@stonecrop/utilities 0.47.0 → 0.48.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.
- package/dist/utilities.d.ts +7 -0
- package/dist/utilities.js +19 -2
- package/dist/utilities.js.map +1 -1
- package/package.json +11 -13
package/dist/utilities.d.ts
CHANGED
|
@@ -61,6 +61,13 @@ export declare function formatCurrencyAmountInput(amount: number | null | undefi
|
|
|
61
61
|
*/
|
|
62
62
|
export declare function formatCurrencyCell(value: unknown): string;
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* The mark that names a currency beside an amount: the symbol `Intl` formats a valid ISO code with,
|
|
66
|
+
* as {@link formatCurrencyAmount} does; otherwise its symbol, display text, or id.
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export declare function formatCurrencySymbol(currency: CurrencyLike | undefined): string;
|
|
70
|
+
|
|
64
71
|
/**
|
|
65
72
|
* Render a composite quantity value for table cells. Omits the UOM when it matches `stockUom`.
|
|
66
73
|
* @public
|
package/dist/utilities.js
CHANGED
|
@@ -596,10 +596,27 @@ function formatCurrencyAmount(amount, currency) {
|
|
|
596
596
|
currencyDisplay: "symbol"
|
|
597
597
|
}).format(amount);
|
|
598
598
|
} catch {}
|
|
599
|
-
const suffix = currency
|
|
599
|
+
const suffix = formatCurrencySymbol(currency);
|
|
600
600
|
return suffix ? `${amount} ${suffix}`.trim() : String(amount);
|
|
601
601
|
}
|
|
602
602
|
/**
|
|
603
|
+
* The mark that names a currency beside an amount: the symbol `Intl` formats a valid ISO code with,
|
|
604
|
+
* as {@link formatCurrencyAmount} does; otherwise its symbol, display text, or id.
|
|
605
|
+
* @public
|
|
606
|
+
*/
|
|
607
|
+
function formatCurrencySymbol(currency) {
|
|
608
|
+
const id = currency?.id != null ? String(currency.id) : "";
|
|
609
|
+
if (id) try {
|
|
610
|
+
const symbol = new Intl.NumberFormat(void 0, {
|
|
611
|
+
style: "currency",
|
|
612
|
+
currency: id,
|
|
613
|
+
currencyDisplay: "symbol"
|
|
614
|
+
}).formatToParts(0).find((part) => part.type === "currency")?.value;
|
|
615
|
+
if (symbol) return symbol;
|
|
616
|
+
} catch {}
|
|
617
|
+
return currency?.symbol ?? currency?.displayText ?? id;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
603
620
|
* Render a composite quantity value for table cells. Omits the UOM when it matches `stockUom`.
|
|
604
621
|
* @public
|
|
605
622
|
*/
|
|
@@ -633,6 +650,6 @@ function formatCurrencyCell(value) {
|
|
|
633
650
|
*/
|
|
634
651
|
function install(_app) {}
|
|
635
652
|
//#endregion
|
|
636
|
-
export { compareSemver, currencyAmountEntryPattern, currencyInputFractionDigits, defaultKeypressHandlers, formatCurrencyAmount, formatCurrencyAmountInput, formatCurrencyCell, formatQuantityCell, fromISODate, install, isSemver, isSemverPrefix, parseCurrencyAmountInput, useKeyboardNav };
|
|
653
|
+
export { compareSemver, currencyAmountEntryPattern, currencyInputFractionDigits, defaultKeypressHandlers, formatCurrencyAmount, formatCurrencyAmountInput, formatCurrencyCell, formatCurrencySymbol, formatQuantityCell, fromISODate, install, isSemver, isSemverPrefix, parseCurrencyAmountInput, useKeyboardNav };
|
|
637
654
|
|
|
638
655
|
//# sourceMappingURL=utilities.js.map
|
package/dist/utilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","names":[],"sources":["../src/composables/visibility/index.ts","../src/composables/keyboard.ts","../src/dates.ts","../src/semver.ts","../src/currencyAmountFormat.ts","../src/denominatedFormat.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/** When focus is on a control inside a cell, grid navigation still uses the owning `<td>`. */\nconst resolveNavCell = (element: HTMLElement): HTMLElement => {\n\tif (element instanceof HTMLTableCellElement) {\n\t\treturn element\n\t}\n\tconst cell = element.closest('td, th')\n\tif (cell instanceof HTMLTableCellElement) {\n\t\treturn cell\n\t}\n\treturn element\n}\n\n// navigation functions\nconst getUpCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getUpCellEl(resolveNavCell(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 = resolveNavCell(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(resolveNavCell(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 = resolveNavCell(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(resolveNavCell(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(resolveNavCell(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 = resolveNavCell(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 = resolveNavCell(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 = resolveNavCell(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 = resolveNavCell(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","/**\n * Fraction digits for a currency in amount inputs (e.g. JPY → 0).\n * @public\n */\nexport function currencyInputFractionDigits(currencyId: string | undefined): number {\n\tconst id = currencyId?.toUpperCase() ?? ''\n\tif (!id) return 2\n\ttry {\n\t\treturn (\n\t\t\tnew Intl.NumberFormat('en-US', {\n\t\t\t\tstyle: 'currency',\n\t\t\t\tcurrency: id,\n\t\t\t}).resolvedOptions().maximumFractionDigits ?? 2\n\t\t)\n\t} catch {\n\t\treturn 2\n\t}\n}\n\nfunction separatorsForLocale(locale: string | undefined): { group: string; decimal: string } {\n\tconst parts = new Intl.NumberFormat(locale).formatToParts(1234567.89)\n\treturn {\n\t\tgroup: parts.find(part => part.type === 'group')?.value ?? ',',\n\t\tdecimal: parts.find(part => part.type === 'decimal')?.value ?? '.',\n\t}\n}\n\n/**\n * Format a numeric amount for display in a currency amount field (no currency symbol). The currency\n * sets the decimals; the separators are the locale's, as in the table cell.\n * @param locale - The browser's own when omitted\n * @public\n */\nexport function formatCurrencyAmountInput(\n\tamount: number | null | undefined,\n\tcurrencyId: string | undefined,\n\tlocale?: string\n): string {\n\tif (amount === null || amount === undefined) return ''\n\tconst id = currencyId?.toUpperCase() ?? ''\n\tconst fractionDigits = currencyInputFractionDigits(id)\n\treturn new Intl.NumberFormat(locale, {\n\t\tminimumFractionDigits: fractionDigits,\n\t\tmaximumFractionDigits: fractionDigits,\n\t\tuseGrouping: id !== 'JPY',\n\t}).format(amount)\n}\n\n/**\n * Parse user-entered text in a currency amount field back to a number, read with the separators the\n * field writes it with.\n * @param locale - The browser's own when omitted\n * @public\n */\nexport function parseCurrencyAmountInput(text: string, locale?: string): number | null {\n\tconst { group, decimal } = separatorsForLocale(locale)\n\tconst normalized = text\n\t\t.replace(/\\s/g, '')\n\t\t.replace(/[^\\d.,\\-+]/g, '')\n\t\t.replaceAll(group, '')\n\t\t.replace(decimal, '.')\n\t// No digits is no amount, though `Number('')` is 0.\n\tif (!/\\d/.test(normalized)) return null\n\tconst value = Number(normalized)\n\treturn Number.isFinite(value) ? value : null\n}\n\n/**\n * What a masked currency amount field may hold while it is typed in: digits and grouping marks, then at most one\n * decimal point followed by digits.\n * @param locale - The browser's own when omitted\n * @public\n */\nexport function currencyAmountEntryPattern(currencyId: string | undefined, locale?: string): RegExp {\n\tconst { group, decimal } = separatorsForLocale(locale)\n\tconst escape = (mark: string) => mark.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\tconst whole = `-?[\\\\d${escape(group)}]*`\n\tif (currencyInputFractionDigits(currencyId) === 0) return new RegExp(`^${whole}$`)\n\t// US-style keyboards often paste/type '.' even when the locale decimal is ','.\n\tconst point = decimal === '.' ? '\\\\.' : `[${escape(decimal)}.]`\n\treturn new RegExp(`^${whole}(?:${point}\\\\d*)?$`)\n}\n","type CurrencyLike = {\n\tid?: string | number\n\tsymbol?: string\n\tdisplayText?: string\n}\n\nfunction displayScalar(value: unknown): string {\n\tif (typeof value === 'string') return value\n\tif (typeof value === 'number' || typeof value === 'bigint') return String(value)\n\tif (typeof value === 'boolean') return String(value)\n\treturn ''\n}\n\nfunction displayQty(qty: unknown): string {\n\tif (qty === null || qty === undefined || qty === '') return ''\n\treturn displayScalar(qty)\n}\n\n/**\n * Format a currency amount for display (forms, table cells). Uses `Intl` when `currency.id` is a\n * valid ISO code; otherwise falls back to symbol, display text, or id.\n * @public\n */\nexport function formatCurrencyAmount(amount: number | null | undefined, currency: CurrencyLike | undefined): string {\n\tif (amount === null || amount === undefined) return ''\n\tconst id = currency?.id != null ? String(currency.id) : ''\n\tif (id) {\n\t\ttry {\n\t\t\treturn new Intl.NumberFormat(undefined, {\n\t\t\t\tstyle: 'currency',\n\t\t\t\tcurrency: id,\n\t\t\t\tcurrencyDisplay: 'symbol',\n\t\t\t}).format(amount)\n\t\t} catch {\n\t\t\t// Not a valid ISO 4217 code — fall through to symbol / displayText.\n\t\t}\n\t}\n\tconst suffix = currency?.symbol ?? currency?.displayText ?? id\n\treturn suffix ? `${amount} ${suffix}`.trim() : String(amount)\n}\n\n/**\n * Render a composite quantity value for table cells. Omits the UOM when it matches `stockUom`.\n * @public\n */\nexport function formatQuantityCell(value: unknown): string {\n\tif (value === null || value === undefined) return ''\n\tif (typeof value !== 'object') return displayScalar(value)\n\tconst record = value as { qty?: unknown; uom?: string; stockUom?: string }\n\tconst qtyText = displayQty(record.qty)\n\tconst uom = record.uom ?? ''\n\tconst stockUom = record.stockUom ?? ''\n\tif (!uom) return qtyText\n\tif (stockUom && uom === stockUom) return qtyText\n\treturn `${qtyText} ${uom}`.trim()\n}\n\n/**\n * Render a composite currency value for table cells.\n * @public\n */\nexport function formatCurrencyCell(value: unknown): string {\n\tif (value === null || value === undefined) return ''\n\tif (typeof value !== 'object') return displayScalar(value)\n\tconst record = value as { amount?: number | null; currency?: CurrencyLike }\n\treturn formatCurrencyAmount(record.amount, record.currency)\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 {\n\tcurrencyAmountEntryPattern,\n\tcurrencyInputFractionDigits,\n\tformatCurrencyAmountInput,\n\tparseCurrencyAmountInput,\n} from './currencyAmountFormat'\nexport { formatCurrencyAmount, formatCurrencyCell, formatQuantityCell } from './denominatedFormat'\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;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KAAA,KAAa,QAAQ,IAAI,OAAO;CAC5D,OAAO,cAAc,GAAG;AACzB;;;;;;AAOA,SAAgB,qBAAqB,QAAmC,UAA4C;CACnH,IAAI,WAAW,QAAQ,WAAW,KAAA,GAAW,OAAO;CACpD,MAAM,KAAK,UAAU,MAAM,OAAO,OAAO,SAAS,EAAE,IAAI;CACxD,IAAI,IACH,IAAI;EACH,OAAO,IAAI,KAAK,aAAa,KAAA,GAAW;GACvC,OAAO;GACP,UAAU;GACV,iBAAiB;EAClB,CAAC,CAAC,CAAC,OAAO,MAAM;CACjB,QAAQ,CAER;CAED,MAAM,SAAS,UAAU,UAAU,UAAU,eAAe;CAC5D,OAAO,SAAS,GAAG,OAAO,GAAG,SAAS,KAAK,IAAI,OAAO,MAAM;AAC7D;;;;;AAMA,SAAgB,mBAAmB,OAAwB;CAC1D,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,cAAc,KAAK;CACzD,MAAM,SAAS;CACf,MAAM,UAAU,WAAW,OAAO,GAAG;CACrC,MAAM,MAAM,OAAO,OAAO;CAC1B,MAAM,WAAW,OAAO,YAAY;CACpC,IAAI,CAAC,KAAK,OAAO;CACjB,IAAI,YAAY,QAAQ,UAAU,OAAO;CACzC,OAAO,GAAG,QAAQ,GAAG,MAAM,KAAK;AACjC;;;;;AAMA,SAAgB,mBAAmB,OAAwB;CAC1D,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,cAAc,KAAK;CACzD,MAAM,SAAS;CACf,OAAO,qBAAqB,OAAO,QAAQ,OAAO,QAAQ;AAC3D;;;;;;;;ACtDA,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/currencyAmountFormat.ts","../src/denominatedFormat.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/** When focus is on a control inside a cell, grid navigation still uses the owning `<td>`. */\nconst resolveNavCell = (element: HTMLElement): HTMLElement => {\n\tif (element instanceof HTMLTableCellElement) {\n\t\treturn element\n\t}\n\tconst cell = element.closest('td, th')\n\tif (cell instanceof HTMLTableCellElement) {\n\t\treturn cell\n\t}\n\treturn element\n}\n\n// navigation functions\nconst getUpCell = (event: KeyboardEvent) => {\n\tif (!(event.target instanceof HTMLElement)) return undefined\n\treturn getUpCellEl(resolveNavCell(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 = resolveNavCell(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(resolveNavCell(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 = resolveNavCell(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(resolveNavCell(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(resolveNavCell(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 = resolveNavCell(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 = resolveNavCell(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 = resolveNavCell(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 = resolveNavCell(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","/**\n * Fraction digits for a currency in amount inputs (e.g. JPY → 0).\n * @public\n */\nexport function currencyInputFractionDigits(currencyId: string | undefined): number {\n\tconst id = currencyId?.toUpperCase() ?? ''\n\tif (!id) return 2\n\ttry {\n\t\treturn (\n\t\t\tnew Intl.NumberFormat('en-US', {\n\t\t\t\tstyle: 'currency',\n\t\t\t\tcurrency: id,\n\t\t\t}).resolvedOptions().maximumFractionDigits ?? 2\n\t\t)\n\t} catch {\n\t\treturn 2\n\t}\n}\n\nfunction separatorsForLocale(locale: string | undefined): { group: string; decimal: string } {\n\tconst parts = new Intl.NumberFormat(locale).formatToParts(1234567.89)\n\treturn {\n\t\tgroup: parts.find(part => part.type === 'group')?.value ?? ',',\n\t\tdecimal: parts.find(part => part.type === 'decimal')?.value ?? '.',\n\t}\n}\n\n/**\n * Format a numeric amount for display in a currency amount field (no currency symbol). The currency\n * sets the decimals; the separators are the locale's, as in the table cell.\n * @param locale - The browser's own when omitted\n * @public\n */\nexport function formatCurrencyAmountInput(\n\tamount: number | null | undefined,\n\tcurrencyId: string | undefined,\n\tlocale?: string\n): string {\n\tif (amount === null || amount === undefined) return ''\n\tconst id = currencyId?.toUpperCase() ?? ''\n\tconst fractionDigits = currencyInputFractionDigits(id)\n\treturn new Intl.NumberFormat(locale, {\n\t\tminimumFractionDigits: fractionDigits,\n\t\tmaximumFractionDigits: fractionDigits,\n\t\tuseGrouping: id !== 'JPY',\n\t}).format(amount)\n}\n\n/**\n * Parse user-entered text in a currency amount field back to a number, read with the separators the\n * field writes it with.\n * @param locale - The browser's own when omitted\n * @public\n */\nexport function parseCurrencyAmountInput(text: string, locale?: string): number | null {\n\tconst { group, decimal } = separatorsForLocale(locale)\n\tconst normalized = text\n\t\t.replace(/\\s/g, '')\n\t\t.replace(/[^\\d.,\\-+]/g, '')\n\t\t.replaceAll(group, '')\n\t\t.replace(decimal, '.')\n\t// No digits is no amount, though `Number('')` is 0.\n\tif (!/\\d/.test(normalized)) return null\n\tconst value = Number(normalized)\n\treturn Number.isFinite(value) ? value : null\n}\n\n/**\n * What a masked currency amount field may hold while it is typed in: digits and grouping marks, then at most one\n * decimal point followed by digits.\n * @param locale - The browser's own when omitted\n * @public\n */\nexport function currencyAmountEntryPattern(currencyId: string | undefined, locale?: string): RegExp {\n\tconst { group, decimal } = separatorsForLocale(locale)\n\tconst escape = (mark: string) => mark.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n\tconst whole = `-?[\\\\d${escape(group)}]*`\n\tif (currencyInputFractionDigits(currencyId) === 0) return new RegExp(`^${whole}$`)\n\t// US-style keyboards often paste/type '.' even when the locale decimal is ','.\n\tconst point = decimal === '.' ? '\\\\.' : `[${escape(decimal)}.]`\n\treturn new RegExp(`^${whole}(?:${point}\\\\d*)?$`)\n}\n","type CurrencyLike = {\n\tid?: string | number\n\tsymbol?: string\n\tdisplayText?: string\n}\n\nfunction displayScalar(value: unknown): string {\n\tif (typeof value === 'string') return value\n\tif (typeof value === 'number' || typeof value === 'bigint') return String(value)\n\tif (typeof value === 'boolean') return String(value)\n\treturn ''\n}\n\nfunction displayQty(qty: unknown): string {\n\tif (qty === null || qty === undefined || qty === '') return ''\n\treturn displayScalar(qty)\n}\n\n/**\n * Format a currency amount for display (forms, table cells). Uses `Intl` when `currency.id` is a\n * valid ISO code; otherwise falls back to symbol, display text, or id.\n * @public\n */\nexport function formatCurrencyAmount(amount: number | null | undefined, currency: CurrencyLike | undefined): string {\n\tif (amount === null || amount === undefined) return ''\n\tconst id = currency?.id != null ? String(currency.id) : ''\n\tif (id) {\n\t\ttry {\n\t\t\treturn new Intl.NumberFormat(undefined, {\n\t\t\t\tstyle: 'currency',\n\t\t\t\tcurrency: id,\n\t\t\t\tcurrencyDisplay: 'symbol',\n\t\t\t}).format(amount)\n\t\t} catch {\n\t\t\t// Not a valid ISO 4217 code — fall through to symbol / displayText.\n\t\t}\n\t}\n\tconst suffix = formatCurrencySymbol(currency)\n\treturn suffix ? `${amount} ${suffix}`.trim() : String(amount)\n}\n\n/**\n * The mark that names a currency beside an amount: the symbol `Intl` formats a valid ISO code with,\n * as {@link formatCurrencyAmount} does; otherwise its symbol, display text, or id.\n * @public\n */\nexport function formatCurrencySymbol(currency: CurrencyLike | undefined): string {\n\tconst id = currency?.id != null ? String(currency.id) : ''\n\tif (id) {\n\t\ttry {\n\t\t\tconst parts = new Intl.NumberFormat(undefined, {\n\t\t\t\tstyle: 'currency',\n\t\t\t\tcurrency: id,\n\t\t\t\tcurrencyDisplay: 'symbol',\n\t\t\t}).formatToParts(0)\n\t\t\tconst symbol = parts.find(part => part.type === 'currency')?.value\n\t\t\tif (symbol) return symbol\n\t\t} catch {\n\t\t\t// Not a valid ISO 4217 code — fall through to symbol / displayText.\n\t\t}\n\t}\n\treturn currency?.symbol ?? currency?.displayText ?? id\n}\n\n/**\n * Render a composite quantity value for table cells. Omits the UOM when it matches `stockUom`.\n * @public\n */\nexport function formatQuantityCell(value: unknown): string {\n\tif (value === null || value === undefined) return ''\n\tif (typeof value !== 'object') return displayScalar(value)\n\tconst record = value as { qty?: unknown; uom?: string; stockUom?: string }\n\tconst qtyText = displayQty(record.qty)\n\tconst uom = record.uom ?? ''\n\tconst stockUom = record.stockUom ?? ''\n\tif (!uom) return qtyText\n\tif (stockUom && uom === stockUom) return qtyText\n\treturn `${qtyText} ${uom}`.trim()\n}\n\n/**\n * Render a composite currency value for table cells.\n * @public\n */\nexport function formatCurrencyCell(value: unknown): string {\n\tif (value === null || value === undefined) return ''\n\tif (typeof value !== 'object') return displayScalar(value)\n\tconst record = value as { amount?: number | null; currency?: CurrencyLike }\n\treturn formatCurrencyAmount(record.amount, record.currency)\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 {\n\tcurrencyAmountEntryPattern,\n\tcurrencyInputFractionDigits,\n\tformatCurrencyAmountInput,\n\tparseCurrencyAmountInput,\n} from './currencyAmountFormat'\nexport { formatCurrencyAmount, formatCurrencyCell, formatCurrencySymbol, formatQuantityCell } from './denominatedFormat'\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,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C7D;;;;;;AAOA,SAAgB,qBAAqB,UAA4C;CAChF,MAAM,KAAK,UAAU,MAAM,OAAO,OAAO,SAAS,EAAE,IAAI;CACxD,IAAI,IACH,IAAI;EAMH,MAAM,SALQ,IAAI,KAAK,aAAa,KAAA,GAAW;GAC9C,OAAO;GACP,UAAU;GACV,iBAAiB;EAClB,CAAC,CAAC,CAAC,cAAc,CACF,CAAA,CAAM,MAAK,SAAQ,KAAK,SAAS,UAAU,CAAC,EAAE;EAC7D,IAAI,QAAQ,OAAO;CACpB,QAAQ,CAER;CAED,OAAO,UAAU,UAAU,UAAU,eAAe;AACrD;;;;;AAMA,SAAgB,mBAAmB,OAAwB;CAC1D,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,cAAc,KAAK;CACzD,MAAM,SAAS;CACf,MAAM,UAAU,WAAW,OAAO,GAAG;CACrC,MAAM,MAAM,OAAO,OAAO;CAC1B,MAAM,WAAW,OAAO,YAAY;CACpC,IAAI,CAAC,KAAK,OAAO;CACjB,IAAI,YAAY,QAAQ,UAAU,OAAO;CACzC,OAAO,GAAG,QAAQ,GAAG,MAAM,KAAK;AACjC;;;;;AAMA,SAAgB,mBAAmB,OAAwB;CAC1D,IAAI,UAAU,QAAQ,UAAU,KAAA,GAAW,OAAO;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,cAAc,KAAK;CACzD,MAAM,SAAS;CACf,OAAO,qBAAqB,OAAO,QAAQ,OAAO,QAAQ;AAC3D;;;;;;;;AC7EA,SAAS,QAAQ,MAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/utilities",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.1",
|
|
4
4
|
"description": "Shared utility functions for Stonecrop",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"helpers",
|
|
@@ -46,14 +46,12 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@microsoft/api-extractor": "^7.58.7",
|
|
48
48
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
49
|
-
"@vitest/coverage-istanbul": "5.0.
|
|
49
|
+
"@vitest/coverage-istanbul": "5.0.5",
|
|
50
50
|
"@vue/test-utils": "^2.4.10",
|
|
51
51
|
"jsdom": "^29.1.1",
|
|
52
|
-
"oxlint": "1.67.0",
|
|
53
|
-
"oxlint-tsgolint": "0.23.0",
|
|
54
52
|
"typescript": "^6.0.3",
|
|
55
|
-
"vite": "
|
|
56
|
-
"vitest": "5.0.
|
|
53
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.3.0",
|
|
54
|
+
"vitest": "5.0.5",
|
|
57
55
|
"vue": "^3.5.33",
|
|
58
56
|
"vue-router": "^5.0.6"
|
|
59
57
|
},
|
|
@@ -64,13 +62,13 @@
|
|
|
64
62
|
"node": ">=24.0.0"
|
|
65
63
|
},
|
|
66
64
|
"scripts": {
|
|
67
|
-
"dev": "
|
|
65
|
+
"dev": "vp build --watch",
|
|
68
66
|
"docs": "bash ../tools/scripts/run-docs.sh utilities",
|
|
69
|
-
"lint": "
|
|
70
|
-
"lint:fix": "
|
|
71
|
-
"preview": "
|
|
72
|
-
"test": "
|
|
73
|
-
"test:coverage": "
|
|
74
|
-
"test:watch": "
|
|
67
|
+
"lint": "vp lint",
|
|
68
|
+
"lint:fix": "vp lint --fix",
|
|
69
|
+
"preview": "vp preview",
|
|
70
|
+
"test": "vp test run --coverage.enabled false",
|
|
71
|
+
"test:coverage": "vp test run --coverage",
|
|
72
|
+
"test:watch": "vp test watch"
|
|
75
73
|
}
|
|
76
74
|
}
|