@banzamel/mineralui 1.11.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/MConflictIllustration-DfNfvv7Q.cjs +2 -0
- package/dist/MConflictIllustration-DfNfvv7Q.cjs.map +1 -0
- package/dist/{MConflictIllustration-Ctggjn7z.js → MConflictIllustration-Drsm8_8C.js} +41 -99
- package/dist/MConflictIllustration-Drsm8_8C.js.map +1 -0
- package/dist/{cards-CvgcQCAP.js → cards-C2t-pM0r.js} +12 -11
- package/dist/cards-C2t-pM0r.js.map +1 -0
- package/dist/{cards-O0osWbUF.cjs → cards-D7_hH3Q8.cjs} +2 -2
- package/dist/cards-D7_hH3Q8.cjs.map +1 -0
- package/dist/cards.cjs +1 -1
- package/dist/cards.js +1 -1
- package/dist/components/inputs/MInputUrl/MInputUrl.d.ts +3 -0
- package/dist/components/inputs/MInputUrl/MInputUrl.types.d.ts +27 -0
- package/dist/components/inputs/MInputUrl/index.d.ts +2 -0
- package/dist/components/inputs/index.d.ts +2 -0
- package/dist/{dropdowns-C9jREjLg.js → dropdowns-BJ8s18h2.js} +2 -2
- package/dist/dropdowns-BJ8s18h2.js.map +1 -0
- package/dist/{dropdowns-BP2HBR-x.cjs → dropdowns-BLd4lyr6.cjs} +2 -2
- package/dist/dropdowns-BLd4lyr6.cjs.map +1 -0
- package/dist/dropdowns.cjs +1 -1
- package/dist/dropdowns.js +1 -1
- package/dist/{form-D5F1kTIA.cjs → form-Bni0Gf_s.cjs} +2 -2
- package/dist/{form-D5F1kTIA.cjs.map → form-Bni0Gf_s.cjs.map} +1 -1
- package/dist/{form-CWoOQ_qo.js → form-CFhDAU18.js} +2 -2
- package/dist/{form-CWoOQ_qo.js.map → form-CFhDAU18.js.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +1 -1
- package/dist/i18n/frameworkTexts.d.ts +0 -29
- package/dist/illustrations/index.d.ts +0 -1
- package/dist/illustrations.cjs +1 -1
- package/dist/illustrations.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +42 -42
- package/dist/inputs-BpdfT9Hp.cjs +2 -0
- package/dist/inputs-BpdfT9Hp.cjs.map +1 -0
- package/dist/{inputs-bbwdb6m3.js → inputs-CyDoEfL3.js} +333 -284
- package/dist/inputs-CyDoEfL3.js.map +1 -0
- package/dist/inputs.cjs +1 -1
- package/dist/inputs.js +3 -3
- package/dist/style-runtime.cjs +1 -1
- package/dist/style-runtime.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/validators.d.ts +14 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +2 -2
- package/dist/{validators-DRhikiAi.cjs → validators-B6yWdsu2.cjs} +2 -2
- package/dist/{validators-DRhikiAi.cjs.map → validators-B6yWdsu2.cjs.map} +1 -1
- package/dist/{validators-D5OCyV2h.js → validators-DVYOtFnw.js} +19 -2
- package/dist/{validators-D5OCyV2h.js.map → validators-DVYOtFnw.js.map} +1 -1
- package/package.json +1 -1
- package/dist/MConflictIllustration-CfYeZVmf.cjs +0 -2
- package/dist/MConflictIllustration-CfYeZVmf.cjs.map +0 -1
- package/dist/MConflictIllustration-Ctggjn7z.js.map +0 -1
- package/dist/cards-CvgcQCAP.js.map +0 -1
- package/dist/cards-O0osWbUF.cjs.map +0 -1
- package/dist/dropdowns-BP2HBR-x.cjs.map +0 -1
- package/dist/dropdowns-C9jREjLg.js.map +0 -1
- package/dist/illustrations/scenes/MCookieConsentIllustration.d.ts +0 -2
- package/dist/inputs-D38ib0gM.cjs +0 -2
- package/dist/inputs-D38ib0gM.cjs.map +0 -1
- package/dist/inputs-bbwdb6m3.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { $n as e, Fr as t, Gi as n, Gr as r, Hi as i, Ir as a, Ki as o, Kr as s,
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { r as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { n as
|
|
12
|
-
import { forwardRef as q, isValidElement as
|
|
1
|
+
import { $n as e, Fr as t, Gi as n, Gr as r, Hi as i, Ir as a, Ki as o, Kr as s, On as c, Pi as l, Ur as u, Vi as d, Vr as f, Wr as p, ar as m, ci as h, gi as g, ii as _, ji as v, ki as y, li as b, ni as x, oi as S, or as C, pi as w, pr as T, si as E, sr as D, ui as O } from "./icons-DLP-Rs6z.js";
|
|
2
|
+
import { t as k } from "./cn-YER3QsV1.js";
|
|
3
|
+
import { S as A, _ as j, a as M, b as N, d as P, i as F, m as I, n as L, o as R, p as ee, r as z, s as B, u as V, v as H, y as te } from "./validators-DVYOtFnw.js";
|
|
4
|
+
import { a as U, i as ne, n as W, r as re } from "./creditCards-D_iWmtG6.js";
|
|
5
|
+
import { a as ie, c as ae, d as oe, i as se, n as ce, o as le, r as ue, s as de, u as G } from "./formatters-T0vvjMtB.js";
|
|
6
|
+
import { t as fe } from "./useGhostText-DG0bzcao.js";
|
|
7
|
+
import { t as pe } from "./useInteractionEffect-DtpbVd77.js";
|
|
8
|
+
import { r as me, t as he } from "./MButton-C94fZ3l9.js";
|
|
9
|
+
import { t as ge } from "./MCheckbox-B-nT2OBE.js";
|
|
10
|
+
import { t as _e } from "./MSlider-5141rKeH.js";
|
|
11
|
+
import { n as ve, t as K } from "./MInput-CkbgK8eU.js";
|
|
12
|
+
import { forwardRef as q, isValidElement as ye, useCallback as J, useEffect as Y, useMemo as be, useRef as X, useState as Z } from "react";
|
|
13
13
|
import { jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/inputs/MTextarea/MTextarea.tsx
|
|
15
|
-
var
|
|
16
|
-
let [L, R] = Z(!1), ee = X(null), { currentValue: z, setCurrentValue: B } =
|
|
15
|
+
var xe = q(function({ value: e, defaultValue: t, name: n, id: r, placeholder: i, disabled: a = !1, readOnly: o = !1, required: s = !1, autoFocus: c = !1, rows: l = 3, autoResize: u = !1, minRows: d, maxRows: f, variant: p = "outlined", size: m = "md", color: h, fullWidth: g = !1, label: _, helperText: v, errorText: y, error: b = !1, success: x = !1, maxLength: S, showCharCount: C = !1, ghostOptions: w, ghostMinChars: T = 2, onGhostAccept: E, loading: D = !1, onChange: O, onFocus: A, onBlur: j, className: M, style: N, textareaClassName: P, labelClassName: F }, I) {
|
|
16
|
+
let [L, R] = Z(!1), ee = X(null), { currentValue: z, setCurrentValue: B } = ve(e, t), V = fe({
|
|
17
17
|
options: w ?? [],
|
|
18
18
|
value: z,
|
|
19
19
|
minChars: T
|
|
@@ -32,14 +32,14 @@ var ye = q(function({ value: e, defaultValue: t, name: n, id: r, placeholder: i,
|
|
|
32
32
|
Y(() => {
|
|
33
33
|
ne();
|
|
34
34
|
}, [z, ne]);
|
|
35
|
-
let
|
|
35
|
+
let W = J((e) => {
|
|
36
36
|
R(!0), A?.(e);
|
|
37
|
-
}, [A]),
|
|
37
|
+
}, [A]), re = J((e) => {
|
|
38
38
|
R(!1), j?.(e);
|
|
39
|
-
}, [j]),
|
|
40
|
-
B(e.target.value),
|
|
39
|
+
}, [j]), ie = J((e) => {
|
|
40
|
+
B(e.target.value), O?.(e), V.reset();
|
|
41
41
|
}, [
|
|
42
|
-
|
|
42
|
+
O,
|
|
43
43
|
B,
|
|
44
44
|
V.reset
|
|
45
45
|
]), ae = J((e) => {
|
|
@@ -56,14 +56,14 @@ var ye = q(function({ value: e, defaultValue: t, name: n, id: r, placeholder: i,
|
|
|
56
56
|
B,
|
|
57
57
|
E,
|
|
58
58
|
U
|
|
59
|
-
]), oe =
|
|
59
|
+
]), oe = k("container", `field-${p}`, `field-${m}`, L && "focused", H && "error", x && !H && "success", a && "disabled");
|
|
60
60
|
return /* @__PURE__ */ $("div", {
|
|
61
|
-
className:
|
|
61
|
+
className: k("textarea", te, g && "full-width", M),
|
|
62
62
|
style: N,
|
|
63
63
|
children: [
|
|
64
64
|
_ && /* @__PURE__ */ Q("label", {
|
|
65
65
|
htmlFor: r,
|
|
66
|
-
className:
|
|
66
|
+
className: k("field-label", L && "focused", H && "error", x && !H && "success", s && "required", F),
|
|
67
67
|
children: _
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ $("div", {
|
|
@@ -82,10 +82,10 @@ var ye = q(function({ value: e, defaultValue: t, name: n, id: r, placeholder: i,
|
|
|
82
82
|
rows: u ? d ?? l : l,
|
|
83
83
|
maxLength: S,
|
|
84
84
|
value: z,
|
|
85
|
-
className:
|
|
86
|
-
onChange:
|
|
87
|
-
onFocus:
|
|
88
|
-
onBlur:
|
|
85
|
+
className: k("field", P),
|
|
86
|
+
onChange: ie,
|
|
87
|
+
onFocus: W,
|
|
88
|
+
onBlur: re,
|
|
89
89
|
onKeyDown: ae,
|
|
90
90
|
"aria-invalid": H || void 0,
|
|
91
91
|
"aria-describedby": y ? `${r}-error` : v ? `${r}-helper` : void 0
|
|
@@ -112,13 +112,13 @@ var ye = q(function({ value: e, defaultValue: t, name: n, id: r, placeholder: i,
|
|
|
112
112
|
rows: u ? d ?? l : l,
|
|
113
113
|
maxLength: S,
|
|
114
114
|
value: z,
|
|
115
|
-
className:
|
|
116
|
-
onChange:
|
|
117
|
-
onFocus:
|
|
118
|
-
onBlur:
|
|
115
|
+
className: k("field", P),
|
|
116
|
+
onChange: ie,
|
|
117
|
+
onFocus: W,
|
|
118
|
+
onBlur: re,
|
|
119
119
|
"aria-invalid": H || void 0,
|
|
120
120
|
"aria-describedby": y ? `${r}-error` : v ? `${r}-helper` : void 0
|
|
121
|
-
}), D && /* @__PURE__ */ Q(
|
|
121
|
+
}), D && /* @__PURE__ */ Q(me, {
|
|
122
122
|
size: "sm",
|
|
123
123
|
color: h,
|
|
124
124
|
className: "textarea-spinner"
|
|
@@ -136,7 +136,7 @@ var ye = q(function({ value: e, defaultValue: t, name: n, id: r, placeholder: i,
|
|
|
136
136
|
className: "field-helper",
|
|
137
137
|
children: v
|
|
138
138
|
})] }), C && S && /* @__PURE__ */ $("span", {
|
|
139
|
-
className:
|
|
139
|
+
className: k("char-count", z.length > S && "over"),
|
|
140
140
|
children: [
|
|
141
141
|
z.length,
|
|
142
142
|
"/",
|
|
@@ -149,17 +149,17 @@ var ye = q(function({ value: e, defaultValue: t, name: n, id: r, placeholder: i,
|
|
|
149
149
|
});
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region src/components/inputs/MInputPassword/MInputPassword.tsx
|
|
152
|
-
function
|
|
152
|
+
function Se(e) {
|
|
153
153
|
let t = 0;
|
|
154
154
|
return e.length >= 8 && t++, e.length >= 12 && t++, /[a-z]/.test(e) && /[A-Z]/.test(e) && t++, /\d/.test(e) && t++, /[^a-zA-Z0-9]/.test(e) && t++, t <= 1 ? "weak" : t <= 2 ? "fair" : t <= 3 ? "good" : "strong";
|
|
155
155
|
}
|
|
156
|
-
var
|
|
156
|
+
var Ce = {
|
|
157
157
|
weak: "Weak",
|
|
158
158
|
fair: "Fair",
|
|
159
159
|
good: "Good",
|
|
160
160
|
strong: "Strong"
|
|
161
|
-
},
|
|
162
|
-
let [l, u] = Z(!1), [d, f] = Z(i?.toString() ?? ""),
|
|
161
|
+
}, we = q(function({ showToggle: e = !0, showStrength: t = !1, onStrengthChange: n, value: r, defaultValue: i, onChange: a, className: o, ...s }, c) {
|
|
162
|
+
let [l, u] = Z(!1), [d, f] = Z(i?.toString() ?? ""), p = r === void 0 ? d : r.toString(), h = Se(p);
|
|
163
163
|
Y(() => {
|
|
164
164
|
n?.(h);
|
|
165
165
|
}, [h, n]);
|
|
@@ -171,18 +171,18 @@ var xe = {
|
|
|
171
171
|
onClick: () => u((e) => !e),
|
|
172
172
|
tabIndex: -1,
|
|
173
173
|
"aria-label": l ? "Hide password" : "Show password",
|
|
174
|
-
children: Q(l ?
|
|
174
|
+
children: Q(l ? m : C, {})
|
|
175
175
|
}) : void 0;
|
|
176
176
|
return /* @__PURE__ */ $("div", {
|
|
177
|
-
className:
|
|
177
|
+
className: k("password input", o),
|
|
178
178
|
children: [/* @__PURE__ */ Q(K, {
|
|
179
179
|
...s,
|
|
180
180
|
ref: c,
|
|
181
181
|
type: l ? "text" : "password",
|
|
182
|
-
value:
|
|
182
|
+
value: p,
|
|
183
183
|
onChange: g,
|
|
184
184
|
endIcon: _
|
|
185
|
-
}), t &&
|
|
185
|
+
}), t && p.length > 0 && /* @__PURE__ */ $("div", {
|
|
186
186
|
className: "password strength row",
|
|
187
187
|
children: [/* @__PURE__ */ Q("div", {
|
|
188
188
|
className: "password strength bar",
|
|
@@ -191,29 +191,29 @@ var xe = {
|
|
|
191
191
|
1,
|
|
192
192
|
2,
|
|
193
193
|
3
|
|
194
|
-
].map((e) => /* @__PURE__ */ Q("div", { className:
|
|
194
|
+
].map((e) => /* @__PURE__ */ Q("div", { className: k("password strength segment", e < [
|
|
195
195
|
"weak",
|
|
196
196
|
"fair",
|
|
197
197
|
"good",
|
|
198
198
|
"strong"
|
|
199
199
|
].indexOf(h) + 1 && `strength-${h}`) }, e))
|
|
200
200
|
}), /* @__PURE__ */ Q("span", {
|
|
201
|
-
className:
|
|
202
|
-
children:
|
|
201
|
+
className: k("password strength label", `strength-${h}`),
|
|
202
|
+
children: Ce[h]
|
|
203
203
|
})]
|
|
204
204
|
})]
|
|
205
205
|
});
|
|
206
206
|
});
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region src/components/inputs/MInputNumber/MInputNumber.tsx
|
|
209
|
-
function
|
|
209
|
+
function Te(e, t, n) {
|
|
210
210
|
return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Ee(e, t) {
|
|
213
213
|
let n = 10 ** t;
|
|
214
214
|
return Math.round(e * n) / n;
|
|
215
215
|
}
|
|
216
|
-
var
|
|
216
|
+
var De = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precision: a = 0, allowNegative: o = !0, onValueChange: s, value: c, defaultValue: l, onChange: u, onKeyDown: f, onBlur: p, disabled: m = !1, className: h, ...g }, _) {
|
|
217
217
|
let [v, y] = Z(l?.toString() ?? ""), b = c === void 0 ? v : c.toString(), x = X(null), S = X(b);
|
|
218
218
|
Y(() => {
|
|
219
219
|
S.current = b;
|
|
@@ -223,7 +223,7 @@ var Te = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precisio
|
|
|
223
223
|
let t = parseFloat(e);
|
|
224
224
|
s?.(isNaN(t) ? null : t);
|
|
225
225
|
}, [c, s]), w = J((r) => {
|
|
226
|
-
let i =
|
|
226
|
+
let i = Ee(Te((parseFloat(S.current) || 0) + n * r, e, t), a);
|
|
227
227
|
S.current = i.toString(), C(i.toString());
|
|
228
228
|
}, [
|
|
229
229
|
n,
|
|
@@ -239,15 +239,15 @@ var Te = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precisio
|
|
|
239
239
|
Y(() => E, [E]);
|
|
240
240
|
let D = J((e) => {
|
|
241
241
|
let t = e.target.value.replace(o ? /[^\d.,-]/g : /[^\d.,]/g, "");
|
|
242
|
-
S.current = t, C(t),
|
|
242
|
+
S.current = t, C(t), u?.(e);
|
|
243
243
|
}, [
|
|
244
|
-
|
|
244
|
+
u,
|
|
245
245
|
o,
|
|
246
246
|
C
|
|
247
|
-
]),
|
|
247
|
+
]), O = J((n) => {
|
|
248
248
|
let r = parseFloat(S.current);
|
|
249
249
|
if (!isNaN(r)) {
|
|
250
|
-
let n =
|
|
250
|
+
let n = Ee(Te(r, e, t), a);
|
|
251
251
|
S.current = n.toString(), C(n.toString());
|
|
252
252
|
}
|
|
253
253
|
p?.(n);
|
|
@@ -272,7 +272,7 @@ var Te = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precisio
|
|
|
272
272
|
onPointerCancel: E,
|
|
273
273
|
tabIndex: -1,
|
|
274
274
|
"aria-label": "Increment",
|
|
275
|
-
children: /* @__PURE__ */ Q(
|
|
275
|
+
children: /* @__PURE__ */ Q(d, {})
|
|
276
276
|
}), /* @__PURE__ */ Q("button", {
|
|
277
277
|
type: "button",
|
|
278
278
|
className: "number step button",
|
|
@@ -294,15 +294,15 @@ var Te = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precisio
|
|
|
294
294
|
inputMode: "decimal",
|
|
295
295
|
value: b,
|
|
296
296
|
onChange: D,
|
|
297
|
-
onBlur:
|
|
297
|
+
onBlur: O,
|
|
298
298
|
onKeyDown: A,
|
|
299
299
|
endIcon: j,
|
|
300
300
|
disabled: m,
|
|
301
|
-
className:
|
|
301
|
+
className: k("number input", h)
|
|
302
302
|
});
|
|
303
|
-
}),
|
|
304
|
-
let [h, g] = Z(o?.toString() ?? ""), [
|
|
305
|
-
let t =
|
|
303
|
+
}), Oe = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showValidIcon: r = !0, onValidationChange: i, value: a, defaultValue: o, onChange: s, onBlur: c, error: l, errorText: u, success: d, placeholder: f = "email@example.com", ...p }, m) {
|
|
304
|
+
let [h, g] = Z(o?.toString() ?? ""), [_, y] = Z({ valid: !0 }), [b, x] = Z(!1), S = a === void 0 ? h : a.toString(), C = J((e) => {
|
|
305
|
+
let t = R(e);
|
|
306
306
|
return y(t), i?.(t), t;
|
|
307
307
|
}, [i]), w = J((e) => {
|
|
308
308
|
a === void 0 && g(e.target.value), t && b && C(e.target.value), s?.(e);
|
|
@@ -318,7 +318,7 @@ var Te = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precisio
|
|
|
318
318
|
c,
|
|
319
319
|
e,
|
|
320
320
|
C
|
|
321
|
-
]), E = l || b && !
|
|
321
|
+
]), E = l || b && !_.valid, D = u || (b && !_.valid ? _.error : void 0), O = !E && d !== void 0 ? d : b && _.valid && S.length > 0, k = r && O ? /* @__PURE__ */ Q("span", {
|
|
322
322
|
className: "validation-icon",
|
|
323
323
|
children: /* @__PURE__ */ Q(n, {})
|
|
324
324
|
}) : void 0;
|
|
@@ -333,10 +333,59 @@ var Te = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precisio
|
|
|
333
333
|
errorText: D,
|
|
334
334
|
success: O,
|
|
335
335
|
placeholder: f,
|
|
336
|
-
startIcon: /* @__PURE__ */ Q(
|
|
336
|
+
startIcon: /* @__PURE__ */ Q(v, {}),
|
|
337
337
|
endIcon: k
|
|
338
338
|
});
|
|
339
|
-
}),
|
|
339
|
+
}), ke = ["http", "https"], Ae = q(function({ protocols: e = ke, requireProtocol: t = !0, formatOnBlur: r = !1, validateOnBlur: i = !0, validateOnChange: a = !1, showValidIcon: o = !0, onValidationChange: s, value: l, defaultValue: u, onChange: d, onBlur: f, error: p, errorText: m, success: h, placeholder: g = "https://example.com", ..._ }, v) {
|
|
340
|
+
let [y, b] = Z(u?.toString() ?? ""), [x, S] = Z({ valid: !0 }), [C, w] = Z(!1), T = l === void 0 ? y : l.toString(), E = J((n) => {
|
|
341
|
+
let r = j(n, {
|
|
342
|
+
protocols: e,
|
|
343
|
+
requireProtocol: t
|
|
344
|
+
});
|
|
345
|
+
return S(r), s?.(r), r;
|
|
346
|
+
}, [
|
|
347
|
+
e,
|
|
348
|
+
t,
|
|
349
|
+
s
|
|
350
|
+
]), D = J((e) => {
|
|
351
|
+
l === void 0 && b(e.target.value), a && C && E(e.target.value), d?.(e);
|
|
352
|
+
}, [
|
|
353
|
+
d,
|
|
354
|
+
l,
|
|
355
|
+
a,
|
|
356
|
+
C,
|
|
357
|
+
E
|
|
358
|
+
]), O = J((t) => {
|
|
359
|
+
w(!0);
|
|
360
|
+
let n = t.target.value, a = /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n);
|
|
361
|
+
r && n && !a && e.length > 0 && (n = `${e[0]}://${n}`, l === void 0 && b(n), t.target.value = n, d?.(t)), i && n && E(n), f?.(t);
|
|
362
|
+
}, [
|
|
363
|
+
f,
|
|
364
|
+
i,
|
|
365
|
+
E,
|
|
366
|
+
r,
|
|
367
|
+
e,
|
|
368
|
+
l,
|
|
369
|
+
d
|
|
370
|
+
]), k = p || C && !x.valid, A = m || (C && !x.valid ? x.error : void 0), M = !k && h !== void 0 ? h : C && x.valid && T.length > 0, N = o && M ? /* @__PURE__ */ Q("span", {
|
|
371
|
+
className: "validation-icon",
|
|
372
|
+
children: /* @__PURE__ */ Q(n, {})
|
|
373
|
+
}) : void 0;
|
|
374
|
+
return /* @__PURE__ */ Q(K, {
|
|
375
|
+
..._,
|
|
376
|
+
ref: v,
|
|
377
|
+
type: "url",
|
|
378
|
+
value: T,
|
|
379
|
+
onChange: D,
|
|
380
|
+
onBlur: O,
|
|
381
|
+
error: k,
|
|
382
|
+
errorText: A,
|
|
383
|
+
success: M,
|
|
384
|
+
placeholder: g,
|
|
385
|
+
startIcon: /* @__PURE__ */ Q(c, {}),
|
|
386
|
+
endIcon: N
|
|
387
|
+
});
|
|
388
|
+
}), je = {
|
|
340
389
|
PL: "+48",
|
|
341
390
|
DE: "+49",
|
|
342
391
|
US: "+1",
|
|
@@ -344,58 +393,58 @@ var Te = q(function({ min: e, max: t, step: n = 1, showStepper: r = !0, precisio
|
|
|
344
393
|
FR: "+33",
|
|
345
394
|
CZ: "+420",
|
|
346
395
|
SK: "+421"
|
|
347
|
-
},
|
|
348
|
-
function
|
|
396
|
+
}, Me = Object.entries(je).sort(([, e], [, t]) => t.length - e.length);
|
|
397
|
+
function Ne(e) {
|
|
349
398
|
let t = e.trim().replace(/^00/, "+");
|
|
350
399
|
if (!t.startsWith("+")) return null;
|
|
351
400
|
let n = "+" + G(t);
|
|
352
|
-
for (let [e, t] of
|
|
401
|
+
for (let [e, t] of Me) if (n.startsWith(t)) return {
|
|
353
402
|
country: e,
|
|
354
403
|
rest: n.slice(t.length)
|
|
355
404
|
};
|
|
356
405
|
return null;
|
|
357
406
|
}
|
|
358
|
-
function
|
|
407
|
+
function Pe(e) {
|
|
359
408
|
let t = e.trim();
|
|
360
409
|
return !t.startsWith("+") && !t.startsWith("00") ? !1 : G(t.startsWith("00") ? "+" + t.slice(2) : t).length <= 3;
|
|
361
410
|
}
|
|
362
|
-
function
|
|
411
|
+
function Fe(e) {
|
|
363
412
|
let t = e.trim();
|
|
364
413
|
return "+" + G(t.startsWith("00") ? t.slice(2) : t.slice(1)).slice(0, 3);
|
|
365
414
|
}
|
|
366
|
-
var
|
|
367
|
-
let [b, x] = Z((e ?? t).toUpperCase()), [S, C] = Z(u?.toString() ?? ""), [w, T] = Z({ valid: !0 }), [E, D] = Z(!1),
|
|
415
|
+
var Ie = q(function({ countryCode: e, defaultCountryCode: t = "PL", showCountryCode: n = !0, formatOnChange: r = !0, validateOnBlur: i = !0, onValidationChange: a, onValueChange: o, onCountryChange: s, onClear: c, value: l, defaultValue: u, onChange: d, onBlur: f, error: p, errorText: m, placeholder: h = "123 456 789", className: g, ..._ }, v) {
|
|
416
|
+
let [b, x] = Z((e ?? t).toUpperCase()), [S, C] = Z(u?.toString() ?? ""), [w, T] = Z({ valid: !0 }), [E, D] = Z(!1), O = (e ?? b).toUpperCase(), A = l === void 0 ? S : l.toString(), j = J((t) => {
|
|
368
417
|
let n = t.target.value;
|
|
369
418
|
if (n === "") {
|
|
370
419
|
l === void 0 && C(""), o?.("", ""), d?.(t);
|
|
371
420
|
return;
|
|
372
421
|
}
|
|
373
|
-
let i =
|
|
422
|
+
let i = Ne(n);
|
|
374
423
|
if (i) {
|
|
375
424
|
let n = i.country;
|
|
376
|
-
e === void 0 && n !==
|
|
377
|
-
let a = G(i.rest), c = r ?
|
|
425
|
+
e === void 0 && n !== O && (x(n), s?.(n));
|
|
426
|
+
let a = G(i.rest), c = r ? de(a, { countryCode: n }) : a;
|
|
378
427
|
l === void 0 && C(c), o?.(a, c), d?.(t);
|
|
379
428
|
return;
|
|
380
429
|
}
|
|
381
|
-
if (
|
|
382
|
-
let e =
|
|
430
|
+
if (Pe(n)) {
|
|
431
|
+
let e = Fe(n);
|
|
383
432
|
l === void 0 && C(e), o?.(G(e), e), d?.(t);
|
|
384
433
|
return;
|
|
385
434
|
}
|
|
386
|
-
let a = G(n), c = r ?
|
|
435
|
+
let a = G(n), c = r ? de(a, { countryCode: O }) : a;
|
|
387
436
|
l === void 0 && C(c), o?.(a, c), d?.(t);
|
|
388
437
|
}, [
|
|
389
438
|
d,
|
|
390
439
|
l,
|
|
391
440
|
r,
|
|
392
|
-
|
|
441
|
+
O,
|
|
393
442
|
e,
|
|
394
443
|
o,
|
|
395
444
|
s
|
|
396
445
|
]), M = J((e) => {
|
|
397
446
|
if (D(!0), i && A) {
|
|
398
|
-
let e =
|
|
447
|
+
let e = ee(G(A), O);
|
|
399
448
|
T(e), a?.(e);
|
|
400
449
|
}
|
|
401
450
|
f?.(e);
|
|
@@ -403,7 +452,7 @@ var Me = q(function({ countryCode: e, defaultCountryCode: t = "PL", showCountryC
|
|
|
403
452
|
f,
|
|
404
453
|
i,
|
|
405
454
|
A,
|
|
406
|
-
|
|
455
|
+
O,
|
|
407
456
|
a
|
|
408
457
|
]), N = J(() => {
|
|
409
458
|
l === void 0 && C(""), T({ valid: !0 }), D(!1), a?.({ valid: !0 }), o?.("", ""), c?.();
|
|
@@ -414,26 +463,26 @@ var Me = q(function({ countryCode: e, defaultCountryCode: t = "PL", showCountryC
|
|
|
414
463
|
l
|
|
415
464
|
]), P = A.startsWith("+"), F = n && !P ? /* @__PURE__ */ Q("span", {
|
|
416
465
|
className: "phone prefix",
|
|
417
|
-
children:
|
|
418
|
-
}) : void 0,
|
|
466
|
+
children: je[O] ?? `+${O}`
|
|
467
|
+
}) : void 0, I = p || E && !w.valid, L = m || (E && !w.valid ? w.error : void 0);
|
|
419
468
|
return /* @__PURE__ */ Q(K, {
|
|
420
469
|
..._,
|
|
421
|
-
ref:
|
|
470
|
+
ref: v,
|
|
422
471
|
type: "tel",
|
|
423
472
|
value: A,
|
|
424
473
|
onChange: j,
|
|
425
474
|
onBlur: M,
|
|
426
475
|
onClear: N,
|
|
427
|
-
error:
|
|
428
|
-
errorText:
|
|
476
|
+
error: I,
|
|
477
|
+
errorText: L,
|
|
429
478
|
placeholder: h,
|
|
430
|
-
startIcon: n ? F : /* @__PURE__ */ Q(
|
|
431
|
-
className:
|
|
479
|
+
startIcon: n ? F : /* @__PURE__ */ Q(y, {}),
|
|
480
|
+
className: k("phone input", g)
|
|
432
481
|
});
|
|
433
|
-
}),
|
|
482
|
+
}), Le = q(function({ autoCapitalize: e = !0, allowNumbers: t = !1, allowSpecialChars: n = !1, minWords: r, validateOnBlur: i = !0, onValidationChange: a, value: o, defaultValue: s, onChange: c, onBlur: l, error: u, errorText: d, placeholder: f = "Jan Kowalski", ...p }, m) {
|
|
434
483
|
let [h, g] = Z(s?.toString() ?? ""), [_, v] = Z({ valid: !0 }), [y, b] = Z(!1), x = o === void 0 ? h : o.toString(), S = J((r) => {
|
|
435
484
|
let i = r;
|
|
436
|
-
return t || (i = i.replace(/\d/g, "")), n || (i = i.replace(/[^a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ\s'-]/g, "")), e && (i =
|
|
485
|
+
return t || (i = i.replace(/\d/g, "")), n || (i = i.replace(/[^a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ\s'-]/g, "")), e && (i = ce(i)), i;
|
|
437
486
|
}, [
|
|
438
487
|
t,
|
|
439
488
|
n,
|
|
@@ -445,7 +494,7 @@ var Me = q(function({ countryCode: e, defaultCountryCode: t = "PL", showCountryC
|
|
|
445
494
|
c,
|
|
446
495
|
o,
|
|
447
496
|
S
|
|
448
|
-
]),
|
|
497
|
+
]), w = J((e) => {
|
|
449
498
|
if (b(!0), i && x) {
|
|
450
499
|
let e = x.trim().split(/\s+/).filter(Boolean);
|
|
451
500
|
if (r && e.length < r) {
|
|
@@ -473,35 +522,35 @@ var Me = q(function({ countryCode: e, defaultCountryCode: t = "PL", showCountryC
|
|
|
473
522
|
type: "text",
|
|
474
523
|
value: x,
|
|
475
524
|
onChange: C,
|
|
476
|
-
onBlur:
|
|
525
|
+
onBlur: w,
|
|
477
526
|
error: E,
|
|
478
527
|
errorText: D,
|
|
479
528
|
placeholder: f,
|
|
480
|
-
startIcon: /* @__PURE__ */ Q(
|
|
529
|
+
startIcon: /* @__PURE__ */ Q(T, {})
|
|
481
530
|
});
|
|
482
531
|
});
|
|
483
532
|
//#endregion
|
|
484
533
|
//#region src/components/inputs/MInputGroup/MInputGroup.tsx
|
|
485
|
-
function
|
|
486
|
-
return typeof e == "object" && !!e && !
|
|
534
|
+
function Re(e) {
|
|
535
|
+
return typeof e == "object" && !!e && !ye(e) && "type" in e;
|
|
487
536
|
}
|
|
488
|
-
function
|
|
489
|
-
if (!
|
|
490
|
-
className:
|
|
537
|
+
function ze(e, t, n, r) {
|
|
538
|
+
if (!Re(e)) return /* @__PURE__ */ Q("div", {
|
|
539
|
+
className: k("addon", "custom", t),
|
|
491
540
|
children: e
|
|
492
541
|
}, `${t}-${n}`);
|
|
493
542
|
let i = e;
|
|
494
|
-
return i.type === "button" ? /* @__PURE__ */ Q(
|
|
543
|
+
return i.type === "button" ? /* @__PURE__ */ Q(he, {
|
|
495
544
|
variant: "ghost",
|
|
496
545
|
color: r,
|
|
497
546
|
size: "sm",
|
|
498
|
-
className:
|
|
547
|
+
className: k("addon", t, "addon-button"),
|
|
499
548
|
onClick: i.onClick,
|
|
500
549
|
clickEffect: "none",
|
|
501
550
|
children: i.content
|
|
502
551
|
}, `${t}-${n}`) : i.type === "checkbox" ? /* @__PURE__ */ Q("div", {
|
|
503
|
-
className:
|
|
504
|
-
children: /* @__PURE__ */ Q(
|
|
552
|
+
className: k("addon", t, "checkbox"),
|
|
553
|
+
children: /* @__PURE__ */ Q(ge, {
|
|
505
554
|
size: "sm",
|
|
506
555
|
clickEffect: "none",
|
|
507
556
|
checked: i.checked,
|
|
@@ -509,48 +558,48 @@ function Fe(e, t, n, r) {
|
|
|
509
558
|
className: "addon-checkbox"
|
|
510
559
|
})
|
|
511
560
|
}, `${t}-${n}`) : /* @__PURE__ */ Q("span", {
|
|
512
|
-
className:
|
|
561
|
+
className: k("addon", t),
|
|
513
562
|
children: i.content
|
|
514
563
|
}, `${t}-${n}`);
|
|
515
564
|
}
|
|
516
|
-
function
|
|
565
|
+
function Be(e) {
|
|
517
566
|
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
518
567
|
}
|
|
519
|
-
var
|
|
520
|
-
let [R, ee] = Z(!1), z = X(null), { effectClassName: B, effectLayer: V, handlePointerDown: H } =
|
|
568
|
+
var Ve = q(function({ prepend: e, append: t, type: n = "text", value: r, defaultValue: i, name: a, id: s, placeholder: c, disabled: l = !1, readOnly: u = !1, required: d = !1, autoFocus: f = !1, autoComplete: p, inputMode: m, size: h = "md", fullWidth: g = !1, label: _, helperText: v, errorText: y, color: b = "primary", error: x = !1, maxLength: S, clearable: C = !1, onChange: w, onFocus: T, onBlur: E, onKeyDown: D, onClear: O, loading: A = !1, clickEffect: j = "ripple", rippleColor: M, className: N, style: P, inputClassName: F, labelClassName: I }, L) {
|
|
569
|
+
let [R, ee] = Z(!1), z = X(null), { effectClassName: B, effectLayer: V, handlePointerDown: H } = pe({
|
|
521
570
|
effect: j,
|
|
522
571
|
disabled: l || u,
|
|
523
572
|
color: M
|
|
524
|
-
}), te = x || !!y, U = te ? "color-error" : `color-${b}`, { currentValue: ne, setCurrentValue:
|
|
573
|
+
}), te = x || !!y, U = te ? "color-error" : `color-${b}`, { currentValue: ne, setCurrentValue: W } = ve(r, i), re = ne.length > 0, ie = J((e) => {
|
|
525
574
|
ee(!0), T?.(e);
|
|
526
575
|
}, [T]), ae = J((e) => {
|
|
527
576
|
ee(!1), E?.(e);
|
|
528
577
|
}, [E]), oe = J((e) => {
|
|
529
|
-
|
|
530
|
-
}, [w,
|
|
531
|
-
|
|
578
|
+
W(e.target.value), w?.(e);
|
|
579
|
+
}, [w, W]), se = J(() => {
|
|
580
|
+
W("");
|
|
532
581
|
let e = L?.current ?? z.current;
|
|
533
|
-
e && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 }))),
|
|
582
|
+
e && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 }))), O?.(), e?.focus();
|
|
534
583
|
}, [
|
|
535
|
-
|
|
584
|
+
O,
|
|
536
585
|
L,
|
|
537
|
-
|
|
538
|
-
]), ce =
|
|
586
|
+
W
|
|
587
|
+
]), ce = Be(e), le = Be(t);
|
|
539
588
|
return /* @__PURE__ */ $("div", {
|
|
540
|
-
className:
|
|
589
|
+
className: k("input-group", U, g && "full-width", N),
|
|
541
590
|
style: P,
|
|
542
591
|
children: [
|
|
543
592
|
_ && /* @__PURE__ */ Q("label", {
|
|
544
593
|
htmlFor: s,
|
|
545
|
-
className:
|
|
594
|
+
className: k("field-label", R && "focused", te && "error", d && "required", I),
|
|
546
595
|
children: _
|
|
547
596
|
}),
|
|
548
597
|
/* @__PURE__ */ $("div", {
|
|
549
|
-
className:
|
|
598
|
+
className: k("container", `field-${h}`, R && "focused", te && "has-error", l && "disabled", B),
|
|
550
599
|
onPointerDown: H,
|
|
551
600
|
children: [
|
|
552
601
|
V,
|
|
553
|
-
ce.map((e, t) =>
|
|
602
|
+
ce.map((e, t) => ze(e, "prepend", t, b)),
|
|
554
603
|
/* @__PURE__ */ Q("input", {
|
|
555
604
|
ref: L ?? z,
|
|
556
605
|
type: n,
|
|
@@ -565,9 +614,9 @@ var Le = q(function({ prepend: e, append: t, type: n = "text", value: r, default
|
|
|
565
614
|
autoComplete: p,
|
|
566
615
|
inputMode: m,
|
|
567
616
|
maxLength: S,
|
|
568
|
-
className:
|
|
617
|
+
className: k("field", F),
|
|
569
618
|
onChange: oe,
|
|
570
|
-
onFocus:
|
|
619
|
+
onFocus: ie,
|
|
571
620
|
onBlur: ae,
|
|
572
621
|
onKeyDown: D,
|
|
573
622
|
"aria-invalid": te || void 0,
|
|
@@ -575,12 +624,12 @@ var Le = q(function({ prepend: e, append: t, type: n = "text", value: r, default
|
|
|
575
624
|
}),
|
|
576
625
|
A && /* @__PURE__ */ Q("span", {
|
|
577
626
|
className: "spinner-addon",
|
|
578
|
-
children: /* @__PURE__ */ Q(
|
|
627
|
+
children: /* @__PURE__ */ Q(me, {
|
|
579
628
|
size: "sm",
|
|
580
629
|
color: b
|
|
581
630
|
})
|
|
582
631
|
}),
|
|
583
|
-
C &&
|
|
632
|
+
C && re && !A && !l && /* @__PURE__ */ Q("button", {
|
|
584
633
|
type: "button",
|
|
585
634
|
className: "clear-btn clear-btn-base",
|
|
586
635
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -589,7 +638,7 @@ var Le = q(function({ prepend: e, append: t, type: n = "text", value: r, default
|
|
|
589
638
|
"aria-label": "Clear input",
|
|
590
639
|
children: /* @__PURE__ */ Q(o, {})
|
|
591
640
|
}),
|
|
592
|
-
le.map((e, t) =>
|
|
641
|
+
le.map((e, t) => ze(e, "append", t, b))
|
|
593
642
|
]
|
|
594
643
|
}),
|
|
595
644
|
(y || v) && /* @__PURE__ */ $("div", {
|
|
@@ -610,34 +659,34 @@ var Le = q(function({ prepend: e, append: t, type: n = "text", value: r, default
|
|
|
610
659
|
});
|
|
611
660
|
//#endregion
|
|
612
661
|
//#region src/components/inputs/MInputIBAN/MInputIBAN.tsx
|
|
613
|
-
function
|
|
662
|
+
function He(e) {
|
|
614
663
|
return e?.replace(/[^a-zA-Z]/g, "").toUpperCase().slice(0, 2) || "";
|
|
615
664
|
}
|
|
616
|
-
function
|
|
617
|
-
let t =
|
|
665
|
+
function Ue(e) {
|
|
666
|
+
let t = L(e) ?? 28;
|
|
618
667
|
return Math.max(t - 2, 0);
|
|
619
668
|
}
|
|
620
|
-
function
|
|
621
|
-
let t =
|
|
669
|
+
function We(e) {
|
|
670
|
+
let t = Ue(e), n = [], r = t;
|
|
622
671
|
for (; r > 0;) {
|
|
623
672
|
let e = Math.min(4, r);
|
|
624
673
|
n.push("0".repeat(e)), r -= e;
|
|
625
674
|
}
|
|
626
675
|
return n.join(" ");
|
|
627
676
|
}
|
|
628
|
-
function
|
|
629
|
-
let t =
|
|
677
|
+
function Ge(e) {
|
|
678
|
+
let t = Ue(e);
|
|
630
679
|
return t === 0 ? 0 : t + Math.max(0, Math.ceil(t / 4) - 1);
|
|
631
680
|
}
|
|
632
|
-
var
|
|
633
|
-
let [y, b] = Z(
|
|
634
|
-
let r =
|
|
635
|
-
return r ? t ?
|
|
636
|
-
}, [t]), [C, w] = Z(() => S(c?.toString() ?? "",
|
|
637
|
-
E({ valid: !0 }),
|
|
681
|
+
var Ke = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n = !0, onValidationChange: r, onValueChange: i, onCountryChange: a, onClear: o, value: s, defaultValue: c, onChange: l, onBlur: u, error: d, errorText: f, helperText: p, placeholder: m, className: h, disabled: g = !1, ..._ }, v) {
|
|
682
|
+
let [y, b] = Z(He(e) || "PL"), x = He(e) || y, S = J((e, n) => {
|
|
683
|
+
let r = oe(e).replace(/[^0-9]/g, "").slice(0, Ue(n));
|
|
684
|
+
return r ? t ? ie(r) : r : "";
|
|
685
|
+
}, [t]), [C, w] = Z(() => S(c?.toString() ?? "", He(e) || "PL")), [T, E] = Z({ valid: !0 }), [D, O] = Z(!1), A = s === void 0 ? C : S(s.toString(), x), j = J(() => {
|
|
686
|
+
E({ valid: !0 }), O(!1), r?.({ valid: !0 });
|
|
638
687
|
}, [r]), M = J((e) => {
|
|
639
688
|
let t = S(e.target.value, x);
|
|
640
|
-
s === void 0 && w(t), !t && (D || !T.valid) && j(), i?.(
|
|
689
|
+
s === void 0 && w(t), !t && (D || !T.valid) && j(), i?.(oe(t), t), l?.(e);
|
|
641
690
|
}, [
|
|
642
691
|
S,
|
|
643
692
|
x,
|
|
@@ -648,8 +697,8 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
648
697
|
T.valid,
|
|
649
698
|
s
|
|
650
699
|
]), N = J((e) => {
|
|
651
|
-
if (
|
|
652
|
-
let e =
|
|
700
|
+
if (O(!0), n && A) {
|
|
701
|
+
let e = B(`${x}${oe(A)}`);
|
|
653
702
|
E(e), r?.(e);
|
|
654
703
|
}
|
|
655
704
|
u?.(e);
|
|
@@ -667,12 +716,12 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
667
716
|
j,
|
|
668
717
|
s
|
|
669
718
|
]), F = J((t) => {
|
|
670
|
-
let n =
|
|
719
|
+
let n = He(t.target.value);
|
|
671
720
|
if (!n) return;
|
|
672
721
|
e === void 0 && b(n);
|
|
673
722
|
let o = S(A, n);
|
|
674
|
-
if (s === void 0 && w(o), i?.(
|
|
675
|
-
let e =
|
|
723
|
+
if (s === void 0 && w(o), i?.(oe(o), o), a?.(n), D && o) {
|
|
724
|
+
let e = B(`${n}${oe(o)}`);
|
|
676
725
|
E(e), r?.(e);
|
|
677
726
|
}
|
|
678
727
|
}, [
|
|
@@ -684,8 +733,8 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
684
733
|
i,
|
|
685
734
|
D,
|
|
686
735
|
s
|
|
687
|
-
]), I = d || D && !T.valid,
|
|
688
|
-
return /* @__PURE__ */ Q(
|
|
736
|
+
]), I = d || D && !T.valid, L = f || (D && !T.valid ? T.error : void 0), R = be(() => z, []), ee = L ? void 0 : p ?? `Format: ${x} ${We(x)}`;
|
|
737
|
+
return /* @__PURE__ */ Q(Ve, {
|
|
689
738
|
..._,
|
|
690
739
|
ref: v,
|
|
691
740
|
type: "text",
|
|
@@ -694,11 +743,11 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
694
743
|
onBlur: N,
|
|
695
744
|
onClear: P,
|
|
696
745
|
error: I,
|
|
697
|
-
errorText:
|
|
698
|
-
placeholder: m ??
|
|
699
|
-
helperText:
|
|
746
|
+
errorText: L,
|
|
747
|
+
placeholder: m ?? We(x),
|
|
748
|
+
helperText: ee,
|
|
700
749
|
disabled: g,
|
|
701
|
-
maxLength:
|
|
750
|
+
maxLength: Ge(x),
|
|
702
751
|
prepend: /* @__PURE__ */ Q("div", {
|
|
703
752
|
className: "country-select-wrap",
|
|
704
753
|
children: /* @__PURE__ */ Q("select", {
|
|
@@ -707,29 +756,29 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
707
756
|
onChange: F,
|
|
708
757
|
disabled: g,
|
|
709
758
|
"aria-label": "IBAN country",
|
|
710
|
-
children:
|
|
759
|
+
children: R.map((e) => /* @__PURE__ */ Q("option", {
|
|
711
760
|
value: e,
|
|
712
761
|
children: e
|
|
713
762
|
}, e))
|
|
714
763
|
})
|
|
715
764
|
}),
|
|
716
|
-
className:
|
|
765
|
+
className: k("input-iban", h)
|
|
717
766
|
});
|
|
718
|
-
}),
|
|
719
|
-
NIP:
|
|
720
|
-
PESEL:
|
|
721
|
-
REGON:
|
|
722
|
-
},
|
|
767
|
+
}), qe = {
|
|
768
|
+
NIP: V,
|
|
769
|
+
PESEL: P,
|
|
770
|
+
REGON: I
|
|
771
|
+
}, Je = {
|
|
723
772
|
NIP: 13,
|
|
724
773
|
PESEL: 11,
|
|
725
774
|
REGON: 14
|
|
726
|
-
},
|
|
775
|
+
}, Ye = {
|
|
727
776
|
NIP: "123-456-78-19",
|
|
728
777
|
PESEL: "00000000000",
|
|
729
778
|
REGON: "000000000"
|
|
730
|
-
},
|
|
779
|
+
}, Xe = q(function({ taxIdType: e, formatOnChange: t = !0, validateOnBlur: r = !0, showValidIcon: i = !0, onValidationChange: a, onValueChange: o, value: s, defaultValue: c, onChange: l, onBlur: u, error: d, errorText: f, success: p, placeholder: m, ...h }, g) {
|
|
731
780
|
let [_, v] = Z(c?.toString() ?? ""), [y, b] = Z({ valid: !0 }), [x, S] = Z(!1), C = s === void 0 ? _ : s.toString(), w = J((n) => {
|
|
732
|
-
let r = G(n.target.value), i = t && e === "NIP" ?
|
|
781
|
+
let r = G(n.target.value), i = t && e === "NIP" ? le(r) : r;
|
|
733
782
|
s === void 0 && v(i), o?.(r), l?.(n);
|
|
734
783
|
}, [
|
|
735
784
|
l,
|
|
@@ -739,7 +788,7 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
739
788
|
o
|
|
740
789
|
]), T = J((t) => {
|
|
741
790
|
if (S(!0), r && C) {
|
|
742
|
-
let t =
|
|
791
|
+
let t = qe[e], n = t(G(C));
|
|
743
792
|
b(n), a?.(n);
|
|
744
793
|
}
|
|
745
794
|
u?.(t);
|
|
@@ -749,7 +798,7 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
749
798
|
C,
|
|
750
799
|
e,
|
|
751
800
|
a
|
|
752
|
-
]),
|
|
801
|
+
]), E = d || x && !y.valid, O = f || (x && !y.valid ? y.error : void 0), k = !E && (p === void 0 ? x && y.valid && C.length > 0 : p), A = i && k ? /* @__PURE__ */ Q("span", {
|
|
753
802
|
className: "validation-icon",
|
|
754
803
|
children: /* @__PURE__ */ Q(n, {})
|
|
755
804
|
}) : void 0;
|
|
@@ -761,25 +810,25 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
761
810
|
value: C,
|
|
762
811
|
onChange: w,
|
|
763
812
|
onBlur: T,
|
|
764
|
-
error:
|
|
813
|
+
error: E,
|
|
765
814
|
errorText: O,
|
|
766
815
|
success: k,
|
|
767
|
-
placeholder: m ??
|
|
768
|
-
startIcon: /* @__PURE__ */ Q(
|
|
816
|
+
placeholder: m ?? Ye[e],
|
|
817
|
+
startIcon: /* @__PURE__ */ Q(D, {}),
|
|
769
818
|
endIcon: A,
|
|
770
|
-
maxLength:
|
|
819
|
+
maxLength: Je[e]
|
|
771
820
|
});
|
|
772
|
-
}),
|
|
821
|
+
}), Ze = q(function({ currency: e, currencySymbol: t, currencyPosition: n = "end", decimalSeparator: r = ",", thousandSeparator: i = " ", precision: a = 2, min: o, max: s, allowNegative: c = !1, onValueChange: l, value: u, defaultValue: d, onChange: f, onBlur: p, placeholder: m = "0,00", startIcon: h, endIcon: g, className: _, ...v }, y) {
|
|
773
822
|
let [b, x] = Z(d?.toString() ?? ""), S = u === void 0 ? b : u.toString(), C = t ?? e ?? "", w = J((e) => {
|
|
774
823
|
let t = e.target.value, n = "", o = !1;
|
|
775
824
|
for (let e of t) e >= "0" && e <= "9" ? n += e : (e === "," || e === ".") && !o ? (n += r, o = !0) : e === "-" && c && n.length === 0 && (n += "-");
|
|
776
|
-
let s =
|
|
825
|
+
let s = ue(n, {
|
|
777
826
|
decimalSeparator: r,
|
|
778
827
|
thousandSeparator: i,
|
|
779
828
|
precision: a
|
|
780
829
|
});
|
|
781
830
|
u === void 0 && x(s);
|
|
782
|
-
let d =
|
|
831
|
+
let d = ae(s, i, r);
|
|
783
832
|
l?.(d), f?.(e);
|
|
784
833
|
}, [
|
|
785
834
|
f,
|
|
@@ -790,10 +839,10 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
790
839
|
c,
|
|
791
840
|
l
|
|
792
841
|
]), T = J((e) => {
|
|
793
|
-
let t =
|
|
842
|
+
let t = ae(S, i, r);
|
|
794
843
|
if (t !== null) {
|
|
795
844
|
o !== void 0 && t < o && (t = o), s !== void 0 && t > s && (t = s);
|
|
796
|
-
let e =
|
|
845
|
+
let e = ue(t.toFixed(a).replace(".", r), {
|
|
797
846
|
decimalSeparator: r,
|
|
798
847
|
thousandSeparator: i,
|
|
799
848
|
precision: a
|
|
@@ -826,14 +875,14 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
826
875
|
placeholder: m,
|
|
827
876
|
startIcon: n === "start" ? E : h,
|
|
828
877
|
endIcon: n === "end" ? E : g,
|
|
829
|
-
className:
|
|
878
|
+
className: k("currency input", _)
|
|
830
879
|
});
|
|
831
|
-
}),
|
|
880
|
+
}), Qe = {
|
|
832
881
|
"DD/MM/YYYY": "DD{s}MM{s}YYYY",
|
|
833
882
|
"MM/DD/YYYY": "MM{s}DD{s}YYYY",
|
|
834
883
|
"YYYY/MM/DD": "YYYY{s}MM{s}DD"
|
|
835
|
-
},
|
|
836
|
-
let [x, S] = Z(u?.toString() ?? ""), [C, w] = Z({ valid: !0 }), [T, E] = Z(!1), D = X(!1), O =
|
|
884
|
+
}, $e = q(function({ format: e = "DD/MM/YYYY", separator: t = "/", minDate: n, maxDate: r, validateOnBlur: i = !0, validateOnChange: a = !1, onDateChange: o, onValidationChange: s, value: c, defaultValue: u, onChange: d, onBlur: f, onKeyDown: p, onClear: m, error: h, errorText: g, placeholder: _, className: v, ...y }, b) {
|
|
885
|
+
let [x, S] = Z(u?.toString() ?? ""), [C, w] = Z({ valid: !0 }), [T, E] = Z(!1), D = X(!1), O = c === void 0 ? x : c.toString();
|
|
837
886
|
Y(() => {
|
|
838
887
|
if (D.current) {
|
|
839
888
|
D.current = !1;
|
|
@@ -843,7 +892,7 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
843
892
|
w({ valid: !0 }), E(!1);
|
|
844
893
|
return;
|
|
845
894
|
}
|
|
846
|
-
w(
|
|
895
|
+
w(M(O, {
|
|
847
896
|
format: e,
|
|
848
897
|
minDate: n,
|
|
849
898
|
maxDate: r
|
|
@@ -855,7 +904,7 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
855
904
|
n
|
|
856
905
|
]);
|
|
857
906
|
let k = J((t) => {
|
|
858
|
-
let i =
|
|
907
|
+
let i = M(t, {
|
|
859
908
|
format: e,
|
|
860
909
|
minDate: n,
|
|
861
910
|
maxDate: r
|
|
@@ -866,29 +915,29 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
866
915
|
n,
|
|
867
916
|
r,
|
|
868
917
|
s
|
|
869
|
-
]),
|
|
870
|
-
G(t).length === 8 ? o?.(
|
|
871
|
-
}, [e, o]),
|
|
918
|
+
]), A = J((t) => {
|
|
919
|
+
G(t).length === 8 ? o?.(F(t, e), t) : o?.(null, t);
|
|
920
|
+
}, [e, o]), j = J((n) => {
|
|
872
921
|
let r = G(n.target.value);
|
|
873
922
|
if (r.length > 8) return;
|
|
874
|
-
let i =
|
|
875
|
-
D.current = !0,
|
|
923
|
+
let i = se(r, e, t);
|
|
924
|
+
D.current = !0, c === void 0 && S(i), A(i), a && T && k(i), d?.(n);
|
|
876
925
|
}, [
|
|
877
926
|
d,
|
|
878
|
-
|
|
927
|
+
c,
|
|
879
928
|
e,
|
|
880
929
|
t,
|
|
881
930
|
a,
|
|
882
931
|
T,
|
|
883
932
|
k,
|
|
884
|
-
|
|
885
|
-
]),
|
|
886
|
-
D.current = !0,
|
|
933
|
+
A
|
|
934
|
+
]), N = J(() => {
|
|
935
|
+
D.current = !0, c === void 0 && S(""), w({ valid: !0 }), E(!1), o?.(null, ""), m?.();
|
|
887
936
|
}, [
|
|
888
|
-
|
|
937
|
+
c,
|
|
889
938
|
o,
|
|
890
939
|
m
|
|
891
|
-
]),
|
|
940
|
+
]), P = J((e) => {
|
|
892
941
|
E(!0), i && O && k(O), f?.(e);
|
|
893
942
|
}, [
|
|
894
943
|
f,
|
|
@@ -920,34 +969,34 @@ var He = q(function({ countryCode: e, formatOnChange: t = !0, validateOnBlur: n
|
|
|
920
969
|
type: "text",
|
|
921
970
|
inputMode: "numeric",
|
|
922
971
|
value: O,
|
|
923
|
-
onChange:
|
|
924
|
-
onBlur:
|
|
972
|
+
onChange: j,
|
|
973
|
+
onBlur: P,
|
|
925
974
|
onKeyDown: I,
|
|
926
|
-
onClear:
|
|
975
|
+
onClear: N,
|
|
927
976
|
error: L,
|
|
928
977
|
errorText: R,
|
|
929
|
-
placeholder: _ ??
|
|
930
|
-
startIcon: /* @__PURE__ */ Q(
|
|
978
|
+
placeholder: _ ?? Qe[e].replace(/\{s\}/g, t),
|
|
979
|
+
startIcon: /* @__PURE__ */ Q(l, {}),
|
|
931
980
|
maxLength: 10,
|
|
932
981
|
className: v
|
|
933
982
|
});
|
|
934
983
|
});
|
|
935
984
|
//#endregion
|
|
936
985
|
//#region src/components/inputs/MInputCreditCard/MInputCreditCard.tsx
|
|
937
|
-
function
|
|
938
|
-
let t =
|
|
986
|
+
function et({ value: e }) {
|
|
987
|
+
let t = W(e);
|
|
939
988
|
return /* @__PURE__ */ Q("span", {
|
|
940
|
-
className:
|
|
989
|
+
className: k("credit-card-brand-badge", "credit-brand", t.brand),
|
|
941
990
|
children: t.iconLabel
|
|
942
991
|
});
|
|
943
992
|
}
|
|
944
|
-
var
|
|
945
|
-
let [b, x] = Z(() =>
|
|
946
|
-
let t =
|
|
993
|
+
var tt = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBrandIcon: r = !0, showValidIcon: i = !0, onValidationChange: a, onCardBrandChange: o, onValueChange: s, onClear: c, value: l, defaultValue: u, onChange: d, onBlur: f, error: p, errorText: m, success: h, placeholder: g = "4242 4242 4242 4242", className: _, ...v }, y) {
|
|
994
|
+
let [b, x] = Z(() => re(u?.toString() ?? "")), [S, C] = Z({ valid: !0 }), [w, T] = Z(!1), E = l === void 0 ? b : re(l.toString()), D = J((e) => {
|
|
995
|
+
let t = U(e);
|
|
947
996
|
return C(t), a?.(t), t;
|
|
948
|
-
}, [a]),
|
|
949
|
-
let n =
|
|
950
|
-
l === void 0 && x(n), o?.(r.brand), s?.(
|
|
997
|
+
}, [a]), O = J((e) => {
|
|
998
|
+
let n = re(e.target.value), r = W(n);
|
|
999
|
+
l === void 0 && x(n), o?.(r.brand), s?.(ne(n), n, r.brand), t && w && D(n), d?.(e);
|
|
951
1000
|
}, [
|
|
952
1001
|
o,
|
|
953
1002
|
d,
|
|
@@ -970,7 +1019,7 @@ var Ze = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBran
|
|
|
970
1019
|
a,
|
|
971
1020
|
s,
|
|
972
1021
|
l
|
|
973
|
-
]), M = p || w && !S.valid, N = m || (w && !S.valid ? S.error : void 0), P = !M && h !== void 0 ? h : w && S.valid &&
|
|
1022
|
+
]), M = p || w && !S.valid, N = m || (w && !S.valid ? S.error : void 0), P = !M && h !== void 0 ? h : w && S.valid && ne(E).length > 0, F = i && P ? /* @__PURE__ */ Q("span", {
|
|
974
1023
|
className: "credit valid validation-icon credit-card-valid-icon",
|
|
975
1024
|
"aria-hidden": "true",
|
|
976
1025
|
children: /* @__PURE__ */ Q(n, {})
|
|
@@ -981,71 +1030,71 @@ var Ze = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBran
|
|
|
981
1030
|
type: "text",
|
|
982
1031
|
inputMode: "numeric",
|
|
983
1032
|
value: E,
|
|
984
|
-
onChange:
|
|
1033
|
+
onChange: O,
|
|
985
1034
|
onBlur: A,
|
|
986
1035
|
onClear: j,
|
|
987
1036
|
error: M,
|
|
988
1037
|
errorText: N,
|
|
989
1038
|
success: P,
|
|
990
1039
|
placeholder: g,
|
|
991
|
-
startIcon: r ? /* @__PURE__ */ Q(
|
|
1040
|
+
startIcon: r ? /* @__PURE__ */ Q(et, { value: E }) : void 0,
|
|
992
1041
|
endIcon: F,
|
|
993
|
-
className:
|
|
1042
|
+
className: k("credit-card input", _)
|
|
994
1043
|
});
|
|
995
|
-
}),
|
|
996
|
-
let [x, S] = Z(t.toUpperCase()), [C, w] = Z(() =>
|
|
997
|
-
let n =
|
|
1044
|
+
}), nt = q(function({ country: e, defaultCountry: t = "PL", selectableCountry: n = !0, validateOnBlur: r = !0, validateOnChange: i = !1, onCountryChange: a, onValidationChange: o, onValueChange: s, onClear: c, value: l, defaultValue: u, onChange: d, onBlur: f, error: p, errorText: m, helperText: h, placeholder: g, className: _, disabled: v = !1, ...y }, b) {
|
|
1045
|
+
let [x, S] = Z(t.toUpperCase()), [C, w] = Z(() => H(u?.toString() ?? "", e ?? t)), [T, E] = Z({ valid: !0 }), [D, O] = Z(!1), j = (e ?? x).toUpperCase(), M = be(() => te(j), [j]), P = l === void 0 ? C : H(l.toString(), j), F = J((e, t) => {
|
|
1046
|
+
let n = A(e, t);
|
|
998
1047
|
return E(n), o?.(n), n;
|
|
999
|
-
}, [o]),
|
|
1000
|
-
let t =
|
|
1001
|
-
l === void 0 && w(t), s?.(t.replace(/\s|-/g, ""), t, j), i && D &&
|
|
1048
|
+
}, [o]), I = J((e) => {
|
|
1049
|
+
let t = H(e.target.value, j);
|
|
1050
|
+
l === void 0 && w(t), s?.(t.replace(/\s|-/g, ""), t, j), i && D && F(t, j), d?.(e);
|
|
1002
1051
|
}, [
|
|
1003
1052
|
j,
|
|
1004
1053
|
d,
|
|
1005
1054
|
s,
|
|
1006
|
-
|
|
1055
|
+
F,
|
|
1007
1056
|
D,
|
|
1008
1057
|
i,
|
|
1009
1058
|
l
|
|
1010
|
-
]),
|
|
1011
|
-
|
|
1059
|
+
]), L = J((e) => {
|
|
1060
|
+
O(!0), r && P && F(P, j), f?.(e);
|
|
1012
1061
|
}, [
|
|
1013
1062
|
j,
|
|
1014
|
-
N,
|
|
1015
|
-
f,
|
|
1016
1063
|
P,
|
|
1064
|
+
f,
|
|
1065
|
+
F,
|
|
1017
1066
|
r
|
|
1018
|
-
]),
|
|
1019
|
-
l === void 0 && w(""), E({ valid: !0 }),
|
|
1067
|
+
]), R = J(() => {
|
|
1068
|
+
l === void 0 && w(""), E({ valid: !0 }), O(!1), o?.({ valid: !0 }), s?.("", "", j), c?.();
|
|
1020
1069
|
}, [
|
|
1021
1070
|
c,
|
|
1022
1071
|
o,
|
|
1023
1072
|
s,
|
|
1024
1073
|
l,
|
|
1025
1074
|
j
|
|
1026
|
-
]),
|
|
1027
|
-
let n = t.target.value.toUpperCase(), r =
|
|
1028
|
-
e === void 0 && S(n), l === void 0 && w(r), a?.(n), D &&
|
|
1075
|
+
]), ee = J((t) => {
|
|
1076
|
+
let n = t.target.value.toUpperCase(), r = H(P, n);
|
|
1077
|
+
e === void 0 && S(n), l === void 0 && w(r), a?.(n), D && F(r, n);
|
|
1029
1078
|
}, [
|
|
1030
1079
|
e,
|
|
1031
|
-
N,
|
|
1032
|
-
a,
|
|
1033
1080
|
P,
|
|
1081
|
+
a,
|
|
1082
|
+
F,
|
|
1034
1083
|
D,
|
|
1035
1084
|
l
|
|
1036
|
-
]),
|
|
1037
|
-
return /* @__PURE__ */ Q(
|
|
1085
|
+
]), z = p || D && !T.valid, B = m || (D && !T.valid ? T.error : void 0);
|
|
1086
|
+
return /* @__PURE__ */ Q(Ve, {
|
|
1038
1087
|
...y,
|
|
1039
1088
|
ref: b,
|
|
1040
1089
|
type: "text",
|
|
1041
1090
|
inputMode: M.inputMode,
|
|
1042
|
-
value:
|
|
1043
|
-
onChange:
|
|
1044
|
-
onBlur:
|
|
1045
|
-
onClear:
|
|
1046
|
-
error:
|
|
1047
|
-
errorText:
|
|
1048
|
-
helperText:
|
|
1091
|
+
value: P,
|
|
1092
|
+
onChange: I,
|
|
1093
|
+
onBlur: L,
|
|
1094
|
+
onClear: R,
|
|
1095
|
+
error: z,
|
|
1096
|
+
errorText: B,
|
|
1097
|
+
helperText: B ? void 0 : h ?? `Format: ${M.example}`,
|
|
1049
1098
|
placeholder: n ? M.placeholder : g ?? M.placeholder,
|
|
1050
1099
|
maxLength: M.maxLength,
|
|
1051
1100
|
disabled: v,
|
|
@@ -1054,10 +1103,10 @@ var Ze = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBran
|
|
|
1054
1103
|
children: /* @__PURE__ */ Q("select", {
|
|
1055
1104
|
className: "country-select",
|
|
1056
1105
|
value: j,
|
|
1057
|
-
onChange:
|
|
1106
|
+
onChange: ee,
|
|
1058
1107
|
disabled: v,
|
|
1059
1108
|
"aria-label": "Postal code country",
|
|
1060
|
-
children:
|
|
1109
|
+
children: N.map((e) => /* @__PURE__ */ Q("option", {
|
|
1061
1110
|
value: e.value,
|
|
1062
1111
|
children: e.value
|
|
1063
1112
|
}, e.value))
|
|
@@ -1066,9 +1115,9 @@ var Ze = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBran
|
|
|
1066
1115
|
type: "text",
|
|
1067
1116
|
content: j
|
|
1068
1117
|
},
|
|
1069
|
-
className:
|
|
1118
|
+
className: k("input-post-code", _)
|
|
1070
1119
|
});
|
|
1071
|
-
}),
|
|
1120
|
+
}), rt = q(function({ length: e = 6, value: t, onChange: n, autoFocus: r = !1, disabled: i = !1, color: a = "primary", size: s = "md", error: c = !1, errorText: l, clearable: u = !1, label: d, onClear: f, className: p, ...m }, h) {
|
|
1072
1121
|
let [g, _] = Z(""), v = t === void 0 ? g : t, y = X([]), b = c ? "color-error" : `color-${a}`, x = J((e) => {
|
|
1073
1122
|
t === void 0 && _(e), n?.(e);
|
|
1074
1123
|
}, [t, n]), S = J((t) => {
|
|
@@ -1116,7 +1165,7 @@ var Ze = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBran
|
|
|
1116
1165
|
]);
|
|
1117
1166
|
return /* @__PURE__ */ $("div", {
|
|
1118
1167
|
ref: h,
|
|
1119
|
-
className:
|
|
1168
|
+
className: k("otp input", b, s, i && "disabled", p),
|
|
1120
1169
|
...m,
|
|
1121
1170
|
children: [
|
|
1122
1171
|
d && /* @__PURE__ */ Q("div", {
|
|
@@ -1137,7 +1186,7 @@ var Ze = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBran
|
|
|
1137
1186
|
maxLength: 1,
|
|
1138
1187
|
value: v[t] || "",
|
|
1139
1188
|
disabled: i,
|
|
1140
|
-
className:
|
|
1189
|
+
className: k("otp slot", v[t] && "filled"),
|
|
1141
1190
|
"aria-label": `Digit ${t + 1}`,
|
|
1142
1191
|
onChange: (e) => {
|
|
1143
1192
|
C(t, e.target.value.slice(-1));
|
|
@@ -1162,16 +1211,16 @@ var Ze = q(function({ validateOnBlur: e = !0, validateOnChange: t = !1, showBran
|
|
|
1162
1211
|
});
|
|
1163
1212
|
//#endregion
|
|
1164
1213
|
//#region src/components/inputs/MInputSlider/MInputSlider.tsx
|
|
1165
|
-
function
|
|
1214
|
+
function it(e, t, n) {
|
|
1166
1215
|
return Math.min(n, Math.max(t, e));
|
|
1167
1216
|
}
|
|
1168
|
-
function
|
|
1217
|
+
function at(e, t) {
|
|
1169
1218
|
let n = 10 ** t;
|
|
1170
1219
|
return Math.round(e * n) / n;
|
|
1171
1220
|
}
|
|
1172
|
-
var
|
|
1221
|
+
var ot = q(function({ min: e = 0, max: t = 100, step: n = 1, value: r, onChange: i, precision: a = 0, marks: o, showInput: s = !0, color: c = "primary", size: l = "md", disabled: u = !1, label: d, className: f, ...p }, m) {
|
|
1173
1222
|
let [h, g] = Z(e), _ = r === void 0 ? h : r, v = J((n) => {
|
|
1174
|
-
let o =
|
|
1223
|
+
let o = at(it(n, e, t), a);
|
|
1175
1224
|
r === void 0 && g(o), i?.(o);
|
|
1176
1225
|
}, [
|
|
1177
1226
|
e,
|
|
@@ -1189,14 +1238,14 @@ var nt = q(function({ min: e = 0, max: t = 100, step: n = 1, value: r, onChange:
|
|
|
1189
1238
|
}, [_, v]);
|
|
1190
1239
|
return /* @__PURE__ */ $("div", {
|
|
1191
1240
|
ref: m,
|
|
1192
|
-
className:
|
|
1241
|
+
className: k("slider input", l, u && "disabled", f),
|
|
1193
1242
|
...p,
|
|
1194
1243
|
children: [d && /* @__PURE__ */ Q("div", {
|
|
1195
1244
|
className: "slider label",
|
|
1196
1245
|
children: d
|
|
1197
1246
|
}), /* @__PURE__ */ $("div", {
|
|
1198
1247
|
className: "slider row",
|
|
1199
|
-
children: [/* @__PURE__ */ Q(
|
|
1248
|
+
children: [/* @__PURE__ */ Q(_e, {
|
|
1200
1249
|
min: e,
|
|
1201
1250
|
max: t,
|
|
1202
1251
|
step: n,
|
|
@@ -1208,7 +1257,7 @@ var nt = q(function({ min: e = 0, max: t = 100, step: n = 1, value: r, onChange:
|
|
|
1208
1257
|
}), s && /* @__PURE__ */ Q("input", {
|
|
1209
1258
|
type: "text",
|
|
1210
1259
|
inputMode: "decimal",
|
|
1211
|
-
className:
|
|
1260
|
+
className: k("slider field", `color-${c}`),
|
|
1212
1261
|
value: _,
|
|
1213
1262
|
onChange: b,
|
|
1214
1263
|
onBlur: x,
|
|
@@ -1220,7 +1269,7 @@ var nt = q(function({ min: e = 0, max: t = 100, step: n = 1, value: r, onChange:
|
|
|
1220
1269
|
});
|
|
1221
1270
|
//#endregion
|
|
1222
1271
|
//#region src/components/inputs/MInputFile/MCropEditor.tsx
|
|
1223
|
-
function
|
|
1272
|
+
function st({ file: t, shape: n, outputSize: r, quality: i, onCrop: a, onCancel: o }) {
|
|
1224
1273
|
let s = X(null), c = X(null), l = X(null), [u, d] = Z(""), [f, p] = Z(1), [m, h] = Z({
|
|
1225
1274
|
x: 0,
|
|
1226
1275
|
y: 0
|
|
@@ -1329,7 +1378,7 @@ function rt({ file: t, shape: n, outputSize: r, quality: i, onCrop: a, onCancel:
|
|
|
1329
1378
|
children: [/* @__PURE__ */ Q(e, {
|
|
1330
1379
|
className: "crop zoom icon",
|
|
1331
1380
|
"aria-hidden": "true"
|
|
1332
|
-
}), /* @__PURE__ */ Q(
|
|
1381
|
+
}), /* @__PURE__ */ Q(_e, {
|
|
1333
1382
|
min: 0,
|
|
1334
1383
|
max: 100,
|
|
1335
1384
|
step: 1,
|
|
@@ -1341,13 +1390,13 @@ function rt({ file: t, shape: n, outputSize: r, quality: i, onCrop: a, onCancel:
|
|
|
1341
1390
|
}),
|
|
1342
1391
|
/* @__PURE__ */ $("div", {
|
|
1343
1392
|
className: "crop actions",
|
|
1344
|
-
children: [/* @__PURE__ */ Q(
|
|
1393
|
+
children: [/* @__PURE__ */ Q(he, {
|
|
1345
1394
|
variant: "ghost",
|
|
1346
1395
|
size: "sm",
|
|
1347
1396
|
color: "neutral",
|
|
1348
1397
|
onClick: o,
|
|
1349
1398
|
children: "Cancel"
|
|
1350
|
-
}), /* @__PURE__ */ Q(
|
|
1399
|
+
}), /* @__PURE__ */ Q(he, {
|
|
1351
1400
|
variant: "filled",
|
|
1352
1401
|
size: "sm",
|
|
1353
1402
|
color: "primary",
|
|
@@ -1364,19 +1413,19 @@ function rt({ file: t, shape: n, outputSize: r, quality: i, onCrop: a, onCancel:
|
|
|
1364
1413
|
}
|
|
1365
1414
|
//#endregion
|
|
1366
1415
|
//#region src/components/inputs/MInputFile/MInputFile.tsx
|
|
1367
|
-
function
|
|
1416
|
+
function ct(e) {
|
|
1368
1417
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1369
1418
|
}
|
|
1370
|
-
function
|
|
1419
|
+
function lt(e) {
|
|
1371
1420
|
let t = e.lastIndexOf(".");
|
|
1372
1421
|
return t >= 0 ? e.slice(t + 1).toUpperCase() : "";
|
|
1373
1422
|
}
|
|
1374
|
-
function
|
|
1423
|
+
function ut(e) {
|
|
1375
1424
|
return e.type.startsWith("image/");
|
|
1376
1425
|
}
|
|
1377
|
-
function
|
|
1426
|
+
function dt({ ext: e }) {
|
|
1378
1427
|
let n = e.toLowerCase();
|
|
1379
|
-
return n === "pdf" ? /* @__PURE__ */ Q(
|
|
1428
|
+
return n === "pdf" ? /* @__PURE__ */ Q(b, {
|
|
1380
1429
|
className: "file type icon",
|
|
1381
1430
|
"aria-hidden": "true"
|
|
1382
1431
|
}) : [
|
|
@@ -1386,10 +1435,10 @@ function st({ ext: e }) {
|
|
|
1386
1435
|
"gif",
|
|
1387
1436
|
"webp",
|
|
1388
1437
|
"svg"
|
|
1389
|
-
].includes(n) ? /* @__PURE__ */ Q(
|
|
1438
|
+
].includes(n) ? /* @__PURE__ */ Q(h, {
|
|
1390
1439
|
className: "file type icon",
|
|
1391
1440
|
"aria-hidden": "true"
|
|
1392
|
-
}) : ["json"].includes(n) ? /* @__PURE__ */ Q(
|
|
1441
|
+
}) : ["json"].includes(n) ? /* @__PURE__ */ Q(f, {
|
|
1393
1442
|
className: "file type icon",
|
|
1394
1443
|
"aria-hidden": "true"
|
|
1395
1444
|
}) : [
|
|
@@ -1401,13 +1450,13 @@ function st({ ext: e }) {
|
|
|
1401
1450
|
"css",
|
|
1402
1451
|
"php",
|
|
1403
1452
|
"xml"
|
|
1404
|
-
].includes(n) ? /* @__PURE__ */ Q(
|
|
1453
|
+
].includes(n) ? /* @__PURE__ */ Q(E, {
|
|
1405
1454
|
className: "file type icon",
|
|
1406
1455
|
"aria-hidden": "true"
|
|
1407
|
-
}) : ["txt"].includes(n) ? /* @__PURE__ */ Q(
|
|
1456
|
+
}) : ["txt"].includes(n) ? /* @__PURE__ */ Q(O, {
|
|
1408
1457
|
className: "file type icon",
|
|
1409
1458
|
"aria-hidden": "true"
|
|
1410
|
-
}) : ["md"].includes(n) ? /* @__PURE__ */ Q(
|
|
1459
|
+
}) : ["md"].includes(n) ? /* @__PURE__ */ Q(u, {
|
|
1411
1460
|
className: "file type icon",
|
|
1412
1461
|
"aria-hidden": "true"
|
|
1413
1462
|
}) : [
|
|
@@ -1424,10 +1473,10 @@ function st({ ext: e }) {
|
|
|
1424
1473
|
"csv",
|
|
1425
1474
|
"xls",
|
|
1426
1475
|
"xlsx"
|
|
1427
|
-
].includes(n) ? /* @__PURE__ */ Q(
|
|
1476
|
+
].includes(n) ? /* @__PURE__ */ Q(x, {
|
|
1428
1477
|
className: "file type icon",
|
|
1429
1478
|
"aria-hidden": "true"
|
|
1430
|
-
}) : ["zip"].includes(n) ? /* @__PURE__ */ Q(
|
|
1479
|
+
}) : ["zip"].includes(n) ? /* @__PURE__ */ Q(_, {
|
|
1431
1480
|
className: "file type icon",
|
|
1432
1481
|
"aria-hidden": "true"
|
|
1433
1482
|
}) : [
|
|
@@ -1435,14 +1484,14 @@ function st({ ext: e }) {
|
|
|
1435
1484
|
"7z",
|
|
1436
1485
|
"tar",
|
|
1437
1486
|
"gz"
|
|
1438
|
-
].includes(n) ? /* @__PURE__ */ Q(
|
|
1487
|
+
].includes(n) ? /* @__PURE__ */ Q(S, {
|
|
1439
1488
|
className: "file type icon",
|
|
1440
1489
|
"aria-hidden": "true"
|
|
1441
1490
|
}) : [
|
|
1442
1491
|
"mp3",
|
|
1443
1492
|
"wav",
|
|
1444
1493
|
"ogg"
|
|
1445
|
-
].includes(n) ? /* @__PURE__ */ Q(
|
|
1494
|
+
].includes(n) ? /* @__PURE__ */ Q(p, {
|
|
1446
1495
|
className: "file type icon",
|
|
1447
1496
|
"aria-hidden": "true"
|
|
1448
1497
|
}) : [
|
|
@@ -1461,13 +1510,13 @@ function st({ ext: e }) {
|
|
|
1461
1510
|
].includes(n) ? /* @__PURE__ */ Q(a, {
|
|
1462
1511
|
className: "file type icon",
|
|
1463
1512
|
"aria-hidden": "true"
|
|
1464
|
-
}) : /* @__PURE__ */ Q(
|
|
1513
|
+
}) : /* @__PURE__ */ Q(w, {
|
|
1465
1514
|
className: "file type icon",
|
|
1466
1515
|
"aria-hidden": "true"
|
|
1467
1516
|
});
|
|
1468
1517
|
}
|
|
1469
|
-
var
|
|
1470
|
-
let [T, E] = Z(!1), [D,
|
|
1518
|
+
var ft = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onChange: i, label: a, helperText: s, errorText: c, error: l = !1, disabled: u = !1, color: d = "primary", size: f = "md", preview: p = !0, clearable: m = !1, icon: h, placeholder: _ = "Drop files here or click to browse", dropText: v = "Drop files here", fullWidth: y = !1, crop: b, onClear: x, className: S, ...C }, w) {
|
|
1519
|
+
let [T, E] = Z(!1), [D, O] = Z([]), [A, j] = Z(""), [M, N] = Z(null), P = X(null), F = X(0), I = b ? typeof b == "boolean" ? {
|
|
1471
1520
|
shape: "square",
|
|
1472
1521
|
outputSize: 256,
|
|
1473
1522
|
quality: .92
|
|
@@ -1475,7 +1524,7 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1475
1524
|
shape: b.shape ?? "square",
|
|
1476
1525
|
outputSize: b.outputSize ?? 256,
|
|
1477
1526
|
quality: b.quality ?? .92
|
|
1478
|
-
} : null, L =
|
|
1527
|
+
} : null, L = be(() => D.map((e) => ut(e) ? URL.createObjectURL(e) : null), [D]);
|
|
1479
1528
|
Y(() => () => {
|
|
1480
1529
|
L.forEach((e) => {
|
|
1481
1530
|
e && URL.revokeObjectURL(e);
|
|
@@ -1491,18 +1540,18 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1491
1540
|
});
|
|
1492
1541
|
}
|
|
1493
1542
|
if (n && a.filter((e) => e.size > n).length) {
|
|
1494
|
-
j(`Max file size: ${
|
|
1543
|
+
j(`Max file size: ${ct(n)}`);
|
|
1495
1544
|
return;
|
|
1496
1545
|
}
|
|
1497
1546
|
if (r && a.length > r) {
|
|
1498
1547
|
j(`Max ${r} file${r > 1 ? "s" : ""}`);
|
|
1499
1548
|
return;
|
|
1500
1549
|
}
|
|
1501
|
-
if (j(""), I && a.length === 1 &&
|
|
1550
|
+
if (j(""), I && a.length === 1 && ut(a[0])) {
|
|
1502
1551
|
N(a[0]);
|
|
1503
1552
|
return;
|
|
1504
1553
|
}
|
|
1505
|
-
|
|
1554
|
+
O(a), i?.(a);
|
|
1506
1555
|
}, [
|
|
1507
1556
|
e,
|
|
1508
1557
|
n,
|
|
@@ -1510,7 +1559,7 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1510
1559
|
i,
|
|
1511
1560
|
I
|
|
1512
1561
|
]), ee = J((e) => {
|
|
1513
|
-
N(null),
|
|
1562
|
+
N(null), O([e]), i?.([e]);
|
|
1514
1563
|
}, [i]), z = J(() => {
|
|
1515
1564
|
N(null);
|
|
1516
1565
|
}, []), B = J((e) => {
|
|
@@ -1525,27 +1574,27 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1525
1574
|
u || P.current?.click();
|
|
1526
1575
|
}, [u]), ne = J((e) => {
|
|
1527
1576
|
e.target.files?.length && R(e.target.files);
|
|
1528
|
-
}, [R]),
|
|
1577
|
+
}, [R]), W = J((e) => {
|
|
1529
1578
|
let t = L[e];
|
|
1530
1579
|
t && URL.revokeObjectURL(t);
|
|
1531
1580
|
let n = D.filter((t, n) => n !== e);
|
|
1532
|
-
|
|
1581
|
+
O(n), i?.(n);
|
|
1533
1582
|
}, [
|
|
1534
1583
|
D,
|
|
1535
1584
|
L,
|
|
1536
1585
|
i
|
|
1537
|
-
]),
|
|
1586
|
+
]), re = J(() => {
|
|
1538
1587
|
L.forEach((e) => {
|
|
1539
1588
|
e && URL.revokeObjectURL(e);
|
|
1540
|
-
}), N(null),
|
|
1589
|
+
}), N(null), O([]), j(""), P.current && (P.current.value = ""), i?.([]), x?.();
|
|
1541
1590
|
}, [
|
|
1542
1591
|
L,
|
|
1543
1592
|
i,
|
|
1544
1593
|
x
|
|
1545
|
-
]),
|
|
1594
|
+
]), ie = c || A, ae = l || !!A;
|
|
1546
1595
|
return /* @__PURE__ */ $("div", {
|
|
1547
1596
|
ref: w,
|
|
1548
|
-
className:
|
|
1597
|
+
className: k("file input", ae ? "color-error" : `color-${d}`, f, y && "full-width", u && "disabled", S),
|
|
1549
1598
|
...C,
|
|
1550
1599
|
children: [
|
|
1551
1600
|
(a || m && D.length > 0 && !u) && /* @__PURE__ */ $("div", {
|
|
@@ -1556,13 +1605,13 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1556
1605
|
}), m && D.length > 0 && !u && /* @__PURE__ */ Q("button", {
|
|
1557
1606
|
type: "button",
|
|
1558
1607
|
className: "file clear clear-btn-base",
|
|
1559
|
-
onClick:
|
|
1608
|
+
onClick: re,
|
|
1560
1609
|
"aria-label": "Clear files",
|
|
1561
1610
|
children: /* @__PURE__ */ Q(o, { "aria-hidden": "true" })
|
|
1562
1611
|
})]
|
|
1563
1612
|
}),
|
|
1564
1613
|
/* @__PURE__ */ $("div", {
|
|
1565
|
-
className:
|
|
1614
|
+
className: k("file dropzone", T && "dragging", ae && "error"),
|
|
1566
1615
|
onClick: U,
|
|
1567
1616
|
onDragEnter: B,
|
|
1568
1617
|
onDragLeave: V,
|
|
@@ -1585,11 +1634,11 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1585
1634
|
}), /* @__PURE__ */ $("div", {
|
|
1586
1635
|
className: "file content",
|
|
1587
1636
|
children: [
|
|
1588
|
-
|
|
1637
|
+
h && /* @__PURE__ */ Q("div", {
|
|
1589
1638
|
className: "file icon",
|
|
1590
|
-
children:
|
|
1639
|
+
children: h
|
|
1591
1640
|
}),
|
|
1592
|
-
!
|
|
1641
|
+
!h && /* @__PURE__ */ Q(g, {
|
|
1593
1642
|
className: "file icon default",
|
|
1594
1643
|
"aria-hidden": "true"
|
|
1595
1644
|
}),
|
|
@@ -1604,7 +1653,7 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1604
1653
|
]
|
|
1605
1654
|
})]
|
|
1606
1655
|
}),
|
|
1607
|
-
M && I && /* @__PURE__ */ Q(
|
|
1656
|
+
M && I && /* @__PURE__ */ Q(st, {
|
|
1608
1657
|
file: M,
|
|
1609
1658
|
shape: I.shape,
|
|
1610
1659
|
outputSize: I.outputSize,
|
|
@@ -1616,9 +1665,9 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1616
1665
|
className: "file helper",
|
|
1617
1666
|
children: s
|
|
1618
1667
|
}),
|
|
1619
|
-
ae &&
|
|
1668
|
+
ae && ie && /* @__PURE__ */ Q("div", {
|
|
1620
1669
|
className: "file error",
|
|
1621
|
-
children:
|
|
1670
|
+
children: ie
|
|
1622
1671
|
}),
|
|
1623
1672
|
p && D.length > 0 && !M && /* @__PURE__ */ Q("div", {
|
|
1624
1673
|
className: "file preview",
|
|
@@ -1631,7 +1680,7 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1631
1680
|
src: L[t],
|
|
1632
1681
|
alt: e.name,
|
|
1633
1682
|
className: "file image"
|
|
1634
|
-
}) : /* @__PURE__ */ Q(
|
|
1683
|
+
}) : /* @__PURE__ */ Q(dt, { ext: lt(e.name) })
|
|
1635
1684
|
}),
|
|
1636
1685
|
/* @__PURE__ */ $("div", {
|
|
1637
1686
|
className: "file info",
|
|
@@ -1640,14 +1689,14 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1640
1689
|
children: e.name
|
|
1641
1690
|
}), /* @__PURE__ */ Q("span", {
|
|
1642
1691
|
className: "file size",
|
|
1643
|
-
children:
|
|
1692
|
+
children: ct(e.size)
|
|
1644
1693
|
})]
|
|
1645
1694
|
}),
|
|
1646
1695
|
/* @__PURE__ */ Q("button", {
|
|
1647
1696
|
type: "button",
|
|
1648
1697
|
className: "file remove",
|
|
1649
1698
|
onClick: (e) => {
|
|
1650
|
-
e.stopPropagation(),
|
|
1699
|
+
e.stopPropagation(), W(t);
|
|
1651
1700
|
},
|
|
1652
1701
|
"aria-label": `Remove ${e.name}`,
|
|
1653
1702
|
children: /* @__PURE__ */ Q(o, { "aria-hidden": "true" })
|
|
@@ -1659,6 +1708,6 @@ var ct = q(function({ accept: e, multiple: t = !1, maxSize: n, maxFiles: r, onCh
|
|
|
1659
1708
|
});
|
|
1660
1709
|
});
|
|
1661
1710
|
//#endregion
|
|
1662
|
-
export {
|
|
1711
|
+
export { xe as _, tt as a, Xe as c, Le as d, Ie as f, we as g, De as h, nt as i, Ke as l, Oe as m, ot as n, $e as o, Ae as p, rt as r, Ze as s, ft as t, Ve as u };
|
|
1663
1712
|
|
|
1664
|
-
//# sourceMappingURL=inputs-
|
|
1713
|
+
//# sourceMappingURL=inputs-CyDoEfL3.js.map
|