@acrool/react-picker 0.0.2-alpha.1 → 0.0.2-alpha.3

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.
@@ -1,5 +1,5 @@
1
1
  import * as An from "react";
2
- import $s, { createContext as Rt, useContext as U, useLayoutEffect as Ho, useEffect as Vt, useRef as it, useInsertionEffect as Ks, useCallback as pt, useMemo as Ct, forwardRef as Gs, Fragment as zs, createElement as Yo, useId as Cn, Component as Xo, Children as qo, isValidElement as Zo, useState as Jt } from "react";
2
+ import $s, { createContext as Vt, useContext as U, useLayoutEffect as Ho, useEffect as Et, useRef as it, useInsertionEffect as Ks, useCallback as pt, useMemo as Rt, forwardRef as Gs, Fragment as zs, createElement as Yo, useId as Cn, Component as Xo, Children as qo, isValidElement as Zo, useState as Jt } from "react";
3
3
  var jt = /* @__PURE__ */ ((t) => (t.Escape = "Escape", t.Enter = "Enter", t.Tab = "Tab", t.ArrowUp = "ArrowUp", t.ArrowDown = "ArrowDown", t))(jt || {});
4
4
  const le = [
5
5
  "color: #fff",
@@ -48,21 +48,21 @@ function na(t, ...e) {
48
48
  ]).join(";");
49
49
  ce(t, n, ...e);
50
50
  }
