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.
- package/dist/_virtual/index.js +5 -2
- package/dist/_virtual/index3.js +2 -7
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +5 -2
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/components/ui/checkbox.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/components/ui/message-input.js +1 -1
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +348 -0
- package/dist/components/ui/tables/data-cross-table/edit-controls.js +47 -0
- package/dist/components/ui/tables/data-cross-table/editable-input.js +100 -0
- package/dist/components/ui/tables/data-cross-table/truncated-text.js +19 -0
- package/dist/index.d.ts +29 -3
- package/dist/index.js +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +126 -122
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +10 -6
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +44 -42
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +33 -43
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +237 -120
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +95 -94
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +20 -19
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +14 -13
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +136 -136
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +70 -68
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +66 -64
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +10 -9
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -16
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +11 -10
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +161 -146
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +87 -84
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +269 -257
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -28
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +101 -86
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +23 -22
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +25 -23
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +77 -76
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +43 -21
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +18 -18
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +36 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +491 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +53 -0
- package/dist/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/property-information/lib/html.js +9 -9
- package/dist/node_modules/react-hook-form/dist/index.esm.js +88 -88
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +830 -801
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +9 -0
- package/dist/node_modules/remeda/dist/{chunk-A3PVMI4K.js → chunk-KI5X74E2.js} +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3 -3
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/dist/components/ui/data-cross-table.js +0 -216
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -138
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +0 -625
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -221
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -184
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -33
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/remeda/dist/chunk-OAMXQXGR.js +0 -9
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { memo as d, notUndefined as m, approxEqual as M, debounce as y } from "./utils.js";
|
|
3
|
+
const b = (r) => {
|
|
4
|
+
const { offsetWidth: h, offsetHeight: t } = r;
|
|
5
|
+
return { width: h, height: t };
|
|
6
|
+
}, z = (r) => r, w = (r) => {
|
|
7
|
+
const h = Math.max(r.startIndex - r.overscan, 0), t = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
|
|
8
|
+
for (let e = h; e <= t; e++)
|
|
9
|
+
s.push(e);
|
|
10
|
+
return s;
|
|
11
|
+
}, _ = (r, h) => {
|
|
12
|
+
const t = r.scrollElement;
|
|
13
|
+
if (!t)
|
|
14
|
+
return;
|
|
15
|
+
const s = r.targetWindow;
|
|
16
|
+
if (!s)
|
|
17
|
+
return;
|
|
18
|
+
const e = (n) => {
|
|
19
|
+
const { width: o, height: a } = n;
|
|
20
|
+
h({ width: Math.round(o), height: Math.round(a) });
|
|
21
|
+
};
|
|
22
|
+
if (e(b(t)), !s.ResizeObserver)
|
|
23
|
+
return () => {
|
|
24
|
+
};
|
|
25
|
+
const i = new s.ResizeObserver((n) => {
|
|
26
|
+
const o = () => {
|
|
27
|
+
const a = n[0];
|
|
28
|
+
if (a != null && a.borderBoxSize) {
|
|
29
|
+
const c = a.borderBoxSize[0];
|
|
30
|
+
if (c) {
|
|
31
|
+
e({ width: c.inlineSize, height: c.blockSize });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
e(b(t));
|
|
36
|
+
};
|
|
37
|
+
r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
|
38
|
+
});
|
|
39
|
+
return i.observe(t, { box: "border-box" }), () => {
|
|
40
|
+
i.unobserve(t);
|
|
41
|
+
};
|
|
42
|
+
}, x = {
|
|
43
|
+
passive: !0
|
|
44
|
+
}, E = typeof window > "u" ? !0 : "onscrollend" in window, A = (r, h) => {
|
|
45
|
+
const t = r.scrollElement;
|
|
46
|
+
if (!t)
|
|
47
|
+
return;
|
|
48
|
+
const s = r.targetWindow;
|
|
49
|
+
if (!s)
|
|
50
|
+
return;
|
|
51
|
+
let e = 0;
|
|
52
|
+
const i = r.options.useScrollendEvent && E ? () => {
|
|
53
|
+
} : y(
|
|
54
|
+
s,
|
|
55
|
+
() => {
|
|
56
|
+
h(e, !1);
|
|
57
|
+
},
|
|
58
|
+
r.options.isScrollingResetDelay
|
|
59
|
+
), n = (l) => () => {
|
|
60
|
+
const { horizontal: f, isRtl: u } = r.options;
|
|
61
|
+
e = f ? t.scrollLeft * (u && -1 || 1) : t.scrollTop, i(), h(e, l);
|
|
62
|
+
}, o = n(!0), a = n(!1);
|
|
63
|
+
a(), t.addEventListener("scroll", o, x);
|
|
64
|
+
const c = r.options.useScrollendEvent && E;
|
|
65
|
+
return c && t.addEventListener("scrollend", a, x), () => {
|
|
66
|
+
t.removeEventListener("scroll", o), c && t.removeEventListener("scrollend", a);
|
|
67
|
+
};
|
|
68
|
+
}, C = (r, h, t) => {
|
|
69
|
+
if (h != null && h.borderBoxSize) {
|
|
70
|
+
const s = h.borderBoxSize[0];
|
|
71
|
+
if (s)
|
|
72
|
+
return Math.round(
|
|
73
|
+
s[t.options.horizontal ? "inlineSize" : "blockSize"]
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return r[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
77
|
+
}, D = (r, {
|
|
78
|
+
adjustments: h = 0,
|
|
79
|
+
behavior: t
|
|
80
|
+
}, s) => {
|
|
81
|
+
var e, i;
|
|
82
|
+
const n = r + h;
|
|
83
|
+
(i = (e = s.scrollElement) == null ? void 0 : e.scrollTo) == null || i.call(e, {
|
|
84
|
+
[s.options.horizontal ? "left" : "top"]: n,
|
|
85
|
+
behavior: t
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
class N {
|
|
89
|
+
constructor(h) {
|
|
90
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
91
|
+
let t = null;
|
|
92
|
+
const s = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((e) => {
|
|
93
|
+
e.forEach((i) => {
|
|
94
|
+
const n = () => {
|
|
95
|
+
this._measureElement(i.target, i);
|
|
96
|
+
};
|
|
97
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
|
|
98
|
+
});
|
|
99
|
+
}));
|
|
100
|
+
return {
|
|
101
|
+
disconnect: () => {
|
|
102
|
+
var e;
|
|
103
|
+
(e = s()) == null || e.disconnect(), t = null;
|
|
104
|
+
},
|
|
105
|
+
observe: (e) => {
|
|
106
|
+
var i;
|
|
107
|
+
return (i = s()) == null ? void 0 : i.observe(e, { box: "border-box" });
|
|
108
|
+
},
|
|
109
|
+
unobserve: (e) => {
|
|
110
|
+
var i;
|
|
111
|
+
return (i = s()) == null ? void 0 : i.unobserve(e);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
})(), this.range = null, this.setOptions = (t) => {
|
|
115
|
+
Object.entries(t).forEach(([s, e]) => {
|
|
116
|
+
typeof e > "u" && delete t[s];
|
|
117
|
+
}), this.options = {
|
|
118
|
+
debug: !1,
|
|
119
|
+
initialOffset: 0,
|
|
120
|
+
overscan: 1,
|
|
121
|
+
paddingStart: 0,
|
|
122
|
+
paddingEnd: 0,
|
|
123
|
+
scrollPaddingStart: 0,
|
|
124
|
+
scrollPaddingEnd: 0,
|
|
125
|
+
horizontal: !1,
|
|
126
|
+
getItemKey: z,
|
|
127
|
+
rangeExtractor: w,
|
|
128
|
+
onChange: () => {
|
|
129
|
+
},
|
|
130
|
+
measureElement: C,
|
|
131
|
+
initialRect: { width: 0, height: 0 },
|
|
132
|
+
scrollMargin: 0,
|
|
133
|
+
gap: 0,
|
|
134
|
+
indexAttribute: "data-index",
|
|
135
|
+
initialMeasurementsCache: [],
|
|
136
|
+
lanes: 1,
|
|
137
|
+
isScrollingResetDelay: 150,
|
|
138
|
+
enabled: !0,
|
|
139
|
+
isRtl: !1,
|
|
140
|
+
useScrollendEvent: !1,
|
|
141
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
142
|
+
...t
|
|
143
|
+
};
|
|
144
|
+
}, this.notify = (t) => {
|
|
145
|
+
var s, e;
|
|
146
|
+
(e = (s = this.options).onChange) == null || e.call(s, this, t);
|
|
147
|
+
}, this.maybeNotify = d(
|
|
148
|
+
() => (this.calculateRange(), [
|
|
149
|
+
this.isScrolling,
|
|
150
|
+
this.range ? this.range.startIndex : null,
|
|
151
|
+
this.range ? this.range.endIndex : null
|
|
152
|
+
]),
|
|
153
|
+
(t) => {
|
|
154
|
+
this.notify(t);
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
158
|
+
debug: () => this.options.debug,
|
|
159
|
+
initialDeps: [
|
|
160
|
+
this.isScrolling,
|
|
161
|
+
this.range ? this.range.startIndex : null,
|
|
162
|
+
this.range ? this.range.endIndex : null
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
), this.cleanup = () => {
|
|
166
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
|
|
167
|
+
}, this._didMount = () => () => {
|
|
168
|
+
this.cleanup();
|
|
169
|
+
}, this._willUpdate = () => {
|
|
170
|
+
var t;
|
|
171
|
+
const s = this.options.enabled ? this.options.getScrollElement() : null;
|
|
172
|
+
if (this.scrollElement !== s) {
|
|
173
|
+
if (this.cleanup(), !s) {
|
|
174
|
+
this.maybeNotify();
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((e) => {
|
|
178
|
+
this.observer.observe(e);
|
|
179
|
+
}), this._scrollToOffset(this.getScrollOffset(), {
|
|
180
|
+
adjustments: void 0,
|
|
181
|
+
behavior: void 0
|
|
182
|
+
}), this.unsubs.push(
|
|
183
|
+
this.options.observeElementRect(this, (e) => {
|
|
184
|
+
this.scrollRect = e, this.maybeNotify();
|
|
185
|
+
})
|
|
186
|
+
), this.unsubs.push(
|
|
187
|
+
this.options.observeElementOffset(this, (e, i) => {
|
|
188
|
+
this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = i, this.maybeNotify();
|
|
189
|
+
})
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, s) => {
|
|
193
|
+
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
194
|
+
for (let n = s - 1; n >= 0; n--) {
|
|
195
|
+
const o = t[n];
|
|
196
|
+
if (e.has(o.lane))
|
|
197
|
+
continue;
|
|
198
|
+
const a = i.get(
|
|
199
|
+
o.lane
|
|
200
|
+
);
|
|
201
|
+
if (a == null || o.end > a.end ? i.set(o.lane, o) : o.end < a.end && e.set(o.lane, !0), e.size === this.options.lanes)
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
return i.size === this.options.lanes ? Array.from(i.values()).sort((n, o) => n.end === o.end ? n.index - o.index : n.end - o.end)[0] : void 0;
|
|
205
|
+
}, this.getMeasurementOptions = d(
|
|
206
|
+
() => [
|
|
207
|
+
this.options.count,
|
|
208
|
+
this.options.paddingStart,
|
|
209
|
+
this.options.scrollMargin,
|
|
210
|
+
this.options.getItemKey,
|
|
211
|
+
this.options.enabled
|
|
212
|
+
],
|
|
213
|
+
(t, s, e, i, n) => (this.pendingMeasuredCacheIndexes = [], {
|
|
214
|
+
count: t,
|
|
215
|
+
paddingStart: s,
|
|
216
|
+
scrollMargin: e,
|
|
217
|
+
getItemKey: i,
|
|
218
|
+
enabled: n
|
|
219
|
+
}),
|
|
220
|
+
{
|
|
221
|
+
key: !1
|
|
222
|
+
}
|
|
223
|
+
), this.getMeasurements = d(
|
|
224
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
225
|
+
({ count: t, paddingStart: s, scrollMargin: e, getItemKey: i, enabled: n }, o) => {
|
|
226
|
+
if (!n)
|
|
227
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
228
|
+
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
|
|
229
|
+
this.itemSizeCache.set(l.key, l.size);
|
|
230
|
+
}));
|
|
231
|
+
const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
232
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
233
|
+
const c = this.measurementsCache.slice(0, a);
|
|
234
|
+
for (let l = a; l < t; l++) {
|
|
235
|
+
const f = i(l), u = this.options.lanes === 1 ? c[l - 1] : this.getFurthestMeasurement(c, l), g = u ? u.end + this.options.gap : s + e, p = o.get(f), v = typeof p == "number" ? p : this.options.estimateSize(l), O = g + v, I = u ? u.lane : l % this.options.lanes;
|
|
236
|
+
c[l] = {
|
|
237
|
+
index: l,
|
|
238
|
+
start: g,
|
|
239
|
+
size: v,
|
|
240
|
+
end: O,
|
|
241
|
+
key: f,
|
|
242
|
+
lane: I
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return this.measurementsCache = c, c;
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
249
|
+
debug: () => this.options.debug
|
|
250
|
+
}
|
|
251
|
+
), this.calculateRange = d(
|
|
252
|
+
() => [
|
|
253
|
+
this.getMeasurements(),
|
|
254
|
+
this.getSize(),
|
|
255
|
+
this.getScrollOffset(),
|
|
256
|
+
this.options.lanes
|
|
257
|
+
],
|
|
258
|
+
(t, s, e, i) => this.range = t.length > 0 && s > 0 ? T({
|
|
259
|
+
measurements: t,
|
|
260
|
+
outerSize: s,
|
|
261
|
+
scrollOffset: e,
|
|
262
|
+
lanes: i
|
|
263
|
+
}) : null,
|
|
264
|
+
{
|
|
265
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
266
|
+
debug: () => this.options.debug
|
|
267
|
+
}
|
|
268
|
+
), this.getVirtualIndexes = d(
|
|
269
|
+
() => {
|
|
270
|
+
let t = null, s = null;
|
|
271
|
+
const e = this.calculateRange();
|
|
272
|
+
return e && (t = e.startIndex, s = e.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, s]), [
|
|
273
|
+
this.options.rangeExtractor,
|
|
274
|
+
this.options.overscan,
|
|
275
|
+
this.options.count,
|
|
276
|
+
t,
|
|
277
|
+
s
|
|
278
|
+
];
|
|
279
|
+
},
|
|
280
|
+
(t, s, e, i, n) => i === null || n === null ? [] : t({
|
|
281
|
+
startIndex: i,
|
|
282
|
+
endIndex: n,
|
|
283
|
+
overscan: s,
|
|
284
|
+
count: e
|
|
285
|
+
}),
|
|
286
|
+
{
|
|
287
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
288
|
+
debug: () => this.options.debug
|
|
289
|
+
}
|
|
290
|
+
), this.indexFromElement = (t) => {
|
|
291
|
+
const s = this.options.indexAttribute, e = t.getAttribute(s);
|
|
292
|
+
return e ? parseInt(e, 10) : (console.warn(
|
|
293
|
+
`Missing attribute name '${s}={index}' on measured element.`
|
|
294
|
+
), -1);
|
|
295
|
+
}, this._measureElement = (t, s) => {
|
|
296
|
+
const e = this.indexFromElement(t), i = this.measurementsCache[e];
|
|
297
|
+
if (!i)
|
|
298
|
+
return;
|
|
299
|
+
const n = i.key, o = this.elementsCache.get(n);
|
|
300
|
+
o !== t && (o && this.observer.unobserve(o), this.observer.observe(t), this.elementsCache.set(n, t)), t.isConnected && this.resizeItem(e, this.options.measureElement(t, s, this));
|
|
301
|
+
}, this.resizeItem = (t, s) => {
|
|
302
|
+
const e = this.measurementsCache[t];
|
|
303
|
+
if (!e)
|
|
304
|
+
return;
|
|
305
|
+
const i = this.itemSizeCache.get(e.key) ?? e.size, n = s - i;
|
|
306
|
+
n !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(e, n, this) : e.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", n), this._scrollToOffset(this.getScrollOffset(), {
|
|
307
|
+
adjustments: this.scrollAdjustments += n,
|
|
308
|
+
behavior: void 0
|
|
309
|
+
})), this.pendingMeasuredCacheIndexes.push(e.index), this.itemSizeCache = new Map(this.itemSizeCache.set(e.key, s)), this.notify(!1));
|
|
310
|
+
}, this.measureElement = (t) => {
|
|
311
|
+
if (!t) {
|
|
312
|
+
this.elementsCache.forEach((s, e) => {
|
|
313
|
+
s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(e));
|
|
314
|
+
});
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
this._measureElement(t, void 0);
|
|
318
|
+
}, this.getVirtualItems = d(
|
|
319
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
320
|
+
(t, s) => {
|
|
321
|
+
const e = [];
|
|
322
|
+
for (let i = 0, n = t.length; i < n; i++) {
|
|
323
|
+
const o = t[i], a = s[o];
|
|
324
|
+
e.push(a);
|
|
325
|
+
}
|
|
326
|
+
return e;
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
330
|
+
debug: () => this.options.debug
|
|
331
|
+
}
|
|
332
|
+
), this.getVirtualItemForOffset = (t) => {
|
|
333
|
+
const s = this.getMeasurements();
|
|
334
|
+
if (s.length !== 0)
|
|
335
|
+
return m(
|
|
336
|
+
s[S(
|
|
337
|
+
0,
|
|
338
|
+
s.length - 1,
|
|
339
|
+
(e) => m(s[e]).start,
|
|
340
|
+
t
|
|
341
|
+
)]
|
|
342
|
+
);
|
|
343
|
+
}, this.getOffsetForAlignment = (t, s, e = 0) => {
|
|
344
|
+
const i = this.getSize(), n = this.getScrollOffset();
|
|
345
|
+
s === "auto" && (s = t >= n + i ? "end" : "start"), s === "center" ? t += (e - i) / 2 : s === "end" && (t -= i);
|
|
346
|
+
const o = this.getTotalSize() - i;
|
|
347
|
+
return Math.max(Math.min(o, t), 0);
|
|
348
|
+
}, this.getOffsetForIndex = (t, s = "auto") => {
|
|
349
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
350
|
+
const e = this.measurementsCache[t];
|
|
351
|
+
if (!e)
|
|
352
|
+
return;
|
|
353
|
+
const i = this.getSize(), n = this.getScrollOffset();
|
|
354
|
+
if (s === "auto")
|
|
355
|
+
if (e.end >= n + i - this.options.scrollPaddingEnd)
|
|
356
|
+
s = "end";
|
|
357
|
+
else if (e.start <= n + this.options.scrollPaddingStart)
|
|
358
|
+
s = "start";
|
|
359
|
+
else
|
|
360
|
+
return [n, s];
|
|
361
|
+
const o = s === "end" ? e.end + this.options.scrollPaddingEnd : e.start - this.options.scrollPaddingStart;
|
|
362
|
+
return [
|
|
363
|
+
this.getOffsetForAlignment(o, s, e.size),
|
|
364
|
+
s
|
|
365
|
+
];
|
|
366
|
+
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
|
|
367
|
+
this.scrollToIndexTimeoutId !== null && this.targetWindow && (this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId), this.scrollToIndexTimeoutId = null);
|
|
368
|
+
}, this.scrollToOffset = (t, { align: s = "start", behavior: e } = {}) => {
|
|
369
|
+
this.cancelScrollToIndex(), e === "smooth" && this.isDynamicMode() && console.warn(
|
|
370
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
371
|
+
), this._scrollToOffset(this.getOffsetForAlignment(t, s), {
|
|
372
|
+
adjustments: void 0,
|
|
373
|
+
behavior: e
|
|
374
|
+
});
|
|
375
|
+
}, this.scrollToIndex = (t, { align: s = "auto", behavior: e } = {}) => {
|
|
376
|
+
t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), e === "smooth" && this.isDynamicMode() && console.warn(
|
|
377
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
378
|
+
);
|
|
379
|
+
const i = this.getOffsetForIndex(t, s);
|
|
380
|
+
if (!i) return;
|
|
381
|
+
const [n, o] = i;
|
|
382
|
+
this._scrollToOffset(n, { adjustments: void 0, behavior: e }), e !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
|
|
383
|
+
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
|
384
|
+
this.options.getItemKey(t)
|
|
385
|
+
)) {
|
|
386
|
+
const [c] = m(
|
|
387
|
+
this.getOffsetForIndex(t, o)
|
|
388
|
+
), l = this.getScrollOffset();
|
|
389
|
+
M(c, l) || this.scrollToIndex(t, { align: o, behavior: e });
|
|
390
|
+
} else
|
|
391
|
+
this.scrollToIndex(t, { align: o, behavior: e });
|
|
392
|
+
}));
|
|
393
|
+
}, this.scrollBy = (t, { behavior: s } = {}) => {
|
|
394
|
+
this.cancelScrollToIndex(), s === "smooth" && this.isDynamicMode() && console.warn(
|
|
395
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
396
|
+
), this._scrollToOffset(this.getScrollOffset() + t, {
|
|
397
|
+
adjustments: void 0,
|
|
398
|
+
behavior: s
|
|
399
|
+
});
|
|
400
|
+
}, this.getTotalSize = () => {
|
|
401
|
+
var t;
|
|
402
|
+
const s = this.getMeasurements();
|
|
403
|
+
let e;
|
|
404
|
+
if (s.length === 0)
|
|
405
|
+
e = this.options.paddingStart;
|
|
406
|
+
else if (this.options.lanes === 1)
|
|
407
|
+
e = ((t = s[s.length - 1]) == null ? void 0 : t.end) ?? 0;
|
|
408
|
+
else {
|
|
409
|
+
const i = Array(this.options.lanes).fill(null);
|
|
410
|
+
let n = s.length - 1;
|
|
411
|
+
for (; n >= 0 && i.some((o) => o === null); ) {
|
|
412
|
+
const o = s[n];
|
|
413
|
+
i[o.lane] === null && (i[o.lane] = o.end), n--;
|
|
414
|
+
}
|
|
415
|
+
e = Math.max(...i.filter((o) => o !== null));
|
|
416
|
+
}
|
|
417
|
+
return Math.max(
|
|
418
|
+
e - this.options.scrollMargin + this.options.paddingEnd,
|
|
419
|
+
0
|
|
420
|
+
);
|
|
421
|
+
}, this._scrollToOffset = (t, {
|
|
422
|
+
adjustments: s,
|
|
423
|
+
behavior: e
|
|
424
|
+
}) => {
|
|
425
|
+
this.options.scrollToFn(t, { behavior: e, adjustments: s }, this);
|
|
426
|
+
}, this.measure = () => {
|
|
427
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
428
|
+
}, this.setOptions(h);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
const S = (r, h, t, s) => {
|
|
432
|
+
for (; r <= h; ) {
|
|
433
|
+
const e = (r + h) / 2 | 0, i = t(e);
|
|
434
|
+
if (i < s)
|
|
435
|
+
r = e + 1;
|
|
436
|
+
else if (i > s)
|
|
437
|
+
h = e - 1;
|
|
438
|
+
else
|
|
439
|
+
return e;
|
|
440
|
+
}
|
|
441
|
+
return r > 0 ? r - 1 : 0;
|
|
442
|
+
};
|
|
443
|
+
function T({
|
|
444
|
+
measurements: r,
|
|
445
|
+
outerSize: h,
|
|
446
|
+
scrollOffset: t,
|
|
447
|
+
lanes: s
|
|
448
|
+
}) {
|
|
449
|
+
const e = r.length - 1, i = (a) => r[a].start;
|
|
450
|
+
if (r.length <= s)
|
|
451
|
+
return {
|
|
452
|
+
startIndex: 0,
|
|
453
|
+
endIndex: e
|
|
454
|
+
};
|
|
455
|
+
let n = S(
|
|
456
|
+
0,
|
|
457
|
+
e,
|
|
458
|
+
i,
|
|
459
|
+
t
|
|
460
|
+
), o = n;
|
|
461
|
+
if (s === 1)
|
|
462
|
+
for (; o < e && r[o].end < t + h; )
|
|
463
|
+
o++;
|
|
464
|
+
else if (s > 1) {
|
|
465
|
+
const a = Array(s).fill(0);
|
|
466
|
+
for (; o < e && a.some((l) => l < t + h); ) {
|
|
467
|
+
const l = r[o];
|
|
468
|
+
a[l.lane] = l.end, o++;
|
|
469
|
+
}
|
|
470
|
+
const c = Array(s).fill(t + h);
|
|
471
|
+
for (; n >= 0 && c.some((l) => l >= t); ) {
|
|
472
|
+
const l = r[n];
|
|
473
|
+
c[l.lane] = l.start, n--;
|
|
474
|
+
}
|
|
475
|
+
n = Math.max(0, n - n % s), o = Math.min(e, o + (s - 1 - o % s));
|
|
476
|
+
}
|
|
477
|
+
return { startIndex: n, endIndex: o };
|
|
478
|
+
}
|
|
479
|
+
export {
|
|
480
|
+
N as Virtualizer,
|
|
481
|
+
M as approxEqual,
|
|
482
|
+
y as debounce,
|
|
483
|
+
z as defaultKeyExtractor,
|
|
484
|
+
w as defaultRangeExtractor,
|
|
485
|
+
D as elementScroll,
|
|
486
|
+
C as measureElement,
|
|
487
|
+
d as memo,
|
|
488
|
+
m as notUndefined,
|
|
489
|
+
A as observeElementOffset,
|
|
490
|
+
_ as observeElementRect
|
|
491
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function T(n, i, e) {
|
|
3
|
+
let l = e.initialDeps ?? [], t;
|
|
4
|
+
function r() {
|
|
5
|
+
var u, m, h, f;
|
|
6
|
+
let g;
|
|
7
|
+
e.key && ((u = e.debug) != null && u.call(e)) && (g = Date.now());
|
|
8
|
+
const o = n();
|
|
9
|
+
if (!(o.length !== l.length || o.some((c, a) => l[a] !== c)))
|
|
10
|
+
return t;
|
|
11
|
+
l = o;
|
|
12
|
+
let s;
|
|
13
|
+
if (e.key && ((m = e.debug) != null && m.call(e)) && (s = Date.now()), t = i(...o), e.key && ((h = e.debug) != null && h.call(e))) {
|
|
14
|
+
const c = Math.round((Date.now() - g) * 100) / 100, a = Math.round((Date.now() - s) * 100) / 100, b = a / 16, w = (d, v) => {
|
|
15
|
+
for (d = String(d); d.length < v; )
|
|
16
|
+
d = " " + d;
|
|
17
|
+
return d;
|
|
18
|
+
};
|
|
19
|
+
console.info(
|
|
20
|
+
`%c⏱ ${w(a, 5)} /${w(c, 5)} ms`,
|
|
21
|
+
`
|
|
22
|
+
font-size: .6rem;
|
|
23
|
+
font-weight: bold;
|
|
24
|
+
color: hsl(${Math.max(
|
|
25
|
+
0,
|
|
26
|
+
Math.min(120 - 120 * b, 120)
|
|
27
|
+
)}deg 100% 31%);`,
|
|
28
|
+
e == null ? void 0 : e.key
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return (f = e == null ? void 0 : e.onChange) == null || f.call(e, t), t;
|
|
32
|
+
}
|
|
33
|
+
return r.updateDeps = (u) => {
|
|
34
|
+
l = u;
|
|
35
|
+
}, r;
|
|
36
|
+
}
|
|
37
|
+
function y(n, i) {
|
|
38
|
+
if (n === void 0)
|
|
39
|
+
throw new Error("Unexpected undefined");
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
const M = (n, i) => Math.abs(n - i) <= 1, k = (n, i, e) => {
|
|
43
|
+
let l;
|
|
44
|
+
return function(...t) {
|
|
45
|
+
n.clearTimeout(l), l = n.setTimeout(() => i.apply(this, t), e);
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
M as approxEqual,
|
|
50
|
+
k as debounce,
|
|
51
|
+
T as memo,
|
|
52
|
+
y as notUndefined
|
|
53
|
+
};
|
|
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
|
|
|
3
3
|
import { ok as u } from "../../devlop/lib/default.js";
|
|
4
4
|
import { svg as m, html as C } from "../../property-information/index.js";
|
|
5
5
|
import { stringify as N } from "../../space-separated-tokens/index.js";
|
|
6
|
-
import S from "../../../_virtual/
|
|
6
|
+
import S from "../../../_virtual/index5.js";
|
|
7
7
|
import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
|
|
8
8
|
import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
|
|
9
9
|
import { VFileMessage as h } from "../../vfile-message/lib/index.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { caseInsensitiveTransform as
|
|
3
|
-
import { create as
|
|
4
|
-
import { number as n, boolean as l, booleanish as o, spaceSeparated as e, overloadedBoolean as
|
|
5
|
-
const d =
|
|
2
|
+
import { caseInsensitiveTransform as t } from "./util/case-insensitive-transform.js";
|
|
3
|
+
import { create as r } from "./util/create.js";
|
|
4
|
+
import { number as n, boolean as l, booleanish as o, spaceSeparated as e, overloadedBoolean as u, commaSeparated as a } from "./util/types.js";
|
|
5
|
+
const d = r({
|
|
6
6
|
attributes: {
|
|
7
7
|
acceptcharset: "accept-charset",
|
|
8
8
|
classname: "class",
|
|
@@ -13,7 +13,7 @@ const d = t({
|
|
|
13
13
|
properties: {
|
|
14
14
|
// Standard Properties.
|
|
15
15
|
abbr: null,
|
|
16
|
-
accept:
|
|
16
|
+
accept: a,
|
|
17
17
|
acceptCharset: e,
|
|
18
18
|
accessKey: e,
|
|
19
19
|
action: null,
|
|
@@ -40,7 +40,7 @@ const d = t({
|
|
|
40
40
|
contentEditable: o,
|
|
41
41
|
controls: l,
|
|
42
42
|
controlsList: e,
|
|
43
|
-
coords: n |
|
|
43
|
+
coords: n | a,
|
|
44
44
|
crossOrigin: null,
|
|
45
45
|
data: null,
|
|
46
46
|
dateTime: null,
|
|
@@ -50,7 +50,7 @@ const d = t({
|
|
|
50
50
|
dir: null,
|
|
51
51
|
dirName: null,
|
|
52
52
|
disabled: l,
|
|
53
|
-
download:
|
|
53
|
+
download: u,
|
|
54
54
|
draggable: o,
|
|
55
55
|
encType: null,
|
|
56
56
|
enterKeyHint: null,
|
|
@@ -63,7 +63,7 @@ const d = t({
|
|
|
63
63
|
formTarget: null,
|
|
64
64
|
headers: e,
|
|
65
65
|
height: n,
|
|
66
|
-
hidden:
|
|
66
|
+
hidden: u,
|
|
67
67
|
high: n,
|
|
68
68
|
href: null,
|
|
69
69
|
hrefLang: null,
|
|
@@ -362,7 +362,7 @@ const d = t({
|
|
|
362
362
|
unselectable: null
|
|
363
363
|
},
|
|
364
364
|
space: "html",
|
|
365
|
-
transform:
|
|
365
|
+
transform: t
|
|
366
366
|
});
|
|
367
367
|
export {
|
|
368
368
|
d as html
|