@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
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["inputs/MultiSelectInput.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, onCleanup, onMount, Show } from \"solid-js\";\nimport { colorTintStyle, normalizeHexColor } from \"../internal/color\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { ChoiceGroups } from \"./ChoiceGroups\";\nimport {\n type ChoiceOption,\n createChoiceLoader,\n createChoicePopover,\n filterChoiceOptions,\n fitChoicePills,\n nextEnabledChoiceIndex,\n} from \"./choice\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { commitFieldValue, resolveMaybeAccessor } from \"./field-contract\";\nimport type { SelectGroup } from \"./Select\";\n\nexport type MultiSelectOption =\n | string\n | { id: string; label?: string; description?: string; icon?: string; color?: string; groups?: readonly string[] }\n | ChoiceOption<string>;\ntype NormalizedOption = ChoiceOption<string>;\nexport type MultiSelectFetchDataFn = (query: string, signal: AbortSignal, group: string | null) => Promise<MultiSelectOption[]>;\n\nexport type MultiSelectInputProps = ValueFieldProps<string[]> & {\n options?: MultiSelectOption[];\n fetchData?: MultiSelectFetchDataFn;\n selectedOptions?: () => MultiSelectOption[];\n placeholder?: string;\n icon?: string;\n activeIcon?: string;\n fetchDebounceMs?: number;\n debounceMs?: number;\n loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;\n groups?: readonly SelectGroup[];\n defaultGroup?: string;\n groupsAriaLabel?: string;\n allGroupLabel?: string;\n searchable?: boolean;\n clearable?: boolean;\n name?: string;\n renderOption?: (option: ChoiceOption<string>) => JSX.Element;\n renderValue?: (option: ChoiceOption<string>) => JSX.Element;\n searchPlaceholder?: string;\n loadingLabel?: string;\n noResultsLabel?: string;\n emptyLabel?: string;\n retryLabel?: string;\n clearLabel?: string;\n};\n\n/** Cloud tints the option icon with the option color instead of adding a dot. */\nconst iconColor = (color: string | undefined): JSX.CSSProperties | undefined => {\n const normalized = normalizeHexColor(color);\n return normalized ? { color: normalized } : undefined;\n};\n\nconst normalize = (option: MultiSelectOption): 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 MultiSelectInput(props: MultiSelectInputProps): 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 let searchRef: HTMLInputElement | undefined;\n\n const values = () => resolveMaybeAccessor(props.value) ?? [];\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 asyncOptions = createChoiceLoader(\n () =>\n props.fetchData\n ? async (query, signal) => (await props.fetchData!(query, signal, activeGroup())).map(normalize)\n : props.loadOptions\n ? (query, signal) => props.loadOptions!(query, signal, activeGroup())\n : undefined,\n () => props.fetchDebounceMs ?? props.debounceMs ?? 200,\n );\n const isAsync = () => Boolean(props.fetchData || props.loadOptions);\n const sourceOptions = createMemo(() => (isAsync() ? asyncOptions.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 // Cloud's multi-select always renders its search field, and filters a static\n // option list client-side while a remote loader filters server-side.\n const searchable = () => isAsync() || (props.searchable ?? true);\n const visibleOptions = createMemo(() =>\n isAsync() ? groupedOptions() : filterChoiceOptions(groupedOptions(), searchable() ? query() : \"\"),\n );\n const optionByValue = createMemo(() => {\n const options = new Map<string, NormalizedOption>();\n for (const option of Object.values(cache())) options.set(option.value, option);\n for (const option of (props.selectedOptions?.() ?? []).map(normalize)) options.set(option.value, option);\n for (const option of sourceOptions()) options.set(option.value, option);\n return options;\n });\n const selected = createMemo(() => values().map((value) => optionByValue().get(value) ?? ({ value, label: value } as NormalizedOption)));\n const hasClearAction = () => Boolean(props.clearable && selected().length > 0 && !props.disabled);\n const selectedValues = createMemo(() => new Set(values()));\n const popover = createChoicePopover(() => Boolean(props.disabled));\n const focusedOption = () => visibleOptions()[focusedIndex()];\n\n // Pills that do not fit the trigger collapse into a \"+N\" summary. Until the\n // browser measures them (server HTML, hidden containers) every pill stays.\n let valuesRef: HTMLSpanElement | undefined;\n let moreRef: HTMLSpanElement | undefined;\n const [visibleCount, setVisibleCount] = createSignal(Number.POSITIVE_INFINITY);\n const hiddenOptions = createMemo(() => selected().slice(visibleCount()));\n // While every pill fits, the invisible summary carries the largest count it\n // could show, so measuring it reserves enough room for the real one.\n const moreCount = () => hiddenOptions().length || selected().length - 1;\n const fitValues = () => {\n const values = valuesRef;\n if (!values?.isConnected) return;\n // Measuring releases a truncated first pill to its natural width; the\n // browser paints only the final state.\n values.dataset.measuring = \"true\";\n const pills = Array.from(\n values.querySelectorAll<HTMLElement>(\":scope > .k2b-choice-pill\"),\n (pill) => pill.getBoundingClientRect().width,\n );\n const fit = fitChoicePills(\n values.getBoundingClientRect().width,\n pills,\n Number.parseFloat(getComputedStyle(values).columnGap) || 0,\n moreRef?.isConnected ? moreRef.getBoundingClientRect().width : 0,\n );\n delete values.dataset.measuring;\n // Hidden pills leave the flow. While any are hidden the strip keeps the\n // whole row as its preferred width, so a container sized by its content\n // does not shrink with the collapse and grows back once it has room. The\n // strip still flexes to the trigger's width.\n values.style.width = fit.visible < pills.length ? `${fit.rowWidth}px` : \"\";\n setVisibleCount(fit.visible);\n };\n const resizeObserver = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(() => fitValues());\n onCleanup(() => resizeObserver?.disconnect());\n createEffect(() => {\n selected();\n fitValues();\n });\n onMount(() => {\n if (\"fonts\" in document) void document.fonts.ready.then(fitValues);\n });\n\n const emit = (next: readonly string[]) => {\n const unique = [...new Set(next)];\n commitFieldValue(props, unique);\n };\n const isSelected = (value: string) => selectedValues().has(value);\n const focusFirst = () => setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), -1, 1));\n const chooseGroup = (group: string | null) => {\n if (group === activeGroup()) return;\n setSelectedGroup(group);\n focusFirst();\n if (isAsync()) asyncOptions.load(query(), true);\n };\n const open = () => {\n if (props.disabled) return;\n setQuery(\"\");\n if (isAsync()) asyncOptions.load(\"\", true);\n focusFirst();\n popover.show();\n if (searchable()) queueMicrotask(() => searchRef?.focus());\n };\n const close = (restoreFocus = false) => {\n asyncOptions.cancel();\n setQuery(\"\");\n setFocusedIndex(-1);\n popover.hide(restoreFocus);\n };\n const toggleOption = (option: NormalizedOption) => {\n if (option.disabled) return;\n setCache({ ...cache(), [option.value]: option });\n emit(isSelected(option.value) ? values().filter((value) => value !== option.value) : [...values(), option.value]);\n };\n const remove = (value: string) => emit(values().filter((item) => item !== value));\n const move = (direction: 1 | -1) => {\n setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), focusedIndex(), direction));\n };\n const handleKeyDown = (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 return;\n }\n if ((event.key === \"Enter\" || event.key === \" \") && !popover.open()) {\n event.preventDefault();\n open();\n return;\n }\n if (event.key === \"Enter\" && popover.open()) {\n const option = focusedOption();\n if (option) {\n event.preventDefault();\n toggleOption(option);\n }\n return;\n }\n if (event.key === \"Backspace\" && popover.open() && !query() && values().length > 0) {\n event.preventDefault();\n const last = values().at(-1);\n if (last) remove(last);\n return;\n }\n if (event.key === \"Escape\" && popover.open()) {\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\" && popover.open()) {\n close();\n }\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 labelFor={false}\n required={props.required}\n disabled={props.disabled}\n >\n <div class=\"k2b-choice-control\" data-invalid={error() ? \"true\" : undefined}>\n <div\n ref={(element) => {\n popover.setTrigger(element);\n resizeObserver?.observe(element);\n }}\n id={meta.controlId}\n class=\"k2b-multi-select-trigger\"\n role=\"combobox\"\n tabIndex={props.disabled ? -1 : 0}\n aria-haspopup=\"listbox\"\n aria-expanded={popover.open()}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n {...fieldControlAria(meta, props)}\n aria-disabled={props.disabled}\n data-disabled={props.disabled ? \"true\" : undefined}\n onClick={() => (popover.open() ? close() : open())}\n onKeyDown={handleKeyDown}\n >\n <Show\n when={selected().length > 0}\n fallback={\n <span class=\"k2b-choice-trigger__value\" data-placeholder=\"true\">\n {props.placeholder ?? messages().select}\n </span>\n }\n >\n <span\n ref={valuesRef}\n class=\"k2b-multi-select-trigger__values\"\n data-overflowing={hiddenOptions().length > 0 ? \"true\" : undefined}\n >\n <For each={selected()}>\n {(option, index) => (\n <span\n class=\"k2b-choice-pill\"\n style={colorTintStyle(option.color)}\n title={option.label}\n data-hidden={index() >= visibleCount() ? \"true\" : undefined}\n >\n <Show\n when={props.renderValue}\n fallback={\n <>\n <Show when={option.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span>{option.label}</span>\n </>\n }\n >\n {(render) => <span class=\"k2b-choice-pill__content\">{render()(option)}</span>}\n </Show>\n <button\n type=\"button\"\n aria-label={messages().removeNamed({ name: option.label })}\n disabled={props.disabled}\n tabIndex={-1}\n onClick={(event) => {\n event.stopPropagation();\n remove(option.value);\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </span>\n )}\n </For>\n <Show when={selected().length > 1}>\n <span\n ref={(element) => {\n moreRef = element;\n resizeObserver?.observe(element);\n onCleanup(() => resizeObserver?.unobserve(element));\n }}\n class=\"k2b-multi-select-trigger__more\"\n title={\n hiddenOptions()\n .map((option) => option.label)\n .join(\", \") || undefined\n }\n data-hidden={hiddenOptions().length === 0 ? \"true\" : undefined}\n >\n <span aria-hidden=\"true\">+{moreCount()}</span>\n <span class=\"k2b-sr-only\">{messages().moreSelected({ count: moreCount() })}</span>\n </span>\n </Show>\n </span>\n </Show>\n <Show when={!hasClearAction()}>\n <i\n class={`${popover.open() ? (props.activeIcon ?? \"ti ti-chevron-up\") : (props.icon ?? \"ti ti-chevron-down\")} k2b-multi-select-trigger__chevron`}\n aria-hidden=\"true\"\n />\n </Show>\n </div>\n <Show when={hasClearAction()}>\n <button\n type=\"button\"\n class=\"k2b-choice-control__clear k2b-input-clear-action\"\n aria-label={props.clearLabel ?? messages().clearSelection}\n onClick={(event) => {\n event.stopPropagation();\n emit([]);\n popover.trigger()?.focus();\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n\n <div\n ref={popover.setPopover}\n popover=\"manual\"\n class=\"k2b-choice-popover\"\n role=\"group\"\n onKeyDown={handleKeyDown}\n aria-label={typeof props.label === \"string\" ? props.label : (props[\"aria-label\"] ?? messages().options)}\n >\n <Show when={searchable()}>\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 const next = event.currentTarget.value;\n setQuery(next);\n if (isAsync()) asyncOptions.load(next);\n focusFirst();\n }}\n />\n </div>\n </Show>\n <Show when={(props.groups?.length ?? 0) > 0}>\n <div class=\"k2b-choice-toolbar\">\n <ChoiceGroups\n choices={groupChoices()}\n value={activeGroup()}\n onValueChange={chooseGroup}\n ariaLabel={props.groupsAriaLabel ?? messages().filterOptions}\n controls={listboxId}\n />\n </div>\n </Show>\n <div id={listboxId} class=\"k2b-choice-options\" role=\"listbox\" aria-multiselectable=\"true\">\n <Show when={asyncOptions.error()}>\n {(message) => (\n <div class=\"k2b-choice-status\" data-tone=\"danger\">\n <span>{message()}</span>\n <button type=\"button\" onClick={asyncOptions.retry}>\n {props.retryLabel ?? messages().retry}\n </button>\n </div>\n )}\n </Show>\n <Show when={asyncOptions.loading() && visibleOptions().length === 0}>\n <div class=\"k2b-choice-status\">\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span>{props.loadingLabel ?? messages().loading}</span>\n </div>\n </Show>\n <For\n each={asyncOptions.error() ? [] : visibleOptions()}\n fallback={\n <Show when={!asyncOptions.loading() && !asyncOptions.error()}>\n <div class=\"k2b-choice-status\">\n {isAsync() || query() ? (props.noResultsLabel ?? messages().noResults) : (props.emptyLabel ?? messages().noOptions)}\n </div>\n </Show>\n }\n >\n {(option, index) => (\n <button\n type=\"button\"\n id={`${listboxId}-${index()}`}\n class=\"k2b-choice-option\"\n role=\"option\"\n aria-label={option.label}\n aria-selected={isSelected(option.value)}\n data-focused={index() === focusedIndex() ? \"true\" : undefined}\n disabled={option.disabled}\n onPointerMove={() => !option.disabled && setFocusedIndex(index())}\n onClick={() => toggleOption(option)}\n >\n <span class=\"k2b-choice-option__checkbox\" aria-hidden=\"true\">\n <i class=\"ti ti-check\" />\n </span>\n <Show\n when={option.icon}\n fallback={\n <Show when={normalizeHexColor(option.color)}>\n {(color) => <span class=\"k2b-choice-dot\" style={{ background: color() }} aria-hidden=\"true\" />}\n </Show>\n }\n >\n {(icon) => <i class={icon()} style={iconColor(option.color)} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-option__content\">\n <Show\n when={props.renderOption}\n fallback={\n <>\n <strong>{option.label}</strong>\n <Show when={option.description}>{(description) => <small>{description()}</small>}</Show>\n </>\n }\n >\n {(render) => render()(option)}\n </Show>\n </span>\n </button>\n )}\n </For>\n </div>\n </div>\n <Show when={props.name}>{(name) => <input type=\"hidden\" name={name()} value={values().join(\",\")} />}</Show>\n </div>\n </Field>\n );\n}\n\nexport default MultiSelectInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC1G,SAAS,cAAc,EAAE,iBAAiB,QAAQ,mBAAmB;AACrE,SAAS,eAAe,EAAE,KAAK,EAAE,gBAAgB,QAAQ,mBAAmB;AAC5E,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAEE,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,QACjB,UAAU;AAEjB,SAAS,gBAAgB,EAAE,oBAAoB,QAAQ,kBAAkB;AAqCzE;AACA,MAAM,SAAS,GAAI,KAAyB,IAAoC;EA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[],"sources":["inputs/MultiSelectInput.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, type JSX, onCleanup, onMount, Show } from \"solid-js\";\nimport { colorTintStyle, normalizeHexColor } from \"../internal/color\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { ChoiceGroups } from \"./ChoiceGroups\";\nimport {\n type ChoiceOption,\n createChoiceLoader,\n createChoicePopover,\n filterChoiceOptions,\n fitChoicePills,\n nextEnabledChoiceIndex,\n} from \"./choice\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { commitFieldValue, resolveMaybeAccessor } from \"./field-contract\";\nimport type { ChoiceAppearance, SelectGroup } from \"./Select\";\n\nexport type MultiSelectOption =\n | string\n | { id: string; label?: string; description?: string; icon?: string; color?: string; groups?: readonly string[] }\n | ChoiceOption<string>;\ntype NormalizedOption = ChoiceOption<string>;\nexport type MultiSelectFetchDataFn = (query: string, signal: AbortSignal, group: string | null) => Promise<MultiSelectOption[]>;\n\nexport type MultiSelectInputProps = ValueFieldProps<string[]> & {\n options?: MultiSelectOption[];\n fetchData?: MultiSelectFetchDataFn;\n selectedOptions?: () => MultiSelectOption[];\n placeholder?: string;\n icon?: string;\n activeIcon?: string;\n fetchDebounceMs?: number;\n debounceMs?: number;\n loadOptions?: (query: string, signal: AbortSignal, group: string | null) => Promise<readonly ChoiceOption<string>[]>;\n groups?: readonly SelectGroup[];\n defaultGroup?: string;\n groupsAriaLabel?: string;\n allGroupLabel?: string;\n searchable?: boolean;\n clearable?: boolean;\n name?: string;\n renderOption?: (option: ChoiceOption<string>) => JSX.Element;\n renderValue?: (option: ChoiceOption<string>) => JSX.Element;\n searchPlaceholder?: string;\n loadingLabel?: string;\n noResultsLabel?: string;\n emptyLabel?: string;\n retryLabel?: string;\n clearLabel?: string;\n /** `plain` shows the selection as wrapping pills without a box; options are removed in the list. */\n appearance?: ChoiceAppearance;\n /** Icon class shown before the placeholder while nothing is selected. */\n placeholderIcon?: string;\n};\n\n/** Cloud tints the option icon with the option color instead of adding a dot. */\nconst iconColor = (color: string | undefined): JSX.CSSProperties | undefined => {\n const normalized = normalizeHexColor(color);\n return normalized ? { color: normalized } : undefined;\n};\n\nconst normalize = (option: MultiSelectOption): 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 MultiSelectInput(props: MultiSelectInputProps): 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 let searchRef: HTMLInputElement | undefined;\n\n const values = () => resolveMaybeAccessor(props.value) ?? [];\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 asyncOptions = createChoiceLoader(\n () =>\n props.fetchData\n ? async (query, signal) => (await props.fetchData!(query, signal, activeGroup())).map(normalize)\n : props.loadOptions\n ? (query, signal) => props.loadOptions!(query, signal, activeGroup())\n : undefined,\n () => props.fetchDebounceMs ?? props.debounceMs ?? 200,\n );\n const isAsync = () => Boolean(props.fetchData || props.loadOptions);\n const sourceOptions = createMemo(() => (isAsync() ? asyncOptions.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 // Cloud's multi-select always renders its search field, and filters a static\n // option list client-side while a remote loader filters server-side.\n const searchable = () => isAsync() || (props.searchable ?? true);\n const visibleOptions = createMemo(() =>\n isAsync() ? groupedOptions() : filterChoiceOptions(groupedOptions(), searchable() ? query() : \"\"),\n );\n const optionByValue = createMemo(() => {\n const options = new Map<string, NormalizedOption>();\n for (const option of Object.values(cache())) options.set(option.value, option);\n for (const option of (props.selectedOptions?.() ?? []).map(normalize)) options.set(option.value, option);\n for (const option of sourceOptions()) options.set(option.value, option);\n return options;\n });\n const selected = createMemo(() => values().map((value) => optionByValue().get(value) ?? ({ value, label: value } as NormalizedOption)));\n const plain = () => props.appearance === \"plain\";\n const hasClearAction = () => Boolean(props.clearable && selected().length > 0 && !props.disabled && !plain());\n const selectedValues = createMemo(() => new Set(values()));\n const popover = createChoicePopover(() => Boolean(props.disabled));\n const focusedOption = () => visibleOptions()[focusedIndex()];\n\n // Pills that do not fit the trigger collapse into a \"+N\" summary. Until the\n // browser measures them (server HTML, hidden containers) every pill stays.\n let valuesRef: HTMLSpanElement | undefined;\n let moreRef: HTMLSpanElement | undefined;\n const [visibleCount, setVisibleCount] = createSignal(Number.POSITIVE_INFINITY);\n const hiddenOptions = createMemo(() => selected().slice(visibleCount()));\n // While every pill fits, the invisible summary carries the largest count it\n // could show, so measuring it reserves enough room for the real one.\n const moreCount = () => hiddenOptions().length || selected().length - 1;\n const fitValues = () => {\n const values = valuesRef;\n if (!values?.isConnected) return;\n // Plain pills wrap, so every one stays visible.\n if (plain()) {\n values.style.width = \"\";\n setVisibleCount(Number.POSITIVE_INFINITY);\n return;\n }\n // Measuring releases a truncated first pill to its natural width; the\n // browser paints only the final state.\n values.dataset.measuring = \"true\";\n const pills = Array.from(\n values.querySelectorAll<HTMLElement>(\":scope > .k2b-choice-pill\"),\n (pill) => pill.getBoundingClientRect().width,\n );\n const fit = fitChoicePills(\n values.getBoundingClientRect().width,\n pills,\n Number.parseFloat(getComputedStyle(values).columnGap) || 0,\n moreRef?.isConnected ? moreRef.getBoundingClientRect().width : 0,\n );\n delete values.dataset.measuring;\n // Hidden pills leave the flow. While any are hidden the strip keeps the\n // whole row as its preferred width, so a container sized by its content\n // does not shrink with the collapse and grows back once it has room. The\n // strip still flexes to the trigger's width.\n values.style.width = fit.visible < pills.length ? `${fit.rowWidth}px` : \"\";\n setVisibleCount(fit.visible);\n };\n const resizeObserver = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(() => fitValues());\n onCleanup(() => resizeObserver?.disconnect());\n createEffect(() => {\n selected();\n fitValues();\n });\n onMount(() => {\n if (\"fonts\" in document) void document.fonts.ready.then(fitValues);\n });\n\n const emit = (next: readonly string[]) => {\n const unique = [...new Set(next)];\n commitFieldValue(props, unique);\n };\n const isSelected = (value: string) => selectedValues().has(value);\n const focusFirst = () => setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), -1, 1));\n const chooseGroup = (group: string | null) => {\n if (group === activeGroup()) return;\n setSelectedGroup(group);\n focusFirst();\n if (isAsync()) asyncOptions.load(query(), true);\n };\n const open = () => {\n if (props.disabled) return;\n setQuery(\"\");\n if (isAsync()) asyncOptions.load(\"\", true);\n focusFirst();\n popover.show();\n if (searchable()) queueMicrotask(() => searchRef?.focus());\n };\n const close = (restoreFocus = false) => {\n asyncOptions.cancel();\n setQuery(\"\");\n setFocusedIndex(-1);\n popover.hide(restoreFocus);\n };\n const toggleOption = (option: NormalizedOption) => {\n if (option.disabled) return;\n setCache({ ...cache(), [option.value]: option });\n emit(isSelected(option.value) ? values().filter((value) => value !== option.value) : [...values(), option.value]);\n };\n const remove = (value: string) => emit(values().filter((item) => item !== value));\n const move = (direction: 1 | -1) => {\n setFocusedIndex(nextEnabledChoiceIndex(visibleOptions(), focusedIndex(), direction));\n };\n const handleKeyDown = (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 return;\n }\n if ((event.key === \"Enter\" || event.key === \" \") && !popover.open()) {\n event.preventDefault();\n open();\n return;\n }\n if (event.key === \"Enter\" && popover.open()) {\n const option = focusedOption();\n if (option) {\n event.preventDefault();\n toggleOption(option);\n }\n return;\n }\n if (event.key === \"Backspace\" && popover.open() && !query() && values().length > 0) {\n event.preventDefault();\n const last = values().at(-1);\n if (last) remove(last);\n return;\n }\n if (event.key === \"Escape\" && popover.open()) {\n event.preventDefault();\n close(true);\n } else if (event.key === \"Tab\" && popover.open()) {\n close();\n }\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 labelFor={false}\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 <div\n ref={(element) => {\n popover.setTrigger(element);\n resizeObserver?.observe(element);\n }}\n id={meta.controlId}\n class=\"k2b-multi-select-trigger\"\n role=\"combobox\"\n tabIndex={props.disabled ? -1 : 0}\n aria-haspopup=\"listbox\"\n aria-expanded={popover.open()}\n aria-controls={listboxId}\n aria-activedescendant={focusedOption() ? `${listboxId}-${focusedIndex()}` : undefined}\n {...fieldControlAria(meta, props)}\n aria-disabled={props.disabled}\n data-disabled={props.disabled ? \"true\" : undefined}\n onClick={() => (popover.open() ? close() : open())}\n onKeyDown={handleKeyDown}\n >\n <Show\n when={selected().length > 0}\n fallback={\n <>\n <Show when={props.placeholderIcon}>\n {(icon) => <i class={`${icon()} k2b-choice-trigger__placeholder-icon`} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-trigger__value\" data-placeholder=\"true\">\n {props.placeholder ?? messages().select}\n </span>\n </>\n }\n >\n <span\n ref={valuesRef}\n class=\"k2b-multi-select-trigger__values\"\n data-overflowing={hiddenOptions().length > 0 ? \"true\" : undefined}\n >\n <For each={selected()}>\n {(option, index) => (\n <span\n class=\"k2b-choice-pill\"\n style={colorTintStyle(option.color)}\n title={option.label}\n data-hidden={index() >= visibleCount() ? \"true\" : undefined}\n >\n <Show\n when={props.renderValue}\n fallback={\n <>\n <Show when={option.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span>{option.label}</span>\n </>\n }\n >\n {(render) => <span class=\"k2b-choice-pill__content\">{render()(option)}</span>}\n </Show>\n <Show when={!plain()}>\n <button\n type=\"button\"\n aria-label={messages().removeNamed({ name: option.label })}\n disabled={props.disabled}\n tabIndex={-1}\n onClick={(event) => {\n event.stopPropagation();\n remove(option.value);\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n </span>\n )}\n </For>\n <Show when={selected().length > 1 && !plain()}>\n <span\n ref={(element) => {\n moreRef = element;\n resizeObserver?.observe(element);\n onCleanup(() => resizeObserver?.unobserve(element));\n }}\n class=\"k2b-multi-select-trigger__more\"\n title={\n hiddenOptions()\n .map((option) => option.label)\n .join(\", \") || undefined\n }\n data-hidden={hiddenOptions().length === 0 ? \"true\" : undefined}\n >\n <span aria-hidden=\"true\">+{moreCount()}</span>\n <span class=\"k2b-sr-only\">{messages().moreSelected({ count: moreCount() })}</span>\n </span>\n </Show>\n </span>\n </Show>\n <Show when={!hasClearAction()}>\n <i\n class={`${popover.open() ? (props.activeIcon ?? \"ti ti-chevron-up\") : (props.icon ?? \"ti ti-chevron-down\")} k2b-multi-select-trigger__chevron`}\n aria-hidden=\"true\"\n />\n </Show>\n </div>\n <Show when={hasClearAction()}>\n <button\n type=\"button\"\n class=\"k2b-choice-control__clear k2b-input-clear-action\"\n aria-label={props.clearLabel ?? messages().clearSelection}\n onClick={(event) => {\n event.stopPropagation();\n emit([]);\n popover.trigger()?.focus();\n }}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n\n <div\n ref={popover.setPopover}\n popover=\"manual\"\n class=\"k2b-choice-popover\"\n role=\"group\"\n onKeyDown={handleKeyDown}\n aria-label={typeof props.label === \"string\" ? props.label : (props[\"aria-label\"] ?? messages().options)}\n >\n <Show when={searchable()}>\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 const next = event.currentTarget.value;\n setQuery(next);\n if (isAsync()) asyncOptions.load(next);\n focusFirst();\n }}\n />\n </div>\n </Show>\n <Show when={(props.groups?.length ?? 0) > 0}>\n <div class=\"k2b-choice-toolbar\">\n <ChoiceGroups\n choices={groupChoices()}\n value={activeGroup()}\n onValueChange={chooseGroup}\n ariaLabel={props.groupsAriaLabel ?? messages().filterOptions}\n controls={listboxId}\n />\n </div>\n </Show>\n <div id={listboxId} class=\"k2b-choice-options\" role=\"listbox\" aria-multiselectable=\"true\">\n <Show when={asyncOptions.error()}>\n {(message) => (\n <div class=\"k2b-choice-status\" data-tone=\"danger\">\n <span>{message()}</span>\n <button type=\"button\" onClick={asyncOptions.retry}>\n {props.retryLabel ?? messages().retry}\n </button>\n </div>\n )}\n </Show>\n <Show when={asyncOptions.loading() && visibleOptions().length === 0}>\n <div class=\"k2b-choice-status\">\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span>{props.loadingLabel ?? messages().loading}</span>\n </div>\n </Show>\n <For\n each={asyncOptions.error() ? [] : visibleOptions()}\n fallback={\n <Show when={!asyncOptions.loading() && !asyncOptions.error()}>\n <div class=\"k2b-choice-status\">\n {isAsync() || query() ? (props.noResultsLabel ?? messages().noResults) : (props.emptyLabel ?? messages().noOptions)}\n </div>\n </Show>\n }\n >\n {(option, index) => (\n <button\n type=\"button\"\n id={`${listboxId}-${index()}`}\n class=\"k2b-choice-option\"\n role=\"option\"\n aria-label={option.label}\n aria-selected={isSelected(option.value)}\n data-focused={index() === focusedIndex() ? \"true\" : undefined}\n disabled={option.disabled}\n onPointerMove={() => !option.disabled && setFocusedIndex(index())}\n onClick={() => toggleOption(option)}\n >\n <span class=\"k2b-choice-option__checkbox\" aria-hidden=\"true\">\n <i class=\"ti ti-check\" />\n </span>\n <Show\n when={option.icon}\n fallback={\n <Show when={normalizeHexColor(option.color)}>\n {(color) => <span class=\"k2b-choice-dot\" style={{ background: color() }} aria-hidden=\"true\" />}\n </Show>\n }\n >\n {(icon) => <i class={icon()} style={iconColor(option.color)} aria-hidden=\"true\" />}\n </Show>\n <span class=\"k2b-choice-option__content\">\n <Show\n when={props.renderOption}\n fallback={\n <>\n <strong>{option.label}</strong>\n <Show when={option.description}>{(description) => <small>{description()}</small>}</Show>\n </>\n }\n >\n {(render) => render()(option)}\n </Show>\n </span>\n </button>\n )}\n </For>\n </div>\n </div>\n <Show when={props.name}>{(name) => <input type=\"hidden\" name={name()} value={values().join(\",\")} />}</Show>\n </div>\n </Field>\n );\n}\n\nexport default MultiSelectInput;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,EAAY,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AAC1G,SAAS,cAAc,EAAE,iBAAiB,QAAQ,mBAAmB;AACrE,SAAS,eAAe,EAAE,KAAK,EAAE,gBAAgB,QAAQ,mBAAmB;AAC5E,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAEE,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,QACjB,UAAU;AAEjB,SAAS,gBAAgB,EAAE,oBAAoB,QAAQ,kBAAkB;AAyCzE;AACA,MAAM,SAAS,GAAI,KAAyB,IAAoC;EAC9E,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC;EAC3C,OAAO,UAAU,GAAG;IAAE,KAAK,EAAE;EAAW,C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,KAAK,sBACpB,IAAI;cAAA,IAAC,IAAI;gBAAA,OAAE,MAAM,CAAC,WAAW;cAAA;cAAA,UAAI,WAAW,6BAAa,WAAW,CAAC,CAAC;YAAS;UAAA;UAAA,UAIlF,MAAM,IAAK,MAAM,CAAC,CAAC,CAAC,MAAM;QAAC;MAIpC,gCAIN,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,IAAI;QAAA;QAAA,UAAI,IAAI,oDAAgC,IAAI,CAAC,CAAC,mDAAS,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;MAAI;IAAA;EAAA;AAI3G;AAEA,eAAe,gBAAgB","ignoreList":[]}
@@ -1,16 +1,17 @@
1
- import { ssrElement as _$ssrElement } from "solid-js/web";
2
- import { mergeProps as _$mergeProps } from "solid-js/web";
3
1
  import { createComponent as _$createComponent } from "solid-js/web";
