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