@astryxdesign/core 0.7.8-canary.ea33daf → 0.7.8-canary.eb985e5
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 +1 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +30 -14
- package/dist/BottomSheet/bottomSheetStack.js +1 -1
- package/dist/BottomSheet/useSheetGestures.d.ts +3 -1
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +4 -0
- package/dist/CheckboxList/CheckboxList.d.ts +13 -2
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +10 -4
- package/dist/CheckboxList/CheckboxListContext.d.ts +7 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListContext.js +2 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +14 -2
- package/dist/CheckboxList/requiredGroup.d.ts +22 -0
- package/dist/CheckboxList/requiredGroup.d.ts.map +1 -0
- package/dist/CheckboxList/requiredGroup.js +52 -0
- package/dist/DateInput/PickerWheel.d.ts +1 -1
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +27 -6
- package/dist/DateInput/Wheel.d.ts +2 -2
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +20 -6
- package/dist/DateInput/datePickerTouch.d.ts +13 -0
- package/dist/DateInput/datePickerTouch.d.ts.map +1 -0
- package/dist/DateInput/datePickerTouch.js +14 -0
- package/dist/DateInput/wheelOptions.d.ts +22 -2
- package/dist/DateInput/wheelOptions.d.ts.map +1 -1
- package/dist/DateInput/wheelOptions.js +14 -2
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +62 -119
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +6 -1
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +7 -2
- package/dist/PowerSearch/PowerSearch.d.ts +4 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +24 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +172 -50
- package/dist/TimeInput/TimeWheels.d.ts +32 -0
- package/dist/TimeInput/TimeWheels.d.ts.map +1 -0
- package/dist/TimeInput/TimeWheels.js +144 -0
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +63 -118
- package/dist/TimeInput/timeWheelRules.d.ts +124 -0
- package/dist/TimeInput/timeWheelRules.d.ts.map +1 -0
- package/dist/TimeInput/timeWheelRules.js +277 -0
- package/dist/Tokenizer/TokenizerBottomSheet.js +8 -12
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +6 -0
- package/dist/astryx.css +3 -1
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +3 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.js +5 -2
- package/dist/i18n/generated-english/TimeInput/TimeWheels.generated.d.ts +8 -0
- package/dist/i18n/generated-english/TimeInput/TimeWheels.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/TimeInput/TimeWheels.generated.js +17 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -2
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -2
- package/dist/keyboard/index.d.ts +17 -0
- package/dist/keyboard/index.d.ts.map +1 -0
- package/dist/keyboard/index.js +19 -0
- package/dist/keyboard/keyboardHeight.d.ts +149 -0
- package/dist/keyboard/keyboardHeight.d.ts.map +1 -0
- package/dist/keyboard/keyboardHeight.js +432 -0
- package/dist/keyboard/keyboardLayoutGuide.d.ts +59 -0
- package/dist/keyboard/keyboardLayoutGuide.d.ts.map +1 -0
- package/dist/keyboard/keyboardLayoutGuide.js +207 -0
- package/dist/keyboard/keyboardModel.d.ts +93 -0
- package/dist/keyboard/keyboardModel.d.ts.map +1 -0
- package/dist/keyboard/keyboardModel.js +220 -0
- package/dist/keyboard/rideKeyboard.d.ts +42 -0
- package/dist/keyboard/rideKeyboard.d.ts.map +1 -0
- package/dist/keyboard/rideKeyboard.js +77 -0
- package/dist/keyboard/useMobileKeyboard.d.ts +61 -0
- package/dist/keyboard/useMobileKeyboard.d.ts.map +1 -0
- package/dist/keyboard/useMobileKeyboard.js +699 -0
- package/dist/motion/android/index.d.ts +16 -0
- package/dist/motion/android/index.d.ts.map +1 -0
- package/dist/motion/android/index.js +18 -0
- package/dist/motion/android/keyboard.d.ts +83 -0
- package/dist/motion/android/keyboard.d.ts.map +1 -0
- package/dist/motion/android/keyboard.js +96 -0
- package/dist/motion/uikit/datePicker.d.ts +58 -0
- package/dist/motion/uikit/datePicker.d.ts.map +1 -0
- package/dist/motion/uikit/datePicker.js +60 -0
- package/dist/motion/uikit/index.d.ts +4 -3
- package/dist/motion/uikit/index.d.ts.map +1 -1
- package/dist/motion/uikit/index.js +4 -3
- package/dist/utils/interactionOverlay.stylex.d.ts +3 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +3 -2
- package/dist/utils/layoutViewport.d.ts +25 -0
- package/dist/utils/layoutViewport.d.ts.map +1 -0
- package/dist/utils/layoutViewport.js +102 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +74 -9
- package/dist/utils/pressGesture.d.ts +4 -2
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +3 -1
- package/dist/utils/selectionLock.d.ts +10 -1
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +31 -5
- package/dist/utils/sharedMutationObserver.d.ts +2 -1
- package/dist/utils/sharedMutationObserver.d.ts.map +1 -1
- package/dist/utils/sharedMutationObserver.js +2 -1
- package/dist/utils/timeParser.d.ts +2 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +29 -3
- package/locales/en.json +21 -9
- package/locales/pseudo.json +15 -6
- package/package.json +4 -4
- package/src/BottomSheet/BottomSheet.doc.mjs +1 -1
- package/src/BottomSheet/BottomSheetPanel.tsx +41 -13
- package/src/BottomSheet/bottomSheetStack.ts +1 -1
- package/src/BottomSheet/useSheetGestures.ts +6 -0
- package/src/CheckboxList/CheckboxList.doc.mjs +7 -0
- package/src/CheckboxList/CheckboxList.tsx +34 -2
- package/src/CheckboxList/CheckboxListContext.tsx +9 -1
- package/src/CheckboxList/CheckboxListItem.tsx +23 -2
- package/src/CheckboxList/requiredGroup.ts +77 -0
- package/src/DateInput/PickerWheel.tsx +37 -4
- package/src/DateInput/Wheel.tsx +30 -3
- package/src/DateInput/datePickerTouch.ts +15 -0
- package/src/DateInput/wheelOptions.ts +31 -2
- package/src/DateTimeInput/TouchDateTimeField.tsx +94 -178
- package/src/HoverCard/useHoverCard.tsx +6 -1
- package/src/Overlay/Overlay.tsx +7 -2
- package/src/PowerSearch/PowerSearch.doc.mjs +2 -2
- package/src/PowerSearch/PowerSearch.tsx +4 -2
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +237 -62
- package/src/TimeInput/TimeWheels.tsx +218 -0
- package/src/TimeInput/TouchTimeField.tsx +93 -157
- package/src/TimeInput/timeWheelRules.ts +352 -0
- package/src/Tokenizer/TokenizerBottomSheet.tsx +8 -12
- package/src/Tooltip/useTooltip.tsx +6 -0
- package/src/gestures/GestureHost.ts +5 -4
- package/src/i18n/generated-english/PowerSearch/PowerSearchBottomSheet.generated.ts +5 -2
- package/src/i18n/generated-english/TimeInput/TimeWheels.generated.ts +18 -0
- package/src/i18n/generated-locales/en.generated.ts +6 -4
- package/src/i18n/generated-locales/pseudo.generated.ts +6 -4
- package/src/keyboard/README.md +197 -0
- package/src/keyboard/index.ts +48 -0
- package/src/keyboard/keyboardHeight.ts +543 -0
- package/src/keyboard/keyboardLayoutGuide.ts +266 -0
- package/src/keyboard/keyboardModel.ts +301 -0
- package/src/keyboard/rideKeyboard.ts +100 -0
- package/src/keyboard/useMobileKeyboard.ts +866 -0
- package/src/motion/MEASUREMENTS.md +10 -0
- package/src/motion/README.md +2 -0
- package/src/motion/android/index.ts +18 -0
- package/src/motion/android/keyboard.ts +96 -0
- package/src/motion/uikit/datePicker.ts +60 -0
- package/src/motion/uikit/index.ts +4 -3
- package/src/utils/interactionOverlay.stylex.ts +3 -2
- package/src/utils/layoutViewport.ts +104 -0
- package/src/utils/pressFeedback.ts +99 -21
- package/src/utils/pressGesture.ts +4 -2
- package/src/utils/selectionLock.ts +40 -6
- package/src/utils/sharedMutationObserver.ts +2 -1
- package/src/utils/timeParser.ts +40 -3
- package/dist/BottomSheet/useMobileKeyboard.d.ts +0 -21
- package/dist/BottomSheet/useMobileKeyboard.d.ts.map +0 -1
- package/dist/BottomSheet/useMobileKeyboard.js +0 -413
- package/src/BottomSheet/useMobileKeyboard.ts +0 -542
package/dist/DateInput/Wheel.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Wheel.tsx
|
|
7
|
-
* @input Option list, selected value and change callback
|
|
7
|
+
* @input Option list, selected value and change callback; a ref for
|
|
8
|
+
* programmatic turns
|
|
8
9
|
* @output Exports Wheel (one picker column), ScrollWheel (the scrolling
|
|
9
10
|
* column) and the shared types of wheelOptions.ts
|
|
10
11
|
* @position Internal component; consumed by MonthYearWheels.tsx,
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
* - /packages/core/src/DateInput/DateInput.doc.mjs
|
|
27
28
|
* - /packages/core/src/DateInput/DateInputTouch.test.tsx
|
|
28
29
|
*/
|
|
29
|
-
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
30
|
+
import { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
30
31
|
import * as stylex from '@stylexjs/stylex';
|
|
31
32
|
import "../theme/tokens.stylex.js";
|
|
32
33
|
import { colorVars, radiusVars, fontWeightVars, typeScaleVars, spacingVars, durationVars } from "../theme/tokens.stylex.js";
|
|
@@ -40,7 +41,7 @@ import { useOwnScrollGesture } from "./useOwnScrollGesture.js";
|
|
|
40
41
|
import { usePointerDragScroll } from "./usePointerDragScroll.js";
|
|
41
42
|
import { useScrollSettle } from "./useScrollSettle.js";
|
|
42
43
|
import { useWheelListbox } from "./useWheelListbox.js";
|
|
43
|
-
import { endIndex, nearestEnabledIndex, steppedIndex } from "./wheelOptions.js";
|
|
44
|
+
import { canSpinTo, endIndex, nearestEnabledIndex, steppedIndex } from "./wheelOptions.js";
|
|
44
45
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
45
46
|
export { nearestEnabledIndex } from "./wheelOptions.js";
|
|
46
47
|
const ITEM_BLOCK_SIZE = dateInputTouchSizes.wheelItemSize;
|
|
@@ -130,8 +131,23 @@ export function ScrollWheel({
|
|
|
130
131
|
options,
|
|
131
132
|
value,
|
|
132
133
|
onChange,
|
|
133
|
-
isActive = true
|
|
134
|
+
isActive = true,
|
|
135
|
+
ref
|
|
134
136
|
}) {
|
|
137
|
+
// A spin commits the row at once. The new value then scrolls the column
|
|
138
|
+
// there, as any new value does.
|
|
139
|
+
useImperativeHandle(ref, () => ({
|
|
140
|
+
spinTo: async index => {
|
|
141
|
+
if (!canSpinTo(options, index)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
const option = options[index];
|
|
145
|
+
if (option.value !== value) {
|
|
146
|
+
onChange(option.value);
|
|
147
|
+
}
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
}), [options, value, onChange]);
|
|
135
151
|
const scrollerRef = useRef(null);
|
|
136
152
|
const selectedIndex = Math.max(0, options.findIndex(option => option.value === value));
|
|
137
153
|
// Which row is under the band right now. Tracks the finger during a scroll;
|
|
@@ -351,8 +367,6 @@ export function ScrollWheel({
|
|
|
351
367
|
useOwnScrollGesture(scrollerRef, 'all', {
|
|
352
368
|
isEnabled: isActive
|
|
353
369
|
});
|
|
354
|
-
|
|
355
|
-
// A key commits the row it moves to and scrolls the column there.
|
|
356
370
|
const moveTo = useCallback(row => {
|
|
357
371
|
const option = row == null ? undefined : options[row];
|
|
358
372
|
if (row == null || option == null || option.isDisabled) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file datePickerTouch.ts
|
|
3
|
+
* @input The date and time pickers' touch-only pieces
|
|
4
|
+
* @output Re-exports what the date and time sheets use only under a finger:
|
|
5
|
+
* TimeWheels
|
|
6
|
+
* @position The pickers' touch layer. The sheets import touch behaviour from
|
|
7
|
+
* here only, so a desktop build can replace this one module.
|
|
8
|
+
*
|
|
9
|
+
* SYNC: When modified, update TouchTimeField.tsx and TouchDateTimeField.tsx.
|
|
10
|
+
*/
|
|
11
|
+
export { TimeWheels } from '../TimeInput/TimeWheels.js';
|
|
12
|
+
export type { TimeWheelsProps } from '../TimeInput/TimeWheels.js';
|
|
13
|
+
//# sourceMappingURL=datePickerTouch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datePickerTouch.d.ts","sourceRoot":"","sources":["../../src/DateInput/datePickerTouch.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACnD,YAAY,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file datePickerTouch.ts
|
|
5
|
+
* @input The date and time pickers' touch-only pieces
|
|
6
|
+
* @output Re-exports what the date and time sheets use only under a finger:
|
|
7
|
+
* TimeWheels
|
|
8
|
+
* @position The pickers' touch layer. The sheets import touch behaviour from
|
|
9
|
+
* here only, so a desktop build can replace this one module.
|
|
10
|
+
*
|
|
11
|
+
* SYNC: When modified, update TouchTimeField.tsx and TouchDateTimeField.tsx.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export { TimeWheels } from "../TimeInput/TimeWheels.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file wheelOptions.ts
|
|
3
3
|
* @input Nothing; types, the row height and pure functions
|
|
4
|
-
* @output WheelOption, WheelProps, WHEEL_ROW_HEIGHT,
|
|
5
|
-
* steppedIndex and endIndex: what both wheels share
|
|
4
|
+
* @output WheelOption, WheelProps, WheelHandle, WHEEL_ROW_HEIGHT, canSpinTo,
|
|
5
|
+
* nearestEnabledIndex, steppedIndex and endIndex: what both wheels share
|
|
6
6
|
* @position Internal; read by Wheel.tsx (which re-exports all of it) and
|
|
7
7
|
* PickerWheel.tsx
|
|
8
8
|
*
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* - /packages/core/src/DateInput/Wheel.tsx
|
|
11
11
|
* - /packages/core/src/DateInput/PickerWheel.tsx
|
|
12
12
|
*/
|
|
13
|
+
import type { Ref } from 'react';
|
|
13
14
|
/**
|
|
14
15
|
* The row height, px (`dateInputTouchSizes.wheelItemSize`): the pitch of both
|
|
15
16
|
* columns' rows, and the unit of the touch wheel's offset.
|
|
@@ -32,6 +33,18 @@ export interface WheelOption {
|
|
|
32
33
|
*/
|
|
33
34
|
order?: number;
|
|
34
35
|
}
|
|
36
|
+
/** What a Wheel's `ref` exposes. */
|
|
37
|
+
export interface WheelHandle {
|
|
38
|
+
/**
|
|
39
|
+
* Turn the wheel onto `index` (an index into `options`) on the tap spin, then
|
|
40
|
+
* commit it as a rest would. Resolves true once that row is the committed
|
|
41
|
+
* one, false if a finger or another turn interrupted it or the wheel went
|
|
42
|
+
* away first. An index outside `options` or a disabled row resolves false at
|
|
43
|
+
* once, and nothing turns. Under a fine pointer the row commits at once. The
|
|
44
|
+
* column then scrolls to it as for any new value, on the same rule.
|
|
45
|
+
*/
|
|
46
|
+
spinTo(index: number): Promise<boolean>;
|
|
47
|
+
}
|
|
35
48
|
export interface WheelProps {
|
|
36
49
|
/** Accessible name for the column, e.g. "Month". */
|
|
37
50
|
label: string;
|
|
@@ -48,7 +61,14 @@ export interface WheelProps {
|
|
|
48
61
|
* motion.
|
|
49
62
|
*/
|
|
50
63
|
isActive?: boolean;
|
|
64
|
+
/** Programmatic turns: `spinTo(index)`. */
|
|
65
|
+
ref?: Ref<WheelHandle>;
|
|
51
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Whether `spinTo(index)` may turn onto `index`: an enabled row of `options`.
|
|
69
|
+
* The touch wheel and the scrolling column answer a spin by the same rule.
|
|
70
|
+
*/
|
|
71
|
+
export declare function canSpinTo(options: ReadonlyArray<WheelOption>, index: number): boolean;
|
|
52
72
|
/**
|
|
53
73
|
* The enabled row nearest `index`: `index` itself when it is enabled,
|
|
54
74
|
* otherwise the closest enabled row on either side. A tie goes to the side of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wheelOptions.d.ts","sourceRoot":"","sources":["../../src/DateInput/wheelOptions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,MAAM,WAAW,WAAW;IAC1B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,KAAK,EAAE,MAA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AI,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,EACnC,KAAK,EAAE,MAAM,GACZ,OAAO,CAGT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,EACnC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,MAAM,CAsBR;AAaD;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,EACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAyBf;AAED,uFAAuF;AACvF,wBAAgB,QAAQ,CACtB,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,EACnC,GAAG,EAAE,OAAO,GAAG,MAAM,GACpB,MAAM,GAAG,IAAI,CAKf"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file wheelOptions.ts
|
|
5
5
|
* @input Nothing; types, the row height and pure functions
|
|
6
|
-
* @output WheelOption, WheelProps, WHEEL_ROW_HEIGHT,
|
|
7
|
-
* steppedIndex and endIndex: what both wheels share
|
|
6
|
+
* @output WheelOption, WheelProps, WheelHandle, WHEEL_ROW_HEIGHT, canSpinTo,
|
|
7
|
+
* nearestEnabledIndex, steppedIndex and endIndex: what both wheels share
|
|
8
8
|
* @position Internal; read by Wheel.tsx (which re-exports all of it) and
|
|
9
9
|
* PickerWheel.tsx
|
|
10
10
|
*
|
|
@@ -18,6 +18,18 @@
|
|
|
18
18
|
* columns' rows, and the unit of the touch wheel's offset.
|
|
19
19
|
*/
|
|
20
20
|
export const WHEEL_ROW_HEIGHT = 28;
|
|
21
|
+
|
|
22
|
+
/** What a Wheel's `ref` exposes. */
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Whether `spinTo(index)` may turn onto `index`: an enabled row of `options`.
|
|
26
|
+
* The touch wheel and the scrolling column answer a spin by the same rule.
|
|
27
|
+
*/
|
|
28
|
+
export function canSpinTo(options, index) {
|
|
29
|
+
const option = options[index];
|
|
30
|
+
return option != null && !option.isDisabled;
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
/**
|
|
22
34
|
* The enabled row nearest `index`: `index` itself when it is enabled,
|
|
23
35
|
* otherwise the closest enabled row on either side. A tie goes to the side of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchDateTimeField.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/TouchDateTimeField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TouchDateTimeField.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/TouchDateTimeField.tsx"],"names":[],"mappings":"AAuHA,OAAO,KAAK,EAAC,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AA6S3E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,UAAkB,EAClB,UAAkB,EAElB,aAAa,EAAE,cAAc,EAC7B,kBAAkB,EAAE,mBAAmB,EACvC,QAAgB,EAChB,WAAW,EAAE,oBAAoB,EACjC,eAAe,EAAE,wBAAwB,EACzC,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EAEZ,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,gBAAoB,EAClC,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,GAAG,SAAS,EACb,EAAE,kBAAkB,+BAk8BpB;yBAz+Be,kBAAkB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file TouchDateTimeField.tsx
|
|
7
|
-
* @input Uses React, Field, BottomSheet, SegmentedControl, DateInput month picker primitives, Wheel, StyleX intrinsic flex layout
|
|
7
|
+
* @input Uses React, Field, BottomSheet, SegmentedControl, DateInput month picker primitives, Wheel and the pickers' touch layer (TimeWheels), the touch presentation, StyleX intrinsic flex layout
|
|
8
8
|
* @output Exports TouchDateTimeField — the coarse-pointer surface behind DateTimeInput
|
|
9
9
|
* @position Internal component; consumed by DateTimeInput.tsx
|
|
10
10
|
*
|
|
@@ -46,7 +46,7 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
46
46
|
import { normalizeDayOfWeek } from "../utils/dateTypes.js";
|
|
47
47
|
import { formatLocaleTime } from "../utils/timeFormat.js";
|
|
48
48
|
import { getWeekdayHeaders } from "../Calendar/getWeekdayHeaderNames.js";
|
|
49
|
-
import { formatISOTime, isImeKeyEvent, isRenderable,
|
|
49
|
+
import { formatISOTime, isImeKeyEvent, isRenderable, clampTime, mergeProps, parseISOTime } from "../utils/index.js";
|
|
50
50
|
import { chainEventHandlers } from "../utils/chainEventHandlers.js";
|
|
51
51
|
import { joinAriaIDs } from "../utils/inputAria.js";
|
|
52
52
|
import { DATE_FORMAT_LONG, plainDateFormat, plainDateFromISO, plainDateToday } from "../utils/plainDate.js";
|
|
@@ -54,13 +54,16 @@ import { plainDateFormatStandaloneMonthYear } from "../utils/plainDate.js";
|
|
|
54
54
|
import { MonthScroller } from "../DateInput/MonthScroller.js";
|
|
55
55
|
import { MonthYearWheels } from "../DateInput/MonthYearWheels.js";
|
|
56
56
|
import { Wheel } from "../DateInput/Wheel.js";
|
|
57
|
+
import { TimeWheels } from "../DateInput/datePickerTouch.js";
|
|
58
|
+
import { hour12From24, hour24From12, hourRowsInHalf, meridiemRows, minuteRows, secondRows, wheelBounds } from "../TimeInput/timeWheelRules.js";
|
|
59
|
+
import { useTouchPresentation } from "../utils/touchPresentation.js";
|
|
57
60
|
import "../DateInput/tokens.stylex.js";
|
|
58
61
|
import { dateInputTouchGeometry, dateInputTouchSizes } from "../DateInput/tokens.stylex.js";
|
|
59
62
|
import { DEFAULT_MONTH_REACH, clampIndex, fromMonthIndex, monthIndexOf } from "../DateInput/monthGeometry.js";
|
|
60
63
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
61
64
|
import { InternationalizationContext } from "../i18n/InternationalizationContext.js";
|
|
62
65
|
import english from "../i18n/generated-english/DateTimeInput/TouchDateTimeField.generated.js";
|
|
63
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
66
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
64
67
|
registerEnglishFallback(english);
|
|
65
68
|
function splitDateTime(dt) {
|
|
66
69
|
if (!dt) {
|
|
@@ -201,30 +204,6 @@ function normalizeISOTime(time, hasSeconds) {
|
|
|
201
204
|
const parsed = parseISOTime(time);
|
|
202
205
|
return parsed ? formatISOTime(parsed, hasSeconds) : undefined;
|
|
203
206
|
}
|
|
204
|
-
function timeToSeconds(time) {
|
|
205
|
-
if (time === undefined) {
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
208
|
-
const parsed = parseISOTime(time);
|
|
209
|
-
return parsed == null ? null : parsed.hour * 3600 + parsed.minute * 60 + parsed.second;
|
|
210
|
-
}
|
|
211
|
-
function twoDigits(value) {
|
|
212
|
-
return String(value).padStart(2, '0');
|
|
213
|
-
}
|
|
214
|
-
function hour12From24(hour) {
|
|
215
|
-
return hour === 0 ? 12 : hour > 12 ? hour - 12 : hour;
|
|
216
|
-
}
|
|
217
|
-
function hour24From12(hour, meridiem) {
|
|
218
|
-
if (meridiem === 0) {
|
|
219
|
-
return hour === 12 ? 0 : hour;
|
|
220
|
-
}
|
|
221
|
-
return hour === 12 ? 12 : hour + 12;
|
|
222
|
-
}
|
|
223
|
-
function rangeOverlaps(startSecond, endSecond, min, max) {
|
|
224
|
-
const minSecond = timeToSeconds(min);
|
|
225
|
-
const maxSecond = timeToSeconds(max);
|
|
226
|
-
return (minSecond == null || endSecond >= minSecond) && (maxSecond == null || startSecond <= maxSecond);
|
|
227
|
-
}
|
|
228
207
|
export function TouchDateTimeField({
|
|
229
208
|
label,
|
|
230
209
|
isLabelHidden = false,
|
|
@@ -348,6 +327,9 @@ export function TouchDateTimeField({
|
|
|
348
327
|
useBusyAnnouncement(isBusy, t('@astryx.spinner.loading'), isSheetOpen ? sheetBodyRef : dateInputRef);
|
|
349
328
|
const [activePanel, setActivePanel] = useState('date');
|
|
350
329
|
const [isWheelOpen, setIsWheelOpen] = useState(false);
|
|
330
|
+
const {
|
|
331
|
+
isTouch
|
|
332
|
+
} = useTouchPresentation();
|
|
351
333
|
const [draftTime, setDraftTime] = useState(() => normalizeISOTime(splitDateTime(value).time, hasSeconds));
|
|
352
334
|
const today = useMemo(() => plainDateToday(), []);
|
|
353
335
|
const selectedDate = useMemo(() => parseValidISODate(valueParts.date), [valueParts.date]);
|
|
@@ -519,63 +501,14 @@ export function TouchDateTimeField({
|
|
|
519
501
|
}, hasSeconds);
|
|
520
502
|
}, [hasSeconds, hourFormat, parsedWheelTime]);
|
|
521
503
|
const timeBounds = timeBoundsForDate(valueParts.date);
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}));
|
|
531
|
-
}
|
|
532
|
-
const meridiem = parsedWheelTime.hour < 12 ? 0 : 1;
|
|
533
|
-
// In 12-hour mode the hour column is interpreted inside the active AM/PM
|
|
534
|
-
// half, so disabled rows describe reachability within that half only.
|
|
535
|
-
return Array.from({
|
|
536
|
-
length: 12
|
|
537
|
-
}, (_, index) => {
|
|
538
|
-
const hour = index + 1;
|
|
539
|
-
const hour24 = hour24From12(hour, meridiem);
|
|
540
|
-
return {
|
|
541
|
-
value: hour,
|
|
542
|
-
label: String(hour),
|
|
543
|
-
// Keys step in time order: 12 PM comes before 1 PM.
|
|
544
|
-
order: hour24,
|
|
545
|
-
isDisabled: !rangeOverlaps(hour24 * 3600, hour24 * 3600 + 3599, timeBounds.min, timeBounds.max)
|
|
546
|
-
};
|
|
547
|
-
});
|
|
548
|
-
}, [hourFormat, parsedWheelTime.hour, timeBounds.min, timeBounds.max]);
|
|
549
|
-
const minuteOptions = useMemo(() => Array.from({
|
|
550
|
-
length: 60
|
|
551
|
-
}, (_, minute) => {
|
|
552
|
-
const start = parsedWheelTime.hour * 3600 + minute * 60;
|
|
553
|
-
return {
|
|
554
|
-
value: minute,
|
|
555
|
-
label: twoDigits(minute),
|
|
556
|
-
isDisabled: !rangeOverlaps(start, start + (hasSeconds ? 59 : 0), timeBounds.min, timeBounds.max)
|
|
557
|
-
};
|
|
558
|
-
}), [hasSeconds, parsedWheelTime.hour, timeBounds.min, timeBounds.max]);
|
|
559
|
-
const secondOptions = useMemo(() => Array.from({
|
|
560
|
-
length: 60
|
|
561
|
-
}, (_, second) => ({
|
|
562
|
-
value: second,
|
|
563
|
-
label: twoDigits(second),
|
|
564
|
-
isDisabled: !isTimeInRange(formatISOTime({
|
|
565
|
-
hour: parsedWheelTime.hour,
|
|
566
|
-
minute: parsedWheelTime.minute,
|
|
567
|
-
second
|
|
568
|
-
}, true), timeBounds.min, timeBounds.max)
|
|
569
|
-
})), [parsedWheelTime.hour, parsedWheelTime.minute, timeBounds.min, timeBounds.max]);
|
|
570
|
-
const meridiemOptions = useMemo(() => [{
|
|
571
|
-
value: 0,
|
|
572
|
-
label: t('@astryx.dateTimeInput.meridiemAM'),
|
|
573
|
-
isDisabled: !rangeOverlaps(0, 11 * 3600 + 3599, timeBounds.min, timeBounds.max)
|
|
574
|
-
}, {
|
|
575
|
-
value: 1,
|
|
576
|
-
label: t('@astryx.dateTimeInput.meridiemPM'),
|
|
577
|
-
isDisabled: !rangeOverlaps(12 * 3600, 23 * 3600 + 3599, timeBounds.min, timeBounds.max)
|
|
578
|
-
}], [t, timeBounds.min, timeBounds.max]);
|
|
504
|
+
const bounds = useMemo(() => wheelBounds(timeBounds.min, timeBounds.max), [timeBounds.min, timeBounds.max]);
|
|
505
|
+
const hourOptions = useMemo(() => hourRowsInHalf(parsedWheelTime.hour, hourFormat, bounds), [bounds, hourFormat, parsedWheelTime.hour]);
|
|
506
|
+
const minuteOptions = useMemo(() => minuteRows(parsedWheelTime.hour, hasSeconds, bounds), [bounds, hasSeconds, parsedWheelTime.hour]);
|
|
507
|
+
const secondOptions = useMemo(() => secondRows(parsedWheelTime.hour, parsedWheelTime.minute, bounds), [bounds, parsedWheelTime.hour, parsedWheelTime.minute]);
|
|
508
|
+
const meridiemOptions = useMemo(() => meridiemRows({
|
|
509
|
+
am: t('@astryx.dateTimeInput.meridiemAM'),
|
|
510
|
+
pm: t('@astryx.dateTimeInput.meridiemPM')
|
|
511
|
+
}, bounds), [bounds, t]);
|
|
579
512
|
const handleVisibleMonthChange = useCallback(next => {
|
|
580
513
|
if (activePanel === 'date' && !isWheelOpen) {
|
|
581
514
|
setMonthIndex(next);
|
|
@@ -853,45 +786,55 @@ export function TouchDateTimeField({
|
|
|
853
786
|
className: "x15r89dc x78zum5 xh8yej3 xeuugli xdt5ytf x1txdalj xlshs6z xg01cxk x47corl"
|
|
854
787
|
}
|
|
855
788
|
}[!!(activePanel !== 'time') << 0],
|
|
856
|
-
children: [/*#__PURE__*/
|
|
789
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
857
790
|
...{
|
|
858
791
|
className: "x78zum5 xh8yej3 xeuugli xm8gem x1txdalj"
|
|
859
792
|
},
|
|
860
|
-
children:
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
hour24: hour
|
|
867
|
-
}) : composeWheelTime({
|
|
868
|
-
hour12: hour
|
|
869
|
-
}))
|
|
870
|
-
}), /*#__PURE__*/_jsx(Wheel, {
|
|
871
|
-
label: t('@astryx.dateTimeInput.minuteWheel'),
|
|
872
|
-
options: minuteOptions,
|
|
873
|
-
value: parsedWheelTime.minute,
|
|
793
|
+
children: isTouch ? /*#__PURE__*/_jsx(TimeWheels, {
|
|
794
|
+
time: parsedWheelTime,
|
|
795
|
+
hourFormat: hourFormat,
|
|
796
|
+
hasSeconds: hasSeconds,
|
|
797
|
+
min: timeBounds.min,
|
|
798
|
+
max: timeBounds.max,
|
|
874
799
|
isActive: activePanel === 'time',
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
800
|
+
onCommit: time => commitWheelTime(formatISOTime(time, hasSeconds))
|
|
801
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
802
|
+
children: [/*#__PURE__*/_jsx(Wheel, {
|
|
803
|
+
label: t('@astryx.dateTimeInput.hourWheel'),
|
|
804
|
+
options: hourOptions,
|
|
805
|
+
value: hourFormat === '24h' ? parsedWheelTime.hour : hour12From24(parsedWheelTime.hour),
|
|
806
|
+
isActive: activePanel === 'time',
|
|
807
|
+
onChange: hour => commitWheelTime(hourFormat === '24h' ? composeWheelTime({
|
|
808
|
+
hour24: hour
|
|
809
|
+
}) : composeWheelTime({
|
|
810
|
+
hour12: hour
|
|
811
|
+
}))
|
|
812
|
+
}), /*#__PURE__*/_jsx(Wheel, {
|
|
813
|
+
label: t('@astryx.dateTimeInput.minuteWheel'),
|
|
814
|
+
options: minuteOptions,
|
|
815
|
+
value: parsedWheelTime.minute,
|
|
816
|
+
isActive: activePanel === 'time',
|
|
817
|
+
onChange: minute => commitWheelTime(composeWheelTime({
|
|
818
|
+
minute
|
|
819
|
+
}))
|
|
820
|
+
}), hasSeconds && /*#__PURE__*/_jsx(Wheel, {
|
|
821
|
+
label: t('@astryx.dateTimeInput.secondWheel'),
|
|
822
|
+
options: secondOptions,
|
|
823
|
+
value: parsedWheelTime.second,
|
|
824
|
+
isActive: activePanel === 'time',
|
|
825
|
+
onChange: second => commitWheelTime(composeWheelTime({
|
|
826
|
+
second
|
|
827
|
+
}))
|
|
828
|
+
}), hourFormat === '12h' && /*#__PURE__*/_jsx(Wheel, {
|
|
829
|
+
label: t('@astryx.dateTimeInput.meridiemWheel'),
|
|
830
|
+
options: meridiemOptions,
|
|
831
|
+
value: parsedWheelTime.hour < 12 ? 0 : 1,
|
|
832
|
+
isActive: activePanel === 'time',
|
|
833
|
+
onChange: meridiem => commitWheelTime(composeWheelTime({
|
|
834
|
+
meridiem
|
|
835
|
+
}))
|
|
836
|
+
})]
|
|
837
|
+
})
|
|
895
838
|
}), /*#__PURE__*/_jsx("div", {
|
|
896
839
|
...{
|
|
897
840
|
className: "x78zum5 xr1yuqi xfsso4q"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA8BlC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAA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AM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEtC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAke5E"}
|
|
@@ -197,7 +197,12 @@ export function useHoverCard(options = {}) {
|
|
|
197
197
|
|
|
198
198
|
// Tap-to-open on touch; on a mouse this does nothing and hover still rules.
|
|
199
199
|
const handlePointerDown = useCallback(event => {
|
|
200
|
-
|
|
200
|
+
// A pen in range starts the hover show before it lands. Left pending,
|
|
201
|
+
// that show opens the card during the press. The tap then closes it.
|
|
202
|
+
if (handleTouchPointerDown(event) && showTimeoutRef.current) {
|
|
203
|
+
clearTimeout(showTimeoutRef.current);
|
|
204
|
+
showTimeoutRef.current = null;
|
|
205
|
+
}
|
|
201
206
|
}, [handleTouchPointerDown]);
|
|
202
207
|
|
|
203
208
|
// Under `auto`, whether focus counts is decided when it arrives, and a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACd,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAC;IACnB,wBAAwB;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,qBAAqB;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,IAAI,EACR,EAAE,YAAY,+
|
|
1
|
+
{"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,OAAO,CAAC;AAO1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACd,MAAM,gBAAgB,CAAC;AAGxB,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,OAAO,EAAE,SAAS,CAAC;IACnB,wBAAwB;IACxB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,qBAAqB;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,IAAI,EACR,EAAE,YAAY,+BA0Dd;yBAzEe,OAAO"}
|
package/dist/Overlay/Overlay.js
CHANGED
|
@@ -66,8 +66,13 @@ export function Overlay({
|
|
|
66
66
|
align
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
//
|
|
70
|
-
//
|
|
69
|
+
// Copies the first child's radius onto the wrapper, so the scrim clips to
|
|
70
|
+
// the media's rounded corners. This is a layout read of the mounted DOM, and
|
|
71
|
+
// no user interaction causes it. It runs again when a hidden Activity shows
|
|
72
|
+
// the wrapper, because the child can change while it is hidden. A ref
|
|
73
|
+
// callback runs again when a caller's ref changes identity, so it cannot
|
|
74
|
+
// keep this once-per-show timing. A useOverlay consumer sets the radius on
|
|
75
|
+
// its own element.
|
|
71
76
|
useIsomorphicLayoutEffect(() => {
|
|
72
77
|
const el = overlay.containerRef.current;
|
|
73
78
|
if (!el) {
|
|
@@ -133,8 +133,10 @@ export interface PowerSearchProps extends Omit<BaseProps<HTMLElement>, 'onChange
|
|
|
133
133
|
* above it with the fields (or the content search with inline
|
|
134
134
|
* suggestions), and a value step opens above that, stages operator →
|
|
135
135
|
* value, and confirms from its footer. Dismissing a step reveals the
|
|
136
|
-
* one beneath.
|
|
137
|
-
*
|
|
136
|
+
* one beneath. The flow edits a draft: `onChange` is called when Done
|
|
137
|
+
* applies it, once per edit in order, and a dismissal with a changed
|
|
138
|
+
* draft asks before discarding it. Suited to compact touch screens,
|
|
139
|
+
* where the editor popover competes with the software keyboard.
|
|
138
140
|
* - `'adaptive'`: the bottom sheet on compact coarse-pointer screens,
|
|
139
141
|
* otherwise the popover — the same resolution Selector uses. The server
|
|
140
142
|
* render and the hydrating render are the popover.
|
|
@@ -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/B,MAAM,cAAc,CAAC;AAStB,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAY1C,OAAO,EACL,KAAK,oBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,qBAmiClB;yBAtkCe,WAAW"}
|
|
@@ -72,7 +72,14 @@ export interface PowerSearchBottomSheetProps {
|
|
|
72
72
|
config: InternalConfig;
|
|
73
73
|
/** The caller's config, handed to Editor overrides as they expect it. */
|
|
74
74
|
configProp: PowerSearchConfig;
|
|
75
|
+
/** The committed filters; the draft the sheet edits starts from them. */
|
|
75
76
|
filters: ReadonlyArray<PowerSearchFilter>;
|
|
77
|
+
/**
|
|
78
|
+
* The field's `onChange`. Done replays the draft's edits through it, in
|
|
79
|
+
* order, onto the field's latest filters, each call carrying that list
|
|
80
|
+
* with the edit applied; nothing is reported before Done, and nothing when
|
|
81
|
+
* the field is read-only or disabled at Done.
|
|
82
|
+
*/
|
|
76
83
|
onChange: (filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void;
|
|
77
84
|
/** The field typeahead source; the content search lists its suggestions. */
|
|
78
85
|
searchSource: SearchSource<PowerSearchItem>;
|
|
@@ -90,13 +97,29 @@ export interface PowerSearchBottomSheetProps {
|
|
|
90
97
|
components?: PowerSearchComponents;
|
|
91
98
|
editors: PowerSearchSheetEditors;
|
|
92
99
|
}
|
|
100
|
+
/** One edit of the draft: the draft before and after it, and its type and index in the draft; Done replays it onto the field's latest filters. */
|
|
101
|
+
interface DraftEdit {
|
|
102
|
+
before: ReadonlyArray<PowerSearchFilter>;
|
|
103
|
+
after: ReadonlyArray<PowerSearchFilter>;
|
|
104
|
+
changeType: PowerSearchChangeType;
|
|
105
|
+
index: number;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Replays the draft's edits onto `base`, the field's latest filters, and
|
|
109
|
+
* reports each through `report` with the list after it. An add appends; an
|
|
110
|
+
* edit replaces the first filter matching the one it edited; a removal drops
|
|
111
|
+
* the filters it removed, by signature. An edit or removal whose target is
|
|
112
|
+
* not in the base list is skipped: the parent removed it meanwhile.
|
|
113
|
+
*/
|
|
114
|
+
export declare function replayDraftEdits(base: ReadonlyArray<PowerSearchFilter>, edits: ReadonlyArray<DraftEdit>, report: (filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void): ReadonlyArray<PowerSearchFilter>;
|
|
93
115
|
/**
|
|
94
116
|
* The sheet flow of PowerSearch's touch presentation: Filters, Add filter,
|
|
95
117
|
* and the value step, as standalone sheets that stack, each open beneath the
|
|
96
118
|
* step it led to.
|
|
97
119
|
*/
|
|
98
|
-
export declare function PowerSearchBottomSheet({ isOpen, onOpenChange, finalFocusRef, resultCountText, config, configProp, filters, onChange, searchSource, placeholder, isReadOnly, isDisabled, hasClear, maxOperatorMenuItems, timezoneID, maxSearchResults, saveButtonLabel: saveButtonLabelFromProps, components: componentOverrides, editors, }: PowerSearchBottomSheetProps): React.JSX.Element;
|
|
120
|
+
export declare function PowerSearchBottomSheet({ isOpen, onOpenChange, finalFocusRef, resultCountText, config, configProp, filters: committedFilters, onChange: onCommit, searchSource, placeholder, isReadOnly, isDisabled, hasClear, maxOperatorMenuItems, timezoneID, maxSearchResults, saveButtonLabel: saveButtonLabelFromProps, components: componentOverrides, editors, }: PowerSearchBottomSheetProps): React.JSX.Element;
|
|
99
121
|
export declare namespace PowerSearchBottomSheet {
|
|
100
122
|
var displayName: string;
|
|
101
123
|
}
|
|
124
|
+
export {};
|
|
102
125
|
//# sourceMappingURL=PowerSearchBottomSheet.d.ts.map
|
|
@@ -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;AAkCrD,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAe3D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAIV,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EAEjB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAajB;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;IACtD,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;CAC3D;AAED,MAAM,WAAW,2BAA2B;IAC1C,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,aAAa,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C;;;;;OAKG;I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