design-system-next 2.11.17 → 2.11.19
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 +6885 -6987
- 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/assets/styles/tailwind.css +6 -18
- 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/calendar/calendar.ts +89 -89
- 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/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
- package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
- package/src/components/dropdown/dropdown.ts +4 -0
- package/src/components/dropdown/dropdown.vue +2 -0
- 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/list/list.ts +4 -0
- package/src/components/list/list.vue +33 -24
- 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/lozenge/lozenge.ts +61 -61
- 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 +172 -173
- package/src/components/sidenav/sidenav.vue +211 -126
- package/src/components/sidenav/use-sidenav.ts +85 -76
- package/src/components/sidepanel/sidepanel.ts +104 -100
- 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/sidepanel/use-sidepanel.ts +5 -2
- 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/tooltip.ts +44 -46
- package/src/components/tooltip/tooltip.vue +4 -1
- 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 +0 -6
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
// This file contains the fixed version of the handleSelectedItem function
|
|
2
|
-
// for handling multiple primitive number values in dropdowns
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Fixed version of the handleSelectedItem function that properly handles number values in multi-select mode
|
|
6
|
-
* This is designed to be copied into the use-dropdown.ts file
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// Handle selected item for simple list component
|
|
10
|
-
// This function is exported to be used as a reference for implementation
|
|
11
|
-
export const handleSelectedItem = (selectedItems: MenuListType[]) => {
|
|
12
|
-
if (!props.ladderized) {
|
|
13
|
-
// Determine the type of value to emit based on the original data type and multiSelect
|
|
14
|
-
if (multiSelect.value) {
|
|
15
|
-
// For multi-select, always return an array
|
|
16
|
-
const values = selectedItems.map(item => {
|
|
17
|
-
// If we stored the original object, use it
|
|
18
|
-
if ('_originalObject' in item) {
|
|
19
|
-
return item._originalObject;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// For simple types, handle value type conversion properly
|
|
23
|
-
const val = item.value;
|
|
24
|
-
|
|
25
|
-
// If it's already a number, keep it as a number
|
|
26
|
-
if (typeof val === 'number') {
|
|
27
|
-
return val;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// For strings that look like numbers, convert them
|
|
31
|
-
if (typeof val === 'string' && !isNaN(Number(val)) && val.trim() !== '') {
|
|
32
|
-
// Only convert if it looks like a proper number format
|
|
33
|
-
if (/^-?\d+(\.\d+)?$/.test(val)) {
|
|
34
|
-
return Number(val);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Return the original value for all other cases
|
|
39
|
-
return val;
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// Set the dropdown value
|
|
43
|
-
dropdownValue.value = values as (string | number | Record<string, unknown>)[];
|
|
44
|
-
} else {
|
|
45
|
-
// For single-select
|
|
46
|
-
if (selectedItems.length === 0) {
|
|
47
|
-
dropdownValue.value = props.multiSelect ? [] : '';
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const item = selectedItems[0];
|
|
52
|
-
|
|
53
|
-
// If we stored the original object, use it
|
|
54
|
-
if ('_originalObject' in item) {
|
|
55
|
-
dropdownValue.value = item._originalObject as Record<string, unknown>;
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// For simple types, return the value (try to convert number strings to numbers)
|
|
60
|
-
const val = item.value;
|
|
61
|
-
if (typeof val === 'string' && !isNaN(Number(val)) && val.trim() !== '') {
|
|
62
|
-
dropdownValue.value = Number(val);
|
|
63
|
-
} else {
|
|
64
|
-
dropdownValue.value = val;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
} else if (props.ladderized) {
|
|
68
|
-
if (props.searchString !== '') {
|
|
69
|
-
// generate dropdown value if ladderized with search string
|
|
70
|
-
const subvalue = selectedItems[0]?.subvalue;
|
|
71
|
-
const value = selectedItems[0]?.value;
|
|
72
|
-
if (subvalue !== undefined && value !== undefined) {
|
|
73
|
-
dropdownValue.value = [subvalue, value] as [string, string | number];
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
// For regular ladderized dropdown selection without search
|
|
77
|
-
if (selectedItems.length > 0) {
|
|
78
|
-
const item = selectedItems[0];
|
|
79
|
-
// Use the value directly for ladderized items
|
|
80
|
-
if (item && item.value) {
|
|
81
|
-
dropdownValue.value = item.value;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (!multiSelect.value) {
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
dropdownPopperState.value = false;
|
|
90
|
-
}, 10);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
1
|
+
// This file contains the fixed version of the handleSelectedItem function
|
|
2
|
+
// for handling multiple primitive number values in dropdowns
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fixed version of the handleSelectedItem function that properly handles number values in multi-select mode
|
|
6
|
+
* This is designed to be copied into the use-dropdown.ts file
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Handle selected item for simple list component
|
|
10
|
+
// This function is exported to be used as a reference for implementation
|
|
11
|
+
export const handleSelectedItem = (selectedItems: MenuListType[]) => {
|
|
12
|
+
if (!props.ladderized) {
|
|
13
|
+
// Determine the type of value to emit based on the original data type and multiSelect
|
|
14
|
+
if (multiSelect.value) {
|
|
15
|
+
// For multi-select, always return an array
|
|
16
|
+
const values = selectedItems.map(item => {
|
|
17
|
+
// If we stored the original object, use it
|
|
18
|
+
if ('_originalObject' in item) {
|
|
19
|
+
return item._originalObject;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// For simple types, handle value type conversion properly
|
|
23
|
+
const val = item.value;
|
|
24
|
+
|
|
25
|
+
// If it's already a number, keep it as a number
|
|
26
|
+
if (typeof val === 'number') {
|
|
27
|
+
return val;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// For strings that look like numbers, convert them
|
|
31
|
+
if (typeof val === 'string' && !isNaN(Number(val)) && val.trim() !== '') {
|
|
32
|
+
// Only convert if it looks like a proper number format
|
|
33
|
+
if (/^-?\d+(\.\d+)?$/.test(val)) {
|
|
34
|
+
return Number(val);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Return the original value for all other cases
|
|
39
|
+
return val;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Set the dropdown value
|
|
43
|
+
dropdownValue.value = values as (string | number | Record<string, unknown>)[];
|
|
44
|
+
} else {
|
|
45
|
+
// For single-select
|
|
46
|
+
if (selectedItems.length === 0) {
|
|
47
|
+
dropdownValue.value = props.multiSelect ? [] : '';
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const item = selectedItems[0];
|
|
52
|
+
|
|
53
|
+
// If we stored the original object, use it
|
|
54
|
+
if ('_originalObject' in item) {
|
|
55
|
+
dropdownValue.value = item._originalObject as Record<string, unknown>;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// For simple types, return the value (try to convert number strings to numbers)
|
|
60
|
+
const val = item.value;
|
|
61
|
+
if (typeof val === 'string' && !isNaN(Number(val)) && val.trim() !== '') {
|
|
62
|
+
dropdownValue.value = Number(val);
|
|
63
|
+
} else {
|
|
64
|
+
dropdownValue.value = val;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} else if (props.ladderized) {
|
|
68
|
+
if (props.searchString !== '') {
|
|
69
|
+
// generate dropdown value if ladderized with search string
|
|
70
|
+
const subvalue = selectedItems[0]?.subvalue;
|
|
71
|
+
const value = selectedItems[0]?.value;
|
|
72
|
+
if (subvalue !== undefined && value !== undefined) {
|
|
73
|
+
dropdownValue.value = [subvalue, value] as [string, string | number];
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
// For regular ladderized dropdown selection without search
|
|
77
|
+
if (selectedItems.length > 0) {
|
|
78
|
+
const item = selectedItems[0];
|
|
79
|
+
// Use the value directly for ladderized items
|
|
80
|
+
if (item && item.value) {
|
|
81
|
+
dropdownValue.value = item.value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!multiSelect.value) {
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
dropdownPopperState.value = false;
|
|
90
|
+
}, 10);
|
|
91
|
+
}
|
|
92
|
+
};
|