@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/Select-DvFmJB1_.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as D } from "@golemui/react";
|
|
3
|
-
import { useCallback as s } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function z(a) {
|
|
6
|
-
const d = a.widget, {
|
|
7
|
-
uid: c,
|
|
8
|
-
errors: u,
|
|
9
|
-
value: p,
|
|
10
|
-
isTouched: h,
|
|
11
|
-
templateData: e,
|
|
12
|
-
onValueChanged: n,
|
|
13
|
-
onBlur: m,
|
|
14
|
-
injectValidationIssues: i
|
|
15
|
-
} = D(d), v = s(
|
|
16
|
-
(t) => n(t.nativeEvent.detail.value),
|
|
17
|
-
[n]
|
|
18
|
-
), g = s(
|
|
19
|
-
(t) => {
|
|
20
|
-
const o = t, l = (w) => {
|
|
21
|
-
i([w.detail.message]);
|
|
22
|
-
};
|
|
23
|
-
return t && o.addEventListener("inputError", l), () => {
|
|
24
|
-
o.removeEventListener("inputError", l);
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
[i]
|
|
28
|
-
), b = e.options, f = e.label, E = e.hint, y = e.placeholder, C = e.icon, F = e.valueField, q = e.labelField, x = e.disabled, R = e.readonly, j = e.validator?.required;
|
|
29
|
-
return /* @__PURE__ */ r("div", { className: "gui-select", style: { flex: e.size }, children: /* @__PURE__ */ r(
|
|
30
|
-
"gui-select",
|
|
31
|
-
{
|
|
32
|
-
ref: g,
|
|
33
|
-
uid: c,
|
|
34
|
-
label: f,
|
|
35
|
-
errors: u,
|
|
36
|
-
touched: h,
|
|
37
|
-
required: j,
|
|
38
|
-
disabled: x,
|
|
39
|
-
readOnly: R,
|
|
40
|
-
value: p,
|
|
41
|
-
hint: E,
|
|
42
|
-
placeholder: y,
|
|
43
|
-
icon: C,
|
|
44
|
-
options: b,
|
|
45
|
-
labelField: q,
|
|
46
|
-
valueField: F,
|
|
47
|
-
onChange: v,
|
|
48
|
-
onBlur: m
|
|
49
|
-
}
|
|
50
|
-
) });
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
z as Select
|
|
54
|
-
};
|
package/Tabs-CsmJz1Vs.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { jsx as l, jsxs as v } from "react/jsx-runtime";
|
|
2
|
-
import { useLayoutWidget as N, WidgetRenderer as E, cn as A } from "@golemui/react";
|
|
3
|
-
import { createIntersectionObserver as x } from "@golemui/gui-components";
|
|
4
|
-
import { useRef as u, useState as h, useEffect as b, useCallback as f } from "react";
|
|
5
|
-
function z(y) {
|
|
6
|
-
const m = u(null), r = y.widget, { uid: O, children: g, templateData: e, onChange: $ } = N(r), c = u([]), w = u(null), _ = u(null), [S, R] = h(!1), [k, T] = h(!1), [s, p] = h(e.defaultOpen);
|
|
7
|
-
b(() => {
|
|
8
|
-
const i = w.current, t = _.current, a = x(
|
|
9
|
-
i,
|
|
10
|
-
(n) => R(n)
|
|
11
|
-
), d = x(
|
|
12
|
-
t,
|
|
13
|
-
(n) => T(n)
|
|
14
|
-
);
|
|
15
|
-
return () => {
|
|
16
|
-
a.disconnect(), d.disconnect();
|
|
17
|
-
};
|
|
18
|
-
}, []), b(() => {
|
|
19
|
-
s === void 0 && e.tabs?.length > 0 && p(e.tabs[0].uid);
|
|
20
|
-
}, [e.tabs, s]), b(() => {
|
|
21
|
-
e.defaultOpen && p(e.defaultOpen);
|
|
22
|
-
}, [e.defaultOpen]), b(() => {
|
|
23
|
-
const t = (e.tabs || []).findIndex((a) => a.uid === s);
|
|
24
|
-
t > -1 && c.current[t].scrollIntoView();
|
|
25
|
-
}, [s, e.tabs]);
|
|
26
|
-
const o = f(
|
|
27
|
-
(i) => {
|
|
28
|
-
p(i), $(i);
|
|
29
|
-
},
|
|
30
|
-
[$]
|
|
31
|
-
), I = f(
|
|
32
|
-
(i) => {
|
|
33
|
-
const t = e.tabs.findIndex((n) => n.uid === s), a = c.current, d = m.current ? window.getComputedStyle(m.current).direction === "rtl" : !1;
|
|
34
|
-
switch (i.key) {
|
|
35
|
-
case "ArrowLeft": {
|
|
36
|
-
const n = t + (d ? 1 : -1);
|
|
37
|
-
n >= 0 && n < e.tabs.length && (o(e.tabs[n].uid), a[n]?.focus());
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
case "ArrowRight": {
|
|
41
|
-
const n = t + (d ? -1 : 1);
|
|
42
|
-
n >= 0 && n < e.tabs.length && (o(e.tabs[n].uid), a[n]?.focus());
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
case "Home":
|
|
46
|
-
o(e.tabs[0].uid), a[0]?.focus();
|
|
47
|
-
break;
|
|
48
|
-
case "End":
|
|
49
|
-
o(e.tabs[e.tabs.length - 1].uid), a[e.tabs.length - 1]?.focus();
|
|
50
|
-
break;
|
|
51
|
-
default:
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
[s, e.tabs, o]
|
|
56
|
-
), V = f(() => (e.tabs || []).map((t, a) => /* @__PURE__ */ l("li", { role: "presentation", children: /* @__PURE__ */ l(
|
|
57
|
-
"button",
|
|
58
|
-
{
|
|
59
|
-
ref: (d) => {
|
|
60
|
-
c.current[a] = d;
|
|
61
|
-
},
|
|
62
|
-
type: "button",
|
|
63
|
-
role: "tab",
|
|
64
|
-
tabIndex: t.uid === s ? void 0 : -1,
|
|
65
|
-
"data-cy": `tab_${r.uid}_${a}`,
|
|
66
|
-
id: `tab_${r.uid}_${a}`,
|
|
67
|
-
"aria-controls": `tabpanel_${r.uid}_${a}`,
|
|
68
|
-
"aria-selected": t.uid === s ? "true" : "false",
|
|
69
|
-
className: `${t.uid === s ? "active" : ""}`,
|
|
70
|
-
onClick: () => o(t.uid),
|
|
71
|
-
onKeyDown: (d) => I(d),
|
|
72
|
-
onFocus: (d) => {
|
|
73
|
-
d.target.scrollIntoView();
|
|
74
|
-
},
|
|
75
|
-
children: t.label
|
|
76
|
-
}
|
|
77
|
-
) }, `tab_${r.uid}_${t.uid}`)), [e, s, r, c, o, I]), C = f(() => {
|
|
78
|
-
const i = g.findIndex((t) => t.uid === s);
|
|
79
|
-
return g.filter((t) => t.uid === s || e.renderMode !== "activeOnly").map((t) => /* @__PURE__ */ l(
|
|
80
|
-
"section",
|
|
81
|
-
{
|
|
82
|
-
role: "tabpanel",
|
|
83
|
-
"data-cy": `tabpanel_${r.uid}_${i}`,
|
|
84
|
-
id: `tabpanel_${r.uid}_${i}`,
|
|
85
|
-
hidden: t.uid !== s && e.renderMode !== "activeOnly",
|
|
86
|
-
"aria-labelledby": `tab_${r.uid}_${i}`,
|
|
87
|
-
children: /* @__PURE__ */ l(E, { widget: t }, t.uid)
|
|
88
|
-
},
|
|
89
|
-
`tabpanel_${r.uid}_${t.uid}`
|
|
90
|
-
));
|
|
91
|
-
}, [g, s, r]);
|
|
92
|
-
return /* @__PURE__ */ v("div", { className: "gui-tabs", style: { flex: e.size }, children: [
|
|
93
|
-
/* @__PURE__ */ l(
|
|
94
|
-
"nav",
|
|
95
|
-
{
|
|
96
|
-
className: A({
|
|
97
|
-
"gui-widget": !0,
|
|
98
|
-
"gui-widget--horizontal": !0,
|
|
99
|
-
"gui-tabs--start-shadow": !S,
|
|
100
|
-
"gui-tabs--end-shadow": !k
|
|
101
|
-
}),
|
|
102
|
-
id: O,
|
|
103
|
-
children: /* @__PURE__ */ v("ul", { role: "tablist", children: [
|
|
104
|
-
/* @__PURE__ */ l("li", { role: "presentation", ref: w, className: "gui-sentinel" }),
|
|
105
|
-
V(),
|
|
106
|
-
/* @__PURE__ */ l("li", { role: "presentation", ref: _, className: "gui-sentinel" })
|
|
107
|
-
] })
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
C()
|
|
111
|
-
] });
|
|
112
|
-
}
|
|
113
|
-
export {
|
|
114
|
-
z as Tabs
|
|
115
|
-
};
|
package/TextArea-z99jVJ4-.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as C } from "@golemui/react";
|
|
3
|
-
import { useCallback as D } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function M(n) {
|
|
6
|
-
const a = n.widget, { uid: i, errors: r, value: l, isTouched: s, templateData: e, onValueChanged: t, onBlur: d } = C(a), c = D(
|
|
7
|
-
(q) => t(q.nativeEvent.detail.value),
|
|
8
|
-
[t]
|
|
9
|
-
), u = e.label, m = e.hint, h = e.placeholder, g = e.icon, p = e.validator?.maxLength, x = e.counterMode, v = e.autoGrow, b = e.minimumHeight, f = e.disabled, w = e.readonly, y = e.validator?.required;
|
|
10
|
-
return /* @__PURE__ */ o("div", { className: "gui-textarea", style: { flex: e.size }, children: /* @__PURE__ */ o(
|
|
11
|
-
"gui-textarea",
|
|
12
|
-
{
|
|
13
|
-
uid: i,
|
|
14
|
-
label: u,
|
|
15
|
-
errors: r,
|
|
16
|
-
touched: s,
|
|
17
|
-
required: y,
|
|
18
|
-
disabled: f,
|
|
19
|
-
readOnly: w,
|
|
20
|
-
value: l,
|
|
21
|
-
hint: m,
|
|
22
|
-
placeholder: h,
|
|
23
|
-
icon: g,
|
|
24
|
-
counterMode: x,
|
|
25
|
-
minimumHeight: b,
|
|
26
|
-
autoGrow: v,
|
|
27
|
-
maxLength: p,
|
|
28
|
-
onInput: c,
|
|
29
|
-
onBlur: d
|
|
30
|
-
}
|
|
31
|
-
) });
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
M as TextArea
|
|
35
|
-
};
|
package/TextInput-BTkEyMEv.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useInputWidget as f } from "@golemui/react";
|
|
3
|
-
import { useCallback as y } from "react";
|
|
4
|
-
/* empty css */
|
|
5
|
-
function D(n) {
|
|
6
|
-
const o = n.widget, { uid: l, errors: a, value: d, isTouched: r, templateData: e, onValueChanged: t, onBlur: s } = f(o), c = y(
|
|
7
|
-
(x) => t(x.nativeEvent.detail.value),
|
|
8
|
-
[t]
|
|
9
|
-
), u = e.label, p = e.hint, h = e.placeholder, m = e.icon, g = e.disabled, v = e.readonly, b = e.validator?.required;
|
|
10
|
-
return /* @__PURE__ */ i("div", { className: "gui-textinput", style: { flex: e.size }, children: /* @__PURE__ */ i(
|
|
11
|
-
"gui-textinput",
|
|
12
|
-
{
|
|
13
|
-
uid: l,
|
|
14
|
-
label: u,
|
|
15
|
-
hint: p,
|
|
16
|
-
errors: a,
|
|
17
|
-
touched: r,
|
|
18
|
-
required: b,
|
|
19
|
-
disabled: g,
|
|
20
|
-
readOnly: v,
|
|
21
|
-
value: d,
|
|
22
|
-
icon: m,
|
|
23
|
-
placeholder: h ?? void 0,
|
|
24
|
-
onInput: c,
|
|
25
|
-
onBlur: s
|
|
26
|
-
}
|
|
27
|
-
) });
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
D as TextInput
|
|
31
|
-
};
|