@stonecrop/utilities 0.40.0 → 0.41.1

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.
@@ -3,6 +3,17 @@ import { ComponentPublicInstance } from 'vue';
3
3
  import { Ref } from 'vue';
4
4
  import { Temporal } from 'temporal-polyfill';
5
5
 
6
+ /**
7
+ * Orders two versions by SemVer 2.0.0 precedence: major, minor and patch as numbers, a prerelease
8
+ * before its release, and prerelease identifiers one by one. Build metadata does not count, so
9
+ * `1.4.0+a` and `1.4.0+b` compare equal. Text that is not a version comes after every version.
10
+ * @param a - The first version
11
+ * @param b - The second version
12
+ * @returns Negative when `a` comes first, positive when `b` does, zero when neither
13
+ * @public
14
+ */
15
+ export declare function compareSemver(a: string, b: string): number;
16
+
6
17
  /**
7
18
  * Default keypress handlers for keyboard navigation
8
19
  * @public
@@ -26,6 +37,23 @@ export declare function fromISODate(day: string): Temporal.PlainDate | undefined
26
37
  */
27
38
  export declare function install(_app: App): void;
28
39
 
40
+ /**
41
+ * Whether the text is a version under SemVer 2.0.0: `1.4.0`, `1.4.0-beta.2`, `1.4.0+build.5`. A `v`
42
+ * prefix, a missing part (`1.4`) and a leading zero (`01.4.0`) are not.
43
+ * @param text - The text to check
44
+ * @public
45
+ */
46
+ export declare function isSemver(text: string): boolean;
47
+
48
+ /**
49
+ * Whether typing more could still make the text a version: `1.`, `1.4.0-` and the empty text can,
50
+ * while `v1`, `01` and `1.4-beta` cannot. Every version passes, so a box that refuses any edit failing
51
+ * this one never stops someone typing a version.
52
+ * @param text - The text so far
53
+ * @public
54
+ */
55
+ export declare function isSemverPrefix(text: string): boolean;
56
+
29
57
  /**
30
58
  * Keyboard navigation options
31
59
  * @public
package/dist/utilities.js CHANGED
@@ -410,6 +410,91 @@ function fromISODate(day) {
410
410
  }
411
411
  }
412
412
  //#endregion
413
+ //#region src/semver.ts
414
+ var SEMVER = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
415
+ var NUMBER = /^(0|[1-9]\d*)$/;
416
+ var NUMBER_SO_FAR = /^(0|[1-9]\d*)?$/;
417
+ var PRERELEASE_IDENTIFIER = /^(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)$/;
418
+ var BUILD_IDENTIFIER = /^[0-9a-zA-Z-]+$/;
419
+ var IDENTIFIER_SO_FAR = /^[0-9a-zA-Z-]*$/;
420
+ /**
421
+ * Whether the text is a version under SemVer 2.0.0: `1.4.0`, `1.4.0-beta.2`, `1.4.0+build.5`. A `v`
422
+ * prefix, a missing part (`1.4`) and a leading zero (`01.4.0`) are not.
423
+ * @param text - The text to check
424
+ * @public
425
+ */
426
+ function isSemver(text) {
427
+ return SEMVER.test(text);
428
+ }
429
+ var splitOnce = (text, separator) => {
430
+ const index = text.indexOf(separator);
431
+ return index === -1 ? [text, void 0] : [text.slice(0, index), text.slice(index + 1)];
432
+ };
433
+ /** Whether each dot-separated part before the last matches `whole`, and the last matches `last`. */
434
+ var partsMatch = (text, whole, last) => {
435
+ const parts = text.split(".");
436
+ const typing = parts.pop() ?? "";
437
+ return parts.every((part) => whole.test(part)) && last.test(typing);
438
+ };
439
+ /**
440
+ * Whether typing more could still make the text a version: `1.`, `1.4.0-` and the empty text can,
441
+ * while `v1`, `01` and `1.4-beta` cannot. Every version passes, so a box that refuses any edit failing
442
+ * this one never stops someone typing a version.
443
+ * @param text - The text so far
444
+ * @public
445
+ */
446
+ function isSemverPrefix(text) {
447
+ const [head, build] = splitOnce(text, "+");
448
+ const [core, prerelease] = splitOnce(head, "-");
449
+ const coreDone = prerelease !== void 0 || build !== void 0;
450
+ const numbers = core.split(".").length;
451
+ if (numbers > 3 || coreDone && numbers < 3) return false;
452
+ if (!partsMatch(core, NUMBER, coreDone ? NUMBER : NUMBER_SO_FAR)) return false;
453
+ if (prerelease !== void 0) {
454
+ if (!partsMatch(prerelease, PRERELEASE_IDENTIFIER, build === void 0 ? IDENTIFIER_SO_FAR : PRERELEASE_IDENTIFIER)) return false;
455
+ }
456
+ return build === void 0 || partsMatch(build, BUILD_IDENTIFIER, IDENTIFIER_SO_FAR);
457
+ }
458
+ var compareDigits = (a, b) => a.length - b.length || (a < b ? -1 : a > b ? 1 : 0);
459
+ var compareIdentifiers = (a, b) => {
460
+ const aNumeric = /^\d+$/.test(a);
461
+ const bNumeric = /^\d+$/.test(b);
462
+ if (aNumeric && bNumeric) return compareDigits(a, b);
463
+ if (aNumeric !== bNumeric) return aNumeric ? -1 : 1;
464
+ return a < b ? -1 : a > b ? 1 : 0;
465
+ };
466
+ var comparePrereleases = (a, b) => {
467
+ if (a === b) return 0;
468
+ if (a === void 0) return 1;
469
+ if (b === void 0) return -1;
470
+ const left = a.split(".");
471
+ const right = b.split(".");
472
+ for (let i = 0; i < Math.min(left.length, right.length); i++) {
473
+ const order = compareIdentifiers(left[i], right[i]);
474
+ if (order) return order;
475
+ }
476
+ return left.length - right.length;
477
+ };
478
+ /**
479
+ * Orders two versions by SemVer 2.0.0 precedence: major, minor and patch as numbers, a prerelease
480
+ * before its release, and prerelease identifiers one by one. Build metadata does not count, so
481
+ * `1.4.0+a` and `1.4.0+b` compare equal. Text that is not a version comes after every version.
482
+ * @param a - The first version
483
+ * @param b - The second version
484
+ * @returns Negative when `a` comes first, positive when `b` does, zero when neither
485
+ * @public
486
+ */
487
+ function compareSemver(a, b) {
488
+ const left = SEMVER.exec(a);
489
+ const right = SEMVER.exec(b);
490
+ if (!left || !right) return Number(!left) - Number(!right);
491
+ for (let part = 1; part <= 3; part++) {
492
+ const order = compareDigits(left[part], right[part]);
493
+ if (order) return order;
494
+ }
495
+ return comparePrereleases(left[4], right[4]);
496
+ }
497
+ //#endregion
413
498
  //#region src/index.ts
414
499
  /**
415
500
  * Install all utility components
@@ -418,6 +503,6 @@ function fromISODate(day) {
418
503
  */
419
504
  function install(_app) {}
420
505
  //#endregion
421
- export { defaultKeypressHandlers, fromISODate, install, useKeyboardNav };
506
+ export { compareSemver, defaultKeypressHandlers, fromISODate, install, isSemver, isSemverPrefix, useKeyboardNav };
422
507
 