4
2
  import { ssr as _$ssr } from "solid-js/web";
5
3
  import { memo as _$memo } from "solid-js/web";
6
4
  import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
7
5
  import { escape as _$escape } from "solid-js/web";
6
+ import { ssrElement as _$ssrElement } from "solid-js/web";
7
+ import { mergeProps as _$mergeProps } from "solid-js/web";
8
8
  var _tmpl$ = ["<button type=\"button\" class=\"k2b-number-input__step\"", "", "><i class=\"ti ti-minus\" aria-hidden=\"true\"></i></button>"],
9
9
  _tmpl$2 = ["<span class=\"k2b-input-shell__icon k2b-text-input__icon\" aria-hidden=\"true\"><i", "></i><i", "></i></span>"],
10
10
  _tmpl$3 = ["<span class=\"k2b-input-shell__affix\">", "</span>"],
11
- _tmpl$4 = ["<button type=\"button\" class=\"k2b-input-shell__clear k2b-input-clear-action\"", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i></button>"],
12
- _tmpl$5 = ["<button type=\"button\" class=\"k2b-number-input__step\"", "", "><i class=\"ti ti-plus\" aria-hidden=\"true\"></i></button>"],
13
- _tmpl$6 = ["<div class=\"k2b-input-shell k2b-number-input\"", ">", "<div class=\"k2b-number-input__value\">", "", "", "", "", "</div>", "</div>"];
11
+ _tmpl$4 = ["<span class=\"k2b-number-input__sizer\"", ">", "</span>"],
12
+ _tmpl$5 = ["<button type=\"button\" class=\"k2b-input-shell__clear k2b-input-clear-action\"", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i></button>"],
13
+ _tmpl$6 = ["<button type=\"button\" class=\"k2b-number-input__step\"", "", "><i class=\"ti ti-plus\" aria-hidden=\"true\"></i></button>"],
14
+ _tmpl$7 = ["<div class=\"k2b-input-shell k2b-number-input\"", ">", "<div class=\"k2b-number-input__value\">", "", "", "", "", "</div>", "</div>"];
14
15
  import { createEffect, createMemo, createSignal, Show, splitProps } from "solid-js";
15
16
  import { createFieldMeta, Field, fieldControlAria } from "../internal/field";
16
17
  import { decimalSeparator, useLocale } from "../intl/locale";
@@ -23,8 +24,10 @@ function fractionDigits(value) {
23
24
  return Math.max(0, fraction - Number(exponent));
24
25
  }
25
26
  export function NumberInput(props) {
26
- const [local, rest] = splitProps(props, ["activeIcon", "allowNegative", "aria-describedby", "aria-label", "class", "clearLabel", "clearable", "decimalPlaces", "decreaseLabel", "description", "disableSteppers", "error", "icon", "id", "increaseLabel", "label", "locale", "max", "min", "onClear", "onValueCommit", "onValueChange", "prefix", "required", "showSteppers", "step", "suffix", "value"]);
27
+ const [local, rest] = splitProps(props, ["activeIcon", "appearance", "allowNegative", "aria-describedby", "aria-label", "class", "clearLabel", "clearable", "decimalPlaces", "decreaseLabel", "description", "disableSteppers", "error", "formatValue", "icon", "id", "increaseLabel", "label", "locale", "max", "min", "onClear", "onKeyDown", "onValueCommit", "onValueChange", "prefix", "required", "showSteppers", "step", "suffix", "value"]);
27
28
  const meta = createFieldMeta(local.id);
29
+ const plain = () => local.appearance === "plain";
30
+ let input;
28
31
  const [focused, setFocused] = createSignal(false);
29
32
  const value = () => resolveMaybeAccessor(local.value);
30
33
  const error = () => resolveMaybeAccessor(local.error);
@@ -86,6 +89,75 @@ export function NumberInput(props) {
86
89
  if (focused()) return;
87
90
  if (parse(raw()) !== value()) setRaw(display(value()));
88
91
  });
92
+ // Enter already committed the current text, so leaving the field does not commit it twice.
93
+ let committedOnEnter = false;
94
+ const onKeyDown = event => {
95
+ const handler = local.onKeyDown;
96
+ if (typeof handler === "function") handler(event);else if (Array.isArray(handler)) handler[0](handler[1], event);
97
+ if (!plain() || event.defaultPrevented) return;
98
+ // Both keys keep focus in the field, so keyboard and screen reader users stay in place.
99
+ if (event.key === "Enter") {
100
+ event.preventDefault();
101
+ commit(parse(raw()), true);
102
+ committedOnEnter = true;
103
+ } else if (event.key === "Escape" && parse(raw()) !== value()) {
104
+ // Only an edit in progress swallows Escape; otherwise it reaches an enclosing panel.
105
+ event.preventDefault();
106
+ event.stopPropagation();
107
+ setRaw(display(value()));
108
+ }
109
+ };
110
+ const placeholderText = () => typeof rest.placeholder === "string" ? rest.placeholder : "";
111
+ /** What a plain field shows: the formatted value at rest, the text being edited while focused. */
112
+ const shownText = () => {
113
+ const current = value();
114
+ if (!focused() && current != null && local.formatValue) return local.formatValue(current);
115
+ return raw() || placeholderText();
116
+ };
117
+ const valueText = () => {
118
+ if (rest["aria-valuetext"] !== undefined) return rest["aria-valuetext"];
119
+ const current = focused() ? parse(raw()) : value();
120
+ if (current == null) return undefined;
121
+ if (local.formatValue) return local.formatValue(current);
122
+ const unit = typeof local.suffix === "string" ? local.suffix : "";
123
+ return unit ? `${display(current)} ${unit}` : undefined;
124
+ };
125
+ const control = () => _$ssrElement("input", _$mergeProps(rest, {
126
+ get id() {
127
+ return meta.controlId;
128
+ },
129
+ "class": "k2b-input k2b-number-input__control",
130
+ get ["data-filled"]() {
131
+ return raw() ? "true" : undefined;
132
+ },
133
+ type: "text",
134
+ role: "spinbutton",
135
+ get inputmode() {
136
+ return places() === 0 ? "numeric" : "decimal";
137
+ },
138
+ get value() {
139
+ return raw();
140
+ },
141
+ get required() {
142
+ return local.required;
143
+ }
144
+ }, () => fieldControlAria(meta, local), {
145
+ get ["aria-valuemin"]() {
146
+ return Number.isFinite(min()) ? min() : undefined;
147
+ },
148
+ get ["aria-valuemax"]() {
149
+ return Number.isFinite(max()) ? max() : undefined;
150
+ },
151
+ get ["aria-valuenow"]() {
152
+ return (focused() ? parse(raw()) : value()) ?? undefined;
153
+ },
154
+ get ["aria-valuetext"]() {
155
+ return valueText();
156
+ },
157
+ get size() {
158
+ return plain() ? 1 : rest.size;
159
+ }
160
+ }), undefined, false);
89
161
  return _$createComponent(Field, {
90
162
  get ["class"]() {
91
163
  return local.class;
@@ -107,9 +179,9 @@ export function NumberInput(props) {
107
179
  return rest.disabled;
108
180
  },
109
181
  get children() {
110
- return _$ssr(_tmpl$6, _$ssrAttribute("data-disabled", rest.disabled ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-invalid", error() ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
182
+ return _$ssr(_tmpl$7, _$ssrAttribute("data-appearance", _$escape(local.appearance ?? "field", true), false) + _$ssrAttribute("data-disabled", rest.disabled ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-invalid", error() ? "true" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
111
183
  get when() {
112
- return local.showSteppers ?? true;
184
+ return local.showSteppers ?? !plain();
113
185
  },
114
186
  get children() {
115
187
  return _$ssr(_tmpl$, _$ssrAttribute("aria-label", _$escape(local.decreaseLabel ?? messages().decreaseValue, true), false), _$ssrAttribute("disabled", rest.disabled || local.disableSteppers || value() !== null && value() !== undefined && value() <= min(), true));
@@ -128,55 +200,36 @@ export function NumberInput(props) {
128
200
  get children() {
129
201
  return _$ssr(_tmpl$3, _$escape(local.prefix));
130
202
  }
131
- })), _$ssrElement("input", _$mergeProps(rest, {
132
- get id() {
133
- return meta.controlId;
134
- },
135
- "class": "k2b-input k2b-number-input__control",
136
- get ["data-filled"]() {
137
- return raw() ? "true" : undefined;
138
- },
139
- type: "text",
140
- role: "spinbutton",
141
- get inputmode() {
142
- return places() === 0 ? "numeric" : "decimal";
143
- },
144
- get value() {
145
- return raw();
146
- },
147
- get required() {
148
- return local.required;
149
- }
150
- }, () => fieldControlAria(meta, local), {
151
- get ["aria-valuemin"]() {
152
- return Number.isFinite(min()) ? min() : undefined;
203
+ })), _$escape(_$createComponent(Show, {
204
+ get when() {
205
+ return plain();
153
206
  },
154
- get ["aria-valuemax"]() {
155
- return Number.isFinite(max()) ? max() : undefined;
207
+ get fallback() {
208
+ return control();
156
209
  },
157
- get ["aria-valuenow"]() {
158
- return (focused() ? parse(raw()) : value()) ?? undefined;
210
+ get children() {
211
+ return _$ssr(_tmpl$4, _$ssrAttribute("data-value", _$escape(shownText(), true), false) + _$ssrAttribute("data-placeholder", raw() ? _$escape(undefined, true) : "true", false) + _$ssrAttribute("data-editing", focused() ? "true" : _$escape(undefined, true), false), _$escape(control()));
159
212
  }
160
- }), undefined, false), _$escape(_$createComponent(Show, {
213
+ })), _$escape(_$createComponent(Show, {
161
214
  get when() {
162
- return local.suffix;
215
+ return _$memo(() => !!local.suffix)() && (!plain() || raw() && (focused() || !local.formatValue));
163
216
  },
164
217
  get children() {
165
218
  return _$ssr(_tmpl$3, _$escape(local.suffix));
166
219
  }
167
220
  })), _$escape(_$createComponent(Show, {
168
221
  get when() {
169
- return _$memo(() => !!(local.clearable && raw() && !rest.disabled))() && !rest.readOnly;
222
+ return _$memo(() => !!(local.clearable && raw() && !rest.disabled && !rest.readOnly))() && !plain();
170
223
  },
171
224
  get children() {
172
- return _$ssr(_tmpl$4, _$ssrAttribute("aria-label", _$escape(local.clearLabel ?? messages().clear, true), false));
225
+ return _$ssr(_tmpl$5, _$ssrAttribute("aria-label", _$escape(local.clearLabel ?? messages().clear, true), false));
173
226
  }
174
227
  })), _$escape(_$createComponent(Show, {
175
228
  get when() {
176
- return local.showSteppers ?? true;
229
+ return local.showSteppers ?? !plain();
177
230
  },
178
231
  get children() {
179
- return _$ssr(_tmpl$5, _$ssrAttribute("aria-label", _$escape(local.increaseLabel ?? messages().increaseValue, true), false), _$ssrAttribute("disabled", rest.disabled || local.disableSteppers || value() !== null && value() !== undefined && value() >= max(), true));
232
+ return _$ssr(_tmpl$6, _$ssrAttribute("aria-label", _$escape(local.increaseLabel ?? messages().increaseValue, true), false), _$ssrAttribute("disabled", rest.disabled || local.disableSteppers || value() !== null && value() !== undefined && value() >= max(), true));
180
233
  }
181
234
  })));
182
235
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["inputs/NumberInput.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, type JSX, Show, splitProps } from \"solid-js\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { decimalSeparator, useLocale } from \"../intl/locale\";\nimport { useUiMessages } from \"../intl/messages\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { resolveMaybeAccessor } from \"./field-contract\";\n\nexport type NumberInputProps = Omit<\n JSX.InputHTMLAttributes<HTMLInputElement>,\n \"max\" | \"min\" | \"onChange\" | \"onInput\" | \"prefix\" | \"step\" | \"type\" | \"value\" | keyof ValueFieldProps<number | null>\n> &\n ValueFieldProps<number | null> & {\n max?: number;\n min?: number;\n /** Stepper increment and commit grid; defaults to `1`. A fractional step also sets the default `decimalPlaces`. */\n step?: number;\n /** Accepted fraction digits. Defaults to the fraction digits of `step` (`0.01` → `2`, `1` → `0`); an explicit value wins. */\n decimalPlaces?: number;\n allowNegative?: boolean;\n clearable?: boolean;\n onClear?: () => void;\n clearLabel?: string;\n increaseLabel?: string;\n decreaseLabel?: string;\n /** Explicit locale for the decimal separator; defaults to the inherited render locale. */\n locale?: string;\n showSteppers?: boolean;\n disableSteppers?: boolean;\n icon?: string;\n activeIcon?: string;\n prefix?: JSX.Element;\n suffix?: JSX.Element;\n };\n\nfunction fractionDigits(value: number): number {\n if (!Number.isFinite(value)) return 0;\n const [mantissa = \"\", exponent = \"0\"] = String(value).split(\"e\");\n const fraction = mantissa.split(\".\")[1]?.length ?? 0;\n return Math.max(0, fraction - Number(exponent));\n}\n\nexport function NumberInput(props: NumberInputProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"activeIcon\",\n \"allowNegative\",\n \"aria-describedby\",\n \"aria-label\",\n \"class\",\n \"clearLabel\",\n \"clearable\",\n \"decimalPlaces\",\n \"decreaseLabel\",\n \"description\",\n \"disableSteppers\",\n \"error\",\n \"icon\",\n \"id\",\n \"increaseLabel\",\n \"label\",\n \"locale\",\n \"max\",\n \"min\",\n \"onClear\",\n \"onValueCommit\",\n \"onValueChange\",\n \"prefix\",\n \"required\",\n \"showSteppers\",\n \"step\",\n \"suffix\",\n \"value\",\n ]);\n const meta = createFieldMeta(local.id);\n const [focused, setFocused] = createSignal(false);\n const value = () => resolveMaybeAccessor(local.value);\n const error = () => resolveMaybeAccessor(local.error);\n const contextLocale = useLocale();\n const messages = useUiMessages();\n const separator = createMemo(() => decimalSeparator(local.locale ?? contextLocale()));\n // The visible text keeps the canonical number, only the decimal separator\n // follows the effective locale; grouping is never rendered while editing.\n const display = (value: number | null | undefined) => (value == null ? \"\" : String(value).replace(\".\", separator()));\n const [raw, setRaw] = createSignal(display(value()));\n const min = () => local.min ?? -Infinity;\n const max = () => local.max ?? Infinity;\n const step = () => local.step ?? 1;\n // `step` and the accepted decimals never disagree: a fractional step implies\n // its own precision unless the caller states `decimalPlaces` explicitly.\n const places = () => Math.max(0, local.decimalPlaces ?? fractionDigits(step()));\n\n const filter = (input: string) => {\n let output = \"\";\n let decimal = false;\n for (const character of input) {\n if (/\\d/.test(character)) output += character;\n else if (character === \"-\" && output === \"\" && (local.allowNegative ?? true)) output += character;\n else if ((character === \".\" || character === \",\" || character === separator()) && !decimal && places() > 0) {\n output += separator();\n decimal = true;\n }\n }\n if (decimal) {\n const [integer = \"\", fraction = \"\"] = output.split(separator());\n return `${integer}${separator()}${fraction.slice(0, places())}`;\n }\n return output;\n };\n const parse = (input: string) => {\n const canonical = input.replace(separator(), \".\");\n if (!canonical || canonical === \"-\" || canonical === \".\") return null;\n const number = places() === 0 ? Number.parseInt(canonical, 10) : Number(canonical);\n return Number.isFinite(number) ? number : null;\n };\n const normalize = (value: number | null) => {\n if (value === null) return null;\n const clamped = Math.max(min(), Math.min(max(), value));\n const anchor = Number.isFinite(min()) ? min() : 0;\n const snapped = step() > 0 ? Math.round((clamped - anchor) / step()) * step() + anchor : clamped;\n const bounded = Math.max(min(), Math.min(max(), snapped));\n return places() === 0 ? Math.round(bounded) : Number(bounded.toFixed(places()));\n };\n const emit = (value: number | null) => local.onValueChange?.(value);\n const commit = (value: number | null, changeAlreadyEmitted = false) => {\n const next = normalize(value);\n setRaw(display(next));\n if (!changeAlreadyEmitted || !Object.is(next, value)) emit(next);\n local.onValueCommit?.(next);\n };\n const stepBy = (direction: number) => {\n if (rest.disabled || local.disableSteppers) return;\n const seed = value() ?? (Number.isFinite(min()) ? min() : 0);\n commit(seed + direction * step());\n };\n\n createEffect(() => {\n if (focused()) return;\n if (parse(raw()) !== value()) setRaw(display(value()));\n });\n\n return (\n <Field\n class={local.class}\n label={local.label}\n description={local.description}\n error={error()}\n meta={meta}\n required={local.required}\n disabled={rest.disabled}\n >\n <div\n class=\"k2b-input-shell k2b-number-input\"\n data-disabled={rest.disabled ? \"true\" : undefined}\n data-invalid={error() ? \"true\" : undefined}\n >\n <Show when={local.showSteppers ?? true}>\n <button\n type=\"button\"\n class=\"k2b-number-input__step\"\n aria-label={local.decreaseLabel ?? messages().decreaseValue}\n disabled={rest.disabled || local.disableSteppers || (value() !== null && value() !== undefined && value()! <= min())}\n onClick={() => stepBy(-1)}\n >\n <i class=\"ti ti-minus\" aria-hidden=\"true\" />\n </button>\n </Show>\n <div class=\"k2b-number-input__value\">\n <Show when={local.icon}>\n <span class=\"k2b-input-shell__icon k2b-text-input__icon\" aria-hidden=\"true\">\n <i class={local.icon} />\n <i class={local.activeIcon ?? local.icon} />\n </span>\n </Show>\n <Show when={local.prefix}>\n <span class=\"k2b-input-shell__affix\">{local.prefix}</span>\n </Show>\n <input\n {...rest}\n id={meta.controlId}\n class=\"k2b-input k2b-number-input__control\"\n data-filled={raw() ? \"true\" : undefined}\n type=\"text\"\n role=\"spinbutton\"\n inputmode={places() === 0 ? \"numeric\" : \"decimal\"}\n value={raw()}\n required={local.required}\n {...fieldControlAria(meta, local)}\n aria-valuemin={Number.isFinite(min()) ? min() : undefined}\n aria-valuemax={Number.isFinite(max()) ? max() : undefined}\n aria-valuenow={(focused() ? parse(raw()) : value()) ?? undefined}\n onFocus={() => setFocused(true)}\n onInput={(event) => {\n const input = event.currentTarget;\n const current = input.value;\n const selectionStart = input.selectionStart;\n const selectionEnd = input.selectionEnd;\n const next = filter(current);\n // Only write back when the filter actually dropped something —\n // re-assigning an unchanged value moves the caret to the end.\n if (current !== next) {\n input.value = next;\n if (selectionStart !== null && selectionEnd !== null) {\n input.setSelectionRange(filter(current.slice(0, selectionStart)).length, filter(current.slice(0, selectionEnd)).length);\n }\n }\n setRaw(next);\n emit(parse(next));\n }}\n onBlur={() => {\n commit(parse(raw()), true);\n setFocused(false);\n }}\n />\n <Show when={local.suffix}>\n <span class=\"k2b-input-shell__affix\">{local.suffix}</span>\n </Show>\n <Show when={local.clearable && raw() && !rest.disabled && !rest.readOnly}>\n <button\n type=\"button\"\n class=\"k2b-input-shell__clear k2b-input-clear-action\"\n aria-label={local.clearLabel ?? messages().clear}\n onClick={() => (local.onClear ? local.onClear() : commit(null))}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n </div>\n <Show when={local.showSteppers ?? true}>\n <button\n type=\"button\"\n class=\"k2b-number-input__step\"\n aria-label={local.increaseLabel ?? messages().increaseValue}\n disabled={rest.disabled || local.disableSteppers || (value() !== null && value() !== undefined && value()! >= max())}\n onClick={() => stepBy(1)}\n >\n <i class=\"ti ti-plus\" aria-hidden=\"true\" />\n </button>\n </Show>\n </div>\n </Field>\n );\n}\n\nexport default NumberInput;\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EA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AI,CAAC,IAAI,CAAC,QAAQ;QAAA;QAAA;UAAA,4DAIxD,KAAK,CAAC,UAAU,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK;QAAA;MAAA,gCAOrD,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,YAAY,IAAI,IAAI;QAAA;QAAA;UAAA,4DAItB,KAAK,CAAC,aAAa,IAAI,QAAQ,CAAC,CAAC,CAAC,aAAa,4CACjD,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,eAAe,IAAK,KAAK,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,CAAC,IAAK,GAAG,CAAC,CAAE;QAAA;MAAA;IAAA;EAAA;AAShI;AAEA,eAAe,WAAW","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["inputs/NumberInput.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, type JSX, Show, splitProps } from \"solid-js\";\nimport { createFieldMeta, Field, fieldControlAria } from \"../internal/field\";\nimport { decimalSeparator, useLocale } from \"../intl/locale\";\nimport { useUiMessages } from \"../intl/messages\";\nimport type { ValueFieldProps } from \"./field-contract\";\nimport { resolveMaybeAccessor } from \"./field-contract\";\nimport type { ChoiceAppearance } from \"./Select\";\n\nexport type NumberInputProps = Omit<\n JSX.InputHTMLAttributes<HTMLInputElement>,\n \"max\" | \"min\" | \"onChange\" | \"onInput\" | \"prefix\" | \"step\" | \"type\" | \"value\" | keyof ValueFieldProps<number | null>\n> &\n ValueFieldProps<number | null> & {\n max?: number;\n min?: number;\n /** Stepper increment and commit grid; defaults to `1`. A fractional step also sets the default `decimalPlaces`. */\n step?: number;\n /** Accepted fraction digits. Defaults to the fraction digits of `step` (`0.01` → `2`, `1` → `0`); an explicit value wins. */\n decimalPlaces?: number;\n allowNegative?: boolean;\n clearable?: boolean;\n onClear?: () => void;\n clearLabel?: string;\n increaseLabel?: string;\n decreaseLabel?: string;\n /** Explicit locale for the decimal separator; defaults to the inherited render locale. */\n locale?: string;\n showSteppers?: boolean;\n disableSteppers?: boolean;\n icon?: string;\n activeIcon?: string;\n prefix?: JSX.Element;\n suffix?: JSX.Element;\n /**\n * `plain` edits the value in place for property rows: no box and no steppers\n * or clear button. The field sizes to its text, Enter commits, Escape\n * restores the current value, and clearing the text clears the value. Focus\n * stays in the field.\n */\n appearance?: ChoiceAppearance;\n /**\n * Text for a set value while a plain field is not being edited, such as\n * `90` as \"1 h 30 min\". It also names the value for assistive technology.\n * The suffix then shows only while editing.\n */\n formatValue?: (value: number) => string;\n };\n\nfunction fractionDigits(value: number): number {\n if (!Number.isFinite(value)) return 0;\n const [mantissa = \"\", exponent = \"0\"] = String(value).split(\"e\");\n const fraction = mantissa.split(\".\")[1]?.length ?? 0;\n return Math.max(0, fraction - Number(exponent));\n}\n\nexport function NumberInput(props: NumberInputProps): JSX.Element {\n const [local, rest] = splitProps(props, [\n \"activeIcon\",\n \"appearance\",\n \"allowNegative\",\n \"aria-describedby\",\n \"aria-label\",\n \"class\",\n \"clearLabel\",\n \"clearable\",\n \"decimalPlaces\",\n \"decreaseLabel\",\n \"description\",\n \"disableSteppers\",\n \"error\",\n \"formatValue\",\n \"icon\",\n \"id\",\n \"increaseLabel\",\n \"label\",\n \"locale\",\n \"max\",\n \"min\",\n \"onClear\",\n \"onKeyDown\",\n \"onValueCommit\",\n \"onValueChange\",\n \"prefix\",\n \"required\",\n \"showSteppers\",\n \"step\",\n \"suffix\",\n \"value\",\n ]);\n const meta = createFieldMeta(local.id);\n const plain = () => local.appearance === \"plain\";\n let input: HTMLInputElement | undefined;\n const [focused, setFocused] = createSignal(false);\n const value = () => resolveMaybeAccessor(local.value);\n const error = () => resolveMaybeAccessor(local.error);\n const contextLocale = useLocale();\n const messages = useUiMessages();\n const separator = createMemo(() => decimalSeparator(local.locale ?? contextLocale()));\n // The visible text keeps the canonical number, only the decimal separator\n // follows the effective locale; grouping is never rendered while editing.\n const display = (value: number | null | undefined) => (value == null ? \"\" : String(value).replace(\".\", separator()));\n const [raw, setRaw] = createSignal(display(value()));\n const min = () => local.min ?? -Infinity;\n const max = () => local.max ?? Infinity;\n const step = () => local.step ?? 1;\n // `step` and the accepted decimals never disagree: a fractional step implies\n // its own precision unless the caller states `decimalPlaces` explicitly.\n const places = () => Math.max(0, local.decimalPlaces ?? fractionDigits(step()));\n\n const filter = (input: string) => {\n let output = \"\";\n let decimal = false;\n for (const character of input) {\n if (/\\d/.test(character)) output += character;\n else if (character === \"-\" && output === \"\" && (local.allowNegative ?? true)) output += character;\n else if ((character === \".\" || character === \",\" || character === separator()) && !decimal && places() > 0) {\n output += separator();\n decimal = true;\n }\n }\n if (decimal) {\n const [integer = \"\", fraction = \"\"] = output.split(separator());\n return `${integer}${separator()}${fraction.slice(0, places())}`;\n }\n return output;\n };\n const parse = (input: string) => {\n const canonical = input.replace(separator(), \".\");\n if (!canonical || canonical === \"-\" || canonical === \".\") return null;\n const number = places() === 0 ? Number.parseInt(canonical, 10) : Number(canonical);\n return Number.isFinite(number) ? number : null;\n };\n const normalize = (value: number | null) => {\n if (value === null) return null;\n const clamped = Math.max(min(), Math.min(max(), value));\n const anchor = Number.isFinite(min()) ? min() : 0;\n const snapped = step() > 0 ? Math.round((clamped - anchor) / step()) * step() + anchor : clamped;\n const bounded = Math.max(min(), Math.min(max(), snapped));\n return places() === 0 ? Math.round(bounded) : Number(bounded.toFixed(places()));\n };\n const emit = (value: number | null) => local.onValueChange?.(value);\n const commit = (value: number | null, changeAlreadyEmitted = false) => {\n const next = normalize(value);\n setRaw(display(next));\n if (!changeAlreadyEmitted || !Object.is(next, value)) emit(next);\n local.onValueCommit?.(next);\n };\n const stepBy = (direction: number) => {\n if (rest.disabled || local.disableSteppers) return;\n const seed = value() ?? (Number.isFinite(min()) ? min() : 0);\n commit(seed + direction * step());\n };\n\n createEffect(() => {\n if (focused()) return;\n if (parse(raw()) !== value()) setRaw(display(value()));\n });\n // Enter already committed the current text, so leaving the field does not commit it twice.\n let committedOnEnter = false;\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (event) => {\n const handler = local.onKeyDown;\n if (typeof handler === \"function\") handler(event);\n else if (Array.isArray(handler)) handler[0](handler[1], event);\n if (!plain() || event.defaultPrevented) return;\n // Both keys keep focus in the field, so keyboard and screen reader users stay in place.\n if (event.key === \"Enter\") {\n event.preventDefault();\n commit(parse(raw()), true);\n committedOnEnter = true;\n } else if (event.key === \"Escape\" && parse(raw()) !== value()) {\n // Only an edit in progress swallows Escape; otherwise it reaches an enclosing panel.\n event.preventDefault();\n event.stopPropagation();\n setRaw(display(value()));\n }\n };\n const placeholderText = () => (typeof rest.placeholder === \"string\" ? rest.placeholder : \"\");\n /** What a plain field shows: the formatted value at rest, the text being edited while focused. */\n const shownText = () => {\n const current = value();\n if (!focused() && current != null && local.formatValue) return local.formatValue(current);\n return raw() || placeholderText();\n };\n const valueText = () => {\n if (rest[\"aria-valuetext\"] !== undefined) return rest[\"aria-valuetext\"];\n const current = focused() ? parse(raw()) : value();\n if (current == null) return undefined;\n if (local.formatValue) return local.formatValue(current);\n const unit = typeof local.suffix === \"string\" ? local.suffix : \"\";\n return unit ? `${display(current)} ${unit}` : undefined;\n };\n const control = () => (\n <input\n {...rest}\n ref={input}\n id={meta.controlId}\n class=\"k2b-input k2b-number-input__control\"\n data-filled={raw() ? \"true\" : undefined}\n type=\"text\"\n role=\"spinbutton\"\n inputmode={places() === 0 ? \"numeric\" : \"decimal\"}\n value={raw()}\n required={local.required}\n {...fieldControlAria(meta, local)}\n aria-valuemin={Number.isFinite(min()) ? min() : undefined}\n aria-valuemax={Number.isFinite(max()) ? max() : undefined}\n aria-valuenow={(focused() ? parse(raw()) : value()) ?? undefined}\n aria-valuetext={valueText()}\n // The plain sizer sets the width; the smallest intrinsic size keeps the input from widening it.\n size={plain() ? 1 : rest.size}\n onFocus={() => setFocused(true)}\n onKeyDown={onKeyDown}\n onInput={(event) => {\n const input = event.currentTarget;\n const current = input.value;\n const selectionStart = input.selectionStart;\n const selectionEnd = input.selectionEnd;\n const next = filter(current);\n // Only write back when the filter actually dropped something —\n // re-assigning an unchanged value moves the caret to the end.\n if (current !== next) {\n input.value = next;\n if (selectionStart !== null && selectionEnd !== null) {\n input.setSelectionRange(filter(current.slice(0, selectionStart)).length, filter(current.slice(0, selectionEnd)).length);\n }\n }\n setRaw(next);\n committedOnEnter = false;\n emit(parse(next));\n }}\n onBlur={() => {\n if (!committedOnEnter) commit(parse(raw()), true);\n committedOnEnter = false;\n setFocused(false);\n }}\n />\n );\n\n return (\n <Field\n class={local.class}\n label={local.label}\n description={local.description}\n error={error()}\n meta={meta}\n required={local.required}\n disabled={rest.disabled}\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: the input inside is the keyboard target; a plain field's row only forwards a pointer click beside the text to it. */}\n <div\n class=\"k2b-input-shell k2b-number-input\"\n data-appearance={local.appearance ?? \"field\"}\n data-disabled={rest.disabled ? \"true\" : undefined}\n data-invalid={error() ? \"true\" : undefined}\n onClick={(event) => {\n if (plain() && event.target !== input && !rest.disabled) input?.focus();\n }}\n >\n <Show when={local.showSteppers ?? !plain()}>\n <button\n type=\"button\"\n class=\"k2b-number-input__step\"\n aria-label={local.decreaseLabel ?? messages().decreaseValue}\n disabled={rest.disabled || local.disableSteppers || (value() !== null && value() !== undefined && value()! <= min())}\n onClick={() => stepBy(-1)}\n >\n <i class=\"ti ti-minus\" aria-hidden=\"true\" />\n </button>\n </Show>\n <div class=\"k2b-number-input__value\">\n <Show when={local.icon}>\n <span class=\"k2b-input-shell__icon k2b-text-input__icon\" aria-hidden=\"true\">\n <i class={local.icon} />\n <i class={local.activeIcon ?? local.icon} />\n </span>\n </Show>\n <Show when={local.prefix}>\n <span class=\"k2b-input-shell__affix\">{local.prefix}</span>\n </Show>\n <Show when={plain()} fallback={control()}>\n {/* The sizer shows the text in the input's grid cell, so the field is as wide as what it shows. At rest it is\n the visible value; while editing the input takes over. */}\n <span\n class=\"k2b-number-input__sizer\"\n data-value={shownText()}\n data-placeholder={raw() ? undefined : \"true\"}\n data-editing={focused() ? \"true\" : undefined}\n >\n {control()}\n </span>\n </Show>\n <Show when={local.suffix && (!plain() || (raw() && (focused() || !local.formatValue)))}>\n <span class=\"k2b-input-shell__affix\">{local.suffix}</span>\n </Show>\n <Show when={local.clearable && raw() && !rest.disabled && !rest.readOnly && !plain()}>\n <button\n type=\"button\"\n class=\"k2b-input-shell__clear k2b-input-clear-action\"\n aria-label={local.clearLabel ?? messages().clear}\n onClick={() => (local.onClear ? local.onClear() : commit(null))}\n >\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </Show>\n </div>\n <Show when={local.showSteppers ?? !plain()}>\n <button\n type=\"button\"\n class=\"k2b-number-input__step\"\n aria-label={local.increaseLabel ?? messages().increaseValue}\n disabled={rest.disabled || local.disableSteppers || (value() !== null && value() !== undefined && value()! >= max())}\n onClick={() => stepBy(1)}\n >\n <i class=\"ti ti-plus\" aria-hidden=\"true\" />\n </button>\n </Show>\n </div>\n </Field>\n );\n}\n\nexport default NumberInput;\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,UAAU,EAAE,YAAY,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AAC7F,SAAS,eAAe,EAAE,KAAK,EAAE,gBAAgB,QAAQ,mBAAmB;AAC5E,SAAS,gBAAgB,EAAE,SAAS,QAAQ,gBAAgB;AAC5D,SAAS,aAAa,QAAQ,kBAAkB;AAEhD,SAAS,oBAAoB,QAAQ,kBAAkB;AA2CvD,SAAS,cAAc,CAAC,KAAa,EAAU;EAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;EACrC,MAAM,CAAC,QAAQ,GAAG,EAAE,EAAE,QAAQ,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;EAChE,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