@golemui/gui-react 0.0.2 → 0.12.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/Accordion-Btp_b0xA.js +59 -0
- package/{Alert-B71lVm89.js → Alert-CBgIsMKO.js} +1 -1
- package/Button-DN0G-MUb.js +21 -0
- package/{Calendar-BtYEcLJH.js → Calendar-Dxavv2c7.js} +12 -12
- package/Checkbox-ViM9MktI.js +30 -0
- package/Currency-C4QFWO7Y.js +37 -0
- package/{DateInput-B4S5ssKR.js → DateInput-CdkyyAhc.js} +4 -4
- package/DatePicker-TkMCndrw.js +138 -0
- package/Dropdown-jKk4TyOa.js +201 -0
- package/Errors-D7gxq0y6.js +16 -0
- package/Flex-gD893rrB.js +19 -0
- package/Grid-DREMTVQI.js +30 -0
- package/List-BjMIo577.js +103 -0
- package/Markdown-Ck_88HOR.js +47 -0
- package/MarkdownText-kJVkmihW.js +9 -0
- package/Number-CnQ95aLO.js +35 -0
- package/Password-Bg97DYW3.js +36 -0
- package/README.md +17 -4
- package/RadioGroup-Dldom5ja.js +33 -0
- package/RangeCalendar-u2vxIhna.js +49 -0
- package/RangeDateInput-CopLdb6J.js +54 -0
- package/RangeDatePicker-DXpV-B_G.js +146 -0
- package/Renderer-B6WmwKDv.js +9 -0
- package/Repeater-BYgXVfbl.js +111 -0
- package/Select-BLUX_W91.js +55 -0
- package/Tabs-C2qqi8xO.js +129 -0
- package/TextArea-cw3Q2v97.js +35 -0
- package/TextInput-geLoAA0c.js +32 -0
- package/{Toggle-CCzdFjkq.js → Toggle-a7L71GwR.js} +5 -5
- package/index.js +790 -698
- package/index.umd.cjs +2 -2
- package/lib/components/Form.d.ts +7 -13
- package/lib/components/Grid.d.ts +2 -0
- package/lib/components/Markdown.d.ts +2 -0
- package/lib/components/MarkdownText.d.ts +2 -0
- package/lib/components/RangeDateInput.d.ts +2 -0
- package/lib/components/RangeDatePicker.d.ts +2 -0
- package/lib/widget.loaders.d.ts +2 -2
- package/package.json +11 -6
- package/Accordion-F768Nqhg.js +0 -58
- package/Button-BctTVpNg.js +0 -20
- package/CHANGELOG.md +0 -529
- package/Checkbox-CezJrTAx.js +0 -30
- package/Currency-Bj2yx0JY.js +0 -36
- package/DatePicker-C1Qiridi.js +0 -130
- package/Dropdown-Dd50Psea.js +0 -196
- package/Flex-DPIzOItG.js +0 -11
- package/List-CLplkkLa.js +0 -103
- package/Number-DsIN4V1r.js +0 -34
- package/Password-B_QkZ1WU.js +0 -35
- package/RadioGroup-BPhyHxKf.js +0 -32
- package/RangeCalendar-B-FeEowl.js +0 -47
- package/Renderer-CRWbM4oE.js +0 -9
- package/Repeater-D1koXq-v.js +0 -46
- package/Select-DvFmJB1_.js +0 -54
- package/Tabs-CsmJz1Vs.js +0 -115
- package/TextArea-z99jVJ4-.js +0 -35
- package/TextInput-BTkEyMEv.js +0 -31
package/DatePicker-C1Qiridi.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { jsx as i, jsxs as k } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as z } from "@golemui/react";
|
|
3
|
-
import { useState as B, useRef as F, useCallback as R, useEffect as K } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function S({ errors: g, uid: c }) {
|
|
6
|
-
return /* @__PURE__ */ i("ul", { className: "gui-validator", id: `${c}_errors`, "data-cy": `${c}_validator-errors`, children: g.map((r, s) => /* @__PURE__ */ i(
|
|
7
|
-
"li",
|
|
8
|
-
{
|
|
9
|
-
className: "gui-validator__error",
|
|
10
|
-
role: "alert",
|
|
11
|
-
"data-cy": `${c}_validator-error`,
|
|
12
|
-
children: r
|
|
13
|
-
},
|
|
14
|
-
s
|
|
15
|
-
)) });
|
|
16
|
-
}
|
|
17
|
-
function J(g) {
|
|
18
|
-
const c = g.widget, {
|
|
19
|
-
uid: r,
|
|
20
|
-
errors: s,
|
|
21
|
-
value: I,
|
|
22
|
-
isTouched: p,
|
|
23
|
-
templateData: e,
|
|
24
|
-
onValueChanged: m,
|
|
25
|
-
onBlur: d,
|
|
26
|
-
injectValidationIssues: u
|
|
27
|
-
} = z(c), [h, v] = B(!1), b = F(null), E = F(null), _ = R(
|
|
28
|
-
(t) => {
|
|
29
|
-
const n = t, a = (y) => {
|
|
30
|
-
u(null), m(y.detail.value);
|
|
31
|
-
}, o = (y) => {
|
|
32
|
-
u([y.detail.message]);
|
|
33
|
-
}, l = () => {
|
|
34
|
-
v(!0);
|
|
35
|
-
};
|
|
36
|
-
return b.current = t, t && (n.addEventListener("change", a), n.addEventListener("focus", l), n.addEventListener("blur", d), n.addEventListener("inputError", o)), () => {
|
|
37
|
-
n.removeEventListener("change", a), n.removeEventListener("focus", l), n.removeEventListener("blur", d), n.removeEventListener("inputError", o);
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
[m, d, u]
|
|
41
|
-
), D = R(
|
|
42
|
-
(t) => {
|
|
43
|
-
const n = t, a = (l) => {
|
|
44
|
-
u(null), m(l.detail.value);
|
|
45
|
-
}, o = (l) => {
|
|
46
|
-
d(), v(!1);
|
|
47
|
-
};
|
|
48
|
-
return E.current = t, t && (n.addEventListener("blur", o), n.addEventListener("change", a)), () => {
|
|
49
|
-
n.addEventListener("blur", o), n.addEventListener("change", a);
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
[m, u, d]
|
|
53
|
-
);
|
|
54
|
-
K(() => {
|
|
55
|
-
const t = (n) => {
|
|
56
|
-
if (!h) return;
|
|
57
|
-
const a = n.composedPath(), o = b.current && a.includes(b.current), l = E.current && a.includes(E.current);
|
|
58
|
-
!o && !l && v(!1);
|
|
59
|
-
};
|
|
60
|
-
return document.addEventListener("click", t), () => {
|
|
61
|
-
document.removeEventListener("click", t);
|
|
62
|
-
};
|
|
63
|
-
}, [h]);
|
|
64
|
-
const C = () => {
|
|
65
|
-
h || v(!0);
|
|
66
|
-
}, f = e.hint, N = e.icon, H = e.prevMonthIcon, $ = e.nextMonthIcon, q = e.prevMonthAriaLabel, A = e.nextMonthAriaLabel, O = e.dayFormat, j = e.weekdayFormat, P = e.monthFormat, V = p && s && s.length > 0, x = e.disabled, w = e.readonly, L = e.validator?.required, M = e.lang;
|
|
67
|
-
return /* @__PURE__ */ k("div", { className: "gui-date-picker", style: { flex: e.size }, children: [
|
|
68
|
-
e.label && /* @__PURE__ */ k("label", { className: "gui-label", htmlFor: r, "data-cy": `${r}_label`, children: [
|
|
69
|
-
e.label + (L ? " *" : ""),
|
|
70
|
-
f && /* @__PURE__ */ i("div", { className: "gui-widget-hint", id: `${r}_hint`, children: f })
|
|
71
|
-
] }),
|
|
72
|
-
/* @__PURE__ */ k(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
role: "button",
|
|
76
|
-
tabIndex: 0,
|
|
77
|
-
className: "gui-widget",
|
|
78
|
-
onClick: C,
|
|
79
|
-
onKeyUp: (t) => {
|
|
80
|
-
(t.key === "Enter" || t.key === " ") && C();
|
|
81
|
-
},
|
|
82
|
-
"aria-expanded": h,
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */ i(
|
|
85
|
-
"gui-date",
|
|
86
|
-
{
|
|
87
|
-
ref: _,
|
|
88
|
-
uid: r,
|
|
89
|
-
hint: f,
|
|
90
|
-
showErrors: !1,
|
|
91
|
-
errors: s,
|
|
92
|
-
touched: p,
|
|
93
|
-
required: L,
|
|
94
|
-
disabled: x,
|
|
95
|
-
readOnly: w,
|
|
96
|
-
value: I,
|
|
97
|
-
icon: N,
|
|
98
|
-
localeId: M
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
h && /* @__PURE__ */ i(
|
|
102
|
-
"gui-calendar",
|
|
103
|
-
{
|
|
104
|
-
ref: D,
|
|
105
|
-
uid: r,
|
|
106
|
-
hint: f,
|
|
107
|
-
touched: p,
|
|
108
|
-
required: L,
|
|
109
|
-
disabled: x,
|
|
110
|
-
readOnly: w,
|
|
111
|
-
value: I,
|
|
112
|
-
prevMonthIcon: H,
|
|
113
|
-
nextMonthIcon: $,
|
|
114
|
-
prevMonthAriaLabel: q,
|
|
115
|
-
nextMonthAriaLabel: A,
|
|
116
|
-
dayFormat: O,
|
|
117
|
-
weekdayFormat: j,
|
|
118
|
-
monthFormat: P,
|
|
119
|
-
localeId: M
|
|
120
|
-
}
|
|
121
|
-
)
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
),
|
|
125
|
-
V && /* @__PURE__ */ i(S, { errors: s, uid: r })
|
|
126
|
-
] });
|
|
127
|
-
}
|
|
128
|
-
export {
|
|
129
|
-
J as DatePicker
|
|
130
|
-
};
|
package/Dropdown-Dd50Psea.js
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { jsxs as K, jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as le, useDebounceCallback as ce, useItemRenderer as ae } from "@golemui/react";
|
|
3
|
-
import { useState as m, useRef as O, useMemo as oe, useCallback as x, useEffect as k } from "react";
|
|
4
|
-
import { D as de } from "./DefaultListItemRenderer-lNc9Kk7x.js";
|
|
5
|
-
function ve(P) {
|
|
6
|
-
const p = P.widget, { uid: o, errors: _, value: C, isTouched: w, templateData: t, onFilter: F, onValueChanged: E, onBlur: j } = le(p), [I, z] = m({ start: 0, end: 10 }), [b, M] = m([]), [U, B] = m([]), [W, H] = m(-1), [J, g] = m(!1), [y, d] = m(!1), [D, N] = m(void 0), r = O(null), c = O(null), R = O(null), Q = oe(() => b.slice(I.start, I.end), [b, I]), S = x(() => {
|
|
7
|
-
j(), d(!1), g(!1);
|
|
8
|
-
}, [j]), v = x(
|
|
9
|
-
(e) => {
|
|
10
|
-
if (E(e), c.current) {
|
|
11
|
-
const s = (t.items || []).find(
|
|
12
|
-
(i) => t.valueField ? i[t.valueField] === e : i === e
|
|
13
|
-
);
|
|
14
|
-
if (s) {
|
|
15
|
-
const i = t.valueField ? s[t.valueField] : s;
|
|
16
|
-
c.current.value = String(i);
|
|
17
|
-
} else e || (c.current.value = "");
|
|
18
|
-
}
|
|
19
|
-
d(!1), g(!1);
|
|
20
|
-
},
|
|
21
|
-
[E, t]
|
|
22
|
-
), X = x(
|
|
23
|
-
(e, n) => {
|
|
24
|
-
t.readonly || (v(e.value), F(""), H(n), N(e), g(!1), d(!1), r.current && r.current.focusItemAtIndex(n));
|
|
25
|
-
},
|
|
26
|
-
[v, F, t.readonly]
|
|
27
|
-
);
|
|
28
|
-
k(() => {
|
|
29
|
-
const e = r.current;
|
|
30
|
-
if (!e) return;
|
|
31
|
-
const n = (a) => {
|
|
32
|
-
const { startIndex: l, endIndex: f } = a.detail;
|
|
33
|
-
z({ start: l, end: f });
|
|
34
|
-
}, s = (a) => {
|
|
35
|
-
const l = a.detail;
|
|
36
|
-
M(l ? [...l] : []);
|
|
37
|
-
}, i = (a) => {
|
|
38
|
-
const l = a.detail.index;
|
|
39
|
-
H(l);
|
|
40
|
-
}, u = (a) => {
|
|
41
|
-
const l = a.detail.value;
|
|
42
|
-
v(l), N(b.find((f) => f.value === l)), g(!1), d(!1);
|
|
43
|
-
};
|
|
44
|
-
return e.addEventListener("gui-range-change", n), e.addEventListener("gui-update-items", s), e.addEventListener("gui-focus-change", i), e.addEventListener("change", u), () => {
|
|
45
|
-
e.removeEventListener("gui-range-change", n), e.removeEventListener("gui-update-items", s), e.removeEventListener("gui-focus-change", i), e.removeEventListener("change", u);
|
|
46
|
-
};
|
|
47
|
-
}, [v, b, E]), k(() => {
|
|
48
|
-
const e = (n) => {
|
|
49
|
-
if (!y) return;
|
|
50
|
-
const s = n.target, i = c.current && c.current.contains(s), u = r.current && r.current.contains(s);
|
|
51
|
-
!i && !u && S();
|
|
52
|
-
};
|
|
53
|
-
return document.addEventListener("click", e), () => document.removeEventListener("click", e);
|
|
54
|
-
}, [S, y]), k(() => {
|
|
55
|
-
const e = t.labelField ?? t.valueField, n = e ? D?.template[e] : D?.template;
|
|
56
|
-
c.current.value = n ?? "";
|
|
57
|
-
}, [D, t.labelField, t.valueField]), k(() => {
|
|
58
|
-
R.current && c.current && r.current && (R.current.targetElement = [c.current, r.current]);
|
|
59
|
-
}, []);
|
|
60
|
-
const Y = async (e) => {
|
|
61
|
-
switch (e.key) {
|
|
62
|
-
case "ArrowDown":
|
|
63
|
-
e.preventDefault(), d(!0), setTimeout(() => {
|
|
64
|
-
r.current && (r.current.focus(), r.current.scrollToSelectedIndex());
|
|
65
|
-
}, 0);
|
|
66
|
-
break;
|
|
67
|
-
case "Enter":
|
|
68
|
-
c.current?.value || v(null);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}, Z = x(
|
|
72
|
-
(e) => {
|
|
73
|
-
const n = !!p.on?.filter;
|
|
74
|
-
if (F(e), e && !n) {
|
|
75
|
-
g(!0), d(!0);
|
|
76
|
-
const s = t.searchFields ?? [t.labelField, t.valueField].filter(
|
|
77
|
-
(l) => !!l
|
|
78
|
-
), i = s.length > 0, a = (t.items || []).filter((l) => {
|
|
79
|
-
const f = Object.keys(l);
|
|
80
|
-
if (!f.length)
|
|
81
|
-
return l.toString().toLowerCase().includes(e.toLowerCase());
|
|
82
|
-
const G = (q, re) => q || l[re].toString().toLowerCase().includes(e.toLowerCase());
|
|
83
|
-
return i ? f.filter((q) => s.includes(q)).reduce(G, !1) : f.reduce(G, !1);
|
|
84
|
-
});
|
|
85
|
-
B(a);
|
|
86
|
-
} else
|
|
87
|
-
g(!1), B([...t.items || []]);
|
|
88
|
-
},
|
|
89
|
-
[
|
|
90
|
-
p.on?.filter,
|
|
91
|
-
F,
|
|
92
|
-
t.items,
|
|
93
|
-
t.labelField,
|
|
94
|
-
t.searchFields,
|
|
95
|
-
t.valueField
|
|
96
|
-
]
|
|
97
|
-
), ee = ce(Z, t.inputDebounce ?? 500), te = (e) => {
|
|
98
|
-
const n = e.target.value;
|
|
99
|
-
y || d(!0), ee(n);
|
|
100
|
-
}, V = () => {
|
|
101
|
-
d(!0), setTimeout(() => {
|
|
102
|
-
r.current && r.current.scrollToSelectedIndex();
|
|
103
|
-
}, 0);
|
|
104
|
-
}, A = (e) => {
|
|
105
|
-
const n = e.relatedTarget, s = c.current && c.current.contains(n), i = r.current && r.current.contains(n);
|
|
106
|
-
s || i || S();
|
|
107
|
-
}, ne = ae(t.itemRenderer) || de, se = t.label, T = t.validator?.required, $ = t.disabled, L = t.readonly, ie = !!p.on?.filter;
|
|
108
|
-
return /* @__PURE__ */ K("div", { className: "gui-dropdown", style: { flex: t.size }, children: [
|
|
109
|
-
/* @__PURE__ */ h(
|
|
110
|
-
"gui-label",
|
|
111
|
-
{
|
|
112
|
-
ref: R,
|
|
113
|
-
uid: o,
|
|
114
|
-
label: se,
|
|
115
|
-
hint: t.hint,
|
|
116
|
-
errors: _,
|
|
117
|
-
touched: w,
|
|
118
|
-
required: T,
|
|
119
|
-
native: !1
|
|
120
|
-
}
|
|
121
|
-
),
|
|
122
|
-
/* @__PURE__ */ K("div", { className: "gui-widget", children: [
|
|
123
|
-
/* @__PURE__ */ h(
|
|
124
|
-
"input",
|
|
125
|
-
{
|
|
126
|
-
ref: c,
|
|
127
|
-
type: "text",
|
|
128
|
-
id: o,
|
|
129
|
-
"data-cy": `${o}_textinput`,
|
|
130
|
-
defaultValue: C ?? "",
|
|
131
|
-
required: T,
|
|
132
|
-
disabled: $,
|
|
133
|
-
readOnly: L,
|
|
134
|
-
placeholder: t.placeholder ?? "",
|
|
135
|
-
onKeyDown: Y,
|
|
136
|
-
onInput: te,
|
|
137
|
-
onFocus: V,
|
|
138
|
-
onBlur: A,
|
|
139
|
-
"aria-labelledby": t.label ? `${o}_label` : void 0,
|
|
140
|
-
"aria-describedby": t.hint ? `${o}_hint` : void 0
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
/* @__PURE__ */ h(
|
|
144
|
-
"gui-list",
|
|
145
|
-
{
|
|
146
|
-
ref: r,
|
|
147
|
-
id: `${o}-list`,
|
|
148
|
-
uid: o,
|
|
149
|
-
value: C ?? "",
|
|
150
|
-
valueField: t.valueField,
|
|
151
|
-
items: J && !ie ? U : t.items,
|
|
152
|
-
itemHeight: t.itemHeight,
|
|
153
|
-
height: t.height,
|
|
154
|
-
required: T,
|
|
155
|
-
touched: w,
|
|
156
|
-
disabled: $ || L,
|
|
157
|
-
readOnly: L,
|
|
158
|
-
hidden: !y,
|
|
159
|
-
onFocus: V,
|
|
160
|
-
onBlur: A,
|
|
161
|
-
children: Q.map((e, n) => {
|
|
162
|
-
const s = I.start + n, i = C === e.value, u = W === s;
|
|
163
|
-
return /* @__PURE__ */ h(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
role: "option",
|
|
167
|
-
tabIndex: -1,
|
|
168
|
-
className: "gui-list__item-wrapper",
|
|
169
|
-
id: `${o}-item-${s}`,
|
|
170
|
-
style: { height: `${t.itemHeight || 40}px` },
|
|
171
|
-
"aria-selected": i,
|
|
172
|
-
onClick: () => X(e, s),
|
|
173
|
-
children: /* @__PURE__ */ h(
|
|
174
|
-
ne,
|
|
175
|
-
{
|
|
176
|
-
template: e.template,
|
|
177
|
-
value: e.value,
|
|
178
|
-
index: s,
|
|
179
|
-
selected: i,
|
|
180
|
-
disabled: $ || L,
|
|
181
|
-
focused: u
|
|
182
|
-
}
|
|
183
|
-
)
|
|
184
|
-
},
|
|
185
|
-
s
|
|
186
|
-
);
|
|
187
|
-
})
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
] }),
|
|
191
|
-
/* @__PURE__ */ h("gui-errors", { errors: _, touched: w })
|
|
192
|
-
] });
|
|
193
|
-
}
|
|
194
|
-
export {
|
|
195
|
-
ve as Dropdown
|
|
196
|
-
};
|
package/Flex-DPIzOItG.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useLayoutWidget as s, WidgetRenderer as c } from "@golemui/react";
|
|
3
|
-
import { useCallback as u } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function _(n) {
|
|
6
|
-
const l = n.widget, { uid: o, children: t, templateData: i } = s(l), d = u(() => t.map((r) => /* @__PURE__ */ e(c, { widget: r }, r.uid)), [t]), a = i.direction === "horizontal" ? "gui-flex__widget--horizontal" : "", g = i.align ? `gui-flex__widget--align-${i.align}` : "";
|
|
7
|
-
return /* @__PURE__ */ e("div", { className: "gui-flex", style: { flex: i.size }, children: /* @__PURE__ */ e("div", { className: `gui-flex__widget ${a} ${g}`, id: o, children: d() }) });
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
_ as Flex
|
|
11
|
-
};
|
package/List-CLplkkLa.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { jsxs as $, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback as E, useRef as j, useState as f, useMemo as O, useEffect as S } from "react";
|
|
3
|
-
import { useInputWidget as _, useItemRenderer as z } from "@golemui/react";
|
|
4
|
-
import { D as A } from "./DefaultListItemRenderer-lNc9Kk7x.js";
|
|
5
|
-
function G(R) {
|
|
6
|
-
const C = R.widget, { uid: u, errors: p, value: I, isTouched: g, templateData: t, onValueChanged: c, onBlur: b } = _(C), y = E(
|
|
7
|
-
(e) => {
|
|
8
|
-
i.current && e.relatedTarget && i.current.contains(e.relatedTarget) || b();
|
|
9
|
-
},
|
|
10
|
-
[b]
|
|
11
|
-
), [o, F] = f({ start: 0, end: 10 }), [h, q] = f([]), [w, x] = f(-1), i = j(null), D = O(() => (h.length > 0 ? h : t.items || []).slice(o.start, o.end), [h, t.items, o]);
|
|
12
|
-
S(() => {
|
|
13
|
-
const e = i.current;
|
|
14
|
-
if (!e) return;
|
|
15
|
-
const n = (a) => {
|
|
16
|
-
const { startIndex: s, endIndex: T } = a.detail;
|
|
17
|
-
F({ start: s, end: T });
|
|
18
|
-
}, r = (a) => {
|
|
19
|
-
const s = a.detail;
|
|
20
|
-
q(s ? [...s] : []);
|
|
21
|
-
}, l = (a) => {
|
|
22
|
-
const s = a.detail.index;
|
|
23
|
-
x(s);
|
|
24
|
-
}, m = (a) => {
|
|
25
|
-
const s = a.detail.value;
|
|
26
|
-
c(s);
|
|
27
|
-
};
|
|
28
|
-
return e.addEventListener("change", m), e.addEventListener("gui-update-items", r), e.addEventListener("gui-range-change", n), e.addEventListener("gui-focus-change", l), () => {
|
|
29
|
-
e.removeEventListener("change", m), e.removeEventListener("gui-update-items", r), e.removeEventListener("gui-range-change", n), e.removeEventListener("gui-focus-change", l);
|
|
30
|
-
};
|
|
31
|
-
}, [c]);
|
|
32
|
-
const k = E(
|
|
33
|
-
(e, n) => {
|
|
34
|
-
t.disabled || (c(e.value), x(n), i.current && i.current.focusItemAtIndex(n));
|
|
35
|
-
},
|
|
36
|
-
[c]
|
|
37
|
-
), B = z(t.itemRenderer) || A, H = t.label, L = t.validator?.required, v = t.disabled, N = t.readonly;
|
|
38
|
-
return /* @__PURE__ */ $("div", { className: "gui-list", style: { flex: t.size }, children: [
|
|
39
|
-
/* @__PURE__ */ d(
|
|
40
|
-
"gui-label",
|
|
41
|
-
{
|
|
42
|
-
targetElement: i.current || void 0,
|
|
43
|
-
uid: u,
|
|
44
|
-
label: H,
|
|
45
|
-
hint: t.hint,
|
|
46
|
-
errors: p,
|
|
47
|
-
touched: g,
|
|
48
|
-
required: L,
|
|
49
|
-
native: !1
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
/* @__PURE__ */ d("div", { className: "gui-widget", children: /* @__PURE__ */ d(
|
|
53
|
-
"gui-list",
|
|
54
|
-
{
|
|
55
|
-
ref: i,
|
|
56
|
-
id: u,
|
|
57
|
-
uid: u,
|
|
58
|
-
value: I ?? "",
|
|
59
|
-
valueField: t.valueField,
|
|
60
|
-
items: t.items,
|
|
61
|
-
itemHeight: t.itemHeight,
|
|
62
|
-
height: t.height,
|
|
63
|
-
required: L,
|
|
64
|
-
touched: g,
|
|
65
|
-
disabled: v,
|
|
66
|
-
readOnly: N,
|
|
67
|
-
onBlur: y,
|
|
68
|
-
children: D.map((e, n) => {
|
|
69
|
-
const r = o.start + n, l = I === e.value, m = w === r;
|
|
70
|
-
return /* @__PURE__ */ d(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
role: "option",
|
|
74
|
-
tabIndex: -1,
|
|
75
|
-
id: `${u}-item-${r}`,
|
|
76
|
-
className: "gui-list__item-wrapper",
|
|
77
|
-
style: { height: `${t.itemHeight || 40}px` },
|
|
78
|
-
"aria-selected": l,
|
|
79
|
-
"aria-disabled": v ? "true" : "false",
|
|
80
|
-
onClick: () => k(e, r),
|
|
81
|
-
children: /* @__PURE__ */ d(
|
|
82
|
-
B,
|
|
83
|
-
{
|
|
84
|
-
template: e.template,
|
|
85
|
-
value: e.value,
|
|
86
|
-
index: n,
|
|
87
|
-
selected: l,
|
|
88
|
-
disabled: v,
|
|
89
|
-
focused: m
|
|
90
|
-
}
|
|
91
|
-
)
|
|
92
|
-
},
|
|
93
|
-
r
|
|
94
|
-
);
|
|
95
|
-
})
|
|
96
|
-
}
|
|
97
|
-
) }),
|
|
98
|
-
/* @__PURE__ */ d("gui-errors", { errors: p, touched: g })
|
|
99
|
-
] });
|
|
100
|
-
}
|
|
101
|
-
export {
|
|
102
|
-
G as List
|
|
103
|
-
};
|
package/Number-DsIN4V1r.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as q } from "@golemui/react";
|
|
3
|
-
import { useCallback as C } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function R(n) {
|
|
6
|
-
const i = n.widget, { uid: a, errors: r, value: l, isTouched: s, templateData: e, onValueChanged: t, onBlur: u } = q(i), d = C(
|
|
7
|
-
(y) => t(y.nativeEvent.detail.value),
|
|
8
|
-
[t]
|
|
9
|
-
), m = e.label, c = e.hint, p = e.placeholder, h = e.step, b = e.minimum, g = e.maximum, v = e.autoGrow, f = e.disabled, x = e.readonly, w = e.validator?.required;
|
|
10
|
-
return /* @__PURE__ */ o("div", { className: "gui-number", style: { flex: e.size }, children: /* @__PURE__ */ o(
|
|
11
|
-
"gui-number",
|
|
12
|
-
{
|
|
13
|
-
uid: a,
|
|
14
|
-
label: m,
|
|
15
|
-
hint: c,
|
|
16
|
-
errors: r,
|
|
17
|
-
touched: s,
|
|
18
|
-
required: w,
|
|
19
|
-
disabled: f,
|
|
20
|
-
readOnly: x,
|
|
21
|
-
value: l,
|
|
22
|
-
step: h,
|
|
23
|
-
minimum: b,
|
|
24
|
-
maximum: g,
|
|
25
|
-
autoGrow: v,
|
|
26
|
-
placeholder: p ?? void 0,
|
|
27
|
-
onInput: d,
|
|
28
|
-
onBlur: u
|
|
29
|
-
}
|
|
30
|
-
) });
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
R as NumberInput
|
|
34
|
-
};
|
package/Password-B_QkZ1WU.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as L } from "@golemui/react";
|
|
3
|
-
import { useCallback as q } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function j(a) {
|
|
6
|
-
const d = a.widget, { uid: n, errors: r, value: t, isTouched: i, templateData: o, onValueChanged: s, onBlur: l } = L(d), c = q(
|
|
7
|
-
(y) => s(y.nativeEvent.detail.value),
|
|
8
|
-
[s]
|
|
9
|
-
), h = o.label, u = o.hint, w = o.placeholder, p = o.showPasswordIcon, b = o.hidePasswordIcon, m = o.showPasswordLabel, P = o.hidePasswordLabel, g = o.icon, v = o.disabled, I = o.readonly, f = o.validator?.required;
|
|
10
|
-
return /* @__PURE__ */ e("div", { className: "gui-password", style: { flex: o.size }, children: /* @__PURE__ */ e(
|
|
11
|
-
"gui-password",
|
|
12
|
-
{
|
|
13
|
-
uid: n,
|
|
14
|
-
label: h,
|
|
15
|
-
hint: u,
|
|
16
|
-
errors: r,
|
|
17
|
-
touched: i,
|
|
18
|
-
required: f,
|
|
19
|
-
disabled: v,
|
|
20
|
-
readOnly: I,
|
|
21
|
-
value: t,
|
|
22
|
-
icon: g,
|
|
23
|
-
placeholder: w ?? void 0,
|
|
24
|
-
showPasswordIcon: p,
|
|
25
|
-
hidePasswordIcon: b,
|
|
26
|
-
showPasswordLabel: m,
|
|
27
|
-
hidePasswordLabel: P,
|
|
28
|
-
onInput: c,
|
|
29
|
-
onBlur: l
|
|
30
|
-
}
|
|
31
|
-
) });
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
j as Password
|
|
35
|
-
};
|
package/RadioGroup-BPhyHxKf.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as C } from "@golemui/react";
|
|
3
|
-
import { useCallback as F } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function D(t) {
|
|
6
|
-
const l = t.widget, { uid: a, errors: n, value: d, isTouched: r, templateData: e, onValueChanged: o, onBlur: s } = C(l), u = F(
|
|
7
|
-
(y) => o(y.nativeEvent.detail.value),
|
|
8
|
-
[o]
|
|
9
|
-
), c = e.label, p = e.hint, g = e.options, h = e.labelField, m = e.valueField, b = e.disabled, v = e.readonly, f = e.validator?.required;
|
|
10
|
-
return /* @__PURE__ */ i("div", { className: "gui-radiogroup", style: { flex: e.size }, children: /* @__PURE__ */ i(
|
|
11
|
-
"gui-radiogroup",
|
|
12
|
-
{
|
|
13
|
-
uid: a,
|
|
14
|
-
label: c,
|
|
15
|
-
errors: n,
|
|
16
|
-
touched: r,
|
|
17
|
-
required: f,
|
|
18
|
-
disabled: b,
|
|
19
|
-
readOnly: v,
|
|
20
|
-
value: d,
|
|
21
|
-
hint: p,
|
|
22
|
-
options: g,
|
|
23
|
-
labelField: h,
|
|
24
|
-
valueField: m,
|
|
25
|
-
onChange: u,
|
|
26
|
-
onBlur: s
|
|
27
|
-
}
|
|
28
|
-
) });
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
D as RadioGroup
|
|
32
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as O } from "@golemui/react";
|
|
3
|
-
import { useCallback as H } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function V(l) {
|
|
6
|
-
const c = l.widget, { uid: m, errors: u, value: h, isTouched: b, templateData: e, onBlur: t, onValueChanged: a } = O(c), g = H(
|
|
7
|
-
(o) => {
|
|
8
|
-
const n = o, r = (d) => a(d.detail.value), s = (d) => {
|
|
9
|
-
t();
|
|
10
|
-
};
|
|
11
|
-
return o && (n.addEventListener("blur", s), n.addEventListener("change", r)), () => {
|
|
12
|
-
n.removeEventListener("blur", s), n.removeEventListener("change", r);
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
[a, t]
|
|
16
|
-
), v = e.label, p = e.hint, M = e.prevMonthIcon, f = e.nextMonthIcon, x = e.prevMonthAriaLabel, L = e.nextMonthAriaLabel, y = e.dayFormat, D = e.weekdayFormat, F = e.monthFormat, I = e.minDate, R = e.maxDate, w = e.disabledRanges, A = e.numberOfMonths, E = e.lang, k = e.disabled, q = e.readonly, C = e.validator?.required;
|
|
17
|
-
return /* @__PURE__ */ i("div", { className: "gui-range-calendar", children: /* @__PURE__ */ i(
|
|
18
|
-
"gui-range-calendar",
|
|
19
|
-
{
|
|
20
|
-
ref: g,
|
|
21
|
-
uid: m,
|
|
22
|
-
label: v,
|
|
23
|
-
hint: p,
|
|
24
|
-
errors: u,
|
|
25
|
-
touched: b,
|
|
26
|
-
required: C,
|
|
27
|
-
disabled: k,
|
|
28
|
-
readOnly: q,
|
|
29
|
-
value: h,
|
|
30
|
-
prevMonthIcon: M,
|
|
31
|
-
nextMonthIcon: f,
|
|
32
|
-
prevMonthAriaLabel: x,
|
|
33
|
-
nextMonthAriaLabel: L,
|
|
34
|
-
dayFormat: y,
|
|
35
|
-
weekdayFormat: D,
|
|
36
|
-
monthFormat: F,
|
|
37
|
-
minDate: I,
|
|
38
|
-
maxDate: R,
|
|
39
|
-
disabledRanges: w,
|
|
40
|
-
numberOfMonths: A,
|
|
41
|
-
localeId: E
|
|
42
|
-
}
|
|
43
|
-
) });
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
V as RangeCalendar
|
|
47
|
-
};
|
package/Renderer-CRWbM4oE.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useDisplayWdiget as s } from "@golemui/react";
|
|
3
|
-
function c(r) {
|
|
4
|
-
const i = r.widget, { uid: t, templateData: d } = s(i), n = d?.render;
|
|
5
|
-
return /* @__PURE__ */ e("div", { className: "gui-renderer", children: /* @__PURE__ */ e("div", { className: "gui-widget", id: t, children: n }) });
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
c as Renderer
|
|
9
|
-
};
|
package/Repeater-D1koXq-v.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as g, RepeaterIndexContext as h, WidgetRenderer as v } from "@golemui/react";
|
|
3
|
-
import { useCallback as o } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function w(m) {
|
|
6
|
-
const u = m.widget, { uid: l, value: a, onValueChanged: i, templateData: e } = g(u), p = o(
|
|
7
|
-
(n) => {
|
|
8
|
-
const t = [...n ?? [], {}];
|
|
9
|
-
i(t);
|
|
10
|
-
},
|
|
11
|
-
[i]
|
|
12
|
-
), d = o(
|
|
13
|
-
(n, t) => {
|
|
14
|
-
const s = [...n ?? []];
|
|
15
|
-
s.splice(t, 1), i(s);
|
|
16
|
-
},
|
|
17
|
-
[i]
|
|
18
|
-
), b = o(() => a?.map((n, t) => /* @__PURE__ */ r(h.Provider, { value: t, children: /* @__PURE__ */ c("div", { className: "card", children: [
|
|
19
|
-
/* @__PURE__ */ r(
|
|
20
|
-
v,
|
|
21
|
-
{
|
|
22
|
-
widget: e.template,
|
|
23
|
-
repeaterIndex: t
|
|
24
|
-
},
|
|
25
|
-
`${l}-${t}`
|
|
26
|
-
),
|
|
27
|
-
/* @__PURE__ */ r("button", { type: "button", className: "gui-button", onClick: () => d(a, t), children: e.removeLabel ?? "Remove" })
|
|
28
|
-
] }) }, `${l}-${t}`)), [e, a, l, d]);
|
|
29
|
-
return /* @__PURE__ */ r("div", { className: "gui-repeater", style: { flex: e.size }, children: /* @__PURE__ */ c("div", { id: l, children: [
|
|
30
|
-
e.label && /* @__PURE__ */ r("h2", { children: e.label }, `${l}-title`),
|
|
31
|
-
b(),
|
|
32
|
-
/* @__PURE__ */ r(
|
|
33
|
-
"button",
|
|
34
|
-
{
|
|
35
|
-
type: "button",
|
|
36
|
-
className: "gui-button",
|
|
37
|
-
onClick: () => p(a || []),
|
|
38
|
-
disabled: e.limit ? e.limit === (a?.length ?? 0) : !1,
|
|
39
|
-
children: e.addLabel ?? "Add"
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
] }) });
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
w as Repeater
|
|
46
|
-
};
|