@selectwin/kit 0.1.257 → 0.1.258

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.
@@ -7,20 +7,21 @@ import { SelectSearchInput as u } from "./SelectSearchInput.js";
7
7
  import { SelectDateField as d } from "./SelectDateField.js";
8
8
  import { formatDateValue as f } from "./internal/dateValue.js";
9
9
  import { forwardRef as p, useEffect as m, useRef as h, useState as g } from "react";
10
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
10
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
11
11
  //#region src/SelectFilterBar.tsx
12
- function y(e) {
12
+ function b(e) {
13
13
  return (e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
14
14
  }
15
- function b(e, t) {
15
+ function x(e, t) {
16
16
  let n = new Set(e);
17
17
  return (t ? t.map((e) => e.value).filter((e) => n.has(e)) : [...n]).join(",");
18
18
  }
19
- function x(e, t) {
19
+ function S(e, t) {
20
20
  var n;
21
+ if (e.type === "toggle") return "";
21
22
  if (e.type === "select") return ((n = e.options) == null || (n = n.find((e) => e.value === t)) == null ? void 0 : n.label) ?? t;
22
23
  if (e.type === "multiselect") {
23
- let n = y(t).map((t) => {
24
+ let n = b(t).map((t) => {
24
25
  var n;
25
26
  return ((n = e.options) == null || (n = n.find((e) => e.value === t)) == null ? void 0 : n.label) ?? t;
26
27
  });
@@ -28,125 +29,157 @@ function x(e, t) {
28
29
  }
29
30
  return e.type === "date" ? f(t) ?? t : t;
30
31
  }
31
- function S({ filter: n, value: i, onChange: f, open: p, onToggle: S, onClose: C, disabled: w }) {
32
- let T = a(), [E, D] = g(""), O = h(null);
33
- c(p && (n.type === "select" || n.type === "multiselect"), O), m(() => {
34
- p || D("");
32
+ function C() {
33
+ let e = a().filterBar;
34
+ return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
35
+ className: "select-facet__badge",
36
+ "aria-hidden": "true",
37
+ children: e.customField
38
+ }), /* @__PURE__ */ v("span", {
39
+ className: "select-visually-hidden",
40
+ children: ` (${e.customFieldLabel})`
41
+ })] });
42
+ }
43
+ function w({ filter: n, value: i, onChange: f, open: p, onToggle: _, onClose: w, disabled: T }) {
44
+ let E = a(), [D, O] = g(""), k = h(null);
45
+ c(p && (n.type === "select" || n.type === "multiselect"), k), m(() => {
46
+ p || O("");
35
47
  }, [p]);
36
- let k = i.trim() !== "", A = k ? x(n, i) : null, j = k && !!n.error, M = n.options ?? [], N = M.length > 7, P = N ? M.filter((e) => e.label.toLowerCase().includes(E.trim().toLowerCase())) : M;
37
- return /* @__PURE__ */ v(l, {
48
+ let A = i.trim() !== "", j = A ? S(n, i) : null, M = A && !!n.error, N = n.options ?? [], P = N.length > 7, F = P ? N.filter((e) => e.label.toLowerCase().includes(D.trim().toLowerCase())) : N;
49
+ return n.type === "toggle" ? /* @__PURE__ */ y("button", {
50
+ type: "button",
51
+ className: `select-facet select-facet--toggle${A ? " is-active" : ""}${M ? " is-error" : ""}`,
52
+ "aria-pressed": A,
53
+ "aria-invalid": M || void 0,
54
+ title: M ? n.error : void 0,
55
+ disabled: T,
56
+ onClick: () => f(A ? "" : n.toggleValue ?? "true"),
57
+ children: [
58
+ /* @__PURE__ */ v("span", {
59
+ className: "select-facet__addicon",
60
+ "aria-hidden": "true",
61
+ children: v(A ? e : r, {})
62
+ }),
63
+ /* @__PURE__ */ v("span", {
64
+ className: "select-facet__label",
65
+ children: n.label
66
+ }),
67
+ n.custom ? /* @__PURE__ */ v(C, {}) : null
68
+ ]
69
+ }) : /* @__PURE__ */ y(l, {
38
70
  active: p,
39
- onClose: C,
71
+ onClose: w,
40
72
  placement: "bottom-start",
41
- activator: /* @__PURE__ */ v("button", {
73
+ activator: /* @__PURE__ */ y("button", {
42
74
  type: "button",
43
- className: `select-facet${k ? " is-active" : ""}${j ? " is-error" : ""}`,
44
- onClick: S,
45
- disabled: w,
75
+ className: `select-facet${A ? " is-active" : ""}${M ? " is-error" : ""}`,
76
+ onClick: _,
77
+ disabled: T,
46
78
  "aria-expanded": p,
47
- "aria-invalid": j || void 0,
48
- title: j ? n.error : void 0,
79
+ "aria-invalid": M || void 0,
80
+ title: M ? n.error : void 0,
49
81
  children: [
50
- /* @__PURE__ */ _("span", {
82
+ /* @__PURE__ */ v("span", {
51
83
  className: "select-facet__addicon",
52
84
  "aria-hidden": "true",
53
- children: /* @__PURE__ */ _(r, {})
85
+ children: /* @__PURE__ */ v(r, {})
54
86
  }),
55
- /* @__PURE__ */ _("span", {
87
+ /* @__PURE__ */ v("span", {
56
88
  className: "select-facet__label",
57
- children: A == null ? n.label : `${n.label}: ${A}`
89
+ children: j == null ? n.label : `${n.label}: ${j}`
58
90
  }),
59
- /* @__PURE__ */ _("span", {
91
+ n.custom ? /* @__PURE__ */ v(C, {}) : null,
92
+ /* @__PURE__ */ v("span", {
60
93
  className: `select-facet__caret${p ? " is-open" : ""}`,
61
94
  "aria-hidden": "true",
62
- children: /* @__PURE__ */ _(t, {})
95
+ children: /* @__PURE__ */ v(t, {})
63
96
  })
64
97
  ]
65
98
  }),
66
99
  children: [
67
- n.type === "multiselect" ? /* @__PURE__ */ v("div", {
100
+ n.type === "multiselect" ? /* @__PURE__ */ y("div", {
68
101
  className: "select-facet__panel",
69
- ref: O,
102
+ ref: k,
70
103
  onKeyDown: s,
71
- children: [N && /* @__PURE__ */ _("div", {
104
+ children: [P && /* @__PURE__ */ v("div", {
72
105
  className: "select-facet__search",
73
- children: /* @__PURE__ */ _(u, {
74
- value: E,
75
- onChange: D,
76
- placeholder: T.filterBar.searchOption
106
+ children: /* @__PURE__ */ v(u, {
107
+ value: D,
108
+ onChange: O,
109
+ placeholder: E.filterBar.searchOption
77
110
  })
78
- }), /* @__PURE__ */ _("div", {
111
+ }), /* @__PURE__ */ v("div", {
79
112
  className: "select-facet__options",
80
113
  role: "listbox",
81
114
  "aria-multiselectable": "true",
82
- children: P.length === 0 ? /* @__PURE__ */ _("div", {
115
+ children: F.length === 0 ? /* @__PURE__ */ v("div", {
83
116
  className: "select-facet__empty",
84
- children: T.common.nothingFound
85
- }) : P.map((t) => {
86
- let n = y(i), r = n.includes(t.value);
87
- return /* @__PURE__ */ v("button", {
117
+ children: E.common.nothingFound
118
+ }) : F.map((t) => {
119
+ let n = b(i), r = n.includes(t.value);
120
+ return /* @__PURE__ */ y("button", {
88
121
  type: "button",
89
122
  role: "option",
90
123
  "aria-selected": r,
91
124
  className: "select-facet__opt",
92
- onClick: () => f(b(r ? n.filter((e) => e !== t.value) : [...n, t.value], M)),
93
- children: [/* @__PURE__ */ _("span", { children: t.label }), r && /* @__PURE__ */ _("span", {
125
+ onClick: () => f(x(r ? n.filter((e) => e !== t.value) : [...n, t.value], N)),
126
+ children: [/* @__PURE__ */ v("span", { children: t.label }), r && /* @__PURE__ */ v("span", {
94
127
  className: "select-facet__check",
95
128
  "aria-hidden": "true",
96
- children: /* @__PURE__ */ _(e, {})
129
+ children: /* @__PURE__ */ v(e, {})
97
130
  })]
98
131
  }, t.value);
99
132
  })
100
133
  })]
101
- }) : n.type === "select" ? /* @__PURE__ */ v("div", {
134
+ }) : n.type === "select" ? /* @__PURE__ */ y("div", {
102
135
  className: "select-facet__panel",
103
- ref: O,
136
+ ref: k,
104
137
  onKeyDown: s,
105
- children: [N && /* @__PURE__ */ _("div", {
138
+ children: [P && /* @__PURE__ */ v("div", {
106
139
  className: "select-facet__search",
107
- children: /* @__PURE__ */ _(u, {
108
- value: E,
109
- onChange: D,
110
- placeholder: T.filterBar.searchOption
140
+ children: /* @__PURE__ */ v(u, {
141
+ value: D,
142
+ onChange: O,
143
+ placeholder: E.filterBar.searchOption
111
144
  })
112
- }), /* @__PURE__ */ _("div", {
145
+ }), /* @__PURE__ */ v("div", {
113
146
  className: "select-facet__options",
114
147
  role: "listbox",
115
- children: P.length === 0 ? /* @__PURE__ */ _("div", {
148
+ children: F.length === 0 ? /* @__PURE__ */ v("div", {
116
149
  className: "select-facet__empty",
117
- children: T.common.nothingFound
118
- }) : P.map((t) => {
150
+ children: E.common.nothingFound
151
+ }) : F.map((t) => {
119
152
  let n = i === t.value;
120
- return /* @__PURE__ */ v("button", {
153
+ return /* @__PURE__ */ y("button", {
121
154
  type: "button",
122
155
  role: "option",
123
156
  "aria-selected": n,
124
157
  className: `select-facet__opt${n ? " is-selected" : ""}`,
125
158
  onClick: () => {
126
- f(n ? "" : t.value), C();
159
+ f(n ? "" : t.value), w();
127
160
  },
128
- children: [/* @__PURE__ */ _("span", { children: t.label }), n && /* @__PURE__ */ _("span", {
161
+ children: [/* @__PURE__ */ v("span", { children: t.label }), n && /* @__PURE__ */ v("span", {
129
162
  className: "select-facet__check",
130
163
  "aria-hidden": "true",
131
- children: /* @__PURE__ */ _(e, {})
164
+ children: /* @__PURE__ */ v(e, {})
132
165
  })]
133
166
  }, t.value);
134
167
  })
135
168
  })]
136
- }) : n.type === "date" ? /* @__PURE__ */ _("div", {
169
+ }) : n.type === "date" ? /* @__PURE__ */ v("div", {
137
170
  className: "select-facet__field",
138
- children: /* @__PURE__ */ _(d, {
171
+ children: /* @__PURE__ */ v(d, {
139
172
  value: i,
140
173
  onChange: f,
141
174
  placeholder: n.placeholder,
142
175
  clearable: !1
143
176
  })
144
- }) : /* @__PURE__ */ _("div", {
177
+ }) : /* @__PURE__ */ v("div", {
145
178
  className: "select-facet__field",
146
179
  onKeyDown: (e) => {
147
- e.key === "Enter" && (e.preventDefault(), C());
180
+ e.key === "Enter" && (e.preventDefault(), w());
148
181
  },
149
- children: /* @__PURE__ */ _(o, {
182
+ children: /* @__PURE__ */ v(o, {
150
183
  type: "text",
151
184
  value: i,
152
185
  onChange: f,
@@ -154,55 +187,57 @@ function S({ filter: n, value: i, onChange: f, open: p, onToggle: S, onClose: C,
154
187
  autoFocus: !0
155
188
  })
156
189
  }),
157
- j && /* @__PURE__ */ _("div", {
190
+ M && /* @__PURE__ */ v("div", {
158
191
  className: "select-facet__error",
159
192
  role: "alert",
160
193
  children: n.error
161
194
  }),
162
- k && /* @__PURE__ */ _("div", {
195
+ A && /* @__PURE__ */ v("div", {
163
196
  className: "select-facet__foot",
164
- children: /* @__PURE__ */ _("button", {
197
+ children: /* @__PURE__ */ v("button", {
165
198
  type: "button",
166
199
  className: "select-facet__clear",
167
200
  onClick: () => {
168
- f(""), C();
201
+ f(""), w();
169
202
  },
170
- children: T.filterBar.clear
203
+ children: E.filterBar.clear
171
204
  })
172
205
  })
173
206
  ]
174
207
  });
175
208
  }
176
- var C = p(function({ filters: e, values: t, onChange: o, onClearAll: u, search: d, leading: f, disabled: p, className: m, ...y }, b) {
177
- let C = a(), [w, T] = g([]), [E, D] = g(null), [O, k] = g(!1), A = h(null);
178
- c(O, A);
179
- let j = (e) => (t[e.key] ?? "").trim() !== "", M = (e) => !!e.pinned || j(e) || w.includes(e.key), N = e.filter(M), P = e.filter((e) => !M(e)), F = e.filter(j), I = () => {
180
- T([]), D(null), u();
181
- }, L = (e) => {
182
- T((t) => t.includes(e) ? t : [...t, e]), k(!1), D(e);
209
+ var T = p(function({ filters: e, values: t, onChange: o, onClearAll: u, search: d, leading: f, disabled: p, className: m, ..._ }, b) {
210
+ let x = a(), [T, E] = g([]), [D, O] = g(null), [k, A] = g(!1), j = h(null);
211
+ c(k, j);
212
+ let M = (e) => (t[e.key] ?? "").trim() !== "", N = (e) => !!e.pinned || M(e) || T.includes(e.key), P = e.filter(N), F = e.filter((e) => !N(e)), I = e.filter(M), L = () => {
213
+ E([]), O(null), u();
214
+ }, R = (t) => {
215
+ E((e) => e.includes(t) ? e : [...e, t]), A(!1);
216
+ let n = e.find((e) => e.key === t);
217
+ (n == null ? void 0 : n.type) === "toggle" ? o(t, n.toggleValue ?? "true") : O(t);
183
218
  };
184
- return /* @__PURE__ */ v("div", {
219
+ return /* @__PURE__ */ y("div", {
185
220
  ref: b,
186
- ...y,
221
+ ..._,
187
222
  className: `select-filterbar${m ? " " + m : ""}`,
188
223
  children: [
189
- /* @__PURE__ */ v("div", {
224
+ /* @__PURE__ */ y("div", {
190
225
  className: "select-filterbar__row",
191
226
  children: [
192
227
  f,
193
- d && /* @__PURE__ */ v("div", {
228
+ d && /* @__PURE__ */ y("div", {
194
229
  className: `select-filterbar__query${d.error ? " select-filterbar__query--error" : ""}`,
195
230
  children: [
196
- /* @__PURE__ */ _("span", {
231
+ /* @__PURE__ */ v("span", {
197
232
  className: "select-filterbar__query-icon",
198
233
  "aria-hidden": "true",
199
- children: /* @__PURE__ */ _(i, {})
234
+ children: /* @__PURE__ */ v(i, {})
200
235
  }),
201
- /* @__PURE__ */ _("input", {
236
+ /* @__PURE__ */ v("input", {
202
237
  className: "select-filterbar__query-input",
203
238
  type: "search",
204
239
  value: d.value,
205
- placeholder: d.placeholder ?? C.common.searchPlaceholder,
240
+ placeholder: d.placeholder ?? x.common.searchPlaceholder,
206
241
  onChange: (e) => d.onChange(e.target.value),
207
242
  onKeyDown: d.onSubmit ? (e) => {
208
243
  if (e.key === "Enter") {
@@ -210,100 +245,95 @@ var C = p(function({ filters: e, values: t, onChange: o, onClearAll: u, search:
210
245
  e.preventDefault(), (t = d.onSubmit) == null || t.call(d);
211
246
  }
212
247
  } : void 0,
213
- "aria-label": d.ariaLabel ?? d.placeholder ?? C.common.search,
248
+ "aria-label": d.ariaLabel ?? d.placeholder ?? x.common.search,
214
249
  "aria-invalid": d.error ? !0 : void 0,
215
250
  disabled: p
216
251
  }),
217
- d.value && /* @__PURE__ */ _("button", {
252
+ d.value && /* @__PURE__ */ v("button", {
218
253
  type: "button",
219
254
  className: "select-filterbar__query-clear",
220
- "aria-label": C.filterBar.clearSearch,
255
+ "aria-label": x.filterBar.clearSearch,
221
256
  onClick: () => d.onChange(""),
222
- children: /* @__PURE__ */ _(n, {})
257
+ children: /* @__PURE__ */ v(n, {})
223
258
  }),
224
- d.onSubmit && /* @__PURE__ */ _("button", {
259
+ d.onSubmit && /* @__PURE__ */ v("button", {
225
260
  type: "button",
226
261
  className: "select-filterbar__query-submit",
227
262
  onClick: d.onSubmit,
228
263
  disabled: p,
229
- children: d.submitLabel ?? C.common.search
264
+ children: d.submitLabel ?? x.common.search
230
265
  })
231
266
  ]
232
267
  }),
233
- N.map((e) => /* @__PURE__ */ _(S, {
268
+ P.map((e) => /* @__PURE__ */ v(w, {
234
269
  filter: e,
235
270
  value: t[e.key] ?? "",
236
271
  onChange: (t) => o(e.key, t),
237
- open: E === e.key,
238
- onToggle: () => D((t) => t === e.key ? null : e.key),
239
- onClose: () => D((t) => t === e.key ? null : t),
272
+ open: D === e.key,
273
+ onToggle: () => O((t) => t === e.key ? null : e.key),
274
+ onClose: () => O((t) => t === e.key ? null : t),
240
275
  disabled: p
241
276
  }, e.key)),
242
- P.length > 0 && /* @__PURE__ */ _(l, {
243
- active: O,
244
- onClose: () => k(!1),
277
+ F.length > 0 && /* @__PURE__ */ v(l, {
278
+ active: k,
279
+ onClose: () => A(!1),
245
280
  placement: "bottom-start",
246
- activator: /* @__PURE__ */ v("button", {
281
+ activator: /* @__PURE__ */ y("button", {
247
282
  type: "button",
248
283
  className: "select-facet select-facet--more",
249
- onClick: () => k((e) => !e),
284
+ onClick: () => A((e) => !e),
250
285
  disabled: p,
251
- "aria-expanded": O,
252
- children: [/* @__PURE__ */ _("span", {
286
+ "aria-expanded": k,
287
+ children: [/* @__PURE__ */ v("span", {
253
288
  className: "select-facet__addicon",
254
289
  "aria-hidden": "true",
255
- children: /* @__PURE__ */ _(r, {})
256
- }), C.filterBar.moreFilters]
290
+ children: /* @__PURE__ */ v(r, {})
291
+ }), x.filterBar.moreFilters]
257
292
  }),
258
- children: /* @__PURE__ */ _("div", {
293
+ children: /* @__PURE__ */ v("div", {
259
294
  className: "select-facet__options",
260
295
  role: "menu",
261
- ref: A,
296
+ ref: j,
262
297
  onKeyDown: s,
263
- children: P.map((e) => /* @__PURE__ */ _("button", {
298
+ children: F.map((e) => /* @__PURE__ */ y("button", {
264
299
  type: "button",
265
300
  role: "menuitem",
266
301
  className: "select-facet__opt",
267
- onClick: () => L(e.key),
268
- children: /* @__PURE__ */ _("span", { children: e.label })
302
+ onClick: () => R(e.key),
303
+ children: [/* @__PURE__ */ v("span", { children: e.label }), e.custom ? /* @__PURE__ */ v(C, {}) : null]
269
304
  }, e.key))
270
305
  })
271
306
  })
272
307
  ]
273
308
  }),
274
- d != null && d.error ? /* @__PURE__ */ _("p", {
309
+ d != null && d.error ? /* @__PURE__ */ v("p", {
275
310
  className: "select-filterbar__query-error",
276
311
  role: "alert",
277
312
  children: d.error
278
313
  }) : null,
279
- F.length > 0 && /* @__PURE__ */ v("div", {
314
+ I.length > 0 && /* @__PURE__ */ y("div", {
280
315
  className: "select-filterbar__applied",
281
- children: [F.map((e) => /* @__PURE__ */ v("span", {
316
+ children: [I.map((e) => /* @__PURE__ */ y("span", {
282
317
  className: `select-filterbar__tag${e.error ? " is-error" : ""}`,
283
318
  title: e.error || void 0,
284
- children: [
285
- e.label,
286
- ": ",
287
- x(e, t[e.key] ?? ""),
288
- /* @__PURE__ */ _("button", {
289
- type: "button",
290
- className: "select-filterbar__tagx",
291
- "aria-label": C.filterBar.removeFilter(e.label),
292
- onClick: () => o(e.key, ""),
293
- children: /* @__PURE__ */ _(n, {})
294
- })
295
- ]
296
- }, e.key)), /* @__PURE__ */ _("button", {
319
+ children: [e.type === "toggle" ? e.label : `${e.label}: ${S(e, t[e.key] ?? "")}`, /* @__PURE__ */ v("button", {
320
+ type: "button",
321
+ className: "select-filterbar__tagx",
322
+ "aria-label": x.filterBar.removeFilter(e.label),
323
+ onClick: () => o(e.key, ""),
324
+ children: /* @__PURE__ */ v(n, {})
325
+ })]
326
+ }, e.key)), /* @__PURE__ */ v("button", {
297
327
  type: "button",
298
328
  className: "select-filterbar__clear",
299
- onClick: I,
300
- children: C.filterBar.clearAll
329
+ onClick: L,
330
+ children: x.filterBar.clearAll
301
331
  })]
302
332
  })
303
333
  ]
304
334
  });
305
335
  });
306
336
  //#endregion
307
- export { C as SelectFilterBar, b as joinFilterValues, y as splitFilterValues };
337
+ export { T as SelectFilterBar, x as joinFilterValues, b as splitFilterValues };
308
338
 
309
339
  //# sourceMappingURL=SelectFilterBar.js.map
@@ -6,9 +6,11 @@ export interface SelectImageUploadFieldProps {
6
6
  /** Controlled list of uploaded files (encoded to base64 by the caller at submit). */
7
7
  files: File[];
8
8
  onFilesChange: (files: File[]) => void;
9
- /** Controlled list of image URLs — pre-seed with existing images in edit mode. */
10
- urls: string[];
11
- onUrlsChange: (urls: string[]) => void;
9
+ /** Controlled list of image URLs — pre-seed with existing images in edit mode. 0.1.258: opcional (padrão vazio). */
10
+ urls?: string[];
11
+ onUrlsChange?: (urls: string[]) => void;
12
+ /** 0.1.258: `false` tira o campo "cole uma URL" — só o arquivo entra (o logo da marca). Padrão `true`. */
13
+ allowUrl?: boolean;
12
14
  accept?: string;
13
15
  /** Per-file size cap in MB. Default 3. */
14
16
  maxSizeMB?: number;
@@ -7,22 +7,22 @@ import { URL_RE as o, extOf as s, hostOf as c, isImageFile as l, matchesAccept a
7
7
  import { forwardRef as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
8
8
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
9
9
  //#region src/SelectImageUploadField.tsx
10
- var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x, urls: S, onUrlsChange: C, accept: w = ".jpg,.jpeg,.png,.webp", maxSizeMB: T = 3, maxItems: E = 10, maxFiles: D, uploadHint: O, urlPlaceholder: k, helpText: A, className: j, ...ee }, M) {
11
- let N = y === "single", P = h(null), [F, I] = g(!1), [L, R] = g(0), [z, B] = g(""), [V, H] = g(null), U = N ? 1 : Math.max(1, E), W = N ? 1 : D ?? U, G = b.length + S.length, K = N ? G === 0 : G < U && b.length < W, q = N ? G === 0 : G < U, J = G > 0, Y = T * 1024 * 1024, X = m(() => b.map((e) => l(e) ? URL.createObjectURL(e) : null), [b]);
10
+ var y = [], ee = () => void 0, b = f(function({ label: f, mode: b = "multiple", files: x, onFilesChange: S, urls: C = y, onUrlsChange: w = ee, allowUrl: T = !0, accept: E = ".jpg,.jpeg,.png,.webp", maxSizeMB: D = 3, maxItems: O = 10, maxFiles: te, uploadHint: ne, urlPlaceholder: re, helpText: k, className: A, ...j }, M) {
11
+ let N = b === "single", P = h(null), [F, I] = g(!1), [L, R] = g(0), [z, B] = g(""), [V, H] = g(null), U = N ? 1 : Math.max(1, O), W = N ? 1 : te ?? U, G = x.length + C.length, K = N ? G === 0 : G < U && x.length < W, q = T && (N ? G === 0 : G < U), J = G > 0, Y = D * 1024 * 1024, X = m(() => x.map((e) => l(e) ? URL.createObjectURL(e) : null), [x]);
12
12
  p(() => () => {
13
13
  X.forEach((e) => {
14
14
  e && URL.revokeObjectURL(e);
15
15
  });
16
16
  }, [X]);
17
17
  let Z = (e) => {
18
- let t = e.filter((e) => e.size <= Y && u(e, w));
18
+ let t = e.filter((e) => e.size <= Y && u(e, E));
19
19
  if (R(e.length - t.length), !t.length) return;
20
20
  if (N) {
21
- C([]), x(t.slice(0, 1));
21
+ w([]), S(t.slice(0, 1));
22
22
  return;
23
23
  }
24
- let n = Math.min(W - b.length, U - G);
25
- x([...b, ...t.slice(0, Math.max(0, n))]);
24
+ let n = Math.min(W - x.length, U - G);
25
+ S([...x, ...t.slice(0, Math.max(0, n))]);
26
26
  }, Q = () => {
27
27
  let e = z.trim();
28
28
  if (e) {
@@ -30,18 +30,18 @@ var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x,
30
30
  H("Insira uma URL válida (https://…).");
31
31
  return;
32
32
  }
33
- if (S.includes(e)) {
33
+ if (C.includes(e)) {
34
34
  H("Essa URL já foi adicionada.");
35
35
  return;
36
36
  }
37
- N ? (x([]), C([e])) : C([...S, e].slice(0, U)), B(""), H(null);
37
+ N ? (S([]), w([e])) : w([...C, e].slice(0, U)), B(""), H(null);
38
38
  }
39
- }, te = (e) => {
39
+ }, ie = (e) => {
40
40
  e.key === "Enter" && (e.preventDefault(), Q());
41
- }, ne = (e) => x(b.filter((t, n) => n !== e)), re = (e) => C(S.filter((t, n) => n !== e)), $ = () => {
41
+ }, ae = (e) => S(x.filter((t, n) => n !== e)), oe = (e) => w(C.filter((t, n) => n !== e)), $ = () => {
42
42
  var e;
43
43
  return (e = P.current) == null ? void 0 : e.click();
44
- }, ie = {
44
+ }, se = {
45
45
  onDragOver: (e) => {
46
46
  e.preventDefault(), I(!0);
47
47
  },
@@ -52,8 +52,8 @@ var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x,
52
52
  };
53
53
  return /* @__PURE__ */ v("div", {
54
54
  ref: M,
55
- ...ee,
56
- className: `select-field select-imageupload${j ? " " + j : ""}`,
55
+ ...j,
56
+ className: `select-field select-imageupload${A ? " " + A : ""}`,
57
57
  children: [
58
58
  f && /* @__PURE__ */ _("span", {
59
59
  className: "select-field__label",
@@ -61,22 +61,22 @@ var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x,
61
61
  }),
62
62
  /* @__PURE__ */ v("div", {
63
63
  className: `select-uploadzone${F ? " is-over" : ""}`,
64
- ...ie,
64
+ ...se,
65
65
  children: [
66
66
  J ? /* @__PURE__ */ v("div", {
67
67
  className: `select-filetile-grid${G === 1 ? " select-filetile-grid--single" : ""}`,
68
68
  children: [
69
- b.map((e, t) => /* @__PURE__ */ _(a, {
69
+ x.map((e, t) => /* @__PURE__ */ _(a, {
70
70
  src: X[t] ?? void 0,
71
71
  docExt: s(e.name),
72
72
  name: e.name,
73
73
  sub: d(e.size),
74
- onRemove: () => ne(t)
74
+ onRemove: () => ae(t)
75
75
  }, `f-${e.name}-${t}`)),
76
- S.map((e, t) => /* @__PURE__ */ _(a, {
76
+ C.map((e, t) => /* @__PURE__ */ _(a, {
77
77
  src: e,
78
78
  name: c(e),
79
- onRemove: () => re(t)
79
+ onRemove: () => oe(t)
80
80
  }, `u-${e}-${t}`)),
81
81
  K && /* @__PURE__ */ v("button", {
82
82
  type: "button",
@@ -89,7 +89,7 @@ var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x,
89
89
  type: "button",
90
90
  className: "select-uploadzone__prompt",
91
91
  onClick: $,
92
- children: [/* @__PURE__ */ _(n, {}), /* @__PURE__ */ _("span", { children: O ?? `Arraste ou selecione um arquivo · até ${T} MB` })]
92
+ children: [/* @__PURE__ */ _(n, {}), /* @__PURE__ */ _("span", { children: ne ?? `Arraste ou selecione um arquivo · até ${D} MB` })]
93
93
  }),
94
94
  q && /* @__PURE__ */ v("div", {
95
95
  className: "select-uploadzone__url",
@@ -103,10 +103,10 @@ var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x,
103
103
  onChange: (e) => {
104
104
  B(e), V && H(null);
105
105
  },
106
- onKeyDown: te,
106
+ onKeyDown: ie,
107
107
  type: "url",
108
108
  inputMode: "url",
109
- placeholder: k ?? "ou cole uma URL (https://…)",
109
+ placeholder: re ?? "ou cole uma URL (https://…)",
110
110
  error: V ?? void 0,
111
111
  autoComplete: "off"
112
112
  })
@@ -124,7 +124,7 @@ var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x,
124
124
  /* @__PURE__ */ _("input", {
125
125
  ref: P,
126
126
  type: "file",
127
- accept: w,
127
+ accept: E,
128
128
  multiple: !N,
129
129
  hidden: !0,
130
130
  onChange: (e) => {
@@ -138,18 +138,18 @@ var y = f(function({ label: f, mode: y = "multiple", files: b, onFilesChange: x,
138
138
  children: [
139
139
  L,
140
140
  " arquivo(s) ignorado(s): tipo não permitido ou acima de ",
141
- T,
141
+ D,
142
142
  " MB."
143
143
  ]
144
144
  }),
145
- A != null && /* @__PURE__ */ _("p", {
145
+ k != null && /* @__PURE__ */ _("p", {
146
146
  className: "select-field__hint",
147
- children: A
147
+ children: k
148
148
  })
149
149
  ]
150
150
  });
151
151
  });
152
152
  //#endregion
153
- export { y as SelectImageUploadField };
153
+ export { b as SelectImageUploadField };
154
154
 
155
155
  //# sourceMappingURL=SelectImageUploadField.js.map
@@ -11,6 +11,13 @@ export interface SelectKanbanColumn {
11
11
  description?: ReactNode;
12
12
  /** Aceita um card solto aqui. */
13
13
  droppable?: boolean;
14
+ /**
15
+ * 0.1.258: a coluna automática (a etapa que anda sozinha): o fundo distinto e o cadeado; não aceita o card solto e os
16
+ * cards dela não arrastam.
17
+ */
18
+ locked?: boolean;
19
+ /** 0.1.258: o que o leitor de tela ouve no cadeado (padrão: "automática"). */
20
+ lockedLabel?: string;
14
21
  /** Sem card nenhum. */
15
22
  empty?: ReactNode;
16
23
  /** Sob os cards (ex.: "Ver mais 12"). */
@@ -22,10 +29,15 @@ export interface SelectKanbanProps {
22
29
  columns: SelectKanbanColumn[];
23
30
  /** Um card foi solto em outra coluna que aceita. Sem `onMove`, nada arrasta. */
24
31
  onMove?: (cardId: string, fromColumnId: string, toColumnId: string) => void;
32
+ /**
33
+ * 0.1.258: o quadro ocupa a altura de quem o contém, e cada coluna rola os cards por dentro (o scroll padrão). Sem ele,
34
+ * as colunas crescem com os cards, como antes.
35
+ */
36
+ fill?: boolean;
25
37
  className?: string;
26
38
  'aria-label'?: string;
27
39
  }
28
- export declare function SelectKanban({ columns, onMove, className, 'aria-label': ariaLabel }: SelectKanbanProps): import("react").JSX.Element;
40
+ export declare function SelectKanban({ columns, onMove, fill, className, 'aria-label': ariaLabel }: SelectKanbanProps): import("react").JSX.Element;
29
41
  export interface SelectKanbanCardProps {
30
42
  id: string;
31
43
  title: ReactNode;