@hortiview/shared-components 0.0.4730 → 0.0.4775
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 +199 -1
- package/dist/_baseToString-ByHt83eL.js +282 -0
- package/dist/_getTag-D4bRay2z.js +226 -0
- package/dist/assets/formDatePicker.css +1 -0
- package/dist/assets/formSelect.css +1 -0
- package/dist/assets/formText.css +1 -0
- package/dist/components/BaseView/BaseView.d.ts +1 -0
- package/dist/components/DeleteModal/DeleteModal.js +23 -18
- package/dist/components/DeleteModal/DeleteModal.test.js +3 -3
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.d.ts +30 -0
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +42 -0
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.d.ts +1 -0
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +50 -0
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +36 -0
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +62 -0
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.d.ts +1 -0
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +69 -0
- package/dist/components/FormComponents/FormRadio/FormRadio.d.ts +21 -0
- package/dist/components/FormComponents/FormRadio/FormRadio.js +30 -0
- package/dist/components/FormComponents/FormRadio/FormRadio.test.d.ts +1 -0
- package/dist/components/FormComponents/FormRadio/FormRadio.test.js +73 -0
- package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +61 -0
- package/dist/components/FormComponents/FormSelect/FormSelect.js +76 -0
- package/dist/components/FormComponents/FormSelect/FormSelect.test.d.ts +1 -0
- package/dist/components/FormComponents/FormSelect/FormSelect.test.js +65 -0
- package/dist/components/FormComponents/FormSlider/FormSlider.d.ts +27 -0
- package/dist/components/FormComponents/FormSlider/FormSlider.js +37 -0
- package/dist/components/FormComponents/FormSlider/FormSlider.test.d.ts +1 -0
- package/dist/components/FormComponents/FormSlider/FormSlider.test.js +49 -0
- package/dist/components/FormComponents/FormText/FormText.d.ts +69 -0
- package/dist/components/FormComponents/FormText/FormText.js +103 -0
- package/dist/components/FormComponents/FormText/FormText.test.d.ts +1 -0
- package/dist/components/FormComponents/FormText/FormText.test.js +84 -0
- package/dist/components/Iconify/Iconify.d.ts +1 -0
- package/dist/components/ListArea/ListArea.d.ts +1 -0
- package/dist/components/ListArea/ListArea.js +194 -227
- package/dist/formDatePicker.module-DllLVp7D.js +7 -0
- package/dist/formSelect.module-CdHEvmH_.js +9 -0
- package/dist/formText.module-3BZ0M2vV.js +10 -0
- package/dist/get-BYajYtEc.js +46 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.js +40 -28
- package/dist/types/HashTab.d.ts +1 -0
- package/dist/types/ListElement.d.ts +1 -0
- package/dist/types/internal/ReactRouterTypes.d.ts +1 -0
- package/package.json +7 -2
- package/dist/_getTag-DyrzUAbj.js +0 -494
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { c as x, d as X, e as Y, f as v, g as K, h as Q, j as O, k as D, l as ee, m as j, n as ae } from "./_baseToString-ByHt83eL.js";
|
|
2
|
+
var re = x;
|
|
3
|
+
function te() {
|
|
4
|
+
this.__data__ = new re(), this.size = 0;
|
|
5
|
+
}
|
|
6
|
+
var ne = te;
|
|
7
|
+
function se(e) {
|
|
8
|
+
var a = this.__data__, r = a.delete(e);
|
|
9
|
+
return this.size = a.size, r;
|
|
10
|
+
}
|
|
11
|
+
var ie = se;
|
|
12
|
+
function oe(e) {
|
|
13
|
+
return this.__data__.get(e);
|
|
14
|
+
}
|
|
15
|
+
var ce = oe;
|
|
16
|
+
function fe(e) {
|
|
17
|
+
return this.__data__.has(e);
|
|
18
|
+
}
|
|
19
|
+
var ue = fe, ge = x, _e = X, ve = Y, pe = 200;
|
|
20
|
+
function be(e, a) {
|
|
21
|
+
var r = this.__data__;
|
|
22
|
+
if (r instanceof ge) {
|
|
23
|
+
var t = r.__data__;
|
|
24
|
+
if (!_e || t.length < pe - 1)
|
|
25
|
+
return t.push([e, a]), this.size = ++r.size, this;
|
|
26
|
+
r = this.__data__ = new ve(t);
|
|
27
|
+
}
|
|
28
|
+
return r.set(e, a), this.size = r.size, this;
|
|
29
|
+
}
|
|
30
|
+
var de = be, ye = x, le = ne, Te = ie, Ae = ce, $e = ue, he = de;
|
|
31
|
+
function p(e) {
|
|
32
|
+
var a = this.__data__ = new ye(e);
|
|
33
|
+
this.size = a.size;
|
|
34
|
+
}
|
|
35
|
+
p.prototype.clear = le;
|
|
36
|
+
p.prototype.delete = Te;
|
|
37
|
+
p.prototype.get = Ae;
|
|
38
|
+
p.prototype.has = $e;
|
|
39
|
+
p.prototype.set = he;
|
|
40
|
+
var Or = p, je = "__lodash_hash_undefined__";
|
|
41
|
+
function Se(e) {
|
|
42
|
+
return this.__data__.set(e, je), this;
|
|
43
|
+
}
|
|
44
|
+
var we = Se;
|
|
45
|
+
function me(e) {
|
|
46
|
+
return this.__data__.has(e);
|
|
47
|
+
}
|
|
48
|
+
var Ce = me, Ee = Y, Me = we, Le = Ce;
|
|
49
|
+
function A(e) {
|
|
50
|
+
var a = -1, r = e == null ? 0 : e.length;
|
|
51
|
+
for (this.__data__ = new Ee(); ++a < r; )
|
|
52
|
+
this.add(e[a]);
|
|
53
|
+
}
|
|
54
|
+
A.prototype.add = A.prototype.push = Me;
|
|
55
|
+
A.prototype.has = Le;
|
|
56
|
+
var xe = A;
|
|
57
|
+
function Oe(e, a) {
|
|
58
|
+
for (var r = -1, t = e == null ? 0 : e.length; ++r < t; )
|
|
59
|
+
if (a(e[r], r, e))
|
|
60
|
+
return !0;
|
|
61
|
+
return !1;
|
|
62
|
+
}
|
|
63
|
+
var De = Oe;
|
|
64
|
+
function Ue(e, a) {
|
|
65
|
+
return e.has(a);
|
|
66
|
+
}
|
|
67
|
+
var ke = Ue, Ie = xe, Pe = De, Be = ke, Re = 1, Ge = 2;
|
|
68
|
+
function Ne(e, a, r, t, i, s) {
|
|
69
|
+
var o = r & Re, c = e.length, f = a.length;
|
|
70
|
+
if (c != f && !(o && f > c))
|
|
71
|
+
return !1;
|
|
72
|
+
var u = s.get(e), y = s.get(a);
|
|
73
|
+
if (u && y)
|
|
74
|
+
return u == a && y == e;
|
|
75
|
+
var d = -1, l = !0, S = r & Ge ? new Ie() : void 0;
|
|
76
|
+
for (s.set(e, a), s.set(a, e); ++d < c; ) {
|
|
77
|
+
var _ = e[d], T = a[d];
|
|
78
|
+
if (t)
|
|
79
|
+
var U = o ? t(T, _, d, a, e, s) : t(_, T, d, e, a, s);
|
|
80
|
+
if (U !== void 0) {
|
|
81
|
+
if (U)
|
|
82
|
+
continue;
|
|
83
|
+
l = !1;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
if (S) {
|
|
87
|
+
if (!Pe(a, function(k, I) {
|
|
88
|
+
if (!Be(S, I) && (_ === k || i(_, k, r, t, s)))
|
|
89
|
+
return S.push(I);
|
|
90
|
+
})) {
|
|
91
|
+
l = !1;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
} else if (!(_ === T || i(_, T, r, t, s))) {
|
|
95
|
+
l = !1;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return s.delete(e), s.delete(a), l;
|
|
100
|
+
}
|
|
101
|
+
var He = Ne, Fe = v, ze = Fe.Uint8Array, qe = ze;
|
|
102
|
+
function We(e) {
|
|
103
|
+
var a = -1, r = Array(e.size);
|
|
104
|
+
return e.forEach(function(t, i) {
|
|
105
|
+
r[++a] = [i, t];
|
|
106
|
+
}), r;
|
|
107
|
+
}
|
|
108
|
+
var Ve = We;
|
|
109
|
+
function Xe(e) {
|
|
110
|
+
var a = -1, r = Array(e.size);
|
|
111
|
+
return e.forEach(function(t) {
|
|
112
|
+
r[++a] = t;
|
|
113
|
+
}), r;
|
|
114
|
+
}
|
|
115
|
+
var Ye = Xe, P = K, B = qe, Ze = Q, Je = He, Ke = Ve, Qe = Ye, ea = 1, aa = 2, ra = "[object Boolean]", ta = "[object Date]", na = "[object Error]", sa = "[object Map]", ia = "[object Number]", oa = "[object RegExp]", ca = "[object Set]", fa = "[object String]", ua = "[object Symbol]", ga = "[object ArrayBuffer]", _a = "[object DataView]", R = P ? P.prototype : void 0, w = R ? R.valueOf : void 0;
|
|
116
|
+
function va(e, a, r, t, i, s, o) {
|
|
117
|
+
switch (r) {
|
|
118
|
+
case _a:
|
|
119
|
+
if (e.byteLength != a.byteLength || e.byteOffset != a.byteOffset)
|
|
120
|
+
return !1;
|
|
121
|
+
e = e.buffer, a = a.buffer;
|
|
122
|
+
case ga:
|
|
123
|
+
return !(e.byteLength != a.byteLength || !s(new B(e), new B(a)));
|
|
124
|
+
case ra:
|
|
125
|
+
case ta:
|
|
126
|
+
case ia:
|
|
127
|
+
return Ze(+e, +a);
|
|
128
|
+
case na:
|
|
129
|
+
return e.name == a.name && e.message == a.message;
|
|
130
|
+
case oa:
|
|
131
|
+
case fa:
|
|
132
|
+
return e == a + "";
|
|
133
|
+
case sa:
|
|
134
|
+
var c = Ke;
|
|
135
|
+
case ca:
|
|
136
|
+
var f = t & ea;
|
|
137
|
+
if (c || (c = Qe), e.size != a.size && !f)
|
|
138
|
+
return !1;
|
|
139
|
+
var u = o.get(e);
|
|
140
|
+
if (u)
|
|
141
|
+
return u == a;
|
|
142
|
+
t |= aa, o.set(e, a);
|
|
143
|
+
var y = Je(c(e), c(a), t, i, s, o);
|
|
144
|
+
return o.delete(e), y;
|
|
145
|
+
case ua:
|
|
146
|
+
if (w)
|
|
147
|
+
return w.call(e) == w.call(a);
|
|
148
|
+
}
|
|
149
|
+
return !1;
|
|
150
|
+
}
|
|
151
|
+
var Dr = va, pa = O, ba = D, da = "[object Arguments]";
|
|
152
|
+
function ya(e) {
|
|
153
|
+
return ba(e) && pa(e) == da;
|
|
154
|
+
}
|
|
155
|
+
var la = ya, G = la, Ta = D, Z = Object.prototype, Aa = Z.hasOwnProperty, $a = Z.propertyIsEnumerable, ha = G(/* @__PURE__ */ function() {
|
|
156
|
+
return arguments;
|
|
157
|
+
}()) ? G : function(e) {
|
|
158
|
+
return Ta(e) && Aa.call(e, "callee") && !$a.call(e, "callee");
|
|
159
|
+
}, Ur = ha, $ = { exports: {} };
|
|
160
|
+
function ja() {
|
|
161
|
+
return !1;
|
|
162
|
+
}
|
|
163
|
+
var Sa = ja;
|
|
164
|
+
$.exports;
|
|
165
|
+
(function(e, a) {
|
|
166
|
+
var r = v, t = Sa, i = a && !a.nodeType && a, s = i && !0 && e && !e.nodeType && e, o = s && s.exports === i, c = o ? r.Buffer : void 0, f = c ? c.isBuffer : void 0, u = f || t;
|
|
167
|
+
e.exports = u;
|
|
168
|
+
})($, $.exports);
|
|
169
|
+
var kr = $.exports, wa = 9007199254740991;
|
|
170
|
+
function ma(e) {
|
|
171
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= wa;
|
|
172
|
+
}
|
|
173
|
+
var Ca = ma, Ea = O, Ma = Ca, La = D, xa = "[object Arguments]", Oa = "[object Array]", Da = "[object Boolean]", Ua = "[object Date]", ka = "[object Error]", Ia = "[object Function]", Pa = "[object Map]", Ba = "[object Number]", Ra = "[object Object]", Ga = "[object RegExp]", Na = "[object Set]", Ha = "[object String]", Fa = "[object WeakMap]", za = "[object ArrayBuffer]", qa = "[object DataView]", Wa = "[object Float32Array]", Va = "[object Float64Array]", Xa = "[object Int8Array]", Ya = "[object Int16Array]", Za = "[object Int32Array]", Ja = "[object Uint8Array]", Ka = "[object Uint8ClampedArray]", Qa = "[object Uint16Array]", er = "[object Uint32Array]", n = {};
|
|
174
|
+
n[Wa] = n[Va] = n[Xa] = n[Ya] = n[Za] = n[Ja] = n[Ka] = n[Qa] = n[er] = !0;
|
|
175
|
+
n[xa] = n[Oa] = n[za] = n[Da] = n[qa] = n[Ua] = n[ka] = n[Ia] = n[Pa] = n[Ba] = n[Ra] = n[Ga] = n[Na] = n[Ha] = n[Fa] = !1;
|
|
176
|
+
function ar(e) {
|
|
177
|
+
return La(e) && Ma(e.length) && !!n[Ea(e)];
|
|
178
|
+
}
|
|
179
|
+
var rr = ar;
|
|
180
|
+
function tr(e) {
|
|
181
|
+
return function(a) {
|
|
182
|
+
return e(a);
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
var nr = tr, h = { exports: {} };
|
|
186
|
+
h.exports;
|
|
187
|
+
(function(e, a) {
|
|
188
|
+
var r = ee, t = a && !a.nodeType && a, i = t && !0 && e && !e.nodeType && e, s = i && i.exports === t, o = s && r.process, c = function() {
|
|
189
|
+
try {
|
|
190
|
+
var f = i && i.require && i.require("util").types;
|
|
191
|
+
return f || o && o.binding && o.binding("util");
|
|
192
|
+
} catch {
|
|
193
|
+
}
|
|
194
|
+
}();
|
|
195
|
+
e.exports = c;
|
|
196
|
+
})(h, h.exports);
|
|
197
|
+
var sr = h.exports, ir = rr, or = nr, N = sr, H = N && N.isTypedArray, cr = H ? or(H) : ir, Ir = cr, fr = j, ur = v, gr = fr(ur, "DataView"), _r = gr, vr = j, pr = v, br = vr(pr, "Promise"), dr = br, yr = j, lr = v, Tr = yr(lr, "Set"), Ar = Tr, $r = j, hr = v, jr = $r(hr, "WeakMap"), Sr = jr, m = _r, C = X, E = dr, M = Ar, L = Sr, J = O, b = ae, F = "[object Map]", wr = "[object Object]", z = "[object Promise]", q = "[object Set]", W = "[object WeakMap]", V = "[object DataView]", mr = b(m), Cr = b(C), Er = b(E), Mr = b(M), Lr = b(L), g = J;
|
|
198
|
+
(m && g(new m(new ArrayBuffer(1))) != V || C && g(new C()) != F || E && g(E.resolve()) != z || M && g(new M()) != q || L && g(new L()) != W) && (g = function(e) {
|
|
199
|
+
var a = J(e), r = a == wr ? e.constructor : void 0, t = r ? b(r) : "";
|
|
200
|
+
if (t)
|
|
201
|
+
switch (t) {
|
|
202
|
+
case mr:
|
|
203
|
+
return V;
|
|
204
|
+
case Cr:
|
|
205
|
+
return F;
|
|
206
|
+
case Er:
|
|
207
|
+
return z;
|
|
208
|
+
case Mr:
|
|
209
|
+
return q;
|
|
210
|
+
case Lr:
|
|
211
|
+
return W;
|
|
212
|
+
}
|
|
213
|
+
return a;
|
|
214
|
+
});
|
|
215
|
+
var Pr = g;
|
|
216
|
+
export {
|
|
217
|
+
Or as _,
|
|
218
|
+
kr as a,
|
|
219
|
+
Ir as b,
|
|
220
|
+
Ca as c,
|
|
221
|
+
He as d,
|
|
222
|
+
Dr as e,
|
|
223
|
+
Pr as f,
|
|
224
|
+
nr as g,
|
|
225
|
+
Ur as i
|
|
226
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._datePickerContainer_1l698_1{width:100%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._invalid_1vo1h_1+*[class*=mdc-select-helper-text]{color:var(--lmnt-theme-danger)!important}._formSelect_1vo1h_5+*[class*=mdc-select-helper-text]{margin-bottom:-19.33px!important}._formSelectContainer_1vo1h_9 *[class*=mdc-select-helper-text]{color:var(--lmnt-helper-text-color)}._formSelectContainer_1vo1h_9 *[class*=lmnt__multi-value__label]{overflow:visible}._formSelect_1vo1h_5 *[class*=lmnt-select-menu]{z-index:2001}._formSelectContainer_1vo1h_9{display:flex;flex-wrap:wrap;width:100%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._formTextAreaHelperText_7ae2c_1{display:flex;justify-content:space-between}._invalid_7ae2c_6+*[class*=mdc-text-field-helper-line] *[class*=mdc-text-field-helper-text]{color:var(--lmnt-theme-danger)!important}._formText_7ae2c_1+*[class*=mdc-text-field-helper-line] *[class*=mdc-text-field-helper-text]{margin-bottom:-19.33px!important}._formTextArea_7ae2c_1,._formTextArea_7ae2c_1 *[class*=mdc-text-field-helper-text]{width:100%}._formTextArea_7ae2c_1 *[class*=mdc-text-field-helper-text]:before{display:block;height:6px}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import "../../assets/DeleteModal.css";
|
|
2
2
|
import { jsx as o, jsxs as m, Fragment as f } from "react/jsx-runtime";
|
|
3
|
-
import { Modal as k, Button as c, Group as
|
|
3
|
+
import { Modal as k, Button as c, Group as e, Icon as y, TypoBody as l } from "@element/react-components";
|
|
4
4
|
import { Iconify as C } from "../Iconify/Iconify.js";
|
|
5
5
|
import { uniqueId as D } from "lodash";
|
|
6
6
|
import "react";
|
|
7
|
-
import "../../
|
|
7
|
+
import "../../_baseToString-ByHt83eL.js";
|
|
8
|
+
import "../../_getTag-D4bRay2z.js";
|
|
8
9
|
import "../../searchBar.module-9gKyrZRT.js";
|
|
9
10
|
import "../../listArea.module-B04TR5bj.js";
|
|
10
|
-
import { AvailableCustomIcons as
|
|
11
|
+
import { AvailableCustomIcons as p } from "../../enums/AvailableCustomIcons.js";
|
|
11
12
|
import "../../verticalDivider.module-C3_GL-fH.js";
|
|
12
13
|
import "../../baseView.module-DXWalo9p.js";
|
|
13
14
|
import "../../basicHeading.module-ClcvD7x2.js";
|
|
@@ -16,13 +17,17 @@ import "../../disclaimer.module-BZydt-Q_.js";
|
|
|
16
17
|
import "../../HashTabView.module-BY0tbl3B.js";
|
|
17
18
|
import "../../HeaderFilter.module-DiBmulr5.js";
|
|
18
19
|
import "../Scrollbar/Scrollbar.js";
|
|
19
|
-
|
|
20
|
+
import "react-hook-form";
|
|
21
|
+
import "../../formDatePicker.module-DllLVp7D.js";
|
|
22
|
+
import "../../formSelect.module-CdHEvmH_.js";
|
|
23
|
+
import "../../formText.module-3BZ0M2vV.js";
|
|
24
|
+
const j = "_bulletPoint_469qk_1", q = "_modal_469qk_6", I = "_colorDanger_469qk_10", t = {
|
|
20
25
|
bulletPoint: j,
|
|
21
26
|
modal: q,
|
|
22
27
|
colorDanger: I
|
|
23
|
-
},
|
|
24
|
-
title:
|
|
25
|
-
confirmButtonLabel:
|
|
28
|
+
}, Y = ({
|
|
29
|
+
title: s,
|
|
30
|
+
confirmButtonLabel: d,
|
|
26
31
|
cancelButtonLabel: u,
|
|
27
32
|
deleteHeader: g,
|
|
28
33
|
deleteBody: i,
|
|
@@ -35,38 +40,38 @@ const j = "_bulletPoint_469qk_1", q = "_modal_469qk_6", I = "_colorDanger_469qk_
|
|
|
35
40
|
}) => /* @__PURE__ */ o(
|
|
36
41
|
k,
|
|
37
42
|
{
|
|
38
|
-
className:
|
|
43
|
+
className: t.modal,
|
|
39
44
|
modalSize: "small",
|
|
40
45
|
open: v,
|
|
41
46
|
onClose: () => a(!1),
|
|
42
|
-
title:
|
|
47
|
+
title: s,
|
|
43
48
|
primaryButton: /* @__PURE__ */ o(
|
|
44
49
|
c,
|
|
45
50
|
{
|
|
46
51
|
variant: "danger",
|
|
47
|
-
label:
|
|
52
|
+
label: d,
|
|
48
53
|
onClick: h,
|
|
49
54
|
disabled: !n
|
|
50
55
|
}
|
|
51
56
|
),
|
|
52
57
|
dismissiveButton: /* @__PURE__ */ o(c, { variant: "text", label: u, onClick: () => a(!1) }),
|
|
53
|
-
children: /* @__PURE__ */ m(
|
|
54
|
-
r && Object.values(
|
|
58
|
+
children: /* @__PURE__ */ m(e, { direction: "vertical", secondaryAlign: "center", children: [
|
|
59
|
+
r && Object.values(p).includes(r) && /* @__PURE__ */ o(
|
|
55
60
|
C,
|
|
56
61
|
{
|
|
57
62
|
icon: r,
|
|
58
63
|
iconSize: "xlarge",
|
|
59
|
-
className:
|
|
64
|
+
className: t.colorDanger
|
|
60
65
|
}
|
|
61
66
|
),
|
|
62
|
-
r && !Object.values(
|
|
63
|
-
/* @__PURE__ */ o(
|
|
67
|
+
r && !Object.values(p).includes(r) && /* @__PURE__ */ o(y, { icon: r, iconSize: "xlarge", className: t.colorDanger }),
|
|
68
|
+
/* @__PURE__ */ o(e, { direction: "vertical", children: n ? /* @__PURE__ */ m(f, { children: [
|
|
64
69
|
/* @__PURE__ */ o(l, { level: 1, themeColor: "text-primary-on-background", children: g }),
|
|
65
|
-
i && /* @__PURE__ */ o(
|
|
70
|
+
i && /* @__PURE__ */ o(e, { direction: "vertical", gap: "none", children: i.map((x, _) => /* @__PURE__ */ o(
|
|
66
71
|
l,
|
|
67
72
|
{
|
|
68
73
|
level: 2,
|
|
69
|
-
className:
|
|
74
|
+
className: t.bulletPoint,
|
|
70
75
|
themeColor: "text-secondary-on-background",
|
|
71
76
|
children: x
|
|
72
77
|
},
|
|
@@ -77,5 +82,5 @@ const j = "_bulletPoint_469qk_1", q = "_modal_469qk_6", I = "_colorDanger_469qk_
|
|
|
77
82
|
}
|
|
78
83
|
);
|
|
79
84
|
export {
|
|
80
|
-
|
|
85
|
+
Y as DeleteModal
|
|
81
86
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { r as c, s as e } from "../../react.esm-BeDwcQWb.js";
|
|
3
3
|
import { DeleteModal as b } from "./DeleteModal.js";
|
|
4
|
-
import { d, t as a, v as o, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
-
|
|
4
|
+
import { d as B, t as a, v as o, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
B("DeleteModal Test", () => {
|
|
6
6
|
a("should render the DeleteModal properly", () => {
|
|
7
7
|
c(
|
|
8
8
|
/* @__PURE__ */ n(
|
|
@@ -40,7 +40,7 @@ d("DeleteModal Test", () => {
|
|
|
40
40
|
isDeletePossible: !1
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
|
-
),
|
|
43
|
+
), t(e.getByText("DELETE")).toBeInTheDocument(), t(e.getByTestId("block")).toBeInTheDocument(), t(e.queryByText("block 1")).not.toBeInTheDocument(), t(e.queryByText("block 2")).not.toBeInTheDocument(), t(e.queryByText("block 3")).not.toBeInTheDocument(), t(e.getByText("Remove")).toBeInTheDocument(), t(e.getByText("Remove").parentElement).toBeDisabled(), t(e.getByText("Cancel")).toBeInTheDocument(), t(e.queryByText("block cant be deleted")).toBeInTheDocument();
|
|
44
44
|
}), a("should call setOpen with false when clicking on cancel button", () => {
|
|
45
45
|
const l = o.fn();
|
|
46
46
|
c(
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
|
+
type FormCheckProps<T extends FieldValues> = {
|
|
3
|
+
/** The name of the property that this checkbox represents. */
|
|
4
|
+
propertyName: Path<T>;
|
|
5
|
+
/** Label to be displayed with the checkbox. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Validation rules for the checkbox. */
|
|
8
|
+
validate?: RegisterOptions<T>['validate'];
|
|
9
|
+
/** Determines if this input is mandatory. */
|
|
10
|
+
required?: boolean;
|
|
11
|
+
/** Function to be called when the checkbox value changes. */
|
|
12
|
+
onChange?: () => void;
|
|
13
|
+
/** Determines if this input is disabled. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* FormCheckBox is a custom form input component for selecting checkboxes.
|
|
18
|
+
* It is integrated with react-hook-form for form management.
|
|
19
|
+
*
|
|
20
|
+
* @param propertyName - the name of the property this checkbox maps to in the form.
|
|
21
|
+
* @param label - label displayed along with the checkbox.
|
|
22
|
+
* @param validate - validation rules for the checkbox.
|
|
23
|
+
* @param required - determines if the checkbox is required.
|
|
24
|
+
* @param onChange - function to be called when the checkbox value changes.
|
|
25
|
+
* @param disabled - determines if the checkbox is disabled.
|
|
26
|
+
*
|
|
27
|
+
* @returns A JSX element that renders a checkbox form input.
|
|
28
|
+
*/
|
|
29
|
+
export declare const FormCheckBox: <T extends FieldValues>({ propertyName, label, validate, required, onChange, disabled, }: FormCheckProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as l, TypoCaption as u } from "@element/react-components";
|
|
3
|
+
import { useFormContext as g, Controller as i } from "react-hook-form";
|
|
4
|
+
const b = ({
|
|
5
|
+
propertyName: n,
|
|
6
|
+
label: t,
|
|
7
|
+
validate: m,
|
|
8
|
+
required: c,
|
|
9
|
+
onChange: s,
|
|
10
|
+
disabled: h
|
|
11
|
+
}) => {
|
|
12
|
+
const { control: C } = g();
|
|
13
|
+
return /* @__PURE__ */ o(
|
|
14
|
+
i,
|
|
15
|
+
{
|
|
16
|
+
name: n,
|
|
17
|
+
control: C,
|
|
18
|
+
rules: {
|
|
19
|
+
required: c,
|
|
20
|
+
validate: m
|
|
21
|
+
},
|
|
22
|
+
render: ({ field: r, fieldState: e }) => /* @__PURE__ */ p(x, { children: [
|
|
23
|
+
/* @__PURE__ */ o(
|
|
24
|
+
l,
|
|
25
|
+
{
|
|
26
|
+
...r,
|
|
27
|
+
label: t,
|
|
28
|
+
onChange: (...a) => {
|
|
29
|
+
r.onChange(...a), s?.();
|
|
30
|
+
},
|
|
31
|
+
checked: r.value,
|
|
32
|
+
disabled: h
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
e.error && /* @__PURE__ */ o(u, { themeColor: "error", children: e.error.message })
|
|
36
|
+
] })
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
b as FormCheckBox
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { r as n, s as t, f as m } from "../../../react.esm-BeDwcQWb.js";
|
|
3
|
+
import { FormCheckBox as c } from "./FormCheckBox.js";
|
|
4
|
+
import { v as e, d as h, t as l, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
const a = e.fn();
|
|
6
|
+
e.mock("react-hook-form", () => ({
|
|
7
|
+
...e.importActual("react-hook-form"),
|
|
8
|
+
Controller: ({
|
|
9
|
+
render: o
|
|
10
|
+
}) => o({
|
|
11
|
+
field: {
|
|
12
|
+
onChange: a
|
|
13
|
+
},
|
|
14
|
+
fieldState: { error: { message: "error" } }
|
|
15
|
+
}),
|
|
16
|
+
useFormContext: () => ({
|
|
17
|
+
control: {
|
|
18
|
+
register: e.fn(),
|
|
19
|
+
unregister: e.fn(),
|
|
20
|
+
getFieldState: e.fn(),
|
|
21
|
+
_names: {
|
|
22
|
+
array: new Set("test"),
|
|
23
|
+
mount: new Set("test"),
|
|
24
|
+
unMount: new Set("test"),
|
|
25
|
+
watch: new Set("test"),
|
|
26
|
+
focus: "test",
|
|
27
|
+
watchAll: !1
|
|
28
|
+
},
|
|
29
|
+
_subjects: {
|
|
30
|
+
watch: e.fn(),
|
|
31
|
+
array: e.fn(),
|
|
32
|
+
state: e.fn()
|
|
33
|
+
},
|
|
34
|
+
_getWatch: e.fn(),
|
|
35
|
+
_formValues: ["test"],
|
|
36
|
+
_defaultValues: ["test"]
|
|
37
|
+
},
|
|
38
|
+
formState: { errors: {} },
|
|
39
|
+
watch: () => "2024-08-07"
|
|
40
|
+
})
|
|
41
|
+
}));
|
|
42
|
+
h("FormCheckBox Test", () => {
|
|
43
|
+
l("render FormCheckBox", () => {
|
|
44
|
+
n(/* @__PURE__ */ s(c, { propertyName: "hasValue", label: "user.hasValue" })), r(t.getByText("user.hasValue")).toBeInTheDocument(), r(t.getByText("error")).toBeInTheDocument(), r(t.getByRole("checkbox")).toBeInTheDocument();
|
|
45
|
+
}), l("render FormCheckBox click", () => {
|
|
46
|
+
n(/* @__PURE__ */ s(c, { propertyName: "hasValue", label: "user.hasValue", onChange: a }));
|
|
47
|
+
const o = t.getByRole("checkbox");
|
|
48
|
+
m.click(o), r(a).toHaveBeenCalled();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FieldValues, Path } from 'react-hook-form';
|
|
2
|
+
type DatePickerProps<T extends FieldValues> = {
|
|
3
|
+
/** Name of the property that this date picker represents. */
|
|
4
|
+
propertyName: Path<T>;
|
|
5
|
+
/** Label to be displayed with the date picker. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Determines if this input is mandatory. */
|
|
8
|
+
required?: boolean;
|
|
9
|
+
/** Custom text to show when the required field is not filled. */
|
|
10
|
+
requiredText?: string;
|
|
11
|
+
/** ClassName */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Add the number of years to subtract from the current date as bottom of range */
|
|
14
|
+
minRangeYear?: number;
|
|
15
|
+
/** Add the number of years to add to the current date as top of range */
|
|
16
|
+
maxRangeYear?: number;
|
|
17
|
+
/** Locale to be used for the date picker. */
|
|
18
|
+
locale?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* FormDatePicker is a custom form input component for selecting dates.
|
|
22
|
+
* It is integrated with react-hook-form for form management.
|
|
23
|
+
*
|
|
24
|
+
* @param propertyName - the name of the property this date picker maps to in the form.
|
|
25
|
+
* @param label - label displayed along with the date picker.
|
|
26
|
+
* @param required - determines if the date input is required.
|
|
27
|
+
* @param requiredText - text to be shown if the required date is not selected.
|
|
28
|
+
* @param className - class name to be passed if provided.
|
|
29
|
+
* @param minRangeYear - number of years to subtract from the current date as bottom of range
|
|
30
|
+
* @param maxRangeYear - number of years to add to the current date as top of range
|
|
31
|
+
* @param locale - locale to be used for the date picker.
|
|
32
|
+
*
|
|
33
|
+
* @returns A JSX element that renders a date picker form input.
|
|
34
|
+
*/
|
|
35
|
+
export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, required, requiredText, className, minRangeYear, maxRangeYear, locale, }: DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as r, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { Datepicker as Y } from "@element/react-components";
|
|
3
|
+
import { g as j } from "../../../get-BYajYtEc.js";
|
|
4
|
+
import { useState as v, useEffect as s, useMemo as l } from "react";
|
|
5
|
+
import { useFormContext as O, Controller as P } from "react-hook-form";
|
|
6
|
+
import { s as c } from "../../../formDatePicker.module-DllLVp7D.js";
|
|
7
|
+
const N = ({
|
|
8
|
+
propertyName: t,
|
|
9
|
+
label: i,
|
|
10
|
+
required: a = !1,
|
|
11
|
+
requiredText: m,
|
|
12
|
+
className: f,
|
|
13
|
+
minRangeYear: u,
|
|
14
|
+
maxRangeYear: d,
|
|
15
|
+
locale: D
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
control: g,
|
|
19
|
+
formState: { errors: S },
|
|
20
|
+
watch: x
|
|
21
|
+
} = O(), [k, o] = v(), n = x(t);
|
|
22
|
+
s(() => {
|
|
23
|
+
o(/* @__PURE__ */ new Date());
|
|
24
|
+
}, []), s(() => {
|
|
25
|
+
o(new Date(n));
|
|
26
|
+
}, [n]);
|
|
27
|
+
const p = l(() => (/* @__PURE__ */ new Date()).getFullYear() - (u ?? 95), []), w = l(() => (/* @__PURE__ */ new Date()).getFullYear() + (d ?? 15), []);
|
|
28
|
+
return /* @__PURE__ */ r(
|
|
29
|
+
P,
|
|
30
|
+
{
|
|
31
|
+
name: t,
|
|
32
|
+
rules: {
|
|
33
|
+
required: a
|
|
34
|
+
},
|
|
35
|
+
control: g,
|
|
36
|
+
render: ({ field: { onChange: C, ...h } }) => /* @__PURE__ */ F("div", { className: c.datePickerContainer, children: [
|
|
37
|
+
/* @__PURE__ */ r(
|
|
38
|
+
Y,
|
|
39
|
+
{
|
|
40
|
+
...h,
|
|
41
|
+
className: f ?? "",
|
|
42
|
+
value: k,
|
|
43
|
+
variant: "outlined",
|
|
44
|
+
label: i,
|
|
45
|
+
format: (e) => e ? e.toLocaleDateString(D ?? "en") : "",
|
|
46
|
+
disableClearing: !0,
|
|
47
|
+
onChange: (e) => {
|
|
48
|
+
C(e?.toISOString());
|
|
49
|
+
},
|
|
50
|
+
minQuickSelectYear: p,
|
|
51
|
+
maxQuickSelectYear: w,
|
|
52
|
+
readOnly: !0
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
a && j(S, t) && /* @__PURE__ */ r("span", { className: c.errorText, children: m })
|
|
56
|
+
] })
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
N as FormDatePicker
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { r as n, s as a, f as m } from "../../../react.esm-BeDwcQWb.js";
|
|
3
|
+
import { FormDatePicker as s } from "./FormDatePicker.js";
|
|
4
|
+
import { v as e, d as l, t as c, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
const f = e.fn();
|
|
6
|
+
e.mock("react-hook-form", () => ({
|
|
7
|
+
...e.importActual("react-hook-form"),
|
|
8
|
+
Controller: ({
|
|
9
|
+
render: t
|
|
10
|
+
}) => t({
|
|
11
|
+
field: {
|
|
12
|
+
onChange: f
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
useFormContext: () => ({
|
|
16
|
+
control: {
|
|
17
|
+
register: e.fn(),
|
|
18
|
+
unregister: e.fn(),
|
|
19
|
+
getFieldState: e.fn(),
|
|
20
|
+
_names: {
|
|
21
|
+
array: new Set("test"),
|
|
22
|
+
mount: new Set("test"),
|
|
23
|
+
unMount: new Set("test"),
|
|
24
|
+
watch: new Set("test"),
|
|
25
|
+
focus: "test",
|
|
26
|
+
watchAll: !1
|
|
27
|
+
},
|
|
28
|
+
_subjects: {
|
|
29
|
+
watch: e.fn(),
|
|
30
|
+
array: e.fn(),
|
|
31
|
+
state: e.fn()
|
|
32
|
+
},
|
|
33
|
+
_getWatch: e.fn(),
|
|
34
|
+
_formValues: ["test"],
|
|
35
|
+
_defaultValues: ["test"]
|
|
36
|
+
},
|
|
37
|
+
formState: { errors: {} },
|
|
38
|
+
watch: () => "2024-08-07"
|
|
39
|
+
})
|
|
40
|
+
}));
|
|
41
|
+
l("FormDatePicker Test", () => {
|
|
42
|
+
c("render FormDatePicker", () => {
|
|
43
|
+
n(
|
|
44
|
+
/* @__PURE__ */ o(
|
|
45
|
+
s,
|
|
46
|
+
{
|
|
47
|
+
propertyName: "birthday",
|
|
48
|
+
label: "user.date-of-birth",
|
|
49
|
+
maxRangeYear: 0
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
const t = a.getByRole("textbox");
|
|
54
|
+
r(t).toBeInTheDocument(), r(t).toBeInstanceOf(HTMLInputElement), r(["7.8.2024", "8/7/2024"]).toContainEqual(t.value), r(a.getByText("user.date-of-birth")).toBeInTheDocument();
|
|
55
|
+
}), c("change FormDatePicker value", () => {
|
|
56
|
+
n(
|
|
57
|
+
/* @__PURE__ */ o(
|
|
58
|
+
s,
|
|
59
|
+
{
|
|
60
|
+
propertyName: "birthday",
|
|
61
|
+
label: "user.date-of-birth",
|
|
62
|
+
maxRangeYear: 0
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
const t = a.getByRole("textbox");
|
|
67
|
+
m.change(t, { target: { value: "1.1.24" } });
|
|
68
|
+
});
|
|
69
|
+
});
|