@baleada/logic 0.21.0 → 0.21.3
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 +34 -312
- package/lib/index.d.ts +146 -278
- package/lib/index.js +35 -312
- package/package.json +5 -6
package/lib/index.js
CHANGED
|
@@ -183,239 +183,6 @@ class Pipeable {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
function toEvent(eventType, options) {
|
|
187
|
-
const implementation = toImplementation(eventType);
|
|
188
|
-
switch (implementation) {
|
|
189
|
-
case "keycombo": {
|
|
190
|
-
const combo = toCombo(eventType), modifiers = createSlice(0, combo.length - 1)(combo), { 0: name } = createSlice(combo.length - 1)(combo);
|
|
191
|
-
return new KeyboardEvent("keyDirection" in options ? `key${options.keyDirection}` : "keydown", {
|
|
192
|
-
...options.init || {},
|
|
193
|
-
key: toKey(name),
|
|
194
|
-
...createReduce((flags, alias) => {
|
|
195
|
-
flags[toModifierFlag(alias)] = true;
|
|
196
|
-
return flags;
|
|
197
|
-
}, {})(modifiers)
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
case "leftclickcombo":
|
|
201
|
-
case "rightclickcombo": {
|
|
202
|
-
const combo = toCombo(eventType), modifiers = createSlice(0, combo.length - 1)(combo), { 0: name } = createSlice(combo.length - 1)(combo);
|
|
203
|
-
return new MouseEvent(name === "rightclick" ? "contextmenu" : name, {
|
|
204
|
-
...options.init || {},
|
|
205
|
-
...createReduce((flags, alias) => {
|
|
206
|
-
flags[toModifierFlag(alias)] = true;
|
|
207
|
-
return flags;
|
|
208
|
-
}, {})(modifiers)
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
case "pointercombo": {
|
|
212
|
-
const combo = toCombo(eventType), modifiers = createSlice(0, combo.length - 1)(combo), { 0: name } = createSlice(combo.length - 1)(combo);
|
|
213
|
-
return new PointerEvent(name === "rightclick" ? "contextmenu" : name, {
|
|
214
|
-
...options.init || {},
|
|
215
|
-
...createReduce((flags, alias) => {
|
|
216
|
-
flags[toModifierFlag(alias)] = true;
|
|
217
|
-
return flags;
|
|
218
|
-
}, {})(modifiers)
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
case "documentevent":
|
|
222
|
-
case "event":
|
|
223
|
-
if (eventType === "abort")
|
|
224
|
-
return new UIEvent(eventType, options.init);
|
|
225
|
-
if (eventType === "animationcancel")
|
|
226
|
-
return new AnimationEvent(eventType, options.init);
|
|
227
|
-
if (eventType === "animationend")
|
|
228
|
-
return new AnimationEvent(eventType, options.init);
|
|
229
|
-
if (eventType === "animationiteration")
|
|
230
|
-
return new AnimationEvent(eventType, options.init);
|
|
231
|
-
if (eventType === "animationstart")
|
|
232
|
-
return new AnimationEvent(eventType, options.init);
|
|
233
|
-
if (eventType === "auxclick")
|
|
234
|
-
return new MouseEvent(eventType, options.init);
|
|
235
|
-
if (eventType === "beforeinput")
|
|
236
|
-
return new InputEvent(eventType, options.init);
|
|
237
|
-
if (eventType === "blur")
|
|
238
|
-
return new FocusEvent(eventType, options.init);
|
|
239
|
-
if (eventType === "canplay")
|
|
240
|
-
return new Event(eventType, options.init);
|
|
241
|
-
if (eventType === "canplaythrough")
|
|
242
|
-
return new Event(eventType, options.init);
|
|
243
|
-
if (eventType === "change")
|
|
244
|
-
return new Event(eventType, options.init);
|
|
245
|
-
if (eventType === "click")
|
|
246
|
-
return new MouseEvent(eventType, options.init);
|
|
247
|
-
if (eventType === "close")
|
|
248
|
-
return new Event(eventType, options.init);
|
|
249
|
-
if (eventType === "compositionend")
|
|
250
|
-
return new CompositionEvent(eventType, options.init);
|
|
251
|
-
if (eventType === "compositionstart")
|
|
252
|
-
return new CompositionEvent(eventType, options.init);
|
|
253
|
-
if (eventType === "compositionupdate")
|
|
254
|
-
return new CompositionEvent(eventType, options.init);
|
|
255
|
-
if (eventType === "contextmenu")
|
|
256
|
-
return new MouseEvent(eventType, options.init);
|
|
257
|
-
if (eventType === "cuechange")
|
|
258
|
-
return new Event(eventType, options.init);
|
|
259
|
-
if (eventType === "dblclick")
|
|
260
|
-
return new MouseEvent(eventType, options.init);
|
|
261
|
-
if (eventType === "drag")
|
|
262
|
-
return new DragEvent(eventType, options.init);
|
|
263
|
-
if (eventType === "dragend")
|
|
264
|
-
return new DragEvent(eventType, options.init);
|
|
265
|
-
if (eventType === "dragenter")
|
|
266
|
-
return new DragEvent(eventType, options.init);
|
|
267
|
-
if (eventType === "dragleave")
|
|
268
|
-
return new DragEvent(eventType, options.init);
|
|
269
|
-
if (eventType === "dragover")
|
|
270
|
-
return new DragEvent(eventType, options.init);
|
|
271
|
-
if (eventType === "dragstart")
|
|
272
|
-
return new DragEvent(eventType, options.init);
|
|
273
|
-
if (eventType === "drop")
|
|
274
|
-
return new DragEvent(eventType, options.init);
|
|
275
|
-
if (eventType === "durationchange")
|
|
276
|
-
return new Event(eventType, options.init);
|
|
277
|
-
if (eventType === "emptied")
|
|
278
|
-
return new Event(eventType, options.init);
|
|
279
|
-
if (eventType === "ended")
|
|
280
|
-
return new Event(eventType, options.init);
|
|
281
|
-
if (eventType === "error")
|
|
282
|
-
return new ErrorEvent(eventType, options.init);
|
|
283
|
-
if (eventType === "focus")
|
|
284
|
-
return new FocusEvent(eventType, options.init);
|
|
285
|
-
if (eventType === "focusin")
|
|
286
|
-
return new FocusEvent(eventType, options.init);
|
|
287
|
-
if (eventType === "focusout")
|
|
288
|
-
return new FocusEvent(eventType, options.init);
|
|
289
|
-
if (eventType === "gotpointercapture")
|
|
290
|
-
return new PointerEvent(eventType, options.init);
|
|
291
|
-
if (eventType === "input")
|
|
292
|
-
return new Event(eventType, options.init);
|
|
293
|
-
if (eventType === "invalid")
|
|
294
|
-
return new Event(eventType, options.init);
|
|
295
|
-
if (eventType === "keydown")
|
|
296
|
-
return new KeyboardEvent(eventType, options.init);
|
|
297
|
-
if (eventType === "keypress")
|
|
298
|
-
return new KeyboardEvent(eventType, options.init);
|
|
299
|
-
if (eventType === "keyup")
|
|
300
|
-
return new KeyboardEvent(eventType, options.init);
|
|
301
|
-
if (eventType === "load")
|
|
302
|
-
return new Event(eventType, options.init);
|
|
303
|
-
if (eventType === "loadeddata")
|
|
304
|
-
return new Event(eventType, options.init);
|
|
305
|
-
if (eventType === "loadedmetadata")
|
|
306
|
-
return new Event(eventType, options.init);
|
|
307
|
-
if (eventType === "loadstart")
|
|
308
|
-
return new Event(eventType, options.init);
|
|
309
|
-
if (eventType === "lostpointercapture")
|
|
310
|
-
return new PointerEvent(eventType, options.init);
|
|
311
|
-
if (eventType === "mousedown")
|
|
312
|
-
return new MouseEvent(eventType, options.init);
|
|
313
|
-
if (eventType === "mouseenter")
|
|
314
|
-
return new MouseEvent(eventType, options.init);
|
|
315
|
-
if (eventType === "mouseleave")
|
|
316
|
-
return new MouseEvent(eventType, options.init);
|
|
317
|
-
if (eventType === "mousemove")
|
|
318
|
-
return new MouseEvent(eventType, options.init);
|
|
319
|
-
if (eventType === "mouseout")
|
|
320
|
-
return new MouseEvent(eventType, options.init);
|
|
321
|
-
if (eventType === "mouseover")
|
|
322
|
-
return new MouseEvent(eventType, options.init);
|
|
323
|
-
if (eventType === "mouseup")
|
|
324
|
-
return new MouseEvent(eventType, options.init);
|
|
325
|
-
if (eventType === "pause")
|
|
326
|
-
return new Event(eventType, options.init);
|
|
327
|
-
if (eventType === "play")
|
|
328
|
-
return new Event(eventType, options.init);
|
|
329
|
-
if (eventType === "playing")
|
|
330
|
-
return new Event(eventType, options.init);
|
|
331
|
-
if (eventType === "pointercancel")
|
|
332
|
-
return new PointerEvent(eventType, options.init);
|
|
333
|
-
if (eventType === "pointerdown")
|
|
334
|
-
return new PointerEvent(eventType, options.init);
|
|
335
|
-
if (eventType === "pointerenter")
|
|
336
|
-
return new PointerEvent(eventType, options.init);
|
|
337
|
-
if (eventType === "pointerleave")
|
|
338
|
-
return new PointerEvent(eventType, options.init);
|
|
339
|
-
if (eventType === "pointermove")
|
|
340
|
-
return new PointerEvent(eventType, options.init);
|
|
341
|
-
if (eventType === "pointerout")
|
|
342
|
-
return new PointerEvent(eventType, options.init);
|
|
343
|
-
if (eventType === "pointerover")
|
|
344
|
-
return new PointerEvent(eventType, options.init);
|
|
345
|
-
if (eventType === "pointerup")
|
|
346
|
-
return new PointerEvent(eventType, options.init);
|
|
347
|
-
if (eventType === "progress")
|
|
348
|
-
return new ProgressEvent(eventType, options.init);
|
|
349
|
-
if (eventType === "ratechange")
|
|
350
|
-
return new Event(eventType, options.init);
|
|
351
|
-
if (eventType === "reset")
|
|
352
|
-
return new Event(eventType, options.init);
|
|
353
|
-
if (eventType === "scroll")
|
|
354
|
-
return new Event(eventType, options.init);
|
|
355
|
-
if (eventType === "securitypolicyviolation")
|
|
356
|
-
return new SecurityPolicyViolationEvent(eventType, options.init);
|
|
357
|
-
if (eventType === "seeked")
|
|
358
|
-
return new Event(eventType, options.init);
|
|
359
|
-
if (eventType === "seeking")
|
|
360
|
-
return new Event(eventType, options.init);
|
|
361
|
-
if (eventType === "select")
|
|
362
|
-
return new Event(eventType, options.init);
|
|
363
|
-
if (eventType === "selectionchange")
|
|
364
|
-
return new Event(eventType, options.init);
|
|
365
|
-
if (eventType === "selectstart")
|
|
366
|
-
return new Event(eventType, options.init);
|
|
367
|
-
if (eventType === "stalled")
|
|
368
|
-
return new Event(eventType, options.init);
|
|
369
|
-
if (eventType === "submit")
|
|
370
|
-
return new Event(eventType, options.init);
|
|
371
|
-
if (eventType === "suspend")
|
|
372
|
-
return new Event(eventType, options.init);
|
|
373
|
-
if (eventType === "timeupdate")
|
|
374
|
-
return new Event(eventType, options.init);
|
|
375
|
-
if (eventType === "toggle")
|
|
376
|
-
return new Event(eventType, options.init);
|
|
377
|
-
if (eventType === "touchcancel")
|
|
378
|
-
return new TouchEvent(eventType, options.init);
|
|
379
|
-
if (eventType === "touchend")
|
|
380
|
-
return new TouchEvent(eventType, options.init);
|
|
381
|
-
if (eventType === "touchmove")
|
|
382
|
-
return new TouchEvent(eventType, options.init);
|
|
383
|
-
if (eventType === "touchstart")
|
|
384
|
-
return new TouchEvent(eventType, options.init);
|
|
385
|
-
if (eventType === "transitioncancel")
|
|
386
|
-
return new TransitionEvent(eventType, options.init);
|
|
387
|
-
if (eventType === "transitionend")
|
|
388
|
-
return new TransitionEvent(eventType, options.init);
|
|
389
|
-
if (eventType === "transitionrun")
|
|
390
|
-
return new TransitionEvent(eventType, options.init);
|
|
391
|
-
if (eventType === "transitionstart")
|
|
392
|
-
return new TransitionEvent(eventType, options.init);
|
|
393
|
-
if (eventType === "volumechange")
|
|
394
|
-
return new Event(eventType, options.init);
|
|
395
|
-
if (eventType === "waiting")
|
|
396
|
-
return new Event(eventType, options.init);
|
|
397
|
-
if (eventType === "wheel")
|
|
398
|
-
return new WheelEvent(eventType, options.init);
|
|
399
|
-
if (eventType === "copy")
|
|
400
|
-
return new ClipboardEvent(eventType, options.init);
|
|
401
|
-
if (eventType === "cut")
|
|
402
|
-
return new ClipboardEvent(eventType, options.init);
|
|
403
|
-
if (eventType === "paste")
|
|
404
|
-
return new ClipboardEvent(eventType, options.init);
|
|
405
|
-
if (eventType === "fullscreenchange")
|
|
406
|
-
return new Event(eventType, options.init);
|
|
407
|
-
if (eventType === "fullscreenerror")
|
|
408
|
-
return new Event(eventType, options.init);
|
|
409
|
-
if (eventType === "pointerlockchange")
|
|
410
|
-
return new Event(eventType, options.init);
|
|
411
|
-
if (eventType === "pointerlockerror")
|
|
412
|
-
return new Event(eventType, options.init);
|
|
413
|
-
if (eventType === "readystatechange")
|
|
414
|
-
return new Event(eventType, options.init);
|
|
415
|
-
if (eventType === "visibilitychange")
|
|
416
|
-
return new Event(eventType, options.init);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
186
|
function toKey(name) {
|
|
420
187
|
return name in keysByName ? keysByName[name] : name;
|
|
421
188
|
}
|
|
@@ -513,20 +280,6 @@ const modifiersByAlias = {
|
|
|
513
280
|
opt: "alt",
|
|
514
281
|
option: "alt"
|
|
515
282
|
};
|
|
516
|
-
function toModifierFlag(modifierOrAlias) {
|
|
517
|
-
return flagsByModifierOrAlias[modifierOrAlias];
|
|
518
|
-
}
|
|
519
|
-
const flagsByModifierOrAlias = {
|
|
520
|
-
shift: "shiftKey",
|
|
521
|
-
cmd: "metaKey",
|
|
522
|
-
command: "metaKey",
|
|
523
|
-
meta: "metaKey",
|
|
524
|
-
ctrl: "ctrlKey",
|
|
525
|
-
control: "ctrlKey",
|
|
526
|
-
alt: "altKey",
|
|
527
|
-
opt: "altKey",
|
|
528
|
-
option: "altKey"
|
|
529
|
-
};
|
|
530
283
|
function createExceptAndOnlyEffect(effect, options) {
|
|
531
284
|
const { except = [], only = [] } = options;
|
|
532
285
|
return (event) => {
|
|
@@ -2247,10 +2000,10 @@ class Copyable {
|
|
|
2247
2000
|
}
|
|
2248
2001
|
computedResponse;
|
|
2249
2002
|
computedError;
|
|
2250
|
-
async copy(options = {
|
|
2003
|
+
async copy(options = { kind: "clipboard" }) {
|
|
2251
2004
|
this.copying();
|
|
2252
|
-
const {
|
|
2253
|
-
switch (
|
|
2005
|
+
const { kind } = options;
|
|
2006
|
+
switch (kind) {
|
|
2254
2007
|
case "clipboard":
|
|
2255
2008
|
try {
|
|
2256
2009
|
this.computedResponse = await navigator.clipboard.writeText(this.string);
|
|
@@ -2438,44 +2191,6 @@ class Delayable {
|
|
|
2438
2191
|
}
|
|
2439
2192
|
}
|
|
2440
2193
|
|
|
2441
|
-
class Dispatchable {
|
|
2442
|
-
constructor(type, options = {}) {
|
|
2443
|
-
this.setType(type);
|
|
2444
|
-
this.ready();
|
|
2445
|
-
}
|
|
2446
|
-
computedStatus;
|
|
2447
|
-
ready() {
|
|
2448
|
-
this.computedStatus = "ready";
|
|
2449
|
-
}
|
|
2450
|
-
get type() {
|
|
2451
|
-
return this.computedType;
|
|
2452
|
-
}
|
|
2453
|
-
set type(type) {
|
|
2454
|
-
this.setType(type);
|
|
2455
|
-
}
|
|
2456
|
-
get cancelled() {
|
|
2457
|
-
return this.computedCancelled;
|
|
2458
|
-
}
|
|
2459
|
-
get status() {
|
|
2460
|
-
return this.computedStatus;
|
|
2461
|
-
}
|
|
2462
|
-
computedType;
|
|
2463
|
-
setType(type) {
|
|
2464
|
-
this.computedType = type;
|
|
2465
|
-
return this;
|
|
2466
|
-
}
|
|
2467
|
-
computedCancelled;
|
|
2468
|
-
dispatch(options = {}) {
|
|
2469
|
-
const { target = window, ...rest } = options, event = toEvent(this.type, rest);
|
|
2470
|
-
this.computedCancelled = !target.dispatchEvent(event);
|
|
2471
|
-
this.dispatched();
|
|
2472
|
-
return this;
|
|
2473
|
-
}
|
|
2474
|
-
dispatched() {
|
|
2475
|
-
this.computedStatus = "dispatched";
|
|
2476
|
-
}
|
|
2477
|
-
}
|
|
2478
|
-
|
|
2479
2194
|
const defaultOptions$3 = {
|
|
2480
2195
|
toD: (stroke) => stroke.length === 0 ? "" : toD(stroke)
|
|
2481
2196
|
};
|
|
@@ -2978,6 +2693,10 @@ class Navigateable {
|
|
|
2978
2693
|
const defaultOptions$1 = {
|
|
2979
2694
|
initialPicks: []
|
|
2980
2695
|
};
|
|
2696
|
+
const defaultPickOptions = {
|
|
2697
|
+
replace: "none",
|
|
2698
|
+
allowsDuplicates: false
|
|
2699
|
+
};
|
|
2981
2700
|
class Pickable {
|
|
2982
2701
|
constructor(array, options = {}) {
|
|
2983
2702
|
this.setArray(array);
|
|
@@ -3023,8 +2742,9 @@ class Pickable {
|
|
|
3023
2742
|
return this.toItems(this.picks);
|
|
3024
2743
|
}
|
|
3025
2744
|
toItems = createMap((index) => this.array[index]);
|
|
2745
|
+
computedMultiple;
|
|
3026
2746
|
get multiple() {
|
|
3027
|
-
return this.
|
|
2747
|
+
return this.computedMultiple;
|
|
3028
2748
|
}
|
|
3029
2749
|
toPossiblePicks;
|
|
3030
2750
|
setArray(array) {
|
|
@@ -3036,59 +2756,62 @@ class Pickable {
|
|
|
3036
2756
|
return this.pick(indexOrIndices);
|
|
3037
2757
|
}
|
|
3038
2758
|
pick(indexOrIndices, options = {}) {
|
|
3039
|
-
const { replace
|
|
2759
|
+
const { replace, allowsDuplicates } = { ...defaultPickOptions, ...options };
|
|
3040
2760
|
this.computedPicks = new Pipeable(indexOrIndices).pipe(ensureIndices, this.toPossiblePicks, (possiblePicks) => {
|
|
3041
2761
|
if (replace === "all") {
|
|
3042
|
-
return toUnique(possiblePicks);
|
|
2762
|
+
return allowsDuplicates ? possiblePicks : toUnique(possiblePicks);
|
|
3043
2763
|
}
|
|
3044
|
-
const
|
|
2764
|
+
const maybeWithoutDuplicates = allowsDuplicates ? possiblePicks : createFilter((possiblePick) => typeof find((pick) => pick === possiblePick)(this.picks || []) !== "number")(possiblePicks);
|
|
3045
2765
|
switch (replace) {
|
|
3046
2766
|
case "none":
|
|
3047
|
-
return createConcat(this.picks || [],
|
|
2767
|
+
return createConcat(this.picks || [], maybeWithoutDuplicates)([]);
|
|
3048
2768
|
case "fifo":
|
|
3049
|
-
if (
|
|
2769
|
+
if (maybeWithoutDuplicates.length === 0) {
|
|
3050
2770
|
return this.picks;
|
|
3051
2771
|
}
|
|
3052
|
-
if (
|
|
3053
|
-
return
|
|
2772
|
+
if (maybeWithoutDuplicates.length === this.picks.length) {
|
|
2773
|
+
return maybeWithoutDuplicates;
|
|
3054
2774
|
}
|
|
3055
|
-
if (
|
|
3056
|
-
return createSlice(
|
|
2775
|
+
if (maybeWithoutDuplicates.length > this.picks.length) {
|
|
2776
|
+
return createSlice(maybeWithoutDuplicates.length - this.picks.length)(maybeWithoutDuplicates);
|
|
3057
2777
|
}
|
|
3058
|
-
return new Pipeable(this.picks).pipe(createSlice(
|
|
2778
|
+
return new Pipeable(this.picks).pipe(createSlice(maybeWithoutDuplicates.length), createConcat(maybeWithoutDuplicates));
|
|
3059
2779
|
case "lifo":
|
|
3060
|
-
if (
|
|
2780
|
+
if (maybeWithoutDuplicates.length === 0) {
|
|
3061
2781
|
return this.picks;
|
|
3062
2782
|
}
|
|
3063
|
-
if (
|
|
3064
|
-
return
|
|
2783
|
+
if (maybeWithoutDuplicates.length === this.picks.length) {
|
|
2784
|
+
return maybeWithoutDuplicates;
|
|
3065
2785
|
}
|
|
3066
|
-
if (
|
|
3067
|
-
return createSlice(0,
|
|
2786
|
+
if (maybeWithoutDuplicates.length > this.picks.length) {
|
|
2787
|
+
return createSlice(0, maybeWithoutDuplicates.length - this.picks.length + 1)(maybeWithoutDuplicates);
|
|
3068
2788
|
}
|
|
3069
|
-
return new Pipeable(this.picks).pipe(createSlice(0, this.picks.length -
|
|
2789
|
+
return new Pipeable(this.picks).pipe(createSlice(0, this.picks.length - maybeWithoutDuplicates.length), createConcat(maybeWithoutDuplicates));
|
|
3070
2790
|
}
|
|
3071
2791
|
});
|
|
3072
2792
|
this.computedFirst = Math.min(...this.picks);
|
|
3073
2793
|
this.computedLast = Math.max(...this.picks);
|
|
2794
|
+
this.computedMultiple = toUnique(this.picks).length > 1;
|
|
3074
2795
|
this.picked();
|
|
3075
2796
|
return this;
|
|
3076
2797
|
}
|
|
3077
2798
|
picked() {
|
|
3078
2799
|
this.computedStatus = "picked";
|
|
3079
2800
|
}
|
|
3080
|
-
omit(indexOrIndices) {
|
|
2801
|
+
omit(indexOrIndices, options = { reference: "array" }) {
|
|
3081
2802
|
if (isUndefined(indexOrIndices)) {
|
|
3082
2803
|
this.computedPicks = [];
|
|
3083
2804
|
this.computedFirst = void 0;
|
|
3084
2805
|
this.computedLast = void 0;
|
|
2806
|
+
this.computedMultiple = false;
|
|
3085
2807
|
this.omitted();
|
|
3086
2808
|
return this;
|
|
3087
2809
|
}
|
|
3088
2810
|
const omits = ensureIndices(indexOrIndices);
|
|
3089
|
-
this.computedPicks = createFilter((pick) => isUndefined(find((omit) => pick === omit)(omits)))(this.computedPicks);
|
|
2811
|
+
this.computedPicks = createFilter((pick, index) => options.reference === "array" ? isUndefined(find((omit) => pick === omit)(omits)) : isUndefined(find((omit) => index === omit)(omits)))(this.computedPicks);
|
|
3090
2812
|
this.computedFirst = Math.min(...this.picks);
|
|
3091
2813
|
this.computedLast = Math.max(...this.picks);
|
|
2814
|
+
this.computedMultiple = toUnique(this.picks).length > 1;
|
|
3092
2815
|
this.omitted();
|
|
3093
2816
|
return this;
|
|
3094
2817
|
}
|
|
@@ -3194,15 +2917,15 @@ class Searchable {
|
|
|
3194
2917
|
}
|
|
3195
2918
|
|
|
3196
2919
|
const defaultOptions = {
|
|
3197
|
-
|
|
2920
|
+
kind: "local",
|
|
3198
2921
|
statusKeySuffix: " status"
|
|
3199
2922
|
};
|
|
3200
2923
|
class Storeable {
|
|
3201
|
-
|
|
2924
|
+
kind;
|
|
3202
2925
|
statusKeySuffix;
|
|
3203
2926
|
constructor(key, options = {}) {
|
|
3204
2927
|
this.constructing();
|
|
3205
|
-
this.
|
|
2928
|
+
this.kind = options.kind ?? defaultOptions.kind;
|
|
3206
2929
|
this.statusKeySuffix = options.statusKeySuffix ?? defaultOptions.statusKeySuffix;
|
|
3207
2930
|
this.setKey(key);
|
|
3208
2931
|
this.ready();
|
|
@@ -3235,7 +2958,7 @@ class Storeable {
|
|
|
3235
2958
|
return this.computedStatus;
|
|
3236
2959
|
}
|
|
3237
2960
|
get storage() {
|
|
3238
|
-
switch (this.
|
|
2961
|
+
switch (this.kind) {
|
|
3239
2962
|
case "local":
|
|
3240
2963
|
return localStorage;
|
|
3241
2964
|
case "session":
|
|
@@ -3314,4 +3037,4 @@ class Storeable {
|
|
|
3314
3037
|
}
|
|
3315
3038
|
}
|
|
3316
3039
|
|
|
3317
|
-
export { Animateable, Completeable, Copyable, Delayable,
|
|
3040
|
+
export { Animateable, Completeable, Copyable, Delayable, 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, createSort, createSwap, createToEntries, 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baleada/logic",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.3",
|
|
4
4
|
"description": "UI logic for the Baleada toolkit",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -43,17 +43,16 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://baleada.netlify.com",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@baleada/animateable-utils": "^0.0.2",
|
|
47
46
|
"@baleada/prepare": "^0.5.20",
|
|
48
47
|
"@types/node": "^14.14.41",
|
|
49
48
|
"@vue/compiler-sfc": "^3.2.9",
|
|
50
49
|
"esbuild": "^0.9.7",
|
|
51
50
|
"esbuild-register": "^2.6.0",
|
|
52
|
-
"rollup": "^2.
|
|
51
|
+
"rollup": "^2.70.1",
|
|
53
52
|
"tailwindcss": "^2.1.1",
|
|
54
|
-
"typescript": "^4.
|
|
53
|
+
"typescript": "^4.6.2",
|
|
55
54
|
"uvu": "^0.5.1",
|
|
56
|
-
"vite": "^2.
|
|
55
|
+
"vite": "^2.8.6",
|
|
57
56
|
"vue": "^3.2.12",
|
|
58
57
|
"vue-router": "^4.0.3"
|
|
59
58
|
},
|
|
@@ -63,7 +62,7 @@
|
|
|
63
62
|
"@snigo.dev/color": "^0.0.6",
|
|
64
63
|
"@types/dompurify": "^2.2.3",
|
|
65
64
|
"@types/requestidlecallback": "^0.3.1",
|
|
66
|
-
"@types/resize-observer-browser": "^0.1.
|
|
65
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
67
66
|
"bezier-easing": "^2.1.0",
|
|
68
67
|
"dompurify": "^2.2.6",
|
|
69
68
|
"fast-fuzzy": "^1.11.1",
|