51
- const Lt = {
51
+ const bt = {
52
52
  primary: Jo,
53
53
  success: Qo,
54
54
  info: ta,
55
55
  warning: ea,
56
56
  danger: na
57
- }, Rn = Rt({
58
- hide: () => Lt.warning("No hide method detected, did you embed your app with Acrool/PickerPortal?"),
59
- show: () => Lt.warning("No show method detected, did you embed your app with Acrool/PickerPortal?"),
60
- toggle: () => Lt.warning("No toggle method detected, did you embed your app with Acrool/PickerPortal?"),
57
+ }, Rn = Vt({
58
+ hide: () => bt.warning("No hide method detected, did you embed your app with Acrool/PickerPortal?"),
59
+ show: () => bt.warning("No show method detected, did you embed your app with Acrool/PickerPortal?"),
60
+ toggle: () => bt.warning("No toggle method detected, did you embed your app with Acrool/PickerPortal?"),
61
61
  isVisible: !1,
62
- inputFocus: () => Lt.warning("No focus method detected, did you embed your app with Acrool/PickerPortal?"),
63
- inputBlur: () => Lt.warning("No blur method detected, did you embed your app with Acrool/PickerPortal?"),
62
+ inputFocus: () => bt.warning("No focus method detected, did you embed your app with Acrool/PickerPortal?"),
63
+ inputBlur: () => bt.warning("No blur method detected, did you embed your app with Acrool/PickerPortal?"),
64
64
  isInputFocus: !1,
65
- onChange: () => Lt.warning("No onChange method detected, did you embed your app with Acrool/PickerPortal?")
65
+ onChange: () => bt.warning("No onChange method detected, did you embed your app with Acrool/PickerPortal?")
66
66
  }), Uh = Rn.Consumer, Wh = () => U(Rn);
67
67
  var cn = { exports: {} }, Ht = {};
68
68
  /**
@@ -194,14 +194,14 @@ function sa() {
194
194
  }
195
195
  return null;
196
196
  }
197
- var nt = Object.assign, F = 0, J, Et, Dt, ni, ii, si, ri;
197
+ var nt = Object.assign, F = 0, J, Dt, Mt, ni, ii, si, ri;
198
198
  function oi() {
199
199
  }
200
200
  oi.__reactDisabledLog = !0;
201
201
  function xo() {
202
202
  {
203
203
  if (F === 0) {
204
- J = console.log, Et = console.info, Dt = console.warn, ni = console.error, ii = console.group, si = console.groupCollapsed, ri = console.groupEnd;
204
+ J = console.log, Dt = console.info, Mt = console.warn, ni = console.error, ii = console.group, si = console.groupCollapsed, ri = console.groupEnd;
205
205
  var f = {
206
206
  configurable: !0,
207
207
  enumerable: !0,
@@ -234,10 +234,10 @@ function sa() {
234
234
  value: J
235
235
  }),
236
236
  info: nt({}, f, {
237
- value: Et
237
+ value: Dt
238
238
  }),
239
239
  warn: nt({}, f, {
240
- value: Dt
240
+ value: Mt
241
241
  }),
242
242
  error: nt({}, f, {
243
243
  value: ni
@@ -343,7 +343,7 @@ function sa() {
343
343
  } finally {
344
344
  $e = !1, Ue.current = k, To(), Error.prepareStackTrace = D;
345
345
  }
346
- var kt = f ? f.displayName || f.name : "", xt = kt ? me(kt) : "";
346
+ var Lt = f ? f.displayName || f.name : "", xt = Lt ? me(Lt) : "";
347
347
  return typeof f == "function" && ge.set(f, xt), xt;
348
348
  }
349
349
  function wo(f, m, T) {
@@ -532,7 +532,7 @@ function sa() {
532
532
  }
533
533
  }
534
534
  var ze = x.ReactCurrentOwner, pi = x.ReactDebugCurrentFrame;
535
- function Mt(f) {
535
+ function kt(f) {
536
536
  if (f) {
537
537
  var m = f._owner, T = ye(f.type, f._source, m ? m.type : null);
538
538
  pi.setExtraStackFrame(T);
@@ -590,7 +590,7 @@ Check the top-level render call using <` + T + ">.");
590
590
  return;
591
591
  gi[T] = !0;
592
592
  var A = "";
593
- f && f._owner && f._owner !== ze.current && (A = " It was passed a child from " + Z(f._owner.type) + "."), Mt(f), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, A), Mt(null);
593
+ f && f._owner && f._owner !== ze.current && (A = " It was passed a child from " + Z(f._owner.type) + "."), kt(f), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', T, A), kt(null);
594
594
  }
595
595
  }
596
596
  function vi(f, m) {
@@ -642,11 +642,11 @@ Check the top-level render call using <` + T + ">.");
642
642
  for (var m = Object.keys(f.props), T = 0; T < m.length; T++) {
643
643
  var A = m[T];
644
644
  if (A !== "children" && A !== "key") {
645
- Mt(f), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", A), Mt(null);
645
+ kt(f), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", A), kt(null);
646
646
  break;
647
647
  }
648
648
  }
649
- f.ref !== null && (Mt(f), v("Invalid attribute `ref` supplied to `React.Fragment`."), Mt(null));
649
+ f.ref !== null && (kt(f), v("Invalid attribute `ref` supplied to `React.Fragment`."), kt(null));
650
650
  }
651
651
  }
652
652
  var Pi = {};
@@ -669,8 +669,8 @@ Check the top-level render call using <` + T + ">.");
669
669
  if (Q !== void 0)
670
670
  if (A)
671
671
  if (Ke(Q)) {
672
- for (var kt = 0; kt < Q.length; kt++)
673
- vi(Q[kt], f);
672
+ for (var Lt = 0; Lt < Q.length; Lt++)
673
+ vi(Q[Lt], f);
674
674
  Object.freeze && Object.freeze(Q);
675
675
  } else
676
676
  v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
@@ -706,11 +706,11 @@ React keys must be passed directly to JSX without using spread:
706
706
  }
707
707
  process.env.NODE_ENV === "production" ? cn.exports = ia() : cn.exports = sa();
708
708
  var O = cn.exports;
709
- const Vn = Rt({
709
+ const Vn = Vt({
710
710
  transformPagePoint: (t) => t,
711
711
  isStatic: !1,
712
712
  reducedMotion: "never"
713
- }), ke = Rt({}), Le = Rt(null), En = typeof window < "u", Hs = En ? Ho : Vt, Ys = Rt({ strict: !1 }), je = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), ra = "framerAppearId", Xs = "data-" + je(ra), oa = {
713
+ }), ke = Vt({}), Le = Vt(null), En = typeof window < "u", Hs = En ? Ho : Et, Ys = Vt({ strict: !1 }), je = (t) => t.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), ra = "framerAppearId", Xs = "data-" + je(ra), oa = {
714
714
  skipAnimations: !1,
715
715
  useManualTiming: !1
716
716
  };
@@ -790,7 +790,7 @@ const { schedule: Dn, cancel: $h } = qs(queueMicrotask, !1);
790
790
  function Ot(t) {
791
791
  return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "current");
792
792
  }
793
- const Zs = Rt({});
793
+ const Zs = Vt({});
794
794
  let wi = !1;
795
795
  function ua(t, e, n, i, s) {
796
796
  const { visualElement: o } = U(ke), r = U(Ys), a = U(Le), l = U(Vn).reducedMotion, u = it();
@@ -809,7 +809,7 @@ function ua(t, e, n, i, s) {
809
809
  const d = it(!!(n[Xs] && !window.HandoffComplete));
810
810
  return Hs(() => {
811
811
  c && (c.updateFeatures(), Dn.render(c.render), d.current && c.animationState && c.animationState.animateChanges());
812
- }), Vt(() => {
812
+ }), Et(() => {
813
813
  c && (!d.current && c.animationState && c.animationState.animateChanges(), d.current && (d.current = !1, wi || (wi = !0, queueMicrotask(ca))));
814
814
  }), c;
815
815
  }
@@ -886,7 +886,7 @@ function da(t, e) {
886
886
  }
887
887
  function pa(t) {
888
888
  const { initial: e, animate: n } = da(t, U(ke));
889
- return Ct(() => ({ initial: e, animate: n }), [Si(e), Si(n)]);
889
+ return Rt(() => ({ initial: e, animate: n }), [Si(e), Si(n)]);
890
890
  }
891
891
  function Si(t) {
892
892
  return Array.isArray(t) ? t.join(" ") : t;
@@ -922,7 +922,7 @@ function ma(t) {
922
922
  ...t[e]
923
923
  };
924
924
  }
925
- const Ln = Rt({}), ga = Symbol.for("motionComponentSymbol"), W = (t) => t;
925
+ const Ln = Vt({}), ga = Symbol.for("motionComponentSymbol"), W = (t) => t;
926
926
  let Wt = W, ct = W;
927
927
  process.env.NODE_ENV !== "production" && (Wt = (t, e) => {
928
928
  !t && typeof console < "u" && console.warn(e);
@@ -1205,7 +1205,7 @@ function sr(t, e, n) {
1205
1205
  !K(e[i]) && !tr(i, n) && (t[i] = e[i]);
1206
1206
  }
1207
1207
  function Oa({ transformTemplate: t }, e) {
1208
- return Ct(() => {
1208
+ return Rt(() => {
1209
1209
  const n = Bn();
1210
1210
  return _n(n, e, t), Object.assign({}, n.vars, n.style);
1211
1211
  }, [e]);
@@ -1314,7 +1314,7 @@ const or = () => ({
1314
1314
  attrs: {}
1315
1315
  }), Nn = (t) => typeof t == "string" && t.toLowerCase() === "svg";
1316
1316
  function Ga(t, e, n, i) {
1317
- const s = Ct(() => {
1317
+ const s = Rt(() => {
1318
1318
  const o = or();
1319
1319
  return In(o, e, Nn(i), t.transformTemplate), {
1320
1320
  ...o.attrs,
@@ -1329,7 +1329,7 @@ function Ga(t, e, n, i) {
1329
1329
  }
1330
1330
  function za(t = !1) {
1331
1331
  return (n, i, s, { latestValues: o }, r) => {
1332
- const l = (jn(n) ? Ga : _a)(i, o, r, n), u = Na(i, typeof n == "string", t), c = n !== zs ? { ...u, ...l, ref: s } : {}, { children: h } = i, d = Ct(() => K(h) ? h.get() : h, [h]);
1332
+ const l = (jn(n) ? Ga : _a)(i, o, r, n), u = Na(i, typeof n == "string", t), c = n !== zs ? { ...u, ...l, ref: s } : {}, { children: h } = i, d = Rt(() => K(h) ? h.get() : h, [h]);
1333
1333
  return Yo(n, {
1334
1334
  ...c,
1335
1335
  children: d
@@ -1883,11 +1883,11 @@ Ut.translateY = Ut.y;
1883
1883
  const wr = (t) => (e) => e.test(t), Dl = {
1884
1884
  test: (t) => t === "auto",
1885
1885
  parse: (t) => t
1886
- }, Sr = [$t, w, st, dt, ja, La, Dl], _i = (t) => Sr.find(wr(t)), At = /* @__PURE__ */ new Set();
1886
+ }, Sr = [$t, w, st, dt, ja, La, Dl], _i = (t) => Sr.find(wr(t)), Ct = /* @__PURE__ */ new Set();
1887
1887
  let dn = !1, pn = !1;
1888
1888
  function Ar() {
1889
1889
  if (pn) {
1890
- const t = Array.from(At).filter((i) => i.needsMeasurement), e = new Set(t.map((i) => i.element)), n = /* @__PURE__ */ new Map();
1890
+ const t = Array.from(Ct).filter((i) => i.needsMeasurement), e = new Set(t.map((i) => i.element)), n = /* @__PURE__ */ new Map();
1891
1891
  e.forEach((i) => {
1892
1892
  const s = El(i);
1893
1893
  s.length && (n.set(i, s), i.render());
@@ -1902,10 +1902,10 @@ function Ar() {
1902
1902
  i.suspendedScrollY !== void 0 && window.scrollTo(0, i.suspendedScrollY);
1903
1903
  });
1904
1904
  }
1905
- pn = !1, dn = !1, At.forEach((t) => t.complete()), At.clear();
1905
+ pn = !1, dn = !1, Ct.forEach((t) => t.complete()), Ct.clear();
1906
1906
  }
1907
1907
  function Cr() {
1908
- At.forEach((t) => {
1908
+ Ct.forEach((t) => {
1909
1909
  t.readKeyframes(), t.needsMeasurement && (pn = !0);
1910
1910
  });
1911
1911
  }
@@ -1917,7 +1917,7 @@ class Gn {
1917
1917
  this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...e], this.onComplete = n, this.name = i, this.motionValue = s, this.element = o, this.isAsync = r;
1918
1918
  }
1919
1919
  scheduleResolve() {
1920
- this.isScheduled = !0, this.isAsync ? (At.add(this), dn || (dn = !0, M.read(Cr), M.resolveKeyframes(Ar))) : (this.readKeyframes(), this.complete());
1920
+ this.isScheduled = !0, this.isAsync ? (Ct.add(this), dn || (dn = !0, M.read(Cr), M.resolveKeyframes(Ar))) : (this.readKeyframes(), this.complete());
1921
1921
  }
1922
1922
  readKeyframes() {
1923
1923
  const { unresolvedKeyframes: e, name: n, element: i, motionValue: s } = this;
@@ -1944,10 +1944,10 @@ class Gn {
1944
1944
  measureEndState() {
1945
1945
  }
1946
1946
  complete() {
1947
- this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), At.delete(this);
1947
+ this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), Ct.delete(this);
1948
1948
  }
1949
1949
  cancel() {
1950
- this.isComplete || (this.isScheduled = !1, At.delete(this));
1950
+ this.isComplete || (this.isScheduled = !1, Ct.delete(this));
1951
1951
  }
1952
1952
  resume() {
1953
1953
  this.isComplete || this.scheduleResolve();
@@ -1966,7 +1966,7 @@ const zn = (t, e) => (n) => !!(fe(n) && Ma.test(n) && n.startsWith(t) || e && !k
1966
1966
  }, kl = (t) => gt(0, 255, t), Qe = {
1967
1967
  ...$t,
1968
1968
  transform: (t) => Math.round(kl(t))
1969
- }, St = {
1969
+ }, At = {
1970
1970
  test: zn("rgb", "red"),
1971
1971
  parse: Rr("red", "green", "blue"),
1972
1972
  transform: ({ red: t, green: e, blue: n, alpha: i = 1 }) => "rgba(" + Qe.transform(t) + ", " + Qe.transform(e) + ", " + Qe.transform(n) + ", " + te(Qt.transform(i)) + ")"
@@ -1983,15 +1983,15 @@ function Ll(t) {
1983
1983
  const mn = {
1984
1984
  test: zn("#"),
1985
1985
  parse: Ll,
1986
- transform: St.transform
1986
+ transform: At.transform
1987
1987
  }, Ft = {
1988
1988
  test: zn("hsl", "hue"),
1989
1989
  parse: Rr("hue", "saturation", "lightness"),
1990
1990
  transform: ({ hue: t, saturation: e, lightness: n, alpha: i = 1 }) => "hsla(" + Math.round(t) + ", " + st.transform(te(e)) + ", " + st.transform(te(n)) + ", " + te(Qt.transform(i)) + ")"
1991
1991
  }, $ = {
1992
- test: (t) => St.test(t) || mn.test(t) || Ft.test(t),
1993
- parse: (t) => St.test(t) ? St.parse(t) : Ft.test(t) ? Ft.parse(t) : mn.parse(t),
1994
- transform: (t) => fe(t) ? t : t.hasOwnProperty("red") ? St.transform(t) : Ft.transform(t)
1992
+ test: (t) => At.test(t) || mn.test(t) || Ft.test(t),
1993
+ parse: (t) => At.test(t) ? At.parse(t) : Ft.test(t) ? Ft.parse(t) : mn.parse(t),
1994
+ transform: (t) => fe(t) ? t : t.hasOwnProperty("red") ? At.transform(t) : Ft.transform(t)
1995
1995
  };
1996
1996
  function jl(t) {
1997
1997
  var e, n;
@@ -2428,7 +2428,7 @@ function Ve(t, e) {
2428
2428
  const nn = (t, e, n) => {
2429
2429
  const i = t * t, s = n * (e * e - i) + i;
2430
2430
  return s < 0 ? 0 : Math.sqrt(s);
2431
- }, pu = [mn, St, Ft], mu = (t) => pu.find((e) => e.test(t));
2431
+ }, pu = [mn, At, Ft], mu = (t) => pu.find((e) => e.test(t));
2432
2432
  function Gi(t) {
2433
2433
  const e = mu(t);
2434
2434
  if (Wt(!!e, `'${t}' is not an animatable color. Use the equivalent color code instead.`), !e)
@@ -2441,7 +2441,7 @@ const zi = (t, e) => {
2441
2441
  if (!n || !i)
2442
2442
  return Ve(t, e);
2443
2443
  const s = { ...n };
2444
- return (o) => (s.red = nn(n.red, i.red, o), s.green = nn(n.green, i.green, o), s.blue = nn(n.blue, i.blue, o), s.alpha = j(n.alpha, i.alpha, o), St.transform(s));
2444
+ return (o) => (s.red = nn(n.red, i.red, o), s.green = nn(n.green, i.green, o), s.blue = nn(n.blue, i.blue, o), s.alpha = j(n.alpha, i.alpha, o), At.transform(s));
2445
2445
  }, vn = /* @__PURE__ */ new Set(["none", "hidden"]);
2446
2446
  function gu(t, e) {
2447
2447
  return vn.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
@@ -3409,11 +3409,11 @@ function Ju(t) {
3409
3409
  J && (J.liveStyle = !1);
3410
3410
  };
3411
3411
  for (const F in Z) {
3412
- const J = ft[F], Et = Kt[F];
3412
+ const J = ft[F], Dt = Kt[F];
3413
3413
  if (p.hasOwnProperty(F))
3414
3414
  continue;
3415
- let Dt = !1;
3416
- hn(J) && hn(Et) ? Dt = !Pr(J, Et) : Dt = J !== Et, Dt ? J != null ? nt(F) : d.add(F) : J !== void 0 && d.has(F) ? nt(F) : v.protectedKeys[F] = !0;
3415
+ let Mt = !1;
3416
+ hn(J) && hn(Dt) ? Mt = !Pr(J, Dt) : Mt = J !== Dt, Mt ? J != null ? nt(F) : d.add(F) : J !== void 0 && d.has(F) ? nt(F) : v.protectedKeys[F] = !0;
3417
3417
  }
3418
3418
  v.prevProp = g, v.prevResolvedValues = ft, v.isActive && (p = { ...p, ...ft }), i && t.blockInitialAnimation && (V = !1), V && (!L || G) && h.push(...H.map((F) => ({
3419
3419
  animation: F,
@@ -3726,7 +3726,7 @@ function on(t) {
3726
3726
  function bn({ scale: t, scaleX: e, scaleY: n }) {
3727
3727
  return !on(t) || !on(e) || !on(n);
3728
3728
  }
3729
- function bt(t) {
3729
+ function wt(t) {
3730
3730
  return bn(t) || so(t) || t.z || t.rotate || t.rotateX || t.rotateY || t.skewX || t.skewY;
3731
3731
  }
3732
3732
  function so(t) {
@@ -3761,7 +3761,7 @@ function Tc(t, e, n, i = !1) {
3761
3761
  l && l.props.style && l.props.style.display === "contents" || (i && o.options.layoutScroll && o.scroll && o !== o.root && It(t, {
3762
3762
  x: -o.scroll.offset.x,
3763
3763
  y: -o.scroll.offset.y
3764
- }), r && (e.x *= r.x.scale, e.y *= r.y.scale, ro(t, r)), i && bt(o.latestValues) && It(t, o.latestValues));
3764
+ }), r && (e.x *= r.x.scale, e.y *= r.y.scale, ro(t, r)), i && wt(o.latestValues) && It(t, o.latestValues));
3765
3765
  }
3766
3766
  e.x < fs && e.x > hs && (e.x = 1), e.y < fs && e.y > hs && (e.y = 1);
3767
3767
  }
@@ -4069,7 +4069,7 @@ function Vc() {
4069
4069
  if (t === null)
4070
4070
  return [!0, null];
4071
4071
  const { isPresent: e, onExitComplete: n, register: i } = t, s = Cn();
4072
- Vt(() => i(s), []);
4072
+ Et(() => i(s), []);
4073
4073
  const o = pt(() => n && n(s), [s, n]);
4074
4074
  return !e && n ? [!1, o] : [!0];
4075
4075
  }
@@ -4336,7 +4336,7 @@ function zc(t, e, n) {
4336
4336
  const i = K(t) ? t : ae(t);
4337
4337
  return i.start(Qn("", i, e, n)), i.animation;
4338
4338
  }
4339
- const wt = {
4339
+ const St = {
4340
4340
  type: "projectionFrame",
4341
4341
  totalNodes: 0,
4342
4342
  resolvedTargetDeltas: 0,
@@ -4359,7 +4359,7 @@ function mo({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4359
4359
  this.id = Yc++, this.animationId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
4360
4360
  this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
4361
4361
  }, this.updateProjection = () => {
4362
- this.projectionUpdateScheduled = !1, Zt && (wt.totalNodes = wt.resolvedTargetDeltas = wt.recalculatedProjection = 0), this.nodes.forEach(Zc), this.nodes.forEach(nh), this.nodes.forEach(ih), this.nodes.forEach(Jc), Zt && window.MotionDebug.record(wt);
4362
+ this.projectionUpdateScheduled = !1, Zt && (St.totalNodes = St.resolvedTargetDeltas = St.recalculatedProjection = 0), this.nodes.forEach(Zc), this.nodes.forEach(nh), this.nodes.forEach(ih), this.nodes.forEach(Jc), Zt && window.MotionDebug.record(St);
4363
4363
  }, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = r, this.root = a ? a.root || a : this, this.path = a ? [...a.path, a] : [], this.parent = a, this.depth = a ? a.depth + 1 : 0;
4364
4364
  for (let l = 0; l < this.path.length; l++)
4365
4365
  this.path[l].shouldResetTransform = !0;
@@ -4510,7 +4510,7 @@ function mo({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4510
4510
  if (!s)
4511
4511
  return;
4512
4512
  const r = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, a = this.projectionDelta && !ho(this.projectionDelta), l = this.getTransformTemplate(), u = l ? l(this.latestValues, "") : void 0, c = u !== this.prevTransformTemplateValue;
4513
- r && (a || bt(this.latestValues) || c) && (s(this.instance, u), this.shouldResetTransform = !1, this.scheduleRender());
4513
+ r && (a || wt(this.latestValues) || c) && (s(this.instance, u), this.shouldResetTransform = !1, this.scheduleRender());
4514
4514
  }
4515
4515
  measure(r = !0) {
4516
4516
  const a = this.measurePageBox();
@@ -4554,22 +4554,22 @@ function mo({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4554
4554
  !a && c.options.layoutScroll && c.scroll && c !== c.root && It(l, {
4555
4555
  x: -c.scroll.offset.x,
4556
4556
  y: -c.scroll.offset.y
4557
- }), bt(c.latestValues) && It(l, c.latestValues);
4557
+ }), wt(c.latestValues) && It(l, c.latestValues);
4558
4558
  }
4559
- return bt(this.latestValues) && It(l, this.latestValues), l;
4559
+ return wt(this.latestValues) && It(l, this.latestValues), l;
4560
4560
  }
4561
4561
  removeTransform(r) {
4562
4562
  const a = B();
4563
4563
  tt(a, r);
4564
4564
  for (let l = 0; l < this.path.length; l++) {
4565
4565
  const u = this.path[l];
4566
- if (!u.instance || !bt(u.latestValues))
4566
+ if (!u.instance || !wt(u.latestValues))
4567
4567
  continue;
4568
4568
  bn(u.latestValues) && u.updateSnapshot();
4569
4569
  const c = B(), h = u.measurePageBox();
4570
4570
  tt(c, h), ws(a, u.latestValues, u.snapshot ? u.snapshot.layoutBox : void 0, c);
4571
4571
  }
4572
- return bt(this.latestValues) && ws(a, this.latestValues), a;
4572
+ return wt(this.latestValues) && ws(a, this.latestValues), a;
4573
4573
  }
4574
4574
  setTargetDelta(r) {
4575
4575
  this.targetDelta = r, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
@@ -4606,7 +4606,7 @@ function mo({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4606
4606
  const p = this.getClosestProjectingParent();
4607
4607
  p && !!p.resumingFrom == !!this.resumingFrom && !p.options.layoutScroll && p.target && this.animationProgress !== 1 ? (this.relativeParent = p, this.forceRelativeParentToResolveTarget(), this.relativeTarget = B(), this.relativeTargetOrigin = B(), ne(this.relativeTargetOrigin, this.target, p.target), tt(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
4608
4608
  }
4609
- Zt && wt.resolvedTargetDeltas++;
4609
+ Zt && St.resolvedTargetDeltas++;
4610
4610
  }
4611
4611
  }
4612
4612
  }
@@ -4634,7 +4634,7 @@ function mo({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4634
4634
  this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
4635
4635
  return;
4636
4636
  }
4637
- !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (xs(this.prevProjectionDelta.x, this.projectionDelta.x), xs(this.prevProjectionDelta.y, this.projectionDelta.y)), ee(this.projectionDelta, this.layoutCorrected, y, this.latestValues), (this.treeScale.x !== d || this.treeScale.y !== p || !Vs(this.projectionDelta.x, this.prevProjectionDelta.x) || !Vs(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", y)), Zt && wt.recalculatedProjection++;
4637
+ !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (xs(this.prevProjectionDelta.x, this.projectionDelta.x), xs(this.prevProjectionDelta.y, this.projectionDelta.y)), ee(this.projectionDelta, this.layoutCorrected, y, this.latestValues), (this.treeScale.x !== d || this.treeScale.y !== p || !Vs(this.projectionDelta.x, this.prevProjectionDelta.x) || !Vs(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", y)), Zt && St.recalculatedProjection++;
4638
4638
  }
4639
4639
  hide() {
4640
4640
  this.isVisible = !1;
@@ -4765,7 +4765,7 @@ function mo({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
4765
4765
  const h = this.getLead();
4766
4766
  if (!this.projectionDelta || !this.layout || !h.target) {
4767
4767
  const P = {};
4768
- return this.options.layoutId && (P.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, P.pointerEvents = we(r == null ? void 0 : r.pointerEvents) || ""), this.hasProjected && !bt(this.latestValues) && (P.transform = c ? c({}, "") : "none", this.hasProjected = !1), P;
4768
+ return this.options.layoutId && (P.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, P.pointerEvents = we(r == null ? void 0 : r.pointerEvents) || ""), this.hasProjected && !wt(this.latestValues) && (P.transform = c ? c({}, "") : "none", this.hasProjected = !1), P;
4769
4769
  }
4770
4770
  const d = h.animationValues || h.latestValues;
4771
4771
  this.applyTransformsToTarget(), u.transform = Uc(this.projectionDeltaWithTransform, this.treeScale, d), c && (u.transform = c(d, u.transform));
@@ -4844,7 +4844,7 @@ function qc(t) {
4844
4844
  t.options.transition = void 0;
4845
4845
  }
4846
4846
  function Zc(t) {
4847
- Zt && wt.totalNodes++, t.parent && (t.isProjecting() || (t.isProjectionDirty = t.parent.isProjectionDirty), t.isSharedProjectionDirty || (t.isSharedProjectionDirty = !!(t.isProjectionDirty || t.parent.isProjectionDirty || t.parent.isSharedProjectionDirty)), t.isTransformDirty || (t.isTransformDirty = t.parent.isTransformDirty));
4847
+ Zt && St.totalNodes++, t.parent && (t.isProjecting() || (t.isProjectionDirty = t.parent.isProjectionDirty), t.isSharedProjectionDirty || (t.isSharedProjectionDirty = !!(t.isProjectionDirty || t.parent.isProjectionDirty || t.parent.isSharedProjectionDirty)), t.isTransformDirty || (t.isTransformDirty = t.parent.isTransformDirty));
4848
4848
  }
4849
4849
  function Jc(t) {
4850
4850
  t.isProjectionDirty = t.isSharedProjectionDirty = t.isTransformDirty = !1;
@@ -5314,7 +5314,7 @@ function Rh({ children: t, isPresent: e }) {
5314
5314
  }, [e]), O.jsx(Ch, { isPresent: e, childRef: i, sizeRef: s, children: An.cloneElement(t, { ref: i }) });
5315
5315
  }
5316
5316
  const Vh = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom: s, presenceAffectsLayout: o, mode: r }) => {
5317
- const a = $n(Eh), l = Cn(), u = Ct(
5317
+ const a = $n(Eh), l = Cn(), u = Rt(
5318
5318
  () => ({
5319
5319
  id: l,
5320
5320
  initial: e,
@@ -5336,7 +5336,7 @@ const Vh = ({ children: t, initial: e, isPresent: n, onExitComplete: i, custom:
5336
5336
  */
5337
5337
  o ? [Math.random()] : [n]
5338
5338
  );
5339
- return Ct(() => {
5339
+ return Rt(() => {
5340
5340
  a.forEach((c, h) => a.set(h, !1));
5341
5341
  }, [n]), An.useEffect(() => {
5342
5342
  !n && !a.size && i && i();
@@ -5354,7 +5354,7 @@ function Is(t) {
5354
5354
  }
5355
5355
  const Dh = ({ children: t, exitBeforeEnter: e, custom: n, initial: i = !0, onExitComplete: s, presenceAffectsLayout: o = !0, mode: r = "sync" }) => {
5356
5356
  ct(!e, "Replace exitBeforeEnter with mode='wait'");
5357
- const a = Ct(() => Is(t), [t]), l = a.map(be), u = it(!0), c = it(a), h = $n(() => /* @__PURE__ */ new Map()), [d, p] = Jt(a), [y, P] = Jt(a);
5357
+ const a = Rt(() => Is(t), [t]), l = a.map(be), u = it(!0), c = it(a), h = $n(() => /* @__PURE__ */ new Map()), [d, p] = Jt(a), [y, P] = Jt(a);
5358
5358
  Hs(() => {
5359
5359
  u.current = !1, c.current = a;
5360
5360
  for (let v = 0; v < y.length; v++) {
@@ -5389,15 +5389,15 @@ const Dh = ({ children: t, exitBeforeEnter: e, custom: n, initial: i = !0, onExi
5389
5389
  }) });
5390
5390
  }, Ns = ({
5391
5391
  onKeydown: t
5392
- }) => (Vt(() => (document.addEventListener("keydown", t), () => {
5392
+ }) => (Et(() => (document.addEventListener("keydown", t), () => {
5393
5393
  document.removeEventListener("keydown", t);
5394
5394
  }), []), null), Us = ({
5395
5395
  onMousedown: t
5396
- }) => (Vt(() => (document.addEventListener("mousedown", t), () => {
5396
+ }) => (Et(() => (document.addEventListener("mousedown", t), () => {
5397
5397
  document.removeEventListener("mousedown", t);
5398
5398
  }), []), null), Mh = ({
5399
5399
  onPickerHide: t
5400
- }) => (Vt(() => () => {
5400
+ }) => (Et(() => () => {
5401
5401
  t();
5402
5402
  }, []), null), kh = "acrool-react-picker__root", Lh = "acrool-react-picker__main-el", Ws = {
5403
5403
  root: kh,
@@ -5454,7 +5454,7 @@ const Dh = ({ children: t, exitBeforeEnter: e, custom: n, initial: i = !0, onExi
5454
5454
  function Gh(t, e) {
5455
5455
  return (i) => {
5456
5456
  const [s, o] = Jt(!1), [r, a] = Jt(!1), [l, u] = Jt(), c = it(null), h = it(null), d = it(l);
5457
- Vt(() => {
5457
+ Et(() => {
5458
5458
  d.current = l;
5459
5459
  }, [l]);
5460
5460
  const p = pt((g) => {
@@ -5466,6 +5466,10 @@ function Gh(t, e) {
5466
5466
  }, []), b = pt((g) => {
5467
5467
  c.current && !c.current.contains(g.target) && h.current && !h.current.contains(g.target) && (o(!1), a(!1));
5468
5468
  }, []), x = pt(() => {
5469
+ if (typeof (i == null ? void 0 : i.onChange) > "u") {
5470
+ bt.warning("@acrool/react-picker", "createPicker component props onChange is undefined, is no call");
5471
+ return;
5472
+ }
5469
5473
  d.current && JSON.stringify(l) !== JSON.stringify(d.current) && i.onChange(d.current);
5470
5474
  }, [l, i.onChange]), v = pt((g) => {
5471
5475
  [jt.Escape].includes(g.key) && s && (g.stopPropagation(), o(!1));
package/dist/types.d.ts CHANGED
@@ -9,7 +9,7 @@ export interface IPickerOptions {
9
9
  }
10
10
  export interface IValueChange<T = string> {
11
11
  value?: T;
12
- onChange: (value: T) => void;
12
+ onChange?: (value: T) => void;
13
13
  }
14
14
  export interface IPosition {
15
15
  vertical: 'top' | 'bottom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrool/react-picker",
3
- "version": "0.0.2-alpha.1",
3
+ "version": "0.0.2-alpha.3",
4
4
  "description": "Picker library based for Reactjs",
5
5
  "keywords": [
6
6
  "acrool",