@caspeco/casper-ui-library 12.1.0 → 12.1.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.
Files changed (34) hide show
  1. package/dist/_virtual/builtin_esm-external-require-react.js +1 -1
  2. package/dist/components/combobox/combobox.d.ts.map +1 -1
  3. package/dist/components/combobox/combobox.js +88 -93
  4. package/dist/components/image-upload/image-cropper.js +1 -1
  5. package/dist/components/image-upload/image-upload-dropzone.js +2 -6
  6. package/dist/components/menu/menu-group.js +0 -1
  7. package/dist/components/rich-text-editor/rich-text-editor-control.js +2 -6
  8. package/dist/components/table/table.d.ts.map +1 -1
  9. package/dist/components/table/table.js +1 -1
  10. package/dist/node_modules/@dnd-kit/abstract/index.js +1 -1
  11. package/dist/node_modules/@dnd-kit/dom/index.js +11 -16
  12. package/dist/node_modules/@dnd-kit/dom/sortable.js +4 -4
  13. package/dist/node_modules/@dnd-kit/dom/utilities.js +2 -6
  14. package/dist/node_modules/@dnd-kit/react/hooks.js +2 -5
  15. package/dist/node_modules/@dnd-kit/react/sortable.js +4 -4
  16. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +16 -30
  17. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +9 -18
  18. package/dist/node_modules/@tiptap/core/dist/index.js +838 -790
  19. package/dist/node_modules/@tiptap/extension-code/dist/index.js +14 -3
  20. package/dist/node_modules/@tiptap/extension-link/dist/index.js +114 -97
  21. package/dist/node_modules/@tiptap/extension-list/dist/index.js +133 -120
  22. package/dist/node_modules/@tiptap/extensions/dist/index.js +33 -33
  23. package/dist/node_modules/country-flag-icons/modules/react/3x2/index.js +1 -2
  24. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +1 -1
  25. package/dist/node_modules/date-fns/getISOWeek.js +1 -1
  26. package/dist/node_modules/date-fns/getWeek.js +1 -1
  27. package/dist/node_modules/libphonenumber-js/es6-modern/metadata.js +1 -1
  28. package/dist/node_modules/prosemirror-commands/dist/index.js +1 -1
  29. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +2 -6
  30. package/dist/node_modules/prosemirror-history/dist/index.js +27 -22
  31. package/dist/node_modules/prosemirror-model/dist/index.js +32 -35
  32. package/dist/node_modules/prosemirror-view/dist/index.js +10 -11
  33. package/dist/packages/casper-ui-library/node_modules/@tiptap/react/dist/index.js +74 -57
  34. package/package.json +13 -13
@@ -2,7 +2,7 @@ import { __commonJSMin as e } from "./_rolldown/runtime.js";
2
2
  import * as t from "react";
3
3
  //#region builtin:esm-external-require-react
4
4
  var n = /* @__PURE__ */ e(((e, n) => {
5
- n.exports = { ...t };
5
+ n.exports = Object.prototype.hasOwnProperty.call(t, "module.exports") ? t["module.exports"] : { ...t };
6
6
  }));
7
7
  //#endregion
