jaguar-form 1.0.7 → 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 +4 -0
- package/dist/{Cascader-iWlk7VJR.js → Cascader-COGUcdDS.js} +4 -4
- package/dist/{Select-CoEW4UIq.js → Select-BxwT7MHH.js} +81 -77
- package/dist/{TreeSelect-BWksr9iW.js → TreeSelect-W5sgU5nW.js} +4 -4
- package/dist/{compound-BW6G7E_-.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-B-BSf2n1.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-C9l9lzQw.js → lazy-tree-DNvNf_Yv.js} +20 -17
- 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-DpZdLaoP.js +0 -718
- package/dist/selection-DCIzhR5q.js +0 -197
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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
|
+
|
|
5
9
|
## 1.0.7
|
|
6
10
|
|
|
7
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).
|
|
@@ -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,
|
|
@@ -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();
|
|
@@ -151,21 +151,25 @@ function b(t, a, o, s, c, l, u = {}) {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
// src/components/select/Select.tsx
|
|
154
|
-
function
|
|
155
|
-
|
|
154
|
+
function S(e) {
|
|
155
|
+
let t = g();
|
|
156
|
+
return /* @__PURE__ */ v(T, {
|
|
157
|
+
...t.components?.Select,
|
|
156
158
|
...e,
|
|
157
159
|
multiple: !1
|
|
158
160
|
});
|
|
159
161
|
}
|
|
160
|
-
function
|
|
161
|
-
|
|
162
|
+
function C(e) {
|
|
163
|
+
let t = g();
|
|
164
|
+
return /* @__PURE__ */ v(T, {
|
|
165
|
+
...t.components?.MultiSelect,
|
|
162
166
|
...e,
|
|
163
167
|
multiple: !0
|
|
164
168
|
});
|
|
165
169
|
}
|
|
166
|
-
var
|
|
167
|
-
function
|
|
168
|
-
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) ?? {
|
|
169
173
|
value: e,
|
|
170
174
|
label: String(e)
|
|
171
175
|
}, ne = n(() => E.map(W), [E, V]), G = n(() => T.map(W), [T, V]), K = n(() => {
|
|
@@ -185,13 +189,13 @@ function w(r) {
|
|
|
185
189
|
S || (j(""), F(-1), N(!1));
|
|
186
190
|
}, [S]);
|
|
187
191
|
let ie = (e) => {
|
|
188
|
-
O || r.readOnly || e.disabled || (r.multiple ? D(p(E, [e.value], r.maxCount)) : (D([e.value]), r.needConfirm ||
|
|
192
|
+
O || r.readOnly || e.disabled || (r.multiple ? D(p(E, [e.value], r.maxCount)) : (D([e.value]), r.needConfirm || C(!1)));
|
|
189
193
|
}, $ = () => D(E.filter((e) => V.get(e)?.disabled)), ae = (e) => {
|
|
190
194
|
V.get(e)?.disabled || D(E.filter((t) => t !== e));
|
|
191
195
|
}, oe = () => {
|
|
192
|
-
O || (S ||
|
|
196
|
+
O || (S || C(!0), N(!0));
|
|
193
197
|
}, se = (e) => {
|
|
194
|
-
!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)),
|
|
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));
|
|
195
199
|
}, ce = (e) => {
|
|
196
200
|
if (e.nativeEvent.isComposing || e.keyCode === 229 || M) return;
|
|
197
201
|
let t = e.target;
|
|
@@ -206,33 +210,33 @@ function w(r) {
|
|
|
206
210
|
"End"
|
|
207
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]))));
|
|
208
212
|
};
|
|
209
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ v(s, {
|
|
210
214
|
...r,
|
|
211
215
|
layout: "selection",
|
|
212
216
|
open: S,
|
|
213
|
-
onOpenChange:
|
|
217
|
+
onOpenChange: C,
|
|
214
218
|
label: z,
|
|
215
|
-
trigger: (e, t) => /* @__PURE__ */
|
|
219
|
+
trigger: (e, t) => /* @__PURE__ */ v("div", {
|
|
216
220
|
ref: t,
|
|
217
221
|
className: "rfe-anchor",
|
|
218
222
|
onKeyDown: se,
|
|
219
223
|
onBlur: (e) => {
|
|
220
224
|
!S && !e.currentTarget.contains(e.relatedTarget) && r.onBlur?.();
|
|
221
225
|
},
|
|
222
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ v(c, {
|
|
223
227
|
...r,
|
|
224
228
|
id: r.id ?? I,
|
|
225
229
|
disabled: r.disabled || r.loading,
|
|
226
230
|
floatingFilled: T.length > 0,
|
|
227
231
|
floatingOpen: S,
|
|
228
|
-
actions: /* @__PURE__ */
|
|
232
|
+
actions: /* @__PURE__ */ y(_, { children: [r.clearable !== !1 && /* @__PURE__ */ v(o, {
|
|
229
233
|
name: "clear",
|
|
230
234
|
source: r.icons?.clear,
|
|
231
|
-
label:
|
|
235
|
+
label: g.clear,
|
|
232
236
|
hidden: !T.length,
|
|
233
237
|
disabled: k,
|
|
234
238
|
onClick: $
|
|
235
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ v("button", {
|
|
236
240
|
type: "button",
|
|
237
241
|
...e,
|
|
238
242
|
id: r.id ?? I,
|
|
@@ -241,17 +245,17 @@ function w(r) {
|
|
|
241
245
|
"aria-invalid": r["aria-invalid"] ?? r.status === "error",
|
|
242
246
|
"aria-describedby": r["aria-describedby"],
|
|
243
247
|
"aria-label": z,
|
|
244
|
-
onClick: () =>
|
|
248
|
+
onClick: () => C(!S),
|
|
245
249
|
"data-open": S,
|
|
246
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ v(m, {
|
|
247
251
|
name: "dropdown",
|
|
248
252
|
source: r.icons?.dropdown
|
|
249
253
|
})
|
|
250
254
|
})] }),
|
|
251
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ v("div", {
|
|
252
256
|
className: "rfe-value",
|
|
253
|
-
onClick: () =>
|
|
254
|
-
children: r.multiple ? /* @__PURE__ */
|
|
257
|
+
onClick: () => C(!S),
|
|
258
|
+
children: r.multiple ? /* @__PURE__ */ v(d, {
|
|
255
259
|
options: G,
|
|
256
260
|
mode: r.displayMode,
|
|
257
261
|
maxTagCount: r.maxTagCount,
|
|
@@ -260,73 +264,73 @@ function w(r) {
|
|
|
260
264
|
onInspect: oe,
|
|
261
265
|
readOnly: k,
|
|
262
266
|
placeholder: r.placeholder
|
|
263
|
-
}) : /* @__PURE__ */
|
|
267
|
+
}) : /* @__PURE__ */ v("span", {
|
|
264
268
|
className: G.length ? "rfe-single-value" : "rfe-placeholder",
|
|
265
|
-
children: G[0]?.label ?? r.placeholder ??
|
|
269
|
+
children: G[0]?.label ?? r.placeholder ?? g.choose
|
|
266
270
|
})
|
|
267
271
|
})
|
|
268
272
|
})
|
|
269
273
|
}),
|
|
270
|
-
children: /* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ y("div", {
|
|
271
275
|
className: "rfe-selection-body",
|
|
272
276
|
onKeyDown: ce,
|
|
273
277
|
"data-selection-style": r.selectionStyle ?? (r.multiple ? "subtle" : "accent"),
|
|
274
|
-
children: [r.multiple && M ? /* @__PURE__ */
|
|
278
|
+
children: [r.multiple && M ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ y("button", {
|
|
275
279
|
type: "button",
|
|
276
280
|
className: "rfe-link",
|
|
277
281
|
onClick: () => N(!1),
|
|
278
|
-
children: [/* @__PURE__ */
|
|
279
|
-
}), /* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ v(m, { name: "previous" }), g.choose]
|
|
283
|
+
}), /* @__PURE__ */ v(u, {
|
|
280
284
|
options: ne,
|
|
281
285
|
onRemove: ae,
|
|
282
286
|
onClear: $,
|
|
283
287
|
readOnly: r.readOnly
|
|
284
|
-
})] }) : /* @__PURE__ */
|
|
285
|
-
r.searchable !== !1 && /* @__PURE__ */
|
|
288
|
+
})] }) : /* @__PURE__ */ y(_, { children: [
|
|
289
|
+
r.searchable !== !1 && /* @__PURE__ */ v("input", {
|
|
286
290
|
className: "rfe-search",
|
|
287
291
|
role: "combobox",
|
|
288
292
|
"aria-expanded": "true",
|
|
289
293
|
"aria-controls": K.length ? L : void 0,
|
|
290
294
|
"aria-activedescendant": J >= 0 ? R(J) : void 0,
|
|
291
295
|
"aria-autocomplete": "list",
|
|
292
|
-
"aria-label":
|
|
293
|
-
placeholder:
|
|
296
|
+
"aria-label": g.search,
|
|
297
|
+
placeholder: g.search,
|
|
294
298
|
value: A,
|
|
295
299
|
onChange: (e) => {
|
|
296
300
|
j(e.target.value), F(-1);
|
|
297
301
|
}
|
|
298
302
|
}),
|
|
299
|
-
r.multiple && r.showSelectAll && !r.readOnly && /* @__PURE__ */
|
|
303
|
+
r.multiple && r.showSelectAll && !r.readOnly && /* @__PURE__ */ y("div", {
|
|
300
304
|
className: "rfe-toolbar",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ y("button", {
|
|
302
306
|
type: "button",
|
|
303
307
|
className: "rfe-select-all",
|
|
304
308
|
role: "checkbox",
|
|
305
309
|
"aria-checked": Z ? !0 : X ? "mixed" : !1,
|
|
306
|
-
"aria-label":
|
|
307
|
-
title: re ?
|
|
310
|
+
"aria-label": g.all,
|
|
311
|
+
title: re ? b("max", { max: r.maxCount ?? 0 }) : void 0,
|
|
308
312
|
disabled: !Y.length || re,
|
|
309
313
|
onClick: () => D(p(E, Y, r.maxCount)),
|
|
310
|
-
children: [/* @__PURE__ */
|
|
314
|
+
children: [/* @__PURE__ */ v("span", {
|
|
311
315
|
className: "rfe-option-check",
|
|
312
316
|
"data-checked": Q !== "none",
|
|
313
|
-
children: Q !== "none" && /* @__PURE__ */
|
|
314
|
-
}), Z ?
|
|
315
|
-
}), /* @__PURE__ */
|
|
317
|
+
children: Q !== "none" && /* @__PURE__ */ v(m, { name: Q === "all" ? "check" : "minus" })
|
|
318
|
+
}), Z ? g.deselectAll : g.all]
|
|
319
|
+
}), /* @__PURE__ */ v("button", {
|
|
316
320
|
type: "button",
|
|
317
321
|
className: "rfe-link",
|
|
318
322
|
onClick: $,
|
|
319
|
-
children:
|
|
323
|
+
children: g.clear
|
|
320
324
|
})]
|
|
321
325
|
}),
|
|
322
|
-
H && /* @__PURE__ */
|
|
326
|
+
H && /* @__PURE__ */ y("div", {
|
|
323
327
|
className: "rfe-options-loading",
|
|
324
328
|
role: "status",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ v(m, { name: "loading" }), g.loading]
|
|
326
330
|
}),
|
|
327
|
-
K.length ? /* @__PURE__ */
|
|
331
|
+
K.length ? /* @__PURE__ */ v(f, {
|
|
328
332
|
items: K,
|
|
329
|
-
getKey:
|
|
333
|
+
getKey: w,
|
|
330
334
|
id: L,
|
|
331
335
|
role: "listbox",
|
|
332
336
|
label: z,
|
|
@@ -335,7 +339,7 @@ function w(r) {
|
|
|
335
339
|
activeIndex: J,
|
|
336
340
|
activeId: J >= 0 ? R(J) : void 0,
|
|
337
341
|
variableHeight: r.variableHeight,
|
|
338
|
-
render: (e, t) => /* @__PURE__ */
|
|
342
|
+
render: (e, t) => /* @__PURE__ */ y("button", {
|
|
339
343
|
id: R(t),
|
|
340
344
|
type: "button",
|
|
341
345
|
role: "option",
|
|
@@ -350,73 +354,73 @@ function w(r) {
|
|
|
350
354
|
onMouseEnter: () => F(t),
|
|
351
355
|
onClick: () => ie(e),
|
|
352
356
|
children: [
|
|
353
|
-
r.multiple && /* @__PURE__ */
|
|
357
|
+
r.multiple && /* @__PURE__ */ v("span", {
|
|
354
358
|
className: "rfe-option-check",
|
|
355
359
|
"data-checked": U.has(e.value),
|
|
356
|
-
children: U.has(e.value) && /* @__PURE__ */
|
|
360
|
+
children: U.has(e.value) && /* @__PURE__ */ v(m, { name: "check" })
|
|
357
361
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ v("span", {
|
|
359
363
|
className: "rfe-option-label",
|
|
360
|
-
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: [
|
|
361
365
|
e.icon,
|
|
362
366
|
e.label,
|
|
363
|
-
e.description && /* @__PURE__ */
|
|
367
|
+
e.description && /* @__PURE__ */ v("small", { children: e.description })
|
|
364
368
|
] })
|
|
365
369
|
}),
|
|
366
|
-
!r.multiple && U.has(e.value) && /* @__PURE__ */
|
|
370
|
+
!r.multiple && U.has(e.value) && /* @__PURE__ */ v(m, {
|
|
367
371
|
name: "check",
|
|
368
372
|
source: r.icons?.check
|
|
369
373
|
})
|
|
370
374
|
]
|
|
371
375
|
})
|
|
372
|
-
}) : !H && !B.error && /* @__PURE__ */
|
|
376
|
+
}) : !H && !B.error && /* @__PURE__ */ y("div", {
|
|
373
377
|
className: "rfe-empty",
|
|
374
378
|
role: "status",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ v(m, { name: "empty" }), g.empty]
|
|
376
380
|
}),
|
|
377
|
-
B.error && /* @__PURE__ */
|
|
381
|
+
B.error && /* @__PURE__ */ v("button", {
|
|
378
382
|
type: "button",
|
|
379
383
|
className: "rfe-link",
|
|
380
384
|
onClick: () => void B.retry(),
|
|
381
|
-
children:
|
|
385
|
+
children: g.retry
|
|
382
386
|
}),
|
|
383
|
-
B.hasMore && !B.error && /* @__PURE__ */
|
|
387
|
+
B.hasMore && !B.error && /* @__PURE__ */ v("button", {
|
|
384
388
|
type: "button",
|
|
385
389
|
className: "rfe-link",
|
|
386
390
|
disabled: B.loading,
|
|
387
391
|
onClick: () => void B.more(),
|
|
388
|
-
children:
|
|
392
|
+
children: g.next
|
|
389
393
|
})
|
|
390
|
-
] }), (r.multiple || r.needConfirm) && /* @__PURE__ */
|
|
394
|
+
] }), (r.multiple || r.needConfirm) && /* @__PURE__ */ y("div", {
|
|
391
395
|
className: "rfe-footer",
|
|
392
396
|
children: [
|
|
393
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ y("button", {
|
|
394
398
|
type: "button",
|
|
395
399
|
className: "rfe-link",
|
|
396
400
|
onClick: () => N(!M),
|
|
397
401
|
children: [
|
|
398
|
-
|
|
402
|
+
g.selected,
|
|
399
403
|
" ",
|
|
400
404
|
E.length
|
|
401
405
|
]
|
|
402
406
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
r.needConfirm && /* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ v("span", { className: "rfe-spacer" }),
|
|
408
|
+
r.needConfirm && /* @__PURE__ */ v("button", {
|
|
405
409
|
type: "button",
|
|
406
410
|
className: "rfe-link",
|
|
407
|
-
onClick: () =>
|
|
408
|
-
children:
|
|
411
|
+
onClick: () => C(!1),
|
|
412
|
+
children: g.cancel
|
|
409
413
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ v("button", {
|
|
411
415
|
className: "rfe-button",
|
|
412
416
|
"data-variant": "primary",
|
|
413
417
|
type: "button",
|
|
414
418
|
onClick: ee,
|
|
415
|
-
children:
|
|
419
|
+
children: g.done
|
|
416
420
|
})
|
|
417
421
|
]
|
|
418
422
|
})]
|
|
419
423
|
})
|
|
420
424
|
});
|
|
421
425
|
}
|
|
422
|
-
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";
|