@astryx-vue/core 0.19.1 → 0.20.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/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-CNb0dkY9.js → AlertDialog-DYYA2LOe.js} +6 -6
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-NvIT99xw.js → AppShell-zEXmJb1h.js} +116 -9
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-BXITu2pn.js → Banner-C4ZICVvW.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-CCW58Kl3.js → BottomSheet-DNuzJPfQ.js} +2 -2
- package/dist/{BottomSheet-HQpcSkPH.js → BottomSheet-DV7bboru.js} +1 -1
- package/dist/Breadcrumbs/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-DXzBkpkd.js → Breadcrumbs-C8nA3Ft9.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-BZtim0B-.js → Button-DOfigN38.js} +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-EpWZowJP.js → ButtonGroup-BzrDhbMP.js} +2 -2
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-BaCXqtKK.js → Carousel-CRaHAUsZ.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-CXwXzlZ0.js → Chat-DTs843Ta.js} +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-3ONBl1AY.js → CheckboxInput-Ydl1GSBh.js} +33 -3
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CbRX5YDA.js → CheckboxList-Sn_ph-Xz.js} +64 -5
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CLVXVlB7.js → CodeBlock-DXBJEZS6.js} +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-ExzU7vC0.js → Collapsible-BG-u5nEt.js} +2 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-CECjNvGB.js → CommandPalette-CV7t0ouM.js} +1 -1
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-Dmaag1wm.js → ComplexSelector-BKjyFdHr.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-CujLDt4e.js → ContextMenu-CwnY6hcJ.js} +2 -2
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-CiIWOWXM.js → DateInput-BaX40vSs.js} +4 -4
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-CLVQ8E0Y.js → DateRangeInput-DplhXZqK.js} +3 -3
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-jHSN-Dzu.js → DateTimeInput-CrD1EEfs.js} +7 -7
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-BQ5OBB1d.js → Dialog-B2pOTrnQ.js} +1 -1
- package/dist/{Dialog-DgdbRn2l.js → Dialog-CztWmbf8.js} +1 -1
- package/dist/{DialogHeader-D8234o9F.js → DialogHeader-CjHTNccL.js} +2 -2
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-Dqus7kUc.js → Drawer-DGIuMLms.js} +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-BC_zB9le.js → DropdownMenu-l9c562oA.js} +31 -8
- package/dist/{DropdownMenu-LQsXd-_V.js → DropdownMenu-r93pI0mD.js} +4 -4
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-Bw0kWfMi.js → EmptyState-nyV5XxMA.js} +2 -2
- package/dist/Field/index.js +3 -3
- package/dist/{Field-BXkGR8H0.js → Field-CIZdFzXr.js} +1 -1
- package/dist/{FieldInfoTip-DzpUxMDh.js → FieldInfoTip-eJSORVbp.js} +1 -1
- package/dist/{FieldLabel-DI7Yqdhf.js → FieldLabel-BoMSIOLF.js} +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BNHjbyQY.js → FileInput-DvGU92Sg.js} +2 -2
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-Oph-5DDq.js → Heading-Bo6A69fA.js} +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-Du2XBBAX.js → IconButton-oKXLxgYb.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-Bjw1ithP.js → InfoTip-DWC-vnT5.js} +1 -1
- package/dist/{InputClearButton-CED-zP2y.js → InputClearButton-CAitWZTk.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-D5PoL4cU.js → InputGroup-CeTKqJQn.js} +1 -1
- package/dist/{Item-CNR22qzk.js → Item-BSHDEJyh.js} +18 -10
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-RN_f7zRw.js → Lightbox-CesmEisI.js} +3 -3
- package/dist/Link/index.d.ts +1 -1
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-BJ6ZaKcj.js → ListItem-v1GFTbba.js} +1 -1
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DnnWjJGX.js → Markdown-CIA5ejYp.js} +2 -2
- package/dist/MobileNav/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-DlQmYaBx.js → MobileNavToggle-CKEOroi0.js} +75 -32
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-i80Ey9vR.js → MoreMenu-DcImQxyp.js} +3 -3
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-BK6nZweN.js → MultiSelector-DedRF-RL.js} +3 -3
- package/dist/{NavHeadingSurface-C17cbKn9.js → NavHeadingSurface-DZPa2px5.js} +19 -5
- package/dist/NavItem/index.d.ts +2 -2
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-BAe-tUG9.js → NavItem-CcbOJNnY.js} +18 -5
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-BsWTXomE.js → NumberInput-q9HP5L_V.js} +3 -3
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-DFQNX_Mb.js → Pagination-DfAHckUV.js} +1 -1
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CmAEizH-.js → Popover-D0jAIXkw.js} +3 -2
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-C2x4uuAM.js → PowerSearch-CU_MBQlC.js} +12 -12
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-FhoQMqg5.js → RadioGroup-Cm2n6M5C.js} +10 -2
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-DK2uXQ5S.js → RadioList-B5MaynOw.js} +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-BCvscZM9.js → SegmentedControl-D--5X0eZ.js} +9 -2
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-Bo7qkt1P.js → Selector-wcbEB7BC.js} +2 -2
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-CcZLUd7G.js → SideNav-CYlAzvrT.js} +512 -58
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DIgb8ogt.js → Slider-jgmpvIDe.js} +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-5toeiELX.js → Switch-YNk17Lct.js} +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-o3aGMDT1.js → Table-DcFujAPW.js} +12 -10
- package/dist/Text/index.js +2 -2
- package/dist/{Text-CiSw2pOi.js → Text-Bv4urzOW.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-B82oXF-m.js → TextArea-CixgkV__.js} +4 -4
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-_SIiqVOY.js → TextInput-Bpiq3FcP.js} +4 -4
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-BlueoqOH.js → Thumbnail-Bktyar_H.js} +1 -1
- package/dist/{TimeField-BM-rVFhC.js → TimeField-BtiLoHqW.js} +4 -4
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-CkZfhhAr.js → TimeInput-eyxw3KzD.js} +2 -2
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-DiIs5GLA.js → Timer-C-N-sElU.js} +2 -2
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-D9Jyk9sD.js → Timestamp-BTs10ZLD.js} +2 -2
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-D4Q6wvYu.js → Toast-DpMqZ72F.js} +1 -1
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-CO0XWWc0.js → ToggleButton-W_tpgZ8k.js} +3 -3
- package/dist/Token/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-CsFiYUJ_.js → Tokenizer-Bs1VXinx.js} +2 -2
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CFkThrKq.js → TopNav-CSFUTuyI.js} +3 -3
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-ugSF9DWj.js → TreeList-B8p_lI7a.js} +18 -9
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead--kEp21ut.js → Typeahead-Bh0nap5Z.js} +2 -2
- package/dist/{landing-Bs0aMIsR.js → batch-BJD6Bt-O.js} +42 -740
- package/dist/composables/index.js +4 -4
- package/dist/{composables-BgfubKnk.js → composables-CDrwFX0l.js} +2 -19
- package/dist/context-Cj_zItu2.js +729 -0
- package/dist/{dateParser-DS_a8Ej8.js → dateParser-BKoaawL9.js} +46 -2
- package/dist/edge-DIlkB7vS.js +164 -0
- package/dist/edgeRide-D0oC2JEB.js +499 -0
- package/dist/focusAcrossSwap-Casww_IY.js +19 -0
- package/dist/focusRegion-CmDg7_4b.js +81 -0
- package/dist/{handle-BPXdHbkr.js → handle-ChN2TMKH.js} +1 -1
- package/dist/{index-C93nwgTW.d.ts → index-51CkIKnI.d.ts} +1 -1
- package/dist/{index--kbwaSXW.d.ts → index-5Hrxeq2J.d.ts} +4 -4
- package/dist/{index-D-giO0SA.d.ts → index-B63NOJRc.d.ts} +8 -8
- package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
- package/dist/{index-CryFtTT6.d.ts → index-BIQZa2BD.d.ts} +1 -1
- package/dist/{index-CUCgbqBB.d.ts → index-BNtSmuWg.d.ts} +5 -5
- package/dist/{index-BO9TY87G.d.ts → index-BOCb89V9.d.ts} +3 -3
- package/dist/{index-Djf0M7PH.d.ts → index-BP2SjZiM.d.ts} +2 -2
- package/dist/{index-CdvmnNMH.d.ts → index-BaFphczL.d.ts} +1 -1
- package/dist/{index-CKUfpmFL.d.ts → index-C3FgFPrM.d.ts} +3 -1
- package/dist/{index-BeR-1LgF.d.ts → index-C5fbwY7Y.d.ts} +4 -3
- package/dist/{index-C4S65SAW.d.ts → index-CKnr0JlT.d.ts} +1 -1
- package/dist/{index-ohw86wfM.d.ts → index-CaE2cqeG.d.ts} +59 -55
- package/dist/{index-Otl047R1.d.ts → index-Cb-rvc1W.d.ts} +1 -1
- package/dist/{index-C9ZssPUV.d.ts → index-CiVrhGUJ.d.ts} +1 -1
- package/dist/{index-C8wfe0Mr.d.ts → index-D05JGsT3.d.ts} +1 -1
- package/dist/{index-B449gOMC.d.ts → index-D1JXm7Et.d.ts} +3 -3
- package/dist/{index-BL4mH8aK.d.ts → index-DMN_JVEt.d.ts} +1 -1
- package/dist/{index-aE810PYg.d.ts → index-DmAEpn5E.d.ts} +1 -1
- package/dist/{index-CfXW4km8.d.ts → index-GgHVkJtB.d.ts} +1 -1
- package/dist/{index-DdT2wE_N.d.ts → index-LaQSu7ST.d.ts} +7 -7
- package/dist/{index-eCp-ElSp.d.ts → index-MvrDMqnQ.d.ts} +1 -1
- package/dist/{index-B-3EGjfQ.d.ts → index-Q1oG9yIT.d.ts} +2 -2
- package/dist/{index-DE1genab.d.ts → index-QnlWyUxN.d.ts} +2 -2
- package/dist/{index-Dg0JsBpI.d.ts → index-Y-AmNzkO.d.ts} +2 -2
- package/dist/{index-dWlCpnua.d.ts → index-mK1ICsVg.d.ts} +1 -1
- package/dist/{index-B3yTdknp.d.ts → index-vCRf5fyK.d.ts} +3 -2
- package/dist/index.d.ts +29 -29
- package/dist/index.js +77 -77
- package/dist/landing-C7nc9JHm.js +104 -0
- package/dist/quietFinished-CKZXgsPM.js +19 -0
- package/dist/sharedMutationObserver-Dvh3N1N2.js +41 -0
- package/dist/{timeFormat-CqrwFE42.js → timeFormat-Cnd5vu5t.js} +1 -1
- package/dist/{timeParser-D9tCF_b3.js → timeParser-nVL5sIwT.js} +34 -5
- package/dist/{types-BG23kC3S.d.ts → types-C2ZuV4jf.d.ts} +7 -1
- package/dist/{useActionGroupTracking-DGeOIv3K.js → useActionGroupTracking-fwmxDcU3.js} +1 -1
- package/dist/{useFocusTrap-BUd-fvUH.js → useFocusTrap-DsYtRdmV.js} +2 -81
- package/dist/{useInputStatusIcon-ne9V7ZQC.js → useInputStatusIcon-CVGsNTi_.js} +1 -1
- package/dist/{useMenuDrillIn-BaNYxWiS.js → useMenuDrillIn-DaH0nhPa.js} +1 -1
- package/dist/{useTimeValue-CcKrnO8z.js → useTimeValue-8YfPQffv.js} +2 -2
- package/dist/{useTouchHitArea-BI-CtI7e.js → useTouchHitArea-BKZL6tHX.js} +48 -5
- package/dist/{useTruncation-C4pdlaXa.js → useTruncation-BxYAhQtF.js} +1 -40
- package/dist/{useTruncationTooltip-DwUQN7fD.js → useTruncationTooltip-DeCGRmot.js} +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/styles/mobile-nav.css +4 -2
- package/styles/nav-item.css +3 -3
- package/styles/side-nav.css +36 -8
- package/styles/touch-hit-area.css +28 -0
- package/styles/tree-list.css +9 -4
- package/dist/context-ZsDEkhSF.js +0 -24
- package/dist/{index-BqhgeAT4.d.ts → index-BJ9Wim6J.d.ts} +1 -1
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { t as unicodeRegExp } from "./unicodeRegExp-B7yQnpFC.js";
|
|
2
|
+
//#region src/utils/dateTimeFormatCache.ts
|
|
3
|
+
/** Options that print a time of day or a zone, which a PlainDate lacks. */
|
|
4
|
+
const TIME_OF_DAY_FIELDS = [
|
|
5
|
+
"timeZoneName",
|
|
6
|
+
"hour",
|
|
7
|
+
"minute",
|
|
8
|
+
"second",
|
|
9
|
+
"fractionalSecondDigits",
|
|
10
|
+
"dayPeriod",
|
|
11
|
+
"timeStyle"
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* One `Intl.DateTimeFormat` per locale and options, built on first use. A
|
|
15
|
+
* calendar formats each of a month's 42 day labels with the same options on
|
|
16
|
+
* every render, and building a formatter costs far more than using one. The
|
|
17
|
+
* options are keyed in a fixed order, so the same options written in another
|
|
18
|
+
* order share a formatter.
|
|
19
|
+
*/
|
|
20
|
+
const dateTimeFormats = /* @__PURE__ */ new Map();
|
|
21
|
+
/** @internal */
|
|
22
|
+
function dateTimeFormatFor(locale, options) {
|
|
23
|
+
const key = JSON.stringify([locale, Object.entries(options).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)]);
|
|
24
|
+
let format = dateTimeFormats.get(key);
|
|
25
|
+
if (format == null) {
|
|
26
|
+
format = new Intl.DateTimeFormat(locale, options);
|
|
27
|
+
dateTimeFormats.set(key, format);
|
|
28
|
+
}
|
|
29
|
+
return format;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
1
32
|
//#region src/utils/plainDate.ts
|
|
2
33
|
function plainDateCreate(year, month, day) {
|
|
3
34
|
if (!Number.isInteger(year) || year < 1) throw new RangeError(`year must be a positive integer, got ${year}`);
|
|
@@ -223,10 +254,20 @@ const DATE_FORMAT_SHORT_WITH_YEAR = {
|
|
|
223
254
|
* serialization, or any Astryx component's calendar semantics.
|
|
224
255
|
*/
|
|
225
256
|
function plainDateFormat(pd, options, locale = "en") {
|
|
226
|
-
|
|
257
|
+
const calendar = options.calendar ?? "gregory";
|
|
258
|
+
if (options.timeZone != null) return dateTimeFormatFor(locale, {
|
|
259
|
+
...options,
|
|
260
|
+
calendar
|
|
261
|
+
}).format(plainDateToDate(pd));
|
|
262
|
+
if (TIME_OF_DAY_FIELDS.some((field) => options[field] != null)) return new Intl.DateTimeFormat(locale, {
|
|
227
263
|
...options,
|
|
228
|
-
calendar
|
|
264
|
+
calendar
|
|
229
265
|
}).format(plainDateToDate(pd));
|
|
266
|
+
return dateTimeFormatFor(locale, {
|
|
267
|
+
...options,
|
|
268
|
+
calendar,
|
|
269
|
+
timeZone: "UTC"
|
|
270
|
+
}).format(utcTime(pd.year, pd.month - 1, pd.day));
|
|
230
271
|
}
|
|
231
272
|
/**
|
|
232
273
|
* The locale's name for the "week of year" date field ("week", "Woche", "週"),
|
|
@@ -280,6 +321,8 @@ function isLocaleDayFirst(locale = "en") {
|
|
|
280
321
|
const parts = new Intl.DateTimeFormat(locale, { calendar: "gregory" }).formatToParts(new Date(2e3, 0, 15));
|
|
281
322
|
return parts.findIndex((p) => p.type === "day") < parts.findIndex((p) => p.type === "month");
|
|
282
323
|
}
|
|
324
|
+
const LETTER_FREE = unicodeRegExp("^\\P{L}+$");
|
|
325
|
+
const YEAR_FIRST = unicodeRegExp("^\\d{4}[^\\p{L}\\d]");
|
|
283
326
|
/**
|
|
284
327
|
* Parses user input into a PlainDate.
|
|
285
328
|
*
|
|
@@ -336,6 +379,7 @@ function parseDateInput(input, locale = "en") {
|
|
|
336
379
|
return parseNumericDate(+first, +second, currentYear, locale);
|
|
337
380
|
}
|
|
338
381
|
if (/^\d+$/.test(trimmed)) return null;
|
|
382
|
+
if (isLocaleDayFirst(locale) && LETTER_FREE.test(trimmed) && !YEAR_FIRST.test(trimmed)) return null;
|
|
339
383
|
const parsed = new Date(trimmed);
|
|
340
384
|
if (!Number.isNaN(parsed.getTime())) {
|
|
341
385
|
const fromDate = plainDateFromDate(parsed);
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { C as ownScaleOf, D as glides, T as visibleRect, f as round, o as bandFor, u as takesPart, w as scaleOf } from "./batch-BJD6Bt-O.js";
|
|
2
|
+
//#region src/motion/layout/edge.ts
|
|
3
|
+
/** Whether `element` lays its inline axis out right to left. */
|
|
4
|
+
function isRtl(element) {
|
|
5
|
+
return element.ownerDocument.defaultView?.getComputedStyle(element).direction === "rtl";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The `clip-path` that hides `side` of an element from `edge`: `inset()`'s
|
|
9
|
+
* sides are physical (top, right, bottom, left), so an inline edge is
|
|
10
|
+
* mirrored right to left. `zero` is how the other three are written.
|
|
11
|
+
*/
|
|
12
|
+
function edgeClip(edge, side, zero, rtl) {
|
|
13
|
+
const sides = [
|
|
14
|
+
zero,
|
|
15
|
+
zero,
|
|
16
|
+
zero,
|
|
17
|
+
zero
|
|
18
|
+
];
|
|
19
|
+
const index = edge === "block-start" ? 0 : edge === "block-end" ? 2 : edge === "inline-end" !== rtl ? 1 : 3;
|
|
20
|
+
sides[index] = side;
|
|
21
|
+
return `inset(${sides.join(" ")})`;
|
|
22
|
+
}
|
|
23
|
+
/** A hidden fraction of the element, as a percentage clip on `edge`. */
|
|
24
|
+
function fractionClip(edge, hidden, rtl) {
|
|
25
|
+
return edgeClip(edge, `${round(hidden * 100)}%`, "0", rtl);
|
|
26
|
+
}
|
|
27
|
+
/** A hidden length of the element, in its own px, as a clip on `edge`. */
|
|
28
|
+
function pxClip(edge, hidden, rtl) {
|
|
29
|
+
return edgeClip(edge, `${hidden}px`, "0px", rtl);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The element's size along `edge`'s axis, in its own px (a scaled ancestor
|
|
33
|
+
* divided out), read from the layout the caller already laid out.
|
|
34
|
+
*/
|
|
35
|
+
function extentOf(element, edge) {
|
|
36
|
+
const rect = element.getBoundingClientRect();
|
|
37
|
+
const scale = scaleOf(element, rect);
|
|
38
|
+
return edge.startsWith("inline") ? rect.width / scale.x : rect.height / scale.y;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The parts that slide inside an element revealed or concealed from a block
|
|
42
|
+
* edge by `extent` px. They are its child elements that the band can show:
|
|
43
|
+
* the area's visible part plus one viewport, or `extent` if larger, above and
|
|
44
|
+
* below. A part past the band cannot come into view while it moves, so it
|
|
45
|
+
* stays. The walk stops at the first child below the band, so its cost grows
|
|
46
|
+
* with the changed size, never with the length of a list. A translation
|
|
47
|
+
* cannot move text on its own, so an element with text of its own keeps the
|
|
48
|
+
* clip (null).
|
|
49
|
+
*/
|
|
50
|
+
function slidingParts(element, edge, area, extent) {
|
|
51
|
+
if (!edge.startsWith("block") || !(extent > 0)) return null;
|
|
52
|
+
const view = element.ownerDocument.defaultView;
|
|
53
|
+
const style = view?.getComputedStyle(element);
|
|
54
|
+
if (view == null || style == null || paintsOwnBox(style) || ["::before", "::after"].some((pseudo) => {
|
|
55
|
+
const { content } = view.getComputedStyle(element, pseudo);
|
|
56
|
+
return content !== "" && content !== "none" && content !== "normal";
|
|
57
|
+
})) return null;
|
|
58
|
+
const visible = visibleRect(area);
|
|
59
|
+
const band = bandFor(visible, Math.max(view.innerHeight, extent));
|
|
60
|
+
const parts = [];
|
|
61
|
+
const scales = [];
|
|
62
|
+
for (let node = element.firstChild; node != null; node = node.nextSibling) {
|
|
63
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
64
|
+
if ((node.textContent ?? "").trim() !== "") return null;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (node.nodeType !== Node.ELEMENT_NODE) continue;
|
|
68
|
+
const { display } = view.getComputedStyle(node);
|
|
69
|
+
if (display === "inline" || display === "contents") return null;
|
|
70
|
+
const box = node.getBoundingClientRect();
|
|
71
|
+
if (box.top > band.end) break;
|
|
72
|
+
if (box.bottom >= band.start) {
|
|
73
|
+
if (glides.has(node)) return null;
|
|
74
|
+
parts.push(node);
|
|
75
|
+
scales.push(scaleOf(node, box, ownScaleOf(node)));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (parts.length === 0) return null;
|
|
79
|
+
const inner = (side) => (Number.parseFloat(style.getPropertyValue(`border-${side}-width`)) || 0) + (Number.parseFloat(style.getPropertyValue(`padding-${side}`)) || 0);
|
|
80
|
+
return {
|
|
81
|
+
parts,
|
|
82
|
+
scales,
|
|
83
|
+
clip: edge === "block-end" ? `inset(${inner("top")}px 0px 0px 0px)` : `inset(0px 0px ${inner("bottom")}px 0px)`
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Whether a style paints a box of its own: a fill, a border, a shadow, an
|
|
88
|
+
* outline or a filter.
|
|
89
|
+
*/
|
|
90
|
+
function paintsOwnBox(style) {
|
|
91
|
+
const isClear = (color) => color === "" || color === "transparent" || /^rgba\(.*,\s*0\)$/.test(color);
|
|
92
|
+
return !isClear(style.backgroundColor) || style.backgroundImage !== "" && style.backgroundImage !== "none" || [
|
|
93
|
+
"Top",
|
|
94
|
+
"Right",
|
|
95
|
+
"Bottom",
|
|
96
|
+
"Left"
|
|
97
|
+
].some((side) => style.getPropertyValue(`border-${side.toLowerCase()}-style`) !== "none" && Number.parseFloat(style.getPropertyValue(`border-${side.toLowerCase()}-width`)) > 0) || style.boxShadow !== "" && style.boxShadow !== "none" || style.borderImageSource !== "" && style.borderImageSource !== "none" || style.filter !== "" && style.filter !== "none" || style.outlineStyle !== "" && style.outlineStyle !== "none" && Number.parseFloat(style.outlineWidth) > 0;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Where the parts sit when the element hides `hidden` px from `edge`. They
|
|
101
|
+
* move that far towards it, so their far edge meets the content that rides
|
|
102
|
+
* the same edge.
|
|
103
|
+
*/
|
|
104
|
+
function slideFrame(edge, hidden) {
|
|
105
|
+
return { translate: `0px ${edge === "block-end" ? -hidden : hidden}px` };
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Clips `element` with `clip` while its parts slide, and returns what puts
|
|
109
|
+
* its own `clip-path` back. The clip does not move, so it stays in step with
|
|
110
|
+
* the parts and the content beside them on every engine.
|
|
111
|
+
*/
|
|
112
|
+
function holdSlideClip(element, clip) {
|
|
113
|
+
const { style } = element;
|
|
114
|
+
const value = style.getPropertyValue("clip-path");
|
|
115
|
+
const priority = style.getPropertyPriority("clip-path");
|
|
116
|
+
style.setProperty("clip-path", clip);
|
|
117
|
+
return () => {
|
|
118
|
+
if (value === "") style.removeProperty("clip-path");
|
|
119
|
+
else style.setProperty("clip-path", value, priority);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The last element before `element` in the area that takes part in layout:
|
|
124
|
+
* its previous sibling, or its nearest ancestor's below the area (the mirror
|
|
125
|
+
* of `nextInFlow`, for a start edge).
|
|
126
|
+
*/
|
|
127
|
+
function previousInFlow(element, area) {
|
|
128
|
+
const view = element.ownerDocument.defaultView;
|
|
129
|
+
const lastBox = (from) => {
|
|
130
|
+
const style = view?.getComputedStyle(from);
|
|
131
|
+
if (style == null) return from;
|
|
132
|
+
if (style.display === "contents") {
|
|
133
|
+
for (let child = from.lastElementChild; child != null; child = child.previousElementSibling) {
|
|
134
|
+
const box = lastBox(child);
|
|
135
|
+
if (box != null) return box;
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return takesPart(from, style) ? from : null;
|
|
140
|
+
};
|
|
141
|
+
let node = element;
|
|
142
|
+
while (node != null && node !== area) {
|
|
143
|
+
for (let sibling = node.previousElementSibling; sibling != null; sibling = sibling.previousElementSibling) {
|
|
144
|
+
const box = lastBox(sibling);
|
|
145
|
+
if (box != null) return box;
|
|
146
|
+
}
|
|
147
|
+
node = node.parentElement;
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The glide that moves `neighbour`: its own, or that of its nearest gliding
|
|
153
|
+
* ancestor below the area that does not also hold `element` (one that holds
|
|
154
|
+
* both moves the two together, so the edge does not ride it).
|
|
155
|
+
*/
|
|
156
|
+
function glideMoving(neighbour, element, area) {
|
|
157
|
+
for (let node = neighbour; node != null && node !== area && !node.contains(element); node = node.parentElement) {
|
|
158
|
+
const glide = glides.get(node);
|
|
159
|
+
if (glide != null) return glide;
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
//#endregion
|
|
164
|
+
export { isRtl as a, slideFrame as c, holdSlideClip as i, slidingParts as l, fractionClip as n, previousInFlow as o, glideMoving as r, pxClip as s, extentOf as t };
|