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.
Files changed (90) hide show
  1. package/dist/design-system-next.es.js +8040 -8213
  2. package/dist/design-system-next.es.js.gz +0 -0
  3. package/dist/design-system-next.umd.js +12 -12
  4. package/dist/design-system-next.umd.js.gz +0 -0
  5. package/dist/main.css +1 -1
  6. package/dist/main.css.gz +0 -0
  7. package/dist/package.json.d.ts +1 -1
  8. package/package.json +1 -1
  9. package/src/App.vue +49 -1
  10. package/src/assets/scripts/border-radius.ts +15 -15
  11. package/src/assets/scripts/colors.ts +134 -134
  12. package/src/assets/scripts/max-width.ts +11 -11
  13. package/src/assets/scripts/spacing.ts +23 -23
  14. package/src/assets/scripts/utilities.ts +15 -15
  15. package/src/components/accordion/accordion.ts +43 -43
  16. package/src/components/accordion/use-accordion.ts +43 -43
  17. package/src/components/avatar/avatar.ts +71 -64
  18. package/src/components/avatar/avatar.vue +10 -5
  19. package/src/components/avatar/use-avatar.ts +14 -3
  20. package/src/components/badge/badge.ts +43 -43
  21. package/src/components/banner/banner.ts +20 -20
  22. package/src/components/button/button.ts +72 -72
  23. package/src/components/button/button.vue +15 -15
  24. package/src/components/calendar/calendar.ts +12 -2
  25. package/src/components/card/card.ts +52 -52
  26. package/src/components/checkbox/checkbox.ts +45 -45
  27. package/src/components/chips/chips.ts +101 -95
  28. package/src/components/chips/use-chips.ts +11 -3
  29. package/src/components/collapsible/collapsible.ts +21 -21
  30. package/src/components/collapsible/collapsible.vue +27 -27
  31. package/src/components/date-picker/__tests__/date-picker.test.ts +112 -112
  32. package/src/components/date-picker/date-picker.ts +157 -157
  33. package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
  34. package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
  35. package/src/components/dropdown/fix-multi-number.ts +92 -92
  36. package/src/components/dropdown/use-dropdown.ts +488 -488
  37. package/src/components/empty-state/empty-state.ts +50 -50
  38. package/src/components/file-upload/file-upload.ts +87 -87
  39. package/src/components/floating-action/floating-action.ts +12 -12
  40. package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
  41. package/src/components/input/input-email/input-email.vue +17 -17
  42. package/src/components/input/input-password/use-input-password.ts +19 -19
  43. package/src/components/input/input-search/input-search.vue +13 -13
  44. package/src/components/input/input-url/input-url.vue +20 -20
  45. package/src/components/input/input-username/input-username.vue +17 -17
  46. package/src/components/input/input.vue +72 -72
  47. package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
  48. package/src/components/logo/logo.ts +43 -43
  49. package/src/components/logo/logo.vue +14 -14
  50. package/src/components/logo/use-logo.ts +41 -41
  51. package/src/components/modal/modal.ts +45 -45
  52. package/src/components/progress-bar/progress-bar.ts +39 -39
  53. package/src/components/radio/radio.ts +42 -42
  54. package/src/components/select/select.ts +144 -144
  55. package/src/components/sidenav/sidenav.ts +5 -4
  56. package/src/components/sidenav/sidenav.vue +66 -50
  57. package/src/components/sidenav/use-sidenav.ts +29 -20
  58. package/src/components/sidepanel/sidepanel.vue +55 -55
  59. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
  60. package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
  61. package/src/components/slider/slider.ts +38 -38
  62. package/src/components/snackbar/snack/snack.ts +71 -71
  63. package/src/components/snackbar/use-snackbar.ts +34 -34
  64. package/src/components/status/status.ts +19 -19
  65. package/src/components/status/status.vue +13 -13
  66. package/src/components/stepper/step/step.ts +47 -47
  67. package/src/components/stepper/stepper.ts +47 -47
  68. package/src/components/stepper/stepper.vue +34 -34
  69. package/src/components/switch/switch.ts +42 -42
  70. package/src/components/table/table-actions/table-actions.ts +42 -42
  71. package/src/components/table/table-actions/table-actions.vue +40 -40
  72. package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
  73. package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
  74. package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
  75. package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
  76. package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
  77. package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
  78. package/src/components/table/table-pagination/table-pagination.ts +63 -63
  79. package/src/components/table/table-pagination/table-pagination.vue +72 -72
  80. package/src/components/table/table.ts +174 -173
  81. package/src/components/table/table.vue +2 -2
  82. package/src/components/table/use-table.ts +13 -8
  83. package/src/components/tabs/tabs.ts +43 -43
  84. package/src/components/textarea/textarea.ts +72 -72
  85. package/src/components/textarea/textarea.vue +45 -45
  86. package/src/components/time-picker/time-picker.ts +69 -69
  87. package/src/components/tooltip/use-tooltip.ts +13 -13
  88. package/src/stores/useSnackbarStore.ts +44 -44
  89. package/src/examples/dropdown-number-multi-select.vue +0 -76
  90. 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
- 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
+ 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 = classNames(
100
- 'spr-min-h-12 spr-px-size-spacing-2xs spr-py-size-spacing-3xs',
101
- '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',
102
- 'spr-border-color-weak spr-border-x-0 spr-border-y spr-border-solid',
103
- {
104
- 'spr-border-t-0': !slots.default,
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>;