8
8
  export default n();
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIX,aAAa,EAEb,MAAM,SAAS,CAAC;AA6GjB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACxB,EAAE,EACF,KAAU,EACV,cAAsB,EACtB,aAAkB,EAClB,IAAW,EACX,OAAmB,EACnB,WAAmB,EACnB,QAAQ,EACR,KAAK,EACL,eAAe,EACf,QAAQ,EACR,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAiB,EACjB,WAAuB,EACvB,qBAAiD,EACjD,qBAAqB,EACrB,GAAG,KAAK,EACR,EAAE,aAAa,+BAgWf"}
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIX,aAAa,EAEb,MAAM,SAAS,CAAC;AAgHjB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACxB,EAAE,EACF,KAAU,EACV,cAAsB,EACtB,aAAoC,EACpC,IAAW,EACX,OAAmB,EACnB,WAAmB,EACnB,QAAQ,EACR,KAAK,EACL,eAAe,EACf,QAAQ,EACR,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAiB,EACjB,WAAuB,EACvB,qBAAiD,EACjD,qBAAqB,EACrB,GAAG,KAAK,EACR,EAAE,aAAa,+BAgWf"}
@@ -75,7 +75,7 @@ var f = e(), p = (e, t) => {
75
75
  r[9] === Symbol.for("react.memo_cache_sentinel") ? (u = (e) => {
76
76
  c((t) => [...t, e]);
77
77
  }, d = () => {
78
- c(v);
78
+ c(y);
79
79
  }, r[9] = u, r[10] = d) : (u = r[9], d = r[10]);
80
80
  let p;
81
81
  return r[11] !== l || r[12] !== o ? (p = {
@@ -91,12 +91,12 @@ var f = e(), p = (e, t) => {
91
91
  t[e.id] = [...r], e.children && e.children.forEach((t) => n(t, [...r, e.label]));
92
92
  }
93
93
  return e.forEach((e) => n(e, [])), t;
94
- };
95
- function _({ id: e, label: f = "", isSingleSelect: _ = !1, selectedItems: v = [], size: te = "md", variant: ne = "outline", asPlainText: y = !1, onSearch: b, items: x, maxVisibleItems: S, onChange: C, onBlur: w, isDisabled: T, isReadOnly: E, isRequired: re, placeholder: ie, footerContent: ae, popoverWidth: oe, popoverPlacement: se, collapsed: D = !1, folderStyle: O = "grouped", keepSearchAfterSelect: k = O === "stacked", parentSelectsChildren: A, ...j }) {
96
- let [M, N] = s(y ? v[0]?.label ?? "" : ""), [ce, P] = s(!1), le = t(n), F = o(null), I = o(null), L = g(x), R = M.toLowerCase() === v[0]?.label.toLowerCase(), z = M.length > 0 && !(y && R), B = d(), V = B?.invalid ?? !1, H = T ?? B?.disabled ?? !1, U = E ?? B?.readOnly ?? !1, W = re ?? B?.required ?? !1, G = L.current;
97
- if (z) {
94
+ }, _ = [];
95
+ function v({ id: e, label: f = "", isSingleSelect: v = !1, selectedItems: y = _, size: te = "md", variant: ne = "outline", asPlainText: b = !1, onSearch: x, items: S, maxVisibleItems: C, onChange: w, onBlur: T, isDisabled: E, isReadOnly: D, isRequired: O, placeholder: re, footerContent: ie, popoverWidth: k, popoverPlacement: ae, collapsed: oe = !1, folderStyle: A = "grouped", keepSearchAfterSelect: se = A === "stacked", parentSelectsChildren: j, ...ce }) {
96
+ let [M, N] = s(b ? y[0]?.label ?? "" : ""), [le, P] = s(!1), F = t(n), I = o(null), L = o(null), R = g(S), z = M.toLowerCase() === y[0]?.label.toLowerCase(), B = M.length > 0 && !(b && z), V = d(), H = V?.invalid ?? !1, U = E ?? V?.disabled ?? !1, W = D ?? V?.readOnly ?? !1, G = O ?? V?.required ?? !1, K = R.current;
97
+ if (B) {
98
98
  let e = [], t = M.toLowerCase();
99
- if (O === "stacked") {
99
+ if (A === "stacked") {
100
100
  let e = (n) => n.map((n) => {
101
101
  let r = n.label.toLowerCase().includes(t), i = n.children && n.children.length > 0;
102
102
  if (r) return n;
@@ -108,140 +108,135 @@ function _({ id: e, label: f = "", isSingleSelect: _ = !1, selectedItems: v = []
108
108
  }
109
109
  }
110
110
  }).filter(Boolean);
111
- G = e(x);
111
+ K = e(S);
112
112
  } else {
113
113
  let t = (n) => {
114
114
  e.push(n), n.children && n.children.forEach(t);
115
115
  };
116
- x.forEach(t), G = e.filter((e) => {
116
+ S.forEach(t), K = e.filter((e) => {
117
117
  let t = e.label.toLowerCase().includes(M.toLowerCase());
118
118
  return (!(e.children && e.children.length > 0) || e.isSelectableParent) && t;
119
119
  });
120
120
  }
121
121
  }
122
- let K = p(G, I), [q, ue] = s([]), J = m(K, y, N, H, b, () => {
123
- if (O !== "stacked") {
124
- if (_) {
125
- let e = v[0]?.id, t = e ? h(x, e) ?? [] : [];
126
- L.setPath(t);
127
- return;
128
- }
129
- ue(v);
122
+ let q = p(K, L), [J, ue] = s([]), Y = m(q, b, N, U, x, () => {
123
+ if (A !== "stacked") {
124
+ if (v) {
125
+ let e = y[0]?.id, t = e ? h(S, e) ?? [] : [];
126
+ R.setPath(t);
127
+ } else ue(y);
130
128
  }
131
- }), [Y, de] = s({
132
- isOpen: J.isOpen,
133
- selectedItems: v,
134
- asPlainText: y
129
+ }), [X, de] = s({
130
+ isOpen: Y.isOpen,
131
+ selectedItems: y,
132
+ asPlainText: b
135
133
  });
136
- (Y.isOpen !== J.isOpen || Y.selectedItems !== v || Y.asPlainText !== y) && (de({
137
- isOpen: J.isOpen,
138
- selectedItems: v,
139
- asPlainText: y
140
- }), y && !J.isOpen && N(v[0]?.label ?? "")), z || (G = [...q, ...G.filter((e) => !q.find((t) => t.label === e.label))]);
141
- let X = !1;
142
- U ? G = v : (X = G.length > (S ?? Infinity), G = G.slice(0, S));
143
- let Z = ee(x), fe = (e) => {
144
- let t = L.opened.length > 0 && L.opened[L.opened.length - 1]?.id === e.id, n = e.children && e.children.length > 0;
145
- if (!z && !t && n) {
146
- L.open(e), requestAnimationFrame(() => K.set(1));
147
- return;
148
- }
149
- return _ ? [e] : Q(e);
150
- }, pe = (e) => {
134
+ (X.isOpen !== Y.isOpen || X.selectedItems !== y || X.asPlainText !== b) && (de({
135
+ isOpen: Y.isOpen,
136
+ selectedItems: y,
137
+ asPlainText: b
138
+ }), b && !Y.isOpen && N(y[0]?.label ?? "")), B || (K = [...J, ...K.filter((e) => !J.find((t) => t.label === e.label))]);
139
+ let Z = !1;
140
+ W ? K = y : (Z = K.length > (C ?? Infinity), K = K.slice(0, C));
141
+ let fe = ee(S), pe = (e) => {
142
+ let t = R.opened.length > 0 && R.opened[R.opened.length - 1]?.id === e.id, n = e.children && e.children.length > 0;
143
+ if (!B && !t && n) R.open(e), requestAnimationFrame(() => q.set(1));
144
+ else return v ? [e] : Q(e);
145
+ }, me = (e) => {
151
146
  let t = e.children && e.children.length > 0;
152
- if (!(t && !e.isSelectableParent && (_ || !A))) return _ ? [e] : t ? me(e) : Q(e);
153
- }, Q = (e) => v.some((t) => t.id === e.id) ? v.filter((t) => t.id !== e.id) : [...v, e];
154
- function me(e) {
147
+ if (!t || e.isSelectableParent || !v && j) return v ? [e] : t ? he(e) : Q(e);
148
+ }, Q = (e) => y.some((t) => t.id === e.id) ? y.filter((t) => t.id !== e.id) : [...y, e];
149
+ function he(e) {
155
150
  let t, n = [], r = (e) => {
156
151
  e.children && e.children.length > 0 ? (e.isSelectableParent && n.push(e), e.children.forEach(r)) : n.push(e);
157
152
  };
158
153
  r(e);
159
- let i = v.filter((e) => n.some((t) => t.id === e.id));
160
- return t = i.length > 0 && (!e.isSelectableParent || i.some((t) => t.id === e.id)) ? v.filter((e) => !i.some((t) => t.id === e.id)) : [...v, ...n.filter((e) => !v.some((t) => t.id === e.id))], t;
154
+ let i = y.filter((e) => n.some((t) => t.id === e.id));
155
+ return t = i.length > 0 && (!e.isSelectableParent || i.some((t) => t.id === e.id)) ? y.filter((e) => !i.some((t) => t.id === e.id)) : [...y, ...n.filter((e) => !y.some((t) => t.id === e.id))], t;
161
156
  }
162
- let he = (e) => {
163
- if (!e || U || H) return;
164
- if (I.current?.parentNode?.querySelector("input")?.focus(), e.id === "_back") {
165
- L.back();
157
+ let ge = (e) => {
158
+ if (!e || W || U) return;
159
+ if (L.current?.parentNode?.querySelector("input")?.focus(), e.id === "_back") {
160
+ R.back();
166
161
  return;
167
162
  }
168
163
  let t;
169
- t = O === "grouped" ? fe(e) : pe(e), t && (y ? N(t[0]?.label ?? "") : k || (N(""), b?.("")), _ && (t.length === 0 ? J.open() : J.close()), C && C(t));
170
- }, ge = () => {
171
- U || H || W || v.length === 0 || (F.current?.querySelector("input")?.focus(), N(""), b?.(""), C?.([]));
172
- }, _e = v.length === 0 ? ie ?? le.search : void 0;
164
+ t = A === "grouped" ? pe(e) : me(e), t && (b ? N(t[0]?.label ?? "") : se || (N(""), x?.("")), v && (t.length === 0 ? Y.open() : Y.close()), w && w(t));
165
+ }, _e = () => {
166
+ W || U || G || y.length === 0 || (I.current?.querySelector("input")?.focus(), N(""), x?.(""), w?.([]));
167
+ }, ve = y.length === 0 ? re ?? F.search : void 0;
173
168
  a(() => {
174
- let e = I.current?.querySelector("[role='listbox']");
175
- if (!e || !J.isOpen) return;
169
+ let e = L.current?.querySelector("[role='listbox']");
170
+ if (!e || !Y.isOpen) return;
176
171
  let t = (t) => {
177
172
  t.target === e && t.preventDefault();
178
173
  };
179
174
  return e.addEventListener("mousedown", t, !0), () => {
180
175
  e.removeEventListener("mousedown", t, !0);
181
176
  };
182
- }, [J.isOpen]);
183
- let ve = (e) => {
184
- F.current?.contains(e.relatedTarget) || (J.close(), P(!1), w && w(v));
177
+ }, [Y.isOpen]);
178
+ let ye = (e) => {
179
+ I.current?.contains(e.relatedTarget) || (Y.close(), P(!1), T && T(y));
185
180
  }, $ = {
186
181
  id: e,
187
- asPlainText: y,
182
+ asPlainText: b,
188
183
  inputValue: M,
189
- selectedItems: v,
190
- displayItems: G,
191
- toggleItem: he,
192
- clearSelection: ge,
193
- highlightState: K,
194
- openState: J,
195
- parentStrings: Z,
184
+ selectedItems: y,
185
+ displayItems: K,
186
+ toggleItem: ge,
187
+ clearSelection: _e,
188
+ highlightState: q,
189
+ openState: Y,
190
+ parentStrings: fe,
196
191
  size: te,
197
192
  variant: ne,
198
193
  label: f,
199
- placeHolderText: _e,
200
- isDisabled: H,
201
- isReadOnly: U,
202
- isInvalid: V,
203
- isRequired: W,
204
- collapsed: D,
205
- hasPendingDelete: ce,
194
+ placeHolderText: ve,
195
+ isDisabled: U,
196
+ isReadOnly: W,
197
+ isInvalid: H,
198
+ isRequired: G,
199
+ collapsed: oe,
200
+ hasPendingDelete: le,
206
201
  setHasPendingDelete: P,
207
202
  setInputValue: N,
208
- onSearch: b,
209
- isSingleSelect: _,
210
- isSearching: z,
211
- isHidingItems: X,
212
- popoverWidth: oe,
213
- popoverPlacement: se,
214
- previousSelectedItems: q,
215
- parentRef: F,
216
- popupRef: I,
217
- footerContent: ae,
218
- subMenuState: L,
219
- folderStyle: O,
220
- parentSelectsChildren: A
203
+ onSearch: x,
204
+ isSingleSelect: v,
205
+ isSearching: B,
206
+ isHidingItems: Z,
207
+ popoverWidth: k,
208
+ popoverPlacement: ae,
209
+ previousSelectedItems: J,
210
+ parentRef: I,
211
+ popupRef: L,
212
+ footerContent: ie,
213
+ subMenuState: R,
214
+ folderStyle: A,
215
+ parentSelectsChildren: j
221
216
  };
222
217
  return /* @__PURE__ */ c(u, {
223
218
  role: "combobox",
224
219
  asChild: !0,
225
220
  className: "combobox",
226
- ref: F,
227
- onClick: J.open,
228
- onBlur: ve,
221
+ ref: I,
222
+ onClick: Y.open,
223
+ onBlur: ye,
229
224
  overflow: "visible",
230
225
  width: "100%",
231
- "aria-expanded": J.isOpen,
232
- "aria-required": W,
233
- "aria-disabled": H,
234
- "aria-readonly": U,
235
- "aria-invalid": V,
236
- ...j,
226
+ "aria-expanded": Y.isOpen,
227
+ "aria-required": G,
228
+ "aria-disabled": U,
229
+ "aria-readonly": W,
230
+ "aria-invalid": H,
231
+ ...ce,
237
232
  children: /* @__PURE__ */ l("label", {
238
233
  htmlFor: e,
239
- children: [/* @__PURE__ */ c(r, { ...$ }), J.isOpen && /* @__PURE__ */ c(i, { ...$ })]
234
+ children: [/* @__PURE__ */ c(r, { ...$ }), Y.isOpen && /* @__PURE__ */ c(i, { ...$ })]
240
235
  })
241
236
  });
242
237
  }
243
- function v(e) {
238
+ function y(e) {
244
239
  return e.slice(0, -1);
245
240
  }
246
241
  //#endregion
247
- export { _ as Combobox };
242
+ export { v as Combobox };
@@ -81,7 +81,7 @@ function f({ src: f, crop: p, onCropCallback: m, setPreviewImage: h, aspectRatio
81
81
  }, [f]);
82
82
  let O = () => {
83
83
  let e = _.current, t = e?.getContext("2d");
84
- !t || !e || (t.clearRect(0, 0, e.width, e.height), v.current && t.drawImage(v.current, 0, 0, e.width, e.height), E(t, e, x.current, null));
84
+ t && e && (t.clearRect(0, 0, e.width, e.height), v.current && t.drawImage(v.current, 0, 0, e.width, e.height), E(t, e, x.current, null));
85
85
  }, k = (e) => {
86
86
  let t = i(e, _, x.current, 10, n(x.current, 10));
87
87
  w(t);
@@ -31,17 +31,13 @@ function v(e) {
31
31
  let { target: t } = e;
32
32
  if (!t || !t.files || !t.files[0]) return;
33
33
  let n = t.files[0];
34
- if (!N.includes(n.type)) {
35
- D(!0);
36
- return;
37
- }
38
- D(!1), n.size > 3145728 ? T(!0) : (T(!1), j(n, (e) => {
34
+ N.includes(n.type) ? (D(!1), n.size > 3145728 ? T(!0) : (T(!1), j(n, (e) => {
39
35
  let t = e.target?.result, r = {
40
36
  fileName: s(n.name),
41
37
  data: t
42
38
  };
43
39
  y(r), b(!0);
44
- }));
40
+ }))) : D(!0);
45
41
  }, v[3] = y, v[4] = b, v[5] = P) : P = v[5];
46
42
  let F = P, I;
47
43
  v[6] === Symbol.for("react.memo_cache_sentinel") ? (I = () => {
@@ -46,7 +46,6 @@ var le = e(), c = (e) => {
46
46
  w.current = e, w.current?.focus();
47
47
  break bb17;
48
48
  }
49
- default:
50
49
  }
51
50
  }, c[23] = R) : R = c[23];
52
51
  let pe = R, z;
@@ -189,14 +189,10 @@ function H() {
189
189
  e[6] !== k || e[7] !== a || e[8] !== T ? (N = () => {
190
190
  if (!a) return;
191
191
  let e = ie(T);
192
- if (!e) {
193
- a.chain().focus().extendMarkRange("link").unsetLink().run();
194
- return;
195
- }
196
- a.chain().focus().extendMarkRange("link").command((t) => {
192
+ e ? a.chain().focus().extendMarkRange("link").command((t) => {
197
193
  let { tr: n, state: r } = t, { from: i, to: a } = r.selection, o = k || r.doc.textBetween(i, a, " ") || e, s = r.schema.marks.link?.create({ href: e });
198
194
  return s ? (n.replaceWith(i, a, r.schema.text(o, [s])), !0) : !1;
199
- }).run();
195
+ }).run() : a.chain().focus().extendMarkRange("link").unsetLink().run();
200
196
  }, e[6] = k, e[7] = a, e[8] = T, e[9] = N) : N = e[9];
201
197
  let P = N, F;
202
198
  e[10] === a ? F = e[11] : (F = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,SAAS,SAAS,EAAE,EAC9C,OAAO,EACP,IAAI,EACJ,cAAc,EACd,aAAa,EACb,oBAAyB,EACzB,2BAAgC,EAChC,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,QAAQ,EACR,aAAa,EACb,EAAE,EACF,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,GACR,EAAE,UAAU,CAAC,KAAK,CAAC,+BAuCnB"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,KAAK,SAAS,SAAS,EAAE,EAC9C,OAAO,EACP,IAAI,EACJ,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,QAAQ,EACR,aAAa,EACb,EAAE,EACF,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,GACR,EAAE,UAAU,CAAC,KAAK,CAAC,+BAuCnB"}
@@ -2,7 +2,7 @@
2
2
  import { TableProvider as e } from "./table-context-provider.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  //#region lib/components/table/table.tsx
5
- function n({ columns: n, data: r, totalDataCount: i, expandedState: a, initialExpandedState: o = {}, initialBreakingContentState: s = {}, initialColumnVisibilityState: c, columnVisibilityState: l, onColumnVisibilityChange: u, onExpandedChange: d, onBreakingContentChange: f, getRowId: p, getRowActions: m, id: h, customRowIndication: g, onSortingChange: _, initialSortingState: v, sortingState: y, onSelectionChange: b, initialSelectionState: x, selectionState: S, selectionActions: C, disableSelectionCheckbox: w, enableColumnReorder: T, columnOrderState: E, initialColumnOrder: D, onColumnOrderChange: O, enableColumnResizing: k, initialColumnSizingState: A, onColumnSizingChange: j, enableRowReorder: M, onRowOrderChange: N, children: P }) {
5
+ function n({ columns: n, data: r, totalDataCount: i, expandedState: a, initialExpandedState: o, initialBreakingContentState: s, initialColumnVisibilityState: c, columnVisibilityState: l, onColumnVisibilityChange: u, onExpandedChange: d, onBreakingContentChange: f, getRowId: p, getRowActions: m, id: h, customRowIndication: g, onSortingChange: _, initialSortingState: v, sortingState: y, onSelectionChange: b, initialSelectionState: x, selectionState: S, selectionActions: C, disableSelectionCheckbox: w, enableColumnReorder: T, columnOrderState: E, initialColumnOrder: D, onColumnOrderChange: O, enableColumnResizing: k, initialColumnSizingState: A, onColumnSizingChange: j, enableRowReorder: M, onRowOrderChange: N, children: P }) {
6
6
  return /* @__PURE__ */ t(e, {
7
7
  columns: n,
8
8
  data: r,
@@ -273,7 +273,7 @@ var z = R, Ee = class {
273
273
  ]);
274
274
  super(y(v({}, c), { effects: () => [...s?.() ?? [], () => {
275
275
  let { manager: e, plugins: t } = this;
276
- if (!(!e || !t)) for (let n of t) {
276
+ if (e && t) for (let n of t) {
277
277
  let { plugin: t } = O(n);
278
278
  e.registry.plugins.register(t);
279
279
  }
@@ -70,7 +70,7 @@ var Pe = Object.create, Fe = Object.defineProperty, Ie = Object.defineProperties
70
70
  if (e) return `Picked up draggable item ${e.id}.`;
71
71
  },
72
72
  dragover({ operation: { source: e, target: t } }) {
73
- if (!(!e || e.id === t?.id)) return t ? `Draggable item ${e.id} was moved over droppable target ${t.id}.` : `Draggable item ${e.id} is no longer over a droppable target.`;
73
+ if (e && e.id !== t?.id) return t ? `Draggable item ${e.id} was moved over droppable target ${t.id}.` : `Draggable item ${e.id} is no longer over a droppable target.`;
74
74
  },
75
75
  dragend({ operation: { source: e, target: t }, canceled: n }) {
76
76
  if (e) return n ? `Dragging was cancelled. Draggable item ${e.id} was dropped.` : t ? `Draggable item ${e.id} was dropped over droppable target ${t.id}` : `Draggable item ${e.id} was dropped.`;
@@ -98,7 +98,7 @@ var it = ["dragover", "dragmove"], at = class extends y {
98
98
  constructor(e, t) {
99
99
  super(e);
100
100
  let { id: n, idPrefix: { description: r = Ze, announcement: i = Qe } = {}, announcements: a = et, screenReaderInstructions: o = $e, debounce: s = 500 } = t ?? {}, c = n ? `${r}-${n}` : ce(r), l = n ? `${i}-${n}` : ce(i), u, d, f, p, m = (e = p) => {
101
- !f || !e || f?.nodeValue !== e && (f.nodeValue = e);
101
+ f && e && f?.nodeValue !== e && (f.nodeValue = e);
102
102
  }, h = () => A.schedule(m), g = ot(h, s), _ = Object.entries(a).map(([e, t]) => this.manager.monitor.addEventListener(e, (n, r) => {
103
103
  let i = f;
104
104
  if (!i) return;
@@ -610,7 +610,7 @@ Ut = F(Ht), Wt = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakSet
610
610
  g === this.overlay ? setTimeout(t, 0) : t();
611
611
  }, I = n?.dropAnimation, L = this, R = s(() => {
612
612
  let { transform: t, status: a } = i;
613
- if (!(!t.x && !t.y && !e.current.translate) && a.dragging) {
613
+ if ((t.x || t.y || e.current.translate) && a.dragging) {
614
614
  let a = h.translate ?? {
615
615
  x: 0,
616
616
  y: 0
@@ -661,7 +661,7 @@ Ut = F(Ht), Wt = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakSet
661
661
  qe(), R();
662
662
  };
663
663
  }, R(Ut, 4, "overlay", Vt, Jt, Wt), I(Ut, Jt), Jt.configure = b(Jt);
664
- var Yt = Jt, Xt = !0, Zt = !1, Qt, $t, en, tn = (en = [c], T.Forward), q, nn, rn;
664
+ var Yt = Jt, Xt = !0, Zt = !1, Qt, $t, en = [c], tn = T.Forward, q, nn, rn;
665
665
  $t = (Qt = [c], T.Reverse);
666
666
  var an = class {
667
667
  constructor() {
@@ -775,7 +775,7 @@ var un, dn, fn, pn, J, mn, hn = class extends (dn = h, un = [c], dn) {
775
775
  return n = null, null;
776
776
  }, a);
777
777
  this.getScrollableElements = () => o.value, this.scrollIntentTracker = new cn(e), this.destroy = e.monitor.addEventListener("dragmove", (t) => {
778
- this.disabled || t.defaultPrevented || !Se(e.dragOperation.activatorEvent) || !t.by || this.scroll({ by: t.by }) && t.preventDefault();
778
+ !this.disabled && !t.defaultPrevented && Se(e.dragOperation.activatorEvent) && t.by && this.scroll({ by: t.by }) && t.preventDefault();
779
779
  });
780
780
  }
781
781
  };
@@ -933,9 +933,7 @@ var Dn = Object.freeze({
933
933
  e.preventDefault();
934
934
  let t = jn(e, r.cancel);
935
935
  this.handleEnd(e, t);
936
- return;
937
- }
938
- jn(e, r.up) ? this.handleMove("up", e) : jn(e, r.down) && this.handleMove("down", e), jn(e, r.left) ? this.handleMove("left", e) : jn(e, r.right) && this.handleMove("right", e);
936
+ } else jn(e, r.up) ? this.handleMove("up", e) : jn(e, r.down) && this.handleMove("down", e), jn(e, r.left) ? this.handleMove("left", e) : jn(e, r.right) && this.handleMove("right", e);
939
937
  }
940
938
  handleEnd(e, t) {
941
939
  this.manager.actions.stop({
@@ -1059,7 +1057,7 @@ Z.Delay = Pn, Z.Distance = Mn;
1059
1057
  var Fn = Object.freeze({
1060
1058
  activationConstraints(e, t) {
1061
1059
  let { pointerType: n, target: r } = e;
1062
- if (!(n === "mouse" && O(r) && (t.handle === r || t.handle?.contains(r)))) return n === "touch" ? [new Z.Delay({
1060
+ if (n !== "mouse" || !O(r) || t.handle !== r && !t.handle?.contains(r)) return n === "touch" ? [new Z.Delay({
1063
1061
  value: 250,
1064
1062
  tolerance: 5
1065
1063
  })] : Te(r) && !e.defaultPrevented ? [new Z.Delay({
@@ -1083,7 +1081,7 @@ var Fn = Object.freeze({
1083
1081
  coordinates: void 0
1084
1082
  }, this.handleMove = () => {
1085
1083
  let { event: e, coordinates: t } = this.latest;
1086
- !e || !t || this.manager.actions.move({
1084
+ e && t && this.manager.actions.move({
1087
1085
  event: e,
1088
1086
  to: t
1089
1087
  });
@@ -1142,11 +1140,8 @@ var Fn = Object.freeze({
1142
1140
  }
1143
1141
  handlePointerMove(e, t) {
1144
1142
  var n;
1145
- if (this.controller?.activated === !1) {
1146
- (n = this.controller) == null || n.onEvent(e);
1147
- return;
1148
- }
1149
- if (this.manager.dragOperation.status.dragging) {
1143
+ if (this.controller?.activated === !1) (n = this.controller) == null || n.onEvent(e);
1144
+ else if (this.manager.dragOperation.status.dragging) {
1150
1145
  let n = E(e), r = ge(t.element);
1151
1146
  n.x = n.x * r.scaleX + r.x, n.y = n.y * r.scaleY + r.y, e.preventDefault(), e.stopPropagation(), this.latest.event = e, this.latest.coordinates = n, A.schedule(this.handleMove);
1152
1147
  }
@@ -1232,7 +1227,7 @@ function Bn(e) {
1232
1227
  function Vn() {}
1233
1228
  var Hn = /* @__PURE__ */ new WeakSet();
1234
1229
  function Un(e) {
1235
- !e || Hn.has(e) || (e.addEventListener("touchmove", Vn, {
1230
+ e && !Hn.has(e) && (e.addEventListener("touchmove", Vn, {
1236
1231
  capture: !1,
1237
1232
  passive: !1
1238
1233
  }), Hn.add(e));
@@ -87,7 +87,7 @@ var F = 10, I = class extends o {
87
87
  let { id: t } = e;
88
88
  if (!e.accepts(d) || t === f?.id && P(e) || !e.element) continue;
89
89
  let n = e.shape, r = new c(e.element, { getBoundingClientRect: (e) => p(e, void 0, .2) });
90
- !r.height || !r.width || (u == "down" && m.y + F < r.center.y || u == "up" && m.y - F > r.center.y || u == "left" && m.x - F > r.center.x || u == "right" && m.x + F < r.center.x) && (g.push(e), e.shape = r, y.push(() => e.shape = n));
90
+ r.height && r.width && (u == "down" && m.y + F < r.center.y || u == "up" && m.y - F > r.center.y || u == "left" && m.x - F > r.center.x || u == "right" && m.x + F < r.center.x) && (g.push(e), e.shape = r, y.push(() => e.shape = n));
91
91
  }
92
92
  }), t.preventDefault(), o.disable();
93
93
  let b = o.computeCollisions(g, v);
@@ -248,7 +248,7 @@ var De = "__default__", Oe = class extends o {
248
248
  let { dragOperation: i } = r, { source: a, target: o } = i;
249
249
  if (!P(a) || !P(o) || a.sortable === o.sortable) return;
250
250
  let s = n(), c = Te(s), l = a.sortable.group === o.sortable.group, u = s.get(a.sortable.group), d = l ? u : s.get(o.sortable.group);
251
- !u || !d || queueMicrotask(() => {
251
+ u && d && queueMicrotask(() => {
252
252
  t.defaultPrevented || r.renderer.rendering.then(() => {
253
253
  let i = n();
254
254
  if (Ee(c, s, i)) return;
@@ -275,7 +275,7 @@ var De = "__default__", Oe = class extends o {
275
275
  let r = n();
276
276
  if (Ee(i, t, r)) return;
277
277
  let s = U(o), c = U(o, je), l = a.sortable.element, u = s[c.indexOf(a.sortable)], d = u?.element;
278
- !u || !d || !l || (ke(l, u.index, d, a.index), e(() => {
278
+ u && d && l && (ke(l, u.index, d, a.index), e(() => {
279
279
  for (let e of t.values()) {
280
280
  let t = Array.from(e).values();
281
281
  for (let e of t) e.index = e.initialIndex, e.group = e.initialGroup;
@@ -380,7 +380,7 @@ var Z = class {
380
380
  let { manager: e, transition: t } = this, { shape: n } = this.droppable;
381
381
  if (!e) return;
382
382
  let { idle: r } = e.dragOperation.status;
383
- !n || !t || r && !t.idle || e.renderer.rendering.then(() => {
383
+ n && t && (!r || t.idle) && e.renderer.rendering.then(() => {
384
384
  let { element: r } = this;
385
385
  if (!r) return;
386
386
  for (let e of r.getAnimations()) "transitionProperty" in e && (e.transitionProperty === "transform" || e.transitionProperty === "translate" || e.transitionProperty === "scale") && e.cancel();
@@ -236,11 +236,7 @@ var he = S ? ResizeObserver : class {
236
236
  }, O, ge = class extends he {
237
237
  constructor(e) {
238
238
  super((t) => {
239
- if (!r(this, O)) {
240
- a(this, O, !0);
241
- return;
242
- }
243
- e(t, this);
239
+ r(this, O) ? e(t, this) : a(this, O, !0);
244
240
  }), i(this, O, !1);
245
241
  }
246
242
  };
@@ -275,7 +271,7 @@ var _e = Array.from({ length: 100 }, (e, t) => t / 100), ve = 75, k, A, j, M, N,
275
271
  s?.debug && (a(this, P, document.createElement("div")), r(this, P).style.background = "rgba(0,0,0,0.15)", r(this, P).style.position = "fixed", r(this, P).style.pointerEvents = "none", l.body.appendChild(r(this, P))), a(this, N, new IntersectionObserver((e) => {
276
272
  var n, i;
277
273
  let { boundingClientRect: o, isIntersecting: s } = e[e.length - 1], { width: c, height: l } = o, u = r(this, k);
278
- a(this, k, s), !(!c && !l) && (u && !s ? ((n = r(this, M)) == null || n.disconnect(), this.callback(null), (i = r(this, j)) == null || i.disconnect(), a(this, j, void 0), r(this, P) && (r(this, P).style.visibility = "hidden")) : r(this, I).call(this), s && !r(this, j) && (a(this, j, new ge(r(this, I))), r(this, j).observe(t)));
274
+ a(this, k, s), (c || l) && (u && !s ? ((n = r(this, M)) == null || n.disconnect(), this.callback(null), (i = r(this, j)) == null || i.disconnect(), a(this, j, void 0), r(this, P) && (r(this, P).style.visibility = "hidden")) : r(this, I).call(this), s && !r(this, j) && (a(this, j, new ge(r(this, I))), r(this, j).observe(t)));
279
275
  }, {
280
276
  threshold: _e,
281
277
  root: l
@@ -13,11 +13,8 @@ function d() {
13
13
  function f(n, r) {
14
14
  let i = s(/* @__PURE__ */ new Map()), a = d();
15
15
  return u(() => {
16
- if (!n) {
17
- i.current.clear();
18
- return;
19
- }
20
- return e(() => {
16
+ if (!n) i.current.clear();
17
+ else return e(() => {
21
18
  let e = !1, o = !1;
22
19
  for (let a of i.current) {
23
20
  let [s] = a, c = t(() => a[1]), l = n[s];
@@ -52,18 +52,18 @@ function x(f) {
52
52
  M.handle = e ?? void 0;
53
53
  }, [M]),
54
54
  ref: d((e) => {
55
- !e && M.element?.isConnected && !M.manager?.dragOperation.status.idle || (M.element = e ?? void 0);
55
+ (e || !M.element?.isConnected || M.manager?.dragOperation.status.idle) && (M.element = e ?? void 0);
56
56
  }, [M]),
57
57
  sourceRef: d((e) => {
58
- !e && M.source?.isConnected && !M.manager?.dragOperation.status.idle || (M.source = e ?? void 0);
58
+ (e || !M.source?.isConnected || M.manager?.dragOperation.status.idle) && (M.source = e ?? void 0);
59
59
  }, [M]),
60
60
  targetRef: d((e) => {
61
- !e && M.target?.isConnected && !M.manager?.dragOperation.status.idle || (M.target = e ?? void 0);
61
+ (e || !M.target?.isConnected || M.manager?.dragOperation.status.idle) && (M.target = e ?? void 0);
62
62
  }, [M])
63
63
  };
64
64
  }
65
65
  function S(e, t, n) {
66
- return !!(e === "isDragSource" && !n && t);
66
+ return !(e !== "isDragSource" || n || !t);
67
67
  }
68
68
  //#endregion
69
69
  export { x as useSortable };
@@ -812,13 +812,10 @@ var I = { createTable: (e) => {
812
812
  createTable: (e) => {
813
813
  let t = !1, n = !1;
814
814
  e._autoResetExpanded = () => {
815
- if (!t) {
816
- e._queue(() => {
817
- t = !0;
818
- });
819
- return;
820
- }
821
- if (e.options.autoResetAll ?? e.options.autoResetExpanded ?? !e.options.manualExpanding) {
815
+ if (!t) e._queue(() => {
816
+ t = !0;
817
+ });
818
+ else if (e.options.autoResetAll ?? e.options.autoResetExpanded ?? !e.options.manualExpanding) {
822
819
  if (n) return;
823
820
  n = !0, e._queue(() => {
824
821
  e.resetExpanded(), n = !1;
@@ -892,13 +889,10 @@ var I = { createTable: (e) => {
892
889
  createTable: (e) => {
893
890
  let n = !1, r = !1;
894
891
  e._autoResetPageIndex = () => {
895
- if (!n) {
896
- e._queue(() => {
897
- n = !0;
898
- });
899
- return;
900
- }
901
- if (e.options.autoResetAll ?? e.options.autoResetPageIndex ?? !e.options.manualPagination) {
892
+ if (!n) e._queue(() => {
893
+ n = !0;
894
+ });
895
+ else if (e.options.autoResetAll ?? e.options.autoResetPageIndex ?? !e.options.manualPagination) {
902
896
  if (r) return;
903
897
  r = !0, e._queue(() => {
904
898
  e.resetPageIndex(), r = !1;
@@ -1119,7 +1113,7 @@ function Y(e, t, n) {
1119
1113
  if (!((r = e.subRows) != null && r.length)) return !1;
1120
1114
  let i = !0, a = !1;
1121
1115
  return e.subRows.forEach((e) => {
1122
- if (!(a && !i) && (e.getCanSelect() && (J(e, t) ? a = !0 : i = !1), e.subRows && e.subRows.length)) {
1116
+ if ((!a || i) && (e.getCanSelect() && (J(e, t) ? a = !0 : i = !1), e.subRows && e.subRows.length)) {
1123
1117
  let n = Y(e, t);
1124
1118
  n === "all" ? a = !0 : (n === "some" && (a = !0), i = !1);
1125
1119
  }
@@ -1142,11 +1136,11 @@ function me(e, t) {
1142
1136
  if (isNaN(o[0])) {
1143
1137
  if (e > t) return 1;
1144
1138
  if (t > e) return -1;
1145
- continue;
1139
+ } else {
1140
+ if (isNaN(o[1])) return isNaN(i) ? -1 : 1;
1141
+ if (i > a) return 1;
1142
+ if (a > i) return -1;
1146
1143
  }
1147
- if (isNaN(o[1])) return isNaN(i) ? -1 : 1;
1148
- if (i > a) return 1;
1149
- if (a > i) return -1;
1150
1144
  }
1151
1145
  return n.length - r.length;
1152
1146
  }
@@ -1364,11 +1358,7 @@ function Se(e, t, n) {
1364
1358
  var l;
1365
1359
  let d = e[u], f = m(n, d.id, d.original, d.index, d.depth, void 0, d.parentId);
1366
1360
  if (f.columnFilters = d.columnFilters, (l = d.subRows) != null && l.length && s < a) {
1367
- if (f.subRows = o(d.subRows, s + 1), d = f, t(d) && !f.subRows.length) {
1368
- c.push(d), i[d.id] = d, r.push(d);
1369
- continue;
1370
- }
1371
- if (t(d) || f.subRows.length) {
1361
+ if (f.subRows = o(d.subRows, s + 1), d = f, t(d) && !f.subRows.length || t(d) || f.subRows.length) {
1372
1362
  c.push(d), i[d.id] = d, r.push(d);
1373
1363
  continue;
1374
1364
  }
@@ -1420,15 +1410,11 @@ function we() {
1420
1410
  let n = e.getColumn(t.id);
1421
1411
  if (!n) return;
1422
1412
  let r = n.getFilterFn();
1423
- if (!r) {
1424
- process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${n.id}.`);
1425
- return;
1426
- }
1427
- i.push({
1413
+ r ? i.push({
1428
1414
  id: t.id,
1429
1415
  filterFn: r,
1430
1416
  resolvedValue: (r.resolveFilterValue == null ? void 0 : r.resolveFilterValue(t.value)) ?? t.value
1431
- });
1417
+ }) : process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${n.id}.`);
1432
1418
  });
1433
1419
  let o = (n ?? []).map((e) => e.id), s = e.getGlobalFilterFn(), c = e.getAllLeafColumns().filter((e) => e.getCanGlobalFilter());
1434
1420
  r && s && c.length && (o.push("__global__"), c.forEach((e) => {