@selectwin/kit 0.1.262 → 0.1.264

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 (65) hide show
  1. package/README.md +74 -0
  2. package/dist/SelectActionMenu.d.ts +7 -1
  3. package/dist/SelectActionMenu.js +14 -13
  4. package/dist/SelectBlockBuilder.d.ts +63 -0
  5. package/dist/SelectBlockBuilder.js +370 -0
  6. package/dist/SelectCalendar.d.ts +68 -4
  7. package/dist/SelectCalendar.js +449 -279
  8. package/dist/SelectChannelPreview.d.ts +34 -5
  9. package/dist/SelectChannelPreview.js +167 -73
  10. package/dist/SelectChartCard.d.ts +13 -0
  11. package/dist/SelectChartCard.js +50 -30
  12. package/dist/SelectCombobox.d.ts +5 -0
  13. package/dist/SelectCombobox.js +77 -61
  14. package/dist/SelectConversationContext.d.ts +30 -0
  15. package/dist/SelectConversationContext.js +141 -0
  16. package/dist/SelectDatePicker.d.ts +4 -0
  17. package/dist/SelectDatePicker.js +78 -62
  18. package/dist/SelectDateRangeField.d.ts +6 -1
  19. package/dist/SelectDateRangeField.js +9 -8
  20. package/dist/SelectField.d.ts +7 -3
  21. package/dist/SelectField.js +71 -70
  22. package/dist/SelectFilterBar.d.ts +9 -0
  23. package/dist/SelectFilterBar.js +301 -179
  24. package/dist/SelectFunnel.d.ts +12 -2
  25. package/dist/SelectFunnel.js +193 -63
  26. package/dist/SelectHorizontalBar.d.ts +11 -1
  27. package/dist/SelectHorizontalBar.js +86 -35
  28. package/dist/SelectHtmlFrame.d.ts +3 -1
  29. package/dist/SelectHtmlFrame.js +4 -4
  30. package/dist/SelectIconButton.d.ts +2 -1
  31. package/dist/SelectIconButton.js +1 -1
  32. package/dist/SelectLocale.d.ts +146 -0
  33. package/dist/SelectLocale.js +363 -31
  34. package/dist/SelectMail.d.ts +80 -4
  35. package/dist/SelectMail.js +433 -300
  36. package/dist/SelectMailEditor.d.ts +35 -1
  37. package/dist/SelectMailEditor.js +347 -163
  38. package/dist/SelectNumberedList.d.ts +20 -2
  39. package/dist/SelectNumberedList.js +75 -17
  40. package/dist/SelectPopover.js +31 -18
  41. package/dist/SelectProgressBar.d.ts +22 -5
  42. package/dist/SelectProgressBar.js +70 -40
  43. package/dist/SelectRecordCard.d.ts +13 -4
  44. package/dist/SelectRecordCard.js +30 -8
  45. package/dist/SelectRuleBuilder.d.ts +52 -0
  46. package/dist/SelectRuleBuilder.js +157 -0
  47. package/dist/SelectSearchPreview.d.ts +35 -0
  48. package/dist/SelectSearchPreview.js +69 -0
  49. package/dist/SelectSegmented.d.ts +2 -0
  50. package/dist/SelectSegmented.js +1 -1
  51. package/dist/SelectSortable.d.ts +5 -1
  52. package/dist/SelectSparkBars.d.ts +5 -1
  53. package/dist/SelectSparkBars.js +65 -57
  54. package/dist/SelectSteps.d.ts +6 -0
  55. package/dist/SelectSteps.js +43 -10
  56. package/dist/SelectTabs.d.ts +16 -4
  57. package/dist/SelectTabs.js +95 -60
  58. package/dist/SelectTextarea.d.ts +1 -1
  59. package/dist/SelectVoiceNote.d.ts +6 -1
  60. package/dist/SelectVoiceNote.js +118 -106
  61. package/dist/chartUtils.d.ts +10 -0
  62. package/dist/index.d.ts +18 -2
  63. package/dist/index.js +153 -149
  64. package/dist/style.css +1 -1
  65. package/package.json +1 -1
