@harpercollins/harpercollins-design-system 1.37.0 → 1.38.1

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.
@@ -1,153 +1,194 @@
1
- import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
- import { faFilter as I } from "../../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js";
3
- import r from "react";
4
- import C from "styled-components";
1
+ import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
+ import { faFilter as D } from "../../../../node_modules/.pnpm/@fortawesome_free-solid-svg-icons@6.7.2/node_modules/@fortawesome/free-solid-svg-icons/index.js";
3
+ import i from "react";
4
+ import y from "styled-components";
5
5
  import z from "../../../inputs/RadioButton/RadioButton.js";
6
- import D from "../../../navigation/Dropdown/Dropdown.js";
7
- import A from "../../../navigation/Menu/Menu.js";
8
- import R from "../../Icon/Icon.js";
6
+ import A from "../../../inputs/Textarea/Textarea.js";
7
+ import I from "../../../navigation/Dropdown/Dropdown.js";
8
+ import R from "../../../navigation/Menu/Menu.js";
9
+ import E from "../../Icon/Icon.js";
9
10
  import g from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Box/Box.js";
10
11
  import b from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/List/List.js";
11
- import F from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ListItem/ListItem.js";
12
- import E from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Checkbox/Checkbox.js";
12
+ import C from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/ListItem/ListItem.js";
13
+ import k from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Checkbox/Checkbox.js";
13
14
  import x from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Input/Input.js";
14
15
  import S from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Button/Button.js";
15
- import k from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Badge/Badge.js";
16
- import M from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuButton/MenuButton.js";
17
- import L from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/IconButton/IconButton.js";
16
+ import T from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/Badge/Badge.js";
17
+ import H from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/MenuButton/MenuButton.js";
18
+ import M from "../../../../node_modules/.pnpm/@mui_joy@5.0.0-beta.52_@emotion_react@11.14.0_@types_react@18.3.28_react@18.3.1__@emoti_58201694b486b0db36cbf79098c4edaa/node_modules/@mui/joy/IconButton/IconButton.js";
18
19
  function V(e) {
19
- const { header: i } = e.columnDef;
20
- return String(typeof i == "function" ? i({ column: e }) : i);
20
+ const { meta: o } = e.columnDef;
21
+ if (o?.filterLabel) return o.filterLabel;
22
+ const { header: t } = e.columnDef;
23
+ if (typeof t == "string") return t;
24
+ if (typeof t == "function") {
25
+ const l = t({ column: e });
26
+ return typeof l == "string" ? l : e.id;
27
+ }
28
+ return e.id;
21
29
  }
22
- const B = C(g)`
30
+ const L = y(g)`
23
31
  padding: 12px;
24
32
  min-width: 250px;
25
33
  display: flex;
26
34
  flex-direction: column;
27
35
  gap: 12px;
28
- `, H = C(g)`
36
+ `, K = y(g)`
29
37
  display: flex;
30
38
  justify-content: space-between;
31
39
  align-items: center;
32
40
  font-weight: 600;
33
41
  font-size: 14px;
34
42
  margin-bottom: 4px;
35
- `, T = C(g)`
43
+ `, B = y(g)`
36
44
  display: flex;
37
45
  gap: 8px;
38
46
  justify-content: flex-end;
39
47
  margin-top: 8px;
40
48
  padding-top: 8px;
41
49
  border-top: 1px solid var(--palette-divider);
