@xaui/native 0.9.1-alpha.93 → 0.9.1-alpha.94
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/{chunk-PAQZOD2L.js → chunk-2JFMCW5E.js} +1 -1
- package/dist/chunk-2TLPFGGR.cjs +251 -0
- package/dist/{chunk-TPYOQSKT.js → chunk-2UNLQRXY.js} +1 -1
- package/dist/{chunk-JKDWYNSG.js → chunk-2XEQDQAN.js} +109 -107
- package/dist/{chunk-RXEUKYM5.js → chunk-33BA4LVN.js} +1 -1
- package/dist/{chunk-ODQHAPQW.js → chunk-4AIIAF6U.js} +24 -22
- package/dist/{chunk-QCH7X7O2.cjs → chunk-4LRVB6WR.cjs} +14 -14
- package/dist/{chunk-QUSQEYLP.cjs → chunk-53E2E7GS.cjs} +26 -28
- package/dist/{chunk-2B6PUYTP.cjs → chunk-55KGHYYU.cjs} +4 -4
- package/dist/{chunk-B33OU34Z.cjs → chunk-5O7E73QP.cjs} +12 -12
- package/dist/{chunk-FVEMTBU4.js → chunk-5XTF2JDK.js} +2 -2
- package/dist/{chunk-V2CEKPJ6.js → chunk-6MVKLRLZ.js} +1 -1
- package/dist/{chunk-RSIWSVXI.js → chunk-6NAZ2IHL.js} +1 -1
- package/dist/{chunk-LPJ3UBSO.cjs → chunk-6NRWZR7T.cjs} +2 -2
- package/dist/{chunk-FXN32S75.cjs → chunk-6SRFQSPR.cjs} +3 -3
- package/dist/{chunk-7EVW6O2Q.js → chunk-6W45YHTF.js} +1 -1
- package/dist/{chunk-7NQL5DXY.js → chunk-6XY3XAEQ.js} +1 -1
- package/dist/{chunk-UEW3GAP5.cjs → chunk-6ZWQDTGQ.cjs} +5 -5
- package/dist/{chunk-VMPCXS4S.js → chunk-7OVYYZ7H.js} +22 -20
- package/dist/{chunk-CYOUOQXT.cjs → chunk-AHJLQJOE.cjs} +5 -5
- package/dist/{chunk-OPLPLFGK.cjs → chunk-AHKKEM3K.cjs} +66 -23
- package/dist/{chunk-WIX4SYZI.cjs → chunk-AIHKBSQ5.cjs} +2 -2
- package/dist/{chunk-WRZV6ORJ.js → chunk-AYOJXFHR.js} +1 -1
- package/dist/{chunk-OD6H7ANY.js → chunk-B5DBFS6M.js} +1 -1
- package/dist/{chunk-VQGNLX5C.js → chunk-BYDGJU5A.js} +1 -1
- package/dist/{chunk-NVODH2PR.js → chunk-CCTAJXZ3.js} +63 -61
- package/dist/{chunk-ORXVXYKC.cjs → chunk-CHGBWFDI.cjs} +63 -26
- package/dist/{chunk-WLJPO3AS.cjs → chunk-CZ2NUGUI.cjs} +357 -201
- package/dist/{chunk-PYQ2P3M5.cjs → chunk-CZEWWCWG.cjs} +58 -58
- package/dist/{chunk-PDSR42YC.cjs → chunk-D22K3NZU.cjs} +3 -3
- package/dist/{chunk-TRWZEOCO.js → chunk-DBP5CA5R.js} +2 -2
- package/dist/{chunk-QN2D5ZCS.cjs → chunk-DE4RSR7Q.cjs} +3 -3
- package/dist/{chunk-FOOXBVOQ.js → chunk-E5E2QA4K.js} +22 -20
- package/dist/{chunk-LECYGVIH.js → chunk-EQUD3NHO.js} +50 -48
- package/dist/chunk-ERIGD4SE.cjs +686 -0
- package/dist/{chunk-62AYYMZP.cjs → chunk-FDYPWVNP.cjs} +3 -3
- package/dist/chunk-GN7BWYXP.cjs +627 -0
- package/dist/chunk-GWTURY4S.cjs +999 -0
- package/dist/{chunk-OW4N2C3M.cjs → chunk-HBYT7B47.cjs} +88 -61
- package/dist/{chunk-XWIPLZTD.cjs → chunk-HOV25N3M.cjs} +2 -2
- package/dist/{chunk-5MMBEDZG.cjs → chunk-I3XIZWCV.cjs} +29 -29
- package/dist/{chunk-EDNCHCIN.cjs → chunk-IAJG7GYE.cjs} +2 -2
- package/dist/{chunk-P7OHZCU3.js → chunk-IAWLQN2W.js} +2 -2
- package/dist/{chunk-RCSEVEIR.js → chunk-ICVIWXK4.js} +1 -1
- package/dist/{chunk-RREJUSAS.cjs → chunk-IMIY34F4.cjs} +3 -3
- package/dist/{chunk-ZWS3FQ3J.js → chunk-IUDQG3JI.js} +57 -57
- package/dist/{chunk-O6B72H4B.js → chunk-K7VDLVLE.js} +6 -8
- package/dist/{chunk-P2CJNTAP.js → chunk-KFB24VYT.js} +22 -20
- package/dist/chunk-KHPODIQV.cjs +540 -0
- package/dist/{chunk-CBRW53GN.cjs → chunk-KMK6FUTK.cjs} +39 -23
- package/dist/{chunk-2AFA5HA2.js → chunk-KQW25RCC.js} +77 -75
- package/dist/{chunk-X4CZYJZ6.cjs → chunk-LCGJA37L.cjs} +12 -12
- package/dist/{chunk-SUJLTC2K.js → chunk-LPGY2IDX.js} +1 -1
- package/dist/{chunk-P5M5URAB.js → chunk-LSZW4G7B.js} +31 -31
- package/dist/{chunk-GYEQEF5H.js → chunk-LUPU7FJK.js} +1 -1
- package/dist/chunk-MNBEUNC5.cjs +792 -0
- package/dist/{chunk-AIND5F7P.js → chunk-MTQGFUW5.js} +29 -29
- package/dist/chunk-NGXLJ5ZF.cjs +395 -0
- package/dist/{chunk-DYQB54JA.cjs → chunk-NPAGA6SH.cjs} +2 -2
- package/dist/{chunk-QELEKXN3.cjs → chunk-OMI2FRCU.cjs} +5 -5
- package/dist/{chunk-EBCAPIBD.js → chunk-OX23MW5E.js} +70 -50
- package/dist/{chunk-MMFIMQMQ.js → chunk-OZLOYXLW.js} +2 -2
- package/dist/{chunk-JBZ7SBRV.cjs → chunk-Q3ZKZ2Y6.cjs} +3 -3
- package/dist/{chunk-TCWW7JI2.js → chunk-QT7KLGO3.js} +65 -63
- package/dist/{chunk-6RU6GUJP.js → chunk-QZF7RSVV.js} +1 -1
- package/dist/{chunk-UYQLW7OD.js → chunk-RAYO2TJL.js} +2 -2
- package/dist/{chunk-FRLWG5LM.js → chunk-RFT5MGJC.js} +25 -25
- package/dist/chunk-SIOSYITD.cjs +1039 -0
- package/dist/{chunk-USIWPESU.js → chunk-SIX5AVXG.js} +1 -1
- package/dist/{chunk-52XUGOLD.js → chunk-SX5U5UJQ.js} +3 -3
- package/dist/{chunk-GGP2ERSV.js → chunk-T5ES7FOL.js} +1 -1
- package/dist/{chunk-MSORLKO7.cjs → chunk-V3C3ATRO.cjs} +2 -2
- package/dist/{chunk-BI5ME4QP.cjs → chunk-VBS6VWW4.cjs} +5 -5
- package/dist/{chunk-2SHWOFQV.js → chunk-VQ4OTVET.js} +29 -29
- package/dist/{chunk-6GQ7UTJ7.cjs → chunk-VXAIFOXL.cjs} +2 -2
- package/dist/{chunk-BJVO7DWJ.js → chunk-W4F4NQXM.js} +1 -1
- package/dist/{chunk-ZE4IHUUO.cjs → chunk-WNEDQTH6.cjs} +2 -2
- package/dist/{chunk-CBXILKQZ.cjs → chunk-WPYJW3WM.cjs} +3 -3
- package/dist/{chunk-QHXTO525.js → chunk-WYJHDTU7.js} +1 -1
- package/dist/{chunk-PROLOLZ5.cjs → chunk-X22PLAP6.cjs} +2 -2
- package/dist/chunk-X6GT4H4I.cjs +662 -0
- package/dist/{chunk-RLC3EXMV.js → chunk-XM4IN4Q6.js} +2 -2
- package/dist/{chunk-ZKGVOXLQ.js → chunk-XOZMGNVS.js} +1 -1
- package/dist/chunk-XXXR2AD3.cjs +94 -0
- package/dist/{chunk-JC4YCKKL.js → chunk-YI5D4QZP.js} +22 -20
- package/dist/{chunk-AR7667VN.cjs → chunk-YJA7OQQZ.cjs} +4 -4
- package/dist/{chunk-PAQD6UUF.cjs → chunk-YJIVPYMG.cjs} +3 -3
- package/dist/{chunk-JJYHW4PV.js → chunk-YOPWQHNO.js} +1 -1
- package/dist/{chunk-LKRQUQZQ.cjs → chunk-YRANVNJG.cjs} +2 -2
- package/dist/chunk-ZDJQ643D.js +62 -0
- package/dist/components/accordion/index.cjs +3 -3
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/agenda-calendar/index.cjs +4 -4
- package/dist/components/agenda-calendar/index.js +3 -3
- package/dist/components/alert/index.cjs +4 -4
- package/dist/components/alert/index.js +3 -3
- package/dist/components/autocomplete/index.cjs +3 -3
- package/dist/components/autocomplete/index.js +2 -2
- package/dist/components/bottom-sheet/index.cjs +3 -3
- package/dist/components/bottom-sheet/index.js +2 -2
- package/dist/components/button/index.cjs +3 -3
- package/dist/components/button/index.js +2 -2
- package/dist/components/calendar/index.cjs +3 -3
- package/dist/components/calendar/index.js +2 -2
- package/dist/components/card/index.cjs +3 -3
- package/dist/components/card/index.js +2 -2
- package/dist/components/carousel/index.cjs +3 -3
- package/dist/components/carousel/index.js +2 -2
- package/dist/components/checkbox/index.cjs +3 -3
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/chip/index.cjs +4 -4
- package/dist/components/chip/index.js +3 -3
- package/dist/components/close-button/index.cjs +4 -4
- package/dist/components/close-button/index.js +3 -3
- package/dist/components/color-picker/index.cjs +6 -6
- package/dist/components/color-picker/index.js +5 -5
- package/dist/components/combobox/index.cjs +4 -4
- package/dist/components/combobox/index.js +3 -3
- package/dist/components/date-picker/index.cjs +4 -4
- package/dist/components/date-picker/index.js +3 -3
- package/dist/components/date-range-picker/index.cjs +6 -6
- package/dist/components/date-range-picker/index.js +5 -5
- package/dist/components/date-time-picker/date-time-picker-indicator.d.cts +2 -2
- package/dist/components/date-time-picker/date-time-picker-indicator.d.ts +2 -2
- package/dist/components/date-time-picker/date-time-picker.type.d.cts +3 -2
- package/dist/components/date-time-picker/date-time-picker.type.d.ts +3 -2
- package/dist/components/date-time-picker/index.cjs +8 -9
- package/dist/components/date-time-picker/index.d.cts +1 -1
- package/dist/components/date-time-picker/index.d.ts +1 -1
- package/dist/components/date-time-picker/index.js +7 -8
- package/dist/components/dialog/index.cjs +4 -4
- package/dist/components/dialog/index.js +3 -3
- package/dist/components/dummy-field/index.cjs +3 -3
- package/dist/components/dummy-field/index.js +2 -2
- package/dist/components/fab/index.cjs +3 -3
- package/dist/components/fab/index.js +2 -2
- package/dist/components/flip-card/index.cjs +3 -3
- package/dist/components/flip-card/index.js +2 -2
- package/dist/components/index.d.cts +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/list-box/index.cjs +2 -2
- package/dist/components/list-box/index.js +1 -1
- package/dist/components/menu/index.cjs +3 -3
- package/dist/components/menu/index.js +2 -2
- package/dist/components/morph-button/index.cjs +3 -3
- package/dist/components/morph-button/index.js +2 -2
- package/dist/components/number-field/number-field-increment.d.cts +2 -2
- package/dist/components/number-field/number-field-increment.d.ts +2 -2
- package/dist/components/number-pad/index.cjs +3 -3
- package/dist/components/number-pad/index.js +2 -2
- package/dist/components/number-stepper/index.cjs +3 -3
- package/dist/components/number-stepper/index.js +2 -2
- package/dist/components/pager/index.cjs +2 -2
- package/dist/components/pager/index.js +1 -1
- package/dist/components/phone-number-field/index.cjs +14 -14
- package/dist/components/phone-number-field/index.js +3 -3
- package/dist/components/popover/index.cjs +3 -3
- package/dist/components/popover/index.js +2 -2
- package/dist/components/radio/index.cjs +3 -3
- package/dist/components/radio/index.js +2 -2
- package/dist/components/range-calendar/index.cjs +4 -4
- package/dist/components/range-calendar/index.js +3 -3
- package/dist/components/rating/index.cjs +3 -3
- package/dist/components/rating/index.js +2 -2
- package/dist/components/search-field/index.cjs +4 -4
- package/dist/components/search-field/index.js +3 -3
- package/dist/components/segment/index.cjs +4 -4
- package/dist/components/segment/index.js +2 -2
- package/dist/components/select/index.cjs +3 -3
- package/dist/components/select/index.js +2 -2
- package/dist/components/slider/index.cjs +2 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/snackbar/index.cjs +3 -3
- package/dist/components/snackbar/index.js +2 -2
- package/dist/components/switch/index.cjs +3 -3
- package/dist/components/switch/index.js +2 -2
- package/dist/components/table/index.cjs +4 -4
- package/dist/components/table/index.js +3 -3
- package/dist/components/tabs/index.cjs +4 -4
- package/dist/components/tabs/index.js +3 -3
- package/dist/components/tag-group/index.cjs +4 -4
- package/dist/components/tag-group/index.js +3 -3
- package/dist/components/time-picker/index.cjs +4 -5
- package/dist/components/time-picker/index.d.cts +1 -1
- package/dist/components/time-picker/index.d.ts +1 -1
- package/dist/components/time-picker/index.js +3 -4
- package/dist/components/time-picker/time-picker-display.d.cts +3 -3
- package/dist/components/time-picker/time-picker-display.d.ts +3 -3
- package/dist/components/time-picker/time-picker-indicator.d.cts +2 -2
- package/dist/components/time-picker/time-picker-indicator.d.ts +2 -2
- package/dist/components/time-picker/time-picker.d.cts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/time-picker/time-picker.type.d.cts +11 -1
- package/dist/components/time-picker/time-picker.type.d.ts +11 -1
- package/dist/components/toast/index.cjs +3 -3
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toggle-button/index.cjs +3 -3
- package/dist/components/toggle-button/index.js +2 -2
- package/dist/components/wheel-picker/index.cjs +2 -2
- package/dist/components/wheel-picker/index.js +1 -1
- package/dist/index.cjs +47 -60
- package/dist/index.js +50 -63
- package/dist/system/index.cjs +3 -3
- package/dist/system/index.js +2 -2
- package/dist/utils/time.d.cts +29 -0
- package/dist/utils/time.d.ts +29 -0
- package/package.json +1 -11
- package/dist/chunk-3MRCSXGT.js +0 -73
- package/dist/chunk-5E6SHYEQ.cjs +0 -631
- package/dist/chunk-6JAGPPZU.cjs +0 -788
- package/dist/chunk-CEPX7CKM.cjs +0 -365
- package/dist/chunk-CHFPFYNV.js +0 -60
- package/dist/chunk-ECR6GPJ6.js +0 -198
- package/dist/chunk-GBTNFQXN.cjs +0 -33
- package/dist/chunk-GZAGWNQM.cjs +0 -719
- package/dist/chunk-ILXKBDC6.cjs +0 -209
- package/dist/chunk-IPD3IUE2.cjs +0 -640
- package/dist/chunk-P2V6PIM7.cjs +0 -478
- package/dist/chunk-Q2BWXT55.cjs +0 -1011
- package/dist/chunk-UFKSUELU.cjs +0 -453
- package/dist/chunk-W4IPOWLY.cjs +0 -198
- package/dist/chunk-YSTLHVQV.cjs +0 -73
- package/dist/components/time-field/index.cjs +0 -27
- package/dist/components/time-field/index.d.cts +0 -52
- package/dist/components/time-field/index.d.ts +0 -52
- package/dist/components/time-field/index.js +0 -27
- package/dist/components/time-field/time-field-field.d.cts +0 -11
- package/dist/components/time-field/time-field-field.d.ts +0 -11
- package/dist/components/time-field/time-field-period.d.cts +0 -34
- package/dist/components/time-field/time-field-period.d.ts +0 -34
- package/dist/components/time-field/time-field.context.d.cts +0 -9
- package/dist/components/time-field/time-field.context.d.ts +0 -9
- package/dist/components/time-field/time-field.d.cts +0 -56
- package/dist/components/time-field/time-field.d.ts +0 -56
- package/dist/components/time-field/time-field.type.d.cts +0 -72
- package/dist/components/time-field/time-field.type.d.ts +0 -72
- package/dist/utils/time-mask.d.cts +0 -68
- package/dist/utils/time-mask.d.ts +0 -68
package/dist/chunk-CEPX7CKM.cjs
DELETED
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkX4CZYJZ6cjs = require('./chunk-X4CZYJZ6.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkIPD3IUE2cjs = require('./chunk-IPD3IUE2.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkJ5COSALOcjs = require('./chunk-J5COSALO.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _chunkEKS3W46Mcjs = require('./chunk-EKS3W46M.cjs');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _chunkOW4N2C3Mcjs = require('./chunk-OW4N2C3M.cjs');
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _chunkGSZDN6EZcjs = require('./chunk-GSZDN6EZ.cjs');
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var _chunkCDRGTUYFcjs = require('./chunk-CDRGTUYF.cjs');
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _chunkIIAQISBGcjs = require('./chunk-IIAQISBG.cjs');
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
38
|
-
|
|
39
|
-
// src/components/date-range-picker/date-range-picker.tsx
|
|
40
|
-
var _react = require('react');
|
|
41
|
-
var _reactnative = require('react-native');
|
|
42
|
-
|
|
43
|
-
// src/components/date-range-picker/date-range-picker.context.ts
|
|
44
|
-
var [DateRangePickerProvider, useDateRangePicker] = _chunkCDRGTUYFcjs.createSlotContext.call(void 0, "DateRangePicker");
|
|
45
|
-
|
|
46
|
-
// src/components/date-range-picker/date-range-picker.tsx
|
|
47
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
48
|
-
var DEFAULT_FORMAT = { dateStyle: "medium" };
|
|
49
|
-
var DEFAULT_SEPARATOR = " \u2013 ";
|
|
50
|
-
function DateRangePicker({
|
|
51
|
-
children,
|
|
52
|
-
variant,
|
|
53
|
-
size = "md",
|
|
54
|
-
radius,
|
|
55
|
-
color,
|
|
56
|
-
calendarVariant,
|
|
57
|
-
value: controlledValue,
|
|
58
|
-
defaultValue,
|
|
59
|
-
onValueChange,
|
|
60
|
-
isOpen: controlledOpen,
|
|
61
|
-
defaultOpen = false,
|
|
62
|
-
onOpenChange,
|
|
63
|
-
minValue,
|
|
64
|
-
maxValue,
|
|
65
|
-
firstDayOfWeek,
|
|
66
|
-
locale,
|
|
67
|
-
formatOptions = DEFAULT_FORMAT,
|
|
68
|
-
separator = DEFAULT_SEPARATOR,
|
|
69
|
-
closeOnSelect = true,
|
|
70
|
-
isDisabled = false,
|
|
71
|
-
isInvalid = false
|
|
72
|
-
}) {
|
|
73
|
-
const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0, );
|
|
74
|
-
const [value, setValue] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
75
|
-
value: controlledValue,
|
|
76
|
-
defaultValue: _nullishCoalesce(defaultValue, () => ( _chunkX4CZYJZ6cjs.EMPTY_RANGE)),
|
|
77
|
-
onChange: onValueChange
|
|
78
|
-
});
|
|
79
|
-
const [isOpen, setOpen] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
80
|
-
value: controlledOpen,
|
|
81
|
-
defaultValue: defaultOpen,
|
|
82
|
-
onChange: onOpenChange
|
|
83
|
-
});
|
|
84
|
-
const selection = {
|
|
85
|
-
variant,
|
|
86
|
-
size,
|
|
87
|
-
radius,
|
|
88
|
-
isOpen: isOpen ? "true" : void 0,
|
|
89
|
-
isInvalid: isInvalid ? "true" : void 0
|
|
90
|
-
};
|
|
91
|
-
const field = _chunkJ5COSALOcjs.selectRecipe.resolve({
|
|
92
|
-
theme,
|
|
93
|
-
selection,
|
|
94
|
-
states: { disabled: isDisabled }
|
|
95
|
-
});
|
|
96
|
-
const fieldPressed = _chunkJ5COSALOcjs.selectRecipe.resolve({
|
|
97
|
-
theme,
|
|
98
|
-
selection,
|
|
99
|
-
states: { pressed: true }
|
|
100
|
-
});
|
|
101
|
-
const tint = color ? _chunkJ5COSALOcjs.selectRecipe.tint({ theme, color, selection }) : void 0;
|
|
102
|
-
const onPickRange = _react.useCallback.call(void 0,
|
|
103
|
-
(next) => {
|
|
104
|
-
setValue(next);
|
|
105
|
-
if (closeOnSelect && next.start !== null && next.end !== null) setOpen(false);
|
|
106
|
-
},
|
|
107
|
-
[closeOnSelect, setOpen, setValue]
|
|
108
|
-
);
|
|
109
|
-
const toggle = _react.useCallback.call(void 0, () => {
|
|
110
|
-
if (isDisabled) return;
|
|
111
|
-
setOpen(!isOpen);
|
|
112
|
-
}, [isDisabled, isOpen, setOpen]);
|
|
113
|
-
const text = _react.useMemo.call(void 0, () => {
|
|
114
|
-
if (value.start === null) return void 0;
|
|
115
|
-
const format = new Intl.DateTimeFormat(locale, formatOptions);
|
|
116
|
-
const start = format.format(value.start);
|
|
117
|
-
return value.end === null ? start : `${start}${separator}${format.format(value.end)}`;
|
|
118
|
-
}, [value, locale, formatOptions, separator]);
|
|
119
|
-
const glyph = _react.useMemo.call(void 0, () => {
|
|
120
|
-
const flat = _reactnative.StyleSheet.flatten([field.indicator, _optionalChain([tint, 'optionalAccess', _ => _.indicator])]);
|
|
121
|
-
return {
|
|
122
|
-
size: flat.fontSize,
|
|
123
|
-
color: typeof flat.color === "string" ? flat.color : void 0
|
|
124
|
-
};
|
|
125
|
-
}, [field.indicator, tint]);
|
|
126
|
-
const context = _react.useMemo.call(void 0,
|
|
127
|
-
() => ({
|
|
128
|
-
triggerStyle: [field.trigger, _optionalChain([tint, 'optionalAccess', _2 => _2.trigger])],
|
|
129
|
-
triggerPressedStyle: fieldPressed.trigger,
|
|
130
|
-
valueStyle: [field.value, _optionalChain([tint, 'optionalAccess', _3 => _3.value])],
|
|
131
|
-
placeholderStyle: tint ? [
|
|
132
|
-
field.placeholder,
|
|
133
|
-
{ color: _reactnative.StyleSheet.flatten([tint.value]).color }
|
|
134
|
-
] : field.placeholder,
|
|
135
|
-
indicatorStyle: field.indicator,
|
|
136
|
-
glyph,
|
|
137
|
-
value,
|
|
138
|
-
text,
|
|
139
|
-
onPickRange,
|
|
140
|
-
calendar: {
|
|
141
|
-
variant: calendarVariant,
|
|
142
|
-
size,
|
|
143
|
-
color,
|
|
144
|
-
minValue,
|
|
145
|
-
maxValue,
|
|
146
|
-
firstDayOfWeek,
|
|
147
|
-
locale
|
|
148
|
-
},
|
|
149
|
-
isOpen,
|
|
150
|
-
setOpen,
|
|
151
|
-
toggle,
|
|
152
|
-
isDisabled,
|
|
153
|
-
isInvalid
|
|
154
|
-
}),
|
|
155
|
-
[
|
|
156
|
-
field,
|
|
157
|
-
fieldPressed,
|
|
158
|
-
tint,
|
|
159
|
-
glyph,
|
|
160
|
-
value,
|
|
161
|
-
text,
|
|
162
|
-
onPickRange,
|
|
163
|
-
calendarVariant,
|
|
164
|
-
size,
|
|
165
|
-
color,
|
|
166
|
-
minValue,
|
|
167
|
-
maxValue,
|
|
168
|
-
firstDayOfWeek,
|
|
169
|
-
locale,
|
|
170
|
-
isOpen,
|
|
171
|
-
setOpen,
|
|
172
|
-
toggle,
|
|
173
|
-
isDisabled,
|
|
174
|
-
isInvalid
|
|
175
|
-
]
|
|
176
|
-
);
|
|
177
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DateRangePickerProvider, { value: context, children });
|
|
178
|
-
}
|
|
179
|
-
DateRangePicker.displayName = "XAUI.DateRangePicker.Root";
|
|
180
|
-
|
|
181
|
-
// src/components/date-range-picker/date-range-picker-sheet.tsx
|
|
182
|
-
|
|
183
|
-
function DateRangePickerSheet({
|
|
184
|
-
children,
|
|
185
|
-
previousLabel,
|
|
186
|
-
nextLabel,
|
|
187
|
-
...props
|
|
188
|
-
}) {
|
|
189
|
-
const picker = useDateRangePicker();
|
|
190
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkIPD3IUE2cjs.BottomSheet2, { isOpen: picker.isOpen, onOpenChange: picker.setOpen, ...props, children: [
|
|
191
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkIPD3IUE2cjs.BottomSheet2.Overlay, {}),
|
|
192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkIPD3IUE2cjs.BottomSheet2.Content, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DateRangePickerProvider, { value: picker, children: _nullishCoalesce(children, () => ( /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
193
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkIPD3IUE2cjs.BottomSheet2.Handle, {}),
|
|
194
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
195
|
-
DateRangePickerCalendar,
|
|
196
|
-
{
|
|
197
|
-
previousLabel,
|
|
198
|
-
nextLabel
|
|
199
|
-
}
|
|
200
|
-
)
|
|
201
|
-
] }))) }) })
|
|
202
|
-
] });
|
|
203
|
-
}
|
|
204
|
-
DateRangePickerSheet.displayName = "XAUI.DateRangePicker.Sheet";
|
|
205
|
-
function DateRangePickerCalendar({
|
|
206
|
-
previousLabel,
|
|
207
|
-
nextLabel,
|
|
208
|
-
...props
|
|
209
|
-
}) {
|
|
210
|
-
const { value, onPickRange, calendar } = useDateRangePicker();
|
|
211
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
212
|
-
_chunkX4CZYJZ6cjs.RangeCalendar,
|
|
213
|
-
{
|
|
214
|
-
variant: calendar.variant,
|
|
215
|
-
size: calendar.size,
|
|
216
|
-
color: calendar.color,
|
|
217
|
-
locale: calendar.locale,
|
|
218
|
-
minValue: calendar.minValue,
|
|
219
|
-
maxValue: calendar.maxValue,
|
|
220
|
-
firstDayOfWeek: calendar.firstDayOfWeek,
|
|
221
|
-
value,
|
|
222
|
-
onValueChange: onPickRange,
|
|
223
|
-
...props,
|
|
224
|
-
children: [
|
|
225
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkX4CZYJZ6cjs.RangeCalendar.Header, { children: [
|
|
226
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4CZYJZ6cjs.RangeCalendar.PreviousButton, { accessibilityLabel: previousLabel }),
|
|
227
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4CZYJZ6cjs.RangeCalendar.Title, {}),
|
|
228
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4CZYJZ6cjs.RangeCalendar.NextButton, { accessibilityLabel: nextLabel })
|
|
229
|
-
] }),
|
|
230
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4CZYJZ6cjs.RangeCalendar.Weekdays, {}),
|
|
231
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4CZYJZ6cjs.RangeCalendar.Grid, {})
|
|
232
|
-
]
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
DateRangePickerCalendar.displayName = "XAUI.DateRangePicker.Calendar";
|
|
237
|
-
|
|
238
|
-
// src/components/date-range-picker/date-range-picker-indicator.tsx
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
246
|
-
|
|
247
|
-
function DateRangePickerIndicator(props) {
|
|
248
|
-
const { as = _chunkGSZDN6EZcjs.ChevronDownIcon } = props;
|
|
249
|
-
const { indicatorStyle, isOpen } = useDateRangePicker();
|
|
250
|
-
const progress = _reactnativereanimated.useSharedValue.call(void 0, isOpen ? 1 : 0);
|
|
251
|
-
_react.useEffect.call(void 0, () => {
|
|
252
|
-
progress.set(_reactnativereanimated.withSpring.call(void 0, isOpen ? 1 : 0, _chunkEKS3W46Mcjs.INDICATOR_SPRING));
|
|
253
|
-
}, [isOpen, progress]);
|
|
254
|
-
const rotation = _reactnativereanimated.useAnimatedStyle.call(void 0, () => ({
|
|
255
|
-
transform: [
|
|
256
|
-
{
|
|
257
|
-
rotate: `${_reactnativereanimated.interpolate.call(void 0, progress.get(), [0, 1], [_chunkEKS3W46Mcjs.INDICATOR_ROTATION[0], _chunkEKS3W46Mcjs.INDICATOR_ROTATION[1]])}deg`
|
|
258
|
-
}
|
|
259
|
-
]
|
|
260
|
-
}));
|
|
261
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { style: [indicatorStyle, rotation], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSZDN6EZcjs.Icon, { as }) });
|
|
262
|
-
}
|
|
263
|
-
DateRangePickerIndicator.displayName = "XAUI.DateRangePicker.Indicator";
|
|
264
|
-
|
|
265
|
-
// src/components/date-range-picker/date-range-picker-trigger.tsx
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
var DateRangePickerTrigger = _react.forwardRef.call(void 0,
|
|
269
|
-
function DateRangePickerTrigger2({
|
|
270
|
-
children,
|
|
271
|
-
asChild = false,
|
|
272
|
-
accessibilityRole = "button",
|
|
273
|
-
accessibilityState,
|
|
274
|
-
style,
|
|
275
|
-
onPressIn,
|
|
276
|
-
onPressOut,
|
|
277
|
-
onPress,
|
|
278
|
-
...props
|
|
279
|
-
}, ref) {
|
|
280
|
-
const {
|
|
281
|
-
triggerStyle,
|
|
282
|
-
triggerPressedStyle,
|
|
283
|
-
glyph,
|
|
284
|
-
isOpen,
|
|
285
|
-
isDisabled,
|
|
286
|
-
isInvalid,
|
|
287
|
-
toggle
|
|
288
|
-
} = useDateRangePicker();
|
|
289
|
-
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
290
|
-
const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
|
|
291
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGSZDN6EZcjs.IconContext.Provider, { value: glyph, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
292
|
-
_chunkOW4N2C3Mcjs.PressableFeedback,
|
|
293
|
-
{
|
|
294
|
-
ref,
|
|
295
|
-
isPressed,
|
|
296
|
-
asChild,
|
|
297
|
-
accessibilityRole,
|
|
298
|
-
accessibilityState: {
|
|
299
|
-
expanded: isOpen,
|
|
300
|
-
disabled: isDisabled,
|
|
301
|
-
...accessibilityState
|
|
302
|
-
},
|
|
303
|
-
"aria-invalid": isInvalid || void 0,
|
|
304
|
-
isDisabled,
|
|
305
|
-
...rest,
|
|
306
|
-
style: [
|
|
307
|
-
isPressed ? triggerPressedStyle : triggerStyle,
|
|
308
|
-
styleProps,
|
|
309
|
-
typeof style === "function" ? style({ pressed: isPressed }) : style
|
|
310
|
-
],
|
|
311
|
-
onPress: (event) => {
|
|
312
|
-
_optionalChain([onPress, 'optionalCall', _4 => _4(event)]);
|
|
313
|
-
toggle();
|
|
314
|
-
},
|
|
315
|
-
onPressIn: press.onPressIn,
|
|
316
|
-
onPressOut: press.onPressOut,
|
|
317
|
-
children
|
|
318
|
-
}
|
|
319
|
-
) });
|
|
320
|
-
}
|
|
321
|
-
);
|
|
322
|
-
DateRangePickerTrigger.displayName = "XAUI.DateRangePicker.Trigger";
|
|
323
|
-
|
|
324
|
-
// src/components/date-range-picker/date-range-picker-value.tsx
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
var DateRangePickerValue = _react.forwardRef.call(void 0,
|
|
329
|
-
function DateRangePickerValue2({ children, placeholder, style, ...props }, ref) {
|
|
330
|
-
const { text, valueStyle, placeholderStyle } = useDateRangePicker();
|
|
331
|
-
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
332
|
-
const isEmpty = children === void 0 && text === void 0;
|
|
333
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
334
|
-
_reactnative.Text,
|
|
335
|
-
{
|
|
336
|
-
ref,
|
|
337
|
-
numberOfLines: 1,
|
|
338
|
-
...rest,
|
|
339
|
-
style: [isEmpty ? placeholderStyle : valueStyle, styleProps, style],
|
|
340
|
-
children: _nullishCoalesce(_nullishCoalesce(children, () => ( text)), () => ( placeholder))
|
|
341
|
-
}
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
);
|
|
345
|
-
DateRangePickerValue.displayName = "XAUI.DateRangePicker.Value";
|
|
346
|
-
|
|
347
|
-
// src/components/date-range-picker/index.ts
|
|
348
|
-
var DateRangePicker2 = Object.assign(DateRangePicker, {
|
|
349
|
-
Trigger: DateRangePickerTrigger,
|
|
350
|
-
Value: DateRangePickerValue,
|
|
351
|
-
Indicator: DateRangePickerIndicator,
|
|
352
|
-
Sheet: DateRangePickerSheet,
|
|
353
|
-
Calendar: DateRangePickerCalendar
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
exports.useDateRangePicker = useDateRangePicker; exports.DateRangePicker = DateRangePicker; exports.DateRangePickerSheet = DateRangePickerSheet; exports.DateRangePickerCalendar = DateRangePickerCalendar; exports.DateRangePickerIndicator = DateRangePickerIndicator; exports.DateRangePickerTrigger = DateRangePickerTrigger; exports.DateRangePickerValue = DateRangePickerValue; exports.DateRangePicker2 = DateRangePicker2;
|
package/dist/chunk-CHFPFYNV.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// src/hooks/use-sliding-indicator.ts
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated";
|
|
4
|
-
var INDICATOR_SPRING = {
|
|
5
|
-
damping: 20,
|
|
6
|
-
stiffness: 220,
|
|
7
|
-
mass: 0.6
|
|
8
|
-
};
|
|
9
|
-
const _worklet_8419584934064_init_data = {
|
|
10
|
-
code: "function chunkCHFPFYNVJs1(){const{x,width,hasArrived}=this.__closure;return{transform:[{translateX:x.get()}],width:width.get(),opacity:hasArrived.get()?1:0};}",
|
|
11
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-CHFPFYNV.js",
|
|
12
|
-
sourceMap: "{\"version\":3,\"names\":[\"chunkCHFPFYNVJs1\",\"x\",\"width\",\"hasArrived\",\"__closure\",\"transform\",\"translateX\",\"get\",\"opacity\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-CHFPFYNV.js\"],\"mappings\":\"AAuB0B,SAAAA,iBAAA,QAAAC,CAAA,CAAAC,KAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CAC7BC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEL,CAAC,CAACM,GAAG,CAAC,CAAE,CAAC,CAAC,CACpCL,KAAK,CAAEA,KAAK,CAACK,GAAG,CAAC,CAAC,CAClBC,OAAO,CAAEL,UAAU,CAACI,GAAG,CAAC,CAAC,CAAG,CAAC,CAAG,CAClC,CAAC\",\"ignoreList\":[]}"
|
|
13
|
-
};
|
|
14
|
-
function useSlidingIndicator(rect) {
|
|
15
|
-
const x = useSharedValue(rect?.x ?? 0);
|
|
16
|
-
const width = useSharedValue(rect?.width ?? 0);
|
|
17
|
-
const hasArrived = useSharedValue(rect !== void 0);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (rect === void 0) return;
|
|
20
|
-
if (hasArrived.get()) {
|
|
21
|
-
x.set(withSpring(rect.x, INDICATOR_SPRING));
|
|
22
|
-
width.set(withSpring(rect.width, INDICATOR_SPRING));
|
|
23
|
-
} else {
|
|
24
|
-
x.set(rect.x);
|
|
25
|
-
width.set(rect.width);
|
|
26
|
-
hasArrived.set(true);
|
|
27
|
-
}
|
|
28
|
-
}, [rect, hasArrived, width, x]);
|
|
29
|
-
return useAnimatedStyle(function chunkCHFPFYNVJs1Factory({
|
|
30
|
-
_worklet_8419584934064_init_data,
|
|
31
|
-
x,
|
|
32
|
-
width,
|
|
33
|
-
hasArrived
|
|
34
|
-
}) {
|
|
35
|
-
const _e = [new global.Error(), -4, -27];
|
|
36
|
-
const chunkCHFPFYNVJs1 = () => ({
|
|
37
|
-
transform: [{
|
|
38
|
-
translateX: x.get()
|
|
39
|
-
}],
|
|
40
|
-
width: width.get(),
|
|
41
|
-
opacity: hasArrived.get() ? 1 : 0
|
|
42
|
-
});
|
|
43
|
-
chunkCHFPFYNVJs1.__closure = {
|
|
44
|
-
x,
|
|
45
|
-
width,
|
|
46
|
-
hasArrived
|
|
47
|
-
};
|
|
48
|
-
chunkCHFPFYNVJs1.__workletHash = 8419584934064;
|
|
49
|
-
chunkCHFPFYNVJs1.__pluginVersion = "0.7.4";
|
|
50
|
-
chunkCHFPFYNVJs1.__initData = _worklet_8419584934064_init_data;
|
|
51
|
-
chunkCHFPFYNVJs1.__stackDetails = _e;
|
|
52
|
-
return chunkCHFPFYNVJs1;
|
|
53
|
-
}({
|
|
54
|
-
_worklet_8419584934064_init_data,
|
|
55
|
-
x,
|
|
56
|
-
width,
|
|
57
|
-
hasArrived
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
export { useSlidingIndicator };
|
package/dist/chunk-ECR6GPJ6.js
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FieldGroupSuffix,
|
|
3
|
-
decoratorPadding,
|
|
4
|
-
useOptionalFieldGroup
|
|
5
|
-
} from "./chunk-3CPLJJWX.js";
|
|
6
|
-
import {
|
|
7
|
-
TextFieldDescription,
|
|
8
|
-
TextFieldError,
|
|
9
|
-
TextFieldField,
|
|
10
|
-
TextFieldLabel,
|
|
11
|
-
TextFieldRoot,
|
|
12
|
-
useTextField
|
|
13
|
-
} from "./chunk-5YZUYSV7.js";
|
|
14
|
-
import {
|
|
15
|
-
formatTime,
|
|
16
|
-
hourCycleFor,
|
|
17
|
-
maskTime,
|
|
18
|
-
parseTime,
|
|
19
|
-
periodOf,
|
|
20
|
-
timeLength,
|
|
21
|
-
timePlaceholder,
|
|
22
|
-
withTime
|
|
23
|
-
} from "./chunk-3MRCSXGT.js";
|
|
24
|
-
import {
|
|
25
|
-
createSlotContext
|
|
26
|
-
} from "./chunk-TTZOIXKE.js";
|
|
27
|
-
import {
|
|
28
|
-
warnDev
|
|
29
|
-
} from "./chunk-EGLLDKN6.js";
|
|
30
|
-
|
|
31
|
-
// src/components/time-field/time-field-field.tsx
|
|
32
|
-
import { forwardRef, useMemo } from "react";
|
|
33
|
-
|
|
34
|
-
// src/components/time-field/time-field.context.ts
|
|
35
|
-
var [TimeFieldProvider, useTimeField] = createSlotContext("TimeField");
|
|
36
|
-
|
|
37
|
-
// src/components/time-field/time-field-field.tsx
|
|
38
|
-
import { jsx } from "react/jsx-runtime";
|
|
39
|
-
var TimeFieldField = forwardRef(
|
|
40
|
-
function TimeFieldField2({ placeholder, style, ...props }, ref) {
|
|
41
|
-
const { text, onType, placeholder: shape, length } = useTimeField();
|
|
42
|
-
const group = useOptionalFieldGroup();
|
|
43
|
-
const padding = useMemo(
|
|
44
|
-
() => decoratorPadding(group?.prefixWidth ?? 0, group?.suffixWidth ?? 0),
|
|
45
|
-
[group?.prefixWidth, group?.suffixWidth]
|
|
46
|
-
);
|
|
47
|
-
return /* @__PURE__ */ jsx(
|
|
48
|
-
TextFieldField,
|
|
49
|
-
{
|
|
50
|
-
ref,
|
|
51
|
-
keyboardType: "number-pad",
|
|
52
|
-
autoCapitalize: "none",
|
|
53
|
-
autoCorrect: false,
|
|
54
|
-
maxLength: length,
|
|
55
|
-
placeholder: placeholder ?? shape,
|
|
56
|
-
...props,
|
|
57
|
-
value: text,
|
|
58
|
-
onChangeText: onType,
|
|
59
|
-
style: [padding, style]
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
TimeFieldField.displayName = "XAUI.TimeField.Field";
|
|
65
|
-
|
|
66
|
-
// src/components/time-field/time-field-period.tsx
|
|
67
|
-
import { forwardRef as forwardRef2 } from "react";
|
|
68
|
-
import { Pressable, Text } from "react-native";
|
|
69
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
70
|
-
var HIT_SLOP = 12;
|
|
71
|
-
var TimeFieldPeriod = forwardRef2(
|
|
72
|
-
function TimeFieldPeriod2({ accessibilityLabel, ...props }, ref) {
|
|
73
|
-
const { period, periodLabels, onPeriodChange, hasPeriod } = useTimeField();
|
|
74
|
-
const { isDisabled, labelStyle } = useTextField();
|
|
75
|
-
if (hasPeriod && !accessibilityLabel) {
|
|
76
|
-
warnDev(
|
|
77
|
-
'TimeField.Period: the toggle needs an `accessibilityLabel` \u2014 "AM" read on its own says the value, not that pressing it changes which half of the day it is.'
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
if (!hasPeriod) return null;
|
|
81
|
-
return /* @__PURE__ */ jsx2(FieldGroupSuffix, { ref, ...props, children: /* @__PURE__ */ jsx2(
|
|
82
|
-
Pressable,
|
|
83
|
-
{
|
|
84
|
-
accessibilityRole: "button",
|
|
85
|
-
accessibilityLabel,
|
|
86
|
-
accessibilityState: { disabled: isDisabled },
|
|
87
|
-
accessibilityValue: { text: periodLabels[period] },
|
|
88
|
-
disabled: isDisabled,
|
|
89
|
-
hitSlop: HIT_SLOP,
|
|
90
|
-
onPress: () => onPeriodChange(period === "am" ? "pm" : "am"),
|
|
91
|
-
children: /* @__PURE__ */ jsx2(Text, { style: labelStyle, children: periodLabels[period] })
|
|
92
|
-
}
|
|
93
|
-
) });
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
TimeFieldPeriod.displayName = "XAUI.TimeField.Period";
|
|
97
|
-
|
|
98
|
-
// src/components/time-field/time-field.tsx
|
|
99
|
-
import { forwardRef as forwardRef3, useCallback, useMemo as useMemo2, useRef, useState } from "react";
|
|
100
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
101
|
-
var DEFAULT_LABELS = { hours: "HH", minutes: "mm", seconds: "ss" };
|
|
102
|
-
var DEFAULT_PERIODS = { am: "AM", pm: "PM" };
|
|
103
|
-
var TimeFieldRoot = forwardRef3(function TimeField({
|
|
104
|
-
value,
|
|
105
|
-
defaultValue,
|
|
106
|
-
onValueChange,
|
|
107
|
-
granularity = "minute",
|
|
108
|
-
hourCycle: hourCycleProp,
|
|
109
|
-
locale = "en-US",
|
|
110
|
-
timeLabels = DEFAULT_LABELS,
|
|
111
|
-
periodLabels = DEFAULT_PERIODS,
|
|
112
|
-
children,
|
|
113
|
-
...props
|
|
114
|
-
}, ref) {
|
|
115
|
-
const hourCycle = hourCycleProp ?? hourCycleFor(locale);
|
|
116
|
-
const [typed, setTyped] = useState(
|
|
117
|
-
() => defaultValue ? formatTime(defaultValue, granularity, hourCycle) : ""
|
|
118
|
-
);
|
|
119
|
-
const [typedPeriod, setTypedPeriod] = useState(
|
|
120
|
-
() => defaultValue ? periodOf(defaultValue) : "am"
|
|
121
|
-
);
|
|
122
|
-
const isControlled = value !== void 0;
|
|
123
|
-
const typedParts = parseTime(typed, granularity, hourCycle, typedPeriod);
|
|
124
|
-
const agrees = typedParts !== null && value != null && withTime(value, typedParts).getTime() === value.getTime();
|
|
125
|
-
const text = isControlled && !agrees ? value === null ? "" : formatTime(value, granularity, hourCycle) : typed;
|
|
126
|
-
const period = isControlled && !agrees && value != null ? periodOf(value) : typedPeriod;
|
|
127
|
-
const anchor = useRef(value ?? defaultValue ?? null);
|
|
128
|
-
if (value != null) anchor.current = value;
|
|
129
|
-
const reported = useRef(null);
|
|
130
|
-
const report = useCallback(
|
|
131
|
-
(next, nextPeriod) => {
|
|
132
|
-
const parts = parseTime(next, granularity, hourCycle, nextPeriod);
|
|
133
|
-
const moment = parts === null ? null : withTime(anchor.current ?? /* @__PURE__ */ new Date(), parts);
|
|
134
|
-
const before = reported.current;
|
|
135
|
-
if (moment === null ? before === null : before?.getTime() === moment.getTime())
|
|
136
|
-
return;
|
|
137
|
-
reported.current = moment;
|
|
138
|
-
onValueChange?.(moment);
|
|
139
|
-
},
|
|
140
|
-
[granularity, hourCycle, onValueChange]
|
|
141
|
-
);
|
|
142
|
-
const onType = useCallback(
|
|
143
|
-
(input) => {
|
|
144
|
-
const next = maskTime(input, granularity, hourCycle);
|
|
145
|
-
setTyped(next);
|
|
146
|
-
report(next, period);
|
|
147
|
-
},
|
|
148
|
-
[granularity, hourCycle, period, report]
|
|
149
|
-
);
|
|
150
|
-
const onPeriodChange = useCallback(
|
|
151
|
-
(next) => {
|
|
152
|
-
setTypedPeriod(next);
|
|
153
|
-
report(text, next);
|
|
154
|
-
},
|
|
155
|
-
[report, text]
|
|
156
|
-
);
|
|
157
|
-
const context = useMemo2(
|
|
158
|
-
() => ({
|
|
159
|
-
text,
|
|
160
|
-
onType,
|
|
161
|
-
placeholder: timePlaceholder(granularity, timeLabels),
|
|
162
|
-
length: timeLength(granularity),
|
|
163
|
-
period,
|
|
164
|
-
periodLabels,
|
|
165
|
-
onPeriodChange,
|
|
166
|
-
hasPeriod: hourCycle === 12
|
|
167
|
-
}),
|
|
168
|
-
[
|
|
169
|
-
text,
|
|
170
|
-
onType,
|
|
171
|
-
granularity,
|
|
172
|
-
timeLabels,
|
|
173
|
-
period,
|
|
174
|
-
periodLabels,
|
|
175
|
-
onPeriodChange,
|
|
176
|
-
hourCycle
|
|
177
|
-
]
|
|
178
|
-
);
|
|
179
|
-
return /* @__PURE__ */ jsx3(TimeFieldProvider, { value: context, children: /* @__PURE__ */ jsx3(TextFieldRoot, { ref, ...props, children }) });
|
|
180
|
-
});
|
|
181
|
-
TimeFieldRoot.displayName = "XAUI.TimeField.Root";
|
|
182
|
-
|
|
183
|
-
// src/components/time-field/index.ts
|
|
184
|
-
var TimeField2 = Object.assign(TimeFieldRoot, {
|
|
185
|
-
Label: TextFieldLabel,
|
|
186
|
-
Field: TimeFieldField,
|
|
187
|
-
Period: TimeFieldPeriod,
|
|
188
|
-
Description: TextFieldDescription,
|
|
189
|
-
Error: TextFieldError
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
export {
|
|
193
|
-
useTimeField,
|
|
194
|
-
TimeFieldField,
|
|
195
|
-
TimeFieldPeriod,
|
|
196
|
-
TimeFieldRoot,
|
|
197
|
-
TimeField2 as TimeField
|
|
198
|
-
};
|
package/dist/chunk-GBTNFQXN.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/hooks/use-sliding-indicator.ts
|
|
2
|
-
var _react = require('react');
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _reactnativereanimated = require('react-native-reanimated');
|
|
8
|
-
var INDICATOR_SPRING = { damping: 20, stiffness: 220, mass: 0.6 };
|
|
9
|
-
function useSlidingIndicator(rect) {
|
|
10
|
-
const x = _reactnativereanimated.useSharedValue.call(void 0, _nullishCoalesce(_optionalChain([rect, 'optionalAccess', _ => _.x]), () => ( 0)));
|
|
11
|
-
const width = _reactnativereanimated.useSharedValue.call(void 0, _nullishCoalesce(_optionalChain([rect, 'optionalAccess', _2 => _2.width]), () => ( 0)));
|
|
12
|
-
const hasArrived = _reactnativereanimated.useSharedValue.call(void 0, rect !== void 0);
|
|
13
|
-
_react.useEffect.call(void 0, () => {
|
|
14
|
-
if (rect === void 0) return;
|
|
15
|
-
if (hasArrived.get()) {
|
|
16
|
-
x.set(_reactnativereanimated.withSpring.call(void 0, rect.x, INDICATOR_SPRING));
|
|
17
|
-
width.set(_reactnativereanimated.withSpring.call(void 0, rect.width, INDICATOR_SPRING));
|
|
18
|
-
} else {
|
|
19
|
-
x.set(rect.x);
|
|
20
|
-
width.set(rect.width);
|
|
21
|
-
hasArrived.set(true);
|
|
22
|
-
}
|
|
23
|
-
}, [rect, hasArrived, width, x]);
|
|
24
|
-
return _reactnativereanimated.useAnimatedStyle.call(void 0, () => ({
|
|
25
|
-
transform: [{ translateX: x.get() }],
|
|
26
|
-
width: width.get(),
|
|
27
|
-
opacity: hasArrived.get() ? 1 : 0
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
exports.useSlidingIndicator = useSlidingIndicator;
|