laif-ds 0.1.35 → 0.1.36

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 (83) hide show
  1. package/dist/_virtual/index.js +5 -2
  2. package/dist/_virtual/index3.js +2 -7
  3. package/dist/_virtual/index4.js +2 -5
  4. package/dist/_virtual/index5.js +4 -4
  5. package/dist/_virtual/index6.js +5 -2
  6. package/dist/_virtual/index7.js +5 -2
  7. package/dist/_virtual/index8.js +5 -0
  8. package/dist/_virtual/index9.js +5 -0
  9. package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
  10. package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
  11. package/dist/components/ui/checkbox.js +12 -12
  12. package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
  13. package/dist/components/ui/message-input.js +1 -1
  14. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +348 -0
  15. package/dist/components/ui/tables/data-cross-table/edit-controls.js +47 -0
  16. package/dist/components/ui/tables/data-cross-table/editable-input.js +100 -0
  17. package/dist/components/ui/tables/data-cross-table/truncated-text.js +19 -0
  18. package/dist/index.d.ts +29 -3
  19. package/dist/index.js +1 -1
  20. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +126 -122
  21. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +10 -6
  22. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +44 -42
  23. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +33 -43
  24. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +237 -120
  25. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +17 -16
  26. package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +95 -94
  27. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +20 -19
  28. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +3 -3
  29. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +14 -13
  30. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +136 -136
  31. package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +70 -68
  32. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +66 -64
  33. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +10 -9
  34. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -16
  35. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +11 -10
  36. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +161 -146
  37. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +87 -84
  38. package/dist/node_modules/@radix-ui/react-select/dist/index.js +269 -257
  39. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +3 -3
  40. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -28
  41. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +101 -86
  42. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +23 -22
  43. package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +17 -16
  44. package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +25 -23
  45. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +77 -76
  46. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +43 -21
  47. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
  48. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +18 -18
  49. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +36 -0
  50. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +491 -0
  51. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +53 -0
  52. package/dist/node_modules/classnames/index.js +1 -1
  53. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  54. package/dist/node_modules/property-information/lib/html.js +9 -9
  55. package/dist/node_modules/react-hook-form/dist/index.esm.js +88 -88
  56. package/dist/node_modules/react-is/index.js +1 -1
  57. package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +830 -801
  58. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  59. package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +9 -0
  60. package/dist/node_modules/remeda/dist/{chunk-A3PVMI4K.js → chunk-KI5X74E2.js} +1 -1
  61. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  62. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3 -3
  63. package/dist/node_modules/unified/lib/index.js +1 -1
  64. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
  65. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
  66. package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
  67. package/dist/styles.css +1 -1
  68. package/package.json +2 -1
  69. package/dist/components/ui/data-cross-table.js +0 -216
  70. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  71. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
  72. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  73. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -138
  74. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +0 -625
  75. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -221
  76. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  77. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
  78. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -184
  79. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
  80. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
  81. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -33
  82. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
  83. package/dist/node_modules/remeda/dist/chunk-OAMXQXGR.js +0 -9
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx as i, jsxs as l } from "react/jsx-runtime";
3
+ import { TooltipProvider as c, Tooltip as d, TooltipTrigger as e, TooltipContent as p } from "../../tooltip.js";
4
+ function s({
5
+ text: r,
6
+ maxLength: n,
7
+ className: o = ""
8
+ }) {
9
+ return !r || ((r == null ? void 0 : r.length) ?? 0) <= n ? /* @__PURE__ */ i("div", { className: o, children: r }) : /* @__PURE__ */ i(c, { children: /* @__PURE__ */ l(d, { children: [
10
+ /* @__PURE__ */ i(e, { asChild: !0, children: /* @__PURE__ */ l("div", { className: `truncate ${o} cursor-pointer`, children: [
11
+ r.substring(0, n),
12
+ "…"
13
+ ] }) }),
14
+ /* @__PURE__ */ i(p, { children: /* @__PURE__ */ i("p", { children: r }) })
15
+ ] }) });
16
+ }
17
+ export {
18
+ s as TruncatedText
19
+ };
package/dist/index.d.ts CHANGED
@@ -490,6 +490,18 @@ export declare function CommandShortcut({ className, ...props }: React_2.Compone
490
490
  declare const confirm_2: (payload: ConfirmOptions) => Promise<boolean>;
491
491
  export { confirm_2 as confirm }
492
492
 
493
+ declare interface ConfirmedCell {
494
+ fromId: string;
495
+ toId: string;
496
+ id?: string;
497
+ value: any;
498
+ }
499
+
500
+ declare interface ConfirmedCellsData {
501
+ editedCells: ConfirmedCell[];
502
+ toDefaultCells: ConfirmedCell[];
503
+ }
504
+
493
505
  export declare const Confirmer: () => JSX.Element;
494
506
 
495
507
  declare interface ConfirmOptions {
@@ -561,12 +573,17 @@ export declare interface CrossTableCell {
561
573
  }
562
574
 
563
575
  declare interface CrossTableData {
564
- headerTop: string[];
565
- headerLeft: string[];
576
+ headerTop: CrossTableHeader[];
577
+ headerLeft: CrossTableHeader[];
566
578
  data: (CrossTableCell | null)[][];
567
579
  }
568
580
 
569
- export declare function DataCrossTable({ crossTableData, filterable, loading, emptyComponent, className, notFoundMessage, cornerHeaderFrom, cornerHeaderTo, maxHeaderLength, minWidthCell, }: DataCrossTableProps): JSX.Element;
581
+ declare interface CrossTableHeader {
582
+ id: string;
583
+ label: string;
584
+ }
585
+
586
+ export declare function DataCrossTable({ crossTableData, filterable, loading, emptyComponent, className, notFoundMessage, cornerHeaderFrom, cornerHeaderTo, maxHeaderLength, minWidthCell, editable, editMode, editConfirmLabel, editCancelLabel, onConfirmedCells, onEditModeChange, onSelectedRow, selectedRow, rowSortAsc, }: DataCrossTableProps): JSX.Element;
570
587
 
571
588
  export declare interface DataCrossTableProps {
572
589
  crossTableData: CrossTableData;
@@ -580,6 +597,15 @@ export declare interface DataCrossTableProps {
580
597
  maxHeaderLength?: number;
581
598
  minWidthCell?: number;
582
599
  showFreezeControls?: boolean;
600
+ editable?: boolean;
601
+ editMode?: boolean;
602
+ editConfirmLabel?: string;
603
+ editCancelLabel?: string;
604
+ onConfirmedCells?: (cells: ConfirmedCellsData) => void;
605
+ onEditModeChange?: (editMode: boolean) => void;
606
+ onSelectedRow?: (row: CrossTableHeader) => void;
607
+ selectedRow?: CrossTableHeader;
608
+ rowSortAsc?: boolean;
583
609
  }
584
610
 
585
611
  export declare enum DataRepeatTypes {
package/dist/index.js CHANGED
@@ -74,7 +74,7 @@ import { AppSidebar as _a } from "./components/ui/app-sidebar.js";
74
74
  import { Confirmer as en, confirm as rn } from "./components/ui/confirmer.js";
75
75
  import { AppSelect as tn } from "./components/ui/app-select.js";
76
76
  import { AppMultipleSelectDropdown as nn } from "./components/ui/app-multiple-select-dropdown.js";
77
- import { DataCrossTable as mn } from "./components/ui/data-cross-table.js";
77
+ import { DataCrossTable as mn } from "./components/ui/tables/data-cross-table/data-cross-table.js";
78
78
  import { useAudioRecording as un } from "./hooks/use-audio-recording.js";
79
79
  import { useAutoScroll as dn } from "./hooks/use-auto-scroll.js";
80
80
  import { useAutosizeTextArea as bn } from "./hooks/use-autosize-textarea.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { evaluate as E, getSideAxis as V, getSide as B, clamp as X, getOppositePlacement as Z, getExpandedPlacements as ee, getOppositeAxisPlacements as te, getAlignmentSides as ne, getAlignment as z, min as $, max as W, getPaddingObject as J, rectToClientRect as _, getOppositeAxis as K, getAlignmentAxis as N, sides as ie, getAxisLength as Q } from "../../utils/dist/floating-ui.utils.js";
3
- function I(t, e, d) {
2
+ import { evaluate as T, getSideAxis as B, getSide as W, clamp as X, getOppositePlacement as ee, getExpandedPlacements as te, getOppositeAxisPlacements as ne, getAlignmentSides as ie, getAlignment as I, min as $, max as Y, getPaddingObject as K, rectToClientRect as _, getOppositeAxis as N, getAlignmentAxis as Q, sides as se, getAxisLength as U } from "../../utils/dist/floating-ui.utils.js";
3
+ function q(t, e, d) {
4
4
  let {
5
5
  reference: a,
6
6
  floating: r
7
7
  } = t;
8
- const n = V(e), o = N(e), m = Q(o), g = B(e), h = n === "y", c = a.x + a.width / 2 - r.width / 2, s = a.y + a.height / 2 - r.height / 2, f = a[m] / 2 - r[m] / 2;
8
+ const n = B(e), o = Q(e), m = U(o), g = W(e), h = n === "y", c = a.x + a.width / 2 - r.width / 2, s = a.y + a.height / 2 - r.height / 2, f = a[m] / 2 - r[m] / 2;
9
9
  let i;
10
10
  switch (g) {
11
11
  case "top":
@@ -38,7 +38,7 @@ function I(t, e, d) {
38
38
  y: a.y
39
39
  };
40
40
  }
41
- switch (z(e)) {
41
+ switch (I(e)) {
42
42
  case "start":
43
43
  i[o] -= f * (d && h ? -1 : 1);
44
44
  break;
@@ -48,7 +48,7 @@ function I(t, e, d) {
48
48
  }
49
49
  return i;
50
50
  }
51
- const ae = async (t, e, d) => {
51
+ const ce = async (t, e, d) => {
52
52
  const {
53
53
  placement: a = "bottom",
54
54
  strategy: r = "absolute",
@@ -62,17 +62,17 @@ const ae = async (t, e, d) => {
62
62
  }), {
63
63
  x: c,
64
64
  y: s
65
- } = I(h, a, g), f = a, i = {}, l = 0;
65
+ } = q(h, a, g), f = a, i = {}, l = 0;
66
66
  for (let u = 0; u < m.length; u++) {
67
67
  const {
68
68
  name: x,
69
- fn: y
69
+ fn: A
70
70
  } = m[u], {
71
- x: A,
71
+ x: v,
72
72
  y: p,
73
- data: v,
73
+ data: y,
74
74
  reset: w
75
- } = await y({
75
+ } = await A({
76
76
  x: c,
77
77
  y: s,
78
78
  initialPlacement: a,
@@ -86,11 +86,11 @@ const ae = async (t, e, d) => {
86
86
  floating: e
87
87
  }
88
88
  });
89
- c = A ?? c, s = p ?? s, i = {
89
+ c = v ?? c, s = p ?? s, i = {
90
90
  ...i,
91
91
  [x]: {
92
92
  ...i[x],
93
- ...v
93
+ ...y
94
94
  }
95
95
  }, w && l <= 50 && (l++, typeof w == "object" && (w.placement && (f = w.placement), w.rects && (h = w.rects === !0 ? await o.getElementRects({
96
96
  reference: t,
@@ -99,7 +99,7 @@ const ae = async (t, e, d) => {
99
99
  }) : w.rects), {
100
100
  x: c,
101
101
  y: s
102
- } = I(h, f, g)), u = -1);
102
+ } = q(h, f, g)), u = -1);
103
103
  }
104
104
  return {
105
105
  x: c,
@@ -109,7 +109,7 @@ const ae = async (t, e, d) => {
109
109
  middlewareData: i
110
110
  };
111
111
  };
112
- async function Y(t, e) {
112
+ async function z(t, e) {
113
113
  var d;
114
114
  e === void 0 && (e = {});
115
115
  const {
@@ -125,17 +125,17 @@ async function Y(t, e) {
125
125
  elementContext: s = "floating",
126
126
  altBoundary: f = !1,
127
127
  padding: i = 0
128
- } = E(e, t), l = J(i), x = m[f ? s === "floating" ? "reference" : "floating" : s], y = _(await n.getClippingRect({
128
+ } = T(e, t), l = K(i), x = m[f ? s === "floating" ? "reference" : "floating" : s], A = _(await n.getClippingRect({
129
129
  element: (d = await (n.isElement == null ? void 0 : n.isElement(x))) == null || d ? x : x.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(m.floating)),
130
130
  boundary: h,
131
131
  rootBoundary: c,
132
132
  strategy: g
133
- })), A = s === "floating" ? {
133
+ })), v = s === "floating" ? {
134
134
  x: a,
135
135
  y: r,
136
136
  width: o.floating.width,
137
137
  height: o.floating.height
138
- } : o.reference, p = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(m.floating)), v = await (n.isElement == null ? void 0 : n.isElement(p)) ? await (n.getScale == null ? void 0 : n.getScale(p)) || {
138
+ } : o.reference, p = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(m.floating)), y = await (n.isElement == null ? void 0 : n.isElement(p)) ? await (n.getScale == null ? void 0 : n.getScale(p)) || {
139
139
  x: 1,
140
140
  y: 1
141
141
  } : {
@@ -143,18 +143,18 @@ async function Y(t, e) {
143
143
  y: 1
144
144
  }, w = _(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({
145
145
  elements: m,
146
- rect: A,
146
+ rect: v,
147
147
  offsetParent: p,
148
148
  strategy: g
149
- }) : A);
149
+ }) : v);
150
150
  return {
151
- top: (y.top - w.top + l.top) / v.y,
152
- bottom: (w.bottom - y.bottom + l.bottom) / v.y,
153
- left: (y.left - w.left + l.left) / v.x,
154
- right: (w.right - y.right + l.right) / v.x
151
+ top: (A.top - w.top + l.top) / y.y,
152
+ bottom: (w.bottom - A.bottom + l.bottom) / y.y,
153
+ left: (A.left - w.left + l.left) / y.x,
154
+ right: (w.right - A.right + l.right) / y.x
155
155
  };
156
156
  }
157
- const ce = (t) => ({
157
+ const le = (t) => ({
158
158
  name: "arrow",
159
159
  options: t,
160
160
  async fn(e) {
@@ -169,29 +169,29 @@ const ce = (t) => ({
169
169
  } = e, {
170
170
  element: h,
171
171
  padding: c = 0
172
- } = E(t, e) || {};
172
+ } = T(t, e) || {};
173
173
  if (h == null)
174
174
  return {};
175
- const s = J(c), f = {
175
+ const s = K(c), f = {
176
176
  x: d,
177
177
  y: a
178
- }, i = N(r), l = Q(i), u = await o.getDimensions(h), x = i === "y", y = x ? "top" : "left", A = x ? "bottom" : "right", p = x ? "clientHeight" : "clientWidth", v = n.reference[l] + n.reference[i] - f[i] - n.floating[l], w = f[i] - n.reference[i], O = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(h));
178
+ }, i = Q(r), l = U(i), u = await o.getDimensions(h), x = i === "y", A = x ? "top" : "left", v = x ? "bottom" : "right", p = x ? "clientHeight" : "clientWidth", y = n.reference[l] + n.reference[i] - f[i] - n.floating[l], w = f[i] - n.reference[i], O = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(h));
179
179
  let P = O ? O[p] : 0;
180
180
  (!P || !await (o.isElement == null ? void 0 : o.isElement(O))) && (P = m.floating[p] || n.floating[l]);
181
- const D = v / 2 - w / 2, R = P / 2 - u[l] / 2 - 1, C = $(s[y], R), T = $(s[A], R), S = C, L = P - u[l] - T, b = P / 2 - u[l] / 2 + D, j = X(S, b, L), M = !g.arrow && z(r) != null && b !== j && n.reference[l] / 2 - (b < S ? C : T) - u[l] / 2 < 0, k = M ? b < S ? b - S : b - L : 0;
181
+ const M = y / 2 - w / 2, R = P / 2 - u[l] / 2 - 1, b = $(s[A], R), L = $(s[v], R), S = b, H = P - u[l] - L, k = P / 2 - u[l] / 2 + M, C = X(S, k, H), j = !g.arrow && I(r) != null && k !== C && n.reference[l] / 2 - (k < S ? b : L) - u[l] / 2 < 0, E = j ? k < S ? k - S : k - H : 0;
182
182
  return {
183
- [i]: f[i] + k,
183
+ [i]: f[i] + E,
184
184
  data: {
185
- [i]: j,
186
- centerOffset: b - j - k,
187
- ...M && {
188
- alignmentOffset: k
185
+ [i]: C,
186
+ centerOffset: k - C - E,
187
+ ...j && {
188
+ alignmentOffset: E
189
189
  }
190
190
  },
191
- reset: M
191
+ reset: j
192
192
  };
193
193
  }
194
- }), le = function(t) {
194
+ }), re = function(t) {
195
195
  return t === void 0 && (t = {}), {
196
196
  name: "flip",
197
197
  options: t,
@@ -212,58 +212,62 @@ const ce = (t) => ({
212
212
  fallbackAxisSideDirection: l = "none",
213
213
  flipAlignment: u = !0,
214
214
  ...x
215
- } = E(t, e);
215
+ } = T(t, e);
216
216
  if ((d = n.arrow) != null && d.alignmentOffset)
217
217
  return {};
218
- const y = B(r), A = V(m), p = B(m) === m, v = await (g.isRTL == null ? void 0 : g.isRTL(h.floating)), w = f || (p || !u ? [Z(m)] : ee(m)), O = l !== "none";
219
- !f && O && w.push(...te(m, u, l, v));
220
- const P = [m, ...w], D = await Y(e, x), R = [];
221
- let C = ((a = n.flip) == null ? void 0 : a.overflows) || [];
222
- if (c && R.push(D[y]), s) {
223
- const b = ne(r, o, v);
224
- R.push(D[b[0]], D[b[1]]);
218
+ const A = W(r), v = B(m), p = W(m) === m, y = await (g.isRTL == null ? void 0 : g.isRTL(h.floating)), w = f || (p || !u ? [ee(m)] : te(m)), O = l !== "none";
219
+ !f && O && w.push(...ne(m, u, l, y));
220
+ const P = [m, ...w], M = await z(e, x), R = [];
221
+ let b = ((a = n.flip) == null ? void 0 : a.overflows) || [];
222
+ if (c && R.push(M[A]), s) {
223
+ const C = ie(r, o, y);
224
+ R.push(M[C[0]], M[C[1]]);
225
225
  }
226
- if (C = [...C, {
226
+ if (b = [...b, {
227
227
  placement: r,
228
228
  overflows: R
229
- }], !R.every((b) => b <= 0)) {
230
- var T, S;
231
- const b = (((T = n.flip) == null ? void 0 : T.index) || 0) + 1, j = P[b];
232
- if (j)
233
- return {
234
- data: {
235
- index: b,
236
- overflows: C
237
- },
238
- reset: {
239
- placement: j
240
- }
241
- };
242
- let M = (S = C.filter((k) => k.overflows[0] <= 0).sort((k, H) => k.overflows[1] - H.overflows[1])[0]) == null ? void 0 : S.placement;
243
- if (!M)
229
+ }], !R.every((C) => C <= 0)) {
230
+ var L, S;
231
+ const C = (((L = n.flip) == null ? void 0 : L.index) || 0) + 1, j = P[C];
232
+ if (j) {
233
+ var H;
234
+ const F = s === "alignment" ? v !== B(j) : !1, D = ((H = b[0]) == null ? void 0 : H.overflows[0]) > 0;
235
+ if (!F || D)
236
+ return {
237
+ data: {
238
+ index: C,
239
+ overflows: b
240
+ },
241
+ reset: {
242
+ placement: j
243
+ }
244
+ };
245
+ }
246
+ let E = (S = b.filter((F) => F.overflows[0] <= 0).sort((F, D) => F.overflows[1] - D.overflows[1])[0]) == null ? void 0 : S.placement;
247
+ if (!E)
244
248
  switch (i) {
245
249
  case "bestFit": {
246
- var L;
247
- const k = (L = C.filter((H) => {
250
+ var k;
251
+ const F = (k = b.filter((D) => {
248
252
  if (O) {
249
- const F = V(H.placement);
250
- return F === A || // Create a bias to the `y` side axis due to horizontal
253
+ const V = B(D.placement);
254
+ return V === v || // Create a bias to the `y` side axis due to horizontal
251
255
  // reading directions favoring greater width.
252
- F === "y";
256
+ V === "y";
253
257
  }
254
258
  return !0;
255
- }).map((H) => [H.placement, H.overflows.filter((F) => F > 0).reduce((F, U) => F + U, 0)]).sort((H, F) => H[1] - F[1])[0]) == null ? void 0 : L[0];
256
- k && (M = k);
259
+ }).map((D) => [D.placement, D.overflows.filter((V) => V > 0).reduce((V, Z) => V + Z, 0)]).sort((D, V) => D[1] - V[1])[0]) == null ? void 0 : k[0];
260
+ F && (E = F);
257
261
  break;
258
262
  }
259
263
  case "initialPlacement":
260
- M = m;
264
+ E = m;
261
265
  break;
262
266
  }
263
- if (r !== M)
267
+ if (r !== E)
264
268
  return {
265
269
  reset: {
266
- placement: M
270
+ placement: E
267
271
  }
268
272
  };
269
273
  }
@@ -271,7 +275,7 @@ const ce = (t) => ({
271
275
  }
272
276
  };
273
277
  };
274
- function q(t, e) {
278
+ function G(t, e) {
275
279
  return {
276
280
  top: t.top - e.height,
277
281
  right: t.right - e.width,
@@ -279,10 +283,10 @@ function q(t, e) {
279
283
  left: t.left - e.width
280
284
  };
281
285
  }
282
- function G(t) {
283
- return ie.some((e) => t[e] >= 0);
286
+ function J(t) {
287
+ return se.some((e) => t[e] >= 0);
284
288
  }
285
- const re = function(t) {
289
+ const fe = function(t) {
286
290
  return t === void 0 && (t = {}), {
287
291
  name: "hide",
288
292
  options: t,
@@ -292,29 +296,29 @@ const re = function(t) {
292
296
  } = e, {
293
297
  strategy: a = "referenceHidden",
294
298
  ...r
295
- } = E(t, e);
299
+ } = T(t, e);
296
300
  switch (a) {
297
301
  case "referenceHidden": {
298
- const n = await Y(e, {
302
+ const n = await z(e, {
299
303
  ...r,
300
304
  elementContext: "reference"
301
- }), o = q(n, d.reference);
305
+ }), o = G(n, d.reference);
302
306
  return {
303
307
  data: {
304
308
  referenceHiddenOffsets: o,
305
- referenceHidden: G(o)
309
+ referenceHidden: J(o)
306
310
  }
307
311
  };
308
312
  }
309
313
  case "escaped": {
310
- const n = await Y(e, {
314
+ const n = await z(e, {
311
315
  ...r,
312
316
  altBoundary: !0
313
- }), o = q(n, d.floating);
317
+ }), o = G(n, d.floating);
314
318
  return {
315
319
  data: {
316
320
  escapedOffsets: o,
317
- escaped: G(o)
321
+ escaped: J(o)
318
322
  }
319
323
  };
320
324
  }
@@ -324,12 +328,12 @@ const re = function(t) {
324
328
  }
325
329
  };
326
330
  };
327
- async function se(t, e) {
331
+ async function oe(t, e) {
328
332
  const {
329
333
  placement: d,
330
334
  platform: a,
331
335
  elements: r
332
- } = t, n = await (a.isRTL == null ? void 0 : a.isRTL(r.floating)), o = B(d), m = z(d), g = V(d) === "y", h = ["left", "top"].includes(o) ? -1 : 1, c = n && g ? -1 : 1, s = E(e, t);
336
+ } = t, n = await (a.isRTL == null ? void 0 : a.isRTL(r.floating)), o = W(d), m = I(d), g = B(d) === "y", h = ["left", "top"].includes(o) ? -1 : 1, c = n && g ? -1 : 1, s = T(e, t);
333
337
  let {
334
338
  mainAxis: f,
335
339
  crossAxis: i,
@@ -351,7 +355,7 @@ async function se(t, e) {
351
355
  y: i * c
352
356
  };
353
357
  }
354
- const fe = function(t) {
358
+ const me = function(t) {
355
359
  return t === void 0 && (t = 0), {
356
360
  name: "offset",
357
361
  options: t,
@@ -362,7 +366,7 @@ const fe = function(t) {
362
366
  y: n,
363
367
  placement: o,
364
368
  middlewareData: m
365
- } = e, g = await se(e, t);
369
+ } = e, g = await oe(e, t);
366
370
  return o === ((d = m.offset) == null ? void 0 : d.placement) && (a = m.arrow) != null && a.alignmentOffset ? {} : {
367
371
  x: r + g.x,
368
372
  y: n + g.y,
@@ -373,7 +377,7 @@ const fe = function(t) {
373
377
  };
374
378
  }
375
379
  };
376
- }, me = function(t) {
380
+ }, de = function(t) {
377
381
  return t === void 0 && (t = {}), {
378
382
  name: "shift",
379
383
  options: t,
@@ -388,28 +392,28 @@ const fe = function(t) {
388
392
  limiter: m = {
389
393
  fn: (x) => {
390
394
  let {
391
- x: y,
392
- y: A
395
+ x: A,
396
+ y: v
393
397
  } = x;
394
398
  return {
395
- x: y,
396
- y: A
399
+ x: A,
400
+ y: v
397
401
  };
398
402
  }
399
403
  },
400
404
  ...g
401
- } = E(t, e), h = {
405
+ } = T(t, e), h = {
402
406
  x: d,
403
407
  y: a
404
- }, c = await Y(e, g), s = V(B(r)), f = K(s);
408
+ }, c = await z(e, g), s = B(W(r)), f = N(s);
405
409
  let i = h[f], l = h[s];
406
410
  if (n) {
407
- const x = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", A = i + c[x], p = i - c[y];
408
- i = X(A, i, p);
411
+ const x = f === "y" ? "top" : "left", A = f === "y" ? "bottom" : "right", v = i + c[x], p = i - c[A];
412
+ i = X(v, i, p);
409
413
  }
410
414
  if (o) {
411
- const x = s === "y" ? "top" : "left", y = s === "y" ? "bottom" : "right", A = l + c[x], p = l - c[y];
412
- l = X(A, l, p);
415
+ const x = s === "y" ? "top" : "left", A = s === "y" ? "bottom" : "right", v = l + c[x], p = l - c[A];
416
+ l = X(v, l, p);
413
417
  }
414
418
  const u = m.fn({
415
419
  ...e,
@@ -429,7 +433,7 @@ const fe = function(t) {
429
433
  };
430
434
  }
431
435
  };
432
- }, de = function(t) {
436
+ }, xe = function(t) {
433
437
  return t === void 0 && (t = {}), {
434
438
  options: t,
435
439
  fn(e) {
@@ -443,12 +447,12 @@ const fe = function(t) {
443
447
  offset: m = 0,
444
448
  mainAxis: g = !0,
445
449
  crossAxis: h = !0
446
- } = E(t, e), c = {
450
+ } = T(t, e), c = {
447
451
  x: d,
448
452
  y: a
449
- }, s = V(r), f = K(s);
453
+ }, s = B(r), f = N(s);
450
454
  let i = c[f], l = c[s];
451
- const u = E(m, e), x = typeof u == "number" ? {
455
+ const u = T(m, e), x = typeof u == "number" ? {
452
456
  mainAxis: u,
453
457
  crossAxis: 0
454
458
  } : {
@@ -457,12 +461,12 @@ const fe = function(t) {
457
461
  ...u
458
462
  };
459
463
  if (g) {
460
- const p = f === "y" ? "height" : "width", v = n.reference[f] - n.floating[p] + x.mainAxis, w = n.reference[f] + n.reference[p] - x.mainAxis;
461
- i < v ? i = v : i > w && (i = w);
464
+ const p = f === "y" ? "height" : "width", y = n.reference[f] - n.floating[p] + x.mainAxis, w = n.reference[f] + n.reference[p] - x.mainAxis;
465
+ i < y ? i = y : i > w && (i = w);
462
466
  }
463
467
  if (h) {
464
- var y, A;
465
- const p = f === "y" ? "width" : "height", v = ["top", "left"].includes(B(r)), w = n.reference[s] - n.floating[p] + (v && ((y = o.offset) == null ? void 0 : y[s]) || 0) + (v ? 0 : x.crossAxis), O = n.reference[s] + n.reference[p] + (v ? 0 : ((A = o.offset) == null ? void 0 : A[s]) || 0) - (v ? x.crossAxis : 0);
468
+ var A, v;
469
+ const p = f === "y" ? "width" : "height", y = ["top", "left"].includes(W(r)), w = n.reference[s] - n.floating[p] + (y && ((A = o.offset) == null ? void 0 : A[s]) || 0) + (y ? 0 : x.crossAxis), O = n.reference[s] + n.reference[p] + (y ? 0 : ((v = o.offset) == null ? void 0 : v[s]) || 0) - (y ? x.crossAxis : 0);
466
470
  l < w ? l = w : l > O && (l = O);
467
471
  }
468
472
  return {
@@ -471,7 +475,7 @@ const fe = function(t) {
471
475
  };
472
476
  }
473
477
  };
474
- }, xe = function(t) {
478
+ }, ue = function(t) {
475
479
  return t === void 0 && (t = {}), {
476
480
  name: "size",
477
481
  options: t,
@@ -486,21 +490,21 @@ const fe = function(t) {
486
490
  apply: g = () => {
487
491
  },
488
492
  ...h
489
- } = E(t, e), c = await Y(e, h), s = B(r), f = z(r), i = V(r) === "y", {
493
+ } = T(t, e), c = await z(e, h), s = W(r), f = I(r), i = B(r) === "y", {
490
494
  width: l,
491
495
  height: u
492
496
  } = n.floating;
493
- let x, y;
494
- s === "top" || s === "bottom" ? (x = s, y = f === (await (o.isRTL == null ? void 0 : o.isRTL(m.floating)) ? "start" : "end") ? "left" : "right") : (y = s, x = f === "end" ? "top" : "bottom");
495
- const A = u - c.top - c.bottom, p = l - c.left - c.right, v = $(u - c[x], A), w = $(l - c[y], p), O = !e.middlewareData.shift;
496
- let P = v, D = w;
497
- if ((d = e.middlewareData.shift) != null && d.enabled.x && (D = p), (a = e.middlewareData.shift) != null && a.enabled.y && (P = A), O && !f) {
498
- const C = W(c.left, 0), T = W(c.right, 0), S = W(c.top, 0), L = W(c.bottom, 0);
499
- i ? D = l - 2 * (C !== 0 || T !== 0 ? C + T : W(c.left, c.right)) : P = u - 2 * (S !== 0 || L !== 0 ? S + L : W(c.top, c.bottom));
497
+ let x, A;
498
+ s === "top" || s === "bottom" ? (x = s, A = f === (await (o.isRTL == null ? void 0 : o.isRTL(m.floating)) ? "start" : "end") ? "left" : "right") : (A = s, x = f === "end" ? "top" : "bottom");
499
+ const v = u - c.top - c.bottom, p = l - c.left - c.right, y = $(u - c[x], v), w = $(l - c[A], p), O = !e.middlewareData.shift;
500
+ let P = y, M = w;
501
+ if ((d = e.middlewareData.shift) != null && d.enabled.x && (M = p), (a = e.middlewareData.shift) != null && a.enabled.y && (P = v), O && !f) {
502
+ const b = Y(c.left, 0), L = Y(c.right, 0), S = Y(c.top, 0), H = Y(c.bottom, 0);
503
+ i ? M = l - 2 * (b !== 0 || L !== 0 ? b + L : Y(c.left, c.right)) : P = u - 2 * (S !== 0 || H !== 0 ? S + H : Y(c.top, c.bottom));
500
504
  }
501
505
  await g({
502
506
  ...e,
503
- availableWidth: D,
507
+ availableWidth: M,
504
508
  availableHeight: P
505
509
  });
506
510
  const R = await o.getDimensions(m.floating);
@@ -513,14 +517,14 @@ const fe = function(t) {
513
517
  };
514
518
  };
515
519
  export {
516
- ce as arrow,
517
- ae as computePosition,
518
- Y as detectOverflow,
519
- le as flip,
520
- re as hide,
521
- de as limitShift,
522
- fe as offset,
520
+ le as arrow,
521
+ ce as computePosition,
522
+ z as detectOverflow,
523
+ re as flip,
524
+ fe as hide,
525
+ xe as limitShift,
526
+ me as offset,
523
527
  _ as rectToClientRect,
524
- me as shift,
525
- xe as size
528
+ de as shift,
529
+ ue as size
526
530
  };
@@ -214,15 +214,19 @@ function Ct(t, e, i) {
214
214
  scrollTop: 0
215
215
  };
216
216
  const l = m(0);
217
+ function f() {
218
+ l.x = k(o);
219
+ }
217
220
  if (n || !n && !r)
218
221
  if ((M(e) !== "body" || _(o)) && (c = N(e)), n) {
219
- const p = T(e, !0, r, e);
220
- l.x = p.x + e.clientLeft, l.y = p.y + e.clientTop;
221
- } else o && (l.x = k(o));
222
- const f = o && !n && !r ? tt(o, c) : m(0), u = s.left + c.scrollLeft - l.x - f.x, h = s.top + c.scrollTop - l.y - f.y;
222
+ const a = T(e, !0, r, e);
223
+ l.x = a.x + e.clientLeft, l.y = a.y + e.clientTop;
224
+ } else o && f();
225
+ r && !n && o && f();
226
+ const u = o && !n && !r ? tt(o, c) : m(0), h = s.left + c.scrollLeft - l.x - u.x, p = s.top + c.scrollTop - l.y - u.y;
223
227
  return {
224
- x: u,
225
- y: h,
228
+ x: h,
229
+ y: p,
226
230
  width: s.width,
227
231
  height: s.height
228
232
  };