@smilodon/vue 1.4.6 β†’ 1.4.11

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/README.md CHANGED
@@ -9,7 +9,7 @@ Production-ready, accessible select component for Vue 3 applications.
9
9
  πŸ‘‰ **[Complete Vue Guide](./COMPLETE-GUIDE.md)** πŸ‘ˆ
10
10
 
11
11
  The complete guide includes:
12
- - βœ… All 60+ CSS variables for complete customization
12
+ - βœ… Complete styling token coverage for colors, layout, chips, motion, and accessibility
13
13
  - βœ… Vue 3-specific patterns (Composition API, v-model, computed)
14
14
  - βœ… Complete API reference with TypeScript types
15
15
  - βœ… Pinia store integration examples
@@ -53,6 +53,7 @@ The complete guide includes:
53
53
  - βœ… **Infinite Scroll** - Handle massive datasets efficiently
54
54
  - βœ… **Virtual Scrolling** - Render only visible items for performance
55
55
  - βœ… **Grouped Options** - Organize items into categories
56
+ - 🎨 **Dark Mode** - apply `class="dark-mode"` or `data-theme="dark"` to the component or an ancestor; styles are scoped inside the shadow DOM.
56
57
  - βœ… **Accessible** - WCAG 2.1 AAA compliant, full keyboard navigation
57
58
  - βœ… **Flexible Input** - Accepts SelectItem objects, string arrays, or number arrays
58
59
  - βœ… **Customizable** - Custom renderers, styles, and behaviors
@@ -76,6 +77,54 @@ or
76
77
  pnpm add @smilodon/vue @smilodon/core
77
78
  ```
78
79
 
80
+ ## Nuxt Integration
81
+
82
+ Nuxt works well with `@smilodon/vue`, but the underlying `enhanced-select` custom element must be treated as a custom element by the Vue compiler.
83
+
84
+ ### `nuxt.config.ts`
85
+
86
+ ```ts
87
+ export default defineNuxtConfig({
88
+ vue: {
89
+ compilerOptions: {
90
+ isCustomElement: (tag) => tag === 'enhanced-select',
91
+ },
92
+ },
93
+ })
94
+ ```
95
+
96
+ ### Client usage in Nuxt
97
+
98
+ ```vue
99
+ <script setup lang="ts">
100
+ import { ref } from 'vue'
101
+ import { Select } from '@smilodon/vue'
102
+
103
+ const value = ref<string | number>('')
104
+ const items = [
105
+ { value: 'nuxt', label: 'Nuxt' },
106
+ { value: 'vite', label: 'Vite' },
107
+ { value: 'astro', label: 'Astro' },
108
+ ]
109
+ </script>
110
+
111
+ <template>
112
+ <Select
113
+ v-model="value"
114
+ :items="items"
115
+ searchable
116
+ clearable
117
+ placeholder="Choose a stack"
118
+ />
119
+ </template>
120
+ ```
121
+
122
+ ### Nuxt notes
123
+
124
+ - Keep browser-only imperative access inside `onMounted()`.
125
+ - Pass plain objects/arrays through props when data originates from server routes.
126
+ - If you style globally, target `::part()` hooks or CSS variables rather than internal markup.
127
+
79
128
  ## Quick Start
80
129
 
81
130
  ```vue
