ono-react-element 0.0.5 → 0.0.6

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,7 +1,7 @@
1
1
  import { j as y } from "./dependencies-DWmdjl5u.js";
2
- import { p as z } from "./utils-ziqvBIOU.js";
2
+ import { p as z } from "./utils-BLV_TQU3.js";
3
3
  import { useState as a, useRef as H, useMemo as j, useEffect as g, cloneElement as V } from "react";
4
- import { u as W } from "./hooks-Bj-aT2k8.js";
4
+ import { u as W } from "./hooks-CQN6qu4t.js";
5
5
  var x = /* @__PURE__ */ ((s) => (s.Horizontal = "Horizontal", s.Vertical = "Vertical", s))(x || {});
6
6
  const q = ({
7
7
  list: s,
@@ -1,5 +1,5 @@
1
1
  import { j as i, R as j } from "./dependencies-DWmdjl5u.js";
2
- import { a as p } from "./hooks-Bj-aT2k8.js";
2
+ import { a as p } from "./hooks-CQN6qu4t.js";
3
3
  let e = null, t;
4
4
  const B = ({
5
5
  className: n,
@@ -1,6 +1,6 @@
1
1
  import { j as o } from "./dependencies-DWmdjl5u.js";
2
2
  import { useState as x, useRef as T, useEffect as P } from "react";
3
- import { b as Y } from "./hooks-Bj-aT2k8.js";
3
+ import { b as Y } from "./hooks-CQN6qu4t.js";
4
4
  const A = () => /* @__PURE__ */ o.jsx(
5
5
  "svg",
6
6
  {
@@ -1,6 +1,6 @@
1
1
  import { j as t } from "./dependencies-DWmdjl5u.js";
2
2
  import { useState as m, useRef as v, useMemo as J, useCallback as Q, useEffect as j } from "react";
3
- import { c, g as U, a as W, b as X, d as B, e as Y } from "./utils-ziqvBIOU.js";
3
+ import { c, g as U, a as W, b as X, d as B, e as Y } from "./utils-BLV_TQU3.js";
4
4
  const Z = {
5
5
  info: { light: "#1677ff", dark: "#1677ff" },
6
6
  success: { light: "#52c41a", dark: "#49aa19" },
@@ -1,5 +1,5 @@
1
1
  import { j as o } from "./dependencies-DWmdjl5u.js";
2
- import { f as i } from "./utils-ziqvBIOU.js";
2
+ import { f as i } from "./utils-BLV_TQU3.js";
3
3
  import { useRef as b, useEffect as j } from "react";
4
4
  import { p as R } from "./PortalRenderer-8Iur-eZp.js";
5
5
  const z = ({
@@ -1,5 +1,5 @@
1
1
  import { j as s } from "./dependencies-DWmdjl5u.js";
2
- import { p as j } from "./utils-ziqvBIOU.js";
2
+ import { p as j } from "./utils-BLV_TQU3.js";
3
3
  import { useRef as c, useEffect as R } from "react";
4
4
  const _ = ({
5
5
  id: S,
@@ -1,5 +1,5 @@
1
1
  import { j as u } from "./dependencies-DWmdjl5u.js";
2
- import { Q as $ } from "./utils-ziqvBIOU.js";
2
+ import { C as $ } from "./utils-BLV_TQU3.js";
3
3
  import { useState as b, useRef as w, useEffect as h, useCallback as j } from "react";
4
4
  const N = ({
5
5
  children: r,
@@ -12,7 +12,7 @@ const N = ({
12
12
  clickMaskClose: g = !0,
13
13
  dialogClose: a
14
14
  }) => {
15
- const [n, m] = b(!1), s = w(null), x = () => {
15
+ const [n, C] = b(!1), s = w(null), m = () => {
16
16
  if (!e || !s.current) return;
17
17
  const t = s.current.parentElement.style, o = s.current.style;
18
18
  switch (t.setProperty("--duration", `${c / 1e3}s`), e.type) {
@@ -29,16 +29,16 @@ const N = ({
29
29
  }
30
30
  }, p = () => {
31
31
  if (s.current)
32
- if (m(!0), e) {
32
+ if (C(!0), e) {
33
33
  const t = s.current;
34
34
  t.classList.remove(`ono-${e.type}-enter`), t.classList.add(`ono-${e.type}-leave`), setTimeout(a, c);
35
35
  } else
36
36
  a();
37
37
  };
38
38
  h(() => {
39
- x();
39
+ m();
40
40
  }, [s, e]);
41
- const C = j(() => {
41
+ const x = j(() => {
42
42
  if (!e) return "";
43
43
  const t = `ono-${e.type}-enter`, o = `ono-${e.type}-leave`;
44
44
  return n ? o : t;
@@ -60,7 +60,7 @@ const N = ({
60
60
  className: `
61
61
  ono-dialog
62
62
  ${i || ""}
63
- ${C()}
63
+ ${x()}
64
64
  `,
65
65
  style: f,
66
66
  onClick: (t) => t.stopPropagation(),
@@ -1,6 +1,6 @@
1
1
  import { j as s } from "./dependencies-DWmdjl5u.js";
2
2
  import { useEffect as y, useRef as L } from "react";
3
- import { i as T } from "./InjunctiveBox-CmZg4sIq.js";
3
+ import { i as T } from "./InjunctiveBox-CGpy0PxH.js";
4
4
  const b = "_container_3s92l_1", m = "_base_3s92l_15", z = "_promise_3s92l_15", M = "_enter_3s92l_32", C = "_leave_3s92l_36", B = "_icon_3s92l_40", i = {
5
5
  container: b,
6
6
  base: m,
@@ -1,7 +1,7 @@
1
1
  import { j as n } from "./dependencies-DWmdjl5u.js";
2
2
  import { createPopper as E } from "@popperjs/core";
3
3
  import { useState as S, useRef as d, useEffect as x } from "react";
4
- import { c as F } from "./hooks-Bj-aT2k8.js";
4
+ import { c as F } from "./hooks-CQN6qu4t.js";
5
5
  let f = null, u = null;
6
6
  const $ = ({
7
7
  children: i,
@@ -1,6 +1,6 @@
1
1
  import { j as L } from "./dependencies-DWmdjl5u.js";
2
2
  import { memo as q, useState as R, useMemo as g, useRef as M, useEffect as y } from "react";
3
- import { a as F } from "./hooks-Bj-aT2k8.js";
3
+ import { a as F } from "./hooks-CQN6qu4t.js";
4
4
  const Q = q(
5
5
  ({
6
6
  containerClassName: z,
@@ -1,6 +1,6 @@
1
1
  import { j as m } from "./dependencies-DWmdjl5u.js";
2
2
  import { useState as W, useRef as b, useCallback as v, useEffect as I } from "react";
3
- import { a as z } from "./hooks-Bj-aT2k8.js";
3
+ import { a as z } from "./hooks-CQN6qu4t.js";
4
4
  const K = ({
5
5
  options: a,
6
6
  pageSize: h,
@@ -1,5 +1,5 @@
1
1
  import { useEffect as E, useState as L, useRef as b, useCallback as T } from "react";
2
- import { R as v } from "./utils-ziqvBIOU.js";
2
+ import { X as v } from "./utils-BLV_TQU3.js";
3
3
  const C = (e, c, t) => {
4
4
  const { target: s, deps: i, isDeferred: r } = t || {}, n = (l) => c(l);
5
5
  return E(() => (typeof e == "string" ? !r && (s || window).addEventListener(e, n) : e.forEach(
@@ -36,7 +36,7 @@ const C = (e, c, t) => {
36
36
  {
37
37
  deps: [e, ...(t == null ? void 0 : t.deps) || []]
38
38
  }
39
- ), R = (e = 60, c) => {
39
+ ), A = (e = 60, c) => {
40
40
  const [t, s] = L(e), [i, r] = L(!1), n = b(null), l = T(() => r(!0), []), u = T(() => {
41
41
  r(!1), s(e), n.current && (clearTimeout(n.current), n.current = null), c == null || c();
42
42
  }, [e, c]);
@@ -48,7 +48,7 @@ const C = (e, c, t) => {
48
48
  n.current && (clearTimeout(n.current), n.current = null);
49
49
  };
50
50
  }, [i, t, u]), [t, l, u];
51
- }, A = (e) => {
51
+ }, R = (e) => {
52
52
  const [c, t] = L({ w: 0, h: 0 }), s = new ResizeObserver((r) => {
53
53
  for (const n of r)
54
54
  t({
@@ -152,8 +152,8 @@ export {
152
152
  C as a,
153
153
  k as b,
154
154
  M as c,
155
- R as d,
155
+ A as d,
156
156
  z as e,
157
157
  x as f,
158
- A as u
158
+ R as u
159
159
  };
package/dist/es/index.js CHANGED
@@ -1,30 +1,30 @@
1
- import { f as X, h as Y, i as Z, j as _, k as $, l as oo, m as eo, n as so, o as to, q as ao, r as ro, s as io, t as no, u as co, v as lo, w as mo, x as po, y as fo, z as uo, A as xo, B as So, C as jo, D as vo, E as To, F as ho, G as go, H as wo, I as Bo, J as Lo, K as Oo, L as bo, M as Do, N as Fo, O as Io, P as No } from "./utils-ziqvBIOU.js";
2
- import { A as Ao, D as Po } from "./AutoSliderList-DqaQhmce.js";
3
- import { A as Co } from "./AvatarCrop-DzGw2FVQ.js";
4
- import { L as C } from "./List-B9mP7VjN.js";
5
- import { A as Vo } from "./List-B9mP7VjN.js";
6
- import { B as zo } from "./Button-CdxyXFF4.js";
7
- import { C as Wo } from "./Card3D-sf3zmiHk.js";
8
- import { C as Ho } from "./Checkbox-BN7rT73n.js";
9
- import { E as Ko, c as Uo } from "./VirtualList-D8M5JJ-W.js";
10
- import { M as Qo } from "./MenuButton-CuOdVlg0.js";
11
- import { m as Yo } from "./Message-BMimz-k2.js";
12
- import { M as _o } from "./Modal-BAJOEXRd.js";
13
- import { O as E } from "./Input-wORRaL9-.js";
14
- import { a as oe } from "./Input-wORRaL9-.js";
1
+ import { h as X, f as Y, i as Z, j as _, k as $, l as oo, m as eo, n as so, o as to, q as ao, r as ro, s as io, t as no, u as co, v as lo, w as mo, x as po, y as uo, z as fo, A as xo, B as So, C as To, D as jo, E as vo, F as go, G as ho, H as wo, I as Bo, J as bo, K as Lo, L as No, M as Oo, N as ko, O as yo, p as Co, P as Do, Q as Fo, R as Io, S as Po, T as Ao, U as Eo, V as Vo, W as Mo } from "./utils-BLV_TQU3.js";
2
+ import { A as zo, D as Wo } from "./AutoSliderList-DN4Sec6L.js";
3
+ import { A as Ho } from "./AvatarCrop-DzGw2FVQ.js";
4
+ import { L as A } from "./List-B9mP7VjN.js";
5
+ import { A as qo } from "./List-B9mP7VjN.js";
6
+ import { B as Qo } from "./Button-CdxyXFF4.js";
7
+ import { C as Xo } from "./Card3D-sf3zmiHk.js";
8
+ import { C as Zo } from "./Checkbox-BN7rT73n.js";
9
+ import { E as $o, c as oe } from "./VirtualList-OG7kqLe0.js";
10
+ import { M as se } from "./MenuButton-CuOdVlg0.js";
11
+ import { m as ae } from "./Message-TfweOOpK.js";
12
+ import { M as ie } from "./Modal-CHgTYu-I.js";
13
+ import { O as E } from "./Input-DoY3kR7J.js";
14
+ import { a as ce } from "./Input-DoY3kR7J.js";
15
15
  import { j as e } from "./dependencies-DWmdjl5u.js";
16
16
  import { useState as l, useEffect as V } from "react";
17
- import { T as M } from "./Tooltip-C_gPojr9.js";
18
- import { P as se } from "./Pagination-BtmtUkVw.js";
19
- import { p as ae } from "./PortalRenderer-8Iur-eZp.js";
20
- import { R as ie, a as ne } from "./Radio-BmSpqdK8.js";
21
- import { S as le } from "./SvgImg-Bcmzdjzl.js";
22
- import { S as pe } from "./Switch-hGQGZVO2.js";
23
- import { T as ue } from "./TemplateDialog-DuURiDPX.js";
24
- import { t as xe } from "./Toast-CkC8zQdq.js";
25
- import { c as je, d as ve, a as Te, u as he, b as ge, e as we, f as Be } from "./hooks-Bj-aT2k8.js";
26
- import { W as Oe } from "./Waterfall-BXE2_5Sj.js";
27
- const z = ({
17
+ import { T as M } from "./Tooltip-BtzG0TSW.js";
18
+ import { P as me } from "./Pagination-BtmtUkVw.js";
19
+ import { p as ue } from "./PortalRenderer-8Iur-eZp.js";
20
+ import { R as de, a as xe } from "./Radio-BmSpqdK8.js";
21
+ import { S as Te } from "./SvgImg-Bcmzdjzl.js";
22
+ import { S as ve } from "./Switch-DwDBR0sG.js";
23
+ import { T as he } from "./TemplateDialog-SXrElzoR.js";
24
+ import { t as Be } from "./Toast-C7ybVNyd.js";
25
+ import { c as Le, d as Ne, a as Oe, u as ke, b as ye, e as Ce, f as De } from "./hooks-CQN6qu4t.js";
26
+ import { W as Ie } from "./Waterfall-GHdJxww4.js";
27
+ const R = ({
28
28
  label: s,
29
29
  value: a,
30
30
  disabled: i,
@@ -51,34 +51,34 @@ const z = ({
51
51
  }
52
52
  )
53
53
  }
54
- ), U = ({
54
+ ), K = ({
55
55
  options: s,
56
56
  defaultValue: a,
57
57
  placeholder: i,
58
58
  inputBorder: n,
59
59
  isShowArrow: m,
60
60
  disabled: p,
61
- clearable: u,
62
- selectClassName: L,
63
- optionsClassName: O,
61
+ clearable: f,
62
+ selectClassName: b,
63
+ optionsClassName: L,
64
64
  filterable: t,
65
- notFoundContent: b,
66
- optionRender: D,
65
+ notFoundContent: N,
66
+ optionRender: O,
67
67
  onClear: d,
68
68
  onChange: r,
69
69
  filterMethod: x
70
70
  }) => {
71
- const [f, S] = l(""), [c, j] = l(""), [v, T] = l(!1), [h, F] = l(!1), [I, g] = l(""), w = (o) => {
72
- const B = s.find((y) => y.value === o);
71
+ const [u, S] = l(""), [c, T] = l(""), [j, v] = l(!1), [g, k] = l(!1), [y, h] = l(""), w = (o) => {
72
+ const B = s.find((P) => P.value === o);
73
73
  S(B ? B.label : "");
74
- }, N = () => t ? x && typeof x == "function" ? x(c, s) : s.filter(
74
+ }, C = () => t ? x && typeof x == "function" ? x(c, s) : s.filter(
75
75
  (o) => o.label.toLocaleLowerCase().includes(c.toLocaleLowerCase())
76
- ) : s, k = (o) => {
77
- F(o), t && c && !o && j("");
78
- }, A = (o) => {
79
- r == null || r(o), g(o), w(o);
80
- }, P = () => {
81
- d == null || d(), r == null || r(""), g(""), S(""), j("");
76
+ ) : s, D = (o) => {
77
+ k(o), t && c && !o && T("");
78
+ }, F = (o) => {
79
+ r == null || r(o), h(o), w(o);
80
+ }, I = () => {
81
+ d == null || d(), r == null || r(""), h(""), S(""), T("");
82
82
  };
83
83
  return V(() => {
84
84
  a && w(a);
@@ -89,13 +89,13 @@ const z = ({
89
89
  trigger: "click",
90
90
  placement: "bottom",
91
91
  isShowArrow: m,
92
- className: ["ono-option", O].filter(Boolean).join(" "),
93
- onOpenChange: k,
92
+ className: ["ono-option", L].filter(Boolean).join(" "),
93
+ onOpenChange: D,
94
94
  content: /* @__PURE__ */ e.jsx(
95
- C,
95
+ A,
96
96
  {
97
- list: N(),
98
- fallback: b ?? /* @__PURE__ */ e.jsx("div", { className: "ono-option-item", children: /* @__PURE__ */ e.jsx(
97
+ list: C(),
98
+ fallback: N ?? /* @__PURE__ */ e.jsx("div", { className: "ono-option-item", children: /* @__PURE__ */ e.jsx(
99
99
  "div",
100
100
  {
101
101
  className: "ono-option-item-content-no-data",
@@ -104,12 +104,12 @@ const z = ({
104
104
  }
105
105
  ) }),
106
106
  children: (o) => /* @__PURE__ */ e.jsx(
107
- z,
107
+ R,
108
108
  {
109
109
  ...o,
110
- onChange: A,
111
- currentValue: f.toString(),
112
- optionRender: D
110
+ onChange: F,
111
+ currentValue: u.toString(),
112
+ optionRender: O
113
113
  },
114
114
  o.value
115
115
  )
@@ -119,28 +119,28 @@ const z = ({
119
119
  "div",
120
120
  {
121
121
  className: "ono-select",
122
- onMouseEnter: () => T(!0),
123
- onMouseLeave: () => T(!1),
122
+ onMouseEnter: () => v(!0),
123
+ onMouseLeave: () => v(!1),
124
124
  children: /* @__PURE__ */ e.jsx(
125
125
  E,
126
126
  {
127
- className: [t ? "" : "ono-select-readonly", L].filter(Boolean).join(" "),
127
+ className: [t ? "" : "ono-select-readonly", b].filter(Boolean).join(" "),
128
128
  border: n,
129
129
  disabled: p,
130
- placeholder: t && I ? f.toString() || "" : i,
130
+ placeholder: t && y ? u.toString() || "" : i,
131
131
  readonly: !t,
132
- value: t && h ? c : f.toString(),
133
- clearable: v && u,
134
- suffix: !(v && u && f) && !(u && c && t) ? /* @__PURE__ */ e.jsx(R, { isVisible: h }) : /* @__PURE__ */ e.jsx(e.Fragment, {}),
135
- onClear: P,
136
- onChange: (o) => j(o.target.value)
132
+ value: t && g ? c : u.toString(),
133
+ clearable: j && f,
134
+ suffix: !(j && f && u) && !(f && c && t) ? /* @__PURE__ */ e.jsx(z, { isVisible: g }) : /* @__PURE__ */ e.jsx(e.Fragment, {}),
135
+ onClear: I,
136
+ onChange: (o) => T(o.target.value)
137
137
  }
138
138
  )
139
139
  }
140
140
  )
141
141
  }
142
142
  );
143
- }, R = ({ isVisible: s }) => /* @__PURE__ */ e.jsx(
143
+ }, z = ({ isVisible: s }) => /* @__PURE__ */ e.jsx(
144
144
  "svg",
145
145
  {
146
146
  className: [
@@ -156,72 +156,80 @@ const z = ({
156
156
  }
157
157
  );
158
158
  export {
159
- Ao as AutoSliderList,
160
- Co as AvatarCrop,
161
- Vo as AwaitList,
162
- zo as Button,
163
- Wo as Card3D,
164
- Ho as Checkbox,
165
- Po as Direction,
166
- Ko as EstimatedVirtualList,
167
- C as List,
168
- Qo as MenuButton,
169
- _o as Modal,
159
+ zo as AutoSliderList,
160
+ Ho as AvatarCrop,
161
+ qo as AwaitList,
162
+ Qo as Button,
163
+ Xo as Card3D,
164
+ Zo as Checkbox,
165
+ Wo as Direction,
166
+ $o as EstimatedVirtualList,
167
+ A as List,
168
+ se as MenuButton,
169
+ ie as Modal,
170
170
  E as OnoInput,
171
- U as OnoSelect,
172
- oe as OnoTextarea,
173
- se as Pagination,
174
- ie as Radio,
175
- ne as RadioGroup,
176
- le as SvgImg,
177
- pe as Switch,
178
- ue as TemplateDialog,
171
+ K as OnoSelect,
172
+ ce as OnoTextarea,
173
+ me as Pagination,
174
+ de as Radio,
175
+ xe as RadioGroup,
176
+ Te as SvgImg,
177
+ ve as Switch,
178
+ he as TemplateDialog,
179
179
  M as Tooltip,
180
- Oe as Waterfall,
181
- X as adjustingColors,
182
- Y as base64ToBlob,
183
- Z as base64ToFile,
184
- _ as blobToBase64,
185
- $ as blobToFile,
186
- oo as calculateAspectRatio,
187
- eo as checkDeviceIsMobile,
188
- so as checkStatusCode,
189
- to as colorUtils,
190
- ao as common,
191
- ro as convertSecondToOtherTime,
192
- io as copy2Clipboard,
193
- Uo as createDataSource,
194
- no as createIntersectionObserver,
195
- co as deepCopy,
196
- lo as downloadFile,
197
- mo as fileToBase64,
198
- po as fileToBlob,
180
+ Ie as Waterfall,
181
+ X as addCommasToNumber,
182
+ Y as adjustingColors,
183
+ Z as base64ToBlob,
184
+ _ as base64ToFile,
185
+ $ as blobToBase64,
186
+ oo as blobToFile,
187
+ eo as calculateAspectRatio,
188
+ so as checkDeviceIsMobile,
189
+ to as checkStatusCode,
190
+ ao as colorUtils,
191
+ ro as common,
192
+ io as convertSecondToOtherTime,
193
+ no as copy2Clipboard,
194
+ oe as createDataSource,
195
+ co as createIntersectionObserver,
196
+ lo as deepCopy,
197
+ mo as downloadFile,
198
+ po as fileToBase64,
199
+ uo as fileToBlob,
199
200
  fo as formatFileSize,
200
- uo as formatSecondes,
201
- xo as formatTime,
202
- So as getFileName,
203
- jo as getFileSuffix,
204
- vo as getImageSIze,
205
- To as getPointDistance,
206
- ho as getURLSearchParams,
207
- go as localFormat,
208
- Yo as message,
209
- ae as portalRenderer,
210
- wo as printStr,
211
- Bo as quickSort,
212
- Lo as randomString,
213
- Oo as safeCapitalizeWord,
214
- bo as second2Day,
215
- Do as singleton,
216
- xe as toast,
217
- Fo as urlToBase64,
218
- Io as urlToBlob,
219
- No as urlToFile,
220
- je as useClickOutSide,
221
- ve as useCountdown,
222
- Te as useEventListener,
223
- he as useGetElementSize,
224
- ge as useKeyPress,
225
- we as useTheme,
226
- Be as useThemePro
201
+ xo as formatSecondes,
202
+ So as formatTime,
203
+ To as getElementCenterPosition,
204
+ jo as getFileName,
205
+ vo as getFileSuffix,
206
+ go as getImageSIze,
207
+ ho as getPointDistance,
208
+ wo as getURLSearchParams,
209
+ Bo as grayColor,
210
+ bo as localFormat,
211
+ Lo as mediaAutoplayPolicies,
212
+ ae as message,
213
+ No as parseQuery,
214
+ Oo as passwordStrength,
215
+ ko as pick,
216
+ ue as portalRenderer,
217
+ yo as printStr,
218
+ Co as pureNumber,
219
+ Do as quickSort,
220
+ Fo as randomString,
221
+ Io as safeCapitalizeWord,
222
+ Po as second2Day,
223
+ Ao as singleton,
224
+ Be as toast,
225
+ Eo as urlToBase64,
226
+ Vo as urlToBlob,
227
+ Mo as urlToFile,
228
+ Le as useClickOutSide,
229
+ Ne as useCountdown,
230
+ Oe as useEventListener,
231
+ ke as useGetElementSize,
232
+ ye as useKeyPress,
233
+ Ce as useTheme,
234
+ De as useThemePro
227
235
  };