@mittwald/flow-react-components 0.1.0-alpha.205 → 0.1.0-alpha.207

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/dist/List.js CHANGED
@@ -1,20 +1,20 @@
1
1
  "use client"
2
2
  /* */
3
3
  var mt = Object.defineProperty;
4
- var gt = (a, t, e) => t in a ? mt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
5
- var n = (a, t, e) => gt(a, typeof t != "symbol" ? t + "" : t, e);
6
- import r, { createContext as pt, useContext as ft, createElement as Y, useState as Q, useEffect as L, useRef as bt, cloneElement as St } from "react";
4
+ var gt = (i, t, e) => t in i ? mt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
5
+ var n = (i, t, e) => gt(i, typeof t != "symbol" ? t + "" : t, e);
6
+ import r, { createContext as pt, useContext as ft, createElement as J, useState as Y, useEffect as E, useRef as bt, cloneElement as St } from "react";
7
7
  import "./propsContext-DzAKlmhS.js";
8
8
  import { P as vt } from "./PropsContextProvider-C6Z4XGp6.js";
9
9
  import "@react-aria/utils";
10
10
  import { isShallowEqual as yt, unique as wt, times as Et } from "remeda";
11
- import { d as Ct } from "./dynamic-ClpUSmEt.js";
11
+ import { d as Ft } from "./dynamic-ClpUSmEt.js";
12
12
  import { B as p } from "./Button-DQtavSbo.js";
13
13
  import "@tabler/icons-react";
14
14
  import "./Icon-DPoIVASu.js";
15
- import { I as Ft } from "./IconContextMenu-jwoVcLvd.js";
16
- import { a as A, C as X } from "./ContextMenuTrigger-BdJf5T8A.js";
17
- import { M as Z } from "./MenuItem-DcfYvfPJ.js";
15
+ import { I as Ct } from "./IconContextMenu-jwoVcLvd.js";
16
+ import { a as A, C as Q } from "./ContextMenuTrigger-BdJf5T8A.js";
17
+ import { M as X } from "./MenuItem-DcfYvfPJ.js";
18
18
  import { useLocalizedStringFormatter as v } from "react-aria";
19
19
  import { TunnelProvider as Lt, TunnelExit as U } from "@mittwald/react-tunnel";
20
20
  import C from "clsx";
@@ -22,19 +22,19 @@ import { g as Tt } from "./getContainerBreakpointSizeClassName-BrcFDcCY.js";
22
22
  import { f as It } from "./flowComponent-DHPUcYyM.js";
23
23
  import { R as kt } from "./Render-BdlTa7Qb.js";
24
24
  import { T as f } from "./Text-Sd5q3Yme.js";
25
- import { I as _ } from "./IconChevronDown--OxZLX8L.js";
25
+ import { I as Z } from "./IconChevronDown--OxZLX8L.js";
26
26
  import { I as At } from "./IconClose-BFwPT_IX.js";
27
- import { makeObservable as Bt, observable as $, computed as O, action as F } from "mobx";
27
+ import { makeObservable as Vt, observable as $, computed as O, action as L } from "mobx";
28
28
  import "./context-BB3_MApL.js";
29
- import { u as Pt } from "./useOnChange-C1Quwyuz.js";
30
- import { S as xt } from "./SearchField-DstUFmq4.js";
31
- import { getProperty as Dt } from "dot-prop";
32
- import { hash as Vt } from "object-code";
29
+ import { u as Bt } from "./useOnChange-C1Quwyuz.js";
30
+ import { S as Pt } from "./SearchField-DstUFmq4.js";
31
+ import { getProperty as xt } from "dot-prop";
32
+ import { hash as Dt } from "object-code";
33
33
  import { useReactTable as Nt, getCoreRowModel as Rt, getSortedRowModel as Mt, getFilteredRowModel as zt, getPaginationRowModel as Ut, getFacetedUniqueValues as $t } from "@tanstack/react-table";
34
34
  import tt from "invariant";
35
35
  import { getAsyncResource as q } from "@mittwald/react-use-promise";
36
36
  import { u as H } from "./useSelector-DpU7_HMO.js";
37
- import * as B from "react-aria-components";
37
+ import * as V from "react-aria-components";
38
38
  import { I as Ot } from "./IllustratedMessage-B3MHD01M.js";
39
39
  import { I as qt } from "./IconSearch-C7VQTAqK.js";
40
40
  import { H as et } from "./Heading-BEC6iPfF.js";
@@ -42,15 +42,15 @@ import { S as K } from "./SkeletonText-B5ZghZhO.js";
42
42
  import { d as S, a as G } from "./deepFindOfType-6pG0fH7S.js";
43
43
  import { ListLoaderAsyncResource as Ht, TypedListLoaderAsyncResource as Kt } from "./List/ListLoaderAsyncResource.js";
44
44
  import { S as Gt } from "./Skeleton-CKLaTmDR.js";
45
- const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title", Jt = "flow--list--items--item--view--top-content", Yt = "flow--list--items--item--view--content", Qt = "flow--list--items--item--view--action", Xt = "flow--list--items--item--view--avatar", Zt = "flow--list--items--item--view--text", _t = "flow--list--items--item--view--heading", h = {
45
+ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view--title", _t = "flow--list--items--item--view--top-content", Jt = "flow--list--items--item--view--content", Yt = "flow--list--items--item--view--action", Qt = "flow--list--items--item--view--avatar", Xt = "flow--list--items--item--view--text", Zt = "flow--list--items--item--view--heading", d = {
46
46
  view: jt,
47
47
  title: Wt,
48
- topContent: Jt,
49
- content: Yt,
50
- action: Qt,
51
- avatar: Xt,
52
- text: Zt,
53
- heading: _t,
48
+ topContent: _t,
49
+ content: Jt,
50
+ action: Yt,
51
+ avatar: Qt,
52
+ text: Xt,
53
+ heading: Zt,
54
54
  "container-breakpoint-size-xs": "flow--list--items--item--view--container-breakpoint-size-xs",
55
55
  "container-breakpoint-size-s": "flow--list--items--item--view--container-breakpoint-size-s",
56
56
  "container-breakpoint-size-m": "flow--list--items--item--view--container-breakpoint-size-m",
@@ -60,22 +60,22 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
60
60
  "list.noResult.heading": "Keine Suchergebnisse gefunden",
61
61
  "list.noResult.text": "Deine Suche ergab keine Ergebnisse. Bitte passe die Suchanfrage oder deine Filter an.",
62
62
  "list.options": "Optionen",
63
- "list.paginationInfo": (a) => `${a.visibleItemsCount} von insgesamt ${a.totalItemsCount} angezeigt`,
63
+ "list.paginationInfo": (i) => `${i.visibleItemsCount} von insgesamt ${i.totalItemsCount} angezeigt`,
64
64
  "list.resetAll": "Alles zurücksetzen",
65
- "list.setSorting": (a) => `Sortierung: ${a.property}`,
65
+ "list.setSorting": (i) => `Sortierung: ${i.property}`,
66
66
  "list.showMore": "Mehr anzeigen",
67
67
  "list.sorting": "Sortierung"
68
68
  }, "en-EN": {
69
69
  "list.noResult.heading": "No search results found",
70
70
  "list.noResult.text": "Your search did not return any results. Please adjust the search query or your filters.",
71
71
  "list.options": "Options",
72
- "list.paginationInfo": (a) => `Showing ${a.visibleItemsCount} of ${a.totalItemsCount}`,
72
+ "list.paginationInfo": (i) => `Showing ${i.visibleItemsCount} of ${i.totalItemsCount}`,
73
73
  "list.resetAll": "Reset filters",
74
- "list.setSorting": (a) => `Sorting: ${a.property}`,
74
+ "list.setSorting": (i) => `Sorting: ${i.property}`,
75
75
  "list.showMore": "Show more",
76
76
  "list.sorting": "Sorting"
77
- } }, te = (a) => {
78
- const { className: t, children: e } = a, s = v(g);
77
+ } }, te = (i) => {
78
+ const { className: t, children: e } = i, s = v(g);
79
79
  return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(
80
80
  p,
81
81
  {
@@ -83,60 +83,60 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
83
83
  className: t,
84
84
  "aria-label": s.format("list.options")
85
85
  },
86
- /* @__PURE__ */ r.createElement(Ft, null)
86
+ /* @__PURE__ */ r.createElement(Ct, null)
87
87
  ), e);
