jaguar-form 1.0.6 → 1.0.8
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 +8 -0
- package/dist/{Cascader-ZIkXvvC3.js → Cascader-COGUcdDS.js} +4 -4
- package/dist/{Select-BIBk_TT6.js → Select-BxwT7MHH.js} +118 -107
- package/dist/{TreeSelect-BQCyCCqa.js → TreeSelect-W5sgU5nW.js} +4 -4
- package/dist/{compound-BX_PoTK5.js → compound-nXxRSVJu.js} +27 -27
- package/dist/compound.js +1 -1
- package/dist/core.js +1 -1
- package/dist/date-time.js +1 -1
- package/dist/{form-CSfUExUT.js → form-D6O5PqrZ.js} +62 -49
- package/dist/form.js +3 -3
- package/dist/{icons-BwE05e0C.js → icons-B1dOXz-r.js} +1 -1
- package/dist/{image-upload-D9oPG0Eh.js → image-upload-BFVs81x3.js} +46 -42
- package/dist/image-upload.js +1 -1
- package/dist/index.js +15 -15
- package/dist/input.js +1 -1
- package/dist/inputs-w_es2t_C.js +862 -0
- package/dist/{lazy-tree-NCX3ntYm.js → lazy-tree-DNvNf_Yv.js} +51 -43
- package/dist/{pickers-Bci1y8cc.js → pickers-5zLmSrsp.js} +3 -3
- package/dist/select.js +2 -2
- package/dist/selection-CA_66JX9.js +223 -0
- package/dist/{slider-AM0Egz9P.js → slider-Bhd1Z4LP.js} +35 -35
- package/dist/slider.js +1 -1
- package/dist/{store-CFSQW-Fv.js → store-C9eBd8Y7.js} +205 -194
- package/dist/style.css +1 -1
- package/dist/tree-select.js +1 -1
- package/dist/types/components/extended-inputs.d.ts +4 -1
- package/dist/types/components/image-upload/index.d.ts +1 -1
- package/dist/types/components/inputs.d.ts +28 -8
- package/dist/types/config/index.d.ts +32 -1
- package/dist/types/entries/input.d.ts +2 -2
- package/dist/types/form/index.d.ts +3 -0
- package/dist/types/form/store.d.ts +1 -0
- package/dist/types/primitives/Control.d.ts +7 -2
- package/dist/{useControllable-QDX_UWRh.js → useControllable-Dt38Jg9E.js} +54 -21
- package/package.json +1 -1
- package/dist/inputs-Dx3xOy9q.js +0 -718
- package/dist/selection-DCIzhR5q.js +0 -197
package/README.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Modern React 19 form controls and schema-driven forms with validation, value adapters, internationalization and customizable themes.
|
|
4
4
|
|
|
5
|
+
## 1.0.8
|
|
6
|
+
|
|
7
|
+
Switch now supports round and rounded shapes, asynchronous confirmation, optional optimistic updates, and loading indicators. Component defaults, form selector subscriptions, synchronous batching, repeated numeric steps, textarea auto-sizing and fixed-height virtual list arithmetic are available. See [1.0.8 guide](docs/release-1.0.8.md) and [changelog](docs/CHANGELOG-1.0.8.md).
|
|
8
|
+
|
|
9
|
+
## 1.0.7
|
|
10
|
+
|
|
11
|
+
Choice buttons use a transparent resting surface and a theme-tinted selected state. Select option indexing, selection membership and remote cache recency are optimized. See [1.0.7 changelog](docs/CHANGELOG-1.0.7.md).
|
|
12
|
+
|
|
5
13
|
## 1.0.6
|
|
6
14
|
|
|
7
15
|
Single-image capacity fixes, mixed image management, broader floating labels, compound child state, async defaults, container grids, decimal bounds, remote label resolution and Cascader. See the [1.0.6 usage guide](docs/release-1.0.6.md), [changelog](docs/CHANGELOG-1.0.6.md) and [release verification](docs/RELEASE.md).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect as e, useId as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
|
-
import { o as a, r as o, s } from "./selection-
|
|
3
|
-
import { t as c } from "./icons-
|
|
4
|
-
import {
|
|
5
|
-
import { n as d, r as f, t as p } from "./lazy-tree-
|
|
2
|
+
import { o as a, r as o, s } from "./selection-CA_66JX9.js";
|
|
3
|
+
import { t as c } from "./icons-B1dOXz-r.js";
|
|
4
|
+
import { c as l, t as u } from "./useControllable-Dt38Jg9E.js";
|
|
5
|
+
import { n as d, r as f, t as p } from "./lazy-tree-DNvNf_Yv.js";
|
|
6
6
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
7
7
|
// src/utils/cascader.ts
|
|
8
8
|
function _(e) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useEffect as e, useId as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
|
-
import { n as a, o, r as s, s as c } from "./selection-
|
|
3
|
-
import { a as l, d as u, f as d, p as f, u as p } from "./lazy-tree-
|
|
4
|
-
import { t as m } from "./icons-
|
|
5
|
-
import {
|
|
6
|
-
import { Fragment as
|
|
2
|
+
import { n as a, o, r as s, s as c } from "./selection-CA_66JX9.js";
|
|
3
|
+
import { a as l, d as u, f as d, p as f, u as p } from "./lazy-tree-DNvNf_Yv.js";
|
|
4
|
+
import { t as m } from "./icons-B1dOXz-r.js";
|
|
5
|
+
import { c as h, s as g } from "./useControllable-Dt38Jg9E.js";
|
|
6
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
7
7
|
// src/utils/remote-options.ts
|
|
8
|
-
function
|
|
8
|
+
function b(e, t, n, r = 0) {
|
|
9
9
|
let i = {
|
|
10
10
|
options: [],
|
|
11
11
|
loading: !1,
|
|
@@ -56,7 +56,7 @@ function y(e, t, n, r = 0) {
|
|
|
56
56
|
search(e, t = 0) {
|
|
57
57
|
d(), o = e;
|
|
58
58
|
let n = a.get(e);
|
|
59
|
-
n && n.expires > Date.now() ? u(n.state) : (u({
|
|
59
|
+
n && n.expires > Date.now() ? (a.delete(e), a.set(e, n), u(n.state)) : (n && a.delete(e), u({
|
|
60
60
|
options: [],
|
|
61
61
|
page: 0,
|
|
62
62
|
hasMore: !1,
|
|
@@ -79,14 +79,14 @@ function y(e, t, n, r = 0) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
// src/components/select/useRemoteOptions.ts
|
|
82
|
-
function
|
|
82
|
+
function x(t, a, o, s, c, l, u = {}) {
|
|
83
83
|
let [d, f] = i({
|
|
84
84
|
options: [],
|
|
85
85
|
loading: !1,
|
|
86
86
|
error: !1,
|
|
87
87
|
hasMore: !1,
|
|
88
88
|
page: 0
|
|
89
|
-
}), p = !!t, m = n(() =>
|
|
89
|
+
}), p = !!t, m = n(() => b((e) => t(e), (e) => e.value, f, u.cacheTime), [
|
|
90
90
|
t,
|
|
91
91
|
u.cacheTime,
|
|
92
92
|
u.reloadKey
|
|
@@ -106,7 +106,7 @@ function b(t, a, o, s, c, l, u = {}) {
|
|
|
106
106
|
u.minSearchLength,
|
|
107
107
|
u.reloadKey
|
|
108
108
|
]);
|
|
109
|
-
let h = r(/* @__PURE__ */ new Map()), [g, _] = i([]), v = JSON.stringify([...new Set(c)]),
|
|
109
|
+
let h = r(/* @__PURE__ */ new Map()), [g, _] = i([]), v = JSON.stringify([...new Set(c)]), y = n(() => new Set([...l, ...d.options].map((e) => e.value)), [l, d.options]), x = [...new Set(c)].filter((e) => !y.has(e) && !h.current.has(e)), S = JSON.stringify(x);
|
|
110
110
|
e(() => {
|
|
111
111
|
if (!u.resolveOptions || !x.length) return;
|
|
112
112
|
let e = new AbortController();
|
|
@@ -119,25 +119,28 @@ function b(t, a, o, s, c, l, u = {}) {
|
|
|
119
119
|
S,
|
|
120
120
|
u.reloadKey
|
|
121
121
|
]);
|
|
122
|
-
let C = p ? d.options : l, w =
|
|
123
|
-
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
let C = p ? d.options : l, w = n(() => {
|
|
123
|
+
let e = /* @__PURE__ */ new Map(), t = new Set(c);
|
|
124
|
+
for (let n of t) {
|
|
125
|
+
let t = h.current.get(n);
|
|
126
|
+
t && e.set(n, t);
|
|
127
|
+
}
|
|
128
|
+
for (let n of g) t.has(n.value) && e.set(n.value, n);
|
|
129
|
+
for (let t of l) e.set(t.value, t);
|
|
130
|
+
if (C !== l) for (let t of C) e.set(t.value, t);
|
|
131
|
+
return e;
|
|
132
|
+
}, [
|
|
133
|
+
v,
|
|
134
|
+
l,
|
|
135
|
+
C,
|
|
136
|
+
g
|
|
137
|
+
]);
|
|
130
138
|
return e(() => {
|
|
131
139
|
h.current = new Map(c.flatMap((e) => {
|
|
132
140
|
let t = w.get(e);
|
|
133
141
|
return t ? [[e, t]] : [];
|
|
134
142
|
}));
|
|
135
|
-
}, [
|
|
136
|
-
c,
|
|
137
|
-
l,
|
|
138
|
-
C,
|
|
139
|
-
g
|
|
140
|
-
]), {
|
|
143
|
+
}, [v, w]), {
|
|
141
144
|
options: C,
|
|
142
145
|
map: w,
|
|
143
146
|
loading: p && a && d.loading,
|
|
@@ -148,24 +151,32 @@ function b(t, a, o, s, c, l, u = {}) {
|
|
|
148
151
|
};
|
|
149
152
|
}
|
|
150
153
|
// src/components/select/Select.tsx
|
|
151
|
-
function
|
|
152
|
-
|
|
154
|
+
function S(e) {
|
|
155
|
+
let t = g();
|
|
156
|
+
return /* @__PURE__ */ v(T, {
|
|
157
|
+
...t.components?.Select,
|
|
153
158
|
...e,
|
|
154
159
|
multiple: !1
|
|
155
160
|
});
|
|
156
161
|
}
|
|
157
|
-
function
|
|
158
|
-
|
|
162
|
+
function C(e) {
|
|
163
|
+
let t = g();
|
|
164
|
+
return /* @__PURE__ */ v(T, {
|
|
165
|
+
...t.components?.MultiSelect,
|
|
159
166
|
...e,
|
|
160
167
|
multiple: !0
|
|
161
168
|
});
|
|
162
169
|
}
|
|
163
|
-
var
|
|
164
|
-
function
|
|
165
|
-
let { text:
|
|
170
|
+
var w = (e) => e.value;
|
|
171
|
+
function T(r) {
|
|
172
|
+
let { text: g, t: b } = h(), { open: S, changeOpen: C, committed: T, selected: E, update: D, confirm: ee, blocked: O, triggerReadOnly: k } = l(r), [A, j] = i(""), [M, N] = i(!1), [P, F] = i(-1), I = t(), L = `${I}-options`, R = (e) => `${I}-option-${e}`, z = r["aria-label"] ?? r.floatingLabel ?? g.choose, te = n(() => T === E ? T : T.concat(E), [T, E]), B = x(r.loadOptions, S, A, r.searchDebounce ?? 300, te, r.options, r), V = B.map, H = r.optionsLoading || B.loading, U = n(() => new Set(E), [E]), W = (e) => V.get(e) ?? {
|
|
166
173
|
value: e,
|
|
167
174
|
label: String(e)
|
|
168
|
-
},
|
|
175
|
+
}, ne = n(() => E.map(W), [E, V]), G = n(() => T.map(W), [T, V]), K = n(() => {
|
|
176
|
+
if (r.loadOptions || !A) return B.options;
|
|
177
|
+
let e = A.toLocaleLowerCase();
|
|
178
|
+
return B.options.filter((t) => (t.searchText ?? (typeof t.label == "string" ? t.label : String(t.value))).toLocaleLowerCase().includes(e));
|
|
179
|
+
}, [
|
|
169
180
|
B.options,
|
|
170
181
|
A,
|
|
171
182
|
r.loadOptions
|
|
@@ -173,19 +184,19 @@ function w(r) {
|
|
|
173
184
|
B.options,
|
|
174
185
|
K,
|
|
175
186
|
r.selectAllScope
|
|
176
|
-
]), X = Y.
|
|
187
|
+
]), X = n(() => Y.reduce((e, t) => e + Number(U.has(t)), 0), [Y, U]), Z = Y.length > 0 && X === Y.length, re = !Z && U.size + Y.length - X > (r.maxCount ?? 1e400), Q = Z ? "all" : X ? "partial" : "none";
|
|
177
188
|
e(() => {
|
|
178
189
|
S || (j(""), F(-1), N(!1));
|
|
179
190
|
}, [S]);
|
|
180
|
-
let
|
|
181
|
-
O || r.readOnly || e.disabled || (r.multiple ? D(p(E, [e.value], r.maxCount)) : (D([e.value]), r.needConfirm ||
|
|
182
|
-
}, $ = () => D(E.filter((e) => V.get(e)?.disabled)),
|
|
191
|
+
let ie = (e) => {
|
|
192
|
+
O || r.readOnly || e.disabled || (r.multiple ? D(p(E, [e.value], r.maxCount)) : (D([e.value]), r.needConfirm || C(!1)));
|
|
193
|
+
}, $ = () => D(E.filter((e) => V.get(e)?.disabled)), ae = (e) => {
|
|
183
194
|
V.get(e)?.disabled || D(E.filter((t) => t !== e));
|
|
184
|
-
},
|
|
185
|
-
O || (S ||
|
|
186
|
-
}, oe = (e) => {
|
|
187
|
-
!e.nativeEvent.isComposing && e.target instanceof HTMLElement && e.target.matches(".rfe-trigger-arrow") && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), F(a(K.length, -1, e.key, q)), w(!0));
|
|
195
|
+
}, oe = () => {
|
|
196
|
+
O || (S || C(!0), N(!0));
|
|
188
197
|
}, se = (e) => {
|
|
198
|
+
!e.nativeEvent.isComposing && e.target instanceof HTMLElement && e.target.matches(".rfe-trigger-arrow") && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), F(a(K.length, -1, e.key, q)), C(!0));
|
|
199
|
+
}, ce = (e) => {
|
|
189
200
|
if (e.nativeEvent.isComposing || e.keyCode === 229 || M) return;
|
|
190
201
|
let t = e.target;
|
|
191
202
|
t instanceof HTMLElement && t.matches(".rfe-search,.rfe-list,.rfe-option") && (t instanceof HTMLInputElement && [
|
|
@@ -197,35 +208,35 @@ function w(r) {
|
|
|
197
208
|
"ArrowUp",
|
|
198
209
|
"Home",
|
|
199
210
|
"End"
|
|
200
|
-
].includes(e.key) ? (e.preventDefault(), F(a(K.length, J, e.key, q))) : ["Enter", " "].includes(e.key) && J >= 0 && (e.preventDefault(),
|
|
211
|
+
].includes(e.key) ? (e.preventDefault(), F(a(K.length, J, e.key, q))) : ["Enter", " "].includes(e.key) && J >= 0 && (e.preventDefault(), ie(K[J]))));
|
|
201
212
|
};
|
|
202
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ v(s, {
|
|
203
214
|
...r,
|
|
204
215
|
layout: "selection",
|
|
205
216
|
open: S,
|
|
206
|
-
onOpenChange:
|
|
217
|
+
onOpenChange: C,
|
|
207
218
|
label: z,
|
|
208
|
-
trigger: (e, t) => /* @__PURE__ */
|
|
219
|
+
trigger: (e, t) => /* @__PURE__ */ v("div", {
|
|
209
220
|
ref: t,
|
|
210
221
|
className: "rfe-anchor",
|
|
211
|
-
onKeyDown:
|
|
222
|
+
onKeyDown: se,
|
|
212
223
|
onBlur: (e) => {
|
|
213
224
|
!S && !e.currentTarget.contains(e.relatedTarget) && r.onBlur?.();
|
|
214
225
|
},
|
|
215
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ v(c, {
|
|
216
227
|
...r,
|
|
217
228
|
id: r.id ?? I,
|
|
218
229
|
disabled: r.disabled || r.loading,
|
|
219
230
|
floatingFilled: T.length > 0,
|
|
220
231
|
floatingOpen: S,
|
|
221
|
-
actions: /* @__PURE__ */
|
|
232
|
+
actions: /* @__PURE__ */ y(_, { children: [r.clearable !== !1 && /* @__PURE__ */ v(o, {
|
|
222
233
|
name: "clear",
|
|
223
234
|
source: r.icons?.clear,
|
|
224
|
-
label:
|
|
235
|
+
label: g.clear,
|
|
225
236
|
hidden: !T.length,
|
|
226
237
|
disabled: k,
|
|
227
238
|
onClick: $
|
|
228
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ v("button", {
|
|
229
240
|
type: "button",
|
|
230
241
|
...e,
|
|
231
242
|
id: r.id ?? I,
|
|
@@ -234,92 +245,92 @@ function w(r) {
|
|
|
234
245
|
"aria-invalid": r["aria-invalid"] ?? r.status === "error",
|
|
235
246
|
"aria-describedby": r["aria-describedby"],
|
|
236
247
|
"aria-label": z,
|
|
237
|
-
onClick: () =>
|
|
248
|
+
onClick: () => C(!S),
|
|
238
249
|
"data-open": S,
|
|
239
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ v(m, {
|
|
240
251
|
name: "dropdown",
|
|
241
252
|
source: r.icons?.dropdown
|
|
242
253
|
})
|
|
243
254
|
})] }),
|
|
244
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ v("div", {
|
|
245
256
|
className: "rfe-value",
|
|
246
|
-
onClick: () =>
|
|
247
|
-
children: r.multiple ? /* @__PURE__ */
|
|
257
|
+
onClick: () => C(!S),
|
|
258
|
+
children: r.multiple ? /* @__PURE__ */ v(d, {
|
|
248
259
|
options: G,
|
|
249
260
|
mode: r.displayMode,
|
|
250
261
|
maxTagCount: r.maxTagCount,
|
|
251
262
|
maxTagRows: r.maxTagRows,
|
|
252
|
-
onRemove:
|
|
253
|
-
onInspect:
|
|
263
|
+
onRemove: ae,
|
|
264
|
+
onInspect: oe,
|
|
254
265
|
readOnly: k,
|
|
255
266
|
placeholder: r.placeholder
|
|
256
|
-
}) : /* @__PURE__ */
|
|
267
|
+
}) : /* @__PURE__ */ v("span", {
|
|
257
268
|
className: G.length ? "rfe-single-value" : "rfe-placeholder",
|
|
258
|
-
children: G[0]?.label ?? r.placeholder ??
|
|
269
|
+
children: G[0]?.label ?? r.placeholder ?? g.choose
|
|
259
270
|
})
|
|
260
271
|
})
|
|
261
272
|
})
|
|
262
273
|
}),
|
|
263
|
-
children: /* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ y("div", {
|
|
264
275
|
className: "rfe-selection-body",
|
|
265
|
-
onKeyDown:
|
|
276
|
+
onKeyDown: ce,
|
|
266
277
|
"data-selection-style": r.selectionStyle ?? (r.multiple ? "subtle" : "accent"),
|
|
267
|
-
children: [r.multiple && M ? /* @__PURE__ */
|
|
278
|
+
children: [r.multiple && M ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("button", {
|
|
268
279
|
type: "button",
|
|
269
280
|
className: "rfe-link",
|
|
270
281
|
onClick: () => N(!1),
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
-
}), /* @__PURE__ */
|
|
273
|
-
options:
|
|
274
|
-
onRemove:
|
|
282
|
+
children: [/* @__PURE__ */ v(m, { name: "previous" }), g.choose]
|
|
283
|
+
}), /* @__PURE__ */ v(u, {
|
|
284
|
+
options: ne,
|
|
285
|
+
onRemove: ae,
|
|
275
286
|
onClear: $,
|
|
276
287
|
readOnly: r.readOnly
|
|
277
|
-
})] }) : /* @__PURE__ */
|
|
278
|
-
r.searchable !== !1 && /* @__PURE__ */
|
|
288
|
+
})] }) : /* @__PURE__ */ y(_, { children: [
|
|
289
|
+
r.searchable !== !1 && /* @__PURE__ */ v("input", {
|
|
279
290
|
className: "rfe-search",
|
|
280
291
|
role: "combobox",
|
|
281
292
|
"aria-expanded": "true",
|
|
282
293
|
"aria-controls": K.length ? L : void 0,
|
|
283
294
|
"aria-activedescendant": J >= 0 ? R(J) : void 0,
|
|
284
295
|
"aria-autocomplete": "list",
|
|
285
|
-
"aria-label":
|
|
286
|
-
placeholder:
|
|
296
|
+
"aria-label": g.search,
|
|
297
|
+
placeholder: g.search,
|
|
287
298
|
value: A,
|
|
288
299
|
onChange: (e) => {
|
|
289
300
|
j(e.target.value), F(-1);
|
|
290
301
|
}
|
|
291
302
|
}),
|
|
292
|
-
r.multiple && r.showSelectAll && !r.readOnly && /* @__PURE__ */
|
|
303
|
+
r.multiple && r.showSelectAll && !r.readOnly && /* @__PURE__ */ y("div", {
|
|
293
304
|
className: "rfe-toolbar",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ y("button", {
|
|
295
306
|
type: "button",
|
|
296
307
|
className: "rfe-select-all",
|
|
297
308
|
role: "checkbox",
|
|
298
309
|
"aria-checked": Z ? !0 : X ? "mixed" : !1,
|
|
299
|
-
"aria-label":
|
|
300
|
-
title:
|
|
301
|
-
disabled: !Y.length ||
|
|
310
|
+
"aria-label": g.all,
|
|
311
|
+
title: re ? b("max", { max: r.maxCount ?? 0 }) : void 0,
|
|
312
|
+
disabled: !Y.length || re,
|
|
302
313
|
onClick: () => D(p(E, Y, r.maxCount)),
|
|
303
|
-
children: [/* @__PURE__ */
|
|
314
|
+
children: [/* @__PURE__ */ v("span", {
|
|
304
315
|
className: "rfe-option-check",
|
|
305
316
|
"data-checked": Q !== "none",
|
|
306
|
-
children: Q !== "none" && /* @__PURE__ */
|
|
307
|
-
}), Z ?
|
|
308
|
-
}), /* @__PURE__ */
|
|
317
|
+
children: Q !== "none" && /* @__PURE__ */ v(m, { name: Q === "all" ? "check" : "minus" })
|
|
318
|
+
}), Z ? g.deselectAll : g.all]
|
|
319
|
+
}), /* @__PURE__ */ v("button", {
|
|
309
320
|
type: "button",
|
|
310
321
|
className: "rfe-link",
|
|
311
322
|
onClick: $,
|
|
312
|
-
children:
|
|
323
|
+
children: g.clear
|
|
313
324
|
})]
|
|
314
325
|
}),
|
|
315
|
-
H && /* @__PURE__ */
|
|
326
|
+
H && /* @__PURE__ */ y("div", {
|
|
316
327
|
className: "rfe-options-loading",
|
|
317
328
|
role: "status",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ v(m, { name: "loading" }), g.loading]
|
|
319
330
|
}),
|
|
320
|
-
K.length ? /* @__PURE__ */
|
|
331
|
+
K.length ? /* @__PURE__ */ v(f, {
|
|
321
332
|
items: K,
|
|
322
|
-
getKey:
|
|
333
|
+
getKey: w,
|
|
323
334
|
id: L,
|
|
324
335
|
role: "listbox",
|
|
325
336
|
label: z,
|
|
@@ -328,7 +339,7 @@ function w(r) {
|
|
|
328
339
|
activeIndex: J,
|
|
329
340
|
activeId: J >= 0 ? R(J) : void 0,
|
|
330
341
|
variableHeight: r.variableHeight,
|
|
331
|
-
render: (e, t) => /* @__PURE__ */
|
|
342
|
+
render: (e, t) => /* @__PURE__ */ y("button", {
|
|
332
343
|
id: R(t),
|
|
333
344
|
type: "button",
|
|
334
345
|
role: "option",
|
|
@@ -341,75 +352,75 @@ function w(r) {
|
|
|
341
352
|
className: "rfe-option",
|
|
342
353
|
disabled: e.disabled || r.readOnly || O,
|
|
343
354
|
onMouseEnter: () => F(t),
|
|
344
|
-
onClick: () =>
|
|
355
|
+
onClick: () => ie(e),
|
|
345
356
|
children: [
|
|
346
|
-
r.multiple && /* @__PURE__ */
|
|
357
|
+
r.multiple && /* @__PURE__ */ v("span", {
|
|
347
358
|
className: "rfe-option-check",
|
|
348
359
|
"data-checked": U.has(e.value),
|
|
349
|
-
children: U.has(e.value) && /* @__PURE__ */
|
|
360
|
+
children: U.has(e.value) && /* @__PURE__ */ v(m, { name: "check" })
|
|
350
361
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ v("span", {
|
|
352
363
|
className: "rfe-option-label",
|
|
353
|
-
children: r.renderOption ? r.renderOption(e, U.has(e.value)) : /* @__PURE__ */
|
|
364
|
+
children: r.renderOption ? r.renderOption(e, U.has(e.value)) : /* @__PURE__ */ y(_, { children: [
|
|
354
365
|
e.icon,
|
|
355
366
|
e.label,
|
|
356
|
-
e.description && /* @__PURE__ */
|
|
367
|
+
e.description && /* @__PURE__ */ v("small", { children: e.description })
|
|
357
368
|
] })
|
|
358
369
|
}),
|
|
359
|
-
!r.multiple && U.has(e.value) && /* @__PURE__ */
|
|
370
|
+
!r.multiple && U.has(e.value) && /* @__PURE__ */ v(m, {
|
|
360
371
|
name: "check",
|
|
361
372
|
source: r.icons?.check
|
|
362
373
|
})
|
|
363
374
|
]
|
|
364
375
|
})
|
|
365
|
-
}) : !H && !B.error && /* @__PURE__ */
|
|
376
|
+
}) : !H && !B.error && /* @__PURE__ */ y("div", {
|
|
366
377
|
className: "rfe-empty",
|
|
367
378
|
role: "status",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ v(m, { name: "empty" }), g.empty]
|
|
369
380
|
}),
|
|
370
|
-
B.error && /* @__PURE__ */
|
|
381
|
+
B.error && /* @__PURE__ */ v("button", {
|
|
371
382
|
type: "button",
|
|
372
383
|
className: "rfe-link",
|
|
373
384
|
onClick: () => void B.retry(),
|
|
374
|
-
children:
|
|
385
|
+
children: g.retry
|
|
375
386
|
}),
|
|
376
|
-
B.hasMore && !B.error && /* @__PURE__ */
|
|
387
|
+
B.hasMore && !B.error && /* @__PURE__ */ v("button", {
|
|
377
388
|
type: "button",
|
|
378
389
|
className: "rfe-link",
|
|
379
390
|
disabled: B.loading,
|
|
380
391
|
onClick: () => void B.more(),
|
|
381
|
-
children:
|
|
392
|
+
children: g.next
|
|
382
393
|
})
|
|
383
|
-
] }), (r.multiple || r.needConfirm) && /* @__PURE__ */
|
|
394
|
+
] }), (r.multiple || r.needConfirm) && /* @__PURE__ */ y("div", {
|
|
384
395
|
className: "rfe-footer",
|
|
385
396
|
children: [
|
|
386
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ y("button", {
|
|
387
398
|
type: "button",
|
|
388
399
|
className: "rfe-link",
|
|
389
400
|
onClick: () => N(!M),
|
|
390
401
|
children: [
|
|
391
|
-
|
|
402
|
+
g.selected,
|
|
392
403
|
" ",
|
|
393
404
|
E.length
|
|
394
405
|
]
|
|
395
406
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
r.needConfirm && /* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ v("span", { className: "rfe-spacer" }),
|
|
408
|
+
r.needConfirm && /* @__PURE__ */ v("button", {
|
|
398
409
|
type: "button",
|
|
399
410
|
className: "rfe-link",
|
|
400
|
-
onClick: () =>
|
|
401
|
-
children:
|
|
411
|
+
onClick: () => C(!1),
|
|
412
|
+
children: g.cancel
|
|
402
413
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ v("button", {
|
|
404
415
|
className: "rfe-button",
|
|
405
416
|
"data-variant": "primary",
|
|
406
417
|
type: "button",
|
|
407
418
|
onClick: ee,
|
|
408
|
-
children:
|
|
419
|
+
children: g.done
|
|
409
420
|
})
|
|
410
421
|
]
|
|
411
422
|
})]
|
|
412
423
|
})
|
|
413
424
|
});
|
|
414
425
|
}
|
|
415
|
-
export {
|
|
426
|
+
export { S as n, C as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect as e, useId as t, useLayoutEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
|
-
import { n as o, o as s, r as c, s as l } from "./selection-
|
|
3
|
-
import { a as u, c as d, d as ee, f as te, i as ne, l as re, n as f, o as ie, p as ae, r as p, s as oe, t as m, u as h } from "./lazy-tree-
|
|
4
|
-
import { t as g } from "./icons-
|
|
5
|
-
import {
|
|
2
|
+
import { n as o, o as s, r as c, s as l } from "./selection-CA_66JX9.js";
|
|
3
|
+
import { a as u, c as d, d as ee, f as te, i as ne, l as re, n as f, o as ie, p as ae, r as p, s as oe, t as m, u as h } from "./lazy-tree-DNvNf_Yv.js";
|
|
4
|
+
import { t as g } from "./icons-B1dOXz-r.js";
|
|
5
|
+
import { c as se } from "./useControllable-Dt38Jg9E.js";
|
|
6
6
|
import { Fragment as ce, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
7
|
// src/components/select/TreeSelect.tsx
|
|
8
8
|
var le = (e) => e.node.value, y = (e) => e.searchText ?? (typeof e.label == "string" ? e.label : String(e.value));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Children as e, cloneElement as t, isValidElement as n, useCallback as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { c as p, o as m, s as h, t as g } from "./inputs-
|
|
4
|
-
import { n as _, t as v } from "./Select-
|
|
5
|
-
import { t as y } from "./TreeSelect-
|
|
6
|
-
import { s as b, t as x } from "./pickers-
|
|
7
|
-
import { a as S, i as C } from "./selection-
|
|
2
|
+
import { l, s as u, t as d, u as f } from "./useControllable-Dt38Jg9E.js";
|
|
3
|
+
import { c as p, o as m, s as h, t as g } from "./inputs-w_es2t_C.js";
|
|
4
|
+
import { n as _, t as v } from "./Select-BxwT7MHH.js";
|
|
5
|
+
import { t as y } from "./TreeSelect-W5sgU5nW.js";
|
|
6
|
+
import { s as b, t as x } from "./pickers-5zLmSrsp.js";
|
|
7
|
+
import { a as S, i as C } from "./selection-CA_66JX9.js";
|
|
8
8
|
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
9
9
|
import { n as E } from "./validation-D6vk5NAv.js";
|
|
10
10
|
// src/components/compound/ControlGroup.tsx
|
|
@@ -15,11 +15,11 @@ var D = (e) => typeof e == "number" ? `${e}px` : {
|
|
|
15
15
|
large: "12px",
|
|
16
16
|
full: "999px"
|
|
17
17
|
}[e ?? ""] ?? e;
|
|
18
|
-
function O({ children: e, width: t, minWidth: n, maxWidth: r, flex: i, radius: a, background: o, padding: s, divider: c, className: l, style: u, fieldName:
|
|
18
|
+
function O({ children: e, width: t, minWidth: n, maxWidth: r, flex: i, radius: a, background: o, padding: s, divider: c, className: l, style: u, fieldName: d }) {
|
|
19
19
|
return /* @__PURE__ */ w("div", {
|
|
20
|
-
className:
|
|
20
|
+
className: f("rfe-control-group-item", l),
|
|
21
21
|
"data-divider": c,
|
|
22
|
-
"data-compound-field":
|
|
22
|
+
"data-compound-field": d,
|
|
23
23
|
"data-auto-width": t === "auto" || void 0,
|
|
24
24
|
style: {
|
|
25
25
|
width: t,
|
|
@@ -35,19 +35,19 @@ function O({ children: e, width: t, minWidth: n, maxWidth: r, flex: i, radius: a
|
|
|
35
35
|
children: e
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
function k({ children: a, disabled:
|
|
39
|
-
let M =
|
|
38
|
+
function k({ children: a, disabled: l, readOnly: d, error: p, status: m, id: h, floatingLabel: g, floatingFilled: _, className: v, style: y, onFocus: b, onBlur: x, "aria-label": E, "aria-describedby": k, "aria-invalid": A, ...j }) {
|
|
39
|
+
let M = u(), N = S(), { layout: P = "connected", direction: F = "horizontal", focusMode: I = P === "separated" ? "individual" : "group", radius: L, gap: R, padding: z, size: B = M.size, variant: V = M.variant, divider: H = !0, block: U = !0 } = {
|
|
40
40
|
...M.controlGroup,
|
|
41
41
|
...j
|
|
42
42
|
}, W = s(null), G = s(/* @__PURE__ */ new Set()), K = s(!1), q = s(null), [J, ee] = c(!1), Y = s({
|
|
43
43
|
onFocus: b,
|
|
44
44
|
onBlur: x,
|
|
45
|
-
disabled:
|
|
45
|
+
disabled: l
|
|
46
46
|
});
|
|
47
47
|
Y.current = {
|
|
48
48
|
onFocus: b,
|
|
49
49
|
onBlur: x,
|
|
50
|
-
disabled:
|
|
50
|
+
disabled: l
|
|
51
51
|
};
|
|
52
52
|
let X = r(() => {
|
|
53
53
|
let e = W.current;
|
|
@@ -66,7 +66,7 @@ function k({ children: a, disabled: u, readOnly: f, error: p, status: m, id: h,
|
|
|
66
66
|
};
|
|
67
67
|
}, [X, Z]), i(() => {
|
|
68
68
|
X();
|
|
69
|
-
}, [
|
|
69
|
+
}, [l, X]);
|
|
70
70
|
let Q = r((e) => {
|
|
71
71
|
G.current.add(e);
|
|
72
72
|
let t = N?.registerPopup(e);
|
|
@@ -81,14 +81,14 @@ function k({ children: a, disabled: u, readOnly: f, error: p, status: m, id: h,
|
|
|
81
81
|
"textarea",
|
|
82
82
|
"button"
|
|
83
83
|
].includes(e.type) ? t(e, {
|
|
84
|
-
...
|
|
85
|
-
...
|
|
84
|
+
...l ? { disabled: !0 } : {},
|
|
85
|
+
...d ? e.type === "input" || e.type === "textarea" ? { readOnly: !0 } : { disabled: !0 } : {}
|
|
86
86
|
}) : e;
|
|
87
87
|
let r = e;
|
|
88
88
|
return t(r, {
|
|
89
89
|
size: P === "separated" ? r.props.size ?? B : B,
|
|
90
|
-
...
|
|
91
|
-
...
|
|
90
|
+
...l ? { disabled: !0 } : {},
|
|
91
|
+
...d ? { readOnly: !0 } : {}
|
|
92
92
|
});
|
|
93
93
|
}, ne = e.toArray(a).map((r, i) => {
|
|
94
94
|
if (n(r) && r.type === O) {
|
|
@@ -110,15 +110,15 @@ function k({ children: a, disabled: u, readOnly: f, error: p, status: m, id: h,
|
|
|
110
110
|
"aria-label": E ?? g,
|
|
111
111
|
"aria-describedby": k,
|
|
112
112
|
"aria-invalid": A || p || m === "error" || void 0,
|
|
113
|
-
"aria-disabled":
|
|
114
|
-
className:
|
|
113
|
+
"aria-disabled": l || void 0,
|
|
114
|
+
className: f("rfe-control-group", !!g && "rfe-floating-shell", v),
|
|
115
115
|
"data-layout": P,
|
|
116
116
|
"data-direction": F,
|
|
117
117
|
"data-focus-mode": I,
|
|
118
118
|
"data-focused": J,
|
|
119
119
|
"data-floating-filled": _ || void 0,
|
|
120
120
|
"data-status": A || p ? "error" : m ?? "default",
|
|
121
|
-
"data-disabled":
|
|
121
|
+
"data-disabled": l || void 0,
|
|
122
122
|
"data-size": B,
|
|
123
123
|
"data-variant": V,
|
|
124
124
|
"data-divider": H,
|
|
@@ -179,15 +179,15 @@ var I = {
|
|
|
179
179
|
date: x,
|
|
180
180
|
time: b
|
|
181
181
|
};
|
|
182
|
-
function L({ fields: e, value: t, defaultValue: n, onChange: r, name: i, loading: o, disabled: s, id: c, partStates: l, onPartChange: u, onPartBlur:
|
|
183
|
-
let m = a(), [h, g] =
|
|
182
|
+
function L({ fields: e, value: t, defaultValue: n, onChange: r, name: i, loading: o, disabled: s, id: c, partStates: l, onPartChange: u, onPartBlur: f, ...p }) {
|
|
183
|
+
let m = a(), [h, g] = d(t, M(e, n), r), _ = M(e, h);
|
|
184
184
|
return /* @__PURE__ */ w(A, {
|
|
185
185
|
...p,
|
|
186
186
|
floatingFilled: Object.values(_).some((e) => e != null && e !== "" && (!Array.isArray(e) || e.length > 0)),
|
|
187
187
|
disabled: s || o,
|
|
188
188
|
"aria-label": p["aria-label"] ?? i,
|
|
189
189
|
children: e.filter((e) => N(e, _)).map((e, t) => {
|
|
190
|
-
let n = I[e.type], { width: r, minWidth: a, maxWidth:
|
|
190
|
+
let n = I[e.type], { width: r, minWidth: a, maxWidth: d, flex: h, radius: v, background: y, padding: b, divider: x } = e, S = {
|
|
191
191
|
...e.componentProps,
|
|
192
192
|
id: t === 0 ? c ?? m : `${c ?? m}-${t}`,
|
|
193
193
|
name: e.name,
|
|
@@ -200,7 +200,7 @@ function L({ fields: e, value: t, defaultValue: n, onChange: r, name: i, loading
|
|
|
200
200
|
[e.name]: t
|
|
201
201
|
}),
|
|
202
202
|
onBlur: () => {
|
|
203
|
-
typeof e.componentProps?.onBlur == "function" && e.componentProps.onBlur(),
|
|
203
|
+
typeof e.componentProps?.onBlur == "function" && e.componentProps.onBlur(), f?.(e.name);
|
|
204
204
|
},
|
|
205
205
|
disabled: s || o || P(e, _) || e.componentProps?.disabled === !0,
|
|
206
206
|
readOnly: p.readOnly || (typeof e.readOnly == "function" ? e.readOnly(_) : e.readOnly) || e.componentProps?.readOnly === !0
|
|
@@ -209,7 +209,7 @@ function L({ fields: e, value: t, defaultValue: n, onChange: r, name: i, loading
|
|
|
209
209
|
fieldName: i ? `${i}.${e.name}` : void 0,
|
|
210
210
|
width: r,
|
|
211
211
|
minWidth: a,
|
|
212
|
-
maxWidth:
|
|
212
|
+
maxWidth: d,
|
|
213
213
|
flex: h,
|
|
214
214
|
radius: v,
|
|
215
215
|
background: y,
|
|
@@ -288,7 +288,7 @@ function H(e) {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
function U({ onSearch: e, buttonLabel: t, ...n }) {
|
|
291
|
-
let r =
|
|
291
|
+
let r = l(), [i, a] = d(n.value, n.defaultValue ?? {
|
|
292
292
|
value: "",
|
|
293
293
|
option: null
|
|
294
294
|
}, n.onChange);
|
package/dist/compound.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as CompoundField, f as ControlGroup, n as InputRange, r as InputSelect, i as NumberSelect, a as NumberUnit, o as SearchGroup, s as compoundDefaults, c as compoundRule, l as compoundValues, u as partDisabled, d as partVisible } from "./compound-
|
|
1
|
+
export { t as CompoundField, f as ControlGroup, n as InputRange, r as InputSelect, i as NumberSelect, a as NumberUnit, o as SearchGroup, s as compoundDefaults, c as compoundRule, l as compoundValues, u as partDisabled, d as partVisible } from "./compound-nXxRSVJu.js";
|
package/dist/core.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as e, r as t, t as n } from "./validation-D6vk5NAv.js";
|
|
2
|
-
import { _ as r, a as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, y as x } from "./store-
|
|
2
|
+
import { _ as r, a as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y, v as b, y as x } from "./store-C9eBd8Y7.js";
|
|
3
3
|
export { m as changedOutputValues, _ as cloneValues, v as createFormStore, g as createPathAdapter, a as defineValueAdapter, o as editArray, p as equalValue, u as expandPaths, s as fieldSegments, i as getPathValue, h as hasPath, d as inputValues, f as isArrayIndex, n as isEmpty, l as isPlainRecord, c as normalizePaths, r as omitPaths, y as outputValues, b as readPath, e as validateRuleIssue, t as validateRules, x as writePath };
|
package/dist/date-time.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as DatePicker, n as DateRangePicker, r as DateTimePicker, i as DateTimeRangePicker, a as MonthPicker, o as MonthRangePicker, s as TimePicker, c as TimeRangePicker, l as YearPicker, u as YearRangePicker } from "./pickers-
|
|
1
|
+
export { t as DatePicker, n as DateRangePicker, r as DateTimePicker, i as DateTimeRangePicker, a as MonthPicker, o as MonthRangePicker, s as TimePicker, c as TimeRangePicker, l as YearPicker, u as YearRangePicker } from "./pickers-5zLmSrsp.js";
|