@sprawlify/primitives 0.0.30 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{aria-hidden-DIoJxbA3.mjs → aria-hidden-Bq1drpzH.mjs} +1 -1
- package/dist/{aria-hidden-DtLU6hSU.cjs → aria-hidden-DSdN9ih2.cjs} +1 -1
- package/dist/aria-hidden.cjs +2 -2
- package/dist/aria-hidden.mjs +2 -2
- package/dist/{auto-resize-xzlPFDyD.cjs → auto-resize-Bh8HjZd5.cjs} +1 -1
- package/dist/{auto-resize-L6Oqa0lE.mjs → auto-resize-DLuF3IFp.mjs} +1 -1
- package/dist/auto-resize.cjs +2 -2
- package/dist/auto-resize.mjs +2 -2
- package/dist/{collection-DrxGD6r-.cjs → collection-C26svdLV.cjs} +2 -2
- package/dist/{collection-Don0IqzY.mjs → collection-CIpGDBdt.mjs} +2 -2
- package/dist/collection.cjs +2 -2
- package/dist/collection.mjs +2 -2
- package/dist/{color-utils-CjwofPil.mjs → color-utils-DGt9e4DC.mjs} +2 -2
- package/dist/{color-utils-grkMlPoh.cjs → color-utils-ZGUFwZHm.cjs} +2 -2
- package/dist/color-utils.cjs +2 -2
- package/dist/color-utils.mjs +2 -2
- package/dist/{core-DVmt6PX7.mjs → core-BLrKf6Qi.mjs} +2 -2
- package/dist/{core-DHn58LRl.cjs → core-BXoiGBfo.cjs} +2 -2
- package/dist/core.cjs +3 -3
- package/dist/core.d.cts +48 -2
- package/dist/core.d.mts +48 -2
- package/dist/core.mjs +3 -3
- package/dist/{date-utils-D2xPHa_I.cjs → date-utils-_Hu9b5fQ.cjs} +45 -45
- package/dist/date-utils.cjs +1 -1
- package/dist/date-utils.d.cts +6 -6
- package/dist/date-utils.d.mts +1 -1
- package/dist/{defineProperty-Cql4jybt.mjs → defineProperty-Bzw41Glr.mjs} +4 -4
- package/dist/{defineProperty-BoUOT9Ie.cjs → defineProperty-CTuz_M0G.cjs} +4 -4
- package/dist/{dismissable-rIq_LmT8.cjs → dismissable-DAGPnT9O.cjs} +3 -3
- package/dist/{dismissable-layer-DmvOBneO.d.cts → dismissable-layer-C39y-V3t.d.mts} +2 -2
- package/dist/{dismissable-layer-xYn_dIUQ.d.mts → dismissable-layer-D-7fwQL8.d.cts} +2 -2
- package/dist/{dismissable-CyZwVu7n.mjs → dismissable-xKLesXM6.mjs} +3 -3
- package/dist/dismissable.cjs +4 -4
- package/dist/dismissable.d.cts +2 -2
- package/dist/dismissable.d.mts +2 -2
- package/dist/dismissable.mjs +4 -4
- package/dist/{dom-query-Bwyyt0Vp.mjs → dom-query-BaSlGC4X.mjs} +1 -1
- package/dist/{dom-query-CWZdWUGp.cjs → dom-query-fmUvyB3x.cjs} +1 -1
- package/dist/dom-query.cjs +1 -1
- package/dist/dom-query.d.cts +7 -7
- package/dist/dom-query.d.mts +7 -7
- package/dist/dom-query.mjs +1 -1
- package/dist/file-utils.d.cts +1 -1
- package/dist/file-utils.d.mts +1 -1
- package/dist/{focus-trap-BwUy71da.cjs → focus-trap-9PNm7ZOS.cjs} +2 -2
- package/dist/{focus-trap-Bw_WJq_d.mjs → focus-trap-zo20IBVh.mjs} +2 -2
- package/dist/focus-trap.cjs +2 -2
- package/dist/focus-trap.mjs +2 -2
- package/dist/{focus-visible-BVOZnp76.cjs → focus-visible-BHSdwdWA.cjs} +1 -1
- package/dist/{focus-visible-BKLakzc7.mjs → focus-visible-D6iSwUgD.mjs} +1 -1
- package/dist/focus-visible.cjs +2 -2
- package/dist/focus-visible.mjs +2 -2
- package/dist/hotkeys.cjs +1 -1
- package/dist/hotkeys.mjs +1 -1
- package/dist/{i18n-utils-DCz8B6DF.mjs → i18n-utils-BYlbN_An.mjs} +1 -1
- package/dist/{i18n-utils-B8IY1mOh.cjs → i18n-utils-DNxuEaJv.cjs} +1 -1
- package/dist/i18n-utils.cjs +2 -2
- package/dist/i18n-utils.mjs +2 -2
- package/dist/{index-BlM1bSkX.d.mts → index-60_Ru8qp.d.mts} +1 -1
- package/dist/{interact-outside-Dp8GERFa.cjs → interact-outside-DhVG9So9.cjs} +2 -2
- package/dist/{interact-outside-D9gKK1XW.mjs → interact-outside-DkNMPOqV.mjs} +2 -2
- package/dist/interact-outside.cjs +3 -3
- package/dist/interact-outside.d.cts +1 -1
- package/dist/interact-outside.d.mts +1 -1
- package/dist/interact-outside.mjs +3 -3
- package/dist/live-region.d.cts +1 -1
- package/dist/live-region.d.mts +1 -1
- package/dist/machines/accordion/index.cjs +3 -3
- package/dist/machines/accordion/index.d.cts +2 -2
- package/dist/machines/accordion/index.d.mts +2 -2
- package/dist/machines/accordion/index.mjs +3 -3
- package/dist/machines/angle-slider/index.cjs +4 -4
- package/dist/machines/angle-slider/index.d.cts +3 -3
- package/dist/machines/angle-slider/index.d.mts +3 -3
- package/dist/machines/angle-slider/index.mjs +4 -4
- package/dist/machines/async-list/index.cjs +3 -3
- package/dist/machines/async-list/index.d.cts +1 -1
- package/dist/machines/async-list/index.d.mts +1 -1
- package/dist/machines/async-list/index.mjs +3 -3
- package/dist/machines/avatar/index.cjs +3 -3
- package/dist/machines/avatar/index.d.cts +2 -2
- package/dist/machines/avatar/index.d.mts +2 -2
- package/dist/machines/avatar/index.mjs +3 -3
- package/dist/machines/bottom-sheet/index.cjs +9 -9
- package/dist/machines/bottom-sheet/index.d.cts +4 -4
- package/dist/machines/bottom-sheet/index.d.mts +4 -4
- package/dist/machines/bottom-sheet/index.mjs +9 -9
- package/dist/machines/carousel/index.cjs +4 -4
- package/dist/machines/carousel/index.d.cts +3 -3
- package/dist/machines/carousel/index.d.mts +3 -3
- package/dist/machines/carousel/index.mjs +4 -4
- package/dist/machines/checkbox/index.cjs +4 -4
- package/dist/machines/checkbox/index.d.cts +3 -3
- package/dist/machines/checkbox/index.d.mts +3 -3
- package/dist/machines/checkbox/index.mjs +4 -4
- package/dist/machines/clipboard/index.cjs +3 -3
- package/dist/machines/clipboard/index.d.cts +3 -3
- package/dist/machines/clipboard/index.d.mts +3 -3
- package/dist/machines/clipboard/index.mjs +3 -3
- package/dist/machines/collapsible/index.cjs +3 -3
- package/dist/machines/collapsible/index.d.cts +3 -3
- package/dist/machines/collapsible/index.d.mts +3 -3
- package/dist/machines/collapsible/index.mjs +3 -3
- package/dist/machines/color-picker/index.cjs +7 -7
- package/dist/machines/color-picker/index.d.cts +5 -5
- package/dist/machines/color-picker/index.d.mts +5 -5
- package/dist/machines/color-picker/index.mjs +7 -7
- package/dist/machines/combobox/index.cjs +7 -7
- package/dist/machines/combobox/index.d.cts +5 -5
- package/dist/machines/combobox/index.d.mts +5 -5
- package/dist/machines/combobox/index.mjs +7 -7
- package/dist/machines/date-picker/index.cjs +19 -19
- package/dist/machines/date-picker/index.d.cts +7 -7
- package/dist/machines/date-picker/index.d.mts +7 -7
- package/dist/machines/date-picker/index.mjs +6 -6
- package/dist/machines/dialog/index.cjs +8 -8
- package/dist/machines/dialog/index.d.cts +5 -5
- package/dist/machines/dialog/index.d.mts +5 -5
- package/dist/machines/dialog/index.mjs +8 -8
- package/dist/machines/editable/index.cjs +4 -4
- package/dist/machines/editable/index.d.cts +4 -4
- package/dist/machines/editable/index.d.mts +4 -4
- package/dist/machines/editable/index.mjs +4 -4
- package/dist/machines/file-upload/index.cjs +4 -4
- package/dist/machines/file-upload/index.d.cts +4 -4
- package/dist/machines/file-upload/index.d.mts +4 -4
- package/dist/machines/file-upload/index.mjs +4 -4
- package/dist/machines/floating-panel/index.cjs +4 -4
- package/dist/machines/floating-panel/index.d.cts +4 -4
- package/dist/machines/floating-panel/index.d.mts +4 -4
- package/dist/machines/floating-panel/index.mjs +4 -4
- package/dist/machines/hover-card/index.cjs +6 -6
- package/dist/machines/hover-card/index.d.cts +5 -5
- package/dist/machines/hover-card/index.d.mts +5 -5
- package/dist/machines/hover-card/index.mjs +6 -6
- package/dist/machines/image-cropper/index.cjs +3 -3
- package/dist/machines/image-cropper/index.d.cts +2 -2
- package/dist/machines/image-cropper/index.d.mts +2 -2
- package/dist/machines/image-cropper/index.mjs +3 -3
- package/dist/machines/listbox/index.cjs +5 -5
- package/dist/machines/listbox/index.d.cts +4 -4
- package/dist/machines/listbox/index.d.mts +4 -4
- package/dist/machines/listbox/index.mjs +5 -5
- package/dist/machines/marquee/index.cjs +3 -3
- package/dist/machines/marquee/index.d.cts +5 -5
- package/dist/machines/marquee/index.d.mts +5 -5
- package/dist/machines/marquee/index.mjs +3 -3
- package/dist/machines/menu/index.cjs +7 -7
- package/dist/machines/menu/index.d.cts +8 -8
- package/dist/machines/menu/index.d.mts +8 -8
- package/dist/machines/menu/index.mjs +7 -7
- package/dist/machines/navigation-menu/index.cjs +5 -5
- package/dist/machines/navigation-menu/index.d.cts +3 -3
- package/dist/machines/navigation-menu/index.d.mts +3 -3
- package/dist/machines/navigation-menu/index.mjs +5 -5
- package/dist/machines/number-input/index.cjs +5 -5
- package/dist/machines/number-input/index.d.cts +3 -3
- package/dist/machines/number-input/index.d.mts +3 -3
- package/dist/machines/number-input/index.mjs +3 -3
- package/dist/machines/pagination/index.cjs +3 -3
- package/dist/machines/pagination/index.d.cts +2 -2
- package/dist/machines/pagination/index.d.mts +2 -2
- package/dist/machines/pagination/index.mjs +3 -3
- package/dist/machines/password-input/index.cjs +3 -3
- package/dist/machines/password-input/index.d.cts +3 -3
- package/dist/machines/password-input/index.d.mts +3 -3
- package/dist/machines/password-input/index.mjs +3 -3
- package/dist/machines/pin-input/index.cjs +3 -3
- package/dist/machines/pin-input/index.d.cts +3 -3
- package/dist/machines/pin-input/index.d.mts +3 -3
- package/dist/machines/pin-input/index.mjs +3 -3
- package/dist/machines/popover/index.cjs +9 -9
- package/dist/machines/popover/index.d.cts +6 -6
- package/dist/machines/popover/index.d.mts +6 -6
- package/dist/machines/popover/index.mjs +9 -9
- package/dist/machines/presence/index.cjs +3 -3
- package/dist/machines/presence/index.d.cts +2 -2
- package/dist/machines/presence/index.d.mts +2 -2
- package/dist/machines/presence/index.mjs +3 -3
- package/dist/machines/progress/index.cjs +3 -3
- package/dist/machines/progress/index.d.cts +3 -3
- package/dist/machines/progress/index.d.mts +3 -3
- package/dist/machines/progress/index.mjs +3 -3
- package/dist/machines/qr-code/index.cjs +3 -3
- package/dist/machines/qr-code/index.d.cts +4 -4
- package/dist/machines/qr-code/index.d.mts +4 -4
- package/dist/machines/qr-code/index.mjs +3 -3
- package/dist/machines/radio-group/index.cjs +4 -4
- package/dist/machines/radio-group/index.d.cts +3 -3
- package/dist/machines/radio-group/index.d.mts +3 -3
- package/dist/machines/radio-group/index.mjs +4 -4
- package/dist/machines/rating-group/index.cjs +3 -3
- package/dist/machines/rating-group/index.d.cts +3 -3
- package/dist/machines/rating-group/index.d.mts +3 -3
- package/dist/machines/rating-group/index.mjs +3 -3
- package/dist/machines/scroll-area/index.cjs +4 -4
- package/dist/machines/scroll-area/index.d.cts +3 -3
- package/dist/machines/scroll-area/index.d.mts +3 -3
- package/dist/machines/scroll-area/index.mjs +4 -4
- package/dist/machines/select/index.cjs +7 -7
- package/dist/machines/select/index.d.cts +6 -6
- package/dist/machines/select/index.d.mts +6 -6
- package/dist/machines/select/index.mjs +7 -7
- package/dist/machines/signature-pad/index.cjs +6 -6
- package/dist/machines/signature-pad/index.d.cts +3 -3
- package/dist/machines/signature-pad/index.d.mts +3 -3
- package/dist/machines/signature-pad/index.mjs +7 -7
- package/dist/machines/slider/index.cjs +153 -13
- package/dist/machines/slider/index.d.cts +7 -4
- package/dist/machines/slider/index.d.mts +7 -4
- package/dist/machines/slider/index.mjs +153 -13
- package/dist/machines/splitter/index.cjs +3 -3
- package/dist/machines/splitter/index.d.cts +2 -2
- package/dist/machines/splitter/index.d.mts +2 -2
- package/dist/machines/splitter/index.mjs +3 -3
- package/dist/machines/steps/index.cjs +3 -3
- package/dist/machines/steps/index.d.cts +3 -3
- package/dist/machines/steps/index.d.mts +3 -3
- package/dist/machines/steps/index.mjs +3 -3
- package/dist/machines/switch/index.cjs +4 -4
- package/dist/machines/switch/index.d.cts +3 -3
- package/dist/machines/switch/index.d.mts +3 -3
- package/dist/machines/switch/index.mjs +4 -4
- package/dist/machines/tabs/index.cjs +3 -3
- package/dist/machines/tabs/index.d.cts +3 -3
- package/dist/machines/tabs/index.d.mts +3 -3
- package/dist/machines/tabs/index.mjs +3 -3
- package/dist/machines/tags-input/index.cjs +5 -5
- package/dist/machines/tags-input/index.d.cts +5 -5
- package/dist/machines/tags-input/index.d.mts +5 -5
- package/dist/machines/tags-input/index.mjs +5 -5
- package/dist/machines/timer/index.cjs +3 -3
- package/dist/machines/timer/index.d.cts +3 -3
- package/dist/machines/timer/index.d.mts +3 -3
- package/dist/machines/timer/index.mjs +3 -3
- package/dist/machines/toast/index.cjs +7 -7
- package/dist/machines/toast/index.d.cts +5 -4
- package/dist/machines/toast/index.d.mts +5 -4
- package/dist/machines/toast/index.mjs +8 -8
- package/dist/machines/toggle/index.cjs +3 -3
- package/dist/machines/toggle/index.d.cts +2 -2
- package/dist/machines/toggle/index.d.mts +2 -2
- package/dist/machines/toggle/index.mjs +3 -3
- package/dist/machines/toggle-group/index.cjs +3 -3
- package/dist/machines/toggle-group/index.d.cts +2 -2
- package/dist/machines/toggle-group/index.d.mts +2 -2
- package/dist/machines/toggle-group/index.mjs +3 -3
- package/dist/machines/tooltip/index.cjs +5 -5
- package/dist/machines/tooltip/index.d.cts +4 -4
- package/dist/machines/tooltip/index.d.mts +4 -4
- package/dist/machines/tooltip/index.mjs +5 -5
- package/dist/machines/tour/index.cjs +7 -7
- package/dist/machines/tour/index.d.cts +6 -6
- package/dist/machines/tour/index.d.mts +6 -6
- package/dist/machines/tour/index.mjs +7 -7
- package/dist/machines/tree-view/index.cjs +4 -4
- package/dist/machines/tree-view/index.d.cts +4 -4
- package/dist/machines/tree-view/index.d.mts +4 -4
- package/dist/machines/tree-view/index.mjs +4 -4
- package/dist/{popper-CjBC91Tz.mjs → popper-BN7E_8-R.mjs} +2 -2
- package/dist/{popper-kp05O3Bm.cjs → popper-CasttusN.cjs} +12 -12
- package/dist/popper.cjs +3 -3
- package/dist/popper.d.cts +2 -2
- package/dist/popper.d.mts +1 -1
- package/dist/popper.mjs +3 -3
- package/dist/{rect-utils-Dp9Wvl7-.cjs → rect-utils-C-9DRQNd.cjs} +1 -1
- package/dist/{rect-utils-j6C9uZk1.mjs → rect-utils-C6Nug-pt.mjs} +1 -1
- package/dist/rect-utils.cjs +1 -1
- package/dist/rect-utils.d.cts +1 -1
- package/dist/rect-utils.d.mts +1 -1
- package/dist/rect-utils.mjs +1 -1
- package/dist/{remove-scroll-Dh9PjZFE.cjs → remove-scroll-BPLI9jr9.cjs} +1 -1
- package/dist/{remove-scroll-C73TLIgr.mjs → remove-scroll-Btia-r68.mjs} +1 -1
- package/dist/{scroll-snap-B279jSp5.mjs → scroll-snap-DY-Wmmhl.mjs} +1 -1
- package/dist/{scroll-snap-BvaE_jFu.cjs → scroll-snap-VzQ4ngQ4.cjs} +1 -1
- package/dist/scroll-snap.cjs +2 -2
- package/dist/scroll-snap.mjs +2 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/{utils-BIwaJq8z.mjs → utils-B_odTlcq.mjs} +5 -5
- package/dist/{utils-CtgLe8Vv.cjs → utils-CMs0714u.cjs} +5 -5
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/dist/core-75kSaDJc.d.mts +0 -49
- package/dist/core-D_pI64vx.d.cts +0 -49
- /package/dist/{data-url-BqpiKO1L.d.mts → data-url-C3ITPVRX.d.cts} +0 -0
- /package/dist/{data-url-og2AwQaU.d.cts → data-url-mcVoUiET.d.mts} +0 -0
- /package/dist/{functions-2ix8ad1e.d.cts → functions-7V6veSov.d.cts} +0 -0
- /package/dist/{functions-qoGE2jOS.d.mts → functions-CjitT5Gr.d.mts} +0 -0
- /package/dist/{index-DYzqCFaj.d.mts → index-BqhWpjZh.d.mts} +0 -0
- /package/dist/{index-BVcPBg7R.d.mts → index-Bqw3r34-.d.cts} +0 -0
- /package/dist/{index-UNyqrBDu.d.cts → index-BuUzJjaP.d.mts} +0 -0
- /package/dist/{index-9OlOKr2i.d.mts → index-Bvn6ocEE.d.mts} +0 -0
- /package/dist/{index-DFiQyzeW.d.cts → index-C9-feK5c.d.cts} +0 -0
- /package/dist/{index-BBTkH09t.d.cts → index-CygfPLvT.d.mts} +0 -0
- /package/dist/{index-C9ajBf1B.d.mts → index-Owca7uxB.d.cts} +0 -0
- /package/dist/{node-BecR7gec.d.cts → node-CHGS3acf.d.mts} +0 -0
- /package/dist/{node-v8Pyrj9P.d.mts → node-CSsuPZVZ.d.cts} +0 -0
- /package/dist/{raf-BF2VrckK.d.cts → raf-BV1049GE.d.mts} +0 -0
- /package/dist/{raf-DX52LaVy.d.mts → raf-Cd2FGy0z.d.cts} +0 -0
- /package/dist/{typeahead-BWyD_KIb.d.cts → typeahead-BdNwVP09.d.cts} +0 -0
- /package/dist/{typeahead-BX-BWYjD.d.mts → typeahead-DMSwLv1e.d.mts} +0 -0
- /package/dist/{types-CsK6JMut.d.mts → types-D-ZRl1jP.d.mts} +0 -0
- /package/dist/{types-TUsgVjZA.d.cts → types-D5ziaMrd.d.cts} +0 -0
- /package/dist/{types-BIy26Uwn.d.cts → types-DL5AIQk5.d.mts} +0 -0
- /package/dist/{types-ByFp2QfD.d.mts → types-DddL75YY.d.cts} +0 -0
- /package/dist/{types-jyV564Ip.d.mts → types-DejIu60O.d.cts} +0 -0
- /package/dist/{types-xyuh-a2-.d.cts → types-F-0xFywm.d.cts} +0 -0
- /package/dist/{types-oh90SH45.d.cts → types-GxLIgJib.d.cts} +0 -0
- /package/dist/{types-CaxzY9yP.d.cts → types-J14X3oxU.d.mts} +0 -0
- /package/dist/{wait-for-C9QyzQj2.d.cts → wait-for-BkzY39R9.d.mts} +0 -0
- /package/dist/{wait-for-Pn6RmrHX.d.mts → wait-for-CMjPsqWk.d.cts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-CArN8dVu.mjs";
|
|
2
|
-
import { T as trackPointerMove, Vt as getDataUrl, bt as isModifierKey, ft as getEventTarget, k as getRelativePoint, vn as dataAttr, x as query, yt as isLeftClick } from "../../dom-query-
|
|
3
|
-
import { u as createSplitProps } from "../../utils-
|
|
4
|
-
import { a as createMachine } from "../../core-
|
|
2
|
+
import { T as trackPointerMove, Vt as getDataUrl$1, bt as isModifierKey, ft as getEventTarget, k as getRelativePoint, vn as dataAttr, x as query, yt as isLeftClick } from "../../dom-query-BaSlGC4X.mjs";
|
|
3
|
+
import { u as createSplitProps } from "../../utils-B_odTlcq.mjs";
|
|
4
|
+
import { a as createMachine } from "../../core-BLrKf6Qi.mjs";
|
|
5
5
|
import { t as createProps } from "../../create-props-SRSjdUTq.mjs";
|
|
6
6
|
import getStroke from "perfect-freehand";
|
|
7
7
|
|
|
@@ -17,8 +17,8 @@ const getLabelId = (ctx) => ctx.ids?.label ?? `signature-pad:${ctx.id}:label`;
|
|
|
17
17
|
const getHiddenInputId = (ctx) => ctx.ids?.hiddenInput ?? `signature-pad:${ctx.id}:input`;
|
|
18
18
|
const getControlEl = (ctx) => ctx.getById(getControlId(ctx));
|
|
19
19
|
const getSegmentEl = (ctx) => query(getControlEl(ctx), "[data-part=segment]");
|
|
20
|
-
const getDataUrl
|
|
21
|
-
return getDataUrl(getSegmentEl(ctx), options);
|
|
20
|
+
const getDataUrl = (ctx, options) => {
|
|
21
|
+
return getDataUrl$1(getSegmentEl(ctx), options);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
@@ -41,7 +41,7 @@ function connect(service, normalize) {
|
|
|
41
41
|
},
|
|
42
42
|
getDataUrl(type, quality) {
|
|
43
43
|
if (computed("isEmpty")) return Promise.resolve("");
|
|
44
|
-
return getDataUrl
|
|
44
|
+
return getDataUrl(scope, {
|
|
45
45
|
type,
|
|
46
46
|
quality
|
|
47
47
|
});
|
|
@@ -293,7 +293,7 @@ const machine = createMachine({
|
|
|
293
293
|
paths: [...context.get("paths")],
|
|
294
294
|
getDataUrl(type, quality = .92) {
|
|
295
295
|
if (computed("isEmpty")) return Promise.resolve("");
|
|
296
|
-
return getDataUrl
|
|
296
|
+
return getDataUrl(scope, {
|
|
297
297
|
type,
|
|
298
298
|
quality
|
|
299
299
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_create_anatomy = require('../../create-anatomy-CDsIFUXg.cjs');
|
|
2
|
-
const require_dom_query = require('../../dom-query-
|
|
3
|
-
const require_utils = require('../../utils-
|
|
4
|
-
const require_core = require('../../core-
|
|
2
|
+
const require_dom_query = require('../../dom-query-fmUvyB3x.cjs');
|
|
3
|
+
const require_utils = require('../../utils-CMs0714u.cjs');
|
|
4
|
+
const require_core = require('../../core-BXoiGBfo.cjs');
|
|
5
5
|
const require_create_props = require('../../create-props-l5q5b8Wo.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/machines/slider/slider.anatomy.ts
|
|
@@ -25,20 +25,50 @@ const getThumbEls = (ctx) => require_dom_query.queryAll(getControlEl(ctx), "[rol
|
|
|
25
25
|
const getFirstThumbEl = (ctx) => getThumbEls(ctx)[0];
|
|
26
26
|
const getHiddenInputEl = (ctx, index) => ctx.getById(getHiddenInputId(ctx, index));
|
|
27
27
|
const getControlEl = (ctx) => ctx.getById(getControlId(ctx));
|
|
28
|
+
const getThumbInset = (thumbSize, thumbAlignment, orientation) => {
|
|
29
|
+
return thumbAlignment === "contain" ? (orientation === "vertical" ? thumbSize?.height ?? 0 : thumbSize?.width ?? 0) / 2 : 0;
|
|
30
|
+
};
|
|
28
31
|
const getPointValue = (params, point) => {
|
|
29
|
-
const { prop, scope, refs } = params;
|
|
32
|
+
const { context, prop, scope, refs } = params;
|
|
30
33
|
const controlEl = getControlEl(scope);
|
|
31
34
|
if (!controlEl) return;
|
|
32
35
|
const offset = refs.get("thumbDragOffset");
|
|
33
|
-
return require_utils.getPercentValue(
|
|
36
|
+
return require_utils.getPercentValue(getRelativePointWithInset({
|
|
34
37
|
x: point.x - (offset?.x ?? 0),
|
|
35
38
|
y: point.y - (offset?.y ?? 0)
|
|
36
|
-
}, controlEl).getPercentValue({
|
|
39
|
+
}, controlEl, getThumbInset(context.get("thumbSize"), prop("thumbAlignment"), prop("orientation"))).getPercentValue({
|
|
37
40
|
orientation: prop("orientation"),
|
|
38
41
|
dir: prop("dir"),
|
|
39
42
|
inverted: { y: true }
|
|
40
43
|
}), prop("min"), prop("max"), prop("step"));
|
|
41
44
|
};
|
|
45
|
+
function getRelativePointWithInset(point, element, inset) {
|
|
46
|
+
const { left, top, width, height } = element.getBoundingClientRect();
|
|
47
|
+
const effectiveWidth = width - inset * 2;
|
|
48
|
+
const effectiveHeight = height - inset * 2;
|
|
49
|
+
const effectiveLeft = left + inset;
|
|
50
|
+
const effectiveTop = top + inset;
|
|
51
|
+
const offset = {
|
|
52
|
+
x: point.x - effectiveLeft,
|
|
53
|
+
y: point.y - effectiveTop
|
|
54
|
+
};
|
|
55
|
+
const percent = {
|
|
56
|
+
x: effectiveWidth > 0 ? require_utils.clampPercent(offset.x / effectiveWidth) : 0,
|
|
57
|
+
y: effectiveHeight > 0 ? require_utils.clampPercent(offset.y / effectiveHeight) : 0
|
|
58
|
+
};
|
|
59
|
+
function getPercentValue$1(options = {}) {
|
|
60
|
+
const { dir = "ltr", orientation = "horizontal", inverted } = options;
|
|
61
|
+
const invertX = typeof inverted === "object" ? inverted.x : inverted;
|
|
62
|
+
const invertY = typeof inverted === "object" ? inverted.y : inverted;
|
|
63
|
+
if (orientation === "horizontal") return dir === "rtl" || invertX ? 1 - percent.x : percent.x;
|
|
64
|
+
return invertY ? 1 - percent.y : percent.y;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
offset,
|
|
68
|
+
percent,
|
|
69
|
+
getPercentValue: getPercentValue$1
|
|
70
|
+
};
|
|
71
|
+
}
|
|
42
72
|
const dispatchChangeEvent = (ctx, value) => {
|
|
43
73
|
value.forEach((value$1, index) => {
|
|
44
74
|
const inputEl = getHiddenInputEl(ctx, index);
|
|
@@ -196,6 +226,92 @@ function getMarkerGroupStyle() {
|
|
|
196
226
|
|
|
197
227
|
//#endregion
|
|
198
228
|
//#region src/machines/slider/slider.utils.ts
|
|
229
|
+
function getThumbBounds(ctx) {
|
|
230
|
+
const { index, values, min, max, gap } = ctx;
|
|
231
|
+
const prevThumb = values[index - 1];
|
|
232
|
+
const nextThumb = values[index + 1];
|
|
233
|
+
return {
|
|
234
|
+
min: prevThumb != null ? prevThumb + gap : min,
|
|
235
|
+
max: nextThumb != null ? nextThumb - gap : max
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function round(value) {
|
|
239
|
+
return Math.round(value * 1e10) / 1e10;
|
|
240
|
+
}
|
|
241
|
+
function handleNone(ctx) {
|
|
242
|
+
const { index, value, values } = ctx;
|
|
243
|
+
const bounds = getThumbBounds(ctx);
|
|
244
|
+
const nextValues = values.slice();
|
|
245
|
+
nextValues[index] = round(require_utils.clampValue(value, bounds.min, bounds.max));
|
|
246
|
+
return {
|
|
247
|
+
values: nextValues,
|
|
248
|
+
index,
|
|
249
|
+
swapped: false
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function handlePush(ctx) {
|
|
253
|
+
const { index, value, values, min, max, gap } = ctx;
|
|
254
|
+
const nextValues = values.slice();
|
|
255
|
+
nextValues[index] = round(require_utils.clampValue(value, min + index * gap, max - (values.length - 1 - index) * gap));
|
|
256
|
+
for (let i = index + 1; i < values.length; i++) {
|
|
257
|
+
const minAllowed = nextValues[i - 1] + gap;
|
|
258
|
+
if (nextValues[i] < minAllowed) nextValues[i] = round(minAllowed);
|
|
259
|
+
}
|
|
260
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
261
|
+
const maxAllowed = nextValues[i + 1] - gap;
|
|
262
|
+
if (nextValues[i] > maxAllowed) nextValues[i] = round(maxAllowed);
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
values: nextValues,
|
|
266
|
+
index,
|
|
267
|
+
swapped: false
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function handleSwap(ctx, startValue) {
|
|
271
|
+
const { index, value, values, gap } = ctx;
|
|
272
|
+
const prevThumb = values[index - 1];
|
|
273
|
+
const nextThumb = values[index + 1];
|
|
274
|
+
const crossingNext = nextThumb != null && value >= nextThumb && value > startValue;
|
|
275
|
+
const crossingPrev = prevThumb != null && value <= prevThumb && value < startValue;
|
|
276
|
+
if (!crossingNext && !crossingPrev) return handleNone(ctx);
|
|
277
|
+
const swapIndex = crossingNext ? index + 1 : index - 1;
|
|
278
|
+
const nextValues = values.slice();
|
|
279
|
+
const bounds = getThumbBounds({
|
|
280
|
+
...ctx,
|
|
281
|
+
index: swapIndex
|
|
282
|
+
});
|
|
283
|
+
nextValues[swapIndex] = round(require_utils.clampValue(value, bounds.min, bounds.max));
|
|
284
|
+
nextValues[index] = values[swapIndex];
|
|
285
|
+
if (crossingNext && nextValues[index] > nextValues[swapIndex] - gap) nextValues[index] = round(nextValues[swapIndex] - gap);
|
|
286
|
+
else if (crossingPrev && nextValues[index] < nextValues[swapIndex] + gap) nextValues[index] = round(nextValues[swapIndex] + gap);
|
|
287
|
+
return {
|
|
288
|
+
values: nextValues,
|
|
289
|
+
index: swapIndex,
|
|
290
|
+
swapped: true
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function resolveThumbCollision(behavior, index, value, values, min, max, step, minStepsBetweenThumbs, startValue) {
|
|
294
|
+
if (values.length === 1) return {
|
|
295
|
+
values: [round(require_utils.clampValue(value, min, max))],
|
|
296
|
+
index: 0,
|
|
297
|
+
swapped: false
|
|
298
|
+
};
|
|
299
|
+
const ctx = {
|
|
300
|
+
behavior,
|
|
301
|
+
index,
|
|
302
|
+
value,
|
|
303
|
+
values,
|
|
304
|
+
min,
|
|
305
|
+
max,
|
|
306
|
+
gap: step * minStepsBetweenThumbs
|
|
307
|
+
};
|
|
308
|
+
switch (behavior) {
|
|
309
|
+
case "push": return handlePush(ctx);
|
|
310
|
+
case "swap": return handleSwap(ctx, startValue ?? values[index]);
|
|
311
|
+
case "none":
|
|
312
|
+
default: return handleNone(ctx);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
199
315
|
function normalizeValues(params, nextValues) {
|
|
200
316
|
return nextValues.map((value, index) => {
|
|
201
317
|
return constrainValue(params, value, index);
|
|
@@ -644,6 +760,7 @@ const machine = require_core.createMachine({
|
|
|
644
760
|
thumbAlignment: "contain",
|
|
645
761
|
origin: "start",
|
|
646
762
|
orientation: "horizontal",
|
|
763
|
+
thumbCollisionBehavior: "none",
|
|
647
764
|
minStepsBetweenThumbs,
|
|
648
765
|
...props$1,
|
|
649
766
|
defaultValue: normalize(defaultValue, min, max, step, minStepsBetweenThumbs),
|
|
@@ -684,7 +801,10 @@ const machine = require_core.createMachine({
|
|
|
684
801
|
};
|
|
685
802
|
},
|
|
686
803
|
refs() {
|
|
687
|
-
return {
|
|
804
|
+
return {
|
|
805
|
+
thumbDragOffset: null,
|
|
806
|
+
thumbDragStartValue: null
|
|
807
|
+
};
|
|
688
808
|
},
|
|
689
809
|
computed: {
|
|
690
810
|
isHorizontal: ({ prop }) => prop("orientation") === "horizontal",
|
|
@@ -722,6 +842,7 @@ const machine = require_core.createMachine({
|
|
|
722
842
|
target: "dragging",
|
|
723
843
|
actions: [
|
|
724
844
|
"setClosestThumbIndex",
|
|
845
|
+
"setThumbDragStartValue",
|
|
725
846
|
"setPointerValue",
|
|
726
847
|
"focusActiveThumb"
|
|
727
848
|
]
|
|
@@ -735,6 +856,7 @@ const machine = require_core.createMachine({
|
|
|
735
856
|
actions: [
|
|
736
857
|
"setFocusedIndex",
|
|
737
858
|
"setThumbDragOffset",
|
|
859
|
+
"setThumbDragStartValue",
|
|
738
860
|
"focusActiveThumb"
|
|
739
861
|
]
|
|
740
862
|
}
|
|
@@ -746,6 +868,7 @@ const machine = require_core.createMachine({
|
|
|
746
868
|
target: "dragging",
|
|
747
869
|
actions: [
|
|
748
870
|
"setClosestThumbIndex",
|
|
871
|
+
"setThumbDragStartValue",
|
|
749
872
|
"setPointerValue",
|
|
750
873
|
"focusActiveThumb"
|
|
751
874
|
]
|
|
@@ -755,6 +878,7 @@ const machine = require_core.createMachine({
|
|
|
755
878
|
actions: [
|
|
756
879
|
"setFocusedIndex",
|
|
757
880
|
"setThumbDragOffset",
|
|
881
|
+
"setThumbDragStartValue",
|
|
758
882
|
"focusActiveThumb"
|
|
759
883
|
]
|
|
760
884
|
},
|
|
@@ -774,12 +898,20 @@ const machine = require_core.createMachine({
|
|
|
774
898
|
on: {
|
|
775
899
|
POINTER_UP: {
|
|
776
900
|
target: "focus",
|
|
777
|
-
actions: [
|
|
901
|
+
actions: [
|
|
902
|
+
"invokeOnChangeEnd",
|
|
903
|
+
"clearThumbDragOffset",
|
|
904
|
+
"clearThumbDragStartValue"
|
|
905
|
+
]
|
|
778
906
|
},
|
|
779
907
|
POINTER_MOVE: { actions: ["setPointerValue"] },
|
|
780
908
|
POINTER_CANCEL: {
|
|
781
909
|
target: "idle",
|
|
782
|
-
actions: [
|
|
910
|
+
actions: [
|
|
911
|
+
"clearFocusedIndex",
|
|
912
|
+
"clearThumbDragOffset",
|
|
913
|
+
"clearThumbDragStartValue"
|
|
914
|
+
]
|
|
783
915
|
}
|
|
784
916
|
}
|
|
785
917
|
}
|
|
@@ -858,14 +990,22 @@ const machine = require_core.createMachine({
|
|
|
858
990
|
clearThumbDragOffset({ refs }) {
|
|
859
991
|
refs.set("thumbDragOffset", null);
|
|
860
992
|
},
|
|
993
|
+
setThumbDragStartValue({ refs, context }) {
|
|
994
|
+
refs.set("thumbDragStartValue", context.get("value").slice());
|
|
995
|
+
},
|
|
996
|
+
clearThumbDragStartValue({ refs }) {
|
|
997
|
+
refs.set("thumbDragStartValue", null);
|
|
998
|
+
},
|
|
861
999
|
setPointerValue(params) {
|
|
862
1000
|
queueMicrotask(() => {
|
|
863
|
-
const { context, event } = params;
|
|
1001
|
+
const { context, event, prop, refs } = params;
|
|
864
1002
|
const pointValue = getPointValue(params, event.point);
|
|
865
1003
|
if (pointValue == null) return;
|
|
866
1004
|
const focusedIndex = context.get("focusedIndex");
|
|
867
|
-
const
|
|
868
|
-
context.
|
|
1005
|
+
const startValues = refs.get("thumbDragStartValue");
|
|
1006
|
+
const result = resolveThumbCollision(prop("thumbCollisionBehavior"), focusedIndex, pointValue, context.get("value"), prop("min"), prop("max"), prop("step"), prop("minStepsBetweenThumbs"), startValues?.[focusedIndex]);
|
|
1007
|
+
if (result.swapped) context.set("focusedIndex", result.index);
|
|
1008
|
+
context.set("value", result.values);
|
|
869
1009
|
});
|
|
870
1010
|
},
|
|
871
1011
|
focusActiveThumb({ scope, context }) {
|
|
@@ -934,7 +1074,7 @@ const props = require_create_props.createProps()([
|
|
|
934
1074
|
"readOnly",
|
|
935
1075
|
"step",
|
|
936
1076
|
"thumbAlignment",
|
|
937
|
-
"
|
|
1077
|
+
"thumbCollisionBehavior",
|
|
938
1078
|
"thumbSize",
|
|
939
1079
|
"value",
|
|
940
1080
|
"defaultValue"
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-smWrirg1.cjs";
|
|
2
|
-
import { p as Machine, u as EventObject, y as Service } from "../../types-
|
|
3
|
-
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-
|
|
2
|
+
import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu60O.cjs";
|
|
3
|
+
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/slider/slider.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "track" | "thumb" | "label" | "marker" | "range" | "valueText" | "control" | "markerGroup" | "draggingIndicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/slider/slider.types.d.ts
|
|
9
|
+
type ThumbCollisionBehavior = "none" | "push" | "swap";
|
|
9
10
|
interface ValueChangeDetails {
|
|
10
11
|
value: number[];
|
|
11
12
|
}
|
|
@@ -54,8 +55,9 @@ interface SliderProps extends DirectionProperty, CommonProperties {
|
|
|
54
55
|
width: number;
|
|
55
56
|
height: number;
|
|
56
57
|
} | undefined;
|
|
58
|
+
thumbCollisionBehavior?: ThumbCollisionBehavior | undefined;
|
|
57
59
|
}
|
|
58
|
-
type PropsWithDefault = "dir" | "min" | "max" | "step" | "orientation" | "defaultValue" | "origin" | "thumbAlignment" | "minStepsBetweenThumbs";
|
|
60
|
+
type PropsWithDefault = "dir" | "min" | "max" | "step" | "orientation" | "defaultValue" | "origin" | "thumbAlignment" | "minStepsBetweenThumbs" | "thumbCollisionBehavior";
|
|
59
61
|
type Computed = Readonly<{
|
|
60
62
|
hasMeasuredThumbSize: boolean;
|
|
61
63
|
isInteractive: boolean;
|
|
@@ -80,6 +82,7 @@ interface SliderSchema {
|
|
|
80
82
|
x: number;
|
|
81
83
|
y: number;
|
|
82
84
|
} | null;
|
|
85
|
+
thumbDragStartValue: number[] | null;
|
|
83
86
|
};
|
|
84
87
|
computed: Computed;
|
|
85
88
|
event: EventObject;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-DHVOqZET.mjs";
|
|
2
|
-
import { p as Machine, u as EventObject, y as Service } from "../../types-
|
|
3
|
-
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-
|
|
2
|
+
import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQk5.mjs";
|
|
3
|
+
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/slider/slider.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "track" | "thumb" | "label" | "marker" | "range" | "valueText" | "control" | "markerGroup" | "draggingIndicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/slider/slider.types.d.ts
|
|
9
|
+
type ThumbCollisionBehavior = "none" | "push" | "swap";
|
|
9
10
|
interface ValueChangeDetails {
|
|
10
11
|
value: number[];
|
|
11
12
|
}
|
|
@@ -54,8 +55,9 @@ interface SliderProps extends DirectionProperty, CommonProperties {
|
|
|
54
55
|
width: number;
|
|
55
56
|
height: number;
|
|
56
57
|
} | undefined;
|
|
58
|
+
thumbCollisionBehavior?: ThumbCollisionBehavior | undefined;
|
|
57
59
|
}
|
|
58
|
-
type PropsWithDefault = "dir" | "min" | "max" | "step" | "orientation" | "defaultValue" | "origin" | "thumbAlignment" | "minStepsBetweenThumbs";
|
|
60
|
+
type PropsWithDefault = "dir" | "min" | "max" | "step" | "orientation" | "defaultValue" | "origin" | "thumbAlignment" | "minStepsBetweenThumbs" | "thumbCollisionBehavior";
|
|
59
61
|
type Computed = Readonly<{
|
|
60
62
|
hasMeasuredThumbSize: boolean;
|
|
61
63
|
isInteractive: boolean;
|
|
@@ -80,6 +82,7 @@ interface SliderSchema {
|
|
|
80
82
|
x: number;
|
|
81
83
|
y: number;
|
|
82
84
|
} | null;
|
|
85
|
+
thumbDragStartValue: number[] | null;
|
|
83
86
|
};
|
|
84
87
|
computed: Computed;
|
|
85
88
|
event: EventObject;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-CArN8dVu.mjs";
|
|
2
|
-
import { S as queryAll, T as trackPointerMove, U as raf, _n as ariaAttr, at as setElementValue, bt as isModifierKey, dt as getEventStep,
|
|
3
|
-
import { B as snapValueToStep, C as getPercentValue, E as getValueRanges, H as toPx, N as isValueWithinRange, O as getValueTransformer, S as getNextStepValue, T as getValuePercent, W as callAll, ft as isEqual, g as clampValue, p as pick, u as createSplitProps, vt as first, w as getPreviousStepValue, wt as last, z as setValueAtIndex } from "../../utils-
|
|
4
|
-
import { a as createMachine, s as memo } from "../../core-
|
|
2
|
+
import { S as queryAll, T as trackPointerMove, U as raf, _n as ariaAttr, at as setElementValue, bt as isModifierKey, dt as getEventStep, lt as getEventKey, ot as trackFormControl, p as resizeObserverBorderBox, rt as dispatchInputValueEvent, ut as getEventPoint, vn as dataAttr, yt as isLeftClick } from "../../dom-query-BaSlGC4X.mjs";
|
|
3
|
+
import { B as snapValueToStep, C as getPercentValue, E as getValueRanges, H as toPx, N as isValueWithinRange, O as getValueTransformer, S as getNextStepValue, T as getValuePercent, W as callAll, ft as isEqual, g as clampValue, h as clampPercent, p as pick, u as createSplitProps, vt as first, w as getPreviousStepValue, wt as last, z as setValueAtIndex } from "../../utils-B_odTlcq.mjs";
|
|
4
|
+
import { a as createMachine, s as memo } from "../../core-BLrKf6Qi.mjs";
|
|
5
5
|
import { t as createProps } from "../../create-props-SRSjdUTq.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/machines/slider/slider.anatomy.ts
|
|
@@ -25,20 +25,50 @@ const getThumbEls = (ctx) => queryAll(getControlEl(ctx), "[role=slider]");
|
|
|
25
25
|
const getFirstThumbEl = (ctx) => getThumbEls(ctx)[0];
|
|
26
26
|
const getHiddenInputEl = (ctx, index) => ctx.getById(getHiddenInputId(ctx, index));
|
|
27
27
|
const getControlEl = (ctx) => ctx.getById(getControlId(ctx));
|
|
28
|
+
const getThumbInset = (thumbSize, thumbAlignment, orientation) => {
|
|
29
|
+
return thumbAlignment === "contain" ? (orientation === "vertical" ? thumbSize?.height ?? 0 : thumbSize?.width ?? 0) / 2 : 0;
|
|
30
|
+
};
|
|
28
31
|
const getPointValue = (params, point) => {
|
|
29
|
-
const { prop, scope, refs } = params;
|
|
32
|
+
const { context, prop, scope, refs } = params;
|
|
30
33
|
const controlEl = getControlEl(scope);
|
|
31
34
|
if (!controlEl) return;
|
|
32
35
|
const offset = refs.get("thumbDragOffset");
|
|
33
|
-
return getPercentValue(
|
|
36
|
+
return getPercentValue(getRelativePointWithInset({
|
|
34
37
|
x: point.x - (offset?.x ?? 0),
|
|
35
38
|
y: point.y - (offset?.y ?? 0)
|
|
36
|
-
}, controlEl).getPercentValue({
|
|
39
|
+
}, controlEl, getThumbInset(context.get("thumbSize"), prop("thumbAlignment"), prop("orientation"))).getPercentValue({
|
|
37
40
|
orientation: prop("orientation"),
|
|
38
41
|
dir: prop("dir"),
|
|
39
42
|
inverted: { y: true }
|
|
40
43
|
}), prop("min"), prop("max"), prop("step"));
|
|
41
44
|
};
|
|
45
|
+
function getRelativePointWithInset(point, element, inset) {
|
|
46
|
+
const { left, top, width, height } = element.getBoundingClientRect();
|
|
47
|
+
const effectiveWidth = width - inset * 2;
|
|
48
|
+
const effectiveHeight = height - inset * 2;
|
|
49
|
+
const effectiveLeft = left + inset;
|
|
50
|
+
const effectiveTop = top + inset;
|
|
51
|
+
const offset = {
|
|
52
|
+
x: point.x - effectiveLeft,
|
|
53
|
+
y: point.y - effectiveTop
|
|
54
|
+
};
|
|
55
|
+
const percent = {
|
|
56
|
+
x: effectiveWidth > 0 ? clampPercent(offset.x / effectiveWidth) : 0,
|
|
57
|
+
y: effectiveHeight > 0 ? clampPercent(offset.y / effectiveHeight) : 0
|
|
58
|
+
};
|
|
59
|
+
function getPercentValue$1(options = {}) {
|
|
60
|
+
const { dir = "ltr", orientation = "horizontal", inverted } = options;
|
|
61
|
+
const invertX = typeof inverted === "object" ? inverted.x : inverted;
|
|
62
|
+
const invertY = typeof inverted === "object" ? inverted.y : inverted;
|
|
63
|
+
if (orientation === "horizontal") return dir === "rtl" || invertX ? 1 - percent.x : percent.x;
|
|
64
|
+
return invertY ? 1 - percent.y : percent.y;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
offset,
|
|
68
|
+
percent,
|
|
69
|
+
getPercentValue: getPercentValue$1
|
|
70
|
+
};
|
|
71
|
+
}
|
|
42
72
|
const dispatchChangeEvent = (ctx, value) => {
|
|
43
73
|
value.forEach((value$1, index) => {
|
|
44
74
|
const inputEl = getHiddenInputEl(ctx, index);
|
|
@@ -196,6 +226,92 @@ function getMarkerGroupStyle() {
|
|
|
196
226
|
|
|
197
227
|
//#endregion
|
|
198
228
|
//#region src/machines/slider/slider.utils.ts
|
|
229
|
+
function getThumbBounds(ctx) {
|
|
230
|
+
const { index, values, min, max, gap } = ctx;
|
|
231
|
+
const prevThumb = values[index - 1];
|
|
232
|
+
const nextThumb = values[index + 1];
|
|
233
|
+
return {
|
|
234
|
+
min: prevThumb != null ? prevThumb + gap : min,
|
|
235
|
+
max: nextThumb != null ? nextThumb - gap : max
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function round(value) {
|
|
239
|
+
return Math.round(value * 1e10) / 1e10;
|
|
240
|
+
}
|
|
241
|
+
function handleNone(ctx) {
|
|
242
|
+
const { index, value, values } = ctx;
|
|
243
|
+
const bounds = getThumbBounds(ctx);
|
|
244
|
+
const nextValues = values.slice();
|
|
245
|
+
nextValues[index] = round(clampValue(value, bounds.min, bounds.max));
|
|
246
|
+
return {
|
|
247
|
+
values: nextValues,
|
|
248
|
+
index,
|
|
249
|
+
swapped: false
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function handlePush(ctx) {
|
|
253
|
+
const { index, value, values, min, max, gap } = ctx;
|
|
254
|
+
const nextValues = values.slice();
|
|
255
|
+
nextValues[index] = round(clampValue(value, min + index * gap, max - (values.length - 1 - index) * gap));
|
|
256
|
+
for (let i = index + 1; i < values.length; i++) {
|
|
257
|
+
const minAllowed = nextValues[i - 1] + gap;
|
|
258
|
+
if (nextValues[i] < minAllowed) nextValues[i] = round(minAllowed);
|
|
259
|
+
}
|
|
260
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
261
|
+
const maxAllowed = nextValues[i + 1] - gap;
|
|
262
|
+
if (nextValues[i] > maxAllowed) nextValues[i] = round(maxAllowed);
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
values: nextValues,
|
|
266
|
+
index,
|
|
267
|
+
swapped: false
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function handleSwap(ctx, startValue) {
|
|
271
|
+
const { index, value, values, gap } = ctx;
|
|
272
|
+
const prevThumb = values[index - 1];
|
|
273
|
+
const nextThumb = values[index + 1];
|
|
274
|
+
const crossingNext = nextThumb != null && value >= nextThumb && value > startValue;
|
|
275
|
+
const crossingPrev = prevThumb != null && value <= prevThumb && value < startValue;
|
|
276
|
+
if (!crossingNext && !crossingPrev) return handleNone(ctx);
|
|
277
|
+
const swapIndex = crossingNext ? index + 1 : index - 1;
|
|
278
|
+
const nextValues = values.slice();
|
|
279
|
+
const bounds = getThumbBounds({
|
|
280
|
+
...ctx,
|
|
281
|
+
index: swapIndex
|
|
282
|
+
});
|
|
283
|
+
nextValues[swapIndex] = round(clampValue(value, bounds.min, bounds.max));
|
|
284
|
+
nextValues[index] = values[swapIndex];
|
|
285
|
+
if (crossingNext && nextValues[index] > nextValues[swapIndex] - gap) nextValues[index] = round(nextValues[swapIndex] - gap);
|
|
286
|
+
else if (crossingPrev && nextValues[index] < nextValues[swapIndex] + gap) nextValues[index] = round(nextValues[swapIndex] + gap);
|
|
287
|
+
return {
|
|
288
|
+
values: nextValues,
|
|
289
|
+
index: swapIndex,
|
|
290
|
+
swapped: true
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function resolveThumbCollision(behavior, index, value, values, min, max, step, minStepsBetweenThumbs, startValue) {
|
|
294
|
+
if (values.length === 1) return {
|
|
295
|
+
values: [round(clampValue(value, min, max))],
|
|
296
|
+
index: 0,
|
|
297
|
+
swapped: false
|
|
298
|
+
};
|
|
299
|
+
const ctx = {
|
|
300
|
+
behavior,
|
|
301
|
+
index,
|
|
302
|
+
value,
|
|
303
|
+
values,
|
|
304
|
+
min,
|
|
305
|
+
max,
|
|
306
|
+
gap: step * minStepsBetweenThumbs
|
|
307
|
+
};
|
|
308
|
+
switch (behavior) {
|
|
309
|
+
case "push": return handlePush(ctx);
|
|
310
|
+
case "swap": return handleSwap(ctx, startValue ?? values[index]);
|
|
311
|
+
case "none":
|
|
312
|
+
default: return handleNone(ctx);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
199
315
|
function normalizeValues(params, nextValues) {
|
|
200
316
|
return nextValues.map((value, index) => {
|
|
201
317
|
return constrainValue(params, value, index);
|
|
@@ -644,6 +760,7 @@ const machine = createMachine({
|
|
|
644
760
|
thumbAlignment: "contain",
|
|
645
761
|
origin: "start",
|
|
646
762
|
orientation: "horizontal",
|
|
763
|
+
thumbCollisionBehavior: "none",
|
|
647
764
|
minStepsBetweenThumbs,
|
|
648
765
|
...props$1,
|
|
649
766
|
defaultValue: normalize(defaultValue, min, max, step, minStepsBetweenThumbs),
|
|
@@ -684,7 +801,10 @@ const machine = createMachine({
|
|
|
684
801
|
};
|
|
685
802
|
},
|
|
686
803
|
refs() {
|
|
687
|
-
return {
|
|
804
|
+
return {
|
|
805
|
+
thumbDragOffset: null,
|
|
806
|
+
thumbDragStartValue: null
|
|
807
|
+
};
|
|
688
808
|
},
|
|
689
809
|
computed: {
|
|
690
810
|
isHorizontal: ({ prop }) => prop("orientation") === "horizontal",
|
|
@@ -722,6 +842,7 @@ const machine = createMachine({
|
|
|
722
842
|
target: "dragging",
|
|
723
843
|
actions: [
|
|
724
844
|
"setClosestThumbIndex",
|
|
845
|
+
"setThumbDragStartValue",
|
|
725
846
|
"setPointerValue",
|
|
726
847
|
"focusActiveThumb"
|
|
727
848
|
]
|
|
@@ -735,6 +856,7 @@ const machine = createMachine({
|
|
|
735
856
|
actions: [
|
|
736
857
|
"setFocusedIndex",
|
|
737
858
|
"setThumbDragOffset",
|
|
859
|
+
"setThumbDragStartValue",
|
|
738
860
|
"focusActiveThumb"
|
|
739
861
|
]
|
|
740
862
|
}
|
|
@@ -746,6 +868,7 @@ const machine = createMachine({
|
|
|
746
868
|
target: "dragging",
|
|
747
869
|
actions: [
|
|
748
870
|
"setClosestThumbIndex",
|
|
871
|
+
"setThumbDragStartValue",
|
|
749
872
|
"setPointerValue",
|
|
750
873
|
"focusActiveThumb"
|
|
751
874
|
]
|
|
@@ -755,6 +878,7 @@ const machine = createMachine({
|
|
|
755
878
|
actions: [
|
|
756
879
|
"setFocusedIndex",
|
|
757
880
|
"setThumbDragOffset",
|
|
881
|
+
"setThumbDragStartValue",
|
|
758
882
|
"focusActiveThumb"
|
|
759
883
|
]
|
|
760
884
|
},
|
|
@@ -774,12 +898,20 @@ const machine = createMachine({
|
|
|
774
898
|
on: {
|
|
775
899
|
POINTER_UP: {
|
|
776
900
|
target: "focus",
|
|
777
|
-
actions: [
|
|
901
|
+
actions: [
|
|
902
|
+
"invokeOnChangeEnd",
|
|
903
|
+
"clearThumbDragOffset",
|
|
904
|
+
"clearThumbDragStartValue"
|
|
905
|
+
]
|
|
778
906
|
},
|
|
779
907
|
POINTER_MOVE: { actions: ["setPointerValue"] },
|
|
780
908
|
POINTER_CANCEL: {
|
|
781
909
|
target: "idle",
|
|
782
|
-
actions: [
|
|
910
|
+
actions: [
|
|
911
|
+
"clearFocusedIndex",
|
|
912
|
+
"clearThumbDragOffset",
|
|
913
|
+
"clearThumbDragStartValue"
|
|
914
|
+
]
|
|
783
915
|
}
|
|
784
916
|
}
|
|
785
917
|
}
|
|
@@ -858,14 +990,22 @@ const machine = createMachine({
|
|
|
858
990
|
clearThumbDragOffset({ refs }) {
|
|
859
991
|
refs.set("thumbDragOffset", null);
|
|
860
992
|
},
|
|
993
|
+
setThumbDragStartValue({ refs, context }) {
|
|
994
|
+
refs.set("thumbDragStartValue", context.get("value").slice());
|
|
995
|
+
},
|
|
996
|
+
clearThumbDragStartValue({ refs }) {
|
|
997
|
+
refs.set("thumbDragStartValue", null);
|
|
998
|
+
},
|
|
861
999
|
setPointerValue(params) {
|
|
862
1000
|
queueMicrotask(() => {
|
|
863
|
-
const { context, event } = params;
|
|
1001
|
+
const { context, event, prop, refs } = params;
|
|
864
1002
|
const pointValue = getPointValue(params, event.point);
|
|
865
1003
|
if (pointValue == null) return;
|
|
866
1004
|
const focusedIndex = context.get("focusedIndex");
|
|
867
|
-
const
|
|
868
|
-
context.
|
|
1005
|
+
const startValues = refs.get("thumbDragStartValue");
|
|
1006
|
+
const result = resolveThumbCollision(prop("thumbCollisionBehavior"), focusedIndex, pointValue, context.get("value"), prop("min"), prop("max"), prop("step"), prop("minStepsBetweenThumbs"), startValues?.[focusedIndex]);
|
|
1007
|
+
if (result.swapped) context.set("focusedIndex", result.index);
|
|
1008
|
+
context.set("value", result.values);
|
|
869
1009
|
});
|
|
870
1010
|
},
|
|
871
1011
|
focusActiveThumb({ scope, context }) {
|
|
@@ -934,7 +1074,7 @@ const props = createProps()([
|
|
|
934
1074
|
"readOnly",
|
|
935
1075
|
"step",
|
|
936
1076
|
"thumbAlignment",
|
|
937
|
-
"
|
|
1077
|
+
"thumbCollisionBehavior",
|
|
938
1078
|
"thumbSize",
|
|
939
1079
|
"value",
|
|
940
1080
|
"defaultValue"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_create_anatomy = require('../../create-anatomy-CDsIFUXg.cjs');
|
|
2
|
-
const require_dom_query = require('../../dom-query-
|
|
3
|
-
const require_utils = require('../../utils-
|
|
4
|
-
const require_core = require('../../core-
|
|
2
|
+
const require_dom_query = require('../../dom-query-fmUvyB3x.cjs');
|
|
3
|
+
const require_utils = require('../../utils-CMs0714u.cjs');
|
|
4
|
+
const require_core = require('../../core-BXoiGBfo.cjs');
|
|
5
5
|
const require_create_props = require('../../create-props-l5q5b8Wo.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/machines/splitter/splitter.anatomy.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-smWrirg1.cjs";
|
|
2
|
-
import { p as Machine, u as EventObject, y as Service } from "../../types-
|
|
3
|
-
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-
|
|
2
|
+
import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu60O.cjs";
|
|
3
|
+
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/splitter/splitter.anatomy.d.ts
|
|
6
6
|
declare const anatomy: AnatomyInstance<"root" | "panel" | "resizeTrigger" | "resizeTriggerIndicator">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-DHVOqZET.mjs";
|
|
2
|
-
import { p as Machine, u as EventObject, y as Service } from "../../types-
|
|
3
|
-
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-
|
|
2
|
+
import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQk5.mjs";
|
|
3
|
+
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/splitter/splitter.anatomy.d.ts
|
|
6
6
|
declare const anatomy: AnatomyInstance<"root" | "panel" | "resizeTrigger" | "resizeTriggerIndicator">;
|