design-system-next 2.12.1 → 2.12.6
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 +8040 -8213
- 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/App.vue +49 -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 +71 -64
- package/src/components/avatar/avatar.vue +10 -5
- package/src/components/avatar/use-avatar.ts +14 -3
- 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/calendar/calendar.ts +12 -2
- package/src/components/card/card.ts +52 -52
- package/src/components/checkbox/checkbox.ts +45 -45
- package/src/components/chips/chips.ts +101 -95
- package/src/components/chips/use-chips.ts +11 -3
- 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/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/sidenav/sidenav.ts +5 -4
- package/src/components/sidenav/sidenav.vue +66 -50
- package/src/components/sidenav/use-sidenav.ts +29 -20
- 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 +174 -173
- package/src/components/table/table.vue +2 -2
- package/src/components/table/use-table.ts +13 -8
- 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/stores/useSnackbarStore.ts +44 -44
- package/src/examples/dropdown-number-multi-select.vue +0 -76
- package/src/vite-env.d.ts +0 -6
|
@@ -1,173 +1,174 @@
|
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
export type
|
|
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
|
+
export 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
|
+
customTailwindClasses?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TableData {
|
|
22
|
+
[key: string]: TableDataProps | string | number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TableDataProps {
|
|
26
|
+
title: string | LozengeTitle | ChipTitle | LozengeTitle[] | ChipTitle[];
|
|
27
|
+
subtext?: string;
|
|
28
|
+
image?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface EmptyState {
|
|
33
|
+
description: string;
|
|
34
|
+
subDescription: string;
|
|
35
|
+
image: string;
|
|
36
|
+
size: 'small' | 'large';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface TableActions {
|
|
40
|
+
search: boolean;
|
|
41
|
+
filter: boolean;
|
|
42
|
+
option: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface SortEvent {
|
|
46
|
+
field: string;
|
|
47
|
+
sortOrder: TABLE_SORT;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const TABLE_SORT = ['asc', 'desc'] as const;
|
|
51
|
+
const TABLE_VARIANT = ['surface', 'white'] as const;
|
|
52
|
+
export type TABLE_SORT = (typeof TABLE_SORT)[number];
|
|
53
|
+
|
|
54
|
+
export const tablePropTypes = {
|
|
55
|
+
/**
|
|
56
|
+
* @description Action Column,
|
|
57
|
+
*/
|
|
58
|
+
action: {
|
|
59
|
+
type: Boolean as PropType<boolean>,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* @description Table Values
|
|
64
|
+
*/
|
|
65
|
+
dataTable: {
|
|
66
|
+
type: Array as PropType<TableData[]>,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* @description Table Headers
|
|
71
|
+
*/
|
|
72
|
+
headers: {
|
|
73
|
+
type: Array as PropType<Header[]>,
|
|
74
|
+
required: true,
|
|
75
|
+
default: () => [],
|
|
76
|
+
},
|
|
77
|
+
emptyState: {
|
|
78
|
+
type: Object as PropType<EmptyState>,
|
|
79
|
+
default: () => ({
|
|
80
|
+
description: 'No results found',
|
|
81
|
+
subDescription: 'Try a different search term',
|
|
82
|
+
image: 'location',
|
|
83
|
+
size: 'large',
|
|
84
|
+
}),
|
|
85
|
+
},
|
|
86
|
+
emptyStateCustomClasses: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: ''
|
|
89
|
+
},
|
|
90
|
+
tableActionSlotCustomClasses: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: ''
|
|
93
|
+
},
|
|
94
|
+
loading: {
|
|
95
|
+
type: Boolean as PropType<boolean>,
|
|
96
|
+
default: false,
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @description Table Actions
|
|
101
|
+
*/
|
|
102
|
+
tableActions: {
|
|
103
|
+
type: Object as PropType<TableActions>,
|
|
104
|
+
default: () => ({
|
|
105
|
+
search: false,
|
|
106
|
+
filter: false,
|
|
107
|
+
option: false,
|
|
108
|
+
}),
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @description Search variable
|
|
113
|
+
*
|
|
114
|
+
*/
|
|
115
|
+
searchModel: {
|
|
116
|
+
type: String as PropType<string>,
|
|
117
|
+
default: '',
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
sortOrder: {
|
|
121
|
+
type: String as PropType<(typeof TABLE_SORT)[number]>,
|
|
122
|
+
validator: (value: (typeof TABLE_SORT)[number]) => TABLE_SORT.includes(value),
|
|
123
|
+
default: 'asc'
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
variant: {
|
|
127
|
+
type: String as PropType<(typeof TABLE_VARIANT)[number]>,
|
|
128
|
+
validator: (value: (typeof TABLE_VARIANT)[number]) => TABLE_VARIANT.includes(value),
|
|
129
|
+
default: 'surface',
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
isRowClickable: {
|
|
133
|
+
type: Boolean as PropType<boolean>,
|
|
134
|
+
default: false,
|
|
135
|
+
},
|
|
136
|
+
fullHeight: {
|
|
137
|
+
type: Boolean as PropType<boolean>,
|
|
138
|
+
default: true,
|
|
139
|
+
},
|
|
140
|
+
removeHeaderOnEmpty: {
|
|
141
|
+
type: Boolean as PropType<boolean>,
|
|
142
|
+
default: false,
|
|
143
|
+
},
|
|
144
|
+
isMultiSelect: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: false,
|
|
147
|
+
},
|
|
148
|
+
selectedKeyId: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: '',
|
|
151
|
+
},
|
|
152
|
+
returnCompleteSelectedProperties: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: false,
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export const tableEmitTypes = {
|
|
159
|
+
'update:searchModel': (value: string): value is string => typeof value === 'string',
|
|
160
|
+
onSort: (value: SortEvent): value is SortEvent =>
|
|
161
|
+
typeof value.field === 'string' && TABLE_SORT.includes(value.sortOrder),
|
|
162
|
+
onRowClick: (rowData: TableData, rowKey: number): rowData is TableData =>
|
|
163
|
+
typeof rowData === 'object' && typeof rowKey === 'number',
|
|
164
|
+
onHover: (value: { active: boolean; data: TableData }): value is { active: boolean; data: TableData } =>
|
|
165
|
+
typeof value.active === 'boolean' && typeof value.data === 'object',
|
|
166
|
+
'update:selectedData': (value: (string | number | TableDataProps)[] | TableData[]) =>
|
|
167
|
+
Array.isArray(value) &&
|
|
168
|
+
value.every(
|
|
169
|
+
(item) => (typeof item === 'object' || typeof item === 'string' || typeof item === 'number') && item !== null,
|
|
170
|
+
),
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type TablePropTypes = ExtractPropTypes<typeof tablePropTypes>;
|
|
174
|
+
export type TableEmitTypes = typeof tableEmitTypes;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<table aria-describedby="describe" class="spr-h-full spr-w-full spr-table-fixed" cellspacing="0" cellpadding="0">
|
|
22
22
|
<thead>
|
|
23
23
|
<tr v-if="!(props.removeHeaderOnEmpty && sortedData.length <= 0)">
|
|
24
|
-
<th v-if="props.isMultiSelect" :class="[getTableClasses.multiselectClass, getTableClasses.headerClasses]">
|
|
24
|
+
<th v-if="props.isMultiSelect" :class="[getTableClasses.multiselectClass, getTableClasses.headerClasses(null)]">
|
|
25
25
|
<div class="spr-flex spr-items-center spr-justify-center">
|
|
26
26
|
<spr-checkbox
|
|
27
27
|
label=""
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
/>
|
|
32
32
|
</div>
|
|
33
33
|
</th>
|
|
34
|
-
<th v-for="(header, keyHeader) in headers" :key="keyHeader" :class="[getTableClasses.headerClasses]">
|
|
34
|
+
<th v-for="(header, keyHeader) in headers" :key="keyHeader" :class="[getTableClasses.headerClasses(header)]">
|
|
35
35
|
<div :class="getTableClasses.headerNameClass">
|
|
36
36
|
<span :class="[{ 'spr-cursor-pointer': header.sort }]" @click="header.sort && sortData(header.field)">
|
|
37
37
|
{{ header.name }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, computed, toRefs, Slots, watch } from 'vue';
|
|
2
2
|
|
|
3
|
-
import type { TablePropTypes, TableEmitTypes, TABLE_SORT, TableData, TableDataProps } from './table';
|
|
3
|
+
import type { TablePropTypes, TableEmitTypes, TABLE_SORT, TableData, TableDataProps, Header } from './table';
|
|
4
4
|
import type { SetupContext } from 'vue';
|
|
5
5
|
|
|
6
6
|
import classNames from 'classnames';
|
|
@@ -96,15 +96,20 @@ export const useTable = (props: TablePropTypes, emit: SetupContext<TableEmitType
|
|
|
96
96
|
'spr-background-color': props.variant === 'white',
|
|
97
97
|
'spr-background-color-surface': props.variant === 'surface',
|
|
98
98
|
});
|
|
99
|
-
const headerClasses =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
const headerClasses = (header: Header | null) => {
|
|
100
|
+
if (header?.customTailwindClasses){
|
|
101
|
+
return classNames(header.customTailwindClasses);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return classNames(
|
|
105
|
+
'spr-min-h-12 spr-px-size-spacing-2xs spr-py-size-spacing-3xs',
|
|
106
|
+
'spr-text-color-strong spr-font-size-100 spr-font-line-height-100 spr-font-letter-spacing-normal spr-text-start spr-font-medium spr-uppercase',
|
|
107
|
+
'spr-border-color-weak spr-border-x-0 spr-border-y spr-border-solid',
|
|
108
|
+
{
|
|
109
|
+
'spr-border-t-0': !slots.default,
|
|
105
110
|
},
|
|
106
111
|
headerBackground,
|
|
107
|
-
);
|
|
112
|
+
)};
|
|
108
113
|
|
|
109
114
|
const headerNameClass = 'spr-flex spr-flex-row spr-items-center spr-gap-size-spacing-5xs';
|
|
110
115
|
|
|
@@ -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;
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export const textAreaPropTypes = {
|
|
6
|
-
id: {
|
|
7
|
-
type: String,
|
|
8
|
-
default: '',
|
|
9
|
-
},
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: '',
|
|
13
|
-
},
|
|
14
|
-
label: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: '',
|
|
17
|
-
},
|
|
18
|
-
placeholder: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: '',
|
|
21
|
-
},
|
|
22
|
-
active: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false,
|
|
25
|
-
},
|
|
26
|
-
disabled: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: false,
|
|
29
|
-
},
|
|
30
|
-
readonly: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false,
|
|
33
|
-
},
|
|
34
|
-
error: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false,
|
|
37
|
-
},
|
|
38
|
-
minLength: {
|
|
39
|
-
type: Number,
|
|
40
|
-
},
|
|
41
|
-
maxLength: {
|
|
42
|
-
type: Number,
|
|
43
|
-
},
|
|
44
|
-
rows: {
|
|
45
|
-
type: Number,
|
|
46
|
-
default: 4,
|
|
47
|
-
},
|
|
48
|
-
displayHelper: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false,
|
|
51
|
-
},
|
|
52
|
-
helperIcon: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: null,
|
|
55
|
-
},
|
|
56
|
-
helperText: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: '',
|
|
59
|
-
},
|
|
60
|
-
hasCounter: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const textAreaEmitTypes = {
|
|
67
|
-
'update:modelValue': (value: string) => typeof value === 'string',
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type TextAreaEmitTypes = { 'update:modelValue': typeof textAreaEmitTypes };
|
|
71
|
-
|
|
72
|
-
export type TextAreaPropTypes = ExtractPropTypes<typeof textAreaPropTypes>;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export const textAreaPropTypes = {
|
|
6
|
+
id: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: '',
|
|
9
|
+
},
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '',
|
|
17
|
+
},
|
|
18
|
+
placeholder: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '',
|
|
21
|
+
},
|
|
22
|
+
active: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
readonly: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
|
+
error: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
minLength: {
|
|
39
|
+
type: Number,
|
|
40
|
+
},
|
|
41
|
+
maxLength: {
|
|
42
|
+
type: Number,
|
|
43
|
+
},
|
|
44
|
+
rows: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 4,
|
|
47
|
+
},
|
|
48
|
+
displayHelper: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
helperIcon: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: null,
|
|
55
|
+
},
|
|
56
|
+
helperText: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: '',
|
|
59
|
+
},
|
|
60
|
+
hasCounter: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const textAreaEmitTypes = {
|
|
67
|
+
'update:modelValue': (value: string) => typeof value === 'string',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type TextAreaEmitTypes = { 'update:modelValue': typeof textAreaEmitTypes };
|
|
71
|
+
|
|
72
|
+
export type TextAreaPropTypes = ExtractPropTypes<typeof textAreaPropTypes>;
|