@baleada/logic 0.20.15 → 0.20.16
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/lib/index.cjs +87 -16
- package/lib/index.d.ts +28 -1
- package/lib/index.js +87 -17
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1099,7 +1099,7 @@ const observerAssertionsByType = {
|
|
|
1099
1099
|
resize: (observer) => observer instanceof ResizeObserver
|
|
1100
1100
|
};
|
|
1101
1101
|
|
|
1102
|
-
const defaultOptions$
|
|
1102
|
+
const defaultOptions$6 = {
|
|
1103
1103
|
duration: 0,
|
|
1104
1104
|
timing: [
|
|
1105
1105
|
0,
|
|
@@ -1112,10 +1112,10 @@ const defaultOptions$5 = {
|
|
|
1112
1112
|
};
|
|
1113
1113
|
class Animateable {
|
|
1114
1114
|
constructor(keyframes, options = {}) {
|
|
1115
|
-
this.initialDuration = options?.duration || defaultOptions$
|
|
1116
|
-
this.controlPoints = fromTimingToControlPoints(options?.timing || defaultOptions$
|
|
1117
|
-
this.iterationLimit = options?.iterations || defaultOptions$
|
|
1118
|
-
this.alternates = options?.alternates || defaultOptions$
|
|
1115
|
+
this.initialDuration = options?.duration || defaultOptions$6.duration;
|
|
1116
|
+
this.controlPoints = fromTimingToControlPoints(options?.timing || defaultOptions$6.timing);
|
|
1117
|
+
this.iterationLimit = options?.iterations || defaultOptions$6.iterations;
|
|
1118
|
+
this.alternates = options?.alternates || defaultOptions$6.alternates;
|
|
1119
1119
|
this.reversedControlPoints = fromControlPointsToReversedControlPoints(this.controlPoints);
|
|
1120
1120
|
this.toAnimationProgress = createToAnimationProgress(this.controlPoints);
|
|
1121
1121
|
this.reversedToAnimationProgress = createToAnimationProgress(this.reversedControlPoints);
|
|
@@ -1961,7 +1961,7 @@ const easingsNetInOutBack = [
|
|
|
1961
1961
|
1.6
|
|
1962
1962
|
];
|
|
1963
1963
|
|
|
1964
|
-
const defaultOptions$
|
|
1964
|
+
const defaultOptions$5 = {
|
|
1965
1965
|
segment: {
|
|
1966
1966
|
from: "start",
|
|
1967
1967
|
to: "end"
|
|
@@ -1974,9 +1974,9 @@ const defaultCompleteOptions = {
|
|
|
1974
1974
|
class Completeable {
|
|
1975
1975
|
constructor(string, options = {}) {
|
|
1976
1976
|
this.constructing();
|
|
1977
|
-
this.segmentFrom = options?.segment?.from || defaultOptions$
|
|
1978
|
-
this.segmentTo = options?.segment?.to || defaultOptions$
|
|
1979
|
-
this.divider = options?.divider || defaultOptions$
|
|
1977
|
+
this.segmentFrom = options?.segment?.from || defaultOptions$5.segment.from;
|
|
1978
|
+
this.segmentTo = options?.segment?.to || defaultOptions$5.segment.to;
|
|
1979
|
+
this.divider = options?.divider || defaultOptions$5.divider;
|
|
1980
1980
|
this.computedDividerIndices = { before: 0, after: 0 };
|
|
1981
1981
|
this.setString(string);
|
|
1982
1982
|
this.setSelection(options?.initialSelection || { start: string.length, end: string.length, direction: "none" });
|
|
@@ -2206,7 +2206,7 @@ class Copyable {
|
|
|
2206
2206
|
}
|
|
2207
2207
|
}
|
|
2208
2208
|
|
|
2209
|
-
const defaultOptions$
|
|
2209
|
+
const defaultOptions$4 = {
|
|
2210
2210
|
delay: 0,
|
|
2211
2211
|
executions: 1
|
|
2212
2212
|
};
|
|
@@ -2216,8 +2216,8 @@ class Delayable {
|
|
|
2216
2216
|
{ progress: 0, properties: { progress: 0 } },
|
|
2217
2217
|
{ progress: 1, properties: { progress: 1 } }
|
|
2218
2218
|
], {
|
|
2219
|
-
duration: options?.delay ?? defaultOptions$
|
|
2220
|
-
iterations: options?.executions ?? defaultOptions$
|
|
2219
|
+
duration: options?.delay ?? defaultOptions$4.delay,
|
|
2220
|
+
iterations: options?.executions ?? defaultOptions$4.executions
|
|
2221
2221
|
});
|
|
2222
2222
|
this.setEffect(effect);
|
|
2223
2223
|
this.ready();
|
|
@@ -2381,12 +2381,12 @@ class Dispatchable {
|
|
|
2381
2381
|
}
|
|
2382
2382
|
}
|
|
2383
2383
|
|
|
2384
|
-
const defaultOptions$
|
|
2384
|
+
const defaultOptions$3 = {
|
|
2385
2385
|
toD: (stroke) => stroke.length === 0 ? "" : toD(stroke)
|
|
2386
2386
|
};
|
|
2387
2387
|
class Drawable {
|
|
2388
2388
|
constructor(stroke, options = {}) {
|
|
2389
|
-
this.toD = options?.toD || defaultOptions$
|
|
2389
|
+
this.toD = options?.toD || defaultOptions$3.toD;
|
|
2390
2390
|
this.setStroke(stroke);
|
|
2391
2391
|
this.ready();
|
|
2392
2392
|
}
|
|
@@ -2713,7 +2713,7 @@ class Grantable {
|
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
2715
|
|
|
2716
|
-
const defaultOptions$
|
|
2716
|
+
const defaultOptions$2 = {
|
|
2717
2717
|
initialLocation: 0
|
|
2718
2718
|
};
|
|
2719
2719
|
const defaultNextAndPreviousOptions = {
|
|
@@ -2723,7 +2723,7 @@ const defaultNextAndPreviousOptions = {
|
|
|
2723
2723
|
class Navigateable {
|
|
2724
2724
|
constructor(array, options = {}) {
|
|
2725
2725
|
this.setArray(array);
|
|
2726
|
-
this.navigate(options?.initialLocation ?? defaultOptions$
|
|
2726
|
+
this.navigate(options?.initialLocation ?? defaultOptions$2.initialLocation);
|
|
2727
2727
|
this.ready();
|
|
2728
2728
|
}
|
|
2729
2729
|
ready() {
|
|
@@ -2825,6 +2825,76 @@ class Navigateable {
|
|
|
2825
2825
|
}
|
|
2826
2826
|
}
|
|
2827
2827
|
|
|
2828
|
+
const defaultOptions$1 = {
|
|
2829
|
+
initialPicks: []
|
|
2830
|
+
};
|
|
2831
|
+
class Pickable {
|
|
2832
|
+
constructor(array, options = {}) {
|
|
2833
|
+
this.toItems = createMap((index) => this.array[index]);
|
|
2834
|
+
this.setArray(array);
|
|
2835
|
+
this.pick(options.initialPicks ?? defaultOptions$1.initialPicks);
|
|
2836
|
+
this.ready();
|
|
2837
|
+
}
|
|
2838
|
+
ready() {
|
|
2839
|
+
this.computedStatus = "ready";
|
|
2840
|
+
}
|
|
2841
|
+
get array() {
|
|
2842
|
+
return this.computedArray;
|
|
2843
|
+
}
|
|
2844
|
+
set array(array) {
|
|
2845
|
+
this.setArray(array);
|
|
2846
|
+
}
|
|
2847
|
+
get picks() {
|
|
2848
|
+
return this.computedPicks;
|
|
2849
|
+
}
|
|
2850
|
+
set picks(indices) {
|
|
2851
|
+
this.pick(indices);
|
|
2852
|
+
}
|
|
2853
|
+
get status() {
|
|
2854
|
+
return this.computedStatus;
|
|
2855
|
+
}
|
|
2856
|
+
get items() {
|
|
2857
|
+
return this.toItems(this.picks);
|
|
2858
|
+
}
|
|
2859
|
+
get multiple() {
|
|
2860
|
+
return this.picks.length > 1;
|
|
2861
|
+
}
|
|
2862
|
+
setArray(array) {
|
|
2863
|
+
this.computedArray = array;
|
|
2864
|
+
this.toPossiblePicks = createFilter((index) => index >= 0 && index < array.length);
|
|
2865
|
+
return this;
|
|
2866
|
+
}
|
|
2867
|
+
setPicks(indexOrIndices) {
|
|
2868
|
+
return this.pick(indexOrIndices);
|
|
2869
|
+
}
|
|
2870
|
+
pick(indexOrIndices) {
|
|
2871
|
+
const newPicks = new Pipeable(indexOrIndices).pipe(ensureIndices, this.toPossiblePicks);
|
|
2872
|
+
this.computedPicks = createConcat(newPicks)(this.computedPicks || []);
|
|
2873
|
+
this.picked();
|
|
2874
|
+
return this;
|
|
2875
|
+
}
|
|
2876
|
+
picked() {
|
|
2877
|
+
this.computedStatus = "picked";
|
|
2878
|
+
}
|
|
2879
|
+
omit(indexOrIndices) {
|
|
2880
|
+
if (isUndefined(indexOrIndices)) {
|
|
2881
|
+
this.computedPicks = [];
|
|
2882
|
+
this.omitted();
|
|
2883
|
+
return this;
|
|
2884
|
+
}
|
|
2885
|
+
const omits = ensureIndices(indexOrIndices), filter = createFilter((pick) => !lazyCollections.find((omit) => pick === omit)(omits));
|
|
2886
|
+
this.computedPicks = filter(this.computedPicks);
|
|
2887
|
+
this.omitted();
|
|
2888
|
+
return this;
|
|
2889
|
+
}
|
|
2890
|
+
omitted() {
|
|
2891
|
+
this.computedStatus = "omitted";
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
function ensureIndices(indexOrIndices) {
|
|
2895
|
+
return Array.isArray(indexOrIndices) ? indexOrIndices : [indexOrIndices];
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2828
2898
|
class Sanitizeable {
|
|
2829
2899
|
constructor(html, options) {
|
|
2830
2900
|
this.computedHtml = html;
|
|
@@ -3033,6 +3103,7 @@ exports.Fullscreenable = Fullscreenable;
|
|
|
3033
3103
|
exports.Grantable = Grantable;
|
|
3034
3104
|
exports.Listenable = Listenable;
|
|
3035
3105
|
exports.Navigateable = Navigateable;
|
|
3106
|
+
exports.Pickable = Pickable;
|
|
3036
3107
|
exports.Pipeable = Pipeable;
|
|
3037
3108
|
exports.Recognizeable = Recognizeable;
|
|
3038
3109
|
exports.Resolveable = Resolveable;
|
package/lib/index.d.ts
CHANGED
|
@@ -731,6 +731,33 @@ declare class Navigateable<Item> {
|
|
|
731
731
|
last(): this;
|
|
732
732
|
}
|
|
733
733
|
|
|
734
|
+
declare type PickableOptions = {
|
|
735
|
+
initialPicks?: number | number[];
|
|
736
|
+
};
|
|
737
|
+
declare type PickableStatus = 'ready' | 'picked' | 'omitted';
|
|
738
|
+
declare class Pickable<Item> {
|
|
739
|
+
constructor(array: Item[], options?: PickableOptions);
|
|
740
|
+
private computedStatus;
|
|
741
|
+
private ready;
|
|
742
|
+
private computedArray;
|
|
743
|
+
get array(): Item[];
|
|
744
|
+
set array(array: Item[]);
|
|
745
|
+
private computedPicks;
|
|
746
|
+
get picks(): number[];
|
|
747
|
+
set picks(indices: number[]);
|
|
748
|
+
get status(): PickableStatus;
|
|
749
|
+
get items(): Item[];
|
|
750
|
+
private toItems;
|
|
751
|
+
get multiple(): boolean;
|
|
752
|
+
private toPossiblePicks;
|
|
753
|
+
setArray(array: Item[]): this;
|
|
754
|
+
setPicks(indexOrIndices: number | number[]): this;
|
|
755
|
+
pick(indexOrIndices: number | number[]): this;
|
|
756
|
+
private picked;
|
|
757
|
+
omit(indexOrIndices?: number | number[]): this;
|
|
758
|
+
private omitted;
|
|
759
|
+
}
|
|
760
|
+
|
|
734
761
|
declare type SanitizeableOptions = Config;
|
|
735
762
|
declare type SanitizeableStatus = 'ready' | 'sanitized';
|
|
736
763
|
declare class Sanitizeable {
|
|
@@ -868,4 +895,4 @@ declare class Pipeable {
|
|
|
868
895
|
pipeAsync(...fns: ((...args: any[]) => Promise<any>)[]): Promise<any>;
|
|
869
896
|
}
|
|
870
897
|
|
|
871
|
-
export { AnimateFrame, AnimateFrameEffect, AnimateOptions, Animateable, AnimateableKeyframe, AnimateableOptions, AnimateableStatus, ArrayFunction, ArrayFunctionAsync, CompleteOptions, Completeable, CompleteableOptions, CompleteableStatus, Copyable, CopyableOptions, CopyableStatus, Delayable, DelayableEffect, DelayableOptions, DelayableStatus, DispatchOptions, Dispatchable, DispatchableOptions, DispatchableStatus, Drawable, DrawableOptions, DrawableState, DrawableStatus, FetchOptions, FetchOptionsApi, Fetchable, FetchableOptions, FetchableStatus, Fullscreenable, FullscreenableGetElement, FullscreenableOptions, FullscreenableStatus, Grantable, GrantableOptions, GrantableStatus, ListenEffect, ListenEffectParam, ListenOptions, Listenable, ListenableActive, ListenableClickcombo, ListenableKeycombo, ListenableKeycomboItem, ListenableOptions, ListenablePointercombo, ListenableStatus, ListenableSupportedEventType, ListenableSupportedType, MapFunction, Navigateable, NavigateableOptions, NavigateableStatus, NumberFunction, Pipeable, RecognizeOptions, Recognizeable, RecognizeableEffectApi, RecognizeableOptions, RecognizeableStatus, Resolveable, ResolveableGetPromise, ResolveableOptions, ResolveableStatus, Sanitizeable, SanitizeableOptions, SanitizeableStatus, Searchable, SearchableOptions, SearchableStatus, Storeable, StoreableOptions, StoreableStatus, StringFunction, createClamp, createClip, createConcat, createDelete, createDetermine, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSwap, createUnique, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, ensureKeycombo, eventMatchesKeycombo, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|
|
898
|
+
export { AnimateFrame, AnimateFrameEffect, AnimateOptions, Animateable, AnimateableKeyframe, AnimateableOptions, AnimateableStatus, ArrayFunction, ArrayFunctionAsync, CompleteOptions, Completeable, CompleteableOptions, CompleteableStatus, Copyable, CopyableOptions, CopyableStatus, Delayable, DelayableEffect, DelayableOptions, DelayableStatus, DispatchOptions, Dispatchable, DispatchableOptions, DispatchableStatus, Drawable, DrawableOptions, DrawableState, DrawableStatus, FetchOptions, FetchOptionsApi, Fetchable, FetchableOptions, FetchableStatus, Fullscreenable, FullscreenableGetElement, FullscreenableOptions, FullscreenableStatus, Grantable, GrantableOptions, GrantableStatus, ListenEffect, ListenEffectParam, ListenOptions, Listenable, ListenableActive, ListenableClickcombo, ListenableKeycombo, ListenableKeycomboItem, ListenableOptions, ListenablePointercombo, ListenableStatus, ListenableSupportedEventType, ListenableSupportedType, MapFunction, Navigateable, NavigateableOptions, NavigateableStatus, NumberFunction, Pickable, PickableOptions, PickableStatus, Pipeable, RecognizeOptions, Recognizeable, RecognizeableEffectApi, RecognizeableOptions, RecognizeableStatus, Resolveable, ResolveableGetPromise, ResolveableOptions, ResolveableStatus, Sanitizeable, SanitizeableOptions, SanitizeableStatus, Searchable, SearchableOptions, SearchableStatus, Storeable, StoreableOptions, StoreableStatus, StringFunction, createClamp, createClip, createConcat, createDelete, createDetermine, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSwap, createUnique, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, ensureKeycombo, eventMatchesKeycombo, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|
package/lib/index.js
CHANGED
|
@@ -1088,7 +1088,7 @@ const observerAssertionsByType = {
|
|
|
1088
1088
|
resize: (observer) => observer instanceof ResizeObserver
|
|
1089
1089
|
};
|
|
1090
1090
|
|
|
1091
|
-
const defaultOptions$
|
|
1091
|
+
const defaultOptions$6 = {
|
|
1092
1092
|
duration: 0,
|
|
1093
1093
|
timing: [
|
|
1094
1094
|
0,
|
|
@@ -1101,10 +1101,10 @@ const defaultOptions$5 = {
|
|
|
1101
1101
|
};
|
|
1102
1102
|
class Animateable {
|
|
1103
1103
|
constructor(keyframes, options = {}) {
|
|
1104
|
-
this.initialDuration = options?.duration || defaultOptions$
|
|
1105
|
-
this.controlPoints = fromTimingToControlPoints(options?.timing || defaultOptions$
|
|
1106
|
-
this.iterationLimit = options?.iterations || defaultOptions$
|
|
1107
|
-
this.alternates = options?.alternates || defaultOptions$
|
|
1104
|
+
this.initialDuration = options?.duration || defaultOptions$6.duration;
|
|
1105
|
+
this.controlPoints = fromTimingToControlPoints(options?.timing || defaultOptions$6.timing);
|
|
1106
|
+
this.iterationLimit = options?.iterations || defaultOptions$6.iterations;
|
|
1107
|
+
this.alternates = options?.alternates || defaultOptions$6.alternates;
|
|
1108
1108
|
this.reversedControlPoints = fromControlPointsToReversedControlPoints(this.controlPoints);
|
|
1109
1109
|
this.toAnimationProgress = createToAnimationProgress(this.controlPoints);
|
|
1110
1110
|
this.reversedToAnimationProgress = createToAnimationProgress(this.reversedControlPoints);
|
|
@@ -1950,7 +1950,7 @@ const easingsNetInOutBack = [
|
|
|
1950
1950
|
1.6
|
|
1951
1951
|
];
|
|
1952
1952
|
|
|
1953
|
-
const defaultOptions$
|
|
1953
|
+
const defaultOptions$5 = {
|
|
1954
1954
|
segment: {
|
|
1955
1955
|
from: "start",
|
|
1956
1956
|
to: "end"
|
|
@@ -1963,9 +1963,9 @@ const defaultCompleteOptions = {
|
|
|
1963
1963
|
class Completeable {
|
|
1964
1964
|
constructor(string, options = {}) {
|
|
1965
1965
|
this.constructing();
|
|
1966
|
-
this.segmentFrom = options?.segment?.from || defaultOptions$
|
|
1967
|
-
this.segmentTo = options?.segment?.to || defaultOptions$
|
|
1968
|
-
this.divider = options?.divider || defaultOptions$
|
|
1966
|
+
this.segmentFrom = options?.segment?.from || defaultOptions$5.segment.from;
|
|
1967
|
+
this.segmentTo = options?.segment?.to || defaultOptions$5.segment.to;
|
|
1968
|
+
this.divider = options?.divider || defaultOptions$5.divider;
|
|
1969
1969
|
this.computedDividerIndices = { before: 0, after: 0 };
|
|
1970
1970
|
this.setString(string);
|
|
1971
1971
|
this.setSelection(options?.initialSelection || { start: string.length, end: string.length, direction: "none" });
|
|
@@ -2195,7 +2195,7 @@ class Copyable {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
}
|
|
2197
2197
|
|
|
2198
|
-
const defaultOptions$
|
|
2198
|
+
const defaultOptions$4 = {
|
|
2199
2199
|
delay: 0,
|
|
2200
2200
|
executions: 1
|
|
2201
2201
|
};
|
|
@@ -2205,8 +2205,8 @@ class Delayable {
|
|
|
2205
2205
|
{ progress: 0, properties: { progress: 0 } },
|
|
2206
2206
|
{ progress: 1, properties: { progress: 1 } }
|
|
2207
2207
|
], {
|
|
2208
|
-
duration: options?.delay ?? defaultOptions$
|
|
2209
|
-
iterations: options?.executions ?? defaultOptions$
|
|
2208
|
+
duration: options?.delay ?? defaultOptions$4.delay,
|
|
2209
|
+
iterations: options?.executions ?? defaultOptions$4.executions
|
|
2210
2210
|
});
|
|
2211
2211
|
this.setEffect(effect);
|
|
2212
2212
|
this.ready();
|
|
@@ -2370,12 +2370,12 @@ class Dispatchable {
|
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
2372
|
|
|
2373
|
-
const defaultOptions$
|
|
2373
|
+
const defaultOptions$3 = {
|
|
2374
2374
|
toD: (stroke) => stroke.length === 0 ? "" : toD(stroke)
|
|
2375
2375
|
};
|
|
2376
2376
|
class Drawable {
|
|
2377
2377
|
constructor(stroke, options = {}) {
|
|
2378
|
-
this.toD = options?.toD || defaultOptions$
|
|
2378
|
+
this.toD = options?.toD || defaultOptions$3.toD;
|
|
2379
2379
|
this.setStroke(stroke);
|
|
2380
2380
|
this.ready();
|
|
2381
2381
|
}
|
|
@@ -2702,7 +2702,7 @@ class Grantable {
|
|
|
2702
2702
|
}
|
|
2703
2703
|
}
|
|
2704
2704
|
|
|
2705
|
-
const defaultOptions$
|
|
2705
|
+
const defaultOptions$2 = {
|
|
2706
2706
|
initialLocation: 0
|
|
2707
2707
|
};
|
|
2708
2708
|
const defaultNextAndPreviousOptions = {
|
|
@@ -2712,7 +2712,7 @@ const defaultNextAndPreviousOptions = {
|
|
|
2712
2712
|
class Navigateable {
|
|
2713
2713
|
constructor(array, options = {}) {
|
|
2714
2714
|
this.setArray(array);
|
|
2715
|
-
this.navigate(options?.initialLocation ?? defaultOptions$
|
|
2715
|
+
this.navigate(options?.initialLocation ?? defaultOptions$2.initialLocation);
|
|
2716
2716
|
this.ready();
|
|
2717
2717
|
}
|
|
2718
2718
|
ready() {
|
|
@@ -2814,6 +2814,76 @@ class Navigateable {
|
|
|
2814
2814
|
}
|
|
2815
2815
|
}
|
|
2816
2816
|
|
|
2817
|
+
const defaultOptions$1 = {
|
|
2818
|
+
initialPicks: []
|
|
2819
|
+
};
|
|
2820
|
+
class Pickable {
|
|
2821
|
+
constructor(array, options = {}) {
|
|
2822
|
+
this.toItems = createMap((index) => this.array[index]);
|
|
2823
|
+
this.setArray(array);
|
|
2824
|
+
this.pick(options.initialPicks ?? defaultOptions$1.initialPicks);
|
|
2825
|
+
this.ready();
|
|
2826
|
+
}
|
|
2827
|
+
ready() {
|
|
2828
|
+
this.computedStatus = "ready";
|
|
2829
|
+
}
|
|
2830
|
+
get array() {
|
|
2831
|
+
return this.computedArray;
|
|
2832
|
+
}
|
|
2833
|
+
set array(array) {
|
|
2834
|
+
this.setArray(array);
|
|
2835
|
+
}
|
|
2836
|
+
get picks() {
|
|
2837
|
+
return this.computedPicks;
|
|
2838
|
+
}
|
|
2839
|
+
set picks(indices) {
|
|
2840
|
+
this.pick(indices);
|
|
2841
|
+
}
|
|
2842
|
+
get status() {
|
|
2843
|
+
return this.computedStatus;
|
|
2844
|
+
}
|
|
2845
|
+
get items() {
|
|
2846
|
+
return this.toItems(this.picks);
|
|
2847
|
+
}
|
|
2848
|
+
get multiple() {
|
|
2849
|
+
return this.picks.length > 1;
|
|
2850
|
+
}
|
|
2851
|
+
setArray(array) {
|
|
2852
|
+
this.computedArray = array;
|
|
2853
|
+
this.toPossiblePicks = createFilter((index) => index >= 0 && index < array.length);
|
|
2854
|
+
return this;
|
|
2855
|
+
}
|
|
2856
|
+
setPicks(indexOrIndices) {
|
|
2857
|
+
return this.pick(indexOrIndices);
|
|
2858
|
+
}
|
|
2859
|
+
pick(indexOrIndices) {
|
|
2860
|
+
const newPicks = new Pipeable(indexOrIndices).pipe(ensureIndices, this.toPossiblePicks);
|
|
2861
|
+
this.computedPicks = createConcat(newPicks)(this.computedPicks || []);
|
|
2862
|
+
this.picked();
|
|
2863
|
+
return this;
|
|
2864
|
+
}
|
|
2865
|
+
picked() {
|
|
2866
|
+
this.computedStatus = "picked";
|
|
2867
|
+
}
|
|
2868
|
+
omit(indexOrIndices) {
|
|
2869
|
+
if (isUndefined(indexOrIndices)) {
|
|
2870
|
+
this.computedPicks = [];
|
|
2871
|
+
this.omitted();
|
|
2872
|
+
return this;
|
|
2873
|
+
}
|
|
2874
|
+
const omits = ensureIndices(indexOrIndices), filter = createFilter((pick) => !find((omit) => pick === omit)(omits));
|
|
2875
|
+
this.computedPicks = filter(this.computedPicks);
|
|
2876
|
+
this.omitted();
|
|
2877
|
+
return this;
|
|
2878
|
+
}
|
|
2879
|
+
omitted() {
|
|
2880
|
+
this.computedStatus = "omitted";
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
function ensureIndices(indexOrIndices) {
|
|
2884
|
+
return Array.isArray(indexOrIndices) ? indexOrIndices : [indexOrIndices];
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2817
2887
|
class Sanitizeable {
|
|
2818
2888
|
constructor(html, options) {
|
|
2819
2889
|
this.computedHtml = html;
|
|
@@ -3011,4 +3081,4 @@ class Storeable {
|
|
|
3011
3081
|
}
|
|
3012
3082
|
}
|
|
3013
3083
|
|
|
3014
|
-
export { Animateable, Completeable, Copyable, Delayable, Dispatchable, Drawable, Fetchable, Fullscreenable, Grantable, Listenable, Navigateable, Pipeable, Recognizeable, Resolveable, Sanitizeable, Searchable, Storeable, createClamp, createClip, createConcat, createDelete, createDetermine, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSwap, createUnique, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, ensureKeycombo, eventMatchesKeycombo, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|
|
3084
|
+
export { Animateable, Completeable, Copyable, Delayable, Dispatchable, Drawable, Fetchable, Fullscreenable, Grantable, Listenable, Navigateable, Pickable, Pipeable, Recognizeable, Resolveable, Sanitizeable, Searchable, Storeable, createClamp, createClip, createConcat, createDelete, createDetermine, createFilter, createFilterAsync, createForEachAsync, createInsert, createMap, createMapAsync, createReduce, createReduceAsync, createRename, createReorder, createReplace, createReverse, createSlice, createSlug, createSwap, createUnique, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, ensureKeycombo, eventMatchesKeycombo, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|