@fragiola/primitives-vue 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/autocomplete-virtual.d.ts +1 -1
  3. package/dist/autocomplete.d.ts +1 -1
  4. package/dist/calendar-preset.d.ts +1 -1
  5. package/dist/calendar-view.d.ts +1 -1
  6. package/dist/calendar.d.ts +1 -1
  7. package/dist/cascade-select.d.ts +1 -1
  8. package/dist/{combobox-virtual-DTRTVq5N.js → combobox-virtual-BDWkgERh.js} +2 -2
  9. package/dist/{combobox-virtual-DTRTVq5N.js.map → combobox-virtual-BDWkgERh.js.map} +1 -1
  10. package/dist/combobox-virtual.d.ts +1 -1
  11. package/dist/combobox-virtual.js +2 -2
  12. package/dist/combobox.d.ts +1 -1
  13. package/dist/combobox.js +1 -1
  14. package/dist/command-virtual.d.ts +1 -1
  15. package/dist/date-field.d.ts +1 -1
  16. package/dist/date-picker-input.d.ts +1 -1
  17. package/dist/date-range-field.d.ts +1 -1
  18. package/dist/date-range-picker-input.d.ts +1 -1
  19. package/dist/{index-t_lSQgLA.d.ts → index-g8zeeaxp.d.ts} +3 -1
  20. package/dist/{index-B8E3X1CK.d.ts → index-lXj_BUUG.d.ts} +5 -0
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +3 -3
  23. package/dist/listbox-virtual.d.ts +1 -1
  24. package/dist/meter.d.ts +1 -1
  25. package/dist/month-calendar.d.ts +1 -1
  26. package/dist/month-range-calendar.d.ts +1 -1
  27. package/dist/multiple-calendar.d.ts +1 -1
  28. package/dist/{number-field-CqxEnwiS.js → number-field-D5pM1f30.js} +28 -4
  29. package/dist/number-field-D5pM1f30.js.map +1 -0
  30. package/dist/number-field.d.ts +1 -1
  31. package/dist/number-field.js +1 -1
  32. package/dist/{parts--mC44S1N.js → parts-DOWIiUdN.js} +13 -3
  33. package/dist/parts-DOWIiUdN.js.map +1 -0
  34. package/dist/progress.d.ts +1 -1
  35. package/dist/range-calendar.d.ts +1 -1
  36. package/dist/select-virtual.d.ts +1 -1
  37. package/dist/slider.d.ts +1 -1
  38. package/dist/time-field.d.ts +1 -1
  39. package/dist/time-range-field.d.ts +1 -1
  40. package/dist/year-calendar.d.ts +1 -1
  41. package/dist/year-range-calendar.d.ts +1 -1
  42. package/package.json +2 -2
  43. package/dist/number-field-CqxEnwiS.js.map +0 -1
  44. package/dist/parts--mC44S1N.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @fragiola/primitives-vue
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#123](https://github.com/fragiola/primitives/pull/123) [`18fd0ff`](https://github.com/fragiola/primitives/commit/18fd0ff180f8b7af9586db77b67b105281b89242) Thanks [@maurodesouza](https://github.com/maurodesouza)! - NumberField reports the committed value: `onValueCommitted` (Vue `@value-committed`, Angular `(valueCommitted)`) is called once a change is complete, on blur after typing, at a key or wheel step, at the release of a button press or a scrub. The toolkit's `watchAutoRepeat` takes an `onEnd` callback.
8
+
9
+ Combobox takes `autoHighlight`: typing highlights the first item the text keeps, so Enter chooses it, as Autocomplete's.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`18fd0ff`](https://github.com/fragiola/primitives/commit/18fd0ff180f8b7af9586db77b67b105281b89242)]:
14
+ - @fragiola/primitives@0.2.0
15
+
3
16
  ## 0.1.0
4
17
 
5
18
  ### Minor Changes
@@ -1,2 +1,2 @@
1
- import { Bi as VirtualListProps, i as Autocomplete, n as AutocompleteVirtualListProps, r as AutocompleteVirtualListSlots, t as AutocompleteVirtual, zi as VirtualListEmits } from "./index-t_lSQgLA.js";
1
+ import { Bi as VirtualListProps, i as Autocomplete, n as AutocompleteVirtualListProps, r as AutocompleteVirtualListSlots, t as AutocompleteVirtual, zi as VirtualListEmits } from "./index-g8zeeaxp.js";
2
2
  export { Autocomplete, AutocompleteVirtual, type AutocompleteVirtualListProps, type AutocompleteVirtualListSlots, type VirtualListEmits, type VirtualListProps };