@@ -1,339 +1,461 @@
1
- import { CheckIcon as e, ChevronDownIcon as t, CloseIcon as n, FilterIcon as r, SearchIcon as i } from "./icons.js";
2
- import { useSelectMessages as a } from "./SelectLocale.js";
3
- import { SelectField as o } from "./SelectField.js";
4
- import { moveInOptions as s, useOptionListFocus as c } from "./internal/optionList.js";
5
- import { SelectPopover as l } from "./SelectPopover.js";
6
- import { SelectDateField as u } from "./SelectDateField.js";
7
- import { SelectSearchInput as d } from "./SelectSearchInput.js";
8
- import { formatDateValue as f } from "./internal/dateValue.js";
9
- import { forwardRef as p, useEffect as m, useRef as h, useState as g } from "react";
10
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
1
+ import { SelectButton as e } from "./SelectButton.js";
2
+ import { CheckIcon as t, ChevronDownIcon as n, CloseIcon as r, FilterIcon as i, SearchIcon as a } from "./icons.js";
3
+ import { useSelectMessages as o } from "./SelectLocale.js";
4
+ import { SelectField as s } from "./SelectField.js";
5
+ import { moveInOptions as c, useOptionListFocus as l } from "./internal/optionList.js";
6
+ import { SelectPopover as u } from "./SelectPopover.js";
7
+ import { SelectDateField as d } from "./SelectDateField.js";
8
+ import { SelectSearchInput as f } from "./SelectSearchInput.js";
9
+ import { SelectModal as p, SelectModalActions as m } from "./SelectModal.js";
10
+ import { formatDateValue as h } from "./internal/dateValue.js";
11
+ import { forwardRef as g, useEffect as _, useRef as v, useState as y } from "react";
12
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
11
13
  //#region src/SelectFilterBar.tsx
