jaguar-form 1.0.1 → 1.0.3

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.
Files changed (40) hide show
  1. package/README.md +24 -0
  2. package/dist/{Control-fWNQOzmu.js → Control-B36bu6zQ.js} +2 -2
  3. package/dist/{Select-BFLDNUiq.js → Select-BG2H-YnK.js} +5 -5
  4. package/dist/{TreeSelect-D8smQmgp.js → TreeSelect-CkPtMg-g.js} +6 -5
  5. package/dist/compound-D4_6P0d_.js +320 -0
  6. package/dist/compound.js +1 -0
  7. package/dist/core.js +3 -1
  8. package/dist/date-time.js +1 -1
  9. package/dist/form-DTI0Sqsy.js +413 -0
  10. package/dist/form.js +4 -3
  11. package/dist/{icons-KmLuj5v3.js → icons-BI3fdIey.js} +2 -1
  12. package/dist/{image-upload-CkX8vlWK.js → image-upload-VtUlQgzJ.js} +4 -4
  13. package/dist/image-upload.js +1 -1
  14. package/dist/index.js +14 -12
  15. package/dist/input.js +1 -1
  16. package/dist/{inputs-DNNFmj2K.js → inputs-BOP8Ryne.js} +5 -4
  17. package/dist/{pickers-BOMKe7vt.js → pickers-C9QTR2XN.js} +6 -4
  18. package/dist/select.js +1 -1
  19. package/dist/selection-CIEa1uce.js +146 -0
  20. package/dist/{slider-BwDcSnnI.js → slider-CNwkLMmo.js} +1 -1
  21. package/dist/slider.js +1 -1
  22. package/dist/{store-DmlIFdPW.js → store-DOn9K-EA.js} +171 -229
  23. package/dist/style.css +1 -1
  24. package/dist/tree-select.js +1 -1
  25. package/dist/types/components/compound/ControlGroup.d.ts +29 -0
  26. package/dist/types/components/compound/context.d.ts +5 -0
  27. package/dist/types/components/compound/index.d.ts +40 -0
  28. package/dist/types/components/compound/model.d.ts +14 -0
  29. package/dist/types/components/compound/types.d.ts +24 -0
  30. package/dist/types/components/date-time/types.d.ts +1 -0
  31. package/dist/types/config/index.d.ts +2 -0
  32. package/dist/types/entries/compound.d.ts +1 -0
  33. package/dist/types/icons/index.d.ts +1 -0
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/{useControllable-Dl8gno_5.js → useControllable-Zax42z2F.js} +6 -1
  36. package/dist/{useSelection-FYP8nzFQ.js → useSelection-C0OEFZUE.js} +3 -3
  37. package/dist/validation-D6vk5NAv.js +61 -0
  38. package/package.json +5 -1
  39. package/dist/form-zqtJgUQ3.js +0 -407
  40. package/dist/selection-Bfrk6SoB.js +0 -136
