@component-hook/picker 1.0.1-alpha.0 → 1.0.2-alpha.0
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/README.md +5 -5
- package/dist/react/picker.es.d.ts +15 -15
- package/dist/react/picker.es.js +102 -96
- package/dist/react/picker.umd.js +12 -12
- package/dist/vue/picker.es.d.ts +55 -115
- package/dist/vue/picker.es.js +1 -0
- package/package.json +3 -3
package/dist/react/picker.es.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import he, { useRef as ve, useEffect as Ze, forwardRef as Er, useState as me, useMemo as Oe, useImperativeHandle as Yt } from "react";
|
|
3
|
+
import Me, { createPortal as gr } from "react-dom";
|
|
4
|
+
function br(t) {
|
|
4
5
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
5
6
|
}
|
|
6
7
|
var Qe = { exports: {} }, we = {};
|
|
@@ -14,7 +15,7 @@ var Qe = { exports: {} }, we = {};
|
|
|
14
15
|
* LICENSE file in the root directory of this source tree.
|
|
15
16
|
*/
|
|
16
17
|
var gt;
|
|
17
|
-
function
|
|
18
|
+
function Tr() {
|
|
18
19
|
if (gt) return we;
|
|
19
20
|
gt = 1;
|
|
20
21
|
var t = he, o = Symbol.for("react.element"), u = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
@@ -38,7 +39,7 @@ var ke = {};
|
|
|
38
39
|
* LICENSE file in the root directory of this source tree.
|
|
39
40
|
*/
|
|
40
41
|
var bt;
|
|
41
|
-
function
|
|
42
|
+
function xr() {
|
|
42
43
|
return bt || (bt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
44
|
var t = he, o = Symbol.for("react.element"), u = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), n = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), i = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), k = Symbol.iterator, T = "@@iterator";
|
|
44
45
|
function I(e) {
|
|
@@ -627,34 +628,34 @@ React keys must be passed directly to JSX without using spread:
|
|
|
627
628
|
ke.Fragment = r, ke.jsx = vr, ke.jsxs = hr;
|
|
628
629
|
}()), ke;
|
|
629
630
|
}
|
|
630
|
-
process.env.NODE_ENV === "production" ? Qe.exports =
|
|
631
|
+
process.env.NODE_ENV === "production" ? Qe.exports = Tr() : Qe.exports = xr();
|
|
631
632
|
var K = Qe.exports;
|
|
632
|
-
const
|
|
633
|
-
function
|
|
634
|
-
if (
|
|
633
|
+
const Sr = Array.isArray;
|
|
634
|
+
function _r(t, o) {
|
|
635
|
+
if (Ft(t)) return "multiple";
|
|
635
636
|
const [u] = t;
|
|
636
637
|
return u != null && u[o.children] ? "cascade" : "single";
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
+
function Rr(t) {
|
|
639
640
|
return {
|
|
640
641
|
children: (t == null ? void 0 : t.children) || "children",
|
|
641
642
|
label: (t == null ? void 0 : t.label) || "label",
|
|
642
643
|
value: (t == null ? void 0 : t.value) || "value"
|
|
643
644
|
};
|
|
644
645
|
}
|
|
645
|
-
function
|
|
646
|
+
function Or(t, o, u) {
|
|
646
647
|
var s;
|
|
647
|
-
if (
|
|
648
|
+
if (Ft(t)) return [];
|
|
648
649
|
const r = [];
|
|
649
650
|
let a = t, n = 0;
|
|
650
651
|
for (; a; ) {
|
|
651
652
|
const i = o[n];
|
|
652
|
-
let c =
|
|
653
|
+
let c = $t(a, i, u);
|
|
653
654
|
c === -1 && (c = 0), r.push(a), n += 1, a = (s = a[c]) == null ? void 0 : s[u.children];
|
|
654
655
|
}
|
|
655
656
|
return r;
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
+
function Cr(t, o, u, r) {
|
|
658
659
|
const a = [...u];
|
|
659
660
|
let n = t, s = o + 1;
|
|
660
661
|
for (; n != null && n[r.children]; ) {
|
|
@@ -663,14 +664,14 @@ function Or(t, o, u, r) {
|
|
|
663
664
|
}
|
|
664
665
|
return a;
|
|
665
666
|
}
|
|
666
|
-
function
|
|
667
|
+
function $t(t, o, u) {
|
|
667
668
|
return t.findIndex((r) => (r == null ? void 0 : r[u.value]) === o);
|
|
668
669
|
}
|
|
669
|
-
function
|
|
670
|
+
function Ft(t) {
|
|
670
671
|
const [o] = t;
|
|
671
|
-
return
|
|
672
|
+
return Sr(o);
|
|
672
673
|
}
|
|
673
|
-
function
|
|
674
|
+
function Pr(t, o) {
|
|
674
675
|
return t > o ? "horizontal" : o > t ? "vertical" : "";
|
|
675
676
|
}
|
|
676
677
|
function Ce(t, o, u) {
|
|
@@ -687,34 +688,34 @@ function Tt(t, o) {
|
|
|
687
688
|
function xt(t, o) {
|
|
688
689
|
return t === o.getFullYear();
|
|
689
690
|
}
|
|
690
|
-
function Pr(t, o) {
|
|
691
|
-
return t === o.getMonth() + 1;
|
|
692
|
-
}
|
|
693
691
|
function wr(t, o) {
|
|
694
692
|
return t === o.getMonth() + 1;
|
|
695
693
|
}
|
|
696
694
|
function kr(t, o) {
|
|
695
|
+
return t === o.getMonth() + 1;
|
|
696
|
+
}
|
|
697
|
+
function Ar(t, o) {
|
|
697
698
|
return new Date(t, o, 0).getDate();
|
|
698
699
|
}
|
|
699
|
-
function
|
|
700
|
+
function jr(t, o, u) {
|
|
700
701
|
const r = /* @__PURE__ */ new Date(), a = Date.now(), n = t.getTime(), s = o.getTime(), i = a >= n && a <= s;
|
|
701
702
|
return u === "year" ? i ? r.getFullYear() : t.getFullYear() : u === "month" ? i ? r.getMonth() + 1 : t.getMonth() + 1 : i ? r.getDate() : t.getDate();
|
|
702
703
|
}
|
|
703
704
|
function Ue(t) {
|
|
704
705
|
return t;
|
|
705
706
|
}
|
|
706
|
-
function
|
|
707
|
+
function Mr(t) {
|
|
707
708
|
return /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(t);
|
|
708
709
|
}
|
|
709
710
|
function St(t) {
|
|
710
|
-
if (!
|
|
711
|
+
if (!Mr(t)) return null;
|
|
711
712
|
const [o, u, r] = t.split(":");
|
|
712
713
|
return { hour: Number(o), minute: Number(u), second: Number(r) };
|
|
713
714
|
}
|
|
714
715
|
function We(t) {
|
|
715
716
|
return t.padStart(2, "0");
|
|
716
717
|
}
|
|
717
|
-
function
|
|
718
|
+
function Ir(t, o, u) {
|
|
718
719
|
const r = Date.now(), { hour: a, minute: n, second: s } = t, { hour: i, minute: c, second: f } = o, p = (/* @__PURE__ */ new Date()).setHours(a, n, s), h = (/* @__PURE__ */ new Date()).setHours(i, c, f), g = r >= p && r <= h;
|
|
719
720
|
return u === "hour" ? g ? (/* @__PURE__ */ new Date()).getHours() : a : u === "minute" ? g ? (/* @__PURE__ */ new Date()).getMinutes() : n : g ? (/* @__PURE__ */ new Date()).getSeconds() : s;
|
|
720
721
|
}
|
|
@@ -727,7 +728,7 @@ function De() {
|
|
|
727
728
|
return t;
|
|
728
729
|
}, De.apply(null, arguments);
|
|
729
730
|
}
|
|
730
|
-
function
|
|
731
|
+
function Lt(t, o) {
|
|
731
732
|
if (t == null) return {};
|
|
732
733
|
var u = {};
|
|
733
734
|
for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
|
|
@@ -741,7 +742,7 @@ function et(t, o) {
|
|
|
741
742
|
return u.__proto__ = r, u;
|
|
742
743
|
}, et(t, o);
|
|
743
744
|
}
|
|
744
|
-
function
|
|
745
|
+
function Vt(t, o) {
|
|
745
746
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, et(t, o);
|
|
746
747
|
}
|
|
747
748
|
var tt = { exports: {} }, Ie = { exports: {} }, H = {};
|
|
@@ -754,7 +755,7 @@ var tt = { exports: {} }, Ie = { exports: {} }, H = {};
|
|
|
754
755
|
* LICENSE file in the root directory of this source tree.
|
|
755
756
|
*/
|
|
756
757
|
var _t;
|
|
757
|
-
function
|
|
758
|
+
function Dr() {
|
|
758
759
|
if (_t) return H;
|
|
759
760
|
_t = 1;
|
|
760
761
|
var t = typeof Symbol == "function" && Symbol.for, o = t ? Symbol.for("react.element") : 60103, u = t ? Symbol.for("react.portal") : 60106, r = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, n = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, i = t ? Symbol.for("react.context") : 60110, c = t ? Symbol.for("react.async_mode") : 60111, f = t ? Symbol.for("react.concurrent_mode") : 60111, p = t ? Symbol.for("react.forward_ref") : 60112, h = t ? Symbol.for("react.suspense") : 60113, g = t ? Symbol.for("react.suspense_list") : 60120, S = t ? Symbol.for("react.memo") : 60115, k = t ? Symbol.for("react.lazy") : 60116, T = t ? Symbol.for("react.block") : 60121, I = t ? Symbol.for("react.fundamental") : 60117, F = t ? Symbol.for("react.responder") : 60118, q = t ? Symbol.for("react.scope") : 60119;
|
|
@@ -829,7 +830,7 @@ var z = {};
|
|
|
829
830
|
* LICENSE file in the root directory of this source tree.
|
|
830
831
|
*/
|
|
831
832
|
var Rt;
|
|
832
|
-
function
|
|
833
|
+
function Nr() {
|
|
833
834
|
return Rt || (Rt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
834
835
|
var t = typeof Symbol == "function" && Symbol.for, o = t ? Symbol.for("react.element") : 60103, u = t ? Symbol.for("react.portal") : 60106, r = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, n = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, i = t ? Symbol.for("react.context") : 60110, c = t ? Symbol.for("react.async_mode") : 60111, f = t ? Symbol.for("react.concurrent_mode") : 60111, p = t ? Symbol.for("react.forward_ref") : 60112, h = t ? Symbol.for("react.suspense") : 60113, g = t ? Symbol.for("react.suspense_list") : 60120, S = t ? Symbol.for("react.memo") : 60115, k = t ? Symbol.for("react.lazy") : 60116, T = t ? Symbol.for("react.block") : 60121, I = t ? Symbol.for("react.fundamental") : 60117, F = t ? Symbol.for("react.responder") : 60118, q = t ? Symbol.for("react.scope") : 60119;
|
|
835
836
|
function L(y) {
|
|
@@ -912,8 +913,8 @@ function Dr() {
|
|
|
912
913
|
}()), z;
|
|
913
914
|
}
|
|
914
915
|
var Ot;
|
|
915
|
-
function
|
|
916
|
-
return Ot || (Ot = 1, process.env.NODE_ENV === "production" ? Ie.exports =
|
|
916
|
+
function Ut() {
|
|
917
|
+
return Ot || (Ot = 1, process.env.NODE_ENV === "production" ? Ie.exports = Dr() : Ie.exports = Nr()), Ie.exports;
|
|
917
918
|
}
|
|
918
919
|
/*
|
|
919
920
|
object-assign
|
|
@@ -921,7 +922,7 @@ object-assign
|
|
|
921
922
|
@license MIT
|
|
922
923
|
*/
|
|
923
924
|
var qe, Ct;
|
|
924
|
-
function
|
|
925
|
+
function Yr() {
|
|
925
926
|
if (Ct) return qe;
|
|
926
927
|
Ct = 1;
|
|
927
928
|
var t = Object.getOwnPropertySymbols, o = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
@@ -974,17 +975,17 @@ function ot() {
|
|
|
974
975
|
return Xe = t, Xe;
|
|
975
976
|
}
|
|
976
977
|
var He, wt;
|
|
977
|
-
function
|
|
978
|
+
function Wt() {
|
|
978
979
|
return wt || (wt = 1, He = Function.call.bind(Object.prototype.hasOwnProperty)), He;
|
|
979
980
|
}
|
|
980
981
|
var ze, kt;
|
|
981
|
-
function
|
|
982
|
+
function $r() {
|
|
982
983
|
if (kt) return ze;
|
|
983
984
|
kt = 1;
|
|
984
985
|
var t = function() {
|
|
985
986
|
};
|
|
986
987
|
if (process.env.NODE_ENV !== "production") {
|
|
987
|
-
var o = ot(), u = {}, r =
|
|
988
|
+
var o = ot(), u = {}, r = Wt();
|
|
988
989
|
t = function(n) {
|
|
989
990
|
var s = "Warning: " + n;
|
|
990
991
|
typeof console < "u" && console.error(s);
|
|
@@ -1027,10 +1028,10 @@ function Yr() {
|
|
|
1027
1028
|
}, ze = a, ze;
|
|
1028
1029
|
}
|
|
1029
1030
|
var Be, At;
|
|
1030
|
-
function
|
|
1031
|
+
function Fr() {
|
|
1031
1032
|
if (At) return Be;
|
|
1032
1033
|
At = 1;
|
|
1033
|
-
var t =
|
|
1034
|
+
var t = Ut(), o = Yr(), u = ot(), r = Wt(), a = $r(), n = function() {
|
|
1034
1035
|
};
|
|
1035
1036
|
process.env.NODE_ENV !== "production" && (n = function(i) {
|
|
1036
1037
|
var c = "Warning: " + i;
|
|
@@ -1348,7 +1349,7 @@ Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
|
|
|
1348
1349
|
}, Be;
|
|
1349
1350
|
}
|
|
1350
1351
|
var Ge, jt;
|
|
1351
|
-
function
|
|
1352
|
+
function Lr() {
|
|
1352
1353
|
if (jt) return Ge;
|
|
1353
1354
|
jt = 1;
|
|
1354
1355
|
var t = ot();
|
|
@@ -1396,32 +1397,32 @@ function Fr() {
|
|
|
1396
1397
|
}, Ge;
|
|
1397
1398
|
}
|
|
1398
1399
|
if (process.env.NODE_ENV !== "production") {
|
|
1399
|
-
var
|
|
1400
|
-
tt.exports =
|
|
1400
|
+
var Vr = Ut(), Ur = !0;
|
|
1401
|
+
tt.exports = Fr()(Vr.isElement, Ur);
|
|
1401
1402
|
} else
|
|
1402
|
-
tt.exports =
|
|
1403
|
-
var
|
|
1404
|
-
const C = /* @__PURE__ */
|
|
1405
|
-
function
|
|
1403
|
+
tt.exports = Lr()();
|
|
1404
|
+
var Wr = tt.exports;
|
|
1405
|
+
const C = /* @__PURE__ */ br(Wr);
|
|
1406
|
+
function qr(t, o) {
|
|
1406
1407
|
return t.classList ? !!o && t.classList.contains(o) : (" " + (t.className.baseVal || t.className) + " ").indexOf(" " + o + " ") !== -1;
|
|
1407
1408
|
}
|
|
1408
|
-
function
|
|
1409
|
-
t.classList ? t.classList.add(o) :
|
|
1409
|
+
function Xr(t, o) {
|
|
1410
|
+
t.classList ? t.classList.add(o) : qr(t, o) || (typeof t.className == "string" ? t.className = t.className + " " + o : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + o));
|
|
1410
1411
|
}
|
|
1411
1412
|
function Mt(t, o) {
|
|
1412
1413
|
return t.replace(new RegExp("(^|\\s)" + o + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
1413
1414
|
}
|
|
1414
|
-
function
|
|
1415
|
+
function Hr(t, o) {
|
|
1415
1416
|
t.classList ? t.classList.remove(o) : typeof t.className == "string" ? t.className = Mt(t.className, o) : t.setAttribute("class", Mt(t.className && t.className.baseVal || "", o));
|
|
1416
1417
|
}
|
|
1417
1418
|
const It = {
|
|
1418
1419
|
disabled: !1
|
|
1419
1420
|
};
|
|
1420
|
-
var
|
|
1421
|
+
var zr = process.env.NODE_ENV !== "production" ? C.oneOfType([C.number, C.shape({
|
|
1421
1422
|
enter: C.number,
|
|
1422
1423
|
exit: C.number,
|
|
1423
1424
|
appear: C.number
|
|
1424
|
-
}).isRequired]) : null,
|
|
1425
|
+
}).isRequired]) : null, Br = process.env.NODE_ENV !== "production" ? C.oneOfType([C.string, C.shape({
|
|
1425
1426
|
enter: C.string,
|
|
1426
1427
|
exit: C.string,
|
|
1427
1428
|
active: C.string
|
|
@@ -1433,11 +1434,11 @@ var Hr = process.env.NODE_ENV !== "production" ? C.oneOfType([C.number, C.shape(
|
|
|
1433
1434
|
exitDone: C.string,
|
|
1434
1435
|
exitActive: C.string
|
|
1435
1436
|
})]) : null;
|
|
1436
|
-
const
|
|
1437
|
-
var
|
|
1437
|
+
const qt = he.createContext(null);
|
|
1438
|
+
var Xt = function(o) {
|
|
1438
1439
|
return o.scrollTop;
|
|
1439
1440
|
}, Ae = "unmounted", ge = "exited", be = "entering", Re = "entered", rt = "exiting", pe = /* @__PURE__ */ function(t) {
|
|
1440
|
-
|
|
1441
|
+
Vt(o, t);
|
|
1441
1442
|
function o(r, a) {
|
|
1442
1443
|
var n;
|
|
1443
1444
|
n = t.call(this, r, a) || this;
|
|
@@ -1476,7 +1477,7 @@ var Ht = function(o) {
|
|
|
1476
1477
|
if (this.cancelNextCallback(), n === be) {
|
|
1477
1478
|
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
1478
1479
|
var s = this.props.nodeRef ? this.props.nodeRef.current : Me.findDOMNode(this);
|
|
1479
|
-
s &&
|
|
1480
|
+
s && Xt(s);
|
|
1480
1481
|
}
|
|
1481
1482
|
this.performEnter(a);
|
|
1482
1483
|
} else
|
|
@@ -1555,16 +1556,16 @@ var Ht = function(o) {
|
|
|
1555
1556
|
return null;
|
|
1556
1557
|
var n = this.props, s = n.children;
|
|
1557
1558
|
n.in, n.mountOnEnter, n.unmountOnExit, n.appear, n.enter, n.exit, n.timeout, n.addEndListener, n.onEnter, n.onEntering, n.onEntered, n.onExit, n.onExiting, n.onExited, n.nodeRef;
|
|
1558
|
-
var i =
|
|
1559
|
+
var i = Lt(n, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
1559
1560
|
return (
|
|
1560
1561
|
// allows for nested Transitions
|
|
1561
|
-
/* @__PURE__ */ he.createElement(
|
|
1562
|
+
/* @__PURE__ */ he.createElement(qt.Provider, {
|
|
1562
1563
|
value: null
|
|
1563
1564
|
}, typeof s == "function" ? s(a, i) : he.cloneElement(he.Children.only(s), i))
|
|
1564
1565
|
);
|
|
1565
1566
|
}, o;
|
|
1566
1567
|
}(he.Component);
|
|
1567
|
-
pe.contextType =
|
|
1568
|
+
pe.contextType = qt;
|
|
1568
1569
|
pe.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1569
1570
|
/**
|
|
1570
1571
|
* A React reference to DOM element that need to transition:
|
|
@@ -1661,7 +1662,7 @@ pe.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1661
1662
|
* @type {number | { enter?: number, exit?: number, appear?: number }}
|
|
1662
1663
|
*/
|
|
1663
1664
|
timeout: function(o) {
|
|
1664
|
-
var u =
|
|
1665
|
+
var u = zr;
|
|
1665
1666
|
o.addEndListener || (u = u.isRequired);
|
|
1666
1667
|
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
1667
1668
|
a[n - 1] = arguments[n];
|
|
@@ -1755,16 +1756,16 @@ pe.EXITED = ge;
|
|
|
1755
1756
|
pe.ENTERING = be;
|
|
1756
1757
|
pe.ENTERED = Re;
|
|
1757
1758
|
pe.EXITING = rt;
|
|
1758
|
-
var
|
|
1759
|
+
var Gr = function(o, u) {
|
|
1759
1760
|
return o && u && u.split(" ").forEach(function(r) {
|
|
1760
|
-
return
|
|
1761
|
+
return Xr(o, r);
|
|
1761
1762
|
});
|
|
1762
1763
|
}, Je = function(o, u) {
|
|
1763
1764
|
return o && u && u.split(" ").forEach(function(r) {
|
|
1764
|
-
return
|
|
1765
|
+
return Hr(o, r);
|
|
1765
1766
|
});
|
|
1766
1767
|
}, Ne = /* @__PURE__ */ function(t) {
|
|
1767
|
-
|
|
1768
|
+
Vt(o, t);
|
|
1768
1769
|
function o() {
|
|
1769
1770
|
for (var r, a = arguments.length, n = new Array(a), s = 0; s < a; s++)
|
|
1770
1771
|
n[s] = arguments[s];
|
|
@@ -1804,14 +1805,14 @@ var Br = function(o, u) {
|
|
|
1804
1805
|
var u = o.prototype;
|
|
1805
1806
|
return u.addClass = function(a, n, s) {
|
|
1806
1807
|
var i = this.getClassNames(n)[s + "ClassName"], c = this.getClassNames("enter"), f = c.doneClassName;
|
|
1807
|
-
n === "appear" && s === "done" && f && (i += " " + f), s === "active" && a &&
|
|
1808
|
+
n === "appear" && s === "done" && f && (i += " " + f), s === "active" && a && Xt(a), i && (this.appliedClasses[n][s] = i, Gr(a, i));
|
|
1808
1809
|
}, u.removeClasses = function(a, n) {
|
|
1809
1810
|
var s = this.appliedClasses[n], i = s.base, c = s.active, f = s.done;
|
|
1810
1811
|
this.appliedClasses[n] = {}, i && Je(a, i), c && Je(a, c), f && Je(a, f);
|
|
1811
1812
|
}, u.render = function() {
|
|
1812
1813
|
var a = this.props;
|
|
1813
1814
|
a.classNames;
|
|
1814
|
-
var n =
|
|
1815
|
+
var n = Lt(a, ["classNames"]);
|
|
1815
1816
|
return /* @__PURE__ */ he.createElement(pe, De({}, n, {
|
|
1816
1817
|
onEnter: this.onEnter,
|
|
1817
1818
|
onEntered: this.onEntered,
|
|
@@ -1894,7 +1895,7 @@ Ne.propTypes = process.env.NODE_ENV !== "production" ? De({}, pe.propTypes, {
|
|
|
1894
1895
|
* exitDone?: string,
|
|
1895
1896
|
* }}
|
|
1896
1897
|
*/
|
|
1897
|
-
classNames:
|
|
1898
|
+
classNames: Br,
|
|
1898
1899
|
/**
|
|
1899
1900
|
* A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
|
|
1900
1901
|
* applied.
|
|
@@ -1949,7 +1950,7 @@ Ne.propTypes = process.env.NODE_ENV !== "production" ? De({}, pe.propTypes, {
|
|
|
1949
1950
|
*/
|
|
1950
1951
|
onExited: C.func
|
|
1951
1952
|
}) : {};
|
|
1952
|
-
function
|
|
1953
|
+
function Jr({
|
|
1953
1954
|
show: t,
|
|
1954
1955
|
onClose: o,
|
|
1955
1956
|
onOpen: u,
|
|
@@ -1964,7 +1965,7 @@ function Gr({
|
|
|
1964
1965
|
function c(f) {
|
|
1965
1966
|
s.current && (s.current.style.setProperty("display", f), f === "none" && (r == null || r()));
|
|
1966
1967
|
}
|
|
1967
|
-
return
|
|
1968
|
+
return gr(
|
|
1968
1969
|
/* @__PURE__ */ K.jsxs(K.Fragment, { children: [
|
|
1969
1970
|
/* @__PURE__ */ K.jsx(
|
|
1970
1971
|
Ne,
|
|
@@ -2012,8 +2013,11 @@ function Gr({
|
|
|
2012
2013
|
n
|
|
2013
2014
|
);
|
|
2014
2015
|
}
|
|
2015
|
-
|
|
2016
|
-
|
|
2016
|
+
function Ht(t) {
|
|
2017
|
+
return Er(t);
|
|
2018
|
+
}
|
|
2019
|
+
const Kr = 16, nt = 48, Zr = 0.52, Dt = 150, Ke = 300, Qr = 15, en = 8e-3, Nt = 5, tn = "Select Date", rn = ["year", "month", "day"], nn = "Select Time", on = ["hour", "minute", "second"];
|
|
2020
|
+
function an() {
|
|
2017
2021
|
const t = {
|
|
2018
2022
|
startX: 0,
|
|
2019
2023
|
startY: 0,
|
|
@@ -2036,7 +2040,7 @@ function on() {
|
|
|
2036
2040
|
const p = "touches" in f ? f.touches[0] : f;
|
|
2037
2041
|
t.deltaX = Math.max(p.clientX, 0) - t.startX, t.deltaY = p.clientY - t.startY, t.offsetX = Math.abs(t.deltaX), t.offsetY = Math.abs(t.deltaY);
|
|
2038
2042
|
const h = 10;
|
|
2039
|
-
(!o || t.offsetX < h && t.offsetY < h) && (o =
|
|
2043
|
+
(!o || t.offsetX < h && t.offsetY < h) && (o = Pr(t.offsetX, t.offsetY)), u && (t.offsetX > Nt || t.offsetY > Nt) && (u = !1);
|
|
2040
2044
|
}
|
|
2041
2045
|
function c() {
|
|
2042
2046
|
t.startX = 0, t.startY = 0;
|
|
@@ -2051,8 +2055,8 @@ function on() {
|
|
|
2051
2055
|
isHorizontal: a
|
|
2052
2056
|
};
|
|
2053
2057
|
}
|
|
2054
|
-
function
|
|
2055
|
-
const r = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) /
|
|
2058
|
+
function sn({ column: t, onChange: o }) {
|
|
2059
|
+
const r = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) / Kr, [a, n] = me(0), [s, i] = me(0), c = ve(0), f = ve(0), p = ve(0), h = ve(!1), g = ve(null), { pointer: S, start: k, move: T, stop: I } = Oe(() => an(), []);
|
|
2056
2060
|
function F(U) {
|
|
2057
2061
|
return U * r;
|
|
2058
2062
|
}
|
|
@@ -2075,7 +2079,7 @@ function an({ column: t, onChange: o }) {
|
|
|
2075
2079
|
function ee() {
|
|
2076
2080
|
I();
|
|
2077
2081
|
const U = a - p.current, $ = Date.now() - f.current;
|
|
2078
|
-
if ($ < Ke && Math.abs(U) >
|
|
2082
|
+
if ($ < Ke && Math.abs(U) > Qr) {
|
|
2079
2083
|
fe(U, $);
|
|
2080
2084
|
return;
|
|
2081
2085
|
}
|
|
@@ -2083,7 +2087,7 @@ function an({ column: t, onChange: o }) {
|
|
|
2083
2087
|
i(Dt), L(Z), h.current = !1;
|
|
2084
2088
|
}
|
|
2085
2089
|
function fe(U, $) {
|
|
2086
|
-
const Z = Math.abs(U / $), te = a + Z /
|
|
2090
|
+
const Z = Math.abs(U / $), te = a + Z / en * (U < 0 ? -1 : 1), j = q(te);
|
|
2087
2091
|
i(Ke), L(j);
|
|
2088
2092
|
}
|
|
2089
2093
|
function ue() {
|
|
@@ -2102,12 +2106,12 @@ function an({ column: t, onChange: o }) {
|
|
|
2102
2106
|
scrollToIndex: Q
|
|
2103
2107
|
};
|
|
2104
2108
|
}
|
|
2105
|
-
|
|
2106
|
-
const { offsetY: n, transitionDuration: s, onPointerDown: i, onPointerMove: c, onPointerUp: f, stopInertialSliding: p, scrollToIndex: h } =
|
|
2109
|
+
function un({ column: t, fields: o, selectedIndex: u = 0, onChange: r }, a) {
|
|
2110
|
+
const { offsetY: n, transitionDuration: s, onPointerDown: i, onPointerMove: c, onPointerUp: f, stopInertialSliding: p, scrollToIndex: h } = sn({
|
|
2107
2111
|
column: t,
|
|
2108
2112
|
onChange: g
|
|
2109
2113
|
});
|
|
2110
|
-
|
|
2114
|
+
Yt(a, () => ({
|
|
2111
2115
|
scrollToSelected: S
|
|
2112
2116
|
}));
|
|
2113
2117
|
function g(T) {
|
|
@@ -2157,7 +2161,7 @@ const zt = Yt(({ column: t, fields: o, selectedIndex: u = 0, onChange: r }, a) =
|
|
|
2157
2161
|
{
|
|
2158
2162
|
className: "chook-picker-column-label",
|
|
2159
2163
|
style: {
|
|
2160
|
-
transform: `rotate3d(1, 0, 0, ${(I * nt + n) *
|
|
2164
|
+
transform: `rotate3d(1, 0, 0, ${(I * nt + n) * Zr}deg)`
|
|
2161
2165
|
},
|
|
2162
2166
|
children: T == null ? void 0 : T[o.label]
|
|
2163
2167
|
}
|
|
@@ -2169,9 +2173,10 @@ const zt = Yt(({ column: t, fields: o, selectedIndex: u = 0, onChange: r }, a) =
|
|
|
2169
2173
|
)
|
|
2170
2174
|
}
|
|
2171
2175
|
);
|
|
2172
|
-
}
|
|
2176
|
+
}
|
|
2177
|
+
const zt = Ht(un);
|
|
2173
2178
|
zt.displayName = "Column";
|
|
2174
|
-
|
|
2179
|
+
function cn(t, o) {
|
|
2175
2180
|
const {
|
|
2176
2181
|
loading: u,
|
|
2177
2182
|
loadingSlot: r,
|
|
@@ -2182,7 +2187,7 @@ const Bt = Yt((t, o) => {
|
|
|
2182
2187
|
selectedIndices: c,
|
|
2183
2188
|
updateSelectedValueByIndex: f
|
|
2184
2189
|
} = t, p = ve([]);
|
|
2185
|
-
|
|
2190
|
+
Yt(o, () => ({
|
|
2186
2191
|
scrollColumnToSelected: h
|
|
2187
2192
|
}));
|
|
2188
2193
|
function h(g, S) {
|
|
@@ -2213,7 +2218,8 @@ const Bt = Yt((t, o) => {
|
|
|
2213
2218
|
]
|
|
2214
2219
|
}
|
|
2215
2220
|
) : /* @__PURE__ */ K.jsx("div", { className: "chook-picker-columns", children: n });
|
|
2216
|
-
}
|
|
2221
|
+
}
|
|
2222
|
+
const Bt = Ht(cn);
|
|
2217
2223
|
Bt.displayName = "Columns";
|
|
2218
2224
|
function Gt({
|
|
2219
2225
|
show: t,
|
|
@@ -2235,7 +2241,7 @@ function Gt({
|
|
|
2235
2241
|
onOpen: I,
|
|
2236
2242
|
onClosed: F
|
|
2237
2243
|
}) {
|
|
2238
|
-
const [q, L] = me([]), [P, v] = me([]), [ee, fe] = me([]), ue = ve(null), Q =
|
|
2244
|
+
const [q, L] = me([]), [P, v] = me([]), [ee, fe] = me([]), ue = ve(null), Q = Rr(h), U = _r(r, Q), $ = Oe(() => U === "single" ? [r] : U === "multiple" ? r : Or(r, P, Q), [r, U, P, Q]);
|
|
2239
2245
|
Ze(() => {
|
|
2240
2246
|
!o || o.every((ne, l) => ne === P[l]) || v(o);
|
|
2241
2247
|
}, [o]), Ze(() => {
|
|
@@ -2243,7 +2249,7 @@ function Gt({
|
|
|
2243
2249
|
const G = $.length, ne = [];
|
|
2244
2250
|
let l = !1;
|
|
2245
2251
|
for (let b = 0; b < G; b++) {
|
|
2246
|
-
const x = $[b], _ = P[b], A =
|
|
2252
|
+
const x = $[b], _ = P[b], A = $t(x, _, Q);
|
|
2247
2253
|
if (A === -1) {
|
|
2248
2254
|
const w = (ee[b] ?? 0) >= x.length ? Math.max(x.length - 1, 0) : 0;
|
|
2249
2255
|
ne[b] = w;
|
|
@@ -2259,7 +2265,7 @@ function Gt({
|
|
|
2259
2265
|
if (m === b) return;
|
|
2260
2266
|
const x = [...P];
|
|
2261
2267
|
if (x[G] = m, U === "cascade") {
|
|
2262
|
-
const A = l[ne], O =
|
|
2268
|
+
const A = l[ne], O = Cr(A, G, x, Q);
|
|
2263
2269
|
v(O), te(O);
|
|
2264
2270
|
} else
|
|
2265
2271
|
v(x), te(x);
|
|
@@ -2280,7 +2286,7 @@ function Gt({
|
|
|
2280
2286
|
v(o ? [...o] : [...q]), F == null || F();
|
|
2281
2287
|
}
|
|
2282
2288
|
return /* @__PURE__ */ K.jsxs(
|
|
2283
|
-
|
|
2289
|
+
Jr,
|
|
2284
2290
|
{
|
|
2285
2291
|
show: t,
|
|
2286
2292
|
teleport: c,
|
|
@@ -2325,11 +2331,11 @@ function Gt({
|
|
|
2325
2331
|
}
|
|
2326
2332
|
);
|
|
2327
2333
|
}
|
|
2328
|
-
function
|
|
2334
|
+
function dn({
|
|
2329
2335
|
show: t,
|
|
2330
2336
|
values: o,
|
|
2331
|
-
title: u =
|
|
2332
|
-
columnsType: r =
|
|
2337
|
+
title: u = tn,
|
|
2338
|
+
columnsType: r = rn,
|
|
2333
2339
|
minDate: a = new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1),
|
|
2334
2340
|
maxDate: n = new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11, 31),
|
|
2335
2341
|
teleport: s,
|
|
@@ -2361,12 +2367,12 @@ function cn({
|
|
|
2361
2367
|
return Ce(B, M, p);
|
|
2362
2368
|
}
|
|
2363
2369
|
function ue() {
|
|
2364
|
-
const j = Q("year"), B = Q("month"), M = Tt(j, a) &&
|
|
2370
|
+
const j = Q("year"), B = Q("month"), M = Tt(j, a) && wr(B, a), re = xt(j, n) && kr(B, n), G = M ? a.getDate() : 1, ne = re ? n.getDate() : Ar(j, B);
|
|
2365
2371
|
return Ce(G, ne, h);
|
|
2366
2372
|
}
|
|
2367
2373
|
function Q(j) {
|
|
2368
2374
|
const B = r.indexOf(j), M = L[B];
|
|
2369
|
-
return M ? Number(M) :
|
|
2375
|
+
return M ? Number(M) : jr(a, n, j);
|
|
2370
2376
|
}
|
|
2371
2377
|
function U(j) {
|
|
2372
2378
|
q(j), S(), g == null || g(j);
|
|
@@ -2400,11 +2406,11 @@ function cn({
|
|
|
2400
2406
|
}
|
|
2401
2407
|
);
|
|
2402
2408
|
}
|
|
2403
|
-
function
|
|
2409
|
+
function pn({
|
|
2404
2410
|
show: t,
|
|
2405
2411
|
values: o,
|
|
2406
|
-
title: u =
|
|
2407
|
-
columnsType: r =
|
|
2412
|
+
title: u = nn,
|
|
2413
|
+
columnsType: r = on,
|
|
2408
2414
|
minTime: a,
|
|
2409
2415
|
maxTime: n,
|
|
2410
2416
|
teleport: s,
|
|
@@ -2448,7 +2454,7 @@ function fn({
|
|
|
2448
2454
|
}
|
|
2449
2455
|
function $(M) {
|
|
2450
2456
|
const re = r.indexOf(M), G = L[re];
|
|
2451
|
-
return G !== void 0 ? Number(G) :
|
|
2457
|
+
return G !== void 0 ? Number(G) : Ir(v, ee, M);
|
|
2452
2458
|
}
|
|
2453
2459
|
function Z(M) {
|
|
2454
2460
|
q(M), S(), g == null || g(M);
|
|
@@ -2483,7 +2489,7 @@ function fn({
|
|
|
2483
2489
|
);
|
|
2484
2490
|
}
|
|
2485
2491
|
export {
|
|
2486
|
-
|
|
2492
|
+
dn as DatePicker,
|
|
2487
2493
|
Gt as Picker,
|
|
2488
|
-
|
|
2494
|
+
pn as TimePicker
|
|
2489
2495
|
};
|