@smilodon/svelte 1.10.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,122 +1,69 @@
1
1
  import { configureSelect, resetSelectConfig, selectConfig } from "@smilodon/core";
2
- import { SvelteComponent, init, safe_not_equal, noop, detach, set_custom_element_data, insert, action_destroyer, element, binding_callbacks } from "svelte/internal";
2
+ import { createClassComponent } from "svelte/legacy";
3
+ import "svelte/internal/disclose-version";
4
+ import "svelte/internal/flags/legacy";
5
+ import * as $ from "svelte/internal/client";
3
6
  import { createEventDispatcher, onMount } from "svelte";
4
- const PUBLIC_VERSION = "4";
5
- if (typeof window !== "undefined")
6
- (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION);
7
- function create_fragment(ctx) {
8
- let enhanced_select;
9
- let mounted;
10
- let dispose;
11
- return {
12
- c() {
13
- enhanced_select = element("enhanced-select");
14
- set_custom_element_data(
15
- enhanced_select,
16
- "class",
17
- /*className*/
18
- ctx[0]
19
- );
20
- set_custom_element_data(
21
- enhanced_select,
22
- "style",
23
- /*style*/
24
- ctx[1]
25
- );
26
- },
27
- m(target, anchor) {
28
- insert(target, enhanced_select, anchor);
29
- ctx[64](enhanced_select);
30
- if (!mounted) {
31
- dispose = action_destroyer(
32
- /*listenForSelectEvents*/
33
- ctx[3].call(null, enhanced_select)
34
- );
35
- mounted = true;
36
- }
37
- },
38
- p(ctx2, dirty) {
39
- if (dirty[0] & /*className*/
40
- 1) {
41
- set_custom_element_data(
42
- enhanced_select,
43
- "class",
44
- /*className*/
45
- ctx2[0]
46
- );
47
- }
48
- if (dirty[0] & /*style*/
49
- 2) {
50
- set_custom_element_data(
51
- enhanced_select,
52
- "style",
53
- /*style*/
54
- ctx2[1]
55
- );
56
- }
57
- },
58
- i: noop,
59
- o: noop,
60
- d(detaching) {
61
- if (detaching) {
62
- detach(enhanced_select);
63
- }
64
- ctx[64](null);
65
- mounted = false;
66
- dispose();
67
- }
68
- };
69
- }
70
- function instance($$self, $$props, $$invalidate) {
71
- let isControlled;
72
- let currentValue;
73
- let { items = [] } = $$props;
74
- let { groupedItems = void 0 } = $$props;
75
- let { value = void 0 } = $$props;
76
- let { defaultValue = void 0 } = $$props;
77
- let { multiple = false } = $$props;
78
- let { searchable = false } = $$props;
79
- let { placeholder = "" } = $$props;
80
- let { disabled = false } = $$props;
81
- let { required = false } = $$props;
82
- let { error = false } = $$props;
83
- let { infiniteScroll = false } = $$props;
84
- let { pageSize = 50 } = $$props;
85
- let { virtualized = true } = $$props;
86
- let { maxSelections = void 0 } = $$props;
87
- let { selectionConfig = void 0 } = $$props;
88
- let { multiSelectDisplay = void 0 } = $$props;
89
- let { scrollToSelected = void 0 } = $$props;
90
- let { styles = void 0 } = $$props;
91
- let { config = void 0 } = $$props;
92
- let { removeButtonIcon = void 0 } = $$props;
93
- let { disabledOptionBehavior = void 0 } = $$props;
94
- let { showSelectedIndicator = true } = $$props;
95
- let { direction = void 0 } = $$props;
96
- let { placement = "auto" } = $$props;
97
- let { className = "" } = $$props;
98
- let { style = "" } = $$props;
99
- let { classMap = void 0 } = $$props;
100
- let { clearable = false } = $$props;
101
- let { clearSelectionOnClear = true } = $$props;
102
- let { clearSearchOnClear = true } = $$props;
103
- let { clearAriaLabel = "Clear selection and search" } = $$props;
104
- let { clearIcon = "×" } = $$props;
105
- let { optionRenderer = void 0 } = $$props;
106
- let { trackingEnabled = false } = $$props;
107
- let { trackEvents = true } = $$props;
108
- let { trackStyling = true } = $$props;
109
- let { trackLimitations = true } = $$props;
110
- let { emitDiagnostics = false } = $$props;
111
- let { trackingMaxEntries = 200 } = $$props;
112
- let { limitationPolicies = void 0 } = $$props;
113
- let { autoMitigateRuntimeModeSwitch = true } = $$props;
7
+ var root = $.from_html(`<span slot="loading-icon" aria-hidden="true"><!></span>`);
8
+ var root_1 = $.from_html(`<div slot="loading-content"><!></div>`);
9
+ var root_2 = $.from_html(`<div slot="empty-state"><!></div>`);
10
+ var root_3 = $.from_html(`<enhanced-select><!> <!> <!></enhanced-select>`, 2);
11
+ function Select($$anchor, $$props) {
12
+ if (new.target) return createClassComponent({ component: Select, ...$$anchor });
13
+ $.push($$props, false);
14
+ const isControlled = $.mutable_source();
15
+ const currentValue = $.mutable_source();
16
+ let items = $.prop($$props, "items", 28, () => []);
17
+ let groupedItems = $.prop($$props, "groupedItems", 12, void 0);
18
+ let value = $.prop($$props, "value", 12, void 0);
19
+ let defaultValue = $.prop($$props, "defaultValue", 12, void 0);
20
+ let multiple = $.prop($$props, "multiple", 12, false);
21
+ let searchable = $.prop($$props, "searchable", 12, false);
22
+ let placeholder = $.prop($$props, "placeholder", 12, "");
23
+ let disabled = $.prop($$props, "disabled", 12, false);
24
+ let required = $.prop($$props, "required", 12, false);
25
+ let error = $.prop($$props, "error", 12, false);
26
+ let infiniteScroll = $.prop($$props, "infiniteScroll", 12, false);
27
+ let pageSize = $.prop($$props, "pageSize", 12, 50);
28
+ let virtualized = $.prop($$props, "virtualized", 12, true);
29
+ let maxSelections = $.prop($$props, "maxSelections", 12, void 0);
30
+ let selectionConfig = $.prop($$props, "selectionConfig", 12, void 0);
31
+ let multiSelectDisplay = $.prop($$props, "multiSelectDisplay", 12, void 0);
32
+ let scrollToSelected = $.prop($$props, "scrollToSelected", 12, void 0);
33
+ let styles = $.prop($$props, "styles", 12, void 0);
34
+ let config = $.prop($$props, "config", 12, void 0);
35
+ let removeButtonIcon = $.prop($$props, "removeButtonIcon", 12, void 0);
36
+ let disabledOptionBehavior = $.prop($$props, "disabledOptionBehavior", 12, void 0);
37
+ let showSelectedIndicator = $.prop($$props, "showSelectedIndicator", 12, true);
38
+ let direction = $.prop($$props, "direction", 12, void 0);
39
+ let placement = $.prop($$props, "placement", 12, "auto");
40
+ let className = $.prop($$props, "className", 12, "");
41
+ let style = $.prop($$props, "style", 12, "");
42
+ let classMap = $.prop($$props, "classMap", 12, void 0);
43
+ let clearable = $.prop($$props, "clearable", 12, false);
44
+ let clearSelectionOnClear = $.prop($$props, "clearSelectionOnClear", 12, true);
45
+ let clearSearchOnClear = $.prop($$props, "clearSearchOnClear", 12, true);
46
+ let clearAriaLabel = $.prop($$props, "clearAriaLabel", 12, "Clear selection and search");
47
+ let clearIcon = $.prop($$props, "clearIcon", 12, "×");
48
+ let optionRenderer = $.prop($$props, "optionRenderer", 12, void 0);
49
+ let trackingEnabled = $.prop($$props, "trackingEnabled", 12, false);
50
+ let trackEvents = $.prop($$props, "trackEvents", 12, true);
51
+ let trackStyling = $.prop($$props, "trackStyling", 12, true);
52
+ let trackLimitations = $.prop($$props, "trackLimitations", 12, true);
53
+ let emitDiagnostics = $.prop($$props, "emitDiagnostics", 12, false);
54
+ let trackingMaxEntries = $.prop($$props, "trackingMaxEntries", 12, 200);
55
+ let limitationPolicies = $.prop($$props, "limitationPolicies", 12, void 0);
56
+ let autoMitigateRuntimeModeSwitch = $.prop($$props, "autoMitigateRuntimeModeSwitch", 12, true);
57
+ let loadingIcon = $.prop($$props, "loadingIcon", 12, void 0);
58
+ let loadingContent = $.prop($$props, "loadingContent", 12, void 0);
59
+ let emptyState = $.prop($$props, "emptyState", 12, void 0);
114
60
  const dispatch = createEventDispatcher();
115
- let selectRef;
116
- let nativeListenersReady = false;
117
- let internalValue = defaultValue;
61
+ let selectRef = $.mutable_source();
62
+ let nativeListenersReady = $.mutable_source(false);
63
+ let internalValue = $.mutable_source(defaultValue());
64
+ let emptyStateContext = $.mutable_source(null);
118
65
  const resolvedOptionRenderer = (item, index, helpers) => {
119
- return optionRenderer ? optionRenderer(item, index, helpers) : document.createElement("div");
66
+ return optionRenderer() ? optionRenderer()(item, index, helpers) : document.createElement("div");
120
67
  };
121
68
  function handleSelect(e) {
122
69
  const customEvent = e;
@@ -127,11 +74,14 @@ function instance($$self, $$props, $$invalidate) {
127
74
  const customEvent = e;
128
75
  const { selectedItems, selectedValues } = customEvent.detail;
129
76
  const values = selectedValues;
130
- if (!isControlled) {
131
- $$invalidate(61, internalValue = multiple ? values : values[0]);
77
+ if (!$.get(isControlled)) {
78
+ $.set(internalValue, multiple() ? values : values[0]);
132
79
  }
133
- const newValue = multiple ? values : values[0];
134
- $$invalidate(4, value = newValue);
80
+ const newValue = multiple() ? values : values[0];
81
+ value(
82
+ newValue
83
+ // Update binding
84
+ );
135
85
  dispatch("change", { value: newValue, selectedItems });
136
86
  }
137
87
  function handleOpen() {
@@ -163,378 +113,305 @@ function instance($$self, $$props, $$invalidate) {
163
113
  const customEvent = e;
164
114
  dispatch("diagnostic", customEvent.detail);
165
115
  }
166
- function listenForSelectEvents(element2) {
167
- $$invalidate(2, selectRef = element2);
168
- element2.addEventListener("select", handleSelect);
169
- element2.addEventListener("change", handleChange);
170
- element2.addEventListener("open", handleOpen);
171
- element2.addEventListener("close", handleClose);
172
- element2.addEventListener("search", handleSearch);
173
- element2.addEventListener("loadMore", handleLoadMore);
174
- element2.addEventListener("create", handleCreate);
175
- element2.addEventListener("clear", handleClear);
176
- element2.addEventListener("diagnostic", handleDiagnostic);
177
- $$invalidate(60, nativeListenersReady = true);
116
+ function handleEmptyStateChange(e) {
117
+ const detail = e.detail;
118
+ $.set(emptyStateContext, detail.context);
119
+ dispatch("emptyStateChange", detail.context);
120
+ }
121
+ function listenForSelectEvents(element) {
122
+ var _a;
123
+ $.set(selectRef, element);
124
+ element.addEventListener("select", handleSelect);
125
+ element.addEventListener("change", handleChange);
126
+ element.addEventListener("open", handleOpen);
127
+ element.addEventListener("close", handleClose);
128
+ element.addEventListener("search", handleSearch);
129
+ element.addEventListener("loadMore", handleLoadMore);
130
+ element.addEventListener("create", handleCreate);
131
+ element.addEventListener("clear", handleClear);
132
+ element.addEventListener("diagnostic", handleDiagnostic);
133
+ element.addEventListener("emptyStateChange", handleEmptyStateChange);
134
+ $.set(emptyStateContext, ((_a = element.getEmptyStateContext) == null ? void 0 : _a.call(element)) ?? null);
135
+ $.set(nativeListenersReady, true);
178
136
  return {
179
137
  destroy() {
180
- element2.removeEventListener("select", handleSelect);
181
- element2.removeEventListener("change", handleChange);
182
- element2.removeEventListener("open", handleOpen);
183
- element2.removeEventListener("close", handleClose);
184
- element2.removeEventListener("search", handleSearch);
185
- element2.removeEventListener("loadMore", handleLoadMore);
186
- element2.removeEventListener("create", handleCreate);
187
- element2.removeEventListener("clear", handleClear);
188
- element2.removeEventListener("diagnostic", handleDiagnostic);
189
- if (selectRef === element2) $$invalidate(2, selectRef = void 0);
190
- $$invalidate(60, nativeListenersReady = false);
138
+ element.removeEventListener("select", handleSelect);
139
+ element.removeEventListener("change", handleChange);
140
+ element.removeEventListener("open", handleOpen);
141
+ element.removeEventListener("close", handleClose);
142
+ element.removeEventListener("search", handleSearch);
143
+ element.removeEventListener("loadMore", handleLoadMore);
144
+ element.removeEventListener("create", handleCreate);
145
+ element.removeEventListener("clear", handleClear);
146
+ element.removeEventListener("diagnostic", handleDiagnostic);
147
+ element.removeEventListener("emptyStateChange", handleEmptyStateChange);
148
+ if ($.get(selectRef) === element) $.set(selectRef, void 0);
149
+ $.set(nativeListenersReady, false);
191
150
  }
192
151
  };
193
152
  }
194
153
  function updateConfig() {
195
- var _a, _b;
196
- if (!selectRef) return;
197
- (_a = selectRef.updateConfig) == null ? void 0 : _a.call(selectRef, {
198
- searchable,
199
- placeholder,
200
- enabled: !disabled,
201
- direction,
202
- dropdownPlacement: { mode: placement },
154
+ var _a, _b, _c, _d;
155
+ if (!$.get(selectRef)) return;
156
+ (_b = (_a = $.get(selectRef)).updateConfig) == null ? void 0 : _b.call(_a, {
157
+ searchable: searchable(),
158
+ placeholder: placeholder(),
159
+ enabled: !disabled(),
160
+ direction: direction(),
161
+ dropdownPlacement: { mode: placement() },
203
162
  selection: {
204
- ...selectionConfig,
205
- mode: multiple ? "multi" : "single",
206
- maxSelections,
207
- removeButtonIcon,
208
- disabledOptionBehavior,
209
- showSelectedIndicator
163
+ ...selectionConfig(),
164
+ mode: multiple() ? "multi" : "single",
165
+ maxSelections: maxSelections(),
166
+ removeButtonIcon: removeButtonIcon(),
167
+ disabledOptionBehavior: disabledOptionBehavior(),
168
+ showSelectedIndicator: showSelectedIndicator()
210
169
  },
211
- multiSelectDisplay,
212
- infiniteScroll: { enabled: infiniteScroll, pageSize },
213
- scrollToSelected: { enabled: true, ...scrollToSelected },
214
- styles,
170
+ multiSelectDisplay: multiSelectDisplay(),
171
+ infiniteScroll: { enabled: infiniteScroll(), pageSize: pageSize() },
172
+ scrollToSelected: { enabled: true, ...scrollToSelected() },
173
+ styles: styles(),
215
174
  clearControl: {
216
- enabled: clearable,
217
- clearSelection: clearSelectionOnClear,
218
- clearSearch: clearSearchOnClear,
219
- ariaLabel: clearAriaLabel,
220
- icon: clearIcon
175
+ enabled: clearable(),
176
+ clearSelection: clearSelectionOnClear(),
177
+ clearSearch: clearSearchOnClear(),
178
+ ariaLabel: clearAriaLabel(),
179
+ icon: clearIcon()
221
180
  },
222
181
  tracking: {
223
- enabled: trackingEnabled,
224
- events: trackEvents,
225
- styling: trackStyling,
226
- limitations: trackLimitations,
227
- emitDiagnostics,
228
- maxEntries: trackingMaxEntries
182
+ enabled: trackingEnabled(),
183
+ events: trackEvents(),
184
+ styling: trackStyling(),
185
+ limitations: trackLimitations(),
186
+ emitDiagnostics: emitDiagnostics(),
187
+ maxEntries: trackingMaxEntries()
229
188
  },
230
189
  limitations: {
231
- policies: limitationPolicies,
232
- autoMitigateRuntimeModeSwitch
190
+ policies: limitationPolicies(),
191
+ autoMitigateRuntimeModeSwitch: autoMitigateRuntimeModeSwitch()
233
192
  }
234
193
  });
235
- if (config) {
236
- (_b = selectRef.updateConfig) == null ? void 0 : _b.call(selectRef, config);
194
+ if (config()) {
195
+ (_d = (_c = $.get(selectRef)).updateConfig) == null ? void 0 : _d.call(_c, config());
237
196
  }
238
197
  }
239
198
  onMount(async () => {
240
- if (!selectRef) return;
199
+ var _a, _b;
200
+ if (!$.get(selectRef)) return;
241
201
  await customElements.whenDefined("enhanced-select");
242
- if (!selectRef) return;
243
- const element2 = selectRef;
244
- if (placeholder) element2.setAttribute("placeholder", placeholder);
245
- if (disabled) element2.setAttribute("disabled", "");
246
- if (required) element2.setAttribute("required", "");
247
- if (error) element2.setAttribute("error", "");
248
- if (searchable) element2.setAttribute("searchable", "");
249
- if (multiple) element2.setAttribute("multiple", "");
250
- if (virtualized) element2.setAttribute("virtualized", "");
251
- if (infiniteScroll) element2.setAttribute("infinite-scroll", "");
252
- if (pageSize) element2.setAttribute("page-size", String(pageSize));
253
- if (maxSelections) element2.setAttribute("max-selections", String(maxSelections));
254
- if (placement) element2.setAttribute("placement", placement);
255
- if (direction) element2.setAttribute("dir", direction);
256
- if (optionRenderer) {
257
- element2.optionRenderer = resolvedOptionRenderer;
202
+ if (!$.get(selectRef)) return;
203
+ const element = $.get(selectRef);
204
+ if (placeholder()) element.setAttribute("placeholder", placeholder());
205
+ if (disabled()) element.setAttribute("disabled", "");
206
+ if (required()) element.setAttribute("required", "");
207
+ if (error()) element.setAttribute("error", "");
208
+ if (searchable()) element.setAttribute("searchable", "");
209
+ if (multiple()) element.setAttribute("multiple", "");
210
+ if (virtualized()) element.setAttribute("virtualized", "");
211
+ if (infiniteScroll()) element.setAttribute("infinite-scroll", "");
212
+ if (pageSize()) element.setAttribute("page-size", String(pageSize()));
213
+ if (maxSelections()) element.setAttribute("max-selections", String(maxSelections()));
214
+ if (placement()) element.setAttribute("placement", placement());
215
+ if (direction()) element.setAttribute("dir", direction());
216
+ if (optionRenderer()) {
217
+ element.optionRenderer = resolvedOptionRenderer;
258
218
  }
259
- if (items == null ? void 0 : items.length) {
260
- const first = items[0];
219
+ if ((_a = items()) == null ? void 0 : _a.length) {
220
+ const first = items()[0];
261
221
  if (first && first.group !== void 0) {
262
222
  const map = /* @__PURE__ */ new Map();
263
- items.forEach((it) => {
223
+ items().forEach((it) => {
264
224
  const g = it.group ?? "Ungrouped";
265
225
  if (!map.has(g)) map.set(g, []);
266
226
  map.get(g).push(it);
267
227
  });
268
228
  const groups = Array.from(map.entries()).map(([label, options]) => ({ label, options }));
269
- element2.setGroupedItems(groups);
229
+ element.setGroupedItems(groups);
270
230
  } else {
271
- element2.setItems(items);
231
+ element.setItems(items());
272
232
  }
273
233
  }
274
- if (groupedItems == null ? void 0 : groupedItems.length) {
275
- element2.setGroupedItems(groupedItems);
234
+ if ((_b = groupedItems()) == null ? void 0 : _b.length) {
235
+ element.setGroupedItems(groupedItems());
276
236
  }
277
- if (currentValue !== void 0) {
278
- const values = Array.isArray(currentValue) ? currentValue : [currentValue];
279
- element2.setSelectedValues(values);
237
+ if ($.get(currentValue) !== void 0) {
238
+ const values = Array.isArray($.get(currentValue)) ? $.get(currentValue) : [$.get(currentValue)];
239
+ element.setSelectedValues(values);
280
240
  }
281
241
  updateConfig();
282
242
  });
283
243
  function open() {
284
- if (typeof (selectRef == null ? void 0 : selectRef.open) === "function") {
285
- selectRef.open();
244
+ var _a;
245
+ if (typeof ((_a = $.get(selectRef)) == null ? void 0 : _a.open) === "function") {
246
+ $.get(selectRef).open();
286
247
  }
287
248
  }
288
249
  function close() {
289
- if (typeof (selectRef == null ? void 0 : selectRef.close) === "function") {
290
- selectRef.close();
250
+ var _a;
251
+ if (typeof ((_a = $.get(selectRef)) == null ? void 0 : _a.close) === "function") {
252
+ $.get(selectRef).close();
291
253
  }
292
254
  }
293
255
  function focus() {
294
- if (typeof (selectRef == null ? void 0 : selectRef.focus) === "function") {
295
- selectRef.focus();
256
+ var _a;
257
+ if (typeof ((_a = $.get(selectRef)) == null ? void 0 : _a.focus) === "function") {
258
+ $.get(selectRef).focus();
296
259
  }
297
260
  }
298
261
  function setItems(newItems) {
299
- selectRef == null ? void 0 : selectRef.setItems(newItems);
262
+ var _a;
263
+ (_a = $.get(selectRef)) == null ? void 0 : _a.setItems(newItems);
300
264
  }
301
265
  function setGroupedItems(groups) {
302
- selectRef == null ? void 0 : selectRef.setGroupedItems(groups);
266
+ var _a;
267
+ (_a = $.get(selectRef)) == null ? void 0 : _a.setGroupedItems(groups);
303
268
  }
304
269
  function clear() {
305
- selectRef == null ? void 0 : selectRef.setSelectedValues([]);
306
- if (!isControlled) {
307
- $$invalidate(61, internalValue = multiple ? [] : void 0);
270
+ var _a;
271
+ (_a = $.get(selectRef)) == null ? void 0 : _a.setSelectedValues([]);
272
+ if (!$.get(isControlled)) {
273
+ $.set(internalValue, multiple() ? [] : void 0);
308
274
  }
309
- const newValue = multiple ? [] : "";
310
- $$invalidate(4, value = newValue);
275
+ const newValue = multiple() ? [] : "";
276
+ value(newValue);
311
277
  dispatch("change", { value: newValue, selectedItems: [] });
312
278
  }
313
279
  function clearSearch() {
314
- var _a;
315
- (_a = selectRef == null ? void 0 : selectRef.clearSearch) == null ? void 0 : _a.call(selectRef);
280
+ var _a, _b;
281
+ (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.clearSearch) == null ? void 0 : _b.call(_a);
316
282
  }
317
283
  function updateCoreConfig(nextConfig) {
318
- var _a;
319
- (_a = selectRef == null ? void 0 : selectRef.updateConfig) == null ? void 0 : _a.call(selectRef, nextConfig);
284
+ var _a, _b;
285
+ (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.updateConfig) == null ? void 0 : _b.call(_a, nextConfig);
320
286
  }
321
287
  function setError(message) {
322
- var _a;
323
- (_a = selectRef == null ? void 0 : selectRef.setError) == null ? void 0 : _a.call(selectRef, message);
288
+ var _a, _b;
289
+ (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.setError) == null ? void 0 : _b.call(_a, message);
324
290
  }
325
291
  function clearError() {
326
- var _a;
327
- (_a = selectRef == null ? void 0 : selectRef.clearError) == null ? void 0 : _a.call(selectRef);
292
+ var _a, _b;
293
+ (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.clearError) == null ? void 0 : _b.call(_a);
328
294
  }
329
295
  function setRequiredState(isRequired) {
330
- var _a;
331
- (_a = selectRef == null ? void 0 : selectRef.setRequired) == null ? void 0 : _a.call(selectRef, isRequired);
296
+ var _a, _b;
297
+ (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.setRequired) == null ? void 0 : _b.call(_a, isRequired);
332
298
  }
333
299
  function validate() {
334
- var _a;
335
- return ((_a = selectRef == null ? void 0 : selectRef.validate) == null ? void 0 : _a.call(selectRef)) ?? true;
300
+ var _a, _b;
301
+ return ((_b = (_a = $.get(selectRef)) == null ? void 0 : _a.validate) == null ? void 0 : _b.call(_a)) ?? true;
336
302
  }
337
303
  function getCapabilities() {
338
- var _a;
339
- return (_a = selectRef == null ? void 0 : selectRef.getCapabilities) == null ? void 0 : _a.call(selectRef);
304
+ var _a, _b;
305
+ return (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.getCapabilities) == null ? void 0 : _b.call(_a);
306
+ }
307
+ function getEmptyStateContext() {
308
+ var _a, _b;
309
+ return ((_b = (_a = $.get(selectRef)) == null ? void 0 : _a.getEmptyStateContext) == null ? void 0 : _b.call(_a)) ?? null;
340
310
  }
341
311
  function getKnownLimitations() {
342
- var _a;
343
- return ((_a = selectRef == null ? void 0 : selectRef.getKnownLimitations) == null ? void 0 : _a.call(selectRef)) || [];
312
+ var _a, _b;
313
+ return ((_b = (_a = $.get(selectRef)) == null ? void 0 : _a.getKnownLimitations) == null ? void 0 : _b.call(_a)) || [];
344
314
  }
345
315
  function getTrackingSnapshot() {
346
- var _a;
347
- return ((_a = selectRef == null ? void 0 : selectRef.getTrackingSnapshot) == null ? void 0 : _a.call(selectRef)) || { events: [], styles: [], limitations: [] };
316
+ var _a, _b;
317
+ return ((_b = (_a = $.get(selectRef)) == null ? void 0 : _a.getTrackingSnapshot) == null ? void 0 : _b.call(_a)) || { events: [], styles: [], limitations: [] };
348
318
  }
349
319
  function clearTracking(source) {
350
- var _a;
351
- (_a = selectRef == null ? void 0 : selectRef.clearTracking) == null ? void 0 : _a.call(selectRef, source);
320
+ var _a, _b;
321
+ (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.clearTracking) == null ? void 0 : _b.call(_a, source);
352
322
  }
353
323
  function setLimitationPolicies(policies) {
354
- var _a;
355
- (_a = selectRef == null ? void 0 : selectRef.setLimitationPolicies) == null ? void 0 : _a.call(selectRef, policies);
356
- }
357
- function enhanced_select_binding($$value) {
358
- binding_callbacks[$$value ? "unshift" : "push"](() => {
359
- selectRef = $$value;
360
- $$invalidate(2, selectRef), $$invalidate(60, nativeListenersReady), $$invalidate(10, placeholder), $$invalidate(11, disabled), $$invalidate(9, searchable), $$invalidate(26, direction), $$invalidate(8, multiple), $$invalidate(16, virtualized), $$invalidate(34, optionRenderer), $$invalidate(28, classMap);
361
- });
324
+ var _a, _b;
325
+ (_b = (_a = $.get(selectRef)) == null ? void 0 : _a.setLimitationPolicies) == null ? void 0 : _b.call(_a, policies);
362
326
  }
363
- $$self.$$set = ($$props2) => {
364
- if ("items" in $$props2) $$invalidate(5, items = $$props2.items);
365
- if ("groupedItems" in $$props2) $$invalidate(6, groupedItems = $$props2.groupedItems);
366
- if ("value" in $$props2) $$invalidate(4, value = $$props2.value);
367
- if ("defaultValue" in $$props2) $$invalidate(7, defaultValue = $$props2.defaultValue);
368
- if ("multiple" in $$props2) $$invalidate(8, multiple = $$props2.multiple);
369
- if ("searchable" in $$props2) $$invalidate(9, searchable = $$props2.searchable);
370
- if ("placeholder" in $$props2) $$invalidate(10, placeholder = $$props2.placeholder);
371
- if ("disabled" in $$props2) $$invalidate(11, disabled = $$props2.disabled);
372
- if ("required" in $$props2) $$invalidate(12, required = $$props2.required);
373
- if ("error" in $$props2) $$invalidate(13, error = $$props2.error);
374
- if ("infiniteScroll" in $$props2) $$invalidate(14, infiniteScroll = $$props2.infiniteScroll);
375
- if ("pageSize" in $$props2) $$invalidate(15, pageSize = $$props2.pageSize);
376
- if ("virtualized" in $$props2) $$invalidate(16, virtualized = $$props2.virtualized);
377
- if ("maxSelections" in $$props2) $$invalidate(17, maxSelections = $$props2.maxSelections);
378
- if ("selectionConfig" in $$props2) $$invalidate(18, selectionConfig = $$props2.selectionConfig);
379
- if ("multiSelectDisplay" in $$props2) $$invalidate(19, multiSelectDisplay = $$props2.multiSelectDisplay);
380
- if ("scrollToSelected" in $$props2) $$invalidate(20, scrollToSelected = $$props2.scrollToSelected);
381
- if ("styles" in $$props2) $$invalidate(21, styles = $$props2.styles);
382
- if ("config" in $$props2) $$invalidate(22, config = $$props2.config);
383
- if ("removeButtonIcon" in $$props2) $$invalidate(23, removeButtonIcon = $$props2.removeButtonIcon);
384
- if ("disabledOptionBehavior" in $$props2) $$invalidate(24, disabledOptionBehavior = $$props2.disabledOptionBehavior);
385
- if ("showSelectedIndicator" in $$props2) $$invalidate(25, showSelectedIndicator = $$props2.showSelectedIndicator);
386
- if ("direction" in $$props2) $$invalidate(26, direction = $$props2.direction);
387
- if ("placement" in $$props2) $$invalidate(27, placement = $$props2.placement);
388
- if ("className" in $$props2) $$invalidate(0, className = $$props2.className);
389
- if ("style" in $$props2) $$invalidate(1, style = $$props2.style);
390
- if ("classMap" in $$props2) $$invalidate(28, classMap = $$props2.classMap);
391
- if ("clearable" in $$props2) $$invalidate(29, clearable = $$props2.clearable);
392
- if ("clearSelectionOnClear" in $$props2) $$invalidate(30, clearSelectionOnClear = $$props2.clearSelectionOnClear);
393
- if ("clearSearchOnClear" in $$props2) $$invalidate(31, clearSearchOnClear = $$props2.clearSearchOnClear);
394
- if ("clearAriaLabel" in $$props2) $$invalidate(32, clearAriaLabel = $$props2.clearAriaLabel);
395
- if ("clearIcon" in $$props2) $$invalidate(33, clearIcon = $$props2.clearIcon);
396
- if ("optionRenderer" in $$props2) $$invalidate(34, optionRenderer = $$props2.optionRenderer);
397
- if ("trackingEnabled" in $$props2) $$invalidate(35, trackingEnabled = $$props2.trackingEnabled);
398
- if ("trackEvents" in $$props2) $$invalidate(36, trackEvents = $$props2.trackEvents);
399
- if ("trackStyling" in $$props2) $$invalidate(37, trackStyling = $$props2.trackStyling);
400
- if ("trackLimitations" in $$props2) $$invalidate(38, trackLimitations = $$props2.trackLimitations);
401
- if ("emitDiagnostics" in $$props2) $$invalidate(39, emitDiagnostics = $$props2.emitDiagnostics);
402
- if ("trackingMaxEntries" in $$props2) $$invalidate(40, trackingMaxEntries = $$props2.trackingMaxEntries);
403
- if ("limitationPolicies" in $$props2) $$invalidate(41, limitationPolicies = $$props2.limitationPolicies);
404
- if ("autoMitigateRuntimeModeSwitch" in $$props2) $$invalidate(42, autoMitigateRuntimeModeSwitch = $$props2.autoMitigateRuntimeModeSwitch);
405
- };
406
- $$self.$$.update = () => {
407
- if ($$self.$$.dirty[0] & /*value*/
408
- 16) {
409
- $$invalidate(62, isControlled = value !== void 0);
327
+ $.legacy_pre_effect(() => $.deep_read_state(value()), () => {
328
+ $.set(isControlled, value() !== void 0);
329
+ });
330
+ $.legacy_pre_effect(
331
+ () => ($.get(isControlled), $.deep_read_state(value()), $.get(internalValue)),
332
+ () => {
333
+ $.set(currentValue, $.get(isControlled) ? value() : $.get(internalValue));
334
+ }
335
+ );
336
+ $.legacy_pre_effect(
337
+ () => ($.get(nativeListenersReady), $.get(selectRef), $.deep_read_state(items())),
338
+ () => {
339
+ if ($.get(nativeListenersReady) && $.get(selectRef) && items()) {
340
+ if (typeof $.get(selectRef).setItems === "function") {
341
+ $.get(selectRef).setItems(items());
342
+ }
343
+ }
344
+ }
345
+ );
346
+ $.legacy_pre_effect(
347
+ () => ($.get(nativeListenersReady), $.get(selectRef), $.deep_read_state(groupedItems())),
348
+ () => {
349
+ if ($.get(nativeListenersReady) && $.get(selectRef) && groupedItems()) {
350
+ if (typeof $.get(selectRef).setGroupedItems === "function") {
351
+ $.get(selectRef).setGroupedItems(groupedItems());
352
+ }
353
+ }
410
354
  }
411
- if ($$self.$$.dirty[0] & /*value*/
412
- 16 | $$self.$$.dirty[1] & /*internalValue*/
413
- 1073741824 | $$self.$$.dirty[2] & /*isControlled*/
414
- 1) {
415
- $$invalidate(63, currentValue = isControlled ? value : internalValue);
355
+ );
356
+ $.legacy_pre_effect(
357
+ () => ($.get(nativeListenersReady), $.get(selectRef), $.get(currentValue)),
358
+ () => {
359
+ if ($.get(nativeListenersReady) && $.get(selectRef) && $.get(currentValue) !== void 0) {
360
+ if (typeof $.get(selectRef).setSelectedValues === "function") {
361
+ const values = Array.isArray($.get(currentValue)) ? $.get(currentValue) : [$.get(currentValue)];
362
+ $.get(selectRef).setSelectedValues(values);
363
+ }
364
+ }
416
365
  }
417
- if ($$self.$$.dirty[0] & /*selectRef, placeholder, disabled, searchable, direction, multiple, virtualized, classMap*/
418
- 335613700 | $$self.$$.dirty[1] & /*nativeListenersReady, optionRenderer*/
419
- 536870920) {
420
- if (nativeListenersReady && selectRef) {
421
- if (placeholder) selectRef.setAttribute("placeholder", placeholder);
422
- if (disabled) {
423
- selectRef.setAttribute("disabled", "");
366
+ );
367
+ $.legacy_pre_effect(
368
+ () => ($.get(nativeListenersReady), $.get(selectRef), $.deep_read_state(placeholder()), $.deep_read_state(disabled()), $.deep_read_state(searchable()), $.deep_read_state(direction()), $.deep_read_state(multiple()), $.deep_read_state(virtualized()), $.deep_read_state(optionRenderer()), $.deep_read_state(classMap())),
369
+ () => {
370
+ if ($.get(nativeListenersReady) && $.get(selectRef)) {
371
+ if (placeholder()) $.get(selectRef).setAttribute("placeholder", placeholder());
372
+ if (disabled()) {
373
+ $.get(selectRef).setAttribute("disabled", "");
424
374
  } else {
425
- selectRef.removeAttribute("disabled");
375
+ $.get(selectRef).removeAttribute("disabled");
426
376
  }
427
- if (searchable) {
428
- selectRef.setAttribute("searchable", "");
377
+ if (searchable()) {
378
+ $.get(selectRef).setAttribute("searchable", "");
429
379
  } else {
430
- selectRef.removeAttribute("searchable");
380
+ $.get(selectRef).removeAttribute("searchable");
431
381
  }
432
- if (direction) {
433
- selectRef.setAttribute("dir", direction);
382
+ if (direction()) {
383
+ $.get(selectRef).setAttribute("dir", direction());
434
384
  } else {
435
- selectRef.removeAttribute("dir");
385
+ $.get(selectRef).removeAttribute("dir");
436
386
  }
437
- if (multiple) {
438
- selectRef.setAttribute("multiple", "");
387
+ if (multiple()) {
388
+ $.get(selectRef).setAttribute("multiple", "");
439
389
  } else {
440
- selectRef.removeAttribute("multiple");
390
+ $.get(selectRef).removeAttribute("multiple");
441
391
  }
442
- if (virtualized) {
443
- selectRef.setAttribute("virtualized", "");
392
+ if (virtualized()) {
393
+ $.get(selectRef).setAttribute("virtualized", "");
444
394
  } else {
445
- selectRef.removeAttribute("virtualized");
395
+ $.get(selectRef).removeAttribute("virtualized");
446
396
  }
447
- if (optionRenderer) {
448
- if (selectRef.optionRenderer !== resolvedOptionRenderer) {
449
- $$invalidate(2, selectRef.optionRenderer = resolvedOptionRenderer, selectRef);
397
+ if (optionRenderer()) {
398
+ if ($.get(selectRef).optionRenderer !== resolvedOptionRenderer) {
399
+ $.mutate(selectRef, $.get(selectRef).optionRenderer = resolvedOptionRenderer);
450
400
  }
451
- } else if (selectRef.optionRenderer === resolvedOptionRenderer) {
452
- $$invalidate(2, selectRef.optionRenderer = void 0, selectRef);
401
+ } else if ($.get(selectRef).optionRenderer === resolvedOptionRenderer) {
402
+ $.mutate(selectRef, $.get(selectRef).optionRenderer = void 0);
453
403
  }
454
- $$invalidate(2, selectRef.classMap = classMap, selectRef);
404
+ $.mutate(selectRef, $.get(selectRef).classMap = classMap());
455
405
  }
456
406
  }
457
- if ($$self.$$.dirty[0] & /*selectRef, items*/
458
- 36 | $$self.$$.dirty[1] & /*nativeListenersReady*/
459
- 536870912) {
460
- if (nativeListenersReady && selectRef && items) {
461
- if (typeof selectRef.setItems === "function") {
462
- selectRef.setItems(items);
463
- }
464
- }
407
+ );
408
+ $.legacy_pre_effect(() => ($.get(nativeListenersReady), $.get(selectRef)), () => {
409
+ if ($.get(nativeListenersReady) && $.get(selectRef)) {
410
+ updateConfig();
465
411
  }
466
- if ($$self.$$.dirty[0] & /*selectRef, groupedItems*/
467
- 68 | $$self.$$.dirty[1] & /*nativeListenersReady*/
468
- 536870912) {
469
- if (nativeListenersReady && selectRef && groupedItems) {
470
- if (typeof selectRef.setGroupedItems === "function") {
471
- selectRef.setGroupedItems(groupedItems);
472
- }
473
- }
474
- }
475
- if ($$self.$$.dirty[0] & /*selectRef*/
476
- 4 | $$self.$$.dirty[1] & /*nativeListenersReady*/
477
- 536870912 | $$self.$$.dirty[2] & /*currentValue*/
478
- 2) {
479
- if (nativeListenersReady && selectRef && currentValue !== void 0) {
480
- if (typeof selectRef.setSelectedValues === "function") {
481
- const values = Array.isArray(currentValue) ? currentValue : [currentValue];
482
- selectRef.setSelectedValues(values);
483
- }
484
- }
485
- }
486
- if ($$self.$$.dirty[0] & /*selectRef*/
487
- 4 | $$self.$$.dirty[1] & /*nativeListenersReady*/
488
- 536870912) {
489
- if (nativeListenersReady && selectRef) {
490
- updateConfig();
491
- }
492
- }
493
- };
494
- return [
495
- className,
496
- style,
497
- selectRef,
498
- listenForSelectEvents,
499
- value,
500
- items,
501
- groupedItems,
502
- defaultValue,
503
- multiple,
504
- searchable,
505
- placeholder,
506
- disabled,
507
- required,
508
- error,
509
- infiniteScroll,
510
- pageSize,
511
- virtualized,
512
- maxSelections,
513
- selectionConfig,
514
- multiSelectDisplay,
515
- scrollToSelected,
516
- styles,
517
- config,
518
- removeButtonIcon,
519
- disabledOptionBehavior,
520
- showSelectedIndicator,
521
- direction,
522
- placement,
523
- classMap,
524
- clearable,
525
- clearSelectionOnClear,
526
- clearSearchOnClear,
527
- clearAriaLabel,
528
- clearIcon,
529
- optionRenderer,
530
- trackingEnabled,
531
- trackEvents,
532
- trackStyling,
533
- trackLimitations,
534
- emitDiagnostics,
535
- trackingMaxEntries,
536
- limitationPolicies,
537
- autoMitigateRuntimeModeSwitch,
412
+ });
413
+ $.legacy_pre_effect_reset();
414
+ var $$exports = {
538
415
  open,
539
416
  close,
540
417
  focus,
@@ -548,141 +425,390 @@ function instance($$self, $$props, $$invalidate) {
548
425
  setRequiredState,
549
426
  validate,
550
427
  getCapabilities,
428
+ getEmptyStateContext,
551
429
  getKnownLimitations,
552
430
  getTrackingSnapshot,
553
431
  clearTracking,
554
432
  setLimitationPolicies,
555
- nativeListenersReady,
556
- internalValue,
557
- isControlled,
558
- currentValue,
559
- enhanced_select_binding
560
- ];
561
- }
562
- class Select extends SvelteComponent {
563
- constructor(options) {
564
- super();
565
- init(
566
- this,
567
- options,
568
- instance,
569
- create_fragment,
570
- safe_not_equal,
571
- {
572
- items: 5,
573
- groupedItems: 6,
574
- value: 4,
575
- defaultValue: 7,
576
- multiple: 8,
577
- searchable: 9,
578
- placeholder: 10,
579
- disabled: 11,
580
- required: 12,
581
- error: 13,
582
- infiniteScroll: 14,
583
- pageSize: 15,
584
- virtualized: 16,
585
- maxSelections: 17,
586
- selectionConfig: 18,
587
- multiSelectDisplay: 19,
588
- scrollToSelected: 20,
589
- styles: 21,
590
- config: 22,
591
- removeButtonIcon: 23,
592
- disabledOptionBehavior: 24,
593
- showSelectedIndicator: 25,
594
- direction: 26,
595
- placement: 27,
596
- className: 0,
597
- style: 1,
598
- classMap: 28,
599
- clearable: 29,
600
- clearSelectionOnClear: 30,
601
- clearSearchOnClear: 31,
602
- clearAriaLabel: 32,
603
- clearIcon: 33,
604
- optionRenderer: 34,
605
- trackingEnabled: 35,
606
- trackEvents: 36,
607
- trackStyling: 37,
608
- trackLimitations: 38,
609
- emitDiagnostics: 39,
610
- trackingMaxEntries: 40,
611
- limitationPolicies: 41,
612
- autoMitigateRuntimeModeSwitch: 42,
613
- open: 43,
614
- close: 44,
615
- focus: 45,
616
- setItems: 46,
617
- setGroupedItems: 47,
618
- clear: 48,
619
- clearSearch: 49,
620
- updateCoreConfig: 50,
621
- setError: 51,
622
- clearError: 52,
623
- setRequiredState: 53,
624
- validate: 54,
625
- getCapabilities: 55,
626
- getKnownLimitations: 56,
627
- getTrackingSnapshot: 57,
628
- clearTracking: 58,
629
- setLimitationPolicies: 59
630
- },
631
- null,
632
- [-1, -1, -1]
633
- );
634
- }
635
- get open() {
636
- return this.$$.ctx[43];
637
- }
638
- get close() {
639
- return this.$$.ctx[44];
640
- }
641
- get focus() {
642
- return this.$$.ctx[45];
643
- }
644
- get setItems() {
645
- return this.$$.ctx[46];
646
- }
647
- get setGroupedItems() {
648
- return this.$$.ctx[47];
649
- }
650
- get clear() {
651
- return this.$$.ctx[48];
652
- }
653
- get clearSearch() {
654
- return this.$$.ctx[49];
655
- }
656
- get updateCoreConfig() {
657
- return this.$$.ctx[50];
658
- }
659
- get setError() {
660
- return this.$$.ctx[51];
661
- }
662
- get clearError() {
663
- return this.$$.ctx[52];
664
- }
665
- get setRequiredState() {
666
- return this.$$.ctx[53];
667
- }
668
- get validate() {
669
- return this.$$.ctx[54];
670
- }
671
- get getCapabilities() {
672
- return this.$$.ctx[55];
673
- }
674
- get getKnownLimitations() {
675
- return this.$$.ctx[56];
676
- }
677
- get getTrackingSnapshot() {
678
- return this.$$.ctx[57];
433
+ get items() {
434
+ return items();
435
+ },
436
+ set items($$value) {
437
+ items($$value);
438
+ $.flush();
439
+ },
440
+ get groupedItems() {
441
+ return groupedItems();
442
+ },
443
+ set groupedItems($$value) {
444
+ groupedItems($$value);
445
+ $.flush();
446
+ },
447
+ get value() {
448
+ return value();
449
+ },
450
+ set value($$value) {
451
+ value($$value);
452
+ $.flush();
453
+ },
454
+ get defaultValue() {
455
+ return defaultValue();
456
+ },
457
+ set defaultValue($$value) {
458
+ defaultValue($$value);
459
+ $.flush();
460
+ },
461
+ get multiple() {
462
+ return multiple();
463
+ },
464
+ set multiple($$value) {
465
+ multiple($$value);
466
+ $.flush();
467
+ },
468
+ get searchable() {
469
+ return searchable();
470
+ },
471
+ set searchable($$value) {
472
+ searchable($$value);
473
+ $.flush();
474
+ },
475
+ get placeholder() {
476
+ return placeholder();
477
+ },
478
+ set placeholder($$value) {
479
+ placeholder($$value);
480
+ $.flush();
481
+ },
482
+ get disabled() {
483
+ return disabled();
484
+ },
485
+ set disabled($$value) {
486
+ disabled($$value);
487
+ $.flush();
488
+ },
489
+ get required() {
490
+ return required();
491
+ },
492
+ set required($$value) {
493
+ required($$value);
494
+ $.flush();
495
+ },
496
+ get error() {
497
+ return error();
498
+ },
499
+ set error($$value) {
500
+ error($$value);
501
+ $.flush();
502
+ },
503
+ get infiniteScroll() {
504
+ return infiniteScroll();
505
+ },
506
+ set infiniteScroll($$value) {
507
+ infiniteScroll($$value);
508
+ $.flush();
509
+ },
510
+ get pageSize() {
511
+ return pageSize();
512
+ },
513
+ set pageSize($$value) {
514
+ pageSize($$value);
515
+ $.flush();
516
+ },
517
+ get virtualized() {
518
+ return virtualized();
519
+ },
520
+ set virtualized($$value) {
521
+ virtualized($$value);
522
+ $.flush();
523
+ },
524
+ get maxSelections() {
525
+ return maxSelections();
526
+ },
527
+ set maxSelections($$value) {
528
+ maxSelections($$value);
529
+ $.flush();
530
+ },
531
+ get selectionConfig() {
532
+ return selectionConfig();
533
+ },
534
+ set selectionConfig($$value) {
535
+ selectionConfig($$value);
536
+ $.flush();
537
+ },
538
+ get multiSelectDisplay() {
539
+ return multiSelectDisplay();
540
+ },
541
+ set multiSelectDisplay($$value) {
542
+ multiSelectDisplay($$value);
543
+ $.flush();
544
+ },
545
+ get scrollToSelected() {
546
+ return scrollToSelected();
547
+ },
548
+ set scrollToSelected($$value) {
549
+ scrollToSelected($$value);
550
+ $.flush();
551
+ },
552
+ get styles() {
553
+ return styles();
554
+ },
555
+ set styles($$value) {
556
+ styles($$value);
557
+ $.flush();
558
+ },
559
+ get config() {
560
+ return config();
561
+ },
562
+ set config($$value) {
563
+ config($$value);
564
+ $.flush();
565
+ },
566
+ get removeButtonIcon() {
567
+ return removeButtonIcon();
568
+ },
569
+ set removeButtonIcon($$value) {
570
+ removeButtonIcon($$value);
571
+ $.flush();
572
+ },
573
+ get disabledOptionBehavior() {
574
+ return disabledOptionBehavior();
575
+ },
576
+ set disabledOptionBehavior($$value) {
577
+ disabledOptionBehavior($$value);
578
+ $.flush();
579
+ },
580
+ get showSelectedIndicator() {
581
+ return showSelectedIndicator();
582
+ },
583
+ set showSelectedIndicator($$value) {
584
+ showSelectedIndicator($$value);
585
+ $.flush();
586
+ },
587
+ get direction() {
588
+ return direction();
589
+ },
590
+ set direction($$value) {
591
+ direction($$value);
592
+ $.flush();
593
+ },
594
+ get placement() {
595
+ return placement();
596
+ },
597
+ set placement($$value) {
598
+ placement($$value);
599
+ $.flush();
600
+ },
601
+ get className() {
602
+ return className();
603
+ },
604
+ set className($$value) {
605
+ className($$value);
606
+ $.flush();
607
+ },
608
+ get style() {
609
+ return style();
610
+ },
611
+ set style($$value) {
612
+ style($$value);
613
+ $.flush();
614
+ },
615
+ get classMap() {
616
+ return classMap();
617
+ },
618
+ set classMap($$value) {
619
+ classMap($$value);
620
+ $.flush();
621
+ },
622
+ get clearable() {
623
+ return clearable();
624
+ },
625
+ set clearable($$value) {
626
+ clearable($$value);
627
+ $.flush();
628
+ },
629
+ get clearSelectionOnClear() {
630
+ return clearSelectionOnClear();
631
+ },
632
+ set clearSelectionOnClear($$value) {
633
+ clearSelectionOnClear($$value);
634
+ $.flush();
635
+ },
636
+ get clearSearchOnClear() {
637
+ return clearSearchOnClear();
638
+ },
639
+ set clearSearchOnClear($$value) {
640
+ clearSearchOnClear($$value);
641
+ $.flush();
642
+ },
643
+ get clearAriaLabel() {
644
+ return clearAriaLabel();
645
+ },
646
+ set clearAriaLabel($$value) {
647
+ clearAriaLabel($$value);
648
+ $.flush();
649
+ },
650
+ get clearIcon() {
651
+ return clearIcon();
652
+ },
653
+ set clearIcon($$value) {
654
+ clearIcon($$value);
655
+ $.flush();
656
+ },
657
+ get optionRenderer() {
658
+ return optionRenderer();
659
+ },
660
+ set optionRenderer($$value) {
661
+ optionRenderer($$value);
662
+ $.flush();
663
+ },
664
+ get trackingEnabled() {
665
+ return trackingEnabled();
666
+ },
667
+ set trackingEnabled($$value) {
668
+ trackingEnabled($$value);
669
+ $.flush();
670
+ },
671
+ get trackEvents() {
672
+ return trackEvents();
673
+ },
674
+ set trackEvents($$value) {
675
+ trackEvents($$value);
676
+ $.flush();
677
+ },
678
+ get trackStyling() {
679
+ return trackStyling();
680
+ },
681
+ set trackStyling($$value) {
682
+ trackStyling($$value);
683
+ $.flush();
684
+ },
685
+ get trackLimitations() {
686
+ return trackLimitations();
687
+ },
688
+ set trackLimitations($$value) {
689
+ trackLimitations($$value);
690
+ $.flush();
691
+ },
692
+ get emitDiagnostics() {
693
+ return emitDiagnostics();
694
+ },
695
+ set emitDiagnostics($$value) {
696
+ emitDiagnostics($$value);
697
+ $.flush();
698
+ },
699
+ get trackingMaxEntries() {
700
+ return trackingMaxEntries();
701
+ },
702
+ set trackingMaxEntries($$value) {
703
+ trackingMaxEntries($$value);
704
+ $.flush();
705
+ },
706
+ get limitationPolicies() {
707
+ return limitationPolicies();
708
+ },
709
+ set limitationPolicies($$value) {
710
+ limitationPolicies($$value);
711
+ $.flush();
712
+ },
713
+ get autoMitigateRuntimeModeSwitch() {
714
+ return autoMitigateRuntimeModeSwitch();
715
+ },
716
+ set autoMitigateRuntimeModeSwitch($$value) {
717
+ autoMitigateRuntimeModeSwitch($$value);
718
+ $.flush();
719
+ },
720
+ get loadingIcon() {
721
+ return loadingIcon();
722
+ },
723
+ set loadingIcon($$value) {
724
+ loadingIcon($$value);
725
+ $.flush();
726
+ },
727
+ get loadingContent() {
728
+ return loadingContent();
729
+ },
730
+ set loadingContent($$value) {
731
+ loadingContent($$value);
732
+ $.flush();
733
+ },
734
+ get emptyState() {
735
+ return emptyState();
736
+ },
737
+ set emptyState($$value) {
738
+ emptyState($$value);
739
+ $.flush();
740
+ },
741
+ $set: $.update_legacy_props,
742
+ $on: ($$event_name, $$event_cb) => $.add_legacy_event_listener($$props, $$event_name, $$event_cb)
743
+ };
744
+ $.init();
745
+ var enhanced_select = root_3();
746
+ var node = $.child(enhanced_select);
747
+ {
748
+ var consequent = ($$anchor2) => {
749
+ var span = root();
750
+ var node_1 = $.child(span);
751
+ $.snippet(node_1, loadingIcon);
752
+ $.reset(span);
753
+ $.append($$anchor2, span);
754
+ };
755
+ $.if(node, ($$render) => {
756
+ if (loadingIcon()) $$render(consequent);
757
+ });
679
758
  }
680
- get clearTracking() {
681
- return this.$$.ctx[58];
759
+ var node_2 = $.sibling(node, 2);
760
+ {
761
+ var consequent_1 = ($$anchor2) => {
762
+ var div = root_1();
763
+ var node_3 = $.child(div);
764
+ $.snippet(node_3, loadingContent);
765
+ $.reset(div);
766
+ $.append($$anchor2, div);
767
+ };
768
+ $.if(node_2, ($$render) => {
769
+ if (loadingContent()) $$render(consequent_1);
770
+ });
682
771
  }
683
- get setLimitationPolicies() {
684
- return this.$$.ctx[59];
772
+ var node_4 = $.sibling(node_2, 2);
773
+ {
774
+ var consequent_2 = ($$anchor2) => {
775
+ var div_1 = root_2();
776
+ var node_5 = $.child(div_1);
777
+ $.snippet(node_5, emptyState, () => $.get(emptyStateContext));
778
+ $.reset(div_1);
779
+ $.append($$anchor2, div_1);
780
+ };
781
+ $.if(node_4, ($$render) => {
782
+ if ($.get(emptyStateContext) && emptyState()) $$render(consequent_2);
783
+ });
685
784
  }
785
+ $.reset(enhanced_select);
786
+ $.action(enhanced_select, ($$node) => listenForSelectEvents == null ? void 0 : listenForSelectEvents($$node));
787
+ $.bind_this(enhanced_select, ($$value) => $.set(selectRef, $$value), () => $.get(selectRef));
788
+ $.template_effect(() => {
789
+ $.set_class(enhanced_select, 1, $.clsx(className()));
790
+ $.set_style(enhanced_select, style());
791
+ });
792
+ $.append($$anchor, enhanced_select);
793
+ $.bind_prop($$props, "open", open);
794
+ $.bind_prop($$props, "close", close);
795
+ $.bind_prop($$props, "focus", focus);
796
+ $.bind_prop($$props, "setItems", setItems);
797
+ $.bind_prop($$props, "setGroupedItems", setGroupedItems);
798
+ $.bind_prop($$props, "clear", clear);
799
+ $.bind_prop($$props, "clearSearch", clearSearch);
800
+ $.bind_prop($$props, "updateCoreConfig", updateCoreConfig);
801
+ $.bind_prop($$props, "setError", setError);
802
+ $.bind_prop($$props, "clearError", clearError);
803
+ $.bind_prop($$props, "setRequiredState", setRequiredState);
804
+ $.bind_prop($$props, "validate", validate);
805
+ $.bind_prop($$props, "getCapabilities", getCapabilities);
806
+ $.bind_prop($$props, "getEmptyStateContext", getEmptyStateContext);
807
+ $.bind_prop($$props, "getKnownLimitations", getKnownLimitations);
808
+ $.bind_prop($$props, "getTrackingSnapshot", getTrackingSnapshot);
809
+ $.bind_prop($$props, "clearTracking", clearTracking);
810
+ $.bind_prop($$props, "setLimitationPolicies", setLimitationPolicies);
811
+ return $.pop($$exports);
686
812
  }
687
813
  export {
688
814
  Select,