12
- function b(e) {
14
+ function C(e) {
13
15
  return (e ?? "").split(",").map((e) => e.trim()).filter(Boolean);
14
16
  }
15
- function x(e, t) {
17
+ function w(e, t) {
16
18
  let n = new Set(e);
17
19
  return (t ? t.map((e) => e.value).filter((e) => n.has(e)) : [...n]).join(",");
18
20
  }
19
- function S(e, t) {
21
+ function T(e, t) {
20
22
  var n;
21
23
  if (e.type === "toggle") return "";
22
24
  if (e.type === "select") return ((n = e.options) == null || (n = n.find((e) => e.value === t)) == null ? void 0 : n.label) ?? t;
23
25
  if (e.type === "multiselect") {
24
- let n = b(t).map((t) => {
26
+ let n = C(t).map((t) => {
25
27
  var n;
26
28
  return ((n = e.options) == null || (n = n.find((e) => e.value === t)) == null ? void 0 : n.label) ?? t;
27
29
  });
28
30
  return n.length > 2 ? `${n[0]} +${n.length - 1}` : n.join(", ");
29
31
  }
30
- return e.type === "date" ? f(t) ?? t : t;
32
+ return e.type === "date" ? h(t) ?? t : t;
31
33
  }
32
- function C() {
33
- let e = a().filterBar;
34
- return /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("span", {
34
+ function E() {
35
+ let e = o().filterBar;
36
+ return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("span", {
35
37
  className: "select-facet__badge",
36
38
  "aria-hidden": "true",
37
39
  children: e.customField
38
- }), /* @__PURE__ */ v("span", {
40
+ }), /* @__PURE__ */ x("span", {
39
41
  className: "select-visually-hidden",
40
42
  children: ` (${e.customFieldLabel})`
41
43
  })] });
42
44
  }
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(() => {
45
+ function D({ filter: e, value: r, onChange: a, open: p, onToggle: m, onClose: h, disabled: g }) {
46
+ let b = o(), [D, O] = y(""), k = v(null);
47
+ l(p && (e.type === "select" || e.type === "multiselect"), k), _(() => {
46
48
  p || O("");
47
49
  }, [p]);
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
+ let A = r.trim() !== "", j = A ? T(e, r) : null, M = A && !!e.error, N = e.options ?? [], P = N.length > 7, F = P ? N.filter((e) => e.label.toLowerCase().includes(D.trim().toLowerCase())) : N;
51
+ return e.type === "toggle" ? /* @__PURE__ */ S("button", {
50
52
  type: "button",
51
53
  className: `select-facet select-facet--toggle${A ? " is-active" : ""}${M ? " is-error" : ""}`,
52
54
  "aria-pressed": A,
53
55
  "aria-invalid": M || void 0,
54
- title: M ? n.error : void 0,
55
- disabled: T,
56
- onClick: () => f(A ? "" : n.toggleValue ?? "true"),
56
+ title: M ? e.error : void 0,
57
+ disabled: g,
58
+ onClick: () => a(A ? "" : e.toggleValue ?? "true"),
57
59
  children: [
58
- /* @__PURE__ */ v("span", {
60
+ /* @__PURE__ */ x("span", {
59
61
  className: "select-facet__addicon",
60
62
  "aria-hidden": "true",
61
- children: v(A ? e : r, {})
63
+ children: x(A ? t : i, {})
62
64
  }),
63
- /* @__PURE__ */ v("span", {
65
+ /* @__PURE__ */ x("span", {
64
66
  className: "select-facet__label",
65
- children: n.label
67
+ children: e.label
66
68
  }),
67
- n.custom ? /* @__PURE__ */ v(C, {}) : null
69
+ e.custom ? /* @__PURE__ */ x(E, {}) : null
68
70
  ]
69
- }) : /* @__PURE__ */ y(l, {
71
+ }) : /* @__PURE__ */ S(u, {
70
72
  active: p,
71
- onClose: w,
73
+ onClose: h,
72
74
  placement: "bottom-start",
73
- activator: /* @__PURE__ */ y("button", {
75
+ activator: /* @__PURE__ */ S("button", {
74
76
  type: "button",
75
77
  className: `select-facet${A ? " is-active" : ""}${M ? " is-error" : ""}`,
76
- onClick: _,
77
- disabled: T,
78
+ onClick: m,
79
+ disabled: g,
78
80
  "aria-expanded": p,
79
81
  "aria-invalid": M || void 0,
80
- title: M ? n.error : void 0,
82
+ title: M ? e.error : void 0,
81
83
  children: [
82
- /* @__PURE__ */ v("span", {
84
+ /* @__PURE__ */ x("span", {
83
85
  className: "select-facet__addicon",
84
86
  "aria-hidden": "true",
85
- children: /* @__PURE__ */ v(r, {})
87
+ children: /* @__PURE__ */ x(i, {})
86
88
  }),
87
- /* @__PURE__ */ v("span", {
89
+ /* @__PURE__ */ x("span", {
88
90
  className: "select-facet__label",
89
- children: j == null ? n.label : `${n.label}: ${j}`
91
+ children: j == null ? e.label : `${e.label}: ${j}`
90
92
  }),
91
- n.custom ? /* @__PURE__ */ v(C, {}) : null,
92
- /* @__PURE__ */ v("span", {
93
+ e.custom ? /* @__PURE__ */ x(E, {}) : null,
94
+ /* @__PURE__ */ x("span", {
93
95
  className: `select-facet__caret${p ? " is-open" : ""}`,
94
96
  "aria-hidden": "true",
95
- children: /* @__PURE__ */ v(t, {})
97
+ children: /* @__PURE__ */ x(n, {})
96
98
  })
97
99
  ]
98
100
  }),
99
101
  children: [
100
- n.type === "multiselect" ? /* @__PURE__ */ y("div", {
102
+ e.type === "multiselect" ? /* @__PURE__ */ S("div", {
101
103
  className: "select-facet__panel",
102
104
  ref: k,
103
- onKeyDown: s,
104
- children: [P && /* @__PURE__ */ v("div", {
105
+ onKeyDown: c,
106
+ children: [P && /* @__PURE__ */ x("div", {
105
107
  className: "select-facet__search",
106
- children: /* @__PURE__ */ v(d, {
108
+ children: /* @__PURE__ */ x(f, {
107
109
  value: D,
108
110
  onChange: O,
109
- placeholder: E.filterBar.searchOption
111
+ placeholder: b.filterBar.searchOption
110
112
  })
111
- }), /* @__PURE__ */ v("div", {
113
+ }), /* @__PURE__ */ x("div", {
112
114
  className: "select-facet__options",
113
115
  role: "listbox",
114
116
  "aria-multiselectable": "true",
115
- children: F.length === 0 ? /* @__PURE__ */ v("div", {
117
+ children: F.length === 0 ? /* @__PURE__ */ x("div", {
116
118
  className: "select-facet__empty",
117
- children: E.common.nothingFound
118
- }) : F.map((t) => {
119
- let n = b(i), r = n.includes(t.value);
120
- return /* @__PURE__ */ y("button", {
119
+ children: b.common.nothingFound
120
+ }) : F.map((e) => {
121
+ let n = C(r), i = n.includes(e.value);
122
+ return /* @__PURE__ */ S("button", {
121
123
  type: "button",
122
124
  role: "option",
123
- "aria-selected": r,
125
+ "aria-selected": i,
124
126
  className: "select-facet__opt",
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", {
127
+ onClick: () => a(w(i ? n.filter((t) => t !== e.value) : [...n, e.value], N)),
128
+ children: [/* @__PURE__ */ x("span", { children: e.label }), i && /* @__PURE__ */ x("span", {
127
129
  className: "select-facet__check",
128
130
  "aria-hidden": "true",
129
- children: /* @__PURE__ */ v(e, {})
131
+ children: /* @__PURE__ */ x(t, {})
130
132
  })]
131
- }, t.value);
133
+ }, e.value);
132
134
  })
133
135
  })]
134
- }) : n.type === "select" ? /* @__PURE__ */ y("div", {
136
+ }) : e.type === "select" ? /* @__PURE__ */ S("div", {
135
137
  className: "select-facet__panel",
136
138
  ref: k,
137
- onKeyDown: s,
138
- children: [P && /* @__PURE__ */ v("div", {
139
+ onKeyDown: c,
140
+ children: [P && /* @__PURE__ */ x("div", {
139
141
  className: "select-facet__search",
140
- children: /* @__PURE__ */ v(d, {
142
+ children: /* @__PURE__ */ x(f, {
141
143
  value: D,
142
144
  onChange: O,
143
- placeholder: E.filterBar.searchOption
145
+ placeholder: b.filterBar.searchOption
144
146
  })
145
- }), /* @__PURE__ */ v("div", {
147
+ }), /* @__PURE__ */ x("div", {
146
148
  className: "select-facet__options",
147
149
  role: "listbox",
148
- children: F.length === 0 ? /* @__PURE__ */ v("div", {
150
+ children: F.length === 0 ? /* @__PURE__ */ x("div", {
149
151
  className: "select-facet__empty",
150
- children: E.common.nothingFound
151
- }) : F.map((t) => {
152
- let n = i === t.value;
153
- return /* @__PURE__ */ y("button", {
152
+ children: b.common.nothingFound
153
+ }) : F.map((e) => {
154
+ let n = r === e.value;
155
+ return /* @__PURE__ */ S("button", {
154
156
  type: "button",
155
157
  role: "option",
156
158
  "aria-selected": n,
157
159
  className: `select-facet__opt${n ? " is-selected" : ""}`,
158
160
  onClick: () => {
159
- f(n ? "" : t.value), w();
161
+ a(n ? "" : e.value), h();
160
162
  },
161
- children: [/* @__PURE__ */ v("span", { children: t.label }), n && /* @__PURE__ */ v("span", {
163
+ children: [/* @__PURE__ */ x("span", { children: e.label }), n && /* @__PURE__ */ x("span", {
162
164
  className: "select-facet__check",
163
165
  "aria-hidden": "true",
164
- children: /* @__PURE__ */ v(e, {})
166
+ children: /* @__PURE__ */ x(t, {})
165
167
  })]
166
- }, t.value);
168
+ }, e.value);
167
169
  })
168
170
  })]
169
- }) : n.type === "date" ? /* @__PURE__ */ v("div", {
171
+ }) : e.type === "date" ? /* @__PURE__ */ x("div", {
170
172
  className: "select-facet__field",
171
- children: /* @__PURE__ */ v(u, {
172
- value: i,
173
- onChange: f,
174
- placeholder: n.placeholder,
173
+ children: /* @__PURE__ */ x(d, {
174
+ value: r,
175
+ onChange: a,
176
+ placeholder: e.placeholder,
175
177
  clearable: !1
176
178
  })
177
- }) : /* @__PURE__ */ v("div", {
179
+ }) : /* @__PURE__ */ x("div", {
178
180
  className: "select-facet__field",
179
181
  onKeyDown: (e) => {
180
- e.key === "Enter" && (e.preventDefault(), w());
182
+ e.key === "Enter" && (e.preventDefault(), h());
181
183
  },
182
- children: /* @__PURE__ */ v(o, {
184
+ children: /* @__PURE__ */ x(s, {
183
185
  type: "text",
184
- value: i,
185
- onChange: f,
186
- placeholder: n.placeholder,
186
+ value: r,
187
+ onChange: a,
188
+ placeholder: e.placeholder,
187
189
  autoFocus: !0
188
190
  })
189
191
  }),
190
- M && /* @__PURE__ */ v("div", {
192
+ M && /* @__PURE__ */ x("div", {
191
193
  className: "select-facet__error",
192
194
  role: "alert",
193
- children: n.error
195
+ children: e.error
194
196
  }),
195
- A && /* @__PURE__ */ v("div", {
197
+ A && /* @__PURE__ */ x("div", {
196
198
  className: "select-facet__foot",
197
- children: /* @__PURE__ */ v("button", {
199
+ children: /* @__PURE__ */ x("button", {
198
200
  type: "button",
199
201
  className: "select-facet__clear",
200
202
  onClick: () => {
201
- f(""), w();
203
+ a(""), h();
202
204
  },
203
- children: E.filterBar.clear
205
+ children: b.filterBar.clear
204
206
  })
205
207
  })
206
208
  ]
207
209
  });
208
210
  }
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);
211
+ function O({ filter: e, value: n, onChange: r, disabled: i }) {
212
+ let a = n.trim() !== "";
213
+ if (e.type === "toggle") return /* @__PURE__ */ S("button", {
214
+ type: "button",
215
+ role: "switch",
216
+ "aria-checked": a,
217
+ className: `select-facet__opt select-filterbar__sheetopt${a ? " is-selected" : ""}`,
218
+ disabled: i,
219
+ onClick: () => r(a ? "" : e.toggleValue ?? "true"),
220
+ children: [/* @__PURE__ */ S("span", { children: [e.label, e.custom ? /* @__PURE__ */ x(E, {}) : null] }), a ? /* @__PURE__ */ x("span", {
221
+ className: "select-facet__check",
222
+ "aria-hidden": "true",
223
+ children: /* @__PURE__ */ x(t, {})
224
+ }) : null]
225
+ });
226
+ let o = `select-filterbar-sheet-${e.key}`, c = /* @__PURE__ */ S("div", {
227
+ className: "select-filterbar__sheetlabel",
228
+ id: o,
229
+ children: [e.label, e.custom ? /* @__PURE__ */ x(E, {}) : null]
230
+ });
231
+ if (e.type === "select" || e.type === "multiselect") {
232
+ let s = e.type === "multiselect", l = s ? C(n) : [n];
233
+ return /* @__PURE__ */ S("div", {
234
+ className: "select-filterbar__sheetgroup",
235
+ children: [
236
+ c,
237
+ /* @__PURE__ */ x("div", {
238
+ className: "select-filterbar__sheetopts",
239
+ role: s ? "group" : "radiogroup",
240
+ "aria-labelledby": o,
241
+ children: (e.options ?? []).map((n) => {
242
+ let a = l.includes(n.value);
243
+ return /* @__PURE__ */ S("button", {
244
+ type: "button",
245
+ role: s ? "checkbox" : "radio",
246
+ "aria-checked": a,
247
+ className: `select-facet__opt select-filterbar__sheetopt${a ? " is-selected" : ""}`,
248
+ disabled: i,
249
+ onClick: () => r(s ? w(a ? l.filter((e) => e !== n.value) : [...l, n.value], e.options) : a ? "" : n.value),
250
+ children: [/* @__PURE__ */ x("span", { children: n.label }), a ? /* @__PURE__ */ x("span", {
251
+ className: "select-facet__check",
252
+ "aria-hidden": "true",
253
+ children: /* @__PURE__ */ x(t, {})
254
+ }) : null]
255
+ }, n.value);
256
+ })
257
+ }),
258
+ a && e.error ? /* @__PURE__ */ x("div", {
259
+ className: "select-facet__error",
260
+ role: "alert",
261
+ children: e.error
262
+ }) : null
263
+ ]
264
+ });
265
+ }
266
+ return /* @__PURE__ */ x("div", {
267
+ className: "select-filterbar__sheetgroup",
268
+ children: e.type === "date" ? /* @__PURE__ */ x(d, {
269
+ label: e.label,
270
+ value: n,
271
+ onChange: r,
272
+ placeholder: e.placeholder,
273
+ disabled: i,
274
+ error: a ? e.error : void 0
275
+ }) : /* @__PURE__ */ x(s, {
276
+ label: e.label,
277
+ type: "text",
278
+ value: n,
279
+ onChange: r,
280
+ placeholder: e.placeholder,
281
+ disabled: i,
282
+ error: a ? e.error : void 0
283
+ })
284
+ });
285
+ }
286
+ var k = g(function({ filters: t, values: n, onChange: s, onClearAll: d, search: f, leading: h, disabled: g, phone: _ = "inline", sheetTitle: b, resultsLabel: C, className: w, ...k }, j) {
287
+ let M = o(), N = _ === "sheet", [P, F] = y(!1), [I, L] = y([]), [R, z] = y(null), [B, V] = y(!1), H = v(null);
288
+ l(B, H);
289
+ let U = (e) => (n[e.key] ?? "").trim() !== "", W = (e) => !!e.pinned || U(e) || I.includes(e.key), G = t.filter(W), K = t.filter((e) => !W(e)), q = t.filter(U), J = () => {
290
+ L([]), z(null), d();
291
+ }, Y = (e) => {
292
+ L((t) => t.includes(e) ? t : [...t, e]), V(!1);
293
+ let n = t.find((t) => t.key === e);
294
+ (n == null ? void 0 : n.type) === "toggle" ? s(e, n.toggleValue ?? "true") : z(e);
218
295
  };
219
- return /* @__PURE__ */ y("div", {
220
- ref: b,
221
- ..._,
222
- className: `select-filterbar${m ? " " + m : ""}`,
296
+ return /* @__PURE__ */ S("div", {
297
+ ref: j,
298
+ ...k,
299
+ className: `select-filterbar${N ? " select-filterbar--sheet" : ""}${w ? " " + w : ""}`,
223
300
  children: [
224
- /* @__PURE__ */ y("div", {
301
+ /* @__PURE__ */ S("div", {
225
302
  className: "select-filterbar__row",
226
303
  children: [
227
- f,
228
- d && /* @__PURE__ */ y("div", {
229
- className: `select-filterbar__query${d.error ? " select-filterbar__query--error" : ""}`,
304
+ h,
305
+ f && /* @__PURE__ */ S("div", {
306
+ className: `select-filterbar__query${f.error ? " select-filterbar__query--error" : ""}`,
230
307
  children: [
231
- /* @__PURE__ */ v("span", {
308
+ /* @__PURE__ */ x("span", {
232
309
  className: "select-filterbar__query-icon",
233
310
  "aria-hidden": "true",
234
- children: /* @__PURE__ */ v(i, {})
311
+ children: /* @__PURE__ */ x(a, {})
235
312
  }),
236
- /* @__PURE__ */ v("input", {
313
+ /* @__PURE__ */ x("input", {
237
314
  className: "select-filterbar__query-input",
238
315
  type: "search",
239
- value: d.value,
240
- placeholder: d.placeholder ?? x.common.searchPlaceholder,
241
- onChange: (e) => d.onChange(e.target.value),
242
- onKeyDown: d.onSubmit ? (e) => {
316
+ value: f.value,
317
+ placeholder: f.placeholder ?? M.common.searchPlaceholder,
318
+ onChange: (e) => f.onChange(e.target.value),
319
+ onKeyDown: f.onSubmit ? (e) => {
243
320
  if (e.key === "Enter") {
244
321
  var t;
245
- e.preventDefault(), (t = d.onSubmit) == null || t.call(d);
322
+ e.preventDefault(), (t = f.onSubmit) == null || t.call(f);
246
323
  }
247
324
  } : void 0,
248
- "aria-label": d.ariaLabel ?? d.placeholder ?? x.common.search,
249
- "aria-invalid": d.error ? !0 : void 0,
250
- disabled: p
325
+ "aria-label": f.ariaLabel ?? f.placeholder ?? M.common.search,
326
+ "aria-invalid": f.error ? !0 : void 0,
327
+ disabled: g
251
328
  }),
252
- d.value && /* @__PURE__ */ v("button", {
329
+ f.value && /* @__PURE__ */ x("button", {
253
330
  type: "button",
254
331
  className: "select-filterbar__query-clear",
255
- "aria-label": x.filterBar.clearSearch,
256
- onClick: () => d.onChange(""),
257
- children: /* @__PURE__ */ v(n, {})
332
+ "aria-label": M.filterBar.clearSearch,
333
+ onClick: () => f.onChange(""),
334
+ children: /* @__PURE__ */ x(r, {})
258
335
  }),
259
- d.onSubmit && /* @__PURE__ */ v("button", {
336
+ f.onSubmit && /* @__PURE__ */ x("button", {
260
337
  type: "button",
261
338
  className: "select-filterbar__query-submit",
262
- onClick: d.onSubmit,
263
- disabled: p,
264
- children: d.submitLabel ?? x.common.search
339
+ onClick: f.onSubmit,
340
+ disabled: g,
341
+ children: f.submitLabel ?? M.common.search
265
342
  })
266
343
  ]
267
344
  }),
268
- P.map((e) => /* @__PURE__ */ v(w, {
269
- filter: e,
270
- value: t[e.key] ?? "",
271
- onChange: (t) => o(e.key, 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),
275
- disabled: p
276
- }, e.key)),
277
- F.length > 0 && /* @__PURE__ */ v(l, {
278
- active: k,
279
- onClose: () => A(!1),
280
- placement: "bottom-start",
281
- activator: /* @__PURE__ */ y("button", {
282
- type: "button",
283
- className: "select-facet select-facet--more",
284
- onClick: () => A((e) => !e),
285
- disabled: p,
286
- "aria-expanded": k,
287
- children: [/* @__PURE__ */ v("span", {
288
- className: "select-facet__addicon",
289
- "aria-hidden": "true",
290
- children: /* @__PURE__ */ v(r, {})
291
- }), x.filterBar.moreFilters]
292
- }),
293
- children: /* @__PURE__ */ v("div", {
294
- className: "select-facet__options",
295
- role: "menu",
296
- ref: j,
297
- onKeyDown: s,
298
- children: F.map((e) => /* @__PURE__ */ y("button", {
345
+ N ? /* @__PURE__ */ S("button", {
346
+ type: "button",
347
+ className: `select-filterbar__sheetbtn${q.length > 0 ? " is-active" : ""}`,
348
+ "aria-haspopup": "dialog",
349
+ "aria-expanded": P,
350
+ disabled: g,
351
+ onClick: () => F(!0),
352
+ children: [/* @__PURE__ */ x("span", {
353
+ className: "select-facet__addicon",
354
+ "aria-hidden": "true",
355
+ children: /* @__PURE__ */ x(i, {})
356
+ }), q.length > 0 ? M.filterBar.filtersCount(b ?? M.filterBar.filters, q.length) : b ?? M.filterBar.filters]
357
+ }) : null,
358
+ /* @__PURE__ */ S(A, {
359
+ on: N,
360
+ children: [G.map((e) => /* @__PURE__ */ x(D, {
361
+ filter: e,
362
+ value: n[e.key] ?? "",
363
+ onChange: (t) => s(e.key, t),
364
+ open: R === e.key,
365
+ onToggle: () => z((t) => t === e.key ? null : e.key),
366
+ onClose: () => z((t) => t === e.key ? null : t),
367
+ disabled: g
368
+ }, e.key)), K.length > 0 && /* @__PURE__ */ x(u, {
369
+ active: B,
370
+ onClose: () => V(!1),
371
+ placement: "bottom-start",
372
+ activator: /* @__PURE__ */ S("button", {
299
373
  type: "button",
300
- role: "menuitem",
301
- className: "select-facet__opt",
302
- onClick: () => R(e.key),
303
- children: [/* @__PURE__ */ v("span", { children: e.label }), e.custom ? /* @__PURE__ */ v(C, {}) : null]
304
- }, e.key))
305
- })
374
+ className: "select-facet select-facet--more",
375
+ onClick: () => V((e) => !e),
376
+ disabled: g,
377
+ "aria-expanded": B,
378
+ children: [/* @__PURE__ */ x("span", {
379
+ className: "select-facet__addicon",
380
+ "aria-hidden": "true",
381
+ children: /* @__PURE__ */ x(i, {})
382
+ }), M.filterBar.moreFilters]
383
+ }),
384
+ children: /* @__PURE__ */ x("div", {
385
+ className: "select-facet__options",
386
+ role: "menu",
387
+ ref: H,
388
+ onKeyDown: c,
389
+ children: K.map((e) => /* @__PURE__ */ S("button", {
390
+ type: "button",
391
+ role: "menuitem",
392
+ className: "select-facet__opt",
393
+ onClick: () => Y(e.key),
394
+ children: [/* @__PURE__ */ x("span", { children: e.label }), e.custom ? /* @__PURE__ */ x(E, {}) : null]
395
+ }, e.key))
396
+ })
397
+ })]
306
398
  })
307
399
  ]
308
400
  }),
309
- d != null && d.error ? /* @__PURE__ */ v("p", {
401
+ f != null && f.error ? /* @__PURE__ */ x("p", {
310
402
  className: "select-filterbar__query-error",
311
403
  role: "alert",
312
- children: d.error
404
+ children: f.error
313
405
  }) : null,
314
- I.length > 0 && /* @__PURE__ */ y("div", {
406
+ q.length > 0 && /* @__PURE__ */ S("div", {
315
407
  className: "select-filterbar__applied",
316
- children: [I.map((e) => /* @__PURE__ */ y("span", {
408
+ children: [q.map((e) => /* @__PURE__ */ S("span", {
317
409
  className: `select-filterbar__tag${e.error ? " is-error" : ""}`,
318
410
  title: e.error || void 0,
319
- children: [e.type === "toggle" ? e.label : `${e.label}: ${S(e, t[e.key] ?? "")}`, /* @__PURE__ */ v("button", {
411
+ children: [e.type === "toggle" ? e.label : `${e.label}: ${T(e, n[e.key] ?? "")}`, /* @__PURE__ */ x("button", {
320
412
  type: "button",
321
413
  className: "select-filterbar__tagx",
322
- "aria-label": x.filterBar.removeFilter(e.label),
323
- onClick: () => o(e.key, ""),
324
- children: /* @__PURE__ */ v(n, {})
414
+ "aria-label": M.filterBar.removeFilter(e.label),
415
+ onClick: () => s(e.key, ""),
416
+ children: /* @__PURE__ */ x(r, {})
325
417
  })]
326
- }, e.key)), /* @__PURE__ */ v("button", {
418
+ }, e.key)), /* @__PURE__ */ x("button", {
327
419
  type: "button",
328
420
  className: "select-filterbar__clear",
329
- onClick: L,
330
- children: x.filterBar.clearAll
421
+ onClick: J,
422
+ children: M.filterBar.clearAll
331
423
  })]
332
- })
424
+ }),
425
+ N ? /* @__PURE__ */ x(p, {
426
+ open: P,
427
+ onClose: () => F(!1),
428
+ placement: "sheet",
429
+ title: b ?? M.filterBar.filters,
430
+ footer: /* @__PURE__ */ S(m, { children: [/* @__PURE__ */ x(e, {
431
+ variant: "secondary",
432
+ onClick: J,
433
+ disabled: g || q.length === 0,
434
+ children: M.filterBar.clearAll
435
+ }), /* @__PURE__ */ x(e, {
436
+ onClick: () => F(!1),
437
+ children: C ?? M.filterBar.showResults
438
+ })] }),
439
+ children: /* @__PURE__ */ x("div", {
440
+ className: "select-filterbar__sheet",
441
+ children: t.map((e) => /* @__PURE__ */ x(O, {
442
+ filter: e,
443
+ value: n[e.key] ?? "",
444
+ onChange: (t) => s(e.key, t),
445
+ disabled: g
446
+ }, e.key))
447
+ })
448
+ }) : null
333
449
  ]
334
450
  });
335
451
  });
452
+ function A({ on: e, children: t }) {
453
+ return e ? /* @__PURE__ */ x("span", {
454
+ className: "select-filterbar__facets",
455
+ children: t
456
+ }) : /* @__PURE__ */ x(b, { children: t });
457
+ }
336
458
  //#endregion
337
- export { T as SelectFilterBar, x as joinFilterValues, b as splitFilterValues };
459
+ export { k as SelectFilterBar, w as joinFilterValues, C as splitFilterValues };
338
460
 
339
461
  //# sourceMappingURL=SelectFilterBar.js.map