design-system-next 2.9.1 → 2.9.4
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.js +5039 -5074
- package/dist/design-system-next.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 +80 -1
- package/src/components/banner/use-banner.ts +1 -1
- package/src/components/calendar/calendar.vue +7 -2
- package/src/components/calendar/use-calendar.ts +3 -1
- package/src/components/select/select-ladderized/use-select-ladderized.ts +164 -164
- package/src/components/select/select-multiple/select-multiple.ts +9 -3
- package/src/components/select/select-multiple/select-multiple.vue +49 -36
- package/src/components/select/select-multiple/use-select-multiple.ts +18 -5
- package/src/components/select/select.ts +8 -0
- package/src/components/select/select.vue +58 -47
- package/src/components/select/use-select.ts +34 -31
|
@@ -34,6 +34,7 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
|
|
|
34
34
|
const isSelectPopperDisabled = computed(() => disabled.value);
|
|
35
35
|
|
|
36
36
|
// Select Variables
|
|
37
|
+
const selectPopperRef = ref<HTMLDivElement | null>(null);
|
|
37
38
|
const selectModel = useVModel(props, 'modelValue', emit);
|
|
38
39
|
const selectedListItems = ref<MenuListType[]>();
|
|
39
40
|
const selectOptions = ref<MenuListType[]>([]);
|
|
@@ -44,12 +45,6 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
|
|
|
44
45
|
const inputTextBackup = ref<string | number>('');
|
|
45
46
|
const isSearching = ref<boolean>(false);
|
|
46
47
|
|
|
47
|
-
const handleOptionsToggle = () => {
|
|
48
|
-
selectPopperState.value = true;
|
|
49
|
-
|
|
50
|
-
isSearching.value = false;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
48
|
// Normalized value for internal use - always an array
|
|
54
49
|
const normalizedValue = computed(() => {
|
|
55
50
|
// If already an array, use it
|
|
@@ -147,14 +142,6 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
|
|
|
147
142
|
return selectOptions.value.filter((item) => item.text?.toString().toLowerCase().includes(query));
|
|
148
143
|
});
|
|
149
144
|
|
|
150
|
-
watch(
|
|
151
|
-
options,
|
|
152
|
-
() => {
|
|
153
|
-
processOptions();
|
|
154
|
-
},
|
|
155
|
-
{ deep: true },
|
|
156
|
-
);
|
|
157
|
-
|
|
158
145
|
// Search handler: always emit search-string, but only filter locally if local search is enabled
|
|
159
146
|
const handleSearch = () => {
|
|
160
147
|
isSearching.value = true;
|
|
@@ -166,24 +153,12 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
|
|
|
166
153
|
emit('search-string', inputText.value);
|
|
167
154
|
}, 300);
|
|
168
155
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// If user was searching, restore inputText from backup
|
|
173
|
-
if (isSearching.value) {
|
|
174
|
-
inputText.value = inputTextBackup.value;
|
|
175
|
-
}
|
|
156
|
+
// Toggle options popper state
|
|
157
|
+
const handleOptionsToggle = () => {
|
|
158
|
+
selectPopperState.value = !selectPopperState.value;
|
|
176
159
|
|
|
177
160
|
isSearching.value = false;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
useInfiniteScroll(
|
|
181
|
-
selectRef,
|
|
182
|
-
() => {
|
|
183
|
-
emit('infinite-scroll-trigger', true);
|
|
184
|
-
},
|
|
185
|
-
{ distance: 10 },
|
|
186
|
-
);
|
|
161
|
+
};
|
|
187
162
|
|
|
188
163
|
// Handle selected item for simple list component
|
|
189
164
|
const handleSelectedItem = (selectedItems: MenuListType[]) => {
|
|
@@ -336,6 +311,33 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
|
|
|
336
311
|
updateSelectedItemsFromValue();
|
|
337
312
|
});
|
|
338
313
|
|
|
314
|
+
watch(
|
|
315
|
+
options,
|
|
316
|
+
() => {
|
|
317
|
+
processOptions();
|
|
318
|
+
},
|
|
319
|
+
{ deep: true },
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
onClickOutside(selectRef, () => {
|
|
323
|
+
selectPopperState.value = false;
|
|
324
|
+
|
|
325
|
+
// If user was searching, restore inputText from backup
|
|
326
|
+
if (isSearching.value) {
|
|
327
|
+
inputText.value = inputTextBackup.value;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
isSearching.value = false;
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
useInfiniteScroll(
|
|
334
|
+
selectPopperRef,
|
|
335
|
+
() => {
|
|
336
|
+
emit('infinite-scroll-trigger', true);
|
|
337
|
+
},
|
|
338
|
+
{ distance: 10 },
|
|
339
|
+
);
|
|
340
|
+
|
|
339
341
|
onMounted(() => {
|
|
340
342
|
processOptions();
|
|
341
343
|
|
|
@@ -351,8 +353,8 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
|
|
|
351
353
|
return {
|
|
352
354
|
selectClasses,
|
|
353
355
|
selectPopperState,
|
|
354
|
-
handleOptionsToggle,
|
|
355
356
|
selectRef,
|
|
357
|
+
selectPopperRef,
|
|
356
358
|
selectModel: compatPreSelectedItems, // Use compatible format for lists
|
|
357
359
|
selectOptions,
|
|
358
360
|
filteredSelectOptions,
|
|
@@ -360,6 +362,7 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
|
|
|
360
362
|
inputText,
|
|
361
363
|
isSelectPopperDisabled,
|
|
362
364
|
isSearching,
|
|
365
|
+
handleOptionsToggle,
|
|
363
366
|
handleSelectedItem,
|
|
364
367
|
handleSearch,
|
|
365
368
|
handleClear,
|