react-artasys-ui 0.1.34 → 0.1.35

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/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
- import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import r, { cloneElement as i, createContext as a, forwardRef as o, useCallback as s, useContext as c, useEffect as l, useImperativeHandle as u, useMemo as d, useRef as f, useState as p } from "react";
1
+ import e, { cloneElement as t, createContext as n, forwardRef as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useMemo as c, useRef as l, useState as u } from "react";
2
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
3
3
  var m = {
4
- container: "style-module__container__62IoS",
5
- "wait-indicator": "style-module__wait-indicator__gf4Cz",
6
- wait: "style-module__wait__gRt9X"
4
+ container: "style-module__container__q3kth",
5
+ "wait-indicator": "style-module__wait-indicator__6U6CR",
6
+ wait: "style-module__wait__UP-DV"
7
7
  }, h = {
8
8
  spinner: "style-module__spinner__bqxDY",
9
9
  "button-spinner-border": "style-module__button-spinner-border__Zu60W",
@@ -11,11 +11,11 @@ var m = {
11
11
  small: "style-module__small__A2XhO",
12
12
  middle: "style-module__middle__5esgZ",
13
13
  large: "style-module__large__5MX0S"
14
- }, g = ({ size: e, contrast: n, ...r }) => {
15
- let i = ["ui-spinner"];
16
- return i.push(h.spinner), e && i.push(h[e], "ui-spinner-" + e), n && i.push(h["ui-spinner-contrast"]), r.className && i.push(r.className), /* @__PURE__ */ t("div", {
17
- ...r,
18
- className: i.join(" ")
14
+ }, g = ({ size: e, contrast: t, ...n }) => {
15
+ let r = ["ui-spinner"];
16
+ return r.push(h.spinner), e && r.push(h[e], "ui-spinner-" + e), t && r.push(h["ui-spinner-contrast"]), n.className && r.push(n.className), /* @__PURE__ */ f("div", {
17
+ ...n,
18
+ className: r.join(" ")
19
19
  });
20
20
  }, _ = {
21
21
  container: "style-module__container__Tcehc",
@@ -23,28 +23,31 @@ var m = {
23
23
  small: "style-module__small__GbGdW",
24
24
  middle: "style-module__middle__Xb1-y",
25
25
  large: "style-module__large__eTEPS"
26
- }, v = ({ value: e = 0, size: n, radius: r = !1 }) => {
26
+ }, v = ({ value: e = 0, size: t, radius: n = !1 }) => {
27
27
  e = Math.ceil(Number(e) * 10) / 10, e > 100 && (e = 100), e < 0 && (e = 0);
28
- let i = r ? 360 / 100 * e + "deg" : e + "%", a = ["ui-progress"];
29
- return a.push(_.container), n && a.push(_[n]), r && a.push(_.radius), /* @__PURE__ */ t("div", {
30
- className: a.join(" "),
28
+ let r = n ? 360 / 100 * e + "deg" : e + "%", i = ["ui-progress"];
29
+ return i.push(_.container), t && i.push(_[t]), n && i.push(_.radius), /* @__PURE__ */ f("div", {
30
+ className: i.join(" "),
31
31
  "data-progress": e,
32
- style: { "--progress": i }
32
+ style: { "--progress": r }
33
33
  });
34
- }, y = ({ children: e, wait: r, progress: i, progressRadius: a = !0, className: o, onSubmit: s, ...c }) => {
35
- let l = (e) => {
36
- e.preventDefault(), typeof s == "function" && s(e);
37
- }, u = [];
38
- return u.push(m.container), r && u.push(m.wait), o && u.push(o), /* @__PURE__ */ n("form", {
39
- ...c,
40
- onSubmit: l,
41
- className: u.join(" "),
42
- children: [e, /* @__PURE__ */ t("div", {
34
+ }, y = ({ children: e, wait: t, progress: n, progressRadius: r = !0, className: i, onSubmit: a, ...o }) => {
35
+ let s = (e) => {
36
+ e.preventDefault(), typeof a == "function" && a(e);
37
+ }, l = c(() => {
38
+ let e = [m.container];
39
+ return t && e.push(m.wait), i && e.push(i), e.join(" ");
40
+ }, []);
41
+ return /* @__PURE__ */ p("form", {
42
+ ...o,
43
+ onSubmit: s,
44
+ className: l,
45
+ children: [e, /* @__PURE__ */ f("div", {
43
46
  className: m["wait-indicator"],
44
- children: typeof i == "number" ? /* @__PURE__ */ t(v, {
45
- radius: a,
46
- value: i
47
- }) : /* @__PURE__ */ t(g, {})
47
+ children: typeof n == "number" ? /* @__PURE__ */ f(v, {
48
+ radius: r,
49
+ value: n
50
+ }) : /* @__PURE__ */ f(g, {})
48
51
  })]
49
52
  });
50
53
  }, b = (e) => e.type === "checkbox", x = (e) => e instanceof Date, S = (e) => e == null, C = (e) => typeof e == "object", w = (e) => !S(e) && !Array.isArray(e) && C(e) && !x(e), ee = (e) => w(e) && e.target ? b(e.target) ? e.target.checked : e.target.value : e, T = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), E = (e) => {
@@ -103,7 +106,7 @@ var k = {
103
106
  if (ne.includes(t)) return;
104
107
  e[t] = a, e = e[t];
105
108
  }
106
- }, se = r.createContext(null);
109
+ }, se = e.createContext(null);
107
110
  se.displayName = "HookFormControlContext";
108
111
  var ce = (e, t, n, r = !0) => {
109
112
  let i = {};
@@ -112,7 +115,7 @@ var ce = (e, t, n, r = !0) => {
112
115
  return t._proxyFormState[i] !== A.all && (t._proxyFormState[i] = !r || A.all), n && (n[i] = !0), e[i];
113
116
  } });
114
117
  return i;
115
- }, le = D ? r.useLayoutEffect : r.useEffect, L = (e) => typeof e == "string", ue = (e, t, n, r, i) => L(e) ? (r && t.watch.add(e), N(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), N(n, e))) : (r && (t.watchAll = !0), n), de = (e) => S(e) || !C(e), R = (e, t) => t.length === 0 && !Array.isArray(e) && !E(e);
118
+ }, le = D ? e.useLayoutEffect : e.useEffect, L = (e) => typeof e == "string", ue = (e, t, n, r, i) => L(e) ? (r && t.watch.add(e), N(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), N(n, e))) : (r && (t.watchAll = !0), n), de = (e) => S(e) || !C(e), R = (e, t) => t.length === 0 && !Array.isArray(e) && !E(e);
116
119
  function z(e, t, n = /* @__PURE__ */ new WeakMap()) {
117
120
  if (e === t) return !0;
118
121
  if (de(e) || de(t)) return Object.is(e, t);
@@ -138,7 +141,7 @@ function z(e, t, n = /* @__PURE__ */ new WeakMap()) {
138
141
  }
139
142
  return !0;
140
143
  }
141
- var fe = r.createContext(null);
144
+ var fe = e.createContext(null);
142
145
  fe.displayName = "HookFormContext";
143
146
  var pe = (e, t, n, r, i) => t ? {
144
147
  ...n[e],
@@ -1071,27 +1074,27 @@ function et(e = {}) {
1071
1074
  formControl: X
1072
1075
  };
1073
1076
  }
1074
- function tt(e = {}) {
1075
- let t = r.useRef(void 0), n = r.useRef(void 0), i = r.useRef(e.formControl), [a, o] = r.useState(() => ({
1077
+ function tt(t = {}) {
1078
+ let n = e.useRef(void 0), r = e.useRef(void 0), i = e.useRef(t.formControl), [a, o] = e.useState(() => ({
1076
1079
  ...O($e),
1077
- isLoading: F(e.defaultValues),
1078
- errors: e.errors || {},
1079
- disabled: e.disabled || !1,
1080
- defaultValues: F(e.defaultValues) ? void 0 : e.defaultValues
1080
+ isLoading: F(t.defaultValues),
1081
+ errors: t.errors || {},
1082
+ disabled: t.disabled || !1,
1083
+ defaultValues: F(t.defaultValues) ? void 0 : t.defaultValues
1081
1084
  }));
1082
- if (!t.current || e.formControl && i.current !== e.formControl) if (i.current = e.formControl, e.formControl) t.current = {
1083
- ...e.formControl,
1085
+ if (!n.current || t.formControl && i.current !== t.formControl) if (i.current = t.formControl, t.formControl) n.current = {
1086
+ ...t.formControl,
1084
1087
  formState: a
1085
- }, e.defaultValues && !F(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
1088
+ }, t.defaultValues && !F(t.defaultValues) && t.formControl.reset(t.defaultValues, t.resetOptions);
1086
1089
  else {
1087
- let { formControl: n, ...r } = et(e);
1088
- t.current = {
1090
+ let { formControl: e, ...r } = et(t);
1091
+ n.current = {
1089
1092
  ...r,
1090
1093
  formState: a
1091
1094
  };
1092
1095
  }
1093
- let s = t.current.control;
1094
- return s._options = e, le(() => {
1096
+ let s = n.current.control;
1097
+ return s._options = t, le(() => {
1095
1098
  let e = s._subscribe({
1096
1099
  formState: s._proxyFormState,
1097
1100
  callback: () => o({
@@ -1104,52 +1107,52 @@ function tt(e = {}) {
1104
1107
  ...e,
1105
1108
  isReady: !0
1106
1109
  })), s._formState.isReady = !0, e;
1107
- }, [s]), r.useEffect(() => s._disableForm(e.disabled), [s, e.disabled]), r.useEffect(() => {
1108
- e.mode && (s._options.mode = e.mode), e.reValidateMode && (s._options.reValidateMode = e.reValidateMode);
1110
+ }, [s]), e.useEffect(() => s._disableForm(t.disabled), [s, t.disabled]), e.useEffect(() => {
1111
+ t.mode && (s._options.mode = t.mode), t.reValidateMode && (s._options.reValidateMode = t.reValidateMode);
1109
1112
  }, [
1110
1113
  s,
1111
- e.mode,
1112
- e.reValidateMode
1113
- ]), r.useEffect(() => {
1114
- e.errors && (s._setErrors(e.errors), s._focusError());
1115
- }, [s, e.errors]), r.useEffect(() => {
1116
- e.shouldUnregister && s._subjects.state.next({ values: s._getWatch() });
1117
- }, [s, e.shouldUnregister]), r.useEffect(() => {
1114
+ t.mode,
1115
+ t.reValidateMode
1116
+ ]), e.useEffect(() => {
1117
+ t.errors && (s._setErrors(t.errors), s._focusError());
1118
+ }, [s, t.errors]), e.useEffect(() => {
1119
+ t.shouldUnregister && s._subjects.state.next({ values: s._getWatch() });
1120
+ }, [s, t.shouldUnregister]), e.useEffect(() => {
1118
1121
  if (s._proxyFormState.isDirty) {
1119
1122
  let e = s._getDirty();
1120
1123
  e !== a.isDirty && s._subjects.state.next({ isDirty: e });
1121
1124
  }
1122
- }, [s, a.isDirty]), r.useEffect(() => {
1123
- e.values && !z(e.values, n.current) ? (s._reset(e.values, {
1125
+ }, [s, a.isDirty]), e.useEffect(() => {
1126
+ t.values && !z(t.values, r.current) ? (s._reset(t.values, {
1124
1127
  keepFieldsRef: !0,
1125
1128
  ...s._options.resetOptions
1126
- }), s._options.resetOptions?.keepIsValid || s._setValid(), n.current = e.values, o((e) => ({ ...e }))) : s._resetDefaultValues();
1127
- }, [s, e.values]), r.useEffect(() => {
1129
+ }), s._options.resetOptions?.keepIsValid || s._setValid(), r.current = t.values, o((e) => ({ ...e }))) : s._resetDefaultValues();
1130
+ }, [s, t.values]), e.useEffect(() => {
1128
1131
  s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
1129
- }), t.current.formState = r.useMemo(() => ce(a, s), [s, a]), t.current;
1132
+ }), n.current.formState = e.useMemo(() => ce(a, s), [s, a]), n.current;
1130
1133
  }
1131
1134
  //#endregion
1132
1135
  //#region src/Form/useForm.tsx
1133
1136
  var nt = () => {
1134
- let [n, r] = p(), i = tt({ reValidateMode: "onChange" }), a = (e, t) => {
1135
- let n = i.register(e, t), a = (t) => (r(null), i.clearErrors(e), n.onChange(t)), o = i?.formState.errors, s = i.watch(e);
1137
+ let [e, t] = u(), n = tt({ reValidateMode: "onChange" }), r = (e, r) => {
1138
+ let i = n.register(e, r), a = (r) => (t(null), n.clearErrors(e), i.onChange(r)), o = n?.formState.errors, s = n.watch(e);
1136
1139
  return {
1137
- ...n,
1140
+ ...i,
1138
1141
  onChange: a,
1139
1142
  formvalue: s,
1140
1143
  error: o?.[e]?.message?.toString()
1141
1144
  };
1142
- }, o = (e) => {
1143
- e.errors ? Object.keys(e.errors).forEach((t) => i.setError(t, { message: e.errors?.[t]?.[0] })) : r(e);
1144
- }, s = () => /* @__PURE__ */ t(e, { children: n && !n.errors && /* @__PURE__ */ t("div", {
1145
+ }, i = (e) => {
1146
+ e.errors ? Object.keys(e.errors).forEach((t) => n.setError(t, { message: e.errors?.[t]?.[0] })) : t(e);
1147
+ }, a = () => /* @__PURE__ */ f(d, { children: e && !e.errors && /* @__PURE__ */ f("div", {
1145
1148
  className: m["global-error"],
1146
- children: n.message
1149
+ children: e.message
1147
1150
  }) });
1148
1151
  return {
1149
- ...i,
1150
- register: a,
1151
- GlobalError: s,
1152
- setErrors: o
1152
+ ...n,
1153
+ register: r,
1154
+ GlobalError: a,
1155
+ setErrors: i
1153
1156
  };
1154
1157
  }, q = {
1155
1158
  container: "style-module__container__JyG0-",
@@ -1167,166 +1170,166 @@ var nt = () => {
1167
1170
  light: "style-module__light__Kubs1",
1168
1171
  secondary: "style-module__secondary__EkNcU",
1169
1172
  "secondary-light": "style-module__secondary-light__cJeWY"
1170
- }, rt = ({ color: e = "primary", ...r }) => {
1171
- let i = ["ui-loading"];
1172
- return i.push(J.loading), e && i.push(J[e], "ui-loading-" + e), /* @__PURE__ */ n("div", {
1173
- ...r,
1174
- className: i.join(" "),
1173
+ }, rt = ({ color: e = "primary", ...t }) => {
1174
+ let n = ["ui-loading"];
1175
+ return n.push(J.loading), e && n.push(J[e], "ui-loading-" + e), /* @__PURE__ */ p("div", {
1176
+ ...t,
1177
+ className: n.join(" "),
1175
1178
  children: [
1176
- /* @__PURE__ */ t("div", { className: J.dot }),
1177
- /* @__PURE__ */ t("div", { className: J.dot }),
1178
- /* @__PURE__ */ t("div", { className: J.dot }),
1179
- /* @__PURE__ */ t("div", { className: J.dot })
1179
+ /* @__PURE__ */ f("div", { className: J.dot }),
1180
+ /* @__PURE__ */ f("div", { className: J.dot }),
1181
+ /* @__PURE__ */ f("div", { className: J.dot }),
1182
+ /* @__PURE__ */ f("div", { className: J.dot })
1180
1183
  ]
1181
1184
  });
1182
- }, Y = ({ children: r, beforeElement: a, afterElement: o, error: s, placeholder: c, styleContainer: u, classNameContainer: f, classNameContainerElement: m, hiddenContainer: h, formvalue: g, wait: _, withBorder: v = !1, ...y }) => {
1183
- let [b, x] = p("");
1184
- return l(() => {
1185
- x(s ?? "");
1186
- }, [s]), /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("label", {
1187
- className: d(() => {
1185
+ }, Y = ({ children: e, beforeElement: n, afterElement: r, error: i, placeholder: a, styleContainer: s, classNameContainer: l, classNameContainerElement: m, hiddenContainer: h, formvalue: g, wait: _, withBorder: v = !1, ...y }) => {
1186
+ let [b, x] = u("");
1187
+ return o(() => {
1188
+ x(i ?? "");
1189
+ }, [i]), /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("label", {
1190
+ className: c(() => {
1188
1191
  let e = ["ui-form-element-container"];
1189
- return e.push(q.container), b && e.push(q.error), y.disabled && e.push(q.disabled), h && e.push(q.hidden), v && e.push(q.border), f && e.push(f), e.join(" ");
1192
+ return e.push(q.container), b && e.push(q.error), y.disabled && e.push(q.disabled), h && e.push(q.hidden), v && e.push(q.border), l && e.push(l), e.join(" ");
1190
1193
  }, [
1191
1194
  b,
1192
1195
  y.disabled,
1193
1196
  h,
1194
- f,
1197
+ l,
1195
1198
  v
1196
1199
  ]),
1197
- style: u,
1198
- children: /* @__PURE__ */ n("div", {
1200
+ style: s,
1201
+ children: /* @__PURE__ */ p("div", {
1199
1202
  className: "ui-form-element " + q.element + (m ? " " + m : ""),
1200
1203
  children: [
1201
- a ? i(a, { key: "ui-before-element" }) : null,
1202
- typeof r == "function" ? r(y) : null,
1203
- c && _ ? "" : /* @__PURE__ */ t("span", {
1204
+ n ? t(n, { key: "ui-before-element" }) : null,
1205
+ typeof e == "function" ? e(y) : null,
1206
+ a && _ ? "" : /* @__PURE__ */ f("span", {
1204
1207
  className: "ui-form-element-placeholder " + q.placeholder,
1205
- children: c
1208
+ children: a
1206
1209
  }),
1207
- _ && /* @__PURE__ */ t(rt, {}),
1208
- o ? i(o, { key: "ui-after-element" }) : null
1210
+ _ && /* @__PURE__ */ f(rt, {}),
1211
+ r ? t(r, { key: "ui-after-element" }) : null
1209
1212
  ]
1210
1213
  })
1211
- }), b && /* @__PURE__ */ t("div", {
1214
+ }), b && /* @__PURE__ */ f("div", {
1212
1215
  className: "ui-form-error " + q.error,
1213
1216
  children: b
1214
1217
  })] });
1215
1218
  }, it = y, at = {
1216
1219
  container: "styles-module__container__-32s9",
1217
1220
  placeholder: "styles-module__placeholder__HQctl"
1218
- }, ot = o(({ onChange: e, onInput: n, onChangeText: r, wait: i, disabled: a, formvalue: o, children: s, ...c }, u) => {
1219
- let [d, f] = p(""), m = (t) => {
1220
- typeof e == "function" && e(t), typeof r == "function" && r(t.target.value);
1221
+ }, ot = r(({ onChange: e, onInput: t, onChangeText: n, wait: r, disabled: i, formvalue: a, children: s, ...c }, l) => {
1222
+ let [d, p] = u(""), m = (t) => {
1223
+ typeof e == "function" && e(t), typeof n == "function" && n(t.target.value);
1221
1224
  }, h = (e) => {
1222
- a || i || (typeof n == "function" && n(e), f(e.target.value));
1225
+ i || r || (typeof t == "function" && t(e), p(e.target.value));
1223
1226
  };
1224
- return l(() => {
1225
- let e = c.value ?? o;
1226
- f(e ? String(e) : "");
1227
- }, [c.value, o]), /* @__PURE__ */ t(Y, {
1227
+ return o(() => {
1228
+ let e = c.value ?? a;
1229
+ p(e ? String(e) : "");
1230
+ }, [c.value, a]), /* @__PURE__ */ f(Y, {
1228
1231
  ...c,
1229
- wait: i,
1232
+ wait: r,
1230
1233
  classNameContainerElement: at.container,
1231
1234
  withBorder: !0,
1232
- children: (e) => /* @__PURE__ */ t("input", {
1235
+ children: (e) => /* @__PURE__ */ f("input", {
1233
1236
  ...e,
1234
1237
  placeholder: "",
1235
1238
  onChange: m,
1236
- disabled: a || i,
1237
- value: i ? "" : d,
1239
+ disabled: i || r,
1240
+ value: r ? "" : d,
1238
1241
  onInput: h,
1239
- ref: u
1242
+ ref: l
1240
1243
  })
1241
1244
  });
1242
- }), st = { container: "style-module__container__iExWO" }, ct = o(({ onChange: e, onInput: n, onChangeText: r, formvalue: i, wait: a, ...o }, s) => {
1243
- let c = f(null), [d, m] = p(o.value ?? i ?? ""), h = (t) => {
1244
- typeof e == "function" && e(t), typeof r == "function" && r(t.target.value);
1245
+ }), st = { container: "style-module__container__iExWO" }, ct = r(({ onChange: e, onInput: t, onChangeText: n, formvalue: r, wait: i, ...a }, c) => {
1246
+ let d = l(null), [p, m] = u(a.value ?? r ?? ""), h = (t) => {
1247
+ typeof e == "function" && e(t), typeof n == "function" && n(t.target.value);
1245
1248
  }, g = (e) => {
1246
- typeof n == "function" && n(e), m(e.target.value);
1249
+ typeof t == "function" && t(e), m(e.target.value);
1247
1250
  };
1248
- l(() => {
1249
- let e = c.current;
1251
+ o(() => {
1252
+ let e = d.current;
1250
1253
  if (!e) return;
1251
1254
  let t = e.offsetHeight;
1252
1255
  e.style.height = "auto";
1253
1256
  let n = e.scrollHeight, r = Math.max(n, 50);
1254
1257
  e.style.height = `${Math.max(r, t)}px`;
1255
- }, [d]), l(() => {
1256
- m(o.value ?? i ?? "");
1257
- }, [o.value, i]), u(s, () => c.current);
1258
- let _ = a ? "" : d;
1259
- return /* @__PURE__ */ t(Y, {
1260
- ...o,
1261
- wait: a,
1258
+ }, [p]), o(() => {
1259
+ m(a.value ?? r ?? "");
1260
+ }, [a.value, r]), s(c, () => d.current);
1261
+ let _ = i ? "" : p;
1262
+ return /* @__PURE__ */ f(Y, {
1263
+ ...a,
1264
+ wait: i,
1262
1265
  classNameContainerElement: st.container,
1263
1266
  withBorder: !0,
1264
- children: (e) => /* @__PURE__ */ t("textarea", {
1267
+ children: (e) => /* @__PURE__ */ f("textarea", {
1265
1268
  ...e,
1266
- disabled: a,
1269
+ disabled: i,
1267
1270
  placeholder: e.placeholder ?? "",
1268
1271
  value: _,
1269
1272
  onChange: h,
1270
1273
  onInput: g,
1271
- ref: c
1274
+ ref: d
1272
1275
  })
1273
1276
  });
1274
1277
  }), lt = {
1275
1278
  "file-btn": "style-module__file-btn__WajPw",
1276
1279
  icon: "style-module__icon__f1VPN"
1277
- }, ut = ({ onChange: r, onChangeFiles: i, accept: a, multiple: o, wait: c, children: l, className: u, icon: d, ...p }) => {
1278
- let m = f(null), h = `
1280
+ }, ut = ({ onChange: e, onChangeFiles: t, accept: n, multiple: r, wait: a, children: o, className: s, icon: c, ...u }) => {
1281
+ let m = l(null), h = `
1279
1282
  ${lt["file-btn"]}
1280
- ${d && !c ? lt.icon : ""}
1281
- `.trim(), g = s((e) => {
1282
- let t = e.target.files;
1283
- typeof r == "function" && r(e), typeof i == "function" && i(t);
1284
- }, [r, i]);
1285
- return /* @__PURE__ */ t(Y, {
1286
- ...p,
1287
- wait: c,
1288
- children: (r) => /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("input", {
1283
+ ${c && !a ? lt.icon : ""}
1284
+ `.trim(), g = i((n) => {
1285
+ let r = n.target.files;
1286
+ typeof e == "function" && e(n), typeof t == "function" && t(r);
1287
+ }, [e, t]);
1288
+ return /* @__PURE__ */ f(Y, {
1289
+ ...u,
1290
+ wait: a,
1291
+ children: (e) => /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("input", {
1289
1292
  type: "file",
1290
1293
  ref: m,
1291
1294
  onChange: g,
1292
- accept: a,
1293
- multiple: o,
1295
+ accept: n,
1296
+ multiple: r,
1294
1297
  style: { display: "none" },
1295
- ...r
1296
- }), /* @__PURE__ */ t("div", {
1297
- className: `ui-file-uploader ${h} ${u || ""}`,
1298
- children: !c && (l || "Выбрать файл")
1298
+ ...e
1299
+ }), /* @__PURE__ */ f("div", {
1300
+ className: `ui-file-uploader ${h} ${s || ""}`,
1301
+ children: !a && (o || "Выбрать файл")
1299
1302
  })] })
1300
1303
  });
1301
- }, dt = ({ onChange: e, children: n, multiple: r, accept: i, ...a }) => {
1302
- let o = f(null), s = (t) => {
1304
+ }, dt = ({ onChange: e, children: t, multiple: n, accept: r, ...i }) => {
1305
+ let a = l(null), s = (t) => {
1303
1306
  let n = t.target;
1304
1307
  if (n.files) for (let t of n.files) {
1305
1308
  let n = new FileReader();
1306
1309
  n.onload = (n) => {
1307
- let r = n.target?.result?.toString().split(";base64,"), i = r?.[0].replace("data:", "") ?? "", a = r?.[1] ?? "";
1308
- typeof e == "function" && (o.current.value = "", e({
1310
+ let r = n.target?.result?.toString().split(";base64,"), i = r?.[0].replace("data:", "") ?? "", o = r?.[1] ?? "";
1311
+ typeof e == "function" && (a.current.value = "", e({
1309
1312
  name: t.name,
1310
1313
  type: t.type,
1311
1314
  size: t.size,
1312
1315
  mime: i,
1313
- data: a,
1316
+ data: o,
1314
1317
  base64: n.target?.result
1315
1318
  }));
1316
1319
  }, n.readAsDataURL(t);
1317
1320
  }
1318
1321
  }, c = (e) => {
1319
- a.disabled || (o.current.click(), e.preventDefault());
1322
+ i.disabled || (a.current.click(), e.preventDefault());
1320
1323
  }, u = () => {
1321
1324
  let e = document.createElement("input");
1322
- return e.setAttribute("type", "file"), e.onchange = s, i && i.length > 0 && e.setAttribute("accept", i.join(",")), r && e.setAttribute("multiple", "multiple"), e;
1325
+ return e.setAttribute("type", "file"), e.onchange = s, r && r.length > 0 && e.setAttribute("accept", r.join(",")), n && e.setAttribute("multiple", "multiple"), e;
1323
1326
  };
1324
- return l(() => (o.current = u(), () => {
1325
- o.current?.remove();
1326
- }), []), /* @__PURE__ */ t("div", {
1327
- ...a,
1327
+ return o(() => (a.current = u(), () => {
1328
+ a.current?.remove();
1329
+ }), []), /* @__PURE__ */ f("div", {
1330
+ ...i,
1328
1331
  onClick: c,
1329
- children: n
1332
+ children: t
1330
1333
  });
1331
1334
  }, X = {
1332
1335
  container: "style-module__container__Y4Az4",
@@ -1343,24 +1346,24 @@ var nt = () => {
1343
1346
  "normal-btn": "style-module__normal-btn__qHevU",
1344
1347
  "small-btn": "style-module__small-btn__Axtvq",
1345
1348
  "large-btn": "style-module__large-btn__X3--3"
1346
- }, ft = ({ children: e, className: r, classNameContainer: i, styleContainer: a, wait: o = !1, variant: s, size: c = "normal", icon: l, ...u }) => {
1347
- let d = `
1349
+ }, ft = ({ children: e, className: t, classNameContainer: n, styleContainer: r, wait: i = !1, variant: a, size: o = "normal", icon: s, ...c }) => {
1350
+ let l = `
1348
1351
  ${X.btn}
1349
- ${s && X[`btn-${s}`]}
1350
- ${c && X[`${c}-btn`]}
1351
- ${l && !o ? X[`icon-${l}`] : ""}
1352
- ${r || ""}
1353
- `.replace(/\s+/g, " ").trim(), f = ["ui-button-container"];
1354
- return f.push(X.container), i && f.push(i), /* @__PURE__ */ n("div", {
1355
- className: f.join(" "),
1356
- style: a,
1357
- children: [/* @__PURE__ */ t("button", {
1358
- ...u,
1359
- className: d,
1360
- children: !o && e
1361
- }), o && /* @__PURE__ */ t("div", {
1362
- className: "ui-button-spinner " + X["wait-indicator"] + (o ? " " + X.active : ""),
1363
- children: /* @__PURE__ */ t(rt, { color: s })
1352
+ ${a && X[`btn-${a}`]}
1353
+ ${o && X[`${o}-btn`]}
1354
+ ${s && !i ? X[`icon-${s}`] : ""}
1355
+ ${t || ""}
1356
+ `.replace(/\s+/g, " ").trim(), u = ["ui-button-container"];
1357
+ return u.push(X.container), n && u.push(n), /* @__PURE__ */ p("div", {
1358
+ className: u.join(" "),
1359
+ style: r,
1360
+ children: [/* @__PURE__ */ f("button", {
1361
+ ...c,
1362
+ className: l,
1363
+ children: !i && e
1364
+ }), i && /* @__PURE__ */ f("div", {
1365
+ className: "ui-button-spinner " + X["wait-indicator"] + (i ? " " + X.active : ""),
1366
+ children: /* @__PURE__ */ f(rt, { color: a })
1364
1367
  })]
1365
1368
  });
1366
1369
  }, pt = {
@@ -1369,72 +1372,72 @@ var nt = () => {
1369
1372
  new: "style-module__new__fOnXf",
1370
1373
  close: "style-module__close__9k-p1",
1371
1374
  wait: "style-module__wait__qnGnj"
1372
- }, mt = ({ onChange: e, onClick: r, onId: i, onRemove: a, ...o }) => {
1373
- let { base64: s, src: c } = o, [u, d] = p(!0), m = f(!1), h = f(), _ = (e) => {
1374
- h.current = e, typeof i == "function" && i(e);
1375
+ }, mt = ({ onChange: e, onClick: t, onId: n, onRemove: r, ...i }) => {
1376
+ let { base64: a, src: s } = i, [c, d] = u(!0), m = l(!1), h = l(), _ = (e) => {
1377
+ h.current = e, typeof n == "function" && n(e);
1375
1378
  };
1376
- return l(() => {
1377
- typeof e != "function" || c || e({
1378
- ...o,
1379
+ return o(() => {
1380
+ typeof e != "function" || s || e({
1381
+ ...i,
1379
1382
  setWait: d,
1380
1383
  setId: _,
1381
1384
  id: h.current
1382
1385
  });
1383
- }, []), /* @__PURE__ */ n("span", {
1386
+ }, []), /* @__PURE__ */ p("span", {
1384
1387
  className: pt.image,
1385
1388
  onClick: () => {
1386
- typeof r == "function" && r({
1387
- ...o,
1389
+ typeof t == "function" && t({
1390
+ ...i,
1388
1391
  setWait: d,
1389
1392
  setId: _,
1390
1393
  id: h.current
1391
1394
  });
1392
1395
  },
1393
1396
  children: [
1394
- /* @__PURE__ */ t("span", {
1397
+ /* @__PURE__ */ f("span", {
1395
1398
  className: pt.close,
1396
1399
  onClick: (e) => {
1397
1400
  if (!e.target) return;
1398
1401
  let t = e.target;
1399
- m.current && (m.current = !1, t.blur(), typeof a == "function" && a()), m.current = !0;
1402
+ m.current && (m.current = !1, t.blur(), typeof r == "function" && r()), m.current = !0;
1400
1403
  },
1401
1404
  onBlur: () => {
1402
1405
  m.current = !1;
1403
1406
  },
1404
1407
  tabIndex: 1
1405
1408
  }),
1406
- /* @__PURE__ */ t("img", {
1407
- src: c ?? s?.toString(),
1409
+ /* @__PURE__ */ f("img", {
1410
+ src: s ?? a?.toString(),
1408
1411
  onLoad: () => {
1409
1412
  d(!1);
1410
1413
  }
1411
1414
  }),
1412
- u && /* @__PURE__ */ t("span", {
1415
+ c && /* @__PURE__ */ f("span", {
1413
1416
  className: pt.wait,
1414
- children: /* @__PURE__ */ t(g, {})
1417
+ children: /* @__PURE__ */ f(g, {})
1415
1418
  })
1416
1419
  ]
1417
1420
  });
1418
- }, ht = ({ imagesArray: e, onChange: r, onChangeArray: i, onClick: a }) => {
1419
- let [o, s] = p([]), c = (e) => {
1420
- s((t) => [...t, { ...e }]);
1421
- }, u = (e) => (t) => {
1422
- s((n) => n.map((n) => (e === n && (n.id = t), n)));
1423
- }, d = (e) => () => s((t) => t.filter((t) => t !== e));
1424
- return l(() => {
1425
- typeof i == "function" && i(o);
1426
- }, [o]), l(() => {
1427
- e && s(e);
1428
- }, [e]), /* @__PURE__ */ n("div", {
1421
+ }, ht = ({ imagesArray: e, onChange: t, onChangeArray: n, onClick: r }) => {
1422
+ let [i, a] = u([]), s = (e) => {
1423
+ a((t) => [...t, { ...e }]);
1424
+ }, c = (e) => (t) => {
1425
+ a((n) => n.map((n) => (e === n && (n.id = t), n)));
1426
+ }, l = (e) => () => a((t) => t.filter((t) => t !== e));
1427
+ return o(() => {
1428
+ typeof n == "function" && n(i);
1429
+ }, [i]), o(() => {
1430
+ e && a(e);
1431
+ }, [e]), /* @__PURE__ */ p("div", {
1429
1432
  className: pt.container,
1430
- children: [o.map((e, n) => /* @__PURE__ */ t(mt, {
1433
+ children: [i.map((e, n) => /* @__PURE__ */ f(mt, {
1431
1434
  ...e,
1432
- onChange: r,
1433
- onClick: a,
1434
- onRemove: d(e),
1435
- onId: u(e)
1436
- }, e.name + n)), /* @__PURE__ */ t(dt, {
1437
- onChange: c,
1435
+ onChange: t,
1436
+ onClick: r,
1437
+ onRemove: l(e),
1438
+ onId: c(e)
1439
+ }, e.name + n)), /* @__PURE__ */ f(dt, {
1440
+ onChange: s,
1438
1441
  accept: ["image/png"],
1439
1442
  className: pt.new,
1440
1443
  multiple: !0
@@ -1444,27 +1447,27 @@ var nt = () => {
1444
1447
  container: "style-module__container__tUkU0",
1445
1448
  text: "style-module__text__5dksK",
1446
1449
  indicator: "style-module__indicator__BdmZs"
1447
- }, _t = o(({ type: e = "checkbox", hiddenContainer: r = !0, placeholder: i, onChecked: a, onChange: o, ...s }, c) => {
1448
- let l = (e) => {
1449
- typeof o == "function" && o(e), typeof a == "function" && a(e.target.checked, s.value);
1450
+ }, _t = r(({ type: e = "checkbox", hiddenContainer: t = !0, placeholder: n, onChecked: r, onChange: i, ...a }, o) => {
1451
+ let s = (e) => {
1452
+ typeof i == "function" && i(e), typeof r == "function" && r(e.target.checked, a.value);
1450
1453
  };
1451
- return /* @__PURE__ */ t(Y, {
1452
- ...s,
1453
- hiddenContainer: r,
1454
- children: (r) => /* @__PURE__ */ n("div", {
1454
+ return /* @__PURE__ */ f(Y, {
1455
+ ...a,
1456
+ hiddenContainer: t,
1457
+ children: (t) => /* @__PURE__ */ p("div", {
1455
1458
  className: "ui-checkbox-container " + gt.container,
1456
1459
  children: [
1457
- /* @__PURE__ */ t("input", {
1458
- ...r,
1459
- className: "ui-checkbox" + (r.className ? " " + r.className : ""),
1460
+ /* @__PURE__ */ f("input", {
1461
+ ...t,
1462
+ className: "ui-checkbox" + (t.className ? " " + t.className : ""),
1460
1463
  type: e,
1461
- onChange: l,
1462
- ref: c
1464
+ onChange: s,
1465
+ ref: o
1463
1466
  }),
1464
- /* @__PURE__ */ t("span", { className: "ui-checkbox-indicator " + gt.indicator }),
1465
- /* @__PURE__ */ t("span", {
1467
+ /* @__PURE__ */ f("span", { className: "ui-checkbox-indicator " + gt.indicator }),
1468
+ /* @__PURE__ */ f("span", {
1466
1469
  className: "ui-checkbox-text " + gt.text,
1467
- children: i
1470
+ children: n
1468
1471
  })
1469
1472
  ]
1470
1473
  })
@@ -1475,11 +1478,11 @@ var nt = () => {
1475
1478
  up: "style-module__up__4e9Cz",
1476
1479
  left: "style-module__left__tsvvk",
1477
1480
  right: "style-module__right__-YgfC"
1478
- }, yt = ({ className: e, direction: n = "down", ...r }) => {
1479
- let i = ["ui-component-arrow"];
1480
- return i.push(vt.container), n && i.push(vt[n]), e && i.push(e), /* @__PURE__ */ t("div", {
1481
- ...r,
1482
- className: i.join(" ")
1481
+ }, yt = ({ className: e, direction: t = "down", ...n }) => {
1482
+ let r = ["ui-component-arrow"];
1483
+ return r.push(vt.container), t && r.push(vt[t]), e && r.push(e), /* @__PURE__ */ f("div", {
1484
+ ...n,
1485
+ className: r.join(" ")
1483
1486
  });
1484
1487
  }, Z = {
1485
1488
  "container-element": "style-module__container-element__bbCnL",
@@ -1500,15 +1503,15 @@ var nt = () => {
1500
1503
  }, bt = "ui-", Q = (e, t, n) => {
1501
1504
  let r = bt + (n ? n + "-" : "");
1502
1505
  return Array.isArray(e) ? e.map(() => Q(e, t, r)).join(" ") : `${t[e]} ${r}${e}`;
1503
- }, xt = a({
1506
+ }, xt = n({
1504
1507
  selected: "",
1505
1508
  emptyValue: { current: {} },
1506
1509
  setSelect: (e) => {},
1507
1510
  setSelected: (e) => {},
1508
1511
  setTitle: (e) => {}
1509
- }), St = o(({ children: e, onChangeSelect: r, value: i, formvalue: a, ...o }, s) => {
1510
- let c = f(null), m = f(null), h = f(!1), [g, _] = p(!1), [v, y] = p(""), [b, x] = p(), S = () => {
1511
- o.disabled || _(!0);
1512
+ }), St = r(({ children: e, onChangeSelect: t, value: n, formvalue: r, ...i }, a) => {
1513
+ let d = l(null), m = l(null), h = l(!1), [g, _] = u(!1), [v, y] = u(""), [b, x] = u(), S = () => {
1514
+ i.disabled || _(!0);
1512
1515
  }, C = () => {
1513
1516
  _(!1);
1514
1517
  }, w = () => {
@@ -1518,31 +1521,31 @@ var nt = () => {
1518
1521
  let t = new Event("input", { bubbles: !0 });
1519
1522
  m.current.dispatchEvent(t);
1520
1523
  }, T = (e) => {
1521
- typeof r == "function" && r(e), i === void 0 && y(e), C();
1524
+ typeof t == "function" && t(e), n === void 0 && y(e), C();
1522
1525
  }, E = (e) => {
1523
- o.disabled || (typeof o.onInput == "function" && o.onInput(e), typeof o.onChange == "function" && o.onChange(e), y(e.target.value));
1526
+ i.disabled || (typeof i.onInput == "function" && i.onInput(e), typeof i.onChange == "function" && i.onChange(e), y(e.target.value));
1524
1527
  };
1525
- l(() => {
1528
+ o(() => {
1526
1529
  v && ee(v);
1527
- }, [v]), l(() => {
1528
- y(String(i ?? a));
1529
- }, [i, a]), l(() => {
1530
- let e = c.current, t = e.classList;
1530
+ }, [v]), o(() => {
1531
+ y(String(n ?? r));
1532
+ }, [n, r]), o(() => {
1533
+ let e = d.current, t = e.classList;
1531
1534
  g ? (t.remove(Z.hidden), requestAnimationFrame(() => {
1532
1535
  t.add(Z.opened), e?.focus();
1533
1536
  })) : (t.contains(Z.opened) && (e.ontransitionend = () => {
1534
1537
  t.add(Z.hidden), e.ontransitionend = null;
1535
1538
  }), t.remove(Z.opened));
1536
- }, [g]), u(s, () => m.current, []);
1537
- let D = d(() => {
1539
+ }, [g]), s(a, () => m.current, []);
1540
+ let D = c(() => {
1538
1541
  let e = [Q("container", Z, "select")];
1539
1542
  return e.push(Z.hidden), e;
1540
1543
  }, []);
1541
- return /* @__PURE__ */ t(Y, {
1542
- ...o,
1544
+ return /* @__PURE__ */ f(Y, {
1545
+ ...i,
1543
1546
  classNameContainer: Q("container-element", Z, "select"),
1544
1547
  withBorder: !0,
1545
- children: (r) => /* @__PURE__ */ n(xt.Provider, {
1548
+ children: (t) => /* @__PURE__ */ p(xt.Provider, {
1546
1549
  value: {
1547
1550
  selected: v,
1548
1551
  emptyValue: h,
@@ -1550,58 +1553,58 @@ var nt = () => {
1550
1553
  setSelected: y,
1551
1554
  setTitle: x
1552
1555
  },
1553
- children: [/* @__PURE__ */ t("input", {
1554
- ...r,
1556
+ children: [/* @__PURE__ */ f("input", {
1557
+ ...t,
1555
1558
  type: "hidden",
1556
1559
  value: v,
1557
1560
  onInput: E,
1558
1561
  ref: m
1559
- }), /* @__PURE__ */ n("div", {
1562
+ }), /* @__PURE__ */ p("div", {
1560
1563
  className: D.join(" "),
1561
- ref: c,
1564
+ ref: d,
1562
1565
  tabIndex: 1,
1563
1566
  onBlur: C,
1564
- children: [/* @__PURE__ */ n("div", {
1567
+ children: [/* @__PURE__ */ p("div", {
1565
1568
  className: Z.select,
1566
1569
  onClick: w,
1567
- children: [/* @__PURE__ */ t("span", {
1570
+ children: [/* @__PURE__ */ f("span", {
1568
1571
  className: Q("title", Z, "select"),
1569
1572
  children: b
1570
- }), /* @__PURE__ */ t(yt, { className: Q("arrow", Z, "select") })]
1571
- }), /* @__PURE__ */ t("ul", {
1573
+ }), /* @__PURE__ */ f(yt, { className: Q("arrow", Z, "select") })]
1574
+ }), /* @__PURE__ */ f("ul", {
1572
1575
  className: Q("select-list", Z, "select"),
1573
1576
  children: e
1574
1577
  })]
1575
1578
  })]
1576
1579
  })
1577
1580
  });
1578
- }), Ct = ({ children: e, value: n, disabled: r, hidden: i, onClick: a, ...o }) => {
1579
- let s = c(xt), u = (e) => {
1580
- n === void 0 || r || (s.setSelect(n), typeof a == "function" && a(e));
1581
+ }), Ct = ({ children: e, value: t, disabled: n, hidden: r, onClick: i, ...s }) => {
1582
+ let l = a(xt), u = (e) => {
1583
+ t === void 0 || n || (l.setSelect(t), typeof i == "function" && i(e));
1581
1584
  };
1582
- if (l(() => {
1583
- e && (n === s.selected || !s.emptyValue.current) && (s.setTitle(e), !s.emptyValue.current && n && s.setSelected(n), s.emptyValue.current = !0);
1584
- }, [s.selected, s.emptyValue.current]), i) return null;
1585
- let f = d(() => {
1585
+ if (o(() => {
1586
+ e && (t === l.selected || !l.emptyValue.current) && (l.setTitle(e), !l.emptyValue.current && t && l.setSelected(t), l.emptyValue.current = !0);
1587
+ }, [l.selected, l.emptyValue.current]), r) return null;
1588
+ let d = c(() => {
1586
1589
  let e = [Q("ui-select-option", Z, "select")];
1587
- return e.push(Z.option), s.selected === n && e.push(Z.active, "active"), r && e.push(Z.disabled, "disabled"), e;
1588
- }, [s.selected, r]);
1589
- return /* @__PURE__ */ t("li", {
1590
- ...o,
1590
+ return e.push(Z.option), l.selected === t && e.push(Z.active, "active"), n && e.push(Z.disabled, "disabled"), e;
1591
+ }, [l.selected, n]);
1592
+ return /* @__PURE__ */ f("li", {
1593
+ ...s,
1591
1594
  onClick: u,
1592
- className: f.join(" "),
1595
+ className: d.join(" "),
1593
1596
  children: e
1594
1597
  });
1595
- }, wt = ({ children: e, label: r }) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("ul", {
1598
+ }, wt = ({ children: e, label: t }) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ p("ul", {
1596
1599
  className: Z.optgpoup,
1597
- children: [r && /* @__PURE__ */ t("li", {
1600
+ children: [t && /* @__PURE__ */ f("li", {
1598
1601
  className: Z.label,
1599
- children: r
1602
+ children: t
1600
1603
  }), e]
1601
1604
  }) }), Tt = {
1602
- ...o(({ ...e }, n) => /* @__PURE__ */ t(St, {
1605
+ ...r(({ ...e }, t) => /* @__PURE__ */ f(St, {
1603
1606
  ...e,
1604
- ref: n
1607
+ ref: t
1605
1608
  })),
1606
1609
  Option: Ct,
1607
1610
  Optgroup: wt
@@ -1616,30 +1619,30 @@ var nt = () => {
1616
1619
  opened: "style-module__opened__GjGrB",
1617
1620
  arrow: "style-module__arrow__SCvqs",
1618
1621
  item: "style-module__item__v8SnZ"
1619
- }, Et = ({ items: e, isOpen: n, enableRerenderItems: r, disabled: i }) => {
1620
- let a = f(null), o = d(() => r ? n ? e : null : e, [
1621
- r,
1622
+ }, Et = ({ items: e, isOpen: t, enableRerenderItems: n, disabled: r }) => {
1623
+ let i = l(null), a = c(() => n ? t ? e : null : e, [
1624
+ n,
1622
1625
  e,
1623
- n
1626
+ t
1624
1627
  ]);
1625
- return l(() => {
1626
- a.current && (window.innerWidth, a.current.getBoundingClientRect().left);
1627
- }, [n]), i ? null : /* @__PURE__ */ t("ul", {
1628
+ return o(() => {
1629
+ i.current && (window.innerWidth, i.current.getBoundingClientRect().left);
1630
+ }, [t]), r ? null : /* @__PURE__ */ f("ul", {
1628
1631
  className: `${$["dropdown-list"]} ui-dropdown-list`,
1629
- children: o,
1630
- ref: a
1632
+ children: a,
1633
+ ref: i
1631
1634
  });
1632
- }, Dt = a({ close: () => {} }), Ot = ({ children: e, className: r, items: i, arrow: a = !0, direction: o = "down", position: s = "right", split: c = !1, disabled: u, hover: m = !1, enableRerenderItems: h = !0, onShow: g, onHide: _, ...v }) => {
1633
- let y = f(null), b = f(null), [x, S] = p(!1), C = () => {
1635
+ }, Dt = n({ close: () => {} }), Ot = ({ children: e, className: t, items: n, arrow: r = !0, direction: i = "down", position: a = "right", split: s = !1, disabled: d, hover: m = !1, enableRerenderItems: h = !0, onShow: g, onHide: _, ...v }) => {
1636
+ let y = l(null), b = l(null), [x, S] = u(!1), C = () => {
1634
1637
  S(!1);
1635
1638
  }, w = () => {
1636
1639
  S(!0);
1637
1640
  }, ee = () => {
1638
- S((e) => u ? !1 : !e);
1641
+ S((e) => d ? !1 : !e);
1639
1642
  }, T = () => {
1640
1643
  ee();
1641
1644
  }, E = () => {
1642
- b.current || (!c || m) && ee();
1645
+ b.current || (!s || m) && ee();
1643
1646
  }, D = (e) => {
1644
1647
  e.currentTarget.contains(e.relatedTarget) || C();
1645
1648
  }, O = () => {
@@ -1647,21 +1650,21 @@ var nt = () => {
1647
1650
  }, k = () => {
1648
1651
  b.current &&= (clearTimeout(b.current), null);
1649
1652
  };
1650
- l(() => {
1653
+ o(() => {
1651
1654
  let e = y.current, t = e?.classList;
1652
1655
  x ? (t?.add($.opened), e?.focus(), typeof g == "function" && g()) : (t?.remove($.opened), typeof _ == "function" && _());
1653
1656
  }, [x]);
1654
- let A = d(() => {
1657
+ let A = c(() => {
1655
1658
  let e = ["ui-dropdown"];
1656
- return e.push($.container), r && e.push(r), o && e.push($[o]), s && e.push($[s]), e.join(" ");
1659
+ return e.push($.container), t && e.push(t), i && e.push($[i]), a && e.push($[a]), e.join(" ");
1657
1660
  }, [
1658
- r,
1659
- o,
1660
- s
1661
+ t,
1662
+ i,
1663
+ a
1661
1664
  ]);
1662
- return /* @__PURE__ */ t(Dt.Provider, {
1665
+ return /* @__PURE__ */ f(Dt.Provider, {
1663
1666
  value: { close: C },
1664
- children: /* @__PURE__ */ n("div", {
1667
+ children: /* @__PURE__ */ p("div", {
1665
1668
  ...v,
1666
1669
  className: A,
1667
1670
  ref: y,
@@ -1670,42 +1673,42 @@ var nt = () => {
1670
1673
  tabIndex: 1,
1671
1674
  onBlur: D,
1672
1675
  children: [
1673
- s === "left" && !u && /* @__PURE__ */ t(yt, {
1676
+ a === "left" && !d && /* @__PURE__ */ f(yt, {
1674
1677
  className: $.arrow,
1675
1678
  onClick: T
1676
1679
  }),
1677
- /* @__PURE__ */ t("div", {
1680
+ /* @__PURE__ */ f("div", {
1678
1681
  onClick: E,
1679
1682
  className: "ui-dropdown-block" + (x ? " " + $.hide : ""),
1680
1683
  children: e
1681
1684
  }),
1682
- s === "right" && !u && a && /* @__PURE__ */ t(yt, {
1685
+ a === "right" && !d && r && /* @__PURE__ */ f(yt, {
1683
1686
  className: $.arrow,
1684
1687
  onClick: T
1685
1688
  }),
1686
- /* @__PURE__ */ t(Et, {
1689
+ /* @__PURE__ */ f(Et, {
1687
1690
  isOpen: x,
1688
- disabled: u,
1691
+ disabled: d,
1689
1692
  enableRerenderItems: h,
1690
- items: i
1693
+ items: n
1691
1694
  })
1692
1695
  ]
1693
1696
  })
1694
1697
  });
1695
- }, kt = ({ children: e, onClick: n, autoClose: r = !0, active: i, className: a, ...o }) => {
1696
- let s = c(Dt), l = (e) => {
1697
- typeof n == "function" && n(e), r && s.close();
1698
- }, u = ["ui-dropdown-item"];
1699
- return u.push($.item), i && u.push($.active, "active"), a && u.push(a), /* @__PURE__ */ t("li", {
1698
+ }, kt = ({ children: e, onClick: t, autoClose: n = !0, active: r, className: i, ...o }) => {
1699
+ let s = a(Dt), c = (e) => {
1700
+ typeof t == "function" && t(e), n && s.close();
1701
+ }, l = ["ui-dropdown-item"];
1702
+ return l.push($.item), r && l.push($.active, "active"), i && l.push(i), /* @__PURE__ */ f("li", {
1700
1703
  ...o,
1701
- onClick: l,
1702
- className: u.join(" "),
1704
+ onClick: c,
1705
+ className: l.join(" "),
1703
1706
  children: typeof e == "function" ? e(s) : e
1704
1707
  });
1705
1708
  }, At = {
1706
- ...o(({ ...e }, n) => /* @__PURE__ */ t(Ot, { ...e })),
1709
+ ...r(({ ...e }, t) => /* @__PURE__ */ f(Ot, { ...e })),
1707
1710
  Item: kt
1708
- }, jt = a({}), Mt = ({ children: e }) => /* @__PURE__ */ t(jt.Provider, {
1711
+ }, jt = n({}), Mt = ({ children: e }) => /* @__PURE__ */ f(jt.Provider, {
1709
1712
  value: {},
1710
1713
  children: e
1711
1714
  });