@@ -1,6 +1,6 @@
1
1
  import { a as OverlayActions, i as OpenChangeDetails, n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
3
  import { n as OverlayRootEmits, r as OverlayRootProps, t as OverlayPortalProps } from "./overlay-portal-Cmn7Dt7E.js";
4
- import { Ai as AutocompletePortalProps, Ci as Side, Di as AutocompleteListState, Ei as AutocompleteListSlots, Fi as AutocompleteItemToString, Ii as AutocompleteRootEmits, Li as AutocompleteRootProps, Mi as AutocompleteDisabledState, Ni as AutocompleteOpenState, Oi as AutocompleteItemProps, Pi as AutocompleteFilter, Ri as AutocompleteMode, Si as ItemGroup, Ti as AutocompletePopupState, bi as Align, i as Autocomplete, ji as AutocompleteValueSlots, ki as AutocompleteItemState, wi as AutocompletePositionerState, xi as ItemFilter } from "./index-t_lSQgLA.js";
4
+ import { Ai as AutocompletePortalProps, Ci as Side, Di as AutocompleteListState, Ei as AutocompleteListSlots, Fi as AutocompleteItemToString, Ii as AutocompleteRootEmits, Li as AutocompleteRootProps, Mi as AutocompleteDisabledState, Ni as AutocompleteOpenState, Oi as AutocompleteItemProps, Pi as AutocompleteFilter, Ri as AutocompleteMode, Si as ItemGroup, Ti as AutocompletePopupState, bi as Align, i as Autocomplete, ji as AutocompleteValueSlots, ki as AutocompleteItemState, wi as AutocompletePositionerState, xi as ItemFilter } from "./index-g8zeeaxp.js";
5
5
  import { t as PositionerProps } from "./use-positioner-D98pYl_K.js";
6
6
  export { type Align, Autocomplete, type AutocompleteDisabledState, type AutocompleteFilter, type AutocompleteItemProps, type AutocompleteItemState, type AutocompleteItemToString, type AutocompleteListSlots, type AutocompleteListState, type AutocompleteMode, type AutocompleteOpenState, type AutocompletePopupState, type AutocompletePortalProps, type AutocompletePositionerState, type AutocompleteRootEmits, type AutocompleteRootProps, type AutocompleteValueSlots, type ChangeDetails, type ChangeReason, type ItemFilter, type ItemGroup, type OpenChangeDetails, type OverlayActions, type OverlayPortalProps, type OverlayRootEmits, type OverlayRootProps, type PositionerProps, type RenderSlotProps, type Side };
@@ -1,3 +1,3 @@
1
1
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
2
- import { Jr as CalendarPreset, Kr as DateRange, Xr as CalendarPresetState, Yr as CalendarPresetProps, Zr as CalendarPresetValue, qr as PlainDate, ti as Calendar } from "./index-t_lSQgLA.js";
2
+ import { Jr as CalendarPreset, Kr as DateRange, Xr as CalendarPresetState, Yr as CalendarPresetProps, Zr as CalendarPresetValue, qr as PlainDate, ti as Calendar } from "./index-g8zeeaxp.js";
3
3
  export { Calendar, CalendarPreset, type CalendarPresetProps, type CalendarPresetState, type CalendarPresetValue, type DateRange, type PlainDate, type RenderSlotProps };
@@ -1,4 +1,4 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { Ar as MonthCalendar, Cr as CalendarViewTriggerProps, Dr as CalendarViewRootSlots, Er as CalendarViewRootProps, Or as CalendarViewState, Sr as CalendarView, Tr as CalendarViewRootEmits, kr as CalendarViewName, ti as Calendar, wr as CalendarViewTriggerState } from "./index-t_lSQgLA.js";
3
+ import { Ar as MonthCalendar, Cr as CalendarViewTriggerProps, Dr as CalendarViewRootSlots, Er as CalendarViewRootProps, Or as CalendarViewState, Sr as CalendarView, Tr as CalendarViewRootEmits, kr as CalendarViewName, ti as Calendar, wr as CalendarViewTriggerState } from "./index-g8zeeaxp.js";
4
4
  export { Calendar, CalendarView, type CalendarViewName, type CalendarViewRootEmits, type CalendarViewRootProps, type CalendarViewRootSlots, type CalendarViewState, type CalendarViewTriggerProps, type CalendarViewTriggerState, type ChangeDetails, type ChangeReason, MonthCalendar, type RenderSlotProps };
@@ -1,5 +1,5 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { $r as PlainDate, Qr as DateRange, _i as CalendarGridProps, ai as CalendarRootProps, ci as CalendarPrevButtonProps, di as CalendarHeadingProps, ei as Weekday, fi as CalendarHeadingState, gi as CalendarGridBodySlots, hi as CalendarGridHeaderSlots, ii as CalendarRootEmits, li as CalendarNextButtonProps, mi as CalendarHeaderCellState, ni as CalendarRowProps, oi as CalendarRootSharedProps, pi as CalendarHeaderCellProps, ri as CalendarRowSlots, si as CalendarRootState, ti as Calendar, ui as CalendarPageButtonState, vi as CalendarCellProps, yi as CalendarCellState } from "./index-t_lSQgLA.js";
3
+ import { $r as PlainDate, Qr as DateRange, _i as CalendarGridProps, ai as CalendarRootProps, ci as CalendarPrevButtonProps, di as CalendarHeadingProps, ei as Weekday, fi as CalendarHeadingState, gi as CalendarGridBodySlots, hi as CalendarGridHeaderSlots, ii as CalendarRootEmits, li as CalendarNextButtonProps, mi as CalendarHeaderCellState, ni as CalendarRowProps, oi as CalendarRootSharedProps, pi as CalendarHeaderCellProps, ri as CalendarRowSlots, si as CalendarRootState, ti as Calendar, ui as CalendarPageButtonState, vi as CalendarCellProps, yi as CalendarCellState } from "./index-g8zeeaxp.js";
4
4
  import { h as CalendarOptions } from "./index-DIZSgXHM.js";
5
5
  export { Calendar, type CalendarCellProps, type CalendarCellState, type CalendarGridBodySlots, type CalendarGridHeaderSlots, type CalendarGridProps, type CalendarHeaderCellProps, type CalendarHeaderCellState, type CalendarHeadingProps, type CalendarHeadingState, type CalendarNextButtonProps, type CalendarOptions, type CalendarPageButtonState, type CalendarPrevButtonProps, type CalendarRootEmits, type CalendarRootProps, type CalendarRootSharedProps, type CalendarRootState, type CalendarRowProps, type CalendarRowSlots, type ChangeDetails, type ChangeReason, type DateRange, type PlainDate, type RenderSlotProps, type Weekday };
@@ -1,6 +1,6 @@
1
1
  import { a as OverlayActions, i as OpenChangeDetails, n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
3
  import { n as OverlayRootEmits, r as OverlayRootProps, t as OverlayPortalProps } from "./overlay-portal-Cmn7Dt7E.js";
4
- import { _r as CascadeSelectLevelState, ar as CascadeItem, br as CascadeSelectItemProps, cr as CascadeSelectValueProps, dr as CascadeSelectRootEmits, fr as CascadeSelectRootProps, gr as CascadeSelectLevelProps, hr as CascadeSelectPopupState, ir as Align, lr as CascadeSelectValueState, mr as CascadeSelectPortalProps, or as Side, pr as CascadeSelectPositionerState, sr as CascadeSelect, ur as CascadeSelectTriggerState, vr as CascadeSelectItemIndicatorProps, xr as CascadeSelectItemState, yr as CascadeSelectItemIndicatorState } from "./index-t_lSQgLA.js";
4
+ import { _r as CascadeSelectLevelState, ar as CascadeItem, br as CascadeSelectItemProps, cr as CascadeSelectValueProps, dr as CascadeSelectRootEmits, fr as CascadeSelectRootProps, gr as CascadeSelectLevelProps, hr as CascadeSelectPopupState, ir as Align, lr as CascadeSelectValueState, mr as CascadeSelectPortalProps, or as Side, pr as CascadeSelectPositionerState, sr as CascadeSelect, ur as CascadeSelectTriggerState, vr as CascadeSelectItemIndicatorProps, xr as CascadeSelectItemState, yr as CascadeSelectItemIndicatorState } from "./index-g8zeeaxp.js";
5
5
  import { t as PositionerProps } from "./use-positioner-D98pYl_K.js";
6
6
  export { type Align, type CascadeItem, CascadeSelect, type CascadeSelectItemIndicatorProps, type CascadeSelectItemIndicatorState, type CascadeSelectItemProps, type CascadeSelectItemState, type CascadeSelectLevelProps, type CascadeSelectLevelState, type CascadeSelectPopupState, type CascadeSelectPortalProps, type CascadeSelectPositionerState, type CascadeSelectRootEmits, type CascadeSelectRootProps, type CascadeSelectTriggerState, type CascadeSelectValueProps, type CascadeSelectValueState, type ChangeDetails, type ChangeReason, type OpenChangeDetails, type OverlayActions, type OverlayPortalProps, type OverlayRootEmits, type OverlayRootProps, type PositionerProps, type RenderSlotProps, type Side };
@@ -1,4 +1,4 @@
1
- import { n as ComboboxList, r as ComboboxKey } from "./parts--mC44S1N.js";
1
+ import { n as ComboboxList, r as ComboboxKey } from "./parts-DOWIiUdN.js";
2
2
  import { t as elementSetter } from "./use-overlay-root-BkyTQIsX.js";
3
3
  import { t as useRequiredContext } from "./use-required-context-CPpEkr4Q.js";
4
4
  import { n as useVirtualRows, r as virtualListProps, t as reachableRows } from "./use-virtual-rows-DesBexmk.js";
@@ -53,4 +53,4 @@ const ComboboxVirtual = { List: publicComponent(defineComponent({
53
53
  })) };
54
54
  export { ComboboxVirtual as t };
55
55
 
56
- //# sourceMappingURL=combobox-virtual-DTRTVq5N.js.map
56
+ //# sourceMappingURL=combobox-virtual-BDWkgERh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-virtual-DTRTVq5N.js","names":[],"sources":["../src/components/combobox-virtual/combobox-virtual-list.ts","../src/components/combobox-virtual/parts.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n nextTick,\n onMounted,\n shallowRef,\n type VNode,\n watch,\n} from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n reachableRows,\n useVirtualRows,\n type VirtualListEmits,\n type VirtualListProps,\n type VirtualRows,\n virtualListProps,\n} from \"../../composables/use-virtual-rows.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type AsProp,\n asProp,\n type RenderSlotProps,\n} from \"../../utils/render-part.ts\";\nimport { chainedRef, renderVirtualList } from \"../../utils/virtual-list.ts\";\nimport { ComboboxKey } from \"../combobox/combobox-context.ts\";\nimport {\n ComboboxList,\n type ComboboxListState,\n} from \"../combobox/combobox-list.ts\";\n\nexport type ComboboxVirtualListProps = VirtualListProps;\n\n/**\n * The default scoped slot renders a `Combobox.Item` for each matching item in view (the Root's\n * `items`, flat). `entry` is the consumer's own type, named by the slot's annotation\n * (`v-slot=\"{ entry }: { entry: Country }\"`), as `Combobox.List`'s: `never` until annotated.\n */\nexport interface ComboboxVirtualListSlots {\n default?: (scope: { entry: never; index: number }) => VNode[];\n render?: (scope: RenderSlotProps<ComboboxListState>) => VNode[];\n}\n\n/**\n * Combobox's List rendering only the matching items in view (spec/virtual-lists.md): the ends,\n * the highlighted item with its neighbours and the selected item stay rendered, so the Input's\n * keys and `aria-activedescendant` behave as with every item rendered.\n */\nexport const ComboboxVirtualList: PublicComponent<\n ComboboxVirtualListProps & { as?: AsProp },\n ComboboxVirtualListSlots,\n VirtualListEmits\n> = publicComponent(\n defineComponent({\n name: \"ComboboxVirtualList\",\n inheritAttrs: false,\n props: {\n ...asProp,\n ...virtualListProps,\n },\n emits: {\n loadMore: () => true,\n },\n setup(props, { attrs, slots, emit }) {\n const context = useRequiredContext(\n ComboboxKey,\n \"ComboboxVirtual.List\",\n );\n // the list element is Combobox.List's own (the context's `list`)\n const ref = chainedRef(elementSetter(context.list));\n const entries = () => context.entries.value;\n const selected = computed(() =>\n context.multiple()\n ? -1\n : entries().findIndex((entry) => context.isSelected(entry)),\n );\n const elements = shallowRef<ReadonlyMap<number, HTMLElement>>(\n new Map(),\n );\n // the highlighted option is rendered: its index is the one its element was rendered\n // at\n const current = computed<number | undefined>(() => {\n const highlighted = context.highlighted.value;\n if (highlighted === null) {\n return undefined;\n }\n for (const [index, element] of elements.value) {\n if (element.id === highlighted) {\n return index;\n }\n }\n return undefined;\n });\n const virtual: VirtualRows<unknown> = useVirtualRows({\n items: entries,\n pinned: () =>\n reachableRows(\n entries().length,\n current.value,\n selected.value,\n ),\n list: context.list,\n props,\n onLoadMore: () => emit(\"loadMore\"),\n elements,\n });\n // the highlighted row in view, by its offset: after the Item's own scroll (its post\n // watcher runs in the same flush, again once the popup is placed), which reads boxes\n // a popup's opening scale transforms\n const { virtualizer } = virtual;\n const reveal = () => {\n const index = current.value;\n if (index !== undefined) {\n nextTick().then(() => virtualizer.scrollToIndex(index));\n }\n };\n onMounted(reveal);\n watch(() => [current.value, context.positioner.value], reveal, {\n flush: \"post\",\n });\n return () =>\n renderVirtualList(\n ComboboxList,\n { attrs, slots },\n props.as,\n props.loading,\n virtual.rows(\n slots.default &&\n ((entry, index) =>\n slots.default?.({\n entry: entry as never,\n index,\n })),\n ),\n ref,\n );\n },\n }),\n);\n","import { ComboboxVirtualList } from \"./combobox-virtual-list.ts\";\n\n/** spec/virtual-lists.md */\nexport const ComboboxVirtual = {\n List: ComboboxVirtualList,\n};\n"],"mappings":";;;;;;;;;;ACGA,MAAa,kBAAkB,EAC3B,MDoDA,gBACA,gBAAgB;CACZ,MAAM;CACN,cAAc;CACd,OAAO;EACH,GAAG;EACH,GAAG;CACP;CACA,OAAO,EACH,gBAAgB,KACpB;CACA,MAAM,OAAO,EAAE,OAAO,OAAO,QAAQ;EACjC,MAAM,UAAU,mBACZ,aACA,sBACJ;EAEA,MAAM,MAAM,WAAW,cAAc,QAAQ,IAAI,CAAC;EAClD,MAAM,gBAAgB,QAAQ,QAAQ;EACtC,MAAM,WAAW,eACb,QAAQ,SAAS,IACX,KACA,QAAQ,CAAC,CAAC,WAAW,UAAU,QAAQ,WAAW,KAAK,CAAC,CAClE;EACA,MAAM,WAAW,2BACb,IAAI,IAAI,CACZ;EAGA,MAAM,UAAU,eAAmC;GAC/C,MAAM,cAAc,QAAQ,YAAY;GACxC,IAAI,gBAAgB,MAChB;GAEJ,KAAK,MAAM,CAAC,OAAO,YAAY,SAAS,OACpC,IAAI,QAAQ,OAAO,aACf,OAAO;EAInB,CAAC;EACD,MAAM,UAAgC,eAAe;GACjD,OAAO;GACP,cACI,cACI,QAAQ,CAAC,CAAC,QACV,QAAQ,OACR,SAAS,KACb;GACJ,MAAM,QAAQ;GACd;GACA,kBAAkB,KAAK,UAAU;GACjC;EACJ,CAAC;EAID,MAAM,EAAE,gBAAgB;EACxB,MAAM,eAAe;GACjB,MAAM,QAAQ,QAAQ;GACtB,IAAI,UAAU,KAAA,GACV,SAAS,CAAC,CAAC,WAAW,YAAY,cAAc,KAAK,CAAC;EAE9D;EACA,UAAU,MAAM;EAChB,YAAY,CAAC,QAAQ,OAAO,QAAQ,WAAW,KAAK,GAAG,QAAQ,EAC3D,OAAO,OACX,CAAC;EACD,aACI,kBACI,cACA;GAAE;GAAO;EAAM,GACf,MAAM,IACN,MAAM,SACN,QAAQ,KACJ,MAAM,aACA,OAAO,UACL,MAAM,UAAU;GACL;GACP;EACJ,CAAC,EACb,GACA,GACJ;CACR;AACJ,CAAC,CCzIK,EACV"}
1
+ {"version":3,"file":"combobox-virtual-BDWkgERh.js","names":[],"sources":["../src/components/combobox-virtual/combobox-virtual-list.ts","../src/components/combobox-virtual/parts.ts"],"sourcesContent":["import {\n computed,\n defineComponent,\n nextTick,\n onMounted,\n shallowRef,\n type VNode,\n watch,\n} from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n reachableRows,\n useVirtualRows,\n type VirtualListEmits,\n type VirtualListProps,\n type VirtualRows,\n virtualListProps,\n} from \"../../composables/use-virtual-rows.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type AsProp,\n asProp,\n type RenderSlotProps,\n} from \"../../utils/render-part.ts\";\nimport { chainedRef, renderVirtualList } from \"../../utils/virtual-list.ts\";\nimport { ComboboxKey } from \"../combobox/combobox-context.ts\";\nimport {\n ComboboxList,\n type ComboboxListState,\n} from \"../combobox/combobox-list.ts\";\n\nexport type ComboboxVirtualListProps = VirtualListProps;\n\n/**\n * The default scoped slot renders a `Combobox.Item` for each matching item in view (the Root's\n * `items`, flat). `entry` is the consumer's own type, named by the slot's annotation\n * (`v-slot=\"{ entry }: { entry: Country }\"`), as `Combobox.List`'s: `never` until annotated.\n */\nexport interface ComboboxVirtualListSlots {\n default?: (scope: { entry: never; index: number }) => VNode[];\n render?: (scope: RenderSlotProps<ComboboxListState>) => VNode[];\n}\n\n/**\n * Combobox's List rendering only the matching items in view (spec/virtual-lists.md): the ends,\n * the highlighted item with its neighbours and the selected item stay rendered, so the Input's\n * keys and `aria-activedescendant` behave as with every item rendered.\n */\nexport const ComboboxVirtualList: PublicComponent<\n ComboboxVirtualListProps & { as?: AsProp },\n ComboboxVirtualListSlots,\n VirtualListEmits\n> = publicComponent(\n defineComponent({\n name: \"ComboboxVirtualList\",\n inheritAttrs: false,\n props: {\n ...asProp,\n ...virtualListProps,\n },\n emits: {\n loadMore: () => true,\n },\n setup(props, { attrs, slots, emit }) {\n const context = useRequiredContext(\n ComboboxKey,\n \"ComboboxVirtual.List\",\n );\n // the list element is Combobox.List's own (the context's `list`)\n const ref = chainedRef(elementSetter(context.list));\n const entries = () => context.entries.value;\n const selected = computed(() =>\n context.multiple()\n ? -1\n : entries().findIndex((entry) => context.isSelected(entry)),\n );\n const elements = shallowRef<ReadonlyMap<number, HTMLElement>>(\n new Map(),\n );\n // the highlighted option is rendered: its index is the one its element was rendered\n // at\n const current = computed<number | undefined>(() => {\n const highlighted = context.highlighted.value;\n if (highlighted === null) {\n return undefined;\n }\n for (const [index, element] of elements.value) {\n if (element.id === highlighted) {\n return index;\n }\n }\n return undefined;\n });\n const virtual: VirtualRows<unknown> = useVirtualRows({\n items: entries,\n pinned: () =>\n reachableRows(\n entries().length,\n current.value,\n selected.value,\n ),\n list: context.list,\n props,\n onLoadMore: () => emit(\"loadMore\"),\n elements,\n });\n // the highlighted row in view, by its offset: after the Item's own scroll (its post\n // watcher runs in the same flush, again once the popup is placed), which reads boxes\n // a popup's opening scale transforms\n const { virtualizer } = virtual;\n const reveal = () => {\n const index = current.value;\n if (index !== undefined) {\n nextTick().then(() => virtualizer.scrollToIndex(index));\n }\n };\n onMounted(reveal);\n watch(() => [current.value, context.positioner.value], reveal, {\n flush: \"post\",\n });\n return () =>\n renderVirtualList(\n ComboboxList,\n { attrs, slots },\n props.as,\n props.loading,\n virtual.rows(\n slots.default &&\n ((entry, index) =>\n slots.default?.({\n entry: entry as never,\n index,\n })),\n ),\n ref,\n );\n },\n }),\n);\n","import { ComboboxVirtualList } from \"./combobox-virtual-list.ts\";\n\n/** spec/virtual-lists.md */\nexport const ComboboxVirtual = {\n List: ComboboxVirtualList,\n};\n"],"mappings":";;;;;;;;;;ACGA,MAAa,kBAAkB,EAC3B,MDoDA,gBACA,gBAAgB;CACZ,MAAM;CACN,cAAc;CACd,OAAO;EACH,GAAG;EACH,GAAG;CACP;CACA,OAAO,EACH,gBAAgB,KACpB;CACA,MAAM,OAAO,EAAE,OAAO,OAAO,QAAQ;EACjC,MAAM,UAAU,mBACZ,aACA,sBACJ;EAEA,MAAM,MAAM,WAAW,cAAc,QAAQ,IAAI,CAAC;EAClD,MAAM,gBAAgB,QAAQ,QAAQ;EACtC,MAAM,WAAW,eACb,QAAQ,SAAS,IACX,KACA,QAAQ,CAAC,CAAC,WAAW,UAAU,QAAQ,WAAW,KAAK,CAAC,CAClE;EACA,MAAM,WAAW,2BACb,IAAI,IAAI,CACZ;EAGA,MAAM,UAAU,eAAmC;GAC/C,MAAM,cAAc,QAAQ,YAAY;GACxC,IAAI,gBAAgB,MAChB;GAEJ,KAAK,MAAM,CAAC,OAAO,YAAY,SAAS,OACpC,IAAI,QAAQ,OAAO,aACf,OAAO;EAInB,CAAC;EACD,MAAM,UAAgC,eAAe;GACjD,OAAO;GACP,cACI,cACI,QAAQ,CAAC,CAAC,QACV,QAAQ,OACR,SAAS,KACb;GACJ,MAAM,QAAQ;GACd;GACA,kBAAkB,KAAK,UAAU;GACjC;EACJ,CAAC;EAID,MAAM,EAAE,gBAAgB;EACxB,MAAM,eAAe;GACjB,MAAM,QAAQ,QAAQ;GACtB,IAAI,UAAU,KAAA,GACV,SAAS,CAAC,CAAC,WAAW,YAAY,cAAc,KAAK,CAAC;EAE9D;EACA,UAAU,MAAM;EAChB,YAAY,CAAC,QAAQ,OAAO,QAAQ,WAAW,KAAK,GAAG,QAAQ,EAC3D,OAAO,OACX,CAAC;EACD,aACI,kBACI,cACA;GAAE;GAAO;EAAM,GACf,MAAM,IACN,MAAM,SACN,QAAQ,KACJ,MAAM,aACA,OAAO,UACL,MAAM,UAAU;GACL;GACP;EACJ,CAAC,EACb,GACA,GACJ;CACR;AACJ,CAAC,CCzIK,EACV"}
@@ -1,2 +1,2 @@
1
- import { Bi as VirtualListProps, Bn as Combobox, Mn as ComboboxVirtual, Nn as ComboboxVirtualListProps, Pn as ComboboxVirtualListSlots, zi as VirtualListEmits } from "./index-t_lSQgLA.js";
1
+ import { Bi as VirtualListProps, Bn as Combobox, Mn as ComboboxVirtual, Nn as ComboboxVirtualListProps, Pn as ComboboxVirtualListSlots, zi as VirtualListEmits } from "./index-g8zeeaxp.js";
2
2
  export { Combobox, ComboboxVirtual, type ComboboxVirtualListProps, type ComboboxVirtualListSlots, type VirtualListEmits, type VirtualListProps };
@@ -1,3 +1,3 @@
1
- import { t as Combobox } from "./parts--mC44S1N.js";
2
- import { t as ComboboxVirtual } from "./combobox-virtual-DTRTVq5N.js";
1
+ import { t as Combobox } from "./parts-DOWIiUdN.js";
2
+ import { t as ComboboxVirtual } from "./combobox-virtual-BDWkgERh.js";
3
3
  export { Combobox, ComboboxVirtual };
@@ -1,6 +1,6 @@
1
1
  import { a as OverlayActions, i as OpenChangeDetails, n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
3
  import { n as OverlayRootEmits, r as OverlayRootProps, t as OverlayPortalProps } from "./overlay-portal-Cmn7Dt7E.js";
4
- import { $n as ComboboxItemIndicatorState, Bn as Combobox, Fn as Align, Gn as ComboboxRootEmits, Hn as ComboboxFilter, In as ItemEquality, Jn as ComboboxPortalProps, Kn as ComboboxRootProps, Ln as ItemFilter, Qn as ComboboxItemIndicatorProps, Rn as ItemGroup, Un as ComboboxItemEquality, Vn as ComboboxValueSlots, Wn as ComboboxItemToString, Xn as ComboboxListSlots, Yn as ComboboxPopupState, Zn as ComboboxListState, er as ComboboxItemProps, nr as ComboboxItemState, qn as ComboboxPositionerState, rr as ComboboxDisabledState, tr as ComboboxOpenState, zn as Side } from "./index-t_lSQgLA.js";
4
+ import { $n as ComboboxItemIndicatorState, Bn as Combobox, Fn as Align, Gn as ComboboxRootEmits, Hn as ComboboxFilter, In as ItemEquality, Jn as ComboboxPortalProps, Kn as ComboboxRootProps, Ln as ItemFilter, Qn as ComboboxItemIndicatorProps, Rn as ItemGroup, Un as ComboboxItemEquality, Vn as ComboboxValueSlots, Wn as ComboboxItemToString, Xn as ComboboxListSlots, Yn as ComboboxPopupState, Zn as ComboboxListState, er as ComboboxItemProps, nr as ComboboxItemState, qn as ComboboxPositionerState, rr as ComboboxDisabledState, tr as ComboboxOpenState, zn as Side } from "./index-g8zeeaxp.js";
5
5
  import { t as PositionerProps } from "./use-positioner-D98pYl_K.js";
6
6
  export { type Align, type ChangeDetails, type ChangeReason, Combobox, type ComboboxDisabledState, type ComboboxFilter, type ComboboxItemEquality, type ComboboxItemIndicatorProps, type ComboboxItemIndicatorState, type ComboboxItemProps, type ComboboxItemState, type ComboboxItemToString, type ComboboxListSlots, type ComboboxListState, type ComboboxOpenState, type ComboboxPopupState, type ComboboxPortalProps, type ComboboxPositionerState, type ComboboxRootEmits, type ComboboxRootProps, type ComboboxValueSlots, type ItemEquality, type ItemFilter, type ItemGroup, type OpenChangeDetails, type OverlayActions, type OverlayPortalProps, type OverlayRootEmits, type OverlayRootProps, type PositionerProps, type RenderSlotProps, type Side };
package/dist/combobox.js CHANGED
@@ -1 +1 @@
1
- export { t as Combobox } from "./parts--mC44S1N.js";
1
+ export { t as Combobox } from "./parts-DOWIiUdN.js";
@@ -1,3 +1,3 @@
1
- import { An as CommandVirtualListProps, Bi as VirtualListProps, On as CommandEntry, jn as CommandVirtualListSlots, kn as CommandVirtual, zi as VirtualListEmits } from "./index-t_lSQgLA.js";
1
+ import { An as CommandVirtualListProps, Bi as VirtualListProps, On as CommandEntry, jn as CommandVirtualListSlots, kn as CommandVirtual, zi as VirtualListEmits } from "./index-g8zeeaxp.js";
2
2
  import { r as Command } from "./index-CTzUalDO.js";
3
3
  export { Command, type CommandEntry, CommandVirtual, type CommandVirtualListProps, type CommandVirtualListSlots, type VirtualListEmits, type VirtualListProps };
@@ -1,4 +1,4 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Sn as DateFieldRootProps, Tn as DateFieldInputSlots, _n as SegmentGranularity, bn as DateFieldSegmentProps, gn as PlainTime, hn as PlainDateTime, mn as PlainDate, pn as DateSegment, vn as SegmentType, wn as DateFieldRootSharedProps, xn as DateFieldRootEmits, yn as DateField } from "./index-t_lSQgLA.js";
3
+ import { Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Sn as DateFieldRootProps, Tn as DateFieldInputSlots, _n as SegmentGranularity, bn as DateFieldSegmentProps, gn as PlainTime, hn as PlainDateTime, mn as PlainDate, pn as DateSegment, vn as SegmentType, wn as DateFieldRootSharedProps, xn as DateFieldRootEmits, yn as DateField } from "./index-g8zeeaxp.js";
4
4
  export { type ChangeDetails, type ChangeReason, DateField, type DateFieldInputSlots, type DateFieldRootEmits, type DateFieldRootProps, type DateFieldRootSharedProps, type DateFieldSegmentProps, type DateFieldSegmentState, type DateFieldState, type DateFieldValue, type DateSegment, type PlainDate, type PlainDateTime, type PlainTime, type RenderSlotProps, type SegmentGranularity, type SegmentType };
@@ -1,4 +1,4 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
- import { Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Tn as DateFieldInputSlots, an as SegmentGranularity, bn as DateFieldSegmentProps, cn as DatePickerInputRootEmits, in as PlainDateTime, ln as DatePickerInputRootProps, nn as DateSegment, on as SegmentType, rn as PlainDate, sn as DatePickerInput, un as DatePickerInputRootSharedProps } from "./index-t_lSQgLA.js";
2
+ import { Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Tn as DateFieldInputSlots, an as SegmentGranularity, bn as DateFieldSegmentProps, cn as DatePickerInputRootEmits, in as PlainDateTime, ln as DatePickerInputRootProps, nn as DateSegment, on as SegmentType, rn as PlainDate, sn as DatePickerInput, un as DatePickerInputRootSharedProps } from "./index-g8zeeaxp.js";
3
3
  import { i as DatePicker } from "./index-DIZSgXHM.js";
4
4
  export { type ChangeDetails, type ChangeReason, type DateFieldInputSlots, type DateFieldSegmentProps, type DateFieldSegmentState, type DateFieldState, type DateFieldValue, DatePicker, DatePickerInput, type DatePickerInputRootEmits, type DatePickerInputRootProps, type DatePickerInputRootSharedProps, type DateSegment, type PlainDate, type PlainDateTime, type SegmentGranularity, type SegmentType };
@@ -1,4 +1,4 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { $t as DateRangeFieldRootProps, Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Gt as DateSegment, Jt as PlainTime, Kt as PlainDate, Qt as DateRangeFieldRootEmits, Tn as DateFieldInputSlots, Wt as DateRange, Xt as SegmentType, Yt as SegmentGranularity, Zt as DateRangeField, bn as DateFieldSegmentProps, dn as DateRangeFieldRootSharedProps, en as DateRangeFieldValue, fn as RangeEnd, qt as PlainDateTime, tn as DateRangeFieldInputProps } from "./index-t_lSQgLA.js";
3
+ import { $t as DateRangeFieldRootProps, Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Gt as DateSegment, Jt as PlainTime, Kt as PlainDate, Qt as DateRangeFieldRootEmits, Tn as DateFieldInputSlots, Wt as DateRange, Xt as SegmentType, Yt as SegmentGranularity, Zt as DateRangeField, bn as DateFieldSegmentProps, dn as DateRangeFieldRootSharedProps, en as DateRangeFieldValue, fn as RangeEnd, qt as PlainDateTime, tn as DateRangeFieldInputProps } from "./index-g8zeeaxp.js";
4
4
  export { type ChangeDetails, type ChangeReason, type DateFieldInputSlots, type DateFieldSegmentProps, type DateFieldSegmentState, type DateFieldState, type DateFieldValue, type DateRange, DateRangeField, type DateRangeFieldInputProps, type DateRangeFieldRootEmits, type DateRangeFieldRootProps, type DateRangeFieldRootSharedProps, type DateRangeFieldValue, type DateSegment, type PlainDate, type PlainDateTime, type PlainTime, type RangeEnd, type RenderSlotProps, type SegmentGranularity, type SegmentType };
@@ -1,4 +1,4 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
- import { Bt as SegmentType, Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Ft as DateRange, Ht as DateRangePickerInputRootEmits, It as DateSegment, Lt as PlainDate, Rt as PlainDateTime, Tn as DateFieldInputSlots, Ut as DateRangePickerInputRootProps, Vt as DateRangePickerInput, bn as DateFieldSegmentProps, en as DateRangeFieldValue, fn as RangeEnd, tn as DateRangeFieldInputProps, un as DatePickerInputRootSharedProps, zt as SegmentGranularity } from "./index-t_lSQgLA.js";
2
+ import { Bt as SegmentType, Cn as DateFieldValue, Dn as DateFieldState, En as DateFieldSegmentState, Ft as DateRange, Ht as DateRangePickerInputRootEmits, It as DateSegment, Lt as PlainDate, Rt as PlainDateTime, Tn as DateFieldInputSlots, Ut as DateRangePickerInputRootProps, Vt as DateRangePickerInput, bn as DateFieldSegmentProps, en as DateRangeFieldValue, fn as RangeEnd, tn as DateRangeFieldInputProps, un as DatePickerInputRootSharedProps, zt as SegmentGranularity } from "./index-g8zeeaxp.js";
3
3
  import { a as DateRangePicker } from "./index-uL1dEAhG.js";
4
4
  export { type ChangeDetails, type ChangeReason, type DateFieldInputSlots, type DateFieldSegmentProps, type DateFieldSegmentState, type DateFieldState, type DateFieldValue, type DatePickerInputRootSharedProps, type DateRange, type DateRangeFieldInputProps, type DateRangeFieldValue, DateRangePicker, DateRangePickerInput, type DateRangePickerInputRootEmits, type DateRangePickerInputRootProps, type DateSegment, type PlainDate, type PlainDateTime, type RangeEnd, type SegmentGranularity, type SegmentType };
@@ -44,7 +44,7 @@ import "./index-D11YCkvR.js";
44
44
  import "./index-C-QYKtWy.js";
45
45
  import "./index-BzHLkAWU.js";
46
46
  import "./index-CqP363e5.js";
47
- import "./index-B8E3X1CK.js";
47
+ import "./index-lXj_BUUG.js";
48
48
  import "./index-S0FIwOSw.js";
49
49
  import "./index-BJz7OWbi.js";
50
50
  import "./index-W8aOtVIu.js";
@@ -597,6 +597,8 @@ interface ComboboxRootProps {
597
597
  limit?: number;
598
598
  locale?: string;
599
599
  multiple?: boolean;
600
+ /** Typing highlights the first item the filter keeps, so Enter chooses it (default `false`). */
601
+ autoHighlight?: boolean;
600
602
  /** The selected item (or `null`), or the selected items with `multiple`. */
601
603
  value?: unknown;
602
604
  defaultValue?: unknown;
@@ -46,6 +46,11 @@ interface NumberFieldRootProps {
46
46
  type NumberFieldRootEmits = {
47
47
  "update:value": (value: number | null) => true;
48
48
  valueChange: (value: number | null, details: ChangeDetails) => true;
49
+ /**
50
+ * The value once a change is complete: on blur after typing, at a key or wheel step, at the
51
+ * release of a button press or a scrub (spec/number-field.md, "Committing").
52
+ */
53
+ valueCommitted: (value: number | null, details: ChangeDetails) => true;
49
54
  };
50
55
  interface NumberFieldScrubAreaProps {
51
56
  /** The axis the pointer scrubs along (default `"horizontal"`). */
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import { t as OverlayTriggerProps } from "./use-overlay-trigger-D9OXZ_6K.js";
9
9
  import { a as createDialogHandle, c as DialogPopupState, i as DialogHandle, l as DialogBackdropProps, n as DialogTriggerProps, o as DialogPortalProps, r as DialogTriggerState, s as DialogPopupProps, t as DialogViewportState, u as DialogBackdropState } from "./dialog-viewport-tYqWTs9Q.js";
10
10
  import { a as AlertDialogHandle, i as AlertDialogRootProps, n as AlertDialogTriggerProps, o as createAlertDialogHandle, r as AlertDialogRootEmits, t as AlertDialog } from "./index-Byf0GNd9.js";
11
11
  import { n as AspectRatioProps, r as AspectRatioState, t as AspectRatio } from "./index-CZHLD5cJ.js";
12
- import { $ as Progress, $n as ComboboxItemIndicatorState, $r as PlainDate, $t as DateRangeFieldRootProps, Ai as AutocompletePortalProps, An as CommandVirtualListProps, Ar as MonthCalendar, At as ListboxVirtual, B as SliderRootEmits, Bi as VirtualListProps, Bn as Combobox, Br as MonthCalendarHeadingState, C as TimeRange, Ci as Side, Cn as DateFieldValue, Cr as CalendarViewTriggerProps, Ct as MeterValueSlotProps, Di as AutocompleteListState, Dn as DateFieldState, Dr as CalendarViewRootSlots, Dt as MeterState, E as TimeRangeFieldRootProps, Ei as AutocompleteListSlots, En as DateFieldSegmentState, Er as CalendarViewRootProps, Et as MeterLabelProps, F as SliderThumbProps, Fi as AutocompleteItemToString, Fr as MonthCalendarGridProps, G as SelectVirtualListSlots, Gn as ComboboxRootEmits, Gr as MonthCalendarCellState, H as SliderState, Hn as ComboboxFilter, Hr as MonthCalendarRootProps, Ht as DateRangePickerInputRootEmits, I as SliderThumbState, Ii as AutocompleteRootEmits, In as ItemEquality, Ir as MonthCalendarNextButtonProps, Jn as ComboboxPortalProps, Jr as CalendarPreset, Kn as ComboboxRootProps, L as SliderValueSlotProps, Li as AutocompleteRootProps, Lr as MonthCalendarPrevButtonProps, M as TimeFieldRootEmits, Mi as AutocompleteDisabledState, Mn as ComboboxVirtual, Mr as MonthCalendarRowProps, Mt as ListboxVirtualRootEmits, N as TimeFieldRootProps, Ni as AutocompleteOpenState, Nn as ComboboxVirtualListProps, Nr as MonthCalendarRowSlots, Nt as ListboxVirtualRootProps, Oi as AutocompleteItemProps, Or as CalendarViewState, P as Slider, Pi as AutocompleteFilter, Pn as ComboboxVirtualListSlots, Pr as MonthCalendarGridBodySlots, Pt as ListboxVirtualRootSlots, Q as ProgressStatus, Qn as ComboboxItemIndicatorProps, Qr as DateRange, Qt as DateRangeFieldRootEmits, R as SliderValueSlots, Ri as AutocompleteMode, Rr as MonthCalendarPageButtonState, Si as ItemGroup, Sn as DateFieldRootProps, Sr as CalendarView, St as Meter, T as TimeRangeFieldRootEmits, Ti as AutocompletePopupState, Tn as DateFieldInputSlots, Tr as CalendarViewRootEmits, Tt as MeterRootProps, U as SelectVirtual, Un as ComboboxItemEquality, Ur as MonthCalendarRootSharedProps, Ut as DateRangePickerInputRootProps, V as SliderRootProps, Vn as ComboboxValueSlots, Vr as MonthCalendarRootEmits, Vt as DateRangePickerInput, W as SelectVirtualListProps, Wn as ComboboxItemToString, Wr as MonthCalendarRootState, X as RangeCalendarRootEmits, Xn as ComboboxListSlots, Xr as CalendarPresetState, Y as RangeCalendar, Yn as ComboboxPopupState, Yr as CalendarPresetProps, Z as RangeCalendarRootProps, Zn as ComboboxListState, Zr as CalendarPresetValue, Zt as DateRangeField, _ as YearCalendarRootEmits, _i as CalendarGridProps, _n as SegmentGranularity, _r as CascadeSelectLevelState, _t as MonthRangeCalendarRootProps, ai as CalendarRootProps, ar as CascadeItem, bi as Align, bn as DateFieldSegmentProps, br as CascadeSelectItemProps, bt as YearMonthRange, ci as CalendarPrevButtonProps, cn as DatePickerInputRootEmits, cr as CascadeSelectValueProps, ct as MultipleCalendar, d as YearRangeCalendarRootProps, di as CalendarHeadingProps, dn as DateRangeFieldRootSharedProps, dr as CascadeSelectRootEmits, ei as Weekday, en as DateRangeFieldValue, er as ComboboxItemProps, et as ProgressValueSlotProps, fi as CalendarHeadingState, fn as RangeEnd, fr as CascadeSelectRootProps, g as YearCalendar, gi as CalendarGridBodySlots, gn as PlainTime, gr as CascadeSelectLevelProps, gt as MonthRangeCalendarRootEmits, hi as CalendarGridHeaderSlots, hn as PlainDateTime, hr as CascadeSelectPopupState, ht as MonthRangeCalendar, i as Autocomplete, ii as CalendarRootEmits, it as ProgressState, j as TimeField, ji as AutocompleteValueSlots, jn as CommandVirtualListSlots, jr as MonthCalendarCellProps, jt as ListboxVirtualItem, ki as AutocompleteItemState, kn as CommandVirtual, kr as CalendarViewName, l as YearRangeCalendar, li as CalendarNextButtonProps, ln as DatePickerInputRootProps, lr as CascadeSelectValueState, lt as MultipleCalendarRootEmits, mi as CalendarHeaderCellState, mr as CascadeSelectPortalProps, n as AutocompleteVirtualListProps, ni as CalendarRowProps, nr as ComboboxItemState, nt as ProgressLabelProps, oi as CalendarRootSharedProps, pi as CalendarHeaderCellProps, pn as DateSegment, pr as CascadeSelectPositionerState, qn as ComboboxPositionerState, r as AutocompleteVirtualListSlots, ri as CalendarRowSlots, rr as ComboboxDisabledState, rt as ProgressRootProps, si as CalendarRootState, sn as DatePickerInput, sr as CascadeSelect, t as AutocompleteVirtual, ti as Calendar, tn as DateRangeFieldInputProps, tr as ComboboxOpenState, tt as ProgressValueSlots, u as YearRangeCalendarRootEmits, ui as CalendarPageButtonState, un as DatePickerInputRootSharedProps, ur as CascadeSelectTriggerState, ut as MultipleCalendarRootProps, v as YearCalendarRootProps, vi as CalendarCellProps, vn as SegmentType, vr as CascadeSelectItemIndicatorProps, vt as PlainYear, w as TimeRangeField, wi as AutocompletePositionerState, wn as DateFieldRootSharedProps, wr as CalendarViewTriggerState, wt as MeterValueSlots, xi as ItemFilter, xn as DateFieldRootEmits, xr as CascadeSelectItemState, xt as YearRange, yi as CalendarCellState, yn as DateField, yr as CascadeSelectItemIndicatorState, yt as PlainYearMonth, z as SliderLabelProps, zi as VirtualListEmits, zr as MonthCalendarHeadingProps } from "./index-t_lSQgLA.js";
12
+ import { $ as Progress, $n as ComboboxItemIndicatorState, $r as PlainDate, $t as DateRangeFieldRootProps, Ai as AutocompletePortalProps, An as CommandVirtualListProps, Ar as MonthCalendar, At as ListboxVirtual, B as SliderRootEmits, Bi as VirtualListProps, Bn as Combobox, Br as MonthCalendarHeadingState, C as TimeRange, Ci as Side, Cn as DateFieldValue, Cr as CalendarViewTriggerProps, Ct as MeterValueSlotProps, Di as AutocompleteListState, Dn as DateFieldState, Dr as CalendarViewRootSlots, Dt as MeterState, E as TimeRangeFieldRootProps, Ei as AutocompleteListSlots, En as DateFieldSegmentState, Er as CalendarViewRootProps, Et as MeterLabelProps, F as SliderThumbProps, Fi as AutocompleteItemToString, Fr as MonthCalendarGridProps, G as SelectVirtualListSlots, Gn as ComboboxRootEmits, Gr as MonthCalendarCellState, H as SliderState, Hn as ComboboxFilter, Hr as MonthCalendarRootProps, Ht as DateRangePickerInputRootEmits, I as SliderThumbState, Ii as AutocompleteRootEmits, In as ItemEquality, Ir as MonthCalendarNextButtonProps, Jn as ComboboxPortalProps, Jr as CalendarPreset, Kn as ComboboxRootProps, L as SliderValueSlotProps, Li as AutocompleteRootProps, Lr as MonthCalendarPrevButtonProps, M as TimeFieldRootEmits, Mi as AutocompleteDisabledState, Mn as ComboboxVirtual, Mr as MonthCalendarRowProps, Mt as ListboxVirtualRootEmits, N as TimeFieldRootProps, Ni as AutocompleteOpenState, Nn as ComboboxVirtualListProps, Nr as MonthCalendarRowSlots, Nt as ListboxVirtualRootProps, Oi as AutocompleteItemProps, Or as CalendarViewState, P as Slider, Pi as AutocompleteFilter, Pn as ComboboxVirtualListSlots, Pr as MonthCalendarGridBodySlots, Pt as ListboxVirtualRootSlots, Q as ProgressStatus, Qn as ComboboxItemIndicatorProps, Qr as DateRange, Qt as DateRangeFieldRootEmits, R as SliderValueSlots, Ri as AutocompleteMode, Rr as MonthCalendarPageButtonState, Si as ItemGroup, Sn as DateFieldRootProps, Sr as CalendarView, St as Meter, T as TimeRangeFieldRootEmits, Ti as AutocompletePopupState, Tn as DateFieldInputSlots, Tr as CalendarViewRootEmits, Tt as MeterRootProps, U as SelectVirtual, Un as ComboboxItemEquality, Ur as MonthCalendarRootSharedProps, Ut as DateRangePickerInputRootProps, V as SliderRootProps, Vn as ComboboxValueSlots, Vr as MonthCalendarRootEmits, Vt as DateRangePickerInput, W as SelectVirtualListProps, Wn as ComboboxItemToString, Wr as MonthCalendarRootState, X as RangeCalendarRootEmits, Xn as ComboboxListSlots, Xr as CalendarPresetState, Y as RangeCalendar, Yn as ComboboxPopupState, Yr as CalendarPresetProps, Z as RangeCalendarRootProps, Zn as ComboboxListState, Zr as CalendarPresetValue, Zt as DateRangeField, _ as YearCalendarRootEmits, _i as CalendarGridProps, _n as SegmentGranularity, _r as CascadeSelectLevelState, _t as MonthRangeCalendarRootProps, ai as CalendarRootProps, ar as CascadeItem, bi as Align, bn as DateFieldSegmentProps, br as CascadeSelectItemProps, bt as YearMonthRange, ci as CalendarPrevButtonProps, cn as DatePickerInputRootEmits, cr as CascadeSelectValueProps, ct as MultipleCalendar, d as YearRangeCalendarRootProps, di as CalendarHeadingProps, dn as DateRangeFieldRootSharedProps, dr as CascadeSelectRootEmits, ei as Weekday, en as DateRangeFieldValue, er as ComboboxItemProps, et as ProgressValueSlotProps, fi as CalendarHeadingState, fn as RangeEnd, fr as CascadeSelectRootProps, g as YearCalendar, gi as CalendarGridBodySlots, gn as PlainTime, gr as CascadeSelectLevelProps, gt as MonthRangeCalendarRootEmits, hi as CalendarGridHeaderSlots, hn as PlainDateTime, hr as CascadeSelectPopupState, ht as MonthRangeCalendar, i as Autocomplete, ii as CalendarRootEmits, it as ProgressState, j as TimeField, ji as AutocompleteValueSlots, jn as CommandVirtualListSlots, jr as MonthCalendarCellProps, jt as ListboxVirtualItem, ki as AutocompleteItemState, kn as CommandVirtual, kr as CalendarViewName, l as YearRangeCalendar, li as CalendarNextButtonProps, ln as DatePickerInputRootProps, lr as CascadeSelectValueState, lt as MultipleCalendarRootEmits, mi as CalendarHeaderCellState, mr as CascadeSelectPortalProps, n as AutocompleteVirtualListProps, ni as CalendarRowProps, nr as ComboboxItemState, nt as ProgressLabelProps, oi as CalendarRootSharedProps, pi as CalendarHeaderCellProps, pn as DateSegment, pr as CascadeSelectPositionerState, qn as ComboboxPositionerState, r as AutocompleteVirtualListSlots, ri as CalendarRowSlots, rr as ComboboxDisabledState, rt as ProgressRootProps, si as CalendarRootState, sn as DatePickerInput, sr as CascadeSelect, t as AutocompleteVirtual, ti as Calendar, tn as DateRangeFieldInputProps, tr as ComboboxOpenState, tt as ProgressValueSlots, u as YearRangeCalendarRootEmits, ui as CalendarPageButtonState, un as DatePickerInputRootSharedProps, ur as CascadeSelectTriggerState, ut as MultipleCalendarRootProps, v as YearCalendarRootProps, vi as CalendarCellProps, vn as SegmentType, vr as CascadeSelectItemIndicatorProps, vt as PlainYear, w as TimeRangeField, wi as AutocompletePositionerState, wn as DateFieldRootSharedProps, wr as CalendarViewTriggerState, wt as MeterValueSlots, xi as ItemFilter, xn as DateFieldRootEmits, xr as CascadeSelectItemState, xt as YearRange, yi as CalendarCellState, yn as DateField, yr as CascadeSelectItemIndicatorState, yt as PlainYearMonth, z as SliderLabelProps, zi as VirtualListEmits, zr as MonthCalendarHeadingProps } from "./index-g8zeeaxp.js";
13
13
  import { t as PositionerProps } from "./use-positioner-D98pYl_K.js";
14
14
  import { a as AvatarFallbackProps, i as AvatarImageProps, n as Avatar, o as AvatarState, r as AvatarImageEmits, t as ImageLoadingStatus } from "./index-Drp7svmT.js";
15
15
  import { n as BreadcrumbsLinkProps, r as BreadcrumbsLinkState, t as Breadcrumbs } from "./index-UxsyZS_A.js";
@@ -49,7 +49,7 @@ import { a as MenuTriggerState, i as MenuTriggerProps, r as Menu } from "./index
49
49
  import { i as MenubarState, n as Menubar, r as MenubarProps, t as RovingOrientation } from "./index-C-QYKtWy.js";
50
50
  import { a as MonthRangePicker, o as MonthRangePickerRootEmits, s as MonthRangePickerRootProps } from "./index-BzHLkAWU.js";
51
51
  import { _ as NavigationMenuContentState, a as NavigationMenuTriggerProps, c as NavigationMenuRootProps, d as NavigationMenuPortalProps, f as NavigationMenuPopupState, g as NavigationMenuOrientation, h as NavigationMenuItemProps, i as NavigationMenu, l as NavigationMenuRootState, m as NavigationMenuLinkProps, o as NavigationMenuTriggerState, p as NavigationMenuListState, s as NavigationMenuRootEmits, t as ActivationDirection, u as NavigationMenuPositionerState } from "./index-CqP363e5.js";
52
- import { a as NumberFieldState, i as NumberFieldRootProps, n as NumberFieldScrubAreaProps, r as NumberFieldRootEmits, t as NumberField } from "./index-B8E3X1CK.js";
52
+ import { a as NumberFieldState, i as NumberFieldRootProps, n as NumberFieldScrubAreaProps, r as NumberFieldRootEmits, t as NumberField } from "./index-lXj_BUUG.js";
53
53
  import { a as OTPFieldInputState, i as OTPFieldRootProps, n as OTPField, o as OTPFieldState, r as OTPFieldRootEmits, t as OtpValidationType } from "./index-S0FIwOSw.js";
54
54
  import { a as PaginationRootSlots, c as PaginationItemState, d as PaginationControlState, f as PaginationState, i as PaginationRootProps, l as PaginationEllipsisState, n as Pagination, o as PaginationSlotProps, r as PaginationRootEmits, s as PaginationItemProps, t as PaginationRangeItem, u as PaginationControlProps } from "./index-BJz7OWbi.js";
55
55
  import { i as PasswordInputState, n as PasswordInputRootEmits, r as PasswordInputRootProps, t as PasswordInput } from "./index-W8aOtVIu.js";
package/dist/index.js CHANGED
@@ -29,9 +29,9 @@ import { t as ColorSlider } from "./color-slider-BCqoolnY.js";
29
29
  import { t as ColorSwatch } from "./color-swatch-C-8IN28V.js";
30
30
  import { t as ColorSwatchPicker } from "./color-swatch-picker-CU1wrhjX.js";
31
31
  import { t as ColorWheel } from "./color-wheel-F_BoXKON.js";
32
- import { t as Combobox } from "./parts--mC44S1N.js";
32
+ import { t as Combobox } from "./parts-DOWIiUdN.js";
33
33
  import "./combobox.js";
34
- import { t as ComboboxVirtual } from "./combobox-virtual-DTRTVq5N.js";
34
+ import { t as ComboboxVirtual } from "./combobox-virtual-BDWkgERh.js";
35
35
  import { t as Command } from "./parts-M3ThgZzl.js";
36
36
  import "./command.js";
37
37
  import { t as CommandVirtual } from "./command-virtual-LoTBDEY5.js";
@@ -67,7 +67,7 @@ import { t as MonthRangeCalendar } from "./month-range-calendar-CJAWu1-Z.js";
67
67
  import { t as MonthRangePicker } from "./month-range-picker-CRJDG2HG.js";
68
68
  import { t as MultipleCalendar } from "./multiple-calendar-BIb2zfBH.js";
69
69
  import { t as NavigationMenu } from "./navigation-menu-COTxGol_.js";
70
- import { t as NumberField } from "./number-field-CqxEnwiS.js";
70
+ import { t as NumberField } from "./number-field-D5pM1f30.js";
71
71
  import { t as OTPField } from "./otp-field-DIDuypLU.js";
72
72
  import { t as Pagination } from "./pagination-BNUjFYxK.js";
73
73
  import { t as PasswordInput } from "./password-input-DC39W-do.js";
@@ -1,5 +1,5 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { At as ListboxVirtual, Bi as VirtualListProps, Mt as ListboxVirtualRootEmits, Nt as ListboxVirtualRootProps, Ot as SelectionBehavior, Pt as ListboxVirtualRootSlots, jt as ListboxVirtualItem, kt as SelectionMode, zi as VirtualListEmits } from "./index-t_lSQgLA.js";
3
+ import { At as ListboxVirtual, Bi as VirtualListProps, Mt as ListboxVirtualRootEmits, Nt as ListboxVirtualRootProps, Ot as SelectionBehavior, Pt as ListboxVirtualRootSlots, jt as ListboxVirtualItem, kt as SelectionMode, zi as VirtualListEmits } from "./index-g8zeeaxp.js";
4
4
  import { r as Listbox } from "./index-5WtjXdX9.js";
5
5
  export { type ChangeDetails, type ChangeReason, Listbox, ListboxVirtual, type ListboxVirtualItem, type ListboxVirtualRootEmits, type ListboxVirtualRootProps, type ListboxVirtualRootSlots, type RenderSlotProps, type SelectionBehavior, type SelectionMode, type VirtualListEmits, type VirtualListProps };
package/dist/meter.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
2
- import { Ct as MeterValueSlotProps, Dt as MeterState, Et as MeterLabelProps, St as Meter, Tt as MeterRootProps, wt as MeterValueSlots } from "./index-t_lSQgLA.js";
2
+ import { Ct as MeterValueSlotProps, Dt as MeterState, Et as MeterLabelProps, St as Meter, Tt as MeterRootProps, wt as MeterValueSlots } from "./index-g8zeeaxp.js";
3
3
  export { Meter, type MeterLabelProps, type MeterRootProps, type MeterState, type MeterValueSlotProps, type MeterValueSlots, type RenderSlotProps };
@@ -1,5 +1,5 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { Ar as MonthCalendar, Br as MonthCalendarHeadingState, Fr as MonthCalendarGridProps, Gr as MonthCalendarCellState, Hr as MonthCalendarRootProps, Ir as MonthCalendarNextButtonProps, Lr as MonthCalendarPrevButtonProps, Mr as MonthCalendarRowProps, Nr as MonthCalendarRowSlots, Pr as MonthCalendarGridBodySlots, Rr as MonthCalendarPageButtonState, Ur as MonthCalendarRootSharedProps, Vr as MonthCalendarRootEmits, Wr as MonthCalendarRootState, bt as YearMonthRange, jr as MonthCalendarCellProps, vt as PlainYear, xt as YearRange, yt as PlainYearMonth, zr as MonthCalendarHeadingProps } from "./index-t_lSQgLA.js";
3
+ import { Ar as MonthCalendar, Br as MonthCalendarHeadingState, Fr as MonthCalendarGridProps, Gr as MonthCalendarCellState, Hr as MonthCalendarRootProps, Ir as MonthCalendarNextButtonProps, Lr as MonthCalendarPrevButtonProps, Mr as MonthCalendarRowProps, Nr as MonthCalendarRowSlots, Pr as MonthCalendarGridBodySlots, Rr as MonthCalendarPageButtonState, Ur as MonthCalendarRootSharedProps, Vr as MonthCalendarRootEmits, Wr as MonthCalendarRootState, bt as YearMonthRange, jr as MonthCalendarCellProps, vt as PlainYear, xt as YearRange, yt as PlainYearMonth, zr as MonthCalendarHeadingProps } from "./index-g8zeeaxp.js";
4
4
  import { c as MonthCalendarItem } from "./index-DqI6n06W.js";
5
5
  export { type ChangeDetails, type ChangeReason, MonthCalendar, type MonthCalendarCellProps, type MonthCalendarCellState, type MonthCalendarGridBodySlots, type MonthCalendarGridProps, type MonthCalendarHeadingProps, type MonthCalendarHeadingState, type MonthCalendarItem, type MonthCalendarNextButtonProps, type MonthCalendarPageButtonState, type MonthCalendarPrevButtonProps, type MonthCalendarRootEmits, type MonthCalendarRootProps, type MonthCalendarRootSharedProps, type MonthCalendarRootState, type MonthCalendarRowProps, type MonthCalendarRowSlots, type PlainYear, type PlainYearMonth, type RenderSlotProps, type YearMonthRange, type YearRange };
@@ -1,5 +1,5 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { Ar as MonthCalendar, Br as MonthCalendarHeadingState, Fr as MonthCalendarGridProps, Gr as MonthCalendarCellState, Ir as MonthCalendarNextButtonProps, Lr as MonthCalendarPrevButtonProps, Mr as MonthCalendarRowProps, Nr as MonthCalendarRowSlots, Pr as MonthCalendarGridBodySlots, Rr as MonthCalendarPageButtonState, Ur as MonthCalendarRootSharedProps, Wr as MonthCalendarRootState, _t as MonthRangeCalendarRootProps, dt as PlainYear, ft as PlainYearMonth, gt as MonthRangeCalendarRootEmits, ht as MonthRangeCalendar, jr as MonthCalendarCellProps, mt as YearRange, pt as YearMonthRange, zr as MonthCalendarHeadingProps } from "./index-t_lSQgLA.js";
3
+ import { Ar as MonthCalendar, Br as MonthCalendarHeadingState, Fr as MonthCalendarGridProps, Gr as MonthCalendarCellState, Ir as MonthCalendarNextButtonProps, Lr as MonthCalendarPrevButtonProps, Mr as MonthCalendarRowProps, Nr as MonthCalendarRowSlots, Pr as MonthCalendarGridBodySlots, Rr as MonthCalendarPageButtonState, Ur as MonthCalendarRootSharedProps, Wr as MonthCalendarRootState, _t as MonthRangeCalendarRootProps, dt as PlainYear, ft as PlainYearMonth, gt as MonthRangeCalendarRootEmits, ht as MonthRangeCalendar, jr as MonthCalendarCellProps, mt as YearRange, pt as YearMonthRange, zr as MonthCalendarHeadingProps } from "./index-g8zeeaxp.js";
4
4
  import { c as MonthCalendarItem } from "./index-DqI6n06W.js";
5
5
  export { type ChangeDetails, type ChangeReason, MonthCalendar, type MonthCalendarCellProps, type MonthCalendarCellState, type MonthCalendarGridBodySlots, type MonthCalendarGridProps, type MonthCalendarHeadingProps, type MonthCalendarHeadingState, type MonthCalendarItem, type MonthCalendarNextButtonProps, type MonthCalendarPageButtonState, type MonthCalendarPrevButtonProps, type MonthCalendarRootSharedProps, type MonthCalendarRootState, type MonthCalendarRowProps, type MonthCalendarRowSlots, MonthRangeCalendar, type MonthRangeCalendarRootEmits, type MonthRangeCalendarRootProps, type PlainYear, type PlainYearMonth, type RenderSlotProps, type YearMonthRange, type YearRange };
@@ -1,5 +1,5 @@
1
1
  import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
2
2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { _i as CalendarGridProps, at as DateRange, ci as CalendarPrevButtonProps, ct as MultipleCalendar, di as CalendarHeadingProps, fi as CalendarHeadingState, gi as CalendarGridBodySlots, hi as CalendarGridHeaderSlots, li as CalendarNextButtonProps, lt as MultipleCalendarRootEmits, mi as CalendarHeaderCellState, ni as CalendarRowProps, oi as CalendarRootSharedProps, ot as PlainDate, pi as CalendarHeaderCellProps, ri as CalendarRowSlots, si as CalendarRootState, st as Weekday, ti as Calendar, ui as CalendarPageButtonState, ut as MultipleCalendarRootProps, vi as CalendarCellProps, yi as CalendarCellState } from "./index-t_lSQgLA.js";
3
+ import { _i as CalendarGridProps, at as DateRange, ci as CalendarPrevButtonProps, ct as MultipleCalendar, di as CalendarHeadingProps, fi as CalendarHeadingState, gi as CalendarGridBodySlots, hi as CalendarGridHeaderSlots, li as CalendarNextButtonProps, lt as MultipleCalendarRootEmits, mi as CalendarHeaderCellState, ni as CalendarRowProps, oi as CalendarRootSharedProps, ot as PlainDate, pi as CalendarHeaderCellProps, ri as CalendarRowSlots, si as CalendarRootState, st as Weekday, ti as Calendar, ui as CalendarPageButtonState, ut as MultipleCalendarRootProps, vi as CalendarCellProps, yi as CalendarCellState } from "./index-g8zeeaxp.js";
4
4
  import { h as CalendarOptions } from "./index-DIZSgXHM.js";
5
5
  export { Calendar, type CalendarCellProps, type CalendarCellState, type CalendarGridBodySlots, type CalendarGridHeaderSlots, type CalendarGridProps, type CalendarHeaderCellProps, type CalendarHeaderCellState, type CalendarHeadingProps, type CalendarHeadingState, type CalendarNextButtonProps, type CalendarOptions, type CalendarPageButtonState, type CalendarPrevButtonProps, type CalendarRootSharedProps, type CalendarRootState, type CalendarRowProps, type CalendarRowSlots, type ChangeDetails, type ChangeReason, type DateRange, MultipleCalendar, type MultipleCalendarRootEmits, type MultipleCalendarRootProps, type PlainDate, type RenderSlotProps, type Weekday };
@@ -19,7 +19,10 @@ function useStepperButton(context, direction) {
19
19
  const element = shallowRef(null);
20
20
  watch(element, (button, _, onCleanup) => {
21
21
  if (button === null) return;
22
- onCleanup(watchAutoRepeat(button, { onStep: (event) => context.stepBy(direction * context.amount(event), direction > 0 ? "increment-press" : "decrement-press", event) }));
22
+ onCleanup(watchAutoRepeat(button, {
23
+ onStep: (event) => context.stepBy(direction * context.amount(event), direction > 0 ? "increment-press" : "decrement-press", event),
24
+ onEnd: (event) => context.commit(event)
25
+ }));
23
26
  }, { flush: "post" });
24
27
  return {
25
28
  ref: elementSetter(element),
@@ -294,7 +297,8 @@ const NumberFieldRoot = publicComponent(defineComponent({
294
297
  },
295
298
  emits: {
296
299
  "update:value": (_value) => true,
297
- valueChange: (_value, _details) => true
300
+ valueChange: (_value, _details) => true,
301
+ valueCommitted: (_value, _details) => true
298
302
  },
299
303
  setup(props, { attrs, slots, emit }) {
300
304
  const generatedId = useId();
@@ -333,13 +337,28 @@ const NumberFieldRoot = publicComponent(defineComponent({
333
337
  watch(() => own.value.value, (next) => {
334
338
  current = next;
335
339
  }, { flush: "sync" });
340
+ let pending = null;
336
341
  const setValue = (next, details) => {
342
+ if (details.reason === "none") pending = null;
343
+ else if (!Object.is(next, current)) pending = details.reason;
337
344
  current = next;
338
345
  own.set(next, details);
339
346
  setTimeout(() => {
340
347
  current = own.value.value;
341
348
  });
342
349
  };
350
+ /** Reports the value when a change is pending (spec/number-field.md, "Committing"). */
351
+ const commit = (event) => {
352
+ const reason = pending;
353
+ if (reason === null) return;
354
+ pending = null;
355
+ emit("valueCommitted", current, {
356
+ reason,
357
+ event
358
+ });
359
+ };
360
+ /** A key or the wheel commits its step at once. */
361
+ const commitsAtOnce = (reason) => reason === "keyboard" || reason === "wheel";
343
362
  const options = () => ({
344
363
  locale: props.locale,
345
364
  format: props.format
@@ -365,6 +384,7 @@ const NumberFieldRoot = publicComponent(defineComponent({
365
384
  reason,
366
385
  event
367
386
  });
387
+ if (commitsAtOnce(reason)) commit(event);
368
388
  const bound = by > 0 ? props.max : props.min;
369
389
  return bound === void 0 || next !== bound;
370
390
  };
@@ -375,6 +395,7 @@ const NumberFieldRoot = publicComponent(defineComponent({
375
395
  reason,
376
396
  event
377
397
  });
398
+ if (commitsAtOnce(reason)) commit(event);
378
399
  };
379
400
  const onInputText = (text, event) => {
380
401
  if (disabled() || props.readOnly) return false;
@@ -403,6 +424,7 @@ const NumberFieldRoot = publicComponent(defineComponent({
403
424
  reason: "input-blur",
404
425
  event
405
426
  });
427
+ commit(event);
406
428
  };
407
429
  watch(hidden, (element, _, onCleanup) => {
408
430
  if (element === null) return;
@@ -441,6 +463,7 @@ const NumberFieldRoot = publicComponent(defineComponent({
441
463
  amount,
442
464
  stepBy,
443
465
  stepTo,
466
+ commit,
444
467
  onInputText,
445
468
  onInputBlur,
446
469
  setInputElement: elementSetter(input),
@@ -527,8 +550,9 @@ const NumberField = {
527
550
  const amount = context.amount(event);
528
551
  context.stepBy(steps > 0 ? amount : -amount, "scrub", event, Math.abs(steps));
529
552
  },
530
- onEnd: () => {
553
+ onEnd: (event) => {
531
554
  context.scrubbing.value = false;
555
+ context.commit(event);
532
556
  },
533
557
  onCursor: (point) => {
534
558
  context.cursor.value = point;
@@ -578,4 +602,4 @@ const NumberField = {
578
602
  };
579
603
  export { NumberField as t };
580
604
 
581
- //# sourceMappingURL=number-field-CqxEnwiS.js.map
605
+ //# sourceMappingURL=number-field-D5pM1f30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-field-D5pM1f30.js","names":[],"sources":["../src/components/number-field/number-field-context.ts","../src/components/number-field/use-stepper-button.ts","../src/components/number-field/number-field-decrement.ts","../src/components/number-field/number-field-group.ts","../src/components/number-field/number-field-increment.ts","../src/components/number-field/number-field-input.ts","../src/components/number-field/number-field-root.ts","../src/components/number-field/number-field-scrub-area.ts","../src/components/number-field/number-field-scrub-area-cursor.ts","../src/components/number-field/parts.ts"],"sourcesContent":["import type { ScrubPoint } from \"@fragiola/primitives/number\";\nimport type { ComputedRef, InjectionKey, Ref } from \"vue\";\nimport type { FieldControlBinding } from \"../../composables/use-field-control.ts\";\nimport type { ChangeReason } from \"../../utils/change-details.ts\";\n\n/** The state every part renders with (spec/number-field.md, \"State attributes and ARIA\"). */\nexport interface NumberFieldState {\n /** The value: a number, or `null` while empty. */\n value: number | null;\n /** The Input's text. */\n inputValue: string;\n disabled: boolean;\n readOnly: boolean;\n required: boolean;\n scrubbing: boolean;\n}\n\nexport interface NumberFieldContext {\n state: ComputedRef<NumberFieldState>;\n inputId: () => string;\n min: () => number | undefined;\n max: () => number | undefined;\n format: () => Intl.NumberFormatOptions | undefined;\n /** The value as `format` writes it (`aria-valuetext`), `\"\"` while empty. */\n formattedValue: () => string;\n allowWheelScrub: () => boolean;\n field: FieldControlBinding;\n /** The state attributes and the field's, for every part. */\n attributes: () => Record<string, string>;\n /** The amount of one step for an event's modifier keys (Alt: small, Shift: large). */\n amount: (\n event: { altKey?: boolean; shiftKey?: boolean } | undefined,\n ) => number;\n /**\n * Steps `times` times by `amount` (negative: down) from the value (or the typed text): returns\n * whether another step that way could still change it (a bound not reached).\n */\n stepBy: (\n amount: number,\n reason: ChangeReason,\n event: Event | undefined,\n times?: number,\n ) => boolean;\n /** Sets the value, as a step does (Home and End set a bound). */\n stepTo: (\n value: number,\n reason: ChangeReason,\n event: Event | undefined,\n ) => void;\n /** The Input's text changed: `false` when it is refused (the text stays as it was). */\n onInputText: (text: string, event: Event) => boolean;\n /** The Input lost focus. */\n onInputBlur: (event: Event) => void;\n /** A button press or a scrub ended: reports a pending change (`valueCommitted`). */\n commit: (event: Event | undefined) => void;\n setInputElement: (value: unknown) => void;\n scrubbing: Ref<boolean>;\n /** The virtual cursor of a locked scrub, `null` otherwise. */\n cursor: Ref<ScrubPoint | null>;\n}\n\nexport const NumberFieldKey: InjectionKey<NumberFieldContext> =\n Symbol(\"NumberField\");\n","import { watchAutoRepeat } from \"@fragiola/primitives/number\";\nimport { shallowRef, watch } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport type { NumberFieldContext } from \"./number-field-context.ts\";\n\n/**\n * An Increment's or a Decrement's press and hold (spec/number-field.md, \"Pointer\"), and whether\n * it is disabled: the field disabled or read-only, or its step would change nothing.\n */\nexport function useStepperButton(\n context: NumberFieldContext,\n direction: 1 | -1,\n) {\n const element = shallowRef<HTMLElement | null>(null);\n watch(\n element,\n (button, _, onCleanup) => {\n if (button === null) {\n return;\n }\n onCleanup(\n watchAutoRepeat(button, {\n onStep: (event) =>\n context.stepBy(\n direction * context.amount(event as MouseEvent),\n direction > 0\n ? \"increment-press\"\n : \"decrement-press\",\n event,\n ),\n onEnd: (event) => context.commit(event),\n }),\n );\n },\n { flush: \"post\" },\n );\n return {\n ref: elementSetter(element),\n disabled: () => {\n const { value, disabled, readOnly } = context.state.value;\n const min = context.min();\n const max = context.max();\n const atBound =\n value !== null &&\n (direction > 0\n ? max !== undefined && value >= max\n : min !== undefined && value <= min);\n return disabled || readOnly || atBound;\n },\n };\n}\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport {\n NumberFieldKey,\n type NumberFieldState,\n} from \"./number-field-context.ts\";\nimport { useStepperButton } from \"./use-stepper-button.ts\";\n\n/**\n * Steps the value down, once or held (spec/number-field.md, \"Pointer\"); out of the tab order, its\n * name the consumer's.\n */\nexport const NumberFieldDecrement: PartComponent<\n Record<never, never>,\n NumberFieldState\n> = publicComponent(\n defineComponent({\n name: \"NumberFieldDecrement\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n NumberFieldKey,\n \"NumberField.Decrement\",\n );\n const button = useStepperButton(context, -1);\n return () =>\n renderPart(\n \"button\",\n { attrs, slots },\n props.as,\n context.state.value,\n {\n type: \"button\",\n tabindex: -1,\n disabled: button.disabled(),\n \"aria-controls\": context.inputId(),\n \"data-primitives-part\": \"number-field-decrement\",\n ...context.attributes(),\n ref: button.ref,\n },\n );\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport {\n NumberFieldKey,\n type NumberFieldState,\n} from \"./number-field-context.ts\";\n\n/** Groups the Input with its buttons (`role=\"group\"`, spec/number-field.md). */\nexport const NumberFieldGroup: PartComponent<\n Record<never, never>,\n NumberFieldState\n> = publicComponent(\n defineComponent({\n name: \"NumberFieldGroup\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n NumberFieldKey,\n \"NumberField.Group\",\n );\n return () =>\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n context.state.value,\n {\n role: \"group\",\n \"data-primitives-part\": \"number-field-group\",\n ...context.attributes(),\n },\n );\n },\n }),\n);\n","import { defineComponent } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport {\n NumberFieldKey,\n type NumberFieldState,\n} from \"./number-field-context.ts\";\nimport { useStepperButton } from \"./use-stepper-button.ts\";\n\n/**\n * Steps the value up, once or held (spec/number-field.md, \"Pointer\"); out of the tab order, its\n * name the consumer's.\n */\nexport const NumberFieldIncrement: PartComponent<\n Record<never, never>,\n NumberFieldState\n> = publicComponent(\n defineComponent({\n name: \"NumberFieldIncrement\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n NumberFieldKey,\n \"NumberField.Increment\",\n );\n const button = useStepperButton(context, 1);\n return () =>\n renderPart(\n \"button\",\n { attrs, slots },\n props.as,\n context.state.value,\n {\n type: \"button\",\n tabindex: -1,\n disabled: button.disabled(),\n \"aria-controls\": context.inputId(),\n \"data-primitives-part\": \"number-field-increment\",\n ...context.attributes(),\n ref: button.ref,\n },\n );\n },\n }),\n);\n","import { defineComponent, nextTick, shallowRef, watch } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport {\n NumberFieldKey,\n type NumberFieldState,\n} from \"./number-field-context.ts\";\n\n/** The `spinbutton`: a text input with the formatted value (spec/number-field.md, the APG). */\nexport const NumberFieldInput: PartComponent<\n Record<never, never>,\n NumberFieldState\n> = publicComponent(\n defineComponent({\n name: \"NumberFieldInput\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n NumberFieldKey,\n \"NumberField.Input\",\n );\n const element = shallowRef<HTMLInputElement | null>(null);\n const setElement = (value: unknown) => {\n context.setInputElement(value);\n const next =\n value instanceof HTMLInputElement\n ? value\n : ((value as { $el?: HTMLInputElement } | null)?.$el ??\n null);\n if (element.value !== next) {\n element.value = next;\n }\n };\n\n // the wheel over the focused Input steps it, and the page does not scroll (a\n // non-passive listener)\n watch(\n [element, context.allowWheelScrub],\n ([input, allowed], _, onCleanup) => {\n if (input === null || !allowed) {\n return;\n }\n const onWheel = (event: WheelEvent) => {\n if (\n input.ownerDocument.activeElement !== input ||\n event.deltaY === 0\n ) {\n return;\n }\n const { disabled, readOnly } = context.state.value;\n if (disabled || readOnly) {\n return;\n }\n event.preventDefault();\n const amount = context.amount(event);\n context.stepBy(\n event.deltaY < 0 ? amount : -amount,\n \"wheel\",\n event,\n );\n };\n input.addEventListener(\"wheel\", onWheel, {\n passive: false,\n });\n onCleanup(() =>\n input.removeEventListener(\"wheel\", onWheel),\n );\n },\n { flush: \"post\" },\n );\n\n const onKeydown = (event: KeyboardEvent) => {\n const { disabled, readOnly } = context.state.value;\n if (disabled || readOnly) {\n return;\n }\n const amount = context.amount(event);\n const large = context.amount({ shiftKey: true });\n switch (event.key) {\n case \"ArrowUp\":\n context.stepBy(amount, \"keyboard\", event);\n break;\n case \"ArrowDown\":\n context.stepBy(-amount, \"keyboard\", event);\n break;\n case \"PageUp\":\n context.stepBy(large, \"keyboard\", event);\n break;\n case \"PageDown\":\n context.stepBy(-large, \"keyboard\", event);\n break;\n case \"Home\": {\n const min = context.min();\n if (min === undefined) {\n return;\n }\n context.stepTo(min, \"keyboard\", event);\n break;\n }\n case \"End\": {\n const max = context.max();\n if (max === undefined) {\n return;\n }\n context.stepTo(max, \"keyboard\", event);\n break;\n }\n default:\n return;\n }\n event.preventDefault();\n };\n\n const onInput = (event: Event) => {\n const input = event.target as HTMLInputElement;\n if (!context.onInputText(input.value, event)) {\n // refused: the text stays as it was (spec/number-field.md, \"Typing\")\n input.value = context.state.value.inputValue;\n }\n // a text the render does not change (a controlled value the consumer kept) is\n // re-asserted once the update rendered\n void nextTick().then(() => {\n const text = context.state.value.inputValue;\n if (input.value !== text) {\n input.value = text;\n }\n });\n };\n\n return () => {\n const state = context.state.value;\n const { value, disabled, readOnly, required } = state;\n const min = context.min();\n const max = context.max();\n const integer =\n context.format()?.maximumFractionDigits === 0 &&\n min !== undefined &&\n min >= 0;\n const { field } = context;\n return renderPart(\"input\", { attrs, slots }, props.as, state, {\n id: context.inputId(),\n type: \"text\",\n role: \"spinbutton\",\n inputmode: integer ? \"numeric\" : \"decimal\",\n autocomplete: \"off\",\n autocorrect: \"off\",\n spellcheck: \"false\",\n value: state.inputValue,\n disabled,\n readonly: readOnly,\n \"aria-valuenow\": value ?? undefined,\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuetext\":\n value === null ? undefined : context.formattedValue(),\n \"aria-required\": required ? \"true\" : undefined,\n \"aria-readonly\": readOnly ? \"true\" : undefined,\n ...field.aria(),\n \"data-primitives-part\": \"number-field-input\",\n ...context.attributes(),\n onInput,\n onKeydown,\n onFocus: field.onFocus,\n onBlur: (event: FocusEvent) => {\n context.onInputBlur(event);\n field.onBlur();\n },\n ref: setElement,\n });\n };\n },\n }),\n);\n","import {\n bridgeForm,\n VISUALLY_HIDDEN_INPUT_STYLE,\n} from \"@fragiola/primitives/form\";\nimport {\n clampNumber,\n formatNumber,\n isNumberText,\n parseNumber,\n type ScrubPoint,\n stepNumber,\n} from \"@fragiola/primitives/number\";\nimport {\n computed,\n defineComponent,\n Fragment,\n h,\n type PropType,\n provide,\n ref,\n shallowRef,\n useId,\n watch,\n} from \"vue\";\nimport { useControllable } from \"../../composables/use-controllable.ts\";\nimport { useFieldControl } from \"../../composables/use-field-control.ts\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport type {\n ChangeDetails,\n ChangeReason,\n} from \"../../utils/change-details.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport {\n NumberFieldKey,\n type NumberFieldState,\n} from \"./number-field-context.ts\";\n\nexport interface NumberFieldRootProps {\n /** A number, or `null` while empty (`v-model:value`). */\n value?: number | null;\n defaultValue?: number | null;\n min?: number;\n max?: number;\n /** The amount of a step (default `1`). */\n step?: number;\n /** The amount of a step with Alt (default `0.1`). */\n smallStep?: number;\n /** The amount of a step with Shift, Page Up and Page Down (default `10`). */\n largeStep?: number;\n /** A step from a value off the grid goes to the grid's next point. */\n snapOnStep?: boolean;\n /** A typed value outside `[min, max]` is clamped on blur (default `true`). */\n clampOnBlur?: boolean;\n /** How the Input writes the value; default: the plain number in the locale. */\n format?: Intl.NumberFormatOptions;\n /** The locale of the format and the parsing (BCP 47; default: the runtime's). */\n locale?: string;\n /** The mouse wheel steps the value over the focused Input. */\n allowWheelScrub?: boolean;\n required?: boolean;\n readOnly?: boolean;\n disabled?: boolean;\n name?: string;\n /** The Input's `id`. */\n id?: string;\n}\n\nexport type NumberFieldRootEmits = {\n \"update:value\": (value: number | null) => true;\n valueChange: (value: number | null, details: ChangeDetails) => true;\n /**\n * The value once a change is complete: on blur after typing, at a key or wheel step, at the\n * release of a button press or a scrub (spec/number-field.md, \"Committing\").\n */\n valueCommitted: (value: number | null, details: ChangeDetails) => true;\n};\n\nconst NUMBER_OR_NULL = [Number, null] as PropType<number | null>;\n\n/**\n * Holds a NumberField's value (`v-model:value`), its text and its hidden form input\n * (spec/number-field.md, the APG spinbutton).\n */\nexport const NumberFieldRoot: PartComponent<\n NumberFieldRootProps,\n NumberFieldState,\n NumberFieldRootEmits\n> = publicComponent(\n defineComponent({\n name: \"NumberFieldRoot\",\n inheritAttrs: false,\n props: {\n ...asProp,\n value: { type: NUMBER_OR_NULL, default: undefined },\n defaultValue: { type: NUMBER_OR_NULL, default: null },\n min: { type: Number, default: undefined },\n max: { type: Number, default: undefined },\n step: { type: Number, default: 1 },\n smallStep: { type: Number, default: 0.1 },\n largeStep: { type: Number, default: 10 },\n snapOnStep: { type: Boolean, default: false },\n clampOnBlur: { type: Boolean, default: true },\n format: {\n type: Object as PropType<Intl.NumberFormatOptions>,\n default: undefined,\n },\n locale: { type: String, default: undefined },\n allowWheelScrub: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n readOnly: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n name: { type: String, default: undefined },\n id: { type: String, default: undefined },\n },\n emits: {\n \"update:value\": (_value: number | null) => true,\n valueChange: (_value: number | null, _details: ChangeDetails) =>\n true,\n valueCommitted: (_value: number | null, _details: ChangeDetails) =>\n true,\n },\n setup(props, { attrs, slots, emit }) {\n const generatedId = useId();\n const inputId = () => props.id ?? generatedId;\n const own = useControllable<number | null, ChangeDetails>(\n () => props.value,\n props.defaultValue,\n (next, details) => {\n emit(\"update:value\", next);\n emit(\"valueChange\", next, details);\n },\n );\n // the text the user typed, until the blur formats it (`null`: the formatted value)\n const typed = ref<string | null>(null);\n const scrubbing = ref(false);\n const cursor = shallowRef<ScrubPoint | null>(null);\n const input = shallowRef<HTMLElement | null>(null);\n const hidden = shallowRef<HTMLInputElement | null>(null);\n const field = useFieldControl({\n id: inputId,\n labelable: true,\n value: () => own.value.value,\n filled: () => own.value.value !== null,\n input: () => hidden.value,\n focusTarget: () => input.value,\n });\n const disabled = () => props.disabled || field.disabled();\n const formattedValue = computed(() =>\n formatNumber(own.value.value, {\n locale: props.locale,\n format: props.format,\n }),\n );\n const state = computed<NumberFieldState>(() => ({\n value: own.value.value,\n inputValue: typed.value ?? formattedValue.value,\n disabled: disabled(),\n readOnly: props.readOnly,\n required: props.required,\n scrubbing: scrubbing.value,\n }));\n\n // the value as of the last change, so a held button's steps never read a value a\n // controlled consumer has not rendered yet\n let current = own.value.value;\n watch(\n () => own.value.value,\n (next) => {\n current = next;\n },\n { flush: \"sync\" },\n );\n // the reason of the last change not committed yet\n let pending: ChangeReason | null = null;\n const setValue = (next: number | null, details: ChangeDetails) => {\n if (details.reason === \"none\") {\n pending = null;\n } else if (!Object.is(next, current)) {\n pending = details.reason;\n }\n current = next;\n own.set(next, details);\n // an override for the steps of this task only: a consumer that refused the value\n // renders nothing, and the next task steps from the value it kept\n setTimeout(() => {\n current = own.value.value;\n });\n };\n /** Reports the value when a change is pending (spec/number-field.md, \"Committing\"). */\n const commit = (event: Event | undefined) => {\n const reason = pending;\n if (reason === null) {\n return;\n }\n pending = null;\n emit(\"valueCommitted\", current, { reason, event });\n };\n /** A key or the wheel commits its step at once. */\n const commitsAtOnce = (reason: ChangeReason) =>\n reason === \"keyboard\" || reason === \"wheel\";\n const options = () => ({\n locale: props.locale,\n format: props.format,\n });\n /** The value a step starts from: the typed text when it reads as a number. */\n const base = (): number | null => {\n const text = typed.value;\n if (text === null) {\n return current;\n }\n const parsed = parseNumber(text, options());\n return parsed === null || Number.isNaN(parsed)\n ? current\n : parsed;\n };\n const amount = (\n event: { altKey?: boolean; shiftKey?: boolean } | undefined,\n ) =>\n event?.altKey\n ? props.smallStep\n : event?.shiftKey\n ? props.largeStep\n : props.step;\n const stepBy = (\n by: number,\n reason: ChangeReason,\n event: Event | undefined,\n times = 1,\n ) => {\n if (disabled() || props.readOnly) {\n return false;\n }\n let next = base();\n for (let index = 0; index < times; index += 1) {\n next = stepNumber(next, by, {\n min: props.min,\n max: props.max,\n snapOnStep: props.snapOnStep,\n });\n }\n typed.value = null;\n if (!Object.is(next, current)) {\n setValue(next, { reason, event });\n }\n if (commitsAtOnce(reason)) {\n commit(event);\n }\n const bound = by > 0 ? props.max : props.min;\n return bound === undefined || next !== bound;\n };\n const stepTo = (\n next: number,\n reason: ChangeReason,\n event: Event | undefined,\n ) => {\n if (disabled() || props.readOnly) {\n return;\n }\n typed.value = null;\n if (!Object.is(next, current)) {\n setValue(next, { reason, event });\n }\n if (commitsAtOnce(reason)) {\n commit(event);\n }\n };\n const onInputText = (text: string, event: Event) => {\n if (disabled() || props.readOnly) {\n return false;\n }\n if (!isNumberText(text, options())) {\n // refused: the text stays as it was (spec/number-field.md, \"Typing\")\n return false;\n }\n typed.value = text;\n if (text.trim() === \"\") {\n setValue(null, { reason: \"input-clear\", event });\n return true;\n }\n const parsed = parseNumber(text, options());\n if (parsed !== null && !Number.isNaN(parsed)) {\n setValue(parsed, { reason: \"input-change\", event });\n }\n return true;\n };\n const onInputBlur = (event: Event) => {\n if (typed.value === null) {\n return;\n }\n let next = base();\n if (props.clampOnBlur && next !== null) {\n next = clampNumber(next, props.min, props.max);\n }\n typed.value = null;\n if (!Object.is(next, current)) {\n setValue(next, { reason: \"input-blur\", event });\n }\n commit(event);\n };\n\n // a form reset returns it to its default, and writes the rendered value back\n // (Switch's way, docs/decisions.md)\n watch(\n hidden,\n (element, _, onCleanup) => {\n if (element === null) {\n return;\n }\n onCleanup(\n bridgeForm(element, {\n reset: () => {\n const rendered = own.value.value;\n field.reset();\n typed.value = null;\n setValue(props.defaultValue, {\n reason: \"none\",\n });\n // the rendered value, which a patch follows (a controlled\n // field that refuses the reset keeps its input)\n element.value =\n rendered === null ? \"\" : String(rendered);\n // and the Input's text: Vue sets `value` as a property only, so\n // the browser's reset emptied it, and an unchanged value patches\n // nothing\n const text = input.value;\n if (text instanceof HTMLInputElement) {\n text.value =\n rendered === null\n ? \"\"\n : formatNumber(rendered, options());\n }\n },\n invalid: () => input.value,\n }),\n );\n },\n { flush: \"post\" },\n );\n\n const attributes = () => ({\n ...stateAttributes({\n disabled: disabled(),\n readonly: props.readOnly,\n required: props.required,\n scrubbing: scrubbing.value,\n }),\n ...field.attributes(),\n });\n provide(NumberFieldKey, {\n state,\n inputId,\n min: () => props.min,\n max: () => props.max,\n format: () => props.format,\n formattedValue: () => formattedValue.value,\n allowWheelScrub: () => props.allowWheelScrub,\n field,\n attributes,\n amount,\n stepBy,\n stepTo,\n commit,\n onInputText,\n onInputBlur,\n setInputElement: elementSetter(input),\n scrubbing,\n cursor,\n });\n\n return () => {\n const currentState = state.value;\n const { value } = currentState;\n return h(Fragment, [\n renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n currentState,\n {\n \"data-primitives-part\": \"number-field-root\",\n ...attributes(),\n },\n ),\n h(\"input\", {\n ref: (element: unknown) => {\n hidden.value = element as HTMLInputElement | null;\n },\n type: \"number\",\n \"aria-hidden\": \"true\",\n tabindex: -1,\n name: field.name() ?? props.name,\n value: value === null ? \"\" : String(value),\n min: props.min,\n max: props.max,\n step: \"any\",\n required: currentState.required,\n disabled: currentState.disabled,\n onFocus: () => input.value?.focus(),\n style: VISUALLY_HIDDEN_INPUT_STYLE,\n \"data-primitives-part\": \"number-field-hidden-input\",\n }),\n ]);\n };\n },\n }),\n);\n","import { watchScrub } from \"@fragiola/primitives/number\";\nimport { defineComponent, type PropType, shallowRef, watch } from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport {\n NumberFieldKey,\n type NumberFieldState,\n} from \"./number-field-context.ts\";\n\nexport interface NumberFieldScrubAreaProps {\n /** The axis the pointer scrubs along (default `\"horizontal\"`). */\n direction?: \"horizontal\" | \"vertical\";\n /** The pixels one step takes (default `2`). */\n pixelSensitivity?: number;\n}\n\nconst STYLE = { touchAction: \"none\", userSelect: \"none\" } as const;\n\n/** A press dragged along it steps the value (spec/number-field.md, \"Pointer\": scrub). */\nexport const NumberFieldScrubArea: PartComponent<\n NumberFieldScrubAreaProps,\n NumberFieldState\n> = publicComponent(\n defineComponent({\n name: \"NumberFieldScrubArea\",\n inheritAttrs: false,\n props: {\n ...asProp,\n direction: {\n type: String as PropType<\"horizontal\" | \"vertical\">,\n default: \"horizontal\",\n },\n pixelSensitivity: { type: Number, default: 2 },\n },\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n NumberFieldKey,\n \"NumberField.ScrubArea\",\n );\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n watch(\n [element, () => props.direction, () => props.pixelSensitivity],\n ([area, direction, pixelSensitivity], _, onCleanup) => {\n if (area === null) {\n return;\n }\n onCleanup(\n watchScrub(area, {\n direction,\n pixelSensitivity,\n onStart: () => {\n const { disabled, readOnly } =\n context.state.value;\n if (disabled || readOnly) {\n return false;\n }\n context.scrubbing.value = true;\n return true;\n },\n onScrub: (steps, event) => {\n const amount = context.amount(event);\n context.stepBy(\n steps > 0 ? amount : -amount,\n \"scrub\",\n event,\n Math.abs(steps),\n );\n },\n onEnd: (event) => {\n context.scrubbing.value = false;\n context.commit(event);\n },\n onCursor: (point) => {\n context.cursor.value = point;\n },\n }),\n );\n },\n { flush: \"post\" },\n );\n return () =>\n renderPart(\n \"span\",\n { attrs, slots },\n props.as,\n context.state.value,\n {\n style: STYLE,\n // a press keeps the focus where it is\n onMousedown: (event: MouseEvent) => {\n if (event.button === 0) {\n event.preventDefault();\n }\n },\n \"data-primitives-part\": \"number-field-scrub-area\",\n ...context.attributes(),\n ref: setElement,\n },\n );\n },\n }),\n);\n","import { defineComponent, h, Teleport } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport {\n NumberFieldKey,\n type NumberFieldState,\n} from \"./number-field-context.ts\";\n\n/**\n * The virtual cursor of a locked scrub (spec/number-field.md, \"Pointer\"), teleported into `body`:\n * rendered only while a mouse scrubs with the pointer locked.\n */\nexport const NumberFieldScrubAreaCursor: PartComponent<\n Record<never, never>,\n NumberFieldState\n> = publicComponent(\n defineComponent({\n name: \"NumberFieldScrubAreaCursor\",\n inheritAttrs: false,\n props: asProp,\n setup(props, { attrs, slots }) {\n const context = useRequiredContext(\n NumberFieldKey,\n \"NumberField.ScrubAreaCursor\",\n );\n return () => {\n const cursor = context.cursor.value;\n if (cursor === null) {\n return null;\n }\n return h(Teleport, { to: \"body\" }, [\n renderPart(\n \"span\",\n { attrs, slots },\n props.as,\n context.state.value,\n {\n style: {\n position: \"fixed\",\n top: 0,\n left: 0,\n pointerEvents: \"none\",\n transform: `translate3d(${cursor.x}px, ${cursor.y}px, 0)`,\n },\n \"data-primitives-part\":\n \"number-field-scrub-area-cursor\",\n ...context.attributes(),\n },\n ),\n ]);\n };\n },\n }),\n);\n","import { NumberFieldDecrement } from \"./number-field-decrement.ts\";\nimport { NumberFieldGroup } from \"./number-field-group.ts\";\nimport { NumberFieldIncrement } from \"./number-field-increment.ts\";\nimport { NumberFieldInput } from \"./number-field-input.ts\";\nimport { NumberFieldRoot } from \"./number-field-root.ts\";\nimport { NumberFieldScrubArea } from \"./number-field-scrub-area.ts\";\nimport { NumberFieldScrubAreaCursor } from \"./number-field-scrub-area-cursor.ts\";\n\n/** spec/number-field.md */\nexport const NumberField = {\n Root: NumberFieldRoot,\n Group: NumberFieldGroup,\n Input: NumberFieldInput,\n Increment: NumberFieldIncrement,\n Decrement: NumberFieldDecrement,\n ScrubArea: NumberFieldScrubArea,\n ScrubAreaCursor: NumberFieldScrubAreaCursor,\n};\n"],"mappings":";;;;;;;;;;;AA6DA,MAAa,iBACT,OAAO,aAAa;;;;;;ACrDxB,SAAgB,iBACZ,SACA,WACF;CACE,MAAM,UAAU,WAA+B,IAAI;CACnD,MACI,UACC,QAAQ,GAAG,cAAc;EACtB,IAAI,WAAW,MACX;EAEJ,UACI,gBAAgB,QAAQ;GACpB,SAAS,UACL,QAAQ,OACJ,YAAY,QAAQ,OAAO,KAAmB,GAC9C,YAAY,IACN,oBACA,mBACN,KACJ;GACJ,QAAQ,UAAU,QAAQ,OAAO,KAAK;EAC1C,CAAC,CACL;CACJ,GACA,EAAE,OAAO,OAAO,CACpB;CACA,OAAO;EACH,KAAK,cAAc,OAAO;EAC1B,gBAAgB;GACZ,MAAM,EAAE,OAAO,UAAU,aAAa,QAAQ,MAAM;GACpD,MAAM,MAAM,QAAQ,IAAI;GACxB,MAAM,MAAM,QAAQ,IAAI;GAMxB,OAAO,YAAY,YAJf,UAAU,SACT,YAAY,IACP,QAAQ,KAAA,KAAa,SAAS,MAC9B,QAAQ,KAAA,KAAa,SAAS;EAE5C;CACJ;AACJ;;;;;;ACjCA,MAAa,uBAGT,gBACA,gBAAgB;CACZ,MAAM;CACN,cAAc;CACd,OAAO;CACP,MAAM,OAAO,EAAE,OAAO,SAAS;EAC3B,MA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2
  import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
3
- import { a as NumberFieldState, i as NumberFieldRootProps, n as NumberFieldScrubAreaProps, r as NumberFieldRootEmits, t as NumberField } from "./index-B8E3X1CK.js";
3
+ import { a as NumberFieldState, i as NumberFieldRootProps, n as NumberFieldScrubAreaProps, r as NumberFieldRootEmits, t as NumberField } from "./index-lXj_BUUG.js";
4
4
  export { type ChangeDetails, type ChangeReason, NumberField, type NumberFieldRootEmits, type NumberFieldRootProps, type NumberFieldScrubAreaProps, type NumberFieldState, type RenderSlotProps };
@@ -1 +1 @@
1
- export { t as NumberField } from "./number-field-CqxEnwiS.js";
1
+ export { t as NumberField } from "./number-field-D5pM1f30.js";