88
- }, ee = (a) => a === "top" ? h.topContent : a === "bottom" ? h.content : h.topContent, st = (a) => {
89
- const { children: t, className: e, containerBreakpointSize: s = "m" } = a, i = {
88
+ }, ee = (i) => i === "top" ? d.topContent : i === "bottom" ? d.content : d.topContent, st = (i) => {
89
+ const { children: t, className: e, containerBreakpointSize: s = "m" } = i, a = {
90
90
  ContextMenu: {
91
- wrapWith: /* @__PURE__ */ r.createElement(te, { className: h.action }),
91
+ wrapWith: /* @__PURE__ */ r.createElement(te, { className: d.action }),
92
92
  placement: "bottom end"
93
93
  },
94
94
  Button: {
95
- className: h.action
95
+ className: d.action
96
96
  },
97
97
  ActionGroup: {
98
- className: h.action,
98
+ className: d.action,
99
99
  ignoreBreakpoint: !0
100
100
  },
101
101
  Content: {
102
- className: Ct((l) => ee(l.slot)),
102
+ className: Ft((l) => ee(l.slot)),
103
103
  tunnelId: "topContent"
104
104
  },
105
105
  Avatar: {
106
- className: h.avatar,
106
+ className: d.avatar,
107
107
  tunnelId: "title"
108
108
  },
109
109
  Heading: {
110
- className: h.heading,
110
+ className: d.heading,
111
111
  level: 5,
112
112
  tunnelId: "title"
113
113
  },
114
114
  Text: {
115
- className: h.text,
115
+ className: d.text,
116
116
  tunnelId: "title"
117
117
  },
118
118
  Link: {
119
119
  unstyled: !0
120
120
  }
121
121
  }, o = C(
122
- h.view,
122
+ d.view,
123
123
  e,
124
- h[Tt(s)]
124
+ d[Tt(s)]
125
125
  );
126
- return /* @__PURE__ */ r.createElement("div", { className: o }, /* @__PURE__ */ r.createElement(vt, { props: i }, /* @__PURE__ */ r.createElement(Lt, null, t, /* @__PURE__ */ r.createElement("div", { className: h.title }, /* @__PURE__ */ r.createElement(U, { id: "title" })), /* @__PURE__ */ r.createElement(U, { id: "topContent" }))));
127
- }, it = pt({}), m = () => ft(it).list, se = () => m().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(kt, { key: e }, () => {
126
+ return /* @__PURE__ */ r.createElement("div", { className: o }, /* @__PURE__ */ r.createElement(vt, { props: a }, /* @__PURE__ */ r.createElement(Lt, null, t, /* @__PURE__ */ r.createElement("div", { className: d.title }, /* @__PURE__ */ r.createElement(U, { id: "title" })), /* @__PURE__ */ r.createElement(U, { id: "topContent" }))));
127
+ }, at = pt({}), m = () => ft(at).list, se = () => m().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(kt, { key: e }, () => {
128
128
  t();
129
- })), ie = (a) => {
130
- const { sorting: t } = a;
131
- return /* @__PURE__ */ r.createElement(Z, { id: t.id }, t.name);
132
- }, T = (a) => {
133
- const { children: t, locales: e, variables: s } = a;
129
+ })), ae = (i) => {
130
+ const { sorting: t } = i;
131
+ return /* @__PURE__ */ r.createElement(X, { id: t.id }, t.name);
132
+ }, T = (i) => {
133
+ const { children: t, locales: e, variables: s } = i;
134
134
  return v(e).format(t, s);
135
- }, ae = () => {
136
- const a = m(), t = a.visibleSorting.map((i) => /* @__PURE__ */ r.createElement(ie, { sorting: i, key: i.id }));
135
+ }, ie = () => {
136
+ const i = m(), t = i.visibleSorting.map((a) => /* @__PURE__ */ r.createElement(ae, { sorting: a, key: a.id }));
137
137
  if (t.length === 0)
138
138
  return null;
139
- const e = a.visibleSorting.find((i) => i.isSorted()), s = /* @__PURE__ */ r.createElement(f, null, e ? /* @__PURE__ */ r.createElement(
139
+ const e = i.visibleSorting.find((a) => a.isSorted()), s = /* @__PURE__ */ r.createElement(f, null, e ? /* @__PURE__ */ r.createElement(
140
140
  T,
141
141
  {
142
142
  locales: g,
@@ -146,34 +146,34 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
146
146
  },
147
147
  "list.setSorting"
148
148
  ) : /* @__PURE__ */ r.createElement(T, { locales: g }, "list.sorting"));
149
- return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ r.createElement(_, null)), /* @__PURE__ */ r.createElement(
150
- X,
149
+ return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, s, /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
150
+ Q,
151
151
  {
152
152
  selectionMode: "single",
153
153
  selectedKeys: e ? [e.id] : [],
154
- onAction: (i) => {
155
- a.getSorting(String(i)).enable();
154
+ onAction: (a) => {
155
+ i.getSorting(String(a)).enable();
156
156
  }
157
157
  },
158
158
  t
159
159
  ));
160
- }, re = (a) => {
161
- const { filter: t } = a, { values: e, mode: s, name: i, property: o } = t, l = e.map((u) => /* @__PURE__ */ r.createElement(
162
- Z,
160
+ }, re = (i) => {
161
+ const { filter: t } = i, { values: e, mode: s, name: a, property: o } = t, l = e.map((c) => /* @__PURE__ */ r.createElement(
162
+ X,
163
163
  {
164
- id: u.id,
165
- key: u.id,
164
+ id: c.id,
165
+ key: c.id,
166
166
  onAction: () => {
167
- u.toggle();
167
+ c.toggle();
168
168
  }
169
169
  },
170
- u.render()
171
- )), c = e.filter((u) => u.isActive).map((u) => u.id);
172
- return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ r.createElement(f, null, i ?? o), /* @__PURE__ */ r.createElement(_, null)), /* @__PURE__ */ r.createElement(
173
- X,
170
+ c.render()
171
+ )), u = e.filter((c) => c.isActive).map((c) => c.id);
172
+ return /* @__PURE__ */ r.createElement(A, null, /* @__PURE__ */ r.createElement(p, { variant: "soft", size: "s", color: "secondary" }, /* @__PURE__ */ r.createElement(f, null, a ?? o), /* @__PURE__ */ r.createElement(Z, null)), /* @__PURE__ */ r.createElement(
173
+ Q,
174
174
  {
175
175
  selectionMode: s === "one" ? "single" : "multiple",
176
- selectedKeys: c
176
+ selectedKeys: u
177
177
  },
178
178
  l
179
179
  ));
@@ -182,11 +182,11 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
182
182
  pickerListAndSearch: oe,
183
183
  pickerList: le,
184
184
  searchField: ce
185
- }, ue = "flow--list--header--active-filters", de = "flow--list--header--active-filters--clear-button", j = {
185
+ }, ue = "flow--list--header--active-filters", he = "flow--list--header--active-filters--clear-button", j = {
186
186
  activeFilters: ue,
187
- clearButton: de
188
- }, he = () => {
189
- const a = m(), t = a.filters.flatMap(
187
+ clearButton: he
188
+ }, de = () => {
189
+ const i = m(), t = i.filters.flatMap(
190
190
  (e) => e.values.filter((s) => s.isActive).map((s) => /* @__PURE__ */ r.createElement(
191
191
  p,
192
192
  {
@@ -205,49 +205,49 @@ const jt = "flow--list--items--item--view", Wt = "flow--list--items--item--view-
205
205
  className: j.clearButton,
206
206
  size: "s",
207
207
  variant: "plain",
208
- onPress: () => a.clearFilters()
208
+ onPress: () => i.clearFilters()
209
209
  },
210
210
  /* @__PURE__ */ r.createElement(T, { locales: g }, "list.resetAll")
211
211
  ));
212
- }, me = (a) => {
213
- const { className: t, onChange: e, value: s, ...i } = a, [o, l] = Q(s ?? "");
214
- Pt(s, () => {
212
+ }, me = (i) => {
213
+ const { className: t, onChange: e, value: s, ...a } = i, [o, l] = Y(s ?? "");
214
+ Bt(s, () => {
215
215
  l(s ?? "");
216
216
  }, [o]);
217
- const c = () => {
217
+ const u = () => {
218
218
  e(void 0), l("");
219
- }, u = (d) => {
220
- d.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : d.key === "Escape" && c();
219
+ }, c = (h) => {
220
+ h.key === "Enter" ? o.trim() === "" ? e(void 0) : e(o) : h.key === "Escape" && u();
221
221
  };
222
222
  return /* @__PURE__ */ r.createElement(
223
- xt,
223
+ Pt,
224
224
  {
225
225
  className: t,
226
226
  value: o,
227
- onKeyUp: u,
228
- onChange: (d) => l(d),
229
- onClear: c,
230
- ...i
227
+ onKeyUp: c,
228
+ onChange: (h) => l(h),
229
+ onClear: u,
230
+ ...a
231
231
  }
232
232
  );
233
- }, ge = (a) => {
234
- const { className: t, search: e } = a, s = e.render ?? me;
235
- return Y(s, {
233
+ }, ge = (i) => {
234
+ const { className: t, search: e } = i, s = e.render ?? me;
235
+ return J(s, {
236
236
  className: t,
237
237
  value: e.value,
238
238
  onChange: e.setValue.bind(e),
239
239
  ...e.textFieldProps
240
240
  });
241
- }, pe = (a) => {
242
- const { className: t } = a, e = m();
241
+ }, pe = (i) => {
242
+ const { className: t } = i, e = m();
243
243
  if (e.filters.length === 0 && e.visibleSorting.length === 0 && !e.search)
244
244
  return null;
245
- const s = e.filters.map((i) => /* @__PURE__ */ r.createElement(re, { key: i.property, filter: i }));
246
- return /* @__PURE__ */ r.createElement("div", { className: C(t, w.header) }, /* @__PURE__ */ r.createElement("div", { className: w.pickerListAndSearch }, /* @__PURE__ */ r.createElement("div", { className: w.pickerList }, /* @__PURE__ */ r.createElement(ae, null), s), e.search && /* @__PURE__ */ r.createElement(ge, { className: w.searchField, search: e.search })), /* @__PURE__ */ r.createElement(he, null));
245
+ const s = e.filters.map((a) => /* @__PURE__ */ r.createElement(re, { key: a.property, filter: a }));
246
+ return /* @__PURE__ */ r.createElement("div", { className: C(t, w.header) }, /* @__PURE__ */ r.createElement("div", { className: w.pickerListAndSearch }, /* @__PURE__ */ r.createElement("div", { className: w.pickerList }, /* @__PURE__ */ r.createElement(ie, null), s), e.search && /* @__PURE__ */ r.createElement(ge, { className: w.searchField, search: e.search })), /* @__PURE__ */ r.createElement(de, null));
247
247
  }, fe = "flow--list", be = {
248
248
  list: fe
249
249
  };
250
- let Se = class at {
250
+ let Se = class it {
251
251
  constructor(t, e, s) {
252
252
  n(this, "id");
253
253
  n(this, "data");
@@ -255,7 +255,7 @@ let Se = class at {
255
255
  this.collection = t, this.id = e, this.data = s;
256
256
  }
257
257
  static fromRow(t, e) {
258
- return new at(t, e.id, e.original);
258
+ return new it(t, e.id, e.original);
259
259
  }
260
260
  };
261
261
  class ve {
@@ -271,9 +271,9 @@ class ye {
271
271
  constructor(t, e = {}) {
272
272
  n(this, "batchSize");
273
273
  n(this, "list");
274
- var i;
274
+ var a;
275
275
  const { batchSize: s = 20 } = e;
276
- this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (i = t.search) == null || i.onUpdated(() => this.reset());
276
+ this.list = t, this.batchSize = s, t.filters.forEach((o) => o.onFilterUpdated(() => this.reset())), (a = t.search) == null || a.onUpdated(() => this.reset());
277
277
  }
278
278
  get reactTable() {
279
279
  return this.list.reactTable.table;
@@ -326,7 +326,7 @@ class W {
326
326
  return yt(this.value, t.value);
327
327
  }
328
328
  get id() {
329
- return `${this.filter.property}@@${Vt(this.value)}`;
329
+ return `${this.filter.property}@@${Dt(this.value)}`;
330
330
  }
331
331
  get isActive() {
332
332
  return this.filter.isValueActive(this);
@@ -341,10 +341,11 @@ class W {
341
341
  this.filter.deactivateValue(this);
342
342
  }
343
343
  }
344
- const Ee = (a, t) => a === t, Ce = (a) => String(a);
345
- class Fe {
344
+ const Ee = (i, t) => i === t, Fe = (i) => String(i);
345
+ class Ce {
346
346
  constructor(t, e) {
347
347
  n(this, "_values");
348
+ n(this, "_valuesFromTableState");
348
349
  n(this, "list");
349
350
  n(this, "property");
350
351
  n(this, "mode");
@@ -353,28 +354,28 @@ class Fe {
353
354
  n(this, "name");
354
355
  n(this, "onFilterUpdateCallbacks", /* @__PURE__ */ new Set());
355
356
  var s;
356
- this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((i) => new W(this, i)), this.matcher = e.matcher ?? Ee, this.renderItem = e.renderItem ?? Ce, this.name = e.name;
357
+ this.list = t, this.property = e.property, this.mode = e.mode ?? "one", this._values = (s = e.values) == null ? void 0 : s.map((a) => new W(this, a)), this.matcher = e.matcher ?? Ee, this.renderItem = e.renderItem ?? Fe, this.name = e.name;
357
358
  }
358
359
  updateTableColumnDef(t) {
359
360
  t.enableColumnFilter = !0, t.filterFn = this.getReactTableFilterFn();
360
361
  }
361
362
  getReactTableFilterFn() {
362
363
  return (t, e, s) => {
363
- const i = this.property, o = i.startsWith(we) ? t.original : Dt(t.original, i);
364
+ const a = this.property, o = a.startsWith(we) ? t.original : xt(t.original, a);
364
365
  return this.checkFilterMatches(o, s);
365
366
  };
366
367
  }
367
368
  checkFilterMatches(t, e) {
368
369
  if (e === null)
369
370
  return !0;
370
- const s = (o) => Array.isArray(o) ? o : [o], i = (o) => this.matcher(o.value, t);
371
+ const s = (o) => Array.isArray(o) ? o : [o], a = (o) => this.matcher(o.value, t);
371
372
  if (this.mode === "all")
372
- return s(e).every(i);
373
+ return s(e).every(a);
373
374
  if (this.mode === "some") {
374
375
  const o = s(e);
375
- return o.length === 0 || o.some(i);
376
+ return o.length === 0 || o.some(a);
376
377
  } else if (this.mode === "one")
377
- return i(e);
378
+ return a(e);
378
379
  throw new Error(`Unknown filter mode '${this.mode}'`);
379
380
  }
380
381
  getTableColumnFilter() {
@@ -387,10 +388,24 @@ class Fe {
387
388
  var t;
388
389
  return ((t = this.getTableColumnFilter()) == null ? void 0 : t.value) ?? null;
389
390
  }
390
- get values() {
391
- return this._values === void 0 && (this._values = wt(
391
+ getValuesFromTableState() {
392
+ return wt(
392
393
  Array.from(this.getTableColumn().getFacetedUniqueValues().keys()).flatMap((t) => t).filter((t) => t != null)
393
- ).map((t) => new W(this, t))), this._values;
394
+ ).map((t) => new W(this, t));
395
+ }
396
+ checkIfValueIsUnknown(t) {
397
+ return !this.values.some((s) => s.id === t.id);
398
+ }
399
+ deleteUnknownFilterValues() {
400
+ if (this.values !== this.valuesFromTableState)
401
+ for (const t of this.getArrayValue())
402
+ this.checkIfValueIsUnknown(t) && this.deactivateValue(t);
403
+ }
404
+ get values() {
405
+ return this._values ?? this.valuesFromTableState;
406
+ }
407
+ get valuesFromTableState() {
408
+ return this._valuesFromTableState || (this._valuesFromTableState = this.getValuesFromTableState()), this._valuesFromTableState;
394
409
  }
395
410
  getArrayValue() {
396
411
  const t = this.getValue();
@@ -405,7 +420,7 @@ class Fe {
405
420
  deactivateValue(t) {
406
421
  const e = this.getArrayValue();
407
422
  let s;
408
- this.mode === "all" || this.mode === "some" ? s = e.filter((i) => !i.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
423
+ this.mode === "all" || this.mode === "some" ? s = e.filter((a) => !a.equals(t)) : s = null, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
409
424
  }
410
425
  clearValues() {
411
426
  let t;
@@ -414,7 +429,7 @@ class Fe {
414
429
  toggleValue(t) {
415
430
  const e = this.getArrayValue();
416
431
  let s;
417
- this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((i) => !i.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((i) => i());
432
+ this.mode === "all" || this.mode === "some" ? t.isActive ? s = e.filter((a) => !a.equals(t)) : s = [...e, t] : s = t.isActive ? null : t, this.list.reactTable.getTableColumn(this.property).setFilterValue(s), this.onFilterUpdateCallbacks.forEach((a) => a());
418
433
  }
419
434
  onFilterUpdated(t) {
420
435
  this.onFilterUpdateCallbacks.add(t);
@@ -454,25 +469,25 @@ class Le {
454
469
  return `${this.getTableColumn().id}:${this.direction}`;
455
470
  }
456
471
  }
457
- class P {
472
+ class B {
458
473
  constructor(t, e, s = {}) {
459
474
  n(this, "list");
460
475
  n(this, "table");
461
476
  n(this, "sortingState");
462
477
  n(this, "updateSortingState");
463
478
  this.list = t;
464
- const i = this.list.sorting.filter(
465
- (c) => c.defaultEnabled !== !1
466
- ), [o, l] = Q(
467
- i.map((c) => c.getReactTableColumnSort())
479
+ const a = this.list.sorting.filter(
480
+ (u) => u.defaultEnabled !== !1
481
+ ), [o, l] = Y(
482
+ a.map((u) => u.getReactTableColumnSort())
468
483
  );
469
484
  this.sortingState = o, this.updateSortingState = l, this.table = this.useReactTable(e, s);
470
485
  }
471
486
  static useNew(t, e, s = {}) {
472
- return new P(t, e, s);
487
+ return new B(t, e, s);
473
488
  }
474
489
  useReactTable(t, e = {}) {
475
- const s = this.list.loader.useData(), i = Nt({
490
+ const s = this.list.loader.useData(), a = Nt({
476
491
  data: s,
477
492
  state: {
478
493
  sorting: this.sortingState
@@ -494,14 +509,14 @@ class P {
494
509
  globalFilterFn: "auto",
495
510
  ...e
496
511
  });
497
- return L(() => {
512
+ return E(() => {
498
513
  t && t(this.list);
499
- }, [this.list, t, i]), i;
514
+ }, [this.list, t, a]), a;
500
515
  }
501
516
  handleSortingStateUpdate(t) {
502
517
  const e = typeof t == "function" ? t(this.sortingState) : t, s = this.list.sorting.filter(
503
- (i) => i.defaultEnabled === "hidden" && !e.some((o) => o.id === i.property)
504
- ).map((i) => i.getReactTableColumnSort());
518
+ (a) => a.defaultEnabled === "hidden" && !e.some((o) => o.id === a.property)
519
+ ).map((a) => a.getReactTableColumnSort());
505
520
  this.updateSortingState([...s, ...e]);
506
521
  }
507
522
  get searchString() {
@@ -513,9 +528,9 @@ class P {
513
528
  }
514
529
  getTableColumnDefs() {
515
530
  const t = /* @__PURE__ */ new Map(), e = (s) => {
516
- const i = t.get(s);
517
- if (i)
518
- return i;
531
+ const a = t.get(s);
532
+ if (a)
533
+ return a;
519
534
  const o = {
520
535
  id: s,
521
536
  accessorKey: s,
@@ -531,12 +546,12 @@ class P {
531
546
  ), Array.from(t.values());
532
547
  }
533
548
  }
534
- class x {
549
+ class P {
535
550
  constructor() {
536
551
  n(this, "dataBatches", []);
537
552
  n(this, "prevDataBatches", []);
538
553
  n(this, "batchLoadingStates", ["void"]);
539
- Bt(this, {
554
+ Vt(this, {
540
555
  prevDataBatches: !1,
541
556
  useMergedData: !1,
542
557
  useIsLoading: !1,
@@ -544,13 +559,13 @@ class x {
544
559
  batchLoadingStates: $.shallow,
545
560
  mergedData: O,
546
561
  isLoading: O,
547
- reset: F.bound,
548
- setDataBatch: F.bound,
549
- setBatchLoadingState: F.bound
562
+ reset: L.bound,
563
+ setDataBatch: L.bound,
564
+ setBatchLoadingState: L.bound
550
565
  });
551
566
  }
552
567
  static useNew() {
553
- return bt(new x()).current;
568
+ return bt(new P()).current;
554
569
  }
555
570
  reset() {
556
571
  this.batchLoadingStates = [], this.dataBatches = [];
@@ -575,7 +590,7 @@ class x {
575
590
  }
576
591
  }
577
592
  const Te = [];
578
- class D {
593
+ class x {
579
594
  constructor(t, e = {}) {
580
595
  n(this, "list");
581
596
  n(this, "dataSource");
@@ -583,14 +598,14 @@ class D {
583
598
  n(this, "manualFiltering");
584
599
  n(this, "manualPagination");
585
600
  n(this, "loaderState");
586
- var c;
601
+ var u;
587
602
  const { source: s } = e;
588
603
  this.dataSource = s ?? { staticData: Te };
589
- const i = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, o = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, l = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
590
- this.list = t, this.loaderState = x.useNew(), this.manualPagination = i ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((u) => u.onFilterUpdated(() => this.reset())), (c = this.list.search) == null || c.onUpdated(() => this.reset());
604
+ const a = "manualPagination" in this.dataSource ? this.dataSource.manualPagination : void 0, o = "manualFiltering" in this.dataSource ? this.dataSource.manualFiltering : void 0, l = "manualSorting" in this.dataSource ? this.dataSource.manualSorting : void 0;
605
+ this.list = t, this.loaderState = P.useNew(), this.manualPagination = a ?? !1, this.manualFiltering = o ?? this.manualPagination, this.manualSorting = l ?? this.manualPagination, this.list.filters.forEach((c) => c.onFilterUpdated(() => this.reset())), (u = this.list.search) == null || u.onUpdated(() => this.reset());
591
606
  }
592
607
  static useNew(t, e = {}) {
593
- return new D(t, e);
608
+ return new x(t, e);
594
609
  }
595
610
  reset() {
596
611
  this.loaderState.reset();
@@ -616,7 +631,7 @@ class D {
616
631
  }), this.useObserveBatchData(e, t), this.useObserveBatchLoadingState(e, t);
617
632
  }
618
633
  useObserveBatchLoadingState(t, e) {
619
- L(() => (this.loaderState.setBatchLoadingState(
634
+ E(() => (this.loaderState.setBatchLoadingState(
620
635
  e,
621
636
  t.state.value
622
637
  ), t.state.observe((s) => {
@@ -624,12 +639,12 @@ class D {
624
639
  })), [t, e]);
625
640
  }
626
641
  useObserveBatchData(t, e) {
627
- const s = (i) => {
628
- const { data: o, itemTotalCount: l } = i;
642
+ const s = (a) => {
643
+ const { data: o, itemTotalCount: l } = a;
629
644
  this.loaderState.setDataBatch(e, o), l !== void 0 && this.list.batches.updateItemTotalCount(l);
630
645
  };
631
- L(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((i) => {
632
- i.isSet && s(i.value);
646
+ E(() => (t.value.value.isSet && s(t.value.value.value), t.value.observe((a) => {
647
+ a.isSet && s(a.value);
633
648
  })), [t, e]);
634
649
  }
635
650
  getDataLoaderOptions(t) {
@@ -657,19 +672,19 @@ class D {
657
672
  const e = this.dataSource, s = this.getDataLoaderOptions(t);
658
673
  if ("staticData" in e)
659
674
  return q(
660
- async (i) => ({
661
- data: i,
662
- itemTotalCount: i.length
675
+ async (a) => ({
676
+ data: a,
677
+ itemTotalCount: a.length
663
678
  }),
664
679
  [e.staticData]
665
680
  );
666
681
  if ("asyncLoader" in e) {
667
- const i = e.asyncLoader;
668
- return q(i, [s]);
682
+ const a = e.asyncLoader;
683
+ return q(a, [s]);
669
684
  }
670
685
  if ("asyncResourceFactory" in e) {
671
- const i = e.asyncResourceFactory;
672
- return i(s);
686
+ const a = e.asyncResourceFactory;
687
+ return a(s);
673
688
  }
674
689
  throw new Error("Unknown data source");
675
690
  }
@@ -701,7 +716,7 @@ class Ie {
701
716
  this.onUpdateCallbacks.add(t);
702
717
  }
703
718
  }
704
- const E = class E {
719
+ const F = class F {
705
720
  constructor(t, e = {}) {
706
721
  n(this, "list");
707
722
  n(this, "textValue");
@@ -709,15 +724,15 @@ const E = class E {
709
724
  n(this, "onAction");
710
725
  n(this, "fallback");
711
726
  n(this, "renderFn");
712
- const { onAction: s, fallback: i, textValue: o, href: l, renderFn: c } = e;
713
- this.list = t, this.textValue = o, this.renderFn = c, this.href = l, this.onAction = s, this.fallback = i;
727
+ const { onAction: s, fallback: a, textValue: o, href: l, renderFn: u } = e;
728
+ this.list = t, this.textValue = o, this.renderFn = u, this.href = l, this.onAction = s, this.fallback = a;
714
729
  }
715
730
  render(t) {
716
- return (this.renderFn ?? E.fallbackRenderItemFn)(t);
731
+ return (this.renderFn ?? F.fallbackRenderItemFn)(t);
717
732
  }
718
733
  };
719
- n(E, "fallbackRenderItemFn", (t) => Y("pre", void 0, JSON.stringify(t)));
720
- let I = E, ke = class rt {
734
+ n(F, "fallbackRenderItemFn", (t) => J("pre", void 0, JSON.stringify(t)));
735
+ let I = F, ke = class rt {
721
736
  constructor(t) {
722
737
  n(this, "filters");
723
738
  n(this, "itemView");
@@ -731,16 +746,18 @@ let I = E, ke = class rt {
731
746
  const {
732
747
  itemView: e,
733
748
  filters: s = [],
734
- sorting: i = [],
749
+ sorting: a = [],
735
750
  batchesController: o,
736
751
  hasAction: l,
737
- onChange: c
752
+ onChange: u
738
753
  } = t;
739
- this.items = new ve(this), this.filters = s.map((u) => new Fe(this, u)), this.sorting = i.map((u) => new Le(this, u)), this.search = t.search ? new Ie(this, t.search) : void 0, this.itemView = new I(this, e), this.batches = new ye(this, o), this.loader = D.useNew(this, t.loader), this.reactTable = P.useNew(this, c, {
754
+ this.items = new ve(this), this.filters = s.map((c) => new Ce(this, c)), this.sorting = a.map((c) => new Le(this, c)), this.search = t.search ? new Ie(this, t.search) : void 0, this.itemView = new I(this, e), this.batches = new ye(this, o), this.loader = x.useNew(this, t.loader), this.reactTable = B.useNew(this, u, {
740
755
  manualFiltering: this.loader.manualFiltering,
741
756
  manualPagination: this.loader.manualPagination,
742
757
  manualSorting: this.loader.manualSorting
743
- }), this.hasAction = l;
758
+ }), E(() => {
759
+ this.filters.forEach((c) => c.deleteUnknownFilterValues());
760
+ }, [this.filters]), this.hasAction = l;
744
761
  }
745
762
  static useNew(t) {
746
763
  return new rt(t);
@@ -766,96 +783,96 @@ let I = E, ke = class rt {
766
783
  return !this.loader.useIsLoading() && this.items.entries.length === 0;
767
784
  }
768
785
  };
769
- const Ae = "flow--list--items", Be = "flow--list--items--is-loading", J = {
786
+ const Ae = "flow--list--items", Ve = "flow--list--items--is-loading", _ = {
770
787
  items: Ae,
771
- isLoading: Be
772
- }, Pe = "flow--list--items--item", xe = "flow--list--items--item--has-action", k = {
773
- item: Pe,
774
- hasAction: xe
775
- }, De = (a) => {
776
- const { data: t, children: e } = a, s = m(), i = s.itemView, o = i.onAction, l = i.textValue ? i.textValue(t) : void 0, c = o ? () => o(t) : void 0, u = i.href ? i.href(t) : void 0, d = s.hasAction || !!c || !!u, b = C(k.item, d && k.hasAction);
788
+ isLoading: Ve
789
+ }, Be = "flow--list--items--item", Pe = "flow--list--items--item--has-action", k = {
790
+ item: Be,
791
+ hasAction: Pe
792
+ }, xe = (i) => {
793
+ const { data: t, children: e } = i, s = m(), a = s.itemView, o = a.onAction, l = a.textValue ? a.textValue(t) : void 0, u = o ? () => o(t) : void 0, c = a.href ? a.href(t) : void 0, h = s.hasAction || !!u || !!c, b = C(k.item, h && k.hasAction);
777
794
  return /* @__PURE__ */ r.createElement(
778
- B.GridListItem,
795
+ V.GridListItem,
779
796
  {
780
797
  className: b,
781
- onAction: c,
798
+ onAction: u,
782
799
  textValue: l,
783
- href: u
800
+ href: c
784
801
  },
785
- e ?? i.render(t)
802
+ e ?? a.render(t)
786
803
  );
787
- }, Ve = (a) => /* @__PURE__ */ r.createElement(B.GridListItem, { textValue: "-", className: k.item }, a.children), Ne = () => {
788
- const a = v(g);
789
- return /* @__PURE__ */ r.createElement(Ot, null, /* @__PURE__ */ r.createElement(qt, null), /* @__PURE__ */ r.createElement(et, null, a.format("list.noResult.heading")), /* @__PURE__ */ r.createElement(f, null, a.format("list.noResult.text")));
804
+ }, De = (i) => /* @__PURE__ */ r.createElement(V.GridListItem, { textValue: "-", className: k.item }, i.children), Ne = () => {
805
+ const i = v(g);
806
+ return /* @__PURE__ */ r.createElement(Ot, null, /* @__PURE__ */ r.createElement(qt, null), /* @__PURE__ */ r.createElement(et, null, i.format("list.noResult.heading")), /* @__PURE__ */ r.createElement(f, null, i.format("list.noResult.text")));
790
807
  }, Re = () => /* @__PURE__ */ r.createElement(st, null, /* @__PURE__ */ r.createElement(et, null, /* @__PURE__ */ r.createElement(K, { width: "200px" })), /* @__PURE__ */ r.createElement(f, null, /* @__PURE__ */ r.createElement(K, { width: "300px" }))), Me = () => {
791
808
  const t = m().itemView.fallback ?? /* @__PURE__ */ r.createElement(Re, null);
792
- return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ r.createElement(Ve, { key: s }, St(t)));
793
- }, ze = (a) => {
794
- const { className: t, ...e } = a, s = m(), i = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), c = s.items.entries.map((d) => /* @__PURE__ */ r.createElement(De, { key: d.id, data: d.data })), u = C(
795
- J.items,
809
+ return Array.from(Array(5)).map((e, s) => /* @__PURE__ */ r.createElement(De, { key: s }, St(t)));
810
+ }, ze = (i) => {
811
+ const { className: t, ...e } = i, s = m(), a = s.loader.useIsLoading(), o = s.loader.useIsInitiallyLoading(), l = s.useIsEmpty(), u = s.items.entries.map((h) => /* @__PURE__ */ r.createElement(xe, { key: h.id, data: h.data })), c = C(
812
+ _.items,
796
813
  t,
797
- i && J.isLoading
814
+ a && _.isLoading
798
815
  );
799
- return l ? /* @__PURE__ */ r.createElement(Ne, null) : /* @__PURE__ */ r.createElement("div", { "aria-hidden": o, "aria-busy": i }, /* @__PURE__ */ r.createElement(B.GridList, { className: u, ...e }, o ? /* @__PURE__ */ r.createElement(Me, null) : c));
800
- }, nt = (a) => null, Ue = () => nt, ot = (a) => null, $e = () => ot, lt = (a) => null, Oe = () => lt, ct = (a) => null, qe = () => ct, ut = (a) => null, He = () => ut, Ke = "flow--list--footer", Ge = {
816
+ return l ? /* @__PURE__ */ r.createElement(Ne, null) : /* @__PURE__ */ r.createElement("div", { "aria-hidden": o, "aria-busy": a }, /* @__PURE__ */ r.createElement(V.GridList, { className: c, ...e }, o ? /* @__PURE__ */ r.createElement(Me, null) : u));
817
+ }, nt = (i) => null, Ue = () => nt, ot = (i) => null, $e = () => ot, lt = (i) => null, Oe = () => lt, ct = (i) => null, qe = () => ct, ut = (i) => null, He = () => ut, Ke = "flow--list--footer", Ge = {
801
818
  footer: Ke
802
- }, je = (a) => {
803
- const t = v(g), e = m(), s = e.batches, i = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), c = s.getVisibleItemsCount();
819
+ }, je = (i) => {
820
+ const t = v(g), e = m(), s = e.batches, a = e.loader.useIsInitiallyLoading(), o = e.useIsEmpty(), l = s.getTotalItemsCount(), u = s.getVisibleItemsCount();
804
821
  if (o)
805
822
  return null;
806
- const u = i ? /* @__PURE__ */ r.createElement(Gt, { width: "200px" }) : t.format("list.paginationInfo", {
807
- visibleItemsCount: c,
823
+ const c = a ? /* @__PURE__ */ r.createElement(Gt, { width: "200px" }) : t.format("list.paginationInfo", {
824
+ visibleItemsCount: u,
808
825
  totalItemsCount: l
809
826
  });
810
- return /* @__PURE__ */ r.createElement(f, { ...a }, u);
811
- }, We = (a) => {
812
- const t = v(g), e = m(), s = e.loader.useIsLoading(), i = e.loader.useIsInitiallyLoading();
827
+ return /* @__PURE__ */ r.createElement(f, { ...i }, c);
828
+ }, We = (i) => {
829
+ const t = v(g), e = m(), s = e.loader.useIsLoading(), a = e.loader.useIsInitiallyLoading();
813
830
  return !e.batches.hasNextBatch() && !s ? null : /* @__PURE__ */ r.createElement(
814
831
  p,
815
832
  {
816
- isPending: s && !i,
817
- isDisabled: i,
818
- ...a,
833
+ isPending: s && !a,
834
+ isDisabled: a,
835
+ ...i,
819
836
  onPress: () => e.batches.nextBatch(),
820
837
  variant: "plain",
821
838
  size: "s"
822
839
  },
823
840
  t.format("list.showMore")
824
841
  );
825
- }, Je = () => /* @__PURE__ */ r.createElement("div", { className: Ge.footer }, /* @__PURE__ */ r.createElement(je, null), /* @__PURE__ */ r.createElement(We, null));
826
- function dt(a) {
842
+ }, _e = () => /* @__PURE__ */ r.createElement("div", { className: Ge.footer }, /* @__PURE__ */ r.createElement(je, null), /* @__PURE__ */ r.createElement(We, null));
843
+ function ht(i) {
827
844
  return null;
828
845
  }
829
- const Ye = () => dt, Qe = It("List", (a) => {
830
- var V, N, R, M, z;
831
- const { children: t, batchSize: e, onChange: s, ...i } = a, o = (V = S(
846
+ const Je = () => ht, Ye = It("List", (i) => {
847
+ var D, N, R, M, z;
848
+ const { children: t, batchSize: e, onChange: s, ...a } = i, o = (D = S(
832
849
  t,
833
850
  nt
834
- )) == null ? void 0 : V.props, l = (N = S(
851
+ )) == null ? void 0 : D.props, l = (N = S(
835
852
  t,
836
853
  Ht
837
- )) == null ? void 0 : N.props, c = (R = S(t, ut)) == null ? void 0 : R.props, u = {
854
+ )) == null ? void 0 : N.props, u = (R = S(t, ut)) == null ? void 0 : R.props, c = {
838
855
  source: o ? {
839
856
  ...o,
840
857
  asyncLoader: o.children
841
858
  } : l ? {
842
859
  ...l,
843
860
  asyncResourceFactory: l.children
844
- } : c ? {
845
- staticData: c.data
861
+ } : u ? {
862
+ staticData: u.data
846
863
  } : void 0
847
- }, d = (M = S(t, dt)) == null ? void 0 : M.props, b = (z = S(t, ct)) == null ? void 0 : z.props, ht = ke.useNew({
864
+ }, h = (M = S(t, ht)) == null ? void 0 : M.props, b = (z = S(t, ct)) == null ? void 0 : z.props, dt = ke.useNew({
848
865
  onChange: s,
849
- loader: u,
866
+ loader: c,
850
867
  filters: G(t, ot).map(
851
868
  (y) => ({
852
869
  ...y.props,
853
870
  renderItem: y.props.children
854
871
  })
855
872
  ),
856
- search: d ? {
857
- render: d.children,
858
- textFieldProps: d
873
+ search: h ? {
874
+ render: h.children,
875
+ textFieldProps: h
859
876
  } : void 0,
860
877
  sorting: G(t, lt).map((y) => y.props),
861
878
  itemView: b ? {
@@ -865,22 +882,22 @@ const Ye = () => dt, Qe = It("List", (a) => {
865
882
  batchesController: {
866
883
  batchSize: e
867
884
  },
868
- hasAction: !!a.onAction
885
+ hasAction: !!i.onAction
869
886
  });
870
887
  return /* @__PURE__ */ r.createElement(
871
- it.Provider,
888
+ at.Provider,
872
889
  {
873
890
  value: {
874
- list: ht
891
+ list: dt
875
892
  }
876
893
  },
877
894
  /* @__PURE__ */ r.createElement(se, null),
878
- /* @__PURE__ */ r.createElement("div", { className: be.list }, /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ze, { ...i }), /* @__PURE__ */ r.createElement(Je, null))
895
+ /* @__PURE__ */ r.createElement("div", { className: be.list }, /* @__PURE__ */ r.createElement(pe, null), /* @__PURE__ */ r.createElement(ze, { ...a }), /* @__PURE__ */ r.createElement(_e, null))
879
896
  );
880
- }), Xe = () => Qe, Ms = () => ({
881
- List: Xe(),
897
+ }), Qe = () => Ye, Ms = () => ({
898
+ List: Qe(),
882
899
  Filter: $e(),
883
- Search: Ye(),
900
+ Search: Je(),
884
901
  Sorting: Oe(),
885
902
  Item: qe(),
886
903
  ItemView: st,
@@ -889,14 +906,14 @@ const Ye = () => dt, Qe = It("List", (a) => {
889
906
  LoaderAsyncResource: Kt()
890
907
  });
891
908
  export {
892
- Qe as List,
909
+ Ye as List,
893
910
  ot as ListFilter,
894
911
  ct as ListItem,
895
912
  st as ListItemView,
896
913
  nt as ListLoaderAsync,
897
914
  lt as ListSorting,
898
915
  ut as ListStaticData,
899
- Xe as TypedList,
916
+ Qe as TypedList,
900
917
  $e as TypedListFilter,
901
918
  qe as TypedListItem,
902
919
  Ue as TypedListLoaderAsync,
package/dist/Tabs.js CHANGED
@@ -1,32 +1,32 @@
1
1
  "use client"
2
2
  /* */
3
- import e, { useRef as h, useState as v, useEffect as M, useId as g, createContext as I, useContext as P } from "react";
3
+ import e, { useRef as g, useState as v, useEffect as M, useId as w, createContext as h, useContext as I } from "react";
4
4
  import * as E from "react-aria-components";
5
5
  import u from "clsx";
6
- import { TunnelExit as C, TunnelProvider as y, TunnelEntry as f } from "@mittwald/react-tunnel";
7
- import { f as S } from "./flowComponent-DHPUcYyM.js";
6
+ import { TunnelExit as C, TunnelProvider as P, TunnelEntry as f } from "@mittwald/react-tunnel";
7
+ import { f as y } from "./flowComponent-DHPUcYyM.js";
8
8
  import { useCallbackRef as O } from "use-callback-ref";
9
- import { a as B, C as K } from "./ContextMenuTrigger-BdJf5T8A.js";
10
- import { M as A } from "./MenuItem-DcfYvfPJ.js";
11
- import { B as L } from "./Button-DQtavSbo.js";
9
+ import { a as S, C as A } from "./ContextMenuTrigger-BdJf5T8A.js";
10
+ import { M as B } from "./MenuItem-DcfYvfPJ.js";
11
+ import { B as K } from "./Button-DQtavSbo.js";
12
12
  import "@tabler/icons-react";
13
13
  import "./Icon-DPoIVASu.js";
14
- import { I as F } from "./IconContextMenu-jwoVcLvd.js";
15
- import { T as R } from "./Text-Sd5q3Yme.js";
14
+ import { I as L } from "./IconContextMenu-jwoVcLvd.js";
15
+ import { T as F } from "./Text-Sd5q3Yme.js";
16
16
  import "./propsContext-DzAKlmhS.js";
17
- import { P as W } from "./PropsContextProvider-C6Z4XGp6.js";
17
+ import { P as R } from "./PropsContextProvider-C6Z4XGp6.js";
18
18
  import "@react-aria/utils";
19
19
  import "remeda";
20
- const $ = "flow--tabs", k = "flow--tabs--list", j = {
21
- tabs: $,
22
- list: k
23
- }, q = "flow--tabs--tab-list", z = "flow--tabs--tab-list--context-menu-button", D = "flow--tabs--tab-list--titles", G = "flow--tabs--tab-list--collapsed", b = {
24
- tabList: q,
25
- contextMenuButton: z,
26
- titles: D,
27
- collapsed: G
28
- }, H = () => {
29
- const s = h(), [n, r] = v(!1), o = O(null, (t) => {
20
+ const W = "flow--tabs", $ = "flow--tabs--list", k = {
21
+ tabs: W,
22
+ list: $
23
+ }, j = "flow--tabs--tab-list", q = "flow--tabs--tab-list--context-menu-button", z = "flow--tabs--tab-list--titles", D = "flow--tabs--tab-list--collapsed", b = {
24
+ tabList: j,
25
+ contextMenuButton: q,
26
+ titles: z,
27
+ collapsed: D
28
+ }, G = () => {
29
+ const s = g(), [n, r] = v(!1), o = O(null, (t) => {
30
30
  l(), c(t);
31
31
  }), a = ([
32
32
  t
@@ -49,38 +49,37 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
49
49
  ref: o,
50
50
  isOverflowing: n
51
51
  };
52
- }, J = "flow--tabs--tab-title", Q = "flow--tabs--tab-title--text", U = "flow--tabs--tab-title--menu-item", p = {
53
- tabTitle: J,
54
- text: Q,
55
- menuItem: U
56
- }, V = (s) => {
52
+ }, H = "flow--tabs--tab-title", J = "flow--tabs--tab-title--text", Q = "flow--tabs--tab-title--menu-item", p = {
53
+ tabTitle: H,
54
+ text: J,
55
+ menuItem: Q
56
+ }, U = (s) => {
57
57
  const { className: n, ...r } = s, o = u(n, p.tabTitle);
58
58
  return /* @__PURE__ */ e.createElement("div", { ...r, className: o, "data-selected": !0 }, /* @__PURE__ */ e.createElement(C, { id: "ActiveTitle" }));
59
- }, X = (s) => {
60
- const { selection: n, disabledKeys: r, onContextMenuSelectionChange: o } = s, a = g(), c = H(), l = c.isOverflowing, t = u(b.tabList, l && b.collapsed), i = (N) => {
61
- const [x] = N;
62
- x && o(x);
63
- }, m = /* @__PURE__ */ e.createElement(E.TabList, { className: b.titles, ref: c.ref }, /* @__PURE__ */ e.createElement(C, { id: "Titles" })), d = l && /* @__PURE__ */ e.createElement(V, { id: a }), T = l && /* @__PURE__ */ e.createElement(B, null, /* @__PURE__ */ e.createElement(
64
- L,
59
+ }, V = (s) => {
60
+ const { selection: n, disabledKeys: r, onContextMenuSelectionChange: o } = s, a = w(), c = G(), l = c.isOverflowing, t = u(b.tabList, l && b.collapsed), i = (x) => {
61
+ o(x);
62
+ }, m = /* @__PURE__ */ e.createElement(E.TabList, { className: b.titles, ref: c.ref }, /* @__PURE__ */ e.createElement(C, { id: "Titles" })), d = l && /* @__PURE__ */ e.createElement(U, { id: a }), T = l && /* @__PURE__ */ e.createElement(S, null, /* @__PURE__ */ e.createElement(
63
+ K,
65
64
  {
66
65
  variant: "soft",
67
66
  className: b.contextMenuButton,
68
67
  color: "secondary",
69
68
  "aria-labelledby": a
70
69
  },
71
- /* @__PURE__ */ e.createElement(F, null)
70
+ /* @__PURE__ */ e.createElement(L, null)
72
71
  ), /* @__PURE__ */ e.createElement(
73
- K,
72
+ A,
74
73
  {
75
74
  disabledKeys: r,
76
75
  selectedKeys: n ? [n] : void 0,
77
76
  selectionMode: "navigation",
78
- onSelectionChange: i
77
+ onAction: (x) => i(x)
79
78
  },
80
79
  /* @__PURE__ */ e.createElement(C, { id: "ContextMenuItems" })
81
80
  ));
82
81
  return /* @__PURE__ */ e.createElement("div", { className: t }, m, d, T);
83
- }, Ee = S("Tabs", (s) => {
82
+ }, Ce = y("Tabs", (s) => {
84
83
  const {
85
84
  children: n,
86
85
  className: r,
@@ -88,10 +87,10 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
88
87
  disabledKeys: a,
89
88
  refProp: c,
90
89
  ...l
91
- } = s, t = u(j.tabs, r), [i, m] = v(
90
+ } = s, t = u(k.tabs, r), [i, m] = v(
92
91
  o
93
92
  );
94
- return /* @__PURE__ */ e.createElement(y, null, n, /* @__PURE__ */ e.createElement(
93
+ return /* @__PURE__ */ e.createElement(P, null, n, /* @__PURE__ */ e.createElement(
95
94
  E.Tabs,
96
95
  {
97
96
  slot: null,
@@ -103,7 +102,7 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
103
102
  ref: c
104
103
  },
105
104
  /* @__PURE__ */ e.createElement(
106
- X,
105
+ V,
107
106
  {
108
107
  selection: i,
109
108
  onContextMenuSelectionChange: m,
@@ -112,15 +111,15 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
112
111
  ),
113
112
  /* @__PURE__ */ e.createElement(C, { id: "Panels" })
114
113
  ));
115
- }), w = I({
114
+ }), N = h({
116
115
  id: "undefined"
117
- }), Y = () => P(w), Z = w.Provider, Te = (s) => {
118
- const { children: n, className: r, ...o } = s, { id: a } = Y(), c = u(p.tabTitle, r);
119
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(f, { id: "Titles" }, /* @__PURE__ */ e.createElement(E.Tab, { ...o, id: a, className: c }, (l) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(R, { emulateBoldWidth: !0 }, /* @__PURE__ */ e.createElement("span", { className: p.text }, n)), /* @__PURE__ */ e.createElement(f, { id: "ActiveTitle" }, l.isSelected && n)))), /* @__PURE__ */ e.createElement(f, { id: "ContextMenuItems" }, /* @__PURE__ */ e.createElement(A, { className: p.menuItem, id: a }, n)));
120
- }, _ = "flow--tabs--tab--tab-panel", ee = {
121
- tabPanel: _
122
- }, xe = (s) => {
123
- const { children: n, className: r, id: o, ...a } = s, c = u(ee.tabPanel, r), l = g(), t = o ?? l, i = (m) => {
116
+ }), X = () => I(N), Y = N.Provider, Ee = (s) => {
117
+ const { children: n, className: r, ...o } = s, { id: a } = X(), c = u(p.tabTitle, r);
118
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(f, { id: "Titles" }, /* @__PURE__ */ e.createElement(E.Tab, { ...o, id: a, className: c }, (l) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(F, { emulateBoldWidth: !0 }, /* @__PURE__ */ e.createElement("span", { className: p.text }, n)), /* @__PURE__ */ e.createElement(f, { id: "ActiveTitle" }, l.isSelected && n)))), /* @__PURE__ */ e.createElement(f, { id: "ContextMenuItems" }, /* @__PURE__ */ e.createElement(B, { className: p.menuItem, id: a }, n)));
119
+ }, Z = "flow--tabs--tab--tab-panel", _ = {
120
+ tabPanel: Z
121
+ }, Te = (s) => {
122
+ const { children: n, className: r, id: o, ...a } = s, c = u(_.tabPanel, r), l = w(), t = o ?? l, i = (m) => {
124
123
  const d = m.state.selectedKey === t, T = {
125
124
  Content: {
126
125
  isActive: d
@@ -130,7 +129,7 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
130
129
  }
131
130
  };
132
131
  return /* @__PURE__ */ e.createElement(
133
- W,
132
+ R,
134
133
  {
135
134
  props: T,
136
135
  dependencies: [d, n]
@@ -138,7 +137,7 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
138
137
  n
139
138
  );
140
139
  };
141
- return /* @__PURE__ */ e.createElement(f, { id: "Panels" }, /* @__PURE__ */ e.createElement(Z, { value: { id: t } }, /* @__PURE__ */ e.createElement(
140
+ return /* @__PURE__ */ e.createElement(f, { id: "Panels" }, /* @__PURE__ */ e.createElement(Y, { value: { id: t } }, /* @__PURE__ */ e.createElement(
142
141
  E.TabPanel,
143
142
  {
144
143
  className: c,
@@ -150,8 +149,8 @@ const $ = "flow--tabs", k = "flow--tabs--list", j = {
150
149
  )));
151
150
  };
152
151
  export {
153
- xe as Tab,
154
- Te as TabTitle,
155
- Ee as Tabs,
156
- Ee as default
152
+ Te as Tab,
153
+ Ee as TabTitle,
154
+ Ce as Tabs,
155
+ Ce as default
157
156
  };
@@ -6,6 +6,7 @@ import { FilterValue } from './FilterValue';
6
6
 
7
7
  export declare class Filter<T, TProp extends PropertyName<T>, TMatchValue> {
8
8
  private _values?;
9
+ private _valuesFromTableState?;
9
10
  readonly list: List<T>;
10
11
  readonly property: PropertyName<T>;
11
12
  readonly mode: FilterMode;
@@ -20,11 +21,15 @@ export declare class Filter<T, TProp extends PropertyName<T>, TMatchValue> {
20
21
  protected getTableColumnFilter(): ColumnFilter | undefined;
21
22
  private getTableColumn;
22
23
  getValue(): unknown;
24
+ private getValuesFromTableState;
25
+ private checkIfValueIsUnknown;
26
+ deleteUnknownFilterValues(): void;
23
27
  get values(): FilterValue[];
28
+ private get valuesFromTableState();
24
29
  getArrayValue(): FilterValue[];
25
30
  isValueActive(value: FilterValue): boolean;
26
31
  isActive(): boolean;
27
- deactivateValue(newValue: FilterValue): void;
32
+ deactivateValue(value: FilterValue): void;
28
33
  clearValues(): void;
29
34
  toggleValue(newValue: FilterValue): void;
30
35
  onFilterUpdated(cb: () => unknown): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.205",
3
+ "version": "0.1.0-alpha.207",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -292,7 +292,7 @@
292
292
  "dependencies": {
293
293
  "@chakra-ui/live-region": "^2.1.0",
294
294
  "@internationalized/string-compiler": "^3.2.4",
295
- "@mittwald/react-tunnel": "^0.1.0-alpha.205",
295
+ "@mittwald/react-tunnel": "^0.1.0-alpha.207",
296
296
  "@mittwald/react-use-promise": "^2.3.13",
297
297
  "@react-aria/utils": "^3.25.1",
298
298
  "@react-types/shared": "^3.24.1",
@@ -318,7 +318,7 @@
318
318
  },
319
319
  "devDependencies": {
320
320
  "@faker-js/faker": "^8.4.1",
321
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.205",
321
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.207",
322
322
  "@mittwald/react-use-promise": "^2.3.13",
323
323
  "@nx/storybook": "^19.5.6",
324
324
  "@storybook/addon-a11y": "^8.2.7",
@@ -396,5 +396,5 @@
396
396
  "optional": true
397
397
  }
398
398
  },
399
- "gitHead": "d3aceff468b18036899bbdbe516272dff97b4329"
399
+ "gitHead": "9a013d07dc863c485ab5bad240b8bc56e15c35c3"
400
400
  }