@xaui/native 0.9.1-alpha.93 → 0.9.1-beta.95
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
|
@@ -1,19 +1,45 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule ? obj : {
|
|
8
|
+
default: obj
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
12
|
+
if (lhs != null) {
|
|
13
|
+
return lhs;
|
|
14
|
+
} else {
|
|
15
|
+
return rhsFn();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function _optionalChain(ops) {
|
|
19
|
+
let lastAccessLHS = undefined;
|
|
20
|
+
let value = ops[0];
|
|
21
|
+
let i = 1;
|
|
22
|
+
while (i < ops.length) {
|
|
23
|
+
const op = ops[i];
|
|
24
|
+
const fn = ops[i + 1];
|
|
25
|
+
i += 2;
|
|
26
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
30
|
+
lastAccessLHS = value;
|
|
31
|
+
value = fn(value);
|
|
32
|
+
} else if (op === 'call' || op === 'optionalCall') {
|
|
33
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
34
|
+
lastAccessLHS = undefined;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
3
39
|
var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
40
|
var _chunkSL3V7R2Ycjs = require('./chunk-SL3V7R2Y.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
41
|
var _chunkCDRGTUYFcjs = require('./chunk-CDRGTUYF.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
42
|
var _chunkIIAQISBGcjs = require('./chunk-IIAQISBG.cjs');
|
|
15
|
-
|
|
16
|
-
|
|
17
43
|
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
18
44
|
|
|
19
45
|
// src/components/slider/slider-fill.tsx
|
|
@@ -25,61 +51,82 @@ var [SliderProvider, useSlider] = _chunkCDRGTUYFcjs.createSlotContext.call(void
|
|
|
25
51
|
|
|
26
52
|
// src/components/slider/slider-fill.tsx
|
|
27
53
|
var _jsxruntime = require('react/jsx-runtime');
|
|
28
|
-
var SliderFill = _react.forwardRef.call(void 0, function SliderFill2({
|
|
29
|
-
|
|
54
|
+
var SliderFill = _react.forwardRef.call(void 0, function SliderFill2({
|
|
55
|
+
style,
|
|
56
|
+
...props
|
|
57
|
+
}, ref) {
|
|
58
|
+
const {
|
|
59
|
+
fillStyle,
|
|
60
|
+
fractions,
|
|
61
|
+
trackLength,
|
|
62
|
+
thumbSize,
|
|
63
|
+
orientation
|
|
64
|
+
} = useSlider();
|
|
30
65
|
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
31
66
|
const travel = Math.max(trackLength - thumbSize, 0);
|
|
32
67
|
const half = thumbSize / 2;
|
|
33
68
|
const from = fractions.length > 1 ? fractions[0] * travel + half : 0;
|
|
34
69
|
const to = fractions[fractions.length - 1] * travel + half;
|
|
35
70
|
const vertical = orientation === "vertical";
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
);
|
|
71
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
|
|
72
|
+
ref,
|
|
73
|
+
...rest,
|
|
74
|
+
style: [fillStyle, vertical ? {
|
|
75
|
+
bottom: from,
|
|
76
|
+
height: to - from,
|
|
77
|
+
top: void 0
|
|
78
|
+
} : {
|
|
79
|
+
start: from,
|
|
80
|
+
width: to - from,
|
|
81
|
+
end: void 0
|
|
82
|
+
}, styleProps, style]
|
|
83
|
+
});
|
|
49
84
|
});
|
|
50
85
|
SliderFill.displayName = "XAUI.Slider.Fill";
|
|
51
86
|
|
|
52
87
|
// src/components/slider/slider-output.tsx
|
|
53
88
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
89
|
+
var SliderOutput = _react.forwardRef.call(void 0, function SliderOutput2({
|
|
90
|
+
children,
|
|
91
|
+
style,
|
|
92
|
+
...props
|
|
93
|
+
}, ref) {
|
|
94
|
+
const {
|
|
95
|
+
outputStyle,
|
|
96
|
+
values
|
|
97
|
+
} = useSlider();
|
|
98
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
99
|
+
const value = values.length > 1 ? [values[0], values[1]] : values[0];
|
|
100
|
+
const text = values.length > 1 ? `${values[0]} \u2013 ${values[1]}` : String(values[0]);
|
|
101
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
|
|
102
|
+
ref,
|
|
103
|
+
...rest,
|
|
104
|
+
style: [outputStyle, styleProps, style],
|
|
105
|
+
children: typeof children === "function" ? children(value) : _nullishCoalesce(children, () => text)
|
|
106
|
+
});
|
|
107
|
+
});
|
|
65
108
|
SliderOutput.displayName = "XAUI.Slider.Output";
|
|
66
109
|
|
|
67
110
|
// src/components/slider/slider-thumb.tsx
|
|
68
111
|
|
|
69
112
|
var _reactnativegesturehandler = require('react-native-gesture-handler');
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
113
|
+
var _reactnativereanimated = require('react-native-reanimated');
|
|
114
|
+
var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
76
115
|
|
|
77
116
|
// src/components/slider/slider.animation.ts
|
|
78
117
|
var THUMB_PRESSED_SCALE = 1.15;
|
|
79
|
-
var THUMB_SPRING = {
|
|
118
|
+
var THUMB_SPRING = {
|
|
119
|
+
damping: 18,
|
|
120
|
+
stiffness: 320,
|
|
121
|
+
mass: 0.5
|
|
122
|
+
};
|
|
80
123
|
|
|
81
124
|
// src/components/slider/slider-thumb.tsx
|
|
82
|
-
|
|
125
|
+
const _worklet_2893629534622_init_data = {
|
|
126
|
+
code: "function chunkCZ2NUGUICjs1(){const{pressed,THUMB_PRESSED_SCALE}=this.__closure;return{transform:[{scale:1+pressed.get()*(THUMB_PRESSED_SCALE-1)}]};}",
|
|
127
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-CZ2NUGUI.cjs",
|
|
128
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkCZ2NUGUICjs1\",\"pressed\",\"THUMB_PRESSED_SCALE\",\"__closure\",\"transform\",\"scale\",\"get\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-CZ2NUGUI.cjs\"],\"mappings\":\"AA4HqE,SAAAA,iBAAMA,CAAA,QAAAC,OAAA,CAAAC,mBAAA,OAAAC,SAAA,CAEvE,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAE,CAAC,CAAGJ,OAAO,CAACK,GAAG,CAAC,CAAC,EAAIJ,mBAAmB,CAAG,CAAC,CAAE,CAAC,CAAE,CAAC,CAClF\",\"ignoreList\":[]}"
|
|
129
|
+
};
|
|
83
130
|
function SliderThumb({
|
|
84
131
|
index = 0,
|
|
85
132
|
accessibilityValueText,
|
|
@@ -104,30 +151,49 @@ function SliderThumb({
|
|
|
104
151
|
const pressed = _reactnativereanimated.useSharedValue.call(void 0, 0);
|
|
105
152
|
const vertical = orientation === "vertical";
|
|
106
153
|
const travel = Math.max(trackLength - thumbSize, 0);
|
|
107
|
-
const value = _nullishCoalesce(values[index], () =>
|
|
108
|
-
const fraction = _nullishCoalesce(fractions[index], () =>
|
|
154
|
+
const value = _nullishCoalesce(values[index], () => values[0]);
|
|
155
|
+
const fraction = _nullishCoalesce(fractions[index], () => fractions[0]);
|
|
109
156
|
const start = _reactnativereanimated.useSharedValue.call(void 0, 0);
|
|
110
|
-
const move = _react.useCallback.call(void 0,
|
|
111
|
-
(along) => slideTo(index, travel === 0 ? 0 : along / travel),
|
|
112
|
-
[index, slideTo, travel]
|
|
113
|
-
);
|
|
157
|
+
const move = _react.useCallback.call(void 0, along => slideTo(index, travel === 0 ? 0 : along / travel), [index, slideTo, travel]);
|
|
114
158
|
const pan = _reactnativegesturehandler.Gesture.Pan().enabled(!isDisabled).onBegin(() => {
|
|
115
159
|
start.set(fraction * travel);
|
|
116
160
|
pressed.set(_reactnativereanimated.withSpring.call(void 0, 1, THUMB_SPRING));
|
|
117
|
-
}).onUpdate(
|
|
118
|
-
_reactnativereanimated.runOnJS.call(void 0, move)(
|
|
119
|
-
start.get() + (vertical ? -event.translationY : event.translationX)
|
|
120
|
-
);
|
|
161
|
+
}).onUpdate(event => {
|
|
162
|
+
_reactnativereanimated.runOnJS.call(void 0, move)(start.get() + (vertical ? -event.translationY : event.translationX));
|
|
121
163
|
}).onFinalize(() => {
|
|
122
164
|
pressed.set(_reactnativereanimated.withSpring.call(void 0, 0, THUMB_SPRING));
|
|
123
165
|
_reactnativereanimated.runOnJS.call(void 0, commit)();
|
|
124
166
|
});
|
|
125
|
-
const scale = _reactnativereanimated.useAnimatedStyle.call(void 0,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
167
|
+
const scale = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkCZ2NUGUICjs1Factory({
|
|
168
|
+
_worklet_2893629534622_init_data,
|
|
169
|
+
pressed,
|
|
170
|
+
THUMB_PRESSED_SCALE
|
|
171
|
+
}) {
|
|
172
|
+
const _e = [new global.Error(), -3, -27];
|
|
173
|
+
const chunkCZ2NUGUICjs1 = function () {
|
|
174
|
+
return {
|
|
175
|
+
transform: [{
|
|
176
|
+
scale: 1 + pressed.get() * (THUMB_PRESSED_SCALE - 1)
|
|
177
|
+
}]
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
chunkCZ2NUGUICjs1.__closure = {
|
|
181
|
+
pressed,
|
|
182
|
+
THUMB_PRESSED_SCALE
|
|
183
|
+
};
|
|
184
|
+
chunkCZ2NUGUICjs1.__workletHash = 2893629534622;
|
|
185
|
+
chunkCZ2NUGUICjs1.__pluginVersion = "0.7.4";
|
|
186
|
+
chunkCZ2NUGUICjs1.__initData = _worklet_2893629534622_init_data;
|
|
187
|
+
chunkCZ2NUGUICjs1.__stackDetails = _e;
|
|
188
|
+
return chunkCZ2NUGUICjs1;
|
|
189
|
+
}({
|
|
190
|
+
_worklet_2893629534622_init_data,
|
|
191
|
+
pressed,
|
|
192
|
+
THUMB_PRESSED_SCALE
|
|
193
|
+
}), [pressed]);
|
|
194
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativegesturehandler.GestureDetector, {
|
|
195
|
+
gesture: pan,
|
|
196
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
|
|
131
197
|
accessibilityRole: "adjustable",
|
|
132
198
|
accessibilityValue: {
|
|
133
199
|
min,
|
|
@@ -135,8 +201,12 @@ function SliderThumb({
|
|
|
135
201
|
now: value,
|
|
136
202
|
text: _optionalChain([accessibilityValueText, 'optionalCall', _ => _(value)])
|
|
137
203
|
},
|
|
138
|
-
accessibilityActions: [{
|
|
139
|
-
|
|
204
|
+
accessibilityActions: [{
|
|
205
|
+
name: "increment"
|
|
206
|
+
}, {
|
|
207
|
+
name: "decrement"
|
|
208
|
+
}],
|
|
209
|
+
onAccessibilityAction: event => {
|
|
140
210
|
const delta = event.nativeEvent.actionName === "increment" ? step : -step;
|
|
141
211
|
const next = value + (step === 0 ? (max - min) / 10 : delta);
|
|
142
212
|
slideTo(index, max === min ? 0 : (next - min) / (max - min));
|
|
@@ -144,23 +214,24 @@ function SliderThumb({
|
|
|
144
214
|
},
|
|
145
215
|
"aria-disabled": isDisabled || void 0,
|
|
146
216
|
...rest,
|
|
147
|
-
style: [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
) });
|
|
217
|
+
style: [thumbStyle, vertical ? {
|
|
218
|
+
bottom: fraction * travel
|
|
219
|
+
} : {
|
|
220
|
+
start: fraction * travel
|
|
221
|
+
}, scale, styleProps, style]
|
|
222
|
+
})
|
|
223
|
+
});
|
|
156
224
|
}
|
|
157
225
|
SliderThumb.displayName = "XAUI.Slider.Thumb";
|
|
158
226
|
|
|
159
227
|
// src/components/slider/slider-track.tsx
|
|
160
228
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
229
|
+
var SliderTrack = _react.forwardRef.call(void 0, function SliderTrack2({
|
|
230
|
+
children,
|
|
231
|
+
style,
|
|
232
|
+
onLayout,
|
|
233
|
+
...props
|
|
234
|
+
}, ref) {
|
|
164
235
|
const {
|
|
165
236
|
trackStyle,
|
|
166
237
|
trackLength,
|
|
@@ -174,65 +245,81 @@ var SliderTrack = _react.forwardRef.call(void 0, function SliderTrack2({ childre
|
|
|
174
245
|
} = useSlider();
|
|
175
246
|
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
176
247
|
const vertical = orientation === "vertical";
|
|
177
|
-
const measure = _react.useCallback.call(void 0,
|
|
178
|
-
(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
);
|
|
185
|
-
const handlePress = _react.useCallback.call(void 0,
|
|
186
|
-
(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
onPress: handlePress,
|
|
205
|
-
...rest,
|
|
206
|
-
onLayout: measure,
|
|
207
|
-
style: [trackStyle, styleProps, style],
|
|
208
|
-
children
|
|
209
|
-
}
|
|
210
|
-
);
|
|
248
|
+
const measure = _react.useCallback.call(void 0, event => {
|
|
249
|
+
_optionalChain([onLayout, 'optionalCall', _2 => _2(event)]);
|
|
250
|
+
const {
|
|
251
|
+
width,
|
|
252
|
+
height
|
|
253
|
+
} = event.nativeEvent.layout;
|
|
254
|
+
setTrackLength(vertical ? height : width);
|
|
255
|
+
}, [onLayout, setTrackLength, vertical]);
|
|
256
|
+
const handlePress = _react.useCallback.call(void 0, event => {
|
|
257
|
+
const travel = Math.max(trackLength - thumbSize, 1);
|
|
258
|
+
const along = vertical ?
|
|
259
|
+
// Counted from the bottom: a press near the floor of a vertical rail is a small
|
|
260
|
+
// value, not a large one.
|
|
261
|
+
trackLength - event.nativeEvent.locationY : event.nativeEvent.locationX;
|
|
262
|
+
const fraction = (along - thumbSize / 2) / travel;
|
|
263
|
+
slideTo(thumbFor(fraction), fraction);
|
|
264
|
+
commit();
|
|
265
|
+
}, [commit, slideTo, thumbFor, thumbSize, trackLength, vertical]);
|
|
266
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Pressable, {
|
|
267
|
+
ref,
|
|
268
|
+
disabled: isDisabled,
|
|
269
|
+
onPress: handlePress,
|
|
270
|
+
...rest,
|
|
271
|
+
onLayout: measure,
|
|
272
|
+
style: [trackStyle, styleProps, style],
|
|
273
|
+
children
|
|
274
|
+
});
|
|
211
275
|
});
|
|
212
276
|
SliderTrack.displayName = "XAUI.Slider.Track";
|
|
213
277
|
|
|
214
278
|
// src/components/slider/slider.tsx
|
|
215
279
|
|
|
216
|
-
|
|
217
|
-
|
|
218
280
|
// src/components/slider/slider.recipe.ts
|
|
219
281
|
var SLOTS = ["root", "output", "track", "fill", "thumb"];
|
|
220
282
|
var VARIANT_TOKENS = {
|
|
221
|
-
default: {
|
|
283
|
+
default: {
|
|
284
|
+
bg: "default",
|
|
285
|
+
bgSelected: "accent"
|
|
286
|
+
}
|
|
222
287
|
};
|
|
223
288
|
var FILL_ALPHA = 0.35;
|
|
224
289
|
var SIZES = {
|
|
225
|
-
sm: {
|
|
226
|
-
|
|
227
|
-
|
|
290
|
+
sm: {
|
|
291
|
+
track: 6,
|
|
292
|
+
thumb: 16,
|
|
293
|
+
output: "xs"
|
|
294
|
+
},
|
|
295
|
+
md: {
|
|
296
|
+
track: 8,
|
|
297
|
+
thumb: 20,
|
|
298
|
+
output: "sm"
|
|
299
|
+
},
|
|
300
|
+
lg: {
|
|
301
|
+
track: 10,
|
|
302
|
+
thumb: 24,
|
|
303
|
+
output: "md"
|
|
304
|
+
}
|
|
228
305
|
};
|
|
229
306
|
var VERTICAL_LENGTH = 220;
|
|
230
307
|
function rail(step, orientation) {
|
|
231
|
-
const {
|
|
308
|
+
const {
|
|
309
|
+
track,
|
|
310
|
+
thumb,
|
|
311
|
+
output
|
|
312
|
+
} = step;
|
|
232
313
|
const vertical = orientation === "vertical";
|
|
233
314
|
const overhang = (thumb - track) / 2;
|
|
234
|
-
return
|
|
235
|
-
root: vertical ? {
|
|
315
|
+
return theme => ({
|
|
316
|
+
root: vertical ? {
|
|
317
|
+
flexDirection: "row",
|
|
318
|
+
alignItems: "center"
|
|
319
|
+
} : {
|
|
320
|
+
flexDirection: "column",
|
|
321
|
+
width: "100%"
|
|
322
|
+
},
|
|
236
323
|
track: vertical ? {
|
|
237
324
|
width: track,
|
|
238
325
|
height: VERTICAL_LENGTH,
|
|
@@ -248,8 +335,26 @@ function rail(step, orientation) {
|
|
|
248
335
|
marginVertical: overhang
|
|
249
336
|
},
|
|
250
337
|
// Pulled back by the overhang so its centre sits on the rail's centre line.
|
|
251
|
-
thumb: vertical ? {
|
|
252
|
-
|
|
338
|
+
thumb: vertical ? {
|
|
339
|
+
width: thumb,
|
|
340
|
+
height: thumb,
|
|
341
|
+
borderRadius: thumb / 2,
|
|
342
|
+
start: -overhang
|
|
343
|
+
} : {
|
|
344
|
+
width: thumb,
|
|
345
|
+
height: thumb,
|
|
346
|
+
borderRadius: thumb / 2,
|
|
347
|
+
top: -overhang
|
|
348
|
+
},
|
|
349
|
+
fill: vertical ? {
|
|
350
|
+
start: 0,
|
|
351
|
+
end: 0,
|
|
352
|
+
bottom: 0
|
|
353
|
+
} : {
|
|
354
|
+
top: 0,
|
|
355
|
+
bottom: 0,
|
|
356
|
+
start: 0
|
|
357
|
+
},
|
|
253
358
|
output: {
|
|
254
359
|
fontSize: theme.fontSizes[output],
|
|
255
360
|
lineHeight: theme.lineHeights[output]
|
|
@@ -258,8 +363,10 @@ function rail(step, orientation) {
|
|
|
258
363
|
}
|
|
259
364
|
var sliderRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
|
|
260
365
|
slots: SLOTS,
|
|
261
|
-
base:
|
|
262
|
-
root: {
|
|
366
|
+
base: theme => ({
|
|
367
|
+
root: {
|
|
368
|
+
gap: theme.spacing(2)
|
|
369
|
+
},
|
|
263
370
|
output: {
|
|
264
371
|
fontFamily: theme.fontFamilies.body,
|
|
265
372
|
fontWeight: theme.fontWeights.medium,
|
|
@@ -267,8 +374,13 @@ var sliderRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
|
|
|
267
374
|
},
|
|
268
375
|
// `full` rather than a step of the radius scale: a rail's ends are semicircles at every
|
|
269
376
|
// thickness, and any fixed number is wrong for two of the three sizes.
|
|
270
|
-
track: {
|
|
271
|
-
|
|
377
|
+
track: {
|
|
378
|
+
borderRadius: theme.radius.full
|
|
379
|
+
},
|
|
380
|
+
fill: {
|
|
381
|
+
position: "absolute",
|
|
382
|
+
borderRadius: theme.radius.full
|
|
383
|
+
},
|
|
272
384
|
/**
|
|
273
385
|
* The knob: a solid disc of the fill's own colour, lifted off the rail by a shadow.
|
|
274
386
|
*
|
|
@@ -279,7 +391,10 @@ var sliderRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
|
|
|
279
391
|
* thinnest. The disc is the same shape at every size, and it never has to fight the
|
|
280
392
|
* fill for contrast because the fill is a softened version of it.
|
|
281
393
|
*/
|
|
282
|
-
thumb: {
|
|
394
|
+
thumb: {
|
|
395
|
+
position: "absolute",
|
|
396
|
+
...theme.shadows.surface
|
|
397
|
+
}
|
|
283
398
|
}),
|
|
284
399
|
variantTokens: VARIANT_TOKENS,
|
|
285
400
|
/**
|
|
@@ -300,50 +415,82 @@ var sliderRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
|
|
|
300
415
|
* steps at once and none of them can drift from the others.
|
|
301
416
|
*/
|
|
302
417
|
paint: (_theme, colors) => ({
|
|
303
|
-
track: {
|
|
418
|
+
track: {
|
|
419
|
+
backgroundColor: colors.bg
|
|
420
|
+
},
|
|
304
421
|
fill: {
|
|
305
422
|
backgroundColor: colors.bgSelected ? _chunkIIAQISBGcjs.alpha.call(void 0, colors.bgSelected, FILL_ALPHA) : void 0
|
|
306
423
|
},
|
|
307
|
-
thumb: {
|
|
424
|
+
thumb: {
|
|
425
|
+
backgroundColor: colors.bgSelected
|
|
426
|
+
}
|
|
308
427
|
}),
|
|
309
428
|
variants: {
|
|
310
429
|
// The axes select; the compound below is what paints. Both are declared so `size` and
|
|
311
430
|
// `orientation` are part of the cache key and a press still allocates nothing.
|
|
312
|
-
size: {
|
|
313
|
-
|
|
431
|
+
size: {
|
|
432
|
+
sm: () => ({}),
|
|
433
|
+
md: () => ({}),
|
|
434
|
+
lg: () => ({})
|
|
435
|
+
},
|
|
436
|
+
orientation: {
|
|
437
|
+
horizontal: () => ({}),
|
|
438
|
+
vertical: () => ({})
|
|
439
|
+
},
|
|
314
440
|
radius: _chunkSL3V7R2Ycjs.radiusAxis.call(void 0, "track", "fill")
|
|
315
441
|
},
|
|
316
|
-
compoundVariants: ["sm", "md", "lg"].flatMap(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
|
|
442
|
+
compoundVariants: ["sm", "md", "lg"].flatMap(size => ["horizontal", "vertical"].map(orientation => ({
|
|
443
|
+
when: {
|
|
444
|
+
size,
|
|
445
|
+
orientation
|
|
446
|
+
},
|
|
447
|
+
style: rail(SIZES[size], orientation)
|
|
448
|
+
}))),
|
|
322
449
|
states: {
|
|
323
450
|
/**
|
|
324
451
|
* Grey, and the colour goes entirely. A disabled slider still reports a value, so the
|
|
325
452
|
* bar has to stay legible — dimming the accent would leave a pale lavender that reads
|
|
326
453
|
* as an enabled slider seen through fog, where a neutral one reads as switched off.
|
|
327
454
|
*/
|
|
328
|
-
disabled:
|
|
329
|
-
root: {
|
|
330
|
-
|
|
331
|
-
|
|
455
|
+
disabled: theme => ({
|
|
456
|
+
root: {
|
|
457
|
+
opacity: theme.opacity.disabled
|
|
458
|
+
},
|
|
459
|
+
fill: {
|
|
460
|
+
backgroundColor: theme.colors.defaultSoft
|
|
461
|
+
},
|
|
462
|
+
thumb: {
|
|
463
|
+
backgroundColor: theme.colors.muted
|
|
464
|
+
}
|
|
332
465
|
})
|
|
333
466
|
},
|
|
334
|
-
defaultVariants: {
|
|
467
|
+
defaultVariants: {
|
|
468
|
+
variant: "default",
|
|
469
|
+
size: "md",
|
|
470
|
+
orientation: "horizontal"
|
|
471
|
+
}
|
|
335
472
|
});
|
|
336
473
|
|
|
337
474
|
// src/components/slider/slider.utils.ts
|
|
338
|
-
function toFraction(value, {
|
|
475
|
+
function toFraction(value, {
|
|
476
|
+
min,
|
|
477
|
+
max
|
|
478
|
+
}) {
|
|
339
479
|
if (max === min) return 0;
|
|
340
480
|
return clamp((value - min) / (max - min), 0, 1);
|
|
341
481
|
}
|
|
342
482
|
function fromFraction(fraction, range) {
|
|
343
|
-
const {
|
|
483
|
+
const {
|
|
484
|
+
min,
|
|
485
|
+
max
|
|
486
|
+
} = range;
|
|
344
487
|
return snap(min + clamp(fraction, 0, 1) * (max - min), range);
|
|
345
488
|
}
|
|
346
|
-
function snap(value, {
|
|
489
|
+
function snap(value, {
|
|
490
|
+
min,
|
|
491
|
+
max,
|
|
492
|
+
step
|
|
493
|
+
}) {
|
|
347
494
|
if (step <= 0) return clamp(value, min, max);
|
|
348
495
|
const steps = Math.round((clamp(value, min, max) - min) / step);
|
|
349
496
|
return clamp(round(min + steps * step, min, step), min, max);
|
|
@@ -405,46 +552,59 @@ var SliderRoot = _react.forwardRef.call(void 0, function Slider({
|
|
|
405
552
|
style,
|
|
406
553
|
...props
|
|
407
554
|
}, ref) {
|
|
408
|
-
const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0
|
|
555
|
+
const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0);
|
|
409
556
|
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
410
557
|
const [trackLength, setTrackLength] = _react.useState.call(void 0, 0);
|
|
411
|
-
const range = {
|
|
558
|
+
const range = {
|
|
559
|
+
min,
|
|
560
|
+
max,
|
|
561
|
+
step
|
|
562
|
+
};
|
|
412
563
|
const [raw, setValue] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
413
564
|
value: controlledValue,
|
|
414
565
|
defaultValue,
|
|
415
566
|
onChange: onValueChange
|
|
416
567
|
});
|
|
417
568
|
const values = toValues(raw, range);
|
|
418
|
-
const selection = {
|
|
569
|
+
const selection = {
|
|
570
|
+
size,
|
|
571
|
+
orientation,
|
|
572
|
+
radius
|
|
573
|
+
};
|
|
419
574
|
const styles = sliderRecipe.resolve({
|
|
420
575
|
theme,
|
|
421
576
|
selection,
|
|
422
|
-
states: {
|
|
577
|
+
states: {
|
|
578
|
+
disabled: isDisabled
|
|
579
|
+
}
|
|
423
580
|
});
|
|
424
|
-
const tint = color ? sliderRecipe.tint({
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
581
|
+
const tint = color ? sliderRecipe.tint({
|
|
582
|
+
theme,
|
|
583
|
+
color,
|
|
584
|
+
selection
|
|
585
|
+
}) : void 0;
|
|
586
|
+
const slideTo = _react.useCallback.call(void 0, (index, fraction) => {
|
|
587
|
+
const at = fromFraction(fraction, {
|
|
588
|
+
min,
|
|
589
|
+
max,
|
|
590
|
+
step
|
|
591
|
+
});
|
|
592
|
+
setValue(current => fromValues(withThumbAt(toValues(current, {
|
|
593
|
+
min,
|
|
594
|
+
max,
|
|
595
|
+
step
|
|
596
|
+
}), index, at, {
|
|
597
|
+
min,
|
|
598
|
+
max,
|
|
599
|
+
step
|
|
600
|
+
})));
|
|
601
|
+
}, [max, min, setValue, step]);
|
|
602
|
+
const thumbFor = _react.useCallback.call(void 0, fraction => nearestThumb(values, fromFraction(fraction, {
|
|
603
|
+
min,
|
|
604
|
+
max,
|
|
605
|
+
step
|
|
606
|
+
})), [max, min, step, values]);
|
|
607
|
+
const commit = _react.useCallback.call(void 0, () => _optionalChain([onValueCommit, 'optionalCall', _3 => _3(fromValues(values))]), [onValueCommit, values]);
|
|
448
608
|
const context = _react.useMemo.call(void 0, () => {
|
|
449
609
|
const thumb = _reactnative.StyleSheet.flatten([styles.thumb]);
|
|
450
610
|
return {
|
|
@@ -458,7 +618,11 @@ var SliderRoot = _react.forwardRef.call(void 0, function Slider({
|
|
|
458
618
|
max,
|
|
459
619
|
step,
|
|
460
620
|
isDisabled,
|
|
461
|
-
fractions: values.map(
|
|
621
|
+
fractions: values.map(v => toFraction(v, {
|
|
622
|
+
min,
|
|
623
|
+
max,
|
|
624
|
+
step
|
|
625
|
+
})),
|
|
462
626
|
trackLength,
|
|
463
627
|
setTrackLength,
|
|
464
628
|
// Read off the resolved style rather than recomputed: the knob's diameter is what
|
|
@@ -469,21 +633,16 @@ var SliderRoot = _react.forwardRef.call(void 0, function Slider({
|
|
|
469
633
|
thumbFor,
|
|
470
634
|
commit
|
|
471
635
|
};
|
|
472
|
-
}, [
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
slideTo,
|
|
483
|
-
thumbFor,
|
|
484
|
-
commit
|
|
485
|
-
]);
|
|
486
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SliderProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: [styles.root, styleProps, style], children }) });
|
|
636
|
+
}, [styles, tint, values, min, max, step, isDisabled, orientation, trackLength, slideTo, thumbFor, commit]);
|
|
637
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, SliderProvider, {
|
|
638
|
+
value: context,
|
|
639
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
|
|
640
|
+
ref,
|
|
641
|
+
...rest,
|
|
642
|
+
style: [styles.root, styleProps, style],
|
|
643
|
+
children
|
|
644
|
+
})
|
|
645
|
+
});
|
|
487
646
|
});
|
|
488
647
|
SliderRoot.displayName = "XAUI.Slider.Root";
|
|
489
648
|
|
|
@@ -494,17 +653,14 @@ var Slider2 = Object.assign(SliderRoot, {
|
|
|
494
653
|
Fill: SliderFill,
|
|
495
654
|
Thumb: SliderThumb
|
|
496
655
|
});
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
exports.useSlider = useSlider; exports.SliderFill = SliderFill; exports.SliderOutput = SliderOutput; exports.SliderThumb = SliderThumb; exports.SliderTrack = SliderTrack; exports.sliderRecipe = sliderRecipe; exports.toFraction = toFraction; exports.fromFraction = fromFraction; exports.snap = snap; exports.SliderRoot = SliderRoot; exports.Slider = Slider2;
|
|
656
|
+
exports.useSlider = useSlider;
|
|
657
|
+
exports.SliderFill = SliderFill;
|
|
658
|
+
exports.SliderOutput = SliderOutput;
|
|
659
|
+
exports.SliderThumb = SliderThumb;
|
|
660
|
+
exports.SliderTrack = SliderTrack;
|
|
661
|
+
exports.sliderRecipe = sliderRecipe;
|
|
662
|
+
exports.toFraction = toFraction;
|
|
663
|
+
exports.fromFraction = fromFraction;
|
|
664
|
+
exports.snap = snap;
|
|
665
|
+
exports.SliderRoot = SliderRoot;
|
|
666
|
+
exports.Slider = Slider2;
|