@@ -0,0 +1,413 @@
1
+ import { c as e, s as t, t as n } from "./compound-D4_6P0d_.js";
2
+ import { a as r } from "./useControllable-Zax42z2F.js";
3
+ import { r as i } from "./locale-yHkdw2xz.js";
4
+ import { n as a, t as o } from "./slider-CNwkLMmo.js";
5
+ import { i as s, t as c } from "./image-upload-VtUlQgzJ.js";
6
+ import { cloneElement as l, createContext as u, isValidElement as d, useCallback as f, useContext as p, useEffect as m, useId as h, useMemo as g, useRef as _, useState as v, useSyncExternalStore as y } from "react";
7
+ import { d as b, n as x, t as S } from "./store-DOn9K-EA.js";
8
+ import { a as C, c as w, d as T, f as E, l as D, n as O, o as k, r as A, s as j, t as M, u as N } from "./inputs-BOP8Ryne.js";
9
+ import { n as P, t as F } from "./Select-BG2H-YnK.js";
10
+ import { t as I } from "./TreeSelect-CkPtMg-g.js";
11
+ import { a as L, c as R, i as z, l as B, n as ee, o as te, r as ne, s as re, t as ie, u as ae } from "./pickers-C9QTR2XN.js";
12
+ import { jsx as V, jsxs as H } from "react/jsx-runtime";
13
+ // src/form/index.tsx
14
+ var U = u(null);
15
+ function W(e = {}) {
16
+ let [t] = v(() => {
17
+ let t = e.fields ?? [], n = {
18
+ ...Object.fromEntries(t.map((e) => [e.name, Q(e)])),
19
+ ...e.defaultValues
20
+ }, r = Object.fromEntries(t.filter((e) => e.transform).map((e) => [e.name, e.transform]));
21
+ return S(n, {
22
+ nested: e.nested,
23
+ initialValues: e.initialValues,
24
+ adapter: {
25
+ ...e.adapter,
26
+ fields: {
27
+ ...r,
28
+ ...e.adapter?.fields
29
+ }
30
+ }
31
+ });
32
+ });
33
+ return t;
34
+ }
35
+ function G({ form: e, children: t }) {
36
+ return /* @__PURE__ */ V(U.Provider, {
37
+ value: e,
38
+ children: t
39
+ });
40
+ }
41
+ function K() {
42
+ let e = p(U);
43
+ if (!e) throw Error("FormProvider is required");
44
+ return e;
45
+ }
46
+ function q(e) {
47
+ let t = K(), n = f((n) => t.subscribe(e, n), [t, e]), r = f(() => t.getFieldState(e), [t, e]), i = y(n, r, r);
48
+ return {
49
+ ...i,
50
+ value: i.value,
51
+ setValue: (n) => t.setValue(e, n),
52
+ onBlur: () => t.blur(e)
53
+ };
54
+ }
55
+ function J(e) {
56
+ let t = K(), n = f((n) => t.subscribe(e, n), [t, e]), r = f(() => t.getValue(e), [t, e]);
57
+ return y(n, r, r);
58
+ }
59
+ function oe(e) {
60
+ let t = K(), n = J(e), r = h(), i = _(0), a = _([]), o = (e) => ({
61
+ key: `${r}-${++i.current}`,
62
+ value: e
63
+ }), s = (e) => {
64
+ let t = [...a.current];
65
+ return e.map((e) => {
66
+ let n = t.findIndex((t) => x(t.value, e));
67
+ return n < 0 ? o(e) : {
68
+ ...t.splice(n, 1)[0],
69
+ value: e
70
+ };
71
+ });
72
+ }, c = g(() => s(Array.isArray(n) ? n : []), [n]);
73
+ m(() => {
74
+ a.current = c;
75
+ }, [c]);
76
+ let l = (n) => {
77
+ let r = t.getValue(e), i = s(Array.isArray(r) ? r : []), c = n.type === "insert" ? {
78
+ ...n,
79
+ value: o(n.value)
80
+ } : n.type === "update" ? {
81
+ ...n,
82
+ value: {
83
+ key: i[n.index]?.key ?? "",
84
+ value: n.value
85
+ }
86
+ } : n, l = b(i, c);
87
+ return a.current = l, t.editFieldArray(e, n);
88
+ };
89
+ return {
90
+ fields: c,
91
+ append: (n) => {
92
+ let r = t.getValue(e);
93
+ return l({
94
+ type: "insert",
95
+ index: Array.isArray(r) ? r.length : 0,
96
+ value: n
97
+ });
98
+ },
99
+ prepend: (e) => l({
100
+ type: "insert",
101
+ index: 0,
102
+ value: e
103
+ }),
104
+ insert: (e, t) => l({
105
+ type: "insert",
106
+ index: e,
107
+ value: t
108
+ }),
109
+ remove: (e) => l({
110
+ type: "remove",
111
+ index: e
112
+ }),
113
+ move: (e, t) => l({
114
+ type: "move",
115
+ from: e,
116
+ to: t
117
+ }),
118
+ update: (e, t) => l({
119
+ type: "update",
120
+ index: e,
121
+ value: t
122
+ }),
123
+ replace: (n) => t.setValue(e, n)
124
+ };
125
+ }
126
+ function se(e = (e) => e) {
127
+ let t = K(), n = _(null), r = f(() => {
128
+ let r = e(t.getFormSummary());
129
+ return n.current && x(n.current.value, r) ? n.current.value : (n.current = { value: r }, r);
130
+ }, [t, e]);
131
+ return y(t.subscribeAll, r, r);
132
+ }
133
+ function ce() {
134
+ let e = K();
135
+ return y(e.subscribeAll, e.getVersion, e.getVersion), {
136
+ values: e.getValues(),
137
+ changedValues: e.getChangedValues()
138
+ };
139
+ }
140
+ var le = (e) => e, ue = {
141
+ compound: n,
142
+ imageUpload: c,
143
+ input: C,
144
+ number: k,
145
+ password: j,
146
+ textarea: E,
147
+ switch: T,
148
+ checkbox: O,
149
+ radio: w,
150
+ checkboxGroup: A,
151
+ select: P,
152
+ multiSelect: F,
153
+ treeSelect: I,
154
+ date: ie,
155
+ dateRange: ee,
156
+ time: re,
157
+ timeRange: R,
158
+ dateTime: ne,
159
+ dateTimeRange: z,
160
+ month: L,
161
+ year: B,
162
+ monthRange: te,
163
+ yearRange: ae,
164
+ search: D,
165
+ segmented: N,
166
+ slider: a,
167
+ rangeSlider: o
168
+ };
169
+ function Y({ label: e, description: t, error: n, required: r, id: i, children: a, span: o = 1 }) {
170
+ return /* @__PURE__ */ H("div", {
171
+ className: "rfe-field",
172
+ style: { gridColumn: `span ${o}` },
173
+ children: [e && /* @__PURE__ */ H("label", {
174
+ htmlFor: i,
175
+ className: "rfe-field-label",
176
+ children: [r && /* @__PURE__ */ V("span", {
177
+ className: "rfe-required",
178
+ "aria-hidden": "true",
179
+ children: "* "
180
+ }), e]
181
+ }), /* @__PURE__ */ H("div", {
182
+ className: "rfe-field-content",
183
+ children: [a, n ? /* @__PURE__ */ V("div", {
184
+ id: i ? `${i}-help` : void 0,
185
+ role: "alert",
186
+ className: "rfe-error",
187
+ children: n
188
+ }) : t && /* @__PURE__ */ V("div", {
189
+ id: i ? `${i}-help` : void 0,
190
+ className: "rfe-description",
191
+ children: t
192
+ })]
193
+ })]
194
+ });
195
+ }
196
+ var X = (e, t) => typeof e.visible == "function" ? e.visible(t) : e.visible !== !1, Z = (e) => e.type === "compound" && Array.isArray(e.componentProps?.fields) ? e.componentProps.fields : void 0, Q = (e) => e.defaultValue === void 0 ? Z(e) ? t(Z(e)) : void 0 : e.defaultValue;
197
+ function de(t) {
198
+ return [
199
+ ...t.required && !t.rules?.some((e) => e.required) ? [{ required: !0 }] : [],
200
+ ...t.rules ?? [],
201
+ ...Z(t) ? [e(Z(t))] : [],
202
+ ...t.type === "imageUpload" && t.componentProps?.mode === "upload" ? [s] : []
203
+ ];
204
+ }
205
+ function fe({ field: e, components: t, fields: n, validateOn: a }) {
206
+ let o = K(), s = q(e.name), c = r(), l = h(), u = e.dependsOn, d = g(() => ({
207
+ rules: de(e),
208
+ debounce: e.debounce,
209
+ dependsOn: u,
210
+ validateOn: e.validateOn ?? a,
211
+ defaultValue: Q(e),
212
+ visible: (t) => X(e, t)
213
+ }), [
214
+ e,
215
+ u,
216
+ a
217
+ ]);
218
+ m(() => o.registerField(e.name, { ...d }), [o, e.name]), m(() => o.updateField(e.name, d), [
219
+ o,
220
+ e.name,
221
+ d
222
+ ]);
223
+ let p = f((t) => {
224
+ if (!u) return typeof e.visible == "function" || typeof e.disabled == "function" ? o.subscribeAll(t) : () => {};
225
+ let n = u.map((e) => o.subscribe(e, t));
226
+ return () => n.forEach((e) => e());
227
+ }, [
228
+ o,
229
+ u,
230
+ e.visible,
231
+ e.disabled
232
+ ]);
233
+ y(p, o.getVersion, o.getVersion);
234
+ let _ = typeof e.visible == "function" || typeof e.disabled == "function" ? o.getValues() : $;
235
+ if (!X(e, _)) return null;
236
+ let v = t[e.type] ?? ue[e.type], b = {
237
+ ...e.componentProps,
238
+ id: l,
239
+ name: e.name,
240
+ value: s.value ?? ([
241
+ "input",
242
+ "password",
243
+ "textarea",
244
+ "search"
245
+ ].includes(e.type) ? "" : e.type === "switch" || e.type === "checkbox" ? !1 : e.type === "imageUpload" || e.type === "multiSelect" || e.type === "checkboxGroup" || e.type === "treeSelect" && e.componentProps?.multiple ? [] : e.type === "slider" ? 0 : e.type === "rangeSlider" ? [0, 100] : null),
246
+ onChange: (t) => {
247
+ o.setValue(e.name, t);
248
+ },
249
+ onBlur: () => {
250
+ o.blur(e.name);
251
+ },
252
+ status: s.error ? "error" : "default",
253
+ "aria-invalid": !!s.error,
254
+ disabled: typeof e.disabled == "function" ? e.disabled(_) : e.disabled ?? e.componentProps?.disabled,
255
+ "aria-describedby": s.error || e.description ? `${l}-help` : void 0
256
+ };
257
+ return /* @__PURE__ */ H(Y, {
258
+ label: e.label,
259
+ required: e.required,
260
+ description: e.description,
261
+ error: i(s.issue, s.error, c),
262
+ id: l,
263
+ span: e.span,
264
+ children: [e.render ? e.render(b) : v ? /* @__PURE__ */ V(v, { ...b }) : /* @__PURE__ */ V("div", {
265
+ className: "rfe-error",
266
+ children: c.t("unknownField", { type: e.type })
267
+ }), s.validating && /* @__PURE__ */ V("small", {
268
+ role: "status",
269
+ className: "rfe-description",
270
+ children: c.t("validating")
271
+ })]
272
+ });
273
+ }
274
+ var pe = u("blur"), me = [], $ = {}, he = {};
275
+ function ge({ nested: e, initialValues: t, adapter: n, submitHiddenFields: i = !1, validateOn: a = "blur", form: o, fields: s = me, defaultValues: c = $, components: l = he, children: u, columns: d = 1, layout: f = "vertical", onSubmit: p, onError: m, submitText: h, resetText: g, showActions: y = !0 }) {
276
+ let b = r(), x = W(o ? {} : {
277
+ fields: s,
278
+ defaultValues: c,
279
+ initialValues: t,
280
+ adapter: n,
281
+ nested: e
282
+ }), S = o ?? x, [C, w] = v(!1), [T, E] = v(""), D = _(!1), O = _(null);
283
+ return /* @__PURE__ */ V(G, {
284
+ form: S,
285
+ children: /* @__PURE__ */ V(pe.Provider, {
286
+ value: a,
287
+ children: /* @__PURE__ */ H("form", {
288
+ ref: O,
289
+ className: "rfe-form",
290
+ "data-layout": f,
291
+ noValidate: !0,
292
+ onSubmit: async (e) => {
293
+ if (e.preventDefault(), !D.current) {
294
+ D.current = !0, w(!0), E("");
295
+ try {
296
+ let e = S.getDataVersion(), t = await S.validate();
297
+ if (S.getDataVersion() !== e || !t) {
298
+ requestAnimationFrame(() => O.current?.querySelector("input[aria-invalid=\"true\"],button[aria-invalid=\"true\"],textarea[aria-invalid=\"true\"],[tabindex][aria-invalid=\"true\"]")?.focus());
299
+ return;
300
+ }
301
+ await p?.(S.getSubmitValues(i));
302
+ } catch (e) {
303
+ E(e instanceof Error ? e.message : b.t("submitFailed")), m?.(e);
304
+ } finally {
305
+ D.current = !1, w(!1);
306
+ }
307
+ }
308
+ },
309
+ children: [
310
+ /* @__PURE__ */ H("div", {
311
+ className: "rfe-form-grid",
312
+ style: { gridTemplateColumns: `repeat(${Math.max(1, d)},minmax(0,1fr))` },
313
+ children: [s.map((e) => /* @__PURE__ */ V(fe, {
314
+ field: e,
315
+ components: l,
316
+ fields: s,
317
+ validateOn: a
318
+ }, e.name)), u]
319
+ }),
320
+ T && /* @__PURE__ */ V("div", {
321
+ role: "alert",
322
+ className: "rfe-error",
323
+ children: T
324
+ }),
325
+ y && /* @__PURE__ */ H("div", {
326
+ className: "rfe-form-actions",
327
+ children: [/* @__PURE__ */ V(M, {
328
+ variant: "secondary",
329
+ disabled: C,
330
+ onClick: () => {
331
+ S.reset(), E("");
332
+ },
333
+ children: g ?? b.t("reset")
334
+ }), /* @__PURE__ */ V(M, {
335
+ type: "submit",
336
+ loading: C,
337
+ children: h ?? b.t("save")
338
+ })]
339
+ })
340
+ ]
341
+ })
342
+ })
343
+ });
344
+ }
345
+ function _e({ children: a, name: o, label: u, description: _, required: v, rules: b, defaultValue: x, dependsOn: S, debounce: C, validateOn: w, span: T, disabled: E, visible: D, componentProps: O }) {
346
+ let k = K(), A = p(pe), j = w ?? A, M = q(o), N = r(), P = h(), F = d(a) && a.type === n ? a.props.fields : void 0, I = d(a) && a.type === c && a.props.mode === "upload", L = g(() => ({
347
+ rules: [
348
+ ...v && !b?.some((e) => e.required) ? [{ required: !0 }] : [],
349
+ ...b ?? [],
350
+ ...I ? [s] : [],
351
+ ...F ? [e(F)] : []
352
+ ],
353
+ defaultValue: x ?? (F ? t(F) : void 0),
354
+ dependsOn: S,
355
+ debounce: C,
356
+ validateOn: j,
357
+ visible: (e) => typeof D == "function" ? D(e) : D !== !1
358
+ }), [
359
+ v,
360
+ b,
361
+ x,
362
+ S,
363
+ C,
364
+ j,
365
+ D,
366
+ I,
367
+ F
368
+ ]);
369
+ m(() => k.registerField(o, { ...L }), [k, o]), m(() => k.updateField(o, L), [
370
+ k,
371
+ o,
372
+ L
373
+ ]);
374
+ let R = f((e) => typeof D == "function" || typeof E == "function" ? k.subscribeAll(e) : () => {}, [
375
+ k,
376
+ D,
377
+ E
378
+ ]);
379
+ y(R, k.getVersion, k.getVersion);
380
+ let z = typeof D == "function" || typeof E == "function" ? k.getValues() : $;
381
+ if (!L.visible(z)) return null;
382
+ let B = {
383
+ ...O,
384
+ id: P,
385
+ name: o,
386
+ value: M.value,
387
+ onChange: (e) => {
388
+ k.setValue(o, e);
389
+ },
390
+ onBlur: () => {
391
+ k.blur(o);
392
+ },
393
+ disabled: typeof E == "function" ? E(z) : E,
394
+ status: M.error ? "error" : "default",
395
+ "aria-invalid": !!M.error,
396
+ "aria-describedby": M.error || _ ? `${P}-help` : void 0
397
+ };
398
+ return /* @__PURE__ */ H(Y, {
399
+ id: P,
400
+ label: u,
401
+ required: v,
402
+ description: _,
403
+ error: i(M.issue, M.error, N),
404
+ span: T,
405
+ children: [typeof a == "function" ? a(B) : d(a) ? l(a, B) : a, M.validating && /* @__PURE__ */ V("small", {
406
+ role: "status",
407
+ className: "rfe-description",
408
+ children: N.t("validating")
409
+ })]
410
+ });
411
+ }
412
+ var ve = Object.assign(ge, { Field: _e }), ye = (e) => e;
413
+ export { le as a, W as c, se as d, J as f, ye as i, K as l, Y as n, q as o, G as r, oe as s, ve as t, ce as u };
package/dist/form.js CHANGED
@@ -1,3 +1,4 @@
1
- import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "./store-DmlIFdPW.js";
2
- import { a as S, c as C, d as w, f as T, i as E, l as D, n as O, o as k, r as A, s as j, t as M, u as N } from "./form-zqtJgUQ3.js";
3
- export { M as Form, O as FormItem, A as FormProvider, u as changedOutputValues, v as cloneValues, _ as createFormStore, p as createPathAdapter, E as defineComponents, S as defineForm, a as defineValueAdapter, d as editArray, f as equalValue, g as expandPaths, c as fieldSegments, i as getPathValue, s as hasPath, o as inputValues, t as isArrayIndex, h as isEmpty, y as isPlainRecord, x as normalizePaths, r as omitPaths, m as outputValues, b as readPath, k as useField, j as useFieldArray, C as useForm, D as useFormContext, N as useFormState, w as useFormSummary, T as useWatch, l as validateRuleIssue, n as validateRules, e as writePath };
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-DOn9K-EA.js";
3
+ import { a as S, c as C, d as w, f as T, i as E, l as D, n as O, o as k, r as A, s as j, t as M, u as N } from "./form-DTI0Sqsy.js";
4
+ export { M as Form, O as FormItem, A as FormProvider, m as changedOutputValues, _ as cloneValues, v as createFormStore, g as createPathAdapter, E as defineComponents, S as defineForm, 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, k as useField, j as useFieldArray, C as useForm, D as useFormContext, N as useFormState, w as useFormSummary, T as useWatch, e as validateRuleIssue, t as validateRules, x as writePath };
@@ -1,5 +1,5 @@
1
1
  import { isValidElement as e } from "react";