423
508
  //# sourceMappingURL=utilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.js","names":[],"sources":["../src/composables/visibility/index.ts","../src/composables/keyboard.ts","../src/dates.ts","../src/index.ts"],"sourcesContent":["import {\n\ttype ConfigurableWindow,\n\ttype MaybeComputedElementRef,\n\tdefaultWindow,\n\tunrefElement,\n\tuseEventListener,\n} from '@vueuse/core'\nimport { ref, watch, type MaybeRefOrGetter } from 'vue'\n\nexport interface UseElementVisibilityOptions extends ConfigurableWindow {\n\tscrollTarget?: MaybeRefOrGetter<HTMLElement | undefined | null>\n}\n\n/**\n * Tracks the visibility of an element within the viewport.\n *\n * Compatibility version to get Stonecrop keyboard navigation to work. This function is a copy of the\n * `useElementVisibility` function from VueUse v9.13.0, with the `IntersectionObserver` API removed.\n *\n * This version uses the `getBoundingClientRect` method to determine if an element is visible\n * in the viewport. This is less performant than the `IntersectionObserver` API, but it is\n * more compatible.\n *\n * Note: the newer versions of the VueUse dependencies imported here are sufficient for this composable.\n * (Last verified: v10.9.0 on May 2, 2024)\n *\n * @see https://v9-13-0.vueuse.org/core/useElementVisibility\n * @param element - Element to track visibility for\n * @param options - Configuration options (window, scrollTarget)\n */\nexport function useElementVisibility(\n\telement: MaybeComputedElementRef,\n\t{ window = defaultWindow, scrollTarget }: UseElementVisibilityOptions = {}\n) {\n\tconst elementIsVisible = ref(false)\n\n\tconst testBounding = () => {\n\t\tif (!window) return\n\n\t\tconst document = window.document\n\t\tconst el = unrefElement(element)\n\t\tif (!el) {\n\t\t\telementIsVisible.value = false\n\t\t} else {\n\t\t\tconst rect = el.getBoundingClientRect()\n\t\t\telementIsVisible.value =\n\t\t\t\trect.top <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\t\t\trect.left <= (window.innerWidth || document.documentElement.clientWidth) &&\n\t\t\t\trect.bottom >= 0 &&\n\t\t\t\trect.right >= 0\n\t\t}\n\t}\n\n\twatch(\n\t\t() => unrefElement(element),\n\t\t() => testBounding(),\n\t\t{ immediate: true, flush: 'post' }\n\t)\n\n\tif (window) {\n\t\tuseEventListener(scrollTarget || window, 'scroll', testBounding, {\n\t\t\tcapture: false,\n\t\t\tpassive: true,\n\t\t})\n\t}\n\n\treturn elementIsVisible\n}\n","import { type WatchStopHandle, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\n\nimport { useElementVisibility } from './visibility'\nimport type { KeyboardNavigationOptions, KeypressHandlers } from '../types'\n\n// helper functions\nconst isVisible = (element: HTMLElement) => {\n\tlet visible = useElementVisibility(element).value\n\tvisible = visible && element.offsetHeight > 0\n\treturn visible\n}\n\nconst isFocusable = (element: HTMLElement) => {\n\treturn element.tabIndex >= 0\n}\n\n// navigation functions\nconst getUpCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getUpCellEl(event.target)\n}\n\nconst getUpCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $upCell: HTMLElement | undefined\n\tif (element instanceof HTMLTableCellElement) {\n\t\tconst $prevSibling = element.parentElement?.previousElementSibling\n\t\tif ($prevSibling instanceof HTMLTableRowElement) {\n\t\t\tconst $prevRowCells = Array.from($prevSibling.children)\n\t\t\tconst $cellEl = $prevRowCells[element.cellIndex]\n\t\t\tif ($cellEl instanceof HTMLElement) {\n\t\t\t\t$upCell = $cellEl\n\t\t\t}\n\t\t}\n\t} else if (element instanceof HTMLTableRowElement) {\n\t\tconst $prevSibling = element.previousElementSibling\n\t\tif ($prevSibling instanceof HTMLTableRowElement) {\n\t\t\t$upCell = $prevSibling\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($upCell && (!isFocusable($upCell) || !isVisible($upCell))) {\n\t\treturn getUpCellEl($upCell)\n\t}\n\treturn $upCell\n}\n\nconst getTopCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $target = event.target\n\tlet $topCell: HTMLElement | undefined\n\tif ($target instanceof HTMLTableCellElement) {\n\t\tconst $table = $target.parentElement?.parentElement\n\t\tif ($table) {\n\t\t\tconst $firstRow = $table.firstElementChild\n\t\t\tconst $navEl = $firstRow?.children[$target.cellIndex]\n\t\t\tif ($navEl instanceof HTMLElement) {\n\t\t\t\t$topCell = $navEl\n\t\t\t}\n\t\t}\n\t} else if ($target instanceof HTMLTableRowElement) {\n\t\tconst $parent = $target.parentElement\n\t\tif ($parent) {\n\t\t\tconst $firstEl = $parent.firstElementChild\n\t\t\tif ($firstEl instanceof HTMLTableRowElement) {\n\t\t\t\t$topCell = $firstEl\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($topCell && (!isFocusable($topCell) || !isVisible($topCell))) {\n\t\treturn getDownCellEl($topCell)\n\t}\n\treturn $topCell\n}\n\nconst getDownCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getDownCellEl(event.target)\n}\n\nconst getDownCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $downCell: HTMLElement | undefined\n\tif (element instanceof HTMLTableCellElement) {\n\t\tconst $nextSibling = element.parentElement?.nextElementSibling\n\t\tif ($nextSibling) {\n\t\t\tconst $nextRowCells = Array.from($nextSibling.children)\n\t\t\tconst $cellEl = $nextRowCells[element.cellIndex]\n\t\t\tif ($cellEl instanceof HTMLElement) {\n\t\t\t\t$downCell = $cellEl\n\t\t\t}\n\t\t}\n\t} else if (element instanceof HTMLTableRowElement) {\n\t\tconst $nextSibling = element.nextElementSibling\n\t\tif ($nextSibling instanceof HTMLTableRowElement) {\n\t\t\t$downCell = $nextSibling\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($downCell && (!isFocusable($downCell) || !isVisible($downCell))) {\n\t\treturn getDownCellEl($downCell)\n\t}\n\treturn $downCell\n}\n\nconst getBottomCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $target = event.target\n\tlet $bottomCell: HTMLElement | undefined\n\tif ($target instanceof HTMLTableCellElement) {\n\t\tconst $table = $target.parentElement?.parentElement\n\t\tif ($table) {\n\t\t\tconst $lastRow = $table.lastElementChild\n\t\t\tconst $navEl = $lastRow?.children[$target.cellIndex]\n\t\t\tif ($navEl instanceof HTMLElement) {\n\t\t\t\t$bottomCell = $navEl\n\t\t\t}\n\t\t}\n\t} else if ($target instanceof HTMLTableRowElement) {\n\t\tconst $parent = $target.parentElement\n\t\tif ($parent) {\n\t\t\tconst $lastEl = $parent.lastElementChild\n\t\t\tif ($lastEl instanceof HTMLTableRowElement) {\n\t\t\t\t$bottomCell = $lastEl\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($bottomCell && (!isFocusable($bottomCell) || !isVisible($bottomCell))) {\n\t\treturn getUpCellEl($bottomCell)\n\t}\n\treturn $bottomCell\n}\n\nconst getPrevCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getPrevCellEl(event.target)\n}\n\nconst getPrevCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $prevCell: HTMLElement | undefined\n\tconst $prevSibling = element.previousElementSibling\n\tif ($prevSibling instanceof HTMLElement) {\n\t\t$prevCell = $prevSibling\n\t} else {\n\t\tconst $prevRow = element.parentElement?.previousElementSibling\n\t\tconst $lastEl = $prevRow?.lastElementChild\n\t\tif ($lastEl instanceof HTMLElement) {\n\t\t\t$prevCell = $lastEl\n\t\t}\n\t}\n\tif ($prevCell && (!isFocusable($prevCell) || !isVisible($prevCell))) {\n\t\treturn getPrevCellEl($prevCell)\n\t}\n\treturn $prevCell\n}\n\nconst getNextCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getNextCellEl(event.target)\n}\n\nconst getNextCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $nextCell: HTMLElement | undefined\n\tconst $nextSibling = element.nextElementSibling\n\tif ($nextSibling instanceof HTMLElement) {\n\t\t$nextCell = $nextSibling\n\t} else {\n\t\tconst $nextRow = element.parentElement?.nextElementSibling\n\t\tconst $firstEl = $nextRow?.firstElementChild\n\t\tif ($firstEl instanceof HTMLElement) {\n\t\t\t$nextCell = $firstEl\n\t\t}\n\t}\n\tif ($nextCell && (!isFocusable($nextCell) || !isVisible($nextCell))) {\n\t\treturn getNextCellEl($nextCell)\n\t}\n\treturn $nextCell\n}\n\nconst getFirstCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $parent = event.target.parentElement\n\tconst $firstEl = $parent?.firstElementChild\n\tconst $firstCell = $firstEl instanceof HTMLElement ? $firstEl : null\n\tif ($firstCell && (!isFocusable($firstCell) || !isVisible($firstCell))) {\n\t\treturn getNextCellEl($firstCell)\n\t}\n\treturn $firstCell\n}\n\nconst getLastCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $parent = event.target.parentElement\n\tconst $lastEl = $parent?.lastElementChild\n\tconst $lastCell = $lastEl instanceof HTMLElement ? $lastEl : null\n\tif ($lastCell && (!isFocusable($lastCell) || !isVisible($lastCell))) {\n\t\treturn getPrevCellEl($lastCell)\n\t}\n\treturn $lastCell\n}\n\nconst modifierKeys = ['alt', 'control', 'shift', 'meta']\n\nconst eventKeyMap: Record<string, string> = {\n\tArrowUp: 'up',\n\tArrowDown: 'down',\n\tArrowLeft: 'left',\n\tArrowRight: 'right',\n}\n\n/**\n * Default keypress handlers for keyboard navigation\n * @public\n */\nexport const defaultKeypressHandlers: KeypressHandlers = {\n\t'keydown.up': (event: KeyboardEvent) => {\n\t\tconst $upCell = getUpCell(event)\n\t\tif ($upCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$upCell.focus()\n\t\t}\n\t},\n\t'keydown.down': (event: KeyboardEvent) => {\n\t\tconst $downCell = getDownCell(event)\n\t\tif ($downCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$downCell.focus()\n\t\t}\n\t},\n\t'keydown.left': (event: KeyboardEvent) => {\n\t\tconst $prevCell = getPrevCell(event)\n\t\t// prevent default edit-cell behaviour on first cell\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t\tif ($prevCell) {\n\t\t\t$prevCell.focus()\n\t\t}\n\t},\n\t'keydown.right': (event: KeyboardEvent) => {\n\t\tconst $nextCell = getNextCell(event)\n\t\t// prevent default edit-cell behaviour on last cell\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t\tif ($nextCell) {\n\t\t\t$nextCell.focus()\n\t\t}\n\t},\n\t'keydown.control.up': (event: KeyboardEvent) => {\n\t\tconst $topCell = getTopCell(event)\n\t\tif ($topCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$topCell.focus()\n\t\t}\n\t},\n\t'keydown.control.down': (event: KeyboardEvent) => {\n\t\tconst $bottomCell = getBottomCell(event)\n\t\tif ($bottomCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$bottomCell.focus()\n\t\t}\n\t},\n\t'keydown.control.left': (event: KeyboardEvent) => {\n\t\tconst $firstCell = getFirstCell(event)\n\t\tif ($firstCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$firstCell.focus()\n\t\t}\n\t},\n\t'keydown.control.right': (event: KeyboardEvent) => {\n\t\tconst $lastCell = getLastCell(event)\n\t\tif ($lastCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$lastCell.focus()\n\t\t}\n\t},\n\t'keydown.end': (event: KeyboardEvent) => {\n\t\tconst $lastCell = getLastCell(event)\n\t\tif ($lastCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$lastCell.focus()\n\t\t}\n\t},\n\t'keydown.enter': (event: KeyboardEvent) => {\n\t\tif (!(event.target instanceof HTMLElement)) return\n\t\tconst $target = event.target\n\t\tif ($target instanceof HTMLTableCellElement) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\tconst $downCell = getDownCell(event)\n\t\t\tif ($downCell) {\n\t\t\t\t$downCell.focus()\n\t\t\t}\n\t\t} else {\n\t\t\t// handle other contexts\n\t\t}\n\t},\n\t'keydown.shift.enter': (event: KeyboardEvent) => {\n\t\tif (!(event.target instanceof HTMLElement)) return\n\t\tconst $target = event.target\n\t\tif ($target instanceof HTMLTableCellElement) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\tconst $upCell = getUpCell(event)\n\t\t\tif ($upCell) {\n\t\t\t\t$upCell.focus()\n\t\t\t}\n\t\t} else {\n\t\t\t// handle other contexts\n\t\t}\n\t},\n\t'keydown.home': (event: KeyboardEvent) => {\n\t\tconst $firstCell = getFirstCell(event)\n\t\tif ($firstCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$firstCell.focus()\n\t\t}\n\t},\n\t'keydown.tab': (event: KeyboardEvent) => {\n\t\tconst $nextCell = getNextCell(event)\n\t\tif ($nextCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$nextCell.focus()\n\t\t}\n\t},\n\t'keydown.shift.tab': (event: KeyboardEvent) => {\n\t\tconst $prevCell = getPrevCell(event)\n\t\tif ($prevCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$prevCell.focus()\n\t\t}\n\t},\n}\n\n/**\n * Gets the parent element from a keyboard navigation option.\n * @internal\n */\nfunction getParentElement(option: KeyboardNavigationOptions): HTMLElement | null {\n\tlet $parent: HTMLElement | null = null\n\tif (option.parent) {\n\t\tif (typeof option.parent === 'string') {\n\t\t\t$parent = document.querySelector(option.parent)\n\t\t} else if (option.parent instanceof HTMLElement) {\n\t\t\t$parent = option.parent\n\t\t} else {\n\t\t\t$parent = option.parent.value\n\t\t}\n\t}\n\treturn $parent\n}\n\n/**\n * Keyboard navigation composable\n * @param options - Keyboard navigation options\n * @public\n */\nexport function useKeyboardNav(options: KeyboardNavigationOptions[]) {\n\tconst getSelectorsFromOption = (option: KeyboardNavigationOptions) => {\n\t\t// assumes that option.selectors is provided\n\t\tconst $parent = getParentElement(option)\n\t\tlet selectors: HTMLElement[] = []\n\t\tif (typeof option.selectors === 'string') {\n\t\t\tselectors = $parent\n\t\t\t\t? Array.from($parent.querySelectorAll(option.selectors))\n\t\t\t\t: Array.from(document.querySelectorAll(option.selectors))\n\t\t} else if (Array.isArray(option.selectors)) {\n\t\t\tfor (const element of option.selectors) {\n\t\t\t\tif (element instanceof HTMLElement) {\n\t\t\t\t\tselectors.push(element)\n\t\t\t\t} else {\n\t\t\t\t\t// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Vue component $el is typed as any; shape guaranteed by VNode contract\n\t\t\t\t\tselectors.push(element.$el as HTMLElement)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (option.selectors instanceof HTMLElement) {\n\t\t\tselectors.push(option.selectors)\n\t\t} else if (option.selectors?.value) {\n\t\t\tif (Array.isArray(option.selectors.value)) {\n\t\t\t\tfor (const element of option.selectors.value) {\n\t\t\t\t\tif (element instanceof HTMLElement) {\n\t\t\t\t\t\tselectors.push(element)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Vue component $el is typed as any; shape guaranteed by VNode contract\n\t\t\t\t\t\tselectors.push(element.$el as HTMLElement)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tselectors.push(option.selectors.value)\n\t\t\t}\n\t\t}\n\t\treturn selectors\n\t}\n\n\tconst getSelectors = (option: KeyboardNavigationOptions) => {\n\t\tconst $parent = getParentElement(option)\n\t\tlet selectors: HTMLElement[] = []\n\t\tif (option.selectors) {\n\t\t\tselectors = getSelectorsFromOption(option)\n\t\t} else if ($parent) {\n\t\t\t// TODO: what should happen if no parent or selectors are provided?\n\t\t\tconst $children = Array.from($parent.children).filter((el): el is HTMLElement => el instanceof HTMLElement)\n\t\t\tselectors = $children.filter(selector => {\n\t\t\t\t// ignore elements not in the tab order or are not visible\n\t\t\t\treturn isFocusable(selector) && isVisible(selector)\n\t\t\t})\n\t\t}\n\t\treturn selectors\n\t}\n\n\tconst getEventListener = (option: KeyboardNavigationOptions) => {\n\t\treturn (event: KeyboardEvent) => {\n\t\t\tconst activeKey = eventKeyMap[event.key] || event.key.toLowerCase()\n\t\t\tif (modifierKeys.includes(activeKey)) return // ignore modifier key presses\n\n\t\t\tconst handlers = option.handlers || defaultKeypressHandlers\n\t\t\tfor (const key of Object.keys(handlers)) {\n\t\t\t\tconst [eventType, ...keys] = key.split('.')\n\t\t\t\tif (eventType !== 'keydown') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (keys.includes(activeKey)) {\n\t\t\t\t\tconst listener = handlers[key]\n\n\t\t\t\t\t// check if the handler has modifiers, and if the modifier is active;\n\t\t\t\t\t// this is to ensure exact key-press matches\n\t\t\t\t\tconst hasModifier = keys.filter(k => modifierKeys.includes(k))\n\t\t\t\t\tconst isModifierActive = modifierKeys.some(mk => {\n\t\t\t\t\t\tconst modifierKey = mk.charAt(0).toUpperCase() + mk.slice(1)\n\t\t\t\t\t\treturn event.getModifierState(modifierKey)\n\t\t\t\t\t})\n\n\t\t\t\t\tif (hasModifier.length > 0) {\n\t\t\t\t\t\tif (isModifierActive) {\n\t\t\t\t\t\t\tfor (const modifier of modifierKeys) {\n\t\t\t\t\t\t\t\tif (keys.includes(modifier)) {\n\t\t\t\t\t\t\t\t\t// docs: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState\n\t\t\t\t\t\t\t\t\tconst modifierKey = modifier.charAt(0).toUpperCase() + modifier.slice(1)\n\t\t\t\t\t\t\t\t\tif (event.getModifierState(modifierKey)) {\n\t\t\t\t\t\t\t\t\t\tlistener(event)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!isModifierActive) {\n\t\t\t\t\t\t\tlistener(event)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst watchStopHandlers: WatchStopHandle[] = []\n\tonMounted(() => {\n\t\tfor (const option of options) {\n\t\t\tconst $parent = getParentElement(option)\n\t\t\tconst selectors = getSelectors(option)\n\t\t\tconst listener = getEventListener(option)\n\t\t\tconst listenerElements = $parent\n\t\t\t\t? [$parent] // watch for focus recursively within the parent element\n\t\t\t\t: selectors // watch for focus on each selector element TODO: too much JS?\n\n\t\t\tfor (const element of listenerElements) {\n\t\t\t\tconst { focused } = useFocusWithin(ref(element))\n\t\t\t\tconst stopHandler = watch(focused, value => {\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\telement.addEventListener('keydown', listener)\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.removeEventListener('keydown', listener)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\twatchStopHandlers.push(stopHandler)\n\t\t\t}\n\t\t}\n\t})\n\n\tonBeforeUnmount(() => {\n\t\tfor (const stopHandler of watchStopHandlers) {\n\t\t\tstopHandler()\n\t\t}\n\t})\n}\n","import { Temporal } from 'temporal-polyfill'\n\n/**\n * Reads a `YYYY-MM-DD` day. Anything that is not a real day written exactly that way reads as no day.\n *\n * Not `Temporal.PlainDate.from` alone: it also takes the day out of a date-time, which would show a day\n * field over a date-time column as a day instead of as the mismatch it is.\n * @param day - The day, as `YYYY-MM-DD`\n * @public\n */\nexport function fromISODate(day: string): Temporal.PlainDate | undefined {\n\tif (!/^\\d{4}-\\d{2}-\\d{2}$/.test(day)) return undefined\n\n\ttry {\n\t\treturn Temporal.PlainDate.from(day)\n\t} catch {\n\t\treturn undefined\n\t}\n}\n","import { App } from 'vue'\n\nimport { defaultKeypressHandlers, useKeyboardNav } from './composables/keyboard'\nimport { fromISODate } from './dates'\nexport type * from './types'\n\n/**\n * Install all utility components\n * @param _app - Vue app instance\n * @public\n */\nfunction install(_app: App /* options */) {}\n\nexport { defaultKeypressHandlers, fromISODate, install, useKeyboardNav }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,qBACf,SACA,EAAE,SAAS,eAAe,iBAA8C,CAAC,GACxE;CACD,MAAM,mBAAmB,IAAI,KAAK;CAElC,MAAM,qBAAqB;EAC1B,IAAI,CAAC,QAAQ;EAEb,MAAM,WAAW,OAAO;EACxB,MAAM,KAAK,aAAa,OAAO;EAC/B,IAAI,CAAC,IACJ,iBAAiB,QAAQ;OACnB;GACN,MAAM,OAAO,GAAG,sBAAsB;GACtC,iBAAiB,QAChB,KAAK,QAAQ,OAAO,eAAe,SAAS,gBAAgB,iBAC5D,KAAK,SAAS,OAAO,cAAc,SAAS,gBAAgB,gBAC5D,KAAK,UAAU,KACf,KAAK,SAAS;EAChB;CACD;CAEA,YACO,aAAa,OAAO,SACpB,aAAa,GACnB;EAAE,WAAW;EAAM,OAAO;CAAO,CAClC;CAEA,IAAI,QACH,iBAAiB,gBAAgB,QAAQ,UAAU,cAAc;EAChE,SAAS;EACT,SAAS;CACV,CAAC;CAGF,OAAO;AACR;;;AC5DA,IAAM,aAAa,YAAyB;CAC3C,IAAI,UAAU,qBAAqB,OAAO,CAAC,CAAC;CAC5C,UAAU,WAAW,QAAQ,eAAe;CAC5C,OAAO;AACR;AAEA,IAAM,eAAe,YAAyB;CAC7C,OAAO,QAAQ,YAAY;AAC5B;AAG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,CAAC,CAAC,YAAY,IAAI,GAAG,MAAM,CAAC;MAC3D,OAAO,MAAM,iBAAiB,WAAW;KAC1C,CAAC;KAED,IAAI,YAAY,SAAS,GACpB;UAAA,kBACE;YAAA,MAAM,YAAY,cACtB,IAAI,KAAK,SAAS,QAAQ,GAAG;QAE5B,MAAM,cAAc,SAAS,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,SAAS,MAAM,CAAC;QACvE,IAAI,MAAM,iBAAiB,WAAW,GACrC,SAAS,KAAK;OAEhB;;KACD,OAGD,IAAI,CAAC,kBACJ,SAAS,KAAK;IAGjB;GACD;EACD;CACD;CAEA,MAAM,oBAAuC,CAAC;CAC9C,gBAAgB;EACf,KAAK,MAAM,UAAU,SAAS;GAC7B,MAAM,UAAU,iBAAiB,MAAM;GACvC,MAAM,YAAY,aAAa,MAAM;GACrC,MAAM,WAAW,iBAAiB,MAAM;GACxC,MAAM,mBAAmB,UACtB,CAAC,OAAO,IACR;GAEH,KAAK,MAAM,WAAW,kBAAkB;IACvC,MAAM,EAAE,YAAY,eAAe,IAAI,OAAO,CAAC;IAC/C,MAAM,cAAc,MAAM,UAAS,UAAS;KAC3C,IAAI,OACH,QAAQ,iBAAiB,WAAW,QAAQ;UAE5C,QAAQ,oBAAoB,WAAW,QAAQ;IAEjD,CAAC;IACD,kBAAkB,KAAK,WAAW;GACnC;EACD;CACD,CAAC;CAED,sBAAsB;EACrB,KAAK,MAAM,eAAe,mBACzB,YAAY;CAEd,CAAC;AACF;;;;;;;;;;;ACxeA,SAAgB,YAAY,KAA6C;CACxE,IAAI,CAAC,sBAAsB,KAAK,GAAG,GAAG,OAAO,KAAA;CAE7C,IAAI;EACH,OAAO,SAAS,UAAU,KAAK,GAAG;CACnC,QAAQ;EACP;CACD;AACD;;;;;;;;ACPA,SAAS,QAAQ,MAAyB,CAAC"}
