@k2b/ui 0.47.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/actions/CopyButton.js +26 -18
- package/dist/browser/actions/CopyButton.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +244 -193
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +6 -0
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/types.js.map +1 -1
- package/dist/browser/content/Calendar.js +40 -5
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/calendar-event-detail.js +328 -0
- package/dist/browser/content/calendar-event-detail.js.map +1 -0
- package/dist/browser/content/calendar-messages.js +34 -2
- package/dist/browser/content/calendar-messages.js.map +1 -1
- package/dist/browser/content/calendar-shared.js +189 -82
- package/dist/browser/content/calendar-shared.js.map +1 -1
- package/dist/browser/content/calendar-time-view.js +101 -96
- package/dist/browser/content/calendar-time-view.js.map +1 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/prompt-confirm.js +7 -4
- package/dist/browser/feedback/prompt-confirm.js.map +1 -1
- package/dist/browser/feedback/prompts.js +3 -3
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/inputs/NumberInput.js +17 -5
- package/dist/browser/inputs/NumberInput.js.map +1 -1
- package/dist/browser/inputs/dictation/Dictation.js +114 -108
- package/dist/browser/inputs/dictation/Dictation.js.map +1 -1
- package/dist/browser/inputs/dictation/dictation-messages.js +2 -0
- package/dist/browser/inputs/dictation/dictation-messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +574 -522
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/MobileShell.js +26 -0
- package/dist/browser/layout/MobileShell.js.map +1 -1
- package/dist/browser/layout/index.js +1 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/sheet-handle.js +155 -0
- package/dist/browser/layout/sheet-handle.js.map +1 -0
- package/dist/browser/surfaces/NoticeCard.js +48 -29
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/actions/CopyButton.js +13 -8
- package/dist/ssr/actions/CopyButton.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +53 -30
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +6 -0
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/types.js.map +1 -1
- package/dist/ssr/content/Calendar.js +36 -4
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/calendar-event-detail.js +212 -0
- package/dist/ssr/content/calendar-event-detail.js.map +1 -0
- package/dist/ssr/content/calendar-messages.js +34 -2
- package/dist/ssr/content/calendar-messages.js.map +1 -1
- package/dist/ssr/content/calendar-shared.js +117 -36
- package/dist/ssr/content/calendar-shared.js.map +1 -1
- package/dist/ssr/content/calendar-time-view.js +6 -4
- package/dist/ssr/content/calendar-time-view.js.map +1 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/prompt-confirm.js +7 -4
- package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +3 -3
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/inputs/NumberInput.js +17 -5
- package/dist/ssr/inputs/NumberInput.js.map +1 -1
- package/dist/ssr/inputs/dictation/Dictation.js +3 -1
- package/dist/ssr/inputs/dictation/Dictation.js.map +1 -1
- package/dist/ssr/inputs/dictation/dictation-messages.js +2 -0
- package/dist/ssr/inputs/dictation/dictation-messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +152 -114
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/MobileShell.js +26 -0
- package/dist/ssr/layout/MobileShell.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/sheet-handle.js +155 -0
- package/dist/ssr/layout/sheet-handle.js.map +1 -0
- package/dist/ssr/surfaces/NoticeCard.js +25 -10
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/chat/chat-messages.d.ts +3 -0
- package/dist/types/chat/types.d.ts +5 -0
- package/dist/types/content/Calendar.d.ts +29 -5
- package/dist/types/content/calendar-event-detail.d.ts +21 -0
- package/dist/types/content/calendar-messages.d.ts +16 -0
- package/dist/types/content/calendar-shared.d.ts +16 -1
- package/dist/types/content/calendar-time-view.d.ts +1 -1
- package/dist/types/content/index.d.ts +1 -1
- package/dist/types/feedback/prompt-confirm.d.ts +3 -1
- package/dist/types/feedback/prompts.d.ts +2 -2
- package/dist/types/inputs/NumberInput.d.ts +1 -1
- package/dist/types/inputs/dictation/dictation-messages.d.ts +1 -0
- package/dist/types/layout/AppWorkspace.d.ts +16 -1
- package/dist/types/layout/MobileShell.d.ts +5 -0
- package/dist/types/layout/index.d.ts +2 -1
- package/dist/types/layout/sheet-handle.d.ts +21 -0
- package/dist/types/surfaces/NoticeCard.d.ts +5 -2
- package/package.json +1 -1
|
@@ -31,8 +31,11 @@ import { resolvePromptMessages } from "./prompt-messages";
|
|
|
31
31
|
|
|
32
32
|
const PHRASE_SLOT = "\u0000";
|
|
33
33
|
|
|
34
|
-
/** A prompt's `variant` is its tone too: a success or danger prompt carries the dialog tone of that name. */
|
|
35
|
-
export const promptTone = variant => variant === "
|
|
34
|
+
/** A prompt's `variant` is its tone too: a success, warning or danger prompt carries the dialog tone of that name. */
|
|
35
|
+
export const promptTone = variant => variant === "primary" ? undefined : variant;
|
|
36
|
+
|
|
37
|
+
/** A warning asks for care, not for a destructive act: its confirm button stays primary. */
|
|
38
|
+
export const promptButtonVariant = variant => variant === undefined || variant === "warning" ? "primary" : variant;
|
|
36
39
|
export const DialogHeader = props => (() => {
|
|
37
40
|
var _el$ = _$getNextElement(_tmpl$),
|
|
38
41
|
_el$3 = _el$.firstChild,
|
|
@@ -128,7 +131,7 @@ export const confirmPrompt = (content, options) => {
|
|
|
128
131
|
_$insert(_el$14, () => options?.cancelText || resolveUiMessages().cancel);
|
|
129
132
|
_el$15.$$click = () => close(true);
|
|
130
133
|
_$insert(_el$15, () => options?.confirmText || resolvePromptMessages().confirm);
|
|
131
|
-
_$effect(() => _$setAttribute(_el$15, "data-variant", options?.variant
|
|
134
|
+
_$effect(() => _$setAttribute(_el$15, "data-variant", promptButtonVariant(options?.variant)));
|
|
132
135
|
_$runHydrationEvents();
|
|
133
136
|
return _el$11;
|
|
134
137
|
})();
|
|
@@ -192,7 +195,7 @@ export const confirmPrompt = (content, options) => {
|
|
|
192
195
|
_$insert(_el$24, () => options?.cancelText || resolveUiMessages().cancel);
|
|
193
196
|
_$insert(_el$25, () => options?.confirmText || resolvePromptMessages().confirm);
|
|
194
197
|
_$effect(_p$ => {
|
|
195
|
-
var _v$3 = options?.variant
|
|
198
|
+
var _v$3 = promptButtonVariant(options?.variant),
|
|
196
199
|
_v$4 = !canConfirm();
|
|
197
200
|
_v$3 !== _p$.e && _$setAttribute(_el$25, "data-variant", _p$.e = _v$3);
|
|
198
201
|
_v$4 !== _p$.t && _$setProperty(_el$25, "disabled", _p$.t = _v$4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["feedback/prompt-confirm.tsx"],"sourcesContent":["import { createSignal, type JSX, Show } from \"solid-js\";\nimport { TextInput } from \"../inputs/TextInput\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { dialogCore } from \"./dialog-core\";\nimport { type DialogTone, dialogToneIcon, dialogToneLabel } from \"./dialog-tone\";\nimport { resolvePromptMessages } from \"./prompt-messages\";\nimport type { ConfirmOptions, DialogOptions } from \"./prompts\";\n\n// The dialog frame and `prompts.confirm`, apart from the form prompts: `PanelDialog` asks before discarding changes,\n// and the form prompts render date pickers whose phone sheet is a `PanelDialog`, so one module would be an import cycle.\n\nexport type PromptContent = string | HTMLElement | JSX.Element;\n\nconst PHRASE_SLOT = \"\\u0000\";\n\n/** A prompt's `variant` is its tone too: a success or danger prompt carries the dialog tone of that name. */\nexport const promptTone = (variant: DialogOptions[\"variant\"]): DialogTone | undefined =>\n variant === \"success\" || variant === \"danger\" ? variant : undefined;\n\nexport const DialogHeader = (props: { close: () => void; title?: string; icon?: string; tone?: DialogTone }): JSX.Element => (\n <header class=\"k2b-dialog__header\">\n <Show when={props.tone ? dialogToneIcon(props.tone) : props.icon}>\n {(icon) => <i class={icon()} data-tone={props.tone} aria-hidden=\"true\" />}\n </Show>\n <Show when={props.tone}>\n {(tone) => (\n <span class=\"k2b-sr-only\" data-dialog-tone-label>\n {dialogToneLabel(resolveUiMessages(), tone())}\n </span>\n )}\n </Show>\n <Show when={props.title} fallback={<span class=\"k2b-dialog__header-spacer\" />}>\n {(title) => <h2>{title()}</h2>}\n </Show>\n <button type=\"button\" class=\"k2b-dialog__close\" aria-label={resolveUiMessages().closeDialog} onClick={props.close}>\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </header>\n);\n\nexport const panelClass = (options?: Pick<DialogOptions, \"size\" | \"surface\" | \"variant\">): string => {\n const size = options?.size ?? \"medium\";\n const variant = options?.variant && options.variant !== \"primary\" ? ` k2b-dialog--${options.variant}` : \"\";\n return `k2b-dialog k2b-dialog--${size}${variant}${options?.surface === \"bare\" ? \" is-bare\" : \"\"}`;\n};\n\nexport const contentClass = (surface?: DialogOptions[\"surface\"]): string =>\n surface === \"bare\" ? \"k2b-dialog__viewport is-bare\" : \"k2b-dialog__viewport\";\n\nexport const confirmPrompt = (content: PromptContent, options?: ConfirmOptions): Promise<boolean | undefined> => {\n const confirmationPhrase = options?.confirmationPhrase;\n if (confirmationPhrase !== undefined && (confirmationPhrase.trim().length === 0 || /[\\r\\n\\t]/.test(confirmationPhrase))) {\n throw new Error(\"confirmationPhrase must be non-empty, visible, and single-line\");\n }\n let confirmationInput: HTMLInputElement | undefined;\n\n return dialogCore.open<boolean>(\n (close) => {\n if (!confirmationPhrase) {\n return (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title} icon={options?.icon} tone={promptTone(options?.variant)} close={() => close(false)} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"button\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} onClick={() => close(true)}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </div>\n );\n }\n\n // The catalog owns word order; the slot marks where the verbatim phrase is rendered as code.\n const [labelBefore, labelAfter] = resolvePromptMessages().typeToConfirm({ phrase: PHRASE_SLOT }).split(PHRASE_SLOT);\n const [confirmationValue, setConfirmationValue] = createSignal(\"\");\n const canConfirm = () => confirmationValue() === confirmationPhrase;\n const submit = (event: SubmitEvent) => {\n event.preventDefault();\n if (canConfirm()) close(true);\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={submit}>\n <DialogHeader title={options?.title} icon={options?.icon} tone={promptTone(options?.variant)} close={() => close(false)} />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <div class=\"k2b-prompt-copy\">{content}</div>\n <TextInput\n ref={(element) => {\n confirmationInput = element;\n }}\n label={\n <>\n {labelBefore}\n <code class=\"k2b-confirmation-phrase\">{confirmationPhrase}</code>\n {labelAfter}\n </>\n }\n value={confirmationValue}\n onValueChange={setConfirmationValue}\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck={false}\n monospace\n required\n />\n </div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"submit\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} disabled={!canConfirm()}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </form>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n initialFocus: confirmationPhrase ? () => confirmationInput ?? null : undefined,\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolvePromptMessages().confirmation,\n },\n );\n};\n\n/** `prompts` starts as this object; `PanelDialog` asks through it, so it reaches a replaced `prompts.confirm` too. */\nexport const sharedPrompts = { confirm: confirmPrompt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAY,IAAI,QAAQ,UAAU;AACvD,SAAS,SAAS,QAAQ,qBAAqB;AAC/C,SAAS,iBAAiB,QAAQ,kBAAkB;AACpD,SAAS,UAAU,QAAQ,eAAe;AAC1C,SAA0B,cAAc,EAAE,eAAe,QAAQ,eAAe;AAChF,SAAS,qBAAqB,QAAQ,mBAAmB;;AAGzD;AACA;;AAIA,MAAM,WAAW,GAAG,QAAQ;;AAE5B;AACA,OAAO,MAAM,UAAU,GAAI,OAAiC,IAC1D,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,SAAS;AAErE,OAAO,MAAM,YAAY,GAAI,KAA8E;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA,iCAEtG,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,oBAAK,CAAC,IAAI,MAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI;IAAA;IAAA,UAC5D,IAAI;MAAA;MAAA;QAAA,UAAe,IAAI,CAAC,CAAC;UAAA,OAAa,KAAK,CAAC,IAAI;QAAA;QAAA;QAAA;MAAA;QAAA;QAAA;MAAA;MAAA;IAAA;EAAuB;EAAA,iCAE1E,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,IAAI;IAAA;IAAA,UAClB,IAAI;MAAA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OAAO,MAAM,aAAa,GAAG;EAAE,OAAO,EAAE;AAAc,CAAC;AAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["feedback/prompt-confirm.tsx"],"sourcesContent":["import { createSignal, type JSX, Show } from \"solid-js\";\nimport { TextInput } from \"../inputs/TextInput\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { dialogCore } from \"./dialog-core\";\nimport { type DialogTone, dialogToneIcon, dialogToneLabel } from \"./dialog-tone\";\nimport { resolvePromptMessages } from \"./prompt-messages\";\nimport type { ConfirmOptions, DialogOptions } from \"./prompts\";\n\n// The dialog frame and `prompts.confirm`, apart from the form prompts: `PanelDialog` asks before discarding changes,\n// and the form prompts render date pickers whose phone sheet is a `PanelDialog`, so one module would be an import cycle.\n\nexport type PromptContent = string | HTMLElement | JSX.Element;\n\nconst PHRASE_SLOT = \"\\u0000\";\n\n/** A prompt's `variant` is its tone too: a success, warning or danger prompt carries the dialog tone of that name. */\nexport const promptTone = (variant: DialogOptions[\"variant\"]): DialogTone | undefined => (variant === \"primary\" ? undefined : variant);\n\n/** A warning asks for care, not for a destructive act: its confirm button stays primary. */\nexport const promptButtonVariant = (variant: DialogOptions[\"variant\"]): \"danger\" | \"primary\" | \"success\" =>\n variant === undefined || variant === \"warning\" ? \"primary\" : variant;\n\nexport const DialogHeader = (props: { close: () => void; title?: string; icon?: string; tone?: DialogTone }): JSX.Element => (\n <header class=\"k2b-dialog__header\">\n <Show when={props.tone ? dialogToneIcon(props.tone) : props.icon}>\n {(icon) => <i class={icon()} data-tone={props.tone} aria-hidden=\"true\" />}\n </Show>\n <Show when={props.tone}>\n {(tone) => (\n <span class=\"k2b-sr-only\" data-dialog-tone-label>\n {dialogToneLabel(resolveUiMessages(), tone())}\n </span>\n )}\n </Show>\n <Show when={props.title} fallback={<span class=\"k2b-dialog__header-spacer\" />}>\n {(title) => <h2>{title()}</h2>}\n </Show>\n <button type=\"button\" class=\"k2b-dialog__close\" aria-label={resolveUiMessages().closeDialog} onClick={props.close}>\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n </button>\n </header>\n);\n\nexport const panelClass = (options?: Pick<DialogOptions, \"size\" | \"surface\" | \"variant\">): string => {\n const size = options?.size ?? \"medium\";\n const variant = options?.variant && options.variant !== \"primary\" ? ` k2b-dialog--${options.variant}` : \"\";\n return `k2b-dialog k2b-dialog--${size}${variant}${options?.surface === \"bare\" ? \" is-bare\" : \"\"}`;\n};\n\nexport const contentClass = (surface?: DialogOptions[\"surface\"]): string =>\n surface === \"bare\" ? \"k2b-dialog__viewport is-bare\" : \"k2b-dialog__viewport\";\n\nexport const confirmPrompt = (content: PromptContent, options?: ConfirmOptions): Promise<boolean | undefined> => {\n const confirmationPhrase = options?.confirmationPhrase;\n if (confirmationPhrase !== undefined && (confirmationPhrase.trim().length === 0 || /[\\r\\n\\t]/.test(confirmationPhrase))) {\n throw new Error(\"confirmationPhrase must be non-empty, visible, and single-line\");\n }\n let confirmationInput: HTMLInputElement | undefined;\n\n return dialogCore.open<boolean>(\n (close) => {\n if (!confirmationPhrase) {\n return (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title} icon={options?.icon} tone={promptTone(options?.variant)} close={() => close(false)} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"button\" class=\"k2b-button\" data-variant={promptButtonVariant(options?.variant)} onClick={() => close(true)}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </div>\n );\n }\n\n // The catalog owns word order; the slot marks where the verbatim phrase is rendered as code.\n const [labelBefore, labelAfter] = resolvePromptMessages().typeToConfirm({ phrase: PHRASE_SLOT }).split(PHRASE_SLOT);\n const [confirmationValue, setConfirmationValue] = createSignal(\"\");\n const canConfirm = () => confirmationValue() === confirmationPhrase;\n const submit = (event: SubmitEvent) => {\n event.preventDefault();\n if (canConfirm()) close(true);\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={submit}>\n <DialogHeader title={options?.title} icon={options?.icon} tone={promptTone(options?.variant)} close={() => close(false)} />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <div class=\"k2b-prompt-copy\">{content}</div>\n <TextInput\n ref={(element) => {\n confirmationInput = element;\n }}\n label={\n <>\n {labelBefore}\n <code class=\"k2b-confirmation-phrase\">{confirmationPhrase}</code>\n {labelAfter}\n </>\n }\n value={confirmationValue}\n onValueChange={setConfirmationValue}\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck={false}\n monospace\n required\n />\n </div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => close(false)}>\n {options?.cancelText || resolveUiMessages().cancel}\n </button>\n <button type=\"submit\" class=\"k2b-button\" data-variant={promptButtonVariant(options?.variant)} disabled={!canConfirm()}>\n {options?.confirmText || resolvePromptMessages().confirm}\n </button>\n </footer>\n </form>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n initialFocus: confirmationPhrase ? () => confirmationInput ?? null : undefined,\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolvePromptMessages().confirmation,\n },\n );\n};\n\n/** `prompts` starts as this object; `PanelDialog` asks through it, so it reaches a replaced `prompts.confirm` too. */\nexport const sharedPrompts = { confirm: confirmPrompt };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAY,IAAI,QAAQ,UAAU;AACvD,SAAS,SAAS,QAAQ,qBAAqB;AAC/C,SAAS,iBAAiB,QAAQ,kBAAkB;AACpD,SAAS,UAAU,QAAQ,eAAe;AAC1C,SAA0B,cAAc,EAAE,eAAe,QAAQ,eAAe;AAChF,SAAS,qBAAqB,QAAQ,mBAAmB;;AAGzD;AACA;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,CAAC,KAAK,CAAC;MAAA,uBAC1F,OAAO,EAAE,UAAU,IAAI,iBAAiB,CAAC,CAAC,CAAC,MAAM;MAAA,uBAGjD,OAAO,EAAE,WAAW,IAAI,qBAAqB,CAAC,CAAC,CAAC,OAAO;MAAA;QAAA,WADH,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;UAAA,OAAY,CAAC,UAAU,CAAC,CAAC;QAAA;QAAA;QAAA;MAAA;QAAA;QAAA;MAAA;MAAA;MAAA;IAAA;EAM7H,CAAC,EACD;IACE,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC;IACnC,gBAAgB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,YAAY,EAAE,kBAAkB,GAAG,MAAM,iBAAiB,IAAI,IAAI,GAAG,SAAS;IAC9E,MAAM,EAAE,OAAO,EAAE,MAAM;IACvB,cAAc,EAAE,OAAO,EAAE,cAAc;IACvC,OAAO,EAAE,OAAO,EAAE,OAAO;IACzB,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,KAAK,IAAI,qBAAqB,CAAC,CAAC,CAAC;EAC7E,CACF,CAAC;AACH,CAAC;;AAED;AACA,OAAO,MAAM,aAAa,GAAG;EAAE,OAAO,EAAE;AAAc,CAAC;AAAC","ignoreList":[]}
|
|
@@ -46,7 +46,7 @@ import { TextInput } from "../inputs/TextInput";
|
|
|
46
46
|
import { KeyedFor } from "../internal/keyed-for";
|
|
47
47
|
import { resolveUiMessages } from "../intl/messages";
|
|
48
48
|
import { dialogCore } from "./dialog-core";
|
|
49
|
-
import { contentClass, DialogHeader, panelClass, promptTone, sharedPrompts } from "./prompt-confirm";
|
|
49
|
+
import { contentClass, DialogHeader, panelClass, promptButtonVariant, promptTone, sharedPrompts } from "./prompt-confirm";
|
|
50
50
|
import { resolvePromptMessages } from "./prompt-messages";
|
|
51
51
|
export { DialogHeader } from "./prompt-confirm";
|
|
52
52
|
const isEmpty = value => value === undefined || value === null || value === "" || Array.isArray(value) && value.length === 0;
|
|
@@ -413,7 +413,7 @@ const PromptFormDialog = props => {
|
|
|
413
413
|
}
|
|
414
414
|
}), _el$8, _co$);
|
|
415
415
|
_$insert(_el$6, () => props.config.confirmText ?? resolveUiMessages().save);
|
|
416
|
-
_$effect(() => _$setAttribute(_el$6, "data-variant", props.config.variant
|
|
416
|
+
_$effect(() => _$setAttribute(_el$6, "data-variant", promptButtonVariant(props.config.variant)));
|
|
417
417
|
return _el$2;
|
|
418
418
|
})();
|
|
419
419
|
};
|
|
@@ -789,7 +789,7 @@ export const prompts = Object.assign(sharedPrompts, {
|
|
|
789
789
|
_$insert(_el$44, content);
|
|
790
790
|
_el$46.$$click = () => close();
|
|
791
791
|
_$insert(_el$46, () => options?.confirmText || resolveUiMessages().ok);
|
|
792
|
-
_$effect(() => _$setAttribute(_el$46, "data-variant", options?.variant
|
|
792
|
+
_$effect(() => _$setAttribute(_el$46, "data-variant", promptButtonVariant(options?.variant)));
|
|
793
793
|
_$runHydrationEvents();
|
|
794
794
|
return _el$43;
|
|
795
795
|
})(), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["feedback/prompts.tsx"],"sourcesContent":["import { mutation, timed } from \"@k2b/stdlib/solid\";\nimport { createEffect, createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { createStore } from \"solid-js/store\";\nimport { Checkbox } from \"../inputs/Checkbox\";\nimport { PinInput } from \"../inputs/ChoiceInputs\";\nimport { DatePicker, DateTimePicker } from \"../inputs/DatePicker\";\nimport { ImageInput } from \"../inputs/FileInputs\";\nimport { NumberInput } from \"../inputs/NumberInput\";\nimport { Select } from \"../inputs/Select\";\nimport { resolveSelectMessages } from \"../inputs/select-messages\";\nimport { TagsInput } from \"../inputs/TagsInput\";\nimport { TextInput } from \"../inputs/TextInput\";\nimport { KeyedFor } from \"../internal/keyed-for\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { type DialogRender, dialogCore, type OpenDialogOptions } from \"./dialog-core\";\nimport { contentClass, DialogHeader, type PromptContent, panelClass, promptTone, sharedPrompts } from \"./prompt-confirm\";\nimport { resolvePromptMessages } from \"./prompt-messages\";\n\nexport { DialogHeader } from \"./prompt-confirm\";\n\nexport interface DialogOptions {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\";\n /** `full` fills the available viewport and becomes edge-to-edge on narrow screens. */\n size?: \"small\" | \"medium\" | \"large\" | \"wide\" | \"full\";\n surface?: \"default\" | \"bare\";\n header?: false;\n cancelBehavior?: OpenDialogOptions[\"cancelBehavior\"];\n /** Back closes the prompt like Cancel, as in a phone app; see `OpenDialogOptions.history`. */\n history?: boolean;\n}\n\nexport interface ConfirmOptions extends DialogOptions {\n confirmationPhrase?: string;\n}\n\nexport type PromptSearchItem<T = unknown> = {\n /**\n * Stable identity of the result, such as its record ID. With it, a newer answer that contains the same result keeps\n * its row, so a click in progress still lands. Without it, each answer replaces the rows.\n */\n id?: string;\n label: string;\n desc?: string;\n icon?: string;\n previewUrl?: string;\n value?: T;\n};\n\nexport type PromptSearchInput = {\n query: string;\n abortSignal: AbortSignal;\n};\n\nexport type PromptSearchOptions = DialogOptions & {\n placeholder?: string;\n icon?: string;\n initialQuery?: string;\n minQueryLength?: number;\n debounceMs?: number;\n emptyText?: string;\n noResultsText?: string;\n};\n\nexport type PromptFieldBase<T = any> = {\n label?: string | false;\n description?: string;\n placeholder?: string;\n required?: boolean;\n default?: T;\n validate?: (value: T | undefined) => string | null;\n};\n\nexport type FieldSchema =\n | (PromptFieldBase<string> & {\n type: \"text\";\n multiline?: boolean;\n lines?: number;\n maxLength?: number;\n minLength?: number;\n icon?: string;\n activeIcon?: string;\n password?: boolean;\n markdown?: boolean;\n })\n | (PromptFieldBase<number> & {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n })\n | (PromptFieldBase<string> & {\n type: \"image\";\n round?: boolean;\n ariaLabel?: string;\n accept?: string;\n })\n | (PromptFieldBase<string> & {\n type: \"pin\";\n length?: number;\n stretch?: boolean;\n })\n | (PromptFieldBase<string> & {\n type: \"select\";\n options: string[] | { id: string; label?: string; description?: string; icon?: string }[];\n icon?: string;\n activeIcon?: string;\n clearable?: boolean;\n })\n | (PromptFieldBase<string[]> & {\n type: \"tags\";\n maxTags?: number;\n minTags?: number;\n icon?: string;\n activeIcon?: string;\n })\n | (PromptFieldBase<boolean> & {\n type: \"boolean\";\n })\n | (PromptFieldBase<string> & {\n type: \"datetime\";\n dateOnly?: boolean;\n /** A date whose time is optional, as `DateTimePicker`'s `optionalTime`. */\n optionalTime?: boolean;\n })\n | {\n type: \"info\";\n content: string | JSX.Element | (() => JSX.Element);\n };\n\ntype InferFieldType<T extends FieldSchema> = T extends { type: \"text\" }\n ? string\n : T extends { type: \"number\" }\n ? number\n : T extends { type: \"image\" }\n ? string\n : T extends { type: \"pin\" }\n ? string\n : T extends { type: \"select\" }\n ? string\n : T extends { type: \"tags\" }\n ? string[]\n : T extends { type: \"boolean\" }\n ? boolean\n : T extends { type: \"datetime\" }\n ? string\n : T extends { type: \"currency\" }\n ? number\n : T extends { type: \"info\" }\n ? never\n : never;\n\ntype InferFormValues<T extends Record<string, FieldSchema>> = {\n [K in keyof T as T[K] extends { type: \"info\" } ? never : K]: T[K] extends { required: true }\n ? InferFieldType<T[K]>\n : InferFieldType<T[K]> | undefined;\n};\n\ntype PromptFormValue = string | number | boolean | string[] | undefined;\ntype PromptFormOptions<T extends Record<string, FieldSchema>> = {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n fields: T;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\";\n size?: DialogOptions[\"size\"];\n cancelBehavior?: DialogOptions[\"cancelBehavior\"];\n};\n\nconst isEmpty = (value: unknown): boolean =>\n value === undefined || value === null || value === \"\" || (Array.isArray(value) && value.length === 0);\n\nexport const createFormState = <T extends Record<string, FieldSchema>>(schema: T) => {\n const messages = resolveUiMessages();\n const promptMessages = resolvePromptMessages();\n const [values, setValues] = createStore<Record<string, PromptFormValue>>({});\n const [errors, setErrors] = createStore<Record<string, string | undefined>>({});\n // Errors appear with the first submit and then follow every change. Before that, a check that fails mid-input,\n // such as a URL still being typed, would interrupt the user with an alert on the first character.\n let submitted = false;\n\n for (const [key, field] of Object.entries(schema)) {\n if (field.type !== \"info\" && \"default\" in field) setValues(key, field.default as PromptFormValue);\n }\n\n const validateField = (key: string, value: PromptFormValue): string | null => {\n const field = schema[key];\n if (!field || field.type === \"info\") return null;\n if (field.type === \"boolean\" && field.required && value !== true) return messages.required;\n if (field.required && isEmpty(value)) return messages.required;\n if (\"validate\" in field && field.validate) {\n const customError = (field.validate as (next: never) => string | null)(value as never);\n if (customError) return customError;\n }\n if (field.type === \"text\" && typeof value === \"string\" && value.length > 0) {\n if (field.minLength !== undefined && value.length < field.minLength) return promptMessages.minCharacters({ count: field.minLength });\n if (field.maxLength !== undefined && value.length > field.maxLength) return promptMessages.maxCharacters({ count: field.maxLength });\n }\n if (field.type === \"tags\" && Array.isArray(value) && value.length > 0) {\n if (field.minTags !== undefined && value.length < field.minTags) return promptMessages.minTags({ count: field.minTags });\n if (field.maxTags !== undefined && value.length > field.maxTags) return promptMessages.maxTags({ count: field.maxTags });\n }\n return null;\n };\n\n const updateField = (key: string, value: PromptFormValue) => {\n setValues(key, value);\n if (submitted) setErrors(key, validateField(key, value) ?? undefined);\n };\n\n const validateAll = (): boolean => {\n submitted = true;\n let valid = true;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n const error = validateField(key, values[key]);\n setErrors(key, error ?? undefined);\n if (error) valid = false;\n }\n return valid;\n };\n\n const reset = () => {\n submitted = false;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n setValues(key, \"default\" in field ? (field.default as PromptFormValue) : undefined);\n setErrors(key, undefined);\n }\n };\n\n return { values, errors, updateField, validateAll, reset };\n};\n\nconst renderInfo = (content: Extract<FieldSchema, { type: \"info\" }>[\"content\"]): JSX.Element => {\n if (typeof content === \"string\") return <p>{content}</p>;\n if (typeof content === \"function\") return content();\n return content;\n};\n\nconst PromptControl = (props: {\n field: Exclude<FieldSchema, { type: \"info\" }>;\n value: () => PromptFormValue;\n update: (value: PromptFormValue) => void;\n error: () => string | undefined;\n submit: () => void;\n}): JSX.Element => {\n const label = props.field.label || undefined;\n\n switch (props.field.type) {\n case \"text\":\n return (\n <TextInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={String(props.value() ?? \"\")}\n onValueChange={(value) => props.update(value ?? undefined)}\n onSubmit={props.submit}\n multiline={props.field.multiline}\n lines={props.field.lines}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n password={props.field.password}\n markdown={props.field.markdown}\n minLength={props.field.minLength}\n maxLength={props.field.maxLength}\n />\n );\n case \"number\":\n return (\n <NumberInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={typeof props.value() === \"number\" ? (props.value() as number) : null}\n onValueChange={(value) => props.update(value ?? undefined)}\n min={props.field.min}\n max={props.field.max}\n step={props.field.step}\n />\n );\n case \"image\":\n return (\n <ImageInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n round={props.field.round}\n aria-label={props.field.ariaLabel}\n accept={props.field.accept}\n />\n );\n case \"pin\":\n return (\n <PinInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => String(props.value() ?? \"\")}\n onValueChange={props.update}\n length={props.field.length}\n stretch={props.field.stretch}\n />\n );\n case \"select\":\n return (\n <Select\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n options={props.field.options}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n clearable={props.field.clearable}\n />\n );\n case \"tags\":\n return (\n <TagsInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (Array.isArray(props.value()) ? (props.value() as string[]) : [])}\n onValueChange={props.update}\n maxTags={props.field.maxTags}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n />\n );\n case \"boolean\":\n return (\n <Checkbox\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => Boolean(props.value())}\n onValueChange={props.update}\n />\n );\n case \"datetime\": {\n const pickerProps = {\n label,\n description: props.field.description,\n required: props.field.required,\n placeholder: props.field.placeholder,\n error: props.error,\n value: () => (typeof props.value() === \"string\" ? (props.value() as string) : null),\n onValueChange: (value: string | null) => props.update(value ?? \"\"),\n clearable: true,\n };\n return props.field.dateOnly ? (\n <DatePicker {...pickerProps} />\n ) : (\n <DateTimePicker {...pickerProps} optionalTime={props.field.optionalTime} />\n );\n }\n }\n};\n\nconst PromptFormDialog = <T extends Record<string, FieldSchema>>(props: {\n config: PromptFormOptions<T>;\n close: (value: InferFormValues<T> | null) => void;\n}): JSX.Element => {\n const state = createFormState(props.config.fields);\n const submit = () => {\n if (state.validateAll()) props.close(state.values as InferFormValues<T>);\n };\n const handleSubmit = (event: SubmitEvent) => {\n event.preventDefault();\n submit();\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={handleSubmit}>\n <DialogHeader\n title={props.config.title}\n icon={props.config.icon}\n tone={promptTone(props.config.variant)}\n close={() => props.close(null)}\n />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <For each={Object.entries(props.config.fields)}>\n {([key, field]) => {\n if (field.type === \"info\") return <div class=\"k2b-prompt-form__info\">{renderInfo(field.content)}</div>;\n return (\n <PromptControl\n field={field}\n value={() => state.values[key]}\n update={(value) => state.updateField(key, value)}\n error={() => state.errors[key]}\n submit={submit}\n />\n );\n }}\n </For>\n </div>\n <footer class=\"k2b-dialog__actions\">\n <Show when={props.config.cancelText !== false}>\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => props.close(null)}>\n {props.config.cancelText || resolveUiMessages().cancel}\n </button>\n </Show>\n <button type=\"submit\" class=\"k2b-button\" data-variant={props.config.variant ?? \"primary\"}>\n {props.config.confirmText ?? resolveUiMessages().save}\n </button>\n </footer>\n </form>\n );\n};\n\n// Results without an ID keep today's behavior: each object is its own identity, so a new answer replaces the row.\nconst anonymousRows = new WeakMap<object, string>();\nlet anonymousRow = 0;\nconst searchRowIdentity = (item: PromptSearchItem<unknown>): string => {\n if (item.id !== undefined) return `id:${item.id}`;\n const known = anonymousRows.get(item);\n if (known !== undefined) return known;\n const key = `object:${anonymousRow++}`;\n anonymousRows.set(item, key);\n return key;\n};\n\ntype CloudSearchResolver<T> = (input: PromptSearchInput) => Promise<PromptSearchItem<T>[]> | PromptSearchItem<T>[];\n\nconst openSearchPrompt = <T extends unknown = unknown>(resolver: CloudSearchResolver<T>, options?: PromptSearchOptions) =>\n dialogCore.open<PromptSearchItem<T>>(\n (close) => {\n const [query, setQuery] = createSignal(options?.initialQuery ?? \"\");\n const [items, setItems] = createSignal<PromptSearchItem<T>[]>([]);\n const [activeIndex, setActiveIndex] = createSignal(0);\n const [hasLoaded, setHasLoaded] = createSignal(false);\n const [failedPreviews, setFailedPreviews] = createStore<Record<number, true>>({});\n const [activeSearchQuery, setActiveSearchQuery] = createSignal(\"\");\n const rowRefs = new Map<number, HTMLButtonElement>();\n const searchId = `k2b-prompt-search-${createUniqueId()}`;\n const listboxId = `${searchId}-listbox`;\n const optionId = (index: number) => `${searchId}-option-${index}`;\n\n const minQueryLength = options?.minQueryLength ?? 0;\n const debounceMs = options?.debounceMs ?? 180;\n const searchMutation = mutation.create<{ query: string; items: PromptSearchItem<T>[] }, string, { requestQuery: string }>({\n onBefore: (requestQuery) => ({ requestQuery }),\n mutation: async (requestQuery, context) => {\n const result = await resolver({\n query: requestQuery,\n abortSignal: context.abortSignal,\n });\n return { query: requestQuery, items: (result ?? []).slice() };\n },\n onSuccess: (result, context) => {\n if (!context || context.requestQuery !== activeSearchQuery()) return;\n setItems(result.items);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n onError: (error, context) => {\n if (!context || context.requestQuery !== activeSearchQuery() || error.name === \"AbortError\") return;\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n });\n const searchError = createMemo(() => {\n const error = searchMutation.error();\n if (!error || error.name === \"AbortError\") return null;\n return error.message || resolvePromptMessages().searchFailed;\n });\n const shouldShowResults = createMemo(() => {\n if (query().trim().length < minQueryLength) return false;\n return hasLoaded() || searchError() !== null || items().length > 0;\n });\n const emptyStateText = createMemo(() => {\n if (!hasLoaded()) return options?.emptyText ?? resolveSelectMessages().typeToSearch;\n return options?.noResultsText ?? resolveUiMessages().noResults;\n });\n const { debouncedFn: debounceSearch, cancel: cancelDebounce } = timed.debounce((nextQuery: string) => {\n setActiveSearchQuery(nextQuery);\n searchMutation.abort();\n void searchMutation.mutate(nextQuery);\n }, debounceMs);\n\n const execute = (item?: PromptSearchItem<T>) => {\n if (!item) return;\n close(item);\n };\n const moveSelection = (delta: -1 | 1) => {\n const list = items();\n if (list.length === 0) return;\n setActiveIndex((activeIndex() + delta + list.length) % list.length);\n };\n\n createEffect(() => {\n const list = items();\n const maxIndex = list.length - 1;\n if (maxIndex < 0) {\n setActiveIndex(0);\n return;\n }\n if (activeIndex() > maxIndex) setActiveIndex(maxIndex);\n rowRefs.get(activeIndex())?.scrollIntoView({ block: \"nearest\" });\n });\n createEffect(() => {\n const nextQuery = query().trim();\n setFailedPreviews({});\n if (nextQuery.length < minQueryLength) {\n cancelDebounce();\n searchMutation.abort();\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(false);\n setActiveSearchQuery(\"\");\n return;\n }\n debounceSearch(nextQuery);\n });\n onCleanup(() => {\n cancelDebounce();\n searchMutation.abort();\n });\n\n return (\n <div class=\"k2b-prompt-search-shell\">\n <Show when={options?.title}>{(title) => <p class=\"k2b-prompt-search-shell__title\">{title()}</p>}</Show>\n <div class=\"k2b-prompt-search\">\n <label class=\"k2b-prompt-search__input\">\n <i class={options?.icon ?? \"ti ti-search\"} aria-hidden=\"true\" />\n <input\n id={searchId}\n type=\"search\"\n role=\"combobox\"\n aria-label={options?.ariaLabel ?? options?.title ?? resolveUiMessages().search}\n aria-autocomplete=\"list\"\n aria-controls={listboxId}\n aria-expanded={shouldShowResults()}\n aria-activedescendant={shouldShowResults() && items().length > 0 ? optionId(activeIndex()) : undefined}\n aria-busy={searchMutation.loading()}\n value={query()}\n onInput={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n moveSelection(1);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n moveSelection(-1);\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n execute(items()[activeIndex()]);\n }\n }}\n placeholder={options?.placeholder ?? resolveUiMessages().search}\n spellcheck={false}\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n />\n <Show when={searchMutation.loading()}>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n </Show>\n </label>\n <div\n class=\"k2b-prompt-search__collapse\"\n style={{\n height: shouldShowResults() ? \"var(--k2b-search-body-max)\" : \"0px\",\n opacity: shouldShowResults() ? \"1\" : \"0\",\n }}\n >\n <div class=\"k2b-prompt-search__results\" onWheel={(event) => event.stopPropagation()}>\n <Show when={searchError()}>\n {(message) => (\n <div class=\"k2b-prompt-search__error\" role=\"status\" aria-live=\"polite\">\n {message()}\n </div>\n )}\n </Show>\n <Show\n when={items().length > 0}\n fallback={\n <p role=\"status\" aria-live=\"polite\">\n {emptyStateText()}\n </p>\n }\n >\n <div id={listboxId} class=\"k2b-prompt-search__list\" role=\"listbox\" aria-label={resolveUiMessages().searchResults}>\n <KeyedFor each={items()} by={searchRowIdentity}>\n {(item, index) => (\n <button\n ref={(element) => {\n if (!element) rowRefs.delete(index());\n else rowRefs.set(index(), element);\n }}\n type=\"button\"\n id={optionId(index())}\n role=\"option\"\n aria-selected={activeIndex() === index()}\n data-active={activeIndex() === index() ? \"true\" : undefined}\n data-has-description={item().desc ? \"true\" : undefined}\n onMouseEnter={() => setActiveIndex(index())}\n onClick={() => execute(item())}\n >\n {/* Cloud keeps the preview box mounted once a row declares an image, so a\n failed load swaps in the fallback glyph instead of collapsing the row. */}\n <Show when={item().previewUrl?.startsWith(\"/\") || item().icon}>\n <span class=\"k2b-prompt-search__preview\">\n <Show\n when={item().previewUrl?.startsWith(\"/\") && !failedPreviews[index()]}\n fallback={<i class={item().icon ?? \"ti ti-file\"} aria-hidden=\"true\" />}\n >\n <img src={item().previewUrl} alt=\"\" onError={() => setFailedPreviews(index(), true)} />\n </Show>\n </span>\n </Show>\n <span class=\"k2b-prompt-search__copy\">\n <strong>{item().label}</strong>\n <Show when={item().desc}>{(description) => <small>{description()}</small>}</Show>\n </span>\n </button>\n )}\n </KeyedFor>\n </div>\n </Show>\n </div>\n </div>\n </div>\n </div>\n );\n },\n {\n panelClassName: \"k2b-dialog k2b-dialog--search is-bare\",\n contentClassName: \"k2b-dialog__viewport is-search\",\n initialFocus: \"first-input\",\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().search,\n },\n );\n\nconst promptText = (content: string, defaultValue?: string, options?: DialogOptions) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"text\",\n label: false,\n default: defaultValue || \"\",\n },\n },\n })\n .then((result) => result?.value ?? null);\n\nconst promptNumber = (\n content: string,\n defaultValue?: number,\n options?: DialogOptions & {\n min?: number;\n max?: number;\n },\n) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"number\",\n label: false,\n default: defaultValue || 0,\n min: options?.min,\n max: options?.max,\n },\n },\n })\n .then((result) => result?.value ?? null);\n\n// The same object as `sharedPrompts`, which `PanelDialog` uses for its discard question: replacing `prompts.confirm`\n// (for example in a test) therefore reaches every confirmation.\nexport const prompts = Object.assign(sharedPrompts, {\n alert: (content: PromptContent, options?: DialogOptions): Promise<void | undefined> =>\n dialogCore.open<void>(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader\n title={options?.title || resolveUiMessages().info}\n icon={options?.icon}\n tone={promptTone(options?.variant)}\n close={() => close()}\n />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant={options?.variant ?? \"primary\"} onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().ok}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().info,\n },\n ),\n\n success: (content: PromptContent, options?: Omit<DialogOptions, \"variant\">): Promise<void | undefined> =>\n prompts.alert(content, {\n ...options,\n variant: \"success\",\n title: options?.title ?? resolveUiMessages().success,\n }),\n\n prompt: promptText,\n promptNumber,\n\n form: async <T extends Record<string, FieldSchema>>(config: PromptFormOptions<T>): Promise<InferFormValues<T> | null> =>\n (await dialogCore.open<InferFormValues<T> | null>((close) => <PromptFormDialog config={config} close={(value) => close(value)} />, {\n panelClassName: panelClass(config),\n contentClassName: contentClass(),\n signal: config.signal,\n cancelBehavior: config.cancelBehavior,\n ariaLabel: config.ariaLabel ?? config.title ?? resolvePromptMessages().form,\n })) ?? null,\n\n /**\n * Open custom content with a typed close callback and the dialog render context.\n * Register a dismiss handler to guard Escape, backdrop clicks and the supplied header's close button,\n * for example while saving. Explicit close(result) bypasses the guard. Without a handler, dismissal\n * keeps its existing behavior, including a header close button independent of cancelBehavior.\n */\n dialog: <T extends unknown = unknown>(component: DialogRender<T>, options?: DialogOptions): Promise<T | undefined> =>\n dialogCore.open<T>(\n (close, context) => {\n // A dismiss handler the component sets guards the header's close button as well as Escape and the backdrop.\n let dismiss = () => close(undefined);\n const body = component(close, {\n ...context,\n setDismissHandler: (handler) => {\n context.setDismissHandler(handler);\n dismiss = () => void context.requestDismiss();\n },\n });\n if (options?.surface === \"bare\" && options.header === false) return body;\n return (\n <div class=\"k2b-dialog__panel k2b-dialog__stack\">\n <Show when={options?.header !== false}>\n <DialogHeader title={options?.title} icon={options?.icon} tone={promptTone(options?.variant)} close={() => dismiss()} />\n </Show>\n <div class=\"k2b-dialog__content\">{body}</div>\n </div>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().dialog,\n },\n ),\n\n search: openSearchPrompt,\n\n error: (content: string | HTMLElement, options?: DialogOptions) =>\n dialogCore.open(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title ?? resolveUiMessages().error} icon={options?.icon} tone=\"danger\" close={close} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().close}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass({ ...options, variant: \"danger\" }),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().error,\n },\n ),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AK,EAAE;IAAK;IAAA,iBAClF,OAAO;IAAA,iBAEc,MAAM,KAAK,CAAC,CAAC;IAAA,uBAC5D,OAAO,EAAE,WAAW,IAAI,iBAAiB,CAAC,CAAC,CAAC,KAAK;IAAA;IAAA;EAAA,IAIzD,EACD;IACE,cAAc,EAAE,UAAU,CAAC;MAAE,GAAG,OAAO;MAAE,OAAO,EAAE;IAAS,CAAC,CAAC;IAC7D,gBAAgB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,MAAM,EAAE,OAAO,EAAE,MAAM;IACvB,cAAc,EAAE,OAAO,EAAE,cAAc;IACvC,OAAO,EAAE,OAAO,EAAE,OAAO;IACzB,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,KAAK,IAAI,iBAAiB,CAAC,CAAC,CAAC;EACzE,CACF;AACJ,CAAC,CAAC;AAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["feedback/prompts.tsx"],"sourcesContent":["import { mutation, timed } from \"@k2b/stdlib/solid\";\nimport { createEffect, createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { createStore } from \"solid-js/store\";\nimport { Checkbox } from \"../inputs/Checkbox\";\nimport { PinInput } from \"../inputs/ChoiceInputs\";\nimport { DatePicker, DateTimePicker } from \"../inputs/DatePicker\";\nimport { ImageInput } from \"../inputs/FileInputs\";\nimport { NumberInput } from \"../inputs/NumberInput\";\nimport { Select } from \"../inputs/Select\";\nimport { resolveSelectMessages } from \"../inputs/select-messages\";\nimport { TagsInput } from \"../inputs/TagsInput\";\nimport { TextInput } from \"../inputs/TextInput\";\nimport { KeyedFor } from \"../internal/keyed-for\";\nimport { resolveUiMessages } from \"../intl/messages\";\nimport { type DialogRender, dialogCore, type OpenDialogOptions } from \"./dialog-core\";\nimport {\n contentClass,\n DialogHeader,\n type PromptContent,\n panelClass,\n promptButtonVariant,\n promptTone,\n sharedPrompts,\n} from \"./prompt-confirm\";\nimport { resolvePromptMessages } from \"./prompt-messages\";\n\nexport { DialogHeader } from \"./prompt-confirm\";\n\nexport interface DialogOptions {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\" | \"warning\";\n /** `full` fills the available viewport and becomes edge-to-edge on narrow screens. */\n size?: \"small\" | \"medium\" | \"large\" | \"wide\" | \"full\";\n surface?: \"default\" | \"bare\";\n header?: false;\n cancelBehavior?: OpenDialogOptions[\"cancelBehavior\"];\n /** Back closes the prompt like Cancel, as in a phone app; see `OpenDialogOptions.history`. */\n history?: boolean;\n}\n\nexport interface ConfirmOptions extends DialogOptions {\n confirmationPhrase?: string;\n}\n\nexport type PromptSearchItem<T = unknown> = {\n /**\n * Stable identity of the result, such as its record ID. With it, a newer answer that contains the same result keeps\n * its row, so a click in progress still lands. Without it, each answer replaces the rows.\n */\n id?: string;\n label: string;\n desc?: string;\n icon?: string;\n previewUrl?: string;\n value?: T;\n};\n\nexport type PromptSearchInput = {\n query: string;\n abortSignal: AbortSignal;\n};\n\nexport type PromptSearchOptions = DialogOptions & {\n placeholder?: string;\n icon?: string;\n initialQuery?: string;\n minQueryLength?: number;\n debounceMs?: number;\n emptyText?: string;\n noResultsText?: string;\n};\n\nexport type PromptFieldBase<T = any> = {\n label?: string | false;\n description?: string;\n placeholder?: string;\n required?: boolean;\n default?: T;\n validate?: (value: T | undefined) => string | null;\n};\n\nexport type FieldSchema =\n | (PromptFieldBase<string> & {\n type: \"text\";\n multiline?: boolean;\n lines?: number;\n maxLength?: number;\n minLength?: number;\n icon?: string;\n activeIcon?: string;\n password?: boolean;\n markdown?: boolean;\n })\n | (PromptFieldBase<number> & {\n type: \"number\";\n min?: number;\n max?: number;\n step?: number;\n })\n | (PromptFieldBase<string> & {\n type: \"image\";\n round?: boolean;\n ariaLabel?: string;\n accept?: string;\n })\n | (PromptFieldBase<string> & {\n type: \"pin\";\n length?: number;\n stretch?: boolean;\n })\n | (PromptFieldBase<string> & {\n type: \"select\";\n options: string[] | { id: string; label?: string; description?: string; icon?: string }[];\n icon?: string;\n activeIcon?: string;\n clearable?: boolean;\n })\n | (PromptFieldBase<string[]> & {\n type: \"tags\";\n maxTags?: number;\n minTags?: number;\n icon?: string;\n activeIcon?: string;\n })\n | (PromptFieldBase<boolean> & {\n type: \"boolean\";\n })\n | (PromptFieldBase<string> & {\n type: \"datetime\";\n dateOnly?: boolean;\n /** A date whose time is optional, as `DateTimePicker`'s `optionalTime`. */\n optionalTime?: boolean;\n })\n | {\n type: \"info\";\n content: string | JSX.Element | (() => JSX.Element);\n };\n\ntype InferFieldType<T extends FieldSchema> = T extends { type: \"text\" }\n ? string\n : T extends { type: \"number\" }\n ? number\n : T extends { type: \"image\" }\n ? string\n : T extends { type: \"pin\" }\n ? string\n : T extends { type: \"select\" }\n ? string\n : T extends { type: \"tags\" }\n ? string[]\n : T extends { type: \"boolean\" }\n ? boolean\n : T extends { type: \"datetime\" }\n ? string\n : T extends { type: \"currency\" }\n ? number\n : T extends { type: \"info\" }\n ? never\n : never;\n\ntype InferFormValues<T extends Record<string, FieldSchema>> = {\n [K in keyof T as T[K] extends { type: \"info\" } ? never : K]: T[K] extends { required: true }\n ? InferFieldType<T[K]>\n : InferFieldType<T[K]> | undefined;\n};\n\ntype PromptFormValue = string | number | boolean | string[] | undefined;\ntype PromptFormOptions<T extends Record<string, FieldSchema>> = {\n signal?: AbortSignal;\n title?: string;\n ariaLabel?: string;\n icon?: string;\n fields: T;\n confirmText?: string;\n cancelText?: string | false;\n variant?: \"danger\" | \"primary\" | \"success\" | \"warning\";\n size?: DialogOptions[\"size\"];\n cancelBehavior?: DialogOptions[\"cancelBehavior\"];\n};\n\nconst isEmpty = (value: unknown): boolean =>\n value === undefined || value === null || value === \"\" || (Array.isArray(value) && value.length === 0);\n\nexport const createFormState = <T extends Record<string, FieldSchema>>(schema: T) => {\n const messages = resolveUiMessages();\n const promptMessages = resolvePromptMessages();\n const [values, setValues] = createStore<Record<string, PromptFormValue>>({});\n const [errors, setErrors] = createStore<Record<string, string | undefined>>({});\n // Errors appear with the first submit and then follow every change. Before that, a check that fails mid-input,\n // such as a URL still being typed, would interrupt the user with an alert on the first character.\n let submitted = false;\n\n for (const [key, field] of Object.entries(schema)) {\n if (field.type !== \"info\" && \"default\" in field) setValues(key, field.default as PromptFormValue);\n }\n\n const validateField = (key: string, value: PromptFormValue): string | null => {\n const field = schema[key];\n if (!field || field.type === \"info\") return null;\n if (field.type === \"boolean\" && field.required && value !== true) return messages.required;\n if (field.required && isEmpty(value)) return messages.required;\n if (\"validate\" in field && field.validate) {\n const customError = (field.validate as (next: never) => string | null)(value as never);\n if (customError) return customError;\n }\n if (field.type === \"text\" && typeof value === \"string\" && value.length > 0) {\n if (field.minLength !== undefined && value.length < field.minLength) return promptMessages.minCharacters({ count: field.minLength });\n if (field.maxLength !== undefined && value.length > field.maxLength) return promptMessages.maxCharacters({ count: field.maxLength });\n }\n if (field.type === \"tags\" && Array.isArray(value) && value.length > 0) {\n if (field.minTags !== undefined && value.length < field.minTags) return promptMessages.minTags({ count: field.minTags });\n if (field.maxTags !== undefined && value.length > field.maxTags) return promptMessages.maxTags({ count: field.maxTags });\n }\n return null;\n };\n\n const updateField = (key: string, value: PromptFormValue) => {\n setValues(key, value);\n if (submitted) setErrors(key, validateField(key, value) ?? undefined);\n };\n\n const validateAll = (): boolean => {\n submitted = true;\n let valid = true;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n const error = validateField(key, values[key]);\n setErrors(key, error ?? undefined);\n if (error) valid = false;\n }\n return valid;\n };\n\n const reset = () => {\n submitted = false;\n for (const [key, field] of Object.entries(schema)) {\n if (field.type === \"info\") continue;\n setValues(key, \"default\" in field ? (field.default as PromptFormValue) : undefined);\n setErrors(key, undefined);\n }\n };\n\n return { values, errors, updateField, validateAll, reset };\n};\n\nconst renderInfo = (content: Extract<FieldSchema, { type: \"info\" }>[\"content\"]): JSX.Element => {\n if (typeof content === \"string\") return <p>{content}</p>;\n if (typeof content === \"function\") return content();\n return content;\n};\n\nconst PromptControl = (props: {\n field: Exclude<FieldSchema, { type: \"info\" }>;\n value: () => PromptFormValue;\n update: (value: PromptFormValue) => void;\n error: () => string | undefined;\n submit: () => void;\n}): JSX.Element => {\n const label = props.field.label || undefined;\n\n switch (props.field.type) {\n case \"text\":\n return (\n <TextInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={String(props.value() ?? \"\")}\n onValueChange={(value) => props.update(value ?? undefined)}\n onSubmit={props.submit}\n multiline={props.field.multiline}\n lines={props.field.lines}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n password={props.field.password}\n markdown={props.field.markdown}\n minLength={props.field.minLength}\n maxLength={props.field.maxLength}\n />\n );\n case \"number\":\n return (\n <NumberInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={typeof props.value() === \"number\" ? (props.value() as number) : null}\n onValueChange={(value) => props.update(value ?? undefined)}\n min={props.field.min}\n max={props.field.max}\n step={props.field.step}\n />\n );\n case \"image\":\n return (\n <ImageInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n round={props.field.round}\n aria-label={props.field.ariaLabel}\n accept={props.field.accept}\n />\n );\n case \"pin\":\n return (\n <PinInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => String(props.value() ?? \"\")}\n onValueChange={props.update}\n length={props.field.length}\n stretch={props.field.stretch}\n />\n );\n case \"select\":\n return (\n <Select\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (typeof props.value() === \"string\" ? (props.value() as string) : null)}\n onValueChange={(value) => props.update(value ?? undefined)}\n options={props.field.options}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n clearable={props.field.clearable}\n />\n );\n case \"tags\":\n return (\n <TagsInput\n label={label}\n description={props.field.description}\n required={props.field.required}\n placeholder={props.field.placeholder}\n error={props.error}\n value={() => (Array.isArray(props.value()) ? (props.value() as string[]) : [])}\n onValueChange={props.update}\n maxTags={props.field.maxTags}\n icon={props.field.icon}\n activeIcon={props.field.activeIcon}\n />\n );\n case \"boolean\":\n return (\n <Checkbox\n label={label}\n description={props.field.description}\n required={props.field.required}\n error={props.error}\n value={() => Boolean(props.value())}\n onValueChange={props.update}\n />\n );\n case \"datetime\": {\n const pickerProps = {\n label,\n description: props.field.description,\n required: props.field.required,\n placeholder: props.field.placeholder,\n error: props.error,\n value: () => (typeof props.value() === \"string\" ? (props.value() as string) : null),\n onValueChange: (value: string | null) => props.update(value ?? \"\"),\n clearable: true,\n };\n return props.field.dateOnly ? (\n <DatePicker {...pickerProps} />\n ) : (\n <DateTimePicker {...pickerProps} optionalTime={props.field.optionalTime} />\n );\n }\n }\n};\n\nconst PromptFormDialog = <T extends Record<string, FieldSchema>>(props: {\n config: PromptFormOptions<T>;\n close: (value: InferFormValues<T> | null) => void;\n}): JSX.Element => {\n const state = createFormState(props.config.fields);\n const submit = () => {\n if (state.validateAll()) props.close(state.values as InferFormValues<T>);\n };\n const handleSubmit = (event: SubmitEvent) => {\n event.preventDefault();\n submit();\n };\n\n return (\n <form class=\"k2b-dialog__panel\" onSubmit={handleSubmit}>\n <DialogHeader\n title={props.config.title}\n icon={props.config.icon}\n tone={promptTone(props.config.variant)}\n close={() => props.close(null)}\n />\n <div class=\"k2b-dialog__body k2b-prompt-form\">\n <For each={Object.entries(props.config.fields)}>\n {([key, field]) => {\n if (field.type === \"info\") return <div class=\"k2b-prompt-form__info\">{renderInfo(field.content)}</div>;\n return (\n <PromptControl\n field={field}\n value={() => state.values[key]}\n update={(value) => state.updateField(key, value)}\n error={() => state.errors[key]}\n submit={submit}\n />\n );\n }}\n </For>\n </div>\n <footer class=\"k2b-dialog__actions\">\n <Show when={props.config.cancelText !== false}>\n <button type=\"button\" class=\"k2b-button\" data-variant=\"secondary\" onClick={() => props.close(null)}>\n {props.config.cancelText || resolveUiMessages().cancel}\n </button>\n </Show>\n <button type=\"submit\" class=\"k2b-button\" data-variant={promptButtonVariant(props.config.variant)}>\n {props.config.confirmText ?? resolveUiMessages().save}\n </button>\n </footer>\n </form>\n );\n};\n\n// Results without an ID keep today's behavior: each object is its own identity, so a new answer replaces the row.\nconst anonymousRows = new WeakMap<object, string>();\nlet anonymousRow = 0;\nconst searchRowIdentity = (item: PromptSearchItem<unknown>): string => {\n if (item.id !== undefined) return `id:${item.id}`;\n const known = anonymousRows.get(item);\n if (known !== undefined) return known;\n const key = `object:${anonymousRow++}`;\n anonymousRows.set(item, key);\n return key;\n};\n\ntype CloudSearchResolver<T> = (input: PromptSearchInput) => Promise<PromptSearchItem<T>[]> | PromptSearchItem<T>[];\n\nconst openSearchPrompt = <T extends unknown = unknown>(resolver: CloudSearchResolver<T>, options?: PromptSearchOptions) =>\n dialogCore.open<PromptSearchItem<T>>(\n (close) => {\n const [query, setQuery] = createSignal(options?.initialQuery ?? \"\");\n const [items, setItems] = createSignal<PromptSearchItem<T>[]>([]);\n const [activeIndex, setActiveIndex] = createSignal(0);\n const [hasLoaded, setHasLoaded] = createSignal(false);\n const [failedPreviews, setFailedPreviews] = createStore<Record<number, true>>({});\n const [activeSearchQuery, setActiveSearchQuery] = createSignal(\"\");\n const rowRefs = new Map<number, HTMLButtonElement>();\n const searchId = `k2b-prompt-search-${createUniqueId()}`;\n const listboxId = `${searchId}-listbox`;\n const optionId = (index: number) => `${searchId}-option-${index}`;\n\n const minQueryLength = options?.minQueryLength ?? 0;\n const debounceMs = options?.debounceMs ?? 180;\n const searchMutation = mutation.create<{ query: string; items: PromptSearchItem<T>[] }, string, { requestQuery: string }>({\n onBefore: (requestQuery) => ({ requestQuery }),\n mutation: async (requestQuery, context) => {\n const result = await resolver({\n query: requestQuery,\n abortSignal: context.abortSignal,\n });\n return { query: requestQuery, items: (result ?? []).slice() };\n },\n onSuccess: (result, context) => {\n if (!context || context.requestQuery !== activeSearchQuery()) return;\n setItems(result.items);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n onError: (error, context) => {\n if (!context || context.requestQuery !== activeSearchQuery() || error.name === \"AbortError\") return;\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(true);\n },\n });\n const searchError = createMemo(() => {\n const error = searchMutation.error();\n if (!error || error.name === \"AbortError\") return null;\n return error.message || resolvePromptMessages().searchFailed;\n });\n const shouldShowResults = createMemo(() => {\n if (query().trim().length < minQueryLength) return false;\n return hasLoaded() || searchError() !== null || items().length > 0;\n });\n const emptyStateText = createMemo(() => {\n if (!hasLoaded()) return options?.emptyText ?? resolveSelectMessages().typeToSearch;\n return options?.noResultsText ?? resolveUiMessages().noResults;\n });\n const { debouncedFn: debounceSearch, cancel: cancelDebounce } = timed.debounce((nextQuery: string) => {\n setActiveSearchQuery(nextQuery);\n searchMutation.abort();\n void searchMutation.mutate(nextQuery);\n }, debounceMs);\n\n const execute = (item?: PromptSearchItem<T>) => {\n if (!item) return;\n close(item);\n };\n const moveSelection = (delta: -1 | 1) => {\n const list = items();\n if (list.length === 0) return;\n setActiveIndex((activeIndex() + delta + list.length) % list.length);\n };\n\n createEffect(() => {\n const list = items();\n const maxIndex = list.length - 1;\n if (maxIndex < 0) {\n setActiveIndex(0);\n return;\n }\n if (activeIndex() > maxIndex) setActiveIndex(maxIndex);\n rowRefs.get(activeIndex())?.scrollIntoView({ block: \"nearest\" });\n });\n createEffect(() => {\n const nextQuery = query().trim();\n setFailedPreviews({});\n if (nextQuery.length < minQueryLength) {\n cancelDebounce();\n searchMutation.abort();\n setItems([]);\n setActiveIndex(0);\n setHasLoaded(false);\n setActiveSearchQuery(\"\");\n return;\n }\n debounceSearch(nextQuery);\n });\n onCleanup(() => {\n cancelDebounce();\n searchMutation.abort();\n });\n\n return (\n <div class=\"k2b-prompt-search-shell\">\n <Show when={options?.title}>{(title) => <p class=\"k2b-prompt-search-shell__title\">{title()}</p>}</Show>\n <div class=\"k2b-prompt-search\">\n <label class=\"k2b-prompt-search__input\">\n <i class={options?.icon ?? \"ti ti-search\"} aria-hidden=\"true\" />\n <input\n id={searchId}\n type=\"search\"\n role=\"combobox\"\n aria-label={options?.ariaLabel ?? options?.title ?? resolveUiMessages().search}\n aria-autocomplete=\"list\"\n aria-controls={listboxId}\n aria-expanded={shouldShowResults()}\n aria-activedescendant={shouldShowResults() && items().length > 0 ? optionId(activeIndex()) : undefined}\n aria-busy={searchMutation.loading()}\n value={query()}\n onInput={(event) => setQuery(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n moveSelection(1);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n moveSelection(-1);\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n execute(items()[activeIndex()]);\n }\n }}\n placeholder={options?.placeholder ?? resolveUiMessages().search}\n spellcheck={false}\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n />\n <Show when={searchMutation.loading()}>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n </Show>\n </label>\n <div\n class=\"k2b-prompt-search__collapse\"\n style={{\n height: shouldShowResults() ? \"var(--k2b-search-body-max)\" : \"0px\",\n opacity: shouldShowResults() ? \"1\" : \"0\",\n }}\n >\n <div class=\"k2b-prompt-search__results\" onWheel={(event) => event.stopPropagation()}>\n <Show when={searchError()}>\n {(message) => (\n <div class=\"k2b-prompt-search__error\" role=\"status\" aria-live=\"polite\">\n {message()}\n </div>\n )}\n </Show>\n <Show\n when={items().length > 0}\n fallback={\n <p role=\"status\" aria-live=\"polite\">\n {emptyStateText()}\n </p>\n }\n >\n <div id={listboxId} class=\"k2b-prompt-search__list\" role=\"listbox\" aria-label={resolveUiMessages().searchResults}>\n <KeyedFor each={items()} by={searchRowIdentity}>\n {(item, index) => (\n <button\n ref={(element) => {\n if (!element) rowRefs.delete(index());\n else rowRefs.set(index(), element);\n }}\n type=\"button\"\n id={optionId(index())}\n role=\"option\"\n aria-selected={activeIndex() === index()}\n data-active={activeIndex() === index() ? \"true\" : undefined}\n data-has-description={item().desc ? \"true\" : undefined}\n onMouseEnter={() => setActiveIndex(index())}\n onClick={() => execute(item())}\n >\n {/* Cloud keeps the preview box mounted once a row declares an image, so a\n failed load swaps in the fallback glyph instead of collapsing the row. */}\n <Show when={item().previewUrl?.startsWith(\"/\") || item().icon}>\n <span class=\"k2b-prompt-search__preview\">\n <Show\n when={item().previewUrl?.startsWith(\"/\") && !failedPreviews[index()]}\n fallback={<i class={item().icon ?? \"ti ti-file\"} aria-hidden=\"true\" />}\n >\n <img src={item().previewUrl} alt=\"\" onError={() => setFailedPreviews(index(), true)} />\n </Show>\n </span>\n </Show>\n <span class=\"k2b-prompt-search__copy\">\n <strong>{item().label}</strong>\n <Show when={item().desc}>{(description) => <small>{description()}</small>}</Show>\n </span>\n </button>\n )}\n </KeyedFor>\n </div>\n </Show>\n </div>\n </div>\n </div>\n </div>\n );\n },\n {\n panelClassName: \"k2b-dialog k2b-dialog--search is-bare\",\n contentClassName: \"k2b-dialog__viewport is-search\",\n initialFocus: \"first-input\",\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().search,\n },\n );\n\nconst promptText = (content: string, defaultValue?: string, options?: DialogOptions) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"text\",\n label: false,\n default: defaultValue || \"\",\n },\n },\n })\n .then((result) => result?.value ?? null);\n\nconst promptNumber = (\n content: string,\n defaultValue?: number,\n options?: DialogOptions & {\n min?: number;\n max?: number;\n },\n) =>\n prompts\n .form({\n ...options,\n fields: {\n message: { type: \"info\", content: () => <div class=\"k2b-prompt-copy\">{content}</div> },\n value: {\n type: \"number\",\n label: false,\n default: defaultValue || 0,\n min: options?.min,\n max: options?.max,\n },\n },\n })\n .then((result) => result?.value ?? null);\n\n// The same object as `sharedPrompts`, which `PanelDialog` uses for its discard question: replacing `prompts.confirm`\n// (for example in a test) therefore reaches every confirmation.\nexport const prompts = Object.assign(sharedPrompts, {\n alert: (content: PromptContent, options?: DialogOptions): Promise<void | undefined> =>\n dialogCore.open<void>(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader\n title={options?.title || resolveUiMessages().info}\n icon={options?.icon}\n tone={promptTone(options?.variant)}\n close={() => close()}\n />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" data-variant={promptButtonVariant(options?.variant)} onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().ok}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().info,\n },\n ),\n\n success: (content: PromptContent, options?: Omit<DialogOptions, \"variant\">): Promise<void | undefined> =>\n prompts.alert(content, {\n ...options,\n variant: \"success\",\n title: options?.title ?? resolveUiMessages().success,\n }),\n\n prompt: promptText,\n promptNumber,\n\n form: async <T extends Record<string, FieldSchema>>(config: PromptFormOptions<T>): Promise<InferFormValues<T> | null> =>\n (await dialogCore.open<InferFormValues<T> | null>((close) => <PromptFormDialog config={config} close={(value) => close(value)} />, {\n panelClassName: panelClass(config),\n contentClassName: contentClass(),\n signal: config.signal,\n cancelBehavior: config.cancelBehavior,\n ariaLabel: config.ariaLabel ?? config.title ?? resolvePromptMessages().form,\n })) ?? null,\n\n /**\n * Open custom content with a typed close callback and the dialog render context.\n * Register a dismiss handler to guard Escape, backdrop clicks and the supplied header's close button,\n * for example while saving. Explicit close(result) bypasses the guard. Without a handler, dismissal\n * keeps its existing behavior, including a header close button independent of cancelBehavior.\n */\n dialog: <T extends unknown = unknown>(component: DialogRender<T>, options?: DialogOptions): Promise<T | undefined> =>\n dialogCore.open<T>(\n (close, context) => {\n // A dismiss handler the component sets guards the header's close button as well as Escape and the backdrop.\n let dismiss = () => close(undefined);\n const body = component(close, {\n ...context,\n setDismissHandler: (handler) => {\n context.setDismissHandler(handler);\n dismiss = () => void context.requestDismiss();\n },\n });\n if (options?.surface === \"bare\" && options.header === false) return body;\n return (\n <div class=\"k2b-dialog__panel k2b-dialog__stack\">\n <Show when={options?.header !== false}>\n <DialogHeader title={options?.title} icon={options?.icon} tone={promptTone(options?.variant)} close={() => dismiss()} />\n </Show>\n <div class=\"k2b-dialog__content\">{body}</div>\n </div>\n );\n },\n {\n panelClassName: panelClass(options),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().dialog,\n },\n ),\n\n search: openSearchPrompt,\n\n error: (content: string | HTMLElement, options?: DialogOptions) =>\n dialogCore.open(\n (close) => (\n <div class=\"k2b-dialog__panel\">\n <DialogHeader title={options?.title ?? resolveUiMessages().error} icon={options?.icon} tone=\"danger\" close={close} />\n <div class=\"k2b-dialog__body\">{content}</div>\n <footer class=\"k2b-dialog__actions\">\n <button type=\"button\" class=\"k2b-button\" onClick={() => close()}>\n {options?.confirmText || resolveUiMessages().close}\n </button>\n </footer>\n </div>\n ),\n {\n panelClassName: panelClass({ ...options, variant: \"danger\" }),\n contentClassName: contentClass(options?.surface),\n signal: options?.signal,\n cancelBehavior: options?.cancelBehavior,\n history: options?.history,\n ariaLabel: options?.ariaLabel ?? options?.title ?? resolveUiMessages().error,\n },\n ),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,KAAK,QAAQ,mBAAmB;AACnD,SAAS,YAAY,EAAE,UAA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M,KAAK,CAAC,CAAC;IAAA,uBAC5D,OAAO,EAAE,WAAW,IAAI,iBAAiB,CAAC,CAAC,CAAC,KAAK;IAAA;IAAA;EAAA,IAIzD,EACD;IACE,cAAc,EAAE,UAAU,CAAC;MAAE,GAAG,OAAO;MAAE,OAAO,EAAE;IAAS,CAAC,CAAC;IAC7D,gBAAgB,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,MAAM,EAAE,OAAO,EAAE,MAAM;IACvB,cAAc,EAAE,OAAO,EAAE,cAAc;IACvC,OAAO,EAAE,OAAO,EAAE,OAAO;IACzB,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,KAAK,IAAI,iBAAiB,CAAC,CAAC,CAAC;EACzE,CACF;AACJ,CAAC,CAAC;AAAC","ignoreList":[]}
|
|
@@ -45,16 +45,26 @@ export function NumberInput(props) {
|
|
|
45
45
|
const messages = useUiMessages();
|
|
46
46
|
const inputMessages = useInputMessages();
|
|
47
47
|
const separator = createMemo(() => decimalSeparator(local.locale ?? contextLocale()));
|
|
48
|
-
// The visible text keeps the canonical number, only the decimal separator
|
|
49
|
-
// follows the effective locale; grouping is never rendered while editing.
|
|
50
|
-
const display = value => value == null ? "" : String(value).replace(".", separator());
|
|
51
|
-
const [raw, setRaw] = createSignal(display(value()));
|
|
52
48
|
const min = () => local.min ?? -Infinity;
|
|
53
49
|
const max = () => local.max ?? Infinity;
|
|
54
50
|
const step = () => local.step ?? 1;
|
|
55
51
|
// `step` and the accepted decimals never disagree: a fractional step implies
|
|
56
52
|
// its own precision unless the caller states `decimalPlaces` explicitly.
|
|
57
53
|
const places = () => Math.max(0, local.decimalPlaces ?? fractionDigits(step()));
|
|
54
|
+
// Keep ASCII digits and no grouping so display text round-trips through parse,
|
|
55
|
+
// including numbers that String/toFixed would write in exponential notation.
|
|
56
|
+
const formatter = createMemo(() => new Intl.NumberFormat("en", {
|
|
57
|
+
useGrouping: false,
|
|
58
|
+
minimumFractionDigits: places(),
|
|
59
|
+
maximumFractionDigits: places()
|
|
60
|
+
}));
|
|
61
|
+
const display = value => {
|
|
62
|
+
if (value == null) return "";
|
|
63
|
+
// Match normalize's rounding; toFixed switches to exponents at 1e21.
|
|
64
|
+
const text = Math.abs(value) < 1e21 ? value.toFixed(places()) : formatter().format(value);
|
|
65
|
+
return text.replace(".", separator());
|
|
66
|
+
};
|
|
67
|
+
const [raw, setRaw] = createSignal(display(value()));
|
|
58
68
|
const filter = input => {
|
|
59
69
|
let output = "";
|
|
60
70
|
let decimal = false;
|
|
@@ -98,7 +108,9 @@ export function NumberInput(props) {
|
|
|
98
108
|
};
|
|
99
109
|
createEffect(() => {
|
|
100
110
|
if (focused()) return;
|
|
101
|
-
|
|
111
|
+
// Synchronize display text: precision or locale can change
|
|
112
|
+
// without changing the controlled number. This effect never emits changes.
|
|
113
|
+
setRaw(display(value()));
|
|
102
114
|
});
|
|
103
115
|
// Enter already committed the current text, so leaving the field does not commit it twice.
|
|
104
116
|
let committedOnEnter = false;
|
|
@@ -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\";\nimport { useInputMessages } from \"./input-messages\";\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 inputMessages = useInputMessages();\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 ?? inputMessages().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 ?? inputMessages().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;AACvD,SAAS,gBAAgB,QAAQ,kBAAkB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SX, 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 { useInputMessages } from \"./input-messages\";\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 and displayed 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 inputMessages = useInputMessages();\n const separator = createMemo(() => decimalSeparator(local.locale ?? contextLocale()));\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 // Keep ASCII digits and no grouping so display text round-trips through parse,\n // including numbers that String/toFixed would write in exponential notation.\n const formatter = createMemo(\n () =>\n new Intl.NumberFormat(\"en\", {\n useGrouping: false,\n minimumFractionDigits: places(),\n maximumFractionDigits: places(),\n }),\n );\n const display = (value: number | null | undefined) => {\n if (value == null) return \"\";\n // Match normalize's rounding; toFixed switches to exponents at 1e21.\n const text = Math.abs(value) < 1e21 ? value.toFixed(places()) : formatter().format(value);\n return text.replace(\".\", separator());\n };\n const [raw, setRaw] = createSignal(display(value()));\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 // Synchronize display text: precision or locale can change\n // without changing the controlled number. This effect never emits changes.\n 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 ?? inputMessages().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 ?? inputMessages().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;AACvD,SAAS,gBAAgB,QAAQ,kBAAkB;AA2CnD,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,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC;EACpD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjD;AAEA,OAAO,SAAS,WAAW,CAAC,KAAuB,EAAe;EAChE,MAAM,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