@astryxdesign/core 0.7.9-canary.e9bfd12 → 0.7.9-canary.edf7128
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/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +40 -8
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +61 -21
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +6 -4
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +4 -2
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +9 -3
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +14 -11
- package/dist/PowerSearch/formatTokenValue.d.ts +6 -2
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatTokenValue.js +6 -3
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -8
- package/dist/Timestamp/formatInstant.d.ts +10 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +13 -27
- package/dist/Timestamp/tooltipEntries.d.ts +5 -3
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +6 -4
- package/dist/astryx.css +4 -4
- package/dist/i18n/InternationalizationProvider.d.ts +9 -8
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/utils/calendarSystem.d.ts +9 -1
- package/dist/utils/calendarSystem.d.ts.map +1 -1
- package/dist/utils/calendarSystem.js +54 -11
- package/dist/utils/plainDate.d.ts +12 -2
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +23 -3
- package/package.json +4 -4
- package/src/BottomSheet/BottomSheetPanel.tsx +64 -7
- package/src/BottomSheet/useSheetGestures.ts +83 -20
- package/src/PowerSearch/PowerSearch.doc.mjs +3 -3
- package/src/PowerSearch/PowerSearch.tsx +6 -2
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +4 -1
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -11
- package/src/PowerSearch/formatTokenValue.ts +7 -1
- package/src/Timestamp/Timestamp.doc.mjs +3 -3
- package/src/Timestamp/Timestamp.tsx +13 -8
- package/src/Timestamp/formatInstant.ts +49 -28
- package/src/Timestamp/tooltipEntries.ts +7 -3
- package/src/i18n/InternationalizationProvider.doc.mjs +3 -3
- package/src/i18n/InternationalizationProvider.tsx +9 -8
- package/src/utils/calendarSystem.ts +87 -20
- package/src/utils/plainDate.ts +33 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgC5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAQvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,CAAC;AAC5D,YA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IAC1C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAC7D;AAyJD,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,KAAK,EACL,eAAe,EACf,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,cAAsB,EACtB,cAAc,EACd,eAAe,EACf,qBAA4B,EAC5B,kBAA0B,EAC1B,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,qBAAqB,+BA0bvB;yBAlde,gBAAgB"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* - /packages/core/src/BottomSheet/useSheetGestures.ts
|
|
19
19
|
* - /packages/core/src/Layout/container.stylex.ts (bottom-sheet padding chain)
|
|
20
20
|
*/
|
|
21
|
-
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef } from 'react';
|
|
21
|
+
import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from 'react';
|
|
22
22
|
import * as stylex from '@stylexjs/stylex';
|
|
23
23
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
24
24
|
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
@@ -33,6 +33,7 @@ import { layerStructureReset } from "../Layer/layerStructureReset.stylex.js";
|
|
|
33
33
|
import { LayerContentBoundary } from "../Layer/layerScopedContext.js";
|
|
34
34
|
import { container } from "../Layout/container.stylex.js";
|
|
35
35
|
import { containerPaddingBlockEndVarStyles, containerPaddingBlockStartVarStyles, containerPaddingInlineVarStyles, overlayPaddingReset, paddingStyles, spacingStepToToken } from "../Layout/padding.stylex.js";
|
|
36
|
+
import { subscribeInput } from "../utils/inputStream.js";
|
|
36
37
|
import { isValidSnapPoint, resolveSnapPoints } from "./snapOffsets.js";
|
|
37
38
|
import { useMobileKeyboard } from "../keyboard/useMobileKeyboard.js";
|
|
38
39
|
import { scrollPreservationPadding, sheetLayoutHeight, useSheetGestures } from "./useSheetGestures.js";
|
|
@@ -42,8 +43,16 @@ const HEIGHT_BUDGETS = {
|
|
|
42
43
|
capped: '62dvh',
|
|
43
44
|
tall: '92dvh'
|
|
44
45
|
};
|
|
45
|
-
//
|
|
46
|
-
|
|
46
|
+
// The reserve: how far the sheet's surface reaches below the screen, so a
|
|
47
|
+
// pull past the top never shows the page under it.
|
|
48
|
+
// SYNC: OVERSCROLL_MAX in useSheetGestures.ts must not exceed MIN_RESERVE.
|
|
49
|
+
const MIN_RESERVE = 48;
|
|
50
|
+
// A finger can pull past the top by at most the viewport's height. The rubber
|
|
51
|
+
// band over a sheet as tall as the viewport then shows 35.5% of it.
|
|
52
|
+
const RESERVE_VIEWPORT_SHARE = 0.4;
|
|
53
|
+
function sheetReserve(viewportHeight) {
|
|
54
|
+
return Math.max(MIN_RESERVE, Math.ceil(viewportHeight * RESERVE_VIEWPORT_SHARE));
|
|
55
|
+
}
|
|
47
56
|
const MOBILE_KEYBOARD_BOTTOM_CLEARANCE = 48;
|
|
48
57
|
const TRANSITION_BACKSTOP_BUFFER_MS = 50;
|
|
49
58
|
// The floating handle bar's height. The bar is out of flow, so this is not
|
|
@@ -51,6 +60,12 @@ const TRANSITION_BACKSTOP_BUFFER_MS = 50;
|
|
|
51
60
|
// from the sheet's top edge, inside the space a content wrapper's own top
|
|
52
61
|
// padding already provides.
|
|
53
62
|
const HANDLE_BAR_HEIGHT = spacingVars['--spacing-6'];
|
|
63
|
+
const BLOCK_SIZE_PROPERTIES = ['height', 'minHeight', 'maxHeight', 'blockSize', 'minBlockSize', 'maxBlockSize'];
|
|
64
|
+
|
|
65
|
+
/** Whether StyleX styles hold any style: they can nest in arrays. */
|
|
66
|
+
function hasStyles(xstyle) {
|
|
67
|
+
return Array.isArray(xstyle) ? xstyle.some(hasStyles) : xstyle != null && typeof xstyle === 'object';
|
|
68
|
+
}
|
|
54
69
|
|
|
55
70
|
// Measure the viewport that the height budgets use. They are `dvh`, which
|
|
56
71
|
// the virtual keyboard does not shrink, so `visualViewport` would differ by
|
|
@@ -59,6 +74,12 @@ const HANDLE_BAR_HEIGHT = spacingVars['--spacing-6'];
|
|
|
59
74
|
function layoutViewportHeight() {
|
|
60
75
|
return typeof window === 'undefined' ? 0 : window.innerHeight;
|
|
61
76
|
}
|
|
77
|
+
function subscribeToResize(onChange) {
|
|
78
|
+
return subscribeInput(window, 'resize', onChange);
|
|
79
|
+
}
|
|
80
|
+
function subscribeToNothing() {
|
|
81
|
+
return () => {};
|
|
82
|
+
}
|
|
62
83
|
|
|
63
84
|
/**
|
|
64
85
|
* A stable identity for a set of snap points. Type-tagged, so the fraction
|
|
@@ -112,8 +133,8 @@ const styles = {
|
|
|
112
133
|
kGVxlE: "x1kcpxr7",
|
|
113
134
|
kI3sdo: "x1a2a7pz",
|
|
114
135
|
kVQacm: "xb3r6kr",
|
|
115
|
-
kGO01o: "
|
|
116
|
-
k1K539: "
|
|
136
|
+
kGO01o: "x5559hn",
|
|
137
|
+
k1K539: "xgwt18o",
|
|
117
138
|
k3aq6I: "xnn1q72 xhbqy3z xspp5ug",
|
|
118
139
|
kSiTet: "x1hc1fzr x1igigxu xgo67oj",
|
|
119
140
|
k1ekBW: "xwcsmn1",
|
|
@@ -178,12 +199,12 @@ const styles = {
|
|
|
178
199
|
"--x-nsbhg8": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(inset)
|
|
179
200
|
}],
|
|
180
201
|
budget: {
|
|
181
|
-
kZKoxP: "
|
|
202
|
+
kZKoxP: "x1fqcpoh",
|
|
182
203
|
$$css: true
|
|
183
204
|
},
|
|
184
205
|
hugHeight: {
|
|
185
206
|
kZKoxP: "xg7h5cd",
|
|
186
|
-
kskxy: "
|
|
207
|
+
kskxy: "xkche18",
|
|
187
208
|
$$css: true
|
|
188
209
|
}
|
|
189
210
|
};
|
|
@@ -390,6 +411,16 @@ export function BottomSheetPanel({
|
|
|
390
411
|
|
|
391
412
|
// A caller's height owns the element's height: the drag never writes it.
|
|
392
413
|
const consumerHeight = style?.height;
|
|
414
|
+
// StyleX styles and a class name can size the sheet too. Their rules are
|
|
415
|
+
// only class names here, so any of them counts as a size.
|
|
416
|
+
const isSizedByCaller = BLOCK_SIZE_PROPERTIES.some(property => style?.[property] != null) || hasStyles(xstyle) || className != null && className !== '';
|
|
417
|
+
// Only a finger stretches the sheet past MIN_RESERVE, so a device with no
|
|
418
|
+
// touch pointer keeps the smallest reserve. So does a sheet the caller
|
|
419
|
+
// sizes, which nothing extends by the reserve; the stretch stops at it.
|
|
420
|
+
const hasTouchPointer = useMediaQuery('(any-pointer: coarse)');
|
|
421
|
+
const tracksViewport = isPresented && hasTouchPointer && !isSizedByCaller;
|
|
422
|
+
const viewportHeight = useSyncExternalStore(tracksViewport ? subscribeToResize : subscribeToNothing, () => tracksViewport ? layoutViewportHeight() : 0, () => 0);
|
|
423
|
+
const reserve = viewportHeight > 0 ? sheetReserve(viewportHeight) : MIN_RESERVE;
|
|
393
424
|
const {
|
|
394
425
|
contentProps,
|
|
395
426
|
handleProps,
|
|
@@ -409,7 +440,7 @@ export function BottomSheetPanel({
|
|
|
409
440
|
isOpen: isInteractive,
|
|
410
441
|
isOpenRequested: isOpenRequested ?? isInteractive,
|
|
411
442
|
canDismiss: isSwipeDismissAllowed,
|
|
412
|
-
offscreenBlockEndInset:
|
|
443
|
+
offscreenBlockEndInset: reserve,
|
|
413
444
|
onDismiss,
|
|
414
445
|
snapHeights,
|
|
415
446
|
onTravelStart: () => {
|
|
@@ -624,6 +655,7 @@ export function BottomSheetPanel({
|
|
|
624
655
|
},
|
|
625
656
|
...mergeProps(themeProps('bottom-sheet'), stylex.props(layerTextReset.reset, layerStructureReset.reset, styles.sheet, overlayPaddingReset.reset, height === 'hug' ? styles.hugHeight : styles.budget, isClosing && styles.sheetClosing, isClosing && isCrossFade && styles.sheetClosingCrossFade, isFading && styles.sheetFading, isInactive && styles.sheetInactive, isEntrySettled && styles.sheetSettled, xstyle), className, {
|
|
626
657
|
['--_sheet-budget']: budget,
|
|
658
|
+
['--_sheet-reserve']: `${reserve}px`,
|
|
627
659
|
...(isInteractive ? gestureStyle : isRetained || isClosing ? {
|
|
628
660
|
height: hostHeight
|
|
629
661
|
} : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;AA4Hf;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE3E;AA+B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E;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,eAAwB,EACxB,UAAiB,EACjB,sBAA0B,EAC1B,SAAS,EACT,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,cAAsB,GACvB,EAAE,uBAAuB,GAAG,sBAAsB,CAg3ClD"}
|
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
// finger ends any drag (yieldToPinch). There is no module-scope DOM access,
|
|
50
50
|
// so the hook is SSR-safe. Reduced motion skips the settle transition.
|
|
51
51
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
52
|
+
import { rubberBand } from "../motion/rubberBand.js";
|
|
53
|
+
import { scroll } from "../motion/uikit/scroll.js";
|
|
52
54
|
import { computeDetentOffsets, peekOffsetFor, resolveSettleOffset, scrimOpacityForOffset } from "./snapOffsets.js";
|
|
53
55
|
|
|
54
56
|
/**
|
|
@@ -86,13 +88,17 @@ const MAGNET_RANGE = 40;
|
|
|
86
88
|
function isSyntheticTouch(event) {
|
|
87
89
|
return event.syntheticTouch === true;
|
|
88
90
|
}
|
|
91
|
+
// An Apple Pencil raises touch events too, marked `stylus`. Its drag is a
|
|
92
|
+
// pen's, as on the grabber, where WebKit reports it as a pen.
|
|
93
|
+
function touchPointerType(touch) {
|
|
94
|
+
return touch.touchType === 'stylus' ? 'pen' : 'touch';
|
|
95
|
+
}
|
|
89
96
|
|
|
90
|
-
//
|
|
91
|
-
//
|
|
97
|
+
// A mouse's stretch past fully open: a resisted fraction of the drag, capped
|
|
98
|
+
// at OVERSCROLL_MAX.
|
|
92
99
|
const OVERSCROLL_RESISTANCE = 0.35;
|
|
93
|
-
// SYNC: must
|
|
94
|
-
//
|
|
95
|
-
// import so it can be used inside stylex.create there.
|
|
100
|
+
// SYNC: must not exceed MIN_RESERVE in BottomSheetPanel.tsx, the smallest
|
|
101
|
+
// reserve the sheet keeps below the screen.
|
|
96
102
|
const OVERSCROLL_MAX = 48;
|
|
97
103
|
// Travel past the point where a scrolling gesture ran out of content before it
|
|
98
104
|
// hands the sheet the rest of the pull. Small enough to feel continuous with
|
|
@@ -253,6 +259,32 @@ function chainAtTop(chain) {
|
|
|
253
259
|
function chainAtBottom(chain) {
|
|
254
260
|
return chain.every(elementAtBottom);
|
|
255
261
|
}
|
|
262
|
+
function chainScrolls(chain) {
|
|
263
|
+
return chain.some(element => element.scrollHeight - element.clientHeight > 1);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* iOS rubber-bands a scroller past its end even under `overscroll-behavior:
|
|
268
|
+
* contain`. While the content sits at its end mid-pull, `none` holds it still,
|
|
269
|
+
* so only the sheet moves. Returns the undo.
|
|
270
|
+
*/
|
|
271
|
+
function holdAtEnd(chain) {
|
|
272
|
+
const previous = chain.map(element => element.style.overscrollBehaviorY);
|
|
273
|
+
for (const element of chain) {
|
|
274
|
+
element.style.overscrollBehaviorY = 'none';
|
|
275
|
+
}
|
|
276
|
+
return () => {
|
|
277
|
+
chain.forEach((element, index) => {
|
|
278
|
+
element.style.overscrollBehaviorY = previous[index];
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function releaseContentHold(armed) {
|
|
283
|
+
if (armed?.releaseContentHold != null) {
|
|
284
|
+
armed.releaseContentHold();
|
|
285
|
+
armed.releaseContentHold = null;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
256
288
|
function visibleHeightForOffset(sheetHeight, offset, offscreenBlockEndInset) {
|
|
257
289
|
return Math.max(0, sheetHeight - offscreenBlockEndInset - offset);
|
|
258
290
|
}
|
|
@@ -775,7 +807,7 @@ export function useSheetGestures({
|
|
|
775
807
|
const baseLayoutOffset = settledLayoutOffsetRef.current;
|
|
776
808
|
dragStateRef.current = {
|
|
777
809
|
syntheticTouch,
|
|
778
|
-
pointerType:
|
|
810
|
+
pointerType: event.pointerType,
|
|
779
811
|
pointerId: event.pointerId,
|
|
780
812
|
startCoord: start,
|
|
781
813
|
lastCoord: event.clientY,
|
|
@@ -786,6 +818,7 @@ export function useSheetGestures({
|
|
|
786
818
|
}],
|
|
787
819
|
velocity: 0,
|
|
788
820
|
height: sheetHeight,
|
|
821
|
+
reserve: offscreenBlockEndInsetRef.current,
|
|
789
822
|
baseOffset: settledOffset,
|
|
790
823
|
baseLayoutOffset,
|
|
791
824
|
renderedOffset: settledOffset,
|
|
@@ -866,8 +899,9 @@ export function useSheetGestures({
|
|
|
866
899
|
const maxDetentOffset = offsets[offsets.length - 1];
|
|
867
900
|
let next;
|
|
868
901
|
if (raw < 0) {
|
|
869
|
-
//
|
|
870
|
-
|
|
902
|
+
// A touch device's reserve covers the whole stretch. The clamp binds
|
|
903
|
+
// only where the reserve is short.
|
|
904
|
+
next = state.pointerType === 'touch' ? Math.max(-state.reserve, rubberBand(raw, state.height - state.reserve, scroll.rubberBand.coefficient)) : Math.max(-OVERSCROLL_MAX, raw * OVERSCROLL_RESISTANCE);
|
|
871
905
|
} else if (raw > maxDetentOffset) {
|
|
872
906
|
// In the dismiss zone: no magnet, so it doesn't fight a drag-to-close.
|
|
873
907
|
next = raw;
|
|
@@ -1008,6 +1042,7 @@ export function useSheetGestures({
|
|
|
1008
1042
|
// hand-off and any drag in flight so nothing claims (or preventDefault()s)
|
|
1009
1043
|
// the gesture; the sheet returns to its detent.
|
|
1010
1044
|
const yieldToPinch = useCallback(target => {
|
|
1045
|
+
releaseContentHold(touchDragRef.current);
|
|
1011
1046
|
touchDragRef.current = null;
|
|
1012
1047
|
armedBodyRef.current = null;
|
|
1013
1048
|
cancelDrag(target);
|
|
@@ -1030,6 +1065,7 @@ export function useSheetGestures({
|
|
|
1030
1065
|
const asPointer = (touch, target) => ({
|
|
1031
1066
|
syntheticTouch: true,
|
|
1032
1067
|
pointerId: touch.identifier,
|
|
1068
|
+
pointerType: touchPointerType(touch),
|
|
1033
1069
|
clientY: touch.clientY,
|
|
1034
1070
|
timeStamp: Date.now(),
|
|
1035
1071
|
currentTarget: target,
|
|
@@ -1049,21 +1085,19 @@ export function useSheetGestures({
|
|
|
1049
1085
|
// scroll, but it is tracked all the same: the scroller can run out of
|
|
1050
1086
|
// content while the finger is still down (see onTouchMove). A touch
|
|
1051
1087
|
// inside a layer this sheet hosts is that layer's, never tracked here.
|
|
1088
|
+
releaseContentHold(touchDragRef.current);
|
|
1052
1089
|
if (!touch || isInsideNestedLayer(event.target, body)) {
|
|
1053
1090
|
touchDragRef.current = null;
|
|
1054
1091
|
return;
|
|
1055
1092
|
}
|
|
1056
1093
|
const scrollers = scrollChainUnder(event.target, body);
|
|
1057
1094
|
const top = chainAtTop(scrollers);
|
|
1058
|
-
//
|
|
1059
|
-
//
|
|
1060
|
-
//
|
|
1061
|
-
//
|
|
1062
|
-
//
|
|
1063
|
-
|
|
1064
|
-
// downward to scroll back would collapse the sheet instead. Leave the
|
|
1065
|
-
// gesture with the content.
|
|
1066
|
-
const bottom = chainAtBottom(scrollers) && activeOffsetRef.current > 0;
|
|
1095
|
+
// Claiming a pull up from its first move blocks the content's scroll for
|
|
1096
|
+
// the whole touch. So it is claimed here only below the tallest detent,
|
|
1097
|
+
// or over content that cannot scroll. At the tallest detent, a list at
|
|
1098
|
+
// its end keeps its touch. Its pull reaches the sheet through the
|
|
1099
|
+
// content-end hand-off below, and a reversal hands it back.
|
|
1100
|
+
const bottom = chainAtBottom(scrollers) && (activeOffsetRef.current > 0 || !chainScrolls(scrollers));
|
|
1067
1101
|
touchDragRef.current = {
|
|
1068
1102
|
id: touch.identifier,
|
|
1069
1103
|
startY: touch.clientY,
|
|
@@ -1071,7 +1105,8 @@ export function useSheetGestures({
|
|
|
1071
1105
|
top,
|
|
1072
1106
|
bottom,
|
|
1073
1107
|
contentEndY: null,
|
|
1074
|
-
promotedAtContentEnd: false
|
|
1108
|
+
promotedAtContentEnd: false,
|
|
1109
|
+
releaseContentHold: null
|
|
1075
1110
|
};
|
|
1076
1111
|
};
|
|
1077
1112
|
const onTouchMove = event => {
|
|
@@ -1098,6 +1133,7 @@ export function useSheetGestures({
|
|
|
1098
1133
|
// at once; a later pull past the end promotes again.
|
|
1099
1134
|
armed.contentEndY = null;
|
|
1100
1135
|
armed.promotedAtContentEnd = false;
|
|
1136
|
+
releaseContentHold(armed);
|
|
1101
1137
|
cancelDragRef.current(scroller);
|
|
1102
1138
|
return;
|
|
1103
1139
|
}
|
|
@@ -1127,6 +1163,7 @@ export function useSheetGestures({
|
|
|
1127
1163
|
const pullUpAtBottom = armed.bottom && delta < -DRAG_PROMOTION_SLOP && chainAtBottom(armed.scrollers);
|
|
1128
1164
|
if (pullDownAtTop || pullUpAtBottom) {
|
|
1129
1165
|
event.preventDefault();
|
|
1166
|
+
releaseContentHold(armed);
|
|
1130
1167
|
touchDragRef.current = null;
|
|
1131
1168
|
beginDragRef.current(asPointer(t, scroller), measureHeightRef.current(), armed.startY);
|
|
1132
1169
|
pointerMoveRef.current(asPointer(t, scroller));
|
|
@@ -1142,13 +1179,14 @@ export function useSheetGestures({
|
|
|
1142
1179
|
// cannot see this, and re-arming for a preventDefault() promotion would
|
|
1143
1180
|
// be useless anyway: once the browser has committed the gesture to
|
|
1144
1181
|
// scrolling, every remaining touchmove is non-cancelable. Nothing needs
|
|
1145
|
-
// cancelling either
|
|
1146
|
-
// upward travel scrolls nothing. Anchor at the point where the content
|
|
1182
|
+
// cancelling either: the hold clamps the scroller at its maximum, so
|
|
1183
|
+
// further upward travel scrolls nothing. Anchor at the point where the content
|
|
1147
1184
|
// ran out and give the sheet everything past it, so the pull continues
|
|
1148
1185
|
// into the sheet with no jump and no lost scrolling.
|
|
1149
|
-
if (
|
|
1186
|
+
if (chainAtBottom(armed.scrollers)) {
|
|
1150
1187
|
if (armed.contentEndY == null) {
|
|
1151
1188
|
armed.contentEndY = t.clientY;
|
|
1189
|
+
armed.releaseContentHold ??= holdAtEnd(armed.scrollers);
|
|
1152
1190
|
} else if (armed.contentEndY - t.clientY >= CONTENT_END_HANDOFF_SLOP) {
|
|
1153
1191
|
armed.promotedAtContentEnd = true;
|
|
1154
1192
|
beginDragRef.current(asPointer(t, scroller), measureHeightRef.current(), armed.contentEndY);
|
|
@@ -1156,9 +1194,11 @@ export function useSheetGestures({
|
|
|
1156
1194
|
}
|
|
1157
1195
|
} else {
|
|
1158
1196
|
armed.contentEndY = null;
|
|
1197
|
+
releaseContentHold(armed);
|
|
1159
1198
|
}
|
|
1160
1199
|
};
|
|
1161
1200
|
const onTouchEnd = event => {
|
|
1201
|
+
releaseContentHold(touchDragRef.current);
|
|
1162
1202
|
touchDragRef.current = null;
|
|
1163
1203
|
const pointerId = dragStateRef.current?.pointerId;
|
|
1164
1204
|
if (pointerId == null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearch.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAGL,KAAK,yBAAyB,EAC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B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACzC;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC;AAED,oFAAoF;AACpF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAoC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EAAE,UAAU,EAClB,OAAO,EACP,QAAQ,EACR,KAAK,EAAE,cAAc,EACrB,aAAoB,EACpB,WAAW,EAAE,oBAAoB,EACjC,YAAoB,EACpB,QAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,EACN,aAA0B,EAC1B,SAAS,EACT,cAAmB,EACnB,oBAAoB,EACpB,gBAA6C,EAC7C,sBAAsB,EAAE,+BAA+B,EACvD,UAAU,EACV,qBAAqB,EACrB,UAAU,EACV,WAAW,EACX,GAAG,EACH,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EAAE,kBAAkB,EAC9B,YAAyB,GAC1B,EAAE,gBAAgB,qBA0iClB;yBA7kCe,WAAW"}
|
|
@@ -50,6 +50,7 @@ import { buildRelativeDateOptions, PowerSearchValueEditor } from "./PowerSearchV
|
|
|
50
50
|
import { resolveOperatorLabel } from "./resolveOperatorLabel.js";
|
|
51
51
|
import { themeProps } from "../utils/themeProps.js";
|
|
52
52
|
import { useLocale } from "../i18n/useLocale.js";
|
|
53
|
+
import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
|
|
53
54
|
import { formatTokenValueText } from "./formatTokenValue.js";
|
|
54
55
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
55
56
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
@@ -306,6 +307,7 @@ export function PowerSearch({
|
|
|
306
307
|
const searchSource = usePowerSearchSource(config, maxSearchResults);
|
|
307
308
|
const t = useComponentTranslator();
|
|
308
309
|
const locale = useLocale();
|
|
310
|
+
const calendar = useCalendarSystem(undefined, 'PowerSearch');
|
|
309
311
|
const label = labelFromProps ?? t('@astryx.powersearch.label');
|
|
310
312
|
const placeholder = placeholderFromProps ?? t('@astryx.powersearch.placeholder');
|
|
311
313
|
const popoverSaveButtonLabel = popoverSaveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
|
|
@@ -398,13 +400,13 @@ export function PowerSearch({
|
|
|
398
400
|
const fieldLabel = field?.label ?? '';
|
|
399
401
|
const operatorLabel = operator ? resolveOperatorLabel(operator, t) : '';
|
|
400
402
|
const label = `${fieldLabel}: ${operatorLabel}`.trim();
|
|
401
|
-
const value = operator ? formatTokenValueText(operator.value, filter.value, Math.max(maxTokenLength - fieldLabel.length - operatorLabel.length, 10), locale, undefined, undefined, timezoneID) : null;
|
|
403
|
+
const value = operator ? formatTokenValueText(operator.value, filter.value, Math.max(maxTokenLength - fieldLabel.length - operatorLabel.length, 10), locale, calendar, undefined, undefined, timezoneID) : null;
|
|
402
404
|
return {
|
|
403
405
|
label,
|
|
404
406
|
value,
|
|
405
407
|
full: value != null ? `${label} ${value}` : label
|
|
406
408
|
};
|
|
407
|
-
}, [config, maxTokenLength, t, locale, timezoneID]);
|
|
409
|
+
}, [config, maxTokenLength, t, locale, timezoneID, calendar]);
|
|
408
410
|
// The built-in token being edited. A token from a `components` override
|
|
409
411
|
// names itself, so its editor keeps the plain popover.
|
|
410
412
|
const editedFilter = popoverState.type === 'editing' ? filters[popoverState.filterIndex] : undefined;
|
|
@@ -526,7 +528,7 @@ export function PowerSearch({
|
|
|
526
528
|
const operator = config.getOperator(filter.field, filter.operator);
|
|
527
529
|
const resolvedOp = operator ? resolveOperatorLabel(operator, t) : '';
|
|
528
530
|
const operatorLabel = resolvedOp ? `: ${resolvedOp}` : '';
|
|
529
|
-
const valueStr = operator ? formatFilterValue(config, operator.value, filter.value, maxTokenLength, t, locale, timezoneID) : '';
|
|
531
|
+
const valueStr = operator ? formatFilterValue(config, operator.value, filter.value, maxTokenLength, t, locale, timezoneID, calendar) : '';
|
|
530
532
|
const displayLabel = valueStr ? `${field?.label ?? filter.field}${operatorLabel} ${valueStr}` : `${field?.label ?? filter.field}${operatorLabel}`;
|
|
531
533
|
return {
|
|
532
534
|
id: `filter-${index}-${filter.field}-${filter.operator}`,
|
|
@@ -539,7 +541,7 @@ export function PowerSearch({
|
|
|
539
541
|
}
|
|
540
542
|
};
|
|
541
543
|
});
|
|
542
|
-
}, [filters, config, maxTokenLength, timezoneID, t, locale]);
|
|
544
|
+
}, [filters, config, maxTokenLength, timezoneID, t, locale, calendar]);
|
|
543
545
|
|
|
544
546
|
// Handle tokenizer onChange (field selected from typeahead)
|
|
545
547
|
const handleTokenizerChange = useCallback((_items, change) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchBottomSheet.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchBottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAoBf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"P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EACR,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,eAAe,EAAE,wBAAwB,EACzC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,GACR,EAAE,2BAA2B,qBAqsD7B;yBAztDe,sBAAsB"}
|
|
@@ -62,6 +62,7 @@ import { TextInput } from "../TextInput/TextInput.js";
|
|
|
62
62
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
63
63
|
import { useListFormatter } from "../i18n/useListFormatter.js";
|
|
64
64
|
import { useLocale } from "../i18n/useLocale.js";
|
|
65
|
+
import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
|
|
65
66
|
import { SheetConfirmation } from "../internal/SheetConfirmation.js";
|
|
66
67
|
import { useDismissSearchOnTouchDrag } from "../internal/useDismissSearchOnTouchDrag.js";
|
|
67
68
|
import "../theme/tokens.stylex.js";
|
|
@@ -609,6 +610,7 @@ export function PowerSearchBottomSheet({
|
|
|
609
610
|
} = editors;
|
|
610
611
|
const t = useComponentTranslator();
|
|
611
612
|
const locale = useLocale();
|
|
613
|
+
const calendar = useCalendarSystem(undefined, 'PowerSearch');
|
|
612
614
|
const formatList = useListFormatter();
|
|
613
615
|
const isInteractive = !isDisabled && !isReadOnly;
|
|
614
616
|
|
|
@@ -1037,12 +1039,12 @@ export function PowerSearchBottomSheet({
|
|
|
1037
1039
|
// as the value step's choice row does ("3 days ago"), through the
|
|
1038
1040
|
// catalog's relative-date messages, so the sheet agrees with itself. The popover token
|
|
1039
1041
|
// shows the stored key (a known gap of the record).
|
|
1040
|
-
const value = operator.value.type === 'date_relative' && filter.value.type === 'date_relative' ? resolveRelativeDateLabel(operator.value, filter.value.value, t, editors.buildRelativeDateOptions) : formatTokenValueText(operator.value, filter.value, Number.MAX_SAFE_INTEGER, locale, t, formatList, timezoneID);
|
|
1042
|
+
const value = operator.value.type === 'date_relative' && filter.value.type === 'date_relative' ? resolveRelativeDateLabel(operator.value, filter.value.value, t, editors.buildRelativeDateOptions) : formatTokenValueText(operator.value, filter.value, Number.MAX_SAFE_INTEGER, locale, calendar, t, formatList, timezoneID);
|
|
1041
1043
|
return {
|
|
1042
1044
|
label,
|
|
1043
1045
|
value
|
|
1044
1046
|
};
|
|
1045
|
-
}, [config, editors, formatList, locale, t, timezoneID]);
|
|
1047
|
+
}, [calendar, config, editors, formatList, locale, t, timezoneID]);
|
|
1046
1048
|
const describeFilter = useCallback(filter => {
|
|
1047
1049
|
const parts = describeFilterParts(filter);
|
|
1048
1050
|
return parts.value ? t('@astryx.powersearch.sheet.labelValue', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchToken.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchToken.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchToken.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchToken.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AASnD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EAAE,UAAU,EAClB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE,qBAAqB,qBAiDvB;yBA3De,gBAAgB"}
|
|
@@ -12,6 +12,7 @@ import React from 'react';
|
|
|
12
12
|
import * as stylex from '@stylexjs/stylex';
|
|
13
13
|
import { Token } from "../Token/index.js";
|
|
14
14
|
import { useLocale } from "../i18n/useLocale.js";
|
|
15
|
+
import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
|
|
15
16
|
import "../theme/tokens.stylex.js";
|
|
16
17
|
import { fontWeightVars } from "../theme/tokens.stylex.js";
|
|
17
18
|
import { formatFilterValue } from "./formatFilterValue.js";
|
|
@@ -40,12 +41,13 @@ export function PowerSearchToken({
|
|
|
40
41
|
const config = useInternalConfig(configProp);
|
|
41
42
|
const t = useComponentTranslator();
|
|
42
43
|
const locale = useLocale();
|
|
44
|
+
const calendar = useCalendarSystem(undefined, 'PowerSearchToken');
|
|
43
45
|
const fieldLabel = field.label;
|
|
44
46
|
const resolvedOperatorLabel = resolveOperatorLabel(operator, t);
|
|
45
47
|
const operatorLabel = resolvedOperatorLabel ? `: ${resolvedOperatorLabel}` : '';
|
|
46
48
|
const tokenLabel = `${fieldLabel}${operatorLabel}`;
|
|
47
49
|
const adjustedMaxLength = Math.max(maxLength - fieldLabel.length - resolvedOperatorLabel.length, 10);
|
|
48
|
-
const valueStr = formatFilterValue(config, operator.value, filter.value, adjustedMaxLength, t, locale, timezoneID);
|
|
50
|
+
const valueStr = formatFilterValue(config, operator.value, filter.value, adjustedMaxLength, t, locale, timezoneID, calendar);
|
|
49
51
|
const valueContent = valueStr ? /*#__PURE__*/_jsx("span", {
|
|
50
52
|
...{
|
|
51
53
|
className: "x1lvx875"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file formatFilterValue.ts
|
|
3
|
-
* @input OperatorValue, FilterValue, config
|
|
3
|
+
* @input OperatorValue, FilterValue, config, locale, time zone, calendar
|
|
4
4
|
* @output Formatted display string for a filter value
|
|
5
5
|
* @position Pure utility; consumed by PowerSearch token rendering
|
|
6
6
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import type { OperatorValue, FilterValue } from './types.js';
|
|
11
11
|
import type { InternalConfig } from './useInternalConfig.js';
|
|
12
12
|
import type { Locale, TranslatorFn } from '../i18n/index.js';
|
|
13
|
+
import { type CalendarSystem } from '../utils/calendarSystem.js';
|
|
13
14
|
/**
|
|
14
15
|
* A number in the provider locale's digits, decimal mark, and — unless the
|
|
15
16
|
* options say otherwise — grouping. The shared number helper for
|
|
@@ -25,6 +26,11 @@ export declare function formatSharedNumber(value: number, locale: Locale, option
|
|
|
25
26
|
* `isDateOnly: false` is an instant: its date and time in `timezoneID`,
|
|
26
27
|
* else the viewer's zone, the time its editor reads and writes.
|
|
27
28
|
*/
|
|
28
|
-
export declare function formatDateAbsolute(unixSeconds: number, locale: Locale, timezoneID: string | undefined, isDateOnly?: boolean): string;
|
|
29
|
-
|
|
29
|
+
export declare function formatDateAbsolute(unixSeconds: number, locale: Locale, timezoneID: string | undefined, isDateOnly?: boolean, calendar?: CalendarSystem): string;
|
|
30
|
+
/**
|
|
31
|
+
* The display text of a filter value. A `date_absolute` value is written in
|
|
32
|
+
* `calendar`, which defaults to Gregorian; PowerSearch passes the calendar that
|
|
33
|
+
* its provider resolves.
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatFilterValue(_config: InternalConfig, operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, t: TranslatorFn, locale: Locale, timezoneID?: string, calendar?: CalendarSystem): string;
|
|
30
36
|
//# sourceMappingURL=formatFilterValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAyBjC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,IAAI,CACZ,IAAI,CAAC,mBAAmB,EACxB,aAAa,GAAG,uBAAuB,CACxC,GACA,MAAM,CAER;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,UAAU,UAAO,EACjB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CAiBR;AAcD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,CAAC,EAAE,YAAY,EACf,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CA+HR"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file formatFilterValue.ts
|
|
5
|
-
* @input OperatorValue, FilterValue, config
|
|
5
|
+
* @input OperatorValue, FilterValue, config, locale, time zone, calendar
|
|
6
6
|
* @output Formatted display string for a filter value
|
|
7
7
|
* @position Pure utility; consumed by PowerSearch token rendering
|
|
8
8
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* - /packages/core/src/PowerSearch/index.ts
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { formatCalendarInstant } from "../utils/calendarSystem.js";
|
|
13
14
|
import { truncateCharacters } from "../utils/characters.js";
|
|
14
15
|
import { registerEnglishFallback } from "../i18n/englishFallback.js";
|
|
15
16
|
import english from "../i18n/generated-english/PowerSearch/formatFilterValue.generated.js";
|
|
@@ -45,23 +46,19 @@ export function formatSharedNumber(value, locale, options) {
|
|
|
45
46
|
* `isDateOnly: false` is an instant: its date and time in `timezoneID`,
|
|
46
47
|
* else the viewer's zone, the time its editor reads and writes.
|
|
47
48
|
*/
|
|
48
|
-
export function formatDateAbsolute(unixSeconds, locale, timezoneID, isDateOnly = true) {
|
|
49
|
+
export function formatDateAbsolute(unixSeconds, locale, timezoneID, isDateOnly = true, calendar = 'gregory') {
|
|
49
50
|
const options = isDateOnly ? {
|
|
50
51
|
year: 'numeric',
|
|
51
52
|
month: 'short',
|
|
52
|
-
day: 'numeric'
|
|
53
|
-
timeZone: resolveDateZone(timezoneID, true),
|
|
54
|
-
calendar: 'gregory'
|
|
53
|
+
day: 'numeric'
|
|
55
54
|
} : {
|
|
56
55
|
year: 'numeric',
|
|
57
56
|
month: 'short',
|
|
58
57
|
day: 'numeric',
|
|
59
58
|
hour: 'numeric',
|
|
60
|
-
minute: '2-digit'
|
|
61
|
-
timeZone: resolveDateZone(timezoneID, false),
|
|
62
|
-
calendar: 'gregory'
|
|
59
|
+
minute: '2-digit'
|
|
63
60
|
};
|
|
64
|
-
return
|
|
61
|
+
return formatCalendarInstant(calendar, new Date(unixSeconds * 1000), options, locale, resolveDateZone(timezoneID, isDateOnly));
|
|
65
62
|
}
|
|
66
63
|
function formatRelativeDate(value) {
|
|
67
64
|
// value is stored as a descriptive string like "7d" or "1w"
|
|
@@ -70,7 +67,13 @@ function formatRelativeDate(value) {
|
|
|
70
67
|
function formatDateRange(_value, t) {
|
|
71
68
|
return t('@astryx.powersearch.valueEditor.dateRange');
|
|
72
69
|
}
|
|
73
|
-
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The display text of a filter value. A `date_absolute` value is written in
|
|
73
|
+
* `calendar`, which defaults to Gregorian; PowerSearch passes the calendar that
|
|
74
|
+
* its provider resolves.
|
|
75
|
+
*/
|
|
76
|
+
export function formatFilterValue(_config, operatorValue, filterValue, maxLength, t, locale, timezoneID, calendar = 'gregory') {
|
|
74
77
|
switch (filterValue.type) {
|
|
75
78
|
case 'empty':
|
|
76
79
|
return '';
|
|
@@ -148,7 +151,7 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
148
151
|
case 'time':
|
|
149
152
|
return filterValue.value;
|
|
150
153
|
case 'date_absolute':
|
|
151
|
-
return truncate(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false), maxLength);
|
|
154
|
+
return truncate(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false, calendar), maxLength);
|
|
152
155
|
case 'date_relative':
|
|
153
156
|
return formatRelativeDate(filterValue.value);
|
|
154
157
|
case 'date_range':
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview The text a PowerSearch filter token shows for a value.
|
|
3
3
|
*
|
|
4
|
-
* @input `OperatorValue`, `FilterValue`, a width budget, and the
|
|
4
|
+
* @input `OperatorValue`, `FilterValue`, a width budget, the locale, and the
|
|
5
|
+
* calendar.
|
|
5
6
|
* @output `formatTokenValueText` — one string, or null for an empty value.
|
|
6
7
|
* @position Shared by the token itself (`PowerSearch.tsx`) and the sheet
|
|
7
8
|
* presentation's Filters rows and removal announcement
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
*/
|
|
11
12
|
import type { OperatorValue, FilterValue } from './types.js';
|
|
12
13
|
import type { Locale, TranslatorFn } from '../i18n/index.js';
|
|
14
|
+
import type { CalendarSystem } from '../utils/calendarSystem.js';
|
|
13
15
|
type ListFormatFn = (items: ReadonlyArray<string>) => string;
|
|
14
16
|
/**
|
|
15
17
|
* The text a filter token shows for a value: the one place that decides how
|
|
@@ -17,12 +19,14 @@ type ListFormatFn = (items: ReadonlyArray<string>) => string;
|
|
|
17
19
|
* the sheet presentation's Filters rows and its removal announcement — can
|
|
18
20
|
* use the same words and the same zone handling. `maxLength` is the token's
|
|
19
21
|
* width budget; pass `Number.MAX_SAFE_INTEGER` for the untruncated text.
|
|
22
|
+
* A `date_absolute` value is written in `calendar`, the calendar that the
|
|
23
|
+
* provider resolves.
|
|
20
24
|
* With `t`, the list, date-range and nested summaries resolve through the
|
|
21
25
|
* catalog (`@astryx.powersearch.valueEditor.*`); without it they are the
|
|
22
26
|
* token's own literals. With `formatList` (the provider's list formatter),
|
|
23
27
|
* several labels join as a list in the locale; without it they join with
|
|
24
28
|
* the token's literal ", ".
|
|
25
29
|
*/
|
|
26
|
-
export declare function formatTokenValueText(operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, locale: Locale, t?: TranslatorFn, formatList?: ListFormatFn, timezoneID?: string): string | null;
|
|
30
|
+
export declare function formatTokenValueText(operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, locale: Locale, calendar: CalendarSystem, t?: TranslatorFn, formatList?: ListFormatFn, timezoneID?: string): string | null;
|
|
27
31
|
export {};
|
|
28
32
|
//# sourceMappingURL=formatTokenValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatTokenValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatTokenValue.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"formatTokenValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatTokenValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAQ5D,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC;AA6E7D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,CAAC,CAAC,EAAE,YAAY,EAChB,UAAU,CAAC,EAAE,YAAY,EACzB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAqGf"}
|