@smilodon/vue 1.9.0 → 1.9.1
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/COMPLETE-GUIDE.md +1 -1
- package/README.md +155 -0
- package/dist/index.cjs +82 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +76 -9
- package/dist/index.js.map +1 -1
- package/dist/types/Select.vue.d.ts +27 -1
- package/dist/types/Select.vue.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +27 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -2
package/COMPLETE-GUIDE.md
CHANGED
|
@@ -890,7 +890,7 @@ const allStyles = {
|
|
|
890
890
|
'--select-dropdown-max-height': '300px',
|
|
891
891
|
'--select-dropdown-border-radius': '4px',
|
|
892
892
|
'--select-dropdown-bg': 'white',
|
|
893
|
-
'--select-dropdown-border': '
|
|
893
|
+
'--select-dropdown-border': '#ccc',
|
|
894
894
|
'--select-dropdown-shadow': '0 4px 6px rgba(0, 0, 0, 0.1)',
|
|
895
895
|
|
|
896
896
|
// Options
|
package/README.md
CHANGED
|
@@ -4,6 +4,10 @@ Production-ready, accessible select component for Vue 3 applications.
|
|
|
4
4
|
|
|
5
5
|
## 📖 Documentation
|
|
6
6
|
|
|
7
|
+
**Live documentation & interactive examples:** [navidrezadoost.github.io/Smilodon](https://navidrezadoost.github.io/Smilodon/)
|
|
8
|
+
|
|
9
|
+
**Framework integration (Vue 3, Nuxt 4, React, SSR, Vite):** [`docs/FRAMEWORK-INTEGRATION.md`](../../docs/FRAMEWORK-INTEGRATION.md)
|
|
10
|
+
|
|
7
11
|
**For comprehensive documentation covering all features, styling options, and advanced patterns:**
|
|
8
12
|
|
|
9
13
|
👉 **[Complete Vue Guide](./COMPLETE-GUIDE.md)** 👈
|
|
@@ -204,6 +208,157 @@ The Vue adapter now exposes the same option-surface controls as the React adapte
|
|
|
204
208
|
- `disabledOptionBehavior` controls whether dimmed options can still be hovered, focused, or selected
|
|
205
209
|
- `showSelectedIndicator` hides or shows the selected side indicator without custom pseudo-element overrides
|
|
206
210
|
|
|
211
|
+
## Core config parity and global defaults
|
|
212
|
+
|
|
213
|
+
The Vue adapter now accepts the shared core config model directly, so Vue consumers can use either adapter-friendly props or the complete `GlobalSelectConfig` shape.
|
|
214
|
+
|
|
215
|
+
### Convenience props
|
|
216
|
+
|
|
217
|
+
Use these props when you want the most common advanced core features with Vue-friendly prop names:
|
|
218
|
+
|
|
219
|
+
- `selectionConfig`
|
|
220
|
+
- `multiSelectDisplay`
|
|
221
|
+
- `scrollToSelected`
|
|
222
|
+
- `styles`
|
|
223
|
+
- `config`
|
|
224
|
+
|
|
225
|
+
```vue
|
|
226
|
+
<script setup lang="ts">
|
|
227
|
+
import { ref } from 'vue';
|
|
228
|
+
import { Select } from '@smilodon/vue';
|
|
229
|
+
|
|
230
|
+
const value = ref<Array<string | number>>(['react', 'solid']);
|
|
231
|
+
const items = [
|
|
232
|
+
{ value: 'react', label: 'React' },
|
|
233
|
+
{ value: 'vue', label: 'Vue' },
|
|
234
|
+
{ value: 'svelte', label: 'Svelte' },
|
|
235
|
+
{ value: 'solid', label: 'Solid' },
|
|
236
|
+
];
|
|
237
|
+
</script>
|
|
238
|
+
|
|
239
|
+
<template>
|
|
240
|
+
<Select
|
|
241
|
+
v-model="value"
|
|
242
|
+
:items="items"
|
|
243
|
+
multiple
|
|
244
|
+
searchable
|
|
245
|
+
:multi-select-display="{
|
|
246
|
+
mode: 'horizontal',
|
|
247
|
+
maxHeight: '56px',
|
|
248
|
+
overflowX: 'auto',
|
|
249
|
+
overflowY: 'hidden',
|
|
250
|
+
dragScroll: true,
|
|
251
|
+
}"
|
|
252
|
+
:selection-config="{
|
|
253
|
+
closeOnSelect: false,
|
|
254
|
+
toggleOnTriggerClick: true,
|
|
255
|
+
}"
|
|
256
|
+
:styles="{
|
|
257
|
+
badgeRemoveIcon: {
|
|
258
|
+
color: '#dc2626',
|
|
259
|
+
transform: 'scale(1.1)',
|
|
260
|
+
},
|
|
261
|
+
}"
|
|
262
|
+
remove-button-icon="−"
|
|
263
|
+
placeholder="Select frameworks"
|
|
264
|
+
/>
|
|
265
|
+
</template>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Full `config` passthrough
|
|
269
|
+
|
|
270
|
+
```vue
|
|
271
|
+
<script setup lang="ts">
|
|
272
|
+
import { ref } from 'vue';
|
|
273
|
+
import { Select } from '@smilodon/vue';
|
|
274
|
+
|
|
275
|
+
const value = ref<Array<string | number>>([]);
|
|
276
|
+
</script>
|
|
277
|
+
|
|
278
|
+
<template>
|
|
279
|
+
<Select
|
|
280
|
+
v-model="value"
|
|
281
|
+
:items="items"
|
|
282
|
+
multiple
|
|
283
|
+
:config="{
|
|
284
|
+
dropdownPlacement: { mode: 'auto' },
|
|
285
|
+
scrollToSelected: {
|
|
286
|
+
enabled: true,
|
|
287
|
+
multiSelectTarget: 'last',
|
|
288
|
+
},
|
|
289
|
+
multiSelectDisplay: {
|
|
290
|
+
mode: 'vertical',
|
|
291
|
+
maxHeight: '120px',
|
|
292
|
+
},
|
|
293
|
+
selection: {
|
|
294
|
+
allowDeselect: true,
|
|
295
|
+
closeOnSelect: false,
|
|
296
|
+
},
|
|
297
|
+
styles: {
|
|
298
|
+
badge: {
|
|
299
|
+
background: '#eff6ff',
|
|
300
|
+
border: '1px solid #bfdbfe',
|
|
301
|
+
color: '#1d4ed8',
|
|
302
|
+
},
|
|
303
|
+
badgeRemoveIcon: {
|
|
304
|
+
color: '#1d4ed8',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
}"
|
|
308
|
+
/>
|
|
309
|
+
</template>
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Global defaults from `@smilodon/vue`
|
|
313
|
+
|
|
314
|
+
The Vue adapter re-exports `configureSelect()`, `resetSelectConfig()`, and `selectConfig`.
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { configureSelect } from '@smilodon/vue';
|
|
318
|
+
|
|
319
|
+
configureSelect({
|
|
320
|
+
searchable: true,
|
|
321
|
+
clearControl: {
|
|
322
|
+
enabled: true,
|
|
323
|
+
clearSelection: true,
|
|
324
|
+
clearSearch: true,
|
|
325
|
+
},
|
|
326
|
+
selection: {
|
|
327
|
+
showSelectedIndicator: false,
|
|
328
|
+
removeButtonIcon: '×',
|
|
329
|
+
},
|
|
330
|
+
multiSelectDisplay: {
|
|
331
|
+
mode: 'wrap',
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Template ref methods
|
|
337
|
+
|
|
338
|
+
The exposed Vue instance now includes additional core-style helpers alongside diagnostics methods.
|
|
339
|
+
|
|
340
|
+
```vue
|
|
341
|
+
<script setup lang="ts">
|
|
342
|
+
import { ref } from 'vue';
|
|
343
|
+
import { Select } from '@smilodon/vue';
|
|
344
|
+
|
|
345
|
+
const selectRef = ref<InstanceType<typeof Select> | null>(null);
|
|
346
|
+
|
|
347
|
+
function applyRuntimeChanges() {
|
|
348
|
+
selectRef.value?.clearSearch();
|
|
349
|
+
selectRef.value?.updateConfig({ selection: { showSelectedIndicator: false } });
|
|
350
|
+
selectRef.value?.setError('Please review this field');
|
|
351
|
+
console.log(selectRef.value?.getSelectedValues());
|
|
352
|
+
console.log(selectRef.value?.validate());
|
|
353
|
+
}
|
|
354
|
+
</script>
|
|
355
|
+
|
|
356
|
+
<template>
|
|
357
|
+
<Select ref="selectRef" :items="items" required searchable />
|
|
358
|
+
<button @click="applyRuntimeChanges">Run runtime actions</button>
|
|
359
|
+
</template>
|
|
360
|
+
```
|
|
361
|
+
|
|
207
362
|
## Examples
|
|
208
363
|
|
|
209
364
|
### Basic Single Select
|
package/dist/index.cjs
CHANGED
|
@@ -23,8 +23,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
25
25
|
const vue = require("vue");
|
|
26
|
+
const core = require("@smilodon/core");
|
|
26
27
|
const _hoisted_1 = ["dir"];
|
|
27
28
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
29
|
+
...{
|
|
30
|
+
inheritAttrs: false
|
|
31
|
+
},
|
|
28
32
|
__name: "Select",
|
|
29
33
|
props: {
|
|
30
34
|
items: { default: () => [] },
|
|
@@ -42,6 +46,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
42
46
|
pageSize: { default: 50 },
|
|
43
47
|
virtualized: { type: Boolean, default: true },
|
|
44
48
|
maxSelections: {},
|
|
49
|
+
selectionConfig: {},
|
|
50
|
+
multiSelectDisplay: {},
|
|
51
|
+
scrollToSelected: {},
|
|
52
|
+
styles: {},
|
|
53
|
+
config: {},
|
|
45
54
|
removeButtonIcon: {},
|
|
46
55
|
disabledOptionBehavior: {},
|
|
47
56
|
showSelectedIndicator: { type: Boolean, default: true },
|
|
@@ -248,7 +257,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
248
257
|
if (newValue !== void 0) {
|
|
249
258
|
const currentSelected = ((_a = el.getSelectedValues) == null ? void 0 : _a.call(el)) || [];
|
|
250
259
|
const newValues = Array.isArray(newValue) ? newValue : [newValue];
|
|
251
|
-
const hasChanged =
|
|
260
|
+
const hasChanged = !core.arraysEqualByValue(currentSelected, newValues);
|
|
252
261
|
if (hasChanged) {
|
|
253
262
|
el.setSelectedValues(newValues);
|
|
254
263
|
}
|
|
@@ -265,17 +274,27 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
265
274
|
enabled: !props.disabled,
|
|
266
275
|
virtualize: props.virtualized,
|
|
267
276
|
direction: props.direction,
|
|
277
|
+
dropdownPlacement: {
|
|
278
|
+
mode: props.placement
|
|
279
|
+
},
|
|
268
280
|
selection: {
|
|
281
|
+
...props.selectionConfig ?? {},
|
|
269
282
|
mode: props.multiple ? "multi" : "single",
|
|
270
283
|
maxSelections: props.maxSelections,
|
|
271
284
|
removeButtonIcon: props.removeButtonIcon,
|
|
272
285
|
disabledOptionBehavior: props.disabledOptionBehavior,
|
|
273
286
|
showSelectedIndicator: props.showSelectedIndicator
|
|
274
287
|
},
|
|
288
|
+
multiSelectDisplay: props.multiSelectDisplay,
|
|
275
289
|
infiniteScroll: {
|
|
276
290
|
enabled: props.infiniteScroll,
|
|
277
291
|
pageSize: props.pageSize
|
|
278
292
|
},
|
|
293
|
+
scrollToSelected: {
|
|
294
|
+
enabled: true,
|
|
295
|
+
...props.scrollToSelected ?? {}
|
|
296
|
+
},
|
|
297
|
+
styles: props.styles,
|
|
279
298
|
expandable: {
|
|
280
299
|
enabled: props.expandable
|
|
281
300
|
},
|
|
@@ -300,6 +319,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
300
319
|
}
|
|
301
320
|
};
|
|
302
321
|
el.updateConfig(config);
|
|
322
|
+
if (props.config) {
|
|
323
|
+
el.updateConfig(props.config);
|
|
324
|
+
}
|
|
303
325
|
});
|
|
304
326
|
};
|
|
305
327
|
vue.watch(
|
|
@@ -471,6 +493,46 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
471
493
|
emit("update:modelValue", value);
|
|
472
494
|
emit("change", value, []);
|
|
473
495
|
},
|
|
496
|
+
/** Get selected items */
|
|
497
|
+
getSelectedItems: () => {
|
|
498
|
+
var _a, _b;
|
|
499
|
+
return ((_b = (_a = selectRef.value) == null ? void 0 : _a.getSelectedItems) == null ? void 0 : _b.call(_a)) || [];
|
|
500
|
+
},
|
|
501
|
+
/** Get selected values */
|
|
502
|
+
getSelectedValues: () => {
|
|
503
|
+
var _a, _b;
|
|
504
|
+
return ((_b = (_a = selectRef.value) == null ? void 0 : _a.getSelectedValues) == null ? void 0 : _b.call(_a)) || [];
|
|
505
|
+
},
|
|
506
|
+
/** Clear current search query */
|
|
507
|
+
clearSearch: () => {
|
|
508
|
+
var _a, _b;
|
|
509
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.clearSearch) == null ? void 0 : _b.call(_a);
|
|
510
|
+
},
|
|
511
|
+
/** Apply partial core config at runtime */
|
|
512
|
+
updateConfig: (config) => {
|
|
513
|
+
var _a, _b;
|
|
514
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.updateConfig) == null ? void 0 : _b.call(_a, config);
|
|
515
|
+
},
|
|
516
|
+
/** Set error state */
|
|
517
|
+
setError: (message) => {
|
|
518
|
+
var _a, _b;
|
|
519
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.setError) == null ? void 0 : _b.call(_a, message);
|
|
520
|
+
},
|
|
521
|
+
/** Clear error state */
|
|
522
|
+
clearError: () => {
|
|
523
|
+
var _a, _b;
|
|
524
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.clearError) == null ? void 0 : _b.call(_a);
|
|
525
|
+
},
|
|
526
|
+
/** Toggle required state */
|
|
527
|
+
setRequired: (required) => {
|
|
528
|
+
var _a, _b;
|
|
529
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.setRequired) == null ? void 0 : _b.call(_a, required);
|
|
530
|
+
},
|
|
531
|
+
/** Validate the component */
|
|
532
|
+
validate: () => {
|
|
533
|
+
var _a, _b;
|
|
534
|
+
return ((_b = (_a = selectRef.value) == null ? void 0 : _a.validate) == null ? void 0 : _b.call(_a)) ?? true;
|
|
535
|
+
},
|
|
474
536
|
/** Runtime capability report */
|
|
475
537
|
getCapabilities: () => {
|
|
476
538
|
var _a, _b;
|
|
@@ -498,13 +560,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
498
560
|
}
|
|
499
561
|
});
|
|
500
562
|
return (_ctx, _cache) => {
|
|
501
|
-
return vue.openBlock(), vue.createElementBlock("enhanced-select", {
|
|
563
|
+
return vue.openBlock(), vue.createElementBlock("enhanced-select", vue.mergeProps({
|
|
502
564
|
ref_key: "selectRef",
|
|
503
|
-
ref: selectRef
|
|
504
|
-
|
|
565
|
+
ref: selectRef
|
|
566
|
+
}, _ctx.$attrs, {
|
|
567
|
+
class: __props.className,
|
|
505
568
|
dir: __props.direction,
|
|
506
|
-
style:
|
|
507
|
-
}, null,
|
|
569
|
+
style: __props.style
|
|
570
|
+
}), null, 16, _hoisted_1);
|
|
508
571
|
};
|
|
509
572
|
}
|
|
510
573
|
});
|
|
@@ -515,7 +578,19 @@ const _export_sfc = (sfc, props) => {
|
|
|
515
578
|
}
|
|
516
579
|
return target;
|
|
517
580
|
};
|
|
518
|
-
const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
581
|
+
const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fd74613f"]]);
|
|
582
|
+
Object.defineProperty(exports, "configureSelect", {
|
|
583
|
+
enumerable: true,
|
|
584
|
+
get: () => core.configureSelect
|
|
585
|
+
});
|
|
586
|
+
Object.defineProperty(exports, "resetSelectConfig", {
|
|
587
|
+
enumerable: true,
|
|
588
|
+
get: () => core.resetSelectConfig
|
|
589
|
+
});
|
|
590
|
+
Object.defineProperty(exports, "selectConfig", {
|
|
591
|
+
enumerable: true,
|
|
592
|
+
get: () => core.selectConfig
|
|
593
|
+
});
|
|
519
594
|
exports.Select = Select;
|
|
520
595
|
exports.default = Select;
|
|
521
596
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/Select.vue"],"sourcesContent":["<!--\n Smilodon Select Component for Vue 3\n \n A production-ready, accessible select component with advanced features:\n - Single and multi-select modes\n - Searchable with client or server-side filtering\n - Infinite scroll and virtual scrolling for large datasets\n - Grouped options\n - Custom rendering\n - Full keyboard navigation\n - WCAG 2.1 AAA compliant\n \n @example\n <Select\n :items=\"items\"\n v-model=\"selectedValue\"\n searchable\n placeholder=\"Select an option...\"\n />\n-->\n\n<template>\n <enhanced-select\n ref=\"selectRef\"\n :class=\"className\"\n :dir=\"direction\"\n :style=\"style\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, onMounted, onBeforeUnmount, computed, render, isVNode, h } from 'vue';\nimport type {\n SelectEventDetail,\n OpenEventDetail,\n CloseEventDetail,\n SearchEventDetail,\n ChangeEventDetail,\n LoadMoreEventDetail,\n ClearEventDetail,\n GroupedItem,\n ClassMap,\n RendererHelpers,\n DiagnosticEventDetail,\n LimitationPolicyMap,\n} from '@smilodon/core';\n\nexport interface SelectItem {\n value: string | number;\n label: string;\n disabled?: boolean;\n group?: string;\n [key: string]: any;\n}\n\nexport interface SelectProps {\n /** Array of items to display in the select */\n items?: SelectItem[];\n /** Grouped items (alternative to items) */\n groupedItems?: GroupedItem[];\n /** Custom renderer for group headers when groupedItems are used */\n groupHeaderRenderer?: (group: GroupedItem, index: number) => ReturnType<typeof h>;\n /** Selected value(s) - for v-model binding */\n modelValue?: string | number | (string | number)[];\n /** Default value for uncontrolled mode */\n defaultValue?: string | number | (string | number)[];\n /** Enable multi-select mode */\n multiple?: boolean;\n /** Enable search functionality */\n searchable?: boolean;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the select */\n disabled?: boolean;\n /** Mark as required */\n required?: boolean;\n /** Show error state */\n error?: boolean;\n /** Enable infinite scroll */\n infiniteScroll?: boolean;\n /** Number of items per page (for infinite scroll) */\n pageSize?: number;\n /** Enable virtual scrolling */\n virtualized?: boolean;\n /** Maximum number of selections (for multi-select) */\n maxSelections?: number;\n /** Custom icon/markup for selected chip remove buttons */\n removeButtonIcon?: string;\n /** Behavior overrides for visually disabled options */\n disabledOptionBehavior?: {\n selectable?: boolean;\n hoverable?: boolean;\n focusable?: boolean;\n };\n /** Show the selected-state side indicator */\n showSelectedIndicator?: boolean;\n /** Text and layout direction */\n direction?: 'ltr' | 'rtl';\n /** Dropdown placement */\n placement?: 'bottom' | 'top' | 'auto';\n /** Custom CSS class */\n className?: string;\n /** Custom inline styles */\n style?: Record<string, string>;\n /** State-class mapping for utility CSS frameworks */\n classMap?: ClassMap;\n /** Enable expandable dropdown */\n expandable?: boolean;\n\n /** Enable clear control button */\n clearable?: boolean;\n\n /** Clear selected values when clear control is clicked */\n clearSelectionOnClear?: boolean;\n\n /** Clear search query when clear control is clicked */\n clearSearchOnClear?: boolean;\n\n /** ARIA label for clear control */\n clearAriaLabel?: string;\n\n /** Icon text for clear control */\n clearIcon?: string;\n\n /** Custom option renderer returning an HTMLElement */\n optionRenderer?: (item: SelectItem, index: number, helpers: RendererHelpers) => HTMLElement;\n\n /** Custom Vue renderer returning a VNode */\n customRenderer?: (item: SelectItem, index: number) => ReturnType<typeof h>;\n\n /** Enable runtime tracking */\n trackingEnabled?: boolean;\n\n /** Track emitted events */\n trackEvents?: boolean;\n\n /** Track styling changes */\n trackStyling?: boolean;\n\n /** Track limitations and policy updates */\n trackLimitations?: boolean;\n\n /** Emit diagnostic events */\n emitDiagnostics?: boolean;\n\n /** Max entries retained per tracking channel */\n trackingMaxEntries?: number;\n\n /** Limitation control policies */\n limitationPolicies?: LimitationPolicyMap;\n\n /** Automatically mitigate mode switching limitation */\n autoMitigateRuntimeModeSwitch?: boolean;\n}\n\nexport interface SelectEmits {\n /** Emitted when selection changes - for v-model */\n (e: 'update:modelValue', value: string | number | (string | number)[]): void;\n /** Emitted when selection changes with full details */\n (e: 'change', value: string | number | (string | number)[], selectedItems: SelectItem[]): void;\n /** Emitted when an item is selected */\n (e: 'select', item: SelectItem, index: number): void;\n /** Emitted when dropdown opens */\n (e: 'open'): void;\n /** Emitted when dropdown closes */\n (e: 'close'): void;\n /** Emitted when search query changes */\n (e: 'search', query: string): void;\n /** Emitted when more items are requested (infinite scroll) */\n (e: 'loadMore', page: number): void;\n /** Emitted when user creates a new item (if enabled) */\n (e: 'create', value: string): void;\n /** Emitted when clear control is used */\n (e: 'clear', detail: { clearedSelection: boolean; clearedSearch: boolean }): void;\n /** Emitted when runtime diagnostics are enabled */\n (e: 'diagnostic', detail: DiagnosticEventDetail): void;\n}\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n items: () => [],\n multiple: false,\n searchable: false,\n disabled: false,\n required: false,\n error: false,\n infiniteScroll: false,\n pageSize: 50,\n virtualized: true,\n showSelectedIndicator: true,\n placement: 'auto',\n clearable: false,\n clearSelectionOnClear: true,\n clearSearchOnClear: true,\n trackingEnabled: false,\n trackEvents: true,\n trackStyling: true,\n trackLimitations: true,\n emitDiagnostics: false,\n trackingMaxEntries: 200,\n autoMitigateRuntimeModeSwitch: true,\n});\n\nconst emit = defineEmits<SelectEmits>();\n\nconst selectRef = ref<HTMLElement | null>(null);\nconst isElementReady = ref(false);\nconst internalValue = ref<string | number | (string | number)[] | undefined>(\n props.defaultValue\n);\nconst customRendererCache = new Map<number, HTMLElement>();\n\n// Manual management of renderer wrapper to avoid reactivity on function identity\nconst resolvedOptionRenderer = ref<any>(undefined);\n\n// Watch for structural changes in renderers (presence only)\nwatch(\n [() => !!props.optionRenderer, () => !!props.customRenderer],\n ([hasOption, hasCustom]) => {\n if (hasOption) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number, helpers: RendererHelpers) => {\n // Accessing props inside here is safe - it delegates to current prop\n return props.optionRenderer?.(item, index, helpers) || document.createElement('div');\n };\n } else if (hasCustom) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number) => {\n let container = customRendererCache.get(index);\n if (!container) {\n container = document.createElement('div');\n customRendererCache.set(index, container);\n }\n\n const node = props.customRenderer?.(item, index);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n } else {\n render(null, container);\n }\n return container;\n };\n } else {\n resolvedOptionRenderer.value = undefined;\n }\n },\n { immediate: true }\n);\n\n// Sync custom option renderer\n// We watch the stable `resolvedOptionRenderer` ref, which only updates when structure changes.\nwatch(\n resolvedOptionRenderer,\n (renderer) => {\n safeCall((el) => {\n (el as any).optionRenderer = renderer;\n });\n },\n { immediate: true }\n);\n\nwatch(\n () => props.classMap,\n (map) => {\n safeCall((el) => {\n (el as any).classMap = map;\n });\n },\n { immediate: true, deep: true }\n);\n\nconst waitForUpgrade = async () => {\n if (typeof window === 'undefined') return;\n\n // Ensure the module is loaded (it registers the custom element on import)\n if (!customElements.get('enhanced-select')) {\n await import('@smilodon/core');\n }\n\n const el = selectRef.value as any;\n if (!el) return;\n\n // Wait until the element is upgraded and its methods exist.\n // In some environments, the tag can be defined but the particular instance\n // hasn't been upgraded yet when watchers/mounted run.\n try {\n await customElements.whenDefined('enhanced-select');\n } catch {\n // ignore\n }\n\n // Retry a few frames to let the browser upgrade the instance.\n for (let i = 0; i < 5; i++) {\n const candidate = selectRef.value as any;\n if (candidate && typeof candidate.setItems === 'function') {\n isElementReady.value = true;\n if (resolvedOptionRenderer.value) {\n (candidate as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (props.classMap) {\n (candidate as any).classMap = props.classMap;\n }\n return;\n }\n await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));\n }\n\n isElementReady.value = typeof (selectRef.value as any)?.setItems === 'function';\n if (isElementReady.value && resolvedOptionRenderer.value) {\n (selectRef.value as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (isElementReady.value && props.classMap) {\n (selectRef.value as any).classMap = props.classMap;\n }\n};\n\nfunction safeCall(fn: (el: any) => void) {\n const el = selectRef.value as any;\n if (!el || !isElementReady.value) return;\n fn(el);\n}\n\n// Check if component is controlled\nconst isControlled = computed(() => props.modelValue !== undefined);\n\n// Get current value\nconst currentValue = computed(() =>\n isControlled.value ? props.modelValue : internalValue.value\n);\n\n// Sync items to web component\nwatch(\n () => props.items,\n (newItems) => {\n safeCall((el) => {\n if (newItems) el.setItems(newItems);\n });\n },\n { deep: true }\n);\n\n// Sync grouped items to web component\nwatch(\n () => props.groupedItems,\n (newGroups) => {\n safeCall((el) => {\n if (newGroups) el.setGroupedItems(newGroups);\n });\n },\n { deep: true }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// removed old watcher\n\n// We need to keep rendererRefs in sync with props\n// Wait, the previous replacement put the watch inside the script setup directly after refs.\n// That watch updates rendererRefs.\n// But we ALSO need to update the web component if the *presence* of renderers changes (e.g. going from undefined to defined).\n// The existing watcher below was watching `resolvedOptionRenderer.value`.\n// Since `resolvedOptionRenderer` computed now depends only on PRESENCE (implicitly through logic), it should remain stable.\n// So `watch(() => resolvedOptionRenderer.value)` will only fire when PRESENCE changes.\n// THIS IS EXACTLY WHAT WE WANT. It won't fire on identity change.\n// So the original watcher is actually fine as is!\n// BUT: I changed how `resolvedOptionRenderer` works. Let's double check if I broke the watch logic.\n// The computed property returns a *new function* only if the structure changes (e.g. `hasOptionRenderer` flips).\n// So the watcher below will trigger correctly only when structure changes.\n\n// Wait, I see I didn't include `rendererRefs` update in the previous `replace_string_in_file` properly?\n// Previous call:\n// Replaced `const resolvedOptionRenderer ...` block.\n// Included `rendererRefs` definition and `watch` to update refs.\n\n// But wait, the previous `replace_string_in_file` REPLACED the computed property, but did it include the watch for refs?\n// Yes.\n// So the code looks like:\n// ...\n// const rendererRefs = ...\n// watch( ... updates rendererRefs ... )\n// const resolvedOptionRenderer = computed( ... )\n// ...\n//\n// And further down there is existing code:\n// watch(() => resolvedOptionRenderer.value, ...)\n//\n// This existing code is correct! It will update the WC only when the wrapper function changes (which is stable).\n// So I don't need to change the watcher below.\n// UNLESS: The watcher below relies on `resolvedOptionRenderer.value` changing.\n// If props.customRenderer changes from `undefined` to `fn`, computed re-runs -> new wrapper -> watcher runs -> WC updated. Correct.\n// If props.customRenderer changes from `fn1` to `fn2`, computed (depending on `!!props`? No, computed in Vue tracks all dependencies accessed).\n// Wait! `resolvedOptionRenderer` accesses `rendererRefs`.\n// `rendererRefs` is a local object. It is NOT reactive (it's a plain object).\n// `computed` tracks dependencies. If I access `rendererRefs.customRenderer`, does Vue track it? No.\n// So `resolvedOptionRenderer` will NOT re-run when `rendererRefs` changes. This is GOOD. It's stable.\n// But `watch(() => [props.optionRenderer, props.customRenderer], ...)` updates `rendererRefs`.\n// So when `fn1` -> `fn2`, `rendererRefs` is updated. `resolvedOptionRenderer` is NOT re-computed. The OLD wrapper function is still used.\n// But the wrapper function calls `rendererRefs.customRenderer`. This is the NEW function `fn2`.\n// So it works! The wrapper delegates to the current ref.\n// And `resolvedOptionRenderer.value` (the wrapper) hasn't changed identity, so the watcher below (syncing to WC) does NOT fire.\n// This means `el.optionRenderer = wrapper` is NOT called again.\n// Is this okay? Yes, because `el.optionRenderer` is already set to the wrapper. The wrapper hasn't changed.\n// So the infinite loop is broken.\n\n// HOWEVER: I still need to check if my previous replacement was syntactically correct and complete.\n// I see I replaced `const resolvedOptionRenderer ...` with a block that includes `const rendererRefs ...`.\n// Let's verify `rendererRefs` is reactive or not.\n// `const rendererRefs = { ... }` is NOT reactive. This is intentional.\n// We don't want reactivity to trigger computed re-eval.\n\n// BUT `watch(() => [props.optionRenderer...])` updates it.\n// The watcher needs `props` to be in scope. `props` is defined above.\n// It seems correct.\n\n// One detail:\n// `const resolvedOptionRenderer = computed(() => { ... })`\n// Vue computed properties track dependencies.\n// Inside computed, I access `props.optionRenderer` (to check boolean).\n// So computed depends on `props.optionRenderer`.\n// If `props.optionRenderer` changes from `fn1` to `fn2`, `!!props.optionRenderer` is still `true`.\n// Does the dependency change?\n// Vue tracks access. If I only access `!!props.optionRenderer`, maybe it only tracks the boolean?\n// No, usually it tracks the property.\n// If I use `props.optionRenderer` in `if (props.optionRenderer)`, it tracks it.\n// So if it changes, computed re-runs!\n// And returns a NEW function.\n// So watcher runs -> WC update -> Loop.\n// I need `computed` to NOT depend on the function identity.\n// I should use `!!props.optionRenderer` in a way that doesn't trigger on identity change?\n// Or better: explicit dependencies or a structure that isolates the check.\n// In Vue `computed`, we can't easily control the dependency array like React's `useMemo`.\n// But we can access the boolean via a separate stable computed property or just trust that Vue's dependency tracking is based on value?.\n// No, props are reactive.\n// If I assume Vue computes re-run on prop change:\n// Then the wrapper is recreated.\n// I need `resolvedOptionRenderer` to be a `shallowRef` or generic `ref` that I manually update only when structure changes!\n// `computed` is risky here.\n\n// Better approach for Vue:\n// Use `ref` for the wrapper.\n// Watch `[() => !!props.optionRenderer, () => !!props.customRenderer]` explicitly.\n// When that specific boolean tuple changes, update the wrapper ref.\n// And have the \"Sync custom option renderer\" watch depend on that wrapper ref.\n\n// Let's undo/redo the Vue part with this safer `shallowRef` approach.\n\nwatch(\n () => [props.items, props.groupedItems],\n () => {\n const totalItems = props.groupedItems\n ? props.groupedItems.reduce((count, group) => count + group.options.length, 0)\n : props.items.length;\n\n customRendererCache.forEach((container, index) => {\n if (index >= totalItems) {\n render(null, container);\n customRendererCache.delete(index);\n }\n });\n },\n { deep: true }\n);\n\n// Sync value to web component\nwatch(\n currentValue,\n (newValue) => {\n safeCall((el) => {\n if (newValue !== undefined) {\n // Get current selected values from the element to avoid infinite loop\n const currentSelected = el.getSelectedValues?.() || [];\n const newValues = Array.isArray(newValue) ? newValue : [newValue];\n \n // Only update if values have actually changed\n const hasChanged = \n currentSelected.length !== newValues.length ||\n !currentSelected.every((v: any, i: number) => v === newValues[i]);\n \n if (hasChanged) {\n el.setSelectedValues(newValues);\n }\n }\n });\n },\n { immediate: true }\n);\n\n// Sync configuration\nconst updateConfig = () => {\n safeCall((el) => {\n const config = {\n searchable: props.searchable,\n placeholder: props.placeholder,\n enabled: !props.disabled,\n virtualize: props.virtualized,\n direction: props.direction,\n selection: {\n mode: props.multiple ? 'multi' : 'single',\n maxSelections: props.maxSelections,\n removeButtonIcon: props.removeButtonIcon,\n disabledOptionBehavior: props.disabledOptionBehavior,\n showSelectedIndicator: props.showSelectedIndicator,\n },\n infiniteScroll: {\n enabled: props.infiniteScroll,\n pageSize: props.pageSize,\n },\n expandable: {\n enabled: props.expandable,\n },\n clearControl: {\n enabled: props.clearable,\n clearSelection: props.clearSelectionOnClear,\n clearSearch: props.clearSearchOnClear,\n ariaLabel: props.clearAriaLabel,\n icon: props.clearIcon,\n },\n tracking: {\n enabled: props.trackingEnabled,\n events: props.trackEvents,\n styling: props.trackStyling,\n limitations: props.trackLimitations,\n emitDiagnostics: props.emitDiagnostics,\n maxEntries: props.trackingMaxEntries,\n },\n limitations: {\n policies: props.limitationPolicies,\n autoMitigateRuntimeModeSwitch: props.autoMitigateRuntimeModeSwitch,\n },\n };\n\n el.updateConfig(config);\n });\n};\n\nwatch(\n [\n () => props.searchable,\n () => props.placeholder,\n () => props.disabled,\n () => props.multiple,\n () => props.maxSelections,\n () => props.removeButtonIcon,\n () => props.infiniteScroll,\n () => props.pageSize,\n () => props.virtualized,\n () => props.direction,\n () => props.disabledOptionBehavior,\n () => props.showSelectedIndicator,\n () => props.expandable,\n () => props.clearable,\n () => props.clearSelectionOnClear,\n () => props.clearSearchOnClear,\n () => props.clearAriaLabel,\n () => props.clearIcon,\n () => props.trackingEnabled,\n () => props.trackEvents,\n () => props.trackStyling,\n () => props.trackLimitations,\n () => props.emitDiagnostics,\n () => props.trackingMaxEntries,\n () => props.limitationPolicies,\n () => props.autoMitigateRuntimeModeSwitch,\n ],\n updateConfig\n);\n\n// Event handlers\nconst handleSelect = (e: Event) => {\n const customEvent = e as CustomEvent<SelectEventDetail>;\n const { item, index } = customEvent.detail;\n emit('select', item as SelectItem, index);\n};\n\nconst handleChange = (e: Event) => {\n const customEvent = e as CustomEvent<ChangeEventDetail>;\n const { selectedItems, selectedValues } = customEvent.detail;\n\n const values = selectedValues as (string | number)[];\n\n // Update internal value in uncontrolled mode\n if (!isControlled.value) {\n internalValue.value = props.multiple ? values : values[0];\n }\n\n // Emit events\n const value = props.multiple ? values : values[0];\n emit('update:modelValue', value);\n emit('change', value, selectedItems as SelectItem[]);\n};\n\nconst handleOpen = () => {\n emit('open');\n};\n\nconst handleClose = () => {\n emit('close');\n};\n\nconst handleSearch = (e: Event) => {\n const customEvent = e as CustomEvent<SearchEventDetail>;\n emit('search', customEvent.detail.query);\n};\n\nconst handleLoadMore = (e: Event) => {\n const customEvent = e as CustomEvent<LoadMoreEventDetail>;\n emit('loadMore', customEvent.detail.page);\n};\n\nconst handleCreate = (e: Event) => {\n const customEvent = e as CustomEvent<{ value: string }>;\n emit('create', customEvent.detail.value);\n};\n\nconst handleClear = (e: Event) => {\n const customEvent = e as CustomEvent<ClearEventDetail>;\n emit('clear', {\n clearedSelection: customEvent.detail.clearedSelection,\n clearedSearch: customEvent.detail.clearedSearch,\n });\n};\n\nconst handleDiagnostic = (e: Event) => {\n const customEvent = e as CustomEvent<DiagnosticEventDetail>;\n emit('diagnostic', customEvent.detail);\n};\n\n// Setup event listeners\nonMounted(async () => {\n await waitForUpgrade();\n if (!selectRef.value || !isElementReady.value) return;\n\n const element = selectRef.value as any;\n\n // Initial configuration\n updateConfig();\n\n if (props.placement) {\n element.setAttribute('placement', props.placement);\n }\n\n // Set initial items\n if (props.items?.length) {\n // Auto-convert flat items that include a `group` property into groupedItems\n const first = props.items[0];\n if (first && (first as any).group !== undefined) {\n const map = new Map<string, any[]>();\n props.items.forEach((it: any) => {\n const g = it.group ?? 'Ungrouped';\n if (!map.has(g)) map.set(g, []);\n map.get(g)!.push(it);\n });\n const groups = Array.from(map.entries()).map(([label, options]) => ({ label, options }));\n element.setGroupedItems(groups);\n } else {\n element.setItems(props.items);\n }\n }\n if (props.groupedItems?.length) {\n element.setGroupedItems(props.groupedItems);\n }\n\n // Set initial value\n if (currentValue.value !== undefined) {\n const values = Array.isArray(currentValue.value)\n ? currentValue.value\n : [currentValue.value];\n element.setSelectedValues(values);\n }\n\n // Add event listeners\n element.addEventListener('select', handleSelect as EventListener);\n element.addEventListener('change', handleChange as EventListener);\n element.addEventListener('open', handleOpen as EventListener);\n element.addEventListener('close', handleClose as EventListener);\n element.addEventListener('search', handleSearch as EventListener);\n element.addEventListener('loadMore', handleLoadMore as EventListener);\n element.addEventListener('create', handleCreate as EventListener);\n element.addEventListener('clear', handleClear as EventListener);\n element.addEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\nonBeforeUnmount(() => {\n customRendererCache.forEach((container) => render(null, container));\n customRendererCache.clear();\n\n if (!selectRef.value) return;\n\n const element = selectRef.value;\n\n // Remove event listeners\n element.removeEventListener('select', handleSelect as EventListener);\n element.removeEventListener('change', handleChange as EventListener);\n element.removeEventListener('open', handleOpen as EventListener);\n element.removeEventListener('close', handleClose as EventListener);\n element.removeEventListener('search', handleSearch as EventListener);\n element.removeEventListener('loadMore', handleLoadMore as EventListener);\n element.removeEventListener('create', handleCreate as EventListener);\n element.removeEventListener('clear', handleClear as EventListener);\n element.removeEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\n// Expose imperative API\ndefineExpose({\n /** Open the dropdown */\n open: () => {\n (selectRef.value as any)?.open();\n },\n /** Close the dropdown */\n close: () => {\n (selectRef.value as any)?.close();\n },\n /** Focus the select */\n focus: () => {\n selectRef.value?.focus();\n },\n /** Set items programmatically */\n setItems: (items: SelectItem[]) => {\n (selectRef.value as any)?.setItems(items);\n },\n /** Set grouped items programmatically */\n setGroupedItems: (groups: GroupedItem[]) => {\n (selectRef.value as any)?.setGroupedItems(groups);\n },\n /** Clear selection */\n clear: () => {\n (selectRef.value as any)?.setSelectedValues([]);\n if (!isControlled.value) {\n internalValue.value = props.multiple ? [] : undefined;\n }\n const value = props.multiple ? [] : '';\n emit('update:modelValue', value);\n emit('change', value, []);\n },\n /** Runtime capability report */\n getCapabilities: () => {\n return (selectRef.value as any)?.getCapabilities?.();\n },\n /** Known limitations report */\n getKnownLimitations: () => {\n return (selectRef.value as any)?.getKnownLimitations?.() || [];\n },\n /** Tracking snapshot */\n getTrackingSnapshot: () => {\n return (selectRef.value as any)?.getTrackingSnapshot?.() || { events: [], styles: [], limitations: [] };\n },\n /** Clear tracking entries */\n clearTracking: (source?: 'event' | 'style' | 'limitation' | 'all') => {\n (selectRef.value as any)?.clearTracking?.(source);\n },\n /** Update limitation policies */\n setLimitationPolicies: (policies: LimitationPolicyMap) => {\n (selectRef.value as any)?.setLimitationPolicies?.(policies);\n },\n});\n</script>\n\n<style scoped>\n/* Component uses web component styling from @smilodon/core */\n</style>\n"],"names":["ref","watch","isVNode","render","h","computed","onMounted","onBeforeUnmount","_createElementBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkLA,UAAM,QAAQ;AAwBd,UAAM,OAAO;AAEb,UAAM,YAAYA,IAAAA,IAAwB,IAAI;AAC9C,UAAM,iBAAiBA,IAAAA,IAAI,KAAK;AAChC,UAAM,gBAAgBA,IAAAA;AAAAA,MACpB,MAAM;AAAA,IAAA;AAER,UAAM,0CAA0B,IAAA;AAGhC,UAAM,yBAAyBA,IAAAA,IAAS,MAAS;AAGjDC,QAAAA;AAAAA,MACE,CAAC,MAAM,CAAC,CAAC,MAAM,gBAAgB,MAAM,CAAC,CAAC,MAAM,cAAc;AAAA,MAC3D,CAAC,CAAC,WAAW,SAAS,MAAM;AAC1B,YAAI,WAAW;AACb,iCAAuB,QAAQ,CAAC,MAAkB,OAAe,YAA6B;;AAE5F,qBAAO,WAAM,mBAAN,+BAAuB,MAAM,OAAO,aAAY,SAAS,cAAc,KAAK;AAAA,UACrF;AAAA,QACF,WAAW,WAAW;AACpB,iCAAuB,QAAQ,CAAC,MAAkB,UAAkB;;A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AAA,MACtG;AAAA;AAAA,MAEA,eAAe,CAAC,WAAsD;;AACnE,8BAAU,UAAV,mBAAyB,kBAAzB,4BAAyC;AAAA,MAC5C;AAAA;AAAA,MAEA,uBAAuB,CAAC,aAAkC;;AACvD,8BAAU,UAAV,mBAAyB,0BAAzB,4BAAiD;AAAA,MACpD;AAAA,IAAA,CACD;;8BAnwBCK,IAAAA,mBAKE,mBAAA;AAAA,iBAJI;AAAA,QAAJ,KAAI;AAAA,QACH,0BAAO,QAAA,SAAS;AAAA,QAChB,KAAK,QAAA;AAAA,QACL,0BAAO,QAAA,KAAK;AAAA,MAAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/Select.vue"],"sourcesContent":["<!--\n Smilodon Select Component for Vue 3\n \n A production-ready, accessible select component with advanced features:\n - Single and multi-select modes\n - Searchable with client or server-side filtering\n - Infinite scroll and virtual scrolling for large datasets\n - Grouped options\n - Custom rendering\n - Full keyboard navigation\n - WCAG 2.1 AAA compliant\n \n @example\n <Select\n :items=\"items\"\n v-model=\"selectedValue\"\n searchable\n placeholder=\"Select an option...\"\n />\n-->\n\n<template>\n <enhanced-select\n ref=\"selectRef\"\n v-bind=\"$attrs\"\n :class=\"className\"\n :dir=\"direction\"\n :style=\"style\"\n />\n</template>\n\n<script setup lang=\"ts\">\ndefineOptions({\n inheritAttrs: false,\n});\n\nimport { ref, watch, onMounted, onBeforeUnmount, computed, render, isVNode, h } from 'vue';\nimport { arraysEqualByValue } from '@smilodon/core';\nimport type {\n SelectEventDetail,\n OpenEventDetail,\n CloseEventDetail,\n SearchEventDetail,\n ChangeEventDetail,\n LoadMoreEventDetail,\n ClearEventDetail,\n GroupedItem,\n ClassMap,\n RendererHelpers,\n DiagnosticEventDetail,\n LimitationPolicyMap,\n GlobalSelectConfig,\n SelectionConfig,\n MultiSelectDisplayConfig,\n ScrollToSelectedConfig,\n StyleConfig,\n} from '@smilodon/core';\n\nexport interface SelectItem {\n value: string | number;\n label: string;\n disabled?: boolean;\n group?: string;\n [key: string]: any;\n}\n\nexport interface SelectProps {\n /** Array of items to display in the select */\n items?: SelectItem[];\n /** Grouped items (alternative to items) */\n groupedItems?: GroupedItem[];\n /** Custom renderer for group headers when groupedItems are used */\n groupHeaderRenderer?: (group: GroupedItem, index: number) => ReturnType<typeof h>;\n /** Selected value(s) - for v-model binding */\n modelValue?: string | number | (string | number)[];\n /** Default value for uncontrolled mode */\n defaultValue?: string | number | (string | number)[];\n /** Enable multi-select mode */\n multiple?: boolean;\n /** Enable search functionality */\n searchable?: boolean;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the select */\n disabled?: boolean;\n /** Mark as required */\n required?: boolean;\n /** Show error state */\n error?: boolean;\n /** Enable infinite scroll */\n infiniteScroll?: boolean;\n /** Number of items per page (for infinite scroll) */\n pageSize?: number;\n /** Enable virtual scrolling */\n virtualized?: boolean;\n /** Maximum number of selections (for multi-select) */\n maxSelections?: number;\n /** Partial core selection config for advanced selection behavior */\n selectionConfig?: Partial<SelectionConfig>;\n /** Multi-select chip display behavior */\n multiSelectDisplay?: Partial<MultiSelectDisplayConfig>;\n /** Scroll-to-selected behavior */\n scrollToSelected?: Partial<ScrollToSelectedConfig>;\n /** Core style configuration for internal parts */\n styles?: StyleConfig;\n /** Full core config passthrough for advanced runtime features */\n config?: Partial<GlobalSelectConfig>;\n /** Custom icon/markup for selected chip remove buttons */\n removeButtonIcon?: string;\n /** Behavior overrides for visually disabled options */\n disabledOptionBehavior?: {\n selectable?: boolean;\n hoverable?: boolean;\n focusable?: boolean;\n };\n /** Show the selected-state side indicator */\n showSelectedIndicator?: boolean;\n /** Text and layout direction */\n direction?: 'ltr' | 'rtl';\n /** Dropdown placement */\n placement?: 'bottom' | 'top' | 'auto';\n /** Custom CSS class */\n className?: string;\n /** Custom inline styles */\n style?: Record<string, string>;\n /** State-class mapping for utility CSS frameworks */\n classMap?: ClassMap;\n /** Enable expandable dropdown */\n expandable?: boolean;\n\n /** Enable clear control button */\n clearable?: boolean;\n\n /** Clear selected values when clear control is clicked */\n clearSelectionOnClear?: boolean;\n\n /** Clear search query when clear control is clicked */\n clearSearchOnClear?: boolean;\n\n /** ARIA label for clear control */\n clearAriaLabel?: string;\n\n /** Icon text for clear control */\n clearIcon?: string;\n\n /** Custom option renderer returning an HTMLElement */\n optionRenderer?: (item: SelectItem, index: number, helpers: RendererHelpers) => HTMLElement;\n\n /** Custom Vue renderer returning a VNode */\n customRenderer?: (item: SelectItem, index: number) => ReturnType<typeof h>;\n\n /** Enable runtime tracking */\n trackingEnabled?: boolean;\n\n /** Track emitted events */\n trackEvents?: boolean;\n\n /** Track styling changes */\n trackStyling?: boolean;\n\n /** Track limitations and policy updates */\n trackLimitations?: boolean;\n\n /** Emit diagnostic events */\n emitDiagnostics?: boolean;\n\n /** Max entries retained per tracking channel */\n trackingMaxEntries?: number;\n\n /** Limitation control policies */\n limitationPolicies?: LimitationPolicyMap;\n\n /** Automatically mitigate mode switching limitation */\n autoMitigateRuntimeModeSwitch?: boolean;\n}\n\nexport interface SelectEmits {\n /** Emitted when selection changes - for v-model */\n (e: 'update:modelValue', value: string | number | (string | number)[]): void;\n /** Emitted when selection changes with full details */\n (e: 'change', value: string | number | (string | number)[], selectedItems: SelectItem[]): void;\n /** Emitted when an item is selected */\n (e: 'select', item: SelectItem, index: number): void;\n /** Emitted when dropdown opens */\n (e: 'open'): void;\n /** Emitted when dropdown closes */\n (e: 'close'): void;\n /** Emitted when search query changes */\n (e: 'search', query: string): void;\n /** Emitted when more items are requested (infinite scroll) */\n (e: 'loadMore', page: number): void;\n /** Emitted when user creates a new item (if enabled) */\n (e: 'create', value: string): void;\n /** Emitted when clear control is used */\n (e: 'clear', detail: { clearedSelection: boolean; clearedSearch: boolean }): void;\n /** Emitted when runtime diagnostics are enabled */\n (e: 'diagnostic', detail: DiagnosticEventDetail): void;\n}\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n items: () => [],\n multiple: false,\n searchable: false,\n disabled: false,\n required: false,\n error: false,\n infiniteScroll: false,\n pageSize: 50,\n virtualized: true,\n showSelectedIndicator: true,\n placement: 'auto',\n clearable: false,\n clearSelectionOnClear: true,\n clearSearchOnClear: true,\n trackingEnabled: false,\n trackEvents: true,\n trackStyling: true,\n trackLimitations: true,\n emitDiagnostics: false,\n trackingMaxEntries: 200,\n autoMitigateRuntimeModeSwitch: true,\n});\n\nconst emit = defineEmits<SelectEmits>();\n\nconst selectRef = ref<HTMLElement | null>(null);\nconst isElementReady = ref(false);\nconst internalValue = ref<string | number | (string | number)[] | undefined>(\n props.defaultValue\n);\nconst customRendererCache = new Map<number, HTMLElement>();\n\n// Manual management of renderer wrapper to avoid reactivity on function identity\nconst resolvedOptionRenderer = ref<any>(undefined);\n\n// Watch for structural changes in renderers (presence only)\nwatch(\n [() => !!props.optionRenderer, () => !!props.customRenderer],\n ([hasOption, hasCustom]) => {\n if (hasOption) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number, helpers: RendererHelpers) => {\n // Accessing props inside here is safe - it delegates to current prop\n return props.optionRenderer?.(item, index, helpers) || document.createElement('div');\n };\n } else if (hasCustom) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number) => {\n let container = customRendererCache.get(index);\n if (!container) {\n container = document.createElement('div');\n customRendererCache.set(index, container);\n }\n\n const node = props.customRenderer?.(item, index);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n } else {\n render(null, container);\n }\n return container;\n };\n } else {\n resolvedOptionRenderer.value = undefined;\n }\n },\n { immediate: true }\n);\n\n// Sync custom option renderer\n// We watch the stable `resolvedOptionRenderer` ref, which only updates when structure changes.\nwatch(\n resolvedOptionRenderer,\n (renderer) => {\n safeCall((el) => {\n (el as any).optionRenderer = renderer;\n });\n },\n { immediate: true }\n);\n\nwatch(\n () => props.classMap,\n (map) => {\n safeCall((el) => {\n (el as any).classMap = map;\n });\n },\n { immediate: true, deep: true }\n);\n\nconst waitForUpgrade = async () => {\n if (typeof window === 'undefined') return;\n\n // Ensure the module is loaded (it registers the custom element on import)\n if (!customElements.get('enhanced-select')) {\n await import('@smilodon/core');\n }\n\n const el = selectRef.value as any;\n if (!el) return;\n\n // Wait until the element is upgraded and its methods exist.\n // In some environments, the tag can be defined but the particular instance\n // hasn't been upgraded yet when watchers/mounted run.\n try {\n await customElements.whenDefined('enhanced-select');\n } catch {\n // ignore\n }\n\n // Retry a few frames to let the browser upgrade the instance.\n for (let i = 0; i < 5; i++) {\n const candidate = selectRef.value as any;\n if (candidate && typeof candidate.setItems === 'function') {\n isElementReady.value = true;\n if (resolvedOptionRenderer.value) {\n (candidate as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (props.classMap) {\n (candidate as any).classMap = props.classMap;\n }\n return;\n }\n await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));\n }\n\n isElementReady.value = typeof (selectRef.value as any)?.setItems === 'function';\n if (isElementReady.value && resolvedOptionRenderer.value) {\n (selectRef.value as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (isElementReady.value && props.classMap) {\n (selectRef.value as any).classMap = props.classMap;\n }\n};\n\nfunction safeCall(fn: (el: any) => void) {\n const el = selectRef.value as any;\n if (!el || !isElementReady.value) return;\n fn(el);\n}\n\n// Check if component is controlled\nconst isControlled = computed(() => props.modelValue !== undefined);\n\n// Get current value\nconst currentValue = computed(() =>\n isControlled.value ? props.modelValue : internalValue.value\n);\n\n// Sync items to web component\nwatch(\n () => props.items,\n (newItems) => {\n safeCall((el) => {\n if (newItems) el.setItems(newItems);\n });\n },\n { deep: true }\n);\n\n// Sync grouped items to web component\nwatch(\n () => props.groupedItems,\n (newGroups) => {\n safeCall((el) => {\n if (newGroups) el.setGroupedItems(newGroups);\n });\n },\n { deep: true }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// removed old watcher\n\n// We need to keep rendererRefs in sync with props\n// Wait, the previous replacement put the watch inside the script setup directly after refs.\n// That watch updates rendererRefs.\n// But we ALSO need to update the web component if the *presence* of renderers changes (e.g. going from undefined to defined).\n// The existing watcher below was watching `resolvedOptionRenderer.value`.\n// Since `resolvedOptionRenderer` computed now depends only on PRESENCE (implicitly through logic), it should remain stable.\n// So `watch(() => resolvedOptionRenderer.value)` will only fire when PRESENCE changes.\n// THIS IS EXACTLY WHAT WE WANT. It won't fire on identity change.\n// So the original watcher is actually fine as is!\n// BUT: I changed how `resolvedOptionRenderer` works. Let's double check if I broke the watch logic.\n// The computed property returns a *new function* only if the structure changes (e.g. `hasOptionRenderer` flips).\n// So the watcher below will trigger correctly only when structure changes.\n\n// Wait, I see I didn't include `rendererRefs` update in the previous `replace_string_in_file` properly?\n// Previous call:\n// Replaced `const resolvedOptionRenderer ...` block.\n// Included `rendererRefs` definition and `watch` to update refs.\n\n// But wait, the previous `replace_string_in_file` REPLACED the computed property, but did it include the watch for refs?\n// Yes.\n// So the code looks like:\n// ...\n// const rendererRefs = ...\n// watch( ... updates rendererRefs ... )\n// const resolvedOptionRenderer = computed( ... )\n// ...\n//\n// And further down there is existing code:\n// watch(() => resolvedOptionRenderer.value, ...)\n//\n// This existing code is correct! It will update the WC only when the wrapper function changes (which is stable).\n// So I don't need to change the watcher below.\n// UNLESS: The watcher below relies on `resolvedOptionRenderer.value` changing.\n// If props.customRenderer changes from `undefined` to `fn`, computed re-runs -> new wrapper -> watcher runs -> WC updated. Correct.\n// If props.customRenderer changes from `fn1` to `fn2`, computed (depending on `!!props`? No, computed in Vue tracks all dependencies accessed).\n// Wait! `resolvedOptionRenderer` accesses `rendererRefs`.\n// `rendererRefs` is a local object. It is NOT reactive (it's a plain object).\n// `computed` tracks dependencies. If I access `rendererRefs.customRenderer`, does Vue track it? No.\n// So `resolvedOptionRenderer` will NOT re-run when `rendererRefs` changes. This is GOOD. It's stable.\n// But `watch(() => [props.optionRenderer, props.customRenderer], ...)` updates `rendererRefs`.\n// So when `fn1` -> `fn2`, `rendererRefs` is updated. `resolvedOptionRenderer` is NOT re-computed. The OLD wrapper function is still used.\n// But the wrapper function calls `rendererRefs.customRenderer`. This is the NEW function `fn2`.\n// So it works! The wrapper delegates to the current ref.\n// And `resolvedOptionRenderer.value` (the wrapper) hasn't changed identity, so the watcher below (syncing to WC) does NOT fire.\n// This means `el.optionRenderer = wrapper` is NOT called again.\n// Is this okay? Yes, because `el.optionRenderer` is already set to the wrapper. The wrapper hasn't changed.\n// So the infinite loop is broken.\n\n// HOWEVER: I still need to check if my previous replacement was syntactically correct and complete.\n// I see I replaced `const resolvedOptionRenderer ...` with a block that includes `const rendererRefs ...`.\n// Let's verify `rendererRefs` is reactive or not.\n// `const rendererRefs = { ... }` is NOT reactive. This is intentional.\n// We don't want reactivity to trigger computed re-eval.\n\n// BUT `watch(() => [props.optionRenderer...])` updates it.\n// The watcher needs `props` to be in scope. `props` is defined above.\n// It seems correct.\n\n// One detail:\n// `const resolvedOptionRenderer = computed(() => { ... })`\n// Vue computed properties track dependencies.\n// Inside computed, I access `props.optionRenderer` (to check boolean).\n// So computed depends on `props.optionRenderer`.\n// If `props.optionRenderer` changes from `fn1` to `fn2`, `!!props.optionRenderer` is still `true`.\n// Does the dependency change?\n// Vue tracks access. If I only access `!!props.optionRenderer`, maybe it only tracks the boolean?\n// No, usually it tracks the property.\n// If I use `props.optionRenderer` in `if (props.optionRenderer)`, it tracks it.\n// So if it changes, computed re-runs!\n// And returns a NEW function.\n// So watcher runs -> WC update -> Loop.\n// I need `computed` to NOT depend on the function identity.\n// I should use `!!props.optionRenderer` in a way that doesn't trigger on identity change?\n// Or better: explicit dependencies or a structure that isolates the check.\n// In Vue `computed`, we can't easily control the dependency array like React's `useMemo`.\n// But we can access the boolean via a separate stable computed property or just trust that Vue's dependency tracking is based on value?.\n// No, props are reactive.\n// If I assume Vue computes re-run on prop change:\n// Then the wrapper is recreated.\n// I need `resolvedOptionRenderer` to be a `shallowRef` or generic `ref` that I manually update only when structure changes!\n// `computed` is risky here.\n\n// Better approach for Vue:\n// Use `ref` for the wrapper.\n// Watch `[() => !!props.optionRenderer, () => !!props.customRenderer]` explicitly.\n// When that specific boolean tuple changes, update the wrapper ref.\n// And have the \"Sync custom option renderer\" watch depend on that wrapper ref.\n\n// Let's undo/redo the Vue part with this safer `shallowRef` approach.\n\nwatch(\n () => [props.items, props.groupedItems],\n () => {\n const totalItems = props.groupedItems\n ? props.groupedItems.reduce((count, group) => count + group.options.length, 0)\n : props.items.length;\n\n customRendererCache.forEach((container, index) => {\n if (index >= totalItems) {\n render(null, container);\n customRendererCache.delete(index);\n }\n });\n },\n { deep: true }\n);\n\n// Sync value to web component\nwatch(\n currentValue,\n (newValue) => {\n safeCall((el) => {\n if (newValue !== undefined) {\n // Get current selected values from the element to avoid infinite loop\n const currentSelected = el.getSelectedValues?.() || [];\n const newValues = Array.isArray(newValue) ? newValue : [newValue];\n \n // Only update if values have actually changed\n const hasChanged = !arraysEqualByValue(currentSelected, newValues);\n \n if (hasChanged) {\n el.setSelectedValues(newValues);\n }\n }\n });\n },\n { immediate: true }\n);\n\n// Sync configuration\nconst updateConfig = () => {\n safeCall((el) => {\n const config = {\n searchable: props.searchable,\n placeholder: props.placeholder,\n enabled: !props.disabled,\n virtualize: props.virtualized,\n direction: props.direction,\n dropdownPlacement: {\n mode: props.placement,\n },\n selection: {\n ...(props.selectionConfig ?? {}),\n mode: props.multiple ? 'multi' : 'single',\n maxSelections: props.maxSelections,\n removeButtonIcon: props.removeButtonIcon,\n disabledOptionBehavior: props.disabledOptionBehavior,\n showSelectedIndicator: props.showSelectedIndicator,\n },\n multiSelectDisplay: props.multiSelectDisplay,\n infiniteScroll: {\n enabled: props.infiniteScroll,\n pageSize: props.pageSize,\n },\n scrollToSelected: {\n enabled: true,\n ...(props.scrollToSelected ?? {}),\n },\n styles: props.styles,\n expandable: {\n enabled: props.expandable,\n },\n clearControl: {\n enabled: props.clearable,\n clearSelection: props.clearSelectionOnClear,\n clearSearch: props.clearSearchOnClear,\n ariaLabel: props.clearAriaLabel,\n icon: props.clearIcon,\n },\n tracking: {\n enabled: props.trackingEnabled,\n events: props.trackEvents,\n styling: props.trackStyling,\n limitations: props.trackLimitations,\n emitDiagnostics: props.emitDiagnostics,\n maxEntries: props.trackingMaxEntries,\n },\n limitations: {\n policies: props.limitationPolicies,\n autoMitigateRuntimeModeSwitch: props.autoMitigateRuntimeModeSwitch,\n },\n };\n\n el.updateConfig(config);\n if (props.config) {\n el.updateConfig(props.config);\n }\n });\n};\n\nwatch(\n [\n () => props.searchable,\n () => props.placeholder,\n () => props.disabled,\n () => props.multiple,\n () => props.maxSelections,\n () => props.removeButtonIcon,\n () => props.infiniteScroll,\n () => props.pageSize,\n () => props.virtualized,\n () => props.direction,\n () => props.disabledOptionBehavior,\n () => props.showSelectedIndicator,\n () => props.expandable,\n () => props.clearable,\n () => props.clearSelectionOnClear,\n () => props.clearSearchOnClear,\n () => props.clearAriaLabel,\n () => props.clearIcon,\n () => props.trackingEnabled,\n () => props.trackEvents,\n () => props.trackStyling,\n () => props.trackLimitations,\n () => props.emitDiagnostics,\n () => props.trackingMaxEntries,\n () => props.limitationPolicies,\n () => props.autoMitigateRuntimeModeSwitch,\n ],\n updateConfig\n);\n\n// Event handlers\nconst handleSelect = (e: Event) => {\n const customEvent = e as CustomEvent<SelectEventDetail>;\n const { item, index } = customEvent.detail;\n emit('select', item as SelectItem, index);\n};\n\nconst handleChange = (e: Event) => {\n const customEvent = e as CustomEvent<ChangeEventDetail>;\n const { selectedItems, selectedValues } = customEvent.detail;\n\n const values = selectedValues as (string | number)[];\n\n // Update internal value in uncontrolled mode\n if (!isControlled.value) {\n internalValue.value = props.multiple ? values : values[0];\n }\n\n // Emit events\n const value = props.multiple ? values : values[0];\n emit('update:modelValue', value);\n emit('change', value, selectedItems as SelectItem[]);\n};\n\nconst handleOpen = () => {\n emit('open');\n};\n\nconst handleClose = () => {\n emit('close');\n};\n\nconst handleSearch = (e: Event) => {\n const customEvent = e as CustomEvent<SearchEventDetail>;\n emit('search', customEvent.detail.query);\n};\n\nconst handleLoadMore = (e: Event) => {\n const customEvent = e as CustomEvent<LoadMoreEventDetail>;\n emit('loadMore', customEvent.detail.page);\n};\n\nconst handleCreate = (e: Event) => {\n const customEvent = e as CustomEvent<{ value: string }>;\n emit('create', customEvent.detail.value);\n};\n\nconst handleClear = (e: Event) => {\n const customEvent = e as CustomEvent<ClearEventDetail>;\n emit('clear', {\n clearedSelection: customEvent.detail.clearedSelection,\n clearedSearch: customEvent.detail.clearedSearch,\n });\n};\n\nconst handleDiagnostic = (e: Event) => {\n const customEvent = e as CustomEvent<DiagnosticEventDetail>;\n emit('diagnostic', customEvent.detail);\n};\n\n// Setup event listeners\nonMounted(async () => {\n await waitForUpgrade();\n if (!selectRef.value || !isElementReady.value) return;\n\n const element = selectRef.value as any;\n\n // Initial configuration\n updateConfig();\n\n if (props.placement) {\n element.setAttribute('placement', props.placement);\n }\n\n // Set initial items\n if (props.items?.length) {\n // Auto-convert flat items that include a `group` property into groupedItems\n const first = props.items[0];\n if (first && (first as any).group !== undefined) {\n const map = new Map<string, any[]>();\n props.items.forEach((it: any) => {\n const g = it.group ?? 'Ungrouped';\n if (!map.has(g)) map.set(g, []);\n map.get(g)!.push(it);\n });\n const groups = Array.from(map.entries()).map(([label, options]) => ({ label, options }));\n element.setGroupedItems(groups);\n } else {\n element.setItems(props.items);\n }\n }\n if (props.groupedItems?.length) {\n element.setGroupedItems(props.groupedItems);\n }\n\n // Set initial value\n if (currentValue.value !== undefined) {\n const values = Array.isArray(currentValue.value)\n ? currentValue.value\n : [currentValue.value];\n element.setSelectedValues(values);\n }\n\n // Add event listeners\n element.addEventListener('select', handleSelect as EventListener);\n element.addEventListener('change', handleChange as EventListener);\n element.addEventListener('open', handleOpen as EventListener);\n element.addEventListener('close', handleClose as EventListener);\n element.addEventListener('search', handleSearch as EventListener);\n element.addEventListener('loadMore', handleLoadMore as EventListener);\n element.addEventListener('create', handleCreate as EventListener);\n element.addEventListener('clear', handleClear as EventListener);\n element.addEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\nonBeforeUnmount(() => {\n customRendererCache.forEach((container) => render(null, container));\n customRendererCache.clear();\n\n if (!selectRef.value) return;\n\n const element = selectRef.value;\n\n // Remove event listeners\n element.removeEventListener('select', handleSelect as EventListener);\n element.removeEventListener('change', handleChange as EventListener);\n element.removeEventListener('open', handleOpen as EventListener);\n element.removeEventListener('close', handleClose as EventListener);\n element.removeEventListener('search', handleSearch as EventListener);\n element.removeEventListener('loadMore', handleLoadMore as EventListener);\n element.removeEventListener('create', handleCreate as EventListener);\n element.removeEventListener('clear', handleClear as EventListener);\n element.removeEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\n// Expose imperative API\ndefineExpose({\n /** Open the dropdown */\n open: () => {\n (selectRef.value as any)?.open();\n },\n /** Close the dropdown */\n close: () => {\n (selectRef.value as any)?.close();\n },\n /** Focus the select */\n focus: () => {\n selectRef.value?.focus();\n },\n /** Set items programmatically */\n setItems: (items: SelectItem[]) => {\n (selectRef.value as any)?.setItems(items);\n },\n /** Set grouped items programmatically */\n setGroupedItems: (groups: GroupedItem[]) => {\n (selectRef.value as any)?.setGroupedItems(groups);\n },\n /** Clear selection */\n clear: () => {\n (selectRef.value as any)?.setSelectedValues([]);\n if (!isControlled.value) {\n internalValue.value = props.multiple ? [] : undefined;\n }\n const value = props.multiple ? [] : '';\n emit('update:modelValue', value);\n emit('change', value, []);\n },\n /** Get selected items */\n getSelectedItems: () => {\n return (selectRef.value as any)?.getSelectedItems?.() || [];\n },\n /** Get selected values */\n getSelectedValues: () => {\n return (selectRef.value as any)?.getSelectedValues?.() || [];\n },\n /** Clear current search query */\n clearSearch: () => {\n (selectRef.value as any)?.clearSearch?.();\n },\n /** Apply partial core config at runtime */\n updateConfig: (config: Partial<GlobalSelectConfig>) => {\n (selectRef.value as any)?.updateConfig?.(config);\n },\n /** Set error state */\n setError: (message: string) => {\n (selectRef.value as any)?.setError?.(message);\n },\n /** Clear error state */\n clearError: () => {\n (selectRef.value as any)?.clearError?.();\n },\n /** Toggle required state */\n setRequired: (required: boolean) => {\n (selectRef.value as any)?.setRequired?.(required);\n },\n /** Validate the component */\n validate: () => {\n return (selectRef.value as any)?.validate?.() ?? true;\n },\n /** Runtime capability report */\n getCapabilities: () => {\n return (selectRef.value as any)?.getCapabilities?.();\n },\n /** Known limitations report */\n getKnownLimitations: () => {\n return (selectRef.value as any)?.getKnownLimitations?.() || [];\n },\n /** Tracking snapshot */\n getTrackingSnapshot: () => {\n return (selectRef.value as any)?.getTrackingSnapshot?.() || { events: [], styles: [], limitations: [] };\n },\n /** Clear tracking entries */\n clearTracking: (source?: 'event' | 'style' | 'limitation' | 'all') => {\n (selectRef.value as any)?.clearTracking?.(source);\n },\n /** Update limitation policies */\n setLimitationPolicies: (policies: LimitationPolicyMap) => {\n (selectRef.value as any)?.setLimitationPolicies?.(policies);\n },\n});\n</script>\n\n<style scoped>\n/* Component uses web component styling from @smilodon/core */\n</style>\n"],"names":["ref","watch","isVNode","render","h","computed","arraysEqualByValue","onMounted","onBeforeUnmount","_openBlock","_createElementBlock","_mergeProps","$attrs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuMA,UAAM,QAAQ;AAwBd,UAAM,OAAO;AAEb,UAA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iB,MAAM;;AACrB,gBAAQ,qBAAU,UAAV,mBAAyB,oBAAzB;AAAA,MACV;AAAA;AAAA,MAEA,qBAAqB,MAAM;;AACzB,iBAAQ,qBAAU,UAAV,mBAAyB,wBAAzB,gCAAoD,CAAA;AAAA,MAC9D;AAAA;AAAA,MAEA,qBAAqB,MAAM;;AACzB,iBAAQ,qBAAU,UAAV,mBAAyB,wBAAzB,gCAAoD,EAAE,QAAQ,CAAA,GAAI,QAAQ,CAAA,GAAI,aAAa,GAAC;AAAA,MACtG;AAAA;AAAA,MAEA,eAAe,CAAC,WAAsD;;AACnE,8BAAU,UAAV,mBAAyB,kBAAzB,4BAAyC;AAAA,MAC5C;AAAA;AAAA,MAEA,uBAAuB,CAAC,aAAkC;;AACvD,8BAAU,UAAV,mBAAyB,0BAAzB,4BAAiD;AAAA,MACpD;AAAA,IAAA,CACD;;AAn0BC,aAAAM,cAAA,GAAAC,uBAME,mBANFC,IAAAA,WAME;AAAA,iBALI;AAAA,QAAJ,KAAI;AAAA,MAAA,GACIC,KAAAA,QAAM;AAAA,QACb,OAAO,QAAA;AAAA,QACP,KAAK,QAAA;AAAA,QACL,OAAO,QAAA;AAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, isVNode, render, h, computed, onMounted, onBeforeUnmount, openBlock, createElementBlock,
|
|
1
|
+
import { defineComponent, ref, watch, isVNode, render, h, computed, onMounted, onBeforeUnmount, openBlock, createElementBlock, mergeProps } from "vue";
|
|
2
|
+
import { arraysEqualByValue } from "@smilodon/core";
|
|
3
|
+
import { configureSelect, resetSelectConfig, selectConfig } from "@smilodon/core";
|
|
2
4
|
const _hoisted_1 = ["dir"];
|
|
3
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...{
|
|
7
|
+
inheritAttrs: false
|
|
8
|
+
},
|
|
4
9
|
__name: "Select",
|
|
5
10
|
props: {
|
|
6
11
|
items: { default: () => [] },
|
|
@@ -18,6 +23,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
23
|
pageSize: { default: 50 },
|
|
19
24
|
virtualized: { type: Boolean, default: true },
|
|
20
25
|
maxSelections: {},
|
|
26
|
+
selectionConfig: {},
|
|
27
|
+
multiSelectDisplay: {},
|
|
28
|
+
scrollToSelected: {},
|
|
29
|
+
styles: {},
|
|
30
|
+
config: {},
|
|
21
31
|
removeButtonIcon: {},
|
|
22
32
|
disabledOptionBehavior: {},
|
|
23
33
|
showSelectedIndicator: { type: Boolean, default: true },
|
|
@@ -224,7 +234,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
224
234
|
if (newValue !== void 0) {
|
|
225
235
|
const currentSelected = ((_a = el.getSelectedValues) == null ? void 0 : _a.call(el)) || [];
|
|
226
236
|
const newValues = Array.isArray(newValue) ? newValue : [newValue];
|
|
227
|
-
const hasChanged =
|
|
237
|
+
const hasChanged = !arraysEqualByValue(currentSelected, newValues);
|
|
228
238
|
if (hasChanged) {
|
|
229
239
|
el.setSelectedValues(newValues);
|
|
230
240
|
}
|
|
@@ -241,17 +251,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
241
251
|
enabled: !props.disabled,
|
|
242
252
|
virtualize: props.virtualized,
|
|
243
253
|
direction: props.direction,
|
|
254
|
+
dropdownPlacement: {
|
|
255
|
+
mode: props.placement
|
|
256
|
+
},
|
|
244
257
|
selection: {
|
|
258
|
+
...props.selectionConfig ?? {},
|
|
245
259
|
mode: props.multiple ? "multi" : "single",
|
|
246
260
|
maxSelections: props.maxSelections,
|
|
247
261
|
removeButtonIcon: props.removeButtonIcon,
|
|
248
262
|
disabledOptionBehavior: props.disabledOptionBehavior,
|
|
249
263
|
showSelectedIndicator: props.showSelectedIndicator
|
|
250
264
|
},
|
|
265
|
+
multiSelectDisplay: props.multiSelectDisplay,
|
|
251
266
|
infiniteScroll: {
|
|
252
267
|
enabled: props.infiniteScroll,
|
|
253
268
|
pageSize: props.pageSize
|
|
254
269
|
},
|
|
270
|
+
scrollToSelected: {
|
|
271
|
+
enabled: true,
|
|
272
|
+
...props.scrollToSelected ?? {}
|
|
273
|
+
},
|
|
274
|
+
styles: props.styles,
|
|
255
275
|
expandable: {
|
|
256
276
|
enabled: props.expandable
|
|
257
277
|
},
|
|
@@ -276,6 +296,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
276
296
|
}
|
|
277
297
|
};
|
|
278
298
|
el.updateConfig(config);
|
|
299
|
+
if (props.config) {
|
|
300
|
+
el.updateConfig(props.config);
|
|
301
|
+
}
|
|
279
302
|
});
|
|
280
303
|
};
|
|
281
304
|
watch(
|
|
@@ -447,6 +470,46 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
447
470
|
emit("update:modelValue", value);
|
|
448
471
|
emit("change", value, []);
|
|
449
472
|
},
|
|
473
|
+
/** Get selected items */
|
|
474
|
+
getSelectedItems: () => {
|
|
475
|
+
var _a, _b;
|
|
476
|
+
return ((_b = (_a = selectRef.value) == null ? void 0 : _a.getSelectedItems) == null ? void 0 : _b.call(_a)) || [];
|
|
477
|
+
},
|
|
478
|
+
/** Get selected values */
|
|
479
|
+
getSelectedValues: () => {
|
|
480
|
+
var _a, _b;
|
|
481
|
+
return ((_b = (_a = selectRef.value) == null ? void 0 : _a.getSelectedValues) == null ? void 0 : _b.call(_a)) || [];
|
|
482
|
+
},
|
|
483
|
+
/** Clear current search query */
|
|
484
|
+
clearSearch: () => {
|
|
485
|
+
var _a, _b;
|
|
486
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.clearSearch) == null ? void 0 : _b.call(_a);
|
|
487
|
+
},
|
|
488
|
+
/** Apply partial core config at runtime */
|
|
489
|
+
updateConfig: (config) => {
|
|
490
|
+
var _a, _b;
|
|
491
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.updateConfig) == null ? void 0 : _b.call(_a, config);
|
|
492
|
+
},
|
|
493
|
+
/** Set error state */
|
|
494
|
+
setError: (message) => {
|
|
495
|
+
var _a, _b;
|
|
496
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.setError) == null ? void 0 : _b.call(_a, message);
|
|
497
|
+
},
|
|
498
|
+
/** Clear error state */
|
|
499
|
+
clearError: () => {
|
|
500
|
+
var _a, _b;
|
|
501
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.clearError) == null ? void 0 : _b.call(_a);
|
|
502
|
+
},
|
|
503
|
+
/** Toggle required state */
|
|
504
|
+
setRequired: (required) => {
|
|
505
|
+
var _a, _b;
|
|
506
|
+
(_b = (_a = selectRef.value) == null ? void 0 : _a.setRequired) == null ? void 0 : _b.call(_a, required);
|
|
507
|
+
},
|
|
508
|
+
/** Validate the component */
|
|
509
|
+
validate: () => {
|
|
510
|
+
var _a, _b;
|
|
511
|
+
return ((_b = (_a = selectRef.value) == null ? void 0 : _a.validate) == null ? void 0 : _b.call(_a)) ?? true;
|
|
512
|
+
},
|
|
450
513
|
/** Runtime capability report */
|
|
451
514
|
getCapabilities: () => {
|
|
452
515
|
var _a, _b;
|
|
@@ -474,13 +537,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
474
537
|
}
|
|
475
538
|
});
|
|
476
539
|
return (_ctx, _cache) => {
|
|
477
|
-
return openBlock(), createElementBlock("enhanced-select", {
|
|
540
|
+
return openBlock(), createElementBlock("enhanced-select", mergeProps({
|
|
478
541
|
ref_key: "selectRef",
|
|
479
|
-
ref: selectRef
|
|
480
|
-
|
|
542
|
+
ref: selectRef
|
|
543
|
+
}, _ctx.$attrs, {
|
|
544
|
+
class: __props.className,
|
|
481
545
|
dir: __props.direction,
|
|
482
|
-
style:
|
|
483
|
-
}, null,
|
|
546
|
+
style: __props.style
|
|
547
|
+
}), null, 16, _hoisted_1);
|
|
484
548
|
};
|
|
485
549
|
}
|
|
486
550
|
});
|
|
@@ -491,9 +555,12 @@ const _export_sfc = (sfc, props) => {
|
|
|
491
555
|
}
|
|
492
556
|
return target;
|
|
493
557
|
};
|
|
494
|
-
const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
558
|
+
const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fd74613f"]]);
|
|
495
559
|
export {
|
|
496
560
|
Select,
|
|
497
|
-
|
|
561
|
+
configureSelect,
|
|
562
|
+
Select as default,
|
|
563
|
+
resetSelectConfig,
|
|
564
|
+
selectConfig
|
|
498
565
|
};
|
|
499
566
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/Select.vue"],"sourcesContent":["<!--\n Smilodon Select Component for Vue 3\n \n A production-ready, accessible select component with advanced features:\n - Single and multi-select modes\n - Searchable with client or server-side filtering\n - Infinite scroll and virtual scrolling for large datasets\n - Grouped options\n - Custom rendering\n - Full keyboard navigation\n - WCAG 2.1 AAA compliant\n \n @example\n <Select\n :items=\"items\"\n v-model=\"selectedValue\"\n searchable\n placeholder=\"Select an option...\"\n />\n-->\n\n<template>\n <enhanced-select\n ref=\"selectRef\"\n :class=\"className\"\n :dir=\"direction\"\n :style=\"style\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, onMounted, onBeforeUnmount, computed, render, isVNode, h } from 'vue';\nimport type {\n SelectEventDetail,\n OpenEventDetail,\n CloseEventDetail,\n SearchEventDetail,\n ChangeEventDetail,\n LoadMoreEventDetail,\n ClearEventDetail,\n GroupedItem,\n ClassMap,\n RendererHelpers,\n DiagnosticEventDetail,\n LimitationPolicyMap,\n} from '@smilodon/core';\n\nexport interface SelectItem {\n value: string | number;\n label: string;\n disabled?: boolean;\n group?: string;\n [key: string]: any;\n}\n\nexport interface SelectProps {\n /** Array of items to display in the select */\n items?: SelectItem[];\n /** Grouped items (alternative to items) */\n groupedItems?: GroupedItem[];\n /** Custom renderer for group headers when groupedItems are used */\n groupHeaderRenderer?: (group: GroupedItem, index: number) => ReturnType<typeof h>;\n /** Selected value(s) - for v-model binding */\n modelValue?: string | number | (string | number)[];\n /** Default value for uncontrolled mode */\n defaultValue?: string | number | (string | number)[];\n /** Enable multi-select mode */\n multiple?: boolean;\n /** Enable search functionality */\n searchable?: boolean;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the select */\n disabled?: boolean;\n /** Mark as required */\n required?: boolean;\n /** Show error state */\n error?: boolean;\n /** Enable infinite scroll */\n infiniteScroll?: boolean;\n /** Number of items per page (for infinite scroll) */\n pageSize?: number;\n /** Enable virtual scrolling */\n virtualized?: boolean;\n /** Maximum number of selections (for multi-select) */\n maxSelections?: number;\n /** Custom icon/markup for selected chip remove buttons */\n removeButtonIcon?: string;\n /** Behavior overrides for visually disabled options */\n disabledOptionBehavior?: {\n selectable?: boolean;\n hoverable?: boolean;\n focusable?: boolean;\n };\n /** Show the selected-state side indicator */\n showSelectedIndicator?: boolean;\n /** Text and layout direction */\n direction?: 'ltr' | 'rtl';\n /** Dropdown placement */\n placement?: 'bottom' | 'top' | 'auto';\n /** Custom CSS class */\n className?: string;\n /** Custom inline styles */\n style?: Record<string, string>;\n /** State-class mapping for utility CSS frameworks */\n classMap?: ClassMap;\n /** Enable expandable dropdown */\n expandable?: boolean;\n\n /** Enable clear control button */\n clearable?: boolean;\n\n /** Clear selected values when clear control is clicked */\n clearSelectionOnClear?: boolean;\n\n /** Clear search query when clear control is clicked */\n clearSearchOnClear?: boolean;\n\n /** ARIA label for clear control */\n clearAriaLabel?: string;\n\n /** Icon text for clear control */\n clearIcon?: string;\n\n /** Custom option renderer returning an HTMLElement */\n optionRenderer?: (item: SelectItem, index: number, helpers: RendererHelpers) => HTMLElement;\n\n /** Custom Vue renderer returning a VNode */\n customRenderer?: (item: SelectItem, index: number) => ReturnType<typeof h>;\n\n /** Enable runtime tracking */\n trackingEnabled?: boolean;\n\n /** Track emitted events */\n trackEvents?: boolean;\n\n /** Track styling changes */\n trackStyling?: boolean;\n\n /** Track limitations and policy updates */\n trackLimitations?: boolean;\n\n /** Emit diagnostic events */\n emitDiagnostics?: boolean;\n\n /** Max entries retained per tracking channel */\n trackingMaxEntries?: number;\n\n /** Limitation control policies */\n limitationPolicies?: LimitationPolicyMap;\n\n /** Automatically mitigate mode switching limitation */\n autoMitigateRuntimeModeSwitch?: boolean;\n}\n\nexport interface SelectEmits {\n /** Emitted when selection changes - for v-model */\n (e: 'update:modelValue', value: string | number | (string | number)[]): void;\n /** Emitted when selection changes with full details */\n (e: 'change', value: string | number | (string | number)[], selectedItems: SelectItem[]): void;\n /** Emitted when an item is selected */\n (e: 'select', item: SelectItem, index: number): void;\n /** Emitted when dropdown opens */\n (e: 'open'): void;\n /** Emitted when dropdown closes */\n (e: 'close'): void;\n /** Emitted when search query changes */\n (e: 'search', query: string): void;\n /** Emitted when more items are requested (infinite scroll) */\n (e: 'loadMore', page: number): void;\n /** Emitted when user creates a new item (if enabled) */\n (e: 'create', value: string): void;\n /** Emitted when clear control is used */\n (e: 'clear', detail: { clearedSelection: boolean; clearedSearch: boolean }): void;\n /** Emitted when runtime diagnostics are enabled */\n (e: 'diagnostic', detail: DiagnosticEventDetail): void;\n}\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n items: () => [],\n multiple: false,\n searchable: false,\n disabled: false,\n required: false,\n error: false,\n infiniteScroll: false,\n pageSize: 50,\n virtualized: true,\n showSelectedIndicator: true,\n placement: 'auto',\n clearable: false,\n clearSelectionOnClear: true,\n clearSearchOnClear: true,\n trackingEnabled: false,\n trackEvents: true,\n trackStyling: true,\n trackLimitations: true,\n emitDiagnostics: false,\n trackingMaxEntries: 200,\n autoMitigateRuntimeModeSwitch: true,\n});\n\nconst emit = defineEmits<SelectEmits>();\n\nconst selectRef = ref<HTMLElement | null>(null);\nconst isElementReady = ref(false);\nconst internalValue = ref<string | number | (string | number)[] | undefined>(\n props.defaultValue\n);\nconst customRendererCache = new Map<number, HTMLElement>();\n\n// Manual management of renderer wrapper to avoid reactivity on function identity\nconst resolvedOptionRenderer = ref<any>(undefined);\n\n// Watch for structural changes in renderers (presence only)\nwatch(\n [() => !!props.optionRenderer, () => !!props.customRenderer],\n ([hasOption, hasCustom]) => {\n if (hasOption) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number, helpers: RendererHelpers) => {\n // Accessing props inside here is safe - it delegates to current prop\n return props.optionRenderer?.(item, index, helpers) || document.createElement('div');\n };\n } else if (hasCustom) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number) => {\n let container = customRendererCache.get(index);\n if (!container) {\n container = document.createElement('div');\n customRendererCache.set(index, container);\n }\n\n const node = props.customRenderer?.(item, index);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n } else {\n render(null, container);\n }\n return container;\n };\n } else {\n resolvedOptionRenderer.value = undefined;\n }\n },\n { immediate: true }\n);\n\n// Sync custom option renderer\n// We watch the stable `resolvedOptionRenderer` ref, which only updates when structure changes.\nwatch(\n resolvedOptionRenderer,\n (renderer) => {\n safeCall((el) => {\n (el as any).optionRenderer = renderer;\n });\n },\n { immediate: true }\n);\n\nwatch(\n () => props.classMap,\n (map) => {\n safeCall((el) => {\n (el as any).classMap = map;\n });\n },\n { immediate: true, deep: true }\n);\n\nconst waitForUpgrade = async () => {\n if (typeof window === 'undefined') return;\n\n // Ensure the module is loaded (it registers the custom element on import)\n if (!customElements.get('enhanced-select')) {\n await import('@smilodon/core');\n }\n\n const el = selectRef.value as any;\n if (!el) return;\n\n // Wait until the element is upgraded and its methods exist.\n // In some environments, the tag can be defined but the particular instance\n // hasn't been upgraded yet when watchers/mounted run.\n try {\n await customElements.whenDefined('enhanced-select');\n } catch {\n // ignore\n }\n\n // Retry a few frames to let the browser upgrade the instance.\n for (let i = 0; i < 5; i++) {\n const candidate = selectRef.value as any;\n if (candidate && typeof candidate.setItems === 'function') {\n isElementReady.value = true;\n if (resolvedOptionRenderer.value) {\n (candidate as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (props.classMap) {\n (candidate as any).classMap = props.classMap;\n }\n return;\n }\n await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));\n }\n\n isElementReady.value = typeof (selectRef.value as any)?.setItems === 'function';\n if (isElementReady.value && resolvedOptionRenderer.value) {\n (selectRef.value as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (isElementReady.value && props.classMap) {\n (selectRef.value as any).classMap = props.classMap;\n }\n};\n\nfunction safeCall(fn: (el: any) => void) {\n const el = selectRef.value as any;\n if (!el || !isElementReady.value) return;\n fn(el);\n}\n\n// Check if component is controlled\nconst isControlled = computed(() => props.modelValue !== undefined);\n\n// Get current value\nconst currentValue = computed(() =>\n isControlled.value ? props.modelValue : internalValue.value\n);\n\n// Sync items to web component\nwatch(\n () => props.items,\n (newItems) => {\n safeCall((el) => {\n if (newItems) el.setItems(newItems);\n });\n },\n { deep: true }\n);\n\n// Sync grouped items to web component\nwatch(\n () => props.groupedItems,\n (newGroups) => {\n safeCall((el) => {\n if (newGroups) el.setGroupedItems(newGroups);\n });\n },\n { deep: true }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// removed old watcher\n\n// We need to keep rendererRefs in sync with props\n// Wait, the previous replacement put the watch inside the script setup directly after refs.\n// That watch updates rendererRefs.\n// But we ALSO need to update the web component if the *presence* of renderers changes (e.g. going from undefined to defined).\n// The existing watcher below was watching `resolvedOptionRenderer.value`.\n// Since `resolvedOptionRenderer` computed now depends only on PRESENCE (implicitly through logic), it should remain stable.\n// So `watch(() => resolvedOptionRenderer.value)` will only fire when PRESENCE changes.\n// THIS IS EXACTLY WHAT WE WANT. It won't fire on identity change.\n// So the original watcher is actually fine as is!\n// BUT: I changed how `resolvedOptionRenderer` works. Let's double check if I broke the watch logic.\n// The computed property returns a *new function* only if the structure changes (e.g. `hasOptionRenderer` flips).\n// So the watcher below will trigger correctly only when structure changes.\n\n// Wait, I see I didn't include `rendererRefs` update in the previous `replace_string_in_file` properly?\n// Previous call:\n// Replaced `const resolvedOptionRenderer ...` block.\n// Included `rendererRefs` definition and `watch` to update refs.\n\n// But wait, the previous `replace_string_in_file` REPLACED the computed property, but did it include the watch for refs?\n// Yes.\n// So the code looks like:\n// ...\n// const rendererRefs = ...\n// watch( ... updates rendererRefs ... )\n// const resolvedOptionRenderer = computed( ... )\n// ...\n//\n// And further down there is existing code:\n// watch(() => resolvedOptionRenderer.value, ...)\n//\n// This existing code is correct! It will update the WC only when the wrapper function changes (which is stable).\n// So I don't need to change the watcher below.\n// UNLESS: The watcher below relies on `resolvedOptionRenderer.value` changing.\n// If props.customRenderer changes from `undefined` to `fn`, computed re-runs -> new wrapper -> watcher runs -> WC updated. Correct.\n// If props.customRenderer changes from `fn1` to `fn2`, computed (depending on `!!props`? No, computed in Vue tracks all dependencies accessed).\n// Wait! `resolvedOptionRenderer` accesses `rendererRefs`.\n// `rendererRefs` is a local object. It is NOT reactive (it's a plain object).\n// `computed` tracks dependencies. If I access `rendererRefs.customRenderer`, does Vue track it? No.\n// So `resolvedOptionRenderer` will NOT re-run when `rendererRefs` changes. This is GOOD. It's stable.\n// But `watch(() => [props.optionRenderer, props.customRenderer], ...)` updates `rendererRefs`.\n// So when `fn1` -> `fn2`, `rendererRefs` is updated. `resolvedOptionRenderer` is NOT re-computed. The OLD wrapper function is still used.\n// But the wrapper function calls `rendererRefs.customRenderer`. This is the NEW function `fn2`.\n// So it works! The wrapper delegates to the current ref.\n// And `resolvedOptionRenderer.value` (the wrapper) hasn't changed identity, so the watcher below (syncing to WC) does NOT fire.\n// This means `el.optionRenderer = wrapper` is NOT called again.\n// Is this okay? Yes, because `el.optionRenderer` is already set to the wrapper. The wrapper hasn't changed.\n// So the infinite loop is broken.\n\n// HOWEVER: I still need to check if my previous replacement was syntactically correct and complete.\n// I see I replaced `const resolvedOptionRenderer ...` with a block that includes `const rendererRefs ...`.\n// Let's verify `rendererRefs` is reactive or not.\n// `const rendererRefs = { ... }` is NOT reactive. This is intentional.\n// We don't want reactivity to trigger computed re-eval.\n\n// BUT `watch(() => [props.optionRenderer...])` updates it.\n// The watcher needs `props` to be in scope. `props` is defined above.\n// It seems correct.\n\n// One detail:\n// `const resolvedOptionRenderer = computed(() => { ... })`\n// Vue computed properties track dependencies.\n// Inside computed, I access `props.optionRenderer` (to check boolean).\n// So computed depends on `props.optionRenderer`.\n// If `props.optionRenderer` changes from `fn1` to `fn2`, `!!props.optionRenderer` is still `true`.\n// Does the dependency change?\n// Vue tracks access. If I only access `!!props.optionRenderer`, maybe it only tracks the boolean?\n// No, usually it tracks the property.\n// If I use `props.optionRenderer` in `if (props.optionRenderer)`, it tracks it.\n// So if it changes, computed re-runs!\n// And returns a NEW function.\n// So watcher runs -> WC update -> Loop.\n// I need `computed` to NOT depend on the function identity.\n// I should use `!!props.optionRenderer` in a way that doesn't trigger on identity change?\n// Or better: explicit dependencies or a structure that isolates the check.\n// In Vue `computed`, we can't easily control the dependency array like React's `useMemo`.\n// But we can access the boolean via a separate stable computed property or just trust that Vue's dependency tracking is based on value?.\n// No, props are reactive.\n// If I assume Vue computes re-run on prop change:\n// Then the wrapper is recreated.\n// I need `resolvedOptionRenderer` to be a `shallowRef` or generic `ref` that I manually update only when structure changes!\n// `computed` is risky here.\n\n// Better approach for Vue:\n// Use `ref` for the wrapper.\n// Watch `[() => !!props.optionRenderer, () => !!props.customRenderer]` explicitly.\n// When that specific boolean tuple changes, update the wrapper ref.\n// And have the \"Sync custom option renderer\" watch depend on that wrapper ref.\n\n// Let's undo/redo the Vue part with this safer `shallowRef` approach.\n\nwatch(\n () => [props.items, props.groupedItems],\n () => {\n const totalItems = props.groupedItems\n ? props.groupedItems.reduce((count, group) => count + group.options.length, 0)\n : props.items.length;\n\n customRendererCache.forEach((container, index) => {\n if (index >= totalItems) {\n render(null, container);\n customRendererCache.delete(index);\n }\n });\n },\n { deep: true }\n);\n\n// Sync value to web component\nwatch(\n currentValue,\n (newValue) => {\n safeCall((el) => {\n if (newValue !== undefined) {\n // Get current selected values from the element to avoid infinite loop\n const currentSelected = el.getSelectedValues?.() || [];\n const newValues = Array.isArray(newValue) ? newValue : [newValue];\n \n // Only update if values have actually changed\n const hasChanged = \n currentSelected.length !== newValues.length ||\n !currentSelected.every((v: any, i: number) => v === newValues[i]);\n \n if (hasChanged) {\n el.setSelectedValues(newValues);\n }\n }\n });\n },\n { immediate: true }\n);\n\n// Sync configuration\nconst updateConfig = () => {\n safeCall((el) => {\n const config = {\n searchable: props.searchable,\n placeholder: props.placeholder,\n enabled: !props.disabled,\n virtualize: props.virtualized,\n direction: props.direction,\n selection: {\n mode: props.multiple ? 'multi' : 'single',\n maxSelections: props.maxSelections,\n removeButtonIcon: props.removeButtonIcon,\n disabledOptionBehavior: props.disabledOptionBehavior,\n showSelectedIndicator: props.showSelectedIndicator,\n },\n infiniteScroll: {\n enabled: props.infiniteScroll,\n pageSize: props.pageSize,\n },\n expandable: {\n enabled: props.expandable,\n },\n clearControl: {\n enabled: props.clearable,\n clearSelection: props.clearSelectionOnClear,\n clearSearch: props.clearSearchOnClear,\n ariaLabel: props.clearAriaLabel,\n icon: props.clearIcon,\n },\n tracking: {\n enabled: props.trackingEnabled,\n events: props.trackEvents,\n styling: props.trackStyling,\n limitations: props.trackLimitations,\n emitDiagnostics: props.emitDiagnostics,\n maxEntries: props.trackingMaxEntries,\n },\n limitations: {\n policies: props.limitationPolicies,\n autoMitigateRuntimeModeSwitch: props.autoMitigateRuntimeModeSwitch,\n },\n };\n\n el.updateConfig(config);\n });\n};\n\nwatch(\n [\n () => props.searchable,\n () => props.placeholder,\n () => props.disabled,\n () => props.multiple,\n () => props.maxSelections,\n () => props.removeButtonIcon,\n () => props.infiniteScroll,\n () => props.pageSize,\n () => props.virtualized,\n () => props.direction,\n () => props.disabledOptionBehavior,\n () => props.showSelectedIndicator,\n () => props.expandable,\n () => props.clearable,\n () => props.clearSelectionOnClear,\n () => props.clearSearchOnClear,\n () => props.clearAriaLabel,\n () => props.clearIcon,\n () => props.trackingEnabled,\n () => props.trackEvents,\n () => props.trackStyling,\n () => props.trackLimitations,\n () => props.emitDiagnostics,\n () => props.trackingMaxEntries,\n () => props.limitationPolicies,\n () => props.autoMitigateRuntimeModeSwitch,\n ],\n updateConfig\n);\n\n// Event handlers\nconst handleSelect = (e: Event) => {\n const customEvent = e as CustomEvent<SelectEventDetail>;\n const { item, index } = customEvent.detail;\n emit('select', item as SelectItem, index);\n};\n\nconst handleChange = (e: Event) => {\n const customEvent = e as CustomEvent<ChangeEventDetail>;\n const { selectedItems, selectedValues } = customEvent.detail;\n\n const values = selectedValues as (string | number)[];\n\n // Update internal value in uncontrolled mode\n if (!isControlled.value) {\n internalValue.value = props.multiple ? values : values[0];\n }\n\n // Emit events\n const value = props.multiple ? values : values[0];\n emit('update:modelValue', value);\n emit('change', value, selectedItems as SelectItem[]);\n};\n\nconst handleOpen = () => {\n emit('open');\n};\n\nconst handleClose = () => {\n emit('close');\n};\n\nconst handleSearch = (e: Event) => {\n const customEvent = e as CustomEvent<SearchEventDetail>;\n emit('search', customEvent.detail.query);\n};\n\nconst handleLoadMore = (e: Event) => {\n const customEvent = e as CustomEvent<LoadMoreEventDetail>;\n emit('loadMore', customEvent.detail.page);\n};\n\nconst handleCreate = (e: Event) => {\n const customEvent = e as CustomEvent<{ value: string }>;\n emit('create', customEvent.detail.value);\n};\n\nconst handleClear = (e: Event) => {\n const customEvent = e as CustomEvent<ClearEventDetail>;\n emit('clear', {\n clearedSelection: customEvent.detail.clearedSelection,\n clearedSearch: customEvent.detail.clearedSearch,\n });\n};\n\nconst handleDiagnostic = (e: Event) => {\n const customEvent = e as CustomEvent<DiagnosticEventDetail>;\n emit('diagnostic', customEvent.detail);\n};\n\n// Setup event listeners\nonMounted(async () => {\n await waitForUpgrade();\n if (!selectRef.value || !isElementReady.value) return;\n\n const element = selectRef.value as any;\n\n // Initial configuration\n updateConfig();\n\n if (props.placement) {\n element.setAttribute('placement', props.placement);\n }\n\n // Set initial items\n if (props.items?.length) {\n // Auto-convert flat items that include a `group` property into groupedItems\n const first = props.items[0];\n if (first && (first as any).group !== undefined) {\n const map = new Map<string, any[]>();\n props.items.forEach((it: any) => {\n const g = it.group ?? 'Ungrouped';\n if (!map.has(g)) map.set(g, []);\n map.get(g)!.push(it);\n });\n const groups = Array.from(map.entries()).map(([label, options]) => ({ label, options }));\n element.setGroupedItems(groups);\n } else {\n element.setItems(props.items);\n }\n }\n if (props.groupedItems?.length) {\n element.setGroupedItems(props.groupedItems);\n }\n\n // Set initial value\n if (currentValue.value !== undefined) {\n const values = Array.isArray(currentValue.value)\n ? currentValue.value\n : [currentValue.value];\n element.setSelectedValues(values);\n }\n\n // Add event listeners\n element.addEventListener('select', handleSelect as EventListener);\n element.addEventListener('change', handleChange as EventListener);\n element.addEventListener('open', handleOpen as EventListener);\n element.addEventListener('close', handleClose as EventListener);\n element.addEventListener('search', handleSearch as EventListener);\n element.addEventListener('loadMore', handleLoadMore as EventListener);\n element.addEventListener('create', handleCreate as EventListener);\n element.addEventListener('clear', handleClear as EventListener);\n element.addEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\nonBeforeUnmount(() => {\n customRendererCache.forEach((container) => render(null, container));\n customRendererCache.clear();\n\n if (!selectRef.value) return;\n\n const element = selectRef.value;\n\n // Remove event listeners\n element.removeEventListener('select', handleSelect as EventListener);\n element.removeEventListener('change', handleChange as EventListener);\n element.removeEventListener('open', handleOpen as EventListener);\n element.removeEventListener('close', handleClose as EventListener);\n element.removeEventListener('search', handleSearch as EventListener);\n element.removeEventListener('loadMore', handleLoadMore as EventListener);\n element.removeEventListener('create', handleCreate as EventListener);\n element.removeEventListener('clear', handleClear as EventListener);\n element.removeEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\n// Expose imperative API\ndefineExpose({\n /** Open the dropdown */\n open: () => {\n (selectRef.value as any)?.open();\n },\n /** Close the dropdown */\n close: () => {\n (selectRef.value as any)?.close();\n },\n /** Focus the select */\n focus: () => {\n selectRef.value?.focus();\n },\n /** Set items programmatically */\n setItems: (items: SelectItem[]) => {\n (selectRef.value as any)?.setItems(items);\n },\n /** Set grouped items programmatically */\n setGroupedItems: (groups: GroupedItem[]) => {\n (selectRef.value as any)?.setGroupedItems(groups);\n },\n /** Clear selection */\n clear: () => {\n (selectRef.value as any)?.setSelectedValues([]);\n if (!isControlled.value) {\n internalValue.value = props.multiple ? [] : undefined;\n }\n const value = props.multiple ? [] : '';\n emit('update:modelValue', value);\n emit('change', value, []);\n },\n /** Runtime capability report */\n getCapabilities: () => {\n return (selectRef.value as any)?.getCapabilities?.();\n },\n /** Known limitations report */\n getKnownLimitations: () => {\n return (selectRef.value as any)?.getKnownLimitations?.() || [];\n },\n /** Tracking snapshot */\n getTrackingSnapshot: () => {\n return (selectRef.value as any)?.getTrackingSnapshot?.() || { events: [], styles: [], limitations: [] };\n },\n /** Clear tracking entries */\n clearTracking: (source?: 'event' | 'style' | 'limitation' | 'all') => {\n (selectRef.value as any)?.clearTracking?.(source);\n },\n /** Update limitation policies */\n setLimitationPolicies: (policies: LimitationPolicyMap) => {\n (selectRef.value as any)?.setLimitationPolicies?.(policies);\n },\n});\n</script>\n\n<style scoped>\n/* Component uses web component styling from @smilodon/core */\n</style>\n"],"names":["_createElementBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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AO,EAAE;AAAA,MAC1B;AAAA;AAAA,MAEA,iBAAiB,MAAM;;AACrB,gBAAQ,qBAAU,UAAV,mBAAyB,oBAAzB;AAAA,MACV;AAAA;AAAA,MAEA,qBAAqB,MAAM;;AACzB,iBAAQ,qBAAU,UAAV,mBAAyB,wBAAzB,gCAAoD,CAAA;AAAA,MAC9D;AAAA;AAAA,MAEA,qBAAqB,MAAM;;AACzB,iBAAQ,qBAAU,UAAV,mBAAyB,wBAAzB,gCAAoD,EAAE,QAAQ,CAAA,GAAI,QAAQ,CAAA,GAAI,aAAa,GAAC;AAAA,MACtG;AAAA;AAAA,MAEA,eAAe,CAAC,WAAsD;;AACnE,8BAAU,UAAV,mBAAyB,kBAAzB,4BAAyC;AAAA,MAC5C;AAAA;AAAA,MAEA,uBAAuB,CAAC,aAAkC;;AACvD,8BAAU,UAAV,mBAAyB,0BAAzB,4BAAiD;AAAA,MACpD;AAAA,IAAA,CACD;;0BAnwBCA,mBAKE,mBAAA;AAAA,iBAJI;AAAA,QAAJ,KAAI;AAAA,QACH,sBAAO,QAAA,SAAS;AAAA,QAChB,KAAK,QAAA;AAAA,QACL,sBAAO,QAAA,KAAK;AAAA,MAAA;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/Select.vue"],"sourcesContent":["<!--\n Smilodon Select Component for Vue 3\n \n A production-ready, accessible select component with advanced features:\n - Single and multi-select modes\n - Searchable with client or server-side filtering\n - Infinite scroll and virtual scrolling for large datasets\n - Grouped options\n - Custom rendering\n - Full keyboard navigation\n - WCAG 2.1 AAA compliant\n \n @example\n <Select\n :items=\"items\"\n v-model=\"selectedValue\"\n searchable\n placeholder=\"Select an option...\"\n />\n-->\n\n<template>\n <enhanced-select\n ref=\"selectRef\"\n v-bind=\"$attrs\"\n :class=\"className\"\n :dir=\"direction\"\n :style=\"style\"\n />\n</template>\n\n<script setup lang=\"ts\">\ndefineOptions({\n inheritAttrs: false,\n});\n\nimport { ref, watch, onMounted, onBeforeUnmount, computed, render, isVNode, h } from 'vue';\nimport { arraysEqualByValue } from '@smilodon/core';\nimport type {\n SelectEventDetail,\n OpenEventDetail,\n CloseEventDetail,\n SearchEventDetail,\n ChangeEventDetail,\n LoadMoreEventDetail,\n ClearEventDetail,\n GroupedItem,\n ClassMap,\n RendererHelpers,\n DiagnosticEventDetail,\n LimitationPolicyMap,\n GlobalSelectConfig,\n SelectionConfig,\n MultiSelectDisplayConfig,\n ScrollToSelectedConfig,\n StyleConfig,\n} from '@smilodon/core';\n\nexport interface SelectItem {\n value: string | number;\n label: string;\n disabled?: boolean;\n group?: string;\n [key: string]: any;\n}\n\nexport interface SelectProps {\n /** Array of items to display in the select */\n items?: SelectItem[];\n /** Grouped items (alternative to items) */\n groupedItems?: GroupedItem[];\n /** Custom renderer for group headers when groupedItems are used */\n groupHeaderRenderer?: (group: GroupedItem, index: number) => ReturnType<typeof h>;\n /** Selected value(s) - for v-model binding */\n modelValue?: string | number | (string | number)[];\n /** Default value for uncontrolled mode */\n defaultValue?: string | number | (string | number)[];\n /** Enable multi-select mode */\n multiple?: boolean;\n /** Enable search functionality */\n searchable?: boolean;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the select */\n disabled?: boolean;\n /** Mark as required */\n required?: boolean;\n /** Show error state */\n error?: boolean;\n /** Enable infinite scroll */\n infiniteScroll?: boolean;\n /** Number of items per page (for infinite scroll) */\n pageSize?: number;\n /** Enable virtual scrolling */\n virtualized?: boolean;\n /** Maximum number of selections (for multi-select) */\n maxSelections?: number;\n /** Partial core selection config for advanced selection behavior */\n selectionConfig?: Partial<SelectionConfig>;\n /** Multi-select chip display behavior */\n multiSelectDisplay?: Partial<MultiSelectDisplayConfig>;\n /** Scroll-to-selected behavior */\n scrollToSelected?: Partial<ScrollToSelectedConfig>;\n /** Core style configuration for internal parts */\n styles?: StyleConfig;\n /** Full core config passthrough for advanced runtime features */\n config?: Partial<GlobalSelectConfig>;\n /** Custom icon/markup for selected chip remove buttons */\n removeButtonIcon?: string;\n /** Behavior overrides for visually disabled options */\n disabledOptionBehavior?: {\n selectable?: boolean;\n hoverable?: boolean;\n focusable?: boolean;\n };\n /** Show the selected-state side indicator */\n showSelectedIndicator?: boolean;\n /** Text and layout direction */\n direction?: 'ltr' | 'rtl';\n /** Dropdown placement */\n placement?: 'bottom' | 'top' | 'auto';\n /** Custom CSS class */\n className?: string;\n /** Custom inline styles */\n style?: Record<string, string>;\n /** State-class mapping for utility CSS frameworks */\n classMap?: ClassMap;\n /** Enable expandable dropdown */\n expandable?: boolean;\n\n /** Enable clear control button */\n clearable?: boolean;\n\n /** Clear selected values when clear control is clicked */\n clearSelectionOnClear?: boolean;\n\n /** Clear search query when clear control is clicked */\n clearSearchOnClear?: boolean;\n\n /** ARIA label for clear control */\n clearAriaLabel?: string;\n\n /** Icon text for clear control */\n clearIcon?: string;\n\n /** Custom option renderer returning an HTMLElement */\n optionRenderer?: (item: SelectItem, index: number, helpers: RendererHelpers) => HTMLElement;\n\n /** Custom Vue renderer returning a VNode */\n customRenderer?: (item: SelectItem, index: number) => ReturnType<typeof h>;\n\n /** Enable runtime tracking */\n trackingEnabled?: boolean;\n\n /** Track emitted events */\n trackEvents?: boolean;\n\n /** Track styling changes */\n trackStyling?: boolean;\n\n /** Track limitations and policy updates */\n trackLimitations?: boolean;\n\n /** Emit diagnostic events */\n emitDiagnostics?: boolean;\n\n /** Max entries retained per tracking channel */\n trackingMaxEntries?: number;\n\n /** Limitation control policies */\n limitationPolicies?: LimitationPolicyMap;\n\n /** Automatically mitigate mode switching limitation */\n autoMitigateRuntimeModeSwitch?: boolean;\n}\n\nexport interface SelectEmits {\n /** Emitted when selection changes - for v-model */\n (e: 'update:modelValue', value: string | number | (string | number)[]): void;\n /** Emitted when selection changes with full details */\n (e: 'change', value: string | number | (string | number)[], selectedItems: SelectItem[]): void;\n /** Emitted when an item is selected */\n (e: 'select', item: SelectItem, index: number): void;\n /** Emitted when dropdown opens */\n (e: 'open'): void;\n /** Emitted when dropdown closes */\n (e: 'close'): void;\n /** Emitted when search query changes */\n (e: 'search', query: string): void;\n /** Emitted when more items are requested (infinite scroll) */\n (e: 'loadMore', page: number): void;\n /** Emitted when user creates a new item (if enabled) */\n (e: 'create', value: string): void;\n /** Emitted when clear control is used */\n (e: 'clear', detail: { clearedSelection: boolean; clearedSearch: boolean }): void;\n /** Emitted when runtime diagnostics are enabled */\n (e: 'diagnostic', detail: DiagnosticEventDetail): void;\n}\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n items: () => [],\n multiple: false,\n searchable: false,\n disabled: false,\n required: false,\n error: false,\n infiniteScroll: false,\n pageSize: 50,\n virtualized: true,\n showSelectedIndicator: true,\n placement: 'auto',\n clearable: false,\n clearSelectionOnClear: true,\n clearSearchOnClear: true,\n trackingEnabled: false,\n trackEvents: true,\n trackStyling: true,\n trackLimitations: true,\n emitDiagnostics: false,\n trackingMaxEntries: 200,\n autoMitigateRuntimeModeSwitch: true,\n});\n\nconst emit = defineEmits<SelectEmits>();\n\nconst selectRef = ref<HTMLElement | null>(null);\nconst isElementReady = ref(false);\nconst internalValue = ref<string | number | (string | number)[] | undefined>(\n props.defaultValue\n);\nconst customRendererCache = new Map<number, HTMLElement>();\n\n// Manual management of renderer wrapper to avoid reactivity on function identity\nconst resolvedOptionRenderer = ref<any>(undefined);\n\n// Watch for structural changes in renderers (presence only)\nwatch(\n [() => !!props.optionRenderer, () => !!props.customRenderer],\n ([hasOption, hasCustom]) => {\n if (hasOption) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number, helpers: RendererHelpers) => {\n // Accessing props inside here is safe - it delegates to current prop\n return props.optionRenderer?.(item, index, helpers) || document.createElement('div');\n };\n } else if (hasCustom) {\n resolvedOptionRenderer.value = (item: SelectItem, index: number) => {\n let container = customRendererCache.get(index);\n if (!container) {\n container = document.createElement('div');\n customRendererCache.set(index, container);\n }\n\n const node = props.customRenderer?.(item, index);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n } else {\n render(null, container);\n }\n return container;\n };\n } else {\n resolvedOptionRenderer.value = undefined;\n }\n },\n { immediate: true }\n);\n\n// Sync custom option renderer\n// We watch the stable `resolvedOptionRenderer` ref, which only updates when structure changes.\nwatch(\n resolvedOptionRenderer,\n (renderer) => {\n safeCall((el) => {\n (el as any).optionRenderer = renderer;\n });\n },\n { immediate: true }\n);\n\nwatch(\n () => props.classMap,\n (map) => {\n safeCall((el) => {\n (el as any).classMap = map;\n });\n },\n { immediate: true, deep: true }\n);\n\nconst waitForUpgrade = async () => {\n if (typeof window === 'undefined') return;\n\n // Ensure the module is loaded (it registers the custom element on import)\n if (!customElements.get('enhanced-select')) {\n await import('@smilodon/core');\n }\n\n const el = selectRef.value as any;\n if (!el) return;\n\n // Wait until the element is upgraded and its methods exist.\n // In some environments, the tag can be defined but the particular instance\n // hasn't been upgraded yet when watchers/mounted run.\n try {\n await customElements.whenDefined('enhanced-select');\n } catch {\n // ignore\n }\n\n // Retry a few frames to let the browser upgrade the instance.\n for (let i = 0; i < 5; i++) {\n const candidate = selectRef.value as any;\n if (candidate && typeof candidate.setItems === 'function') {\n isElementReady.value = true;\n if (resolvedOptionRenderer.value) {\n (candidate as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (props.classMap) {\n (candidate as any).classMap = props.classMap;\n }\n return;\n }\n await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));\n }\n\n isElementReady.value = typeof (selectRef.value as any)?.setItems === 'function';\n if (isElementReady.value && resolvedOptionRenderer.value) {\n (selectRef.value as any).optionRenderer = resolvedOptionRenderer.value;\n }\n if (isElementReady.value && props.classMap) {\n (selectRef.value as any).classMap = props.classMap;\n }\n};\n\nfunction safeCall(fn: (el: any) => void) {\n const el = selectRef.value as any;\n if (!el || !isElementReady.value) return;\n fn(el);\n}\n\n// Check if component is controlled\nconst isControlled = computed(() => props.modelValue !== undefined);\n\n// Get current value\nconst currentValue = computed(() =>\n isControlled.value ? props.modelValue : internalValue.value\n);\n\n// Sync items to web component\nwatch(\n () => props.items,\n (newItems) => {\n safeCall((el) => {\n if (newItems) el.setItems(newItems);\n });\n },\n { deep: true }\n);\n\n// Sync grouped items to web component\nwatch(\n () => props.groupedItems,\n (newGroups) => {\n safeCall((el) => {\n if (newGroups) el.setGroupedItems(newGroups);\n });\n },\n { deep: true }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// Sync custom group header renderer\nwatch(\n () => props.groupHeaderRenderer,\n (renderer) => {\n safeCall((el) => {\n if (renderer) {\n el.groupHeaderRenderer = (group: any, idx: number) => {\n const container = document.createElement('div');\n const node = renderer(group, idx);\n if (node && isVNode(node)) {\n render(node, container);\n } else if (node) {\n render(h('span', String(node)), container);\n }\n return container;\n };\n }\n });\n }\n);\n\n// removed old watcher\n\n// We need to keep rendererRefs in sync with props\n// Wait, the previous replacement put the watch inside the script setup directly after refs.\n// That watch updates rendererRefs.\n// But we ALSO need to update the web component if the *presence* of renderers changes (e.g. going from undefined to defined).\n// The existing watcher below was watching `resolvedOptionRenderer.value`.\n// Since `resolvedOptionRenderer` computed now depends only on PRESENCE (implicitly through logic), it should remain stable.\n// So `watch(() => resolvedOptionRenderer.value)` will only fire when PRESENCE changes.\n// THIS IS EXACTLY WHAT WE WANT. It won't fire on identity change.\n// So the original watcher is actually fine as is!\n// BUT: I changed how `resolvedOptionRenderer` works. Let's double check if I broke the watch logic.\n// The computed property returns a *new function* only if the structure changes (e.g. `hasOptionRenderer` flips).\n// So the watcher below will trigger correctly only when structure changes.\n\n// Wait, I see I didn't include `rendererRefs` update in the previous `replace_string_in_file` properly?\n// Previous call:\n// Replaced `const resolvedOptionRenderer ...` block.\n// Included `rendererRefs` definition and `watch` to update refs.\n\n// But wait, the previous `replace_string_in_file` REPLACED the computed property, but did it include the watch for refs?\n// Yes.\n// So the code looks like:\n// ...\n// const rendererRefs = ...\n// watch( ... updates rendererRefs ... )\n// const resolvedOptionRenderer = computed( ... )\n// ...\n//\n// And further down there is existing code:\n// watch(() => resolvedOptionRenderer.value, ...)\n//\n// This existing code is correct! It will update the WC only when the wrapper function changes (which is stable).\n// So I don't need to change the watcher below.\n// UNLESS: The watcher below relies on `resolvedOptionRenderer.value` changing.\n// If props.customRenderer changes from `undefined` to `fn`, computed re-runs -> new wrapper -> watcher runs -> WC updated. Correct.\n// If props.customRenderer changes from `fn1` to `fn2`, computed (depending on `!!props`? No, computed in Vue tracks all dependencies accessed).\n// Wait! `resolvedOptionRenderer` accesses `rendererRefs`.\n// `rendererRefs` is a local object. It is NOT reactive (it's a plain object).\n// `computed` tracks dependencies. If I access `rendererRefs.customRenderer`, does Vue track it? No.\n// So `resolvedOptionRenderer` will NOT re-run when `rendererRefs` changes. This is GOOD. It's stable.\n// But `watch(() => [props.optionRenderer, props.customRenderer], ...)` updates `rendererRefs`.\n// So when `fn1` -> `fn2`, `rendererRefs` is updated. `resolvedOptionRenderer` is NOT re-computed. The OLD wrapper function is still used.\n// But the wrapper function calls `rendererRefs.customRenderer`. This is the NEW function `fn2`.\n// So it works! The wrapper delegates to the current ref.\n// And `resolvedOptionRenderer.value` (the wrapper) hasn't changed identity, so the watcher below (syncing to WC) does NOT fire.\n// This means `el.optionRenderer = wrapper` is NOT called again.\n// Is this okay? Yes, because `el.optionRenderer` is already set to the wrapper. The wrapper hasn't changed.\n// So the infinite loop is broken.\n\n// HOWEVER: I still need to check if my previous replacement was syntactically correct and complete.\n// I see I replaced `const resolvedOptionRenderer ...` with a block that includes `const rendererRefs ...`.\n// Let's verify `rendererRefs` is reactive or not.\n// `const rendererRefs = { ... }` is NOT reactive. This is intentional.\n// We don't want reactivity to trigger computed re-eval.\n\n// BUT `watch(() => [props.optionRenderer...])` updates it.\n// The watcher needs `props` to be in scope. `props` is defined above.\n// It seems correct.\n\n// One detail:\n// `const resolvedOptionRenderer = computed(() => { ... })`\n// Vue computed properties track dependencies.\n// Inside computed, I access `props.optionRenderer` (to check boolean).\n// So computed depends on `props.optionRenderer`.\n// If `props.optionRenderer` changes from `fn1` to `fn2`, `!!props.optionRenderer` is still `true`.\n// Does the dependency change?\n// Vue tracks access. If I only access `!!props.optionRenderer`, maybe it only tracks the boolean?\n// No, usually it tracks the property.\n// If I use `props.optionRenderer` in `if (props.optionRenderer)`, it tracks it.\n// So if it changes, computed re-runs!\n// And returns a NEW function.\n// So watcher runs -> WC update -> Loop.\n// I need `computed` to NOT depend on the function identity.\n// I should use `!!props.optionRenderer` in a way that doesn't trigger on identity change?\n// Or better: explicit dependencies or a structure that isolates the check.\n// In Vue `computed`, we can't easily control the dependency array like React's `useMemo`.\n// But we can access the boolean via a separate stable computed property or just trust that Vue's dependency tracking is based on value?.\n// No, props are reactive.\n// If I assume Vue computes re-run on prop change:\n// Then the wrapper is recreated.\n// I need `resolvedOptionRenderer` to be a `shallowRef` or generic `ref` that I manually update only when structure changes!\n// `computed` is risky here.\n\n// Better approach for Vue:\n// Use `ref` for the wrapper.\n// Watch `[() => !!props.optionRenderer, () => !!props.customRenderer]` explicitly.\n// When that specific boolean tuple changes, update the wrapper ref.\n// And have the \"Sync custom option renderer\" watch depend on that wrapper ref.\n\n// Let's undo/redo the Vue part with this safer `shallowRef` approach.\n\nwatch(\n () => [props.items, props.groupedItems],\n () => {\n const totalItems = props.groupedItems\n ? props.groupedItems.reduce((count, group) => count + group.options.length, 0)\n : props.items.length;\n\n customRendererCache.forEach((container, index) => {\n if (index >= totalItems) {\n render(null, container);\n customRendererCache.delete(index);\n }\n });\n },\n { deep: true }\n);\n\n// Sync value to web component\nwatch(\n currentValue,\n (newValue) => {\n safeCall((el) => {\n if (newValue !== undefined) {\n // Get current selected values from the element to avoid infinite loop\n const currentSelected = el.getSelectedValues?.() || [];\n const newValues = Array.isArray(newValue) ? newValue : [newValue];\n \n // Only update if values have actually changed\n const hasChanged = !arraysEqualByValue(currentSelected, newValues);\n \n if (hasChanged) {\n el.setSelectedValues(newValues);\n }\n }\n });\n },\n { immediate: true }\n);\n\n// Sync configuration\nconst updateConfig = () => {\n safeCall((el) => {\n const config = {\n searchable: props.searchable,\n placeholder: props.placeholder,\n enabled: !props.disabled,\n virtualize: props.virtualized,\n direction: props.direction,\n dropdownPlacement: {\n mode: props.placement,\n },\n selection: {\n ...(props.selectionConfig ?? {}),\n mode: props.multiple ? 'multi' : 'single',\n maxSelections: props.maxSelections,\n removeButtonIcon: props.removeButtonIcon,\n disabledOptionBehavior: props.disabledOptionBehavior,\n showSelectedIndicator: props.showSelectedIndicator,\n },\n multiSelectDisplay: props.multiSelectDisplay,\n infiniteScroll: {\n enabled: props.infiniteScroll,\n pageSize: props.pageSize,\n },\n scrollToSelected: {\n enabled: true,\n ...(props.scrollToSelected ?? {}),\n },\n styles: props.styles,\n expandable: {\n enabled: props.expandable,\n },\n clearControl: {\n enabled: props.clearable,\n clearSelection: props.clearSelectionOnClear,\n clearSearch: props.clearSearchOnClear,\n ariaLabel: props.clearAriaLabel,\n icon: props.clearIcon,\n },\n tracking: {\n enabled: props.trackingEnabled,\n events: props.trackEvents,\n styling: props.trackStyling,\n limitations: props.trackLimitations,\n emitDiagnostics: props.emitDiagnostics,\n maxEntries: props.trackingMaxEntries,\n },\n limitations: {\n policies: props.limitationPolicies,\n autoMitigateRuntimeModeSwitch: props.autoMitigateRuntimeModeSwitch,\n },\n };\n\n el.updateConfig(config);\n if (props.config) {\n el.updateConfig(props.config);\n }\n });\n};\n\nwatch(\n [\n () => props.searchable,\n () => props.placeholder,\n () => props.disabled,\n () => props.multiple,\n () => props.maxSelections,\n () => props.removeButtonIcon,\n () => props.infiniteScroll,\n () => props.pageSize,\n () => props.virtualized,\n () => props.direction,\n () => props.disabledOptionBehavior,\n () => props.showSelectedIndicator,\n () => props.expandable,\n () => props.clearable,\n () => props.clearSelectionOnClear,\n () => props.clearSearchOnClear,\n () => props.clearAriaLabel,\n () => props.clearIcon,\n () => props.trackingEnabled,\n () => props.trackEvents,\n () => props.trackStyling,\n () => props.trackLimitations,\n () => props.emitDiagnostics,\n () => props.trackingMaxEntries,\n () => props.limitationPolicies,\n () => props.autoMitigateRuntimeModeSwitch,\n ],\n updateConfig\n);\n\n// Event handlers\nconst handleSelect = (e: Event) => {\n const customEvent = e as CustomEvent<SelectEventDetail>;\n const { item, index } = customEvent.detail;\n emit('select', item as SelectItem, index);\n};\n\nconst handleChange = (e: Event) => {\n const customEvent = e as CustomEvent<ChangeEventDetail>;\n const { selectedItems, selectedValues } = customEvent.detail;\n\n const values = selectedValues as (string | number)[];\n\n // Update internal value in uncontrolled mode\n if (!isControlled.value) {\n internalValue.value = props.multiple ? values : values[0];\n }\n\n // Emit events\n const value = props.multiple ? values : values[0];\n emit('update:modelValue', value);\n emit('change', value, selectedItems as SelectItem[]);\n};\n\nconst handleOpen = () => {\n emit('open');\n};\n\nconst handleClose = () => {\n emit('close');\n};\n\nconst handleSearch = (e: Event) => {\n const customEvent = e as CustomEvent<SearchEventDetail>;\n emit('search', customEvent.detail.query);\n};\n\nconst handleLoadMore = (e: Event) => {\n const customEvent = e as CustomEvent<LoadMoreEventDetail>;\n emit('loadMore', customEvent.detail.page);\n};\n\nconst handleCreate = (e: Event) => {\n const customEvent = e as CustomEvent<{ value: string }>;\n emit('create', customEvent.detail.value);\n};\n\nconst handleClear = (e: Event) => {\n const customEvent = e as CustomEvent<ClearEventDetail>;\n emit('clear', {\n clearedSelection: customEvent.detail.clearedSelection,\n clearedSearch: customEvent.detail.clearedSearch,\n });\n};\n\nconst handleDiagnostic = (e: Event) => {\n const customEvent = e as CustomEvent<DiagnosticEventDetail>;\n emit('diagnostic', customEvent.detail);\n};\n\n// Setup event listeners\nonMounted(async () => {\n await waitForUpgrade();\n if (!selectRef.value || !isElementReady.value) return;\n\n const element = selectRef.value as any;\n\n // Initial configuration\n updateConfig();\n\n if (props.placement) {\n element.setAttribute('placement', props.placement);\n }\n\n // Set initial items\n if (props.items?.length) {\n // Auto-convert flat items that include a `group` property into groupedItems\n const first = props.items[0];\n if (first && (first as any).group !== undefined) {\n const map = new Map<string, any[]>();\n props.items.forEach((it: any) => {\n const g = it.group ?? 'Ungrouped';\n if (!map.has(g)) map.set(g, []);\n map.get(g)!.push(it);\n });\n const groups = Array.from(map.entries()).map(([label, options]) => ({ label, options }));\n element.setGroupedItems(groups);\n } else {\n element.setItems(props.items);\n }\n }\n if (props.groupedItems?.length) {\n element.setGroupedItems(props.groupedItems);\n }\n\n // Set initial value\n if (currentValue.value !== undefined) {\n const values = Array.isArray(currentValue.value)\n ? currentValue.value\n : [currentValue.value];\n element.setSelectedValues(values);\n }\n\n // Add event listeners\n element.addEventListener('select', handleSelect as EventListener);\n element.addEventListener('change', handleChange as EventListener);\n element.addEventListener('open', handleOpen as EventListener);\n element.addEventListener('close', handleClose as EventListener);\n element.addEventListener('search', handleSearch as EventListener);\n element.addEventListener('loadMore', handleLoadMore as EventListener);\n element.addEventListener('create', handleCreate as EventListener);\n element.addEventListener('clear', handleClear as EventListener);\n element.addEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\nonBeforeUnmount(() => {\n customRendererCache.forEach((container) => render(null, container));\n customRendererCache.clear();\n\n if (!selectRef.value) return;\n\n const element = selectRef.value;\n\n // Remove event listeners\n element.removeEventListener('select', handleSelect as EventListener);\n element.removeEventListener('change', handleChange as EventListener);\n element.removeEventListener('open', handleOpen as EventListener);\n element.removeEventListener('close', handleClose as EventListener);\n element.removeEventListener('search', handleSearch as EventListener);\n element.removeEventListener('loadMore', handleLoadMore as EventListener);\n element.removeEventListener('create', handleCreate as EventListener);\n element.removeEventListener('clear', handleClear as EventListener);\n element.removeEventListener('diagnostic', handleDiagnostic as EventListener);\n});\n\n// Expose imperative API\ndefineExpose({\n /** Open the dropdown */\n open: () => {\n (selectRef.value as any)?.open();\n },\n /** Close the dropdown */\n close: () => {\n (selectRef.value as any)?.close();\n },\n /** Focus the select */\n focus: () => {\n selectRef.value?.focus();\n },\n /** Set items programmatically */\n setItems: (items: SelectItem[]) => {\n (selectRef.value as any)?.setItems(items);\n },\n /** Set grouped items programmatically */\n setGroupedItems: (groups: GroupedItem[]) => {\n (selectRef.value as any)?.setGroupedItems(groups);\n },\n /** Clear selection */\n clear: () => {\n (selectRef.value as any)?.setSelectedValues([]);\n if (!isControlled.value) {\n internalValue.value = props.multiple ? [] : undefined;\n }\n const value = props.multiple ? [] : '';\n emit('update:modelValue', value);\n emit('change', value, []);\n },\n /** Get selected items */\n getSelectedItems: () => {\n return (selectRef.value as any)?.getSelectedItems?.() || [];\n },\n /** Get selected values */\n getSelectedValues: () => {\n return (selectRef.value as any)?.getSelectedValues?.() || [];\n },\n /** Clear current search query */\n clearSearch: () => {\n (selectRef.value as any)?.clearSearch?.();\n },\n /** Apply partial core config at runtime */\n updateConfig: (config: Partial<GlobalSelectConfig>) => {\n (selectRef.value as any)?.updateConfig?.(config);\n },\n /** Set error state */\n setError: (message: string) => {\n (selectRef.value as any)?.setError?.(message);\n },\n /** Clear error state */\n clearError: () => {\n (selectRef.value as any)?.clearError?.();\n },\n /** Toggle required state */\n setRequired: (required: boolean) => {\n (selectRef.value as any)?.setRequired?.(required);\n },\n /** Validate the component */\n validate: () => {\n return (selectRef.value as any)?.validate?.() ?? true;\n },\n /** Runtime capability report */\n getCapabilities: () => {\n return (selectRef.value as any)?.getCapabilities?.();\n },\n /** Known limitations report */\n getKnownLimitations: () => {\n return (selectRef.value as any)?.getKnownLimitations?.() || [];\n },\n /** Tracking snapshot */\n getTrackingSnapshot: () => {\n return (selectRef.value as any)?.getTrackingSnapshot?.() || { events: [], styles: [], limitations: [] };\n },\n /** Clear tracking entries */\n clearTracking: (source?: 'event' | 'style' | 'limitation' | 'all') => {\n (selectRef.value as any)?.clearTracking?.(source);\n },\n /** Update limitation policies */\n setLimitationPolicies: (policies: LimitationPolicyMap) => {\n (selectRef.value as any)?.setLimitationPolicies?.(policies);\n },\n});\n</script>\n\n<style scoped>\n/* Component uses web component styling from @smilodon/core */\n</style>\n"],"names":["_openBlock","_createElementBlock","_mergeProps","$attrs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuMA,UAAM,QAAQ;AAwBd,UAAM,OAAO;AAEb,UAAM,YAAY,IAAwB,IAAI;AAC9C,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,gBAAgB;AAAA,MACpB,MAAM;AAAA,IAAA;AAER,UAAM,0CAA0B,IAAA;AAGhC,UAAM,yBAAyB,IAAS,MAAS;AAGjD;AAAA,MACE,CAAC,MAAM,CAAC,CAAC,MAAM,gBAAgB,MAAM,CAAC,CAAC,MAAM,cAAc;AAAA,MAC3D,CAAC,CAAC,WAAW,SAAS,MAAM;AAC1B,YAAI,WAAW;AACb,iCAAuB,QAAQ,CAAC,MAAkB,OAAe,YAA6B;;AAE5F,qBAAO,WAAM,mBAAN,+BAAuB,MAAM,OAAO,aAAY,SAAS,cAAc,KAAK;AAAA,UACrF;AAAA,QACF,WAAW,WAAW;AACpB,iCAAuB,QAAQ,CAAC,MAAkB,UAAkB;;AAClE,gBAAI,YAAY,oBAAoB,IAAI,KAAK;AAC7C,gBAAI,CAAC,WAAW;AACd,0BAAY,SAAS,cAAc,KAAK;AACxC,kCAAoB,IAAI,OAAO,SAAS;AAAA,YAC1C;AAEA,kBAAM,QAAO,WAAM,mBAAN,+BAAuB,MAAM;AAC1C,gBAAI,QAAQ,QAAQ,IAAI,GAAG;AACzB,qBAAO,MAAM,SAAS;AAAA,YACxB,WAAW,MAAM;AACf,qBAAO,EAAE,QAAQ,OAAO,IAAI,CAAC,GAAG,SAAS;AAAA,YAC3C,OAAO;AACL,qBAAO,MAAM,SAAS;AAAA,YACxB;AACA,mBAAO;AAAA,UACT;AAAA,QACF,OAAO;AACL,iCAAuB,QAAQ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AiB,MAAM;;AACrB,gBAAQ,qBAAU,UAAV,mBAAyB,oBAAzB;AAAA,MACV;AAAA;AAAA,MAEA,qBAAqB,MAAM;;AACzB,iBAAQ,qBAAU,UAAV,mBAAyB,wBAAzB,gCAAoD,CAAA;AAAA,MAC9D;AAAA;AAAA,MAEA,qBAAqB,MAAM;;AACzB,iBAAQ,qBAAU,UAAV,mBAAyB,wBAAzB,gCAAoD,EAAE,QAAQ,CAAA,GAAI,QAAQ,CAAA,GAAI,aAAa,GAAC;AAAA,MACtG;AAAA;AAAA,MAEA,eAAe,CAAC,WAAsD;;AACnE,8BAAU,UAAV,mBAAyB,kBAAzB,4BAAyC;AAAA,MAC5C;AAAA;AAAA,MAEA,uBAAuB,CAAC,aAAkC;;AACvD,8BAAU,UAAV,mBAAyB,0BAAzB,4BAAiD;AAAA,MACpD;AAAA,IAAA,CACD;;AAn0BC,aAAAA,UAAA,GAAAC,mBAME,mBANFC,WAME;AAAA,iBALI;AAAA,QAAJ,KAAI;AAAA,MAAA,GACIC,KAAAA,QAAM;AAAA,QACb,OAAO,QAAA;AAAA,QACP,KAAK,QAAA;AAAA,QACL,OAAO,QAAA;AAAA,MAAA;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from 'vue';
|
|
2
|
-
import type { GroupedItem, ClassMap, RendererHelpers, DiagnosticEventDetail, LimitationPolicyMap } from '@smilodon/core';
|
|
2
|
+
import type { GroupedItem, ClassMap, RendererHelpers, DiagnosticEventDetail, LimitationPolicyMap, GlobalSelectConfig, SelectionConfig, MultiSelectDisplayConfig, ScrollToSelectedConfig, StyleConfig } from '@smilodon/core';
|
|
3
3
|
export interface SelectItem {
|
|
4
4
|
value: string | number;
|
|
5
5
|
label: string;
|
|
@@ -38,6 +38,16 @@ export interface SelectProps {
|
|
|
38
38
|
virtualized?: boolean;
|
|
39
39
|
/** Maximum number of selections (for multi-select) */
|
|
40
40
|
maxSelections?: number;
|
|
41
|
+
/** Partial core selection config for advanced selection behavior */
|
|
42
|
+
selectionConfig?: Partial<SelectionConfig>;
|
|
43
|
+
/** Multi-select chip display behavior */
|
|
44
|
+
multiSelectDisplay?: Partial<MultiSelectDisplayConfig>;
|
|
45
|
+
/** Scroll-to-selected behavior */
|
|
46
|
+
scrollToSelected?: Partial<ScrollToSelectedConfig>;
|
|
47
|
+
/** Core style configuration for internal parts */
|
|
48
|
+
styles?: StyleConfig;
|
|
49
|
+
/** Full core config passthrough for advanced runtime features */
|
|
50
|
+
config?: Partial<GlobalSelectConfig>;
|
|
41
51
|
/** Custom icon/markup for selected chip remove buttons */
|
|
42
52
|
removeButtonIcon?: string;
|
|
43
53
|
/** Behavior overrides for visually disabled options */
|
|
@@ -129,6 +139,22 @@ declare const _default: import("vue").DefineComponent<SelectProps, {
|
|
|
129
139
|
setGroupedItems: (groups: GroupedItem[]) => void;
|
|
130
140
|
/** Clear selection */
|
|
131
141
|
clear: () => void;
|
|
142
|
+
/** Get selected items */
|
|
143
|
+
getSelectedItems: () => any;
|
|
144
|
+
/** Get selected values */
|
|
145
|
+
getSelectedValues: () => any;
|
|
146
|
+
/** Clear current search query */
|
|
147
|
+
clearSearch: () => void;
|
|
148
|
+
/** Apply partial core config at runtime */
|
|
149
|
+
updateConfig: (config: Partial<GlobalSelectConfig>) => void;
|
|
150
|
+
/** Set error state */
|
|
151
|
+
setError: (message: string) => void;
|
|
152
|
+
/** Clear error state */
|
|
153
|
+
clearError: () => void;
|
|
154
|
+
/** Toggle required state */
|
|
155
|
+
setRequired: (required: boolean) => void;
|
|
156
|
+
/** Validate the component */
|
|
157
|
+
validate: () => any;
|
|
132
158
|
/** Runtime capability report */
|
|
133
159
|
getCapabilities: () => any;
|
|
134
160
|
/** Known limitations report */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.vue.d.ts","sourceRoot":"","sources":["../../src/Select.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.vue.d.ts","sourceRoot":"","s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G,YAAY,GAAG,KAAK;IAGjE,iCAAiC;sCACC,mBAAmB;;;;;;;;;;;0BAtpBZ,OAAO;uBAAiB,OAAO;;;;;;;;;;;;;0BAA/B,OAAO;uBAAiB,OAAO;;;;cA9G7D,OAAO;WAhBV,UAAU,EAAE;cAUT,OAAO;gBAEL,OAAO;cAMT,OAAO;WAEV,OAAO;oBAEE,OAAO;cAEb,MAAM;iBAEH,OAAO;2BAsBG,OAAO;eAInB,QAAQ,GAAG,KAAK,GAAG,MAAM;eAWzB,OAAO;2BAGK,OAAO;wBAGV,OAAO;qBAeV,OAAO;iBAGX,OAAO;kBAGN,OAAO;sBAGH,OAAO;qBAGR,OAAO;wBAGJ,MAAM;mCAMK,OAAO;;AA+vBzC,wBASG"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
* @packageDocumentation
|
|
32
32
|
*/
|
|
33
33
|
import Select from './Select.vue';
|
|
34
|
-
export type { SelectEventDetail, OpenEventDetail, CloseEventDetail, SearchEventDetail, ChangeEventDetail, LoadMoreEventDetail, GroupedItem, DiagnosticEventDetail, LimitationPolicyMap, TrackingSnapshot, SelectCapabilitiesReport, LimitationState, } from '@smilodon/core';
|
|
34
|
+
export type { SelectEventDetail, OpenEventDetail, CloseEventDetail, SearchEventDetail, ChangeEventDetail, LoadMoreEventDetail, ErrorEventDetail, GroupedItem, DiagnosticEventDetail, LimitationPolicyMap, TrackingSnapshot, SelectCapabilitiesReport, LimitationState, GlobalSelectConfig, SelectionConfig, MultiSelectDisplayConfig, ScrollToSelectedConfig, StyleConfig, ClearControlConfig, ExpandableConfig, InfiniteScrollConfig, LoadMoreConfig, BusyBucketConfig, ServerSideConfig, TrackingConfig, LimitationsConfig, } from '@smilodon/core';
|
|
35
|
+
export { configureSelect, resetSelectConfig, selectConfig } from '@smilodon/core';
|
|
35
36
|
export { Select };
|
|
36
37
|
export default Select;
|
|
37
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,MAAM,MAAM,cAAc,CAAC;AAGlC,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElF,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,eAAe,MAAM,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GroupedItem, ClassMap, RendererHelpers } from '@smilodon/core';
|
|
1
|
+
import { GroupedItem, ClassMap, RendererHelpers, GlobalSelectConfig, SelectionConfig, MultiSelectDisplayConfig, ScrollToSelectedConfig, StyleConfig } from '@smilodon/core';
|
|
2
2
|
export interface SelectItem {
|
|
3
3
|
value: string | number;
|
|
4
4
|
label: string;
|
|
@@ -35,6 +35,16 @@ export interface SelectProps {
|
|
|
35
35
|
virtualized?: boolean;
|
|
36
36
|
/** Maximum number of selections (for multi-select) */
|
|
37
37
|
maxSelections?: number;
|
|
38
|
+
/** Partial core selection config for advanced selection behavior */
|
|
39
|
+
selectionConfig?: Partial<SelectionConfig>;
|
|
40
|
+
/** Multi-select chip display behavior */
|
|
41
|
+
multiSelectDisplay?: Partial<MultiSelectDisplayConfig>;
|
|
42
|
+
/** Scroll-to-selected behavior */
|
|
43
|
+
scrollToSelected?: Partial<ScrollToSelectedConfig>;
|
|
44
|
+
/** Core style configuration for internal parts */
|
|
45
|
+
styles?: StyleConfig;
|
|
46
|
+
/** Full core config passthrough for advanced runtime features */
|
|
47
|
+
config?: Partial<GlobalSelectConfig>;
|
|
38
48
|
/** Custom icon/markup for selected chip remove buttons */
|
|
39
49
|
removeButtonIcon?: string;
|
|
40
50
|
/** Behavior overrides for visually disabled options */
|
|
@@ -91,5 +101,21 @@ export interface SelectExposed {
|
|
|
91
101
|
setGroupedItems: (groups: GroupedItem[]) => void;
|
|
92
102
|
/** Clear selection */
|
|
93
103
|
clear: () => void;
|
|
104
|
+
/** Get selected items */
|
|
105
|
+
getSelectedItems: () => SelectItem[];
|
|
106
|
+
/** Get selected values */
|
|
107
|
+
getSelectedValues: () => Array<string | number>;
|
|
108
|
+
/** Clear current search query */
|
|
109
|
+
clearSearch: () => void;
|
|
110
|
+
/** Apply partial core config at runtime */
|
|
111
|
+
updateConfig: (config: Partial<GlobalSelectConfig>) => void;
|
|
112
|
+
/** Set error state */
|
|
113
|
+
setError: (message: string) => void;
|
|
114
|
+
/** Clear error state */
|
|
115
|
+
clearError: () => void;
|
|
116
|
+
/** Toggle required state */
|
|
117
|
+
setRequired: (required: boolean) => void;
|
|
118
|
+
/** Validate the component */
|
|
119
|
+
validate: () => boolean;
|
|
94
120
|
}
|
|
95
121
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,eAAe,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACnD,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACrD,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;I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,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IACjD,sBAAsB;IACtB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,yBAAyB;IACzB,gBAAgB,EAAE,MAAM,UAAU,EAAE,CAAC;IACrC,0BAA0B;IAC1B,iBAAiB,EAAE,MAAM,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAChD,iCAAiC;IACjC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,2CAA2C;IAC3C,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IAC5D,sBAAsB;IACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,wBAAwB;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,4BAA4B;IAC5B,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smilodon/vue",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Vue 3 adapter for @smilodon/core - Production-ready accessible select component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepublishOnly": "npm run build"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@smilodon/core": "^1.
|
|
27
|
+
"@smilodon/core": "^1.9.1",
|
|
28
28
|
"vue": "^3.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|