50
+ `, O = y(g)`
51
+ font-size: 12px;
52
+ color: var(--palette-text-tertiary);
53
+ margin-top: -6px;
42
54
  `;
43
55
  function v({
44
56
  column: e,
45
- onApply: i,
46
- onClear: n,
47
- children: l
57
+ onApply: o,
58
+ onClear: t,
59
+ children: a
48
60
  }) {
49
- return /* @__PURE__ */ m(B, { children: [
50
- /* @__PURE__ */ m(H, { children: [
61
+ const l = e.columnDef.meta?.filterHelpText;
62
+ return /* @__PURE__ */ m(L, { children: [
63
+ /* @__PURE__ */ m(K, { children: [
51
64
  "Filter by ",
52
65
  V(e)
53
66
  ] }),
54
- l,
55
- /* @__PURE__ */ m(T, { children: [
56
- /* @__PURE__ */ t(
67
+ a,
68
+ l && /* @__PURE__ */ r(O, { children: l }),
69
+ /* @__PURE__ */ m(B, { children: [
70
+ /* @__PURE__ */ r(
57
71
  S,
58
72
  {
59
73
  "aria-label": "Clear filter",
60
74
  size: "sm",
61
75
  variant: "plain",
62
- onClick: n,
76
+ onClick: t,
63
77
  children: "Clear"
64
78
  }
65
79
  ),
66
- /* @__PURE__ */ t(
80
+ /* @__PURE__ */ r(
67
81
  S,
68
82
  {
69
83
  "aria-label": "Apply filter",
70
84
  size: "sm",
71
85
  variant: "solid",
72
86
  color: "primary",
73
- onClick: i,
87
+ onClick: o,
74
88
  children: "Apply"
75
89
  }
76
90
  )
77
91
  ] })
78
92
  ] });
79
93
  }
80
- function K({
94
+ function P({
81
95
  column: e,
82
- onClose: i
96
+ onClose: o
83
97
  }) {
84
- const [n, l] = r.useState(
98
+ const [t, a] = i.useState(
85
99
  e.getFilterValue() ?? ""
86
- ), p = () => {
87
- e.setFilterValue(n || void 0), i?.();
100
+ ), l = () => {
101
+ e.setFilterValue(t || void 0), o?.();
88
102
  };
89
- return /* @__PURE__ */ t(v, { column: e, onApply: p, onClear: () => {
90
- l(""), e.setFilterValue(void 0);
91
- }, children: /* @__PURE__ */ t(
103
+ return /* @__PURE__ */ r(v, { column: e, onApply: l, onClear: () => {
104
+ a(""), e.setFilterValue(void 0);
105
+ }, children: /* @__PURE__ */ r(
92
106
  x,
93
107
  {
94
108
  placeholder: "Search...",
95
- value: n,
96
- onChange: (a) => l(a.target.value),
97
- onKeyDown: (a) => {
98
- a.key === "Enter" && p();
109
+ value: t,
110
+ onChange: (n) => a(n.target.value),
111
+ onKeyDown: (n) => {
112
+ n.key === "Enter" && l();
99
113
  },
100
114
  size: "sm",
101
115
  autoFocus: !0
102
116
  }
103
117
  ) });
104
118
  }
105
- function O({
119
+ function j({
106
120
  column: e,
107
- onClose: i
121
+ onClose: o
108
122
  }) {
109
- const n = e.getFilterValue(), [l, p] = r.useState(
110
- n?.min?.toString() ?? ""
111
- ), [d, a] = r.useState(
112
- n?.max?.toString() ?? ""
113
- ), f = r.useRef(null);
114
- r.useEffect(() => {
123
+ const [t, a] = i.useState(
124
+ e.getFilterValue() ?? ""
125
+ ), l = () => {
126
+ e.setFilterValue(t.trim() || void 0), o?.();
127
+ };
128
+ return /* @__PURE__ */ r(v, { column: e, onApply: l, onClear: () => {
129
+ a(""), e.setFilterValue(void 0);
130
+ }, children: /* @__PURE__ */ r(
131
+ A,
132
+ {
133
+ placeholder: "One term per line or comma-separated...",
134
+ value: t,
135
+ onChange: (n) => a(n.target.value),
136
+ onKeyDown: (n) => {
137
+ n.key === "Enter" && (n.metaKey || n.ctrlKey) && (n.preventDefault(), l());
138
+ },
139
+ minRows: 3,
140
+ maxRows: 6,
141
+ size: "sm",
142
+ autoFocus: !0
143
+ }
144
+ ) });
145
+ }
146
+ function N({
147
+ column: e,
148
+ onClose: o
149
+ }) {
150
+ const t = e.getFilterValue(), [a, l] = i.useState(
151
+ t?.min?.toString() ?? ""
152
+ ), [d, n] = i.useState(
153
+ t?.max?.toString() ?? ""
154
+ ), f = i.useRef(null);
155
+ i.useEffect(() => {
115
156
  f.current?.focus({
116
157
  preventScroll: !0
117
158
  });
118
159
  }, []);
119
160
  const c = () => {
120
- const s = l ? parseFloat(l) : void 0, u = d ? parseFloat(d) : void 0;
121
- s !== void 0 || u !== void 0 ? e.setFilterValue({ min: s, max: u }) : e.setFilterValue(void 0), i?.();
161
+ const p = a ? parseFloat(a) : void 0, u = d ? parseFloat(d) : void 0;
162
+ p !== void 0 || u !== void 0 ? e.setFilterValue({ min: p, max: u }) : e.setFilterValue(void 0), o?.();
122
163
  };
123
- return /* @__PURE__ */ t(v, { column: e, onApply: c, onClear: () => {
124
- p(""), a(""), e.setFilterValue(void 0);
164
+ return /* @__PURE__ */ r(v, { column: e, onApply: c, onClear: () => {
165
+ l(""), n(""), e.setFilterValue(void 0);
125
166
  }, children: /* @__PURE__ */ m(g, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
126
- /* @__PURE__ */ t(
167
+ /* @__PURE__ */ r(
127
168
  x,
128
169
  {
129
170
  slotProps: { input: { ref: f } },
130
171
  placeholder: "Min",
131
172
  type: "number",
132
- value: l,
133
- onChange: (s) => p(s.target.value),
134
- onKeyDown: (s) => {
135
- s.key === "Enter" && c();
173
+ value: a,
174
+ onChange: (p) => l(p.target.value),
175
+ onKeyDown: (p) => {
176
+ p.key === "Enter" && c();
136
177
  },
137
178
  size: "sm",
138
179
  sx: { flex: 1 }
139
180
  }
140
181
  ),
141
- /* @__PURE__ */ t("span", { children: "-" }),
142
- /* @__PURE__ */ t(
182
+ /* @__PURE__ */ r("span", { children: "-" }),
183
+ /* @__PURE__ */ r(
143
184
  x,
144
185
  {
145
186
  placeholder: "Max",
146
187
  type: "number",
147
188
  value: d,
148
- onChange: (s) => a(s.target.value),
149
- onKeyDown: (s) => {
150
- s.key === "Enter" && c();
189
+ onChange: (p) => n(p.target.value),
190
+ onKeyDown: (p) => {
191
+ p.key === "Enter" && c();
151
192
  },
152
193
  size: "sm",
153
194
  sx: { flex: 1 }
@@ -155,26 +196,26 @@ function O({
155
196
  )
156
197
  ] }) });
157
198
  }
158
- function P({
199
+ function W({
159
200
  column: e,
160
- onClose: i
201
+ onClose: o
161
202
  }) {
162
- const n = e.getFilterValue(), [l, p] = r.useState(
163
- n?.start ? n.start.toISOString().split("T")[0] : ""
164
- ), [d, a] = r.useState(
165
- n?.end ? n.end.toISOString().split("T")[0] : ""
166
- ), f = r.useRef(null), c = r.useRef(null);
167
- r.useEffect(() => {
203
+ const t = e.getFilterValue(), [a, l] = i.useState(
204
+ t?.start ? t.start.toISOString().split("T")[0] : ""
205
+ ), [d, n] = i.useState(
206
+ t?.end ? t.end.toISOString().split("T")[0] : ""
207
+ ), f = i.useRef(null), c = i.useRef(null);
208
+ i.useEffect(() => {
168
209
  c.current?.focus({
169
210
  preventScroll: !0
170
211
  });
171
212
  }, []);
172
- const o = () => {
173
- const u = l ? new Date(l) : void 0, y = d ? new Date(d) : void 0;
174
- u !== void 0 || y !== void 0 ? e.setFilterValue({ start: u, end: y }) : e.setFilterValue(void 0), i?.();
213
+ const s = () => {
214
+ const u = a ? new Date(a) : void 0, F = d ? new Date(d) : void 0;
215
+ u !== void 0 || F !== void 0 ? e.setFilterValue({ start: u, end: F }) : e.setFilterValue(void 0), o?.();
175
216
  };
176
- return /* @__PURE__ */ t(v, { column: e, onApply: o, onClear: () => {
177
- p(""), a(""), e.setFilterValue(void 0);
217
+ return /* @__PURE__ */ r(v, { column: e, onApply: s, onClear: () => {
218
+ l(""), n(""), e.setFilterValue(void 0);
178
219
  }, children: /* @__PURE__ */ m(
179
220
  g,
180
221
  {
@@ -190,15 +231,15 @@ function P({
190
231
  }
191
232
  },
192
233
  children: [
193
- /* @__PURE__ */ t(
234
+ /* @__PURE__ */ r(
194
235
  x,
195
236
  {
196
237
  type: "date",
197
- value: l,
238
+ value: a,
198
239
  ref: c,
199
- onChange: (u) => p(u.target.value),
240
+ onChange: (u) => l(u.target.value),
200
241
  onKeyDown: (u) => {
201
- u.key === "Enter" && o();
242
+ u.key === "Enter" && s();
202
243
  },
203
244
  size: "sm",
204
245
  slotProps: {
@@ -209,14 +250,14 @@ function P({
209
250
  autoFocus: !0
210
251
  }
211
252
  ),
212
- /* @__PURE__ */ t(
253
+ /* @__PURE__ */ r(
213
254
  x,
214
255
  {
215
256
  type: "date",
216
257
  value: d,
217
- onChange: (u) => a(u.target.value),
258
+ onChange: (u) => n(u.target.value),
218
259
  onKeyDown: (u) => {
219
- u.key === "Enter" && o();
260
+ u.key === "Enter" && s();
220
261
  },
221
262
  size: "sm",
222
263
  slotProps: {
@@ -230,35 +271,35 @@ function P({
230
271
  }
231
272
  ) });
232
273
  }
233
- function j({
274
+ function _({
234
275
  column: e,
235
- options: i,
236
- searchable: n = !1,
237
- onClose: l
276
+ options: o,
277
+ searchable: t = !1,
278
+ onClose: a
238
279
  }) {
239
- const [p, d] = r.useState(
280
+ const [l, d] = i.useState(
240
281
  e.getFilterValue() ?? ""
241
- ), [a, f] = r.useState(""), c = r.useRef(null), o = r.useRef(null);
242
- r.useEffect(() => {
243
- n ? c.current?.focus({ preventScroll: !0 }) : o.current?.focus({ preventScroll: !0 });
244
- }, [n]);
245
- const s = r.useMemo(
246
- () => a ? i.filter(
247
- (h) => h.label.toLowerCase().includes(a.toLowerCase())
248
- ) : i,
249
- [i, a]
282
+ ), [n, f] = i.useState(""), c = i.useRef(null), s = i.useRef(null);
283
+ i.useEffect(() => {
284
+ t ? c.current?.focus({ preventScroll: !0 }) : s.current?.focus({ preventScroll: !0 });
285
+ }, [t]);
286
+ const p = i.useMemo(
287
+ () => n ? o.filter(
288
+ (h) => h.label.toLowerCase().includes(n.toLowerCase())
289
+ ) : o,
290
+ [o, n]
250
291
  );
251
292
  return /* @__PURE__ */ m(v, { column: e, onApply: () => {
252
- e.setFilterValue(p || void 0), l?.();
293
+ e.setFilterValue(l || void 0), a?.();
253
294
  }, onClear: () => {
254
295
  d(""), f(""), e.setFilterValue(void 0);
255
296
  }, children: [
256
- n && /* @__PURE__ */ t(
297
+ t && /* @__PURE__ */ r(
257
298
  x,
258
299
  {
259
300
  slotProps: { input: { ref: c } },
260
301
  placeholder: "Search...",
261
- value: a,
302
+ value: n,
262
303
  onChange: (h) => f(h.target.value),
263
304
  size: "sm"
264
305
  }
@@ -266,30 +307,30 @@ function j({
266
307
  /* @__PURE__ */ m(
267
308
  b,
268
309
  {
269
- ref: o,
310
+ ref: s,
270
311
  component: "ul",
271
312
  size: "sm",
272
313
  role: "group",
273
314
  tabIndex: 0,
274
315
  sx: {
275
- maxHeight: n ? "200px" : "240px",
316
+ maxHeight: t ? "200px" : "240px",
276
317
  overflowY: "auto",
277
318
  outline: "none",
278
319
  "&:focus": { outline: "none" }
279
320
  },
280
321
  children: [
281
- s.map((h) => /* @__PURE__ */ t(
282
- F,
322
+ p.map((h) => /* @__PURE__ */ r(
323
+ C,
283
324
  {
284
325
  component: "li",
285
326
  sx: { paddingLeft: 0, paddingTop: 0 },
286
- children: /* @__PURE__ */ t(
327
+ children: /* @__PURE__ */ r(
287
328
  z,
288
329
  {
289
330
  value: h.value,
290
331
  label: h.label,
291
332
  size: "sm",
292
- checked: p === h.value,
333
+ checked: l === h.value,
293
334
  onChange: (w) => d(w.target.value),
294
335
  sx: {
295
336
  width: "100%"
@@ -299,33 +340,33 @@ function j({
299
340
  },
300
341
  h.value
301
342
  )),
302
- s.length === 0 && /* @__PURE__ */ t(F, { component: "li", sx: { color: "text.tertiary" }, children: "No options match" })
343
+ p.length === 0 && /* @__PURE__ */ r(C, { component: "li", sx: { color: "text.tertiary" }, children: "No options match" })
303
344
  ]
304
345
  }
305
346
  )
306
347
  ] });
307
348
  }
308
- function N({
349
+ function Y({
309
350
  column: e,
310
- options: i,
311
- onClose: n
351
+ options: o,
352
+ onClose: t
312
353
  }) {
313
- const [l, p] = r.useState(
354
+ const [a, l] = i.useState(
314
355
  e.getFilterValue() ?? []
315
- ), d = r.useRef(null);
316
- r.useEffect(() => {
356
+ ), d = i.useRef(null);
357
+ i.useEffect(() => {
317
358
  d.current?.focus();
318
359
  }, []);
319
- const a = (o) => {
320
- p(
321
- (s) => s.includes(o) ? s.filter((u) => u !== o) : [...s, o]
360
+ const n = (s) => {
361
+ l(
362
+ (p) => p.includes(s) ? p.filter((u) => u !== s) : [...p, s]
322
363
  );
323
364
  };
324
- return /* @__PURE__ */ t(v, { column: e, onApply: () => {
325
- e.setFilterValue(l.length > 0 ? l : void 0), n?.();
365
+ return /* @__PURE__ */ r(v, { column: e, onApply: () => {
366
+ e.setFilterValue(a.length > 0 ? a : void 0), t?.();
326
367
  }, onClear: () => {
327
- p([]), e.setFilterValue(void 0);
328
- }, children: /* @__PURE__ */ t(
368
+ l([]), e.setFilterValue(void 0);
369
+ }, children: /* @__PURE__ */ r(
329
370
  b,
330
371
  {
331
372
  ref: d,
@@ -341,49 +382,50 @@ function N({
341
382
  outline: "none"
342
383
  }
343
384
  },
344
- children: i.map((o) => /* @__PURE__ */ t(
345
- F,
385
+ children: o.map((s) => /* @__PURE__ */ r(
386
+ C,
346
387
  {
347
388
  component: "li",
348
389
  sx: { paddingLeft: 0, paddingTop: 0 },
349
- children: /* @__PURE__ */ t(
350
- E,
390
+ children: /* @__PURE__ */ r(
391
+ k,
351
392
  {
352
- label: o.label,
353
- checked: l.includes(o.value),
354
- onChange: () => a(o.value),
393
+ label: s.label,
394
+ checked: a.includes(s.value),
395
+ onChange: () => n(s.value),
355
396
  size: "sm",
356
397
  sx: {
357
398
  width: "100%"
358
399
  }
359
400
  },
360
- o.value
401
+ s.value
361
402
  )
362
403
  },
363
- o.value
404
+ s.value
364
405
  ))
365
406
  }
366
407
  ) });
367
408
  }
368
- const W = {
369
- text: K,
370
- number: O,
371
- date: P,
372
- select: j,
373
- multiselect: N
409
+ const $ = {
410
+ text: P,
411
+ textarea: j,
412
+ number: N,
413
+ date: W,
414
+ select: _,
415
+ multiselect: Y
374
416
  };
375
- function ae({
417
+ function ue({
376
418
  column: e,
377
- filterType: i = "text",
378
- filterOptions: n = [],
379
- filterSearchable: l
419
+ filterType: o = "text",
420
+ filterOptions: t = [],
421
+ filterSearchable: a
380
422
  }) {
381
- const [p, d] = r.useState(!1), a = () => {
423
+ const [l, d] = i.useState(!1), n = () => {
382
424
  d(!1);
383
- }, f = W[i];
384
- return /* @__PURE__ */ m(D, { open: p, onOpenChange: (c, o) => d(o), children: [
385
- /* @__PURE__ */ t(
386
- k,
425
+ }, f = $[o];
426
+ return /* @__PURE__ */ m(I, { open: l, onOpenChange: (c, s) => d(s), children: [
427
+ /* @__PURE__ */ r(
428
+ T,
387
429
  {
388
430
  badgeContent: "",
389
431
  invisible: !e.getIsFiltered(),
@@ -398,13 +440,13 @@ function ae({
398
440
  borderRadius: "50%"
399
441
  }
400
442
  },
401
- children: /* @__PURE__ */ t(
402
- M,
443
+ children: /* @__PURE__ */ r(
444
+ H,
403
445
  {
404
446
  "aria-label": `${e.getIsFiltered() ? "Filtered" : "Filter"} by ${V(
405
447
  e
406
448
  )}`,
407
- slots: { root: L },
449
+ slots: { root: M },
408
450
  slotProps: {
409
451
  root: {
410
452
  size: "sm",
@@ -425,28 +467,29 @@ function ae({
425
467
  }
426
468
  }
427
469
  },
428
- children: /* @__PURE__ */ t(R, { icon: I, size: "xs" })
470
+ children: /* @__PURE__ */ r(E, { icon: D, size: "xs" })
429
471
  }
430
472
  )
431
473
  }
432
474
  ),
433
- /* @__PURE__ */ t(A, { placement: "bottom-start", children: /* @__PURE__ */ t(
475
+ /* @__PURE__ */ r(R, { placement: "bottom-start", children: /* @__PURE__ */ r(
434
476
  f,
435
477
  {
436
478
  column: e,
437
- onClose: a,
438
- options: n,
439
- searchable: l
479
+ onClose: n,
480
+ options: t,
481
+ searchable: a
440
482
  }
441
483
  ) })
442
484
  ] });
443
485
  }
444
486
  export {
445
- ae as ColumnFilter,
446
- P as DateFilter,
447
- N as MultiSelectFilter,
448
- O as NumericFilter,
449
- j as SelectFilter,
450
- K as TextFilter,
451
- W as filterComponentMap
487
+ ue as ColumnFilter,
488
+ W as DateFilter,
489
+ Y as MultiSelectFilter,
490
+ N as NumericFilter,
491
+ _ as SelectFilter,
492
+ j as TextAreaFilter,
493
+ P as TextFilter,
494
+ $ as filterComponentMap
452
495
  };
@@ -1,36 +1,44 @@
1
- const l = (u, i, r) => {
2
- const e = u.getValue(i);
1
+ const l = (s, i, r) => {
2
+ const e = s.getValue(i);
3
3
  if (e == null) return !1;
4
- const t = String(e).toLowerCase(), n = String(r).toLowerCase();
5
- return t.includes(n);
6
- }, a = (u, i, r) => {
7
- const e = u.getValue(i);
4
+ const t = String(e).toLowerCase(), u = String(r).toLowerCase();
5
+ return t.includes(u);
6
+ }, a = (s, i, r) => {
7
+ const e = s.getValue(i);
8
+ if (e == null) return !1;
9
+ const t = String(r).split(/[\n,]/).map((n) => n.trim().toLowerCase()).filter((n) => n.length > 0);
10
+ if (t.length === 0) return !0;
11
+ const u = String(e).toLowerCase();
12
+ return t.some((n) => u.includes(n));
13
+ }, o = (s, i, r) => {
14
+ const e = s.getValue(i);
8
15
  if (e == null) return !1;
9
16
  const t = Number(e);
10
17
  if (Number.isNaN(t)) return !1;
11
- const { min: n, max: s } = r;
12
- return n !== void 0 && s !== void 0 ? t >= n && t <= s : n !== void 0 ? t >= n : s !== void 0 ? t <= s : !0;
13
- }, o = (u, i, r) => {
14
- const e = u.getValue(i);
18
+ const { min: u, max: n } = r;
19
+ return u !== void 0 && n !== void 0 ? t >= u && t <= n : u !== void 0 ? t >= u : n !== void 0 ? t <= n : !0;
20
+ }, c = (s, i, r) => {
21
+ const e = s.getValue(i);
15
22
  if (e == null) return !1;
16
23
  const t = e instanceof Date ? e : new Date(e);
17
24
  if (Number.isNaN(t.getTime())) return !1;
18
- const { start: n, end: s } = r;
19
- return n && s ? t >= n && t <= s : n ? t >= n : s ? t <= s : !0;
20
- }, c = (u, i, r) => {
21
- const e = u.getValue(i);
25
+ const { start: u, end: n } = r;
26
+ return u && n ? t >= u && t <= n : u ? t >= u : n ? t <= n : !0;
27
+ }, f = (s, i, r) => {
28
+ const e = s.getValue(i);
22
29
  if (e == null) return !1;
23
30
  const t = String(e);
24
31
  return Array.isArray(r) ? r.length === 0 || r.includes(t) : r ? t === r : !0;
25
- }, f = (u, i, r) => {
32
+ }, g = (s, i, r) => {
26
33
  if (!Array.isArray(r) || r.length === 0) return !0;
27
- const e = u.getValue(i);
34
+ const e = s.getValue(i);
28
35
  return e == null ? !1 : r.includes(String(e));
29
36
  };
30
37
  export {
31
- o as dateFilter,
32
- f as multiSelectFilter,
33
- a as numericFilter,
34
- c as selectFilter,
35
- l as textFilter
38
+ c as dateFilter,
39
+ g as multiSelectFilter,
40
+ o as numericFilter,
41
+ f as selectFilter,
42
+ l as textFilter,
43
+ a as textareaFilter
36
44
  };