@acrool/react-picker 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acrool-react-picker.es.js +97 -97
- package/dist/types.d.ts +1 -0
- package/package.json +4 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as yn from "react";
|
|
2
|
-
import Es, { createContext as wt, useContext as N, useRef as K, useId as vn, useInsertionEffect as Cs, useCallback as z, useMemo as Pt, useEffect as st, Children as ao, isValidElement as lo, useLayoutEffect as co, useState as
|
|
2
|
+
import Es, { createContext as wt, useContext as N, useRef as K, useId as vn, useInsertionEffect as Cs, useCallback as z, useMemo as Pt, useEffect as st, Children as ao, isValidElement as lo, useLayoutEffect as co, useState as Ct, forwardRef as Re, Fragment as Ds, createElement as uo, Component as ho } from "react";
|
|
3
3
|
import fo from "react-dom";
|
|
4
|
-
var it = /* @__PURE__ */ ((t) => (t.bottom = "bottom", t.top = "top", t))(it || {}),
|
|
4
|
+
var it = /* @__PURE__ */ ((t) => (t.bottom = "bottom", t.top = "top", t))(it || {}), Et = /* @__PURE__ */ ((t) => (t.left = "left", t.center = "center", t.right = "right", t))(Et || {});
|
|
5
5
|
const se = [
|
|
6
6
|
"color: #fff",
|
|
7
7
|
"display: inline-block",
|
|
@@ -67,7 +67,7 @@ const ct = {
|
|
|
67
67
|
vertical: it.bottom,
|
|
68
68
|
setVertical: () => ct.warning("No onChange method detected, did you embed your app with Acrool/PickerPortal?")
|
|
69
69
|
}), bh = xn.Consumer, xo = () => N(xn);
|
|
70
|
-
var he = { exports: {} },
|
|
70
|
+
var he = { exports: {} }, $t = {};
|
|
71
71
|
/**
|
|
72
72
|
* @license React
|
|
73
73
|
* react-jsx-runtime.production.js
|
|
@@ -79,7 +79,7 @@ var he = { exports: {} }, Ut = {};
|
|
|
79
79
|
*/
|
|
80
80
|
var ni;
|
|
81
81
|
function To() {
|
|
82
|
-
if (ni) return
|
|
82
|
+
if (ni) return $t;
|
|
83
83
|
ni = 1;
|
|
84
84
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
85
85
|
function n(i, s, o) {
|
|
@@ -97,9 +97,9 @@ function To() {
|
|
|
97
97
|
props: o
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
return
|
|
100
|
+
return $t.Fragment = e, $t.jsx = n, $t.jsxs = n, $t;
|
|
101
101
|
}
|
|
102
|
-
var
|
|
102
|
+
var Wt = {};
|
|
103
103
|
/**
|
|
104
104
|
* @license React
|
|
105
105
|
* react-jsx-runtime.development.js
|
|
@@ -202,7 +202,7 @@ function bo() {
|
|
|
202
202
|
}
|
|
203
203
|
function a(m, V) {
|
|
204
204
|
function k() {
|
|
205
|
-
|
|
205
|
+
Ut || (Ut = !0, console.error(
|
|
206
206
|
"%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://react.dev/link/special-props)",
|
|
207
207
|
V
|
|
208
208
|
));
|
|
@@ -254,7 +254,7 @@ function bo() {
|
|
|
254
254
|
var $ = V.children;
|
|
255
255
|
if ($ !== void 0)
|
|
256
256
|
if (U)
|
|
257
|
-
if (
|
|
257
|
+
if (_t($)) {
|
|
258
258
|
for (U = 0; U < $.length; U++)
|
|
259
259
|
h($[U]);
|
|
260
260
|
Object.freeze && Object.freeze($);
|
|
@@ -303,7 +303,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
303
303
|
function h(m) {
|
|
304
304
|
typeof m == "object" && m !== null && m.$$typeof === d && m._store && (m._store.validated = 1);
|
|
305
305
|
}
|
|
306
|
-
var f = Es, d = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), b = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), A = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), F = Symbol.for("react.activity"), _ = Symbol.for("react.client.reference"), X = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, pt = Object.prototype.hasOwnProperty,
|
|
306
|
+
var f = Es, d = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), b = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), A = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), F = Symbol.for("react.activity"), _ = Symbol.for("react.client.reference"), X = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, pt = Object.prototype.hasOwnProperty, _t = Array.isArray, at = console.createTask ? console.createTask : function() {
|
|
307
307
|
return null;
|
|
308
308
|
};
|
|
309
309
|
f = {
|
|
@@ -311,11 +311,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
311
311
|
return m();
|
|
312
312
|
}
|
|
313
313
|
};
|
|
314
|
-
var
|
|
314
|
+
var Ut, R = {}, C = f["react-stack-bottom-frame"].bind(
|
|
315
315
|
f,
|
|
316
316
|
o
|
|
317
317
|
)(), B = at(i(o)), At = {};
|
|
318
|
-
|
|
318
|
+
Wt.Fragment = p, Wt.jsx = function(m, V, k, U, lt) {
|
|
319
319
|
var Q = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
320
320
|
return u(
|
|
321
321
|
m,
|
|
@@ -327,7 +327,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
327
327
|
Q ? Error("react-stack-top-frame") : C,
|
|
328
328
|
Q ? at(i(m)) : B
|
|
329
329
|
);
|
|
330
|
-
},
|
|
330
|
+
}, Wt.jsxs = function(m, V, k, U, lt) {
|
|
331
331
|
var Q = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
332
332
|
return u(
|
|
333
333
|
m,
|
|
@@ -340,7 +340,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
340
340
|
Q ? at(i(m)) : B
|
|
341
341
|
);
|
|
342
342
|
};
|
|
343
|
-
}()),
|
|
343
|
+
}()), Wt;
|
|
344
344
|
}
|
|
345
345
|
var si;
|
|
346
346
|
function Po() {
|
|
@@ -489,7 +489,7 @@ function oi(t) {
|
|
|
489
489
|
}), e;
|
|
490
490
|
}
|
|
491
491
|
const wn = typeof window < "u", ks = wn ? co : st, Ro = ({ children: t, custom: e, initial: n = !0, onExitComplete: i, presenceAffectsLayout: s = !0, mode: o = "sync", propagate: r = !1 }) => {
|
|
492
|
-
const [a, l] = Ms(r), c = Pt(() => oi(t), [t]), u = r && !a ? [] : c.map(fe), h = K(!0), f = K(c), d = bn(() => /* @__PURE__ */ new Map()), [g, p] =
|
|
492
|
+
const [a, l] = Ms(r), c = Pt(() => oi(t), [t]), u = r && !a ? [] : c.map(fe), h = K(!0), f = K(c), d = bn(() => /* @__PURE__ */ new Map()), [g, p] = Ct(c), [v, y] = Ct(c);
|
|
493
493
|
ks(() => {
|
|
494
494
|
h.current = !1, f.current = c;
|
|
495
495
|
for (let w = 0; w < v.length; w++) {
|
|
@@ -523,8 +523,8 @@ const wn = typeof window < "u", ks = wn ? co : st, Ro = ({ children: t, custom:
|
|
|
523
523
|
return E.jsx(Co, { isPresent: A, initial: !h.current || n ? void 0 : !1, custom: A ? void 0 : e, presenceAffectsLayout: s, mode: o, onExitComplete: A ? void 0 : D, children: w }, T);
|
|
524
524
|
}) });
|
|
525
525
|
}, H = /* @__NO_SIDE_EFFECTS__ */ (t) => t;
|
|
526
|
-
let
|
|
527
|
-
process.env.NODE_ENV !== "production" && (
|
|
526
|
+
let Bt = H, ht = H;
|
|
527
|
+
process.env.NODE_ENV !== "production" && (Bt = (t, e) => {
|
|
528
528
|
!t && typeof console < "u" && console.warn(e);
|
|
529
529
|
}, ht = (t, e) => {
|
|
530
530
|
if (!t)
|
|
@@ -535,7 +535,7 @@ function Sn(t) {
|
|
|
535
535
|
let e;
|
|
536
536
|
return () => (e === void 0 && (e = t()), e);
|
|
537
537
|
}
|
|
538
|
-
const
|
|
538
|
+
const jt = /* @__NO_SIDE_EFFECTS__ */ (t, e, n) => {
|
|
539
539
|
const i = e - t;
|
|
540
540
|
return i === 0 ? 1 : (n - t) / i;
|
|
541
541
|
}, tt = /* @__NO_SIDE_EFFECTS__ */ (t) => t * 1e3, rt = /* @__NO_SIDE_EFFECTS__ */ (t) => t / 1e3, Mo = {
|
|
@@ -632,15 +632,15 @@ const { schedule: M, cancel: ft, state: I, steps: Ue } = Ls(typeof requestAnimat
|
|
|
632
632
|
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
|
|
633
633
|
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
|
|
634
634
|
layout: ["layout", "layoutId"]
|
|
635
|
-
},
|
|
635
|
+
}, Ot = {};
|
|
636
636
|
for (const t in ai)
|
|
637
|
-
|
|
637
|
+
Ot[t] = {
|
|
638
638
|
isEnabled: (e) => ai[t].some((n) => !!e[n])
|
|
639
639
|
};
|
|
640
640
|
function jo(t) {
|
|
641
641
|
for (const e in t)
|
|
642
|
-
|
|
643
|
-
...
|
|
642
|
+
Ot[e] = {
|
|
643
|
+
...Ot[e],
|
|
644
644
|
...t[e]
|
|
645
645
|
};
|
|
646
646
|
}
|
|
@@ -751,13 +751,13 @@ function ci(t) {
|
|
|
751
751
|
return Array.isArray(t) ? t.join(" ") : t;
|
|
752
752
|
}
|
|
753
753
|
const Uo = Symbol.for("motionComponentSymbol");
|
|
754
|
-
function
|
|
754
|
+
function Dt(t) {
|
|
755
755
|
return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
|
|
756
756
|
}
|
|
757
757
|
function $o(t, e, n) {
|
|
758
758
|
return z(
|
|
759
759
|
(i) => {
|
|
760
|
-
i && t.onMount && t.onMount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) :
|
|
760
|
+
i && t.onMount && t.onMount(i), e && (i ? e.mount(i) : e.unmount()), n && (typeof n == "function" ? n(i) : Dt(n) && (n.current = i));
|
|
761
761
|
},
|
|
762
762
|
/**
|
|
763
763
|
* Only pass a new ref callback to React if we've received a visual element
|
|
@@ -800,7 +800,7 @@ function Ko(t, e, n, i) {
|
|
|
800
800
|
t.projection = new n(t.latestValues, e["data-framer-portal-id"] ? void 0 : Ns(t.parent)), t.projection.setOptions({
|
|
801
801
|
layoutId: s,
|
|
802
802
|
layout: o,
|
|
803
|
-
alwaysMeasureLayout: !!r || a &&
|
|
803
|
+
alwaysMeasureLayout: !!r || a && Dt(a),
|
|
804
804
|
visualElement: t,
|
|
805
805
|
/**
|
|
806
806
|
* TODO: Update options in an effect. This could be tricky as it'll be too late
|
|
@@ -848,11 +848,11 @@ function Yo(t, e) {
|
|
|
848
848
|
const n = N(js).strict;
|
|
849
849
|
if (process.env.NODE_ENV !== "production" && e && n) {
|
|
850
850
|
const i = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
|
|
851
|
-
t.ignoreStrict ?
|
|
851
|
+
t.ignoreStrict ? Bt(!1, i) : ht(!1, i);
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
854
|
function Xo(t) {
|
|
855
|
-
const { drag: e, layout: n } =
|
|
855
|
+
const { drag: e, layout: n } = Ot;
|
|
856
856
|
if (!e && !n)
|
|
857
857
|
return {};
|
|
858
858
|
const i = { ...e, ...n };
|
|
@@ -972,7 +972,7 @@ function ta(t, e, n, i) {
|
|
|
972
972
|
}
|
|
973
973
|
return s;
|
|
974
974
|
}
|
|
975
|
-
const
|
|
975
|
+
const It = [
|
|
976
976
|
"transformPerspective",
|
|
977
977
|
"x",
|
|
978
978
|
"y",
|
|
@@ -990,15 +990,15 @@ const Bt = [
|
|
|
990
990
|
"skew",
|
|
991
991
|
"skewX",
|
|
992
992
|
"skewY"
|
|
993
|
-
], St = new Set(
|
|
993
|
+
], St = new Set(It), Us = (t) => (e) => typeof e == "string" && e.startsWith(t), $s = /* @__PURE__ */ Us("--"), ea = /* @__PURE__ */ Us("var(--"), Mn = (t) => ea(t) ? na.test(t.split("/*")[0].trim()) : !1, na = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, Ws = (t, e) => e && typeof t == "number" ? e.transform(t) : t, ot = (t, e, n) => n > e ? e : n < t ? t : n, Nt = {
|
|
994
994
|
test: (t) => typeof t == "number",
|
|
995
995
|
parse: parseFloat,
|
|
996
996
|
transform: (t) => t
|
|
997
997
|
}, te = {
|
|
998
|
-
...
|
|
998
|
+
...Nt,
|
|
999
999
|
transform: (t) => ot(0, 1, t)
|
|
1000
1000
|
}, me = {
|
|
1001
|
-
...
|
|
1001
|
+
...Nt,
|
|
1002
1002
|
default: 1
|
|
1003
1003
|
}, ae = (t) => ({
|
|
1004
1004
|
test: (e) => typeof e == "string" && e.endsWith(t) && e.split(" ").length === 1,
|
|
@@ -1070,7 +1070,7 @@ const Bt = [
|
|
|
1070
1070
|
originY: hi,
|
|
1071
1071
|
originZ: P
|
|
1072
1072
|
}, fi = {
|
|
1073
|
-
...
|
|
1073
|
+
...Nt,
|
|
1074
1074
|
transform: Math.round
|
|
1075
1075
|
}, kn = {
|
|
1076
1076
|
...ra,
|
|
@@ -1086,11 +1086,11 @@ const Bt = [
|
|
|
1086
1086
|
y: "translateY",
|
|
1087
1087
|
z: "translateZ",
|
|
1088
1088
|
transformPerspective: "perspective"
|
|
1089
|
-
}, la =
|
|
1089
|
+
}, la = It.length;
|
|
1090
1090
|
function ca(t, e, n) {
|
|
1091
1091
|
let i = "", s = !0;
|
|
1092
1092
|
for (let o = 0; o < la; o++) {
|
|
1093
|
-
const r =
|
|
1093
|
+
const r = It[o], a = t[r];
|
|
1094
1094
|
if (a === void 0)
|
|
1095
1095
|
continue;
|
|
1096
1096
|
let l = !0;
|
|
@@ -1230,7 +1230,7 @@ function Xs(t, e, n) {
|
|
|
1230
1230
|
const i = Bn(t, e, n);
|
|
1231
1231
|
for (const s in t)
|
|
1232
1232
|
if (G(t[s]) || G(e[s])) {
|
|
1233
|
-
const o =
|
|
1233
|
+
const o = It.indexOf(s) !== -1 ? "attr" + s.charAt(0).toUpperCase() + s.substring(1) : s;
|
|
1234
1234
|
i[o] = t[s];
|
|
1235
1235
|
}
|
|
1236
1236
|
return i;
|
|
@@ -1466,7 +1466,7 @@ const we = /* @__PURE__ */ Ca(() => {
|
|
|
1466
1466
|
let i = "";
|
|
1467
1467
|
const s = Math.max(Math.round(e / n), 2);
|
|
1468
1468
|
for (let o = 0; o < s; o++)
|
|
1469
|
-
i += t(/* @__PURE__ */
|
|
1469
|
+
i += t(/* @__PURE__ */ jt(0, s - 1, o)) + ", ";
|
|
1470
1470
|
return `linear(${i.substring(0, i.length - 2)})`;
|
|
1471
1471
|
};
|
|
1472
1472
|
function tr(t) {
|
|
@@ -1602,7 +1602,7 @@ const rr = /* @__PURE__ */ new Set([
|
|
|
1602
1602
|
"left",
|
|
1603
1603
|
"right",
|
|
1604
1604
|
"bottom",
|
|
1605
|
-
...
|
|
1605
|
+
...It
|
|
1606
1606
|
]);
|
|
1607
1607
|
let ve;
|
|
1608
1608
|
function Fa() {
|
|
@@ -1903,7 +1903,7 @@ const za = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s
|
|
|
1903
1903
|
alpha: a !== void 0 ? parseFloat(a) : 1
|
|
1904
1904
|
};
|
|
1905
1905
|
}, Ya = (t) => ot(0, 255, t), We = {
|
|
1906
|
-
...
|
|
1906
|
+
...Nt,
|
|
1907
1907
|
transform: (t) => Math.round(Ya(t))
|
|
1908
1908
|
}, Tt = {
|
|
1909
1909
|
test: /* @__PURE__ */ Yn("rgb", "red"),
|
|
@@ -1923,14 +1923,14 @@ const rn = {
|
|
|
1923
1923
|
test: /* @__PURE__ */ Yn("#"),
|
|
1924
1924
|
parse: Xa,
|
|
1925
1925
|
transform: Tt.transform
|
|
1926
|
-
},
|
|
1926
|
+
}, Rt = {
|
|
1927
1927
|
test: /* @__PURE__ */ Yn("hsl", "hue"),
|
|
1928
1928
|
parse: /* @__PURE__ */ yr("hue", "saturation", "lightness"),
|
|
1929
1929
|
transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " + et.transform(Yt(e)) + ", " + et.transform(Yt(n)) + ", " + Yt(te.transform(i)) + ")"
|
|
1930
1930
|
}, W = {
|
|
1931
|
-
test: (t) => Tt.test(t) || rn.test(t) ||
|
|
1932
|
-
parse: (t) => Tt.test(t) ? Tt.parse(t) :
|
|
1933
|
-
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? Tt.transform(t) :
|
|
1931
|
+
test: (t) => Tt.test(t) || rn.test(t) || Rt.test(t),
|
|
1932
|
+
parse: (t) => Tt.test(t) ? Tt.parse(t) : Rt.test(t) ? Rt.parse(t) : rn.parse(t),
|
|
1933
|
+
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? Tt.transform(t) : Rt.transform(t)
|
|
1934
1934
|
}, qa = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
1935
1935
|
function Za(t) {
|
|
1936
1936
|
var e, n;
|
|
@@ -2022,7 +2022,7 @@ function ll(t, e, n) {
|
|
|
2022
2022
|
for (const o of e)
|
|
2023
2023
|
t[o] = Pr(n, s);
|
|
2024
2024
|
}
|
|
2025
|
-
const bi = (t) => t ===
|
|
2025
|
+
const bi = (t) => t === Nt || t === P, Pi = (t, e) => parseFloat(t.split(", ")[e]), wi = (t, e) => (n, { transform: i }) => {
|
|
2026
2026
|
if (i === "none" || !i)
|
|
2027
2027
|
return 0;
|
|
2028
2028
|
const s = i.match(/^matrix3d\((.+)\)$/u);
|
|
@@ -2032,7 +2032,7 @@ const bi = (t) => t === It || t === P, Pi = (t, e) => parseFloat(t.split(", ")[e
|
|
|
2032
2032
|
const o = i.match(/^matrix\((.+)\)$/u);
|
|
2033
2033
|
return o ? Pi(o[1], t) : 0;
|
|
2034
2034
|
}
|
|
2035
|
-
}, cl = /* @__PURE__ */ new Set(["x", "y", "z"]), ul =
|
|
2035
|
+
}, cl = /* @__PURE__ */ new Set(["x", "y", "z"]), ul = It.filter((t) => !cl.has(t));
|
|
2036
2036
|
function hl(t) {
|
|
2037
2037
|
const e = [];
|
|
2038
2038
|
return ul.forEach((n) => {
|
|
@@ -2040,7 +2040,7 @@ function hl(t) {
|
|
|
2040
2040
|
i !== void 0 && (e.push([n, i.get()]), i.set(n.startsWith("scale") ? 1 : 0));
|
|
2041
2041
|
}), e;
|
|
2042
2042
|
}
|
|
2043
|
-
const
|
|
2043
|
+
const Ft = {
|
|
2044
2044
|
// Dimensions
|
|
2045
2045
|
width: ({ x: t }, { paddingLeft: e = "0", paddingRight: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
2046
2046
|
height: ({ y: t }, { paddingTop: e = "0", paddingBottom: n = "0" }) => t.max - t.min - parseFloat(e) - parseFloat(n),
|
|
@@ -2052,8 +2052,8 @@ const Ot = {
|
|
|
2052
2052
|
x: wi(4, 13),
|
|
2053
2053
|
y: wi(5, 14)
|
|
2054
2054
|
};
|
|
2055
|
-
|
|
2056
|
-
|
|
2055
|
+
Ft.translateX = Ft.x;
|
|
2056
|
+
Ft.translateY = Ft.y;
|
|
2057
2057
|
const bt = /* @__PURE__ */ new Set();
|
|
2058
2058
|
let an = !1, ln = !1;
|
|
2059
2059
|
function wr() {
|
|
@@ -2151,7 +2151,7 @@ function Vr(t, e, n = 1) {
|
|
|
2151
2151
|
const Er = (t) => (e) => e.test(t), gl = {
|
|
2152
2152
|
test: (t) => t === "auto",
|
|
2153
2153
|
parse: (t) => t
|
|
2154
|
-
}, Cr = [
|
|
2154
|
+
}, Cr = [Nt, P, et, ut, sa, ia, gl], Si = (t) => Cr.find(Er(t));
|
|
2155
2155
|
class Dr extends qn {
|
|
2156
2156
|
constructor(e, n, i, s, o) {
|
|
2157
2157
|
super(e, n, i, s, o, !0);
|
|
@@ -2190,7 +2190,7 @@ class Dr extends qn {
|
|
|
2190
2190
|
const { element: e, unresolvedKeyframes: n, name: i } = this;
|
|
2191
2191
|
if (!e || !e.current)
|
|
2192
2192
|
return;
|
|
2193
|
-
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin =
|
|
2193
|
+
i === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Ft[i](e.measureViewportBox(), window.getComputedStyle(e.current)), n[0] = this.measuredOrigin;
|
|
2194
2194
|
const s = n[n.length - 1];
|
|
2195
2195
|
s !== void 0 && e.getValue(i, s).jump(s, !1);
|
|
2196
2196
|
}
|
|
@@ -2202,7 +2202,7 @@ class Dr extends qn {
|
|
|
2202
2202
|
const o = n.getValue(i);
|
|
2203
2203
|
o && o.jump(this.measuredOrigin, !1);
|
|
2204
2204
|
const r = s.length - 1, a = s[r];
|
|
2205
|
-
s[r] =
|
|
2205
|
+
s[r] = Ft[i](n.measureViewportBox(), window.getComputedStyle(n.current)), a !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = a), !((e = this.removedTransforms) === null || e === void 0) && e.length && this.removedTransforms.forEach(([l, c]) => {
|
|
2206
2206
|
n.getValue(l).set(c);
|
|
2207
2207
|
}), this.resolveNoneKeyframes();
|
|
2208
2208
|
}
|
|
@@ -2225,7 +2225,7 @@ function vl(t, e, n, i) {
|
|
|
2225
2225
|
if (e === "display" || e === "visibility")
|
|
2226
2226
|
return !0;
|
|
2227
2227
|
const o = t[t.length - 1], r = Ai(s, e), a = Ai(o, e);
|
|
2228
|
-
return
|
|
2228
|
+
return Bt(r === a, `You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`), !r || !a ? !1 : yl(t) || (n === "spring" || Nn(n)) && i;
|
|
2229
2229
|
}
|
|
2230
2230
|
const xl = (t) => t !== null;
|
|
2231
2231
|
function Be(t, { repeat: e, repeatType: n = "loop" }, i) {
|
|
@@ -2333,13 +2333,13 @@ function Se(t, e) {
|
|
|
2333
2333
|
const Ke = (t, e, n) => {
|
|
2334
2334
|
const i = t * t, s = n * (e * e - i) + i;
|
|
2335
2335
|
return s < 0 ? 0 : Math.sqrt(s);
|
|
2336
|
-
}, Pl = [rn, Tt,
|
|
2336
|
+
}, Pl = [rn, Tt, Rt], wl = (t) => Pl.find((e) => e.test(t));
|
|
2337
2337
|
function Vi(t) {
|
|
2338
2338
|
const e = wl(t);
|
|
2339
|
-
if (
|
|
2339
|
+
if (Bt(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
|
|
2340
2340
|
return !1;
|
|
2341
2341
|
let n = e.parse(t);
|
|
2342
|
-
return e ===
|
|
2342
|
+
return e === Rt && (n = bl(n)), n;
|
|
2343
2343
|
}
|
|
2344
2344
|
const Ei = (t, e) => {
|
|
2345
2345
|
const n = Vi(t), i = Vi(e);
|
|
@@ -2386,7 +2386,7 @@ function Cl(t, e) {
|
|
|
2386
2386
|
}
|
|
2387
2387
|
const Dl = (t, e) => {
|
|
2388
2388
|
const n = dt.createTransformer(e), i = ne(t), s = ne(e);
|
|
2389
|
-
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? cn.has(t) && !s.values.length || cn.has(e) && !i.values.length ? Al(t, e) : ce(Mr(Cl(i, s), s.values), n) : (
|
|
2389
|
+
return i.indexes.var.length === s.indexes.var.length && i.indexes.color.length === s.indexes.color.length && i.indexes.number.length >= s.indexes.number.length ? cn.has(t) && !s.values.length || cn.has(e) && !i.values.length ? Al(t, e) : ce(Mr(Cl(i, s), s.values), n) : (Bt(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), Se(t, e));
|
|
2390
2390
|
};
|
|
2391
2391
|
function kr(t, e, n) {
|
|
2392
2392
|
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? j(t, e, n) : Zn(t)(t, e);
|
|
@@ -2427,7 +2427,7 @@ const L = {
|
|
|
2427
2427
|
}, Ci = 1e-3;
|
|
2428
2428
|
function Ml({ duration: t = L.duration, bounce: e = L.bounce, velocity: n = L.velocity, mass: i = L.mass }) {
|
|
2429
2429
|
let s, o;
|
|
2430
|
-
|
|
2430
|
+
Bt(t <= /* @__PURE__ */ tt(L.maxDuration), "Spring duration must be 10 seconds or less");
|
|
2431
2431
|
let r = 1 - e;
|
|
2432
2432
|
r = ot(L.minDamping, L.maxDamping, r), t = ot(L.minDuration, L.maxDuration, /* @__PURE__ */ rt(t)), r < 1 ? (s = (c) => {
|
|
2433
2433
|
const u = c * r, h = u * t, f = u - n, d = un(c, r), g = Math.exp(-h);
|
|
@@ -2629,7 +2629,7 @@ function Ul(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
|
2629
2629
|
if (l > 1)
|
|
2630
2630
|
for (; h < t.length - 2 && !(u < t[h + 1]); h++)
|
|
2631
2631
|
;
|
|
2632
|
-
const f = /* @__PURE__ */
|
|
2632
|
+
const f = /* @__PURE__ */ jt(t[h], t[h + 1], u);
|
|
2633
2633
|
return a[h](f);
|
|
2634
2634
|
};
|
|
2635
2635
|
return n ? (u) => c(ot(t[0], t[o - 1], u)) : c;
|
|
@@ -2637,7 +2637,7 @@ function Ul(t, e, { clamp: n = !0, ease: i, mixer: s } = {}) {
|
|
|
2637
2637
|
function $l(t, e) {
|
|
2638
2638
|
const n = t[t.length - 1];
|
|
2639
2639
|
for (let i = 1; i <= e; i++) {
|
|
2640
|
-
const s = /* @__PURE__ */
|
|
2640
|
+
const s = /* @__PURE__ */ jt(0, e, i);
|
|
2641
2641
|
t.push(j(n, 1, s));
|
|
2642
2642
|
}
|
|
2643
2643
|
}
|
|
@@ -3201,7 +3201,7 @@ function gc(t) {
|
|
|
3201
3201
|
const _ = Array.isArray(b) ? b : [b];
|
|
3202
3202
|
let X = _.reduce(s(y), {});
|
|
3203
3203
|
T === !1 && (X = {});
|
|
3204
|
-
const { prevResolvedValues: pt = {} } = x,
|
|
3204
|
+
const { prevResolvedValues: pt = {} } = x, _t = {
|
|
3205
3205
|
...pt,
|
|
3206
3206
|
...X
|
|
3207
3207
|
}, at = (C) => {
|
|
@@ -3209,7 +3209,7 @@ function gc(t) {
|
|
|
3209
3209
|
const B = t.getValue(C);
|
|
3210
3210
|
B && (B.liveStyle = !1);
|
|
3211
3211
|
};
|
|
3212
|
-
for (const C in
|
|
3212
|
+
for (const C in _t) {
|
|
3213
3213
|
const B = X[C], At = pt[C];
|
|
3214
3214
|
if (d.hasOwnProperty(C))
|
|
3215
3215
|
continue;
|
|
@@ -3487,7 +3487,7 @@ function jc(t, e) {
|
|
|
3487
3487
|
function Oc(t, e) {
|
|
3488
3488
|
let n = 0.5;
|
|
3489
3489
|
const i = Y(t), s = Y(e);
|
|
3490
|
-
return s > i ? n = /* @__PURE__ */
|
|
3490
|
+
return s > i ? n = /* @__PURE__ */ jt(e.min, e.max - i, t.min) : i > s && (n = /* @__PURE__ */ jt(t.min, t.max - s, e.min)), ot(0, 1, n);
|
|
3491
3491
|
}
|
|
3492
3492
|
function Fc(t, e) {
|
|
3493
3493
|
const n = {};
|
|
@@ -3514,7 +3514,7 @@ const Gi = () => ({
|
|
|
3514
3514
|
scale: 1,
|
|
3515
3515
|
origin: 0,
|
|
3516
3516
|
originPoint: 0
|
|
3517
|
-
}),
|
|
3517
|
+
}), Mt = () => ({
|
|
3518
3518
|
x: Gi(),
|
|
3519
3519
|
y: Gi()
|
|
3520
3520
|
}), Ki = () => ({ min: 0, max: 0 }), O = () => ({
|
|
@@ -3582,21 +3582,21 @@ function _c(t, e, n, i = !1) {
|
|
|
3582
3582
|
for (let a = 0; a < s; a++) {
|
|
3583
3583
|
o = n[a], r = o.projectionDelta;
|
|
3584
3584
|
const { visualElement: l } = o.options;
|
|
3585
|
-
l && l.props.style && l.props.style.display === "contents" || (i && o.options.layoutScroll && o.scroll && o !== o.root &&
|
|
3585
|
+
l && l.props.style && l.props.style.display === "contents" || (i && o.options.layoutScroll && o.scroll && o !== o.root && Lt(t, {
|
|
3586
3586
|
x: -o.scroll.offset.x,
|
|
3587
3587
|
y: -o.scroll.offset.y
|
|
3588
|
-
}), r && (e.x *= r.x.scale, e.y *= r.y.scale, Kr(t, r)), i && yt(o.latestValues) &&
|
|
3588
|
+
}), r && (e.x *= r.x.scale, e.y *= r.y.scale, Kr(t, r)), i && yt(o.latestValues) && Lt(t, o.latestValues));
|
|
3589
3589
|
}
|
|
3590
3590
|
e.x < Xi && e.x > Yi && (e.x = 1), e.y < Xi && e.y > Yi && (e.y = 1);
|
|
3591
3591
|
}
|
|
3592
|
-
function
|
|
3592
|
+
function kt(t, e) {
|
|
3593
3593
|
t.min = t.min + e, t.max = t.max + e;
|
|
3594
3594
|
}
|
|
3595
3595
|
function qi(t, e, n, i, s = 0.5) {
|
|
3596
3596
|
const o = j(t.min, t.max, s);
|
|
3597
3597
|
mn(t, e, n, o, i);
|
|
3598
3598
|
}
|
|
3599
|
-
function
|
|
3599
|
+
function Lt(t, e) {
|
|
3600
3600
|
qi(t.x, e.x, e.scaleX, e.scale, e.originX), qi(t.y, e.y, e.scaleY, e.scale, e.originY);
|
|
3601
3601
|
}
|
|
3602
3602
|
function Hr(t, e) {
|
|
@@ -3604,7 +3604,7 @@ function Hr(t, e) {
|
|
|
3604
3604
|
}
|
|
3605
3605
|
function Uc(t, e, n) {
|
|
3606
3606
|
const i = Hr(t, n), { scroll: s } = e;
|
|
3607
|
-
return s && (
|
|
3607
|
+
return s && (kt(i.x, s.offset.x), kt(i.y, s.offset.y)), i;
|
|
3608
3608
|
}
|
|
3609
3609
|
const zr = ({ current: t }) => t ? t.ownerDocument.defaultView : null, $c = /* @__PURE__ */ new WeakMap();
|
|
3610
3610
|
class Wc {
|
|
@@ -3688,13 +3688,13 @@ class Wc {
|
|
|
3688
3688
|
resolveConstraints() {
|
|
3689
3689
|
var e;
|
|
3690
3690
|
const { dragConstraints: n, dragElastic: i } = this.getProps(), s = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (e = this.visualElement.projection) === null || e === void 0 ? void 0 : e.layout, o = this.constraints;
|
|
3691
|
-
n &&
|
|
3691
|
+
n && Dt(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && s ? this.constraints = Lc(s.layoutBox, n) : this.constraints = !1, this.elastic = Bc(i), o !== this.constraints && s && this.constraints && !this.hasMutatedConstraints && Z((r) => {
|
|
3692
3692
|
this.constraints !== !1 && this.getAxisMotionValue(r) && (this.constraints[r] = Fc(s.layoutBox[r], this.constraints[r]));
|
|
3693
3693
|
});
|
|
3694
3694
|
}
|
|
3695
3695
|
resolveRefConstraints() {
|
|
3696
3696
|
const { dragConstraints: e, onMeasureDragConstraints: n } = this.getProps();
|
|
3697
|
-
if (!e || !
|
|
3697
|
+
if (!e || !Dt(e))
|
|
3698
3698
|
return !1;
|
|
3699
3699
|
const i = e.current;
|
|
3700
3700
|
ht(i !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
|
|
@@ -3778,7 +3778,7 @@ class Wc {
|
|
|
3778
3778
|
if (!this.visualElement.current)
|
|
3779
3779
|
return;
|
|
3780
3780
|
const { drag: e, dragConstraints: n } = this.getProps(), { projection: i } = this.visualElement;
|
|
3781
|
-
if (!
|
|
3781
|
+
if (!Dt(n) || !i || !this.constraints)
|
|
3782
3782
|
return;
|
|
3783
3783
|
this.stopAnimation();
|
|
3784
3784
|
const s = { x: 0, y: 0 };
|
|
@@ -3806,7 +3806,7 @@ class Wc {
|
|
|
3806
3806
|
c && u && this.start(l);
|
|
3807
3807
|
}), i = () => {
|
|
3808
3808
|
const { dragConstraints: l } = this.getProps();
|
|
3809
|
-
|
|
3809
|
+
Dt(l) && l.current && (this.constraints = this.resolveRefConstraints());
|
|
3810
3810
|
}, { projection: s } = this.visualElement, o = s.addEventListener("measure", i);
|
|
3811
3811
|
s && !s.layout && (s.root && s.root.updateScroll(), s.updateLayout()), M.read(i);
|
|
3812
3812
|
const r = ie(window, "resize", () => this.scalePositionWithinConstraints()), a = s.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
|
|
@@ -3900,7 +3900,7 @@ const xe = {
|
|
|
3900
3900
|
function Ji(t, e) {
|
|
3901
3901
|
return e.max === e.min ? 0 : t / (e.max - e.min) * 100;
|
|
3902
3902
|
}
|
|
3903
|
-
const
|
|
3903
|
+
const Gt = {
|
|
3904
3904
|
correct: (t, e) => {
|
|
3905
3905
|
if (!e.target)
|
|
3906
3906
|
return t;
|
|
@@ -3969,7 +3969,7 @@ function Yr(t) {
|
|
|
3969
3969
|
}
|
|
3970
3970
|
const Xc = {
|
|
3971
3971
|
borderRadius: {
|
|
3972
|
-
...
|
|
3972
|
+
...Gt,
|
|
3973
3973
|
applyTo: [
|
|
3974
3974
|
"borderTopLeftRadius",
|
|
3975
3975
|
"borderTopRightRadius",
|
|
@@ -3977,10 +3977,10 @@ const Xc = {
|
|
|
3977
3977
|
"borderBottomRightRadius"
|
|
3978
3978
|
]
|
|
3979
3979
|
},
|
|
3980
|
-
borderTopLeftRadius:
|
|
3981
|
-
borderTopRightRadius:
|
|
3982
|
-
borderBottomLeftRadius:
|
|
3983
|
-
borderBottomRightRadius:
|
|
3980
|
+
borderTopLeftRadius: Gt,
|
|
3981
|
+
borderTopRightRadius: Gt,
|
|
3982
|
+
borderBottomLeftRadius: Gt,
|
|
3983
|
+
borderBottomRightRadius: Gt,
|
|
3984
3984
|
boxShadow: zc
|
|
3985
3985
|
};
|
|
3986
3986
|
function qc(t, e, n) {
|
|
@@ -4034,7 +4034,7 @@ function es(t, e) {
|
|
|
4034
4034
|
}
|
|
4035
4035
|
const iu = /* @__PURE__ */ qr(0, 0.5, mr), su = /* @__PURE__ */ qr(0.5, 0.95, H);
|
|
4036
4036
|
function qr(t, e, n) {
|
|
4037
|
-
return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */
|
|
4037
|
+
return (i) => i < t ? 0 : i > e ? 1 : n(/* @__PURE__ */ jt(t, e, i));
|
|
4038
4038
|
}
|
|
4039
4039
|
function ns(t, e) {
|
|
4040
4040
|
t.min = e.min, t.max = e.max;
|
|
@@ -4352,7 +4352,7 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4352
4352
|
const l = a.measureViewportBox();
|
|
4353
4353
|
if (!(((r = this.scroll) === null || r === void 0 ? void 0 : r.wasRoot) || this.path.some(Cu))) {
|
|
4354
4354
|
const { scroll: u } = this.root;
|
|
4355
|
-
u && (
|
|
4355
|
+
u && (kt(l.x, u.offset.x), kt(l.y, u.offset.y));
|
|
4356
4356
|
}
|
|
4357
4357
|
return l;
|
|
4358
4358
|
}
|
|
@@ -4363,7 +4363,7 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4363
4363
|
return l;
|
|
4364
4364
|
for (let c = 0; c < this.path.length; c++) {
|
|
4365
4365
|
const u = this.path[c], { scroll: h, options: f } = u;
|
|
4366
|
-
u !== this.root && h && f.layoutScroll && (h.wasRoot && q(l, r),
|
|
4366
|
+
u !== this.root && h && f.layoutScroll && (h.wasRoot && q(l, r), kt(l.x, h.offset.x), kt(l.y, h.offset.y));
|
|
4367
4367
|
}
|
|
4368
4368
|
return l;
|
|
4369
4369
|
}
|
|
@@ -4372,12 +4372,12 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4372
4372
|
q(l, r);
|
|
4373
4373
|
for (let c = 0; c < this.path.length; c++) {
|
|
4374
4374
|
const u = this.path[c];
|
|
4375
|
-
!a && u.options.layoutScroll && u.scroll && u !== u.root &&
|
|
4375
|
+
!a && u.options.layoutScroll && u.scroll && u !== u.root && Lt(l, {
|
|
4376
4376
|
x: -u.scroll.offset.x,
|
|
4377
4377
|
y: -u.scroll.offset.y
|
|
4378
|
-
}), yt(u.latestValues) &&
|
|
4378
|
+
}), yt(u.latestValues) && Lt(l, u.latestValues);
|
|
4379
4379
|
}
|
|
4380
|
-
return yt(this.latestValues) &&
|
|
4380
|
+
return yt(this.latestValues) && Lt(l, this.latestValues), l;
|
|
4381
4381
|
}
|
|
4382
4382
|
removeTransform(r) {
|
|
4383
4383
|
const a = O();
|
|
@@ -4472,10 +4472,10 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4472
4472
|
this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
|
|
4473
4473
|
}
|
|
4474
4474
|
createProjectionDeltas() {
|
|
4475
|
-
this.prevProjectionDelta =
|
|
4475
|
+
this.prevProjectionDelta = Mt(), this.projectionDelta = Mt(), this.projectionDeltaWithTransform = Mt();
|
|
4476
4476
|
}
|
|
4477
4477
|
setAnimationOrigin(r, a = !1) {
|
|
4478
|
-
const l = this.snapshot, c = l ? l.latestValues : {}, u = { ...this.latestValues }, h =
|
|
4478
|
+
const l = this.snapshot, c = l ? l.latestValues : {}, u = { ...this.latestValues }, h = Mt();
|
|
4479
4479
|
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !a;
|
|
4480
4480
|
const f = O(), d = l ? l.source : void 0, g = this.layout ? this.layout.source : void 0, p = d !== g, v = this.getStack(), y = !v || v.members.length <= 1, x = !!(p && !y && this.options.crossfade === !0 && !this.path.some(Au));
|
|
4481
4481
|
this.animationProgress = 0;
|
|
@@ -4517,7 +4517,7 @@ function to({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4517
4517
|
const f = Y(this.layout.layoutBox.y);
|
|
4518
4518
|
l.y.min = r.target.y.min, l.y.max = l.y.min + f;
|
|
4519
4519
|
}
|
|
4520
|
-
q(a, l),
|
|
4520
|
+
q(a, l), Lt(a, u), qt(this.projectionDeltaWithTransform, this.layoutCorrected, a, u);
|
|
4521
4521
|
}
|
|
4522
4522
|
}
|
|
4523
4523
|
registerSharedNode(r, a) {
|
|
@@ -4632,9 +4632,9 @@ function mu(t) {
|
|
|
4632
4632
|
const f = r ? n.measuredBox[h] : n.layoutBox[h], d = Y(i[h]);
|
|
4633
4633
|
f.max = f.min + d, t.relativeTarget && !t.currentAnimation && (t.isProjectionDirty = !0, t.relativeTarget[h].max = t.relativeTarget[h].min + d);
|
|
4634
4634
|
});
|
|
4635
|
-
const a =
|
|
4635
|
+
const a = Mt();
|
|
4636
4636
|
qt(a, i, n.layoutBox);
|
|
4637
|
-
const l =
|
|
4637
|
+
const l = Mt();
|
|
4638
4638
|
r ? qt(l, t.applyTransform(s, !0), n.measuredBox) : qt(l, i, n.layoutBox);
|
|
4639
4639
|
const c = !Zr(a);
|
|
4640
4640
|
let u = !1;
|
|
@@ -4980,8 +4980,8 @@ class zu {
|
|
|
4980
4980
|
}
|
|
4981
4981
|
updateFeatures() {
|
|
4982
4982
|
let e = "animation";
|
|
4983
|
-
for (e in
|
|
4984
|
-
const n =
|
|
4983
|
+
for (e in Ot) {
|
|
4984
|
+
const n = Ot[e];
|
|
4985
4985
|
if (!n)
|
|
4986
4986
|
continue;
|
|
4987
4987
|
const { isEnabled: i, Feature: s } = n;
|
|
@@ -5316,8 +5316,8 @@ const mh = (t, e, n, i) => {
|
|
|
5316
5316
|
const r = o.getBoundingClientRect(), a = s.getBoundingClientRect(), l = window.innerHeight, c = window.innerWidth, u = window.pageYOffset || document.documentElement.scrollTop, h = window.pageXOffset || document.documentElement.scrollLeft, f = 8, d = a.top - f, g = l - a.bottom - f;
|
|
5317
5317
|
let p = (i == null ? void 0 : i.vertical) ?? (g >= d ? it.bottom : it.top), v = p === it.bottom ? g : d;
|
|
5318
5318
|
const y = r.width, x = a.left + y < c, b = a.right - y > 0;
|
|
5319
|
-
let w = (i == null ? void 0 : i.horizontal) ??
|
|
5320
|
-
!x && b ? w =
|
|
5319
|
+
let w = (i == null ? void 0 : i.horizontal) ?? Et.left;
|
|
5320
|
+
!x && b ? w = Et.right : !x && !b && (w = Et.left), n(p), o.style.top = p === it.bottom ? `${a.bottom + u}px` : `${a.top + u - v}px`, o.style.left = w === Et.left ? `${a.left + h}px` : w === Et.center ? `${a.left + h + (a.width - y) / 2}px` : `${a.right + h - y}px`, o.style.minWidth = `${a.width}px`, o.style.height = `${v}px`, o.style.transformOrigin = p === it.bottom ? "top" : "bottom", o.style.flexDirection = p === it.bottom ? "column" : "column-reverse";
|
|
5321
5321
|
}, ph = ({
|
|
5322
5322
|
children: t,
|
|
5323
5323
|
isDebug: e = !1,
|
|
@@ -5412,7 +5412,7 @@ const mh = (t, e, n, i) => {
|
|
|
5412
5412
|
function wh(t, e, n) {
|
|
5413
5413
|
const i = t;
|
|
5414
5414
|
return Re((o, r) => {
|
|
5415
|
-
const [a, l] =
|
|
5415
|
+
const [a, l] = Ct(!1), [c, u] = Ct(!1), [h, f] = Ct(it.bottom), [d, g] = Ct(), p = K(null), v = K(null), y = K(null), x = K(d), b = (n == null ? void 0 : n.isEnableClickOutSiteHidden) !== !1, w = (n == null ? void 0 : n.isEnableHideSave) !== !1, T = n == null ? void 0 : n.isVisibleMask;
|
|
5416
5416
|
st(() => {
|
|
5417
5417
|
g(o.value);
|
|
5418
5418
|
}, [JSON.stringify(o.value)]), st(() => {
|
|
@@ -5455,7 +5455,7 @@ function wh(t, e, n) {
|
|
|
5455
5455
|
}), !R));
|
|
5456
5456
|
}, []), pt = z((R) => {
|
|
5457
5457
|
!p.current && y.current && !y.current.contains(R.target) && u(!1);
|
|
5458
|
-
}, []),
|
|
5458
|
+
}, []), _t = z((R) => {
|
|
5459
5459
|
var B;
|
|
5460
5460
|
const C = (B = p.current) == null ? void 0 : B.firstChild;
|
|
5461
5461
|
C && !C.contains(R.target) && y.current && !y.current.contains(R.target) && (l(!1), u(!1));
|
|
@@ -5465,7 +5465,7 @@ function wh(t, e, n) {
|
|
|
5465
5465
|
return;
|
|
5466
5466
|
}
|
|
5467
5467
|
typeof x.current < "u" && w && JSON.stringify(d) !== JSON.stringify(x.current) && o.onChange(x.current);
|
|
5468
|
-
}, [d, o.onChange, w]),
|
|
5468
|
+
}, [d, o.onChange, w]), Ut = () => n != null && n.isDisabledAutoPosition ? /* @__PURE__ */ E.jsx(
|
|
5469
5469
|
vh,
|
|
5470
5470
|
{
|
|
5471
5471
|
ref: p,
|
|
@@ -5524,11 +5524,11 @@ function wh(t, e, n) {
|
|
|
5524
5524
|
{
|
|
5525
5525
|
id: `acrool-react-picker-${oh().toLowerCase()}`,
|
|
5526
5526
|
className: Vs.pickerEl,
|
|
5527
|
-
children:
|
|
5527
|
+
children: Ut()
|
|
5528
5528
|
}
|
|
5529
5529
|
) }),
|
|
5530
5530
|
a && /* @__PURE__ */ E.jsx(ah, { onPickerHide: at }),
|
|
5531
|
-
b && a && /* @__PURE__ */ E.jsx(As, { onMousedown:
|
|
5531
|
+
b && a && /* @__PURE__ */ E.jsx(As, { onMousedown: _t }),
|
|
5532
5532
|
c && /* @__PURE__ */ E.jsx(As, { onMousedown: pt })
|
|
5533
5533
|
] })
|
|
5534
5534
|
}
|
|
@@ -5536,7 +5536,7 @@ function wh(t, e, n) {
|
|
|
5536
5536
|
});
|
|
5537
5537
|
}
|
|
5538
5538
|
export {
|
|
5539
|
-
|
|
5539
|
+
Et as EHorizontal,
|
|
5540
5540
|
it as EVertical,
|
|
5541
5541
|
bh as PickerProviderConsumer,
|
|
5542
5542
|
xn as PickerProviderContext,
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acrool/react-picker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "This is a react method to quickly combine buttons with Picker",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"acrool",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"portal"
|
|
11
11
|
],
|
|
12
12
|
"author": "info@acrool.com",
|
|
13
|
-
"private": false,
|
|
14
13
|
"type": "module",
|
|
15
14
|
"license": "MIT",
|
|
16
15
|
"repository": {
|
|
@@ -54,11 +53,11 @@
|
|
|
54
53
|
"react-dom": ">=18.0.0 <20.0.0"
|
|
55
54
|
},
|
|
56
55
|
"dependencies": {
|
|
57
|
-
"@acrool/react-portal": "^1.1.2",
|
|
58
56
|
"@acrool/js-logger": "^1.0.26",
|
|
57
|
+
"@acrool/react-portal": "^1.1.2",
|
|
59
58
|
"clsx": "^2.1.1",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
59
|
+
"framer-motion": "^11.18.2",
|
|
60
|
+
"ulid": "^2.3.0"
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|
|
64
63
|
"@stylistic/eslint-plugin-ts": "^3.0.1",
|