laif-ds 0.1.6 → 0.1.7
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/_cloneBuffer.js +5 -0
- package/dist/_virtual/dayjs.min.js +8 -0
- package/dist/_virtual/dayjs.min2.js +5 -0
- package/dist/_virtual/debounce.js +8 -0
- package/dist/_virtual/index5.js +5 -2
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/localizedFormat.js +8 -0
- package/dist/_virtual/localizedFormat2.js +5 -0
- package/dist/_virtual/omit.js +8 -0
- package/dist/components/ui/gantt/assets/icons/MinusSquareOutlined.js +36 -0
- package/dist/components/ui/gantt/assets/icons/PlusSquareOutlined.js +45 -0
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +115 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +158 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +36 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +26 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRowContext.js +14 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +75 -0
- package/dist/components/ui/gantt/components/Chart/Chart.js +66 -0
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +88 -0
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +72 -0
- package/dist/components/ui/gantt/components/Controls/Controls.js +82 -0
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +58 -0
- package/dist/components/ui/gantt/components/Gantt/GanttContext.js +35 -0
- package/dist/components/ui/gantt/constants/DimensionsSettings.js +89 -0
- package/dist/components/ui/gantt/constants/DragStepOptions.js +43 -0
- package/dist/components/ui/gantt/constants/GanttConsts.js +17 -0
- package/dist/components/ui/gantt/constants/colors.json.js +106 -0
- package/dist/components/ui/gantt/enums/DataRepeatTimes.js +5 -0
- package/dist/components/ui/gantt/enums/DragStepSizes.js +5 -0
- package/dist/components/ui/gantt/enums/DragTypes.js +5 -0
- package/dist/components/ui/gantt/enums/GanttDimensions.js +5 -0
- package/dist/components/ui/gantt/enums/GanttUnitOfTimes.js +5 -0
- package/dist/components/ui/gantt/hooks/useForwardRef.js +11 -0
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +30 -0
- package/dist/components/ui/gantt/utils/getInitialScrollOffset.js +11 -0
- package/dist/components/ui/gantt/utils/getScaleDates.js +14 -0
- package/dist/components/ui/gantt/utils/getScaleItems.js +33 -0
- package/dist/components/ui/gantt/utils/getWholeWidth.js +7 -0
- package/dist/components/ui/gantt/utils/transformData.js +36 -0
- package/dist/index.d.ts +168 -0
- package/dist/index.js +300 -294
- package/dist/laif-ds.css +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +57 -0
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2150 -0
- package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +27 -0
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +184 -0
- package/dist/node_modules/classnames/index.js +43 -0
- package/dist/node_modules/dayjs/dayjs.min.js +283 -0
- package/dist/node_modules/dayjs/plugin/localizedFormat.js +30 -0
- package/dist/node_modules/lodash/_arrayEach.js +15 -0
- package/dist/node_modules/lodash/_assignValue.js +17 -0
- package/dist/node_modules/lodash/_baseAssign.js +16 -0
- package/dist/node_modules/lodash/_baseAssignIn.js +16 -0
- package/dist/node_modules/lodash/_baseAssignValue.js +20 -0
- package/dist/node_modules/lodash/_baseClone.js +71 -0
- package/dist/node_modules/lodash/_baseCreate.js +24 -0
- package/dist/node_modules/lodash/_baseIsMap.js +16 -0
- package/dist/node_modules/lodash/_baseIsSet.js +16 -0
- package/dist/node_modules/lodash/_baseKeysIn.js +22 -0
- package/dist/node_modules/lodash/_baseUnset.js +18 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js +16 -0
- package/dist/node_modules/lodash/_cloneBuffer.js +20 -0
- package/dist/node_modules/lodash/_cloneDataView.js +16 -0
- package/dist/node_modules/lodash/_cloneRegExp.js +15 -0
- package/dist/node_modules/lodash/_cloneSymbol.js +15 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js +16 -0
- package/dist/node_modules/lodash/_copyArray.js +16 -0
- package/dist/node_modules/lodash/_copyObject.js +22 -0
- package/dist/node_modules/lodash/_copySymbols.js +16 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js +16 -0
- package/dist/node_modules/lodash/_customOmitClone.js +15 -0
- package/dist/node_modules/lodash/_flatRest.js +17 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js +17 -0
- package/dist/node_modules/lodash/_getPrototype.js +12 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js +19 -0
- package/dist/node_modules/lodash/_initCloneArray.js +15 -0
- package/dist/node_modules/lodash/_initCloneByTag.js +49 -0
- package/dist/node_modules/lodash/_initCloneObject.js +17 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js +17 -0
- package/dist/node_modules/lodash/_parent.js +16 -0
- package/dist/node_modules/lodash/flatten.js +16 -0
- package/dist/node_modules/lodash/isMap.js +14 -0
- package/dist/node_modules/lodash/isPlainObject.js +23 -0
- package/dist/node_modules/lodash/isSet.js +14 -0
- package/dist/node_modules/lodash/keysIn.js +17 -0
- package/dist/node_modules/lodash/last.js +14 -0
- package/dist/node_modules/lodash/omit.js +30 -0
- package/dist/node_modules/memoize-one/dist/memoize-one.esm.js +28 -0
- package/dist/node_modules/react-window/dist/index.esm.js +375 -0
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __require as y } from "./_arrayMap.js";
|
|
3
|
+
import { __require as A } from "./_baseClone.js";
|
|
4
|
+
import { __require as g } from "./_baseUnset.js";
|
|
5
|
+
import { __require as E } from "./_castPath.js";
|
|
6
|
+
import { __require as F } from "./_copyObject.js";
|
|
7
|
+
import { __require as b } from "./_customOmitClone.js";
|
|
8
|
+
import { __require as G } from "./_flatRest.js";
|
|
9
|
+
import { __require as M } from "./_getAllKeysIn.js";
|
|
10
|
+
var u, o;
|
|
11
|
+
function d() {
|
|
12
|
+
if (o) return u;
|
|
13
|
+
o = 1;
|
|
14
|
+
var s = y(), m = A(), n = g(), l = E(), q = F(), f = b(), O = G(), c = M(), p = 1, v = 2, L = 4, C = O(function(e, i) {
|
|
15
|
+
var r = {};
|
|
16
|
+
if (e == null)
|
|
17
|
+
return r;
|
|
18
|
+
var _ = !1;
|
|
19
|
+
i = s(i, function(t) {
|
|
20
|
+
return t = l(t, e), _ || (_ = t.length > 1), t;
|
|
21
|
+
}), q(e, c(e), r), _ && (r = m(r, p | v | L, f));
|
|
22
|
+
for (var a = i.length; a--; )
|
|
23
|
+
n(r, i[a]);
|
|
24
|
+
return r;
|
|
25
|
+
});
|
|
26
|
+
return u = C, u;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
d as __require
|
|
30
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var s = Number.isNaN || function(r) {
|
|
3
|
+
return typeof r == "number" && r !== r;
|
|
4
|
+
};
|
|
5
|
+
function o(e, r) {
|
|
6
|
+
return !!(e === r || s(e) && s(r));
|
|
7
|
+
}
|
|
8
|
+
function g(e, r) {
|
|
9
|
+
if (e.length !== r.length)
|
|
10
|
+
return !1;
|
|
11
|
+
for (var t = 0; t < e.length; t++)
|
|
12
|
+
if (!o(e[t], r[t]))
|
|
13
|
+
return !1;
|
|
14
|
+
return !0;
|
|
15
|
+
}
|
|
16
|
+
function h(e, r) {
|
|
17
|
+
r === void 0 && (r = g);
|
|
18
|
+
var t, f = [], u, l = !1;
|
|
19
|
+
function i() {
|
|
20
|
+
for (var n = [], a = 0; a < arguments.length; a++)
|
|
21
|
+
n[a] = arguments[a];
|
|
22
|
+
return l && t === this && r(n, f) || (u = e.apply(this, n), l = !0, t = this, f = n), u;
|
|
23
|
+
}
|
|
24
|
+
return i;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
h as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import re from "../../@babel/runtime/helpers/esm/extends.js";
|
|
3
|
+
import U from "../../@babel/runtime/helpers/esm/assertThisInitialized.js";
|
|
4
|
+
import ie from "../../@babel/runtime/helpers/esm/inheritsLoose.js";
|
|
5
|
+
import D from "../../memoize-one/dist/memoize-one.esm.js";
|
|
6
|
+
import { createElement as k, PureComponent as ae } from "react";
|
|
7
|
+
var ne = typeof performance == "object" && typeof performance.now == "function", V = ne ? function() {
|
|
8
|
+
return performance.now();
|
|
9
|
+
} : function() {
|
|
10
|
+
return Date.now();
|
|
11
|
+
};
|
|
12
|
+
function q(l) {
|
|
13
|
+
cancelAnimationFrame(l.id);
|
|
14
|
+
}
|
|
15
|
+
function oe(l, t) {
|
|
16
|
+
var r = V();
|
|
17
|
+
function a() {
|
|
18
|
+
V() - r >= t ? l.call(null) : n.id = requestAnimationFrame(a);
|
|
19
|
+
}
|
|
20
|
+
var n = {
|
|
21
|
+
id: requestAnimationFrame(a)
|
|
22
|
+
};
|
|
23
|
+
return n;
|
|
24
|
+
}
|
|
25
|
+
var A = -1;
|
|
26
|
+
function H(l) {
|
|
27
|
+
if (l === void 0 && (l = !1), A === -1 || l) {
|
|
28
|
+
var t = document.createElement("div"), r = t.style;
|
|
29
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", document.body.appendChild(t), A = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
30
|
+
}
|
|
31
|
+
return A;
|
|
32
|
+
}
|
|
33
|
+
var b = null;
|
|
34
|
+
function K(l) {
|
|
35
|
+
if (l === void 0 && (l = !1), b === null || l) {
|
|
36
|
+
var t = document.createElement("div"), r = t.style;
|
|
37
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
38
|
+
var a = document.createElement("div"), n = a.style;
|
|
39
|
+
return n.width = "100px", n.height = "100px", t.appendChild(a), document.body.appendChild(t), t.scrollLeft > 0 ? b = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? b = "negative" : b = "positive-ascending"), document.body.removeChild(t), b;
|
|
40
|
+
}
|
|
41
|
+
return b;
|
|
42
|
+
}
|
|
43
|
+
process.env.NODE_ENV;
|
|
44
|
+
var le = 150, se = function(t, r) {
|
|
45
|
+
return t;
|
|
46
|
+
}, N = null, R = null;
|
|
47
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (N = /* @__PURE__ */ new WeakSet(), R = /* @__PURE__ */ new WeakSet());
|
|
48
|
+
function ce(l) {
|
|
49
|
+
var t, r = l.getItemOffset, a = l.getEstimatedTotalSize, n = l.getItemSize, c = l.getOffsetForIndexAndAlignment, s = l.getStartIndexForOffset, h = l.getStopIndexForStartIndex, y = l.initInstanceProps, I = l.shouldResetStyleCacheOnItemSizeChange, g = l.validateProps;
|
|
50
|
+
return t = /* @__PURE__ */ function(w) {
|
|
51
|
+
ie(z, w);
|
|
52
|
+
function z(S) {
|
|
53
|
+
var e;
|
|
54
|
+
return e = w.call(this, S) || this, e._instanceProps = y(e.props, U(e)), e._outerRef = void 0, e._resetIsScrollingTimeoutId = null, e.state = {
|
|
55
|
+
instance: U(e),
|
|
56
|
+
isScrolling: !1,
|
|
57
|
+
scrollDirection: "forward",
|
|
58
|
+
scrollOffset: typeof e.props.initialScrollOffset == "number" ? e.props.initialScrollOffset : 0,
|
|
59
|
+
scrollUpdateWasRequested: !1
|
|
60
|
+
}, e._callOnItemsRendered = void 0, e._callOnItemsRendered = D(function(i, o, f, u) {
|
|
61
|
+
return e.props.onItemsRendered({
|
|
62
|
+
overscanStartIndex: i,
|
|
63
|
+
overscanStopIndex: o,
|
|
64
|
+
visibleStartIndex: f,
|
|
65
|
+
visibleStopIndex: u
|
|
66
|
+
});
|
|
67
|
+
}), e._callOnScroll = void 0, e._callOnScroll = D(function(i, o, f) {
|
|
68
|
+
return e.props.onScroll({
|
|
69
|
+
scrollDirection: i,
|
|
70
|
+
scrollOffset: o,
|
|
71
|
+
scrollUpdateWasRequested: f
|
|
72
|
+
});
|
|
73
|
+
}), e._getItemStyle = void 0, e._getItemStyle = function(i) {
|
|
74
|
+
var o = e.props, f = o.direction, u = o.itemSize, p = o.layout, d = e._getItemStyleCache(I && u, I && p, I && f), m;
|
|
75
|
+
if (d.hasOwnProperty(i))
|
|
76
|
+
m = d[i];
|
|
77
|
+
else {
|
|
78
|
+
var v = r(e.props, i, e._instanceProps), T = n(e.props, i, e._instanceProps), M = f === "horizontal" || p === "horizontal", C = f === "rtl", E = M ? v : 0;
|
|
79
|
+
d[i] = m = {
|
|
80
|
+
position: "absolute",
|
|
81
|
+
left: C ? void 0 : E,
|
|
82
|
+
right: C ? E : void 0,
|
|
83
|
+
top: M ? 0 : v,
|
|
84
|
+
height: M ? "100%" : T,
|
|
85
|
+
width: M ? T : "100%"
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return m;
|
|
89
|
+
}, e._getItemStyleCache = void 0, e._getItemStyleCache = D(function(i, o, f) {
|
|
90
|
+
return {};
|
|
91
|
+
}), e._onScrollHorizontal = function(i) {
|
|
92
|
+
var o = i.currentTarget, f = o.clientWidth, u = o.scrollLeft, p = o.scrollWidth;
|
|
93
|
+
e.setState(function(d) {
|
|
94
|
+
if (d.scrollOffset === u)
|
|
95
|
+
return null;
|
|
96
|
+
var m = e.props.direction, v = u;
|
|
97
|
+
if (m === "rtl")
|
|
98
|
+
switch (K()) {
|
|
99
|
+
case "negative":
|
|
100
|
+
v = -u;
|
|
101
|
+
break;
|
|
102
|
+
case "positive-descending":
|
|
103
|
+
v = p - f - u;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
return v = Math.max(0, Math.min(v, p - f)), {
|
|
107
|
+
isScrolling: !0,
|
|
108
|
+
scrollDirection: d.scrollOffset < v ? "forward" : "backward",
|
|
109
|
+
scrollOffset: v,
|
|
110
|
+
scrollUpdateWasRequested: !1
|
|
111
|
+
};
|
|
112
|
+
}, e._resetIsScrollingDebounced);
|
|
113
|
+
}, e._onScrollVertical = function(i) {
|
|
114
|
+
var o = i.currentTarget, f = o.clientHeight, u = o.scrollHeight, p = o.scrollTop;
|
|
115
|
+
e.setState(function(d) {
|
|
116
|
+
if (d.scrollOffset === p)
|
|
117
|
+
return null;
|
|
118
|
+
var m = Math.max(0, Math.min(p, u - f));
|
|
119
|
+
return {
|
|
120
|
+
isScrolling: !0,
|
|
121
|
+
scrollDirection: d.scrollOffset < m ? "forward" : "backward",
|
|
122
|
+
scrollOffset: m,
|
|
123
|
+
scrollUpdateWasRequested: !1
|
|
124
|
+
};
|
|
125
|
+
}, e._resetIsScrollingDebounced);
|
|
126
|
+
}, e._outerRefSetter = function(i) {
|
|
127
|
+
var o = e.props.outerRef;
|
|
128
|
+
e._outerRef = i, typeof o == "function" ? o(i) : o != null && typeof o == "object" && o.hasOwnProperty("current") && (o.current = i);
|
|
129
|
+
}, e._resetIsScrollingDebounced = function() {
|
|
130
|
+
e._resetIsScrollingTimeoutId !== null && q(e._resetIsScrollingTimeoutId), e._resetIsScrollingTimeoutId = oe(e._resetIsScrolling, le);
|
|
131
|
+
}, e._resetIsScrolling = function() {
|
|
132
|
+
e._resetIsScrollingTimeoutId = null, e.setState({
|
|
133
|
+
isScrolling: !1
|
|
134
|
+
}, function() {
|
|
135
|
+
e._getItemStyleCache(-1, null);
|
|
136
|
+
});
|
|
137
|
+
}, e;
|
|
138
|
+
}
|
|
139
|
+
z.getDerivedStateFromProps = function(e, i) {
|
|
140
|
+
return de(e, i), g(e), null;
|
|
141
|
+
};
|
|
142
|
+
var _ = z.prototype;
|
|
143
|
+
return _.scrollTo = function(e) {
|
|
144
|
+
e = Math.max(0, e), this.setState(function(i) {
|
|
145
|
+
return i.scrollOffset === e ? null : {
|
|
146
|
+
scrollDirection: i.scrollOffset < e ? "forward" : "backward",
|
|
147
|
+
scrollOffset: e,
|
|
148
|
+
scrollUpdateWasRequested: !0
|
|
149
|
+
};
|
|
150
|
+
}, this._resetIsScrollingDebounced);
|
|
151
|
+
}, _.scrollToItem = function(e, i) {
|
|
152
|
+
i === void 0 && (i = "auto");
|
|
153
|
+
var o = this.props, f = o.itemCount, u = o.layout, p = this.state.scrollOffset;
|
|
154
|
+
e = Math.max(0, Math.min(e, f - 1));
|
|
155
|
+
var d = 0;
|
|
156
|
+
if (this._outerRef) {
|
|
157
|
+
var m = this._outerRef;
|
|
158
|
+
u === "vertical" ? d = m.scrollWidth > m.clientWidth ? H() : 0 : d = m.scrollHeight > m.clientHeight ? H() : 0;
|
|
159
|
+
}
|
|
160
|
+
this.scrollTo(c(this.props, e, i, p, this._instanceProps, d));
|
|
161
|
+
}, _.componentDidMount = function() {
|
|
162
|
+
var e = this.props, i = e.direction, o = e.initialScrollOffset, f = e.layout;
|
|
163
|
+
if (typeof o == "number" && this._outerRef != null) {
|
|
164
|
+
var u = this._outerRef;
|
|
165
|
+
i === "horizontal" || f === "horizontal" ? u.scrollLeft = o : u.scrollTop = o;
|
|
166
|
+
}
|
|
167
|
+
this._callPropsCallbacks();
|
|
168
|
+
}, _.componentDidUpdate = function() {
|
|
169
|
+
var e = this.props, i = e.direction, o = e.layout, f = this.state, u = f.scrollOffset, p = f.scrollUpdateWasRequested;
|
|
170
|
+
if (p && this._outerRef != null) {
|
|
171
|
+
var d = this._outerRef;
|
|
172
|
+
if (i === "horizontal" || o === "horizontal")
|
|
173
|
+
if (i === "rtl")
|
|
174
|
+
switch (K()) {
|
|
175
|
+
case "negative":
|
|
176
|
+
d.scrollLeft = -u;
|
|
177
|
+
break;
|
|
178
|
+
case "positive-ascending":
|
|
179
|
+
d.scrollLeft = u;
|
|
180
|
+
break;
|
|
181
|
+
default:
|
|
182
|
+
var m = d.clientWidth, v = d.scrollWidth;
|
|
183
|
+
d.scrollLeft = v - m - u;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
else
|
|
187
|
+
d.scrollLeft = u;
|
|
188
|
+
else
|
|
189
|
+
d.scrollTop = u;
|
|
190
|
+
}
|
|
191
|
+
this._callPropsCallbacks();
|
|
192
|
+
}, _.componentWillUnmount = function() {
|
|
193
|
+
this._resetIsScrollingTimeoutId !== null && q(this._resetIsScrollingTimeoutId);
|
|
194
|
+
}, _.render = function() {
|
|
195
|
+
var e = this.props, i = e.children, o = e.className, f = e.direction, u = e.height, p = e.innerRef, d = e.innerElementType, m = e.innerTagName, v = e.itemCount, T = e.itemData, M = e.itemKey, C = M === void 0 ? se : M, E = e.layout, G = e.outerElementType, Z = e.outerTagName, J = e.style, Q = e.useIsScrolling, X = e.width, P = this.state.isScrolling, W = f === "horizontal" || E === "horizontal", Y = W ? this._onScrollHorizontal : this._onScrollVertical, L = this._getRangeToRender(), ee = L[0], te = L[1], F = [];
|
|
196
|
+
if (v > 0)
|
|
197
|
+
for (var x = ee; x <= te; x++)
|
|
198
|
+
F.push(k(i, {
|
|
199
|
+
data: T,
|
|
200
|
+
key: C(x, T),
|
|
201
|
+
index: x,
|
|
202
|
+
isScrolling: Q ? P : void 0,
|
|
203
|
+
style: this._getItemStyle(x)
|
|
204
|
+
}));
|
|
205
|
+
var $ = a(this.props, this._instanceProps);
|
|
206
|
+
return k(G || Z || "div", {
|
|
207
|
+
className: o,
|
|
208
|
+
onScroll: Y,
|
|
209
|
+
ref: this._outerRefSetter,
|
|
210
|
+
style: re({
|
|
211
|
+
position: "relative",
|
|
212
|
+
height: u,
|
|
213
|
+
width: X,
|
|
214
|
+
overflow: "auto",
|
|
215
|
+
WebkitOverflowScrolling: "touch",
|
|
216
|
+
willChange: "transform",
|
|
217
|
+
direction: f
|
|
218
|
+
}, J)
|
|
219
|
+
}, k(d || m || "div", {
|
|
220
|
+
children: F,
|
|
221
|
+
ref: p,
|
|
222
|
+
style: {
|
|
223
|
+
height: W ? "100%" : $,
|
|
224
|
+
pointerEvents: P ? "none" : void 0,
|
|
225
|
+
width: W ? $ : "100%"
|
|
226
|
+
}
|
|
227
|
+
}));
|
|
228
|
+
}, _._callPropsCallbacks = function() {
|
|
229
|
+
if (typeof this.props.onItemsRendered == "function") {
|
|
230
|
+
var e = this.props.itemCount;
|
|
231
|
+
if (e > 0) {
|
|
232
|
+
var i = this._getRangeToRender(), o = i[0], f = i[1], u = i[2], p = i[3];
|
|
233
|
+
this._callOnItemsRendered(o, f, u, p);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (typeof this.props.onScroll == "function") {
|
|
237
|
+
var d = this.state, m = d.scrollDirection, v = d.scrollOffset, T = d.scrollUpdateWasRequested;
|
|
238
|
+
this._callOnScroll(m, v, T);
|
|
239
|
+
}
|
|
240
|
+
}, _._getRangeToRender = function() {
|
|
241
|
+
var e = this.props, i = e.itemCount, o = e.overscanCount, f = this.state, u = f.isScrolling, p = f.scrollDirection, d = f.scrollOffset;
|
|
242
|
+
if (i === 0)
|
|
243
|
+
return [0, 0, 0, 0];
|
|
244
|
+
var m = s(this.props, d, this._instanceProps), v = h(this.props, m, d, this._instanceProps), T = !u || p === "backward" ? Math.max(1, o) : 1, M = !u || p === "forward" ? Math.max(1, o) : 1;
|
|
245
|
+
return [Math.max(0, m - T), Math.max(0, Math.min(i - 1, v + M)), m, v];
|
|
246
|
+
}, z;
|
|
247
|
+
}(ae), t.defaultProps = {
|
|
248
|
+
direction: "ltr",
|
|
249
|
+
itemData: void 0,
|
|
250
|
+
layout: "vertical",
|
|
251
|
+
overscanCount: 2,
|
|
252
|
+
useIsScrolling: !1
|
|
253
|
+
}, t;
|
|
254
|
+
}
|
|
255
|
+
var de = function(t, r) {
|
|
256
|
+
var a = t.children, n = t.direction, c = t.height, s = t.layout, h = t.innerTagName, y = t.outerTagName, I = t.width, g = r.instance;
|
|
257
|
+
if (process.env.NODE_ENV !== "production") {
|
|
258
|
+
(h != null || y != null) && R && !R.has(g) && (R.add(g), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));
|
|
259
|
+
var w = n === "horizontal" || s === "horizontal";
|
|
260
|
+
switch (n) {
|
|
261
|
+
case "horizontal":
|
|
262
|
+
case "vertical":
|
|
263
|
+
N && !N.has(g) && (N.add(g), console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));
|
|
264
|
+
break;
|
|
265
|
+
case "ltr":
|
|
266
|
+
case "rtl":
|
|
267
|
+
break;
|
|
268
|
+
default:
|
|
269
|
+
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + n + '" was specified.'));
|
|
270
|
+
}
|
|
271
|
+
switch (s) {
|
|
272
|
+
case "horizontal":
|
|
273
|
+
case "vertical":
|
|
274
|
+
break;
|
|
275
|
+
default:
|
|
276
|
+
throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". ' + ('"' + s + '" was specified.'));
|
|
277
|
+
}
|
|
278
|
+
if (a == null)
|
|
279
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
280
|
+
if (w && typeof I != "number")
|
|
281
|
+
throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. ' + ('"' + (I === null ? "null" : typeof I) + '" was specified.'));
|
|
282
|
+
if (!w && typeof c != "number")
|
|
283
|
+
throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. ' + ('"' + (c === null ? "null" : typeof c) + '" was specified.'));
|
|
284
|
+
}
|
|
285
|
+
}, fe = 50, O = function(t, r, a) {
|
|
286
|
+
var n = t, c = n.itemSize, s = a.itemMetadataMap, h = a.lastMeasuredIndex;
|
|
287
|
+
if (r > h) {
|
|
288
|
+
var y = 0;
|
|
289
|
+
if (h >= 0) {
|
|
290
|
+
var I = s[h];
|
|
291
|
+
y = I.offset + I.size;
|
|
292
|
+
}
|
|
293
|
+
for (var g = h + 1; g <= r; g++) {
|
|
294
|
+
var w = c(g);
|
|
295
|
+
s[g] = {
|
|
296
|
+
offset: y,
|
|
297
|
+
size: w
|
|
298
|
+
}, y += w;
|
|
299
|
+
}
|
|
300
|
+
a.lastMeasuredIndex = r;
|
|
301
|
+
}
|
|
302
|
+
return s[r];
|
|
303
|
+
}, ue = function(t, r, a) {
|
|
304
|
+
var n = r.itemMetadataMap, c = r.lastMeasuredIndex, s = c > 0 ? n[c].offset : 0;
|
|
305
|
+
return s >= a ? j(t, r, c, 0, a) : he(t, r, Math.max(0, c), a);
|
|
306
|
+
}, j = function(t, r, a, n, c) {
|
|
307
|
+
for (; n <= a; ) {
|
|
308
|
+
var s = n + Math.floor((a - n) / 2), h = O(t, s, r).offset;
|
|
309
|
+
if (h === c)
|
|
310
|
+
return s;
|
|
311
|
+
h < c ? n = s + 1 : h > c && (a = s - 1);
|
|
312
|
+
}
|
|
313
|
+
return n > 0 ? n - 1 : 0;
|
|
314
|
+
}, he = function(t, r, a, n) {
|
|
315
|
+
for (var c = t.itemCount, s = 1; a < c && O(t, a, r).offset < n; )
|
|
316
|
+
a += s, s *= 2;
|
|
317
|
+
return j(t, r, Math.min(a, c - 1), Math.floor(a / 2), n);
|
|
318
|
+
}, B = function(t, r) {
|
|
319
|
+
var a = t.itemCount, n = r.itemMetadataMap, c = r.estimatedItemSize, s = r.lastMeasuredIndex, h = 0;
|
|
320
|
+
if (s >= a && (s = a - 1), s >= 0) {
|
|
321
|
+
var y = n[s];
|
|
322
|
+
h = y.offset + y.size;
|
|
323
|
+
}
|
|
324
|
+
var I = a - s - 1, g = I * c;
|
|
325
|
+
return h + g;
|
|
326
|
+
}, Se = /* @__PURE__ */ ce({
|
|
327
|
+
getItemOffset: function(t, r, a) {
|
|
328
|
+
return O(t, r, a).offset;
|
|
329
|
+
},
|
|
330
|
+
getItemSize: function(t, r, a) {
|
|
331
|
+
return a.itemMetadataMap[r].size;
|
|
332
|
+
},
|
|
333
|
+
getEstimatedTotalSize: B,
|
|
334
|
+
getOffsetForIndexAndAlignment: function(t, r, a, n, c, s) {
|
|
335
|
+
var h = t.direction, y = t.height, I = t.layout, g = t.width, w = h === "horizontal" || I === "horizontal", z = w ? g : y, _ = O(t, r, c), S = B(t, c), e = Math.max(0, Math.min(S - z, _.offset)), i = Math.max(0, _.offset - z + _.size + s);
|
|
336
|
+
switch (a === "smart" && (n >= i - z && n <= e + z ? a = "auto" : a = "center"), a) {
|
|
337
|
+
case "start":
|
|
338
|
+
return e;
|
|
339
|
+
case "end":
|
|
340
|
+
return i;
|
|
341
|
+
case "center":
|
|
342
|
+
return Math.round(i + (e - i) / 2);
|
|
343
|
+
case "auto":
|
|
344
|
+
default:
|
|
345
|
+
return n >= i && n <= e ? n : n < i ? i : e;
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
getStartIndexForOffset: function(t, r, a) {
|
|
349
|
+
return ue(t, a, r);
|
|
350
|
+
},
|
|
351
|
+
getStopIndexForStartIndex: function(t, r, a, n) {
|
|
352
|
+
for (var c = t.direction, s = t.height, h = t.itemCount, y = t.layout, I = t.width, g = c === "horizontal" || y === "horizontal", w = g ? I : s, z = O(t, r, n), _ = a + w, S = z.offset + z.size, e = r; e < h - 1 && S < _; )
|
|
353
|
+
e++, S += O(t, e, n).size;
|
|
354
|
+
return e;
|
|
355
|
+
},
|
|
356
|
+
initInstanceProps: function(t, r) {
|
|
357
|
+
var a = t, n = a.estimatedItemSize, c = {
|
|
358
|
+
itemMetadataMap: {},
|
|
359
|
+
estimatedItemSize: n || fe,
|
|
360
|
+
lastMeasuredIndex: -1
|
|
361
|
+
};
|
|
362
|
+
return r.resetAfterIndex = function(s, h) {
|
|
363
|
+
h === void 0 && (h = !0), c.lastMeasuredIndex = Math.min(c.lastMeasuredIndex, s - 1), r._getItemStyleCache(-1), h && r.forceUpdate();
|
|
364
|
+
}, c;
|
|
365
|
+
},
|
|
366
|
+
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
367
|
+
validateProps: function(t) {
|
|
368
|
+
var r = t.itemSize;
|
|
369
|
+
if (process.env.NODE_ENV !== "production" && typeof r != "function")
|
|
370
|
+
throw Error('An invalid "itemSize" prop has been specified. Value should be a function. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
export {
|
|
374
|
+
Se as VariableSizeList
|
|
375
|
+
};
|