@sprawlify/primitives 0.0.52 → 0.0.53
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/collection.d.cts +2 -2
- package/dist/collection.d.mts +2 -2
- package/dist/date-utils.d.mts +1 -1
- package/dist/dom-query.d.cts +1 -1
- package/dist/dom-query.d.mts +1 -1
- package/dist/{index-ExuT65LJ.d.mts → index-BqhWpjZh.d.mts} +5 -5
- package/dist/{list-collection-BvMwDNHf.d.cts → list-collection-BslnP0r-.d.cts} +1 -1
- package/dist/{list-collection-CTt1eong.d.mts → list-collection-swuCMCIS.d.mts} +1 -1
- package/dist/machines/angle-slider/index.d.cts +1 -1
- package/dist/machines/angle-slider/index.d.mts +1 -1
- package/dist/machines/bottom-sheet/index.d.cts +1 -1
- package/dist/machines/bottom-sheet/index.d.mts +1 -1
- package/dist/machines/carousel/index.d.cts +1 -1
- package/dist/machines/carousel/index.d.mts +1 -1
- package/dist/machines/clipboard/index.d.cts +1 -1
- package/dist/machines/clipboard/index.d.mts +1 -1
- package/dist/machines/collapsible/index.d.cts +1 -1
- package/dist/machines/collapsible/index.d.mts +1 -1
- package/dist/machines/color-picker/index.d.cts +1 -1
- package/dist/machines/color-picker/index.d.mts +1 -1
- package/dist/machines/combobox/index.d.cts +2 -2
- package/dist/machines/combobox/index.d.mts +2 -2
- package/dist/machines/date-picker/index.d.cts +1 -1
- package/dist/machines/date-picker/index.d.mts +2 -2
- package/dist/machines/dialog/index.d.cts +1 -1
- package/dist/machines/dialog/index.d.mts +1 -1
- package/dist/machines/editable/index.d.cts +1 -1
- package/dist/machines/editable/index.d.mts +1 -1
- package/dist/machines/file-upload/index.d.cts +1 -1
- package/dist/machines/file-upload/index.d.mts +1 -1
- package/dist/machines/floating-panel/index.d.cts +1 -1
- package/dist/machines/floating-panel/index.d.mts +1 -1
- package/dist/machines/hover-card/index.d.cts +1 -1
- package/dist/machines/hover-card/index.d.mts +1 -1
- package/dist/machines/listbox/index.d.cts +3 -3
- package/dist/machines/listbox/index.d.mts +3 -3
- package/dist/machines/marquee/index.d.cts +3 -3
- package/dist/machines/marquee/index.d.mts +3 -3
- package/dist/machines/menu/index.d.cts +1 -1
- package/dist/machines/menu/index.d.mts +1 -1
- package/dist/machines/navigation-menu/index.d.cts +1 -1
- package/dist/machines/navigation-menu/index.d.mts +1 -1
- package/dist/machines/number-input/index.d.cts +1 -1
- package/dist/machines/number-input/index.d.mts +1 -1
- package/dist/machines/pagination/index.d.cts +1 -1
- package/dist/machines/pagination/index.d.mts +1 -1
- package/dist/machines/password-input/index.d.cts +1 -1
- package/dist/machines/password-input/index.d.mts +1 -1
- package/dist/machines/pin-input/index.d.cts +1 -1
- package/dist/machines/pin-input/index.d.mts +1 -1
- package/dist/machines/popover/index.d.cts +1 -1
- package/dist/machines/popover/index.d.mts +1 -1
- package/dist/machines/progress/index.d.cts +1 -1
- package/dist/machines/progress/index.d.mts +1 -1
- package/dist/machines/scroll-area/index.d.cts +1 -1
- package/dist/machines/scroll-area/index.d.mts +1 -1
- package/dist/machines/select/index.d.cts +2 -2
- package/dist/machines/select/index.d.mts +2 -2
- package/dist/machines/signature-pad/index.d.cts +1 -1
- package/dist/machines/signature-pad/index.d.mts +1 -1
- package/dist/machines/slider/index.d.cts +1 -1
- package/dist/machines/slider/index.d.mts +1 -1
- package/dist/machines/splitter/index.d.cts +1 -1
- package/dist/machines/splitter/index.d.mts +1 -1
- package/dist/machines/steps/index.cjs +69 -23
- package/dist/machines/steps/index.d.cts +14 -2
- package/dist/machines/steps/index.d.mts +14 -2
- package/dist/machines/steps/index.mjs +69 -23
- package/dist/machines/switch/index.d.cts +1 -1
- package/dist/machines/switch/index.d.mts +1 -1
- package/dist/machines/tabs/index.d.cts +1 -1
- package/dist/machines/tabs/index.d.mts +1 -1
- package/dist/machines/tags-input/index.d.cts +1 -1
- package/dist/machines/tags-input/index.d.mts +1 -1
- package/dist/machines/timer/index.d.cts +1 -1
- package/dist/machines/timer/index.d.mts +1 -1
- package/dist/machines/toast/index.d.cts +1 -1
- package/dist/machines/toast/index.d.mts +1 -1
- package/dist/machines/tooltip/index.d.cts +1 -1
- package/dist/machines/tooltip/index.d.mts +1 -1
- package/dist/machines/tour/index.d.cts +1 -1
- package/dist/machines/tour/index.d.mts +1 -1
- package/dist/machines/tree-view/index.d.cts +1 -1
- package/dist/machines/tree-view/index.d.mts +1 -1
- package/dist/{selection-JDFmyke7.d.mts → selection-CIoBu9mp.d.mts} +1 -1
- package/dist/{selection-vng1guNc.d.cts → selection-DTpiPgq8.d.cts} +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
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/pagination/pagination.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "nextTrigger" | "prevTrigger" | "ellipsis" | "firstTrigger" | "lastTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/pagination/pagination.types.d.ts
|
|
9
9
|
interface PageChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
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/pagination/pagination.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "item" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "item" | "nextTrigger" | "prevTrigger" | "ellipsis" | "firstTrigger" | "lastTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/pagination/pagination.types.d.ts
|
|
9
9
|
interface PageChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
3
|
import { b as NormalizeProps, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/password-input/password-input.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"input" | "root" | "indicator" | "label" | "control" | "visibilityTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/password-input/password-input.types.d.ts
|
|
9
9
|
interface VisibilityChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
3
|
import { b as NormalizeProps, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/password-input/password-input.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"input" | "root" | "indicator" | "label" | "control" | "visibilityTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/password-input/password-input.types.d.ts
|
|
9
9
|
interface VisibilityChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
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/pin-input/pin-input.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"input" | "root" | "label" | "control">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/pin-input/pin-input.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
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/pin-input/pin-input.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"input" | "root" | "label" | "control">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/pin-input/pin-input.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -6,7 +6,7 @@ import { r as PersistentElementOptions, t as DismissableElementHandlers } from "
|
|
|
6
6
|
import { c as Placement, d as PositioningOptions } from "../../types-D5ziaMrd.cjs";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/popover/popover.anatomy.d.ts
|
|
9
|
-
declare const anatomy: AnatomyInstance<"
|
|
9
|
+
declare const anatomy: AnatomyInstance<"content" | "closeTrigger" | "title" | "description" | "positioner" | "arrow" | "arrowTip" | "trigger" | "indicator" | "anchor">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/popover/popover.types.d.ts
|
|
12
12
|
interface OpenChangeDetails {
|
|
@@ -6,7 +6,7 @@ import { r as PersistentElementOptions, t as DismissableElementHandlers } from "
|
|
|
6
6
|
import { p as PositioningOptions, u as Placement } from "../../index-BTi1wETB.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/popover/popover.anatomy.d.ts
|
|
9
|
-
declare const anatomy: AnatomyInstance<"
|
|
9
|
+
declare const anatomy: AnatomyInstance<"content" | "closeTrigger" | "title" | "description" | "positioner" | "arrow" | "arrowTip" | "trigger" | "indicator" | "anchor">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/popover/popover.types.d.ts
|
|
12
12
|
interface OpenChangeDetails {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
3
|
import { b as NormalizeProps, d as Orientation, f as OrientationProperty, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/progress/progress.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"track" | "root" | "label" | "circle" | "view" | "valueText" | "range" | "circleTrack" | "circleRange">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/progress/progress.types.d.ts
|
|
9
9
|
type ProgressState = "indeterminate" | "loading" | "complete";
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
3
|
import { b as NormalizeProps, d as Orientation, f as OrientationProperty, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/progress/progress.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"track" | "root" | "label" | "circle" | "view" | "valueText" | "range" | "circleTrack" | "circleRange">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/progress/progress.types.d.ts
|
|
9
9
|
type ProgressState = "indeterminate" | "loading" | "complete";
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
3
|
import { _ as Size, b as NormalizeProps, d as Orientation, p as Point, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/scroll-area/scroll-area.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"content" | "root" | "thumb" | "viewport" | "scrollbar" | "corner">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/scroll-area/utils/timeout.d.ts
|
|
9
9
|
declare class Timeout {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
3
|
import { _ as Size, b as NormalizeProps, d as Orientation, p as Point, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/scroll-area/scroll-area.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"content" | "root" | "thumb" | "viewport" | "scrollbar" | "corner">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/scroll-area/utils/timeout.d.ts
|
|
9
9
|
declare class Timeout {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-smWrirg1.cjs";
|
|
2
2
|
import { r as CollectionOptions, t as CollectionItem } from "../../types-CADkcKtr.cjs";
|
|
3
|
-
import { t as ListCollection } from "../../list-collection-
|
|
3
|
+
import { t as ListCollection } from "../../list-collection-BslnP0r-.cjs";
|
|
4
4
|
import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu60O.cjs";
|
|
5
5
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
6
6
|
import { n as TypeaheadState } from "../../typeahead-BdNwVP09.cjs";
|
|
@@ -8,7 +8,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
8
8
|
import { c as Placement, d as PositioningOptions } from "../../types-D5ziaMrd.cjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/select/select.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"
|
|
11
|
+
declare const anatomy: AnatomyInstance<"content" | "positioner" | "trigger" | "root" | "indicator" | "label" | "control" | "item" | "clearTrigger" | "itemText" | "itemIndicator" | "itemGroup" | "itemGroupLabel" | "list" | "valueText">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/select/select.collection.d.ts
|
|
14
14
|
declare const collection: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-DHVOqZET.mjs";
|
|
2
2
|
import { r as CollectionOptions, t as CollectionItem } from "../../types-Df8ZhdY-.mjs";
|
|
3
|
-
import { t as ListCollection } from "../../list-collection-
|
|
3
|
+
import { t as ListCollection } from "../../list-collection-swuCMCIS.mjs";
|
|
4
4
|
import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQk5.mjs";
|
|
5
5
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
6
6
|
import { n as TypeaheadState } from "../../typeahead-DMSwLv1e.mjs";
|
|
@@ -8,7 +8,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
8
8
|
import { p as PositioningOptions, u as Placement } from "../../index-BTi1wETB.mjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/select/select.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"
|
|
11
|
+
declare const anatomy: AnatomyInstance<"content" | "positioner" | "trigger" | "root" | "indicator" | "label" | "control" | "item" | "clearTrigger" | "itemText" | "itemIndicator" | "itemGroup" | "itemGroupLabel" | "list" | "valueText">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/select/select.collection.d.ts
|
|
14
14
|
declare const collection: {
|
|
@@ -4,7 +4,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { StrokeOptions } from "perfect-freehand";
|
|
5
5
|
|
|
6
6
|
//#region src/machines/signature-pad/signature-pad.anatomy.d.ts
|
|
7
|
-
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "
|
|
7
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "clearTrigger" | "segment" | "segmentPath" | "guide">;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/machines/signature-pad/signature-pad.types.d.ts
|
|
10
10
|
interface Point {
|
|
@@ -4,7 +4,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { StrokeOptions } from "perfect-freehand";
|
|
5
5
|
|
|
6
6
|
//#region src/machines/signature-pad/signature-pad.anatomy.d.ts
|
|
7
|
-
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "
|
|
7
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "clearTrigger" | "segment" | "segmentPath" | "guide">;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/machines/signature-pad/signature-pad.types.d.ts
|
|
10
10
|
interface Point {
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
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<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"track" | "root" | "label" | "control" | "marker" | "valueText" | "thumb" | "range" | "markerGroup" | "draggingIndicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/slider/slider.types.d.ts
|
|
9
9
|
type ThumbCollisionBehavior = "none" | "push" | "swap";
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
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<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"track" | "root" | "label" | "control" | "marker" | "valueText" | "thumb" | "range" | "markerGroup" | "draggingIndicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/slider/slider.types.d.ts
|
|
9
9
|
type ThumbCollisionBehavior = "none" | "push" | "swap";
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
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
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "panel" | "resizeTrigger" | "resizeTriggerIndicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/splitter/splitter.types.d.ts
|
|
9
9
|
type ResizeEvent = PointerEvent | KeyboardEvent;
|
|
@@ -3,7 +3,7 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
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
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "panel" | "resizeTrigger" | "resizeTriggerIndicator">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/splitter/splitter.types.d.ts
|
|
9
9
|
type ResizeEvent = PointerEvent | KeyboardEvent;
|
|
@@ -24,6 +24,12 @@ function connect(service, normalize) {
|
|
|
24
24
|
const percent = computed("percent");
|
|
25
25
|
const hasNextStep = computed("hasNextStep");
|
|
26
26
|
const hasPrevStep = computed("hasPrevStep");
|
|
27
|
+
const isStepValid = (index) => {
|
|
28
|
+
return prop("isStepValid")?.(index) ?? true;
|
|
29
|
+
};
|
|
30
|
+
const isStepSkippable = (index) => {
|
|
31
|
+
return prop("isStepSkippable")?.(index) ?? false;
|
|
32
|
+
};
|
|
27
33
|
const getItemState = (props$1) => ({
|
|
28
34
|
triggerId: getTriggerId(scope, props$1.index),
|
|
29
35
|
contentId: getContentId(scope, props$1.index),
|
|
@@ -32,7 +38,9 @@ function connect(service, normalize) {
|
|
|
32
38
|
incomplete: props$1.index > step,
|
|
33
39
|
index: props$1.index,
|
|
34
40
|
first: props$1.index === 0,
|
|
35
|
-
last: props$1.index === count - 1
|
|
41
|
+
last: props$1.index === count - 1,
|
|
42
|
+
skippable: isStepSkippable(props$1.index),
|
|
43
|
+
isValid: () => isStepValid(props$1.index)
|
|
36
44
|
});
|
|
37
45
|
const goToNextStep = () => {
|
|
38
46
|
send({
|
|
@@ -66,6 +74,8 @@ function connect(service, normalize) {
|
|
|
66
74
|
hasNextStep,
|
|
67
75
|
hasPrevStep,
|
|
68
76
|
isCompleted: computed("completed"),
|
|
77
|
+
isStepValid,
|
|
78
|
+
isStepSkippable,
|
|
69
79
|
goToNextStep,
|
|
70
80
|
goToPrevStep,
|
|
71
81
|
resetStep,
|
|
@@ -98,7 +108,8 @@ function connect(service, normalize) {
|
|
|
98
108
|
...parts.item.attrs,
|
|
99
109
|
dir: prop("dir"),
|
|
100
110
|
"aria-current": itemState.current ? "step" : void 0,
|
|
101
|
-
"data-orientation": prop("orientation")
|
|
111
|
+
"data-orientation": prop("orientation"),
|
|
112
|
+
"data-skippable": require_dom_query.dataAttr(itemState.skippable)
|
|
102
113
|
});
|
|
103
114
|
},
|
|
104
115
|
getTriggerProps(props$1) {
|
|
@@ -233,34 +244,65 @@ const machine = require_core.createMachine({
|
|
|
233
244
|
initialState() {
|
|
234
245
|
return "idle";
|
|
235
246
|
},
|
|
236
|
-
entry: ["
|
|
247
|
+
entry: ["validateStepIndex"],
|
|
237
248
|
states: { idle: { on: {
|
|
238
|
-
"STEP.SET": {
|
|
239
|
-
|
|
249
|
+
"STEP.SET": [{
|
|
250
|
+
guard: "isValidStepNavigation",
|
|
251
|
+
actions: ["setStep"]
|
|
252
|
+
}, { actions: ["invokeOnStepInvalid"] }],
|
|
253
|
+
"STEP.NEXT": [{
|
|
254
|
+
guard: "isCurrentStepValid",
|
|
255
|
+
actions: ["goToNextStep"]
|
|
256
|
+
}, { actions: ["invokeOnStepInvalid"] }],
|
|
240
257
|
"STEP.PREV": { actions: ["goToPrevStep"] },
|
|
241
258
|
"STEP.RESET": { actions: ["resetStep"] }
|
|
242
259
|
} } },
|
|
243
|
-
implementations: {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
260
|
+
implementations: {
|
|
261
|
+
guards: {
|
|
262
|
+
isCurrentStepValid({ context, prop }) {
|
|
263
|
+
const current = context.get("step");
|
|
264
|
+
if (prop("isStepSkippable")?.(current)) return true;
|
|
265
|
+
const isStepValid = prop("isStepValid");
|
|
266
|
+
if (!isStepValid) return true;
|
|
267
|
+
return isStepValid(current);
|
|
268
|
+
},
|
|
269
|
+
isValidStepNavigation({ context, event, prop }) {
|
|
270
|
+
const current = context.get("step");
|
|
271
|
+
if (event.value <= current) return true;
|
|
272
|
+
if (prop("isStepSkippable")?.(current)) return true;
|
|
273
|
+
const isStepValid = prop("isStepValid");
|
|
274
|
+
if (!isStepValid) return true;
|
|
275
|
+
return isStepValid(current);
|
|
276
|
+
}
|
|
257
277
|
},
|
|
258
|
-
|
|
259
|
-
|
|
278
|
+
actions: {
|
|
279
|
+
goToNextStep({ context, prop }) {
|
|
280
|
+
const count = prop("count");
|
|
281
|
+
context.set("step", Math.min(context.get("step") + 1, count));
|
|
282
|
+
},
|
|
283
|
+
goToPrevStep({ context }) {
|
|
284
|
+
context.set("step", Math.max(context.get("step") - 1, 0));
|
|
285
|
+
},
|
|
286
|
+
resetStep({ context }) {
|
|
287
|
+
context.set("step", 0);
|
|
288
|
+
},
|
|
289
|
+
setStep({ context, event }) {
|
|
290
|
+
context.set("step", event.value);
|
|
291
|
+
},
|
|
292
|
+
validateStepIndex({ context, prop }) {
|
|
293
|
+
validateStepIndex(prop("count"), context.get("step"));
|
|
294
|
+
},
|
|
295
|
+
invokeOnStepInvalid({ context, event, prop }) {
|
|
296
|
+
prop("onStepInvalid")?.({
|
|
297
|
+
step: context.get("step"),
|
|
298
|
+
action: event.type === "STEP.NEXT" ? "next" : "set",
|
|
299
|
+
targetStep: event.value
|
|
300
|
+
});
|
|
301
|
+
}
|
|
260
302
|
}
|
|
261
|
-
}
|
|
303
|
+
}
|
|
262
304
|
});
|
|
263
|
-
const
|
|
305
|
+
const validateStepIndex = (count, step) => {
|
|
264
306
|
if (!require_utils.isValueWithinRange(step, 0, count)) throw new RangeError(`[sprawlify-js/steps] step index ${step} is out of bounds`);
|
|
265
307
|
};
|
|
266
308
|
|
|
@@ -268,13 +310,17 @@ const validateStep = (count, step) => {
|
|
|
268
310
|
//#region src/machines/steps/steps.props.ts
|
|
269
311
|
const props = require_create_props.createProps()([
|
|
270
312
|
"count",
|
|
313
|
+
"defaultStep",
|
|
271
314
|
"dir",
|
|
272
315
|
"getRootNode",
|
|
273
316
|
"id",
|
|
274
317
|
"ids",
|
|
318
|
+
"isStepSkippable",
|
|
319
|
+
"isStepValid",
|
|
275
320
|
"linear",
|
|
276
321
|
"onStepChange",
|
|
277
322
|
"onStepComplete",
|
|
323
|
+
"onStepInvalid",
|
|
278
324
|
"orientation",
|
|
279
325
|
"step",
|
|
280
326
|
"defaultStep"
|
|
@@ -3,12 +3,17 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DejIu6
|
|
|
3
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/steps/steps.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"content" | "progress" | "trigger" | "root" | "indicator" | "item" | "list" | "separator" | "nextTrigger" | "prevTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/steps/steps.types.d.ts
|
|
9
9
|
interface StepChangeDetails {
|
|
10
10
|
step: number;
|
|
11
11
|
}
|
|
12
|
+
interface StepInvalidDetails {
|
|
13
|
+
step: number;
|
|
14
|
+
action: "next" | "set";
|
|
15
|
+
targetStep?: number;
|
|
16
|
+
}
|
|
12
17
|
interface ElementIds {
|
|
13
18
|
root?: string | undefined;
|
|
14
19
|
list?: string | undefined;
|
|
@@ -24,6 +29,9 @@ interface StepsProps extends DirectionProperty, CommonProperties {
|
|
|
24
29
|
linear?: boolean | undefined;
|
|
25
30
|
orientation?: "horizontal" | "vertical" | undefined;
|
|
26
31
|
count?: number | undefined;
|
|
32
|
+
isStepValid?: ((index: number) => boolean) | undefined;
|
|
33
|
+
isStepSkippable?: ((index: number) => boolean) | undefined;
|
|
34
|
+
onStepInvalid?: ((details: StepInvalidDetails) => void) | undefined;
|
|
27
35
|
}
|
|
28
36
|
type PropsWithDefault = "orientation" | "linear" | "count";
|
|
29
37
|
interface PrivateContext {
|
|
@@ -59,6 +67,8 @@ interface ItemState {
|
|
|
59
67
|
incomplete: boolean;
|
|
60
68
|
last: boolean;
|
|
61
69
|
first: boolean;
|
|
70
|
+
skippable: boolean;
|
|
71
|
+
isValid: () => boolean;
|
|
62
72
|
}
|
|
63
73
|
interface StepsApi<T extends PropTypes = PropTypes> {
|
|
64
74
|
value: number;
|
|
@@ -67,6 +77,8 @@ interface StepsApi<T extends PropTypes = PropTypes> {
|
|
|
67
77
|
hasNextStep: boolean;
|
|
68
78
|
hasPrevStep: boolean;
|
|
69
79
|
isCompleted: boolean;
|
|
80
|
+
isStepValid: (index: number) => boolean;
|
|
81
|
+
isStepSkippable: (index: number) => boolean;
|
|
70
82
|
setStep: (step: number) => void;
|
|
71
83
|
goToNextStep: VoidFunction;
|
|
72
84
|
goToPrevStep: VoidFunction;
|
|
@@ -94,4 +106,4 @@ declare const machine: Machine<StepsSchema>;
|
|
|
94
106
|
declare const props: (keyof StepsProps)[];
|
|
95
107
|
declare const splitProps: <Props extends Partial<StepsProps>>(props: Props) => [Partial<StepsProps>, Omit<Props, keyof StepsProps>];
|
|
96
108
|
//#endregion
|
|
97
|
-
export { type StepsApi as Api, type ElementIds, type ItemProps, type ItemState, type StepsMachine as Machine, type StepsProps as Props, type StepsService as Service, type StepChangeDetails, anatomy, connect, machine, props, splitProps };
|
|
109
|
+
export { type StepsApi as Api, type ElementIds, type ItemProps, type ItemState, type StepsMachine as Machine, type StepsProps as Props, type StepsService as Service, type StepChangeDetails, type StepInvalidDetails, anatomy, connect, machine, props, splitProps };
|
|
@@ -3,12 +3,17 @@ import { p as Machine, u as EventObject, y as Service } from "../../types-DL5AIQ
|
|
|
3
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/steps/steps.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"content" | "progress" | "trigger" | "root" | "indicator" | "item" | "list" | "separator" | "nextTrigger" | "prevTrigger">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/steps/steps.types.d.ts
|
|
9
9
|
interface StepChangeDetails {
|
|
10
10
|
step: number;
|
|
11
11
|
}
|
|
12
|
+
interface StepInvalidDetails {
|
|
13
|
+
step: number;
|
|
14
|
+
action: "next" | "set";
|
|
15
|
+
targetStep?: number;
|
|
16
|
+
}
|
|
12
17
|
interface ElementIds {
|
|
13
18
|
root?: string | undefined;
|
|
14
19
|
list?: string | undefined;
|
|
@@ -24,6 +29,9 @@ interface StepsProps extends DirectionProperty, CommonProperties {
|
|
|
24
29
|
linear?: boolean | undefined;
|
|
25
30
|
orientation?: "horizontal" | "vertical" | undefined;
|
|
26
31
|
count?: number | undefined;
|
|
32
|
+
isStepValid?: ((index: number) => boolean) | undefined;
|
|
33
|
+
isStepSkippable?: ((index: number) => boolean) | undefined;
|
|
34
|
+
onStepInvalid?: ((details: StepInvalidDetails) => void) | undefined;
|
|
27
35
|
}
|
|
28
36
|
type PropsWithDefault = "orientation" | "linear" | "count";
|
|
29
37
|
interface PrivateContext {
|
|
@@ -59,6 +67,8 @@ interface ItemState {
|
|
|
59
67
|
incomplete: boolean;
|
|
60
68
|
last: boolean;
|
|
61
69
|
first: boolean;
|
|
70
|
+
skippable: boolean;
|
|
71
|
+
isValid: () => boolean;
|
|
62
72
|
}
|
|
63
73
|
interface StepsApi<T extends PropTypes = PropTypes> {
|
|
64
74
|
value: number;
|
|
@@ -67,6 +77,8 @@ interface StepsApi<T extends PropTypes = PropTypes> {
|
|
|
67
77
|
hasNextStep: boolean;
|
|
68
78
|
hasPrevStep: boolean;
|
|
69
79
|
isCompleted: boolean;
|
|
80
|
+
isStepValid: (index: number) => boolean;
|
|
81
|
+
isStepSkippable: (index: number) => boolean;
|
|
70
82
|
setStep: (step: number) => void;
|
|
71
83
|
goToNextStep: VoidFunction;
|
|
72
84
|
goToPrevStep: VoidFunction;
|
|
@@ -94,4 +106,4 @@ declare const machine: Machine<StepsSchema>;
|
|
|
94
106
|
declare const props: (keyof StepsProps)[];
|
|
95
107
|
declare const splitProps: <Props extends Partial<StepsProps>>(props: Props) => [Partial<StepsProps>, Omit<Props, keyof StepsProps>];
|
|
96
108
|
//#endregion
|
|
97
|
-
export { type StepsApi as Api, type ElementIds, type ItemProps, type ItemState, type StepsMachine as Machine, type StepsProps as Props, type StepsService as Service, type StepChangeDetails, anatomy, connect, machine, props, splitProps };
|
|
109
|
+
export { type StepsApi as Api, type ElementIds, type ItemProps, type ItemState, type StepsMachine as Machine, type StepsProps as Props, type StepsService as Service, type StepChangeDetails, type StepInvalidDetails, anatomy, connect, machine, props, splitProps };
|
|
@@ -24,6 +24,12 @@ function connect(service, normalize) {
|
|
|
24
24
|
const percent = computed("percent");
|
|
25
25
|
const hasNextStep = computed("hasNextStep");
|
|
26
26
|
const hasPrevStep = computed("hasPrevStep");
|
|
27
|
+
const isStepValid = (index) => {
|
|
28
|
+
return prop("isStepValid")?.(index) ?? true;
|
|
29
|
+
};
|
|
30
|
+
const isStepSkippable = (index) => {
|
|
31
|
+
return prop("isStepSkippable")?.(index) ?? false;
|
|
32
|
+
};
|
|
27
33
|
const getItemState = (props$1) => ({
|
|
28
34
|
triggerId: getTriggerId(scope, props$1.index),
|
|
29
35
|
contentId: getContentId(scope, props$1.index),
|
|
@@ -32,7 +38,9 @@ function connect(service, normalize) {
|
|
|
32
38
|
incomplete: props$1.index > step,
|
|
33
39
|
index: props$1.index,
|
|
34
40
|
first: props$1.index === 0,
|
|
35
|
-
last: props$1.index === count - 1
|
|
41
|
+
last: props$1.index === count - 1,
|
|
42
|
+
skippable: isStepSkippable(props$1.index),
|
|
43
|
+
isValid: () => isStepValid(props$1.index)
|
|
36
44
|
});
|
|
37
45
|
const goToNextStep = () => {
|
|
38
46
|
send({
|
|
@@ -66,6 +74,8 @@ function connect(service, normalize) {
|
|
|
66
74
|
hasNextStep,
|
|
67
75
|
hasPrevStep,
|
|
68
76
|
isCompleted: computed("completed"),
|
|
77
|
+
isStepValid,
|
|
78
|
+
isStepSkippable,
|
|
69
79
|
goToNextStep,
|
|
70
80
|
goToPrevStep,
|
|
71
81
|
resetStep,
|
|
@@ -98,7 +108,8 @@ function connect(service, normalize) {
|
|
|
98
108
|
...parts.item.attrs,
|
|
99
109
|
dir: prop("dir"),
|
|
100
110
|
"aria-current": itemState.current ? "step" : void 0,
|
|
101
|
-
"data-orientation": prop("orientation")
|
|
111
|
+
"data-orientation": prop("orientation"),
|
|
112
|
+
"data-skippable": dataAttr(itemState.skippable)
|
|
102
113
|
});
|
|
103
114
|
},
|
|
104
115
|
getTriggerProps(props$1) {
|
|
@@ -233,34 +244,65 @@ const machine = createMachine({
|
|
|
233
244
|
initialState() {
|
|
234
245
|
return "idle";
|
|
235
246
|
},
|
|
236
|
-
entry: ["
|
|
247
|
+
entry: ["validateStepIndex"],
|
|
237
248
|
states: { idle: { on: {
|
|
238
|
-
"STEP.SET": {
|
|
239
|
-
|
|
249
|
+
"STEP.SET": [{
|
|
250
|
+
guard: "isValidStepNavigation",
|
|
251
|
+
actions: ["setStep"]
|
|
252
|
+
}, { actions: ["invokeOnStepInvalid"] }],
|
|
253
|
+
"STEP.NEXT": [{
|
|
254
|
+
guard: "isCurrentStepValid",
|
|
255
|
+
actions: ["goToNextStep"]
|
|
256
|
+
}, { actions: ["invokeOnStepInvalid"] }],
|
|
240
257
|
"STEP.PREV": { actions: ["goToPrevStep"] },
|
|
241
258
|
"STEP.RESET": { actions: ["resetStep"] }
|
|
242
259
|
} } },
|
|
243
|
-
implementations: {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
260
|
+
implementations: {
|
|
261
|
+
guards: {
|
|
262
|
+
isCurrentStepValid({ context, prop }) {
|
|
263
|
+
const current = context.get("step");
|
|
264
|
+
if (prop("isStepSkippable")?.(current)) return true;
|
|
265
|
+
const isStepValid = prop("isStepValid");
|
|
266
|
+
if (!isStepValid) return true;
|
|
267
|
+
return isStepValid(current);
|
|
268
|
+
},
|
|
269
|
+
isValidStepNavigation({ context, event, prop }) {
|
|
270
|
+
const current = context.get("step");
|
|
271
|
+
if (event.value <= current) return true;
|
|
272
|
+
if (prop("isStepSkippable")?.(current)) return true;
|
|
273
|
+
const isStepValid = prop("isStepValid");
|
|
274
|
+
if (!isStepValid) return true;
|
|
275
|
+
return isStepValid(current);
|
|
276
|
+
}
|
|
257
277
|
},
|
|
258
|
-
|
|
259
|
-
|
|
278
|
+
actions: {
|
|
279
|
+
goToNextStep({ context, prop }) {
|
|
280
|
+
const count = prop("count");
|
|
281
|
+
context.set("step", Math.min(context.get("step") + 1, count));
|
|
282
|
+
},
|
|
283
|
+
goToPrevStep({ context }) {
|
|
284
|
+
context.set("step", Math.max(context.get("step") - 1, 0));
|
|
285
|
+
},
|
|
286
|
+
resetStep({ context }) {
|
|
287
|
+
context.set("step", 0);
|
|
288
|
+
},
|
|
289
|
+
setStep({ context, event }) {
|
|
290
|
+
context.set("step", event.value);
|
|
291
|
+
},
|
|
292
|
+
validateStepIndex({ context, prop }) {
|
|
293
|
+
validateStepIndex(prop("count"), context.get("step"));
|
|
294
|
+
},
|
|
295
|
+
invokeOnStepInvalid({ context, event, prop }) {
|
|
296
|
+
prop("onStepInvalid")?.({
|
|
297
|
+
step: context.get("step"),
|
|
298
|
+
action: event.type === "STEP.NEXT" ? "next" : "set",
|
|
299
|
+
targetStep: event.value
|
|
300
|
+
});
|
|
301
|
+
}
|
|
260
302
|
}
|
|
261
|
-
}
|
|
303
|
+
}
|
|
262
304
|
});
|
|
263
|
-
const
|
|
305
|
+
const validateStepIndex = (count, step) => {
|
|
264
306
|
if (!isValueWithinRange(step, 0, count)) throw new RangeError(`[sprawlify-js/steps] step index ${step} is out of bounds`);
|
|
265
307
|
};
|
|
266
308
|
|
|
@@ -268,13 +310,17 @@ const validateStep = (count, step) => {
|
|
|
268
310
|
//#region src/machines/steps/steps.props.ts
|
|
269
311
|
const props = createProps()([
|
|
270
312
|
"count",
|
|
313
|
+
"defaultStep",
|
|
271
314
|
"dir",
|
|
272
315
|
"getRootNode",
|
|
273
316
|
"id",
|
|
274
317
|
"ids",
|
|
318
|
+
"isStepSkippable",
|
|
319
|
+
"isStepValid",
|
|
275
320
|
"linear",
|
|
276
321
|
"onStepChange",
|
|
277
322
|
"onStepComplete",
|
|
323
|
+
"onStepInvalid",
|
|
278
324
|
"orientation",
|
|
279
325
|
"step",
|
|
280
326
|
"defaultStep"
|