@component-hook/picker 1.0.1 → 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 +101 -96
- package/dist/react/picker.umd.js +12 -12
- package/dist/vue/picker.es.d.ts +55 -115
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -44,13 +44,13 @@ $ pnpm install @component-hook/picker
|
|
|
44
44
|
```vue
|
|
45
45
|
<script setup lang="ts">
|
|
46
46
|
import { ref } from 'vue';
|
|
47
|
-
import { Picker
|
|
47
|
+
import { Picker } from '@component-hook/picker/vue';
|
|
48
48
|
|
|
49
49
|
const isShowPicker = ref(false);
|
|
50
|
-
const pickerValues = ref<
|
|
50
|
+
const pickerValues = ref<number[]>([]);
|
|
51
51
|
const columns = Array.from({ length: 50 }, (_, index) => ({ label: index, value: index }));
|
|
52
52
|
|
|
53
|
-
function onConfirm(value:
|
|
53
|
+
function onConfirm(value: number[]) {
|
|
54
54
|
pickerValues.value = value;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -84,9 +84,9 @@ const columns = Array.from({ length: 50 }, (_, index) => ({ label: index, value:
|
|
|
84
84
|
|
|
85
85
|
export function BasePicker() {
|
|
86
86
|
const [showPicker, setShowPicker] = useState(false);
|
|
87
|
-
const [pickerValues, setPickerValues] = useState<
|
|
87
|
+
const [pickerValues, setPickerValues] = useState<number[]>([]);
|
|
88
88
|
|
|
89
|
-
function onConfirm(values:
|
|
89
|
+
function onConfirm(values: number[]) {
|
|
90
90
|
setPickerValues(values);
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -7,9 +7,9 @@ export declare type DatePickerColumnType = 'year' | 'month' | 'day';
|
|
|
7
7
|
|
|
8
8
|
export declare type Direction = '' | 'vertical' | 'horizontal';
|
|
9
9
|
|
|
10
|
-
export declare function Picker({ show, values, title, columns, linkage, loading, loadingSlot, emptySlot, teleport, confirmButtonText, cancelButtonText, columnsFieldNames, onConfirm, onClose, onChange, onCancel, onOpen, onClosed, }: Props): JSX_2.Element;
|
|
10
|
+
export declare function Picker<T>({ show, values, title, columns, linkage, loading, loadingSlot, emptySlot, teleport, confirmButtonText, cancelButtonText, columnsFieldNames, onConfirm, onClose, onChange, onCancel, onOpen, onClosed, }: Props<T>): JSX_2.Element;
|
|
11
11
|
|
|
12
|
-
export declare type PickerColumn = Array<PickerOption | undefined>;
|
|
12
|
+
export declare type PickerColumn<T = string | number> = Array<PickerOption<T> | undefined>;
|
|
13
13
|
|
|
14
14
|
export declare type PickerColumnsType = 'single' | 'multiple' | 'cascade';
|
|
15
15
|
|
|
@@ -21,20 +21,20 @@ export declare interface PickerFields {
|
|
|
21
21
|
|
|
22
22
|
export declare type PickerFormatLabel = (label: string) => string;
|
|
23
23
|
|
|
24
|
-
export declare interface PickerOption {
|
|
24
|
+
export declare interface PickerOption<T> {
|
|
25
25
|
label?: string | number;
|
|
26
|
-
value?:
|
|
27
|
-
children?: PickerColumn
|
|
26
|
+
value?: T;
|
|
27
|
+
children?: PickerColumn<T>;
|
|
28
28
|
[key: PropertyKey]: any;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export declare type PickerSelectedValues = Array<PickerOption['value']>;
|
|
31
|
+
export declare type PickerSelectedValues<T = string | number> = Array<PickerOption<T>['value']>;
|
|
32
32
|
|
|
33
|
-
declare interface Props {
|
|
33
|
+
declare interface Props<T = string | number> {
|
|
34
34
|
show: boolean;
|
|
35
|
-
values?:
|
|
35
|
+
values?: T[];
|
|
36
36
|
title?: string;
|
|
37
|
-
columns: PickerColumn | PickerColumn[];
|
|
37
|
+
columns: PickerColumn<T> | PickerColumn<T>[];
|
|
38
38
|
linkage?: boolean;
|
|
39
39
|
loading?: boolean;
|
|
40
40
|
loadingSlot?: ReactNode;
|
|
@@ -43,9 +43,9 @@ declare interface Props {
|
|
|
43
43
|
confirmButtonText?: string;
|
|
44
44
|
cancelButtonText?: string;
|
|
45
45
|
columnsFieldNames?: PickerFields;
|
|
46
|
-
onConfirm?: (values:
|
|
46
|
+
onConfirm?: (values: T[]) => void;
|
|
47
47
|
onClose: () => void;
|
|
48
|
-
onChange?: (values:
|
|
48
|
+
onChange?: (values: T[]) => void;
|
|
49
49
|
onCancel?: () => void;
|
|
50
50
|
onOpen?: () => void;
|
|
51
51
|
onClosed?: () => void;
|
|
@@ -53,7 +53,7 @@ declare interface Props {
|
|
|
53
53
|
|
|
54
54
|
declare interface Props_2 {
|
|
55
55
|
show: boolean;
|
|
56
|
-
values?:
|
|
56
|
+
values?: number[];
|
|
57
57
|
title?: string;
|
|
58
58
|
columnsType?: DatePickerColumnType[];
|
|
59
59
|
minDate?: Date;
|
|
@@ -64,7 +64,7 @@ declare interface Props_2 {
|
|
|
64
64
|
formatYearLabel?: PickerFormatLabel;
|
|
65
65
|
formatMonthLabel?: PickerFormatLabel;
|
|
66
66
|
formatDayLabel?: PickerFormatLabel;
|
|
67
|
-
onConfirm?: (values:
|
|
67
|
+
onConfirm?: (values: number[]) => void;
|
|
68
68
|
onClose: () => void;
|
|
69
69
|
onCancel?: () => void;
|
|
70
70
|
onOpen?: () => void;
|
|
@@ -73,7 +73,7 @@ declare interface Props_2 {
|
|
|
73
73
|
|
|
74
74
|
declare interface Props_3 {
|
|
75
75
|
show: boolean;
|
|
76
|
-
values?:
|
|
76
|
+
values?: number[];
|
|
77
77
|
title?: string;
|
|
78
78
|
columnsType?: TimePickerColumnType[];
|
|
79
79
|
minTime?: string;
|
|
@@ -84,7 +84,7 @@ declare interface Props_3 {
|
|
|
84
84
|
formatHourLabel?: PickerFormatLabel;
|
|
85
85
|
formatMinuteLabel?: PickerFormatLabel;
|
|
86
86
|
formatSecondLabel?: PickerFormatLabel;
|
|
87
|
-
onConfirm?: (values:
|
|
87
|
+
onConfirm?: (values: number[]) => void;
|
|
88
88
|
onClose: () => void;
|
|
89
89
|
onCancel?: () => void;
|
|
90
90
|
onOpen?: () => void;
|
package/dist/react/picker.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import he, { useRef as ve, useEffect as Ze,
|
|
3
|
-
import Me, { createPortal as
|
|
4
|
-
function
|
|
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) {
|
|
5
5
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
6
6
|
}
|
|
7
7
|
var Qe = { exports: {} }, we = {};
|
|
@@ -15,7 +15,7 @@ var Qe = { exports: {} }, we = {};
|
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
|
16
16
|
*/
|
|
17
17
|
var gt;
|
|
18
|
-
function
|
|
18
|
+
function Tr() {
|
|
19
19
|
if (gt) return we;
|
|
20
20
|
gt = 1;
|
|
21
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 };
|
|
@@ -39,7 +39,7 @@ var ke = {};
|
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
41
|
var bt;
|
|
42
|
-
function
|
|
42
|
+
function xr() {
|
|
43
43
|
return bt || (bt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
44
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";
|
|
45
45
|
function I(e) {
|
|
@@ -628,34 +628,34 @@ React keys must be passed directly to JSX without using spread:
|
|
|
628
628
|
ke.Fragment = r, ke.jsx = vr, ke.jsxs = hr;
|
|
629
629
|
}()), ke;
|
|
630
630
|
}
|
|
631
|
-
process.env.NODE_ENV === "production" ? Qe.exports =
|
|
631
|
+
process.env.NODE_ENV === "production" ? Qe.exports = Tr() : Qe.exports = xr();
|
|
632
632
|
var K = Qe.exports;
|
|
633
|
-
const
|
|
634
|
-
function
|
|
635
|
-
if (
|
|
633
|
+
const Sr = Array.isArray;
|
|
634
|
+
function _r(t, o) {
|
|
635
|
+
if (Ft(t)) return "multiple";
|
|
636
636
|
const [u] = t;
|
|
637
637
|
return u != null && u[o.children] ? "cascade" : "single";
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function Rr(t) {
|
|
640
640
|
return {
|
|
641
641
|
children: (t == null ? void 0 : t.children) || "children",
|
|
642
642
|
label: (t == null ? void 0 : t.label) || "label",
|
|
643
643
|
value: (t == null ? void 0 : t.value) || "value"
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Or(t, o, u) {
|
|
647
647
|
var s;
|
|
648
|
-
if (
|
|
648
|
+
if (Ft(t)) return [];
|
|
649
649
|
const r = [];
|
|
650
650
|
let a = t, n = 0;
|
|
651
651
|
for (; a; ) {
|
|
652
652
|
const i = o[n];
|
|
653
|
-
let c =
|
|
653
|
+
let c = $t(a, i, u);
|
|
654
654
|
c === -1 && (c = 0), r.push(a), n += 1, a = (s = a[c]) == null ? void 0 : s[u.children];
|
|
655
655
|
}
|
|
656
656
|
return r;
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function Cr(t, o, u, r) {
|
|
659
659
|
const a = [...u];
|
|
660
660
|
let n = t, s = o + 1;
|
|
661
661
|
for (; n != null && n[r.children]; ) {
|
|
@@ -664,14 +664,14 @@ function Or(t, o, u, r) {
|
|
|
664
664
|
}
|
|
665
665
|
return a;
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function $t(t, o, u) {
|
|
668
668
|
return t.findIndex((r) => (r == null ? void 0 : r[u.value]) === o);
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Ft(t) {
|
|
671
671
|
const [o] = t;
|
|
672
|
-
return
|
|
672
|
+
return Sr(o);
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function Pr(t, o) {
|
|
675
675
|
return t > o ? "horizontal" : o > t ? "vertical" : "";
|
|
676
676
|
}
|
|
677
677
|
function Ce(t, o, u) {
|
|
@@ -688,34 +688,34 @@ function Tt(t, o) {
|
|
|
688
688
|
function xt(t, o) {
|
|
689
689
|
return t === o.getFullYear();
|
|
690
690
|
}
|
|
691
|
-
function Pr(t, o) {
|
|
692
|
-
return t === o.getMonth() + 1;
|
|
693
|
-
}
|
|
694
691
|
function wr(t, o) {
|
|
695
692
|
return t === o.getMonth() + 1;
|
|
696
693
|
}
|
|
697
694
|
function kr(t, o) {
|
|
695
|
+
return t === o.getMonth() + 1;
|
|
696
|
+
}
|
|
697
|
+
function Ar(t, o) {
|
|
698
698
|
return new Date(t, o, 0).getDate();
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function jr(t, o, u) {
|
|
701
701
|
const r = /* @__PURE__ */ new Date(), a = Date.now(), n = t.getTime(), s = o.getTime(), i = a >= n && a <= s;
|
|
702
702
|
return u === "year" ? i ? r.getFullYear() : t.getFullYear() : u === "month" ? i ? r.getMonth() + 1 : t.getMonth() + 1 : i ? r.getDate() : t.getDate();
|
|
703
703
|
}
|
|
704
704
|
function Ue(t) {
|
|
705
705
|
return t;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function Mr(t) {
|
|
708
708
|
return /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(t);
|
|
709
709
|
}
|
|
710
710
|
function St(t) {
|
|
711
|
-
if (!
|
|
711
|
+
if (!Mr(t)) return null;
|
|
712
712
|
const [o, u, r] = t.split(":");
|
|
713
713
|
return { hour: Number(o), minute: Number(u), second: Number(r) };
|
|
714
714
|
}
|
|
715
715
|
function We(t) {
|
|
716
716
|
return t.padStart(2, "0");
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function Ir(t, o, u) {
|
|
719
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;
|
|
720
720
|
return u === "hour" ? g ? (/* @__PURE__ */ new Date()).getHours() : a : u === "minute" ? g ? (/* @__PURE__ */ new Date()).getMinutes() : n : g ? (/* @__PURE__ */ new Date()).getSeconds() : s;
|
|
721
721
|
}
|
|
@@ -728,7 +728,7 @@ function De() {
|
|
|
728
728
|
return t;
|
|
729
729
|
}, De.apply(null, arguments);
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Lt(t, o) {
|
|
732
732
|
if (t == null) return {};
|
|
733
733
|
var u = {};
|
|
734
734
|
for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
|
|
@@ -742,7 +742,7 @@ function et(t, o) {
|
|
|
742
742
|
return u.__proto__ = r, u;
|
|
743
743
|
}, et(t, o);
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function Vt(t, o) {
|
|
746
746
|
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, et(t, o);
|
|
747
747
|
}
|
|
748
748
|
var tt = { exports: {} }, Ie = { exports: {} }, H = {};
|
|
@@ -755,7 +755,7 @@ var tt = { exports: {} }, Ie = { exports: {} }, H = {};
|
|
|
755
755
|
* LICENSE file in the root directory of this source tree.
|
|
756
756
|
*/
|
|
757
757
|
var _t;
|
|
758
|
-
function
|
|
758
|
+
function Dr() {
|
|
759
759
|
if (_t) return H;
|
|
760
760
|
_t = 1;
|
|
761
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;
|
|
@@ -830,7 +830,7 @@ var z = {};
|
|
|
830
830
|
* LICENSE file in the root directory of this source tree.
|
|
831
831
|
*/
|
|
832
832
|
var Rt;
|
|
833
|
-
function
|
|
833
|
+
function Nr() {
|
|
834
834
|
return Rt || (Rt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
835
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;
|
|
836
836
|
function L(y) {
|
|
@@ -913,8 +913,8 @@ function Dr() {
|
|
|
913
913
|
}()), z;
|
|
914
914
|
}
|
|
915
915
|
var Ot;
|
|
916
|
-
function
|
|
917
|
-
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;
|
|
918
918
|
}
|
|
919
919
|
/*
|
|
920
920
|
object-assign
|
|
@@ -922,7 +922,7 @@ object-assign
|
|
|
922
922
|
@license MIT
|
|
923
923
|
*/
|
|
924
924
|
var qe, Ct;
|
|
925
|
-
function
|
|
925
|
+
function Yr() {
|
|
926
926
|
if (Ct) return qe;
|
|
927
927
|
Ct = 1;
|
|
928
928
|
var t = Object.getOwnPropertySymbols, o = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
@@ -975,17 +975,17 @@ function ot() {
|
|
|
975
975
|
return Xe = t, Xe;
|
|
976
976
|
}
|
|
977
977
|
var He, wt;
|
|
978
|
-
function
|
|
978
|
+
function Wt() {
|
|
979
979
|
return wt || (wt = 1, He = Function.call.bind(Object.prototype.hasOwnProperty)), He;
|
|
980
980
|
}
|
|
981
981
|
var ze, kt;
|
|
982
|
-
function
|
|
982
|
+
function $r() {
|
|
983
983
|
if (kt) return ze;
|
|
984
984
|
kt = 1;
|
|
985
985
|
var t = function() {
|
|
986
986
|
};
|
|
987
987
|
if (process.env.NODE_ENV !== "production") {
|
|
988
|
-
var o = ot(), u = {}, r =
|
|
988
|
+
var o = ot(), u = {}, r = Wt();
|
|
989
989
|
t = function(n) {
|
|
990
990
|
var s = "Warning: " + n;
|
|
991
991
|
typeof console < "u" && console.error(s);
|
|
@@ -1028,10 +1028,10 @@ function Yr() {
|
|
|
1028
1028
|
}, ze = a, ze;
|
|
1029
1029
|
}
|
|
1030
1030
|
var Be, At;
|
|
1031
|
-
function
|
|
1031
|
+
function Fr() {
|
|
1032
1032
|
if (At) return Be;
|
|
1033
1033
|
At = 1;
|
|
1034
|
-
var t =
|
|
1034
|
+
var t = Ut(), o = Yr(), u = ot(), r = Wt(), a = $r(), n = function() {
|
|
1035
1035
|
};
|
|
1036
1036
|
process.env.NODE_ENV !== "production" && (n = function(i) {
|
|
1037
1037
|
var c = "Warning: " + i;
|
|
@@ -1349,7 +1349,7 @@ Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
|
|
|
1349
1349
|
}, Be;
|
|
1350
1350
|
}
|
|
1351
1351
|
var Ge, jt;
|
|
1352
|
-
function
|
|
1352
|
+
function Lr() {
|
|
1353
1353
|
if (jt) return Ge;
|
|
1354
1354
|
jt = 1;
|
|
1355
1355
|
var t = ot();
|
|
@@ -1397,32 +1397,32 @@ function Fr() {
|
|
|
1397
1397
|
}, Ge;
|
|
1398
1398
|
}
|
|
1399
1399
|
if (process.env.NODE_ENV !== "production") {
|
|
1400
|
-
var
|
|
1401
|
-
tt.exports =
|
|
1400
|
+
var Vr = Ut(), Ur = !0;
|
|
1401
|
+
tt.exports = Fr()(Vr.isElement, Ur);
|
|
1402
1402
|
} else
|
|
1403
|
-
tt.exports =
|
|
1404
|
-
var
|
|
1405
|
-
const C = /* @__PURE__ */
|
|
1406
|
-
function
|
|
1403
|
+
tt.exports = Lr()();
|
|
1404
|
+
var Wr = tt.exports;
|
|
1405
|
+
const C = /* @__PURE__ */ br(Wr);
|
|
1406
|
+
function qr(t, o) {
|
|
1407
1407
|
return t.classList ? !!o && t.classList.contains(o) : (" " + (t.className.baseVal || t.className) + " ").indexOf(" " + o + " ") !== -1;
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1410
|
-
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));
|
|
1411
1411
|
}
|
|
1412
1412
|
function Mt(t, o) {
|
|
1413
1413
|
return t.replace(new RegExp("(^|\\s)" + o + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Hr(t, o) {
|
|
1416
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));
|
|
1417
1417
|
}
|
|
1418
1418
|
const It = {
|
|
1419
1419
|
disabled: !1
|
|
1420
1420
|
};
|
|
1421
|
-
var
|
|
1421
|
+
var zr = process.env.NODE_ENV !== "production" ? C.oneOfType([C.number, C.shape({
|
|
1422
1422
|
enter: C.number,
|
|
1423
1423
|
exit: C.number,
|
|
1424
1424
|
appear: C.number
|
|
1425
|
-
}).isRequired]) : null,
|
|
1425
|
+
}).isRequired]) : null, Br = process.env.NODE_ENV !== "production" ? C.oneOfType([C.string, C.shape({
|
|
1426
1426
|
enter: C.string,
|
|
1427
1427
|
exit: C.string,
|
|
1428
1428
|
active: C.string
|
|
@@ -1434,11 +1434,11 @@ var Hr = process.env.NODE_ENV !== "production" ? C.oneOfType([C.number, C.shape(
|
|
|
1434
1434
|
exitDone: C.string,
|
|
1435
1435
|
exitActive: C.string
|
|
1436
1436
|
})]) : null;
|
|
1437
|
-
const
|
|
1438
|
-
var
|
|
1437
|
+
const qt = he.createContext(null);
|
|
1438
|
+
var Xt = function(o) {
|
|
1439
1439
|
return o.scrollTop;
|
|
1440
1440
|
}, Ae = "unmounted", ge = "exited", be = "entering", Re = "entered", rt = "exiting", pe = /* @__PURE__ */ function(t) {
|
|
1441
|
-
|
|
1441
|
+
Vt(o, t);
|
|
1442
1442
|
function o(r, a) {
|
|
1443
1443
|
var n;
|
|
1444
1444
|
n = t.call(this, r, a) || this;
|
|
@@ -1477,7 +1477,7 @@ var Ht = function(o) {
|
|
|
1477
1477
|
if (this.cancelNextCallback(), n === be) {
|
|
1478
1478
|
if (this.props.unmountOnExit || this.props.mountOnEnter) {
|
|
1479
1479
|
var s = this.props.nodeRef ? this.props.nodeRef.current : Me.findDOMNode(this);
|
|
1480
|
-
s &&
|
|
1480
|
+
s && Xt(s);
|
|
1481
1481
|
}
|
|
1482
1482
|
this.performEnter(a);
|
|
1483
1483
|
} else
|
|
@@ -1556,16 +1556,16 @@ var Ht = function(o) {
|
|
|
1556
1556
|
return null;
|
|
1557
1557
|
var n = this.props, s = n.children;
|
|
1558
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;
|
|
1559
|
-
var i =
|
|
1559
|
+
var i = Lt(n, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
|
|
1560
1560
|
return (
|
|
1561
1561
|
// allows for nested Transitions
|
|
1562
|
-
/* @__PURE__ */ he.createElement(
|
|
1562
|
+
/* @__PURE__ */ he.createElement(qt.Provider, {
|
|
1563
1563
|
value: null
|
|
1564
1564
|
}, typeof s == "function" ? s(a, i) : he.cloneElement(he.Children.only(s), i))
|
|
1565
1565
|
);
|
|
1566
1566
|
}, o;
|
|
1567
1567
|
}(he.Component);
|
|
1568
|
-
pe.contextType =
|
|
1568
|
+
pe.contextType = qt;
|
|
1569
1569
|
pe.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1570
1570
|
/**
|
|
1571
1571
|
* A React reference to DOM element that need to transition:
|
|
@@ -1662,7 +1662,7 @@ pe.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1662
1662
|
* @type {number | { enter?: number, exit?: number, appear?: number }}
|
|
1663
1663
|
*/
|
|
1664
1664
|
timeout: function(o) {
|
|
1665
|
-
var u =
|
|
1665
|
+
var u = zr;
|
|
1666
1666
|
o.addEndListener || (u = u.isRequired);
|
|
1667
1667
|
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
1668
1668
|
a[n - 1] = arguments[n];
|
|
@@ -1756,16 +1756,16 @@ pe.EXITED = ge;
|
|
|
1756
1756
|
pe.ENTERING = be;
|
|
1757
1757
|
pe.ENTERED = Re;
|
|
1758
1758
|
pe.EXITING = rt;
|
|
1759
|
-
var
|
|
1759
|
+
var Gr = function(o, u) {
|
|
1760
1760
|
return o && u && u.split(" ").forEach(function(r) {
|
|
1761
|
-
return
|
|
1761
|
+
return Xr(o, r);
|
|
1762
1762
|
});
|
|
1763
1763
|
}, Je = function(o, u) {
|
|
1764
1764
|
return o && u && u.split(" ").forEach(function(r) {
|
|
1765
|
-
return
|
|
1765
|
+
return Hr(o, r);
|
|
1766
1766
|
});
|
|
1767
1767
|
}, Ne = /* @__PURE__ */ function(t) {
|
|
1768
|
-
|
|
1768
|
+
Vt(o, t);
|
|
1769
1769
|
function o() {
|
|
1770
1770
|
for (var r, a = arguments.length, n = new Array(a), s = 0; s < a; s++)
|
|
1771
1771
|
n[s] = arguments[s];
|
|
@@ -1805,14 +1805,14 @@ var Br = function(o, u) {
|
|
|
1805
1805
|
var u = o.prototype;
|
|
1806
1806
|
return u.addClass = function(a, n, s) {
|
|
1807
1807
|
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 &&
|
|
1808
|
+
n === "appear" && s === "done" && f && (i += " " + f), s === "active" && a && Xt(a), i && (this.appliedClasses[n][s] = i, Gr(a, i));
|
|
1809
1809
|
}, u.removeClasses = function(a, n) {
|
|
1810
1810
|
var s = this.appliedClasses[n], i = s.base, c = s.active, f = s.done;
|
|
1811
1811
|
this.appliedClasses[n] = {}, i && Je(a, i), c && Je(a, c), f && Je(a, f);
|
|
1812
1812
|
}, u.render = function() {
|
|
1813
1813
|
var a = this.props;
|
|
1814
1814
|
a.classNames;
|
|
1815
|
-
var n =
|
|
1815
|
+
var n = Lt(a, ["classNames"]);
|
|
1816
1816
|
return /* @__PURE__ */ he.createElement(pe, De({}, n, {
|
|
1817
1817
|
onEnter: this.onEnter,
|
|
1818
1818
|
onEntered: this.onEntered,
|
|
@@ -1895,7 +1895,7 @@ Ne.propTypes = process.env.NODE_ENV !== "production" ? De({}, pe.propTypes, {
|
|
|
1895
1895
|
* exitDone?: string,
|
|
1896
1896
|
* }}
|
|
1897
1897
|
*/
|
|
1898
|
-
classNames:
|
|
1898
|
+
classNames: Br,
|
|
1899
1899
|
/**
|
|
1900
1900
|
* A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
|
|
1901
1901
|
* applied.
|
|
@@ -1950,7 +1950,7 @@ Ne.propTypes = process.env.NODE_ENV !== "production" ? De({}, pe.propTypes, {
|
|
|
1950
1950
|
*/
|
|
1951
1951
|
onExited: C.func
|
|
1952
1952
|
}) : {};
|
|
1953
|
-
function
|
|
1953
|
+
function Jr({
|
|
1954
1954
|
show: t,
|
|
1955
1955
|
onClose: o,
|
|
1956
1956
|
onOpen: u,
|
|
@@ -1965,7 +1965,7 @@ function Gr({
|
|
|
1965
1965
|
function c(f) {
|
|
1966
1966
|
s.current && (s.current.style.setProperty("display", f), f === "none" && (r == null || r()));
|
|
1967
1967
|
}
|
|
1968
|
-
return
|
|
1968
|
+
return gr(
|
|
1969
1969
|
/* @__PURE__ */ K.jsxs(K.Fragment, { children: [
|
|
1970
1970
|
/* @__PURE__ */ K.jsx(
|
|
1971
1971
|
Ne,
|
|
@@ -2013,8 +2013,11 @@ function Gr({
|
|
|
2013
2013
|
n
|
|
2014
2014
|
);
|
|
2015
2015
|
}
|
|
2016
|
-
|
|
2017
|
-
|
|
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() {
|
|
2018
2021
|
const t = {
|
|
2019
2022
|
startX: 0,
|
|
2020
2023
|
startY: 0,
|
|
@@ -2037,7 +2040,7 @@ function on() {
|
|
|
2037
2040
|
const p = "touches" in f ? f.touches[0] : f;
|
|
2038
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);
|
|
2039
2042
|
const h = 10;
|
|
2040
|
-
(!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);
|
|
2041
2044
|
}
|
|
2042
2045
|
function c() {
|
|
2043
2046
|
t.startX = 0, t.startY = 0;
|
|
@@ -2052,8 +2055,8 @@ function on() {
|
|
|
2052
2055
|
isHorizontal: a
|
|
2053
2056
|
};
|
|
2054
2057
|
}
|
|
2055
|
-
function
|
|
2056
|
-
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(), []);
|
|
2057
2060
|
function F(U) {
|
|
2058
2061
|
return U * r;
|
|
2059
2062
|
}
|
|
@@ -2076,7 +2079,7 @@ function an({ column: t, onChange: o }) {
|
|
|
2076
2079
|
function ee() {
|
|
2077
2080
|
I();
|
|
2078
2081
|
const U = a - p.current, $ = Date.now() - f.current;
|
|
2079
|
-
if ($ < Ke && Math.abs(U) >
|
|
2082
|
+
if ($ < Ke && Math.abs(U) > Qr) {
|
|
2080
2083
|
fe(U, $);
|
|
2081
2084
|
return;
|
|
2082
2085
|
}
|
|
@@ -2084,7 +2087,7 @@ function an({ column: t, onChange: o }) {
|
|
|
2084
2087
|
i(Dt), L(Z), h.current = !1;
|
|
2085
2088
|
}
|
|
2086
2089
|
function fe(U, $) {
|
|
2087
|
-
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);
|
|
2088
2091
|
i(Ke), L(j);
|
|
2089
2092
|
}
|
|
2090
2093
|
function ue() {
|
|
@@ -2103,12 +2106,12 @@ function an({ column: t, onChange: o }) {
|
|
|
2103
2106
|
scrollToIndex: Q
|
|
2104
2107
|
};
|
|
2105
2108
|
}
|
|
2106
|
-
|
|
2107
|
-
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({
|
|
2108
2111
|
column: t,
|
|
2109
2112
|
onChange: g
|
|
2110
2113
|
});
|
|
2111
|
-
|
|
2114
|
+
Yt(a, () => ({
|
|
2112
2115
|
scrollToSelected: S
|
|
2113
2116
|
}));
|
|
2114
2117
|
function g(T) {
|
|
@@ -2158,7 +2161,7 @@ const zt = Yt(({ column: t, fields: o, selectedIndex: u = 0, onChange: r }, a) =
|
|
|
2158
2161
|
{
|
|
2159
2162
|
className: "chook-picker-column-label",
|
|
2160
2163
|
style: {
|
|
2161
|
-
transform: `rotate3d(1, 0, 0, ${(I * nt + n) *
|
|
2164
|
+
transform: `rotate3d(1, 0, 0, ${(I * nt + n) * Zr}deg)`
|
|
2162
2165
|
},
|
|
2163
2166
|
children: T == null ? void 0 : T[o.label]
|
|
2164
2167
|
}
|
|
@@ -2170,9 +2173,10 @@ const zt = Yt(({ column: t, fields: o, selectedIndex: u = 0, onChange: r }, a) =
|
|
|
2170
2173
|
)
|
|
2171
2174
|
}
|
|
2172
2175
|
);
|
|
2173
|
-
}
|
|
2176
|
+
}
|
|
2177
|
+
const zt = Ht(un);
|
|
2174
2178
|
zt.displayName = "Column";
|
|
2175
|
-
|
|
2179
|
+
function cn(t, o) {
|
|
2176
2180
|
const {
|
|
2177
2181
|
loading: u,
|
|
2178
2182
|
loadingSlot: r,
|
|
@@ -2183,7 +2187,7 @@ const Bt = Yt((t, o) => {
|
|
|
2183
2187
|
selectedIndices: c,
|
|
2184
2188
|
updateSelectedValueByIndex: f
|
|
2185
2189
|
} = t, p = ve([]);
|
|
2186
|
-
|
|
2190
|
+
Yt(o, () => ({
|
|
2187
2191
|
scrollColumnToSelected: h
|
|
2188
2192
|
}));
|
|
2189
2193
|
function h(g, S) {
|
|
@@ -2214,7 +2218,8 @@ const Bt = Yt((t, o) => {
|
|
|
2214
2218
|
]
|
|
2215
2219
|
}
|
|
2216
2220
|
) : /* @__PURE__ */ K.jsx("div", { className: "chook-picker-columns", children: n });
|
|
2217
|
-
}
|
|
2221
|
+
}
|
|
2222
|
+
const Bt = Ht(cn);
|
|
2218
2223
|
Bt.displayName = "Columns";
|
|
2219
2224
|
function Gt({
|
|
2220
2225
|
show: t,
|
|
@@ -2236,7 +2241,7 @@ function Gt({
|
|
|
2236
2241
|
onOpen: I,
|
|
2237
2242
|
onClosed: F
|
|
2238
2243
|
}) {
|
|
2239
|
-
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]);
|
|
2240
2245
|
Ze(() => {
|
|
2241
2246
|
!o || o.every((ne, l) => ne === P[l]) || v(o);
|
|
2242
2247
|
}, [o]), Ze(() => {
|
|
@@ -2244,7 +2249,7 @@ function Gt({
|
|
|
2244
2249
|
const G = $.length, ne = [];
|
|
2245
2250
|
let l = !1;
|
|
2246
2251
|
for (let b = 0; b < G; b++) {
|
|
2247
|
-
const x = $[b], _ = P[b], A =
|
|
2252
|
+
const x = $[b], _ = P[b], A = $t(x, _, Q);
|
|
2248
2253
|
if (A === -1) {
|
|
2249
2254
|
const w = (ee[b] ?? 0) >= x.length ? Math.max(x.length - 1, 0) : 0;
|
|
2250
2255
|
ne[b] = w;
|
|
@@ -2260,7 +2265,7 @@ function Gt({
|
|
|
2260
2265
|
if (m === b) return;
|
|
2261
2266
|
const x = [...P];
|
|
2262
2267
|
if (x[G] = m, U === "cascade") {
|
|
2263
|
-
const A = l[ne], O =
|
|
2268
|
+
const A = l[ne], O = Cr(A, G, x, Q);
|
|
2264
2269
|
v(O), te(O);
|
|
2265
2270
|
} else
|
|
2266
2271
|
v(x), te(x);
|
|
@@ -2281,7 +2286,7 @@ function Gt({
|
|
|
2281
2286
|
v(o ? [...o] : [...q]), F == null || F();
|
|
2282
2287
|
}
|
|
2283
2288
|
return /* @__PURE__ */ K.jsxs(
|
|
2284
|
-
|
|
2289
|
+
Jr,
|
|
2285
2290
|
{
|
|
2286
2291
|
show: t,
|
|
2287
2292
|
teleport: c,
|
|
@@ -2326,11 +2331,11 @@ function Gt({
|
|
|
2326
2331
|
}
|
|
2327
2332
|
);
|
|
2328
2333
|
}
|
|
2329
|
-
function
|
|
2334
|
+
function dn({
|
|
2330
2335
|
show: t,
|
|
2331
2336
|
values: o,
|
|
2332
|
-
title: u =
|
|
2333
|
-
columnsType: r =
|
|
2337
|
+
title: u = tn,
|
|
2338
|
+
columnsType: r = rn,
|
|
2334
2339
|
minDate: a = new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1),
|
|
2335
2340
|
maxDate: n = new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11, 31),
|
|
2336
2341
|
teleport: s,
|
|
@@ -2362,12 +2367,12 @@ function cn({
|
|
|
2362
2367
|
return Ce(B, M, p);
|
|
2363
2368
|
}
|
|
2364
2369
|
function ue() {
|
|
2365
|
-
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);
|
|
2366
2371
|
return Ce(G, ne, h);
|
|
2367
2372
|
}
|
|
2368
2373
|
function Q(j) {
|
|
2369
2374
|
const B = r.indexOf(j), M = L[B];
|
|
2370
|
-
return M ? Number(M) :
|
|
2375
|
+
return M ? Number(M) : jr(a, n, j);
|
|
2371
2376
|
}
|
|
2372
2377
|
function U(j) {
|
|
2373
2378
|
q(j), S(), g == null || g(j);
|
|
@@ -2401,11 +2406,11 @@ function cn({
|
|
|
2401
2406
|
}
|
|
2402
2407
|
);
|
|
2403
2408
|
}
|
|
2404
|
-
function
|
|
2409
|
+
function pn({
|
|
2405
2410
|
show: t,
|
|
2406
2411
|
values: o,
|
|
2407
|
-
title: u =
|
|
2408
|
-
columnsType: r =
|
|
2412
|
+
title: u = nn,
|
|
2413
|
+
columnsType: r = on,
|
|
2409
2414
|
minTime: a,
|
|
2410
2415
|
maxTime: n,
|
|
2411
2416
|
teleport: s,
|
|
@@ -2449,7 +2454,7 @@ function fn({
|
|
|
2449
2454
|
}
|
|
2450
2455
|
function $(M) {
|
|
2451
2456
|
const re = r.indexOf(M), G = L[re];
|
|
2452
|
-
return G !== void 0 ? Number(G) :
|
|
2457
|
+
return G !== void 0 ? Number(G) : Ir(v, ee, M);
|
|
2453
2458
|
}
|
|
2454
2459
|
function Z(M) {
|
|
2455
2460
|
q(M), S(), g == null || g(M);
|
|
@@ -2484,7 +2489,7 @@ function fn({
|
|
|
2484
2489
|
);
|
|
2485
2490
|
}
|
|
2486
2491
|
export {
|
|
2487
|
-
|
|
2492
|
+
dn as DatePicker,
|
|
2488
2493
|
Gt as Picker,
|
|
2489
|
-
|
|
2494
|
+
pn as TimePicker
|
|
2490
2495
|
};
|
package/dist/react/picker.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(ve,
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(nr);function
|
|
1
|
+
(function(ve,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],R):(ve=typeof globalThis<"u"?globalThis:ve||self,R(ve.picker={},ve.React,ve.ReactDOM))})(this,function(ve,R,Oe){"use strict";var nr=document.createElement("style");nr.textContent=`:root{--chook-picker-background: #fff;--chook-picker-border-radius: .5rem;--chook-picker-padding-bottom: 1.25rem;--chook-picker-z-index: 2147483646;--chook-picker-mask-background: rgba(0, 0, 0, .2);--chook-picker-header-padding: .75rem 0;--chook-picker-header-margin-bottom: 1.25rem;--chook-picker-title-font-size: 1rem;--chook-picker-title-font-weight: 500;--chook-picker-title-color: #323233;--chook-picker-confirm-color: #1989fa;--chook-picker-confirm-font-size: .875rem;--chook-picker-confirm-padding: 0 1rem;--chook-picker-cancel-color: #969799;--chook-picker-cancel-font-size: .875rem;--chook-picker-cancel-padding: 0 1rem;--chook-picker-active-opacity: .6;--chook-picker-columns-margin: 0 1rem;--chook-picker-columns-backdrop: linear-gradient( to bottom, #f2f2f2 0px, #f2f2f2 .0625rem, transparent .0625rem, transparent calc(100% - .0625rem) , #f2f2f2 calc(100% - .0625rem) , #f2f2f2 100% );--chook-picker-mask-backdrop: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4));--chook-picker-column-label-color: #323233;--chook-picker-column-label-padding: 0 .25rem;--chook-picker-column-font-size: 1rem;--chook-picker-column-font-weight: 500}.chook-picker-mask{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--chook-picker-mask-background);z-index:calc(var(--chook-picker-z-index) - 1)}.chook-picker-container{position:fixed;left:0;bottom:0;width:100vw;z-index:var(--chook-picker-z-index);-webkit-user-select:none;user-select:none;padding-bottom:var(--chook-picker-padding-bottom);background:var(--chook-picker-background);border-top-left-radius:var(--chook-picker-border-radius);border-top-right-radius:var(--chook-picker-border-radius)}.chook-picker-header{display:flex;align-items:center;justify-content:space-between;padding:var(--chook-picker-header-padding);margin-bottom:var(--chook-picker-header-margin-bottom)}.chook-picker-title{font-size:var(--chook-picker-title-font-size);font-weight:var(--chook-picker-title-font-weight);color:var(--chook-picker-title-color);margin:0}.chook-picker-columns{width:calc(100% - var(--chook-picker-columns-margin) * 2);height:13.5rem;overflow:hidden;position:relative;display:flex;margin:var(--chook-picker-columns-margin)}.chook-picker-columns-backdrop{background-image:var(--chook-picker-columns-backdrop);background-repeat:no-repeat;background-position:center;background-size:100% 3rem}.chook-picker-mask-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;background-image:var(--chook-picker-mask-backdrop);background-repeat:no-repeat;background-position:top,bottom;background-size:100% 5.25rem}.chook-picker-loading{height:100%;width:100%;position:absolute;top:0;left:0}.chook-picker-column{flex:1 1 0%;overflow:hidden;padding:5.375rem 0;cursor:grab}.chook-picker-column ul{margin:0;padding:0;list-style:none}.chook-picker-column-item{height:3rem;display:flex;justify-content:center;align-items:center;cursor:grab}.chook-picker-column-label{color:var(--chook-picker-column-label-color);font-size:var(--chook-picker-column-font-size);font-weight:var(--chook-picker-column-font-weight);padding:var(--chook-picker-column-label-padding);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}button.chook-picker-confirm{color:var(--chook-picker-confirm-color);font-size:var(--chook-picker-confirm-font-size);background-color:transparent;padding:var(--chook-picker-confirm-padding);border:none}button.chook-picker-confirm:active{opacity:var(--chook-picker-active-opacity)}button.chook-picker-confirm:hover{color:var(--chook-picker-confirm-color);background-color:transparent}button.chook-picker-cancel{color:var(--chook-picker-cancel-color);font-size:var(--chook-picker-cancel-font-size);background-color:transparent;padding:var(--chook-picker-cancel-padding);border:none}button.chook-picker-cancel:active{opacity:var(--chook-picker-active-opacity)}button.chook-picker-cancel:hover{color:var(--chook-picker-cancel-color);background-color:transparent}.chook-picker-fade-enter{opacity:0}.chook-picker-fade-enter-active{opacity:1;transition:all .3s ease}.chook-picker-fade-exit-active{opacity:0;transition:all .3s ease}.chook-picker-slide-enter{opacity:.5;transform:translate3d(0,100%,0)}.chook-picker-slide-enter-active{transition:all .3s ease;opacity:1;transform:translateZ(0)}.chook-picker-slide-exit-active{transition:all .3s ease;opacity:.5;transform:translate3d(0,100%,0)}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(nr);function Hr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var De={exports:{}},Ce={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var or;function
|
|
10
|
+
*/var or;function Br(){if(or)return Ce;or=1;var r=R,o=Symbol.for("react.element"),c=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function s(a,u,f){var p,h={},E=null,x=null;f!==void 0&&(E=""+f),u.key!==void 0&&(E=""+u.key),u.ref!==void 0&&(x=u.ref);for(p in u)t.call(u,p)&&!n.hasOwnProperty(p)&&(h[p]=u[p]);if(a&&a.defaultProps)for(p in u=a.defaultProps,u)h[p]===void 0&&(h[p]=u[p]);return{$$typeof:o,type:a,key:E,ref:x,props:h,_owner:i.current}}return Ce.Fragment=c,Ce.jsx=s,Ce.jsxs=s,Ce}var Re={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.development.js
|
|
13
13
|
*
|
|
@@ -15,36 +15,36 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var ir;function
|
|
18
|
+
*/var ir;function Gr(){return ir||(ir=1,process.env.NODE_ENV!=="production"&&function(){var r=R,o=Symbol.for("react.element"),c=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),A=Symbol.iterator,k="@@iterator";function D(e){if(e===null||typeof e!="object")return null;var d=A&&e[A]||e[k];return typeof d=="function"?d:null}var L=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function H(e){{for(var d=arguments.length,y=new Array(d>1?d-1:0),_=1;_<d;_++)y[_-1]=arguments[_];V("error",e,y)}}function V(e,d,y){{var _=L.ReactDebugCurrentFrame,B=_.getStackAddendum();B!==""&&(d+="%s",y=y.concat([B]));var K=y.map(function(U){return String(U)});K.unshift("Warning: "+d),Function.prototype.apply.call(console[e],console,K)}}var P=!1,v=!1,re=!1,le=!1,ue=!1,ee;ee=Symbol.for("react.module.reference");function W(e){return!!(typeof e=="string"||typeof e=="function"||e===t||e===n||ue||e===i||e===f||e===p||le||e===x||P||v||re||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===h||e.$$typeof===s||e.$$typeof===a||e.$$typeof===u||e.$$typeof===ee||e.getModuleId!==void 0))}function F(e,d,y){var _=e.displayName;if(_)return _;var B=d.displayName||d.name||"";return B!==""?y+"("+B+")":y}function Q(e){return e.displayName||"Context"}function te(e){if(e==null)return null;if(typeof e.tag=="number"&&H("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t:return"Fragment";case c:return"Portal";case n:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a:var d=e;return Q(d)+".Consumer";case s:var y=e;return Q(y._context)+".Provider";case u:return F(e,e.render,"ForwardRef");case h:var _=e.displayName||null;return _!==null?_:te(e.type)||"Memo";case E:{var B=e,K=B._payload,U=B._init;try{return te(U(K))}catch{return null}}}return null}var M=Object.assign,G=0,I,ne,J,oe,l,m,b;function T(){}T.__reactDisabledLog=!0;function S(){{if(G===0){I=console.log,ne=console.info,J=console.warn,oe=console.error,l=console.group,m=console.groupCollapsed,b=console.groupEnd;var e={configurable:!0,enumerable:!0,value:T,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}G++}}function j(){{if(G--,G===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:I}),info:M({},e,{value:ne}),warn:M({},e,{value:J}),error:M({},e,{value:oe}),group:M({},e,{value:l}),groupCollapsed:M({},e,{value:m}),groupEnd:M({},e,{value:b})})}G<0&&H("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var O=L.ReactCurrentDispatcher,w;function N(e,d,y){{if(w===void 0)try{throw Error()}catch(B){var _=B.stack.trim().match(/\n( *(at )?)/);w=_&&_[1]||""}return`
|
|
19
19
|
`+w+e}}var z=!1,Y;{var se=typeof WeakMap=="function"?WeakMap:Map;Y=new se}function g(e,d){if(!e||z)return"";{var y=Y.get(e);if(y!==void 0)return y}var _;z=!0;var B=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var K;K=O.current,O.current=null,S();try{if(d){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(fe){_=fe}Reflect.construct(e,[],U)}else{try{U.call()}catch(fe){_=fe}e.call(U.prototype)}}else{try{throw Error()}catch(fe){_=fe}e()}}catch(fe){if(fe&&_&&typeof fe.stack=="string"){for(var $=fe.stack.split(`
|
|
20
20
|
`),ce=_.stack.split(`
|
|
21
21
|
`),ie=$.length-1,ae=ce.length-1;ie>=1&&ae>=0&&$[ie]!==ce[ae];)ae--;for(;ie>=1&&ae>=0;ie--,ae--)if($[ie]!==ce[ae]){if(ie!==1||ae!==1)do if(ie--,ae--,ae<0||$[ie]!==ce[ae]){var pe=`
|
|
22
|
-
`+$[ie].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),typeof e=="function"&&Y.set(e,pe),pe}while(ie>=1&&ae>=0);break}}}finally{z=!1,O.current=K,j(),Error.prepareStackTrace=B}var _e=e?e.displayName||e.name:"",Ee=_e?N(_e):"";return typeof e=="function"&&Y.set(e,Ee),Ee}function de(e,d,y){return g(e,!1)}function xe(e){var d=e.prototype;return!!(d&&d.isReactComponent)}function ye(e,d,y){if(e==null)return"";if(typeof e=="function")return g(e,xe(e));if(typeof e=="string")return N(e);switch(e){case f:return N("Suspense");case p:return N("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return de(e.render);case h:return ye(e.type,d,y);case E:{var _=e,B=_._payload,K=_._init;try{return ye(K(B),d,y)}catch{}}}return""}var we=Object.prototype.hasOwnProperty,
|
|
22
|
+
`+$[ie].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),typeof e=="function"&&Y.set(e,pe),pe}while(ie>=1&&ae>=0);break}}}finally{z=!1,O.current=K,j(),Error.prepareStackTrace=B}var _e=e?e.displayName||e.name:"",Ee=_e?N(_e):"";return typeof e=="function"&&Y.set(e,Ee),Ee}function de(e,d,y){return g(e,!1)}function xe(e){var d=e.prototype;return!!(d&&d.isReactComponent)}function ye(e,d,y){if(e==null)return"";if(typeof e=="function")return g(e,xe(e));if(typeof e=="string")return N(e);switch(e){case f:return N("Suspense");case p:return N("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return de(e.render);case h:return ye(e.type,d,y);case E:{var _=e,B=_._payload,K=_._init;try{return ye(K(B),d,y)}catch{}}}return""}var we=Object.prototype.hasOwnProperty,Mr={},Ir=L.ReactDebugCurrentFrame;function Ie(e){if(e){var d=e._owner,y=ye(e.type,e._source,d?d.type:null);Ir.setExtraStackFrame(y)}else Ir.setExtraStackFrame(null)}function $t(e,d,y,_,B){{var K=Function.call.bind(we);for(var U in e)if(K(e,U)){var $=void 0;try{if(typeof e[U]!="function"){var ce=Error((_||"React class")+": "+y+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ce.name="Invariant Violation",ce}$=e[U](d,U,_,y,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ie){$=ie}$&&!($ instanceof Error)&&(Ie(B),H("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",_||"React class",y,U,typeof $),Ie(null)),$ instanceof Error&&!($.message in Mr)&&(Mr[$.message]=!0,Ie(B),H("Failed %s type: %s",y,$.message),Ie(null))}}}var Ft=Array.isArray;function Ze(e){return Ft(e)}function Lt(e){{var d=typeof Symbol=="function"&&Symbol.toStringTag,y=d&&e[Symbol.toStringTag]||e.constructor.name||"Object";return y}}function Vt(e){try{return Dr(e),!1}catch{return!0}}function Dr(e){return""+e}function Nr(e){if(Vt(e))return H("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Lt(e)),Dr(e)}var Yr=L.ReactCurrentOwner,Ut={key:!0,ref:!0,__self:!0,__source:!0},$r,Fr;function Wt(e){if(we.call(e,"ref")){var d=Object.getOwnPropertyDescriptor(e,"ref").get;if(d&&d.isReactWarning)return!1}return e.ref!==void 0}function zt(e){if(we.call(e,"key")){var d=Object.getOwnPropertyDescriptor(e,"key").get;if(d&&d.isReactWarning)return!1}return e.key!==void 0}function qt(e,d){typeof e.ref=="string"&&Yr.current}function Xt(e,d){{var y=function(){$r||($r=!0,H("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};y.isReactWarning=!0,Object.defineProperty(e,"key",{get:y,configurable:!0})}}function Ht(e,d){{var y=function(){Fr||(Fr=!0,H("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};y.isReactWarning=!0,Object.defineProperty(e,"ref",{get:y,configurable:!0})}}var Bt=function(e,d,y,_,B,K,U){var $={$$typeof:o,type:e,key:d,ref:y,props:U,_owner:K};return $._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty($,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty($,"_source",{configurable:!1,enumerable:!1,writable:!1,value:B}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$};function Gt(e,d,y,_,B){{var K,U={},$=null,ce=null;y!==void 0&&(Nr(y),$=""+y),zt(d)&&(Nr(d.key),$=""+d.key),Wt(d)&&(ce=d.ref,qt(d,B));for(K in d)we.call(d,K)&&!Ut.hasOwnProperty(K)&&(U[K]=d[K]);if(e&&e.defaultProps){var ie=e.defaultProps;for(K in ie)U[K]===void 0&&(U[K]=ie[K])}if($||ce){var ae=typeof e=="function"?e.displayName||e.name||"Unknown":e;$&&Xt(U,ae),ce&&Ht(U,ae)}return Bt(e,$,ce,B,_,Yr.current,U)}}var Qe=L.ReactCurrentOwner,Lr=L.ReactDebugCurrentFrame;function Se(e){if(e){var d=e._owner,y=ye(e.type,e._source,d?d.type:null);Lr.setExtraStackFrame(y)}else Lr.setExtraStackFrame(null)}var er;er=!1;function rr(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function Vr(){{if(Qe.current){var e=te(Qe.current.type);if(e)return`
|
|
23
23
|
|
|
24
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
24
|
+
Check the render method of \``+e+"`."}return""}}function Jt(e){return""}var Ur={};function Kt(e){{var d=Vr();if(!d){var y=typeof e=="string"?e:e.displayName||e.name;y&&(d=`
|
|
25
25
|
|
|
26
|
-
Check the top-level render call using <`+y+">.")}return d}}function
|
|
26
|
+
Check the top-level render call using <`+y+">.")}return d}}function Wr(e,d){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var y=Kt(d);if(Ur[y])return;Ur[y]=!0;var _="";e&&e._owner&&e._owner!==Qe.current&&(_=" It was passed a child from "+te(e._owner.type)+"."),Se(e),H('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',y,_),Se(null)}}function zr(e,d){{if(typeof e!="object")return;if(Ze(e))for(var y=0;y<e.length;y++){var _=e[y];rr(_)&&Wr(_,d)}else if(rr(e))e._store&&(e._store.validated=!0);else if(e){var B=D(e);if(typeof B=="function"&&B!==e.entries)for(var K=B.call(e),U;!(U=K.next()).done;)rr(U.value)&&Wr(U.value,d)}}}function Zt(e){{var d=e.type;if(d==null||typeof d=="string")return;var y;if(typeof d=="function")y=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===u||d.$$typeof===h))y=d.propTypes;else return;if(y){var _=te(d);$t(y,e.props,"prop",_,e)}else if(d.PropTypes!==void 0&&!er){er=!0;var B=te(d);H("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",B||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&H("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Qt(e){{for(var d=Object.keys(e.props),y=0;y<d.length;y++){var _=d[y];if(_!=="children"&&_!=="key"){Se(e),H("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),Se(null);break}}e.ref!==null&&(Se(e),H("Invalid attribute `ref` supplied to `React.Fragment`."),Se(null))}}var qr={};function Xr(e,d,y,_,B,K){{var U=W(e);if(!U){var $="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&($+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ce=Jt();ce?$+=ce:$+=Vr();var ie;e===null?ie="null":Ze(e)?ie="array":e!==void 0&&e.$$typeof===o?(ie="<"+(te(e.type)||"Unknown")+" />",$=" Did you accidentally export a JSX literal instead of a component?"):ie=typeof e,H("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ie,$)}var ae=Gt(e,d,y,B,K);if(ae==null)return ae;if(U){var pe=d.children;if(pe!==void 0)if(_)if(Ze(pe)){for(var _e=0;_e<pe.length;_e++)zr(pe[_e],e);Object.freeze&&Object.freeze(pe)}else H("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zr(pe,e)}if(we.call(d,"key")){var Ee=te(e),fe=Object.keys(d).filter(function(an){return an!=="key"}),tr=fe.length>0?"{key: someKey, "+fe.join(": ..., ")+": ...}":"{key: someKey}";if(!qr[Ee+tr]){var on=fe.length>0?"{"+fe.join(": ..., ")+": ...}":"{}";H(`A props object containing a "key" prop is being spread into JSX:
|
|
27
27
|
let props = %s;
|
|
28
28
|
<%s {...props} />
|
|
29
29
|
React keys must be passed directly to JSX without using spread:
|
|
30
30
|
let props = %s;
|
|
31
|
-
<%s key={someKey} {...props} />`,tr,Ee,
|
|
31
|
+
<%s key={someKey} {...props} />`,tr,Ee,on,Ee),qr[Ee+tr]=!0}}return e===t?Qt(ae):Zt(ae),ae}}function en(e,d,y){return Xr(e,d,y,!0)}function rn(e,d,y){return Xr(e,d,y,!1)}var tn=rn,nn=en;Re.Fragment=t,Re.jsx=tn,Re.jsxs=nn}()),Re}process.env.NODE_ENV==="production"?De.exports=Br():De.exports=Gr();var Z=De.exports;const Jr=Array.isArray;function Kr(r,o){if(sr(r))return"multiple";const[c]=r;return c!=null&&c[o.children]?"cascade":"single"}function Zr(r){return{children:(r==null?void 0:r.children)||"children",label:(r==null?void 0:r.label)||"label",value:(r==null?void 0:r.value)||"value"}}function Qr(r,o,c){var s;if(sr(r))return[];const t=[];let i=r,n=0;for(;i;){const a=o[n];let u=ar(i,a,c);u===-1&&(u=0),t.push(i),n+=1,i=(s=i[u])==null?void 0:s[c.children]}return t}function et(r,o,c,t){const i=[...c];let n=r,s=o+1;for(;n!=null&&n[t.children];){const a=n[t.children][0];i[s]=a.value,n=a,s+=1}return i}function ar(r,o,c){return r.findIndex(t=>(t==null?void 0:t[c.value])===o)}function sr(r){const[o]=r;return Jr(o)}function rt(r,o){return r>o?"horizontal":o>r?"vertical":""}function be(r,o,c){const t=[];for(let i=r;i<=o;i++){const n=c(`${i}`);t.push({label:n,value:i})}return t}function cr(r,o){return r===o.getFullYear()}function ur(r,o){return r===o.getFullYear()}function tt(r,o){return r===o.getMonth()+1}function nt(r,o){return r===o.getMonth()+1}function ot(r,o){return new Date(r,o,0).getDate()}function it(r,o,c){const t=new Date,i=Date.now(),n=r.getTime(),s=o.getTime(),a=i>=n&&i<=s;return c==="year"?a?t.getFullYear():r.getFullYear():c==="month"?a?t.getMonth()+1:r.getMonth()+1:a?t.getDate():r.getDate()}function Ne(r){return r}function at(r){return/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/.test(r)}function fr(r){if(!at(r))return null;const[o,c,t]=r.split(":");return{hour:Number(o),minute:Number(c),second:Number(t)}}function Ye(r){return r.padStart(2,"0")}function st(r,o,c){const t=Date.now(),{hour:i,minute:n,second:s}=r,{hour:a,minute:u,second:f}=o,p=new Date().setHours(i,n,s),h=new Date().setHours(a,u,f),E=t>=p&&t<=h;return c==="hour"?E?new Date().getHours():i:c==="minute"?E?new Date().getMinutes():n:E?new Date().getSeconds():s}function Ae(){return Ae=Object.assign?Object.assign.bind():function(r){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var t in c)({}).hasOwnProperty.call(c,t)&&(r[t]=c[t])}return r},Ae.apply(null,arguments)}function lr(r,o){if(r==null)return{};var c={};for(var t in r)if({}.hasOwnProperty.call(r,t)){if(o.includes(t))continue;c[t]=r[t]}return c}function $e(r,o){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,t){return c.__proto__=t,c},$e(r,o)}function dr(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,$e(r,o)}var Fe={exports:{}},je={exports:{}},q={};/** @license React v16.13.1
|
|
32
32
|
* react-is.production.min.js
|
|
33
33
|
*
|
|
34
34
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
35
35
|
*
|
|
36
36
|
* This source code is licensed under the MIT license found in the
|
|
37
37
|
* LICENSE file in the root directory of this source tree.
|
|
38
|
-
*/var pr;function
|
|
38
|
+
*/var pr;function ct(){if(pr)return q;pr=1;var r=typeof Symbol=="function"&&Symbol.for,o=r?Symbol.for("react.element"):60103,c=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,n=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,a=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,E=r?Symbol.for("react.suspense_list"):60120,x=r?Symbol.for("react.memo"):60115,A=r?Symbol.for("react.lazy"):60116,k=r?Symbol.for("react.block"):60121,D=r?Symbol.for("react.fundamental"):60117,L=r?Symbol.for("react.responder"):60118,H=r?Symbol.for("react.scope"):60119;function V(v){if(typeof v=="object"&&v!==null){var re=v.$$typeof;switch(re){case o:switch(v=v.type,v){case u:case f:case t:case n:case i:case h:return v;default:switch(v=v&&v.$$typeof,v){case a:case p:case A:case x:case s:return v;default:return re}}case c:return re}}}function P(v){return V(v)===f}return q.AsyncMode=u,q.ConcurrentMode=f,q.ContextConsumer=a,q.ContextProvider=s,q.Element=o,q.ForwardRef=p,q.Fragment=t,q.Lazy=A,q.Memo=x,q.Portal=c,q.Profiler=n,q.StrictMode=i,q.Suspense=h,q.isAsyncMode=function(v){return P(v)||V(v)===u},q.isConcurrentMode=P,q.isContextConsumer=function(v){return V(v)===a},q.isContextProvider=function(v){return V(v)===s},q.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===o},q.isForwardRef=function(v){return V(v)===p},q.isFragment=function(v){return V(v)===t},q.isLazy=function(v){return V(v)===A},q.isMemo=function(v){return V(v)===x},q.isPortal=function(v){return V(v)===c},q.isProfiler=function(v){return V(v)===n},q.isStrictMode=function(v){return V(v)===i},q.isSuspense=function(v){return V(v)===h},q.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===t||v===f||v===n||v===i||v===h||v===E||typeof v=="object"&&v!==null&&(v.$$typeof===A||v.$$typeof===x||v.$$typeof===s||v.$$typeof===a||v.$$typeof===p||v.$$typeof===D||v.$$typeof===L||v.$$typeof===H||v.$$typeof===k)},q.typeOf=V,q}var X={};/** @license React v16.13.1
|
|
39
39
|
* react-is.development.js
|
|
40
40
|
*
|
|
41
41
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var vr;function
|
|
45
|
+
*/var vr;function ut(){return vr||(vr=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,o=r?Symbol.for("react.element"):60103,c=r?Symbol.for("react.portal"):60106,t=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,n=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,a=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,E=r?Symbol.for("react.suspense_list"):60120,x=r?Symbol.for("react.memo"):60115,A=r?Symbol.for("react.lazy"):60116,k=r?Symbol.for("react.block"):60121,D=r?Symbol.for("react.fundamental"):60117,L=r?Symbol.for("react.responder"):60118,H=r?Symbol.for("react.scope"):60119;function V(g){return typeof g=="string"||typeof g=="function"||g===t||g===f||g===n||g===i||g===h||g===E||typeof g=="object"&&g!==null&&(g.$$typeof===A||g.$$typeof===x||g.$$typeof===s||g.$$typeof===a||g.$$typeof===p||g.$$typeof===D||g.$$typeof===L||g.$$typeof===H||g.$$typeof===k)}function P(g){if(typeof g=="object"&&g!==null){var de=g.$$typeof;switch(de){case o:var xe=g.type;switch(xe){case u:case f:case t:case n:case i:case h:return xe;default:var ye=xe&&xe.$$typeof;switch(ye){case a:case p:case A:case x:case s:return ye;default:return de}}case c:return de}}}var v=u,re=f,le=a,ue=s,ee=o,W=p,F=t,Q=A,te=x,M=c,G=n,I=i,ne=h,J=!1;function oe(g){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),l(g)||P(g)===u}function l(g){return P(g)===f}function m(g){return P(g)===a}function b(g){return P(g)===s}function T(g){return typeof g=="object"&&g!==null&&g.$$typeof===o}function S(g){return P(g)===p}function j(g){return P(g)===t}function O(g){return P(g)===A}function w(g){return P(g)===x}function N(g){return P(g)===c}function z(g){return P(g)===n}function Y(g){return P(g)===i}function se(g){return P(g)===h}X.AsyncMode=v,X.ConcurrentMode=re,X.ContextConsumer=le,X.ContextProvider=ue,X.Element=ee,X.ForwardRef=W,X.Fragment=F,X.Lazy=Q,X.Memo=te,X.Portal=M,X.Profiler=G,X.StrictMode=I,X.Suspense=ne,X.isAsyncMode=oe,X.isConcurrentMode=l,X.isContextConsumer=m,X.isContextProvider=b,X.isElement=T,X.isForwardRef=S,X.isFragment=j,X.isLazy=O,X.isMemo=w,X.isPortal=N,X.isProfiler=z,X.isStrictMode=Y,X.isSuspense=se,X.isValidElementType=V,X.typeOf=P}()),X}var hr;function mr(){return hr||(hr=1,process.env.NODE_ENV==="production"?je.exports=ct():je.exports=ut()),je.exports}/*
|
|
46
46
|
object-assign
|
|
47
47
|
(c) Sindre Sorhus
|
|
48
48
|
@license MIT
|
|
49
|
-
*/var Le,gr;function
|
|
50
|
-
Valid keys: `+JSON.stringify(Object.keys(l),null," "));var g=se(w,Y,S,j,O+"."+Y,c);if(g)return g}return null}return D(m)}function M(l){switch(typeof l){case"number":case"string":case"undefined":return!0;case"boolean":return!l;case"object":if(Array.isArray(l))return l.every(M);if(l===null||a(l))return!0;var m=h(l);if(m){var b=m.call(l),T;if(m!==l.entries){for(;!(T=b.next()).done;)if(!M(T.value))return!1}else for(;!(T=b.next()).done;){var S=T.value;if(S&&!M(S[1]))return!1}}else return!1;return!0;default:return!1}}function G(l,m){return l==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function I(l){var m=typeof l;return Array.isArray(l)?"array":l instanceof RegExp?"object":G(m,l)?"symbol":m}function ne(l){if(typeof l>"u"||l===null)return""+l;var m=I(l);if(m==="object"){if(l instanceof Date)return"date";if(l instanceof RegExp)return"regexp"}return m}function J(l){var m=ne(l);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}function oe(l){return!l.constructor||!l.constructor.name?E:l.constructor.name}return x.checkPropTypes=i,x.resetWarningCache=i.resetWarningCache,x.PropTypes=x,x},qe}var Xe,xr;function dt(){if(xr)return Xe;xr=1;var r=Ue();function o(){}function c(){}return c.resetWarningCache=o,Xe=function(){function t(s,a,u,f,p,h){if(h!==r){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function i(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:i,element:t,elementType:t,instanceOf:i,node:t,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n},Xe}if(process.env.NODE_ENV!=="production"){var pt=mr(),vt=!0;Fe.exports=lt()(pt.isElement,vt)}else Fe.exports=dt()();var ht=Fe.exports;const R=Xr(ht);function mt(r,o){return r.classList?!!o&&r.classList.contains(o):(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+o+" ")!==-1}function gt(r,o){r.classList?r.classList.add(o):mt(r,o)||(typeof r.className=="string"?r.className=r.className+" "+o:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+o))}function Sr(r,o){return r.replace(new RegExp("(^|\\s)"+o+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function yt(r,o){r.classList?r.classList.remove(o):typeof r.className=="string"?r.className=Sr(r.className,o):r.setAttribute("class",Sr(r.className&&r.className.baseVal||"",o))}const _r={disabled:!1};var Et=process.env.NODE_ENV!=="production"?R.oneOfType([R.number,R.shape({enter:R.number,exit:R.number,appear:R.number}).isRequired]):null,bt=process.env.NODE_ENV!=="production"?R.oneOfType([R.string,R.shape({enter:R.string,exit:R.string,active:R.string}),R.shape({enter:R.string,enterDone:R.string,enterActive:R.string,exit:R.string,exitDone:R.string,exitActive:R.string})]):null;const Or=C.createContext(null);var Cr=function(o){return o.scrollTop},Pe="unmounted",me="exited",ge="entering",ke="entered",He="exiting",he=function(r){dr(o,r);function o(t,i){var n;n=r.call(this,t,i)||this;var s=i,a=s&&!s.isMounting?t.enter:t.appear,u;return n.appearStatus=null,t.in?a?(u=me,n.appearStatus=ge):u=ke:t.unmountOnExit||t.mountOnEnter?u=Pe:u=me,n.state={status:u},n.nextCallback=null,n}o.getDerivedStateFromProps=function(i,n){var s=i.in;return s&&n.status===Pe?{status:me}:null};var c=o.prototype;return c.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},c.componentDidUpdate=function(i){var n=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==ge&&s!==ke&&(n=ge):(s===ge||s===ke)&&(n=He)}this.updateStatus(!1,n)},c.componentWillUnmount=function(){this.cancelNextCallback()},c.getTimeouts=function(){var i=this.props.timeout,n,s,a;return n=s=a=i,i!=null&&typeof i!="number"&&(n=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:n,enter:s,appear:a}},c.updateStatus=function(i,n){if(i===void 0&&(i=!1),n!==null)if(this.cancelNextCallback(),n===ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Oe.findDOMNode(this);s&&Cr(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===me&&this.setState({status:Pe})},c.performEnter=function(i){var n=this,s=this.props.enter,a=this.context?this.context.isMounting:i,u=this.props.nodeRef?[a]:[Oe.findDOMNode(this),a],f=u[0],p=u[1],h=this.getTimeouts(),E=a?h.appear:h.enter;if(!i&&!s||_r.disabled){this.safeSetState({status:ke},function(){n.props.onEntered(f)});return}this.props.onEnter(f,p),this.safeSetState({status:ge},function(){n.props.onEntering(f,p),n.onTransitionEnd(E,function(){n.safeSetState({status:ke},function(){n.props.onEntered(f,p)})})})},c.performExit=function(){var i=this,n=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:Oe.findDOMNode(this);if(!n||_r.disabled){this.safeSetState({status:me},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:He},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:me},function(){i.props.onExited(a)})})})},c.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},c.safeSetState=function(i,n){n=this.setNextCallback(n),this.setState(i,n)},c.setNextCallback=function(i){var n=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,n.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},c.onTransitionEnd=function(i,n){this.setNextCallback(n);var s=this.props.nodeRef?this.props.nodeRef.current:Oe.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],f=u[0],p=u[1];this.props.addEndListener(f,p)}i!=null&&setTimeout(this.nextCallback,i)},c.render=function(){var i=this.state.status;if(i===Pe)return null;var n=this.props,s=n.children;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;var a=lr(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return C.createElement(Or.Provider,{value:null},typeof s=="function"?s(i,a):C.cloneElement(C.Children.only(s),a))},o}(C.Component);he.contextType=Or,he.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:R.shape({current:typeof Element>"u"?R.any:function(r,o,c,t,i,n){var s=r[o];return R.instanceOf(s&&"ownerDocument"in s?s.ownerDocument.defaultView.Element:Element)(r,o,c,t,i,n)}}),children:R.oneOfType([R.func.isRequired,R.element.isRequired]).isRequired,in:R.bool,mountOnEnter:R.bool,unmountOnExit:R.bool,appear:R.bool,enter:R.bool,exit:R.bool,timeout:function(o){var c=Et;o.addEndListener||(c=c.isRequired);for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return c.apply(void 0,[o].concat(i))},addEndListener:R.func,onEnter:R.func,onEntering:R.func,onEntered:R.func,onExit:R.func,onExiting:R.func,onExited:R.func}:{};function Te(){}he.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Te,onEntering:Te,onEntered:Te,onExit:Te,onExiting:Te,onExited:Te},he.UNMOUNTED=Pe,he.EXITED=me,he.ENTERING=ge,he.ENTERED=ke,he.EXITING=He;var kt=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return gt(o,t)})},Be=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return yt(o,t)})},Me=function(r){dr(o,r);function o(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return t=r.call.apply(r,[this].concat(n))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1];t.removeClasses(p,"exit"),t.addClass(p,h?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(a,u)},t.onEntering=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1],E=h?"appear":"enter";t.addClass(p,E,"active"),t.props.onEntering&&t.props.onEntering(a,u)},t.onEntered=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1],E=h?"appear":"enter";t.removeClasses(p,E),t.addClass(p,E,"done"),t.props.onEntered&&t.props.onEntered(a,u)},t.onExit=function(a){var u=t.resolveArguments(a),f=u[0];t.removeClasses(f,"appear"),t.removeClasses(f,"enter"),t.addClass(f,"exit","base"),t.props.onExit&&t.props.onExit(a)},t.onExiting=function(a){var u=t.resolveArguments(a),f=u[0];t.addClass(f,"exit","active"),t.props.onExiting&&t.props.onExiting(a)},t.onExited=function(a){var u=t.resolveArguments(a),f=u[0];t.removeClasses(f,"exit"),t.addClass(f,"exit","done"),t.props.onExited&&t.props.onExited(a)},t.resolveArguments=function(a,u){return t.props.nodeRef?[t.props.nodeRef.current,a]:[a,u]},t.getClassNames=function(a){var u=t.props.classNames,f=typeof u=="string",p=f&&u?u+"-":"",h=f?""+p+a:u[a],E=f?h+"-active":u[a+"Active"],x=f?h+"-done":u[a+"Done"];return{baseClassName:h,activeClassName:E,doneClassName:x}},t}var c=o.prototype;return c.addClass=function(i,n,s){var a=this.getClassNames(n)[s+"ClassName"],u=this.getClassNames("enter"),f=u.doneClassName;n==="appear"&&s==="done"&&f&&(a+=" "+f),s==="active"&&i&&Cr(i),a&&(this.appliedClasses[n][s]=a,kt(i,a))},c.removeClasses=function(i,n){var s=this.appliedClasses[n],a=s.base,u=s.active,f=s.done;this.appliedClasses[n]={},a&&Be(i,a),u&&Be(i,u),f&&Be(i,f)},c.render=function(){var i=this.props;i.classNames;var n=lr(i,["classNames"]);return C.createElement(he,Ae({},n,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},o}(C.Component);Me.defaultProps={classNames:""},Me.propTypes=process.env.NODE_ENV!=="production"?Ae({},he.propTypes,{classNames:bt,onEnter:R.func,onEntering:R.func,onEntered:R.func,onExit:R.func,onExiting:R.func,onExited:R.func}):{};function Tt({show:r,onClose:o,onOpen:c,onClosed:t,children:i,teleport:n=document.body}){const s=C.useRef(null),a=C.useRef(null);C.useEffect(()=>(r?(document.body.style.overflow="hidden",c==null||c()):document.body.style.overflow="",()=>{document.body.style.overflow=""}),[r]);function u(f){s.current&&(s.current.style.setProperty("display",f),f==="none"&&(t==null||t()))}return Oe.createPortal(Z.jsxs(Z.Fragment,{children:[Z.jsx(Me,{in:r,timeout:300,nodeRef:a,classNames:"chook-picker-fade",unmountOnExit:!0,children:Z.jsx("div",{ref:a,role:"presentation",className:"chook-picker-mask",onClick:o,onKeyDown:f=>{f.key==="Escape"&&o()}})}),Z.jsx(Me,{in:r,timeout:300,nodeRef:s,classNames:"chook-picker-slide",onEnter:()=>u(""),onExited:()=>u("none"),children:Z.jsx("div",{ref:s,className:"chook-picker-container",style:{display:"none"},children:i})})]}),n)}const xt=16,Ge=48,St=.52,Rr=150,Je=300,_t=15,Ot=.008,Pr=5,Ct="Select Date",Rt=["year","month","day"],Pt="Select Time",wt=["hour","minute","second"];function At(){const r={startX:0,startY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0};let o="",c=!0;const t=()=>o==="vertical",i=()=>o==="horizontal";function n(){r.deltaX=0,r.deltaY=0,r.offsetX=0,r.offsetY=0,o="",c=!0}function s(f){const p="touches"in f?f.touches[0]:f;n(),r.startX=p.clientX,r.startY=p.clientY}function a(f){if(!r.startX||!r.startY)return!0;const p="touches"in f?f.touches[0]:f;r.deltaX=Math.max(p.clientX,0)-r.startX,r.deltaY=p.clientY-r.startY,r.offsetX=Math.abs(r.deltaX),r.offsetY=Math.abs(r.deltaY);const h=10;(!o||r.offsetX<h&&r.offsetY<h)&&(o=et(r.offsetX,r.offsetY)),c&&(r.offsetX>Pr||r.offsetY>Pr)&&(c=!1)}function u(){r.startX=0,r.startY=0}return{pointer:r,move:a,start:s,stop:u,reset:n,isVertical:t,isHorizontal:i}}function jt({column:r,onChange:o}){const t=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)/xt,[i,n]=C.useState(0),[s,a]=C.useState(0),u=C.useRef(0),f=C.useRef(0),p=C.useRef(0),h=C.useRef(!1),E=C.useRef(null),{pointer:x,start:A,move:k,stop:D}=C.useMemo(()=>At(),[]);function L(W){return W*t}function H(W){const F=r.length,Q=Math.round(-W/L(Ge));return Q<0?0:Q>=F?F-1:Q}function V(W){const F=-W*L(Ge),Q=()=>o==null?void 0:o(W);h.current&&F!==i?E.current=Q:Q(),n(F)}function P(W){A(W),h.current=!0,a(0),f.current=Date.now(),u.current=i,p.current=u.current,E.current=null}function v(W){if(k(W))return;const Q=r.length,te=u.current+x.deltaY,M=L((Q-1)*-48),G=Math.min(Math.max(te,M),0),I=Date.now();n(G),!(I-f.current<=Je)&&(f.current=I,p.current=G)}function re(){D();const W=i-p.current,F=Date.now()-f.current;if(F<Je&&Math.abs(W)>_t){le(W,F);return}const Q=H(i);a(Rr),V(Q),h.current=!1}function le(W,F){const Q=Math.abs(W/F),te=i+Q/Ot*(W<0?-1:1),M=H(te);a(Je),V(M)}function ue(){a(0),h.current=!1,E.current&&(E.current(),E.current=null)}function ee(W,F="auto"){h.current&&F==="smooth"||(E.current=null,h.current=F==="smooth",a(F==="smooth"?Rr:0),V(W))}return{offsetY:i,transitionDuration:s,onPointerDown:P,onPointerMove:v,onPointerUp:re,stopInertialSliding:ue,scrollToIndex:ee}}const wr=C.forwardRef(({column:r,fields:o,selectedIndex:c=0,onChange:t},i)=>{const{offsetY:n,transitionDuration:s,onPointerDown:a,onPointerMove:u,onPointerUp:f,stopInertialSliding:p,scrollToIndex:h}=jt({column:r,onChange:E});C.useImperativeHandle(i,()=>({scrollToSelected:x}));function E(k){k!==c&&t(k)}function x(k=c,D){h(k,D)}function A(k){k!==c&&x(k,"smooth")}return Z.jsx("div",{role:"presentation",className:"chook-picker-column",onTouchStart:a,onTouchMove:u,onTouchEnd:f,onTouchCancel:f,onMouseDown:a,onMouseMove:u,onMouseUp:f,children:Z.jsx("ul",{style:{overflowY:"hidden",transform:`translate3d(0, ${n}px, 0)`,transitionDuration:`${s}ms`,transitionProperty:s?"all":"none"},onTransitionEnd:p,children:r.map((k,D)=>Z.jsx("div",{tabIndex:0,role:"button","aria-label":"Select option",className:"chook-picker-column-item",onClick:()=>A(D),onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&A(D)},children:Z.jsx("p",{className:"chook-picker-column-label",style:{transform:`rotate3d(1, 0, 0, ${(D*Ge+n)*St}deg)`},children:k==null?void 0:k[o.label]})},k==null?void 0:k[o.value]))})})});wr.displayName="Column";const Ar=C.forwardRef((r,o)=>{const{loading:c,loadingSlot:t,columns:i,emptySlot:n,currentColumns:s,fields:a,selectedIndices:u,updateSelectedValueByIndex:f}=r,p=C.useRef([]);C.useImperativeHandle(o,()=>({scrollColumnToSelected:h}));function h(E,x){var A;(A=p.current[E])==null||A.scrollToSelected(x)}return c?Z.jsxs(Z.Fragment,{children:[Z.jsx("div",{className:"chook-picker-loading",children:t}),Z.jsx("div",{className:"chook-picker-columns"})]}):i.length?Z.jsxs("div",{className:"chook-picker-columns chook-picker-columns-backdrop",onTouchMove:E=>E.stopPropagation(),children:[s.map((E,x)=>Z.jsx(wr,{ref:A=>p.current[x]=A,column:E,fields:a,selectedIndex:u[x],onChange:A=>f(x,A)},x)),Z.jsx("div",{className:"chook-picker-mask-backdrop"})]}):Z.jsx("div",{className:"chook-picker-columns",children:n})});Ar.displayName="Columns";function Ke({show:r,values:o,title:c,columns:t,linkage:i=!1,loading:n=!1,loadingSlot:s,emptySlot:a,teleport:u,confirmButtonText:f="Confirm",cancelButtonText:p="Cancel",columnsFieldNames:h,onConfirm:E,onClose:x,onChange:A,onCancel:k,onOpen:D,onClosed:L}){const[H,V]=C.useState([]),[P,v]=C.useState([]),[re,le]=C.useState([]),ue=C.useRef(null),ee=Kr(h),W=Jr(t,ee),F=C.useMemo(()=>W==="single"?[t]:W==="multiple"?t:Zr(t,P,ee),[t,W,P,ee]);C.useEffect(()=>{!o||o.every((oe,l)=>oe===P[l])||v(o)},[o]),C.useEffect(()=>{var m;const J=F.length,oe=[];let l=!1;for(let b=0;b<J;b++){const T=F[b],S=P[b],j=ar(T,S,ee);if(j===-1){const w=(re[b]??0)>=T.length?Math.max(T.length-1,0):0;oe[b]=w}else oe[b]=j;oe[b]!==re[b]&&((m=ue.current)==null||m.scrollColumnToSelected(b,oe[b]),l=!0)}l&&le(oe)},[P,F,ee]);function Q(J,oe){var S;const l=F[J],m=(S=l[oe])==null?void 0:S[ee.value],b=P[J];if(m===b)return;const T=[...P];if(T[J]=m,W==="cascade"){const j=l[oe],O=Qr(j,J,T,ee);v(O),te(O)}else v(T),te(T)}function te(J){A==null||A(J),i&&V(J)}function M(){V(P),x(),E==null||E(P)}function G(){x(),k==null||k()}function I(){D==null||D()}function ne(){v(o?[...o]:[...H]),L==null||L()}return Z.jsxs(Tt,{show:r,teleport:u,onOpen:I,onClose:x,onClosed:ne,children:[Z.jsxs("div",{className:"chook-picker-header",children:[Z.jsx("button",{className:"chook-picker-cancel",onClick:G,children:p}),Z.jsx("p",{className:"chook-picker-title",children:c}),Z.jsx("button",{className:"chook-picker-confirm",onClick:M,children:f})]}),Z.jsx(Ar,{ref:ue,loading:n,loadingSlot:s,columns:t,emptySlot:a,currentColumns:F,fields:ee,selectedIndices:re,updateSelectedValueByIndex:Q})]})}function Mt({show:r,values:o,title:c=Ct,columnsType:t=Rt,minDate:i=new Date(new Date().getFullYear()-10,0,1),maxDate:n=new Date(new Date().getFullYear()+10,11,31),teleport:s,confirmButtonText:a,cancelButtonText:u,formatYearLabel:f=Ne,formatMonthLabel:p=Ne,formatDayLabel:h=Ne,onConfirm:E,onClose:x,onCancel:A,onOpen:k,onClosed:D}){const[L,H]=C.useState([]),[V,P]=C.useState([]),v=C.useMemo(()=>{const M={year:re,month:le,day:ue};return t.map(G=>M[G]())},[t,i,n,V,f,p,h]);function re(){const M=i.getFullYear(),G=n.getFullYear();return be(M,G,f)}function le(){const M=ee("year"),G=cr(M,i)?i.getMonth()+1:1,I=ur(M,n)?n.getMonth()+1:12;return be(G,I,p)}function ue(){const M=ee("year"),G=ee("month"),I=cr(M,i)&&rt(G,i),ne=ur(M,n)&&tt(G,n),J=I?i.getDate():1,oe=ne?n.getDate():nt(M,G);return be(J,oe,h)}function ee(M){const G=t.indexOf(M),I=V[G];return I?Number(I):ot(i,n,M)}function W(M){H(M),x(),E==null||E(M)}function F(){x(),A==null||A()}function Q(){k==null||k(),o&&o.length?P([...o]):P(t.map(ee))}function te(){P(o?[...o]:[...L]),D==null||D()}return Z.jsx(Ke,{values:V,show:r,title:c,columns:v,teleport:s,confirmButtonText:a,cancelButtonText:u,linkage:!0,onConfirm:W,onClose:x,onChange:P,onCancel:F,onOpen:Q,onClosed:te})}function It({show:r,values:o,title:c=Pt,columnsType:t=wt,minTime:i,maxTime:n,teleport:s,confirmButtonText:a,cancelButtonText:u,formatHourLabel:f=Ye,formatMinuteLabel:p=Ye,formatSecondLabel:h=Ye,onConfirm:E,onClose:x,onCancel:A,onOpen:k,onClosed:D}){const[L,H]=C.useState([]),[V,P]=C.useState([]),v=C.useMemo(()=>fr(i??"")??{hour:0,minute:0,second:0},[i]),re=C.useMemo(()=>fr(n??"")??{hour:23,minute:59,second:59},[n]),le=C.useMemo(()=>{const I={hour:ue,minute:ee,second:W};return t.map(ne=>I[ne]())},[t,v,re,V,f,p,h]);function ue(){return be(v.hour,re.hour,f)}function ee(){const I=F("hour"),{hour:ne,minute:J}=v,{hour:oe,minute:l}=re;return be(I===ne?J:0,I===oe?l:59,p)}function W(){const I=F("hour"),ne=F("minute"),{hour:J,minute:oe,second:l}=v,{hour:m,minute:b,second:T}=re;return be(I===J&&ne===oe?l:0,I===m&&ne===b?T:59,h)}function F(I){const ne=t.indexOf(I),J=V[ne];return J!==void 0?Number(J):at(v,re,I)}function Q(I){H(I),x(),E==null||E(I)}function te(){x(),A==null||A()}function M(){k==null||k(),o&&o.length?P([...o]):P(t.map(F))}function G(){P(o?[...o]:[...L]),D==null||D()}return Z.jsx(Ke,{values:V,show:r,title:c,columns:le,teleport:s,confirmButtonText:a,cancelButtonText:u,linkage:!0,onConfirm:Q,onClose:x,onChange:P,onCancel:te,onOpen:M,onClosed:G})}ve.DatePicker=Mt,ve.Picker=Ke,ve.TimePicker=It,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});
|
|
49
|
+
*/var Le,gr;function ft(){if(gr)return Le;gr=1;var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;function t(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function i(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var u=Object.getOwnPropertyNames(s).map(function(p){return s[p]});if(u.join("")!=="0123456789")return!1;var f={};return"abcdefghijklmnopqrst".split("").forEach(function(p){f[p]=p}),Object.keys(Object.assign({},f)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Le=i()?Object.assign:function(n,s){for(var a,u=t(n),f,p=1;p<arguments.length;p++){a=Object(arguments[p]);for(var h in a)o.call(a,h)&&(u[h]=a[h]);if(r){f=r(a);for(var E=0;E<f.length;E++)c.call(a,f[E])&&(u[f[E]]=a[f[E]])}}return u},Le}var Ve,yr;function Ue(){if(yr)return Ve;yr=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ve=r,Ve}var We,Er;function br(){return Er||(Er=1,We=Function.call.bind(Object.prototype.hasOwnProperty)),We}var ze,kr;function lt(){if(kr)return ze;kr=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var o=Ue(),c={},t=br();r=function(n){var s="Warning: "+n;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(n,s,a,u,f){if(process.env.NODE_ENV!=="production"){for(var p in n)if(t(n,p)){var h;try{if(typeof n[p]!="function"){var E=Error((u||"React class")+": "+a+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof n[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}h=n[p](s,p,u,a,null,o)}catch(A){h=A}if(h&&!(h instanceof Error)&&r((u||"React class")+": type specification of "+a+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in c)){c[h.message]=!0;var x=f?f():"";r("Failed "+a+" type: "+h.message+(x??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(c={})},ze=i,ze}var qe,Tr;function dt(){if(Tr)return qe;Tr=1;var r=mr(),o=ft(),c=Ue(),t=br(),i=lt(),n=function(){};process.env.NODE_ENV!=="production"&&(n=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function s(){return null}return qe=function(a,u){var f=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function h(l){var m=l&&(f&&l[f]||l[p]);if(typeof m=="function")return m}var E="<<anonymous>>",x={array:L("array"),bigint:L("bigint"),bool:L("boolean"),func:L("function"),number:L("number"),object:L("object"),string:L("string"),symbol:L("symbol"),any:H(),arrayOf:V,element:P(),elementType:v(),instanceOf:re,node:W(),objectOf:ue,oneOf:le,oneOfType:ee,shape:Q,exact:te};function A(l,m){return l===m?l!==0||1/l===1/m:l!==l&&m!==m}function k(l,m){this.message=l,this.data=m&&typeof m=="object"?m:{},this.stack=""}k.prototype=Error.prototype;function D(l){if(process.env.NODE_ENV!=="production")var m={},b=0;function T(j,O,w,N,z,Y,se){if(N=N||E,Y=Y||w,se!==c){if(u){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=N+":"+w;!m[de]&&b<3&&(n("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+N+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),m[de]=!0,b++)}}return O[w]==null?j?O[w]===null?new k("The "+z+" `"+Y+"` is marked as required "+("in `"+N+"`, but its value is `null`.")):new k("The "+z+" `"+Y+"` is marked as required in "+("`"+N+"`, but its value is `undefined`.")):null:l(O,w,N,z,Y)}var S=T.bind(null,!1);return S.isRequired=T.bind(null,!0),S}function L(l){function m(b,T,S,j,O,w){var N=b[T],z=I(N);if(z!==l){var Y=ne(N);return new k("Invalid "+j+" `"+O+"` of type "+("`"+Y+"` supplied to `"+S+"`, expected ")+("`"+l+"`."),{expectedType:l})}return null}return D(m)}function H(){return D(s)}function V(l){function m(b,T,S,j,O){if(typeof l!="function")return new k("Property `"+O+"` of component `"+S+"` has invalid PropType notation inside arrayOf.");var w=b[T];if(!Array.isArray(w)){var N=I(w);return new k("Invalid "+j+" `"+O+"` of type "+("`"+N+"` supplied to `"+S+"`, expected an array."))}for(var z=0;z<w.length;z++){var Y=l(w,z,S,j,O+"["+z+"]",c);if(Y instanceof Error)return Y}return null}return D(m)}function P(){function l(m,b,T,S,j){var O=m[b];if(!a(O)){var w=I(O);return new k("Invalid "+S+" `"+j+"` of type "+("`"+w+"` supplied to `"+T+"`, expected a single ReactElement."))}return null}return D(l)}function v(){function l(m,b,T,S,j){var O=m[b];if(!r.isValidElementType(O)){var w=I(O);return new k("Invalid "+S+" `"+j+"` of type "+("`"+w+"` supplied to `"+T+"`, expected a single ReactElement type."))}return null}return D(l)}function re(l){function m(b,T,S,j,O){if(!(b[T]instanceof l)){var w=l.name||E,N=oe(b[T]);return new k("Invalid "+j+" `"+O+"` of type "+("`"+N+"` supplied to `"+S+"`, expected ")+("instance of `"+w+"`."))}return null}return D(m)}function le(l){if(!Array.isArray(l))return process.env.NODE_ENV!=="production"&&(arguments.length>1?n("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):n("Invalid argument supplied to oneOf, expected an array.")),s;function m(b,T,S,j,O){for(var w=b[T],N=0;N<l.length;N++)if(A(w,l[N]))return null;var z=JSON.stringify(l,function(se,g){var de=ne(g);return de==="symbol"?String(g):g});return new k("Invalid "+j+" `"+O+"` of value `"+String(w)+"` "+("supplied to `"+S+"`, expected one of "+z+"."))}return D(m)}function ue(l){function m(b,T,S,j,O){if(typeof l!="function")return new k("Property `"+O+"` of component `"+S+"` has invalid PropType notation inside objectOf.");var w=b[T],N=I(w);if(N!=="object")return new k("Invalid "+j+" `"+O+"` of type "+("`"+N+"` supplied to `"+S+"`, expected an object."));for(var z in w)if(t(w,z)){var Y=l(w,z,S,j,O+"."+z,c);if(Y instanceof Error)return Y}return null}return D(m)}function ee(l){if(!Array.isArray(l))return process.env.NODE_ENV!=="production"&&n("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var m=0;m<l.length;m++){var b=l[m];if(typeof b!="function")return n("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(b)+" at index "+m+"."),s}function T(S,j,O,w,N){for(var z=[],Y=0;Y<l.length;Y++){var se=l[Y],g=se(S,j,O,w,N,c);if(g==null)return null;g.data&&t(g.data,"expectedType")&&z.push(g.data.expectedType)}var de=z.length>0?", expected one of type ["+z.join(", ")+"]":"";return new k("Invalid "+w+" `"+N+"` supplied to "+("`"+O+"`"+de+"."))}return D(T)}function W(){function l(m,b,T,S,j){return M(m[b])?null:new k("Invalid "+S+" `"+j+"` supplied to "+("`"+T+"`, expected a ReactNode."))}return D(l)}function F(l,m,b,T,S){return new k((l||"React class")+": "+m+" type `"+b+"."+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+S+"`.")}function Q(l){function m(b,T,S,j,O){var w=b[T],N=I(w);if(N!=="object")return new k("Invalid "+j+" `"+O+"` of type `"+N+"` "+("supplied to `"+S+"`, expected `object`."));for(var z in l){var Y=l[z];if(typeof Y!="function")return F(S,j,O,z,ne(Y));var se=Y(w,z,S,j,O+"."+z,c);if(se)return se}return null}return D(m)}function te(l){function m(b,T,S,j,O){var w=b[T],N=I(w);if(N!=="object")return new k("Invalid "+j+" `"+O+"` of type `"+N+"` "+("supplied to `"+S+"`, expected `object`."));var z=o({},b[T],l);for(var Y in z){var se=l[Y];if(t(l,Y)&&typeof se!="function")return F(S,j,O,Y,ne(se));if(!se)return new k("Invalid "+j+" `"+O+"` key `"+Y+"` supplied to `"+S+"`.\nBad object: "+JSON.stringify(b[T],null," ")+`
|
|
50
|
+
Valid keys: `+JSON.stringify(Object.keys(l),null," "));var g=se(w,Y,S,j,O+"."+Y,c);if(g)return g}return null}return D(m)}function M(l){switch(typeof l){case"number":case"string":case"undefined":return!0;case"boolean":return!l;case"object":if(Array.isArray(l))return l.every(M);if(l===null||a(l))return!0;var m=h(l);if(m){var b=m.call(l),T;if(m!==l.entries){for(;!(T=b.next()).done;)if(!M(T.value))return!1}else for(;!(T=b.next()).done;){var S=T.value;if(S&&!M(S[1]))return!1}}else return!1;return!0;default:return!1}}function G(l,m){return l==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function I(l){var m=typeof l;return Array.isArray(l)?"array":l instanceof RegExp?"object":G(m,l)?"symbol":m}function ne(l){if(typeof l>"u"||l===null)return""+l;var m=I(l);if(m==="object"){if(l instanceof Date)return"date";if(l instanceof RegExp)return"regexp"}return m}function J(l){var m=ne(l);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}function oe(l){return!l.constructor||!l.constructor.name?E:l.constructor.name}return x.checkPropTypes=i,x.resetWarningCache=i.resetWarningCache,x.PropTypes=x,x},qe}var Xe,xr;function pt(){if(xr)return Xe;xr=1;var r=Ue();function o(){}function c(){}return c.resetWarningCache=o,Xe=function(){function t(s,a,u,f,p,h){if(h!==r){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}t.isRequired=t;function i(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:i,element:t,elementType:t,instanceOf:i,node:t,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n},Xe}if(process.env.NODE_ENV!=="production"){var vt=mr(),ht=!0;Fe.exports=dt()(vt.isElement,ht)}else Fe.exports=pt()();var mt=Fe.exports;const C=Hr(mt);function gt(r,o){return r.classList?!!o&&r.classList.contains(o):(" "+(r.className.baseVal||r.className)+" ").indexOf(" "+o+" ")!==-1}function yt(r,o){r.classList?r.classList.add(o):gt(r,o)||(typeof r.className=="string"?r.className=r.className+" "+o:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+o))}function Sr(r,o){return r.replace(new RegExp("(^|\\s)"+o+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Et(r,o){r.classList?r.classList.remove(o):typeof r.className=="string"?r.className=Sr(r.className,o):r.setAttribute("class",Sr(r.className&&r.className.baseVal||"",o))}const _r={disabled:!1};var bt=process.env.NODE_ENV!=="production"?C.oneOfType([C.number,C.shape({enter:C.number,exit:C.number,appear:C.number}).isRequired]):null,kt=process.env.NODE_ENV!=="production"?C.oneOfType([C.string,C.shape({enter:C.string,exit:C.string,active:C.string}),C.shape({enter:C.string,enterDone:C.string,enterActive:C.string,exit:C.string,exitDone:C.string,exitActive:C.string})]):null;const Or=R.createContext(null);var Cr=function(o){return o.scrollTop},Pe="unmounted",me="exited",ge="entering",ke="entered",He="exiting",he=function(r){dr(o,r);function o(t,i){var n;n=r.call(this,t,i)||this;var s=i,a=s&&!s.isMounting?t.enter:t.appear,u;return n.appearStatus=null,t.in?a?(u=me,n.appearStatus=ge):u=ke:t.unmountOnExit||t.mountOnEnter?u=Pe:u=me,n.state={status:u},n.nextCallback=null,n}o.getDerivedStateFromProps=function(i,n){var s=i.in;return s&&n.status===Pe?{status:me}:null};var c=o.prototype;return c.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},c.componentDidUpdate=function(i){var n=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==ge&&s!==ke&&(n=ge):(s===ge||s===ke)&&(n=He)}this.updateStatus(!1,n)},c.componentWillUnmount=function(){this.cancelNextCallback()},c.getTimeouts=function(){var i=this.props.timeout,n,s,a;return n=s=a=i,i!=null&&typeof i!="number"&&(n=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:n,enter:s,appear:a}},c.updateStatus=function(i,n){if(i===void 0&&(i=!1),n!==null)if(this.cancelNextCallback(),n===ge){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Oe.findDOMNode(this);s&&Cr(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===me&&this.setState({status:Pe})},c.performEnter=function(i){var n=this,s=this.props.enter,a=this.context?this.context.isMounting:i,u=this.props.nodeRef?[a]:[Oe.findDOMNode(this),a],f=u[0],p=u[1],h=this.getTimeouts(),E=a?h.appear:h.enter;if(!i&&!s||_r.disabled){this.safeSetState({status:ke},function(){n.props.onEntered(f)});return}this.props.onEnter(f,p),this.safeSetState({status:ge},function(){n.props.onEntering(f,p),n.onTransitionEnd(E,function(){n.safeSetState({status:ke},function(){n.props.onEntered(f,p)})})})},c.performExit=function(){var i=this,n=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:Oe.findDOMNode(this);if(!n||_r.disabled){this.safeSetState({status:me},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:He},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:me},function(){i.props.onExited(a)})})})},c.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},c.safeSetState=function(i,n){n=this.setNextCallback(n),this.setState(i,n)},c.setNextCallback=function(i){var n=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,n.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},c.onTransitionEnd=function(i,n){this.setNextCallback(n);var s=this.props.nodeRef?this.props.nodeRef.current:Oe.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var u=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],f=u[0],p=u[1];this.props.addEndListener(f,p)}i!=null&&setTimeout(this.nextCallback,i)},c.render=function(){var i=this.state.status;if(i===Pe)return null;var n=this.props,s=n.children;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;var a=lr(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return R.createElement(Or.Provider,{value:null},typeof s=="function"?s(i,a):R.cloneElement(R.Children.only(s),a))},o}(R.Component);he.contextType=Or,he.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:C.shape({current:typeof Element>"u"?C.any:function(r,o,c,t,i,n){var s=r[o];return C.instanceOf(s&&"ownerDocument"in s?s.ownerDocument.defaultView.Element:Element)(r,o,c,t,i,n)}}),children:C.oneOfType([C.func.isRequired,C.element.isRequired]).isRequired,in:C.bool,mountOnEnter:C.bool,unmountOnExit:C.bool,appear:C.bool,enter:C.bool,exit:C.bool,timeout:function(o){var c=bt;o.addEndListener||(c=c.isRequired);for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return c.apply(void 0,[o].concat(i))},addEndListener:C.func,onEnter:C.func,onEntering:C.func,onEntered:C.func,onExit:C.func,onExiting:C.func,onExited:C.func}:{};function Te(){}he.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Te,onEntering:Te,onEntered:Te,onExit:Te,onExiting:Te,onExited:Te},he.UNMOUNTED=Pe,he.EXITED=me,he.ENTERING=ge,he.ENTERED=ke,he.EXITING=He;var Tt=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return yt(o,t)})},Be=function(o,c){return o&&c&&c.split(" ").forEach(function(t){return Et(o,t)})},Me=function(r){dr(o,r);function o(){for(var t,i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];return t=r.call.apply(r,[this].concat(n))||this,t.appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1];t.removeClasses(p,"exit"),t.addClass(p,h?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(a,u)},t.onEntering=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1],E=h?"appear":"enter";t.addClass(p,E,"active"),t.props.onEntering&&t.props.onEntering(a,u)},t.onEntered=function(a,u){var f=t.resolveArguments(a,u),p=f[0],h=f[1],E=h?"appear":"enter";t.removeClasses(p,E),t.addClass(p,E,"done"),t.props.onEntered&&t.props.onEntered(a,u)},t.onExit=function(a){var u=t.resolveArguments(a),f=u[0];t.removeClasses(f,"appear"),t.removeClasses(f,"enter"),t.addClass(f,"exit","base"),t.props.onExit&&t.props.onExit(a)},t.onExiting=function(a){var u=t.resolveArguments(a),f=u[0];t.addClass(f,"exit","active"),t.props.onExiting&&t.props.onExiting(a)},t.onExited=function(a){var u=t.resolveArguments(a),f=u[0];t.removeClasses(f,"exit"),t.addClass(f,"exit","done"),t.props.onExited&&t.props.onExited(a)},t.resolveArguments=function(a,u){return t.props.nodeRef?[t.props.nodeRef.current,a]:[a,u]},t.getClassNames=function(a){var u=t.props.classNames,f=typeof u=="string",p=f&&u?u+"-":"",h=f?""+p+a:u[a],E=f?h+"-active":u[a+"Active"],x=f?h+"-done":u[a+"Done"];return{baseClassName:h,activeClassName:E,doneClassName:x}},t}var c=o.prototype;return c.addClass=function(i,n,s){var a=this.getClassNames(n)[s+"ClassName"],u=this.getClassNames("enter"),f=u.doneClassName;n==="appear"&&s==="done"&&f&&(a+=" "+f),s==="active"&&i&&Cr(i),a&&(this.appliedClasses[n][s]=a,Tt(i,a))},c.removeClasses=function(i,n){var s=this.appliedClasses[n],a=s.base,u=s.active,f=s.done;this.appliedClasses[n]={},a&&Be(i,a),u&&Be(i,u),f&&Be(i,f)},c.render=function(){var i=this.props;i.classNames;var n=lr(i,["classNames"]);return R.createElement(he,Ae({},n,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},o}(R.Component);Me.defaultProps={classNames:""},Me.propTypes=process.env.NODE_ENV!=="production"?Ae({},he.propTypes,{classNames:kt,onEnter:C.func,onEntering:C.func,onEntered:C.func,onExit:C.func,onExiting:C.func,onExited:C.func}):{};function xt({show:r,onClose:o,onOpen:c,onClosed:t,children:i,teleport:n=document.body}){const s=R.useRef(null),a=R.useRef(null);R.useEffect(()=>(r?(document.body.style.overflow="hidden",c==null||c()):document.body.style.overflow="",()=>{document.body.style.overflow=""}),[r]);function u(f){s.current&&(s.current.style.setProperty("display",f),f==="none"&&(t==null||t()))}return Oe.createPortal(Z.jsxs(Z.Fragment,{children:[Z.jsx(Me,{in:r,timeout:300,nodeRef:a,classNames:"chook-picker-fade",unmountOnExit:!0,children:Z.jsx("div",{ref:a,role:"presentation",className:"chook-picker-mask",onClick:o,onKeyDown:f=>{f.key==="Escape"&&o()}})}),Z.jsx(Me,{in:r,timeout:300,nodeRef:s,classNames:"chook-picker-slide",onEnter:()=>u(""),onExited:()=>u("none"),children:Z.jsx("div",{ref:s,className:"chook-picker-container",style:{display:"none"},children:i})})]}),n)}function Rr(r){return R.forwardRef(r)}const St=16,Ge=48,_t=.52,Pr=150,Je=300,Ot=15,Ct=.008,wr=5,Rt="Select Date",Pt=["year","month","day"],wt="Select Time",At=["hour","minute","second"];function jt(){const r={startX:0,startY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0};let o="",c=!0;const t=()=>o==="vertical",i=()=>o==="horizontal";function n(){r.deltaX=0,r.deltaY=0,r.offsetX=0,r.offsetY=0,o="",c=!0}function s(f){const p="touches"in f?f.touches[0]:f;n(),r.startX=p.clientX,r.startY=p.clientY}function a(f){if(!r.startX||!r.startY)return!0;const p="touches"in f?f.touches[0]:f;r.deltaX=Math.max(p.clientX,0)-r.startX,r.deltaY=p.clientY-r.startY,r.offsetX=Math.abs(r.deltaX),r.offsetY=Math.abs(r.deltaY);const h=10;(!o||r.offsetX<h&&r.offsetY<h)&&(o=rt(r.offsetX,r.offsetY)),c&&(r.offsetX>wr||r.offsetY>wr)&&(c=!1)}function u(){r.startX=0,r.startY=0}return{pointer:r,move:a,start:s,stop:u,reset:n,isVertical:t,isHorizontal:i}}function Mt({column:r,onChange:o}){const t=Number.parseFloat(getComputedStyle(document.documentElement).fontSize)/St,[i,n]=R.useState(0),[s,a]=R.useState(0),u=R.useRef(0),f=R.useRef(0),p=R.useRef(0),h=R.useRef(!1),E=R.useRef(null),{pointer:x,start:A,move:k,stop:D}=R.useMemo(()=>jt(),[]);function L(W){return W*t}function H(W){const F=r.length,Q=Math.round(-W/L(Ge));return Q<0?0:Q>=F?F-1:Q}function V(W){const F=-W*L(Ge),Q=()=>o==null?void 0:o(W);h.current&&F!==i?E.current=Q:Q(),n(F)}function P(W){A(W),h.current=!0,a(0),f.current=Date.now(),u.current=i,p.current=u.current,E.current=null}function v(W){if(k(W))return;const Q=r.length,te=u.current+x.deltaY,M=L((Q-1)*-48),G=Math.min(Math.max(te,M),0),I=Date.now();n(G),!(I-f.current<=Je)&&(f.current=I,p.current=G)}function re(){D();const W=i-p.current,F=Date.now()-f.current;if(F<Je&&Math.abs(W)>Ot){le(W,F);return}const Q=H(i);a(Pr),V(Q),h.current=!1}function le(W,F){const Q=Math.abs(W/F),te=i+Q/Ct*(W<0?-1:1),M=H(te);a(Je),V(M)}function ue(){a(0),h.current=!1,E.current&&(E.current(),E.current=null)}function ee(W,F="auto"){h.current&&F==="smooth"||(E.current=null,h.current=F==="smooth",a(F==="smooth"?Pr:0),V(W))}return{offsetY:i,transitionDuration:s,onPointerDown:P,onPointerMove:v,onPointerUp:re,stopInertialSliding:ue,scrollToIndex:ee}}function It({column:r,fields:o,selectedIndex:c=0,onChange:t},i){const{offsetY:n,transitionDuration:s,onPointerDown:a,onPointerMove:u,onPointerUp:f,stopInertialSliding:p,scrollToIndex:h}=Mt({column:r,onChange:E});R.useImperativeHandle(i,()=>({scrollToSelected:x}));function E(k){k!==c&&t(k)}function x(k=c,D){h(k,D)}function A(k){k!==c&&x(k,"smooth")}return Z.jsx("div",{role:"presentation",className:"chook-picker-column",onTouchStart:a,onTouchMove:u,onTouchEnd:f,onTouchCancel:f,onMouseDown:a,onMouseMove:u,onMouseUp:f,children:Z.jsx("ul",{style:{overflowY:"hidden",transform:`translate3d(0, ${n}px, 0)`,transitionDuration:`${s}ms`,transitionProperty:s?"all":"none"},onTransitionEnd:p,children:r.map((k,D)=>Z.jsx("div",{tabIndex:0,role:"button","aria-label":"Select option",className:"chook-picker-column-item",onClick:()=>A(D),onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&A(D)},children:Z.jsx("p",{className:"chook-picker-column-label",style:{transform:`rotate3d(1, 0, 0, ${(D*Ge+n)*_t}deg)`},children:k==null?void 0:k[o.label]})},k==null?void 0:k[o.value]))})})}const Ar=Rr(It);Ar.displayName="Column";function Dt(r,o){const{loading:c,loadingSlot:t,columns:i,emptySlot:n,currentColumns:s,fields:a,selectedIndices:u,updateSelectedValueByIndex:f}=r,p=R.useRef([]);R.useImperativeHandle(o,()=>({scrollColumnToSelected:h}));function h(E,x){var A;(A=p.current[E])==null||A.scrollToSelected(x)}return c?Z.jsxs(Z.Fragment,{children:[Z.jsx("div",{className:"chook-picker-loading",children:t}),Z.jsx("div",{className:"chook-picker-columns"})]}):i.length?Z.jsxs("div",{className:"chook-picker-columns chook-picker-columns-backdrop",onTouchMove:E=>E.stopPropagation(),children:[s.map((E,x)=>Z.jsx(Ar,{ref:A=>p.current[x]=A,column:E,fields:a,selectedIndex:u[x],onChange:A=>f(x,A)},x)),Z.jsx("div",{className:"chook-picker-mask-backdrop"})]}):Z.jsx("div",{className:"chook-picker-columns",children:n})}const jr=Rr(Dt);jr.displayName="Columns";function Ke({show:r,values:o,title:c,columns:t,linkage:i=!1,loading:n=!1,loadingSlot:s,emptySlot:a,teleport:u,confirmButtonText:f="Confirm",cancelButtonText:p="Cancel",columnsFieldNames:h,onConfirm:E,onClose:x,onChange:A,onCancel:k,onOpen:D,onClosed:L}){const[H,V]=R.useState([]),[P,v]=R.useState([]),[re,le]=R.useState([]),ue=R.useRef(null),ee=Zr(h),W=Kr(t,ee),F=R.useMemo(()=>W==="single"?[t]:W==="multiple"?t:Qr(t,P,ee),[t,W,P,ee]);R.useEffect(()=>{!o||o.every((oe,l)=>oe===P[l])||v(o)},[o]),R.useEffect(()=>{var m;const J=F.length,oe=[];let l=!1;for(let b=0;b<J;b++){const T=F[b],S=P[b],j=ar(T,S,ee);if(j===-1){const w=(re[b]??0)>=T.length?Math.max(T.length-1,0):0;oe[b]=w}else oe[b]=j;oe[b]!==re[b]&&((m=ue.current)==null||m.scrollColumnToSelected(b,oe[b]),l=!0)}l&&le(oe)},[P,F,ee]);function Q(J,oe){var S;const l=F[J],m=(S=l[oe])==null?void 0:S[ee.value],b=P[J];if(m===b)return;const T=[...P];if(T[J]=m,W==="cascade"){const j=l[oe],O=et(j,J,T,ee);v(O),te(O)}else v(T),te(T)}function te(J){A==null||A(J),i&&V(J)}function M(){V(P),x(),E==null||E(P)}function G(){x(),k==null||k()}function I(){D==null||D()}function ne(){v(o?[...o]:[...H]),L==null||L()}return Z.jsxs(xt,{show:r,teleport:u,onOpen:I,onClose:x,onClosed:ne,children:[Z.jsxs("div",{className:"chook-picker-header",children:[Z.jsx("button",{className:"chook-picker-cancel",onClick:G,children:p}),Z.jsx("p",{className:"chook-picker-title",children:c}),Z.jsx("button",{className:"chook-picker-confirm",onClick:M,children:f})]}),Z.jsx(jr,{ref:ue,loading:n,loadingSlot:s,columns:t,emptySlot:a,currentColumns:F,fields:ee,selectedIndices:re,updateSelectedValueByIndex:Q})]})}function Nt({show:r,values:o,title:c=Rt,columnsType:t=Pt,minDate:i=new Date(new Date().getFullYear()-10,0,1),maxDate:n=new Date(new Date().getFullYear()+10,11,31),teleport:s,confirmButtonText:a,cancelButtonText:u,formatYearLabel:f=Ne,formatMonthLabel:p=Ne,formatDayLabel:h=Ne,onConfirm:E,onClose:x,onCancel:A,onOpen:k,onClosed:D}){const[L,H]=R.useState([]),[V,P]=R.useState([]),v=R.useMemo(()=>{const M={year:re,month:le,day:ue};return t.map(G=>M[G]())},[t,i,n,V,f,p,h]);function re(){const M=i.getFullYear(),G=n.getFullYear();return be(M,G,f)}function le(){const M=ee("year"),G=cr(M,i)?i.getMonth()+1:1,I=ur(M,n)?n.getMonth()+1:12;return be(G,I,p)}function ue(){const M=ee("year"),G=ee("month"),I=cr(M,i)&&tt(G,i),ne=ur(M,n)&&nt(G,n),J=I?i.getDate():1,oe=ne?n.getDate():ot(M,G);return be(J,oe,h)}function ee(M){const G=t.indexOf(M),I=V[G];return I?Number(I):it(i,n,M)}function W(M){H(M),x(),E==null||E(M)}function F(){x(),A==null||A()}function Q(){k==null||k(),o&&o.length?P([...o]):P(t.map(ee))}function te(){P(o?[...o]:[...L]),D==null||D()}return Z.jsx(Ke,{values:V,show:r,title:c,columns:v,teleport:s,confirmButtonText:a,cancelButtonText:u,linkage:!0,onConfirm:W,onClose:x,onChange:P,onCancel:F,onOpen:Q,onClosed:te})}function Yt({show:r,values:o,title:c=wt,columnsType:t=At,minTime:i,maxTime:n,teleport:s,confirmButtonText:a,cancelButtonText:u,formatHourLabel:f=Ye,formatMinuteLabel:p=Ye,formatSecondLabel:h=Ye,onConfirm:E,onClose:x,onCancel:A,onOpen:k,onClosed:D}){const[L,H]=R.useState([]),[V,P]=R.useState([]),v=R.useMemo(()=>fr(i??"")??{hour:0,minute:0,second:0},[i]),re=R.useMemo(()=>fr(n??"")??{hour:23,minute:59,second:59},[n]),le=R.useMemo(()=>{const I={hour:ue,minute:ee,second:W};return t.map(ne=>I[ne]())},[t,v,re,V,f,p,h]);function ue(){return be(v.hour,re.hour,f)}function ee(){const I=F("hour"),{hour:ne,minute:J}=v,{hour:oe,minute:l}=re;return be(I===ne?J:0,I===oe?l:59,p)}function W(){const I=F("hour"),ne=F("minute"),{hour:J,minute:oe,second:l}=v,{hour:m,minute:b,second:T}=re;return be(I===J&&ne===oe?l:0,I===m&&ne===b?T:59,h)}function F(I){const ne=t.indexOf(I),J=V[ne];return J!==void 0?Number(J):st(v,re,I)}function Q(I){H(I),x(),E==null||E(I)}function te(){x(),A==null||A()}function M(){k==null||k(),o&&o.length?P([...o]):P(t.map(F))}function G(){P(o?[...o]:[...L]),D==null||D()}return Z.jsx(Ke,{values:V,show:r,title:c,columns:le,teleport:s,confirmButtonText:a,cancelButtonText:u,linkage:!0,onConfirm:Q,onClose:x,onChange:P,onCancel:te,onOpen:M,onClosed:G})}ve.DatePicker=Nt,ve.Picker=Ke,ve.TimePicker=Yt,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});
|
package/dist/vue/picker.es.d.ts
CHANGED
|
@@ -1,108 +1,30 @@
|
|
|
1
|
+
import { AllowedComponentProps } from 'vue';
|
|
2
|
+
import { ComponentCustomProps } from 'vue';
|
|
1
3
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
4
|
import { ComponentProvideOptions } from 'vue';
|
|
3
|
-
import { CreateComponentPublicInstanceWithMixins } from 'vue';
|
|
4
5
|
import { DefineComponent } from 'vue';
|
|
5
|
-
import { GlobalComponents } from 'vue';
|
|
6
|
-
import { GlobalDirectives } from 'vue';
|
|
7
|
-
import { Props as Props_2 } from './PickerColumn.vue';
|
|
8
6
|
import { PublicProps } from 'vue';
|
|
7
|
+
import { ShallowUnwrapRef } from 'vue';
|
|
8
|
+
import { VNode } from 'vue';
|
|
9
|
+
import { VNodeProps } from 'vue';
|
|
9
10
|
|
|
10
|
-
declare
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
closed: () => any;
|
|
14
|
-
"update:show": (args_0: boolean) => any;
|
|
15
|
-
confirm: (args_0: PickerSelectedValues) => any;
|
|
16
|
-
cancel: () => any;
|
|
17
|
-
}, string, PublicProps, Readonly<Props> & Readonly<{
|
|
18
|
-
"onUpdate:modelValue"?: ((args_0: PickerSelectedValues) => any) | undefined;
|
|
19
|
-
onOpen?: (() => any) | undefined;
|
|
20
|
-
onClosed?: (() => any) | undefined;
|
|
21
|
-
"onUpdate:show"?: ((args_0: boolean) => any) | undefined;
|
|
22
|
-
onConfirm?: ((args_0: PickerSelectedValues) => any) | undefined;
|
|
23
|
-
onCancel?: (() => any) | undefined;
|
|
24
|
-
}>, {
|
|
25
|
-
confirmButtonText: string;
|
|
26
|
-
cancelButtonText: string;
|
|
27
|
-
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
28
|
-
columnsRef: (CreateComponentPublicInstanceWithMixins<Readonly<Props_2> & Readonly<{
|
|
29
|
-
onChange?: ((args_0: number) => any) | undefined;
|
|
30
|
-
}>, {
|
|
31
|
-
scrollToSelected: (index?: number, behavior?: ScrollBehavior) => void;
|
|
32
|
-
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
33
|
-
change: (args_0: number) => any;
|
|
34
|
-
}, PublicProps, {
|
|
35
|
-
selectedIndex: number;
|
|
36
|
-
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
|
|
37
|
-
P: {};
|
|
38
|
-
B: {};
|
|
39
|
-
D: {};
|
|
40
|
-
C: {};
|
|
41
|
-
M: {};
|
|
42
|
-
Defaults: {};
|
|
43
|
-
}, Readonly<Props_2> & Readonly<{
|
|
44
|
-
onChange?: ((args_0: number) => any) | undefined;
|
|
45
|
-
}>, {
|
|
46
|
-
scrollToSelected: (index?: number, behavior?: ScrollBehavior) => void;
|
|
47
|
-
}, {}, {}, {}, {
|
|
48
|
-
selectedIndex: number;
|
|
49
|
-
}> | null)[];
|
|
50
|
-
}, any>;
|
|
51
|
-
|
|
52
|
-
declare function __VLS_template(): {
|
|
53
|
-
attrs: Partial<{}>;
|
|
54
|
-
slots: {
|
|
55
|
-
loading?(_: {}): any;
|
|
56
|
-
empty?(_: {}): any;
|
|
57
|
-
};
|
|
58
|
-
refs: {
|
|
59
|
-
columnsRef: (CreateComponentPublicInstanceWithMixins<Readonly<Props_2> & Readonly<{
|
|
60
|
-
onChange?: ((args_0: number) => any) | undefined;
|
|
61
|
-
}>, {
|
|
62
|
-
scrollToSelected: (index?: number, behavior?: ScrollBehavior) => void;
|
|
63
|
-
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
64
|
-
change: (args_0: number) => any;
|
|
65
|
-
}, PublicProps, {
|
|
66
|
-
selectedIndex: number;
|
|
67
|
-
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLDivElement, ComponentProvideOptions, {
|
|
68
|
-
P: {};
|
|
69
|
-
B: {};
|
|
70
|
-
D: {};
|
|
71
|
-
C: {};
|
|
72
|
-
M: {};
|
|
73
|
-
Defaults: {};
|
|
74
|
-
}, Readonly<Props_2> & Readonly<{
|
|
75
|
-
onChange?: ((args_0: number) => any) | undefined;
|
|
76
|
-
}>, {
|
|
77
|
-
scrollToSelected: (index?: number, behavior?: ScrollBehavior) => void;
|
|
78
|
-
}, {}, {}, {}, {
|
|
79
|
-
selectedIndex: number;
|
|
80
|
-
}> | null)[];
|
|
81
|
-
};
|
|
82
|
-
rootEl: any;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare type __VLS_PrettifyLocal<T> = {
|
|
12
|
+
[K in keyof T]: T[K];
|
|
13
|
+
} & {};
|
|
86
14
|
|
|
87
|
-
declare
|
|
88
|
-
|
|
89
|
-
$slots: S;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export declare const DatePicker: DefineComponent<Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
94
|
-
"update:modelValue": (args_0: PickerSelectedValues) => any;
|
|
15
|
+
export declare const DatePicker: DefineComponent<Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (values: number[]) => any;
|
|
95
17
|
open: () => any;
|
|
96
18
|
closed: () => any;
|
|
97
|
-
"update:show": (
|
|
98
|
-
confirm: (
|
|
19
|
+
"update:show": (isShow: boolean) => any;
|
|
20
|
+
confirm: (values: number[]) => any;
|
|
99
21
|
cancel: () => any;
|
|
100
|
-
}, string, PublicProps, Readonly<
|
|
101
|
-
"onUpdate:modelValue"?: ((
|
|
22
|
+
}, string, PublicProps, Readonly<Props_2> & Readonly<{
|
|
23
|
+
"onUpdate:modelValue"?: ((values: number[]) => any) | undefined;
|
|
102
24
|
onOpen?: (() => any) | undefined;
|
|
103
25
|
onClosed?: (() => any) | undefined;
|
|
104
|
-
"onUpdate:show"?: ((
|
|
105
|
-
onConfirm?: ((
|
|
26
|
+
"onUpdate:show"?: ((isShow: boolean) => any) | undefined;
|
|
27
|
+
onConfirm?: ((values: number[]) => any) | undefined;
|
|
106
28
|
onCancel?: (() => any) | undefined;
|
|
107
29
|
}>, {
|
|
108
30
|
title: string;
|
|
@@ -118,9 +40,27 @@ export declare type DatePickerColumnType = 'year' | 'month' | 'day';
|
|
|
118
40
|
|
|
119
41
|
export declare type Direction = '' | 'vertical' | 'horizontal';
|
|
120
42
|
|
|
121
|
-
export declare const Picker:
|
|
43
|
+
export declare const Picker: <T extends string | number>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
44
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
45
|
+
readonly "onUpdate:modelValue"?: ((values: T[]) => any) | undefined;
|
|
46
|
+
readonly onOpen?: (() => any) | undefined;
|
|
47
|
+
readonly onClosed?: (() => any) | undefined;
|
|
48
|
+
readonly "onUpdate:show"?: ((show: boolean) => any) | undefined;
|
|
49
|
+
readonly onConfirm?: ((values: T[]) => any) | undefined;
|
|
50
|
+
readonly onCancel?: (() => any) | undefined;
|
|
51
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:modelValue" | "onOpen" | "onClosed" | "onUpdate:show" | "onConfirm" | "onCancel"> & Props<T> & Partial<{}>> & PublicProps;
|
|
52
|
+
expose(exposed: ShallowUnwrapRef< {}>): void;
|
|
53
|
+
attrs: any;
|
|
54
|
+
slots: {
|
|
55
|
+
loading?(_: {}): any;
|
|
56
|
+
empty?(_: {}): any;
|
|
57
|
+
};
|
|
58
|
+
emit: ((evt: "update:modelValue", values: T[]) => void) & ((evt: "open") => void) & ((evt: "closed") => void) & ((evt: "update:show", show: boolean) => void) & ((evt: "confirm", values: T[]) => void) & ((evt: "cancel") => void);
|
|
59
|
+
}>) => VNode & {
|
|
60
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
61
|
+
};
|
|
122
62
|
|
|
123
|
-
export declare type PickerColumn = Array<PickerOption | undefined>;
|
|
63
|
+
export declare type PickerColumn<T = string | number> = Array<PickerOption<T> | undefined>;
|
|
124
64
|
|
|
125
65
|
export declare type PickerColumnsType = 'single' | 'multiple' | 'cascade';
|
|
126
66
|
|
|
@@ -132,20 +72,20 @@ export declare interface PickerFields {
|
|
|
132
72
|
|
|
133
73
|
export declare type PickerFormatLabel = (label: string) => string;
|
|
134
74
|
|
|
135
|
-
export declare interface PickerOption {
|
|
75
|
+
export declare interface PickerOption<T> {
|
|
136
76
|
label?: string | number;
|
|
137
|
-
value?:
|
|
138
|
-
children?: PickerColumn
|
|
77
|
+
value?: T;
|
|
78
|
+
children?: PickerColumn<T>;
|
|
139
79
|
[key: PropertyKey]: any;
|
|
140
80
|
}
|
|
141
81
|
|
|
142
|
-
export declare type PickerSelectedValues = Array<PickerOption['value']>;
|
|
82
|
+
export declare type PickerSelectedValues<T = string | number> = Array<PickerOption<T>['value']>;
|
|
143
83
|
|
|
144
|
-
declare interface Props {
|
|
84
|
+
declare interface Props<T> {
|
|
145
85
|
show: boolean;
|
|
146
|
-
modelValue?:
|
|
86
|
+
modelValue?: T[];
|
|
147
87
|
title?: string;
|
|
148
|
-
columns: PickerColumn | PickerColumn[];
|
|
88
|
+
columns: PickerColumn<T> | PickerColumn<T>[];
|
|
149
89
|
linkage?: boolean;
|
|
150
90
|
loading?: boolean;
|
|
151
91
|
teleport?: string | Element;
|
|
@@ -154,9 +94,9 @@ declare interface Props {
|
|
|
154
94
|
columnsFieldNames?: PickerFields;
|
|
155
95
|
}
|
|
156
96
|
|
|
157
|
-
declare interface
|
|
97
|
+
declare interface Props_2 {
|
|
158
98
|
show: boolean;
|
|
159
|
-
modelValue?:
|
|
99
|
+
modelValue?: number[];
|
|
160
100
|
title?: string;
|
|
161
101
|
columnsType?: DatePickerColumnType[];
|
|
162
102
|
minDate?: Date;
|
|
@@ -169,9 +109,9 @@ declare interface Props_3 {
|
|
|
169
109
|
formatDayLabel?: PickerFormatLabel;
|
|
170
110
|
}
|
|
171
111
|
|
|
172
|
-
declare interface
|
|
112
|
+
declare interface Props_3 {
|
|
173
113
|
show: boolean;
|
|
174
|
-
modelValue?:
|
|
114
|
+
modelValue?: number[];
|
|
175
115
|
title?: string;
|
|
176
116
|
columnsType?: TimePickerColumnType[];
|
|
177
117
|
minTime?: string;
|
|
@@ -184,19 +124,19 @@ declare interface Props_4 {
|
|
|
184
124
|
formatSecondLabel?: PickerFormatLabel;
|
|
185
125
|
}
|
|
186
126
|
|
|
187
|
-
export declare const TimePicker: DefineComponent<
|
|
188
|
-
"update:modelValue": (
|
|
127
|
+
export declare const TimePicker: DefineComponent<Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
128
|
+
"update:modelValue": (values: number[]) => any;
|
|
189
129
|
open: () => any;
|
|
190
130
|
closed: () => any;
|
|
191
|
-
"update:show": (
|
|
192
|
-
confirm: (
|
|
131
|
+
"update:show": (isShow: boolean) => any;
|
|
132
|
+
confirm: (values: number[]) => any;
|
|
193
133
|
cancel: () => any;
|
|
194
|
-
}, string, PublicProps, Readonly<
|
|
195
|
-
"onUpdate:modelValue"?: ((
|
|
134
|
+
}, string, PublicProps, Readonly<Props_3> & Readonly<{
|
|
135
|
+
"onUpdate:modelValue"?: ((values: number[]) => any) | undefined;
|
|
196
136
|
onOpen?: (() => any) | undefined;
|
|
197
137
|
onClosed?: (() => any) | undefined;
|
|
198
|
-
"onUpdate:show"?: ((
|
|
199
|
-
onConfirm?: ((
|
|
138
|
+
"onUpdate:show"?: ((isShow: boolean) => any) | undefined;
|
|
139
|
+
onConfirm?: ((values: number[]) => any) | undefined;
|
|
200
140
|
onCancel?: (() => any) | undefined;
|
|
201
141
|
}>, {
|
|
202
142
|
title: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@component-hook/picker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2-alpha.0",
|
|
4
4
|
"description": "Picker component with vue3 and react",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/react-transition-group": "^4.4.12",
|
|
53
|
-
"sass-embedded": "^1.
|
|
54
|
-
"vite-plugin-dts": "^4.5.
|
|
53
|
+
"sass-embedded": "^1.85.1",
|
|
54
|
+
"vite-plugin-dts": "^4.5.3"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "pnpm build:vue && pnpm build:react",
|