bitboss-ui 2.0.165 → 2.0.167
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/components/BaseButton/BaseButton.vue.d.ts +2 -1
- package/dist/components/BaseButton/RouterComponent.vue.d.ts +2 -1
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +5 -2
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +2 -4
- package/dist/components/BaseColorInput/BaseColorInput.vue.d.ts +106 -4
- package/dist/components/BaseColorInput/ColorPallette.vue.d.ts +5 -1
- package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +4 -3
- package/dist/components/BaseDatePicker/BaseDatePickerHeader.vue.d.ts +1 -1
- package/dist/components/BaseDatePicker/BaseDatePickerInputDaySelector.vue.d.ts +5 -2
- package/dist/components/BaseDatePicker/BaseDatePickerMonthSelector.vue.d.ts +1 -1
- package/dist/components/BaseDatePicker/BaseDatePickerYearSelector.vue.d.ts +3 -1
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +200 -10
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +10 -2
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +3 -2
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +5 -2
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +3 -2
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +2 -4
- package/dist/components/BaseRating/BaseRating.vue.d.ts +5 -2
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +2 -4
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +8 -2
- package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +5 -2
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +2 -4
- package/dist/components/BaseTag/BaseTag.vue.d.ts +207 -6
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +5 -2
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +5 -2
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +3 -2
- package/dist/components/BbAlert/BbAlert.vue.d.ts +2 -1
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +5 -2
- package/dist/components/BbBadge/BbBadge.vue.d.ts +3 -2
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +3 -2
- package/dist/components/BbButton/BbButton.vue.d.ts +2 -1
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +3 -2
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +2 -4
- package/dist/components/BbChip/BbChip.vue.d.ts +3 -2
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -1
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +3 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -2
- package/dist/components/BbDialog/BbDialog.vue.d.ts +2 -1
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +241 -100
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +69 -126
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +5 -2
- package/dist/components/BbIntersection/BbIntersection.vue.d.ts +5 -2
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +100 -9
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +10 -2
- package/dist/components/BbPagination/BbPagination.vue.d.ts +10 -6
- package/dist/components/BbPopover/BbPopover.vue.d.ts +168 -15
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadio/BbRadio.vue.d.ts +3 -2
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +2 -4
- package/dist/components/BbRating/BbRating.vue.d.ts +3 -2
- package/dist/components/BbRatio/BbRatio.vue.d.ts +2 -1
- package/dist/components/BbRows/BbRows.vue.d.ts +3 -5
- package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -4
- package/dist/components/BbSlider/BbSlider.vue.d.ts +3 -2
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +6 -2
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +3 -2
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +2 -4
- package/dist/components/BbTab/BbTab.vue.d.ts +6 -2
- package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
- package/dist/components/BbTag/BbTag.vue.d.ts +3 -2
- package/dist/components/BbTeleport.vue.d.ts +2 -1
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +3 -2
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +3 -2
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +1 -1
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +175 -7
- package/dist/components/BbTree/BbTree.vue.d.ts +2 -1
- package/dist/components/ClearableButton.vue.d.ts +1 -1
- package/dist/components/CommonFloating.vue.d.ts +6 -2
- package/dist/components/CommonInputInnerContainer.vue.d.ts +5 -2
- package/dist/components/CommonInputOuterContainer.vue.d.ts +5 -4
- package/dist/components/CommonPopover.vue.d.ts +42 -0
- package/dist/components/ErrorIcon.vue.d.ts +1 -1
- package/dist/components/ListBox.vue.d.ts +4 -6
- package/dist/components/OptionsContainer.vue.d.ts +4 -6
- package/dist/components/Transitions/Slide.vue.d.ts +2 -1
- package/dist/composables/useUntil.d.ts +7 -0
- package/dist/{style.css → index.css} +1 -1
- package/dist/index.js +148 -143
- package/dist/index100.js +122 -135
- package/dist/index102.js +100 -0
- package/dist/index104.js +24 -0
- package/dist/index106.js +144 -0
- package/dist/index107.js +106 -59
- package/dist/index109.js +101 -289
- package/dist/index11.js +2 -2
- package/dist/index111.js +37 -476
- package/dist/index113.js +31 -118
- package/dist/index115.js +43 -61
- package/dist/index117.js +86 -78
- package/dist/index119.js +296 -26
- package/dist/index12.js +6 -6
- package/dist/index121.js +470 -138
- package/dist/index123.js +117 -115
- package/dist/index125.js +110 -35
- package/dist/index127.js +115 -45
- package/dist/index129.js +28 -31
- package/dist/index13.js +5 -5
- package/dist/index131.js +117 -21
- package/dist/index133.js +120 -9
- package/dist/index135.js +2 -2
- package/dist/index136.js +21 -5
- package/dist/index137.js +375 -7
- package/dist/index138.js +9 -6
- package/dist/index139.js +25 -3
- package/dist/index140.js +2 -3
- package/dist/index141.js +5 -3
- package/dist/index142.js +9 -3
- package/dist/index143.js +6 -3
- package/dist/index144.js +1 -1
- package/dist/index145.js +1 -1
- package/dist/index146.js +1 -1
- package/dist/index147.js +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.js +1 -1
- package/dist/index15.js +15 -15
- package/dist/index150.js +1 -1
- package/dist/index151.js +1 -1
- package/dist/index152.js +1 -1
- package/dist/index153.js +1 -1
- package/dist/index154.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.js +1 -1
- package/dist/index159.js +1 -1
- package/dist/index160.js +1 -1
- package/dist/index161.js +1 -1
- package/dist/index162.js +1 -1
- package/dist/index163.js +1 -1
- package/dist/index164.js +1 -1
- package/dist/index165.js +1 -1
- package/dist/index166.js +2 -2
- package/dist/index167.js +5 -0
- package/dist/index168.js +2 -2
- package/dist/index169.js +5 -0
- package/dist/index17.js +6 -6
- package/dist/index170.js +1 -1
- package/dist/index171.js +1 -1
- package/dist/index172.js +1 -1
- package/dist/index173.js +1 -1
- package/dist/index174.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.js +2 -2
- package/dist/index178.js +5 -0
- package/dist/index179.js +3 -2
- package/dist/index180.js +1 -1
- package/dist/index181.js +2 -3
- package/dist/index182.js +1 -1
- package/dist/index183.js +1 -1
- package/dist/index184.js +1 -1
- package/dist/index185.js +1 -1
- package/dist/index186.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index188.js +2 -2
- package/dist/index189.js +3 -2
- package/dist/index19.js +10 -10
- package/dist/index190.js +1 -1
- package/dist/index191.js +2 -3
- package/dist/index192.js +1 -1
- package/dist/index193.js +5 -0
- package/dist/index194.js +1 -1
- package/dist/index195.js +5 -0
- package/dist/index196.js +1 -1
- package/dist/index197.js +1 -1
- package/dist/index198.js +1 -1
- package/dist/index199.js +1 -1
- package/dist/index200.js +1 -1
- package/dist/index201.js +1 -1
- package/dist/index202.js +1 -1
- package/dist/index203.js +1 -1
- package/dist/index204.js +1 -1
- package/dist/index205.js +1 -1
- package/dist/index206.js +100 -77
- package/dist/index208.js +2 -4
- package/dist/index209.js +3 -40
- package/dist/index21.js +17 -17
- package/dist/index210.js +41 -20
- package/dist/index211.js +19 -93
- package/dist/index212.js +96 -0
- package/dist/{index213.js → index214.js} +9 -9
- package/dist/{index215.js → index216.js} +15 -15
- package/dist/index218.js +13 -13
- package/dist/index219.js +13 -5
- package/dist/index220.js +5 -16
- package/dist/index221.js +5 -16
- package/dist/index222.js +5 -19
- package/dist/index223.js +5 -15
- package/dist/index224.js +5 -19
- package/dist/index225.js +5 -27
- package/dist/index226.js +5 -3
- package/dist/index227.js +3 -2
- package/dist/index228.js +2 -8
- package/dist/index229.js +6 -248
- package/dist/index23.js +25 -25
- package/dist/index230.js +240 -42
- package/dist/index231.js +43 -35
- package/dist/index232.js +44 -5
- package/dist/index233.js +5 -60
- package/dist/index234.js +60 -3
- package/dist/index235.js +5 -85
- package/dist/index236.js +9 -0
- package/dist/index237.js +15 -29
- package/dist/index238.js +34 -17
- package/dist/index239.js +86 -51
- package/dist/index241.js +28 -11
- package/dist/index242.js +15 -14
- package/dist/index243.js +50 -124
- package/dist/index244.js +15 -2
- package/dist/index245.js +12 -6
- package/dist/index246.js +16 -2
- package/dist/index247.js +5 -9
- package/dist/index248.js +2 -2
- package/dist/index249.js +2 -4
- package/dist/index25.js +8 -8
- package/dist/index250.js +9 -2
- package/dist/index251.js +18 -7
- package/dist/index252.js +127 -14
- package/dist/index253.js +4 -34
- package/dist/index254.js +106 -2
- package/dist/index256.js +100 -2
- package/dist/index258.js +12 -126
- package/dist/index259.js +211 -89
- package/dist/index260.js +370 -0
- package/dist/index261.js +2 -100
- package/dist/index262.js +4 -0
- package/dist/index263.js +2 -12
- package/dist/index264.js +3 -228
- package/dist/index265.js +162 -354
- package/dist/index266.js +2 -176
- package/dist/index27.js +18 -18
- package/dist/index270.js +11 -23
- package/dist/index271.js +101 -3
- package/dist/index273.js +23 -16
- package/dist/index274.js +6 -281
- package/dist/index275.js +16 -6
- package/dist/index276.js +3 -2
- package/dist/index277.js +9 -2
- package/dist/index278.js +8 -2
- package/dist/index279.js +2 -2
- package/dist/index280.js +67 -2
- package/dist/index281.js +5 -2
- package/dist/index282.js +5 -2
- package/dist/index283.js +8 -2
- package/dist/index284.js +471 -2
- package/dist/index285.js +3 -2
- package/dist/index286.js +3 -2
- package/dist/index287.js +3 -28
- package/dist/index289.js +9 -0
- package/dist/index29.js +5 -5
- package/dist/index290.js +6 -6
- package/dist/index291.js +11 -7
- package/dist/index292.js +279 -10
- package/dist/index293.js +2 -431
- package/dist/index294.js +16 -3
- package/dist/index295.js +2 -3
- package/dist/index296.js +16 -3
- package/dist/index297.js +4 -0
- package/dist/index298.js +18 -223
- package/dist/index299.js +2 -3
- package/dist/index300.js +15 -17
- package/dist/index301.js +2 -9
- package/dist/index302.js +18 -199
- package/dist/index303.js +2 -2
- package/dist/index304.js +27 -4
- package/dist/index305.js +2 -2
- package/dist/index306.js +1 -1
- package/dist/index307.js +2 -8
- package/dist/index308.js +2 -126
- package/dist/index309.js +2 -3
- package/dist/index31.js +4 -4
- package/dist/index310.js +28 -3
- package/dist/index311.js +21 -1
- package/dist/index313.js +199 -126
- package/dist/index314.js +4 -2
- package/dist/index315.js +2 -67
- package/dist/index316.js +6 -5
- package/dist/index317.js +2 -89
- package/dist/index318.js +3 -3
- package/dist/index319.js +17 -3
- package/dist/index320.js +123 -56
- package/dist/index321.js +2 -33
- package/dist/index322.js +128 -27
- package/dist/index323.js +5 -0
- package/dist/index324.js +3 -480
- package/dist/index325.js +2 -7
- package/dist/index326.js +4 -7
- package/dist/index327.js +379 -16
- package/dist/index328.js +125 -7
- package/dist/index329.js +5 -6
- package/dist/index33.js +10 -10
- package/dist/index330.js +3 -8
- package/dist/index331.js +5 -58
- package/dist/index332.js +700 -57
- package/dist/index333.js +354 -5
- package/dist/index334.js +57 -7
- package/dist/index335.js +7 -3
- package/dist/index336.js +5 -46
- package/dist/index337.js +8 -2
- package/dist/index338.js +9 -0
- package/dist/index339.js +32 -2
- package/dist/index340.js +28 -2
- package/dist/index342.js +57 -46
- package/dist/index343.js +60 -0
- package/dist/index344.js +7 -0
- package/dist/index345.js +230 -0
- package/dist/index346.js +4 -0
- package/dist/index347.js +49 -0
- package/dist/index348.js +9 -0
- package/dist/index349.js +21 -0
- package/dist/index35.js +9 -9
- package/dist/index350.js +95 -0
- package/dist/index352.js +5 -0
- package/dist/index353.js +484 -0
- package/dist/index354.js +49 -0
- package/dist/index355.js +483 -0
- package/dist/index356.js +4 -0
- package/dist/index37.js +33 -33
- package/dist/index39.js +15 -15
- package/dist/index41.js +5 -5
- package/dist/index43.js +10 -10
- package/dist/index45.js +25 -25
- package/dist/index47.js +6 -6
- package/dist/index49.js +15 -15
- package/dist/index51.js +4 -4
- package/dist/index53.js +6 -6
- package/dist/index55.js +6 -6
- package/dist/index57.js +16 -16
- package/dist/index59.js +3 -3
- package/dist/index6.js +1 -1
- package/dist/index61.js +9 -9
- package/dist/index63.js +5 -5
- package/dist/index65.js +2 -2
- package/dist/index67.js +35 -107
- package/dist/index69.js +42 -85
- package/dist/index7.js +2 -2
- package/dist/index71.js +47 -56
- package/dist/index73.js +83 -54
- package/dist/index75.js +113 -273
- package/dist/index77.js +50 -158
- package/dist/index79.js +228 -194
- package/dist/index81.js +148 -40
- package/dist/index83.js +221 -0
- package/dist/index85.js +53 -0
- package/dist/index87.js +46 -0
- package/dist/index88.js +125 -184
- package/dist/index9.js +1 -1
- package/dist/index90.js +240 -26
- package/dist/index92.js +230 -86
- package/dist/index94.js +135 -117
- package/dist/index96.js +27 -94
- package/dist/index98.js +85 -15
- package/package.json +27 -28
- package/dist/index101.js +0 -178
- package/dist/index103.js +0 -116
- package/dist/index105.js +0 -100
- package/dist/index126.js +0 -46
- package/dist/index128.js +0 -49
- package/dist/index130.js +0 -4
- package/dist/index132.js +0 -346
- package/dist/index134.js +0 -27
- package/dist/index217.js +0 -15
- package/dist/index240.js +0 -17
- package/dist/index255.js +0 -4
- package/dist/index257.js +0 -20
- package/dist/index272.js +0 -8
- package/dist/index288.js +0 -24
- package/dist/index312.js +0 -438
- package/dist/index341.js +0 -426
- package/dist/index82.js +0 -136
- package/dist/index84.js +0 -247
- package/dist/index86.js +0 -238
package/dist/index353.js
ADDED
@@ -0,0 +1,484 @@
|
|
1
|
+
import { debounce as I, memo as d, notUndefined as f, approxEqual as M } from "./index354.js";
|
2
|
+
const z = (r) => r, y = (r) => {
|
3
|
+
const a = Math.max(r.startIndex - r.overscan, 0), t = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
|
4
|
+
for (let e = a; e <= t; e++)
|
5
|
+
s.push(e);
|
6
|
+
return s;
|
7
|
+
}, R = (r, a) => {
|
8
|
+
const t = r.scrollElement;
|
9
|
+
if (!t)
|
10
|
+
return;
|
11
|
+
const s = r.targetWindow;
|
12
|
+
if (!s)
|
13
|
+
return;
|
14
|
+
const e = (n) => {
|
15
|
+
const { width: o, height: l } = n;
|
16
|
+
a({ width: Math.round(o), height: Math.round(l) });
|
17
|
+
};
|
18
|
+
if (e(t.getBoundingClientRect()), !s.ResizeObserver)
|
19
|
+
return () => {
|
20
|
+
};
|
21
|
+
const i = new s.ResizeObserver((n) => {
|
22
|
+
const o = () => {
|
23
|
+
const l = n[0];
|
24
|
+
if (l != null && l.borderBoxSize) {
|
25
|
+
const c = l.borderBoxSize[0];
|
26
|
+
if (c) {
|
27
|
+
e({ width: c.inlineSize, height: c.blockSize });
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
e(t.getBoundingClientRect());
|
32
|
+
};
|
33
|
+
r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
|
34
|
+
});
|
35
|
+
return i.observe(t, { box: "border-box" }), () => {
|
36
|
+
i.unobserve(t);
|
37
|
+
};
|
38
|
+
}, b = {
|
39
|
+
passive: !0
|
40
|
+
}, E = typeof window > "u" ? !0 : "onscrollend" in window, _ = (r, a) => {
|
41
|
+
const t = r.scrollElement;
|
42
|
+
if (!t)
|
43
|
+
return;
|
44
|
+
const s = r.targetWindow;
|
45
|
+
if (!s)
|
46
|
+
return;
|
47
|
+
let e = 0;
|
48
|
+
const i = r.options.useScrollendEvent && E ? () => {
|
49
|
+
} : I(
|
50
|
+
s,
|
51
|
+
() => {
|
52
|
+
a(e, !1);
|
53
|
+
},
|
54
|
+
r.options.isScrollingResetDelay
|
55
|
+
), n = (h) => () => {
|
56
|
+
const { horizontal: m, isRtl: u } = r.options;
|
57
|
+
e = m ? t.scrollLeft * (u && -1 || 1) : t.scrollTop, i(), a(e, h);
|
58
|
+
}, o = n(!0), l = n(!1);
|
59
|
+
l(), t.addEventListener("scroll", o, b);
|
60
|
+
const c = r.options.useScrollendEvent && E;
|
61
|
+
return c && t.addEventListener("scrollend", l, b), () => {
|
62
|
+
t.removeEventListener("scroll", o), c && t.removeEventListener("scrollend", l);
|
63
|
+
};
|
64
|
+
}, w = (r, a, t) => {
|
65
|
+
if (a != null && a.borderBoxSize) {
|
66
|
+
const s = a.borderBoxSize[0];
|
67
|
+
if (s)
|
68
|
+
return Math.round(
|
69
|
+
s[t.options.horizontal ? "inlineSize" : "blockSize"]
|
70
|
+
);
|
71
|
+
}
|
72
|
+
return Math.round(
|
73
|
+
r.getBoundingClientRect()[t.options.horizontal ? "width" : "height"]
|
74
|
+
);
|
75
|
+
}, A = (r, {
|
76
|
+
adjustments: a = 0,
|
77
|
+
behavior: t
|
78
|
+
}, s) => {
|
79
|
+
var e, i;
|
80
|
+
const n = r + a;
|
81
|
+
(i = (e = s.scrollElement) == null ? void 0 : e.scrollTo) == null || i.call(e, {
|
82
|
+
[s.options.horizontal ? "left" : "top"]: n,
|
83
|
+
behavior: t
|
84
|
+
});
|
85
|
+
};
|
86
|
+
class D {
|
87
|
+
constructor(a) {
|
88
|
+
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__ */ (() => {
|
89
|
+
let t = null;
|
90
|
+
const s = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((e) => {
|
91
|
+
e.forEach((i) => {
|
92
|
+
const n = () => {
|
93
|
+
this._measureElement(i.target, i);
|
94
|
+
};
|
95
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
|
96
|
+
});
|
97
|
+
}));
|
98
|
+
return {
|
99
|
+
disconnect: () => {
|
100
|
+
var e;
|
101
|
+
(e = s()) == null || e.disconnect(), t = null;
|
102
|
+
},
|
103
|
+
observe: (e) => {
|
104
|
+
var i;
|
105
|
+
return (i = s()) == null ? void 0 : i.observe(e, { box: "border-box" });
|
106
|
+
},
|
107
|
+
unobserve: (e) => {
|
108
|
+
var i;
|
109
|
+
return (i = s()) == null ? void 0 : i.unobserve(e);
|
110
|
+
}
|
111
|
+
};
|
112
|
+
})(), this.range = null, this.setOptions = (t) => {
|
113
|
+
Object.entries(t).forEach(([s, e]) => {
|
114
|
+
typeof e > "u" && delete t[s];
|
115
|
+
}), this.options = {
|
116
|
+
debug: !1,
|
117
|
+
initialOffset: 0,
|
118
|
+
overscan: 1,
|
119
|
+
paddingStart: 0,
|
120
|
+
paddingEnd: 0,
|
121
|
+
scrollPaddingStart: 0,
|
122
|
+
scrollPaddingEnd: 0,
|
123
|
+
horizontal: !1,
|
124
|
+
getItemKey: z,
|
125
|
+
rangeExtractor: y,
|
126
|
+
onChange: () => {
|
127
|
+
},
|
128
|
+
measureElement: w,
|
129
|
+
initialRect: { width: 0, height: 0 },
|
130
|
+
scrollMargin: 0,
|
131
|
+
gap: 0,
|
132
|
+
indexAttribute: "data-index",
|
133
|
+
initialMeasurementsCache: [],
|
134
|
+
lanes: 1,
|
135
|
+
isScrollingResetDelay: 150,
|
136
|
+
enabled: !0,
|
137
|
+
isRtl: !1,
|
138
|
+
useScrollendEvent: !0,
|
139
|
+
useAnimationFrameWithResizeObserver: !1,
|
140
|
+
...t
|
141
|
+
};
|
142
|
+
}, this.notify = (t) => {
|
143
|
+
var s, e;
|
144
|
+
(e = (s = this.options).onChange) == null || e.call(s, this, t);
|
145
|
+
}, this.maybeNotify = d(
|
146
|
+
() => (this.calculateRange(), [
|
147
|
+
this.isScrolling,
|
148
|
+
this.range ? this.range.startIndex : null,
|
149
|
+
this.range ? this.range.endIndex : null
|
150
|
+
]),
|
151
|
+
(t) => {
|
152
|
+
this.notify(t);
|
153
|
+
},
|
154
|
+
{
|
155
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
156
|
+
debug: () => this.options.debug,
|
157
|
+
initialDeps: [
|
158
|
+
this.isScrolling,
|
159
|
+
this.range ? this.range.startIndex : null,
|
160
|
+
this.range ? this.range.endIndex : null
|
161
|
+
]
|
162
|
+
}
|
163
|
+
), this.cleanup = () => {
|
164
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
|
165
|
+
}, this._didMount = () => () => {
|
166
|
+
this.cleanup();
|
167
|
+
}, this._willUpdate = () => {
|
168
|
+
var t;
|
169
|
+
const s = this.options.enabled ? this.options.getScrollElement() : null;
|
170
|
+
if (this.scrollElement !== s) {
|
171
|
+
if (this.cleanup(), !s) {
|
172
|
+
this.maybeNotify();
|
173
|
+
return;
|
174
|
+
}
|
175
|
+
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) => {
|
176
|
+
this.observer.observe(e);
|
177
|
+
}), this._scrollToOffset(this.getScrollOffset(), {
|
178
|
+
adjustments: void 0,
|
179
|
+
behavior: void 0
|
180
|
+
}), this.unsubs.push(
|
181
|
+
this.options.observeElementRect(this, (e) => {
|
182
|
+
this.scrollRect = e, this.maybeNotify();
|
183
|
+
})
|
184
|
+
), this.unsubs.push(
|
185
|
+
this.options.observeElementOffset(this, (e, i) => {
|
186
|
+
this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = i, this.maybeNotify();
|
187
|
+
})
|
188
|
+
);
|
189
|
+
}
|
190
|
+
}, 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) => {
|
191
|
+
const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
192
|
+
for (let n = s - 1; n >= 0; n--) {
|
193
|
+
const o = t[n];
|
194
|
+
if (e.has(o.lane))
|
195
|
+
continue;
|
196
|
+
const l = i.get(
|
197
|
+
o.lane
|
198
|
+
);
|
199
|
+
if (l == null || o.end > l.end ? i.set(o.lane, o) : o.end < l.end && e.set(o.lane, !0), e.size === this.options.lanes)
|
200
|
+
break;
|
201
|
+
}
|
202
|
+
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;
|
203
|
+
}, this.getMeasurementOptions = d(
|
204
|
+
() => [
|
205
|
+
this.options.count,
|
206
|
+
this.options.paddingStart,
|
207
|
+
this.options.scrollMargin,
|
208
|
+
this.options.getItemKey,
|
209
|
+
this.options.enabled
|
210
|
+
],
|
211
|
+
(t, s, e, i, n) => (this.pendingMeasuredCacheIndexes = [], {
|
212
|
+
count: t,
|
213
|
+
paddingStart: s,
|
214
|
+
scrollMargin: e,
|
215
|
+
getItemKey: i,
|
216
|
+
enabled: n
|
217
|
+
}),
|
218
|
+
{
|
219
|
+
key: !1
|
220
|
+
}
|
221
|
+
), this.getMeasurements = d(
|
222
|
+
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
223
|
+
({ count: t, paddingStart: s, scrollMargin: e, getItemKey: i, enabled: n }, o) => {
|
224
|
+
if (!n)
|
225
|
+
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
226
|
+
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((h) => {
|
227
|
+
this.itemSizeCache.set(h.key, h.size);
|
228
|
+
}));
|
229
|
+
const l = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
230
|
+
this.pendingMeasuredCacheIndexes = [];
|
231
|
+
const c = this.measurementsCache.slice(0, l);
|
232
|
+
for (let h = l; h < t; h++) {
|
233
|
+
const m = i(h), u = this.options.lanes === 1 ? c[h - 1] : this.getFurthestMeasurement(c, h), g = u ? u.end + this.options.gap : s + e, p = o.get(m), v = typeof p == "number" ? p : this.options.estimateSize(h), S = g + v, O = u ? u.lane : h % this.options.lanes;
|
234
|
+
c[h] = {
|
235
|
+
index: h,
|
236
|
+
start: g,
|
237
|
+
size: v,
|
238
|
+
end: S,
|
239
|
+
key: m,
|
240
|
+
lane: O
|
241
|
+
};
|
242
|
+
}
|
243
|
+
return this.measurementsCache = c, c;
|
244
|
+
},
|
245
|
+
{
|
246
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
247
|
+
debug: () => this.options.debug
|
248
|
+
}
|
249
|
+
), this.calculateRange = d(
|
250
|
+
() => [
|
251
|
+
this.getMeasurements(),
|
252
|
+
this.getSize(),
|
253
|
+
this.getScrollOffset(),
|
254
|
+
this.options.lanes
|
255
|
+
],
|
256
|
+
(t, s, e, i) => this.range = t.length > 0 && s > 0 ? C({
|
257
|
+
measurements: t,
|
258
|
+
outerSize: s,
|
259
|
+
scrollOffset: e,
|
260
|
+
lanes: i
|
261
|
+
}) : null,
|
262
|
+
{
|
263
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
264
|
+
debug: () => this.options.debug
|
265
|
+
}
|
266
|
+
), this.getVirtualIndexes = d(
|
267
|
+
() => {
|
268
|
+
let t = null, s = null;
|
269
|
+
const e = this.calculateRange();
|
270
|
+
return e && (t = e.startIndex, s = e.endIndex), [
|
271
|
+
this.options.rangeExtractor,
|
272
|
+
this.options.overscan,
|
273
|
+
this.options.count,
|
274
|
+
t,
|
275
|
+
s
|
276
|
+
];
|
277
|
+
},
|
278
|
+
(t, s, e, i, n) => i === null || n === null ? [] : t({
|
279
|
+
startIndex: i,
|
280
|
+
endIndex: n,
|
281
|
+
overscan: s,
|
282
|
+
count: e
|
283
|
+
}),
|
284
|
+
{
|
285
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
286
|
+
debug: () => this.options.debug
|
287
|
+
}
|
288
|
+
), this.indexFromElement = (t) => {
|
289
|
+
const s = this.options.indexAttribute, e = t.getAttribute(s);
|
290
|
+
return e ? parseInt(e, 10) : (console.warn(
|
291
|
+
`Missing attribute name '${s}={index}' on measured element.`
|
292
|
+
), -1);
|
293
|
+
}, this._measureElement = (t, s) => {
|
294
|
+
const e = this.indexFromElement(t), i = this.measurementsCache[e];
|
295
|
+
if (!i)
|
296
|
+
return;
|
297
|
+
const n = i.key, o = this.elementsCache.get(n);
|
298
|
+
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));
|
299
|
+
}, this.resizeItem = (t, s) => {
|
300
|
+
const e = this.measurementsCache[t];
|
301
|
+
if (!e)
|
302
|
+
return;
|
303
|
+
const i = this.itemSizeCache.get(e.key) ?? e.size, n = s - i;
|
304
|
+
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(), {
|
305
|
+
adjustments: this.scrollAdjustments += n,
|
306
|
+
behavior: void 0
|
307
|
+
})), this.pendingMeasuredCacheIndexes.push(e.index), this.itemSizeCache = new Map(this.itemSizeCache.set(e.key, s)), this.notify(!1));
|
308
|
+
}, this.measureElement = (t) => {
|
309
|
+
if (!t) {
|
310
|
+
this.elementsCache.forEach((s, e) => {
|
311
|
+
s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(e));
|
312
|
+
});
|
313
|
+
return;
|
314
|
+
}
|
315
|
+
this._measureElement(t, void 0);
|
316
|
+
}, this.getVirtualItems = d(
|
317
|
+
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
318
|
+
(t, s) => {
|
319
|
+
const e = [];
|
320
|
+
for (let i = 0, n = t.length; i < n; i++) {
|
321
|
+
const o = t[i], l = s[o];
|
322
|
+
e.push(l);
|
323
|
+
}
|
324
|
+
return e;
|
325
|
+
},
|
326
|
+
{
|
327
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
328
|
+
debug: () => this.options.debug
|
329
|
+
}
|
330
|
+
), this.getVirtualItemForOffset = (t) => {
|
331
|
+
const s = this.getMeasurements();
|
332
|
+
if (s.length !== 0)
|
333
|
+
return f(
|
334
|
+
s[x(
|
335
|
+
0,
|
336
|
+
s.length - 1,
|
337
|
+
(e) => f(s[e]).start,
|
338
|
+
t
|
339
|
+
)]
|
340
|
+
);
|
341
|
+
}, this.getOffsetForAlignment = (t, s, e = 0) => {
|
342
|
+
const i = this.getSize(), n = this.getScrollOffset();
|
343
|
+
s === "auto" && (s = t >= n + i ? "end" : "start"), s === "center" ? t += (e - i) / 2 : s === "end" && (t -= i);
|
344
|
+
const o = this.options.horizontal ? "scrollWidth" : "scrollHeight", c = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[o] : this.scrollElement[o] : 0) - i;
|
345
|
+
return Math.max(Math.min(c, t), 0);
|
346
|
+
}, this.getOffsetForIndex = (t, s = "auto") => {
|
347
|
+
t = Math.max(0, Math.min(t, this.options.count - 1));
|
348
|
+
const e = this.measurementsCache[t];
|
349
|
+
if (!e)
|
350
|
+
return;
|
351
|
+
const i = this.getSize(), n = this.getScrollOffset();
|
352
|
+
if (s === "auto")
|
353
|
+
if (e.end >= n + i - this.options.scrollPaddingEnd)
|
354
|
+
s = "end";
|
355
|
+
else if (e.start <= n + this.options.scrollPaddingStart)
|
356
|
+
s = "start";
|
357
|
+
else
|
358
|
+
return [n, s];
|
359
|
+
const o = s === "end" ? e.end + this.options.scrollPaddingEnd : e.start - this.options.scrollPaddingStart;
|
360
|
+
return [
|
361
|
+
this.getOffsetForAlignment(o, s, e.size),
|
362
|
+
s
|
363
|
+
];
|
364
|
+
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
|
365
|
+
this.scrollToIndexTimeoutId !== null && this.targetWindow && (this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId), this.scrollToIndexTimeoutId = null);
|
366
|
+
}, this.scrollToOffset = (t, { align: s = "start", behavior: e } = {}) => {
|
367
|
+
this.cancelScrollToIndex(), e === "smooth" && this.isDynamicMode() && console.warn(
|
368
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
369
|
+
), this._scrollToOffset(this.getOffsetForAlignment(t, s), {
|
370
|
+
adjustments: void 0,
|
371
|
+
behavior: e
|
372
|
+
});
|
373
|
+
}, this.scrollToIndex = (t, { align: s = "auto", behavior: e } = {}) => {
|
374
|
+
t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), e === "smooth" && this.isDynamicMode() && console.warn(
|
375
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
376
|
+
);
|
377
|
+
const i = this.getOffsetForIndex(t, s);
|
378
|
+
if (!i) return;
|
379
|
+
const [n, o] = i;
|
380
|
+
this._scrollToOffset(n, { adjustments: void 0, behavior: e }), e !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
|
381
|
+
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
382
|
+
this.options.getItemKey(t)
|
383
|
+
)) {
|
384
|
+
const [c] = f(
|
385
|
+
this.getOffsetForIndex(t, o)
|
386
|
+
);
|
387
|
+
M(c, this.getScrollOffset()) || this.scrollToIndex(t, { align: o, behavior: e });
|
388
|
+
} else
|
389
|
+
this.scrollToIndex(t, { align: o, behavior: e });
|
390
|
+
}));
|
391
|
+
}, this.scrollBy = (t, { behavior: s } = {}) => {
|
392
|
+
this.cancelScrollToIndex(), s === "smooth" && this.isDynamicMode() && console.warn(
|
393
|
+
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
394
|
+
), this._scrollToOffset(this.getScrollOffset() + t, {
|
395
|
+
adjustments: void 0,
|
396
|
+
behavior: s
|
397
|
+
});
|
398
|
+
}, this.getTotalSize = () => {
|
399
|
+
var t;
|
400
|
+
const s = this.getMeasurements();
|
401
|
+
let e;
|
402
|
+
if (s.length === 0)
|
403
|
+
e = this.options.paddingStart;
|
404
|
+
else if (this.options.lanes === 1)
|
405
|
+
e = ((t = s[s.length - 1]) == null ? void 0 : t.end) ?? 0;
|
406
|
+
else {
|
407
|
+
const i = Array(this.options.lanes).fill(null);
|
408
|
+
let n = s.length - 1;
|
409
|
+
for (; n > 0 && i.some((o) => o === null); ) {
|
410
|
+
const o = s[n];
|
411
|
+
i[o.lane] === null && (i[o.lane] = o.end), n--;
|
412
|
+
}
|
413
|
+
e = Math.max(...i.filter((o) => o !== null));
|
414
|
+
}
|
415
|
+
return Math.max(
|
416
|
+
e - this.options.scrollMargin + this.options.paddingEnd,
|
417
|
+
0
|
418
|
+
);
|
419
|
+
}, this._scrollToOffset = (t, {
|
420
|
+
adjustments: s,
|
421
|
+
behavior: e
|
422
|
+
}) => {
|
423
|
+
this.options.scrollToFn(t, { behavior: e, adjustments: s }, this);
|
424
|
+
}, this.measure = () => {
|
425
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
|
426
|
+
}, this.setOptions(a);
|
427
|
+
}
|
428
|
+
}
|
429
|
+
const x = (r, a, t, s) => {
|
430
|
+
for (; r <= a; ) {
|
431
|
+
const e = (r + a) / 2 | 0, i = t(e);
|
432
|
+
if (i < s)
|
433
|
+
r = e + 1;
|
434
|
+
else if (i > s)
|
435
|
+
a = e - 1;
|
436
|
+
else
|
437
|
+
return e;
|
438
|
+
}
|
439
|
+
return r > 0 ? r - 1 : 0;
|
440
|
+
};
|
441
|
+
function C({
|
442
|
+
measurements: r,
|
443
|
+
outerSize: a,
|
444
|
+
scrollOffset: t,
|
445
|
+
lanes: s
|
446
|
+
}) {
|
447
|
+
const e = r.length - 1;
|
448
|
+
let n = x(
|
449
|
+
0,
|
450
|
+
e,
|
451
|
+
(l) => r[l].start,
|
452
|
+
t
|
453
|
+
), o = n;
|
454
|
+
if (s === 1)
|
455
|
+
for (; o < e && r[o].end < t + a; )
|
456
|
+
o++;
|
457
|
+
else if (s > 1) {
|
458
|
+
const l = Array(s).fill(0);
|
459
|
+
for (; o < e && l.some((h) => h < t + a); ) {
|
460
|
+
const h = r[o];
|
461
|
+
l[h.lane] = h.end, o++;
|
462
|
+
}
|
463
|
+
const c = Array(s).fill(t + a);
|
464
|
+
for (; n > 0 && c.some((h) => h >= t); ) {
|
465
|
+
const h = r[n];
|
466
|
+
c[h.lane] = h.start, n--;
|
467
|
+
}
|
468
|
+
n = Math.max(0, n - n % s), o = Math.min(e, o + (s - 1 - o % s));
|
469
|
+
}
|
470
|
+
return { startIndex: n, endIndex: o };
|
471
|
+
}
|
472
|
+
export {
|
473
|
+
D as Virtualizer,
|
474
|
+
M as approxEqual,
|
475
|
+
I as debounce,
|
476
|
+
z as defaultKeyExtractor,
|
477
|
+
y as defaultRangeExtractor,
|
478
|
+
A as elementScroll,
|
479
|
+
w as measureElement,
|
480
|
+
d as memo,
|
481
|
+
f as notUndefined,
|
482
|
+
_ as observeElementOffset,
|
483
|
+
R as observeElementRect
|
484
|
+
};
|
package/dist/index354.js
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
function D(n, l, e) {
|
2
|
+
let i = e.initialDeps ?? [], t;
|
3
|
+
return () => {
|
4
|
+
var r, c, h, m;
|
5
|
+
let f;
|
6
|
+
e.key && ((r = e.debug) != null && r.call(e)) && (f = Date.now());
|
7
|
+
const o = n();
|
8
|
+
if (!(o.length !== i.length || o.some((a, u) => i[u] !== a)))
|
9
|
+
return t;
|
10
|
+
i = o;
|
11
|
+
let g;
|
12
|
+
if (e.key && ((c = e.debug) != null && c.call(e)) && (g = Date.now()), t = l(...o), e.key && ((h = e.debug) != null && h.call(e))) {
|
13
|
+
const a = Math.round((Date.now() - f) * 100) / 100, u = Math.round((Date.now() - g) * 100) / 100, w = u / 16, s = (d, b) => {
|
14
|
+
for (d = String(d); d.length < b; )
|
15
|
+
d = " " + d;
|
16
|
+
return d;
|
17
|
+
};
|
18
|
+
console.info(
|
19
|
+
`%c⏱ ${s(u, 5)} /${s(a, 5)} ms`,
|
20
|
+
`
|
21
|
+
font-size: .6rem;
|
22
|
+
font-weight: bold;
|
23
|
+
color: hsl(${Math.max(
|
24
|
+
0,
|
25
|
+
Math.min(120 - 120 * w, 120)
|
26
|
+
)}deg 100% 31%);`,
|
27
|
+
e == null ? void 0 : e.key
|
28
|
+
);
|
29
|
+
}
|
30
|
+
return (m = e == null ? void 0 : e.onChange) == null || m.call(e, t), t;
|
31
|
+
};
|
32
|
+
}
|
33
|
+
function T(n, l) {
|
34
|
+
if (n === void 0)
|
35
|
+
throw new Error("Unexpected undefined");
|
36
|
+
return n;
|
37
|
+
}
|
38
|
+
const y = (n, l) => Math.abs(n - l) < 1, M = (n, l, e) => {
|
39
|
+
let i;
|
40
|
+
return function(...t) {
|
41
|
+
n.clearTimeout(i), i = n.setTimeout(() => l.apply(this, t), e);
|
42
|
+
};
|
43
|
+
};
|
44
|
+
export {
|
45
|
+
y as approxEqual,
|
46
|
+
M as debounce,
|
47
|
+
D as memo,
|
48
|
+
T as notUndefined
|
49
|
+
};
|