@sprawlify/primitives 0.0.51 → 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-C85P2ZDW.mjs → collection-CjwZd09Z.mjs} +7 -1
- package/dist/{collection-C5tUixCe.cjs → collection-Q52RkxUe.cjs} +7 -1
- package/dist/collection.cjs +1 -1
- package/dist/collection.d.cts +3 -3
- package/dist/collection.d.mts +3 -3
- package/dist/collection.mjs +1 -1
- package/dist/dom-query.d.cts +1 -1
- package/dist/dom-query.d.mts +1 -1
- package/dist/{list-collection-DettiQL3.d.cts → list-collection-BslnP0r-.d.cts} +1 -1
- package/dist/{list-collection-BbgocToA.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/checkbox/index.d.cts +1 -1
- package/dist/machines/checkbox/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.cjs +1 -1
- package/dist/machines/combobox/index.d.cts +2 -2
- package/dist/machines/combobox/index.d.mts +2 -2
- package/dist/machines/combobox/index.mjs +1 -1
- package/dist/machines/date-picker/index.d.cts +1 -1
- package/dist/machines/date-picker/index.d.mts +1 -1
- 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/image-cropper/index.d.cts +1 -1
- package/dist/machines/image-cropper/index.d.mts +1 -1
- package/dist/machines/listbox/index.cjs +1 -1
- package/dist/machines/listbox/index.d.cts +3 -3
- package/dist/machines/listbox/index.d.mts +3 -3
- package/dist/machines/listbox/index.mjs +1 -1
- 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/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/rating-group/index.d.cts +1 -1
- package/dist/machines/rating-group/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.cjs +1 -1
- package/dist/machines/select/index.d.cts +2 -2
- package/dist/machines/select/index.d.mts +2 -2
- package/dist/machines/select/index.mjs +1 -1
- 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/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.cjs +11 -6
- package/dist/machines/tree-view/index.d.cts +2 -2
- package/dist/machines/tree-view/index.d.mts +2 -2
- package/dist/machines/tree-view/index.mjs +11 -6
- package/dist/{selection-CTaapzrB.d.mts → selection-CIoBu9mp.d.mts} +1 -1
- package/dist/{selection-D3b3yV_x.d.cts → selection-DTpiPgq8.d.cts} +1 -1
- package/dist/{tree-collection-Dlv1BAsc.d.cts → tree-collection-CmehimuO.d.cts} +1 -1
- package/dist/{tree-collection-DYIVkVee.d.mts → tree-collection-CqXQBHwY.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -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"
|
|
@@ -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/switch/switch.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "thumb">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/switch/switch.types.d.ts
|
|
9
9
|
interface CheckedChangeDetails {
|
|
@@ -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/switch/switch.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "control" | "thumb">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/switch/switch.types.d.ts
|
|
9
9
|
interface CheckedChangeDetails {
|
|
@@ -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, m as Rect, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/tabs/tabs.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "root" | "indicator" | "list">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/tabs/tabs.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, m as Rect, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/tabs/tabs.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"
|
|
6
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "root" | "indicator" | "list">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/tabs/tabs.types.d.ts
|
|
9
9
|
interface ValueChangeDetails {
|
|
@@ -5,7 +5,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
5
5
|
import { t as LiveRegion } from "../../index-Owca7uxB.cjs";
|
|
6
6
|
|
|
7
7
|
//#region src/machines/tags-input/tags-input.anatomy.d.ts
|
|
8
|
-
declare const anatomy: AnatomyInstance<"
|
|
8
|
+
declare const anatomy: AnatomyInstance<"input" | "root" | "label" | "control" | "item" | "itemDeleteTrigger" | "itemInput" | "clearTrigger" | "itemText" | "itemPreview">;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/machines/tags-input/tags-input.types.d.ts
|
|
11
11
|
interface ValueChangeDetails {
|
|
@@ -5,7 +5,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
5
5
|
import { t as LiveRegion } from "../../index-CygfPLvT.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/machines/tags-input/tags-input.anatomy.d.ts
|
|
8
|
-
declare const anatomy: AnatomyInstance<"
|
|
8
|
+
declare const anatomy: AnatomyInstance<"input" | "root" | "label" | "control" | "item" | "itemDeleteTrigger" | "itemInput" | "clearTrigger" | "itemText" | "itemPreview">;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/machines/tags-input/tags-input.types.d.ts
|
|
11
11
|
interface ValueChangeDetails {
|
|
@@ -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, t as CommonProperties, x as PropTypes } from "../../index-Bqw3r34-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/timer/timer.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "control" | "item" | "area" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"actionTrigger" | "root" | "control" | "item" | "area" | "separator" | "itemLabel" | "itemValue">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/timer/timer.types.d.ts
|
|
9
9
|
interface Time<T = number> {
|
|
@@ -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, t as CommonProperties, x as PropTypes } from "../../index-BuUzJjaP.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/machines/timer/timer.anatomy.d.ts
|
|
6
|
-
declare const anatomy: AnatomyInstance<"root" | "control" | "item" | "area" | "
|
|
6
|
+
declare const anatomy: AnatomyInstance<"actionTrigger" | "root" | "control" | "item" | "area" | "separator" | "itemLabel" | "itemValue">;
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/machines/timer/timer.types.d.ts
|
|
9
9
|
interface Time<T = number> {
|
|
@@ -176,7 +176,7 @@ interface ToastApi<T extends PropTypes = PropTypes, O = any> {
|
|
|
176
176
|
declare function groupConnect<T extends PropTypes, O = any>(service: Service<ToastGroupSchema>, normalize: NormalizeProps<T>): ToastGroupApi<T, O>;
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region src/machines/toast/toast.anatomy.d.ts
|
|
179
|
-
declare const anatomy: AnatomyInstance<"
|
|
179
|
+
declare const anatomy: AnatomyInstance<"actionTrigger" | "closeTrigger" | "title" | "description" | "root" | "group">;
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/machines/toast/toast.connect.d.ts
|
|
182
182
|
declare function connect<T extends PropTypes, O>(service: Service<ToastSchema<O>>, normalize: NormalizeProps<T>): ToastApi<T, O>;
|
|
@@ -176,7 +176,7 @@ interface ToastApi<T extends PropTypes = PropTypes, O = any> {
|
|
|
176
176
|
declare function groupConnect<T extends PropTypes, O = any>(service: Service<ToastGroupSchema>, normalize: NormalizeProps<T>): ToastGroupApi<T, O>;
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region src/machines/toast/toast.anatomy.d.ts
|
|
179
|
-
declare const anatomy: AnatomyInstance<"
|
|
179
|
+
declare const anatomy: AnatomyInstance<"actionTrigger" | "closeTrigger" | "title" | "description" | "root" | "group">;
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/machines/toast/toast.connect.d.ts
|
|
182
182
|
declare function connect<T extends PropTypes, O>(service: Service<ToastSchema<O>>, normalize: NormalizeProps<T>): ToastApi<T, O>;
|
|
@@ -4,7 +4,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { c as Placement, d as PositioningOptions } from "../../types-D5ziaMrd.cjs";
|
|
5
5
|
|
|
6
6
|
//#region src/machines/tooltip/tooltip.anatomy.d.ts
|
|
7
|
-
declare const anatomy: AnatomyInstance<"
|
|
7
|
+
declare const anatomy: AnatomyInstance<"content" | "positioner" | "arrow" | "arrowTip" | "trigger">;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/machines/tooltip/tooltip.types.d.ts
|
|
10
10
|
interface OpenChangeDetails {
|
|
@@ -4,7 +4,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { p as PositioningOptions, u as Placement } from "../../index-BTi1wETB.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/machines/tooltip/tooltip.anatomy.d.ts
|
|
7
|
-
declare const anatomy: AnatomyInstance<"
|
|
7
|
+
declare const anatomy: AnatomyInstance<"content" | "positioner" | "arrow" | "arrowTip" | "trigger">;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/machines/tooltip/tooltip.types.d.ts
|
|
10
10
|
interface OpenChangeDetails {
|
|
@@ -6,7 +6,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
6
6
|
import { c as Placement } from "../../types-D5ziaMrd.cjs";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/tour/tour.anatomy.d.ts
|
|
9
|
-
declare const anatomy: AnatomyInstance<"content" | "
|
|
9
|
+
declare const anatomy: AnatomyInstance<"content" | "actionTrigger" | "closeTrigger" | "progressText" | "title" | "description" | "positioner" | "arrow" | "arrowTip" | "backdrop" | "spotlight">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/tour/utils/rect.d.ts
|
|
12
12
|
interface Point {
|
|
@@ -6,7 +6,7 @@ import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusO
|
|
|
6
6
|
import { u as Placement } from "../../index-BTi1wETB.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/tour/tour.anatomy.d.ts
|
|
9
|
-
declare const anatomy: AnatomyInstance<"content" | "
|
|
9
|
+
declare const anatomy: AnatomyInstance<"content" | "actionTrigger" | "closeTrigger" | "progressText" | "title" | "description" | "positioner" | "arrow" | "arrowTip" | "backdrop" | "spotlight">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/tour/utils/rect.d.ts
|
|
12
12
|
interface Point {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_create_anatomy = require('../../create-anatomy-CDsIFUXg.cjs');
|
|
2
2
|
const require_dom_query = require('../../dom-query-ClqjTSZC.cjs');
|
|
3
3
|
const require_utils = require('../../utils-B4_qn2dt.cjs');
|
|
4
|
-
const require_collection = require('../../collection-
|
|
4
|
+
const require_collection = require('../../collection-Q52RkxUe.cjs');
|
|
5
5
|
const require_core = require('../../core-NCx2blZX.cjs');
|
|
6
6
|
const require_create_props = require('../../create-props-l5q5b8Wo.cjs');
|
|
7
7
|
|
|
@@ -76,18 +76,21 @@ function connect(service, normalize) {
|
|
|
76
76
|
const focusedValue = context.get("focusedValue");
|
|
77
77
|
const loadingStatus = context.get("loadingStatus");
|
|
78
78
|
const renamingValue = context.get("renamingValue");
|
|
79
|
+
const skip = ({ indexPath }) => {
|
|
80
|
+
return collection$1.getValuePath(indexPath).slice(0, -1).some((value) => !expandedValue.includes(value));
|
|
81
|
+
};
|
|
82
|
+
const firstNode = collection$1.getFirstNode(void 0, { skip });
|
|
83
|
+
const firstNodeValue = firstNode ? collection$1.getNodeValue(firstNode) : null;
|
|
79
84
|
function getNodeState(props$1) {
|
|
80
85
|
const { node, indexPath } = props$1;
|
|
81
86
|
const value = collection$1.getNodeValue(node);
|
|
82
|
-
const firstNode = collection$1.getFirstNode();
|
|
83
|
-
const firstNodeValue = firstNode ? collection$1.getNodeValue(firstNode) : null;
|
|
84
87
|
return {
|
|
85
88
|
id: getNodeId(scope, value),
|
|
86
89
|
value,
|
|
87
90
|
indexPath,
|
|
88
91
|
valuePath: collection$1.getValuePath(indexPath),
|
|
89
92
|
disabled: Boolean(node.disabled),
|
|
90
|
-
focused: focusedValue == null ? firstNodeValue
|
|
93
|
+
focused: focusedValue == null ? firstNodeValue === value : focusedValue === value,
|
|
91
94
|
selected: selectedValue.includes(value),
|
|
92
95
|
expanded: expandedValue.includes(value),
|
|
93
96
|
loading: loadingStatus[value] === "loading",
|
|
@@ -971,7 +974,8 @@ const machine = require_core.createMachine({
|
|
|
971
974
|
focusTreeFirstNode(params) {
|
|
972
975
|
const { prop, scope } = params;
|
|
973
976
|
const collection$1 = prop("collection");
|
|
974
|
-
const firstNode = collection$1.getFirstNode();
|
|
977
|
+
const firstNode = collection$1.getFirstNode(void 0, { skip: skipFn(params) });
|
|
978
|
+
if (!firstNode) return;
|
|
975
979
|
const firstValue = collection$1.getNodeValue(firstNode);
|
|
976
980
|
if (scrollToNode(params, firstValue)) require_dom_query.raf(() => focusNode(scope, firstValue));
|
|
977
981
|
else focusNode(scope, firstValue);
|
|
@@ -988,7 +992,8 @@ const machine = require_core.createMachine({
|
|
|
988
992
|
const { event, prop, scope } = params;
|
|
989
993
|
const collection$1 = prop("collection");
|
|
990
994
|
const branchNode = collection$1.findNode(event.id);
|
|
991
|
-
const firstNode = collection$1.getFirstNode(branchNode);
|
|
995
|
+
const firstNode = collection$1.getFirstNode(branchNode, { skip: skipFn(params) });
|
|
996
|
+
if (!firstNode) return;
|
|
992
997
|
const firstValue = collection$1.getNodeValue(firstNode);
|
|
993
998
|
if (scrollToNode(params, firstValue)) require_dom_query.raf(() => focusNode(scope, firstValue));
|
|
994
999
|
else focusNode(scope, firstValue);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-smWrirg1.cjs";
|
|
2
2
|
import { f as TreeCollectionOptions, g as ValuePath, p as TreeNode, s as FilePathTreeNode, u as IndexPath } from "../../types-CADkcKtr.cjs";
|
|
3
|
-
import { t as TreeCollection } from "../../tree-collection-
|
|
3
|
+
import { t as TreeCollection } from "../../tree-collection-CmehimuO.cjs";
|
|
4
4
|
import { p as Machine, 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";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/tree-view/tree-view.anatomy.d.ts
|
|
9
|
-
declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemIndicator" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "
|
|
9
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemText" | "itemIndicator" | "tree" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/tree-view/tree-view.collection.d.ts
|
|
12
12
|
declare const collection: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-DHVOqZET.mjs";
|
|
2
2
|
import { f as TreeCollectionOptions, g as ValuePath, p as TreeNode, s as FilePathTreeNode, u as IndexPath } from "../../types-Df8ZhdY-.mjs";
|
|
3
|
-
import { t as TreeCollection } from "../../tree-collection-
|
|
3
|
+
import { t as TreeCollection } from "../../tree-collection-CqXQBHwY.mjs";
|
|
4
4
|
import { p as Machine, 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";
|
|
7
7
|
|
|
8
8
|
//#region src/machines/tree-view/tree-view.anatomy.d.ts
|
|
9
|
-
declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemIndicator" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "
|
|
9
|
+
declare const anatomy: AnatomyInstance<"root" | "label" | "item" | "itemText" | "itemIndicator" | "tree" | "branch" | "branchContent" | "branchControl" | "branchIndentGuide" | "branchIndicator" | "branchText" | "branchTrigger" | "nodeCheckbox" | "nodeRenameInput">;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/machines/tree-view/tree-view.collection.d.ts
|
|
12
12
|
declare const collection: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createAnatomy } from "../../create-anatomy-CArN8dVu.mjs";
|
|
2
2
|
import { W as raf, bt as isLeftClick, cn as isEditableElement, ht as isComposingEvent, on as isAnchorElement, ot as setElementValue, pt as getEventTarget, s as getByTypeahead, ut as getEventKey, vn as ariaAttr, xt as isModifierKey, yn as dataAttr } from "../../dom-query-BwpPRIas.mjs";
|
|
3
3
|
import { At as remove, Dt as partition, Mt as toArray, Nt as uniq, _t as diff, ft as isEqual, mt as addOrRemove, nt as isArray, pt as add, t as ensure, u as createSplitProps, vt as first, wt as last } from "../../utils-DSBXwmDm.mjs";
|
|
4
|
-
import { n as filePathToTree, t as TreeCollection } from "../../collection-
|
|
4
|
+
import { n as filePathToTree, t as TreeCollection } from "../../collection-CjwZd09Z.mjs";
|
|
5
5
|
import { a as createMachine, i as createGuards } from "../../core-BjksCLhs.mjs";
|
|
6
6
|
import { t as createProps } from "../../create-props-SRSjdUTq.mjs";
|
|
7
7
|
|
|
@@ -76,18 +76,21 @@ function connect(service, normalize) {
|
|
|
76
76
|
const focusedValue = context.get("focusedValue");
|
|
77
77
|
const loadingStatus = context.get("loadingStatus");
|
|
78
78
|
const renamingValue = context.get("renamingValue");
|
|
79
|
+
const skip = ({ indexPath }) => {
|
|
80
|
+
return collection$1.getValuePath(indexPath).slice(0, -1).some((value) => !expandedValue.includes(value));
|
|
81
|
+
};
|
|
82
|
+
const firstNode = collection$1.getFirstNode(void 0, { skip });
|
|
83
|
+
const firstNodeValue = firstNode ? collection$1.getNodeValue(firstNode) : null;
|
|
79
84
|
function getNodeState(props$1) {
|
|
80
85
|
const { node, indexPath } = props$1;
|
|
81
86
|
const value = collection$1.getNodeValue(node);
|
|
82
|
-
const firstNode = collection$1.getFirstNode();
|
|
83
|
-
const firstNodeValue = firstNode ? collection$1.getNodeValue(firstNode) : null;
|
|
84
87
|
return {
|
|
85
88
|
id: getNodeId(scope, value),
|
|
86
89
|
value,
|
|
87
90
|
indexPath,
|
|
88
91
|
valuePath: collection$1.getValuePath(indexPath),
|
|
89
92
|
disabled: Boolean(node.disabled),
|
|
90
|
-
focused: focusedValue == null ? firstNodeValue
|
|
93
|
+
focused: focusedValue == null ? firstNodeValue === value : focusedValue === value,
|
|
91
94
|
selected: selectedValue.includes(value),
|
|
92
95
|
expanded: expandedValue.includes(value),
|
|
93
96
|
loading: loadingStatus[value] === "loading",
|
|
@@ -971,7 +974,8 @@ const machine = createMachine({
|
|
|
971
974
|
focusTreeFirstNode(params) {
|
|
972
975
|
const { prop, scope } = params;
|
|
973
976
|
const collection$1 = prop("collection");
|
|
974
|
-
const firstNode = collection$1.getFirstNode();
|
|
977
|
+
const firstNode = collection$1.getFirstNode(void 0, { skip: skipFn(params) });
|
|
978
|
+
if (!firstNode) return;
|
|
975
979
|
const firstValue = collection$1.getNodeValue(firstNode);
|
|
976
980
|
if (scrollToNode(params, firstValue)) raf(() => focusNode(scope, firstValue));
|
|
977
981
|
else focusNode(scope, firstValue);
|
|
@@ -988,7 +992,8 @@ const machine = createMachine({
|
|
|
988
992
|
const { event, prop, scope } = params;
|
|
989
993
|
const collection$1 = prop("collection");
|
|
990
994
|
const branchNode = collection$1.findNode(event.id);
|
|
991
|
-
const firstNode = collection$1.getFirstNode(branchNode);
|
|
995
|
+
const firstNode = collection$1.getFirstNode(branchNode, { skip: skipFn(params) });
|
|
996
|
+
if (!firstNode) return;
|
|
992
997
|
const firstValue = collection$1.getNodeValue(firstNode);
|
|
993
998
|
if (scrollToNode(params, firstValue)) raf(() => focusNode(scope, firstValue));
|
|
994
999
|
else focusNode(scope, firstValue);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as CollectionOptions, t as CollectionItem } from "./types-Df8ZhdY-.mjs";
|
|
2
|
-
import { t as ListCollection } from "./list-collection-
|
|
2
|
+
import { t as ListCollection } from "./list-collection-swuCMCIS.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/collection/grid-collection.d.ts
|
|
5
5
|
interface GridCollectionOptions<T> extends CollectionOptions<T> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as CollectionOptions, t as CollectionItem } from "./types-CADkcKtr.cjs";
|
|
2
|
-
import { t as ListCollection } from "./list-collection-
|
|
2
|
+
import { t as ListCollection } from "./list-collection-BslnP0r-.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/collection/grid-collection.d.ts
|
|
5
5
|
interface GridCollectionOptions<T> extends CollectionOptions<T> {
|
|
@@ -27,7 +27,7 @@ declare class TreeCollection<T = TreeNode> {
|
|
|
27
27
|
getNodeDisabled: (node: T) => boolean;
|
|
28
28
|
stringify: (value: string) => string | null;
|
|
29
29
|
stringifyNode: (node: T) => string;
|
|
30
|
-
getFirstNode: (rootNode?: T) => T | undefined;
|
|
30
|
+
getFirstNode: (rootNode?: T, opts?: TreeSkipOptions<T>) => T | undefined;
|
|
31
31
|
getLastNode: (rootNode?: T, opts?: TreeSkipOptions<T>) => T | undefined;
|
|
32
32
|
at: (indexPath: IndexPath) => T | undefined;
|
|
33
33
|
findNode: (value: string, rootNode?: T) => T | undefined;
|
|
@@ -27,7 +27,7 @@ declare class TreeCollection<T = TreeNode> {
|
|
|
27
27
|
getNodeDisabled: (node: T) => boolean;
|
|
28
28
|
stringify: (value: string) => string | null;
|
|
29
29
|
stringifyNode: (node: T) => string;
|
|
30
|
-
getFirstNode: (rootNode?: T) => T | undefined;
|
|
30
|
+
getFirstNode: (rootNode?: T, opts?: TreeSkipOptions<T>) => T | undefined;
|
|
31
31
|
getLastNode: (rootNode?: T, opts?: TreeSkipOptions<T>) => T | undefined;
|
|
32
32
|
at: (indexPath: IndexPath) => T | undefined;
|
|
33
33
|
findNode: (value: string, rootNode?: T) => T | undefined;
|