1
+ {"version":3,"file":"utilities.js","names":[],"sources":["../src/composables/visibility/index.ts","../src/composables/keyboard.ts","../src/dates.ts","../src/semver.ts","../src/index.ts"],"sourcesContent":["import {\n\ttype ConfigurableWindow,\n\ttype MaybeComputedElementRef,\n\tdefaultWindow,\n\tunrefElement,\n\tuseEventListener,\n} from '@vueuse/core'\nimport { ref, watch, type MaybeRefOrGetter } from 'vue'\n\nexport interface UseElementVisibilityOptions extends ConfigurableWindow {\n\tscrollTarget?: MaybeRefOrGetter<HTMLElement | undefined | null>\n}\n\n/**\n * Tracks the visibility of an element within the viewport.\n *\n * Compatibility version to get Stonecrop keyboard navigation to work. This function is a copy of the\n * `useElementVisibility` function from VueUse v9.13.0, with the `IntersectionObserver` API removed.\n *\n * This version uses the `getBoundingClientRect` method to determine if an element is visible\n * in the viewport. This is less performant than the `IntersectionObserver` API, but it is\n * more compatible.\n *\n * Note: the newer versions of the VueUse dependencies imported here are sufficient for this composable.\n * (Last verified: v10.9.0 on May 2, 2024)\n *\n * @see https://v9-13-0.vueuse.org/core/useElementVisibility\n * @param element - Element to track visibility for\n * @param options - Configuration options (window, scrollTarget)\n */\nexport function useElementVisibility(\n\telement: MaybeComputedElementRef,\n\t{ window = defaultWindow, scrollTarget }: UseElementVisibilityOptions = {}\n) {\n\tconst elementIsVisible = ref(false)\n\n\tconst testBounding = () => {\n\t\tif (!window) return\n\n\t\tconst document = window.document\n\t\tconst el = unrefElement(element)\n\t\tif (!el) {\n\t\t\telementIsVisible.value = false\n\t\t} else {\n\t\t\tconst rect = el.getBoundingClientRect()\n\t\t\telementIsVisible.value =\n\t\t\t\trect.top <= (window.innerHeight || document.documentElement.clientHeight) &&\n\t\t\t\trect.left <= (window.innerWidth || document.documentElement.clientWidth) &&\n\t\t\t\trect.bottom >= 0 &&\n\t\t\t\trect.right >= 0\n\t\t}\n\t}\n\n\twatch(\n\t\t() => unrefElement(element),\n\t\t() => testBounding(),\n\t\t{ immediate: true, flush: 'post' }\n\t)\n\n\tif (window) {\n\t\tuseEventListener(scrollTarget || window, 'scroll', testBounding, {\n\t\t\tcapture: false,\n\t\t\tpassive: true,\n\t\t})\n\t}\n\n\treturn elementIsVisible\n}\n","import { type WatchStopHandle, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useFocusWithin } from '@vueuse/core'\n\nimport { useElementVisibility } from './visibility'\nimport type { KeyboardNavigationOptions, KeypressHandlers } from '../types'\n\n// helper functions\nconst isVisible = (element: HTMLElement) => {\n\tlet visible = useElementVisibility(element).value\n\tvisible = visible && element.offsetHeight > 0\n\treturn visible\n}\n\nconst isFocusable = (element: HTMLElement) => {\n\treturn element.tabIndex >= 0\n}\n\n// navigation functions\nconst getUpCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getUpCellEl(event.target)\n}\n\nconst getUpCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $upCell: HTMLElement | undefined\n\tif (element instanceof HTMLTableCellElement) {\n\t\tconst $prevSibling = element.parentElement?.previousElementSibling\n\t\tif ($prevSibling instanceof HTMLTableRowElement) {\n\t\t\tconst $prevRowCells = Array.from($prevSibling.children)\n\t\t\tconst $cellEl = $prevRowCells[element.cellIndex]\n\t\t\tif ($cellEl instanceof HTMLElement) {\n\t\t\t\t$upCell = $cellEl\n\t\t\t}\n\t\t}\n\t} else if (element instanceof HTMLTableRowElement) {\n\t\tconst $prevSibling = element.previousElementSibling\n\t\tif ($prevSibling instanceof HTMLTableRowElement) {\n\t\t\t$upCell = $prevSibling\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($upCell && (!isFocusable($upCell) || !isVisible($upCell))) {\n\t\treturn getUpCellEl($upCell)\n\t}\n\treturn $upCell\n}\n\nconst getTopCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $target = event.target\n\tlet $topCell: HTMLElement | undefined\n\tif ($target instanceof HTMLTableCellElement) {\n\t\tconst $table = $target.parentElement?.parentElement\n\t\tif ($table) {\n\t\t\tconst $firstRow = $table.firstElementChild\n\t\t\tconst $navEl = $firstRow?.children[$target.cellIndex]\n\t\t\tif ($navEl instanceof HTMLElement) {\n\t\t\t\t$topCell = $navEl\n\t\t\t}\n\t\t}\n\t} else if ($target instanceof HTMLTableRowElement) {\n\t\tconst $parent = $target.parentElement\n\t\tif ($parent) {\n\t\t\tconst $firstEl = $parent.firstElementChild\n\t\t\tif ($firstEl instanceof HTMLTableRowElement) {\n\t\t\t\t$topCell = $firstEl\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($topCell && (!isFocusable($topCell) || !isVisible($topCell))) {\n\t\treturn getDownCellEl($topCell)\n\t}\n\treturn $topCell\n}\n\nconst getDownCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getDownCellEl(event.target)\n}\n\nconst getDownCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $downCell: HTMLElement | undefined\n\tif (element instanceof HTMLTableCellElement) {\n\t\tconst $nextSibling = element.parentElement?.nextElementSibling\n\t\tif ($nextSibling) {\n\t\t\tconst $nextRowCells = Array.from($nextSibling.children)\n\t\t\tconst $cellEl = $nextRowCells[element.cellIndex]\n\t\t\tif ($cellEl instanceof HTMLElement) {\n\t\t\t\t$downCell = $cellEl\n\t\t\t}\n\t\t}\n\t} else if (element instanceof HTMLTableRowElement) {\n\t\tconst $nextSibling = element.nextElementSibling\n\t\tif ($nextSibling instanceof HTMLTableRowElement) {\n\t\t\t$downCell = $nextSibling\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($downCell && (!isFocusable($downCell) || !isVisible($downCell))) {\n\t\treturn getDownCellEl($downCell)\n\t}\n\treturn $downCell\n}\n\nconst getBottomCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $target = event.target\n\tlet $bottomCell: HTMLElement | undefined\n\tif ($target instanceof HTMLTableCellElement) {\n\t\tconst $table = $target.parentElement?.parentElement\n\t\tif ($table) {\n\t\t\tconst $lastRow = $table.lastElementChild\n\t\t\tconst $navEl = $lastRow?.children[$target.cellIndex]\n\t\t\tif ($navEl instanceof HTMLElement) {\n\t\t\t\t$bottomCell = $navEl\n\t\t\t}\n\t\t}\n\t} else if ($target instanceof HTMLTableRowElement) {\n\t\tconst $parent = $target.parentElement\n\t\tif ($parent) {\n\t\t\tconst $lastEl = $parent.lastElementChild\n\t\t\tif ($lastEl instanceof HTMLTableRowElement) {\n\t\t\t\t$bottomCell = $lastEl\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// handle other contexts\n\t}\n\tif ($bottomCell && (!isFocusable($bottomCell) || !isVisible($bottomCell))) {\n\t\treturn getUpCellEl($bottomCell)\n\t}\n\treturn $bottomCell\n}\n\nconst getPrevCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getPrevCellEl(event.target)\n}\n\nconst getPrevCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $prevCell: HTMLElement | undefined\n\tconst $prevSibling = element.previousElementSibling\n\tif ($prevSibling instanceof HTMLElement) {\n\t\t$prevCell = $prevSibling\n\t} else {\n\t\tconst $prevRow = element.parentElement?.previousElementSibling\n\t\tconst $lastEl = $prevRow?.lastElementChild\n\t\tif ($lastEl instanceof HTMLElement) {\n\t\t\t$prevCell = $lastEl\n\t\t}\n\t}\n\tif ($prevCell && (!isFocusable($prevCell) || !isVisible($prevCell))) {\n\t\treturn getPrevCellEl($prevCell)\n\t}\n\treturn $prevCell\n}\n\nconst getNextCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getNextCellEl(event.target)\n}\n\nconst getNextCellEl = (element: HTMLElement): HTMLElement | undefined => {\n\tlet $nextCell: HTMLElement | undefined\n\tconst $nextSibling = element.nextElementSibling\n\tif ($nextSibling instanceof HTMLElement) {\n\t\t$nextCell = $nextSibling\n\t} else {\n\t\tconst $nextRow = element.parentElement?.nextElementSibling\n\t\tconst $firstEl = $nextRow?.firstElementChild\n\t\tif ($firstEl instanceof HTMLElement) {\n\t\t\t$nextCell = $firstEl\n\t\t}\n\t}\n\tif ($nextCell && (!isFocusable($nextCell) || !isVisible($nextCell))) {\n\t\treturn getNextCellEl($nextCell)\n\t}\n\treturn $nextCell\n}\n\nconst getFirstCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $parent = event.target.parentElement\n\tconst $firstEl = $parent?.firstElementChild\n\tconst $firstCell = $firstEl instanceof HTMLElement ? $firstEl : null\n\tif ($firstCell && (!isFocusable($firstCell) || !isVisible($firstCell))) {\n\t\treturn getNextCellEl($firstCell)\n\t}\n\treturn $firstCell\n}\n\nconst getLastCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\tconst $parent = event.target.parentElement\n\tconst $lastEl = $parent?.lastElementChild\n\tconst $lastCell = $lastEl instanceof HTMLElement ? $lastEl : null\n\tif ($lastCell && (!isFocusable($lastCell) || !isVisible($lastCell))) {\n\t\treturn getPrevCellEl($lastCell)\n\t}\n\treturn $lastCell\n}\n\nconst modifierKeys = ['alt', 'control', 'shift', 'meta']\n\nconst eventKeyMap: Record<string, string> = {\n\tArrowUp: 'up',\n\tArrowDown: 'down',\n\tArrowLeft: 'left',\n\tArrowRight: 'right',\n}\n\n/**\n * Default keypress handlers for keyboard navigation\n * @public\n */\nexport const defaultKeypressHandlers: KeypressHandlers = {\n\t'keydown.up': (event: KeyboardEvent) => {\n\t\tconst $upCell = getUpCell(event)\n\t\tif ($upCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$upCell.focus()\n\t\t}\n\t},\n\t'keydown.down': (event: KeyboardEvent) => {\n\t\tconst $downCell = getDownCell(event)\n\t\tif ($downCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$downCell.focus()\n\t\t}\n\t},\n\t'keydown.left': (event: KeyboardEvent) => {\n\t\tconst $prevCell = getPrevCell(event)\n\t\t// prevent default edit-cell behaviour on first cell\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t\tif ($prevCell) {\n\t\t\t$prevCell.focus()\n\t\t}\n\t},\n\t'keydown.right': (event: KeyboardEvent) => {\n\t\tconst $nextCell = getNextCell(event)\n\t\t// prevent default edit-cell behaviour on last cell\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t\tif ($nextCell) {\n\t\t\t$nextCell.focus()\n\t\t}\n\t},\n\t'keydown.control.up': (event: KeyboardEvent) => {\n\t\tconst $topCell = getTopCell(event)\n\t\tif ($topCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$topCell.focus()\n\t\t}\n\t},\n\t'keydown.control.down': (event: KeyboardEvent) => {\n\t\tconst $bottomCell = getBottomCell(event)\n\t\tif ($bottomCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$bottomCell.focus()\n\t\t}\n\t},\n\t'keydown.control.left': (event: KeyboardEvent) => {\n\t\tconst $firstCell = getFirstCell(event)\n\t\tif ($firstCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$firstCell.focus()\n\t\t}\n\t},\n\t'keydown.control.right': (event: KeyboardEvent) => {\n\t\tconst $lastCell = getLastCell(event)\n\t\tif ($lastCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$lastCell.focus()\n\t\t}\n\t},\n\t'keydown.end': (event: KeyboardEvent) => {\n\t\tconst $lastCell = getLastCell(event)\n\t\tif ($lastCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$lastCell.focus()\n\t\t}\n\t},\n\t'keydown.enter': (event: KeyboardEvent) => {\n\t\tif (!(event.target instanceof HTMLElement)) return\n\t\tconst $target = event.target\n\t\tif ($target instanceof HTMLTableCellElement) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\tconst $downCell = getDownCell(event)\n\t\t\tif ($downCell) {\n\t\t\t\t$downCell.focus()\n\t\t\t}\n\t\t} else {\n\t\t\t// handle other contexts\n\t\t}\n\t},\n\t'keydown.shift.enter': (event: KeyboardEvent) => {\n\t\tif (!(event.target instanceof HTMLElement)) return\n\t\tconst $target = event.target\n\t\tif ($target instanceof HTMLTableCellElement) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\tconst $upCell = getUpCell(event)\n\t\t\tif ($upCell) {\n\t\t\t\t$upCell.focus()\n\t\t\t}\n\t\t} else {\n\t\t\t// handle other contexts\n\t\t}\n\t},\n\t'keydown.home': (event: KeyboardEvent) => {\n\t\tconst $firstCell = getFirstCell(event)\n\t\tif ($firstCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$firstCell.focus()\n\t\t}\n\t},\n\t'keydown.tab': (event: KeyboardEvent) => {\n\t\tconst $nextCell = getNextCell(event)\n\t\tif ($nextCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$nextCell.focus()\n\t\t}\n\t},\n\t'keydown.shift.tab': (event: KeyboardEvent) => {\n\t\tconst $prevCell = getPrevCell(event)\n\t\tif ($prevCell) {\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t\t$prevCell.focus()\n\t\t}\n\t},\n}\n\n/**\n * Gets the parent element from a keyboard navigation option.\n * @internal\n */\nfunction getParentElement(option: KeyboardNavigationOptions): HTMLElement | null {\n\tlet $parent: HTMLElement | null = null\n\tif (option.parent) {\n\t\tif (typeof option.parent === 'string') {\n\t\t\t$parent = document.querySelector(option.parent)\n\t\t} else if (option.parent instanceof HTMLElement) {\n\t\t\t$parent = option.parent\n\t\t} else {\n\t\t\t$parent = option.parent.value\n\t\t}\n\t}\n\treturn $parent\n}\n\n/**\n * Keyboard navigation composable\n * @param options - Keyboard navigation options\n * @public\n */\nexport function useKeyboardNav(options: KeyboardNavigationOptions[]) {\n\tconst getSelectorsFromOption = (option: KeyboardNavigationOptions) => {\n\t\t// assumes that option.selectors is provided\n\t\tconst $parent = getParentElement(option)\n\t\tlet selectors: HTMLElement[] = []\n\t\tif (typeof option.selectors === 'string') {\n\t\t\tselectors = $parent\n\t\t\t\t? Array.from($parent.querySelectorAll(option.selectors))\n\t\t\t\t: Array.from(document.querySelectorAll(option.selectors))\n\t\t} else if (Array.isArray(option.selectors)) {\n\t\t\tfor (const element of option.selectors) {\n\t\t\t\tif (element instanceof HTMLElement) {\n\t\t\t\t\tselectors.push(element)\n\t\t\t\t} else {\n\t\t\t\t\t// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Vue component $el is typed as any; shape guaranteed by VNode contract\n\t\t\t\t\tselectors.push(element.$el as HTMLElement)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (option.selectors instanceof HTMLElement) {\n\t\t\tselectors.push(option.selectors)\n\t\t} else if (option.selectors?.value) {\n\t\t\tif (Array.isArray(option.selectors.value)) {\n\t\t\t\tfor (const element of option.selectors.value) {\n\t\t\t\t\tif (element instanceof HTMLElement) {\n\t\t\t\t\t\tselectors.push(element)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Vue component $el is typed as any; shape guaranteed by VNode contract\n\t\t\t\t\t\tselectors.push(element.$el as HTMLElement)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tselectors.push(option.selectors.value)\n\t\t\t}\n\t\t}\n\t\treturn selectors\n\t}\n\n\tconst getSelectors = (option: KeyboardNavigationOptions) => {\n\t\tconst $parent = getParentElement(option)\n\t\tlet selectors: HTMLElement[] = []\n\t\tif (option.selectors) {\n\t\t\tselectors = getSelectorsFromOption(option)\n\t\t} else if ($parent) {\n\t\t\t// TODO: what should happen if no parent or selectors are provided?\n\t\t\tconst $children = Array.from($parent.children).filter((el): el is HTMLElement => el instanceof HTMLElement)\n\t\t\tselectors = $children.filter(selector => {\n\t\t\t\t// ignore elements not in the tab order or are not visible\n\t\t\t\treturn isFocusable(selector) && isVisible(selector)\n\t\t\t})\n\t\t}\n\t\treturn selectors\n\t}\n\n\tconst getEventListener = (option: KeyboardNavigationOptions) => {\n\t\treturn (event: KeyboardEvent) => {\n\t\t\tconst activeKey = eventKeyMap[event.key] || event.key.toLowerCase()\n\t\t\tif (modifierKeys.includes(activeKey)) return // ignore modifier key presses\n\n\t\t\tconst handlers = option.handlers || defaultKeypressHandlers\n\t\t\tfor (const key of Object.keys(handlers)) {\n\t\t\t\tconst [eventType, ...keys] = key.split('.')\n\t\t\t\tif (eventType !== 'keydown') {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif (keys.includes(activeKey)) {\n\t\t\t\t\tconst listener = handlers[key]\n\n\t\t\t\t\t// check if the handler has modifiers, and if the modifier is active;\n\t\t\t\t\t// this is to ensure exact key-press matches\n\t\t\t\t\tconst hasModifier = keys.filter(k => modifierKeys.includes(k))\n\t\t\t\t\tconst isModifierActive = modifierKeys.some(mk => {\n\t\t\t\t\t\tconst modifierKey = mk.charAt(0).toUpperCase() + mk.slice(1)\n\t\t\t\t\t\treturn event.getModifierState(modifierKey)\n\t\t\t\t\t})\n\n\t\t\t\t\tif (hasModifier.length > 0) {\n\t\t\t\t\t\tif (isModifierActive) {\n\t\t\t\t\t\t\tfor (const modifier of modifierKeys) {\n\t\t\t\t\t\t\t\tif (keys.includes(modifier)) {\n\t\t\t\t\t\t\t\t\t// docs: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState\n\t\t\t\t\t\t\t\t\tconst modifierKey = modifier.charAt(0).toUpperCase() + modifier.slice(1)\n\t\t\t\t\t\t\t\t\tif (event.getModifierState(modifierKey)) {\n\t\t\t\t\t\t\t\t\t\tlistener(event)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!isModifierActive) {\n\t\t\t\t\t\t\tlistener(event)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst watchStopHandlers: WatchStopHandle[] = []\n\tonMounted(() => {\n\t\tfor (const option of options) {\n\t\t\tconst $parent = getParentElement(option)\n\t\t\tconst selectors = getSelectors(option)\n\t\t\tconst listener = getEventListener(option)\n\t\t\tconst listenerElements = $parent\n\t\t\t\t? [$parent] // watch for focus recursively within the parent element\n\t\t\t\t: selectors // watch for focus on each selector element TODO: too much JS?\n\n\t\t\tfor (const element of listenerElements) {\n\t\t\t\tconst { focused } = useFocusWithin(ref(element))\n\t\t\t\tconst stopHandler = watch(focused, value => {\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\telement.addEventListener('keydown', listener)\n\t\t\t\t\t} else {\n\t\t\t\t\t\telement.removeEventListener('keydown', listener)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\twatchStopHandlers.push(stopHandler)\n\t\t\t}\n\t\t}\n\t})\n\n\tonBeforeUnmount(() => {\n\t\tfor (const stopHandler of watchStopHandlers) {\n\t\t\tstopHandler()\n\t\t}\n\t})\n}\n","import { Temporal } from 'temporal-polyfill'\n\n/**\n * Reads a `YYYY-MM-DD` day. Anything that is not a real day written exactly that way reads as no day.\n *\n * Not `Temporal.PlainDate.from` alone: it also takes the day out of a date-time, which would show a day\n * field over a date-time column as a day instead of as the mismatch it is.\n * @param day - The day, as `YYYY-MM-DD`\n * @public\n */\nexport function fromISODate(day: string): Temporal.PlainDate | undefined {\n\tif (!/^\\d{4}-\\d{2}-\\d{2}$/.test(day)) return undefined\n\n\ttry {\n\t\treturn Temporal.PlainDate.from(day)\n\t} catch {\n\t\treturn undefined\n\t}\n}\n","// SemVer 2.0.0, strictly: https://semver.org. The same grammar the `semver` Postgres extension stores,\n// so a version the form accepts is one the column takes, and the two order versions alike.\nconst SEMVER =\n\t/^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/\n\nconst NUMBER = /^(0|[1-9]\\d*)$/\nconst NUMBER_SO_FAR = /^(0|[1-9]\\d*)?$/\nconst PRERELEASE_IDENTIFIER = /^(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)$/\nconst BUILD_IDENTIFIER = /^[0-9a-zA-Z-]+$/\n// Any run of identifier characters can still become an identifier: `01` is not one, but `01a` is.\nconst IDENTIFIER_SO_FAR = /^[0-9a-zA-Z-]*$/\n\n/**\n * Whether the text is a version under SemVer 2.0.0: `1.4.0`, `1.4.0-beta.2`, `1.4.0+build.5`. A `v`\n * prefix, a missing part (`1.4`) and a leading zero (`01.4.0`) are not.\n * @param text - The text to check\n * @public\n */\nexport function isSemver(text: string): boolean {\n\treturn SEMVER.test(text)\n}\n\nconst splitOnce = (text: string, separator: string): [string, string | undefined] => {\n\tconst index = text.indexOf(separator)\n\treturn index === -1 ? [text, undefined] : [text.slice(0, index), text.slice(index + 1)]\n}\n\n/** Whether each dot-separated part before the last matches `whole`, and the last matches `last`. */\nconst partsMatch = (text: string, whole: RegExp, last: RegExp): boolean => {\n\tconst parts = text.split('.')\n\tconst typing = parts.pop() ?? ''\n\treturn parts.every(part => whole.test(part)) && last.test(typing)\n}\n\n/**\n * Whether typing more could still make the text a version: `1.`, `1.4.0-` and the empty text can,\n * while `v1`, `01` and `1.4-beta` cannot. Every version passes, so a box that refuses any edit failing\n * this one never stops someone typing a version.\n * @param text - The text so far\n * @public\n */\nexport function isSemverPrefix(text: string): boolean {\n\t// Neither `+` nor `-` can appear in the numbers, so the first of each ends the part before it.\n\tconst [head, build] = splitOnce(text, '+')\n\tconst [core, prerelease] = splitOnce(head, '-')\n\n\tconst coreDone = prerelease !== undefined || build !== undefined\n\tconst numbers = core.split('.').length\n\tif (numbers > 3 || (coreDone && numbers < 3)) return false\n\tif (!partsMatch(core, NUMBER, coreDone ? NUMBER : NUMBER_SO_FAR)) return false\n\n\tif (prerelease !== undefined) {\n\t\tconst last = build === undefined ? IDENTIFIER_SO_FAR : PRERELEASE_IDENTIFIER\n\t\tif (!partsMatch(prerelease, PRERELEASE_IDENTIFIER, last)) return false\n\t}\n\n\treturn build === undefined || partsMatch(build, BUILD_IDENTIFIER, IDENTIFIER_SO_FAR)\n}\n\n// Digits without leading zeros, compared without converting, so no version is too big to order.\nconst compareDigits = (a: string, b: string): number => a.length - b.length || (a < b ? -1 : a > b ? 1 : 0)\n\nconst compareIdentifiers = (a: string, b: string): number => {\n\tconst aNumeric = /^\\d+$/.test(a)\n\tconst bNumeric = /^\\d+$/.test(b)\n\tif (aNumeric && bNumeric) return compareDigits(a, b)\n\tif (aNumeric !== bNumeric) return aNumeric ? -1 : 1\n\treturn a < b ? -1 : a > b ? 1 : 0\n}\n\nconst comparePrereleases = (a: string | undefined, b: string | undefined): number => {\n\tif (a === b) return 0\n\t// A prerelease comes before its release.\n\tif (a === undefined) return 1\n\tif (b === undefined) return -1\n\n\tconst left = a.split('.')\n\tconst right = b.split('.')\n\tfor (let i = 0; i < Math.min(left.length, right.length); i++) {\n\t\tconst order = compareIdentifiers(left[i], right[i])\n\t\tif (order) return order\n\t}\n\treturn left.length - right.length\n}\n\n/**\n * Orders two versions by SemVer 2.0.0 precedence: major, minor and patch as numbers, a prerelease\n * before its release, and prerelease identifiers one by one. Build metadata does not count, so\n * `1.4.0+a` and `1.4.0+b` compare equal. Text that is not a version comes after every version.\n * @param a - The first version\n * @param b - The second version\n * @returns Negative when `a` comes first, positive when `b` does, zero when neither\n * @public\n */\nexport function compareSemver(a: string, b: string): number {\n\tconst left = SEMVER.exec(a)\n\tconst right = SEMVER.exec(b)\n\tif (!left || !right) return Number(!left) - Number(!right)\n\n\tfor (let part = 1; part <= 3; part++) {\n\t\tconst order = compareDigits(left[part], right[part])\n\t\tif (order) return order\n\t}\n\treturn comparePrereleases(left[4], right[4])\n}\n","import { App } from 'vue'\n\nimport { defaultKeypressHandlers, useKeyboardNav } from './composables/keyboard'\nimport { fromISODate } from './dates'\nimport { compareSemver, isSemver, isSemverPrefix } from './semver'\nexport type * from './types'\n\n/**\n * Install all utility components\n * @param _app - Vue app instance\n * @public\n */\nfunction install(_app: App /* options */) {}\n\nexport { compareSemver, defaultKeypressHandlers, fromISODate, install, isSemver, isSemverPrefix, useKeyboardNav }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,qBACf,SACA,EAAE,SAAS,eAAe,iBAA8C,CAAC,GACxE;CACD,MAAM,mBAAmB,IAAI,KAAK;CAElC,MAAM,qBAAqB;EAC1B,IAAI,CAAC,QAAQ;EAEb,MAAM,WAAW,OAAO;EACxB,MAAM,KAAK,aAAa,OAAO;EAC/B,IAAI,CAAC,IACJ,iBAAiB,QAAQ;OACnB;GACN,MAAM,OAAO,GAAG,sBAAsB;GACtC,iBAAiB,QAChB,KAAK,QAAQ,OAAO,eAAe,SAAS,gBAAgB,iBAC5D,KAAK,SAAS,OAAO,cAAc,SAAS,gBAAgB,gBAC5D,KAAK,UAAU,KACf,KAAK,SAAS;EAChB;CACD;CAEA,YACO,aAAa,OAAO,SACpB,aAAa,GACnB;EAAE,WAAW;EAAM,OAAO;CAAO,CAClC;CAEA,IAAI,QACH,iBAAiB,gBAAgB,QAAQ,UAAU,cAAc;EAChE,SAAS;EACT,SAAS;CACV,CAAC;CAGF,OAAO;AACR;;;AC5DA,IAAM,aAAa,YAAyB;CAC3C,IAAI,UAAU,qBAAqB,OAAO,CAAC,CAAC;CAC5C,UAAU,WAAW,QAAQ,eAAe;CAC5C,OAAO;AACR;AAEA,IAAM,eAAe,YAAyB;CAC7C,OAAO,QAAQ,YAAY;AAC5B;AAGA,IAAM,aAAa,UAAyB;CAC3C,IAAI,EAA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KAAK;CAClD,OAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;AACjC;AAEA,IAAM,sBAAsB,GAAuB,MAAkC;CACpF,IAAI,MAAM,GAAG,OAAO;CAEpB,IAAI,MAAM,KAAA,GAAW,OAAO;CAC5B,IAAI,MAAM,KAAA,GAAW,OAAO;CAE5B,MAAM,OAAO,EAAE,MAAM,GAAG;CACxB,MAAM,QAAQ,EAAE,MAAM,GAAG;CACzB,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,IAAI,KAAK,QAAQ,MAAM,MAAM,GAAG,KAAK;EAC7D,MAAM,QAAQ,mBAAmB,KAAK,IAAI,MAAM,EAAE;EAClD,IAAI,OAAO,OAAO;CACnB;CACA,OAAO,KAAK,SAAS,MAAM;AAC5B;;;;;;;;;;AAWA,SAAgB,cAAc,GAAW,GAAmB;CAC3D,MAAM,OAAO,OAAO,KAAK,CAAC;CAC1B,MAAM,QAAQ,OAAO,KAAK,CAAC;CAC3B,IAAI,CAAC,QAAQ,CAAC,OAAO,OAAO,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,KAAK;CAEzD,KAAK,IAAI,OAAO,GAAG,QAAQ,GAAG,QAAQ;EACrC,MAAM,QAAQ,cAAc,KAAK,OAAO,MAAM,KAAK;EACnD,IAAI,OAAO,OAAO;CACnB;CACA,OAAO,mBAAmB,KAAK,IAAI,MAAM,EAAE;AAC5C;;;;;;;;AC5FA,SAAS,QAAQ,MAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/utilities",
3
- "version": "0.40.0",
3
+ "version": "0.41.1",
4
4
  "description": "Shared utility functions for Stonecrop",
5
5
  "keywords": [
6
6
  "helpers",