2
- import { i as t } from "./useControllable-Dl8gno_5.js";
2
+ import { i as t } from "./useControllable-Zax42z2F.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  // src/icons/index.tsx
5
5
  var r = {
@@ -12,6 +12,7 @@ var r = {
12
12
  search: "M21 21l-5-5M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0",
13
13
  calendar: "M5 5h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2ZM8 3v4m8-4v4M3 10h18",
14
14
  clock: "M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM12 7v5l4 2",
15
+ imageAdd: "M14 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h9M3 16l5-5 5 5M14 7h.01M19 14v8M15 18h8M16 3h3a2 2 0 0 1 2 2v6",
15
16
  separator: "M4 12h16m-6-6 6 6-6 6",
16
17
  plus: "M12 5v14M5 12h14",
17
18
  minus: "M5 12h14",
@@ -1,6 +1,6 @@
1
1
  import { useEffect as e, useId as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
- import { a, i as o, s, t as c } from "./useControllable-Dl8gno_5.js";
3
- import { t as l } from "./icons-KmLuj5v3.js";
2
+ import { a, i as o, s, t as c } from "./useControllable-Zax42z2F.js";
3
+ import { t as l } from "./icons-BI3fdIey.js";
4
4
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
5
  // src/components/image-upload/validation.ts
6
6
  var f = "image/jpeg,image/png,image/webp";
@@ -389,7 +389,7 @@ function w(c) {
389
389
  /* @__PURE__ */ u("span", {
390
390
  className: "rfe-image-add-icon",
391
391
  children: /* @__PURE__ */ u(l, {
392
- name: c.loading ? "loading" : "plus",
392
+ name: c.loading ? "loading" : "imageAdd",
393
393
  source: c.icons?.add
394
394
  })
395
395
  }),
@@ -588,7 +588,7 @@ function A({ id: e, name: n, value: p, defaultValue: h, onChange: g, onBlur: y,
588
588
  /* @__PURE__ */ u("span", {
589
589
  className: "rfe-image-add-icon",
590
590
  children: /* @__PURE__ */ u(l, {
591
- name: S ? "loading" : "plus",
591
+ name: S ? "loading" : "imageAdd",
592
592
  source: S ? void 0 : L?.add
593
593
  })
594
594
  }),
@@ -1 +1 @@
1
- export { t as ImageUpload, n as createImageUploadTasks, r as isImageUrl, i as uploadedImagesRule } from "./image-upload-CkX8vlWK.js";
1
+ export { t as ImageUpload, n as createImageUploadTasks, r as isImageUrl, i as uploadedImagesRule } from "./image-upload-VtUlQgzJ.js";
package/dist/index.js CHANGED
@@ -1,12 +1,14 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a } from "./useControllable-Dl8gno_5.js";
2
- import { n as o, t as s } from "./icons-KmLuj5v3.js";
3
- import { a as c, c as l, d as u, f as d, i as f, l as p, n as m, o as h, r as g, s as _, t as v, u as y } from "./inputs-DNNFmj2K.js";
4
- import { a as b, c as x, i as S, l as C, n as w, o as T, r as E, s as D, t as O, u as k } from "./pickers-BOMKe7vt.js";
5
- import { n as A, t as j } from "./slider-BwDcSnnI.js";
6
- import { n as M, t as N } from "./Select-BFLDNUiq.js";
7
- import { t as P } from "./TreeSelect-D8smQmgp.js";
8
- import { a as F, c as I, d as L, f as R, i as z, l as B, n as V, o as H, r as U, s as W, t as G, u as K } from "./form-zqtJgUQ3.js";
9
- import { i as q, n as J, r as Y, t as X } from "./image-upload-CkX8vlWK.js";
10
- import { S as Z, _ as Q, a as $, b as ee, c as te, d as ne, f as re, g as ie, h as ae, i as oe, l as se, m as ce, n as le, o as ue, p as de, r as fe, s as pe, t as me, u as he, v as ge, x as _e, y as ve } from "./store-DmlIFdPW.js";
11
- import { a as ye, i as be, n as xe, o as Se, r as Ce, s as we, t as Te } from "./locale-yHkdw2xz.js";
12
- export { v as Button, m as Checkbox, g as CheckboxGroup, n as ConfigProvider, O as DatePicker, w as DateRangePicker, E as DateTimePicker, S as DateTimeRangePicker, G as Form, V as FormItem, U as FormProvider, s as Icon, f as IconButton, X as ImageUpload, c as Input, b as MonthPicker, T as MonthRangePicker, N as MultiSelect, h as NumberInput, _ as Password, l as RadioGroup, j as RangeSlider, p as SearchInput, y as Segmented, M as Select, A as Slider, o as SvgIcon, u as Switch, d as Textarea, D as TimePicker, x as TimeRangePicker, P as TreeSelect, C as YearPicker, k as YearRangePicker, se as changedOutputValues, he as cloneValues, me as createFormStore, J as createImageUploadTasks, ue as createPathAdapter, a as cx, z as defineComponents, F as defineForm, Te as defineLocale, ne as defineValueAdapter, ce as editArray, xe as enUS, le as equalValue, pe as expandPaths, ae as fieldSegments, Ce as formatIssue, be as formatPickerValue, te as getPathValue, ie as hasPath, re as inputValues, Q as isArrayIndex, fe as isEmpty, Y as isImageUrl, ge as isPlainRecord, ve as normalizePaths, ee as omitPaths, de as outputValues, _e as readPath, ye as resolveLocale, i as tokenStyle, Se as translate, q as uploadedImagesRule, t as useConfig, H as useField, W as useFieldArray, I as useForm, B as useFormContext, K as useFormState, L as useFormSummary, e as useLocale, r as useText, R as useWatch, oe as validateRuleIssue, $ as validateRules, Z as writePath, we as zhCN };
1
+ import { a as e, i as t, n, o as r, r as i, s as a } from "./useControllable-Zax42z2F.js";
2
+ import { n as o, t as s } from "./icons-BI3fdIey.js";
3
+ import { a as c, c as l, d as u, f as d, i as f, l as p, n as m, o as h, r as g, s as _, t as v, u as y } from "./inputs-BOP8Ryne.js";
4
+ import { a as b, c as x, i as S, l as C, n as w, o as T, r as E, s as D, t as O, u as k } from "./pickers-C9QTR2XN.js";
5
+ import { n as A, t as j } from "./slider-CNwkLMmo.js";
6
+ import { n as M, t as N } from "./Select-BG2H-YnK.js";
7
+ import { t as P } from "./TreeSelect-CkPtMg-g.js";
8
+ import { a as F, c as I, d as L, f as R, i as z, l as B, n as V, o as H, r as U, s as W, t as G, u as K } from "./form-DTI0Sqsy.js";
9
+ import { i as q, n as J, r as Y, t as X } from "./image-upload-VtUlQgzJ.js";
10
+ import { n as Z, r as Q, t as $ } from "./validation-D6vk5NAv.js";
11
+ import { a as ee, i as te, n as ne, o as re, r as ie, s as ae, t as oe } from "./locale-yHkdw2xz.js";
12
+ import { _ as se, a as ce, c as le, d as ue, f as de, g as fe, h as pe, i as me, l as he, m as ge, n as _e, o as ve, p as ye, r as be, s as xe, t as Se, u as Ce, v as we, y as Te } from "./store-DOn9K-EA.js";
13
+ import { a as Ee, c as De, d as Oe, f as ke, i as Ae, l as je, n as Me, o as Ne, r as Pe, s as Fe, t as Ie, u as Le } from "./compound-D4_6P0d_.js";
14
+ export { v as Button, m as Checkbox, g as CheckboxGroup, Ie as CompoundField, n as ConfigProvider, ke as ControlGroup, O as DatePicker, w as DateRangePicker, E as DateTimePicker, S as DateTimeRangePicker, G as Form, V as FormItem, U as FormProvider, s as Icon, f as IconButton, X as ImageUpload, c as Input, Me as InputRange, Pe as InputSelect, b as MonthPicker, T as MonthRangePicker, N as MultiSelect, h as NumberInput, Ae as NumberSelect, Ee as NumberUnit, _ as Password, l as RadioGroup, j as RangeSlider, Ne as SearchGroup, p as SearchInput, y as Segmented, M as Select, A as Slider, o as SvgIcon, u as Switch, d as Textarea, D as TimePicker, x as TimeRangePicker, P as TreeSelect, C as YearPicker, k as YearRangePicker, ve as changedOutputValues, xe as cloneValues, Fe as compoundDefaults, De as compoundRule, je as compoundValues, Se as createFormStore, J as createImageUploadTasks, be as createPathAdapter, a as cx, z as defineComponents, F as defineForm, oe as defineLocale, le as defineValueAdapter, ue as editArray, ne as enUS, _e as equalValue, me as expandPaths, de as fieldSegments, ie as formatIssue, te as formatPickerValue, ce as getPathValue, ye as hasPath, he as inputValues, ge as isArrayIndex, $ as isEmpty, Y as isImageUrl, pe as isPlainRecord, fe as normalizePaths, se as omitPaths, Ce as outputValues, Le as partDisabled, Oe as partVisible, we as readPath, ee as resolveLocale, i as tokenStyle, re as translate, q as uploadedImagesRule, t as useConfig, H as useField, W as useFieldArray, I as useForm, B as useFormContext, K as useFormState, L as useFormSummary, e as useLocale, r as useText, R as useWatch, Z as validateRuleIssue, Q as validateRules, Te as writePath, ae as zhCN };
package/dist/input.js CHANGED
@@ -1 +1 @@
1
- export { a as Input, o as NumberInput, s as Password, l as SearchInput, f as Textarea } from "./inputs-DNNFmj2K.js";
1
+ export { a as Input, o as NumberInput, s as Password, l as SearchInput, f as Textarea } from "./inputs-BOP8Ryne.js";
@@ -1,7 +1,7 @@
1
1
  import { useEffect as e, useId as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
2
- import { n as a, t as o } from "./Control-fWNQOzmu.js";
3
- import { t as s } from "./icons-KmLuj5v3.js";
4
- import { a as c, i as l, o as u, s as d, t as f } from "./useControllable-Dl8gno_5.js";
2
+ import { n as a, t as o } from "./Control-B36bu6zQ.js";
3
+ import { t as s } from "./icons-BI3fdIey.js";
4
+ import { a as c, i as l, o as u, s as d, t as f } from "./useControllable-Zax42z2F.js";
5
5
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
6
6
  // src/utils/number.ts
7
7
  var g = /* @__PURE__ */ new Map();
@@ -336,7 +336,7 @@ function k(e) {
336
336
  }
337
337
  var A = () => t();
338
338
  function j(e) {
339
- let [t, n] = f(e.value, e.defaultValue ?? [], e.onChange);
339
+ let [t, n] = f(e.value, e.defaultValue ?? [], e.onChange), r = l();
340
340
  return /* @__PURE__ */ m("div", {
341
341
  role: "group",
342
342
  "aria-label": e["aria-label"],
@@ -346,6 +346,7 @@ function j(e) {
346
346
  style: e.style,
347
347
  "data-direction": e.direction ?? "row",
348
348
  "data-mode": e.variant ?? "default",
349
+ "data-size": e.size ?? r.size,
349
350
  children: e.options.map((r) => /* @__PURE__ */ h(D, {
350
351
  value: t.includes(r.value),
351
352
  size: e.size,
@@ -1,10 +1,10 @@
1
1
  import { useLayoutEffect as e, useMemo as t, useRef as n, useState as r } from "react";
2
2
  import i from "dayjs";
3
3
  import { i as a } from "./locale-yHkdw2xz.js";
4
- import { a as o, t as s } from "./useControllable-Dl8gno_5.js";
5
- import { n as c, t as l } from "./Control-fWNQOzmu.js";
6
- import { n as u, r as d } from "./selection-Bfrk6SoB.js";
7
- import { t as f } from "./icons-KmLuj5v3.js";
4
+ import { a as o, t as s } from "./useControllable-Zax42z2F.js";
5
+ import { n as c, t as l } from "./Control-B36bu6zQ.js";
6
+ import { n as u, r as d } from "./selection-CIEa1uce.js";
7
+ import { t as f } from "./icons-BI3fdIey.js";
8
8
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
9
9
  // src/utils/date.ts
10
10
  var g = (e) => String(e).padStart(2, "0");
@@ -417,11 +417,13 @@ function I({ kind: t, range: u, p: g }) {
417
417
  popupMaxHeight: g.popupMaxHeight ?? 480,
418
418
  trigger: (e, n) => /* @__PURE__ */ m("div", {
419
419
  ref: n,
420
+ className: "rfe-anchor",
420
421
  onBlur: (e) => {
421
422
  !D && !e.currentTarget.contains(e.relatedTarget) && g.onBlur?.();
422
423
  },
423
424
  children: /* @__PURE__ */ m(c, {
424
425
  ...g,
426
+ className: [g.className, `rfe-picker-icon-${g.iconPosition ?? "start"}`].filter(Boolean).join(" "),
425
427
  actions: /* @__PURE__ */ h(p, { children: [g.clearable !== !1 && /* @__PURE__ */ m(l, {
426
428
  name: "clear",
427
429
  source: g.icons?.clear,
package/dist/select.js CHANGED
@@ -1 +1 @@
1
- export { t as MultiSelect, n as Select } from "./Select-BFLDNUiq.js";
1
+ export { t as MultiSelect, n as Select } from "./Select-BG2H-YnK.js";