@k2b/ui 0.10.0 → 0.12.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.
Files changed (83) hide show
  1. package/dist/browser/content/FileView.js +203 -136
  2. package/dist/browser/content/FileView.js.map +1 -1
  3. package/dist/browser/content/markdown-title.js +52 -0
  4. package/dist/browser/content/markdown-title.js.map +1 -0
  5. package/dist/browser/feedback/HoverPreview.js +6 -6
  6. package/dist/browser/feedback/HoverPreview.js.map +1 -1
  7. package/dist/browser/feedback/index.js.map +1 -1
  8. package/dist/browser/feedback/prompts.js +18 -19
  9. package/dist/browser/feedback/prompts.js.map +1 -1
  10. package/dist/browser/feedback/toast.js +363 -122
  11. package/dist/browser/feedback/toast.js.map +1 -1
  12. package/dist/browser/inputs/DatePicker.js +263 -222
  13. package/dist/browser/inputs/DatePicker.js.map +1 -1
  14. package/dist/browser/inputs/MultiSelectInput.js +139 -105
  15. package/dist/browser/inputs/MultiSelectInput.js.map +1 -1
  16. package/dist/browser/inputs/NumberInput.js +209 -122
  17. package/dist/browser/inputs/NumberInput.js.map +1 -1
  18. package/dist/browser/inputs/Select.js +184 -92
  19. package/dist/browser/inputs/Select.js.map +1 -1
  20. package/dist/browser/inputs/index.js.map +1 -1
  21. package/dist/browser/intl/messages.js +4 -0
  22. package/dist/browser/intl/messages.js.map +1 -1
  23. package/dist/browser/layout/AppWorkspace.js +105 -77
  24. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  25. package/dist/browser/layout/DetailPanel.js +2 -1
  26. package/dist/browser/layout/DetailPanel.js.map +1 -1
  27. package/dist/browser/layout/Navigation.js +1 -0
  28. package/dist/browser/layout/Navigation.js.map +1 -1
  29. package/dist/browser/layout/PanelDialog.js +1 -0
  30. package/dist/browser/layout/PanelDialog.js.map +1 -1
  31. package/dist/browser/layout/Settings.js +2 -2
  32. package/dist/browser/layout/Settings.js.map +1 -1
  33. package/dist/browser/layout/app-workspace-controller.js +30 -2
  34. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  35. package/dist/ssr/content/FileView.js +141 -81
  36. package/dist/ssr/content/FileView.js.map +1 -1
  37. package/dist/ssr/content/markdown-title.js +52 -0
  38. package/dist/ssr/content/markdown-title.js.map +1 -0
  39. package/dist/ssr/feedback/HoverPreview.js +6 -6
  40. package/dist/ssr/feedback/HoverPreview.js.map +1 -1
  41. package/dist/ssr/feedback/index.js.map +1 -1
  42. package/dist/ssr/feedback/prompts.js +1 -1
  43. package/dist/ssr/feedback/prompts.js.map +1 -1
  44. package/dist/ssr/feedback/toast.js +363 -122
  45. package/dist/ssr/feedback/toast.js.map +1 -1
  46. package/dist/ssr/inputs/DatePicker.js +78 -52
  47. package/dist/ssr/inputs/DatePicker.js.map +1 -1
  48. package/dist/ssr/inputs/MultiSelectInput.js +52 -32
  49. package/dist/ssr/inputs/MultiSelectInput.js.map +1 -1
  50. package/dist/ssr/inputs/NumberInput.js +93 -40
  51. package/dist/ssr/inputs/NumberInput.js.map +1 -1
  52. package/dist/ssr/inputs/Select.js +108 -29
  53. package/dist/ssr/inputs/Select.js.map +1 -1
  54. package/dist/ssr/inputs/index.js.map +1 -1
  55. package/dist/ssr/intl/messages.js +4 -0
  56. package/dist/ssr/intl/messages.js.map +1 -1
  57. package/dist/ssr/layout/AppWorkspace.js +84 -66
  58. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  59. package/dist/ssr/layout/DetailPanel.js +2 -1
  60. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  61. package/dist/ssr/layout/Navigation.js +1 -0
  62. package/dist/ssr/layout/Navigation.js.map +1 -1
  63. package/dist/ssr/layout/PanelDialog.js +1 -0
  64. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  65. package/dist/ssr/layout/Settings.js +2 -2
  66. package/dist/ssr/layout/Settings.js.map +1 -1
  67. package/dist/ssr/layout/app-workspace-controller.js +30 -2
  68. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  69. package/dist/styles.css +1 -1
  70. package/dist/types/content/FileView.d.ts +11 -1
  71. package/dist/types/content/markdown-title.d.ts +9 -0
  72. package/dist/types/feedback/index.d.ts +1 -1
  73. package/dist/types/feedback/toast.d.ts +7 -0
  74. package/dist/types/inputs/DatePicker.d.ts +11 -2
  75. package/dist/types/inputs/MultiSelectInput.d.ts +5 -1
  76. package/dist/types/inputs/NumberInput.d.ts +14 -0
  77. package/dist/types/inputs/Select.d.ts +10 -0
  78. package/dist/types/inputs/index.d.ts +1 -1
  79. package/dist/types/intl/messages.d.ts +2 -0
  80. package/dist/types/layout/AppWorkspace.d.ts +14 -0
  81. package/dist/types/layout/Settings.d.ts +2 -2
  82. package/dist/types/layout/app-workspace-controller.d.ts +5 -0
  83. package/package.json +1 -1
@@ -7,25 +7,37 @@ import { createComponent as _$createComponent } from "solid-js/web";
7
7
  import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
8
8
  import { escape as _$escape } from "solid-js/web";
9
9
  var _tmpl$ = ["<span class=\"k2b-choice-trigger__value\"", ">", "</span>"],