@@ -398,6 +447,33 @@ async function handleSearch(query) {
398
447
 
399
448
  ### Grouped Options
400
449
 
450
+ The Vue wrapper also accepts a flat `items` array where each object may include a `group` string. The adapter auto‑converts these to `groupedItems` when it detects the property, so you can use whichever format feels more natural.
451
+
452
+ ```vue
453
+ <script setup>
454
+ import { ref } from 'vue';
455
+ import { Select } from '@smilodon/vue';
456
+
457
+ const value = ref('');
458
+ // flat list with `group` property (auto-converted)
459
+ const items = [
460
+ { value: 'apple', label: 'Apple', group: 'Fruits' },
461
+ { value: 'banana', label: 'Banana', group: 'Fruits' },
462
+ { value: 'carrot', label: 'Carrot', group: 'Vegetables' },
463
+ ];
464
+ </script>
465
+
466
+ <template>
467
+ <Select
468
+ :items="items"
469
+ v-model="value"
470
+ searchable
471
+ />
472
+ </template>
473
+ ```
474
+
475
+ You can also pass explicit `groupedItems` if you prefer:
476
+
401
477
  ```vue
402
478
  <script setup>
403
479
  import { ref } from 'vue';
@@ -406,19 +482,19 @@ import { Select } from '@smilodon/vue';
406
482
  const value = ref('');
407
483
  const groupedItems = [
408
484
  {
409
- groupLabel: 'Fruits',
410
- items: [
485
+ label: 'Fruits',
486
+ options: [
411
487
  { value: 'apple', label: 'Apple' },
412
488
  { value: 'banana', label: 'Banana' },
413
- ]
489
+ ],
414
490
  },
415
491
  {
416
- groupLabel: 'Vegetables',
417
- items: [
492
+ label: 'Vegetables',
493
+ options: [
418
494
  { value: 'carrot', label: 'Carrot' },
419
495
  { value: 'potato', label: 'Potato' },
420
- ]
421
- }
496
+ ],
497
+ },
422
498
  ];
423
499
  </script>
424
500
 
@@ -431,6 +507,27 @@ const groupedItems = [
431
507
  </template>
432
508
  ```
433
509
 
510
+ **Custom group header renderer**
511
+ You can provide a Vue render function to customize how headers are displayed. The returned VNode will receive `.group-header` and a `part` attribute automatically.
512
+
513
+ ```vue
514
+ <script setup>
515
+ import { ref, h } from 'vue';
516
+ import { Select } from '@smilodon/vue';
517
+
518
+ const value = ref('');
519
+ const groups = [/* ... */];
520
+ </script>
521
+
522
+ <template>
523
+ <Select
524
+ :groupedItems="groups"
525
+ :groupHeaderRenderer="(grp) => h('div', { class: 'text-xs uppercase' }, grp.label)"
526
+ v-model="value"
527
+ />
528
+ </template>
529
+ ```
530
+
434
531
  ### Infinite Scroll
435
532
 
436
533
  ```vue
package/dist/index.cjs CHANGED
@@ -28,6 +28,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
28
28
  props: {
29
29
  items: { default: () => [] },
30
30
  groupedItems: {},
31
+ groupHeaderRenderer: {},
31
32
  modelValue: {},
32
33
  defaultValue: {},
33
34
  multiple: { type: Boolean, default: false },
@@ -43,6 +44,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
43
44
  placement: { default: "auto" },
44
45
  className: {},
45
46
  style: {},
47
+ classMap: {},
46
48
  expandable: { type: Boolean },
47
49
  clearable: { type: Boolean, default: false },
48
50
  clearSelectionOnClear: { type: Boolean, default: true },
@@ -50,9 +52,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
50
52
  clearAriaLabel: {},
51
53
  clearIcon: {},
52
54
  optionRenderer: {},
53
- customRenderer: {}
55
+ customRenderer: {},
56
+ trackingEnabled: { type: Boolean, default: false },
57
+ trackEvents: { type: Boolean, default: true },
58
+ trackStyling: { type: Boolean, default: true },
59
+ trackLimitations: { type: Boolean, default: true },
60
+ emitDiagnostics: { type: Boolean, default: false },
61
+ trackingMaxEntries: { default: 200 },
62
+ limitationPolicies: {},
63
+ autoMitigateRuntimeModeSwitch: { type: Boolean, default: true }
54
64
  },
55
- emits: ["update:modelValue", "change", "select", "open", "close", "search", "loadMore", "create", "clear"],
65
+ emits: ["update:modelValue", "change", "select", "open", "close", "search", "loadMore", "create", "clear", "diagnostic"],
56
66
  setup(__props, { expose: __expose, emit: __emit }) {
57
67
  const props = __props;
58
68
  const emit = __emit;
@@ -104,6 +114,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
104
114
  },
105
115
  { immediate: true }
106
116
  );
117
+ vue.watch(
118
+ () => props.classMap,
119
+ (map) => {
120
+ safeCall((el) => {
121
+ el.classMap = map;
122
+ });
123
+ },
124
+ { immediate: true, deep: true }
125
+ );
107
126
  const waitForUpgrade = async () => {
108
127
  var _a;
109
128
  if (typeof window === "undefined") return;
@@ -123,6 +142,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
123
142
  if (resolvedOptionRenderer.value) {
124
143
  candidate.optionRenderer = resolvedOptionRenderer.value;
125
144
  }
145
+ if (props.classMap) {
146
+ candidate.classMap = props.classMap;
147
+ }
126
148
  return;
127
149
  }
128
150
  await new Promise((resolve) => requestAnimationFrame(() => resolve()));
@@ -131,12 +153,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
131
153
  if (isElementReady.value && resolvedOptionRenderer.value) {
132
154
  selectRef.value.optionRenderer = resolvedOptionRenderer.value;
133
155
  }
156
+ if (isElementReady.value && props.classMap) {
157
+ selectRef.value.classMap = props.classMap;
158
+ }
134
159
  };
135
- const safeCall = (fn) => {
160
+ function safeCall(fn) {
136
161
  const el = selectRef.value;
137
162
  if (!el || !isElementReady.value) return;
138
163
  fn(el);
139
- };
164
+ }
140
165
  const isControlled = vue.computed(() => props.modelValue !== void 0);
141
166
  const currentValue = vue.computed(
142
167
  () => isControlled.value ? props.modelValue : internalValue.value
@@ -159,6 +184,44 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
159
184
  },
160
185
  { deep: true }
161
186
  );
187
+ vue.watch(
188
+ () => props.groupHeaderRenderer,
189
+ (renderer) => {
190
+ safeCall((el) => {
191
+ if (renderer) {
192
+ el.groupHeaderRenderer = (group, idx) => {
193
+ const container = document.createElement("div");
194
+ const node = renderer(group, idx);
195
+ if (node && vue.isVNode(node)) {
196
+ vue.render(node, container);
197
+ } else if (node) {
198
+ vue.render(vue.h("span", String(node)), container);
199
+ }
200
+ return container;
201
+ };
202
+ }
203
+ });
204
+ }
205
+ );
206
+ vue.watch(
207
+ () => props.groupHeaderRenderer,
208
+ (renderer) => {
209
+ safeCall((el) => {
210
+ if (renderer) {
211
+ el.groupHeaderRenderer = (group, idx) => {
212
+ const container = document.createElement("div");
213
+ const node = renderer(group, idx);
214
+ if (node && vue.isVNode(node)) {
215
+ vue.render(node, container);
216
+ } else if (node) {
217
+ vue.render(vue.h("span", String(node)), container);
218
+ }
219
+ return container;
220
+ };
221
+ }
222
+ });
223
+ }
224
+ );
162
225
  vue.watch(
163
226
  () => [props.items, props.groupedItems],
164
227
  () => {
@@ -213,6 +276,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
213
276
  clearSearch: props.clearSearchOnClear,
214
277
  ariaLabel: props.clearAriaLabel,
215
278
  icon: props.clearIcon
279
+ },
280
+ tracking: {
281
+ enabled: props.trackingEnabled,
282
+ events: props.trackEvents,
283
+ styling: props.trackStyling,
284
+ limitations: props.trackLimitations,
285
+ emitDiagnostics: props.emitDiagnostics,
286
+ maxEntries: props.trackingMaxEntries
287
+ },
288
+ limitations: {
289
+ policies: props.limitationPolicies,
290
+ autoMitigateRuntimeModeSwitch: props.autoMitigateRuntimeModeSwitch
216
291
  }
217
292
  };
218
293
  el.updateConfig(config);
@@ -233,7 +308,15 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
233
308
  () => props.clearSelectionOnClear,
234
309
  () => props.clearSearchOnClear,
235
310
  () => props.clearAriaLabel,
236
- () => props.clearIcon
311
+ () => props.clearIcon,
312
+ () => props.trackingEnabled,
313
+ () => props.trackEvents,
314
+ () => props.trackStyling,
315
+ () => props.trackLimitations,
316
+ () => props.emitDiagnostics,
317
+ () => props.trackingMaxEntries,
318
+ () => props.limitationPolicies,
319
+ () => props.autoMitigateRuntimeModeSwitch
237
320
  ],
238
321
  updateConfig
239
322
  );
@@ -278,6 +361,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
278
361
  clearedSearch: customEvent.detail.clearedSearch
279
362
  });
280
363
  };
364
+ const handleDiagnostic = (e) => {
365
+ const customEvent = e;
366
+ emit("diagnostic", customEvent.detail);
367
+ };
281
368
  vue.onMounted(async () => {
282
369
  var _a, _b;
283
370
  await waitForUpgrade();
@@ -317,6 +404,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
317
404
  element.addEventListener("loadMore", handleLoadMore);
318
405
  element.addEventListener("create", handleCreate);
319
406
  element.addEventListener("clear", handleClear);
407
+ element.addEventListener("diagnostic", handleDiagnostic);
320
408
  });
321
409
  vue.onBeforeUnmount(() => {
322
410
  customRendererCache.forEach((container) => vue.render(null, container));
@@ -331,6 +419,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
331
419
  element.removeEventListener("loadMore", handleLoadMore);
332
420
  element.removeEventListener("create", handleCreate);
333
421
  element.removeEventListener("clear", handleClear);
422
+ element.removeEventListener("diagnostic", handleDiagnostic);
334
423
  });
335
424
  __expose({
336
425
  /** Open the dropdown */
@@ -368,16 +457,40 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
368
457
  const value = props.multiple ? [] : "";
369
458
  emit("update:modelValue", value);
370
459
  emit("change", value, []);
460
+ },
461
+ /** Runtime capability report */
462
+ getCapabilities: () => {
463
+ var _a, _b;
464
+ return (_b = (_a = selectRef.value) == null ? void 0 : _a.getCapabilities) == null ? void 0 : _b.call(_a);
465
+ },
466
+ /** Known limitations report */
467
+ getKnownLimitations: () => {
468
+ var _a, _b;
469
+ return ((_b = (_a = selectRef.value) == null ? void 0 : _a.getKnownLimitations) == null ? void 0 : _b.call(_a)) || [];
470
+ },
471
+ /** Tracking snapshot */
472
+ getTrackingSnapshot: () => {
473
+ var _a, _b;
474
+ return ((_b = (_a = selectRef.value) == null ? void 0 : _a.getTrackingSnapshot) == null ? void 0 : _b.call(_a)) || { events: [], styles: [], limitations: [] };
475
+ },
476
+ /** Clear tracking entries */
477
+ clearTracking: (source) => {
478
+ var _a, _b;
479
+ (_b = (_a = selectRef.value) == null ? void 0 : _a.clearTracking) == null ? void 0 : _b.call(_a, source);
480
+ },
481
+ /** Update limitation policies */
482
+ setLimitationPolicies: (policies) => {
483
+ var _a, _b;
484
+ (_b = (_a = selectRef.value) == null ? void 0 : _a.setLimitationPolicies) == null ? void 0 : _b.call(_a, policies);
371
485
  }
372
486
  });
373
487
  return (_ctx, _cache) => {
374
- const _component_enhanced_select = vue.resolveComponent("enhanced-select");
375
- return vue.openBlock(), vue.createBlock(_component_enhanced_select, {
488
+ return vue.openBlock(), vue.createElementBlock("enhanced-select", {
376
489
  ref_key: "selectRef",
377
490
  ref: selectRef,
378
491
  class: vue.normalizeClass(__props.className),
379
492
  style: vue.normalizeStyle(__props.style)
380
- }, null, 8, ["class", "style"]);
493
+ }, null, 6);
381
494
  };
382
495
  }
383
496
  });
@@ -388,7 +501,7 @@ const _export_sfc = (sfc, props) => {
388
501
  }
389
502
  return target;
390
503
  };
391
- const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-195defd9"]]);
504
+ const Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-854fa07c"]]);
392
505
  exports.Select = Select;
393
506
  exports.default = Select;
394
507
  //# sourceMappingURL=index.cjs.map
@@ -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 :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 RendererHelpers,\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 /** 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 /** Dropdown placement */\n placement?: 'bottom' | 'top' | 'auto';\n /** Custom CSS class */\n className?: string;\n /** Custom inline styles */\n style?: Record<string, string>;\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\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}\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 placement: 'auto',\n clearable: false,\n clearSelectionOnClear: true,\n clearSearchOnClear: 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\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 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};\n\nconst 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// 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 selection: {\n mode: props.multiple ? 'multi' : 'single',\n maxSelections: props.maxSelections,\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 };\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.infiniteScroll,\n () => props.pageSize,\n () => props.virtualized,\n () => props.expandable,\n () => props.clearable,\n () => props.clearSelectionOnClear,\n () => props.clearSearchOnClear,\n () => props.clearAriaLabel,\n () => props.clearIcon,\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\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});\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});\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});\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","_createBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoIA,UAAM,QAAQ;AAgBd,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,iCAA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C,aAAK,qBAAqB,KAAK;AAC/B,aAAK,UAAU,OAAO,EAAE;AAAA,MAC1B;AAAA,IAAA,CACD;;;8BA5lBCK,IAAAA,YAIE,4BAAA;AAAA,iBAHI;AAAA,QAAJ,KAAI;AAAA,QACH,0BAAO,QAAA,SAAS;AAAA,QAChB,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 :class=\"className\"\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 /** 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 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 selection: {\n mode: props.multiple ? 'multi' : 'single',\n maxSelections: props.maxSelections,\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.infiniteScroll,\n () => props.pageSize,\n () => props.virtualized,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqKA,UAAM,QAAQ;AAuBd,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,+BAA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