mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 17:24:10 +00:00
Migrate all shared components to TypeScript SFCs with script setup lang=ts. 72 files, 7144 lines, zero any types. - components/base/ (42 files): Button, Input, Textarea, Checkbox, Radio, Switch, Badge, Card, Modal, Dialog, Dropdown, DatePicker, TimePicker, Money, FileUploader, Select, Icon, Loader, Multiselect, TabGroup, Wizard, CustomerSelect, ItemSelect, CustomInput, alerts, status badges (Invoice/Estimate/Paid/RecurringInvoice), List/ListItem - components/table/ (3 files): DataTable, TablePagination - components/form/ (4 files): FormGroup, FormGrid, SwitchSection - components/layout/ (11 files): Page, PageHeader, Breadcrumb, FilterWrapper, EmptyPlaceholder, ContentPlaceholders, SettingCard - components/editor/ (2 files): RichEditor with Tiptap - components/charts/ (2 files): LineChart with Chart.js - components/notifications/ (3 files): NotificationRoot, NotificationItem - components/icons/ (2 files): MainLogo All use defineProps<Props>(), defineEmits<Emits>(), typed refs, and import domain types from types/domain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
213 lines
4.7 KiB
Vue
213 lines
4.7 KiB
Vue
<template>
|
|
<div :class="classObject">
|
|
<slot />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
interface Props {
|
|
rounded?: boolean
|
|
centered?: boolean
|
|
animated?: boolean
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
rounded: false,
|
|
centered: false,
|
|
animated: true,
|
|
})
|
|
|
|
const classObject = computed<Record<string, boolean>>(() => {
|
|
return {
|
|
'base-content-placeholders': true,
|
|
'base-content-placeholders-is-rounded': props.rounded,
|
|
'base-content-placeholders-is-centered': props.centered,
|
|
'base-content-placeholders-is-animated': props.animated,
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style>
|
|
@keyframes vueContentPlaceholdersAnimation {
|
|
0% {
|
|
transform: translate3d(-30%, 0, 0);
|
|
}
|
|
100% {
|
|
transform: translate3d(100%, 0, 0);
|
|
}
|
|
}
|
|
|
|
.base-content-placeholders-heading {
|
|
display: flex;
|
|
|
|
[class^='base-content-placeholders-'] + & {
|
|
margin-top: 20px;
|
|
}
|
|
}
|
|
|
|
.base-content-placeholders-heading__img {
|
|
margin-right: 15px;
|
|
position: relative;
|
|
overflow: hidden;
|
|
min-height: 15px;
|
|
background: var(--color-surface-muted);
|
|
|
|
.base-content-placeholders-is-rounded & {
|
|
border-radius: 6px;
|
|
}
|
|
.base-content-placeholders-is-centered & {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
.base-content-placeholders-is-animated &::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
max-width: 1000px;
|
|
height: 100%;
|
|
background: linear-gradient(to right, transparent 0%, var(--color-hover-strong) 15%, transparent 30%);
|
|
animation: vueContentPlaceholdersAnimation 1.5s linear infinite forwards;
|
|
}
|
|
}
|
|
|
|
.base-content-placeholders-heading__content {
|
|
display: flex;
|
|
flex: 1;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
}
|
|
|
|
.base-content-placeholders-heading__title {
|
|
width: 85%;
|
|
margin-bottom: 10px;
|
|
background: var(--color-surface-muted);
|
|
position: relative;
|
|
overflow: hidden;
|
|
min-height: 15px;
|
|
|
|
.base-content-placeholders-is-rounded & {
|
|
border-radius: 6px;
|
|
}
|
|
.base-content-placeholders-is-centered & {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
.base-content-placeholders-is-animated &::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
max-width: 1000px;
|
|
height: 100%;
|
|
background: linear-gradient(to right, transparent 0%, var(--color-hover-strong) 15%, transparent 30%);
|
|
animation: vueContentPlaceholdersAnimation 1.5s linear infinite forwards;
|
|
}
|
|
}
|
|
|
|
.base-content-placeholders-heading__subtitle {
|
|
width: 90%;
|
|
position: relative;
|
|
overflow: hidden;
|
|
min-height: 15px;
|
|
background: var(--color-surface-muted);
|
|
|
|
.base-content-placeholders-is-rounded & {
|
|
border-radius: 6px;
|
|
}
|
|
.base-content-placeholders-is-centered & {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
.base-content-placeholders-is-animated &::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
max-width: 1000px;
|
|
height: 100%;
|
|
background: linear-gradient(to right, transparent 0%, var(--color-hover-strong) 15%, transparent 30%);
|
|
animation: vueContentPlaceholdersAnimation 1.5s linear infinite forwards;
|
|
}
|
|
}
|
|
|
|
.base-content-placeholders-text {
|
|
[class^='base-content-placeholders-'] + & {
|
|
margin-top: 20px;
|
|
}
|
|
}
|
|
|
|
.base-content-placeholders-text__line {
|
|
width: 100%;
|
|
margin-bottom: 10px;
|
|
position: relative;
|
|
overflow: hidden;
|
|
min-height: 15px;
|
|
background: var(--color-surface-muted);
|
|
|
|
.base-content-placeholders-is-rounded & {
|
|
border-radius: 6px;
|
|
}
|
|
.base-content-placeholders-is-centered & {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
.base-content-placeholders-is-animated &::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
max-width: 1000px;
|
|
height: 100%;
|
|
background: linear-gradient(to right, transparent 0%, var(--color-hover-strong) 15%, transparent 30%);
|
|
animation: vueContentPlaceholdersAnimation 1.5s linear infinite forwards;
|
|
}
|
|
|
|
&:first-child {
|
|
width: 100%;
|
|
}
|
|
&:nth-child(2) {
|
|
width: 90%;
|
|
}
|
|
&:nth-child(3) {
|
|
width: 80%;
|
|
}
|
|
&:nth-child(4) {
|
|
width: 70%;
|
|
}
|
|
}
|
|
|
|
.base-content-placeholders-box {
|
|
position: relative;
|
|
overflow: hidden;
|
|
min-height: 15px;
|
|
background: var(--color-surface-muted);
|
|
|
|
.base-content-placeholders-is-animated &::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
max-width: 1000px;
|
|
height: 100%;
|
|
background: linear-gradient(to right, transparent 0%, var(--color-hover-strong) 15%, transparent 30%);
|
|
animation: vueContentPlaceholdersAnimation 1.5s linear infinite forwards;
|
|
}
|
|
}
|
|
|
|
.base-content-circle {
|
|
border-radius: 100%;
|
|
}
|
|
|
|
.base-content-placeholders-is-rounded {
|
|
border-radius: 6px;
|
|
}
|
|
</style>
|