@selectwin/kit 0.1.256 → 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.
- package/README.md +57 -0
- package/dist/SelectActionList.d.ts +5 -0
- package/dist/SelectActionList.js +55 -39
- package/dist/SelectAppFrame.d.ts +8 -2
- package/dist/SelectAppFrame.js +124 -119
- package/dist/SelectAvatarGroup.d.ts +31 -0
- package/dist/SelectAvatarGroup.js +39 -0
- package/dist/SelectBadge.d.ts +1 -1
- package/dist/SelectChannelPreview.d.ts +15 -5
- package/dist/SelectChannelPreview.js +94 -54
- package/dist/SelectConversationNote.d.ts +37 -0
- package/dist/SelectConversationNote.js +93 -0
- package/dist/SelectFieldset.d.ts +14 -0
- package/dist/SelectFieldset.js +27 -0
- package/dist/SelectFilterBar.d.ts +6 -1
- package/dist/SelectFilterBar.js +153 -123
- package/dist/SelectImageUploadField.d.ts +5 -3
- package/dist/SelectImageUploadField.js +26 -26
- package/dist/SelectKanban.d.ts +13 -1
- package/dist/SelectKanban.js +72 -50
- package/dist/SelectLocale.d.ts +40 -0
- package/dist/SelectLocale.js +560 -511
- package/dist/SelectMail.d.ts +17 -2
- package/dist/SelectMail.js +9 -6
- package/dist/SelectModal.d.ts +10 -4
- package/dist/SelectModal.js +158 -137
- package/dist/SelectSegmented.d.ts +7 -0
- package/dist/SelectSegmented.js +51 -43
- package/dist/SelectSideNav.d.ts +2 -1
- package/dist/SelectSideNav.js +156 -135
- package/dist/SelectSortable.d.ts +47 -1
- package/dist/SelectSortable.js +138 -19
- package/dist/SelectSteps.d.ts +3 -0
- package/dist/SelectSteps.js +42 -31
- package/dist/SelectTimeline.d.ts +4 -0
- package/dist/SelectTimeline.js +20 -9
- package/dist/SelectTriggerMenu.d.ts +77 -0
- package/dist/SelectTriggerMenu.js +98 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +186 -182
- package/dist/internal/navCount.d.ts +21 -0
- package/dist/internal/navCount.js +27 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectFilterBar.js
CHANGED
|
@@ -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 {
|
|
10
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
11
11
|
//#region src/SelectFilterBar.tsx
|
|
12
|
-
function
|
|
12
|
+
function b(e) {
|
|
13
13
|
return (e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
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
|
|
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 =
|
|
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
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
37
|
-
return /* @__PURE__ */
|
|
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:
|
|
71
|
+
onClose: w,
|
|
40
72
|
placement: "bottom-start",
|
|
41
|
-
activator: /* @__PURE__ */
|
|
73
|
+
activator: /* @__PURE__ */ y("button", {
|
|
42
74
|
type: "button",
|
|
43
|
-
className: `select-facet${
|
|
44
|
-
onClick:
|
|
45
|
-
disabled:
|
|
75
|
+
className: `select-facet${A ? " is-active" : ""}${M ? " is-error" : ""}`,
|
|
76
|
+
onClick: _,
|
|
77
|
+
disabled: T,
|
|
46
78
|
"aria-expanded": p,
|
|
47
|
-
"aria-invalid":
|
|
48
|
-
title:
|
|
79
|
+
"aria-invalid": M || void 0,
|
|
80
|
+
title: M ? n.error : void 0,
|
|
49
81
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ v("span", {
|
|
51
83
|
className: "select-facet__addicon",
|
|
52
84
|
"aria-hidden": "true",
|
|
53
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ v(r, {})
|
|
54
86
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ v("span", {
|
|
56
88
|
className: "select-facet__label",
|
|
57
|
-
children:
|
|
89
|
+
children: j == null ? n.label : `${n.label}: ${j}`
|
|
58
90
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
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__ */
|
|
95
|
+
children: /* @__PURE__ */ v(t, {})
|
|
63
96
|
})
|
|
64
97
|
]
|
|
65
98
|
}),
|
|
66
99
|
children: [
|
|
67
|
-
n.type === "multiselect" ? /* @__PURE__ */
|
|
100
|
+
n.type === "multiselect" ? /* @__PURE__ */ y("div", {
|
|
68
101
|
className: "select-facet__panel",
|
|
69
|
-
ref:
|
|
102
|
+
ref: k,
|
|
70
103
|
onKeyDown: s,
|
|
71
|
-
children: [
|
|
104
|
+
children: [P && /* @__PURE__ */ v("div", {
|
|
72
105
|
className: "select-facet__search",
|
|
73
|
-
children: /* @__PURE__ */
|
|
74
|
-
value:
|
|
75
|
-
onChange:
|
|
76
|
-
placeholder:
|
|
106
|
+
children: /* @__PURE__ */ v(u, {
|
|
107
|
+
value: D,
|
|
108
|
+
onChange: O,
|
|
109
|
+
placeholder: E.filterBar.searchOption
|
|
77
110
|
})
|
|
78
|
-
}), /* @__PURE__ */
|
|
111
|
+
}), /* @__PURE__ */ v("div", {
|
|
79
112
|
className: "select-facet__options",
|
|
80
113
|
role: "listbox",
|
|
81
114
|
"aria-multiselectable": "true",
|
|
82
|
-
children:
|
|
115
|
+
children: F.length === 0 ? /* @__PURE__ */ v("div", {
|
|
83
116
|
className: "select-facet__empty",
|
|
84
|
-
children:
|
|
85
|
-
}) :
|
|
86
|
-
let n =
|
|
87
|
-
return /* @__PURE__ */
|
|
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(
|
|
93
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
129
|
+
children: /* @__PURE__ */ v(e, {})
|
|
97
130
|
})]
|
|
98
131
|
}, t.value);
|
|
99
132
|
})
|
|
100
133
|
})]
|
|
101
|
-
}) : n.type === "select" ? /* @__PURE__ */
|
|
134
|
+
}) : n.type === "select" ? /* @__PURE__ */ y("div", {
|
|
102
135
|
className: "select-facet__panel",
|
|
103
|
-
ref:
|
|
136
|
+
ref: k,
|
|
104
137
|
onKeyDown: s,
|
|
105
|
-
children: [
|
|
138
|
+
children: [P && /* @__PURE__ */ v("div", {
|
|
106
139
|
className: "select-facet__search",
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
value:
|
|
109
|
-
onChange:
|
|
110
|
-
placeholder:
|
|
140
|
+
children: /* @__PURE__ */ v(u, {
|
|
141
|
+
value: D,
|
|
142
|
+
onChange: O,
|
|
143
|
+
placeholder: E.filterBar.searchOption
|
|
111
144
|
})
|
|
112
|
-
}), /* @__PURE__ */
|
|
145
|
+
}), /* @__PURE__ */ v("div", {
|
|
113
146
|
className: "select-facet__options",
|
|
114
147
|
role: "listbox",
|
|
115
|
-
children:
|
|
148
|
+
children: F.length === 0 ? /* @__PURE__ */ v("div", {
|
|
116
149
|
className: "select-facet__empty",
|
|
117
|
-
children:
|
|
118
|
-
}) :
|
|
150
|
+
children: E.common.nothingFound
|
|
151
|
+
}) : F.map((t) => {
|
|
119
152
|
let n = i === t.value;
|
|
120
|
-
return /* @__PURE__ */
|
|
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),
|
|
159
|
+
f(n ? "" : t.value), w();
|
|
127
160
|
},
|
|
128
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
164
|
+
children: /* @__PURE__ */ v(e, {})
|
|
132
165
|
})]
|
|
133
166
|
}, t.value);
|
|
134
167
|
})
|
|
135
168
|
})]
|
|
136
|
-
}) : n.type === "date" ? /* @__PURE__ */
|
|
169
|
+
}) : n.type === "date" ? /* @__PURE__ */ v("div", {
|
|
137
170
|
className: "select-facet__field",
|
|
138
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
177
|
+
}) : /* @__PURE__ */ v("div", {
|
|
145
178
|
className: "select-facet__field",
|
|
146
179
|
onKeyDown: (e) => {
|
|
147
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
180
|
+
e.key === "Enter" && (e.preventDefault(), w());
|
|
148
181
|
},
|
|
149
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
190
|
+
M && /* @__PURE__ */ v("div", {
|
|
158
191
|
className: "select-facet__error",
|
|
159
192
|
role: "alert",
|
|
160
193
|
children: n.error
|
|
161
194
|
}),
|
|
162
|
-
|
|
195
|
+
A && /* @__PURE__ */ v("div", {
|
|
163
196
|
className: "select-facet__foot",
|
|
164
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ v("button", {
|
|
165
198
|
type: "button",
|
|
166
199
|
className: "select-facet__clear",
|
|
167
200
|
onClick: () => {
|
|
168
|
-
f(""),
|
|
201
|
+
f(""), w();
|
|
169
202
|
},
|
|
170
|
-
children:
|
|
203
|
+
children: E.filterBar.clear
|
|
171
204
|
})
|
|
172
205
|
})
|
|
173
206
|
]
|
|
174
207
|
});
|
|
175
208
|
}
|
|
176
|
-
var
|
|
177
|
-
let
|
|
178
|
-
c(
|
|
179
|
-
let
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
|
|
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__ */
|
|
219
|
+
return /* @__PURE__ */ y("div", {
|
|
185
220
|
ref: b,
|
|
186
|
-
...
|
|
221
|
+
..._,
|
|
187
222
|
className: `select-filterbar${m ? " " + m : ""}`,
|
|
188
223
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ y("div", {
|
|
190
225
|
className: "select-filterbar__row",
|
|
191
226
|
children: [
|
|
192
227
|
f,
|
|
193
|
-
d && /* @__PURE__ */
|
|
228
|
+
d && /* @__PURE__ */ y("div", {
|
|
194
229
|
className: `select-filterbar__query${d.error ? " select-filterbar__query--error" : ""}`,
|
|
195
230
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ v("span", {
|
|
197
232
|
className: "select-filterbar__query-icon",
|
|
198
233
|
"aria-hidden": "true",
|
|
199
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ v(i, {})
|
|
200
235
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ v("input", {
|
|
202
237
|
className: "select-filterbar__query-input",
|
|
203
238
|
type: "search",
|
|
204
239
|
value: d.value,
|
|
205
|
-
placeholder: d.placeholder ??
|
|
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 ??
|
|
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__ */
|
|
252
|
+
d.value && /* @__PURE__ */ v("button", {
|
|
218
253
|
type: "button",
|
|
219
254
|
className: "select-filterbar__query-clear",
|
|
220
|
-
"aria-label":
|
|
255
|
+
"aria-label": x.filterBar.clearSearch,
|
|
221
256
|
onClick: () => d.onChange(""),
|
|
222
|
-
children: /* @__PURE__ */
|
|
257
|
+
children: /* @__PURE__ */ v(n, {})
|
|
223
258
|
}),
|
|
224
|
-
d.onSubmit && /* @__PURE__ */
|
|
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 ??
|
|
264
|
+
children: d.submitLabel ?? x.common.search
|
|
230
265
|
})
|
|
231
266
|
]
|
|
232
267
|
}),
|
|
233
|
-
|
|
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:
|
|
238
|
-
onToggle: () =>
|
|
239
|
-
onClose: () =>
|
|
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
|
-
|
|
243
|
-
active:
|
|
244
|
-
onClose: () =>
|
|
277
|
+
F.length > 0 && /* @__PURE__ */ v(l, {
|
|
278
|
+
active: k,
|
|
279
|
+
onClose: () => A(!1),
|
|
245
280
|
placement: "bottom-start",
|
|
246
|
-
activator: /* @__PURE__ */
|
|
281
|
+
activator: /* @__PURE__ */ y("button", {
|
|
247
282
|
type: "button",
|
|
248
283
|
className: "select-facet select-facet--more",
|
|
249
|
-
onClick: () =>
|
|
284
|
+
onClick: () => A((e) => !e),
|
|
250
285
|
disabled: p,
|
|
251
|
-
"aria-expanded":
|
|
252
|
-
children: [/* @__PURE__ */
|
|
286
|
+
"aria-expanded": k,
|
|
287
|
+
children: [/* @__PURE__ */ v("span", {
|
|
253
288
|
className: "select-facet__addicon",
|
|
254
289
|
"aria-hidden": "true",
|
|
255
|
-
children: /* @__PURE__ */
|
|
256
|
-
}),
|
|
290
|
+
children: /* @__PURE__ */ v(r, {})
|
|
291
|
+
}), x.filterBar.moreFilters]
|
|
257
292
|
}),
|
|
258
|
-
children: /* @__PURE__ */
|
|
293
|
+
children: /* @__PURE__ */ v("div", {
|
|
259
294
|
className: "select-facet__options",
|
|
260
295
|
role: "menu",
|
|
261
|
-
ref:
|
|
296
|
+
ref: j,
|
|
262
297
|
onKeyDown: s,
|
|
263
|
-
children:
|
|
298
|
+
children: F.map((e) => /* @__PURE__ */ y("button", {
|
|
264
299
|
type: "button",
|
|
265
300
|
role: "menuitem",
|
|
266
301
|
className: "select-facet__opt",
|
|
267
|
-
onClick: () =>
|
|
268
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
314
|
+
I.length > 0 && /* @__PURE__ */ y("div", {
|
|
280
315
|
className: "select-filterbar__applied",
|
|
281
|
-
children: [
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
x(e
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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:
|
|
300
|
-
children:
|
|
329
|
+
onClick: L,
|
|
330
|
+
children: x.filterBar.clearAll
|
|
301
331
|
})]
|
|
302
332
|
})
|
|
303
333
|
]
|
|
304
334
|
});
|
|
305
335
|
});
|
|
306
336
|
//#endregion
|
|
307
|
-
export {
|
|
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
|
|
11
|
-
onUrlsChange
|
|
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:
|
|
11
|
-
let N =
|
|
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,
|
|
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
|
-
|
|
21
|
+
w([]), S(t.slice(0, 1));
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
let n = Math.min(W -
|
|
25
|
-
|
|
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 (
|
|
33
|
+
if (C.includes(e)) {
|
|
34
34
|
H("Essa URL já foi adicionada.");
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
N ? (
|
|
37
|
+
N ? (S([]), w([e])) : w([...C, e].slice(0, U)), B(""), H(null);
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, ie = (e) => {
|
|
40
40
|
e.key === "Enter" && (e.preventDefault(), Q());
|
|
41
|
-
},
|
|
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
|
-
},
|
|
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
|
-
...
|
|
56
|
-
className: `select-field select-imageupload${
|
|
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
|
-
...
|
|
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
|
-
|
|
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: () =>
|
|
74
|
+
onRemove: () => ae(t)
|
|
75
75
|
}, `f-${e.name}-${t}`)),
|
|
76
|
-
|
|
76
|
+
C.map((e, t) => /* @__PURE__ */ _(a, {
|
|
77
77
|
src: e,
|
|
78
78
|
name: c(e),
|
|
79
|
-
onRemove: () =>
|
|
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:
|
|
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:
|
|
106
|
+
onKeyDown: ie,
|
|
107
107
|
type: "url",
|
|
108
108
|
inputMode: "url",
|
|
109
|
-
placeholder:
|
|
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:
|
|
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
|
-
|
|
141
|
+
D,
|
|
142
142
|
" MB."
|
|
143
143
|
]
|
|
144
144
|
}),
|
|
145
|
-
|
|
145
|
+
k != null && /* @__PURE__ */ _("p", {
|
|
146
146
|
className: "select-field__hint",
|
|
147
|
-
children:
|
|
147
|
+
children: k
|
|
148
148
|
})
|
|
149
149
|
]
|
|
150
150
|
});
|
|
151
151
|
});
|
|
152
152
|
//#endregion
|
|
153
|
-
export {
|
|
153
|
+
export { b as SelectImageUploadField };
|
|
154
154
|
|
|
155
155
|
//# sourceMappingURL=SelectImageUploadField.js.map
|
package/dist/SelectKanban.d.ts
CHANGED
|
@@ -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;
|