@vielzeug/refine 1.3.0 → 1.4.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/button.cjs +1 -1
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +3 -3
- package/dist/button.js.map +1 -1
- package/dist/checkbox-group.cjs +7 -7
- package/dist/checkbox-group.cjs.map +1 -1
- package/dist/checkbox-group.js +35 -26
- package/dist/checkbox-group.js.map +1 -1
- package/dist/checkbox.cjs +3 -3
- package/dist/checkbox.cjs.map +1 -1
- package/dist/checkbox.js +24 -19
- package/dist/checkbox.js.map +1 -1
- package/dist/combobox.cjs +24 -24
- package/dist/combobox.cjs.map +1 -1
- package/dist/combobox.js +133 -129
- package/dist/combobox.js.map +1 -1
- package/dist/content/card/card.css.cjs +1 -1
- package/dist/content/card/card.css.cjs.map +1 -1
- package/dist/content/card/card.css.js +1 -1
- package/dist/content/card/card.css.js.map +1 -1
- package/dist/content/icon/icon.css.cjs +1 -1
- package/dist/content/icon/icon.css.cjs.map +1 -1
- package/dist/content/icon/icon.css.js +1 -1
- package/dist/content/icon/icon.css.js.map +1 -1
- package/dist/custom-elements.json +4711 -4209
- package/dist/feedback/toast/toast.css.cjs +1 -1
- package/dist/feedback/toast/toast.css.cjs.map +1 -1
- package/dist/feedback/toast/toast.css.js +1 -1
- package/dist/feedback/toast/toast.css.js.map +1 -1
- package/dist/headless/auto-resize.cjs +2 -0
- package/dist/headless/auto-resize.cjs.map +1 -0
- package/dist/headless/auto-resize.d.ts +29 -0
- package/dist/headless/auto-resize.d.ts.map +1 -0
- package/dist/headless/auto-resize.js +16 -0
- package/dist/headless/auto-resize.js.map +1 -0
- package/dist/headless/checkable.cjs +1 -1
- package/dist/headless/checkable.cjs.map +1 -1
- package/dist/headless/checkable.d.ts +25 -7
- package/dist/headless/checkable.d.ts.map +1 -1
- package/dist/headless/checkable.js +19 -14
- package/dist/headless/checkable.js.map +1 -1
- package/dist/headless/choice-field.cjs +1 -1
- package/dist/headless/choice-field.cjs.map +1 -1
- package/dist/headless/choice-field.d.ts +21 -0
- package/dist/headless/choice-field.d.ts.map +1 -1
- package/dist/headless/choice-field.js +27 -19
- package/dist/headless/choice-field.js.map +1 -1
- package/dist/headless/composer.cjs +2 -0
- package/dist/headless/composer.cjs.map +1 -0
- package/dist/headless/composer.d.ts +44 -0
- package/dist/headless/composer.d.ts.map +1 -0
- package/dist/headless/composer.js +21 -0
- package/dist/headless/composer.js.map +1 -0
- package/dist/headless/field-base.cjs +1 -1
- package/dist/headless/field-base.cjs.map +1 -1
- package/dist/headless/field-base.d.ts +97 -84
- package/dist/headless/field-base.d.ts.map +1 -1
- package/dist/headless/field-base.js +43 -32
- package/dist/headless/field-base.js.map +1 -1
- package/dist/headless/index.d.ts +3 -1
- package/dist/headless/index.d.ts.map +1 -1
- package/dist/headless/text-field.cjs +1 -1
- package/dist/headless/text-field.cjs.map +1 -1
- package/dist/headless/text-field.d.ts +40 -0
- package/dist/headless/text-field.d.ts.map +1 -1
- package/dist/headless/text-field.js +30 -25
- package/dist/headless/text-field.js.map +1 -1
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +27 -25
- package/dist/index.cjs +1 -1
- package/dist/index.js +61 -60
- package/dist/input.cjs +9 -9
- package/dist/input.cjs.map +1 -1
- package/dist/input.js +49 -44
- package/dist/input.js.map +1 -1
- package/dist/inputs/button/button.css.cjs +1 -1
- package/dist/inputs/button/button.css.cjs.map +1 -1
- package/dist/inputs/button/button.css.js +1 -1
- package/dist/inputs/button/button.css.js.map +1 -1
- package/dist/inputs/checkbox/checkbox.css.cjs +1 -1
- package/dist/inputs/checkbox/checkbox.css.cjs.map +1 -1
- package/dist/inputs/checkbox/checkbox.css.js +1 -1
- package/dist/inputs/checkbox/checkbox.css.js.map +1 -1
- package/dist/inputs/checkbox/checkbox.d.ts +3 -0
- package/dist/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/inputs/checkbox-group/checkbox-group.css.cjs +1 -1
- package/dist/inputs/checkbox-group/checkbox-group.css.cjs.map +1 -1
- package/dist/inputs/checkbox-group/checkbox-group.css.js +1 -1
- package/dist/inputs/checkbox-group/checkbox-group.css.js.map +1 -1
- package/dist/inputs/combobox/combobox.d.ts +1 -0
- package/dist/inputs/combobox/combobox.d.ts.map +1 -1
- package/dist/inputs/combobox/combobox.types.d.ts +2 -0
- package/dist/inputs/combobox/combobox.types.d.ts.map +1 -1
- package/dist/inputs/file-input/file-input.css.cjs +1 -1
- package/dist/inputs/file-input/file-input.css.cjs.map +1 -1
- package/dist/inputs/file-input/file-input.css.js +1 -1
- package/dist/inputs/file-input/file-input.css.js.map +1 -1
- package/dist/inputs/index.d.ts +2 -0
- package/dist/inputs/index.d.ts.map +1 -1
- package/dist/inputs/input/input.css.cjs +1 -1
- package/dist/inputs/input/input.css.cjs.map +1 -1
- package/dist/inputs/input/input.css.js +1 -1
- package/dist/inputs/input/input.css.js.map +1 -1
- package/dist/inputs/input/input.d.ts.map +1 -1
- package/dist/inputs/message-composer/message-composer.css.cjs +2 -0
- package/dist/inputs/message-composer/message-composer.css.cjs.map +1 -0
- package/dist/inputs/message-composer/message-composer.css.js +6 -0
- package/dist/inputs/message-composer/message-composer.css.js.map +1 -0
- package/dist/inputs/message-composer/message-composer.d.ts +139 -0
- package/dist/inputs/message-composer/message-composer.d.ts.map +1 -0
- package/dist/inputs/otp-input/otp-input.css.cjs +1 -1
- package/dist/inputs/otp-input/otp-input.css.cjs.map +1 -1
- package/dist/inputs/otp-input/otp-input.css.js +1 -1
- package/dist/inputs/otp-input/otp-input.css.js.map +1 -1
- package/dist/inputs/radio/radio.css.cjs +1 -1
- package/dist/inputs/radio/radio.css.cjs.map +1 -1
- package/dist/inputs/radio/radio.css.js +1 -1
- package/dist/inputs/radio/radio.css.js.map +1 -1
- package/dist/inputs/radio-group/radio-group.css.cjs +1 -1
- package/dist/inputs/radio-group/radio-group.css.cjs.map +1 -1
- package/dist/inputs/radio-group/radio-group.css.js +1 -1
- package/dist/inputs/radio-group/radio-group.css.js.map +1 -1
- package/dist/inputs/rating/rating.css.cjs +1 -1
- package/dist/inputs/rating/rating.css.cjs.map +1 -1
- package/dist/inputs/rating/rating.css.js +1 -1
- package/dist/inputs/rating/rating.css.js.map +1 -1
- package/dist/inputs/shared/field-binding.cjs +1 -1
- package/dist/inputs/shared/field-binding.cjs.map +1 -1
- package/dist/inputs/shared/field-binding.d.ts +15 -0
- package/dist/inputs/shared/field-binding.d.ts.map +1 -1
- package/dist/inputs/shared/field-binding.js +4 -3
- package/dist/inputs/shared/field-binding.js.map +1 -1
- package/dist/inputs/shared/form-context.cjs.map +1 -1
- package/dist/inputs/shared/form-context.d.ts +6 -0
- package/dist/inputs/shared/form-context.d.ts.map +1 -1
- package/dist/inputs/shared/form-context.js.map +1 -1
- package/dist/inputs/slider/slider.css.cjs +1 -1
- package/dist/inputs/slider/slider.css.cjs.map +1 -1
- package/dist/inputs/slider/slider.css.js +1 -1
- package/dist/inputs/slider/slider.css.js.map +1 -1
- package/dist/inputs/switch/switch.css.cjs +1 -1
- package/dist/inputs/switch/switch.css.cjs.map +1 -1
- package/dist/inputs/switch/switch.css.js +1 -1
- package/dist/inputs/switch/switch.css.js.map +1 -1
- package/dist/inputs/textarea/textarea.css.cjs +1 -1
- package/dist/inputs/textarea/textarea.css.cjs.map +1 -1
- package/dist/inputs/textarea/textarea.css.js +1 -1
- package/dist/inputs/textarea/textarea.css.js.map +1 -1
- package/dist/inputs/textarea/textarea.d.ts.map +1 -1
- package/dist/layout/navbar/navbar.css.cjs +1 -1
- package/dist/layout/navbar/navbar.css.cjs.map +1 -1
- package/dist/layout/navbar/navbar.css.js +1 -1
- package/dist/layout/navbar/navbar.css.js.map +1 -1
- package/dist/layout/sidebar/sidebar.css.cjs +1 -1
- package/dist/layout/sidebar/sidebar.css.cjs.map +1 -1
- package/dist/layout/sidebar/sidebar.css.js +1 -1
- package/dist/layout/sidebar/sidebar.css.js.map +1 -1
- package/dist/message-composer.cjs +52 -0
- package/dist/message-composer.cjs.map +1 -0
- package/dist/message-composer.js +168 -0
- package/dist/message-composer.js.map +1 -0
- package/dist/ore/dist/base-element.cjs +1 -1
- package/dist/ore/dist/base-element.cjs.map +1 -1
- package/dist/ore/dist/base-element.js +13 -3
- package/dist/ore/dist/base-element.js.map +1 -1
- package/dist/ore/dist/forms/field.cjs +1 -1
- package/dist/ore/dist/forms/field.cjs.map +1 -1
- package/dist/ore/dist/forms/field.js +29 -22
- package/dist/ore/dist/forms/field.js.map +1 -1
- package/dist/ore/dist/runtime.cjs +1 -1
- package/dist/ore/dist/runtime.cjs.map +1 -1
- package/dist/ore/dist/runtime.js +3 -1
- package/dist/ore/dist/runtime.js.map +1 -1
- package/dist/overlay/menu/menu.css.cjs +1 -1
- package/dist/overlay/menu/menu.css.cjs.map +1 -1
- package/dist/overlay/menu/menu.css.js +1 -1
- package/dist/overlay/menu/menu.css.js.map +1 -1
- package/dist/radio-group.cjs +9 -9
- package/dist/radio-group.cjs.map +1 -1
- package/dist/radio-group.js +44 -38
- package/dist/radio-group.js.map +1 -1
- package/dist/radio.cjs +3 -3
- package/dist/radio.cjs.map +1 -1
- package/dist/radio.js +23 -24
- package/dist/radio.js.map +1 -1
- package/dist/refine.cjs +228 -181
- package/dist/refine.cjs.map +1 -1
- package/dist/refine.iife.js +228 -181
- package/dist/refine.iife.js.map +1 -1
- package/dist/refine.js +251 -204
- package/dist/refine.js.map +1 -1
- package/dist/select.cjs +31 -31
- package/dist/select.cjs.map +1 -1
- package/dist/select.js +125 -122
- package/dist/select.js.map +1 -1
- package/dist/shared/size-presets.cjs +1 -1
- package/dist/shared/size-presets.cjs.map +1 -1
- package/dist/shared/size-presets.d.ts +23 -0
- package/dist/shared/size-presets.d.ts.map +1 -1
- package/dist/shared/size-presets.js +17 -1
- package/dist/shared/size-presets.js.map +1 -1
- package/dist/styles/mixins/animation.css.cjs +0 -3
- package/dist/styles/mixins/animation.css.cjs.map +1 -1
- package/dist/styles/mixins/animation.css.d.ts +12 -4
- package/dist/styles/mixins/animation.css.d.ts.map +1 -1
- package/dist/styles/mixins/animation.css.js +0 -3
- package/dist/styles/mixins/animation.css.js.map +1 -1
- package/dist/styles/mixins/variants.css.cjs.map +1 -1
- package/dist/styles/mixins/variants.css.d.ts +7 -2
- package/dist/styles/mixins/variants.css.d.ts.map +1 -1
- package/dist/styles/mixins/variants.css.js.map +1 -1
- package/dist/styles/theme.css +341 -132
- package/dist/switch.cjs +3 -3
- package/dist/switch.cjs.map +1 -1
- package/dist/switch.js +17 -18
- package/dist/switch.js.map +1 -1
- package/dist/textarea.cjs +15 -15
- package/dist/textarea.cjs.map +1 -1
- package/dist/textarea.js +64 -60
- package/dist/textarea.js.map +1 -1
- package/package.json +21 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./field-base.cjs"),t=require("./signals.cjs");require("@vielzeug/ripple");var
|
|
1
|
+
const e=require("./field-base.cjs"),t=require("./signals.cjs");let n=require("@vielzeug/ripple");var r=e=>e.trim()===``,i=e=>String(e??``),a=a=>{let o=t.syncedSignal(a.value,a.signal,i),s=e.createField(a),c=a.maxLength?e.createCounterState({maxLength:a.maxLength,value:o}):null,l=(0,n.computed)(()=>!a.readonly?.value&&a.required?.value&&r(o.value)?{valueMissing:!0}:null),u=(0,n.computed)(()=>l.value?a.requiredMessage?.value||`This field is required.`:``),d=()=>{o.value=i(a.value.value),s.triggerValidation(`change`)},f=e=>{e?.preventDefault?.(),o.value=``,a.onInput?.(e??new InputEvent(`input`,{bubbles:!0}),``),a.onChange?.(e??new Event(`change`,{bubbles:!0}),``),s.triggerValidation(`change`)},p=(e,t)=>{let n=[],r=(t,r)=>{e.addEventListener(t,r),n.push(()=>e.removeEventListener(t,r))};a.onFocus&&r(`focus`,e=>a.onFocus(e)),r(`input`,t=>{t.stopPropagation(),a.onBeforeInput?.(t),o.value=e.value,a.onInput?.(t,e.value)}),r(`change`,t=>{t.stopPropagation(),o.value=e.value,a.onChange?.(t,e.value),s.triggerValidation(`change`)}),r(`blur`,e=>{a.onBlur?.(e),s.triggerValidation(`blur`)});let i=!1,c=()=>{if(!i){i=!0;for(let e of n)e()}};return t?.addEventListener(`abort`,c,{once:!0}),c};return{...s,clear:f,counter:c,reset:d,validationMessage:u,validity:l,value:o,wire:p}};exports.createTextField=a;
|
|
2
2
|
//# sourceMappingURL=text-field.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.cjs","names":[],"sources":["../../src/headless/text-field.ts"],"sourcesContent":["import { type Readable, type Signal } from '@vielzeug/ripple';\n\nimport { type CounterState, createCounterState, createField, type FieldHandle, type FieldOptions } from './field-base';\nimport { syncedSignal } from './signals';\n\n// ── Text field ────────────────────────────────────────────────────────────────\n\n/** Detach function returned by `wire()`. Call to remove element listeners. */\nexport type TextFieldDetach = () => void;\n\nexport type TextFieldOptions = FieldOptions & {\n maxLength?: Readable<number | undefined>;\n /**\n * Called synchronously before value extraction on every input event.\n * Use only for DOM side-effects (e.g. auto-resize measurement) that must\n * run before the reactive value is updated.\n */\n onBeforeInput?: (event: Event) => void;\n onBlur?: (event: FocusEvent) => void;\n onChange?: (event: Event, value: string) => void;\n onFocus?: (event: FocusEvent) => void;\n onInput?: (event: Event, value: string) => void;\n /** `AbortSignal` from the component lifecycle. The internal value-sync watcher is disposed on abort. */\n signal: AbortSignal;\n value: Readable<string | undefined>;\n};\n\nexport type TextFieldHandle = FieldHandle & {\n /** Clears the field value and fires synthetic input/change events. */\n clear: (event?: Event) => void;\n /**\n * Reactive counter state. Non-null when `maxLength` was provided; `null` otherwise.\n * Components should only render a counter element when this is non-null.\n */\n counter: Readable<CounterState> | null;\n /** The local mutable field value (two-way bound to the input element via `wire()`). */\n value: Signal<string>;\n /**\n * Attaches event listeners to the underlying input or textarea element.\n *\n * When `signal` is provided, the listeners are detached automatically when\n * the signal's controller calls `abort()`. Without a signal the returned\n * `TextFieldDetach` must be called manually.\n *\n * Safe to call multiple times — each call attaches a fresh set of listeners\n * and returns a distinct detach function. Calling detach multiple times is\n * a no-op (guarded internally).\n */\n wire: (el: HTMLInputElement | HTMLTextAreaElement, signal?: AbortSignal) => TextFieldDetach;\n};\n\nexport const createTextField = (options: TextFieldOptions): TextFieldHandle => {\n const value = syncedSignal(options.value, options.signal,
|
|
1
|
+
{"version":3,"file":"text-field.cjs","names":[],"sources":["../../src/headless/text-field.ts"],"sourcesContent":["import { computed, type Readable, type Signal } from '@vielzeug/ripple';\n\nimport { type CounterState, createCounterState, createField, type FieldHandle, type FieldOptions } from './field-base';\nimport { syncedSignal } from './signals';\n\n// ── Text field ────────────────────────────────────────────────────────────────\n\n/** Detach function returned by `wire()`. Call to remove element listeners. */\nexport type TextFieldDetach = () => void;\n\nexport type TextFieldOptions = FieldOptions & {\n maxLength?: Readable<number | undefined>;\n /**\n * Called synchronously before value extraction on every input event.\n * Use only for DOM side-effects (e.g. auto-resize measurement) that must\n * run before the reactive value is updated.\n */\n onBeforeInput?: (event: Event) => void;\n onBlur?: (event: FocusEvent) => void;\n onChange?: (event: Event, value: string) => void;\n onFocus?: (event: FocusEvent) => void;\n onInput?: (event: Event, value: string) => void;\n /**\n * Bars the field from constraint validation while true — matches the native HTML rule that a\n * `readonly` field is never a candidate for constraint validation (a `readonly required`\n * field is always valid, per spec), so `validity`/`validationMessage` don't feed a false\n * `valueMissing` into `useField()` just because a read-only field happens to be blank.\n */\n readonly?: Readable<boolean | undefined>;\n /** Marks a blank value invalid — feeds `validity`/`validationMessage` (see below). */\n required?: Readable<boolean | undefined>;\n /** Message for the blank+required case. Defaults to `'This field is required.'`. */\n requiredMessage?: Readable<string | undefined>;\n /** `AbortSignal` from the component lifecycle. The internal value-sync watcher is disposed on abort. */\n signal: AbortSignal;\n value: Readable<string | undefined>;\n};\n\nexport type TextFieldHandle = FieldHandle & {\n /**\n * Registers the real form field handle (the return value of `useField()`) so that\n * `triggerValidation()` — called internally on blur/change — can call its\n * `reportValidity()`. `useField()` itself needs `value` (below) to exist first, so this\n * is a two-step wiring rather than a constructor option:\n *\n * ```ts\n * const tf = createTextField({ value: props.value, ... });\n * const formField = useField({ value: tf.value, ... });\n * tf.attachFormField(formField);\n * ```\n */\n attachFormField: (formField: { reportValidity(): void }) => void;\n /** Clears the field value and fires synthetic input/change events. */\n clear: (event?: Event) => void;\n /**\n * Reactive counter state. Non-null when `maxLength` was provided; `null` otherwise.\n * Components should only render a counter element when this is non-null.\n */\n counter: Readable<CounterState> | null;\n /**\n * Restores the value to whatever the `value` option currently holds (native form\n * `reset()` semantics: a `<input>` reverts to its *current* `value` content attribute,\n * not a frozen snapshot from element creation — so setting the attribute programmatically\n * after mount changes what a later reset reverts to). Wire into `useField({ onReset: tf.reset })`.\n */\n reset: () => void;\n /** Reactive validation message paired with `validity`. Empty string when valid. */\n validationMessage: Readable<string>;\n /**\n * Reactive `ValidityStateFlags` — `{ valueMissing: true }` while `required` and blank,\n * `null` (valid) otherwise. Pass straight to `useField({ validity: tf.validity })`.\n */\n validity: Readable<ValidityStateFlags | null>;\n /** The local mutable field value (two-way bound to the input element via `wire()`). */\n value: Signal<string>;\n /**\n * Attaches event listeners to the underlying input or textarea element.\n *\n * When `signal` is provided, the listeners are detached automatically when\n * the signal's controller calls `abort()`. Without a signal the returned\n * `TextFieldDetach` must be called manually.\n *\n * Safe to call multiple times — each call attaches a fresh set of listeners\n * and returns a distinct detach function. Calling detach multiple times is\n * a no-op (guarded internally).\n */\n wire: (el: HTMLInputElement | HTMLTextAreaElement, signal?: AbortSignal) => TextFieldDetach;\n};\n\nconst isBlank = (value: string): boolean => value.trim() === '';\nconst toFieldValue = (v: string | undefined): string => String(v ?? '');\n\nexport const createTextField = (options: TextFieldOptions): TextFieldHandle => {\n const value = syncedSignal(options.value, options.signal, toFieldValue);\n\n const field = createField(options);\n const counter = options.maxLength ? createCounterState({ maxLength: options.maxLength, value }) : null;\n\n const validity = computed<ValidityStateFlags | null>(() =>\n !options.readonly?.value && options.required?.value && isBlank(value.value) ? { valueMissing: true } : null,\n );\n const validationMessage = computed(() =>\n validity.value ? options.requiredMessage?.value || 'This field is required.' : '',\n );\n\n const reset = (): void => {\n value.value = toFieldValue(options.value.value);\n field.triggerValidation('change');\n };\n\n const clear = (event?: Event): void => {\n event?.preventDefault?.();\n value.value = '';\n options.onInput?.(event ?? new InputEvent('input', { bubbles: true }), '');\n options.onChange?.(event ?? new Event('change', { bubbles: true }), '');\n field.triggerValidation('change');\n };\n\n const wire = (element: HTMLInputElement | HTMLTextAreaElement, signal?: AbortSignal): TextFieldDetach => {\n const cleanups: Array<() => void> = [];\n const on = (type: string, handler: EventListener): void => {\n element.addEventListener(type, handler);\n cleanups.push(() => element.removeEventListener(type, handler));\n };\n\n if (options.onFocus) {\n on('focus', (e) => options.onFocus!(e as FocusEvent));\n }\n\n on('input', (e) => {\n e.stopPropagation();\n options.onBeforeInput?.(e);\n value.value = element.value;\n options.onInput?.(e, element.value);\n });\n\n on('change', (e) => {\n e.stopPropagation();\n value.value = element.value;\n options.onChange?.(e, element.value);\n field.triggerValidation('change');\n });\n\n on('blur', (e) => {\n options.onBlur?.(e as FocusEvent);\n field.triggerValidation('blur');\n });\n\n let detached = false;\n const detach = (): void => {\n if (detached) return;\n\n detached = true;\n for (const dispose of cleanups) dispose();\n };\n\n signal?.addEventListener('abort', detach, { once: true });\n\n return detach;\n };\n\n return { ...field, clear, counter, reset, validationMessage, validity, value, wire };\n};\n"],"mappings":"iGAyFA,IAAM,EAAW,GAA2B,EAAM,KAAK,IAAM,GACvD,EAAgB,GAAkC,OAAO,GAAK,EAAE,EAEzD,EAAmB,GAA+C,CAC7E,IAAM,EAAQ,EAAA,aAAa,EAAQ,MAAO,EAAQ,OAAQ,CAAY,EAEhE,EAAQ,EAAA,YAAY,CAAO,EAC3B,EAAU,EAAQ,UAAY,EAAA,mBAAmB,CAAE,UAAW,EAAQ,UAAW,OAAM,CAAC,EAAI,KAE5F,GAAA,EAAA,EAAA,SAAA,KACJ,CAAC,EAAQ,UAAU,OAAS,EAAQ,UAAU,OAAS,EAAQ,EAAM,KAAK,EAAI,CAAE,aAAc,EAAK,EAAI,IACzG,EACM,GAAA,EAAA,EAAA,SAAA,KACJ,EAAS,MAAQ,EAAQ,iBAAiB,OAAS,0BAA4B,EACjF,EAEM,MAAoB,CACxB,EAAM,MAAQ,EAAa,EAAQ,MAAM,KAAK,EAC9C,EAAM,kBAAkB,QAAQ,CAClC,EAEM,EAAS,GAAwB,CACrC,GAAO,iBAAiB,EACxB,EAAM,MAAQ,GACd,EAAQ,UAAU,GAAS,IAAI,WAAW,QAAS,CAAE,QAAS,EAAK,CAAC,EAAG,EAAE,EACzE,EAAQ,WAAW,GAAS,IAAI,MAAM,SAAU,CAAE,QAAS,EAAK,CAAC,EAAG,EAAE,EACtE,EAAM,kBAAkB,QAAQ,CAClC,EAEM,GAAQ,EAAiD,IAA0C,CACvG,IAAM,EAA8B,CAAC,EAC/B,GAAM,EAAc,IAAiC,CACzD,EAAQ,iBAAiB,EAAM,CAAO,EACtC,EAAS,SAAW,EAAQ,oBAAoB,EAAM,CAAO,CAAC,CAChE,EAEI,EAAQ,SACV,EAAG,QAAU,GAAM,EAAQ,QAAS,CAAe,CAAC,EAGtD,EAAG,QAAU,GAAM,CACjB,EAAE,gBAAgB,EAClB,EAAQ,gBAAgB,CAAC,EACzB,EAAM,MAAQ,EAAQ,MACtB,EAAQ,UAAU,EAAG,EAAQ,KAAK,CACpC,CAAC,EAED,EAAG,SAAW,GAAM,CAClB,EAAE,gBAAgB,EAClB,EAAM,MAAQ,EAAQ,MACtB,EAAQ,WAAW,EAAG,EAAQ,KAAK,EACnC,EAAM,kBAAkB,QAAQ,CAClC,CAAC,EAED,EAAG,OAAS,GAAM,CAChB,EAAQ,SAAS,CAAe,EAChC,EAAM,kBAAkB,MAAM,CAChC,CAAC,EAED,IAAI,EAAW,GACT,MAAqB,CACrB,MAEJ,GAAW,GACX,IAAK,IAAM,KAAW,EAAU,EAAQ,CAD7B,CAEb,EAIA,OAFA,GAAQ,iBAAiB,QAAS,EAAQ,CAAE,KAAM,EAAK,CAAC,EAEjD,CACT,EAEA,MAAO,CAAE,GAAG,EAAO,QAAO,UAAS,QAAO,oBAAmB,WAAU,QAAO,MAAK,CACrF"}
|
|
@@ -14,11 +14,37 @@ export type TextFieldOptions = FieldOptions & {
|
|
|
14
14
|
onChange?: (event: Event, value: string) => void;
|
|
15
15
|
onFocus?: (event: FocusEvent) => void;
|
|
16
16
|
onInput?: (event: Event, value: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Bars the field from constraint validation while true — matches the native HTML rule that a
|
|
19
|
+
* `readonly` field is never a candidate for constraint validation (a `readonly required`
|
|
20
|
+
* field is always valid, per spec), so `validity`/`validationMessage` don't feed a false
|
|
21
|
+
* `valueMissing` into `useField()` just because a read-only field happens to be blank.
|
|
22
|
+
*/
|
|
23
|
+
readonly?: Readable<boolean | undefined>;
|
|
24
|
+
/** Marks a blank value invalid — feeds `validity`/`validationMessage` (see below). */
|
|
25
|
+
required?: Readable<boolean | undefined>;
|
|
26
|
+
/** Message for the blank+required case. Defaults to `'This field is required.'`. */
|
|
27
|
+
requiredMessage?: Readable<string | undefined>;
|
|
17
28
|
/** `AbortSignal` from the component lifecycle. The internal value-sync watcher is disposed on abort. */
|
|
18
29
|
signal: AbortSignal;
|
|
19
30
|
value: Readable<string | undefined>;
|
|
20
31
|
};
|
|
21
32
|
export type TextFieldHandle = FieldHandle & {
|
|
33
|
+
/**
|
|
34
|
+
* Registers the real form field handle (the return value of `useField()`) so that
|
|
35
|
+
* `triggerValidation()` — called internally on blur/change — can call its
|
|
36
|
+
* `reportValidity()`. `useField()` itself needs `value` (below) to exist first, so this
|
|
37
|
+
* is a two-step wiring rather than a constructor option:
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* const tf = createTextField({ value: props.value, ... });
|
|
41
|
+
* const formField = useField({ value: tf.value, ... });
|
|
42
|
+
* tf.attachFormField(formField);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
attachFormField: (formField: {
|
|
46
|
+
reportValidity(): void;
|
|
47
|
+
}) => void;
|
|
22
48
|
/** Clears the field value and fires synthetic input/change events. */
|
|
23
49
|
clear: (event?: Event) => void;
|
|
24
50
|
/**
|
|
@@ -26,6 +52,20 @@ export type TextFieldHandle = FieldHandle & {
|
|
|
26
52
|
* Components should only render a counter element when this is non-null.
|
|
27
53
|
*/
|
|
28
54
|
counter: Readable<CounterState> | null;
|
|
55
|
+
/**
|
|
56
|
+
* Restores the value to whatever the `value` option currently holds (native form
|
|
57
|
+
* `reset()` semantics: a `<input>` reverts to its *current* `value` content attribute,
|
|
58
|
+
* not a frozen snapshot from element creation — so setting the attribute programmatically
|
|
59
|
+
* after mount changes what a later reset reverts to). Wire into `useField({ onReset: tf.reset })`.
|
|
60
|
+
*/
|
|
61
|
+
reset: () => void;
|
|
62
|
+
/** Reactive validation message paired with `validity`. Empty string when valid. */
|
|
63
|
+
validationMessage: Readable<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Reactive `ValidityStateFlags` — `{ valueMissing: true }` while `required` and blank,
|
|
66
|
+
* `null` (valid) otherwise. Pass straight to `useField({ validity: tf.validity })`.
|
|
67
|
+
*/
|
|
68
|
+
validity: Readable<ValidityStateFlags | null>;
|
|
29
69
|
/** The local mutable field value (two-way bound to the input element via `wire()`). */
|
|
30
70
|
value: Signal<string>;
|
|
31
71
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/headless/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/headless/text-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,EAAE,KAAK,YAAY,EAAmC,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAKvH,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAEzC,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAC5C,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACzC,sFAAsF;IACtF,QAAQ,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACzC,oFAAoF;IACpF,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/C,wGAAwG;IACxG,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C;;;;;;;;;;;OAWG;IACH,eAAe,EAAE,CAAC,SAAS,EAAE;QAAE,cAAc,IAAI,IAAI,CAAA;KAAE,KAAK,IAAI,CAAC;IACjE,sEAAsE;IACtE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IACvC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,mFAAmF;IACnF,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC9C,uFAAuF;IACvF,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,CAAC,EAAE,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,eAAe,CAAC;CAC7F,CAAC;AAKF,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,eAsE3D,CAAC"}
|
|
@@ -1,41 +1,46 @@
|
|
|
1
1
|
import { createCounterState as e, createField as t } from "./field-base.js";
|
|
2
2
|
import { syncedSignal as n } from "./signals.js";
|
|
3
|
-
import "@vielzeug/ripple";
|
|
3
|
+
import { computed as r } from "@vielzeug/ripple";
|
|
4
4
|
//#region src/headless/text-field.ts
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
maxLength:
|
|
8
|
-
value:
|
|
9
|
-
}) : null, s = (
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
5
|
+
var i = (e) => e.trim() === "", a = (e) => String(e ?? ""), o = (o) => {
|
|
6
|
+
let s = n(o.value, o.signal, a), c = t(o), l = o.maxLength ? e({
|
|
7
|
+
maxLength: o.maxLength,
|
|
8
|
+
value: s
|
|
9
|
+
}) : null, u = r(() => !o.readonly?.value && o.required?.value && i(s.value) ? { valueMissing: !0 } : null), d = r(() => u.value ? o.requiredMessage?.value || "This field is required." : ""), f = () => {
|
|
10
|
+
s.value = a(o.value.value), c.triggerValidation("change");
|
|
11
|
+
}, p = (e) => {
|
|
12
|
+
e?.preventDefault?.(), s.value = "", o.onInput?.(e ?? new InputEvent("input", { bubbles: !0 }), ""), o.onChange?.(e ?? new Event("change", { bubbles: !0 }), ""), c.triggerValidation("change");
|
|
13
|
+
}, m = (e, t) => {
|
|
14
|
+
let n = [], r = (t, r) => {
|
|
13
15
|
e.addEventListener(t, r), n.push(() => e.removeEventListener(t, r));
|
|
14
16
|
};
|
|
15
|
-
|
|
16
|
-
t.stopPropagation(),
|
|
17
|
-
}),
|
|
18
|
-
t.stopPropagation(),
|
|
19
|
-
}),
|
|
20
|
-
|
|
17
|
+
o.onFocus && r("focus", (e) => o.onFocus(e)), r("input", (t) => {
|
|
18
|
+
t.stopPropagation(), o.onBeforeInput?.(t), s.value = e.value, o.onInput?.(t, e.value);
|
|
19
|
+
}), r("change", (t) => {
|
|
20
|
+
t.stopPropagation(), s.value = e.value, o.onChange?.(t, e.value), c.triggerValidation("change");
|
|
21
|
+
}), r("blur", (e) => {
|
|
22
|
+
o.onBlur?.(e), c.triggerValidation("blur");
|
|
21
23
|
});
|
|
22
|
-
let
|
|
23
|
-
if (!
|
|
24
|
-
|
|
24
|
+
let i = !1, a = () => {
|
|
25
|
+
if (!i) {
|
|
26
|
+
i = !0;
|
|
25
27
|
for (let e of n) e();
|
|
26
28
|
}
|
|
27
29
|
};
|
|
28
|
-
return t?.addEventListener("abort",
|
|
30
|
+
return t?.addEventListener("abort", a, { once: !0 }), a;
|
|
29
31
|
};
|
|
30
32
|
return {
|
|
31
|
-
...
|
|
32
|
-
clear:
|
|
33
|
-
counter:
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
...c,
|
|
34
|
+
clear: p,
|
|
35
|
+
counter: l,
|
|
36
|
+
reset: f,
|
|
37
|
+
validationMessage: d,
|
|
38
|
+
validity: u,
|
|
39
|
+
value: s,
|
|
40
|
+
wire: m
|
|
36
41
|
};
|
|
37
42
|
};
|
|
38
43
|
//#endregion
|
|
39
|
-
export {
|
|
44
|
+
export { o as createTextField };
|
|
40
45
|
|
|
41
46
|
//# sourceMappingURL=text-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.js","names":[],"sources":["../../src/headless/text-field.ts"],"sourcesContent":["import { type Readable, type Signal } from '@vielzeug/ripple';\n\nimport { type CounterState, createCounterState, createField, type FieldHandle, type FieldOptions } from './field-base';\nimport { syncedSignal } from './signals';\n\n// ── Text field ────────────────────────────────────────────────────────────────\n\n/** Detach function returned by `wire()`. Call to remove element listeners. */\nexport type TextFieldDetach = () => void;\n\nexport type TextFieldOptions = FieldOptions & {\n maxLength?: Readable<number | undefined>;\n /**\n * Called synchronously before value extraction on every input event.\n * Use only for DOM side-effects (e.g. auto-resize measurement) that must\n * run before the reactive value is updated.\n */\n onBeforeInput?: (event: Event) => void;\n onBlur?: (event: FocusEvent) => void;\n onChange?: (event: Event, value: string) => void;\n onFocus?: (event: FocusEvent) => void;\n onInput?: (event: Event, value: string) => void;\n /** `AbortSignal` from the component lifecycle. The internal value-sync watcher is disposed on abort. */\n signal: AbortSignal;\n value: Readable<string | undefined>;\n};\n\nexport type TextFieldHandle = FieldHandle & {\n /** Clears the field value and fires synthetic input/change events. */\n clear: (event?: Event) => void;\n /**\n * Reactive counter state. Non-null when `maxLength` was provided; `null` otherwise.\n * Components should only render a counter element when this is non-null.\n */\n counter: Readable<CounterState> | null;\n /** The local mutable field value (two-way bound to the input element via `wire()`). */\n value: Signal<string>;\n /**\n * Attaches event listeners to the underlying input or textarea element.\n *\n * When `signal` is provided, the listeners are detached automatically when\n * the signal's controller calls `abort()`. Without a signal the returned\n * `TextFieldDetach` must be called manually.\n *\n * Safe to call multiple times — each call attaches a fresh set of listeners\n * and returns a distinct detach function. Calling detach multiple times is\n * a no-op (guarded internally).\n */\n wire: (el: HTMLInputElement | HTMLTextAreaElement, signal?: AbortSignal) => TextFieldDetach;\n};\n\nexport const createTextField = (options: TextFieldOptions): TextFieldHandle => {\n const value = syncedSignal(options.value, options.signal,
|
|
1
|
+
{"version":3,"file":"text-field.js","names":[],"sources":["../../src/headless/text-field.ts"],"sourcesContent":["import { computed, type Readable, type Signal } from '@vielzeug/ripple';\n\nimport { type CounterState, createCounterState, createField, type FieldHandle, type FieldOptions } from './field-base';\nimport { syncedSignal } from './signals';\n\n// ── Text field ────────────────────────────────────────────────────────────────\n\n/** Detach function returned by `wire()`. Call to remove element listeners. */\nexport type TextFieldDetach = () => void;\n\nexport type TextFieldOptions = FieldOptions & {\n maxLength?: Readable<number | undefined>;\n /**\n * Called synchronously before value extraction on every input event.\n * Use only for DOM side-effects (e.g. auto-resize measurement) that must\n * run before the reactive value is updated.\n */\n onBeforeInput?: (event: Event) => void;\n onBlur?: (event: FocusEvent) => void;\n onChange?: (event: Event, value: string) => void;\n onFocus?: (event: FocusEvent) => void;\n onInput?: (event: Event, value: string) => void;\n /**\n * Bars the field from constraint validation while true — matches the native HTML rule that a\n * `readonly` field is never a candidate for constraint validation (a `readonly required`\n * field is always valid, per spec), so `validity`/`validationMessage` don't feed a false\n * `valueMissing` into `useField()` just because a read-only field happens to be blank.\n */\n readonly?: Readable<boolean | undefined>;\n /** Marks a blank value invalid — feeds `validity`/`validationMessage` (see below). */\n required?: Readable<boolean | undefined>;\n /** Message for the blank+required case. Defaults to `'This field is required.'`. */\n requiredMessage?: Readable<string | undefined>;\n /** `AbortSignal` from the component lifecycle. The internal value-sync watcher is disposed on abort. */\n signal: AbortSignal;\n value: Readable<string | undefined>;\n};\n\nexport type TextFieldHandle = FieldHandle & {\n /**\n * Registers the real form field handle (the return value of `useField()`) so that\n * `triggerValidation()` — called internally on blur/change — can call its\n * `reportValidity()`. `useField()` itself needs `value` (below) to exist first, so this\n * is a two-step wiring rather than a constructor option:\n *\n * ```ts\n * const tf = createTextField({ value: props.value, ... });\n * const formField = useField({ value: tf.value, ... });\n * tf.attachFormField(formField);\n * ```\n */\n attachFormField: (formField: { reportValidity(): void }) => void;\n /** Clears the field value and fires synthetic input/change events. */\n clear: (event?: Event) => void;\n /**\n * Reactive counter state. Non-null when `maxLength` was provided; `null` otherwise.\n * Components should only render a counter element when this is non-null.\n */\n counter: Readable<CounterState> | null;\n /**\n * Restores the value to whatever the `value` option currently holds (native form\n * `reset()` semantics: a `<input>` reverts to its *current* `value` content attribute,\n * not a frozen snapshot from element creation — so setting the attribute programmatically\n * after mount changes what a later reset reverts to). Wire into `useField({ onReset: tf.reset })`.\n */\n reset: () => void;\n /** Reactive validation message paired with `validity`. Empty string when valid. */\n validationMessage: Readable<string>;\n /**\n * Reactive `ValidityStateFlags` — `{ valueMissing: true }` while `required` and blank,\n * `null` (valid) otherwise. Pass straight to `useField({ validity: tf.validity })`.\n */\n validity: Readable<ValidityStateFlags | null>;\n /** The local mutable field value (two-way bound to the input element via `wire()`). */\n value: Signal<string>;\n /**\n * Attaches event listeners to the underlying input or textarea element.\n *\n * When `signal` is provided, the listeners are detached automatically when\n * the signal's controller calls `abort()`. Without a signal the returned\n * `TextFieldDetach` must be called manually.\n *\n * Safe to call multiple times — each call attaches a fresh set of listeners\n * and returns a distinct detach function. Calling detach multiple times is\n * a no-op (guarded internally).\n */\n wire: (el: HTMLInputElement | HTMLTextAreaElement, signal?: AbortSignal) => TextFieldDetach;\n};\n\nconst isBlank = (value: string): boolean => value.trim() === '';\nconst toFieldValue = (v: string | undefined): string => String(v ?? '');\n\nexport const createTextField = (options: TextFieldOptions): TextFieldHandle => {\n const value = syncedSignal(options.value, options.signal, toFieldValue);\n\n const field = createField(options);\n const counter = options.maxLength ? createCounterState({ maxLength: options.maxLength, value }) : null;\n\n const validity = computed<ValidityStateFlags | null>(() =>\n !options.readonly?.value && options.required?.value && isBlank(value.value) ? { valueMissing: true } : null,\n );\n const validationMessage = computed(() =>\n validity.value ? options.requiredMessage?.value || 'This field is required.' : '',\n );\n\n const reset = (): void => {\n value.value = toFieldValue(options.value.value);\n field.triggerValidation('change');\n };\n\n const clear = (event?: Event): void => {\n event?.preventDefault?.();\n value.value = '';\n options.onInput?.(event ?? new InputEvent('input', { bubbles: true }), '');\n options.onChange?.(event ?? new Event('change', { bubbles: true }), '');\n field.triggerValidation('change');\n };\n\n const wire = (element: HTMLInputElement | HTMLTextAreaElement, signal?: AbortSignal): TextFieldDetach => {\n const cleanups: Array<() => void> = [];\n const on = (type: string, handler: EventListener): void => {\n element.addEventListener(type, handler);\n cleanups.push(() => element.removeEventListener(type, handler));\n };\n\n if (options.onFocus) {\n on('focus', (e) => options.onFocus!(e as FocusEvent));\n }\n\n on('input', (e) => {\n e.stopPropagation();\n options.onBeforeInput?.(e);\n value.value = element.value;\n options.onInput?.(e, element.value);\n });\n\n on('change', (e) => {\n e.stopPropagation();\n value.value = element.value;\n options.onChange?.(e, element.value);\n field.triggerValidation('change');\n });\n\n on('blur', (e) => {\n options.onBlur?.(e as FocusEvent);\n field.triggerValidation('blur');\n });\n\n let detached = false;\n const detach = (): void => {\n if (detached) return;\n\n detached = true;\n for (const dispose of cleanups) dispose();\n };\n\n signal?.addEventListener('abort', detach, { once: true });\n\n return detach;\n };\n\n return { ...field, clear, counter, reset, validationMessage, validity, value, wire };\n};\n"],"mappings":";;;;AAyFA,IAAM,KAAW,MAA2B,EAAM,KAAK,MAAM,IACvD,KAAgB,MAAkC,OAAO,KAAK,EAAE,GAEzD,KAAmB,MAA+C;CAC7E,IAAM,IAAQ,EAAa,EAAQ,OAAO,EAAQ,QAAQ,CAAY,GAEhE,IAAQ,EAAY,CAAO,GAC3B,IAAU,EAAQ,YAAY,EAAmB;EAAE,WAAW,EAAQ;EAAW;CAAM,CAAC,IAAI,MAE5F,IAAW,QACf,CAAC,EAAQ,UAAU,SAAS,EAAQ,UAAU,SAAS,EAAQ,EAAM,KAAK,IAAI,EAAE,cAAc,GAAK,IAAI,IACzG,GACM,IAAoB,QACxB,EAAS,QAAQ,EAAQ,iBAAiB,SAAS,4BAA4B,EACjF,GAEM,UAAoB;EAExB,AADA,EAAM,QAAQ,EAAa,EAAQ,MAAM,KAAK,GAC9C,EAAM,kBAAkB,QAAQ;CAClC,GAEM,KAAS,MAAwB;EAKrC,AAJA,GAAO,iBAAiB,GACxB,EAAM,QAAQ,IACd,EAAQ,UAAU,KAAS,IAAI,WAAW,SAAS,EAAE,SAAS,GAAK,CAAC,GAAG,EAAE,GACzE,EAAQ,WAAW,KAAS,IAAI,MAAM,UAAU,EAAE,SAAS,GAAK,CAAC,GAAG,EAAE,GACtE,EAAM,kBAAkB,QAAQ;CAClC,GAEM,KAAQ,GAAiD,MAA0C;EACvG,IAAM,IAA8B,CAAC,GAC/B,KAAM,GAAc,MAAiC;GAEzD,AADA,EAAQ,iBAAiB,GAAM,CAAO,GACtC,EAAS,WAAW,EAAQ,oBAAoB,GAAM,CAAO,CAAC;EAChE;EAoBA,AAlBI,EAAQ,WACV,EAAG,UAAU,MAAM,EAAQ,QAAS,CAAe,CAAC,GAGtD,EAAG,UAAU,MAAM;GAIjB,AAHA,EAAE,gBAAgB,GAClB,EAAQ,gBAAgB,CAAC,GACzB,EAAM,QAAQ,EAAQ,OACtB,EAAQ,UAAU,GAAG,EAAQ,KAAK;EACpC,CAAC,GAED,EAAG,WAAW,MAAM;GAIlB,AAHA,EAAE,gBAAgB,GAClB,EAAM,QAAQ,EAAQ,OACtB,EAAQ,WAAW,GAAG,EAAQ,KAAK,GACnC,EAAM,kBAAkB,QAAQ;EAClC,CAAC,GAED,EAAG,SAAS,MAAM;GAEhB,AADA,EAAQ,SAAS,CAAe,GAChC,EAAM,kBAAkB,MAAM;EAChC,CAAC;EAED,IAAI,IAAW,IACT,UAAqB;GACrB,QAEJ;QAAW;IACX,KAAK,IAAM,KAAW,GAAU,EAAQ;GAD7B;EAEb;EAIA,OAFA,GAAQ,iBAAiB,SAAS,GAAQ,EAAE,MAAM,GAAK,CAAC,GAEjD;CACT;CAEA,OAAO;EAAE,GAAG;EAAO;EAAO;EAAS;EAAO;EAAmB;EAAU;EAAO;CAAK;AACrF"}
|
package/dist/headless.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./headless/ore.cjs"),t=require("./headless/field-base.cjs"),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./headless/ore.cjs"),t=require("./headless/auto-resize.cjs"),n=require("./headless/field-base.cjs"),r=require("./headless/signals.cjs"),i=require("./headless/text-field.cjs"),a=require("./headless/choice-field.cjs"),o=require("./headless/keyboard.cjs"),s=require("./headless/checkable.cjs"),c=require("./headless/composer.cjs"),l=require("./headless/typeahead.cjs"),u=require("./headless/nav.cjs"),d=require("./headless/overlay.cjs"),f=require("./headless/positioner.cjs"),p=require("./headless/option-list.cjs"),m=require("./headless/paginated-list.cjs"),h=require("./headless/numbers.cjs"),g=require("./headless/spinner.cjs"),_=require("./headless/slider.cjs"),v=require("./headless/swipe.cjs"),y=require("./headless/announcer.cjs"),b=require("./headless/date-picker.cjs"),x=require("./headless/dialog-focus.cjs"),S=require("./headless/light-dom.cjs"),C=require("./headless/selection-control.cjs"),w=require("./headless/sort-control.cjs"),T=require("./headless/datagrid.cjs"),E=require("./headless/parse.cjs");exports.announce=y.announce,exports.counterClassName=n.counterClassName,exports.createAssistiveState=n.createAssistiveState,exports.createAutoResize=t.createAutoResize,exports.createCheckable=s.createCheckable,exports.createChoiceField=a.createChoiceField,exports.createComposerControl=c.createComposerControl,exports.createDataGridControl=T.createDataGridControl,exports.createDatePickerControl=b.createDatePickerControl,exports.createDialogFocusControl=x.createDialogFocusControl,exports.createDropdownPositioner=f.createDropdownPositioner,exports.createErrorHelperState=n.createErrorHelperState,exports.createField=n.createField,exports.createInteraction=o.createInteraction,exports.createLabelState=n.createLabelState,exports.createListControl=u.createListControl,exports.createOptionList=p.createOptionList,exports.createOverlayControl=d.createOverlayControl,exports.createPaginatedList=m.createPaginatedList,exports.createSelectionControl=C.createSelectionControl,exports.createSliderControl=_.createSliderControl,exports.createSortControl=w.createSortControl,exports.createSpinnerControl=g.createSpinnerControl,exports.createSwipeControl=v.createSwipeControl,exports.createTextField=i.createTextField,exports.createTypeahead=l.createTypeahead,exports.dispatchKeyboardAction=o.dispatchKeyboardAction,exports.formatDisplayDate=b.formatDisplayDate,exports.getChoiceLabel=S.getChoiceLabel,exports.getLightChildrenByTag=S.getLightChildrenByTag,exports.lifecycleSignal=e.lifecycleSignal,exports.parseIso=b.parseIso,exports.parseStringTriggers=E.parseStringTriggers,exports.syncedSignal=r.syncedSignal,exports.toFiniteNumber=h.toFiniteNumber,exports.toFiniteNumberOr=h.toFiniteNumberOr,exports.toIsoString=b.toIsoString,exports.toPositiveStep=h.toPositiveStep;
|
package/dist/headless.js
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { lifecycleSignal as e } from "./headless/ore.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
2
|
+
import { createAutoResize as t } from "./headless/auto-resize.js";
|
|
3
|
+
import { counterClassName as n, createAssistiveState as r, createErrorHelperState as i, createField as a, createLabelState as o } from "./headless/field-base.js";
|
|
4
|
+
import { syncedSignal as s } from "./headless/signals.js";
|
|
5
|
+
import { createTextField as c } from "./headless/text-field.js";
|
|
6
|
+
import { createChoiceField as l } from "./headless/choice-field.js";
|
|
7
|
+
import { createInteraction as u, dispatchKeyboardAction as d } from "./headless/keyboard.js";
|
|
8
|
+
import { createCheckable as f } from "./headless/checkable.js";
|
|
9
|
+
import { createComposerControl as p } from "./headless/composer.js";
|
|
10
|
+
import { createTypeahead as m } from "./headless/typeahead.js";
|
|
11
|
+
import { createListControl as h } from "./headless/nav.js";
|
|
12
|
+
import { createOverlayControl as g } from "./headless/overlay.js";
|
|
13
|
+
import { createDropdownPositioner as _ } from "./headless/positioner.js";
|
|
14
|
+
import { createOptionList as v } from "./headless/option-list.js";
|
|
15
|
+
import { createPaginatedList as y } from "./headless/paginated-list.js";
|
|
16
|
+
import { toFiniteNumber as b, toFiniteNumberOr as x, toPositiveStep as S } from "./headless/numbers.js";
|
|
17
|
+
import { createSpinnerControl as C } from "./headless/spinner.js";
|
|
18
|
+
import { createSliderControl as w } from "./headless/slider.js";
|
|
19
|
+
import { createSwipeControl as T } from "./headless/swipe.js";
|
|
20
|
+
import { announce as E } from "./headless/announcer.js";
|
|
21
|
+
import { createDatePickerControl as D, formatDisplayDate as O, parseIso as k, toIsoString as A } from "./headless/date-picker.js";
|
|
22
|
+
import { createDialogFocusControl as j } from "./headless/dialog-focus.js";
|
|
23
|
+
import { getChoiceLabel as M, getLightChildrenByTag as N } from "./headless/light-dom.js";
|
|
24
|
+
import { createSelectionControl as P } from "./headless/selection-control.js";
|
|
25
|
+
import { createSortControl as F } from "./headless/sort-control.js";
|
|
26
|
+
import { createDataGridControl as I } from "./headless/datagrid.js";
|
|
27
|
+
import { parseStringTriggers as L } from "./headless/parse.js";
|
|
28
|
+
export { E as announce, n as counterClassName, r as createAssistiveState, t as createAutoResize, f as createCheckable, l as createChoiceField, p as createComposerControl, I as createDataGridControl, D as createDatePickerControl, j as createDialogFocusControl, _ as createDropdownPositioner, i as createErrorHelperState, a as createField, u as createInteraction, o as createLabelState, h as createListControl, v as createOptionList, g as createOverlayControl, y as createPaginatedList, P as createSelectionControl, w as createSliderControl, F as createSortControl, C as createSpinnerControl, T as createSwipeControl, c as createTextField, m as createTypeahead, d as dispatchKeyboardAction, O as formatDisplayDate, M as getChoiceLabel, N as getLightChildrenByTag, e as lifecycleSignal, k as parseIso, L as parseStringTriggers, s as syncedSignal, b as toFiniteNumber, x as toFiniteNumberOr, A as toIsoString, S as toPositiveStep };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./code-window.cjs"),t=require("./icon.cjs"),n=require("./copy-command.cjs"),r=require("./shared/prop-bundles.cjs"),i=require("./shared/size-presets.cjs"),a=require("./progress.cjs"),o=require("./errors.cjs"),ee=require("./content/carousel/carousel-slide.cjs"),s=require("./carousel.cjs"),c=require("./avatar.cjs"),l=require("./breadcrumb.cjs"),u=require("./card.cjs"),d=require("./chat-message.cjs"),f=require("./button-group.cjs"),te=require("./inputs/shared/form-context.cjs"),ne=require("./button.cjs"),re=require("./pagination.cjs"),p=require("./separator.cjs"),m=require("./table.cjs"),h=require("./text.cjs"),g=require("./accordion.cjs"),_=require("./tabs.cjs"),v=require("./accordion-item.cjs"),y=require("./tab-item.cjs"),b=require("./tab-panel.cjs"),x=require("./async.cjs"),S=require("./alert.cjs"),C=require("./badge.cjs"),w=require("./chip.cjs"),T=require("./password-strength.cjs"),E=require("./skeleton.cjs"),D=require("./typing-indicator.cjs"),O=require("./toast.cjs"),k=require("./checkbox-group.cjs"),A=require("./checkbox.cjs"),j=require("./input.cjs"),M=require("./combobox.cjs"),ie=require("./select.cjs"),N=require("./popover.cjs"),P=require("./datagrid.cjs"),F=require("./calendar.cjs"),I=require("./date-picker.cjs"),L=require("./file-input.cjs"),R=require("./form.cjs"),z=require("./number-input.cjs"),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./code-window.cjs"),t=require("./icon.cjs"),n=require("./copy-command.cjs"),r=require("./shared/prop-bundles.cjs"),i=require("./shared/size-presets.cjs"),a=require("./progress.cjs"),o=require("./errors.cjs"),ee=require("./content/carousel/carousel-slide.cjs"),s=require("./carousel.cjs"),c=require("./avatar.cjs"),l=require("./breadcrumb.cjs"),u=require("./card.cjs"),d=require("./chat-message.cjs"),f=require("./button-group.cjs"),te=require("./inputs/shared/form-context.cjs"),ne=require("./button.cjs"),re=require("./pagination.cjs"),p=require("./separator.cjs"),m=require("./table.cjs"),h=require("./text.cjs"),g=require("./accordion.cjs"),_=require("./tabs.cjs"),v=require("./accordion-item.cjs"),y=require("./tab-item.cjs"),b=require("./tab-panel.cjs"),x=require("./async.cjs"),S=require("./alert.cjs"),C=require("./badge.cjs"),w=require("./chip.cjs"),T=require("./password-strength.cjs"),E=require("./skeleton.cjs"),D=require("./typing-indicator.cjs"),O=require("./toast.cjs"),k=require("./checkbox-group.cjs"),A=require("./checkbox.cjs"),j=require("./input.cjs"),M=require("./combobox.cjs"),ie=require("./select.cjs"),N=require("./popover.cjs"),P=require("./datagrid.cjs"),F=require("./calendar.cjs"),I=require("./date-picker.cjs"),L=require("./file-input.cjs"),R=require("./form.cjs"),z=require("./message-composer.cjs"),B=require("./number-input.cjs"),V=require("./otp-input.cjs"),H=require("./radio-group.cjs"),U=require("./radio.cjs"),W=require("./rating.cjs"),G=require("./slider.cjs"),K=require("./switch.cjs"),q=require("./textarea.cjs"),J=require("./time-picker.cjs"),Y=require("./box.cjs"),ae=require("./grid-item.cjs"),oe=require("./grid.cjs"),X=require("./navbar.cjs"),Z=require("./sidebar.cjs"),Q=require("./command-palette.cjs"),se=require("./dialog.cjs"),ce=require("./drawer.cjs"),$=require("./menu.cjs"),le=require("./tooltip.cjs");exports.ACCORDION_CTX=g.ACCORDION_CTX,exports.ACCORDION_ITEM_TAG=v.ACCORDION_ITEM_TAG,exports.ACCORDION_TAG=g.ACCORDION_TAG,exports.ALERT_TAG=S.ALERT_TAG,exports.ASYNC_TAG=x.ASYNC_TAG,exports.AVATAR_GROUP_TAG=c.AVATAR_GROUP_TAG,exports.AVATAR_TAG=c.AVATAR_TAG,exports.BADGE_TAG=C.BADGE_TAG,exports.BOX_TAG=Y.BOX_TAG,exports.BREADCRUMB_ITEM_TAG=l.BREADCRUMB_ITEM_TAG,exports.BREADCRUMB_TAG=l.BREADCRUMB_TAG,exports.BUTTON_GROUP_CTX=f.BUTTON_GROUP_CTX,exports.BUTTON_GROUP_TAG=f.BUTTON_GROUP_TAG,exports.BUTTON_TAG=ne.BUTTON_TAG,exports.CALENDAR_TAG=F.CALENDAR_TAG,exports.CARD_TAG=u.CARD_TAG,exports.CAROUSEL_SLIDE_TAG=ee.CAROUSEL_SLIDE_TAG,exports.CAROUSEL_TAG=s.CAROUSEL_TAG,exports.CHAT_MESSAGE_TAG=d.CHAT_MESSAGE_TAG,exports.CHECKBOX_GROUP_CTX=k.CHECKBOX_GROUP_CTX,exports.CHECKBOX_GROUP_TAG=k.CHECKBOX_GROUP_TAG,exports.CHECKBOX_TAG=A.CHECKBOX_TAG,exports.CHIP_TAG=w.CHIP_TAG,exports.CODE_WINDOW_TAG=e.CODE_WINDOW_TAG,exports.COMBOBOX_TAG=M.COMBOBOX_TAG,exports.COMMAND_PALETTE_ITEM_TAG=Q.COMMAND_PALETTE_ITEM_TAG,exports.COMMAND_PALETTE_TAG=Q.COMMAND_PALETTE_TAG,exports.CONTROL_SIZE_PRESET=i.CONTROL_SIZE_PRESET,exports.COPY_COMMAND_TAG=n.COPY_COMMAND_TAG,exports.DATAGRID_TAG=P.DATAGRID_TAG,exports.DATE_PICKER_TAG=I.DATE_PICKER_TAG,exports.DIALOG_TAG=se.DIALOG_TAG,exports.DRAWER_TAG=ce.DRAWER_TAG,exports.FIELD_SIZE_PRESET=i.FIELD_SIZE_PRESET,exports.FILE_INPUT_SIZE_PRESET=i.FILE_INPUT_SIZE_PRESET,exports.FILE_INPUT_TAG=L.FILE_INPUT_TAG,exports.FORM_CTX=te.FORM_CTX,exports.FORM_TAG=R.FORM_TAG,exports.GRID_ITEM_TAG=ae.GRID_ITEM_TAG,exports.GRID_TAG=oe.GRID_TAG,exports.ICON_TAG=t.ICON_TAG,exports.INPUT_TAG=j.INPUT_TAG,exports.MENU_ITEM_TAG=$.MENU_ITEM_TAG,exports.MENU_TAG=$.MENU_TAG,exports.MESSAGE_COMPOSER_SIZE_PRESET=i.MESSAGE_COMPOSER_SIZE_PRESET,exports.MESSAGE_COMPOSER_TAG=z.MESSAGE_COMPOSER_TAG,exports.NAVBAR_CTX=X.NAVBAR_CTX,exports.NAVBAR_ITEM_TAG=X.NAVBAR_ITEM_TAG,exports.NAVBAR_TAG=X.NAVBAR_TAG,exports.NUMBER_INPUT_TAG=B.NUMBER_INPUT_TAG,exports.OTP_INPUT_TAG=V.OTP_INPUT_TAG,exports.PAGINATION_TAG=re.PAGINATION_TAG,exports.PASSWORD_STRENGTH_TAG=T.PASSWORD_STRENGTH_TAG,exports.POPOVER_TAG=N.POPOVER_TAG,exports.PROGRESS_TAG=a.PROGRESS_TAG,exports.RADIO_GROUP_CTX=H.RADIO_GROUP_CTX,exports.RADIO_GROUP_TAG=H.RADIO_GROUP_TAG,exports.RADIO_TAG=U.RADIO_TAG,exports.RATING_TAG=W.RATING_TAG,exports.RefineConfigError=o.RefineConfigError,exports.RefineError=o.RefineError,exports.SELECT_TAG=ie.SELECT_TAG,exports.SEPARATOR_TAG=p.SEPARATOR_TAG,exports.SIDEBAR_CTX=Z.SIDEBAR_CTX,exports.SIDEBAR_GROUP_TAG=Z.SIDEBAR_GROUP_TAG,exports.SIDEBAR_ITEM_TAG=Z.SIDEBAR_ITEM_TAG,exports.SIDEBAR_TAG=Z.SIDEBAR_TAG,exports.SKELETON_TAG=E.SKELETON_TAG,exports.SLIDER_SIZE_PRESET=i.SLIDER_SIZE_PRESET,exports.SLIDER_TAG=G.SLIDER_TAG,exports.SWITCH_SIZE_PRESET=i.SWITCH_SIZE_PRESET,exports.SWITCH_TAG=K.SWITCH_TAG,exports.TABLE_TAG=m.TABLE_TAG,exports.TABS_CTX=_.TABS_CTX,exports.TABS_TAG=_.TABS_TAG,exports.TAB_ITEM_TAG=y.TAB_ITEM_TAG,exports.TAB_PANEL_TAG=b.TAB_PANEL_TAG,exports.TEXTAREA_SIZE_PRESET=i.TEXTAREA_SIZE_PRESET,exports.TEXTAREA_TAG=q.TEXTAREA_TAG,exports.TEXT_TAG=h.TEXT_TAG,exports.TIME_PICKER_TAG=J.TIME_PICKER_TAG,exports.TOAST_TAG=O.TOAST_TAG,exports.TOOLTIP_TAG=le.TOOLTIP_TAG,exports.TYPING_INDICATOR_TAG=D.TYPING_INDICATOR_TAG,exports.commonProps=r.commonProps,exports.createToastService=O.createToastService,exports.disablableBundle=r.disablableBundle,exports.elevatableBundle=r.elevatableBundle,exports.loadableBundle=r.loadableBundle,exports.registerIcons=t.registerIcons,exports.roundableBundle=r.roundableBundle,exports.sizableBundle=r.sizableBundle,exports.themableBundle=r.themableBundle,exports.toast=O.toast;
|
package/dist/index.js
CHANGED
|
@@ -2,63 +2,64 @@ import { CODE_WINDOW_TAG as e } from "./code-window.js";
|
|
|
2
2
|
import { ICON_TAG as t, registerIcons as n } from "./icon.js";
|
|
3
3
|
import { COPY_COMMAND_TAG as r } from "./copy-command.js";
|
|
4
4
|
import { commonProps as i, disablableBundle as a, elevatableBundle as o, loadableBundle as s, roundableBundle as c, sizableBundle as l, themableBundle as u } from "./shared/prop-bundles.js";
|
|
5
|
-
import { CONTROL_SIZE_PRESET as d, FIELD_SIZE_PRESET as f, FILE_INPUT_SIZE_PRESET as p,
|
|
6
|
-
import { PROGRESS_TAG as
|
|
7
|
-
import { RefineConfigError as
|
|
8
|
-
import { CAROUSEL_SLIDE_TAG as
|
|
9
|
-
import { CAROUSEL_TAG as
|
|
10
|
-
import { AVATAR_GROUP_TAG as
|
|
11
|
-
import { BREADCRUMB_ITEM_TAG as
|
|
12
|
-
import { CARD_TAG as
|
|
13
|
-
import { CHAT_MESSAGE_TAG as
|
|
14
|
-
import { BUTTON_GROUP_CTX as
|
|
15
|
-
import { FORM_CTX as
|
|
16
|
-
import { BUTTON_TAG as
|
|
17
|
-
import { PAGINATION_TAG as
|
|
18
|
-
import { SEPARATOR_TAG as
|
|
19
|
-
import { TABLE_TAG as
|
|
20
|
-
import { TEXT_TAG as
|
|
21
|
-
import { ACCORDION_CTX as
|
|
22
|
-
import { TABS_CTX as
|
|
23
|
-
import { ACCORDION_ITEM_TAG as
|
|
24
|
-
import { TAB_ITEM_TAG as
|
|
25
|
-
import { TAB_PANEL_TAG as
|
|
26
|
-
import { ASYNC_TAG as
|
|
27
|
-
import { ALERT_TAG as
|
|
28
|
-
import { BADGE_TAG as
|
|
29
|
-
import { CHIP_TAG as
|
|
30
|
-
import { PASSWORD_STRENGTH_TAG as
|
|
31
|
-
import { SKELETON_TAG as
|
|
32
|
-
import { TYPING_INDICATOR_TAG as
|
|
33
|
-
import { TOAST_TAG as
|
|
34
|
-
import { CHECKBOX_GROUP_CTX as
|
|
35
|
-
import { CHECKBOX_TAG as
|
|
36
|
-
import { INPUT_TAG as
|
|
37
|
-
import { COMBOBOX_TAG as
|
|
38
|
-
import { SELECT_TAG as
|
|
39
|
-
import { POPOVER_TAG as
|
|
40
|
-
import { DATAGRID_TAG as
|
|
41
|
-
import { CALENDAR_TAG as
|
|
42
|
-
import { DATE_PICKER_TAG as
|
|
43
|
-
import { FILE_INPUT_TAG as
|
|
44
|
-
import { FORM_TAG as
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
|
|
5
|
+
import { CONTROL_SIZE_PRESET as d, FIELD_SIZE_PRESET as f, FILE_INPUT_SIZE_PRESET as p, MESSAGE_COMPOSER_SIZE_PRESET as m, SLIDER_SIZE_PRESET as h, SWITCH_SIZE_PRESET as g, TEXTAREA_SIZE_PRESET as _ } from "./shared/size-presets.js";
|
|
6
|
+
import { PROGRESS_TAG as v } from "./progress.js";
|
|
7
|
+
import { RefineConfigError as y, RefineError as b } from "./errors.js";
|
|
8
|
+
import { CAROUSEL_SLIDE_TAG as x } from "./content/carousel/carousel-slide.js";
|
|
9
|
+
import { CAROUSEL_TAG as S } from "./carousel.js";
|
|
10
|
+
import { AVATAR_GROUP_TAG as C, AVATAR_TAG as w } from "./avatar.js";
|
|
11
|
+
import { BREADCRUMB_ITEM_TAG as T, BREADCRUMB_TAG as E } from "./breadcrumb.js";
|
|
12
|
+
import { CARD_TAG as D } from "./card.js";
|
|
13
|
+
import { CHAT_MESSAGE_TAG as O } from "./chat-message.js";
|
|
14
|
+
import { BUTTON_GROUP_CTX as k, BUTTON_GROUP_TAG as A } from "./button-group.js";
|
|
15
|
+
import { FORM_CTX as j } from "./inputs/shared/form-context.js";
|
|
16
|
+
import { BUTTON_TAG as M } from "./button.js";
|
|
17
|
+
import { PAGINATION_TAG as N } from "./pagination.js";
|
|
18
|
+
import { SEPARATOR_TAG as P } from "./separator.js";
|
|
19
|
+
import { TABLE_TAG as F } from "./table.js";
|
|
20
|
+
import { TEXT_TAG as I } from "./text.js";
|
|
21
|
+
import { ACCORDION_CTX as L, ACCORDION_TAG as R } from "./accordion.js";
|
|
22
|
+
import { TABS_CTX as z, TABS_TAG as B } from "./tabs.js";
|
|
23
|
+
import { ACCORDION_ITEM_TAG as V } from "./accordion-item.js";
|
|
24
|
+
import { TAB_ITEM_TAG as H } from "./tab-item.js";
|
|
25
|
+
import { TAB_PANEL_TAG as U } from "./tab-panel.js";
|
|
26
|
+
import { ASYNC_TAG as W } from "./async.js";
|
|
27
|
+
import { ALERT_TAG as G } from "./alert.js";
|
|
28
|
+
import { BADGE_TAG as K } from "./badge.js";
|
|
29
|
+
import { CHIP_TAG as q } from "./chip.js";
|
|
30
|
+
import { PASSWORD_STRENGTH_TAG as J } from "./password-strength.js";
|
|
31
|
+
import { SKELETON_TAG as Y } from "./skeleton.js";
|
|
32
|
+
import { TYPING_INDICATOR_TAG as X } from "./typing-indicator.js";
|
|
33
|
+
import { TOAST_TAG as Z, createToastService as Q, toast as $ } from "./toast.js";
|
|
34
|
+
import { CHECKBOX_GROUP_CTX as ee, CHECKBOX_GROUP_TAG as te } from "./checkbox-group.js";
|
|
35
|
+
import { CHECKBOX_TAG as ne } from "./checkbox.js";
|
|
36
|
+
import { INPUT_TAG as re } from "./input.js";
|
|
37
|
+
import { COMBOBOX_TAG as ie } from "./combobox.js";
|
|
38
|
+
import { SELECT_TAG as ae } from "./select.js";
|
|
39
|
+
import { POPOVER_TAG as oe } from "./popover.js";
|
|
40
|
+
import { DATAGRID_TAG as se } from "./datagrid.js";
|
|
41
|
+
import { CALENDAR_TAG as ce } from "./calendar.js";
|
|
42
|
+
import { DATE_PICKER_TAG as le } from "./date-picker.js";
|
|
43
|
+
import { FILE_INPUT_TAG as ue } from "./file-input.js";
|
|
44
|
+
import { FORM_TAG as de } from "./form.js";
|
|
45
|
+
import { MESSAGE_COMPOSER_TAG as fe } from "./message-composer.js";
|
|
46
|
+
import { NUMBER_INPUT_TAG as pe } from "./number-input.js";
|
|
47
|
+
import { OTP_INPUT_TAG as me } from "./otp-input.js";
|
|
48
|
+
import { RADIO_GROUP_CTX as he, RADIO_GROUP_TAG as ge } from "./radio-group.js";
|
|
49
|
+
import { RADIO_TAG as _e } from "./radio.js";
|
|
50
|
+
import { RATING_TAG as ve } from "./rating.js";
|
|
51
|
+
import { SLIDER_TAG as ye } from "./slider.js";
|
|
52
|
+
import { SWITCH_TAG as be } from "./switch.js";
|
|
53
|
+
import { TEXTAREA_TAG as xe } from "./textarea.js";
|
|
54
|
+
import { TIME_PICKER_TAG as Se } from "./time-picker.js";
|
|
55
|
+
import { BOX_TAG as Ce } from "./box.js";
|
|
56
|
+
import { GRID_ITEM_TAG as we } from "./grid-item.js";
|
|
57
|
+
import { GRID_TAG as Te } from "./grid.js";
|
|
58
|
+
import { NAVBAR_CTX as Ee, NAVBAR_ITEM_TAG as De, NAVBAR_TAG as Oe } from "./navbar.js";
|
|
59
|
+
import { SIDEBAR_CTX as ke, SIDEBAR_GROUP_TAG as Ae, SIDEBAR_ITEM_TAG as je, SIDEBAR_TAG as Me } from "./sidebar.js";
|
|
60
|
+
import { COMMAND_PALETTE_ITEM_TAG as Ne, COMMAND_PALETTE_TAG as Pe } from "./command-palette.js";
|
|
61
|
+
import { DIALOG_TAG as Fe } from "./dialog.js";
|
|
62
|
+
import { DRAWER_TAG as Ie } from "./drawer.js";
|
|
63
|
+
import { MENU_ITEM_TAG as Le, MENU_TAG as Re } from "./menu.js";
|
|
64
|
+
import { TOOLTIP_TAG as ze } from "./tooltip.js";
|
|
65
|
+
export { L as ACCORDION_CTX, V as ACCORDION_ITEM_TAG, R as ACCORDION_TAG, G as ALERT_TAG, W as ASYNC_TAG, C as AVATAR_GROUP_TAG, w as AVATAR_TAG, K as BADGE_TAG, Ce as BOX_TAG, T as BREADCRUMB_ITEM_TAG, E as BREADCRUMB_TAG, k as BUTTON_GROUP_CTX, A as BUTTON_GROUP_TAG, M as BUTTON_TAG, ce as CALENDAR_TAG, D as CARD_TAG, x as CAROUSEL_SLIDE_TAG, S as CAROUSEL_TAG, O as CHAT_MESSAGE_TAG, ee as CHECKBOX_GROUP_CTX, te as CHECKBOX_GROUP_TAG, ne as CHECKBOX_TAG, q as CHIP_TAG, e as CODE_WINDOW_TAG, ie as COMBOBOX_TAG, Ne as COMMAND_PALETTE_ITEM_TAG, Pe as COMMAND_PALETTE_TAG, d as CONTROL_SIZE_PRESET, r as COPY_COMMAND_TAG, se as DATAGRID_TAG, le as DATE_PICKER_TAG, Fe as DIALOG_TAG, Ie as DRAWER_TAG, f as FIELD_SIZE_PRESET, p as FILE_INPUT_SIZE_PRESET, ue as FILE_INPUT_TAG, j as FORM_CTX, de as FORM_TAG, we as GRID_ITEM_TAG, Te as GRID_TAG, t as ICON_TAG, re as INPUT_TAG, Le as MENU_ITEM_TAG, Re as MENU_TAG, m as MESSAGE_COMPOSER_SIZE_PRESET, fe as MESSAGE_COMPOSER_TAG, Ee as NAVBAR_CTX, De as NAVBAR_ITEM_TAG, Oe as NAVBAR_TAG, pe as NUMBER_INPUT_TAG, me as OTP_INPUT_TAG, N as PAGINATION_TAG, J as PASSWORD_STRENGTH_TAG, oe as POPOVER_TAG, v as PROGRESS_TAG, he as RADIO_GROUP_CTX, ge as RADIO_GROUP_TAG, _e as RADIO_TAG, ve as RATING_TAG, y as RefineConfigError, b as RefineError, ae as SELECT_TAG, P as SEPARATOR_TAG, ke as SIDEBAR_CTX, Ae as SIDEBAR_GROUP_TAG, je as SIDEBAR_ITEM_TAG, Me as SIDEBAR_TAG, Y as SKELETON_TAG, h as SLIDER_SIZE_PRESET, ye as SLIDER_TAG, g as SWITCH_SIZE_PRESET, be as SWITCH_TAG, F as TABLE_TAG, z as TABS_CTX, B as TABS_TAG, H as TAB_ITEM_TAG, U as TAB_PANEL_TAG, _ as TEXTAREA_SIZE_PRESET, xe as TEXTAREA_TAG, I as TEXT_TAG, Se as TIME_PICKER_TAG, Z as TOAST_TAG, ze as TOOLTIP_TAG, X as TYPING_INDICATOR_TAG, i as commonProps, Q as createToastService, a as disablableBundle, o as elevatableBundle, s as loadableBundle, n as registerIcons, c as roundableBundle, l as sizableBundle, u as themableBundle, $ as toast };
|
package/dist/input.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./ore/dist/directives/live.cjs");require("./ore/dist/directives.cjs");const t=require("./styles/mixins/shape.css.cjs"),n=require("./styles/mixins/theme.css.cjs"),r=require("./styles/index.cjs"),i=require("./shared/prop-bundles.cjs"),a=require("./shared/size-presets.cjs"),o=require("./headless/ore.cjs"),s=require("./headless/text-field.cjs"),c=require("./ore/dist/forms/field.cjs");require("./ore/dist/forms.cjs");const l=require("./inputs/shared/form-context.cjs"),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./ore/dist/directives/live.cjs");require("./ore/dist/directives.cjs");const t=require("./styles/mixins/shape.css.cjs"),n=require("./styles/mixins/theme.css.cjs"),r=require("./styles/index.cjs"),i=require("./shared/prop-bundles.cjs"),a=require("./shared/size-presets.cjs"),o=require("./headless/ore.cjs"),s=require("./headless/text-field.cjs"),c=require("./ore/dist/forms/field.cjs");require("./ore/dist/forms.cjs");const l=require("./inputs/shared/field-binding.cjs"),u=require("./inputs/shared/form-context.cjs"),d=require("./inputs/input/input.css.cjs");let f=require("@vielzeug/ore"),p=require("@vielzeug/ripple");var m=[`text`,`email`,`password`,`search`,`url`,`tel`,`number`,`date`,`time`,`datetime-local`,`month`,`week`],h=`ore-input`;(0,f.define)(h,{formAssociated:!0,props:{...i.themableBundle,...i.sizableBundle,...i.disablableBundle,...i.roundableBundle,autocomplete:f.prop.string(),clearable:f.prop.bool(!1),error:f.prop.string(),fullwidth:f.prop.bool(!1),helper:f.prop.string(),inputmode:f.prop.string(),label:f.prop.string(),"label-placement":f.prop.oneOf([`inset`,`outside`],`inset`),maxlength:f.prop.json(void 0),minlength:f.prop.json(void 0),name:f.prop.string(),pattern:f.prop.string(),placeholder:f.prop.string(),readonly:f.prop.bool(!1),ref:f.prop.json(void 0),required:f.prop.bool(!1),type:f.prop.oneOf(m,`text`),value:f.prop.string(),variant:f.prop.string()},setup(t){let n=(0,f.useEmit)(),r=(0,f.useSlots)(),i=(0,f.inject)(u.FORM_CTX),a=u.useFormContext(t,i),d=(0,p.signal)(!1),m=(0,f.ref)(),h=(0,p.computed)(()=>!!t.label.value||r.has(`label`).value),g=o.lifecycleSignal(f.onCleanup),_=s.createTextField({disabled:a.disabled,error:t.error,hasLabel:h,helper:t.helper,label:t.label,labelPlacement:t[`label-placement`],maxLength:t.maxlength,onChange:(e,t)=>{n(`change`,{originalEvent:e,value:t})},onInput:(e,t)=>{n(`input`,{originalEvent:e,value:t})},prefix:`input`,readonly:t.readonly,required:t.required,signal:g,validateOn:i?.validateOn,value:t.value});_.attachFormField(c.useField({disabled:_.disabled,onReset:_.reset,toFormValue:e=>e,validationMessage:_.validationMessage,validity:_.validity,value:_.value}));let{ariaDescribedBy:v,ariaErrorMessage:y,ariaInvalid:b,ariaLabelledBy:x,assistiveId:S,clear:C,counter:w,errorId:T,errorText:E,fieldId:D,helperText:O,labelId:k,labelVisible:A,value:j,wire:M}=_;return(0,f.onElement)(m,e=>{M(e,g),t.ref.value?.(e);let n=(0,p.watch)(t.ref,t=>{t?.(e)});return()=>{n.dispose(),t.ref.value?.(null)}}),(0,f.bind)({attr:{error:l.errorAttr(E),"has-value":()=>j.value?!0:void 0,size:a.size,variant:a.variant}}),f.html`
|
|
2
2
|
<div class="input-wrapper" part="wrapper">
|
|
3
3
|
<label class="label" for="${D}" id="${k}" part="label" ?hidden="${()=>!A.value}"
|
|
4
4
|
><slot name="label">${t.label}</slot></label
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
9
9
|
<input
|
|
10
10
|
part="input"
|
|
11
11
|
id="${D}"
|
|
12
|
-
:type="${()=>t.type.value===`password`&&
|
|
12
|
+
:type="${()=>t.type.value===`password`&&d.value?`text`:t.type.value??`text`}"
|
|
13
13
|
:name="${t.name}"
|
|
14
14
|
:placeholder="${t.placeholder}"
|
|
15
15
|
:autocomplete="${t.autocomplete}"
|
|
@@ -25,17 +25,17 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
25
25
|
:aria-describedby="${v}"
|
|
26
26
|
:aria-errormessage="${y}"
|
|
27
27
|
:aria-invalid="${b}"
|
|
28
|
-
ref="${
|
|
28
|
+
ref="${m}" />
|
|
29
29
|
<slot name="suffix"></slot>
|
|
30
30
|
<button
|
|
31
31
|
class="pwd-toggle-btn"
|
|
32
32
|
part="pwd-toggle"
|
|
33
33
|
type="button"
|
|
34
|
-
:aria-label="${()=>
|
|
35
|
-
:aria-pressed="${()=>String(
|
|
34
|
+
:aria-label="${()=>d.value?`Hide password`:`Show password`}"
|
|
35
|
+
:aria-pressed="${()=>String(d.value)}"
|
|
36
36
|
:tabindex="${()=>t.type.value===`password`?`0`:`-1`}"
|
|
37
|
-
@click="${()=>{
|
|
38
|
-
${()=>
|
|
37
|
+
@click="${()=>{d.value=!d.value,m.value?.focus()}}">
|
|
38
|
+
${()=>d.value?f.html`<ore-icon name="eye-off" size="14" stroke-width="2" aria-hidden="true"></ore-icon>`:f.html`<ore-icon name="eye" size="14" stroke-width="2" aria-hidden="true"></ore-icon>`}
|
|
39
39
|
</button>
|
|
40
40
|
<button
|
|
41
41
|
aria-label="Clear"
|
|
@@ -43,7 +43,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
43
43
|
part="clear"
|
|
44
44
|
type="button"
|
|
45
45
|
:tabindex="${()=>j.value?`0`:`-1`}"
|
|
46
|
-
@click="${e=>{C(e),
|
|
46
|
+
@click="${e=>{C(e),m.value?.focus()}}">
|
|
47
47
|
<ore-icon aria-hidden="true" name="x" size="12" stroke-width="2.5"></ore-icon>
|
|
48
48
|
</button>
|
|
49
49
|
</div>
|
|
@@ -63,5 +63,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
63
63
|
${()=>w?.value.counterText??``}
|
|
64
64
|
</div>
|
|
65
65
|
</div>
|
|
66
|
-
`},shadow:{delegatesFocus:!0},styles:[...r.fieldMixins,t.sizeVariantMixin(a.FIELD_SIZE_PRESET),n.forcedColorsFocusMixin(`input`),
|
|
66
|
+
`},shadow:{delegatesFocus:!0},styles:[...r.fieldMixins,t.sizeVariantMixin(a.FIELD_SIZE_PRESET),n.forcedColorsFocusMixin(`input`),d.default]}),exports.INPUT_TAG=h;
|
|
67
67
|
//# sourceMappingURL=input.cjs.map
|