design-system-next 2.11.22 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design-system-next.es.js +6328 -6212
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +12 -12
- package/dist/design-system-next.umd.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/dist/package.json.d.ts +1 -1
- package/package.json +1 -1
- package/src/assets/scripts/border-radius.ts +15 -15
- package/src/assets/scripts/colors.ts +134 -134
- package/src/assets/scripts/max-width.ts +11 -11
- package/src/assets/scripts/spacing.ts +23 -23
- package/src/assets/scripts/utilities.ts +15 -15
- package/src/components/accordion/accordion.ts +43 -43
- package/src/components/accordion/use-accordion.ts +43 -43
- package/src/components/avatar/avatar.ts +64 -64
- package/src/components/badge/badge.ts +43 -43
- package/src/components/banner/banner.ts +20 -20
- package/src/components/button/button.ts +72 -72
- package/src/components/button/button.vue +15 -15
- package/src/components/card/card.ts +52 -52
- package/src/components/checkbox/checkbox.ts +45 -45
- package/src/components/chips/chips.ts +95 -95
- package/src/components/collapsible/collapsible.ts +21 -21
- package/src/components/collapsible/collapsible.vue +27 -27
- package/src/components/date-picker/__tests__/date-picker.test.ts +112 -112
- package/src/components/date-picker/date-picker.ts +157 -157
- package/src/components/date-picker/date-picker.vue +60 -53
- package/src/components/date-picker/use-date-picker.ts +6 -0
- package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
- package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
- package/src/components/dropdown/fix-multi-number.ts +92 -92
- package/src/components/dropdown/use-dropdown.ts +488 -488
- package/src/components/empty-state/empty-state.ts +50 -50
- package/src/components/file-upload/file-upload.ts +87 -87
- package/src/components/floating-action/floating-action.ts +12 -12
- package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
- package/src/components/input/input-email/input-email.vue +17 -17
- package/src/components/input/input-password/use-input-password.ts +19 -19
- package/src/components/input/input-search/input-search.vue +13 -13
- package/src/components/input/input-url/input-url.vue +20 -20
- package/src/components/input/input-username/input-username.vue +17 -17
- package/src/components/input/input.vue +72 -72
- package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
- package/src/components/logo/logo.ts +43 -43
- package/src/components/logo/logo.vue +14 -14
- package/src/components/logo/use-logo.ts +41 -41
- package/src/components/modal/modal.ts +45 -45
- package/src/components/progress-bar/progress-bar.ts +39 -39
- package/src/components/radio/radio.ts +42 -42
- package/src/components/select/select.ts +144 -144
- package/src/components/sidepanel/sidepanel.vue +55 -55
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
- package/src/components/slider/slider.ts +38 -38
- package/src/components/snackbar/snack/snack.ts +71 -71
- package/src/components/snackbar/use-snackbar.ts +34 -34
- package/src/components/status/status.ts +19 -19
- package/src/components/status/status.vue +13 -13
- package/src/components/stepper/step/step.ts +47 -47
- package/src/components/stepper/stepper.ts +47 -47
- package/src/components/stepper/stepper.vue +34 -34
- package/src/components/switch/switch.ts +42 -42
- package/src/components/table/table-actions/table-actions.ts +42 -42
- package/src/components/table/table-actions/table-actions.vue +40 -40
- package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
- package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
- package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
- package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
- package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
- package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
- package/src/components/table/table-pagination/table-pagination.ts +63 -63
- package/src/components/table/table-pagination/table-pagination.vue +72 -72
- package/src/components/table/table.ts +173 -173
- package/src/components/tabs/tabs.ts +43 -43
- package/src/components/textarea/textarea.ts +72 -72
- package/src/components/textarea/textarea.vue +45 -45
- package/src/components/time-picker/time-picker.ts +69 -69
- package/src/components/tooltip/use-tooltip.ts +13 -13
- package/src/examples/dropdown-number-multi-select.vue +76 -76
- package/src/stores/useSnackbarStore.ts +44 -44
- package/src/vite-env.d.ts +6 -0
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="paginationClasses.baseClass">
|
|
3
|
-
<spr-dropdown
|
|
4
|
-
:id="dropdownId"
|
|
5
|
-
:menu-list="dropdownSelection"
|
|
6
|
-
dropdown-type="single-select"
|
|
7
|
-
placement="bottom"
|
|
8
|
-
:class="paginationClasses.dropdownClass"
|
|
9
|
-
@update:model-value="handleSelectedItem"
|
|
10
|
-
>
|
|
11
|
-
<spr-input v-model="computeSelectedRowCount" :class="paginationClasses.dropdownInputFieldClass" :readonly="true">
|
|
12
|
-
<template #icon>
|
|
13
|
-
<Icon icon="ph:caret-down-bold" :class="paginationClasses.inputFieldIconClass" />
|
|
14
|
-
</template>
|
|
15
|
-
</spr-input>
|
|
16
|
-
</spr-dropdown>
|
|
17
|
-
|
|
18
|
-
<div :class="paginationClasses.rightSideClass">
|
|
19
|
-
<div :class="paginationClasses.computeRowRangeClass">
|
|
20
|
-
{{ computeRowRange }}
|
|
21
|
-
</div>
|
|
22
|
-
<div :class="paginationClasses.navigationContainerClass">
|
|
23
|
-
<spr-button
|
|
24
|
-
id="previousButton"
|
|
25
|
-
has-icon
|
|
26
|
-
:class="paginationClasses.navigationButtonClass"
|
|
27
|
-
:disabled="disabledNext"
|
|
28
|
-
@click="previous"
|
|
29
|
-
>
|
|
30
|
-
<Icon icon="ph:caret-left" />
|
|
31
|
-
</spr-button>
|
|
32
|
-
<spr-button
|
|
33
|
-
id="nextButton"
|
|
34
|
-
has-icon
|
|
35
|
-
:class="paginationClasses.navigationButtonClass"
|
|
36
|
-
:disabled="disabledPrevious"
|
|
37
|
-
@click="next"
|
|
38
|
-
>
|
|
39
|
-
<Icon icon="ph:caret-right" />
|
|
40
|
-
</spr-button>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<script setup lang="ts">
|
|
47
|
-
import { Icon } from '@iconify/vue';
|
|
48
|
-
|
|
49
|
-
import { tablePaginationEmitTypes, tablePaginationPropTypes } from './table-pagination';
|
|
50
|
-
import { useTablePagination } from './use-table-pagination';
|
|
51
|
-
|
|
52
|
-
import SprInput from '@/components/input/input.vue';
|
|
53
|
-
import SprButton from '@/components/button/button.vue';
|
|
54
|
-
import SprDropdown from '@/components/dropdown/dropdown.vue';
|
|
55
|
-
|
|
56
|
-
const emit = defineEmits(tablePaginationEmitTypes);
|
|
57
|
-
|
|
58
|
-
const props = defineProps(tablePaginationPropTypes);
|
|
59
|
-
|
|
60
|
-
const {
|
|
61
|
-
paginationClasses,
|
|
62
|
-
handleSelectedItem,
|
|
63
|
-
computeRowRange,
|
|
64
|
-
computeSelectedRowCount,
|
|
65
|
-
next,
|
|
66
|
-
previous,
|
|
67
|
-
disabledNext,
|
|
68
|
-
disabledPrevious,
|
|
69
|
-
dropdownSelection,
|
|
70
|
-
dropdownId,
|
|
71
|
-
} = useTablePagination(props, emit);
|
|
72
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="paginationClasses.baseClass">
|
|
3
|
+
<spr-dropdown
|
|
4
|
+
:id="dropdownId"
|
|
5
|
+
:menu-list="dropdownSelection"
|
|
6
|
+
dropdown-type="single-select"
|
|
7
|
+
placement="bottom"
|
|
8
|
+
:class="paginationClasses.dropdownClass"
|
|
9
|
+
@update:model-value="handleSelectedItem"
|
|
10
|
+
>
|
|
11
|
+
<spr-input v-model="computeSelectedRowCount" :class="paginationClasses.dropdownInputFieldClass" :readonly="true">
|
|
12
|
+
<template #icon>
|
|
13
|
+
<Icon icon="ph:caret-down-bold" :class="paginationClasses.inputFieldIconClass" />
|
|
14
|
+
</template>
|
|
15
|
+
</spr-input>
|
|
16
|
+
</spr-dropdown>
|
|
17
|
+
|
|
18
|
+
<div :class="paginationClasses.rightSideClass">
|
|
19
|
+
<div :class="paginationClasses.computeRowRangeClass">
|
|
20
|
+
{{ computeRowRange }}
|
|
21
|
+
</div>
|
|
22
|
+
<div :class="paginationClasses.navigationContainerClass">
|
|
23
|
+
<spr-button
|
|
24
|
+
id="previousButton"
|
|
25
|
+
has-icon
|
|
26
|
+
:class="paginationClasses.navigationButtonClass"
|
|
27
|
+
:disabled="disabledNext"
|
|
28
|
+
@click="previous"
|
|
29
|
+
>
|
|
30
|
+
<Icon icon="ph:caret-left" />
|
|
31
|
+
</spr-button>
|
|
32
|
+
<spr-button
|
|
33
|
+
id="nextButton"
|
|
34
|
+
has-icon
|
|
35
|
+
:class="paginationClasses.navigationButtonClass"
|
|
36
|
+
:disabled="disabledPrevious"
|
|
37
|
+
@click="next"
|
|
38
|
+
>
|
|
39
|
+
<Icon icon="ph:caret-right" />
|
|
40
|
+
</spr-button>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script setup lang="ts">
|
|
47
|
+
import { Icon } from '@iconify/vue';
|
|
48
|
+
|
|
49
|
+
import { tablePaginationEmitTypes, tablePaginationPropTypes } from './table-pagination';
|
|
50
|
+
import { useTablePagination } from './use-table-pagination';
|
|
51
|
+
|
|
52
|
+
import SprInput from '@/components/input/input.vue';
|
|
53
|
+
import SprButton from '@/components/button/button.vue';
|
|
54
|
+
import SprDropdown from '@/components/dropdown/dropdown.vue';
|
|
55
|
+
|
|
56
|
+
const emit = defineEmits(tablePaginationEmitTypes);
|
|
57
|
+
|
|
58
|
+
const props = defineProps(tablePaginationPropTypes);
|
|
59
|
+
|
|
60
|
+
const {
|
|
61
|
+
paginationClasses,
|
|
62
|
+
handleSelectedItem,
|
|
63
|
+
computeRowRange,
|
|
64
|
+
computeSelectedRowCount,
|
|
65
|
+
next,
|
|
66
|
+
previous,
|
|
67
|
+
disabledNext,
|
|
68
|
+
disabledPrevious,
|
|
69
|
+
dropdownSelection,
|
|
70
|
+
dropdownId,
|
|
71
|
+
} = useTablePagination(props, emit);
|
|
72
|
+
</script>
|
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { ChipTitle } from '@/components/table/table-chips-title/table-chips-title';
|
|
3
|
-
import type { LozengeTitle } from '@/components/table/table-lozenge-title/table-lozenge-title';
|
|
4
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
5
|
-
|
|
6
|
-
interface Header {
|
|
7
|
-
field: string;
|
|
8
|
-
name: string;
|
|
9
|
-
sort: boolean;
|
|
10
|
-
hasAvatar: boolean;
|
|
11
|
-
hasIcon: boolean;
|
|
12
|
-
hasSubtext: boolean;
|
|
13
|
-
hasLozengeTitle: boolean;
|
|
14
|
-
hasChipTitle: boolean;
|
|
15
|
-
badgeText: string;
|
|
16
|
-
badgeVariant: string;
|
|
17
|
-
avatarVariant: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface TableData {
|
|
21
|
-
[key: string]: TableDataProps | string | number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface TableDataProps {
|
|
25
|
-
title: string | LozengeTitle | ChipTitle | LozengeTitle[] | ChipTitle[];
|
|
26
|
-
subtext?: string;
|
|
27
|
-
image?: string;
|
|
28
|
-
icon?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface EmptyState {
|
|
32
|
-
description: string;
|
|
33
|
-
subDescription: string;
|
|
34
|
-
image: string;
|
|
35
|
-
size: 'small' | 'large';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface TableActions {
|
|
39
|
-
search: boolean;
|
|
40
|
-
filter: boolean;
|
|
41
|
-
option: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface SortEvent {
|
|
45
|
-
field: string;
|
|
46
|
-
sortOrder: TABLE_SORT;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const TABLE_SORT = ['asc', 'desc'] as const;
|
|
50
|
-
const TABLE_VARIANT = ['surface', 'white'] as const;
|
|
51
|
-
export type TABLE_SORT = (typeof TABLE_SORT)[number];
|
|
52
|
-
|
|
53
|
-
export const tablePropTypes = {
|
|
54
|
-
/**
|
|
55
|
-
* @description Action Column,
|
|
56
|
-
*/
|
|
57
|
-
action: {
|
|
58
|
-
type: Boolean as PropType<boolean>,
|
|
59
|
-
default: false,
|
|
60
|
-
},
|
|
61
|
-
/**
|
|
62
|
-
* @description Table Values
|
|
63
|
-
*/
|
|
64
|
-
dataTable: {
|
|
65
|
-
type: Array as PropType<TableData[]>,
|
|
66
|
-
default: false,
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* @description Table Headers
|
|
70
|
-
*/
|
|
71
|
-
headers: {
|
|
72
|
-
type: Array as PropType<Header[]>,
|
|
73
|
-
required: true,
|
|
74
|
-
default: () => [],
|
|
75
|
-
},
|
|
76
|
-
emptyState: {
|
|
77
|
-
type: Object as PropType<EmptyState>,
|
|
78
|
-
default: () => ({
|
|
79
|
-
description: 'No results found',
|
|
80
|
-
subDescription: 'Try a different search term',
|
|
81
|
-
image: 'location',
|
|
82
|
-
size: 'large',
|
|
83
|
-
}),
|
|
84
|
-
},
|
|
85
|
-
emptyStateCustomClasses: {
|
|
86
|
-
type: String,
|
|
87
|
-
default: ''
|
|
88
|
-
},
|
|
89
|
-
tableActionSlotCustomClasses: {
|
|
90
|
-
type: String,
|
|
91
|
-
default: ''
|
|
92
|
-
},
|
|
93
|
-
loading: {
|
|
94
|
-
type: Boolean as PropType<boolean>,
|
|
95
|
-
default: false,
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @description Table Actions
|
|
100
|
-
*/
|
|
101
|
-
tableActions: {
|
|
102
|
-
type: Object as PropType<TableActions>,
|
|
103
|
-
default: () => ({
|
|
104
|
-
search: false,
|
|
105
|
-
filter: false,
|
|
106
|
-
option: false,
|
|
107
|
-
}),
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @description Search variable
|
|
112
|
-
*
|
|
113
|
-
*/
|
|
114
|
-
searchModel: {
|
|
115
|
-
type: String as PropType<string>,
|
|
116
|
-
default: '',
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
sortOrder: {
|
|
120
|
-
type: String as PropType<(typeof TABLE_SORT)[number]>,
|
|
121
|
-
validator: (value: (typeof TABLE_SORT)[number]) => TABLE_SORT.includes(value),
|
|
122
|
-
default: 'asc'
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
variant: {
|
|
126
|
-
type: String as PropType<(typeof TABLE_VARIANT)[number]>,
|
|
127
|
-
validator: (value: (typeof TABLE_VARIANT)[number]) => TABLE_VARIANT.includes(value),
|
|
128
|
-
default: 'surface',
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
isRowClickable: {
|
|
132
|
-
type: Boolean as PropType<boolean>,
|
|
133
|
-
default: false,
|
|
134
|
-
},
|
|
135
|
-
fullHeight: {
|
|
136
|
-
type: Boolean as PropType<boolean>,
|
|
137
|
-
default: true,
|
|
138
|
-
},
|
|
139
|
-
removeHeaderOnEmpty: {
|
|
140
|
-
type: Boolean as PropType<boolean>,
|
|
141
|
-
default: false,
|
|
142
|
-
},
|
|
143
|
-
isMultiSelect: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: false,
|
|
146
|
-
},
|
|
147
|
-
selectedKeyId: {
|
|
148
|
-
type: String,
|
|
149
|
-
default: '',
|
|
150
|
-
},
|
|
151
|
-
returnCompleteSelectedProperties: {
|
|
152
|
-
type: Boolean,
|
|
153
|
-
default: false,
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const tableEmitTypes = {
|
|
158
|
-
'update:searchModel': (value: string): value is string => typeof value === 'string',
|
|
159
|
-
onSort: (value: SortEvent): value is SortEvent =>
|
|
160
|
-
typeof value.field === 'string' && TABLE_SORT.includes(value.sortOrder),
|
|
161
|
-
onRowClick: (rowData: TableData, rowKey: number): rowData is TableData =>
|
|
162
|
-
typeof rowData === 'object' && typeof rowKey === 'number',
|
|
163
|
-
onHover: (value: { active: boolean; data: TableData }): value is { active: boolean; data: TableData } =>
|
|
164
|
-
typeof value.active === 'boolean' && typeof value.data === 'object',
|
|
165
|
-
'update:selectedData': (value: (string | number | TableDataProps)[] | TableData[]) =>
|
|
166
|
-
Array.isArray(value) &&
|
|
167
|
-
value.every(
|
|
168
|
-
(item) => (typeof item === 'object' || typeof item === 'string' || typeof item === 'number') && item !== null,
|
|
169
|
-
),
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export type TablePropTypes = ExtractPropTypes<typeof tablePropTypes>;
|
|
173
|
-
export type TableEmitTypes = typeof tableEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
import type { ChipTitle } from '@/components/table/table-chips-title/table-chips-title';
|
|
3
|
+
import type { LozengeTitle } from '@/components/table/table-lozenge-title/table-lozenge-title';
|
|
4
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
5
|
+
|
|
6
|
+
interface Header {
|
|
7
|
+
field: string;
|
|
8
|
+
name: string;
|
|
9
|
+
sort: boolean;
|
|
10
|
+
hasAvatar: boolean;
|
|
11
|
+
hasIcon: boolean;
|
|
12
|
+
hasSubtext: boolean;
|
|
13
|
+
hasLozengeTitle: boolean;
|
|
14
|
+
hasChipTitle: boolean;
|
|
15
|
+
badgeText: string;
|
|
16
|
+
badgeVariant: string;
|
|
17
|
+
avatarVariant: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface TableData {
|
|
21
|
+
[key: string]: TableDataProps | string | number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TableDataProps {
|
|
25
|
+
title: string | LozengeTitle | ChipTitle | LozengeTitle[] | ChipTitle[];
|
|
26
|
+
subtext?: string;
|
|
27
|
+
image?: string;
|
|
28
|
+
icon?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface EmptyState {
|
|
32
|
+
description: string;
|
|
33
|
+
subDescription: string;
|
|
34
|
+
image: string;
|
|
35
|
+
size: 'small' | 'large';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface TableActions {
|
|
39
|
+
search: boolean;
|
|
40
|
+
filter: boolean;
|
|
41
|
+
option: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface SortEvent {
|
|
45
|
+
field: string;
|
|
46
|
+
sortOrder: TABLE_SORT;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const TABLE_SORT = ['asc', 'desc'] as const;
|
|
50
|
+
const TABLE_VARIANT = ['surface', 'white'] as const;
|
|
51
|
+
export type TABLE_SORT = (typeof TABLE_SORT)[number];
|
|
52
|
+
|
|
53
|
+
export const tablePropTypes = {
|
|
54
|
+
/**
|
|
55
|
+
* @description Action Column,
|
|
56
|
+
*/
|
|
57
|
+
action: {
|
|
58
|
+
type: Boolean as PropType<boolean>,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* @description Table Values
|
|
63
|
+
*/
|
|
64
|
+
dataTable: {
|
|
65
|
+
type: Array as PropType<TableData[]>,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* @description Table Headers
|
|
70
|
+
*/
|
|
71
|
+
headers: {
|
|
72
|
+
type: Array as PropType<Header[]>,
|
|
73
|
+
required: true,
|
|
74
|
+
default: () => [],
|
|
75
|
+
},
|
|
76
|
+
emptyState: {
|
|
77
|
+
type: Object as PropType<EmptyState>,
|
|
78
|
+
default: () => ({
|
|
79
|
+
description: 'No results found',
|
|
80
|
+
subDescription: 'Try a different search term',
|
|
81
|
+
image: 'location',
|
|
82
|
+
size: 'large',
|
|
83
|
+
}),
|
|
84
|
+
},
|
|
85
|
+
emptyStateCustomClasses: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: ''
|
|
88
|
+
},
|
|
89
|
+
tableActionSlotCustomClasses: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: ''
|
|
92
|
+
},
|
|
93
|
+
loading: {
|
|
94
|
+
type: Boolean as PropType<boolean>,
|
|
95
|
+
default: false,
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @description Table Actions
|
|
100
|
+
*/
|
|
101
|
+
tableActions: {
|
|
102
|
+
type: Object as PropType<TableActions>,
|
|
103
|
+
default: () => ({
|
|
104
|
+
search: false,
|
|
105
|
+
filter: false,
|
|
106
|
+
option: false,
|
|
107
|
+
}),
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @description Search variable
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
searchModel: {
|
|
115
|
+
type: String as PropType<string>,
|
|
116
|
+
default: '',
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
sortOrder: {
|
|
120
|
+
type: String as PropType<(typeof TABLE_SORT)[number]>,
|
|
121
|
+
validator: (value: (typeof TABLE_SORT)[number]) => TABLE_SORT.includes(value),
|
|
122
|
+
default: 'asc'
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
variant: {
|
|
126
|
+
type: String as PropType<(typeof TABLE_VARIANT)[number]>,
|
|
127
|
+
validator: (value: (typeof TABLE_VARIANT)[number]) => TABLE_VARIANT.includes(value),
|
|
128
|
+
default: 'surface',
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
isRowClickable: {
|
|
132
|
+
type: Boolean as PropType<boolean>,
|
|
133
|
+
default: false,
|
|
134
|
+
},
|
|
135
|
+
fullHeight: {
|
|
136
|
+
type: Boolean as PropType<boolean>,
|
|
137
|
+
default: true,
|
|
138
|
+
},
|
|
139
|
+
removeHeaderOnEmpty: {
|
|
140
|
+
type: Boolean as PropType<boolean>,
|
|
141
|
+
default: false,
|
|
142
|
+
},
|
|
143
|
+
isMultiSelect: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: false,
|
|
146
|
+
},
|
|
147
|
+
selectedKeyId: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: '',
|
|
150
|
+
},
|
|
151
|
+
returnCompleteSelectedProperties: {
|
|
152
|
+
type: Boolean,
|
|
153
|
+
default: false,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const tableEmitTypes = {
|
|
158
|
+
'update:searchModel': (value: string): value is string => typeof value === 'string',
|
|
159
|
+
onSort: (value: SortEvent): value is SortEvent =>
|
|
160
|
+
typeof value.field === 'string' && TABLE_SORT.includes(value.sortOrder),
|
|
161
|
+
onRowClick: (rowData: TableData, rowKey: number): rowData is TableData =>
|
|
162
|
+
typeof rowData === 'object' && typeof rowKey === 'number',
|
|
163
|
+
onHover: (value: { active: boolean; data: TableData }): value is { active: boolean; data: TableData } =>
|
|
164
|
+
typeof value.active === 'boolean' && typeof value.data === 'object',
|
|
165
|
+
'update:selectedData': (value: (string | number | TableDataProps)[] | TableData[]) =>
|
|
166
|
+
Array.isArray(value) &&
|
|
167
|
+
value.every(
|
|
168
|
+
(item) => (typeof item === 'object' || typeof item === 'string' || typeof item === 'number') && item !== null,
|
|
169
|
+
),
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export type TablePropTypes = ExtractPropTypes<typeof tablePropTypes>;
|
|
173
|
+
export type TableEmitTypes = typeof tableEmitTypes;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes, Component } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
type List = {
|
|
6
|
-
label: string;
|
|
7
|
-
icon?: string;
|
|
8
|
-
iconFill?: Component;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const tabsPropTypes = {
|
|
13
|
-
/**
|
|
14
|
-
* @description Tabs List,
|
|
15
|
-
* option list: label, icon, iconFill, disabled
|
|
16
|
-
*/
|
|
17
|
-
list: {
|
|
18
|
-
type: Array<List>,
|
|
19
|
-
default: () => [],
|
|
20
|
-
},
|
|
21
|
-
/**
|
|
22
|
-
* @description Tabs Type (underlined, not underlined)
|
|
23
|
-
*/
|
|
24
|
-
underlined: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
* @description Active Tab
|
|
30
|
-
*/
|
|
31
|
-
activeTab: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: '',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const tabsEmitTypes = {
|
|
38
|
-
tabIndex: (index: number): index is number => typeof index === 'number',
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export type TabsPropTypes = ExtractPropTypes<typeof tabsPropTypes>;
|
|
42
|
-
|
|
43
|
-
export type TabsEmitTypes = typeof tabsEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes, Component } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
type List = {
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
iconFill?: Component;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const tabsPropTypes = {
|
|
13
|
+
/**
|
|
14
|
+
* @description Tabs List,
|
|
15
|
+
* option list: label, icon, iconFill, disabled
|
|
16
|
+
*/
|
|
17
|
+
list: {
|
|
18
|
+
type: Array<List>,
|
|
19
|
+
default: () => [],
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* @description Tabs Type (underlined, not underlined)
|
|
23
|
+
*/
|
|
24
|
+
underlined: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* @description Active Tab
|
|
30
|
+
*/
|
|
31
|
+
activeTab: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: '',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const tabsEmitTypes = {
|
|
38
|
+
tabIndex: (index: number): index is number => typeof index === 'number',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type TabsPropTypes = ExtractPropTypes<typeof tabsPropTypes>;
|
|
42
|
+
|
|
43
|
+
export type TabsEmitTypes = typeof tabsEmitTypes;
|