10
- _tmpl$2 = ["<i", " aria-hidden=\"true\"></i>"],
10
+ _tmpl$2 = ["<i class=\"", "\" aria-hidden=\"true\"></i>"],
11
11
  _tmpl$3 = ["<button type=\"button\" class=\"k2b-choice-control__clear k2b-input-clear-action\"", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i></button>"],
12
12
  _tmpl$4 = ["<div class=\"k2b-choice-search\"><i class=\"ti ti-search\" aria-hidden=\"true\"></i><input type=\"search\"", "></div>"],
13
13
  _tmpl$5 = ["<button type=\"button\" class=\"k2b-choice-view-toggle\"", "><i", " aria-hidden=\"true\"></i></button>"],
14
14
  _tmpl$6 = ["<div class=\"k2b-choice-toolbar\">", "", "</div>"],
15
15
  _tmpl$7 = ["<div class=\"k2b-choice-status\"><i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\"></i><span>", "</span></div>"],
16
16
  _tmpl$8 = ["<div class=\"k2b-choice-control\"", ">", "", "", "<div popover=\"manual\" class=\"k2b-choice-popover\" role=\"group\"", ">", "", "<div", " class=\"k2b-choice-options\" role=\"listbox\"", ">", "", "", "</div></div></div>"],
17
- _tmpl$9 = ["<span class=\"k2b-choice-dot\" style=\"", "\" aria-hidden=\"true\"></span>"],
18
- _tmpl$0 = ["<input type=\"hidden\"", ">"],
19
- _tmpl$1 = ["<div class=\"k2b-choice-status\" data-tone=\"danger\"><span>", "</span><button type=\"button\">", "</button></div>"],
20
- _tmpl$10 = ["<div class=\"k2b-choice-status\">", "</div>"],
21
- _tmpl$11 = ["<button type=\"button\" id=\"", "\" class=\"k2b-choice-option\" role=\"option\"", "", ">", "<span><strong>", "</strong>", "</span></button>"],
22
- _tmpl$12 = ["<small>", "</small>"];
17
+ _tmpl$9 = "<span class=\"k2b-choice-dot\" data-empty=\"true\" aria-hidden=\"true\"></span>",
18
+ _tmpl$0 = ["<i", " aria-hidden=\"true\"></i>"],
19
+ _tmpl$1 = ["<span class=\"k2b-choice-dot\" style=\"", "\" aria-hidden=\"true\"></span>"],
20
+ _tmpl$10 = ["<input type=\"hidden\"", ">"],
21
+ _tmpl$11 = ["<div class=\"k2b-choice-status\" data-tone=\"danger\"><span>", "</span><button type=\"button\">", "</button></div>"],
22
+ _tmpl$12 = ["<div class=\"k2b-choice-status\">", "</div>"],
23
+ _tmpl$13 = ["<button type=\"button\" id=\"", "\" class=\"k2b-choice-option\" role=\"option\"", "", ">", "<span><strong>", "</strong>", "</span></button>"],
24
+ _tmpl$14 = ["<small>", "</small>"];
23
25
  import { createMemo, createSignal, For, Show } from "solid-js";
24
26
  import { createFieldMeta, Field, fieldControlAria } from "../internal/field";
25
27
  import { useUiMessages } from "../intl/messages";
26
28
  import { ChoiceGroups } from "./ChoiceGroups";
27
29
  import { createChoiceLoader, createChoicePopover, filterChoiceOptions, nextEnabledChoiceIndex } from "./choice";
28
30
  import { commitFieldValue, resolveMaybeAccessor } from "./field-contract";
31
+
32
+ /**
33
+ * `field` draws the boxed form control. `plain` shows the value as text for
34
+ * property rows: no box, no chevron, and a quiet surface on hover or while
35
+ * open. Its surface and hit area cover the nearest positioned ancestor, such as
36
+ * a `DescriptionList` row, so the whole row opens the picker.
37
+ */
38
+
39
+ /** The list entry that clears a plain select. It cannot collide with a real option value. */
40
+ const CLEAR_VALUE = "\u0000k2b-select-clear";
29
41
  const normalize = option => typeof option === "string" ? {
30
42
  value: option,
31
43
  label: option
@@ -67,6 +79,19 @@ export function Select(props) {
67
79
  // Remote loaders filter server-side; a static list has to be filtered here or
68
80
  // the search field would render but do nothing.
69
81
  const options = createMemo(() => isAsync() || !props.searchable ? groupedOptions() : props.filterOptions ? [...props.filterOptions(groupedOptions(), query())] : filterChoiceOptions(groupedOptions(), query()));
82
+ const plain = () => props.appearance === "plain";
83
+ // A plain select has no room for a clear button beside its value, so
84
+ // clearing becomes the last list entry, named by the placeholder.
85
+ const clearOption = createMemo(() => plain() && props.clearable && !query() ? {
86
+ value: CLEAR_VALUE,
87
+ label: props.placeholder ?? messages().clearSelection
88
+ } : undefined);
89
+ const listOptions = createMemo(() => {
90
+ const clear = clearOption();
91
+ return clear && !loader.error() ? [...options(), clear] : options();
92
+ });
93
+ // Colour dots mark the options, so an empty plain value keeps the column with a hollow dot.
94
+ const emptyDot = () => plain() && !props.placeholderIcon && sourceOptions().some(option => option.color);
70
95
  const selected = createMemo(() => {
71
96
  const current = value();
72
97
  if (current === null) return undefined;
@@ -77,29 +102,29 @@ export function Select(props) {
77
102
  label: props.selectedLabel?.() ?? current
78
103
  };
79
104
  });
80
- const hasClearAction = () => Boolean(props.clearable && selected() && !props.disabled);
105
+ const hasClearAction = () => Boolean(props.clearable && selected() && !props.disabled && !plain());
81
106
  const accessibleLabel = () => props["aria-label"] ?? (typeof props.label === "string" ? undefined : props.placeholder ?? messages().selectOption);
82
107
  const popover = createChoicePopover(() => Boolean(props.disabled));
83
- const focusedOption = () => options()[focusedIndex()];
108
+ const focusedOption = () => listOptions()[focusedIndex()];
84
109
  const focus = index => {
85
110
  setFocusedIndex(index);
86
111
  optionRefs[index]?.scrollIntoView({
87
112
  block: "nearest"
88
113
  });
89
114
  };
90
- const move = direction => focus(nextEnabledChoiceIndex(options(), focusedIndex(), direction));
115
+ const move = direction => focus(nextEnabledChoiceIndex(listOptions(), focusedIndex(), direction));
91
116
  const chooseGroup = group => {
92
117
  if (group === activeGroup()) return;
93
118
  setSelectedGroup(group);
94
- setFocusedIndex(nextEnabledChoiceIndex(options(), -1, 1));
119
+ setFocusedIndex(nextEnabledChoiceIndex(listOptions(), -1, 1));
95
120
  if (isAsync()) loader.load(query(), true);
96
121
  };
97
122
  const open = () => {
98
123
  if (props.disabled) return;
99
124
  setQuery("");
100
125
  if (isAsync()) loader.load("", true);
101
- const selectedIndex = options().findIndex(option => option.value === value());
102
- focus(selectedIndex >= 0 ? selectedIndex : nextEnabledChoiceIndex(options(), -1, 1));
126
+ const selectedIndex = listOptions().findIndex(option => option.value === (value() ?? CLEAR_VALUE));
127
+ focus(selectedIndex >= 0 ? selectedIndex : nextEnabledChoiceIndex(listOptions(), -1, 1));
103
128
  popover.show();
104
129
  if (isSearchable()) queueMicrotask(() => searchRef?.focus());
105
130
  };
@@ -115,6 +140,10 @@ export function Select(props) {
115
140
  const select = option => {
116
141
  if (option.disabled) return;
117
142
  close(true);
143
+ if (option.value === CLEAR_VALUE) {
144
+ commitFieldValue(props, null);
145
+ return;
146
+ }
118
147
  setCache({
119
148
  ...cache(),
120
149
  [option.value]: option
@@ -166,7 +195,7 @@ export function Select(props) {
166
195
  return props.disabled;
167
196
  },
168
197
  get children() {
169
- return _$ssr(_tmpl$8, _$ssrAttribute("data-invalid", error() ? "true" : _$escape(undefined, true), false), _$ssrElement("button", _$mergeProps({
198
+ return _$ssr(_tmpl$8, _$ssrAttribute("data-appearance", _$escape(props.appearance ?? "field", true), false) + _$ssrAttribute("data-invalid", error() ? "true" : _$escape(undefined, true), false), _$ssrElement("button", _$mergeProps({
170
199
  get id() {
171
200
  return meta.controlId;
172
201
  },
@@ -193,22 +222,47 @@ export function Select(props) {
193
222
  }
194
223
  }), [_$escape(_$createComponent(Show, {
195
224
  get when() {
196
- return selected()?.color;
225
+ return selected();
197
226
  },
198
227
  get fallback() {
199
228
  return _$createComponent(Show, {
200
229
  get when() {
201
- return selected()?.icon;
230
+ return props.placeholderIcon;
231
+ },
232
+ get fallback() {
233
+ return _$createComponent(Show, {
234
+ get when() {
235
+ return emptyDot();
236
+ },
237
+ get children() {
238
+ return _$ssr(_tmpl$9);
239
+ }
240
+ });
202
241
  },
203
- children: icon => _$ssr(_tmpl$2, _$ssrAttribute("class", _$escape(icon(), true), false))
242
+ children: icon => _$ssr(_tmpl$2, `${_$escape(icon(), true)} k2b-choice-trigger__placeholder-icon`)
204
243
  });
205
244
  },
206
- children: color => _$ssr(_tmpl$9, _$ssrStyleProperty("background-color:", _$escape(color(), true)))
207
- })), _$ssr(_tmpl$, _$ssrAttribute("data-placeholder", selected() ? _$escape(undefined, true) : "true", false), _$escape(selected()?.label ?? props.placeholder ?? messages().select)), _$ssr(_tmpl$2, _$ssrAttribute("class", popover.open() ? _$escape(props.activeIcon ?? "ti ti-chevron-up", true) : _$escape(props.icon ?? "ti ti-chevron-down", true), false))], false), _$escape(_$createComponent(Show, {
245
+ get children() {
246
+ return _$createComponent(Show, {
247
+ get when() {
248
+ return selected()?.color;
249
+ },
250
+ get fallback() {
251
+ return _$createComponent(Show, {
252
+ get when() {
253
+ return selected()?.icon;
254
+ },
255
+ children: icon => _$ssr(_tmpl$0, _$ssrAttribute("class", _$escape(icon(), true), false))
256
+ });
257
+ },
258
+ children: color => _$ssr(_tmpl$1, _$ssrStyleProperty("background-color:", _$escape(color(), true)))
259
+ });
260
+ }
261
+ })), _$ssr(_tmpl$, _$ssrAttribute("data-placeholder", selected() ? _$escape(undefined, true) : "true", false), _$escape(selected()?.label ?? props.placeholder ?? messages().select)), _$ssr(_tmpl$2, `${popover.open() ? _$escape(props.activeIcon ?? "ti ti-chevron-up", true) : _$escape(props.icon ?? "ti ti-chevron-down", true)} k2b-choice-trigger__chevron`)], false), _$escape(_$createComponent(Show, {
208
262
  get when() {
209
263
  return props.name;
210
264
  },
211
- children: name => _$ssr(_tmpl$0, _$ssrAttribute("name", _$escape(name(), true), false) + _$ssrAttribute("value", _$escape(value() ?? "", true), false))
265
+ children: name => _$ssr(_tmpl$10, _$ssrAttribute("name", _$escape(name(), true), false) + _$ssrAttribute("value", _$escape(value() ?? "", true), false))
212
266
  })), _$escape(_$createComponent(Show, {
213
267
  get when() {
214
268
  return hasClearAction();
@@ -260,7 +314,7 @@ export function Select(props) {
260
314
  get when() {
261
315
  return loader.error();
262
316
  },
263
- children: message => _$ssr(_tmpl$1, _$escape(message()), _$escape(messages().retry))
317
+ children: message => _$ssr(_tmpl$11, _$escape(message()), _$escape(messages().retry))
264
318
  })), _$escape(_$createComponent(Show, {
265
319
  get when() {
266
320
  return _$memo(() => !!loader.loading())() && options().length === 0;
@@ -270,7 +324,7 @@ export function Select(props) {
270
324
  }
271
325
  })), _$escape(_$createComponent(For, {
272
326
  get each() {
273
- return _$memo(() => !!loader.error())() ? [] : options();
327
+ return _$memo(() => !!loader.error())() ? [] : listOptions();
274
328
  },
275
329
  get fallback() {
276
330
  return _$createComponent(Show, {
@@ -278,28 +332,53 @@ export function Select(props) {
278
332
  return _$memo(() => !!!loader.loading())() && !loader.error();
279
333
  },
280
334
  get children() {
281
- return _$ssr(_tmpl$10, isSearchable() ? _$escape(messages().noResults) : _$escape(messages().noOptions));
335
+ return _$ssr(_tmpl$12, isSearchable() ? _$escape(messages().noResults) : _$escape(messages().noOptions));
282
336
  }
283
337
  });
284
338
  },
285
- children: (option, index) => _$ssr(_tmpl$11, `${_$escape(listboxId, true)}-${_$escape(index(), true)}`, _$ssrAttribute("aria-label", _$escape(option.label, true), false) + _$ssrAttribute("aria-selected", _$escape(option.value, true) === _$escape(value(), true), false) + _$ssrAttribute("data-focused", index() === focusedIndex() ? "true" : _$escape(undefined, true), false), _$ssrAttribute("disabled", option.disabled, true), _$escape(_$createComponent(Show, {
339
+ children: (option, index) => _$ssr(_tmpl$13, `${_$escape(listboxId, true)}-${_$escape(index(), true)}`, _$ssrAttribute("aria-label", _$escape(option.label, true), false) + _$ssrAttribute("aria-selected", _$escape(option.value, true) === _$escape(value() ?? CLEAR_VALUE, true), false) + _$ssrAttribute("data-focused", index() === focusedIndex() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-clear", option.value === CLEAR_VALUE ? "true" : _$escape(undefined, true), false), _$ssrAttribute("disabled", option.disabled, true), _$escape(_$createComponent(Show, {
286
340
  get when() {
287
- return option.color;
341
+ return option.value === CLEAR_VALUE;
288
342
  },
289
343
  get fallback() {
290
344
  return _$createComponent(Show, {
291
345
  get when() {
292
- return option.icon;
346
+ return option.color;
347
+ },
348
+ get fallback() {
349
+ return _$createComponent(Show, {
350
+ get when() {
351
+ return option.icon;
352
+ },
353
+ children: icon => _$ssr(_tmpl$0, _$ssrAttribute("class", _$escape(icon(), true), false))
354
+ });
293
355
  },
294
- children: icon => _$ssr(_tmpl$2, _$ssrAttribute("class", _$escape(icon(), true), false))
356
+ children: color => _$ssr(_tmpl$1, _$ssrStyleProperty("background-color:", _$escape(color(), true)))
295
357
  });
296
358
  },
297
- children: color => _$ssr(_tmpl$9, _$ssrStyleProperty("background-color:", _$escape(color(), true)))
359
+ get children() {
360
+ return _$createComponent(Show, {
361
+ get when() {
362
+ return props.placeholderIcon;
363
+ },
364
+ get fallback() {
365
+ return _$createComponent(Show, {
366
+ get when() {
367
+ return emptyDot();
368
+ },
369
+ get children() {
370
+ return _$ssr(_tmpl$9);
371
+ }
372
+ });
373
+ },
374
+ children: icon => _$ssr(_tmpl$0, _$ssrAttribute("class", _$escape(icon(), true), false))
375
+ });
376
+ }
298
377
  })), _$escape(option.label), _$escape(_$createComponent(Show, {
299
378
  get when() {
300
379
  return option.description;
301
380
  },
302
- children: description => _$ssr(_tmpl$12, _$escape(description()))
381
+ children: description => _$ssr(_tmpl$14, _$escape(description()))
303
382
  })))
304
383
  })));
305
384
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["inputs/Select.tsx"],"sourcesContent":["import { createMemo, createSignal, For, type JSX, Show } from \"solid-js\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { ChoiceGroups } from \"./ChoiceGroups\";\nimport { type ChoiceOption, createChoiceLoader, createChoicePopover, filterChoiceOptions, nextEnabledChoiceIndex } from \"./choice\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { commitFieldValue, resolveMaybeAccessor } from \"./field-contract\";\n\nexport type SelectOption = ChoiceOption<string>;\nexport type SelectGroup = {\n value: string;\n label: string;\n};\nexport type SelectView = \"list\" | \"grid\";\nexport type SelectGridSize = \"sm\" | \"md\" | \"lg\";\nexport type SelectSourceOption =\n | string\n | {\n id: string;\n label?: string;\n description?: string;\n icon?: string;\n color?: string;\n groups?: readonly string[];\n }\n | SelectOption;\n\nexport type SelectProps = ValueFieldProps<string | null> & {\n placeholder?: string;\n icon?: string;\n activeIcon?: string;\n options?: SelectSourceOption[];\n fetchData?: (query: string, signal: AbortSignal, group: string | null) => Promise<SelectSourceOption[]>;\n loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;\n selectedOption?: ChoiceOption<string>;\n selectedLabel?: () => string | undefined;\n fetchDebounceMs?: number;\n debounceMs?: number;\n searchable?: boolean;\n /** Optional synchronous filter for static options. */\n filterOptions?: (options: readonly SelectOption[], query: string) => readonly SelectOption[];\n /** Optional filters. An option may belong to more than one group. */\n groups?: readonly SelectGroup[];\n /** Group selected when the component is created. Omit to start with all options. */\n defaultGroup?: string;\n groupsAriaLabel?: string;\n allGroupLabel?: string;\n /** Show a local list/grid layout toggle in the dropdown. */\n viewToggle?: boolean;\n /** Initial dropdown layout when `viewToggle` is enabled. */\n defaultView?: SelectView;\n /** Tile density for the grid layout. */\n gridSize?: SelectGridSize;\n searchPlaceholder?: string;\n clearable?: boolean;\n name?: string;\n};\n\ntype NormalizedOption = ChoiceOption<string>;\nconst normalize = (option: SelectSourceOption): NormalizedOption =>\n typeof option === \"string\"\n ? { value: option, label: option }\n : \"value\" in option\n ? option\n : { ...option, value: option.id, label: option.label || option.id };\n\nexport function Select(props: SelectProps): JSX.Element {\n const messages = useUiMessages();\n const meta = createFieldMeta(props.id);\n const listboxId = `${meta.controlId}-listbox`;\n const [query, setQuery] = createSignal(\"\");\n const [focusedIndex, setFocusedIndex] = createSignal(-1);\n const [cache, setCache] = createSignal<Record<string, NormalizedOption>>({});\n const [selectedGroup, setSelectedGroup] = createSignal<string | null>(props.defaultGroup ?? null);\n const [selectedView, setSelectedView] = createSignal<SelectView>(props.defaultView ?? \"list\");\n let searchRef: HTMLInputElement | undefined;\n let optionRefs: HTMLButtonElement[] = [];\n const value = () => resolveMaybeAccessor(props.value) ?? null;\n const error = () => resolveMaybeAccessor(props.error);\n const activeGroup = createMemo(() => {\n const current = selectedGroup();\n return current && props.groups?.some((group) => group.value === current) ? current : null;\n });\n const groupChoices = createMemo(() => [{ value: null, label: props.allGroupLabel ?? messages().all }, ...(props.groups ?? [])]);\n const activeView = () => (props.viewToggle ? selectedView() : \"list\");\n\n const loader = createChoiceLoader(\n () =>\n props.fetchData\n ? async (value, signal) => (await props.fetchData!(value, signal, activeGroup())).map(normalize)\n : props.loadOptions\n ? (value, signal) => props.loadOptions!(value, signal, activeGroup())\n : undefined,\n () => props.fetchDebounceMs ?? props.debounceMs ?? 200,\n );\n const isAsync = () => Boolean(props.fetchData || props.loadOptions);\n const isSearchable = () => isAsync() || Boolean(props.searchable);\n const sourceOptions = createMemo(() => (isAsync() ? loader.options() : (props.options ?? []).map(normalize)));\n const groupedOptions = createMemo(() => {\n const group = activeGroup();\n return !isAsync() && group ? sourceOptions().filter((option) => option.groups?.includes(group)) : sourceOptions();\n });\n // Remote loaders filter server-side; a static list has to be filtered here or\n // the search field would render but do nothing.\n const options = createMemo(() =>\n isAsync() || !props.searchable\n ? groupedOptions()\n : props.filterOptions\n ? [...props.filterOptions(groupedOptions(), query())]\n : filterChoiceOptions(groupedOptions(), query()),\n );\n const selected = createMemo(() => {\n const current = value();\n if (current === null) return undefined;\n // Resolve against the unfiltered list so typing in the search field never\n // blanks the trigger label of the current selection.\n return (\n sourceOptions().find((option) => option.value === current) ??\n cache()[current] ??\n (props.selectedOption?.value === current ? props.selectedOption : undefined) ?? {\n value: current,\n label: props.selectedLabel?.() ?? current,\n }\n );\n });\n const hasClearAction = () => Boolean(props.clearable && selected() && !props.disabled);\n const accessibleLabel = () =>\n props[\"aria-label\"] ?? (typeof props.label === \"string\" ? undefined : (props.placeholder ?? messages().selectOption));\n const popover = createChoicePopover(() => Boolean(props.disabled));\n const focusedOption = () => options()[focusedIndex()];\n const focus = (index: number) => {\n setFocusedIndex(index);\n optionRefs[index]?.scrollIntoView({ block: \"nearest\" });\n };\n const move = (direction: 1 | -1) => focus(nextEnabledChoiceIndex(options(), focusedIndex(), direction));\n const chooseGroup = (group: string | null) => {\n if (group === activeGroup()) return;\n setSelectedGroup(group);\n setFocusedIndex(nextEnabledChoiceIndex(options(), -1, 1));\n if (isAsync()) loader.load(query(), true);\n };\n const open = () => {\n if (props.disabled) return;\n setQuery(\"\");\n if (isAsync()) loader.load(\"\", true);\n const selectedIndex = options().findIndex((option) => option.value === value());\n focus(selectedIndex >= 0 ? selectedIndex : nextEnabledChoiceIndex(options(), -1, 1));\n popover.show();\n if (isSearchable()) queueMicrotask(() => searchRef?.focus());\n };\n const close = (restoreFocus = false) => {\n // Hide the top-layer surface before any reactive cleanup or consumer\n // callback can rerender its contents. Selection must feel atomic: the old\n // listbox must never remain visible with the next value.\n popover.hide(restoreFocus);\n loader.cancel();\n setQuery(\"\");\n setFocusedIndex(-1);\n };\n const select = (option: NormalizedOption) => {\n if (option.disabled) return;\n close(true);\n setCache({ ...cache(), [option.value]: option });\n commitFieldValue(props, option.value);\n };\n const onKeyDown = (event: KeyboardEvent) => {\n const inToolbar = Boolean((event.target as HTMLElement | null)?.closest?.(\".k2b-choice-toolbar\"));\n if (inToolbar && event.key !== \"Escape\" && event.key !== \"Tab\") return;\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!popover.open()) open();\n else move(event.key === \"ArrowDown\" ? 1 : -1);\n } else if ((event.key === \"Enter\" || event.key === \" \") && !popover.open()) {\n event.preventDefault();\n open();\n } else if (event.key === \"Enter\" && focusedOption()) {\n event.preventDefault();\n select(focusedOption()!);\n } else if (event.key === \"Escape\" && popover.open()) {\n // Only swallow Escape while the list is open — a closed select must let\n // the key bubble to an enclosing dialog or drawer.\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\" && popover.open()) close();\n };\n const clear = (event: MouseEvent) => {\n event.stopPropagation();\n commitFieldValue(props, null);\n popover.trigger()?.focus();\n };\n\n return (\n <Field\n class={props.class}\n label={props.label}\n description={props.description}\n error={error()}\n meta={meta}\n required={props.required}\n disabled={props.disabled}\n >\n <div class=\"k2b-choice-control\" data-invalid={error() ? \"true\" : undefined}>\n <button\n ref={popover.setTrigger}\n id={meta.controlId}\n type=\"button\"\n class=\"k2b-choice-trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={popover.open()}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n data-clearable={hasClearAction() ? \"true\" : undefined}\n {...fieldControlAria(meta, {\n ...props,\n \"aria-label\": accessibleLabel(),\n })}\n disabled={props.disabled}\n onClick={() => (popover.open() ? close() : open())}\n onKeyDown={onKeyDown}\n >\n <Show\n when={selected()?.color}\n fallback={<Show when={selected()?.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}\n >\n {(color) => <span class=\"k2b-choice-dot\" style={{ \"background-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-trigger__value\" data-placeholder={selected() ? undefined : \"true\"}>\n {selected()?.label ?? props.placeholder ?? messages().select}\n </span>\n <i class={popover.open() ? (props.activeIcon ?? \"ti ti-chevron-up\") : (props.icon ?? \"ti ti-chevron-down\")} aria-hidden=\"true\" />\n </button>\n <Show when={props.name}>{(name) => <input type=\"hidden\" name={name()} value={value() ?? \"\"} />}</Show>\n <Show when={hasClearAction()}>\n <button\n type=\"button\"\n class=\"k2b-choice-control__clear k2b-input-clear-action\"\n aria-label={messages().clearSelection}\n onClick={clear}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n <div\n ref={popover.setPopover}\n popover=\"manual\"\n class=\"k2b-choice-popover\"\n role=\"group\"\n onKeyDown={onKeyDown}\n aria-label={typeof props.label === \"string\" ? props.label : (props[\"aria-label\"] ?? messages().options)}\n >\n <Show when={isSearchable()}>\n <div class=\"k2b-choice-search\">\n <i class=\"ti ti-search\" aria-hidden=\"true\" />\n <input\n ref={searchRef}\n type=\"search\"\n value={query()}\n placeholder={props.searchPlaceholder ?? messages().search}\n aria-label={props.searchPlaceholder ?? messages().searchOptions}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n onInput={(event) => {\n setQuery(event.currentTarget.value);\n if (isAsync()) loader.load(event.currentTarget.value);\n focus(isAsync() ? -1 : nextEnabledChoiceIndex(options(), -1, 1));\n }}\n />\n </div>\n </Show>\n <Show when={(props.groups?.length ?? 0) > 0 || props.viewToggle}>\n <div class=\"k2b-choice-toolbar\">\n <Show when={(props.groups?.length ?? 0) > 0}>\n <ChoiceGroups\n choices={groupChoices()}\n value={activeGroup()}\n onValueChange={chooseGroup}\n ariaLabel={props.groupsAriaLabel ?? messages().filterOptions}\n controls={listboxId}\n />\n </Show>\n <Show when={props.viewToggle}>\n <button\n type=\"button\"\n class=\"k2b-choice-view-toggle\"\n aria-label={activeView() === \"list\" ? messages().showGridView : messages().showListView}\n aria-controls={listboxId}\n onClick={() => setSelectedView(activeView() === \"list\" ? \"grid\" : \"list\")}\n >\n <i class={activeView() === \"list\" ? \"ti ti-category-2\" : \"ti ti-list-details\"} aria-hidden=\"true\" />\n </button>\n </Show>\n </div>\n </Show>\n <div\n id={listboxId}\n class=\"k2b-choice-options\"\n role=\"listbox\"\n data-view={activeView()}\n data-grid-size={activeView() === \"grid\" ? (props.gridSize ?? \"md\") : undefined}\n >\n <Show when={loader.error()}>\n {(message) => (\n <div class=\"k2b-choice-status\" data-tone=\"danger\">\n <span>{message()}</span>\n <button type=\"button\" onClick={loader.retry}>\n {messages().retry}\n </button>\n </div>\n )}\n </Show>\n <Show when={loader.loading() && options().length === 0}>\n <div class=\"k2b-choice-status\">\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span>{messages().loading}</span>\n </div>\n </Show>\n <For\n each={loader.error() ? [] : options()}\n fallback={\n <Show when={!loader.loading() && !loader.error()}>\n <div class=\"k2b-choice-status\">{isSearchable() ? messages().noResults : messages().noOptions}</div>\n </Show>\n }\n >\n {(option, index) => (\n <button\n ref={(element) => (optionRefs[index()] = element)}\n type=\"button\"\n id={`${listboxId}-${index()}`}\n class=\"k2b-choice-option\"\n role=\"option\"\n aria-label={option.label}\n aria-selected={option.value === value()}\n data-focused={index() === focusedIndex() ? \"true\" : undefined}\n disabled={option.disabled}\n onPointerMove={() => focus(index())}\n onClick={() => select(option)}\n >\n <Show when={option.color} fallback={<Show when={option.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}>\n {(color) => <span class=\"k2b-choice-dot\" style={{ \"background-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n <span>\n <strong>{option.label}</strong>\n <Show when={option.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n </button>\n )}\n </For>\n </div>\n </div>\n </div>\n </Field>\n );\n}\n\nexport default Select;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,IAAI,QAAQ,UAAU;AACxE,SAA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Q;UAAA,yBACL,IAAI;YAAA,IAAC,IAAI;cAAA,OAAE,gBAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAAA;YAAA;cAAA,uBACd,YAAY,CAAC,CAAC,YAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,aAAG,QAAQ,CAAC,CAAC,CAAC,SAAS;YAAA;UAAA;QAAA;QAAA,UAI/F,CAAC,MAAM,EAAE,KAAK,qBAIP,YAAG,SAAS,oBAAI,KAAK,CAAC,CAAC,SAAE,wCAGjB,MAAM,CAAC,KAAK,kDACT,eAAM,CAAC,KAAK,qBAAK,KAAK,CAAC,CAAC,iDACzB,KAAK,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,GAAG,MAAM,YAAG,SAAS,4CACnD,MAAM,CAAC,QAAQ,oCAIxB,IAAI;UAAA,IAAC,IAAI;YAAA,OAAE,MAAM,CAAC,KAAK;UAAA;UAAA,IAAE,QAAQ;YAAA,yBAAG,IAAI;cAAA,IAAC,IAAI;gBAAA,OAAE,MAAM,CAAC,IAAI;cAAA;cAAA,UAAI,IAAI,oDAAe,IAAI,CAAC,CAAC;YAAuB;UAAA;UAAA,UAC3G,KAAK,oEAA+D,KAAK,CAAC,CAAC;QAAyB,cAG7F,MAAM,CAAC,KAAK,8BACpB,IAAI;UAAA,IAAC,IAAI;YAAA,OAAE,MAAM,CAAC,WAAW;UAAA;UAAA,UAAI,WAAW,6BAAa,WAAW,CAAC,CAAC;QAAS;MAGrF;IAAA;EAAA;AAOf;AAEA,eAAe,MAAM","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["inputs/Select.tsx"],"sourcesContent":["import { createMemo, createSignal, For, type JSX, Show } from \"solid-js\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { ChoiceGroups } from \"./ChoiceGroups\";\nimport { type ChoiceOption, createChoiceLoader, createChoicePopover, filterChoiceOptions, nextEnabledChoiceIndex } from \"./choice\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { commitFieldValue, resolveMaybeAccessor } from \"./field-contract\";\n\nexport type SelectOption = ChoiceOption<string>;\nexport type SelectGroup = {\n value: string;\n label: string;\n};\nexport type SelectView = \"list\" | \"grid\";\nexport type SelectGridSize = \"sm\" | \"md\" | \"lg\";\n/**\n * `field` draws the boxed form control. `plain` shows the value as text for\n * property rows: no box, no chevron, and a quiet surface on hover or while\n * open. Its surface and hit area cover the nearest positioned ancestor, such as\n * a `DescriptionList` row, so the whole row opens the picker.\n */\nexport type ChoiceAppearance = \"field\" | \"plain\";\nexport type SelectSourceOption =\n | string\n | {\n id: string;\n label?: string;\n description?: string;\n icon?: string;\n color?: string;\n groups?: readonly string[];\n }\n | SelectOption;\n\nexport type SelectProps = ValueFieldProps<string | null> & {\n placeholder?: string;\n icon?: string;\n activeIcon?: string;\n options?: SelectSourceOption[];\n fetchData?: (query: string, signal: AbortSignal, group: string | null) => Promise<SelectSourceOption[]>;\n loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;\n selectedOption?: ChoiceOption<string>;\n selectedLabel?: () => string | undefined;\n fetchDebounceMs?: number;\n debounceMs?: number;\n searchable?: boolean;\n /** Optional synchronous filter for static options. */\n filterOptions?: (options: readonly SelectOption[], query: string) => readonly SelectOption[];\n /** Optional filters. An option may belong to more than one group. */\n groups?: readonly SelectGroup[];\n /** Group selected when the component is created. Omit to start with all options. */\n defaultGroup?: string;\n groupsAriaLabel?: string;\n allGroupLabel?: string;\n /** Show a local list/grid layout toggle in the dropdown. */\n viewToggle?: boolean;\n /** Initial dropdown layout when `viewToggle` is enabled. */\n defaultView?: SelectView;\n /** Tile density for the grid layout. */\n gridSize?: SelectGridSize;\n searchPlaceholder?: string;\n clearable?: boolean;\n name?: string;\n appearance?: ChoiceAppearance;\n /** Icon class shown before the placeholder while nothing is selected. */\n placeholderIcon?: string;\n};\n\ntype NormalizedOption = ChoiceOption<string>;\n/** The list entry that clears a plain select. It cannot collide with a real option value. */\nconst CLEAR_VALUE = \"\\u0000k2b-select-clear\";\n\nconst normalize = (option: SelectSourceOption): NormalizedOption =>\n typeof option === \"string\"\n ? { value: option, label: option }\n : \"value\" in option\n ? option\n : { ...option, value: option.id, label: option.label || option.id };\n\nexport function Select(props: SelectProps): JSX.Element {\n const messages = useUiMessages();\n const meta = createFieldMeta(props.id);\n const listboxId = `${meta.controlId}-listbox`;\n const [query, setQuery] = createSignal(\"\");\n const [focusedIndex, setFocusedIndex] = createSignal(-1);\n const [cache, setCache] = createSignal<Record<string, NormalizedOption>>({});\n const [selectedGroup, setSelectedGroup] = createSignal<string | null>(props.defaultGroup ?? null);\n const [selectedView, setSelectedView] = createSignal<SelectView>(props.defaultView ?? \"list\");\n let searchRef: HTMLInputElement | undefined;\n let optionRefs: HTMLButtonElement[] = [];\n const value = () => resolveMaybeAccessor(props.value) ?? null;\n const error = () => resolveMaybeAccessor(props.error);\n const activeGroup = createMemo(() => {\n const current = selectedGroup();\n return current && props.groups?.some((group) => group.value === current) ? current : null;\n });\n const groupChoices = createMemo(() => [{ value: null, label: props.allGroupLabel ?? messages().all }, ...(props.groups ?? [])]);\n const activeView = () => (props.viewToggle ? selectedView() : \"list\");\n\n const loader = createChoiceLoader(\n () =>\n props.fetchData\n ? async (value, signal) => (await props.fetchData!(value, signal, activeGroup())).map(normalize)\n : props.loadOptions\n ? (value, signal) => props.loadOptions!(value, signal, activeGroup())\n : undefined,\n () => props.fetchDebounceMs ?? props.debounceMs ?? 200,\n );\n const isAsync = () => Boolean(props.fetchData || props.loadOptions);\n const isSearchable = () => isAsync() || Boolean(props.searchable);\n const sourceOptions = createMemo(() => (isAsync() ? loader.options() : (props.options ?? []).map(normalize)));\n const groupedOptions = createMemo(() => {\n const group = activeGroup();\n return !isAsync() && group ? sourceOptions().filter((option) => option.groups?.includes(group)) : sourceOptions();\n });\n // Remote loaders filter server-side; a static list has to be filtered here or\n // the search field would render but do nothing.\n const options = createMemo(() =>\n isAsync() || !props.searchable\n ? groupedOptions()\n : props.filterOptions\n ? [...props.filterOptions(groupedOptions(), query())]\n : filterChoiceOptions(groupedOptions(), query()),\n );\n const plain = () => props.appearance === \"plain\";\n // A plain select has no room for a clear button beside its value, so\n // clearing becomes the last list entry, named by the placeholder.\n const clearOption = createMemo<NormalizedOption | undefined>(() =>\n plain() && props.clearable && !query() ? { value: CLEAR_VALUE, label: props.placeholder ?? messages().clearSelection } : undefined,\n );\n const listOptions = createMemo(() => {\n const clear = clearOption();\n return clear && !loader.error() ? [...options(), clear] : options();\n });\n // Colour dots mark the options, so an empty plain value keeps the column with a hollow dot.\n const emptyDot = () => plain() && !props.placeholderIcon && sourceOptions().some((option) => option.color);\n const selected = createMemo(() => {\n const current = value();\n if (current === null) return undefined;\n // Resolve against the unfiltered list so typing in the search field never\n // blanks the trigger label of the current selection.\n return (\n sourceOptions().find((option) => option.value === current) ??\n cache()[current] ??\n (props.selectedOption?.value === current ? props.selectedOption : undefined) ?? {\n value: current,\n label: props.selectedLabel?.() ?? current,\n }\n );\n });\n const hasClearAction = () => Boolean(props.clearable && selected() && !props.disabled && !plain());\n const accessibleLabel = () =>\n props[\"aria-label\"] ?? (typeof props.label === \"string\" ? undefined : (props.placeholder ?? messages().selectOption));\n const popover = createChoicePopover(() => Boolean(props.disabled));\n const focusedOption = () => listOptions()[focusedIndex()];\n const focus = (index: number) => {\n setFocusedIndex(index);\n optionRefs[index]?.scrollIntoView({ block: \"nearest\" });\n };\n const move = (direction: 1 | -1) => focus(nextEnabledChoiceIndex(listOptions(), focusedIndex(), direction));\n const chooseGroup = (group: string | null) => {\n if (group === activeGroup()) return;\n setSelectedGroup(group);\n setFocusedIndex(nextEnabledChoiceIndex(listOptions(), -1, 1));\n if (isAsync()) loader.load(query(), true);\n };\n const open = () => {\n if (props.disabled) return;\n setQuery(\"\");\n if (isAsync()) loader.load(\"\", true);\n const selectedIndex = listOptions().findIndex((option) => option.value === (value() ?? CLEAR_VALUE));\n focus(selectedIndex >= 0 ? selectedIndex : nextEnabledChoiceIndex(listOptions(), -1, 1));\n popover.show();\n if (isSearchable()) queueMicrotask(() => searchRef?.focus());\n };\n const close = (restoreFocus = false) => {\n // Hide the top-layer surface before any reactive cleanup or consumer\n // callback can rerender its contents. Selection must feel atomic: the old\n // listbox must never remain visible with the next value.\n popover.hide(restoreFocus);\n loader.cancel();\n setQuery(\"\");\n setFocusedIndex(-1);\n };\n const select = (option: NormalizedOption) => {\n if (option.disabled) return;\n close(true);\n if (option.value === CLEAR_VALUE) {\n commitFieldValue(props, null);\n return;\n }\n setCache({ ...cache(), [option.value]: option });\n commitFieldValue(props, option.value);\n };\n const onKeyDown = (event: KeyboardEvent) => {\n const inToolbar = Boolean((event.target as HTMLElement | null)?.closest?.(\".k2b-choice-toolbar\"));\n if (inToolbar && event.key !== \"Escape\" && event.key !== \"Tab\") return;\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n if (!popover.open()) open();\n else move(event.key === \"ArrowDown\" ? 1 : -1);\n } else if ((event.key === \"Enter\" || event.key === \" \") && !popover.open()) {\n event.preventDefault();\n open();\n } else if (event.key === \"Enter\" && focusedOption()) {\n event.preventDefault();\n select(focusedOption()!);\n } else if (event.key === \"Escape\" && popover.open()) {\n // Only swallow Escape while the list is open — a closed select must let\n // the key bubble to an enclosing dialog or drawer.\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\" && popover.open()) close();\n };\n const clear = (event: MouseEvent) => {\n event.stopPropagation();\n commitFieldValue(props, null);\n popover.trigger()?.focus();\n };\n\n return (\n <Field\n class={props.class}\n label={props.label}\n description={props.description}\n error={error()}\n meta={meta}\n required={props.required}\n disabled={props.disabled}\n >\n <div class=\"k2b-choice-control\" data-appearance={props.appearance ?? \"field\"} data-invalid={error() ? \"true\" : undefined}>\n <button\n ref={popover.setTrigger}\n id={meta.controlId}\n type=\"button\"\n class=\"k2b-choice-trigger\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={popover.open()}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n data-clearable={hasClearAction() ? \"true\" : undefined}\n {...fieldControlAria(meta, {\n ...props,\n \"aria-label\": accessibleLabel(),\n })}\n disabled={props.disabled}\n onClick={() => (popover.open() ? close() : open())}\n onKeyDown={onKeyDown}\n >\n <Show\n when={selected()}\n fallback={\n <Show\n when={props.placeholderIcon}\n fallback={<Show when={emptyDot()}>{<span class=\"k2b-choice-dot\" data-empty=\"true\" aria-hidden=\"true\" />}</Show>}\n >\n {(icon) => <i class={`${icon()} k2b-choice-trigger__placeholder-icon`} aria-hidden=\"true\" />}\n </Show>\n }\n >\n <Show\n when={selected()?.color}\n fallback={<Show when={selected()?.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}\n >\n {(color) => <span class=\"k2b-choice-dot\" style={{ \"background-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n </Show>\n <span class=\"k2b-choice-trigger__value\" data-placeholder={selected() ? undefined : \"true\"}>\n {selected()?.label ?? props.placeholder ?? messages().select}\n </span>\n <i\n class={`${popover.open() ? (props.activeIcon ?? \"ti ti-chevron-up\") : (props.icon ?? \"ti ti-chevron-down\")} k2b-choice-trigger__chevron`}\n aria-hidden=\"true\"\n />\n </button>\n <Show when={props.name}>{(name) => <input type=\"hidden\" name={name()} value={value() ?? \"\"} />}</Show>\n <Show when={hasClearAction()}>\n <button\n type=\"button\"\n class=\"k2b-choice-control__clear k2b-input-clear-action\"\n aria-label={messages().clearSelection}\n onClick={clear}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n <div\n ref={popover.setPopover}\n popover=\"manual\"\n class=\"k2b-choice-popover\"\n role=\"group\"\n onKeyDown={onKeyDown}\n aria-label={typeof props.label === \"string\" ? props.label : (props[\"aria-label\"] ?? messages().options)}\n >\n <Show when={isSearchable()}>\n <div class=\"k2b-choice-search\">\n <i class=\"ti ti-search\" aria-hidden=\"true\" />\n <input\n ref={searchRef}\n type=\"search\"\n value={query()}\n placeholder={props.searchPlaceholder ?? messages().search}\n aria-label={props.searchPlaceholder ?? messages().searchOptions}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n onInput={(event) => {\n setQuery(event.currentTarget.value);\n if (isAsync()) loader.load(event.currentTarget.value);\n focus(isAsync() ? -1 : nextEnabledChoiceIndex(options(), -1, 1));\n }}\n />\n </div>\n </Show>\n <Show when={(props.groups?.length ?? 0) > 0 || props.viewToggle}>\n <div class=\"k2b-choice-toolbar\">\n <Show when={(props.groups?.length ?? 0) > 0}>\n <ChoiceGroups\n choices={groupChoices()}\n value={activeGroup()}\n onValueChange={chooseGroup}\n ariaLabel={props.groupsAriaLabel ?? messages().filterOptions}\n controls={listboxId}\n />\n </Show>\n <Show when={props.viewToggle}>\n <button\n type=\"button\"\n class=\"k2b-choice-view-toggle\"\n aria-label={activeView() === \"list\" ? messages().showGridView : messages().showListView}\n aria-controls={listboxId}\n onClick={() => setSelectedView(activeView() === \"list\" ? \"grid\" : \"list\")}\n >\n <i class={activeView() === \"list\" ? \"ti ti-category-2\" : \"ti ti-list-details\"} aria-hidden=\"true\" />\n </button>\n </Show>\n </div>\n </Show>\n <div\n id={listboxId}\n class=\"k2b-choice-options\"\n role=\"listbox\"\n data-view={activeView()}\n data-grid-size={activeView() === \"grid\" ? (props.gridSize ?? \"md\") : undefined}\n >\n <Show when={loader.error()}>\n {(message) => (\n <div class=\"k2b-choice-status\" data-tone=\"danger\">\n <span>{message()}</span>\n <button type=\"button\" onClick={loader.retry}>\n {messages().retry}\n </button>\n </div>\n )}\n </Show>\n <Show when={loader.loading() && options().length === 0}>\n <div class=\"k2b-choice-status\">\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span>{messages().loading}</span>\n </div>\n </Show>\n <For\n each={loader.error() ? [] : listOptions()}\n fallback={\n <Show when={!loader.loading() && !loader.error()}>\n <div class=\"k2b-choice-status\">{isSearchable() ? messages().noResults : messages().noOptions}</div>\n </Show>\n }\n >\n {(option, index) => (\n <button\n ref={(element) => (optionRefs[index()] = element)}\n type=\"button\"\n id={`${listboxId}-${index()}`}\n class=\"k2b-choice-option\"\n role=\"option\"\n aria-label={option.label}\n aria-selected={option.value === (value() ?? CLEAR_VALUE)}\n data-focused={index() === focusedIndex() ? \"true\" : undefined}\n data-clear={option.value === CLEAR_VALUE ? \"true\" : undefined}\n disabled={option.disabled}\n onPointerMove={() => focus(index())}\n onClick={() => select(option)}\n >\n <Show\n when={option.value === CLEAR_VALUE}\n fallback={\n <Show\n when={option.color}\n fallback={<Show when={option.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>}\n >\n {(color) => <span class=\"k2b-choice-dot\" style={{ \"background-color\": color() }} aria-hidden=\"true\" />}\n </Show>\n }\n >\n <Show\n when={props.placeholderIcon}\n fallback={<Show when={emptyDot()}>{<span class=\"k2b-choice-dot\" data-empty=\"true\" aria-hidden=\"true\" />}</Show>}\n >\n {(icon) => <i class={icon()} aria-hidden=\"true\" />}\n </Show>\n </Show>\n <span>\n <strong>{option.label}</strong>\n <Show when={option.description}>{(description) => <small>{description()}</small>}</Show>\n </span>\n </button>\n )}\n </For>\n </div>\n </div>\n </div>\n </Field>\n );\n}\n\nexport default Select;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,IAAI,QAAQ,UAAU;AACxE,SAAS,eAAe,EAAE,KAAK,EAAE,gBAAgB,QAAQ,mBAAmB;AAC5E,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAA4B,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,sBAAsB,QAAQ,UAAU;AAElI,SAAS,gBAAgB,EAAE,oBAAoB,QA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UAAA,IAAC,IAAI;YAAA,OAAE,MAAM,CAAC,WAAW;UAAA;UAAA,UAAI,WAAW,6BAAa,WAAW,CAAC,CAAC;QAAS;MAGrF;IAAA;EAAA;AAOf;AAEA,eAAe,MAAM","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["inputs/index.ts"],"sourcesContent":["export type { AutocompleteEditorProps } from \"./AutocompleteEditor\";\nexport { AutocompleteEditor } from \"./AutocompleteEditor\";\nexport type {\n AutocompleteSelectOption,\n AutocompleteSelectProps,\n AutocompleteSelectSearchResult,\n} from \"./AutocompleteSelect\";\nexport { AutocompleteSelect } from \"./AutocompleteSelect\";\nexport type { CheckboxProps } from \"./Checkbox\";\nexport { Checkbox } from \"./Checkbox\";\nexport type { CheckboxCardProps } from \"./CheckboxCard\";\nexport { CheckboxCard } from \"./CheckboxCard\";\nexport type {\n ColorInputProps,\n PinInputProps,\n SliderProps,\n} from \"./ChoiceInputs\";\nexport { ColorInput, PinInput, Slider } from \"./ChoiceInputs\";\nexport type { ComboboxOption, ComboboxProps } from \"./Combobox\";\nexport { Combobox } from \"./Combobox\";\nexport type { ChoiceOption, ChoiceOptionsLoader } from \"./choice\";\nexport type {\n Completion,\n QueryContext,\n SuggestContext,\n Suggestion,\n} from \"./completion\";\nexport { abbreviations } from \"./completion\";\nexport type {\n DatePickerBaseProps,\n DatePickerProps,\n DatePreset,\n DateRangePickerProps,\n DateRangeValue,\n DateTimePickerProps,\n DurationPreset,\n} from \"./DatePicker\";\nexport { DatePicker, DateRangePicker, DateTimePicker } from \"./DatePicker\";\nexport type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from \"./FileInputs\";\nexport { FileDropzone, ImageCropper, ImageInput } from \"./FileInputs\";\nexport type { DateContext, FieldProps, MaybeAccessor, ValueFieldProps } from \"./field-contract\";\nexport { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from \"./icon-options\";\nexport type {\n ImageCropAspect,\n ImageCropOutput,\n ImageCropRect,\n ImageCropRotation,\n ImageCropSize,\n ImageCropSource,\n ImageCropState,\n} from \"./image-crop\";\nexport {\n clampImageCropRect,\n createCroppedImageCanvas,\n createCroppedImageDataUrl,\n getInitialImageCropRect,\n imageCropRectToPixels,\n normalizeImageCropRotation,\n resizeImageCropAroundCenter,\n rotateImageCropRight,\n} from \"./image-crop\";\nexport type {\n MultiSelectFetchDataFn,\n MultiSelectInputProps,\n MultiSelectOption,\n} from \"./MultiSelectInput\";\nexport { MultiSelectInput } from \"./MultiSelectInput\";\nexport type { MarkdownEditorProps } from \"./markdown/MarkdownEditor\";\nexport { MarkdownEditor } from \"./markdown/MarkdownEditor\";\nexport type { NumberInputProps } from \"./NumberInput\";\nexport { NumberInput } from \"./NumberInput\";\nexport type { SelectGridSize, SelectGroup, SelectOption, SelectProps, SelectSourceOption, SelectView } from \"./Select\";\nexport { Select } from \"./Select\";\nexport type { SelectChipOption, SelectChipProps } from \"./SelectChip\";\nexport { SelectChip } from \"./SelectChip\";\nexport type { IconInputProps, IconOption } from \"./SpecialInputs\";\nexport { IconInput } from \"./SpecialInputs\";\nexport type { SwitchProps } from \"./Switch\";\nexport { Switch } from \"./Switch\";\nexport type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from \"./TagEditor\";\nexport { TagEditor } from \"./TagEditor\";\nexport type { TagsInputProps } from \"./TagsInput\";\nexport { TagsInput } from \"./TagsInput\";\nexport type {\n TemplateEditorLayout,\n TemplateEditorProps,\n TemplatePreviewProps,\n TemplateSampleDataProps,\n TemplateVariable,\n TemplateVariableKind,\n} from \"./TemplateEditor\";\nexport {\n createTemplateEditorPanesLayout,\n TemplateEditor,\n TemplatePreview,\n TemplateSampleData,\n} from \"./TemplateEditor\";\nexport type { TextInputProps } from \"./TextInput\";\nexport { TextInput } from \"./TextInput\";\n"],"mappings":"AACA,SAAS,kBAAkB,QAAQ,sBAAsB;AAMzD,SAAS,kBAAkB,QAAQ,sBAAsB;AAEzD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,YAAY,QAAQ,gBAAgB;AAM7C,SAAS,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,gBAAgB;AAE7D,SAAS,QAAQ,QAAQ,YAAY;AAQrC,SAAS,aAAa,QAAQ,cAAc;AAU5C,SAAS,UAAU,EAAE,eAAe,EAAE,cAAc,QAAQ,cAAc;AAE1E,SAAS,YAAY,EAAE,YAAY,EAAE,UAAU,QAAQ,cAAc;AAErE,SAAS,mBAAmB,EAAE,oBAAoB,QAAQ,gBAAgB;AAU1E,SACE,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,QACf,cAAc;AAMrB,SAAS,gBAAgB,QAAQ,oBAAoB;AAErD,SAAS,cAAc,QAAQ,2BAA2B;AAE1D,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,SAAS,QAAQ,iBAAiB;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,SAAS,QAAQ,aAAa;AASvC,SACE,+BAA+B,EAC/B,cAAc,EACd,eAAe,EACf,kBAAkB,QACb,kBAAkB;AAEzB,SAAS,SAAS,QAAQ,aAAa","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["inputs/index.ts"],"sourcesContent":["export type { AutocompleteEditorProps } from \"./AutocompleteEditor\";\nexport { AutocompleteEditor } from \"./AutocompleteEditor\";\nexport type {\n AutocompleteSelectOption,\n AutocompleteSelectProps,\n AutocompleteSelectSearchResult,\n} from \"./AutocompleteSelect\";\nexport { AutocompleteSelect } from \"./AutocompleteSelect\";\nexport type { CheckboxProps } from \"./Checkbox\";\nexport { Checkbox } from \"./Checkbox\";\nexport type { CheckboxCardProps } from \"./CheckboxCard\";\nexport { CheckboxCard } from \"./CheckboxCard\";\nexport type {\n ColorInputProps,\n PinInputProps,\n SliderProps,\n} from \"./ChoiceInputs\";\nexport { ColorInput, PinInput, Slider } from \"./ChoiceInputs\";\nexport type { ComboboxOption, ComboboxProps } from \"./Combobox\";\nexport { Combobox } from \"./Combobox\";\nexport type { ChoiceOption, ChoiceOptionsLoader } from \"./choice\";\nexport type {\n Completion,\n QueryContext,\n SuggestContext,\n Suggestion,\n} from \"./completion\";\nexport { abbreviations } from \"./completion\";\nexport type {\n DatePickerBaseProps,\n DatePickerProps,\n DatePreset,\n DateRangePickerProps,\n DateRangeValue,\n DateTimePickerProps,\n DurationPreset,\n} from \"./DatePicker\";\nexport { DatePicker, DateRangePicker, DateTimePicker } from \"./DatePicker\";\nexport type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from \"./FileInputs\";\nexport { FileDropzone, ImageCropper, ImageInput } from \"./FileInputs\";\nexport type { DateContext, FieldProps, MaybeAccessor, ValueFieldProps } from \"./field-contract\";\nexport { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from \"./icon-options\";\nexport type {\n ImageCropAspect,\n ImageCropOutput,\n ImageCropRect,\n ImageCropRotation,\n ImageCropSize,\n ImageCropSource,\n ImageCropState,\n} from \"./image-crop\";\nexport {\n clampImageCropRect,\n createCroppedImageCanvas,\n createCroppedImageDataUrl,\n getInitialImageCropRect,\n imageCropRectToPixels,\n normalizeImageCropRotation,\n resizeImageCropAroundCenter,\n rotateImageCropRight,\n} from \"./image-crop\";\nexport type {\n MultiSelectFetchDataFn,\n MultiSelectInputProps,\n MultiSelectOption,\n} from \"./MultiSelectInput\";\nexport { MultiSelectInput } from \"./MultiSelectInput\";\nexport type { MarkdownEditorProps } from \"./markdown/MarkdownEditor\";\nexport { MarkdownEditor } from \"./markdown/MarkdownEditor\";\nexport type { NumberInputProps } from \"./NumberInput\";\nexport { NumberInput } from \"./NumberInput\";\nexport type { ChoiceAppearance, SelectGridSize, SelectGroup, SelectOption, SelectProps, SelectSourceOption, SelectView } from \"./Select\";\nexport { Select } from \"./Select\";\nexport type { SelectChipOption, SelectChipProps } from \"./SelectChip\";\nexport { SelectChip } from \"./SelectChip\";\nexport type { IconInputProps, IconOption } from \"./SpecialInputs\";\nexport { IconInput } from \"./SpecialInputs\";\nexport type { SwitchProps } from \"./Switch\";\nexport { Switch } from \"./Switch\";\nexport type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from \"./TagEditor\";\nexport { TagEditor } from \"./TagEditor\";\nexport type { TagsInputProps } from \"./TagsInput\";\nexport { TagsInput } from \"./TagsInput\";\nexport type {\n TemplateEditorLayout,\n TemplateEditorProps,\n TemplatePreviewProps,\n TemplateSampleDataProps,\n TemplateVariable,\n TemplateVariableKind,\n} from \"./TemplateEditor\";\nexport {\n createTemplateEditorPanesLayout,\n TemplateEditor,\n TemplatePreview,\n TemplateSampleData,\n} from \"./TemplateEditor\";\nexport type { TextInputProps } from \"./TextInput\";\nexport { TextInput } from \"./TextInput\";\n"],"mappings":"AACA,SAAS,kBAAkB,QAAQ,sBAAsB;AAMzD,SAAS,kBAAkB,QAAQ,sBAAsB;AAEzD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,YAAY,QAAQ,gBAAgB;AAM7C,SAAS,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,gBAAgB;AAE7D,SAAS,QAAQ,QAAQ,YAAY;AAQrC,SAAS,aAAa,QAAQ,cAAc;AAU5C,SAAS,UAAU,EAAE,eAAe,EAAE,cAAc,QAAQ,cAAc;AAE1E,SAAS,YAAY,EAAE,YAAY,EAAE,UAAU,QAAQ,cAAc;AAErE,SAAS,mBAAmB,EAAE,oBAAoB,QAAQ,gBAAgB;AAU1E,SACE,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,QACf,cAAc;AAMrB,SAAS,gBAAgB,QAAQ,oBAAoB;AAErD,SAAS,cAAc,QAAQ,2BAA2B;AAE1D,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,SAAS,QAAQ,iBAAiB;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,SAAS,QAAQ,aAAa;AASvC,SACE,+BAA+B,EAC/B,cAAc,EACd,eAAe,EACf,kBAAkB,QACb,kBAAkB;AAEzB,SAAS,SAAS,QAAQ,aAAa","ignoreList":[]}
@@ -23,6 +23,7 @@ const uiMessages = i18n.define({
23
23
  add: "Add",
24
24
  addTag: "Add tag",
25
25
  addImage: "Add image",
26
+ apply: "Apply",
26
27
  attachments: "Attachments",
27
28
  assistant: "Assistant",
28
29
  avatarLabel: ({
@@ -255,6 +256,7 @@ const uiMessages = i18n.define({
255
256
  filterActions: "Filter actions",
256
257
  info: "Info",
257
258
  dismissNotification: "Dismiss notification",
259
+ notifications: "Notifications",
258
260
  interactiveLineChart: "Interactive line chart",
259
261
  interactiveChart: "Interactive chart. Use arrow keys to inspect, Enter to select, Escape to dismiss. On maps and timelines use Alt with arrow keys to inspect.",
260
262
  chartFields: ({
@@ -485,6 +487,7 @@ const uiMessages = i18n.define({
485
487
  add: "Hinzufügen",
486
488
  addTag: "Tag hinzufügen",
487
489
  addImage: "Bild hinzufügen",
490
+ apply: "Übernehmen",
488
491
  attachments: "Anhänge",
489
492
  assistant: "Assistent",
490
493
  avatarLabel: ({
@@ -717,6 +720,7 @@ const uiMessages = i18n.define({
717
720
  filterActions: "Filteraktionen",
718
721
  info: "Information",
719
722
  dismissNotification: "Benachrichtigung schließen",
723
+ notifications: "Benachrichtigungen",
720
724
  interactiveLineChart: "Interaktives Liniendiagramm",
721
725
  interactiveChart: "Interaktives Diagramm. Pfeiltasten zum Erkunden, Enter zum Auswählen, Escape zum Schließen. In Karten und Zeitleisten Alt mit Pfeiltasten zum Erkunden.",
722
726
  chartFields: ({