design-system-next 2.26.2 → 2.26.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.d.ts +95 -68
- package/dist/design-system-next.es.js +5289 -5194
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +11 -11
- package/dist/design-system-next.umd.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/package.json +1 -2
- package/src/components/calendar/calendar.vue +16 -2
- package/src/components/calendar/use-calendar.ts +4 -1
- package/src/components/list/list-item/list-item.ts +60 -60
- package/src/components/list/list.ts +6 -2
- package/src/components/list/list.vue +34 -7
- package/src/components/list/use-list.ts +48 -8
- package/src/components/{radio-grouped → radio/radio-grouped}/radio-grouped.ts +74 -65
- package/src/components/{radio-grouped → radio/radio-grouped}/radio-grouped.vue +4 -1
- package/src/components/{radio-grouped → radio/radio-grouped}/use-radio-grouped.ts +63 -62
- package/src/components/radio/radio.ts +4 -0
- package/src/components/radio/radio.vue +10 -4
- package/src/components/radio/use-radio.ts +16 -2
- package/src/components/select/select-multiple/select-multiple.ts +4 -0
- package/src/components/select/select-multiple/select-multiple.vue +1 -0
- package/src/components/select/select-multiple/use-select-multiple.ts +12 -1
|
@@ -8,6 +8,7 @@ import type { RadioPropTypes, RadioEmitTypes } from './radio';
|
|
|
8
8
|
|
|
9
9
|
interface RadioClasses {
|
|
10
10
|
baseClasses: string;
|
|
11
|
+
baseInputClasses: string;
|
|
11
12
|
baseIndicatorClasses: string;
|
|
12
13
|
labelClasses: string;
|
|
13
14
|
borderedClasses: string;
|
|
@@ -18,13 +19,24 @@ export const useRadioButton = (
|
|
|
18
19
|
emit: SetupContext<RadioEmitTypes>['emit'],
|
|
19
20
|
slots: Record<string, unknown>,
|
|
20
21
|
) => {
|
|
21
|
-
const { modelValue, disabled, description, bordered, fullWidth } = toRefs(props);
|
|
22
|
+
const { modelValue, disabled, description, bordered, fullWidth, choiceBox } = toRefs(props);
|
|
22
23
|
|
|
23
24
|
const radioRef = ref<HTMLInputElement | null>(null);
|
|
24
25
|
const isHovered = useElementHover(radioRef);
|
|
25
26
|
|
|
26
27
|
const radioClasses: ComputedRef<RadioClasses> = computed(() => {
|
|
27
|
-
const baseClasses = classNames('spr-
|
|
28
|
+
const baseClasses = classNames('spr-relative spr-m-0', {
|
|
29
|
+
'spr-inline-block': !choiceBox.value,
|
|
30
|
+
'spr-block': choiceBox.value,
|
|
31
|
+
'spr-w-full': fullWidth.value || choiceBox.value,
|
|
32
|
+
'spr-align-middle': !choiceBox.value,
|
|
33
|
+
'spr-border-color spr-border-color-weak spr-border spr-border-solid spr-p-2 spr-rounded-lg spr-transition spr-ease-in-out spr-duration-150 active:spr-scale-[0.98]':
|
|
34
|
+
choiceBox.value,
|
|
35
|
+
'spr-cursor-pointer': choiceBox.value && !disabled.value,
|
|
36
|
+
'spr-cursor-not-allowed': disabled.value && choiceBox.value,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const baseInputClasses = classNames('spr-sr-only spr-peer spr-inline-block', {
|
|
28
40
|
'spr-cursor-not-allowed': disabled.value,
|
|
29
41
|
});
|
|
30
42
|
|
|
@@ -121,6 +133,7 @@ export const useRadioButton = (
|
|
|
121
133
|
|
|
122
134
|
return {
|
|
123
135
|
baseClasses,
|
|
136
|
+
baseInputClasses,
|
|
124
137
|
baseIndicatorClasses,
|
|
125
138
|
labelClasses,
|
|
126
139
|
borderedClasses,
|
|
@@ -132,6 +145,7 @@ export const useRadioButton = (
|
|
|
132
145
|
return {
|
|
133
146
|
radioRef,
|
|
134
147
|
radioClasses,
|
|
148
|
+
isHovered,
|
|
135
149
|
proxyValue,
|
|
136
150
|
description,
|
|
137
151
|
bordered,
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
:display-list-item-selected="props.displayListItemSelected"
|
|
166
166
|
:disabled-local-search="props.disabledLocalSearch"
|
|
167
167
|
:disabled-unselected-items="props.disabledUnselectedItems"
|
|
168
|
+
:allow-select-all="props.allowSelectAll"
|
|
168
169
|
multi-select
|
|
169
170
|
@update:model-value="handleMultiSelectedItem"
|
|
170
171
|
@get-single-selected-item="emit('get-single-selected-item', $event)"
|
|
@@ -268,8 +268,9 @@ export const useMultiSelect = (props: MultiSelectPropTypes, emit: SetupContext<M
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
// Always keep multiSelectedListItems in sync with selected values
|
|
271
|
+
const seenValues = new Set<string>();
|
|
271
272
|
multiSelectedListItems.value = multiSelectOptions.value.filter((item) => {
|
|
272
|
-
|
|
273
|
+
const isMatch = values.some((val) => {
|
|
273
274
|
let itemVal = item.value;
|
|
274
275
|
let valToCompare = val;
|
|
275
276
|
|
|
@@ -292,6 +293,16 @@ export const useMultiSelect = (props: MultiSelectPropTypes, emit: SetupContext<M
|
|
|
292
293
|
}
|
|
293
294
|
return itemVal == valToCompare;
|
|
294
295
|
});
|
|
296
|
+
|
|
297
|
+
if (isMatch) {
|
|
298
|
+
const itemKey = typeof item.value === 'object' ? JSON.stringify(item.value) : String(item.value);
|
|
299
|
+
if (seenValues.has(itemKey)) {
|
|
300
|
+
return false; // Skip duplicates
|
|
301
|
+
}
|
|
302
|
+
seenValues.add(itemKey);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return isMatch;
|
|
295
306
|
});
|
|
296
307
|
|
|
297
308
|
// Determine input text based on whether count-only mode is enabled
|