@das-fed/ui 1.1.4 → 6.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/global/icons/index.local.js +1 -1
- package/global/style/index.css +1 -1
- package/global/style/scrollbar.css +22 -22
- package/global/theme/index.js +12 -12
- package/global/theme/module/color.js +31 -31
- package/global/theme/module/fontSize.js +5 -5
- package/global/theme/module/scrollbar.js +6 -6
- package/package.json +15 -9
- package/packages/business-components/app-container/index.js +154 -147
- package/packages/business-components/change-enterprises/index.css +1 -0
- package/packages/business-components/change-enterprises/index.js +241 -0
- package/packages/business-components/change-pwd/index.css +1 -0
- package/packages/business-components/change-pwd/index.js +330 -0
- package/packages/business-components/currency-page/index.css +1 -0
- package/packages/business-components/currency-page/index.js +99 -0
- package/packages/business-components/device-panel/index.css +1 -0
- package/packages/business-components/device-panel/index.js +115939 -0
- package/packages/business-components/echarts/index.js +93 -122
- package/packages/business-components/export-button/index.js +73 -66
- package/packages/business-components/import-button/index.js +213 -170
- package/packages/business-components/index.js +8 -1
- package/packages/business-components/layout-breadcrumb/index.js +82 -66
- package/packages/business-components/model-table-dialog/index.js +299 -289
- package/packages/business-components/process-configuration/index.css +1 -0
- package/packages/business-components/process-configuration/index.js +612 -0
- package/packages/business-components/process-form/index.css +1 -0
- package/packages/business-components/process-form/index.js +524 -0
- package/packages/business-components/process-search-form/index.js +73 -315
- package/packages/business-components/process-table/index.css +1 -1
- package/packages/business-components/process-table/index.js +186 -152
- package/packages/business-components/urgent-panel/index.css +1 -0
- package/packages/business-components/urgent-panel/index.js +3914 -0
- package/packages/business-components/user-org-dialog/index.js +466 -375
- package/packages/business-components/video-dialog/index.css +1 -0
- package/packages/business-components/video-dialog/index.js +1041 -0
- package/packages/business.js +1 -2
- package/packages/components/alert/index.js +449 -633
- package/packages/components/audio-video/index.css +1 -1
- package/packages/components/audio-video/index.js +312 -126
- package/packages/components/autocomplete/index.css +1 -1
- package/packages/components/autocomplete/index.js +312 -2923
- package/packages/components/breadcrumb/index.js +97 -82
- package/packages/components/button/index.css +1 -1
- package/packages/components/button/index.js +646 -787
- package/packages/components/calendar/index.css +1 -1
- package/packages/components/calendar/index.js +655 -3879
- package/packages/components/cascader/index.js +209 -203
- package/packages/components/checkbox/index.css +1 -1
- package/packages/components/checkbox/index.js +710 -872
- package/packages/components/collapse-panel/index.css +1 -1
- package/packages/components/collapse-panel/index.js +419 -601
- package/packages/components/collapse-transition/index.js +23 -21
- package/packages/components/collaspe/index.css +1 -1
- package/packages/components/collaspe/index.js +413 -595
- package/packages/components/color-picker/index.css +1 -1
- package/packages/components/color-picker/index.js +176 -133
- package/packages/components/custom-search-item/index.js +43 -37
- package/packages/components/date-picker/index.js +1338 -1459
- package/packages/components/dialog/index.js +429 -215
- package/packages/components/dimple-layout/index.css +1 -1
- package/packages/components/dimple-layout/index.js +1298 -1794
- package/packages/components/drawer/index.js +105 -77
- package/packages/components/dropdown/index.js +129 -109
- package/packages/components/edit-table/index.css +1 -1
- package/packages/components/edit-table/index.js +868 -752
- package/packages/components/empty/index.js +83 -78
- package/packages/components/form/index.js +22 -15
- package/packages/components/form-item/index.css +1 -1
- package/packages/components/form-item/index.js +601 -440
- package/packages/components/icon/index.css +1 -1
- package/packages/components/icon/index.js +38 -22
- package/packages/components/image-preview/index.css +1 -0
- package/packages/components/image-preview/index.js +2714 -0
- package/packages/components/image-upload/index.js +601 -765
- package/packages/components/image-viewer/index.css +1 -1
- package/packages/components/image-viewer/index.js +909 -990
- package/packages/components/index.js +2 -2
- package/packages/components/input/index.css +1 -1
- package/packages/components/input/index.js +284 -256
- package/packages/components/input-dialog-select/index.css +1 -1
- package/packages/components/input-dialog-select/index.js +179 -156
- package/packages/components/input-number/index.css +1 -1
- package/packages/components/input-number/index.js +157 -170
- package/packages/components/live-player/index.css +1 -0
- package/packages/components/live-player/index.js +170 -0
- package/packages/components/loading/index.js +17 -26
- package/packages/components/map/index.css +1 -1
- package/packages/components/map/index.js +18913 -461
- package/packages/components/menu-aside/index.css +1 -1
- package/packages/components/menu-aside/index.js +648 -713
- package/packages/components/menu-header/index.js +446 -629
- package/packages/components/message/index.js +25 -16
- package/packages/components/notification/index.js +386 -575
- package/packages/components/overlay/index.js +112 -103
- package/packages/components/pagination/index.js +260 -330
- package/packages/components/popover/index.js +104 -93
- package/packages/components/popup-mask/index.css +1 -1
- package/packages/components/popup-mask/index.js +77 -72
- package/packages/components/preview/index.js +33 -28
- package/packages/components/progress/index.js +214 -221
- package/packages/components/radio/index.css +1 -1
- package/packages/components/radio/index.js +699 -862
- package/packages/components/radio-tabs/index.js +144 -107
- package/packages/components/rich-editor/index.css +1 -1
- package/packages/components/rich-editor/index.js +105 -106
- package/packages/components/scrollbar/index.css +3 -2
- package/packages/components/scrollbar/index.js +2262 -1201
- package/packages/components/search/index.js +500 -664
- package/packages/components/search-form/index.css +1 -1
- package/packages/components/search-form/index.js +724 -626
- package/packages/components/select/index.css +1 -1
- package/packages/components/select/index.js +1052 -950
- package/packages/components/select-input/index.js +63 -53
- package/packages/components/select-list/index.css +1 -1
- package/packages/components/select-list/index.js +258 -235
- package/packages/components/special-range-picker-month/index.css +1 -1
- package/packages/components/special-range-picker-month/index.js +3068 -72555
- package/packages/components/special-range-picker-year/index.css +1 -1
- package/packages/components/special-range-picker-year/index.js +345 -339
- package/packages/components/spin/index.js +415 -594
- package/packages/components/split-panel/index.css +1 -1
- package/packages/components/split-panel/index.js +146 -127
- package/packages/components/step/index.js +414 -597
- package/packages/components/steps/index.js +407 -590
- package/packages/components/switch/index.js +23 -23
- package/packages/components/table/index.css +1 -1
- package/packages/components/table/index.js +80813 -27734
- package/packages/components/tabs/index.css +1 -1
- package/packages/components/tabs/index.js +620 -813
- package/packages/components/tag/index.js +63 -63
- package/packages/components/text-tooltip/index.css +9 -0
- package/packages/components/text-tooltip/index.js +2739 -33
- package/packages/components/time-line/index.js +464 -643
- package/packages/components/tooltip/index.css +1 -1
- package/packages/components/tooltip/index.js +108 -79
- package/packages/components/tree/index.css +1 -1
- package/packages/components/tree/index.js +840 -809
- package/packages/components/tree-select/index.js +271 -303
- package/packages/components/tree-table/index.js +461 -352
- package/packages/components/upload/index.js +682 -858
- package/packages/components/virtual-tree/index.css +1 -1
- package/packages/components/virtual-tree/index.js +144 -126
- package/packages/index.d.ts +1 -0
- package/packages/index.js +2 -2
- package/style/business.css +11 -4
- package/style/index.css +52 -42
- package/packages/business-components/low-code/index.css +0 -1
- package/packages/business-components/low-code/index.js +0 -60
- package/packages/components/audio-video-player/index.css +0 -1
- package/packages/components/audio-video-player/index.js +0 -83
- package/packages/components/table-column/index.css +0 -1
- package/packages/components/table-column/index.js +0 -82021
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import '@das-fed/ui/global/theme';
|
|
2
|
+
import { withInstall as withInstall$1 } from '@das-fed/utils';
|
|
3
|
+
import { warn, getCurrentInstance as getCurrentInstance$1, inject, ref as ref$1, computed, unref as unref$1, defineComponent, onBeforeUnmount, toRef, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, vShow, createElementBlock, Fragment, createVNode, watch as watch$1, nextTick as nextTick$1, provide, reactive, onMounted as onMounted$1, onUpdated, resolveDynamicComponent, renderSlot, createCommentVNode, onUnmounted, mergeProps } from 'vue';
|
|
4
|
+
import { createStyle } from '@das-fed/utils/style';
|
|
5
|
+
import { useZIndex } from '@das-fed/utils/hooks/popup-manager/use-zindex';
|
|
6
|
+
import { unref, getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, nextTick, watch, ref } from 'vue-demi';
|
|
2
7
|
|
|
3
8
|
/*!
|
|
4
9
|
* OverlayScrollbars
|
|
5
|
-
* Version: 2.
|
|
10
|
+
* Version: 2.8.3
|
|
6
11
|
*
|
|
7
12
|
* Copyright (c) Rene Haas | KingSora.
|
|
8
13
|
* https://github.com/KingSora
|
|
@@ -10,7 +15,7 @@ import '@das-fed/ui/global/theme';
|
|
|
10
15
|
* Released under the MIT license.
|
|
11
16
|
*/
|
|
12
17
|
const createCache = (t, n) => {
|
|
13
|
-
const {o: o,
|
|
18
|
+
const {o: o, i: s, u: e} = t;
|
|
14
19
|
let c = o;
|
|
15
20
|
let r;
|
|
16
21
|
const cacheUpdateContextual = (t, n) => {
|
|
@@ -28,7 +33,7 @@ const createCache = (t, n) => {
|
|
|
28
33
|
return [ n ? cacheUpdateIsolated : cacheUpdateContextual, getCurrentCache ];
|
|
29
34
|
};
|
|
30
35
|
|
|
31
|
-
const t = typeof window !== "undefined";
|
|
36
|
+
const t = typeof window !== "undefined" && typeof document !== "undefined";
|
|
32
37
|
|
|
33
38
|
const n = t ? window : {};
|
|
34
39
|
|
|
@@ -38,39 +43,39 @@ const s = Math.min;
|
|
|
38
43
|
|
|
39
44
|
const e = Math.round;
|
|
40
45
|
|
|
41
|
-
const
|
|
46
|
+
const c = Math.abs;
|
|
42
47
|
|
|
43
|
-
const
|
|
48
|
+
const r = Math.sign;
|
|
44
49
|
|
|
45
|
-
const
|
|
50
|
+
const l = n.cancelAnimationFrame;
|
|
46
51
|
|
|
47
|
-
const
|
|
52
|
+
const i = n.requestAnimationFrame;
|
|
53
|
+
|
|
54
|
+
const a = n.setTimeout;
|
|
55
|
+
|
|
56
|
+
const u = n.clearTimeout;
|
|
48
57
|
|
|
49
58
|
const getApi = t => typeof n[t] !== "undefined" ? n[t] : void 0;
|
|
50
59
|
|
|
51
|
-
const
|
|
60
|
+
const _ = getApi("MutationObserver");
|
|
52
61
|
|
|
53
|
-
const
|
|
62
|
+
const d = getApi("IntersectionObserver");
|
|
54
63
|
|
|
55
|
-
const
|
|
64
|
+
const f = getApi("ResizeObserver");
|
|
56
65
|
|
|
57
|
-
const
|
|
66
|
+
const p = getApi("ScrollTimeline");
|
|
58
67
|
|
|
59
68
|
const v = t && Node.ELEMENT_NODE;
|
|
60
69
|
|
|
61
|
-
const {toString: h, hasOwnProperty:
|
|
62
|
-
|
|
63
|
-
const g = /^\[object (.+)\]$/;
|
|
70
|
+
const {toString: h, hasOwnProperty: g} = Object.prototype;
|
|
64
71
|
|
|
65
72
|
const isUndefined = t => t === void 0;
|
|
66
73
|
|
|
67
74
|
const isNull = t => t === null;
|
|
68
75
|
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const isNumber = t => typeof t === "number";
|
|
76
|
+
const isNumber$1 = t => typeof t === "number";
|
|
72
77
|
|
|
73
|
-
const isString = t => typeof t === "string";
|
|
78
|
+
const isString$2 = t => typeof t === "string";
|
|
74
79
|
|
|
75
80
|
const isBoolean = t => typeof t === "boolean";
|
|
76
81
|
|
|
@@ -78,29 +83,29 @@ const isFunction = t => typeof t === "function";
|
|
|
78
83
|
|
|
79
84
|
const isArray = t => Array.isArray(t);
|
|
80
85
|
|
|
81
|
-
const isObject = t => typeof t === "object" && !isArray(t) && !isNull(t);
|
|
86
|
+
const isObject$1 = t => typeof t === "object" && !isArray(t) && !isNull(t);
|
|
82
87
|
|
|
83
88
|
const isArrayLike = t => {
|
|
84
89
|
const n = !!t && t.length;
|
|
85
|
-
const o = isNumber(n) && n > -1 && n % 1 == 0;
|
|
86
|
-
return isArray(t) || !isFunction(t) && o ? n > 0 && isObject(t) ? n - 1 in t : true : false;
|
|
90
|
+
const o = isNumber$1(n) && n > -1 && n % 1 == 0;
|
|
91
|
+
return isArray(t) || !isFunction(t) && o ? n > 0 && isObject$1(t) ? n - 1 in t : true : false;
|
|
87
92
|
};
|
|
88
93
|
|
|
89
94
|
const isPlainObject = t => {
|
|
90
|
-
if (!t || !isObject(t)
|
|
95
|
+
if (!t || !isObject$1(t)) {
|
|
91
96
|
return false;
|
|
92
97
|
}
|
|
93
98
|
let n;
|
|
94
99
|
const o = "constructor";
|
|
95
100
|
const s = t[o];
|
|
96
101
|
const e = s && s.prototype;
|
|
97
|
-
const c =
|
|
98
|
-
const r = e &&
|
|
102
|
+
const c = g.call(t, o);
|
|
103
|
+
const r = e && g.call(e, "isPrototypeOf");
|
|
99
104
|
if (s && !c && !r) {
|
|
100
105
|
return false;
|
|
101
106
|
}
|
|
102
107
|
for (n in t) {}
|
|
103
|
-
return isUndefined(n) ||
|
|
108
|
+
return isUndefined(n) || g.call(t, n);
|
|
104
109
|
};
|
|
105
110
|
|
|
106
111
|
const isHTMLElement = t => {
|
|
@@ -131,7 +136,7 @@ const inArray = (t, n) => t.indexOf(n) >= 0;
|
|
|
131
136
|
const concat = (t, n) => t.concat(n);
|
|
132
137
|
|
|
133
138
|
const push = (t, n, o) => {
|
|
134
|
-
!
|
|
139
|
+
!isString$2(n) && isArrayLike(n) ? Array.prototype.push.apply(t, n) : t.push(n);
|
|
135
140
|
return t;
|
|
136
141
|
};
|
|
137
142
|
|
|
@@ -153,11 +158,11 @@ const b = "paddingTop";
|
|
|
153
158
|
|
|
154
159
|
const w = "paddingRight";
|
|
155
160
|
|
|
156
|
-
const
|
|
161
|
+
const y = "paddingLeft";
|
|
157
162
|
|
|
158
|
-
const
|
|
163
|
+
const m = "paddingBottom";
|
|
159
164
|
|
|
160
|
-
const
|
|
165
|
+
const S = "marginLeft";
|
|
161
166
|
|
|
162
167
|
const O = "marginRight";
|
|
163
168
|
|
|
@@ -169,18 +174,25 @@ const x = "overflowY";
|
|
|
169
174
|
|
|
170
175
|
const H = "width";
|
|
171
176
|
|
|
172
|
-
const
|
|
177
|
+
const E = "height";
|
|
173
178
|
|
|
174
|
-
const z = "
|
|
179
|
+
const z = "visible";
|
|
175
180
|
|
|
176
|
-
const
|
|
181
|
+
const I = "hidden";
|
|
182
|
+
|
|
183
|
+
const A = "scroll";
|
|
184
|
+
|
|
185
|
+
const capitalizeFirstLetter = t => {
|
|
186
|
+
const n = String(t || "");
|
|
187
|
+
return n ? n[0].toUpperCase() + n.slice(1) : "";
|
|
188
|
+
};
|
|
177
189
|
|
|
178
190
|
const equal = (t, n, o, s) => {
|
|
179
191
|
if (t && n) {
|
|
180
192
|
let e = true;
|
|
181
193
|
each(o, (o => {
|
|
182
|
-
const c =
|
|
183
|
-
const r =
|
|
194
|
+
const c = t[o];
|
|
195
|
+
const r = n[o];
|
|
184
196
|
if (c !== r) {
|
|
185
197
|
e = false;
|
|
186
198
|
}
|
|
@@ -196,67 +208,75 @@ const equalXY = (t, n) => equal(t, n, [ "x", "y" ]);
|
|
|
196
208
|
|
|
197
209
|
const equalTRBL = (t, n) => equal(t, n, [ "t", "r", "b", "l" ]);
|
|
198
210
|
|
|
199
|
-
const noop = () => {};
|
|
211
|
+
const noop$1 = () => {};
|
|
200
212
|
|
|
201
213
|
const bind = (t, ...n) => t.bind(0, ...n);
|
|
202
214
|
|
|
203
215
|
const selfClearTimeout = t => {
|
|
204
216
|
let n;
|
|
205
|
-
const o = t ?
|
|
206
|
-
const s = t ?
|
|
217
|
+
const o = t ? a : i;
|
|
218
|
+
const s = t ? u : l;
|
|
207
219
|
return [ e => {
|
|
208
220
|
s(n);
|
|
209
|
-
n = o(e, isFunction(t) ? t() : t);
|
|
221
|
+
n = o((() => e()), isFunction(t) ? t() : t);
|
|
210
222
|
}, () => s(n) ];
|
|
211
223
|
};
|
|
212
224
|
|
|
213
225
|
const debounce = (t, n) => {
|
|
214
|
-
|
|
215
|
-
let
|
|
216
|
-
let
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
const {_: o, p: s, v: e, m: c} = n || {};
|
|
227
|
+
let r;
|
|
228
|
+
let _;
|
|
229
|
+
let d;
|
|
230
|
+
let f;
|
|
231
|
+
let p = noop$1;
|
|
232
|
+
const v = function invokeFunctionToDebounce(n) {
|
|
233
|
+
p();
|
|
234
|
+
u(r);
|
|
235
|
+
f = r = _ = void 0;
|
|
236
|
+
p = noop$1;
|
|
224
237
|
t.apply(this, n);
|
|
225
238
|
};
|
|
226
|
-
const mergeParms = t =>
|
|
239
|
+
const mergeParms = t => c && _ ? c(_, t) : t;
|
|
227
240
|
const flush = () => {
|
|
228
|
-
if (
|
|
229
|
-
|
|
241
|
+
if (p !== noop$1) {
|
|
242
|
+
v(mergeParms(d) || d);
|
|
230
243
|
}
|
|
231
244
|
};
|
|
232
|
-
const
|
|
245
|
+
const h = function debouncedFn() {
|
|
233
246
|
const t = from(arguments);
|
|
234
|
-
const n = isFunction(
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
237
|
-
const
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
const n = isFunction(o) ? o() : o;
|
|
248
|
+
const c = isNumber$1(n) && n >= 0;
|
|
249
|
+
if (c) {
|
|
250
|
+
const o = isFunction(s) ? s() : s;
|
|
251
|
+
const c = isNumber$1(o) && o >= 0;
|
|
252
|
+
const h = n > 0 ? a : i;
|
|
253
|
+
const g = n > 0 ? u : l;
|
|
254
|
+
const b = mergeParms(t);
|
|
255
|
+
const w = b || t;
|
|
256
|
+
const y = v.bind(0, w);
|
|
257
|
+
let m;
|
|
258
|
+
p();
|
|
259
|
+
if (e && !f) {
|
|
260
|
+
y();
|
|
261
|
+
f = true;
|
|
262
|
+
m = h((() => f = void 0), n);
|
|
263
|
+
} else {
|
|
264
|
+
m = h(y, n);
|
|
265
|
+
if (c && !r) {
|
|
266
|
+
r = a(flush, o);
|
|
267
|
+
}
|
|
249
268
|
}
|
|
250
|
-
|
|
269
|
+
p = () => g(m);
|
|
270
|
+
_ = d = w;
|
|
251
271
|
} else {
|
|
252
|
-
|
|
272
|
+
v(t);
|
|
253
273
|
}
|
|
254
274
|
};
|
|
255
|
-
|
|
256
|
-
return
|
|
275
|
+
h.S = flush;
|
|
276
|
+
return h;
|
|
257
277
|
};
|
|
258
278
|
|
|
259
|
-
const hasOwnProperty = (t, n) => Object.prototype.hasOwnProperty.call(t, n);
|
|
279
|
+
const hasOwnProperty$1 = (t, n) => Object.prototype.hasOwnProperty.call(t, n);
|
|
260
280
|
|
|
261
281
|
const keys = t => t ? Object.keys(t) : [];
|
|
262
282
|
|
|
@@ -292,8 +312,8 @@ const assignDeep = (t, n, o, s, e, c, r) => {
|
|
|
292
312
|
const removeUndefinedProperties = (t, n) => each(assignDeep({}, t), ((t, o, s) => {
|
|
293
313
|
if (t === void 0) {
|
|
294
314
|
delete s[o];
|
|
295
|
-
} else if (
|
|
296
|
-
s[o] = removeUndefinedProperties(t
|
|
315
|
+
} else if (t && isPlainObject(t)) {
|
|
316
|
+
s[o] = removeUndefinedProperties(t);
|
|
297
317
|
}
|
|
298
318
|
}));
|
|
299
319
|
|
|
@@ -310,9 +330,11 @@ const getDomTokensArray = t => from(new Set((isArray(t) ? t : (t || "").split("
|
|
|
310
330
|
|
|
311
331
|
const getAttr = (t, n) => t && t.getAttribute(n);
|
|
312
332
|
|
|
333
|
+
const hasAttr = (t, n) => t && t.hasAttribute(n);
|
|
334
|
+
|
|
313
335
|
const setAttrs = (t, n, o) => {
|
|
314
336
|
each(getDomTokensArray(n), (n => {
|
|
315
|
-
t && t.setAttribute(n, o || "");
|
|
337
|
+
t && t.setAttribute(n, String(o || ""));
|
|
316
338
|
}));
|
|
317
339
|
};
|
|
318
340
|
|
|
@@ -325,7 +347,9 @@ const domTokenListAttr = (t, n) => {
|
|
|
325
347
|
const s = bind(setAttrs, t, n);
|
|
326
348
|
const domTokenListOperation = (t, n) => {
|
|
327
349
|
const s = new Set(o);
|
|
328
|
-
each(getDomTokensArray(t), (t =>
|
|
350
|
+
each(getDomTokensArray(t), (t => {
|
|
351
|
+
s[n](t);
|
|
352
|
+
}));
|
|
329
353
|
return from(s).join(" ");
|
|
330
354
|
};
|
|
331
355
|
return {
|
|
@@ -340,6 +364,7 @@ const domTokenListAttr = (t, n) => {
|
|
|
340
364
|
|
|
341
365
|
const removeAttrClass = (t, n, o) => {
|
|
342
366
|
domTokenListAttr(t, n).O(o);
|
|
367
|
+
return bind(addAttrClass, t, n, o);
|
|
343
368
|
};
|
|
344
369
|
|
|
345
370
|
const addAttrClass = (t, n, o) => {
|
|
@@ -347,9 +372,7 @@ const addAttrClass = (t, n, o) => {
|
|
|
347
372
|
return bind(removeAttrClass, t, n, o);
|
|
348
373
|
};
|
|
349
374
|
|
|
350
|
-
const addRemoveAttrClass = (t, n, o, s) =>
|
|
351
|
-
(s ? addAttrClass : removeAttrClass)(t, n, o);
|
|
352
|
-
};
|
|
375
|
+
const addRemoveAttrClass = (t, n, o, s) => (s ? addAttrClass : removeAttrClass)(t, n, o);
|
|
353
376
|
|
|
354
377
|
const hasAttrClass = (t, n, o) => domTokenListAttr(t, n).C(o);
|
|
355
378
|
|
|
@@ -364,8 +387,6 @@ const addClass = (t, n) => {
|
|
|
364
387
|
return bind(removeClass, t, n);
|
|
365
388
|
};
|
|
366
389
|
|
|
367
|
-
const A = t && Element.prototype;
|
|
368
|
-
|
|
369
390
|
const find = (t, n) => {
|
|
370
391
|
const o = [];
|
|
371
392
|
const s = n ? isElement(n) && n : document;
|
|
@@ -379,18 +400,21 @@ const findFirst = (t, n) => {
|
|
|
379
400
|
|
|
380
401
|
const is = (t, n) => {
|
|
381
402
|
if (isElement(t)) {
|
|
382
|
-
|
|
383
|
-
return o.call(t, n);
|
|
403
|
+
return t.matches(n);
|
|
384
404
|
}
|
|
385
405
|
return false;
|
|
386
406
|
};
|
|
387
407
|
|
|
408
|
+
const isBodyElement = t => is(t, "body");
|
|
409
|
+
|
|
388
410
|
const contents = t => t ? from(t.childNodes) : [];
|
|
389
411
|
|
|
390
412
|
const parent = t => t && t.parentElement;
|
|
391
413
|
|
|
392
414
|
const closest = (t, n) => isElement(t) && t.closest(n);
|
|
393
415
|
|
|
416
|
+
const getFocusedElement = t => (document).activeElement;
|
|
417
|
+
|
|
394
418
|
const liesBetween = (t, n, o) => {
|
|
395
419
|
const s = closest(t, n);
|
|
396
420
|
const e = t && findFirst(o, s);
|
|
@@ -432,7 +456,7 @@ const before = (t, n, o) => {
|
|
|
432
456
|
t.insertBefore(e, s || null);
|
|
433
457
|
return () => removeElements(o);
|
|
434
458
|
}
|
|
435
|
-
return noop;
|
|
459
|
+
return noop$1;
|
|
436
460
|
};
|
|
437
461
|
|
|
438
462
|
const appendChildren = (t, n) => before(t, null, n);
|
|
@@ -467,10 +491,10 @@ const ratioToCssPercent = t => `${(validFiniteNumber(t) * 100).toFixed(3)}%`;
|
|
|
467
491
|
const numberToCssPx = t => `${validFiniteNumber(t)}px`;
|
|
468
492
|
|
|
469
493
|
function setStyles(t, n) {
|
|
470
|
-
t && each(n, ((n, o) => {
|
|
494
|
+
t && n && each(n, ((n, o) => {
|
|
471
495
|
try {
|
|
472
496
|
const s = t.style;
|
|
473
|
-
const e = isNumber(n) ? numberToCssPx(n) : (n || "") + "";
|
|
497
|
+
const e = isNumber$1(n) ? numberToCssPx(n) : (n || "") + "";
|
|
474
498
|
if (T.test(o)) {
|
|
475
499
|
s.setProperty(o, e);
|
|
476
500
|
} else {
|
|
@@ -481,11 +505,11 @@ function setStyles(t, n) {
|
|
|
481
505
|
}
|
|
482
506
|
|
|
483
507
|
function getStyles(t, o, s) {
|
|
484
|
-
const e = isString(o);
|
|
508
|
+
const e = isString$2(o);
|
|
485
509
|
let c = e ? "" : {};
|
|
486
510
|
if (t) {
|
|
487
511
|
const r = n.getComputedStyle(t, s) || t.style;
|
|
488
|
-
c = e ? getCSSVal(r, o) : o.reduce(((t, n) => {
|
|
512
|
+
c = e ? getCSSVal(r, o) : from(o).reduce(((t, n) => {
|
|
489
513
|
t[n] = getCSSVal(r, n);
|
|
490
514
|
return t;
|
|
491
515
|
}), c);
|
|
@@ -493,8 +517,6 @@ function getStyles(t, o, s) {
|
|
|
493
517
|
return c;
|
|
494
518
|
}
|
|
495
519
|
|
|
496
|
-
const getDirectionIsRTL = t => getStyles(t, "direction") === "rtl";
|
|
497
|
-
|
|
498
520
|
const topRightBottomLeft = (t, n, o) => {
|
|
499
521
|
const s = n ? `${n}-` : "";
|
|
500
522
|
const e = o ? `-${o}` : "";
|
|
@@ -511,7 +533,9 @@ const topRightBottomLeft = (t, n, o) => {
|
|
|
511
533
|
};
|
|
512
534
|
};
|
|
513
535
|
|
|
514
|
-
const getTrasformTranslateValue = (t, n) => `translate${isObject(t) ? `(${t.x},${t.y})` : `${n ? "X" : "Y"}(${t})`}`;
|
|
536
|
+
const getTrasformTranslateValue = (t, n) => `translate${isObject$1(t) ? `(${t.x},${t.y})` : `${n ? "X" : "Y"}(${t})`}`;
|
|
537
|
+
|
|
538
|
+
const elementHasDimensions = t => !!(t.offsetWidth || t.offsetHeight || t.getClientRects().length);
|
|
515
539
|
|
|
516
540
|
const D = {
|
|
517
541
|
w: 0,
|
|
@@ -523,17 +547,17 @@ const getElmWidthHeightProperty = (t, n) => n ? {
|
|
|
523
547
|
h: n[`${t}Height`]
|
|
524
548
|
} : D;
|
|
525
549
|
|
|
526
|
-
const
|
|
550
|
+
const getWindowSize = t => getElmWidthHeightProperty("inner", t || n);
|
|
527
551
|
|
|
528
552
|
const k = bind(getElmWidthHeightProperty, "offset");
|
|
529
553
|
|
|
530
|
-
const
|
|
554
|
+
const M = bind(getElmWidthHeightProperty, "client");
|
|
531
555
|
|
|
532
|
-
const
|
|
556
|
+
const R = bind(getElmWidthHeightProperty, "scroll");
|
|
533
557
|
|
|
534
|
-
const
|
|
558
|
+
const getFractionalSize = t => {
|
|
535
559
|
const n = parseFloat(getStyles(t, H)) || 0;
|
|
536
|
-
const o = parseFloat(getStyles(t,
|
|
560
|
+
const o = parseFloat(getStyles(t, E)) || 0;
|
|
537
561
|
return {
|
|
538
562
|
w: n - e(n),
|
|
539
563
|
h: o - e(o)
|
|
@@ -542,7 +566,9 @@ const fractionalSize = t => {
|
|
|
542
566
|
|
|
543
567
|
const getBoundingClientRect = t => t.getBoundingClientRect();
|
|
544
568
|
|
|
545
|
-
const
|
|
569
|
+
const hasDimensions = t => !!t && elementHasDimensions(t);
|
|
570
|
+
|
|
571
|
+
const domRectHasDimensions = t => !!(t && (t[E] || t[H]));
|
|
546
572
|
|
|
547
573
|
const domRectAppeared = (t, n) => {
|
|
548
574
|
const o = domRectHasDimensions(t);
|
|
@@ -552,7 +578,7 @@ const domRectAppeared = (t, n) => {
|
|
|
552
578
|
|
|
553
579
|
const removeEventListener = (t, n, o, s) => {
|
|
554
580
|
each(getDomTokensArray(n), (n => {
|
|
555
|
-
t.removeEventListener(n, o, s);
|
|
581
|
+
t && t.removeEventListener(n, o, s);
|
|
556
582
|
}));
|
|
557
583
|
};
|
|
558
584
|
|
|
@@ -568,9 +594,9 @@ const addEventListener = (t, n, o, s) => {
|
|
|
568
594
|
return bind(runEachAndClear, getDomTokensArray(n).map((n => {
|
|
569
595
|
const s = l ? e => {
|
|
570
596
|
removeEventListener(t, n, s, r);
|
|
571
|
-
o(e);
|
|
597
|
+
o && o(e);
|
|
572
598
|
} : o;
|
|
573
|
-
t.addEventListener(n, s, i);
|
|
599
|
+
t && t.addEventListener(n, s, i);
|
|
574
600
|
return bind(removeEventListener, t, n, s, r);
|
|
575
601
|
})));
|
|
576
602
|
};
|
|
@@ -579,39 +605,86 @@ const stopPropagation = t => t.stopPropagation();
|
|
|
579
605
|
|
|
580
606
|
const preventDefault = t => t.preventDefault();
|
|
581
607
|
|
|
582
|
-
const
|
|
583
|
-
x: 0,
|
|
584
|
-
y: 0
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
const absoluteCoordinates = t => {
|
|
588
|
-
const o = t && getBoundingClientRect(t);
|
|
589
|
-
return o ? {
|
|
590
|
-
x: o.left + n.scrollX,
|
|
591
|
-
y: o.top + n.scrollY
|
|
592
|
-
} : V;
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
const convertScrollPosition = (t, n, o) => o ? o.n ? -t + 0 : o.i ? n - t : t : t;
|
|
596
|
-
|
|
597
|
-
const getRawScrollBounds = (t, n) => [ convertScrollPosition(0, t, n), convertScrollPosition(t, t, n) ];
|
|
598
|
-
|
|
599
|
-
const getRawScrollRatio = (t, n, o) => capNumber(0, 1, convertScrollPosition(t, n, o) / n || 0);
|
|
608
|
+
const stopAndPrevent = t => stopPropagation(t) || preventDefault(t);
|
|
600
609
|
|
|
601
610
|
const scrollElementTo = (t, n) => {
|
|
602
|
-
const {x: o, y: s} = isNumber(n) ? {
|
|
611
|
+
const {x: o, y: s} = isNumber$1(n) ? {
|
|
603
612
|
x: n,
|
|
604
613
|
y: n
|
|
605
614
|
} : n || {};
|
|
606
|
-
isNumber(o) && (t.scrollLeft = o);
|
|
607
|
-
isNumber(s) && (t.scrollTop = s);
|
|
615
|
+
isNumber$1(o) && (t.scrollLeft = o);
|
|
616
|
+
isNumber$1(s) && (t.scrollTop = s);
|
|
608
617
|
};
|
|
609
618
|
|
|
610
|
-
const
|
|
619
|
+
const getElementScroll = t => ({
|
|
611
620
|
x: t.scrollLeft,
|
|
612
621
|
y: t.scrollTop
|
|
613
622
|
});
|
|
614
623
|
|
|
624
|
+
const getZeroScrollCoordinates = () => ({
|
|
625
|
+
T: {
|
|
626
|
+
x: 0,
|
|
627
|
+
y: 0
|
|
628
|
+
},
|
|
629
|
+
D: {
|
|
630
|
+
x: 0,
|
|
631
|
+
y: 0
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
const sanitizeScrollCoordinates = (t, n) => {
|
|
636
|
+
const {T: o, D: s} = t;
|
|
637
|
+
const {w: e, h: l} = n;
|
|
638
|
+
const sanitizeAxis = (t, n, o) => {
|
|
639
|
+
let s = r(t) * o;
|
|
640
|
+
let e = r(n) * o;
|
|
641
|
+
if (s === e) {
|
|
642
|
+
const o = c(t);
|
|
643
|
+
const r = c(n);
|
|
644
|
+
e = o > r ? 0 : e;
|
|
645
|
+
s = o < r ? 0 : s;
|
|
646
|
+
}
|
|
647
|
+
s = s === e ? 0 : s;
|
|
648
|
+
return [ s + 0, e + 0 ];
|
|
649
|
+
};
|
|
650
|
+
const [i, a] = sanitizeAxis(o.x, s.x, e);
|
|
651
|
+
const [u, _] = sanitizeAxis(o.y, s.y, l);
|
|
652
|
+
return {
|
|
653
|
+
T: {
|
|
654
|
+
x: i,
|
|
655
|
+
y: u
|
|
656
|
+
},
|
|
657
|
+
D: {
|
|
658
|
+
x: a,
|
|
659
|
+
y: _
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
const isDefaultDirectionScrollCoordinates = ({T: t, D: n}) => {
|
|
665
|
+
const getAxis = (t, n) => t === 0 && t <= n;
|
|
666
|
+
return {
|
|
667
|
+
x: getAxis(t.x, n.x),
|
|
668
|
+
y: getAxis(t.y, n.y)
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
const getScrollCoordinatesPercent = ({T: t, D: n}, o) => {
|
|
673
|
+
const getAxis = (t, n, o) => capNumber(0, 1, (t - o) / (t - n) || 0);
|
|
674
|
+
return {
|
|
675
|
+
x: getAxis(t.x, n.x, o.x),
|
|
676
|
+
y: getAxis(t.y, n.y, o.y)
|
|
677
|
+
};
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
const focusElement = t => {
|
|
681
|
+
if (t && t.focus) {
|
|
682
|
+
t.focus({
|
|
683
|
+
preventScroll: true
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
|
|
615
688
|
const manageListener = (t, n) => {
|
|
616
689
|
each(createOrKeepArray(n), t);
|
|
617
690
|
};
|
|
@@ -634,7 +707,7 @@ const createEventListenerHub = t => {
|
|
|
634
707
|
}
|
|
635
708
|
};
|
|
636
709
|
const addEvent = (t, o) => {
|
|
637
|
-
if (isString(t)) {
|
|
710
|
+
if (isString$2(t)) {
|
|
638
711
|
const s = n.get(t) || new Set;
|
|
639
712
|
n.set(t, s);
|
|
640
713
|
manageListener((t => {
|
|
@@ -673,9 +746,9 @@ const opsStringify = t => JSON.stringify(t, ((t, n) => {
|
|
|
673
746
|
return n;
|
|
674
747
|
}));
|
|
675
748
|
|
|
676
|
-
const getPropByPath = (t, n) => t ? `${n}`.split(".").reduce(((t, n) => t && hasOwnProperty(t, n) ? t[n] : void 0), t) : void 0;
|
|
749
|
+
const getPropByPath = (t, n) => t ? `${n}`.split(".").reduce(((t, n) => t && hasOwnProperty$1(t, n) ? t[n] : void 0), t) : void 0;
|
|
677
750
|
|
|
678
|
-
const
|
|
751
|
+
const V = {
|
|
679
752
|
paddingAbsolute: false,
|
|
680
753
|
showNativeOverlaidScrollbars: false,
|
|
681
754
|
update: {
|
|
@@ -706,12 +779,12 @@ const getOptionsDiff = (t, n) => {
|
|
|
706
779
|
each(s, (s => {
|
|
707
780
|
const e = t[s];
|
|
708
781
|
const c = n[s];
|
|
709
|
-
if (isObject(e) && isObject(c)) {
|
|
782
|
+
if (isObject$1(e) && isObject$1(c)) {
|
|
710
783
|
assignDeep(o[s] = {}, getOptionsDiff(e, c));
|
|
711
784
|
if (isEmptyObject(o[s])) {
|
|
712
785
|
delete o[s];
|
|
713
786
|
}
|
|
714
|
-
} else if (hasOwnProperty(n, s) && c !== e) {
|
|
787
|
+
} else if (hasOwnProperty$1(n, s) && c !== e) {
|
|
715
788
|
let t = true;
|
|
716
789
|
if (isArray(e) || isArray(c)) {
|
|
717
790
|
try {
|
|
@@ -730,220 +803,126 @@ const getOptionsDiff = (t, n) => {
|
|
|
730
803
|
|
|
731
804
|
const createOptionCheck = (t, n, o) => s => [ getPropByPath(t, s), o || getPropByPath(n, s) !== void 0 ];
|
|
732
805
|
|
|
733
|
-
const
|
|
806
|
+
const L = `data-overlayscrollbars`;
|
|
734
807
|
|
|
735
|
-
const
|
|
808
|
+
const P = "os-environment";
|
|
736
809
|
|
|
737
|
-
const
|
|
810
|
+
const U = `${P}-scrollbar-hidden`;
|
|
738
811
|
|
|
739
|
-
const N = `${
|
|
812
|
+
const N = `${L}-initialize`;
|
|
740
813
|
|
|
741
|
-
const
|
|
814
|
+
const q = "noClipping";
|
|
742
815
|
|
|
743
|
-
const
|
|
816
|
+
const B = `${L}-body`;
|
|
744
817
|
|
|
745
|
-
const
|
|
818
|
+
const F = L;
|
|
746
819
|
|
|
747
|
-
const
|
|
820
|
+
const j = "host";
|
|
748
821
|
|
|
749
|
-
const X =
|
|
822
|
+
const X = `${L}-viewport`;
|
|
750
823
|
|
|
751
|
-
const Y =
|
|
824
|
+
const Y = C;
|
|
752
825
|
|
|
753
|
-
const
|
|
826
|
+
const W = x;
|
|
754
827
|
|
|
755
|
-
const
|
|
828
|
+
const J = "arrange";
|
|
756
829
|
|
|
757
|
-
const
|
|
830
|
+
const K = "measuring";
|
|
758
831
|
|
|
759
832
|
const G = "scrollbarHidden";
|
|
760
833
|
|
|
761
|
-
const Q =
|
|
834
|
+
const Q = "scrollbarPressed";
|
|
762
835
|
|
|
763
|
-
const
|
|
836
|
+
const Z = "noContent";
|
|
764
837
|
|
|
765
|
-
const
|
|
838
|
+
const tt = `${L}-padding`;
|
|
766
839
|
|
|
767
|
-
const
|
|
840
|
+
const nt = `${L}-content`;
|
|
768
841
|
|
|
769
|
-
const
|
|
842
|
+
const ot = "os-size-observer";
|
|
770
843
|
|
|
771
|
-
const
|
|
844
|
+
const st = `${ot}-appear`;
|
|
772
845
|
|
|
773
|
-
const
|
|
846
|
+
const et = `${ot}-listener`;
|
|
774
847
|
|
|
775
|
-
const
|
|
848
|
+
const it = "os-trinsic-observer";
|
|
776
849
|
|
|
777
|
-
const
|
|
850
|
+
const at = "os-theme-none";
|
|
778
851
|
|
|
779
|
-
const
|
|
852
|
+
const ut = "os-scrollbar";
|
|
780
853
|
|
|
781
|
-
const _t = `${
|
|
854
|
+
const _t = `${ut}-rtl`;
|
|
782
855
|
|
|
783
|
-
const dt = `${
|
|
856
|
+
const dt = `${ut}-horizontal`;
|
|
784
857
|
|
|
785
|
-
const
|
|
858
|
+
const ft = `${ut}-vertical`;
|
|
786
859
|
|
|
787
|
-
const
|
|
860
|
+
const pt = `${ut}-track`;
|
|
788
861
|
|
|
789
|
-
const
|
|
862
|
+
const vt = `${ut}-handle`;
|
|
790
863
|
|
|
791
|
-
const
|
|
864
|
+
const ht = `${ut}-visible`;
|
|
792
865
|
|
|
793
|
-
const
|
|
866
|
+
const gt = `${ut}-cornerless`;
|
|
794
867
|
|
|
795
|
-
const
|
|
868
|
+
const bt = `${ut}-interaction`;
|
|
796
869
|
|
|
797
|
-
const
|
|
870
|
+
const wt = `${ut}-unusable`;
|
|
798
871
|
|
|
799
|
-
const yt = `${
|
|
872
|
+
const yt = `${ut}-auto-hide`;
|
|
800
873
|
|
|
801
874
|
const mt = `${yt}-hidden`;
|
|
802
875
|
|
|
803
|
-
const
|
|
876
|
+
const St = `${ut}-wheel`;
|
|
804
877
|
|
|
805
|
-
const
|
|
878
|
+
const Ot = `${pt}-interactive`;
|
|
806
879
|
|
|
807
|
-
const
|
|
880
|
+
const $t = `${vt}-interactive`;
|
|
808
881
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
const Ht = {};
|
|
812
|
-
|
|
813
|
-
const addPlugins = t => {
|
|
814
|
-
each(t, (t => each(t, ((n, o) => {
|
|
815
|
-
xt[o] = t[o];
|
|
816
|
-
}))));
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
const registerPluginModuleInstances = (t, n, o) => keys(t).map((s => {
|
|
820
|
-
const {static: e, instance: c} = t[s];
|
|
821
|
-
const [r, l, i] = o || [];
|
|
822
|
-
const a = o ? c : e;
|
|
823
|
-
if (a) {
|
|
824
|
-
const t = o ? a(r, l, n) : a(n);
|
|
825
|
-
return (i || Ht)[s] = t;
|
|
826
|
-
}
|
|
827
|
-
}));
|
|
828
|
-
|
|
829
|
-
const getStaticPluginModuleInstance = t => Ht[t];
|
|
830
|
-
|
|
831
|
-
const It = "__osOptionsValidationPlugin";
|
|
832
|
-
|
|
833
|
-
const zt = "__osSizeObserverPlugin";
|
|
834
|
-
|
|
835
|
-
const getShowNativeOverlaidScrollbars = (t, n) => {
|
|
836
|
-
const {T: o} = n;
|
|
837
|
-
const [s, e] = t("showNativeOverlaidScrollbars");
|
|
838
|
-
return [ s && o.x && o.y, e ];
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
const overflowIsVisible = t => t.indexOf(E) === 0;
|
|
842
|
-
|
|
843
|
-
const getViewportOverflowState = (t, n) => {
|
|
844
|
-
const {D: o} = t;
|
|
845
|
-
const getStatePerAxis = t => {
|
|
846
|
-
const s = getStyles(o, t);
|
|
847
|
-
const e = n ? n[t] : s;
|
|
848
|
-
const c = e === "scroll";
|
|
849
|
-
return [ s, c ];
|
|
850
|
-
};
|
|
851
|
-
const [s, e] = getStatePerAxis(C);
|
|
852
|
-
const [c, r] = getStatePerAxis(x);
|
|
853
|
-
return {
|
|
854
|
-
k: {
|
|
855
|
-
x: s,
|
|
856
|
-
y: c
|
|
857
|
-
},
|
|
858
|
-
R: {
|
|
859
|
-
x: e,
|
|
860
|
-
y: r
|
|
861
|
-
}
|
|
862
|
-
};
|
|
863
|
-
};
|
|
864
|
-
|
|
865
|
-
const setViewportOverflowState = (t, n, o, s) => {
|
|
866
|
-
const e = n.x || n.y;
|
|
867
|
-
const setAxisOverflowStyle = (t, n) => {
|
|
868
|
-
const o = overflowIsVisible(t);
|
|
869
|
-
const s = o && e ? "hidden" : "";
|
|
870
|
-
const c = n && o && t.replace(`${E}-`, "") || s;
|
|
871
|
-
return [ n && !o ? t : "", overflowIsVisible(c) ? "hidden" : c ];
|
|
872
|
-
};
|
|
873
|
-
const [c, r] = setAxisOverflowStyle(o.x, n.x);
|
|
874
|
-
const [l, i] = setAxisOverflowStyle(o.y, n.y);
|
|
875
|
-
s[C] = r && l ? r : c;
|
|
876
|
-
s[x] = i && c ? i : l;
|
|
877
|
-
return getViewportOverflowState(t, s);
|
|
878
|
-
};
|
|
879
|
-
|
|
880
|
-
const At = "__osScrollbarsHidingPlugin";
|
|
881
|
-
|
|
882
|
-
const Dt = "__osClickScrollPlugin";
|
|
883
|
-
|
|
884
|
-
let Rt;
|
|
882
|
+
let Ct;
|
|
885
883
|
|
|
886
884
|
const createEnvironment = () => {
|
|
887
|
-
const getNativeScrollbarSize = (t, n, o
|
|
888
|
-
appendChildren(
|
|
889
|
-
|
|
890
|
-
const
|
|
891
|
-
const
|
|
892
|
-
|
|
885
|
+
const getNativeScrollbarSize = (t, n, o) => {
|
|
886
|
+
appendChildren(document.body, t);
|
|
887
|
+
appendChildren(document.body, t);
|
|
888
|
+
const s = M(t);
|
|
889
|
+
const e = k(t);
|
|
890
|
+
const c = getFractionalSize(n);
|
|
891
|
+
o && removeElements(t);
|
|
893
892
|
return {
|
|
894
|
-
x:
|
|
895
|
-
y:
|
|
893
|
+
x: e.h - s.h + c.h,
|
|
894
|
+
y: e.w - s.w + c.w
|
|
896
895
|
};
|
|
897
896
|
};
|
|
898
897
|
const getNativeScrollbarsHiding = t => {
|
|
899
898
|
let n = false;
|
|
900
|
-
const o = addClass(t,
|
|
899
|
+
const o = addClass(t, U);
|
|
901
900
|
try {
|
|
902
901
|
n = getStyles(t, "scrollbar-width") === "none" || getStyles(t, "display", "::-webkit-scrollbar") === "none";
|
|
903
902
|
} catch (s) {}
|
|
904
903
|
o();
|
|
905
904
|
return n;
|
|
906
905
|
};
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
[C]: z,
|
|
910
|
-
[x]: z,
|
|
911
|
-
direction: "rtl"
|
|
912
|
-
});
|
|
913
|
-
scrollElementTo(t, {
|
|
914
|
-
x: 0
|
|
915
|
-
});
|
|
916
|
-
const o = absoluteCoordinates(t);
|
|
917
|
-
const s = absoluteCoordinates(n);
|
|
918
|
-
scrollElementTo(t, {
|
|
919
|
-
x: -999
|
|
920
|
-
});
|
|
921
|
-
const e = absoluteCoordinates(n);
|
|
922
|
-
return {
|
|
923
|
-
i: o.x === s.x,
|
|
924
|
-
n: s.x !== e.x
|
|
925
|
-
};
|
|
926
|
-
};
|
|
927
|
-
const {body: t} = document;
|
|
928
|
-
const o = createDOM(`<div class="${U}"><div></div></div>`);
|
|
906
|
+
const t = `.${P}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${P} div{width:200%;height:200%;margin:10px 0}.${U}{scrollbar-width:none!important}.${U}::-webkit-scrollbar,.${U}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`;
|
|
907
|
+
const o = createDOM(`<div class="${P}"><div></div><style>${t}</style></div>`);
|
|
929
908
|
const s = o[0];
|
|
930
909
|
const e = s.firstChild;
|
|
931
910
|
const [c, , r] = createEventListenerHub();
|
|
932
911
|
const [l, i] = createCache({
|
|
933
|
-
o: getNativeScrollbarSize(
|
|
934
|
-
|
|
935
|
-
}, bind(getNativeScrollbarSize,
|
|
912
|
+
o: getNativeScrollbarSize(s, e),
|
|
913
|
+
i: equalXY
|
|
914
|
+
}, bind(getNativeScrollbarSize, s, e, true));
|
|
936
915
|
const [a] = i();
|
|
937
916
|
const u = getNativeScrollbarsHiding(s);
|
|
938
|
-
const
|
|
917
|
+
const _ = {
|
|
939
918
|
x: a.x === 0,
|
|
940
919
|
y: a.y === 0
|
|
941
920
|
};
|
|
942
|
-
const
|
|
921
|
+
const d = {
|
|
943
922
|
elements: {
|
|
944
923
|
host: null,
|
|
945
924
|
padding: !u,
|
|
946
|
-
viewport: t => u && t
|
|
925
|
+
viewport: t => u && isBodyElement(t) && t,
|
|
947
926
|
content: false
|
|
948
927
|
},
|
|
949
928
|
scrollbars: {
|
|
@@ -954,42 +933,51 @@ const createEnvironment = () => {
|
|
|
954
933
|
body: null
|
|
955
934
|
}
|
|
956
935
|
};
|
|
957
|
-
const
|
|
958
|
-
const
|
|
959
|
-
const
|
|
936
|
+
const f = assignDeep({}, V);
|
|
937
|
+
const v = bind(assignDeep, {}, f);
|
|
938
|
+
const h = bind(assignDeep, {}, d);
|
|
960
939
|
const g = {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
et: assignDeep({}, v)
|
|
940
|
+
k: a,
|
|
941
|
+
M: _,
|
|
942
|
+
R: u,
|
|
943
|
+
V: !!p,
|
|
944
|
+
L: bind(c, "r"),
|
|
945
|
+
P: h,
|
|
946
|
+
U: t => assignDeep(d, t) && h(),
|
|
947
|
+
N: v,
|
|
948
|
+
q: t => assignDeep(f, t) && v(),
|
|
949
|
+
B: assignDeep({}, d),
|
|
950
|
+
F: assignDeep({}, f)
|
|
973
951
|
};
|
|
974
952
|
removeAttrs(s, "style");
|
|
975
953
|
removeElements(s);
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
if (!u && (!f.x || !f.y)) {
|
|
979
|
-
const n = getStaticPluginModuleInstance(At);
|
|
980
|
-
const o = n ? n.Y() : noop;
|
|
981
|
-
t = !!o(g, l);
|
|
982
|
-
}
|
|
983
|
-
r("r", [ t ]);
|
|
954
|
+
addEventListener(n, "resize", (() => {
|
|
955
|
+
r("r", []);
|
|
984
956
|
}));
|
|
957
|
+
if (isFunction(n.matchMedia) && !u && (!_.x || !_.y)) {
|
|
958
|
+
const addZoomListener = t => {
|
|
959
|
+
const o = n.matchMedia(`(resolution: ${n.devicePixelRatio}dppx)`);
|
|
960
|
+
addEventListener(o, "change", (() => {
|
|
961
|
+
t();
|
|
962
|
+
addZoomListener(t);
|
|
963
|
+
}), {
|
|
964
|
+
A: true
|
|
965
|
+
});
|
|
966
|
+
};
|
|
967
|
+
addZoomListener((() => {
|
|
968
|
+
const [t, n] = l();
|
|
969
|
+
assignDeep(g.k, t);
|
|
970
|
+
r("r", [ n ]);
|
|
971
|
+
}));
|
|
972
|
+
}
|
|
985
973
|
return g;
|
|
986
974
|
};
|
|
987
975
|
|
|
988
976
|
const getEnvironment = () => {
|
|
989
|
-
if (!
|
|
990
|
-
|
|
977
|
+
if (!Ct) {
|
|
978
|
+
Ct = createEnvironment();
|
|
991
979
|
}
|
|
992
|
-
return
|
|
980
|
+
return Ct;
|
|
993
981
|
};
|
|
994
982
|
|
|
995
983
|
const resolveInitialization = (t, n) => isFunction(n) ? n.apply(0, t) : n;
|
|
@@ -1008,26 +996,26 @@ const dynamicInitializationElement = (t, n, o, s) => {
|
|
|
1008
996
|
|
|
1009
997
|
const cancelInitialization = (t, n) => {
|
|
1010
998
|
const {nativeScrollbarsOverlaid: o, body: s} = n || {};
|
|
1011
|
-
const {
|
|
999
|
+
const {M: e, R: c, P: r} = getEnvironment();
|
|
1012
1000
|
const {nativeScrollbarsOverlaid: l, body: i} = r().cancel;
|
|
1013
1001
|
const a = o != null ? o : l;
|
|
1014
1002
|
const u = isUndefined(s) ? i : s;
|
|
1015
|
-
const
|
|
1016
|
-
const
|
|
1017
|
-
return !!
|
|
1003
|
+
const _ = (e.x || e.y) && a;
|
|
1004
|
+
const d = t && (isNull(u) ? !c : u);
|
|
1005
|
+
return !!_ || !!d;
|
|
1018
1006
|
};
|
|
1019
1007
|
|
|
1020
|
-
const
|
|
1008
|
+
const xt = new WeakMap;
|
|
1021
1009
|
|
|
1022
1010
|
const addInstance = (t, n) => {
|
|
1023
|
-
|
|
1011
|
+
xt.set(t, n);
|
|
1024
1012
|
};
|
|
1025
1013
|
|
|
1026
1014
|
const removeInstance = t => {
|
|
1027
|
-
|
|
1015
|
+
xt.delete(t);
|
|
1028
1016
|
};
|
|
1029
1017
|
|
|
1030
|
-
const getInstance = t =>
|
|
1018
|
+
const getInstance = t => xt.get(t);
|
|
1031
1019
|
|
|
1032
1020
|
const createEventContentChange = (t, n, o) => {
|
|
1033
1021
|
let s = false;
|
|
@@ -1069,62 +1057,63 @@ const createEventContentChange = (t, n, o) => {
|
|
|
1069
1057
|
|
|
1070
1058
|
const createDOMObserver = (t, n, o, s) => {
|
|
1071
1059
|
let e = false;
|
|
1072
|
-
const {
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1060
|
+
const {j: c, X: r, Y: l, W: i, J: a, K: u} = s || {};
|
|
1061
|
+
const d = debounce((() => e && o(true)), {
|
|
1062
|
+
_: 33,
|
|
1075
1063
|
p: 99
|
|
1076
1064
|
});
|
|
1077
|
-
const [
|
|
1078
|
-
const
|
|
1079
|
-
const
|
|
1080
|
-
const g = concat(
|
|
1065
|
+
const [f, p] = createEventContentChange(t, d, l);
|
|
1066
|
+
const v = c || [];
|
|
1067
|
+
const h = r || [];
|
|
1068
|
+
const g = concat(v, h);
|
|
1081
1069
|
const observerCallback = (e, c) => {
|
|
1082
1070
|
if (!isEmptyArray(c)) {
|
|
1083
|
-
const r = a || noop;
|
|
1084
|
-
const l =
|
|
1085
|
-
const u = [];
|
|
1071
|
+
const r = a || noop$1;
|
|
1072
|
+
const l = u || noop$1;
|
|
1086
1073
|
const _ = [];
|
|
1087
|
-
|
|
1088
|
-
let
|
|
1074
|
+
const d = [];
|
|
1075
|
+
let f = false;
|
|
1076
|
+
let v = false;
|
|
1089
1077
|
each(c, (o => {
|
|
1090
|
-
const {attributeName: e, target: c, type: a, oldValue:
|
|
1078
|
+
const {attributeName: e, target: c, type: a, oldValue: u, addedNodes: p, removedNodes: g} = o;
|
|
1091
1079
|
const b = a === "attributes";
|
|
1092
1080
|
const w = a === "childList";
|
|
1093
|
-
const
|
|
1094
|
-
const
|
|
1095
|
-
const
|
|
1096
|
-
const O =
|
|
1097
|
-
const $ =
|
|
1098
|
-
|
|
1099
|
-
|
|
1081
|
+
const y = t === c;
|
|
1082
|
+
const m = b && e;
|
|
1083
|
+
const S = m && getAttr(c, e || "");
|
|
1084
|
+
const O = isString$2(S) ? S : null;
|
|
1085
|
+
const $ = m && u !== O;
|
|
1086
|
+
const C = inArray(h, e) && $;
|
|
1087
|
+
if (n && (w || !y)) {
|
|
1088
|
+
const n = b && $;
|
|
1100
1089
|
const a = n && i && is(c, i);
|
|
1101
|
-
const
|
|
1102
|
-
const
|
|
1103
|
-
each(
|
|
1104
|
-
each(g, (t => push(
|
|
1105
|
-
|
|
1090
|
+
const d = a ? !r(c, e, u, O) : !b || n;
|
|
1091
|
+
const f = d && !l(o, !!a, t, s);
|
|
1092
|
+
each(p, (t => push(_, t)));
|
|
1093
|
+
each(g, (t => push(_, t)));
|
|
1094
|
+
v = v || f;
|
|
1106
1095
|
}
|
|
1107
|
-
if (!n &&
|
|
1108
|
-
push(
|
|
1109
|
-
|
|
1096
|
+
if (!n && y && $ && !r(c, e, u, O)) {
|
|
1097
|
+
push(d, e);
|
|
1098
|
+
f = f || C;
|
|
1110
1099
|
}
|
|
1111
1100
|
}));
|
|
1112
|
-
|
|
1101
|
+
p((t => deduplicateArray(_).reduce(((n, o) => {
|
|
1113
1102
|
push(n, find(t, o));
|
|
1114
1103
|
return is(o, t) ? push(n, o) : n;
|
|
1115
1104
|
}), [])));
|
|
1116
1105
|
if (n) {
|
|
1117
|
-
!e &&
|
|
1106
|
+
!e && v && o(false);
|
|
1118
1107
|
return [ false ];
|
|
1119
1108
|
}
|
|
1120
|
-
if (!isEmptyArray(
|
|
1121
|
-
const t = [ deduplicateArray(
|
|
1109
|
+
if (!isEmptyArray(d) || f) {
|
|
1110
|
+
const t = [ deduplicateArray(d), f ];
|
|
1122
1111
|
!e && o.apply(0, t);
|
|
1123
1112
|
return t;
|
|
1124
1113
|
}
|
|
1125
1114
|
}
|
|
1126
1115
|
};
|
|
1127
|
-
const b = new
|
|
1116
|
+
const b = new _(bind(observerCallback, false));
|
|
1128
1117
|
return [ () => {
|
|
1129
1118
|
b.observe(t, {
|
|
1130
1119
|
attributes: true,
|
|
@@ -1137,103 +1126,139 @@ const createDOMObserver = (t, n, o, s) => {
|
|
|
1137
1126
|
e = true;
|
|
1138
1127
|
return () => {
|
|
1139
1128
|
if (e) {
|
|
1140
|
-
|
|
1129
|
+
f();
|
|
1141
1130
|
b.disconnect();
|
|
1142
1131
|
e = false;
|
|
1143
1132
|
}
|
|
1144
1133
|
};
|
|
1145
1134
|
}, () => {
|
|
1146
1135
|
if (e) {
|
|
1147
|
-
|
|
1136
|
+
d.S();
|
|
1148
1137
|
return observerCallback(true, b.takeRecords());
|
|
1149
1138
|
}
|
|
1150
1139
|
} ];
|
|
1151
1140
|
};
|
|
1152
1141
|
|
|
1142
|
+
const Ht = {};
|
|
1143
|
+
|
|
1144
|
+
const Et = {};
|
|
1145
|
+
|
|
1146
|
+
const addPlugins = t => {
|
|
1147
|
+
each(t, (t => each(t, ((n, o) => {
|
|
1148
|
+
Ht[o] = t[o];
|
|
1149
|
+
}))));
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
const registerPluginModuleInstances = (t, n, o) => keys(t).map((s => {
|
|
1153
|
+
const {static: e, instance: c} = t[s];
|
|
1154
|
+
const [r, l, i] = o || [];
|
|
1155
|
+
const a = o ? c : e;
|
|
1156
|
+
if (a) {
|
|
1157
|
+
const t = o ? a(r, l, n) : a(n);
|
|
1158
|
+
return (i || Et)[s] = t;
|
|
1159
|
+
}
|
|
1160
|
+
}));
|
|
1161
|
+
|
|
1162
|
+
const getStaticPluginModuleInstance = t => Et[t];
|
|
1163
|
+
|
|
1164
|
+
const zt = "__osOptionsValidationPlugin";
|
|
1165
|
+
|
|
1166
|
+
const It = "__osSizeObserverPlugin";
|
|
1167
|
+
|
|
1168
|
+
const getShowNativeOverlaidScrollbars = (t, n) => {
|
|
1169
|
+
const {M: o} = n;
|
|
1170
|
+
const [s, e] = t("showNativeOverlaidScrollbars");
|
|
1171
|
+
return [ s && o.x && o.y, e ];
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
const overflowIsVisible = t => t.indexOf(z) === 0;
|
|
1175
|
+
|
|
1176
|
+
const createViewportOverflowState = (t, n) => {
|
|
1177
|
+
const getAxisOverflowStyle = (t, n, o, s) => {
|
|
1178
|
+
const e = t === z ? I : t.replace(`${z}-`, "");
|
|
1179
|
+
const c = overflowIsVisible(t);
|
|
1180
|
+
const r = overflowIsVisible(o);
|
|
1181
|
+
if (!n && !s) {
|
|
1182
|
+
return I;
|
|
1183
|
+
}
|
|
1184
|
+
if (c && r) {
|
|
1185
|
+
return z;
|
|
1186
|
+
}
|
|
1187
|
+
if (c) {
|
|
1188
|
+
const t = n ? z : I;
|
|
1189
|
+
return n && s ? e : t;
|
|
1190
|
+
}
|
|
1191
|
+
const l = r && s ? z : I;
|
|
1192
|
+
return n ? e : l;
|
|
1193
|
+
};
|
|
1194
|
+
const o = {
|
|
1195
|
+
x: getAxisOverflowStyle(n.x, t.x, n.y, t.y),
|
|
1196
|
+
y: getAxisOverflowStyle(n.y, t.y, n.x, t.x)
|
|
1197
|
+
};
|
|
1198
|
+
return {
|
|
1199
|
+
G: o,
|
|
1200
|
+
Z: {
|
|
1201
|
+
x: o.x === A,
|
|
1202
|
+
y: o.y === A
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1205
|
+
};
|
|
1206
|
+
|
|
1207
|
+
const Tt = "__osScrollbarsHidingPlugin";
|
|
1208
|
+
|
|
1209
|
+
const kt = "__osClickScrollPlugin";
|
|
1210
|
+
|
|
1153
1211
|
const createSizeObserver = (t, n, o) => {
|
|
1154
|
-
const s =
|
|
1155
|
-
const
|
|
1156
|
-
const
|
|
1157
|
-
const {K: l} = getEnvironment();
|
|
1158
|
-
const i = bind(getDirectionIsRTL, t);
|
|
1159
|
-
const [a] = createCache({
|
|
1212
|
+
const {dt: s} = o || {};
|
|
1213
|
+
const e = getStaticPluginModuleInstance(It);
|
|
1214
|
+
const [c] = createCache({
|
|
1160
1215
|
o: false,
|
|
1161
|
-
|
|
1216
|
+
u: true
|
|
1162
1217
|
});
|
|
1163
1218
|
return () => {
|
|
1164
1219
|
const o = [];
|
|
1165
|
-
const
|
|
1166
|
-
const
|
|
1167
|
-
const
|
|
1220
|
+
const r = createDOM(`<div class="${ot}"><div class="${et}"></div></div>`);
|
|
1221
|
+
const l = r[0];
|
|
1222
|
+
const i = l.firstChild;
|
|
1168
1223
|
const onSizeChangedCallbackProxy = t => {
|
|
1169
1224
|
const o = t instanceof ResizeObserverEntry;
|
|
1170
|
-
|
|
1171
|
-
let
|
|
1172
|
-
let i = false;
|
|
1173
|
-
let u = true;
|
|
1225
|
+
let s = false;
|
|
1226
|
+
let e = false;
|
|
1174
1227
|
if (o) {
|
|
1175
|
-
const [n, , o] =
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
i = c || e;
|
|
1180
|
-
r = !i && !s;
|
|
1181
|
-
u = !r;
|
|
1182
|
-
} else if (c) {
|
|
1183
|
-
[, u] = t;
|
|
1228
|
+
const [n, , o] = c(t.contentRect);
|
|
1229
|
+
const r = domRectHasDimensions(n);
|
|
1230
|
+
e = domRectAppeared(n, o);
|
|
1231
|
+
s = !e && !r;
|
|
1184
1232
|
} else {
|
|
1185
|
-
|
|
1186
|
-
}
|
|
1187
|
-
if (e && u) {
|
|
1188
|
-
const n = c ? t[0] : getDirectionIsRTL(f);
|
|
1189
|
-
scrollElementTo(f, {
|
|
1190
|
-
x: convertScrollPosition(s, s, n && l),
|
|
1191
|
-
y: s
|
|
1192
|
-
});
|
|
1233
|
+
e = t === true;
|
|
1193
1234
|
}
|
|
1194
|
-
if (!
|
|
1235
|
+
if (!s) {
|
|
1195
1236
|
n({
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
dt: i
|
|
1237
|
+
ft: true,
|
|
1238
|
+
dt: e
|
|
1199
1239
|
});
|
|
1200
1240
|
}
|
|
1201
1241
|
};
|
|
1202
|
-
if (
|
|
1203
|
-
const t = new
|
|
1204
|
-
t.observe(
|
|
1242
|
+
if (f) {
|
|
1243
|
+
const t = new f((t => onSizeChangedCallbackProxy(t.pop())));
|
|
1244
|
+
t.observe(i);
|
|
1205
1245
|
push(o, (() => {
|
|
1206
1246
|
t.disconnect();
|
|
1207
1247
|
}));
|
|
1208
|
-
} else if (
|
|
1209
|
-
const [t, n] =
|
|
1210
|
-
push(o, concat([ addClass(
|
|
1248
|
+
} else if (e) {
|
|
1249
|
+
const [t, n] = e(i, onSizeChangedCallbackProxy, s);
|
|
1250
|
+
push(o, concat([ addClass(l, st), addEventListener(l, "animationstart", t) ], n));
|
|
1211
1251
|
} else {
|
|
1212
|
-
return noop;
|
|
1252
|
+
return noop$1;
|
|
1213
1253
|
}
|
|
1214
|
-
|
|
1215
|
-
const [t] = createCache({
|
|
1216
|
-
o: void 0
|
|
1217
|
-
}, i);
|
|
1218
|
-
push(o, addEventListener(f, "scroll", (n => {
|
|
1219
|
-
const o = t();
|
|
1220
|
-
const [s, e, c] = o;
|
|
1221
|
-
if (e) {
|
|
1222
|
-
removeClass(d, "ltr rtl");
|
|
1223
|
-
addClass(d, s ? "rtl" : "ltr");
|
|
1224
|
-
onSizeChangedCallbackProxy([ !!s, e, c ]);
|
|
1225
|
-
}
|
|
1226
|
-
stopPropagation(n);
|
|
1227
|
-
})));
|
|
1228
|
-
}
|
|
1229
|
-
return bind(runEachAndClear, push(o, appendChildren(t, f)));
|
|
1254
|
+
return bind(runEachAndClear, push(o, appendChildren(t, l)));
|
|
1230
1255
|
};
|
|
1231
1256
|
};
|
|
1232
1257
|
|
|
1233
1258
|
const createTrinsicObserver = (t, n) => {
|
|
1234
1259
|
let o;
|
|
1235
1260
|
const isHeightIntrinsic = t => t.h === 0 || t.isIntersecting || t.intersectionRatio > 0;
|
|
1236
|
-
const s = createDiv(
|
|
1261
|
+
const s = createDiv(it);
|
|
1237
1262
|
const [e] = createCache({
|
|
1238
1263
|
o: false
|
|
1239
1264
|
});
|
|
@@ -1247,8 +1272,8 @@ const createTrinsicObserver = (t, n) => {
|
|
|
1247
1272
|
const intersectionObserverCallback = (t, n) => triggerOnTrinsicChangedCallback(n.pop(), t);
|
|
1248
1273
|
return [ () => {
|
|
1249
1274
|
const n = [];
|
|
1250
|
-
if (
|
|
1251
|
-
o = new
|
|
1275
|
+
if (d) {
|
|
1276
|
+
o = new d(bind(intersectionObserverCallback, false), {
|
|
1252
1277
|
root: t
|
|
1253
1278
|
});
|
|
1254
1279
|
o.observe(s);
|
|
@@ -1274,50 +1299,48 @@ const createObserversSetup = (t, n, o, s) => {
|
|
|
1274
1299
|
let l;
|
|
1275
1300
|
let i;
|
|
1276
1301
|
let a;
|
|
1277
|
-
const
|
|
1278
|
-
const
|
|
1279
|
-
const d =
|
|
1280
|
-
const
|
|
1281
|
-
const
|
|
1282
|
-
const
|
|
1283
|
-
const
|
|
1284
|
-
const
|
|
1302
|
+
const u = `[${F}]`;
|
|
1303
|
+
const _ = `[${X}]`;
|
|
1304
|
+
const d = [];
|
|
1305
|
+
const p = [ "wrap", "cols", "rows" ];
|
|
1306
|
+
const v = [ "id", "class", "style", "open" ];
|
|
1307
|
+
const {vt: h, ht: g, ot: b, gt: w, bt: y, wt: m, nt: S, yt: O, St: $, Ot: C} = t;
|
|
1308
|
+
const getDirectionIsRTL = t => getStyles(t, "direction") === "rtl";
|
|
1309
|
+
const x = {
|
|
1285
1310
|
$t: false,
|
|
1286
|
-
|
|
1311
|
+
ct: getDirectionIsRTL(h)
|
|
1287
1312
|
};
|
|
1288
|
-
const
|
|
1289
|
-
const
|
|
1290
|
-
const [
|
|
1291
|
-
|
|
1313
|
+
const H = getEnvironment();
|
|
1314
|
+
const E = getStaticPluginModuleInstance(Tt);
|
|
1315
|
+
const [z] = createCache({
|
|
1316
|
+
i: equalWH,
|
|
1292
1317
|
o: {
|
|
1293
1318
|
w: 0,
|
|
1294
1319
|
h: 0
|
|
1295
1320
|
}
|
|
1296
1321
|
}, (() => {
|
|
1297
|
-
const s =
|
|
1298
|
-
const e = O
|
|
1299
|
-
const c = !
|
|
1300
|
-
const r =
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
const
|
|
1304
|
-
const
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
l && l();
|
|
1310
|
-
scrollElementTo(w, r);
|
|
1322
|
+
const s = E && E.tt(t, n, x, H, o).ut;
|
|
1323
|
+
const e = O && S;
|
|
1324
|
+
const c = !e && hasAttrClass(g, F, q);
|
|
1325
|
+
const r = !S && $(J);
|
|
1326
|
+
const l = r && getElementScroll(w);
|
|
1327
|
+
const i = C(K, c);
|
|
1328
|
+
const a = r && s && s()[0];
|
|
1329
|
+
const u = R(b);
|
|
1330
|
+
const _ = getFractionalSize(b);
|
|
1331
|
+
a && a();
|
|
1332
|
+
scrollElementTo(w, l);
|
|
1333
|
+
c && i();
|
|
1311
1334
|
return {
|
|
1312
|
-
w:
|
|
1313
|
-
h:
|
|
1335
|
+
w: u.w + _.w,
|
|
1336
|
+
h: u.h + _.h
|
|
1314
1337
|
};
|
|
1315
1338
|
}));
|
|
1316
|
-
const
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1339
|
+
const I = m ? p : concat(v, p);
|
|
1340
|
+
const A = debounce(s, {
|
|
1341
|
+
_: () => e,
|
|
1319
1342
|
p: () => c,
|
|
1320
|
-
|
|
1343
|
+
m(t, n) {
|
|
1321
1344
|
const [o] = t;
|
|
1322
1345
|
const [s] = n;
|
|
1323
1346
|
return [ concat(keys(o), keys(s)).reduce(((t, n) => {
|
|
@@ -1326,108 +1349,95 @@ const createObserversSetup = (t, n, o, s) => {
|
|
|
1326
1349
|
}), {}) ];
|
|
1327
1350
|
}
|
|
1328
1351
|
});
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
a = n;
|
|
1339
|
-
}
|
|
1340
|
-
};
|
|
1341
|
-
const updateViewportAttrsFromHost = t => {
|
|
1342
|
-
each(t || v, (t => {
|
|
1343
|
-
if (inArray(v, t)) {
|
|
1344
|
-
const n = getAttr(b, t);
|
|
1345
|
-
if (isString(n)) {
|
|
1346
|
-
setAttrs(w, t, n);
|
|
1347
|
-
} else {
|
|
1348
|
-
removeAttrs(w, t);
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
}));
|
|
1352
|
+
const setDirection = t => {
|
|
1353
|
+
const n = getDirectionIsRTL(h);
|
|
1354
|
+
assignDeep(t, {
|
|
1355
|
+
Ct: a !== n
|
|
1356
|
+
});
|
|
1357
|
+
assignDeep(x, {
|
|
1358
|
+
ct: n
|
|
1359
|
+
});
|
|
1360
|
+
a = n;
|
|
1352
1361
|
};
|
|
1353
1362
|
const onTrinsicChanged = (t, n) => {
|
|
1354
1363
|
const [o, e] = t;
|
|
1355
1364
|
const c = {
|
|
1356
1365
|
xt: e
|
|
1357
1366
|
};
|
|
1358
|
-
assignDeep(
|
|
1367
|
+
assignDeep(x, {
|
|
1359
1368
|
$t: o
|
|
1360
1369
|
});
|
|
1361
1370
|
!n && s(c);
|
|
1362
1371
|
return c;
|
|
1363
1372
|
};
|
|
1364
|
-
const onSizeChanged = ({
|
|
1365
|
-
const
|
|
1366
|
-
const
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
dt: o,
|
|
1371
|
-
Ct: l
|
|
1373
|
+
const onSizeChanged = ({ft: t, dt: n}) => {
|
|
1374
|
+
const o = t && !n;
|
|
1375
|
+
const e = !o && H.R ? A : s;
|
|
1376
|
+
const c = {
|
|
1377
|
+
ft: t || n,
|
|
1378
|
+
dt: n
|
|
1372
1379
|
};
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
N: r
|
|
1376
|
-
});
|
|
1377
|
-
c(i);
|
|
1380
|
+
setDirection(c);
|
|
1381
|
+
e(c);
|
|
1378
1382
|
};
|
|
1379
1383
|
const onContentMutation = (t, n) => {
|
|
1380
|
-
const [, o] =
|
|
1384
|
+
const [, o] = z();
|
|
1381
1385
|
const e = {
|
|
1382
1386
|
Ht: o
|
|
1383
1387
|
};
|
|
1384
|
-
|
|
1385
|
-
const c = t ? s :
|
|
1388
|
+
setDirection(e);
|
|
1389
|
+
const c = t ? s : A;
|
|
1386
1390
|
o && !n && c(e);
|
|
1387
1391
|
return e;
|
|
1388
1392
|
};
|
|
1389
1393
|
const onHostMutation = (t, n, o) => {
|
|
1390
1394
|
const s = {
|
|
1391
|
-
|
|
1395
|
+
Et: n
|
|
1392
1396
|
};
|
|
1393
|
-
|
|
1397
|
+
setDirection(s);
|
|
1394
1398
|
if (n && !o) {
|
|
1395
|
-
|
|
1396
|
-
} else if (!m) {
|
|
1397
|
-
updateViewportAttrsFromHost(t);
|
|
1399
|
+
A(s);
|
|
1398
1400
|
}
|
|
1399
1401
|
return s;
|
|
1400
1402
|
};
|
|
1401
|
-
const
|
|
1402
|
-
const
|
|
1403
|
-
|
|
1404
|
-
dt: true,
|
|
1405
|
-
_t: true
|
|
1403
|
+
const [T, D] = y ? createTrinsicObserver(g, onTrinsicChanged) : [];
|
|
1404
|
+
const k = !S && createSizeObserver(g, onSizeChanged, {
|
|
1405
|
+
dt: true
|
|
1406
1406
|
});
|
|
1407
|
-
const [
|
|
1408
|
-
|
|
1409
|
-
|
|
1407
|
+
const [M, V] = createDOMObserver(g, false, onHostMutation, {
|
|
1408
|
+
X: v,
|
|
1409
|
+
j: concat(v, d)
|
|
1410
1410
|
});
|
|
1411
|
-
const L =
|
|
1411
|
+
const L = S && f && new f((t => {
|
|
1412
1412
|
const n = t[t.length - 1].contentRect;
|
|
1413
1413
|
onSizeChanged({
|
|
1414
|
-
|
|
1414
|
+
ft: true,
|
|
1415
1415
|
dt: domRectAppeared(n, i)
|
|
1416
1416
|
});
|
|
1417
1417
|
i = n;
|
|
1418
1418
|
}));
|
|
1419
|
+
const P = debounce((() => {
|
|
1420
|
+
const [, t] = z();
|
|
1421
|
+
s({
|
|
1422
|
+
Ht: t
|
|
1423
|
+
});
|
|
1424
|
+
}), {
|
|
1425
|
+
_: 222,
|
|
1426
|
+
v: true
|
|
1427
|
+
});
|
|
1419
1428
|
return [ () => {
|
|
1420
|
-
|
|
1421
|
-
L && L.observe(b);
|
|
1429
|
+
L && L.observe(g);
|
|
1422
1430
|
const t = k && k();
|
|
1423
1431
|
const n = T && T();
|
|
1424
|
-
const o =
|
|
1425
|
-
const s =
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
}
|
|
1432
|
+
const o = M();
|
|
1433
|
+
const s = H.L((t => {
|
|
1434
|
+
if (t) {
|
|
1435
|
+
A({
|
|
1436
|
+
zt: t
|
|
1437
|
+
});
|
|
1438
|
+
} else {
|
|
1439
|
+
P();
|
|
1440
|
+
}
|
|
1431
1441
|
}));
|
|
1432
1442
|
return () => {
|
|
1433
1443
|
L && L.disconnect();
|
|
@@ -1437,115 +1447,117 @@ const createObserversSetup = (t, n, o, s) => {
|
|
|
1437
1447
|
o();
|
|
1438
1448
|
s();
|
|
1439
1449
|
};
|
|
1440
|
-
}, ({
|
|
1450
|
+
}, ({It: t, At: n, Tt: o}) => {
|
|
1441
1451
|
const s = {};
|
|
1442
1452
|
const [i] = t("update.ignoreMutation");
|
|
1443
|
-
const [a,
|
|
1444
|
-
const [
|
|
1445
|
-
const [
|
|
1446
|
-
const g =
|
|
1447
|
-
const
|
|
1453
|
+
const [a, d] = t("update.attributes");
|
|
1454
|
+
const [f, p] = t("update.elementEvents");
|
|
1455
|
+
const [v, h] = t("update.debounce");
|
|
1456
|
+
const g = p || d;
|
|
1457
|
+
const w = n || o;
|
|
1448
1458
|
const ignoreMutationFromOptions = t => isFunction(i) && i(t);
|
|
1449
1459
|
if (g) {
|
|
1450
1460
|
r && r();
|
|
1451
1461
|
l && l();
|
|
1452
|
-
const [t, n] = createDOMObserver(
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1462
|
+
const [t, n] = createDOMObserver(y || b, true, onContentMutation, {
|
|
1463
|
+
j: concat(I, a || []),
|
|
1464
|
+
Y: f,
|
|
1465
|
+
W: u,
|
|
1466
|
+
K: (t, n) => {
|
|
1457
1467
|
const {target: o, attributeName: s} = t;
|
|
1458
|
-
const e = !n && s && !
|
|
1459
|
-
return e || !!closest(o, `.${
|
|
1468
|
+
const e = !n && s && !S ? liesBetween(o, u, _) : false;
|
|
1469
|
+
return e || !!closest(o, `.${ut}`) || !!ignoreMutationFromOptions(t);
|
|
1460
1470
|
}
|
|
1461
1471
|
});
|
|
1462
1472
|
l = t();
|
|
1463
1473
|
r = n;
|
|
1464
1474
|
}
|
|
1465
|
-
if (
|
|
1466
|
-
|
|
1467
|
-
if (isArray(
|
|
1468
|
-
const t =
|
|
1469
|
-
const n =
|
|
1470
|
-
e = isNumber(t) && t;
|
|
1471
|
-
c = isNumber(n) && n;
|
|
1472
|
-
} else if (isNumber(
|
|
1473
|
-
e =
|
|
1475
|
+
if (h) {
|
|
1476
|
+
A.S();
|
|
1477
|
+
if (isArray(v)) {
|
|
1478
|
+
const t = v[0];
|
|
1479
|
+
const n = v[1];
|
|
1480
|
+
e = isNumber$1(t) && t;
|
|
1481
|
+
c = isNumber$1(n) && n;
|
|
1482
|
+
} else if (isNumber$1(v)) {
|
|
1483
|
+
e = v;
|
|
1474
1484
|
c = false;
|
|
1475
1485
|
} else {
|
|
1476
1486
|
e = false;
|
|
1477
1487
|
c = false;
|
|
1478
1488
|
}
|
|
1479
1489
|
}
|
|
1480
|
-
if (
|
|
1490
|
+
if (w) {
|
|
1481
1491
|
const t = V();
|
|
1482
1492
|
const n = D && D();
|
|
1483
1493
|
const o = r && r();
|
|
1484
|
-
t && assignDeep(s, onHostMutation(t[0], t[1],
|
|
1485
|
-
n && assignDeep(s, onTrinsicChanged(n[0],
|
|
1486
|
-
o && assignDeep(s, onContentMutation(o[0],
|
|
1494
|
+
t && assignDeep(s, onHostMutation(t[0], t[1], w));
|
|
1495
|
+
n && assignDeep(s, onTrinsicChanged(n[0], w));
|
|
1496
|
+
o && assignDeep(s, onContentMutation(o[0], w));
|
|
1487
1497
|
}
|
|
1488
|
-
|
|
1498
|
+
setDirection(s);
|
|
1489
1499
|
return s;
|
|
1490
|
-
},
|
|
1500
|
+
}, x ];
|
|
1491
1501
|
};
|
|
1492
1502
|
|
|
1493
1503
|
const createScrollbarsSetupElements = (t, n, o, s) => {
|
|
1494
|
-
const {
|
|
1495
|
-
const {scrollbars:
|
|
1496
|
-
const {slot:
|
|
1497
|
-
const {
|
|
1498
|
-
const {scrollbars:
|
|
1499
|
-
const {slot:
|
|
1500
|
-
const
|
|
1501
|
-
const initScrollTimeline = t =>
|
|
1504
|
+
const {P: e} = getEnvironment();
|
|
1505
|
+
const {scrollbars: c} = e();
|
|
1506
|
+
const {slot: r} = c;
|
|
1507
|
+
const {vt: l, ht: i, ot: a, Dt: u, gt: _, yt: d, nt: f} = n;
|
|
1508
|
+
const {scrollbars: v} = u ? {} : t;
|
|
1509
|
+
const {slot: h} = v || {};
|
|
1510
|
+
const g = new Map;
|
|
1511
|
+
const initScrollTimeline = t => p && new p({
|
|
1502
1512
|
source: _,
|
|
1503
1513
|
axis: t
|
|
1504
1514
|
});
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1507
|
-
|
|
1515
|
+
const b = {
|
|
1516
|
+
x: initScrollTimeline("x"),
|
|
1517
|
+
y: initScrollTimeline("y")
|
|
1518
|
+
};
|
|
1519
|
+
const w = dynamicInitializationElement([ l, i, a ], (() => f && d ? l : i), r, h);
|
|
1508
1520
|
const getScrollbarHandleLengthRatio = (t, n) => {
|
|
1509
1521
|
if (n) {
|
|
1510
|
-
const o = t ? H :
|
|
1511
|
-
const {
|
|
1522
|
+
const o = t ? H : E;
|
|
1523
|
+
const {kt: s, Mt: e} = n;
|
|
1512
1524
|
const c = getBoundingClientRect(e)[o];
|
|
1513
1525
|
const r = getBoundingClientRect(s)[o];
|
|
1514
1526
|
return capNumber(0, 1, c / r || 0);
|
|
1515
1527
|
}
|
|
1516
1528
|
const s = t ? "x" : "y";
|
|
1517
|
-
const {
|
|
1529
|
+
const {Rt: e, Vt: c} = o;
|
|
1518
1530
|
const r = c[s];
|
|
1519
1531
|
const l = e[s];
|
|
1520
1532
|
return capNumber(0, 1, r / (r + l) || 0);
|
|
1521
1533
|
};
|
|
1522
|
-
const getScrollbarHandleOffsetRatio = (t, n, o
|
|
1523
|
-
const
|
|
1524
|
-
return 1 /
|
|
1534
|
+
const getScrollbarHandleOffsetRatio = (t, n, o) => {
|
|
1535
|
+
const s = getScrollbarHandleLengthRatio(o, t);
|
|
1536
|
+
return 1 / s * (1 - s) * n;
|
|
1525
1537
|
};
|
|
1526
|
-
const addDirectionRTLKeyframes =
|
|
1538
|
+
const addDirectionRTLKeyframes = t => assignDeep(t, {
|
|
1527
1539
|
clear: [ "left" ]
|
|
1528
|
-
}
|
|
1540
|
+
});
|
|
1529
1541
|
const cancelElementAnimations = t => {
|
|
1530
|
-
|
|
1542
|
+
g.forEach(((n, o) => {
|
|
1531
1543
|
const s = t ? inArray(createOrKeepArray(t), o) : true;
|
|
1532
1544
|
if (s) {
|
|
1533
1545
|
each(n || [], (t => {
|
|
1534
1546
|
t && t.cancel();
|
|
1535
1547
|
}));
|
|
1536
|
-
|
|
1548
|
+
g.delete(o);
|
|
1537
1549
|
}
|
|
1538
1550
|
}));
|
|
1539
1551
|
};
|
|
1540
1552
|
const setElementAnimation = (t, n, o, s) => {
|
|
1541
|
-
const e =
|
|
1553
|
+
const e = g.get(t) || [];
|
|
1542
1554
|
const c = e.find((t => t && t.timeline === n));
|
|
1543
1555
|
if (c) {
|
|
1544
1556
|
c.effect = new KeyframeEffect(t, o, {
|
|
1545
1557
|
composite: s
|
|
1546
1558
|
});
|
|
1547
1559
|
} else {
|
|
1548
|
-
|
|
1560
|
+
g.set(t, concat(e, [ t.animate(o, {
|
|
1549
1561
|
timeline: n,
|
|
1550
1562
|
composite: s
|
|
1551
1563
|
}) ]));
|
|
@@ -1554,7 +1566,7 @@ const createScrollbarsSetupElements = (t, n, o, s) => {
|
|
|
1554
1566
|
const scrollbarStructureAddRemoveClass = (t, n, o) => {
|
|
1555
1567
|
const s = o ? addClass : removeClass;
|
|
1556
1568
|
each(t, (t => {
|
|
1557
|
-
s(t.
|
|
1569
|
+
s(t.Lt, n);
|
|
1558
1570
|
}));
|
|
1559
1571
|
};
|
|
1560
1572
|
const scrollbarStyle = (t, n) => {
|
|
@@ -1565,250 +1577,270 @@ const createScrollbarsSetupElements = (t, n, o, s) => {
|
|
|
1565
1577
|
};
|
|
1566
1578
|
const scrollbarStructureRefreshHandleLength = (t, n) => {
|
|
1567
1579
|
scrollbarStyle(t, (t => {
|
|
1568
|
-
const {
|
|
1580
|
+
const {Mt: o} = t;
|
|
1569
1581
|
return [ o, {
|
|
1570
|
-
[n ? H :
|
|
1582
|
+
[n ? H : E]: ratioToCssPercent(getScrollbarHandleLengthRatio(n))
|
|
1571
1583
|
} ];
|
|
1572
1584
|
}));
|
|
1573
1585
|
};
|
|
1574
1586
|
const scrollbarStructureRefreshHandleOffset = (t, n) => {
|
|
1575
|
-
const {
|
|
1576
|
-
const e = n ?
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1587
|
+
const {Pt: s} = o;
|
|
1588
|
+
const e = n ? "x" : "y";
|
|
1589
|
+
const c = b[e];
|
|
1590
|
+
const r = isDefaultDirectionScrollCoordinates(s)[e];
|
|
1591
|
+
const getAxisTransformValue = (t, o) => getTrasformTranslateValue(ratioToCssPercent(getScrollbarHandleOffsetRatio(t, r ? o : 1 - o, n)), n);
|
|
1592
|
+
if (c) {
|
|
1579
1593
|
each(t, (t => {
|
|
1580
|
-
const {
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
}, r));
|
|
1594
|
+
const {Mt: n} = t;
|
|
1595
|
+
setElementAnimation(n, c, addDirectionRTLKeyframes({
|
|
1596
|
+
transform: [ 0, 1 ].map((n => getAxisTransformValue(t, n)))
|
|
1597
|
+
}));
|
|
1585
1598
|
}));
|
|
1586
1599
|
} else {
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
return [ s, {
|
|
1591
|
-
transform: getTransformValue(t, n ? o.x : o.y, n && getDirectionIsRTL(e) && c)
|
|
1592
|
-
} ];
|
|
1593
|
-
}));
|
|
1600
|
+
scrollbarStyle(t, (t => [ t.Mt, {
|
|
1601
|
+
transform: getAxisTransformValue(t, getScrollCoordinatesPercent(s, getElementScroll(_))[e])
|
|
1602
|
+
} ]));
|
|
1594
1603
|
}
|
|
1595
1604
|
};
|
|
1596
|
-
const doRefreshScrollbarOffset = t =>
|
|
1605
|
+
const doRefreshScrollbarOffset = t => f && !d && parent(t) === a;
|
|
1606
|
+
const y = [];
|
|
1597
1607
|
const m = [];
|
|
1598
|
-
const
|
|
1599
|
-
const $ = [];
|
|
1608
|
+
const S = [];
|
|
1600
1609
|
const scrollbarsAddRemoveClass = (t, n, o) => {
|
|
1601
1610
|
const s = isBoolean(o);
|
|
1602
1611
|
const e = s ? o : true;
|
|
1603
1612
|
const c = s ? !o : true;
|
|
1604
|
-
e && scrollbarStructureAddRemoveClass(
|
|
1605
|
-
c && scrollbarStructureAddRemoveClass(
|
|
1613
|
+
e && scrollbarStructureAddRemoveClass(m, t, n);
|
|
1614
|
+
c && scrollbarStructureAddRemoveClass(S, t, n);
|
|
1606
1615
|
};
|
|
1607
1616
|
const refreshScrollbarsHandleLength = () => {
|
|
1608
|
-
scrollbarStructureRefreshHandleLength(
|
|
1609
|
-
scrollbarStructureRefreshHandleLength(
|
|
1617
|
+
scrollbarStructureRefreshHandleLength(m, true);
|
|
1618
|
+
scrollbarStructureRefreshHandleLength(S);
|
|
1610
1619
|
};
|
|
1611
1620
|
const refreshScrollbarsHandleOffset = () => {
|
|
1612
|
-
scrollbarStructureRefreshHandleOffset(
|
|
1613
|
-
scrollbarStructureRefreshHandleOffset(
|
|
1621
|
+
scrollbarStructureRefreshHandleOffset(m, true);
|
|
1622
|
+
scrollbarStructureRefreshHandleOffset(S);
|
|
1614
1623
|
};
|
|
1615
1624
|
const refreshScrollbarsScrollbarOffset = () => {
|
|
1616
|
-
if (
|
|
1617
|
-
const {
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
setScrollbarElementAnimation(w, t.x, true);
|
|
1629
|
-
setScrollbarElementAnimation(S, t.y);
|
|
1625
|
+
if (f) {
|
|
1626
|
+
const {Rt: t, Pt: n} = o;
|
|
1627
|
+
const s = isDefaultDirectionScrollCoordinates(n);
|
|
1628
|
+
const e = .5;
|
|
1629
|
+
if (b.x && b.y) {
|
|
1630
|
+
each(concat(S, m), (({Lt: n}) => {
|
|
1631
|
+
if (doRefreshScrollbarOffset(n)) {
|
|
1632
|
+
const setScrollbarElementAnimation = o => setElementAnimation(n, b[o], addDirectionRTLKeyframes({
|
|
1633
|
+
transform: [ 0, s[o] ? 1 : -1 ].map((n => getTrasformTranslateValue(numberToCssPx(n * (t[o] - e)), o === "x")))
|
|
1634
|
+
}), "add");
|
|
1635
|
+
setScrollbarElementAnimation("x");
|
|
1636
|
+
setScrollbarElementAnimation("y");
|
|
1630
1637
|
} else {
|
|
1631
|
-
cancelElementAnimations(
|
|
1638
|
+
cancelElementAnimations(n);
|
|
1632
1639
|
}
|
|
1633
1640
|
}));
|
|
1634
1641
|
} else {
|
|
1635
|
-
const
|
|
1636
|
-
const styleScrollbarPosition =
|
|
1637
|
-
const {
|
|
1638
|
-
const
|
|
1642
|
+
const o = getScrollCoordinatesPercent(n, getElementScroll(_));
|
|
1643
|
+
const styleScrollbarPosition = n => {
|
|
1644
|
+
const {Lt: e} = n;
|
|
1645
|
+
const c = doRefreshScrollbarOffset(e) && e;
|
|
1639
1646
|
const getTranslateValue = (t, n, o) => {
|
|
1640
|
-
const s =
|
|
1641
|
-
|
|
1642
|
-
return numberToCssPx(o ? -e : e);
|
|
1647
|
+
const s = n * t;
|
|
1648
|
+
return numberToCssPx(o ? s : -s);
|
|
1643
1649
|
};
|
|
1644
|
-
return [
|
|
1645
|
-
transform:
|
|
1646
|
-
x: getTranslateValue(
|
|
1647
|
-
y: getTranslateValue(
|
|
1648
|
-
})
|
|
1650
|
+
return [ c, c && {
|
|
1651
|
+
transform: getTrasformTranslateValue({
|
|
1652
|
+
x: getTranslateValue(o.x, t.x, s.x),
|
|
1653
|
+
y: getTranslateValue(o.y, t.y, s.y)
|
|
1654
|
+
})
|
|
1649
1655
|
} ];
|
|
1650
1656
|
};
|
|
1651
|
-
scrollbarStyle(
|
|
1652
|
-
scrollbarStyle(
|
|
1657
|
+
scrollbarStyle(m, styleScrollbarPosition);
|
|
1658
|
+
scrollbarStyle(S, styleScrollbarPosition);
|
|
1653
1659
|
}
|
|
1654
1660
|
}
|
|
1655
1661
|
};
|
|
1656
1662
|
const generateScrollbarDOM = t => {
|
|
1657
|
-
const n = t ? dt :
|
|
1658
|
-
const o = createDiv(`${
|
|
1659
|
-
const e = createDiv(
|
|
1660
|
-
const c = createDiv(
|
|
1663
|
+
const n = t ? dt : ft;
|
|
1664
|
+
const o = createDiv(`${ut} ${n}`);
|
|
1665
|
+
const e = createDiv(pt);
|
|
1666
|
+
const c = createDiv(vt);
|
|
1661
1667
|
const r = {
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1668
|
+
Lt: o,
|
|
1669
|
+
kt: e,
|
|
1670
|
+
Mt: c
|
|
1665
1671
|
};
|
|
1666
|
-
push(t ?
|
|
1667
|
-
push(
|
|
1672
|
+
push(t ? m : S, r);
|
|
1673
|
+
push(y, [ appendChildren(o, e), appendChildren(e, c), bind(removeElements, o), cancelElementAnimations, s(r, scrollbarsAddRemoveClass, scrollbarStructureRefreshHandleOffset, t) ]);
|
|
1668
1674
|
return r;
|
|
1669
1675
|
};
|
|
1670
|
-
const
|
|
1671
|
-
const
|
|
1676
|
+
const O = bind(generateScrollbarDOM, true);
|
|
1677
|
+
const $ = bind(generateScrollbarDOM, false);
|
|
1672
1678
|
const appendElements = () => {
|
|
1673
|
-
appendChildren(
|
|
1674
|
-
appendChildren(
|
|
1675
|
-
return bind(runEachAndClear,
|
|
1679
|
+
appendChildren(w, m[0].Lt);
|
|
1680
|
+
appendChildren(w, S[0].Lt);
|
|
1681
|
+
return bind(runEachAndClear, y);
|
|
1676
1682
|
};
|
|
1677
|
-
|
|
1678
|
-
|
|
1683
|
+
O();
|
|
1684
|
+
$();
|
|
1679
1685
|
return [ {
|
|
1680
|
-
|
|
1686
|
+
Ut: refreshScrollbarsHandleLength,
|
|
1681
1687
|
Nt: refreshScrollbarsHandleOffset,
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
Xt:
|
|
1688
|
-
Yt: bind(scrollbarStyle,
|
|
1688
|
+
qt: refreshScrollbarsScrollbarOffset,
|
|
1689
|
+
Bt: scrollbarsAddRemoveClass,
|
|
1690
|
+
Ft: {
|
|
1691
|
+
V: b.x,
|
|
1692
|
+
jt: m,
|
|
1693
|
+
Xt: O,
|
|
1694
|
+
Yt: bind(scrollbarStyle, m)
|
|
1689
1695
|
},
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
Xt:
|
|
1694
|
-
Yt: bind(scrollbarStyle,
|
|
1696
|
+
Wt: {
|
|
1697
|
+
V: b.y,
|
|
1698
|
+
jt: S,
|
|
1699
|
+
Xt: $,
|
|
1700
|
+
Yt: bind(scrollbarStyle, S)
|
|
1695
1701
|
}
|
|
1696
1702
|
}, appendElements ];
|
|
1697
1703
|
};
|
|
1698
1704
|
|
|
1699
|
-
const createScrollbarsSetupEvents = (t, n, o) => {
|
|
1700
|
-
const {
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1705
|
+
const createScrollbarsSetupEvents = (t, n, o, s) => (r, l, i, u) => {
|
|
1706
|
+
const {ht: _, ot: d, nt: f, gt: p, Jt: v, Ot: h} = n;
|
|
1707
|
+
const {Lt: g, kt: b, Mt: w} = r;
|
|
1708
|
+
const [y, m] = selfClearTimeout(333);
|
|
1709
|
+
const [S, O] = selfClearTimeout(444);
|
|
1710
|
+
const [$, C] = selfClearTimeout();
|
|
1711
|
+
const x = bind(i, [ r ], u);
|
|
1712
|
+
const scrollOffsetElementScrollBy = t => {
|
|
1713
|
+
isFunction(p.scrollBy) && p.scrollBy({
|
|
1714
|
+
behavior: "smooth",
|
|
1715
|
+
left: t.x,
|
|
1716
|
+
top: t.y
|
|
1717
|
+
});
|
|
1718
|
+
};
|
|
1719
|
+
const z = u ? H : E;
|
|
1720
|
+
const createInteractiveScrollEvents = () => {
|
|
1721
|
+
const n = "pointerup pointercancel lostpointercapture";
|
|
1722
|
+
const s = `client${u ? "X" : "Y"}`;
|
|
1723
|
+
const r = u ? "left" : "top";
|
|
1724
|
+
const l = u ? "w" : "h";
|
|
1725
|
+
const i = u ? "x" : "y";
|
|
1726
|
+
const createRelativeHandleMove = (t, n) => s => {
|
|
1727
|
+
const {Rt: e} = o;
|
|
1728
|
+
const c = k(b)[l] - k(w)[l];
|
|
1729
|
+
const r = n * s / c;
|
|
1730
|
+
const a = r * e[i];
|
|
1731
|
+
scrollElementTo(p, {
|
|
1732
|
+
[i]: t + a
|
|
1733
|
+
});
|
|
1734
|
+
};
|
|
1735
|
+
return addEventListener(b, "pointerdown", (o => {
|
|
1736
|
+
const a = closest(o.target, `.${vt}`) === w;
|
|
1737
|
+
const u = a ? w : b;
|
|
1738
|
+
const _ = t.scrollbars;
|
|
1739
|
+
const {button: d, isPrimary: f, pointerType: g} = o;
|
|
1740
|
+
const {pointers: y} = _;
|
|
1741
|
+
const m = d === 0 && f && _[a ? "dragScroll" : "clickScroll"] && (y || []).includes(g);
|
|
1742
|
+
if (m) {
|
|
1743
|
+
O();
|
|
1744
|
+
const t = !a && o.shiftKey;
|
|
1745
|
+
const _ = bind(getBoundingClientRect, w);
|
|
1746
|
+
const d = bind(getBoundingClientRect, b);
|
|
1747
|
+
const getHandleOffset = (t, n) => (t || _())[r] - (n || d())[r];
|
|
1748
|
+
const f = e(getBoundingClientRect(p)[z]) / k(p)[l] || 1;
|
|
1749
|
+
const g = createRelativeHandleMove(getElementScroll(p)[i], 1 / f);
|
|
1750
|
+
const y = o[s];
|
|
1751
|
+
const m = _();
|
|
1752
|
+
const $ = d();
|
|
1753
|
+
const C = m[z];
|
|
1754
|
+
const x = getHandleOffset(m, $) + C / 2;
|
|
1755
|
+
const H = y - $[r];
|
|
1756
|
+
const E = a ? 0 : H - x;
|
|
1757
|
+
const releasePointerCapture = t => {
|
|
1758
|
+
runEachAndClear(A);
|
|
1759
|
+
u.releasePointerCapture(t.pointerId);
|
|
1760
|
+
};
|
|
1761
|
+
const addScrollbarPressedClass = () => h(Q, true);
|
|
1762
|
+
const I = addScrollbarPressedClass();
|
|
1763
|
+
const A = [ () => {
|
|
1764
|
+
const t = getElementScroll(p);
|
|
1765
|
+
I();
|
|
1766
|
+
const n = getElementScroll(p);
|
|
1767
|
+
const o = {
|
|
1768
|
+
x: n.x - t.x,
|
|
1769
|
+
y: n.y - t.y
|
|
1748
1770
|
};
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
if (t) {
|
|
1760
|
-
|
|
1761
|
-
} else if (!l) {
|
|
1762
|
-
const t = getStaticPluginModuleInstance(Dt);
|
|
1763
|
-
t && push(I, t(v, getHandleOffset, x, b, C));
|
|
1771
|
+
if (c(o.x) > 3 || c(o.y) > 3) {
|
|
1772
|
+
addScrollbarPressedClass();
|
|
1773
|
+
scrollElementTo(p, t);
|
|
1774
|
+
scrollOffsetElementScrollBy(o);
|
|
1775
|
+
S(I);
|
|
1776
|
+
}
|
|
1777
|
+
}, addEventListener(v, n, releasePointerCapture), addEventListener(v, "selectstart", (t => preventDefault(t)), {
|
|
1778
|
+
H: false
|
|
1779
|
+
}), addEventListener(b, n, releasePointerCapture), addEventListener(b, "pointermove", (n => {
|
|
1780
|
+
const o = n[s] - y;
|
|
1781
|
+
if (a || t) {
|
|
1782
|
+
g(E + o);
|
|
1764
1783
|
}
|
|
1784
|
+
})) ];
|
|
1785
|
+
u.setPointerCapture(o.pointerId);
|
|
1786
|
+
if (t) {
|
|
1787
|
+
g(E);
|
|
1788
|
+
} else if (!a) {
|
|
1789
|
+
const t = getStaticPluginModuleInstance(kt);
|
|
1790
|
+
t && push(A, t(g, getHandleOffset, E, C, H));
|
|
1765
1791
|
}
|
|
1766
|
-
}));
|
|
1767
|
-
};
|
|
1768
|
-
let $ = true;
|
|
1769
|
-
return bind(runEachAndClear, [ addEventListener(u, "pointerenter", (() => {
|
|
1770
|
-
l(wt, true);
|
|
1771
|
-
})), addEventListener(u, "pointerleave pointercancel", (() => {
|
|
1772
|
-
l(wt, false);
|
|
1773
|
-
})), addEventListener(u, "wheel", (t => {
|
|
1774
|
-
const {deltaX: n, deltaY: o, deltaMode: e} = t;
|
|
1775
|
-
if (b && $ && e === 0 && parent(u) === s) {
|
|
1776
|
-
c.scrollBy({
|
|
1777
|
-
left: n,
|
|
1778
|
-
top: o,
|
|
1779
|
-
behavior: "smooth"
|
|
1780
|
-
});
|
|
1781
|
-
}
|
|
1782
|
-
$ = false;
|
|
1783
|
-
l(Ot, true);
|
|
1784
|
-
d((() => {
|
|
1785
|
-
$ = true;
|
|
1786
|
-
l(Ot);
|
|
1787
|
-
}));
|
|
1788
|
-
preventDefault(t);
|
|
1789
|
-
}), {
|
|
1790
|
-
H: false,
|
|
1791
|
-
I: true
|
|
1792
|
-
}), addEventListener(_, "transitionstart", (t => {
|
|
1793
|
-
if (isAffectingTransition(t)) {
|
|
1794
|
-
const animateHandleOffset = () => {
|
|
1795
|
-
g();
|
|
1796
|
-
h(animateHandleOffset);
|
|
1797
|
-
};
|
|
1798
|
-
animateHandleOffset();
|
|
1799
1792
|
}
|
|
1800
|
-
}))
|
|
1801
|
-
if (isAffectingTransition(t)) {
|
|
1802
|
-
p();
|
|
1803
|
-
g();
|
|
1804
|
-
}
|
|
1805
|
-
})), addEventListener(u, "mousedown", bind(addEventListener, r, "click", stopPropagation, {
|
|
1806
|
-
A: true,
|
|
1807
|
-
I: true
|
|
1808
|
-
}), {
|
|
1809
|
-
I: true
|
|
1810
|
-
}), createInteractiveScrollEvents(), v, p ]);
|
|
1793
|
+
}));
|
|
1811
1794
|
};
|
|
1795
|
+
let I = true;
|
|
1796
|
+
const isAffectingTransition = t => t.propertyName.indexOf(z) > -1;
|
|
1797
|
+
return bind(runEachAndClear, [ addEventListener(w, "pointermove pointerleave", s), addEventListener(g, "pointerenter", (() => {
|
|
1798
|
+
l(bt, true);
|
|
1799
|
+
})), addEventListener(g, "pointerleave pointercancel", (() => {
|
|
1800
|
+
l(bt, false);
|
|
1801
|
+
})), !f && addEventListener(g, "mousedown", (() => {
|
|
1802
|
+
const t = getFocusedElement();
|
|
1803
|
+
if (hasAttr(t, X) || hasAttr(t, F) || t === document.body) {
|
|
1804
|
+
a(bind(focusElement, d), 25);
|
|
1805
|
+
}
|
|
1806
|
+
})), addEventListener(g, "wheel", (t => {
|
|
1807
|
+
const {deltaX: n, deltaY: o, deltaMode: s} = t;
|
|
1808
|
+
if (I && s === 0 && parent(g) === _) {
|
|
1809
|
+
scrollOffsetElementScrollBy({
|
|
1810
|
+
x: n,
|
|
1811
|
+
y: o
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
I = false;
|
|
1815
|
+
l(St, true);
|
|
1816
|
+
y((() => {
|
|
1817
|
+
I = true;
|
|
1818
|
+
l(St);
|
|
1819
|
+
}));
|
|
1820
|
+
preventDefault(t);
|
|
1821
|
+
}), {
|
|
1822
|
+
H: false,
|
|
1823
|
+
I: true
|
|
1824
|
+
}), addEventListener(w, "transitionstart", (t => {
|
|
1825
|
+
if (isAffectingTransition(t)) {
|
|
1826
|
+
const animateHandleOffset = () => {
|
|
1827
|
+
x();
|
|
1828
|
+
$(animateHandleOffset);
|
|
1829
|
+
};
|
|
1830
|
+
animateHandleOffset();
|
|
1831
|
+
}
|
|
1832
|
+
})), addEventListener(w, "transitionend transitioncancel", (t => {
|
|
1833
|
+
if (isAffectingTransition(t)) {
|
|
1834
|
+
C();
|
|
1835
|
+
x();
|
|
1836
|
+
}
|
|
1837
|
+
})), addEventListener(g, "pointerdown", bind(addEventListener, v, "click", stopAndPrevent, {
|
|
1838
|
+
A: true,
|
|
1839
|
+
I: true,
|
|
1840
|
+
H: false
|
|
1841
|
+
}), {
|
|
1842
|
+
I: true
|
|
1843
|
+
}), createInteractiveScrollEvents(), m, O, C ]);
|
|
1812
1844
|
};
|
|
1813
1845
|
|
|
1814
1846
|
const createScrollbarsSetup = (t, n, o, s, e, c) => {
|
|
@@ -1817,99 +1849,96 @@ const createScrollbarsSetup = (t, n, o, s, e, c) => {
|
|
|
1817
1849
|
let i;
|
|
1818
1850
|
let a;
|
|
1819
1851
|
let u;
|
|
1820
|
-
let
|
|
1821
|
-
let
|
|
1822
|
-
const
|
|
1823
|
-
const [
|
|
1852
|
+
let _ = noop$1;
|
|
1853
|
+
let d = 0;
|
|
1854
|
+
const isHoverablePointerType = t => t.pointerType === "mouse";
|
|
1855
|
+
const [f, p] = selfClearTimeout();
|
|
1856
|
+
const [v, h] = selfClearTimeout(100);
|
|
1824
1857
|
const [g, b] = selfClearTimeout(100);
|
|
1825
|
-
const [w,
|
|
1826
|
-
const [
|
|
1827
|
-
const
|
|
1828
|
-
const
|
|
1829
|
-
const {bt: H, Zt: I, Rt: z} = e;
|
|
1830
|
-
const {Ft: E, Bt: A, Nt: T, jt: D} = C;
|
|
1831
|
-
const manageAutoHideSuspension = t => {
|
|
1832
|
-
E(yt, t, true);
|
|
1833
|
-
E(yt, t, false);
|
|
1834
|
-
};
|
|
1858
|
+
const [w, y] = selfClearTimeout((() => d));
|
|
1859
|
+
const [m, S] = createScrollbarsSetupElements(t, e, s, createScrollbarsSetupEvents(n, e, s, (t => isHoverablePointerType(t) && manageScrollbarsAutoHideInstantInteraction())));
|
|
1860
|
+
const {ht: O, Kt: $, yt: C} = e;
|
|
1861
|
+
const {Bt: x, Ut: H, Nt: E, qt: I} = m;
|
|
1835
1862
|
const manageScrollbarsAutoHide = (t, n) => {
|
|
1836
|
-
|
|
1863
|
+
y();
|
|
1837
1864
|
if (t) {
|
|
1838
|
-
|
|
1865
|
+
x(mt);
|
|
1839
1866
|
} else {
|
|
1840
|
-
const t = bind(
|
|
1841
|
-
if (
|
|
1842
|
-
|
|
1867
|
+
const t = bind(x, mt, true);
|
|
1868
|
+
if (d > 0 && !n) {
|
|
1869
|
+
w(t);
|
|
1843
1870
|
} else {
|
|
1844
1871
|
t();
|
|
1845
1872
|
}
|
|
1846
1873
|
}
|
|
1847
1874
|
};
|
|
1848
|
-
const
|
|
1875
|
+
const manageScrollbarsAutoHideInstantInteraction = () => {
|
|
1876
|
+
if (i ? !r : !a) {
|
|
1877
|
+
manageScrollbarsAutoHide(true);
|
|
1878
|
+
v((() => {
|
|
1879
|
+
manageScrollbarsAutoHide(false);
|
|
1880
|
+
}));
|
|
1881
|
+
}
|
|
1882
|
+
};
|
|
1883
|
+
const manageAutoHideSuspension = t => {
|
|
1884
|
+
x(yt, t, true);
|
|
1885
|
+
x(yt, t, false);
|
|
1886
|
+
};
|
|
1849
1887
|
const onHostMouseEnter = t => {
|
|
1850
1888
|
if (isHoverablePointerType(t)) {
|
|
1851
|
-
|
|
1852
|
-
|
|
1889
|
+
r = i;
|
|
1890
|
+
i && manageScrollbarsAutoHide(true);
|
|
1853
1891
|
}
|
|
1854
1892
|
};
|
|
1855
|
-
const
|
|
1893
|
+
const T = [ y, h, b, p, () => _(), addEventListener(O, "pointerover", onHostMouseEnter, {
|
|
1856
1894
|
A: true
|
|
1857
|
-
}), addEventListener(
|
|
1895
|
+
}), addEventListener(O, "pointerenter", onHostMouseEnter), addEventListener(O, "pointerleave", (t => {
|
|
1858
1896
|
if (isHoverablePointerType(t)) {
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
}
|
|
1862
|
-
})), addEventListener(
|
|
1863
|
-
isHoverablePointerType(t) &&
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
}));
|
|
1869
|
-
}));
|
|
1870
|
-
})), addEventListener(I, "scroll", (t => {
|
|
1871
|
-
h((() => {
|
|
1872
|
-
T();
|
|
1873
|
-
i && manageScrollbarsAutoHide(true);
|
|
1874
|
-
g((() => {
|
|
1875
|
-
i && !a && manageScrollbarsAutoHide(false);
|
|
1876
|
-
}));
|
|
1897
|
+
r = false;
|
|
1898
|
+
i && manageScrollbarsAutoHide(false);
|
|
1899
|
+
}
|
|
1900
|
+
})), addEventListener(O, "pointermove", (t => {
|
|
1901
|
+
isHoverablePointerType(t) && l && manageScrollbarsAutoHideInstantInteraction();
|
|
1902
|
+
})), addEventListener($, "scroll", (t => {
|
|
1903
|
+
f((() => {
|
|
1904
|
+
E();
|
|
1905
|
+
manageScrollbarsAutoHideInstantInteraction();
|
|
1877
1906
|
}));
|
|
1878
1907
|
c(t);
|
|
1879
|
-
|
|
1908
|
+
I();
|
|
1880
1909
|
})) ];
|
|
1881
|
-
return [ () => bind(runEachAndClear, push(
|
|
1882
|
-
const {tn:
|
|
1883
|
-
const {Ct: h, dt:
|
|
1884
|
-
const {
|
|
1885
|
-
const {
|
|
1886
|
-
const {
|
|
1887
|
-
const [
|
|
1888
|
-
const [
|
|
1889
|
-
const [
|
|
1890
|
-
const [
|
|
1891
|
-
const [
|
|
1892
|
-
const [
|
|
1893
|
-
const [
|
|
1894
|
-
const [
|
|
1895
|
-
const [
|
|
1896
|
-
const
|
|
1897
|
-
const
|
|
1898
|
-
const
|
|
1899
|
-
const
|
|
1900
|
-
const
|
|
1910
|
+
return [ () => bind(runEachAndClear, push(T, S())), ({It: t, Tt: n, Gt: e, Qt: c}) => {
|
|
1911
|
+
const {Zt: r, tn: f, nn: p, sn: v} = c || {};
|
|
1912
|
+
const {Ct: h, dt: b} = e || {};
|
|
1913
|
+
const {ct: w} = o;
|
|
1914
|
+
const {M: y} = getEnvironment();
|
|
1915
|
+
const {G: m, en: S} = s;
|
|
1916
|
+
const [O, T] = t("showNativeOverlaidScrollbars");
|
|
1917
|
+
const [D, k] = t("scrollbars.theme");
|
|
1918
|
+
const [M, R] = t("scrollbars.visibility");
|
|
1919
|
+
const [V, L] = t("scrollbars.autoHide");
|
|
1920
|
+
const [P, U] = t("scrollbars.autoHideSuspend");
|
|
1921
|
+
const [N] = t("scrollbars.autoHideDelay");
|
|
1922
|
+
const [q, B] = t("scrollbars.dragScroll");
|
|
1923
|
+
const [F, j] = t("scrollbars.clickScroll");
|
|
1924
|
+
const [X, Y] = t("overflow");
|
|
1925
|
+
const W = b && !n;
|
|
1926
|
+
const J = S.x || S.y;
|
|
1927
|
+
const K = r || f || v || h || n;
|
|
1928
|
+
const G = p || R || Y;
|
|
1929
|
+
const Q = O && y.x && y.y;
|
|
1901
1930
|
const setScrollbarVisibility = (t, n, o) => {
|
|
1902
|
-
const s = t.includes(
|
|
1903
|
-
|
|
1931
|
+
const s = t.includes(A) && (M === z || M === "auto" && n === A);
|
|
1932
|
+
x(ht, s, o);
|
|
1904
1933
|
return s;
|
|
1905
1934
|
};
|
|
1906
|
-
|
|
1907
|
-
if (
|
|
1908
|
-
if (
|
|
1935
|
+
d = N;
|
|
1936
|
+
if (W) {
|
|
1937
|
+
if (P && J) {
|
|
1909
1938
|
manageAutoHideSuspension(false);
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1939
|
+
_();
|
|
1940
|
+
g((() => {
|
|
1941
|
+
_ = addEventListener($, "scroll", bind(manageAutoHideSuspension, true), {
|
|
1913
1942
|
A: true
|
|
1914
1943
|
});
|
|
1915
1944
|
}));
|
|
@@ -1917,373 +1946,403 @@ const createScrollbarsSetup = (t, n, o, s, e, c) => {
|
|
|
1917
1946
|
manageAutoHideSuspension(true);
|
|
1918
1947
|
}
|
|
1919
1948
|
}
|
|
1920
|
-
if (
|
|
1921
|
-
|
|
1949
|
+
if (T) {
|
|
1950
|
+
x(at, Q);
|
|
1922
1951
|
}
|
|
1923
|
-
if (
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
u =
|
|
1952
|
+
if (k) {
|
|
1953
|
+
x(u);
|
|
1954
|
+
x(D, true);
|
|
1955
|
+
u = D;
|
|
1927
1956
|
}
|
|
1928
|
-
if (
|
|
1957
|
+
if (U && !P) {
|
|
1929
1958
|
manageAutoHideSuspension(true);
|
|
1930
1959
|
}
|
|
1931
|
-
if (
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
manageScrollbarsAutoHide(
|
|
1960
|
+
if (L) {
|
|
1961
|
+
l = V === "move";
|
|
1962
|
+
i = V === "leave";
|
|
1963
|
+
a = V === "never";
|
|
1964
|
+
manageScrollbarsAutoHide(a, true);
|
|
1936
1965
|
}
|
|
1937
|
-
if (
|
|
1938
|
-
|
|
1966
|
+
if (B) {
|
|
1967
|
+
x($t, q);
|
|
1939
1968
|
}
|
|
1940
|
-
if (
|
|
1941
|
-
|
|
1969
|
+
if (j) {
|
|
1970
|
+
x(Ot, F);
|
|
1942
1971
|
}
|
|
1943
|
-
if (
|
|
1944
|
-
const t = setScrollbarVisibility(
|
|
1945
|
-
const n = setScrollbarVisibility(
|
|
1972
|
+
if (G) {
|
|
1973
|
+
const t = setScrollbarVisibility(X.x, m.x, true);
|
|
1974
|
+
const n = setScrollbarVisibility(X.y, m.y, false);
|
|
1946
1975
|
const o = t && n;
|
|
1947
|
-
|
|
1976
|
+
x(gt, !o);
|
|
1948
1977
|
}
|
|
1949
|
-
if (
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1978
|
+
if (K) {
|
|
1979
|
+
H();
|
|
1980
|
+
E();
|
|
1981
|
+
I();
|
|
1982
|
+
x(wt, !S.x, true);
|
|
1983
|
+
x(wt, !S.y, false);
|
|
1984
|
+
x(_t, w && !C);
|
|
1956
1985
|
}
|
|
1957
|
-
}, {},
|
|
1986
|
+
}, {}, m ];
|
|
1958
1987
|
};
|
|
1959
1988
|
|
|
1960
1989
|
const createStructureSetupElements = t => {
|
|
1961
|
-
const
|
|
1962
|
-
const {
|
|
1963
|
-
const {elements:
|
|
1964
|
-
const {host:
|
|
1965
|
-
const
|
|
1966
|
-
const
|
|
1967
|
-
const {elements:
|
|
1968
|
-
const {host:
|
|
1969
|
-
const
|
|
1970
|
-
const
|
|
1971
|
-
const
|
|
1972
|
-
const
|
|
1973
|
-
const
|
|
1974
|
-
const
|
|
1975
|
-
const
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
const
|
|
1982
|
-
const
|
|
1983
|
-
const
|
|
1984
|
-
const
|
|
1985
|
-
const
|
|
1986
|
-
const
|
|
1987
|
-
const
|
|
1988
|
-
const
|
|
1989
|
-
const
|
|
1990
|
-
const
|
|
1991
|
-
const
|
|
1992
|
-
const
|
|
1993
|
-
const
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
Ot: (t, n) => addRemoveAttrClass(V, z ? j : K, t, n)
|
|
2018
|
-
};
|
|
2019
|
-
const W = keys(B).reduce(((t, n) => {
|
|
2020
|
-
const o = B[n];
|
|
2021
|
-
return push(t, o && isHTMLElement(o) && !parent(o) ? o : false);
|
|
2022
|
-
}), []);
|
|
2023
|
-
const elementIsGenerated = t => t ? inArray(W, t) : null;
|
|
2024
|
-
const {gt: X, bt: Y, cn: Z, D: Q, wt: nt} = B;
|
|
2025
|
-
const st = [ () => {
|
|
2026
|
-
removeAttrs(Y, [ j, N ]);
|
|
2027
|
-
removeAttrs(X, N);
|
|
2028
|
-
if (S) {
|
|
2029
|
-
removeAttrs(w, [ N, j ]);
|
|
1990
|
+
const o = getEnvironment();
|
|
1991
|
+
const {P: s, R: e} = o;
|
|
1992
|
+
const {elements: c} = s();
|
|
1993
|
+
const {host: r, padding: l, viewport: i, content: a} = c;
|
|
1994
|
+
const u = isHTMLElement(t);
|
|
1995
|
+
const _ = u ? {} : t;
|
|
1996
|
+
const {elements: d} = _;
|
|
1997
|
+
const {host: f, padding: p, viewport: v, content: h} = d || {};
|
|
1998
|
+
const g = u ? t : _.target;
|
|
1999
|
+
const b = isBodyElement(g);
|
|
2000
|
+
const w = is(g, "textarea");
|
|
2001
|
+
const y = g.ownerDocument;
|
|
2002
|
+
const m = y.documentElement;
|
|
2003
|
+
const getDocumentWindow = () => y.defaultView || n;
|
|
2004
|
+
const S = bind(staticInitializationElement, [ g ]);
|
|
2005
|
+
const O = bind(dynamicInitializationElement, [ g ]);
|
|
2006
|
+
const $ = bind(createDiv, "");
|
|
2007
|
+
const C = bind(S, $, i);
|
|
2008
|
+
const x = bind(O, $, a);
|
|
2009
|
+
const H = C(v);
|
|
2010
|
+
const E = H === g;
|
|
2011
|
+
const z = E && b;
|
|
2012
|
+
const I = !E && x(h);
|
|
2013
|
+
const A = !E && H === I;
|
|
2014
|
+
const T = z ? m : H;
|
|
2015
|
+
const D = w ? S($, r, f) : g;
|
|
2016
|
+
const k = z ? T : D;
|
|
2017
|
+
const M = !E && O($, l, p);
|
|
2018
|
+
const R = !A && I;
|
|
2019
|
+
const V = [ R, T, M, k ].map((t => isHTMLElement(t) && !parent(t) && t));
|
|
2020
|
+
const elementIsGenerated = t => t && inArray(V, t);
|
|
2021
|
+
const L = elementIsGenerated(T) ? g : T;
|
|
2022
|
+
const P = {
|
|
2023
|
+
vt: g,
|
|
2024
|
+
ht: k,
|
|
2025
|
+
ot: T,
|
|
2026
|
+
cn: M,
|
|
2027
|
+
bt: R,
|
|
2028
|
+
gt: z ? m : T,
|
|
2029
|
+
Kt: z ? y : T,
|
|
2030
|
+
rn: b ? m : L,
|
|
2031
|
+
Jt: y,
|
|
2032
|
+
wt: w,
|
|
2033
|
+
yt: b,
|
|
2034
|
+
Dt: u,
|
|
2035
|
+
nt: E,
|
|
2036
|
+
ln: getDocumentWindow,
|
|
2037
|
+
St: t => hasAttrClass(T, X, t),
|
|
2038
|
+
Ot: (t, n) => addRemoveAttrClass(T, X, t, n)
|
|
2039
|
+
};
|
|
2040
|
+
const {vt: U, ht: q, cn: Y, ot: W, bt: J} = P;
|
|
2041
|
+
const K = [ () => {
|
|
2042
|
+
removeAttrs(q, [ F, N ]);
|
|
2043
|
+
removeAttrs(U, N);
|
|
2044
|
+
if (b) {
|
|
2045
|
+
removeAttrs(m, [ N, F ]);
|
|
2030
2046
|
}
|
|
2031
2047
|
} ];
|
|
2032
|
-
const
|
|
2033
|
-
let
|
|
2034
|
-
const
|
|
2035
|
-
const
|
|
2048
|
+
const Q = w && elementIsGenerated(q);
|
|
2049
|
+
let Z = w ? U : contents([ J, W, Y, q, U ].find((t => t && !elementIsGenerated(t))));
|
|
2050
|
+
const ot = z ? U : J || W;
|
|
2051
|
+
const st = bind(runEachAndClear, K);
|
|
2036
2052
|
const appendElements = () => {
|
|
2037
|
-
const t =
|
|
2053
|
+
const t = getDocumentWindow();
|
|
2054
|
+
const n = getFocusedElement();
|
|
2038
2055
|
const unwrap = t => {
|
|
2039
2056
|
appendChildren(parent(t), contents(t));
|
|
2040
2057
|
removeElements(t);
|
|
2041
2058
|
};
|
|
2042
|
-
const prepareWrapUnwrapFocus = t =>
|
|
2043
|
-
stopPropagation(t);
|
|
2044
|
-
t.stopImmediatePropagation();
|
|
2045
|
-
}), {
|
|
2059
|
+
const prepareWrapUnwrapFocus = t => addEventListener(t, "focusin focusout focus blur", stopAndPrevent, {
|
|
2046
2060
|
I: true,
|
|
2047
2061
|
H: false
|
|
2048
|
-
})
|
|
2049
|
-
const
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
setAttrs(
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
+
});
|
|
2063
|
+
const o = "tabindex";
|
|
2064
|
+
const s = getAttr(W, o);
|
|
2065
|
+
const c = prepareWrapUnwrapFocus(n);
|
|
2066
|
+
setAttrs(q, F, E ? "" : j);
|
|
2067
|
+
setAttrs(Y, tt, "");
|
|
2068
|
+
setAttrs(W, X, "");
|
|
2069
|
+
setAttrs(J, nt, "");
|
|
2070
|
+
if (!E) {
|
|
2071
|
+
setAttrs(W, o, s || "-1");
|
|
2072
|
+
b && setAttrs(m, B, "");
|
|
2073
|
+
}
|
|
2074
|
+
if (Q) {
|
|
2075
|
+
insertAfter(U, q);
|
|
2076
|
+
push(K, (() => {
|
|
2077
|
+
insertAfter(q, U);
|
|
2078
|
+
removeElements(q);
|
|
2062
2079
|
}));
|
|
2063
2080
|
}
|
|
2064
|
-
appendChildren(
|
|
2065
|
-
appendChildren(
|
|
2066
|
-
appendChildren(
|
|
2067
|
-
appendChildren(
|
|
2068
|
-
push(
|
|
2081
|
+
appendChildren(ot, Z);
|
|
2082
|
+
appendChildren(q, Y);
|
|
2083
|
+
appendChildren(Y || q, !E && W);
|
|
2084
|
+
appendChildren(W, J);
|
|
2085
|
+
push(K, [ c, () => {
|
|
2069
2086
|
const t = getFocusedElement();
|
|
2070
|
-
const n =
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
removeAttrs(
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2087
|
+
const n = elementIsGenerated(W);
|
|
2088
|
+
const e = n && t === W ? U : t;
|
|
2089
|
+
const c = prepareWrapUnwrapFocus(e);
|
|
2090
|
+
removeAttrs(Y, tt);
|
|
2091
|
+
removeAttrs(J, nt);
|
|
2092
|
+
removeAttrs(W, X);
|
|
2093
|
+
b && removeAttrs(m, B);
|
|
2094
|
+
s ? setAttrs(W, o, s) : removeAttrs(W, o);
|
|
2095
|
+
elementIsGenerated(J) && unwrap(J);
|
|
2096
|
+
n && unwrap(W);
|
|
2097
|
+
elementIsGenerated(Y) && unwrap(Y);
|
|
2098
|
+
focusElement(e);
|
|
2099
|
+
c();
|
|
2079
2100
|
} ]);
|
|
2080
|
-
if (
|
|
2081
|
-
addAttrClass(
|
|
2082
|
-
push(
|
|
2083
|
-
}
|
|
2084
|
-
if (!z && y.top === y && t === p) {
|
|
2085
|
-
const t = "tabindex";
|
|
2086
|
-
const n = getAttr(Q, t);
|
|
2087
|
-
setAttrs(Q, t, "-1");
|
|
2088
|
-
focusElm(Q);
|
|
2089
|
-
const revertViewportTabIndex = () => n ? setAttrs(Q, t, n) : removeAttrs(Q, t);
|
|
2090
|
-
const o = addEventListener(b, "pointerdown keydown", (() => {
|
|
2091
|
-
revertViewportTabIndex();
|
|
2092
|
-
o();
|
|
2093
|
-
}));
|
|
2094
|
-
push(st, [ revertViewportTabIndex, o ]);
|
|
2095
|
-
} else {
|
|
2096
|
-
focusElm(t);
|
|
2101
|
+
if (e && !E) {
|
|
2102
|
+
addAttrClass(W, X, G);
|
|
2103
|
+
push(K, bind(removeAttrs, W, X));
|
|
2097
2104
|
}
|
|
2098
|
-
n
|
|
2099
|
-
|
|
2100
|
-
|
|
2105
|
+
focusElement(!E && b && n === U && t.top === t ? W : n);
|
|
2106
|
+
c();
|
|
2107
|
+
Z = 0;
|
|
2108
|
+
return st;
|
|
2101
2109
|
};
|
|
2102
|
-
return [
|
|
2110
|
+
return [ P, appendElements, st ];
|
|
2103
2111
|
};
|
|
2104
2112
|
|
|
2105
|
-
const createTrinsicUpdateSegment = ({
|
|
2113
|
+
const createTrinsicUpdateSegment = ({bt: t}) => ({Gt: n, an: o, Tt: s}) => {
|
|
2106
2114
|
const {xt: e} = n || {};
|
|
2107
2115
|
const {$t: c} = o;
|
|
2108
2116
|
const r = t && (e || s);
|
|
2109
2117
|
if (r) {
|
|
2110
2118
|
setStyles(t, {
|
|
2111
|
-
[
|
|
2119
|
+
[E]: c && "100%"
|
|
2112
2120
|
});
|
|
2113
2121
|
}
|
|
2114
2122
|
};
|
|
2115
2123
|
|
|
2116
|
-
const createPaddingUpdateSegment = ({
|
|
2124
|
+
const createPaddingUpdateSegment = ({ht: t, cn: n, ot: o, nt: s}, e) => {
|
|
2117
2125
|
const [c, r] = createCache({
|
|
2118
|
-
|
|
2126
|
+
i: equalTRBL,
|
|
2119
2127
|
o: topRightBottomLeft()
|
|
2120
2128
|
}, bind(topRightBottomLeft, t, "padding", ""));
|
|
2121
|
-
return ({
|
|
2122
|
-
let [u,
|
|
2123
|
-
const {
|
|
2124
|
-
const {
|
|
2125
|
-
const {
|
|
2129
|
+
return ({It: t, Gt: l, an: i, Tt: a}) => {
|
|
2130
|
+
let [u, _] = r(a);
|
|
2131
|
+
const {R: d} = getEnvironment();
|
|
2132
|
+
const {ft: f, Ht: p, Ct: v} = l || {};
|
|
2133
|
+
const {ct: h} = i;
|
|
2126
2134
|
const [g, C] = t("paddingAbsolute");
|
|
2127
|
-
const x = a ||
|
|
2128
|
-
if (
|
|
2129
|
-
[u,
|
|
2135
|
+
const x = a || p;
|
|
2136
|
+
if (f || _ || x) {
|
|
2137
|
+
[u, _] = c(a);
|
|
2130
2138
|
}
|
|
2131
|
-
const
|
|
2132
|
-
if (
|
|
2133
|
-
const t = !g || !n && !
|
|
2139
|
+
const E = !s && (C || v || _);
|
|
2140
|
+
if (E) {
|
|
2141
|
+
const t = !g || !n && !d;
|
|
2134
2142
|
const s = u.r + u.l;
|
|
2135
2143
|
const c = u.t + u.b;
|
|
2136
2144
|
const r = {
|
|
2137
|
-
[O]: t && !
|
|
2145
|
+
[O]: t && !h ? -s : 0,
|
|
2138
2146
|
[$]: t ? -c : 0,
|
|
2139
|
-
[
|
|
2147
|
+
[S]: t && h ? -s : 0,
|
|
2140
2148
|
top: t ? -u.t : 0,
|
|
2141
|
-
right: t ?
|
|
2142
|
-
left: t ?
|
|
2149
|
+
right: t ? h ? -u.r : "auto" : 0,
|
|
2150
|
+
left: t ? h ? "auto" : -u.l : 0,
|
|
2143
2151
|
[H]: t && `calc(100% + ${s}px)`
|
|
2144
2152
|
};
|
|
2145
2153
|
const l = {
|
|
2146
2154
|
[b]: t ? u.t : 0,
|
|
2147
2155
|
[w]: t ? u.r : 0,
|
|
2148
|
-
[
|
|
2149
|
-
[
|
|
2156
|
+
[m]: t ? u.b : 0,
|
|
2157
|
+
[y]: t ? u.l : 0
|
|
2150
2158
|
};
|
|
2151
2159
|
setStyles(n || o, r);
|
|
2152
2160
|
setStyles(o, l);
|
|
2153
2161
|
assignDeep(e, {
|
|
2154
2162
|
cn: u,
|
|
2155
|
-
|
|
2156
|
-
|
|
2163
|
+
un: !t,
|
|
2164
|
+
rt: n ? l : assignDeep({}, r, l)
|
|
2157
2165
|
});
|
|
2158
2166
|
}
|
|
2159
2167
|
return {
|
|
2160
|
-
_n:
|
|
2168
|
+
_n: E
|
|
2161
2169
|
};
|
|
2162
2170
|
};
|
|
2163
2171
|
};
|
|
2164
2172
|
|
|
2165
2173
|
const createOverflowUpdateSegment = (t, s) => {
|
|
2166
2174
|
const e = getEnvironment();
|
|
2167
|
-
const {
|
|
2168
|
-
const {
|
|
2169
|
-
const
|
|
2170
|
-
const
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2175
|
+
const {ht: c, cn: r, ot: l, nt: a, Kt: u, gt: _, yt: d, Ot: f, ln: p} = t;
|
|
2176
|
+
const {R: v} = e;
|
|
2177
|
+
const h = d && a;
|
|
2178
|
+
const g = bind(o, 0);
|
|
2179
|
+
const b = [ "display", "direction", "flexDirection", "writingMode" ];
|
|
2180
|
+
const w = {
|
|
2181
|
+
i: equalWH,
|
|
2173
2182
|
o: {
|
|
2174
2183
|
w: 0,
|
|
2175
2184
|
h: 0
|
|
2176
2185
|
}
|
|
2177
2186
|
};
|
|
2178
|
-
const
|
|
2179
|
-
|
|
2180
|
-
o: {
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2187
|
+
const y = {
|
|
2188
|
+
i: equalXY,
|
|
2189
|
+
o: {}
|
|
2190
|
+
};
|
|
2191
|
+
const setMeasuringMode = t => {
|
|
2192
|
+
f(K, !h && t);
|
|
2184
2193
|
};
|
|
2185
2194
|
const getOverflowAmount = (t, o) => {
|
|
2186
2195
|
const s = n.devicePixelRatio % 1 !== 0 ? 1 : 0;
|
|
2187
2196
|
const e = {
|
|
2188
|
-
w:
|
|
2189
|
-
h:
|
|
2197
|
+
w: g(t.w - o.w),
|
|
2198
|
+
h: g(t.h - o.h)
|
|
2190
2199
|
};
|
|
2191
2200
|
return {
|
|
2192
2201
|
w: e.w > s ? e.w : 0,
|
|
2193
2202
|
h: e.h > s ? e.h : 0
|
|
2194
2203
|
};
|
|
2195
2204
|
};
|
|
2196
|
-
const [
|
|
2197
|
-
const [
|
|
2198
|
-
const [
|
|
2199
|
-
const [
|
|
2200
|
-
const [
|
|
2201
|
-
const
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
if (U && _) {
|
|
2218
|
-
a(G, !P);
|
|
2219
|
-
}
|
|
2220
|
-
if (X) {
|
|
2221
|
-
if (Z) {
|
|
2222
|
-
a(Q, false);
|
|
2205
|
+
const [m, S] = createCache(w, bind(getFractionalSize, l));
|
|
2206
|
+
const [O, $] = createCache(w, bind(R, l));
|
|
2207
|
+
const [C, x] = createCache(w);
|
|
2208
|
+
const [H] = createCache(y);
|
|
2209
|
+
const [E, T] = createCache(w);
|
|
2210
|
+
const [D] = createCache(y);
|
|
2211
|
+
const [k] = createCache({
|
|
2212
|
+
i: (t, n) => equal(t, n, b),
|
|
2213
|
+
o: {}
|
|
2214
|
+
}, (() => hasDimensions(l) ? getStyles(l, b) : {}));
|
|
2215
|
+
const [V, L] = createCache({
|
|
2216
|
+
i: (t, n) => equalXY(t.T, n.T) && equalXY(t.D, n.D),
|
|
2217
|
+
o: getZeroScrollCoordinates()
|
|
2218
|
+
}, (() => {
|
|
2219
|
+
setMeasuringMode(true);
|
|
2220
|
+
const t = getElementScroll(_);
|
|
2221
|
+
const n = f(Z, true);
|
|
2222
|
+
const o = addEventListener(u, A, (n => {
|
|
2223
|
+
const o = getElementScroll(_);
|
|
2224
|
+
if (n.isTrusted && o.x === t.x && o.y === t.y) {
|
|
2225
|
+
stopPropagation(n);
|
|
2223
2226
|
}
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2227
|
+
}), {
|
|
2228
|
+
I: true,
|
|
2229
|
+
A: true
|
|
2230
|
+
});
|
|
2231
|
+
scrollElementTo(_, {
|
|
2232
|
+
x: 0,
|
|
2233
|
+
y: 0
|
|
2234
|
+
});
|
|
2235
|
+
n();
|
|
2236
|
+
const s = getElementScroll(_);
|
|
2237
|
+
const e = R(_);
|
|
2238
|
+
scrollElementTo(_, {
|
|
2239
|
+
x: e.w,
|
|
2240
|
+
y: e.h
|
|
2241
|
+
});
|
|
2242
|
+
const c = getElementScroll(_);
|
|
2243
|
+
scrollElementTo(_, {
|
|
2244
|
+
x: c.x - s.x < 1 && -e.w,
|
|
2245
|
+
y: c.y - s.y < 1 && -e.h
|
|
2246
|
+
});
|
|
2247
|
+
const r = getElementScroll(_);
|
|
2248
|
+
scrollElementTo(_, t);
|
|
2249
|
+
i((() => o()));
|
|
2250
|
+
return {
|
|
2251
|
+
T: s,
|
|
2252
|
+
D: r
|
|
2253
|
+
};
|
|
2254
|
+
}));
|
|
2255
|
+
const P = getStaticPluginModuleInstance(Tt);
|
|
2256
|
+
const createViewportOverflowStyleClassName = (t, n) => {
|
|
2257
|
+
const o = n ? Y : W;
|
|
2258
|
+
return `${o}${capitalizeFirstLetter(t)}`;
|
|
2259
|
+
};
|
|
2260
|
+
const setViewportOverflowStyle = t => {
|
|
2261
|
+
const createAllOverflowStyleClassNames = t => [ z, I, A ].map((n => createViewportOverflowStyleClassName(n, t)));
|
|
2262
|
+
const n = createAllOverflowStyleClassNames(true).concat(createAllOverflowStyleClassNames()).join(" ");
|
|
2263
|
+
f(n);
|
|
2264
|
+
f(keys(t).map((n => createViewportOverflowStyleClassName(t[n], n === "x"))).join(" "), true);
|
|
2265
|
+
};
|
|
2266
|
+
return ({It: n, Gt: o, an: i, Tt: a}, {_n: u}) => {
|
|
2267
|
+
const {ft: _, Ht: d, Ct: b, dt: w, zt: y} = o || {};
|
|
2268
|
+
const z = P && P.tt(t, s, i, e, n);
|
|
2269
|
+
const {it: I, ut: A, _t: R} = z || {};
|
|
2270
|
+
const [U, N] = getShowNativeOverlaidScrollbars(n, e);
|
|
2271
|
+
const [B, j] = n("overflow");
|
|
2272
|
+
const X = overflowIsVisible(B.x);
|
|
2273
|
+
const Y = overflowIsVisible(B.y);
|
|
2274
|
+
const W = _ || u || d || b || y || N;
|
|
2275
|
+
let J = S(a);
|
|
2276
|
+
let K = $(a);
|
|
2277
|
+
let Q = x(a);
|
|
2278
|
+
let Z = T(a);
|
|
2279
|
+
if (N && v) {
|
|
2280
|
+
f(G, !U);
|
|
2281
|
+
}
|
|
2282
|
+
if (W) {
|
|
2283
|
+
if (hasAttrClass(c, F, q)) {
|
|
2284
|
+
setMeasuringMode(true);
|
|
2285
|
+
}
|
|
2286
|
+
const [t] = A ? A() : [];
|
|
2287
|
+
const [n] = J = m(a);
|
|
2288
|
+
const [o] = K = O(a);
|
|
2289
|
+
const s = M(l);
|
|
2290
|
+
const e = h && getWindowSize(p());
|
|
2291
|
+
const r = {
|
|
2292
|
+
w: g(o.w + n.w),
|
|
2293
|
+
h: g(o.h + n.h)
|
|
2236
2294
|
};
|
|
2237
|
-
const
|
|
2238
|
-
w:
|
|
2239
|
-
h:
|
|
2295
|
+
const i = {
|
|
2296
|
+
w: g((e ? e.w : s.w + g(s.w - o.w)) + n.w),
|
|
2297
|
+
h: g((e ? e.h : s.h + g(s.h - o.h)) + n.h)
|
|
2240
2298
|
};
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
const [
|
|
2246
|
-
const [
|
|
2247
|
-
const [
|
|
2248
|
-
const
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
const
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2299
|
+
t && t();
|
|
2300
|
+
Z = E(i);
|
|
2301
|
+
Q = C(getOverflowAmount(r, i), a);
|
|
2302
|
+
}
|
|
2303
|
+
const [nt, ot] = Z;
|
|
2304
|
+
const [st, et] = Q;
|
|
2305
|
+
const [ct, rt] = K;
|
|
2306
|
+
const [lt, it] = J;
|
|
2307
|
+
const [at, ut] = H({
|
|
2308
|
+
x: st.w > 0,
|
|
2309
|
+
y: st.h > 0
|
|
2310
|
+
});
|
|
2311
|
+
const _t = X && Y && (at.x || at.y) || X && at.x && !at.y || Y && at.y && !at.x;
|
|
2312
|
+
const dt = u || b || y || it || rt || ot || et || j || N || W;
|
|
2313
|
+
const ft = createViewportOverflowState(at, B);
|
|
2314
|
+
const [pt, vt] = D(ft.G);
|
|
2315
|
+
const [, ht] = k(a);
|
|
2316
|
+
const gt = b || w || ht || ut || a;
|
|
2317
|
+
const [bt, wt] = gt ? V(a) : L();
|
|
2318
|
+
if (dt) {
|
|
2319
|
+
vt && setViewportOverflowStyle(ft.G);
|
|
2320
|
+
if (R && I) {
|
|
2321
|
+
setStyles(l, R(ft, i, I(ft, ct, lt)));
|
|
2263
2322
|
}
|
|
2264
2323
|
}
|
|
2265
|
-
|
|
2266
|
-
addRemoveAttrClass(
|
|
2267
|
-
|
|
2268
|
-
addRemoveAttrClass(l, K, Q, Z);
|
|
2269
|
-
}
|
|
2270
|
-
const [bt, wt] = H(getViewportOverflowState(t).k);
|
|
2324
|
+
setMeasuringMode(false);
|
|
2325
|
+
addRemoveAttrClass(c, F, q, _t);
|
|
2326
|
+
addRemoveAttrClass(r, tt, q, _t);
|
|
2271
2327
|
assignDeep(s, {
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
x:
|
|
2275
|
-
y:
|
|
2328
|
+
G: pt,
|
|
2329
|
+
Vt: {
|
|
2330
|
+
x: nt.w,
|
|
2331
|
+
y: nt.h
|
|
2276
2332
|
},
|
|
2277
|
-
|
|
2278
|
-
x:
|
|
2279
|
-
y:
|
|
2333
|
+
Rt: {
|
|
2334
|
+
x: st.w,
|
|
2335
|
+
y: st.h
|
|
2280
2336
|
},
|
|
2281
|
-
en:
|
|
2337
|
+
en: at,
|
|
2338
|
+
Pt: sanitizeScrollCoordinates(bt, st)
|
|
2282
2339
|
});
|
|
2283
2340
|
return {
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2341
|
+
nn: vt,
|
|
2342
|
+
Zt: ot,
|
|
2343
|
+
tn: et,
|
|
2344
|
+
sn: wt || et,
|
|
2345
|
+
dn: gt
|
|
2287
2346
|
};
|
|
2288
2347
|
};
|
|
2289
2348
|
};
|
|
@@ -2297,110 +2356,112 @@ const createStructureSetup = t => {
|
|
|
2297
2356
|
b: 0,
|
|
2298
2357
|
l: 0
|
|
2299
2358
|
},
|
|
2300
|
-
|
|
2301
|
-
|
|
2359
|
+
un: false,
|
|
2360
|
+
rt: {
|
|
2302
2361
|
[O]: 0,
|
|
2303
2362
|
[$]: 0,
|
|
2304
|
-
[
|
|
2363
|
+
[S]: 0,
|
|
2305
2364
|
[b]: 0,
|
|
2306
2365
|
[w]: 0,
|
|
2307
|
-
[
|
|
2308
|
-
[
|
|
2366
|
+
[m]: 0,
|
|
2367
|
+
[y]: 0
|
|
2309
2368
|
},
|
|
2310
|
-
|
|
2369
|
+
Vt: {
|
|
2311
2370
|
x: 0,
|
|
2312
2371
|
y: 0
|
|
2313
2372
|
},
|
|
2314
|
-
|
|
2373
|
+
Rt: {
|
|
2315
2374
|
x: 0,
|
|
2316
2375
|
y: 0
|
|
2317
2376
|
},
|
|
2318
|
-
|
|
2319
|
-
x:
|
|
2320
|
-
y:
|
|
2377
|
+
G: {
|
|
2378
|
+
x: I,
|
|
2379
|
+
y: I
|
|
2321
2380
|
},
|
|
2322
2381
|
en: {
|
|
2323
2382
|
x: false,
|
|
2324
2383
|
y: false
|
|
2325
|
-
}
|
|
2384
|
+
},
|
|
2385
|
+
Pt: getZeroScrollCoordinates()
|
|
2326
2386
|
};
|
|
2327
|
-
const {
|
|
2328
|
-
const {
|
|
2387
|
+
const {vt: c, gt: r, nt: l} = n;
|
|
2388
|
+
const {R: i, M: a} = getEnvironment();
|
|
2329
2389
|
const u = !i && (a.x || a.y);
|
|
2330
|
-
const
|
|
2390
|
+
const _ = [ createTrinsicUpdateSegment(n), createPaddingUpdateSegment(n, e), createOverflowUpdateSegment(n, e) ];
|
|
2331
2391
|
return [ o, t => {
|
|
2332
2392
|
const n = {};
|
|
2333
2393
|
const o = u;
|
|
2334
|
-
const s = o &&
|
|
2335
|
-
|
|
2336
|
-
each(f, (o => {
|
|
2394
|
+
const s = o && getElementScroll(r);
|
|
2395
|
+
each(_, (o => {
|
|
2337
2396
|
assignDeep(n, o(t, n) || {});
|
|
2338
2397
|
}));
|
|
2339
|
-
e();
|
|
2340
2398
|
scrollElementTo(r, s);
|
|
2341
2399
|
!l && scrollElementTo(c, 0);
|
|
2342
2400
|
return n;
|
|
2343
2401
|
}, e, n, s ];
|
|
2344
2402
|
};
|
|
2345
2403
|
|
|
2346
|
-
const createSetups = (t, n, o, s) => {
|
|
2347
|
-
const
|
|
2348
|
-
const [
|
|
2349
|
-
const [
|
|
2404
|
+
const createSetups = (t, n, o, s, e) => {
|
|
2405
|
+
const c = createOptionCheck(n, {});
|
|
2406
|
+
const [r, l, i, a, u] = createStructureSetup(t);
|
|
2407
|
+
const [_, d, f] = createObserversSetup(a, i, c, (t => {
|
|
2350
2408
|
update({}, t);
|
|
2351
2409
|
}));
|
|
2352
|
-
const [
|
|
2410
|
+
const [p, v, , h] = createScrollbarsSetup(t, n, f, i, a, e);
|
|
2353
2411
|
const updateHintsAreTruthy = t => keys(t).some((n => !!t[n]));
|
|
2354
|
-
const update = (t,
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2412
|
+
const update = (t, e) => {
|
|
2413
|
+
if (o()) {
|
|
2414
|
+
return false;
|
|
2415
|
+
}
|
|
2416
|
+
const {fn: c, Tt: r, At: i, pn: a} = t;
|
|
2417
|
+
const u = c || {};
|
|
2418
|
+
const _ = !!r;
|
|
2419
|
+
const p = {
|
|
2420
|
+
It: createOptionCheck(n, u, _),
|
|
2421
|
+
fn: u,
|
|
2422
|
+
Tt: _
|
|
2362
2423
|
};
|
|
2363
|
-
if (
|
|
2364
|
-
v(
|
|
2424
|
+
if (a) {
|
|
2425
|
+
v(p);
|
|
2365
2426
|
return false;
|
|
2366
2427
|
}
|
|
2367
|
-
const h =
|
|
2368
|
-
At:
|
|
2428
|
+
const h = e || d(assignDeep({}, p, {
|
|
2429
|
+
At: i
|
|
2369
2430
|
}));
|
|
2370
|
-
const
|
|
2371
|
-
|
|
2431
|
+
const g = l(assignDeep({}, p, {
|
|
2432
|
+
an: f,
|
|
2372
2433
|
Gt: h
|
|
2373
2434
|
}));
|
|
2374
|
-
v(assignDeep({},
|
|
2435
|
+
v(assignDeep({}, p, {
|
|
2375
2436
|
Gt: h,
|
|
2376
|
-
Qt:
|
|
2437
|
+
Qt: g
|
|
2377
2438
|
}));
|
|
2378
|
-
const
|
|
2379
|
-
const
|
|
2380
|
-
const
|
|
2381
|
-
|
|
2439
|
+
const b = updateHintsAreTruthy(h);
|
|
2440
|
+
const w = updateHintsAreTruthy(g);
|
|
2441
|
+
const y = b || w || !isEmptyObject(u) || _;
|
|
2442
|
+
y && s(t, {
|
|
2382
2443
|
Gt: h,
|
|
2383
|
-
Qt:
|
|
2444
|
+
Qt: g
|
|
2384
2445
|
});
|
|
2385
|
-
return
|
|
2446
|
+
return y;
|
|
2386
2447
|
};
|
|
2387
2448
|
return [ () => {
|
|
2388
|
-
const {rn: t,
|
|
2389
|
-
const o =
|
|
2390
|
-
const s = [
|
|
2449
|
+
const {rn: t, gt: n} = a;
|
|
2450
|
+
const o = getElementScroll(t);
|
|
2451
|
+
const s = [ _(), r(), p() ];
|
|
2391
2452
|
scrollElementTo(n, o);
|
|
2392
2453
|
return bind(runEachAndClear, s);
|
|
2393
2454
|
}, update, () => ({
|
|
2394
|
-
|
|
2395
|
-
|
|
2455
|
+
vn: f,
|
|
2456
|
+
hn: i
|
|
2396
2457
|
}), {
|
|
2397
|
-
gn:
|
|
2458
|
+
gn: a,
|
|
2398
2459
|
bn: h
|
|
2399
|
-
},
|
|
2460
|
+
}, u ];
|
|
2400
2461
|
};
|
|
2401
2462
|
|
|
2402
2463
|
const OverlayScrollbars = (t, n, o) => {
|
|
2403
|
-
const {
|
|
2464
|
+
const {N: s} = getEnvironment();
|
|
2404
2465
|
const e = isHTMLElement(t);
|
|
2405
2466
|
const c = e ? t : t.target;
|
|
2406
2467
|
const r = getInstance(c);
|
|
@@ -2409,28 +2470,29 @@ const OverlayScrollbars = (t, n, o) => {
|
|
|
2409
2470
|
const l = [];
|
|
2410
2471
|
const i = {};
|
|
2411
2472
|
const validateOptions = t => {
|
|
2412
|
-
const n = removeUndefinedProperties(t
|
|
2413
|
-
const o = getStaticPluginModuleInstance(
|
|
2473
|
+
const n = removeUndefinedProperties(t);
|
|
2474
|
+
const o = getStaticPluginModuleInstance(zt);
|
|
2414
2475
|
return o ? o(n, true) : n;
|
|
2415
2476
|
};
|
|
2416
2477
|
const a = assignDeep({}, s(), validateOptions(n));
|
|
2417
|
-
const [u,
|
|
2418
|
-
const [
|
|
2478
|
+
const [u, _, d] = createEventListenerHub();
|
|
2479
|
+
const [f, p, v] = createEventListenerHub(o);
|
|
2419
2480
|
const triggerEvent = (t, n) => {
|
|
2420
|
-
|
|
2421
|
-
|
|
2481
|
+
v(t, n);
|
|
2482
|
+
d(t, n);
|
|
2422
2483
|
};
|
|
2423
|
-
const [
|
|
2424
|
-
const {
|
|
2425
|
-
const {
|
|
2426
|
-
triggerEvent("updated", [
|
|
2484
|
+
const [h, g, b, w, y] = createSetups(t, a, (() => r), (({fn: t, Tt: n}, {Gt: o, Qt: s}) => {
|
|
2485
|
+
const {ft: e, Ct: c, xt: r, Ht: l, Et: i, dt: a} = o;
|
|
2486
|
+
const {Zt: u, tn: _, nn: d, sn: f} = s;
|
|
2487
|
+
triggerEvent("updated", [ m, {
|
|
2427
2488
|
updateHints: {
|
|
2428
2489
|
sizeChanged: !!e,
|
|
2429
2490
|
directionChanged: !!c,
|
|
2430
2491
|
heightIntrinsicChanged: !!r,
|
|
2431
2492
|
overflowEdgeChanged: !!u,
|
|
2432
|
-
overflowAmountChanged: !!
|
|
2433
|
-
overflowStyleChanged: !!
|
|
2493
|
+
overflowAmountChanged: !!_,
|
|
2494
|
+
overflowStyleChanged: !!d,
|
|
2495
|
+
scrollCoordinatesChanged: !!f,
|
|
2434
2496
|
contentMutation: !!l,
|
|
2435
2497
|
hostMutation: !!i,
|
|
2436
2498
|
appear: !!a
|
|
@@ -2438,16 +2500,16 @@ const OverlayScrollbars = (t, n, o) => {
|
|
|
2438
2500
|
changedOptions: t || {},
|
|
2439
2501
|
force: !!n
|
|
2440
2502
|
} ]);
|
|
2441
|
-
}), (t => triggerEvent("scroll", [
|
|
2503
|
+
}), (t => triggerEvent("scroll", [ m, t ])));
|
|
2442
2504
|
const destroy = t => {
|
|
2443
2505
|
removeInstance(c);
|
|
2444
2506
|
runEachAndClear(l);
|
|
2445
2507
|
r = true;
|
|
2446
|
-
triggerEvent("destroyed", [
|
|
2447
|
-
|
|
2448
|
-
|
|
2508
|
+
triggerEvent("destroyed", [ m, t ]);
|
|
2509
|
+
_();
|
|
2510
|
+
p();
|
|
2449
2511
|
};
|
|
2450
|
-
const
|
|
2512
|
+
const m = {
|
|
2451
2513
|
options(t, n) {
|
|
2452
2514
|
if (t) {
|
|
2453
2515
|
const o = n ? s() : {};
|
|
@@ -2455,25 +2517,29 @@ const OverlayScrollbars = (t, n, o) => {
|
|
|
2455
2517
|
if (!isEmptyObject(e)) {
|
|
2456
2518
|
assignDeep(a, e);
|
|
2457
2519
|
g({
|
|
2458
|
-
|
|
2520
|
+
fn: e
|
|
2459
2521
|
});
|
|
2460
2522
|
}
|
|
2461
2523
|
}
|
|
2462
2524
|
return assignDeep({}, a);
|
|
2463
2525
|
},
|
|
2464
|
-
on:
|
|
2526
|
+
on: f,
|
|
2465
2527
|
off: (t, n) => {
|
|
2466
|
-
t && n &&
|
|
2528
|
+
t && n && p(t, n);
|
|
2467
2529
|
},
|
|
2468
2530
|
state() {
|
|
2469
|
-
const {
|
|
2470
|
-
const {
|
|
2471
|
-
const {
|
|
2531
|
+
const {vn: t, hn: n} = b();
|
|
2532
|
+
const {ct: o} = t;
|
|
2533
|
+
const {Vt: s, Rt: e, G: c, en: l, cn: i, un: a, Pt: u} = n;
|
|
2472
2534
|
return assignDeep({}, {
|
|
2473
2535
|
overflowEdge: s,
|
|
2474
2536
|
overflowAmount: e,
|
|
2475
2537
|
overflowStyle: c,
|
|
2476
2538
|
hasOverflow: l,
|
|
2539
|
+
scrollCoordinates: {
|
|
2540
|
+
start: u.T,
|
|
2541
|
+
end: u.D
|
|
2542
|
+
},
|
|
2477
2543
|
padding: i,
|
|
2478
2544
|
paddingAbsolute: a,
|
|
2479
2545
|
directionRTL: o,
|
|
@@ -2481,10 +2547,10 @@ const OverlayScrollbars = (t, n, o) => {
|
|
|
2481
2547
|
});
|
|
2482
2548
|
},
|
|
2483
2549
|
elements() {
|
|
2484
|
-
const {
|
|
2485
|
-
const {
|
|
2550
|
+
const {vt: t, ht: n, cn: o, ot: s, bt: e, gt: c, Kt: r} = w.gn;
|
|
2551
|
+
const {Ft: l, Wt: i} = w.bn;
|
|
2486
2552
|
const translateScrollbarStructure = t => {
|
|
2487
|
-
const {
|
|
2553
|
+
const {Mt: n, kt: o, Lt: s} = t;
|
|
2488
2554
|
return {
|
|
2489
2555
|
scrollbar: s,
|
|
2490
2556
|
track: o,
|
|
@@ -2492,13 +2558,13 @@ const OverlayScrollbars = (t, n, o) => {
|
|
|
2492
2558
|
};
|
|
2493
2559
|
};
|
|
2494
2560
|
const translateScrollbarsSetupElement = t => {
|
|
2495
|
-
const {
|
|
2561
|
+
const {jt: n, Xt: o} = t;
|
|
2496
2562
|
const s = translateScrollbarStructure(n[0]);
|
|
2497
2563
|
return assignDeep({}, s, {
|
|
2498
2564
|
clone: () => {
|
|
2499
2565
|
const t = translateScrollbarStructure(o());
|
|
2500
2566
|
g({
|
|
2501
|
-
|
|
2567
|
+
pn: true
|
|
2502
2568
|
});
|
|
2503
2569
|
return t;
|
|
2504
2570
|
}
|
|
@@ -2523,17 +2589,17 @@ const OverlayScrollbars = (t, n, o) => {
|
|
|
2523
2589
|
destroy: bind(destroy, false),
|
|
2524
2590
|
plugin: t => i[keys(t)[0]]
|
|
2525
2591
|
};
|
|
2526
|
-
push(l, [
|
|
2527
|
-
addInstance(c,
|
|
2528
|
-
registerPluginModuleInstances(
|
|
2529
|
-
if (cancelInitialization(w.gn.
|
|
2592
|
+
push(l, [ y ]);
|
|
2593
|
+
addInstance(c, m);
|
|
2594
|
+
registerPluginModuleInstances(Ht, OverlayScrollbars, [ m, u, i ]);
|
|
2595
|
+
if (cancelInitialization(w.gn.yt, !e && t.cancel)) {
|
|
2530
2596
|
destroy(true);
|
|
2531
|
-
return
|
|
2597
|
+
return m;
|
|
2532
2598
|
}
|
|
2533
|
-
push(l,
|
|
2534
|
-
triggerEvent("initialized", [
|
|
2535
|
-
|
|
2536
|
-
return
|
|
2599
|
+
push(l, h());
|
|
2600
|
+
triggerEvent("initialized", [ m ]);
|
|
2601
|
+
m.update(true);
|
|
2602
|
+
return m;
|
|
2537
2603
|
}
|
|
2538
2604
|
return r;
|
|
2539
2605
|
};
|
|
@@ -2553,29 +2619,26 @@ OverlayScrollbars.valid = t => {
|
|
|
2553
2619
|
};
|
|
2554
2620
|
|
|
2555
2621
|
OverlayScrollbars.env = () => {
|
|
2556
|
-
const {
|
|
2622
|
+
const {k: t, M: n, R: o, V: s, B: e, F: c, P: r, U: l, N: i, q: a} = getEnvironment();
|
|
2557
2623
|
return assignDeep({}, {
|
|
2558
2624
|
scrollbarsSize: t,
|
|
2559
2625
|
scrollbarsOverlaid: n,
|
|
2560
2626
|
scrollbarsHiding: o,
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
setDefaultOptions: u
|
|
2627
|
+
scrollTimeline: s,
|
|
2628
|
+
staticDefaultInitialization: e,
|
|
2629
|
+
staticDefaultOptions: c,
|
|
2630
|
+
getDefaultInitialization: r,
|
|
2631
|
+
setDefaultInitialization: l,
|
|
2632
|
+
getDefaultOptions: i,
|
|
2633
|
+
setDefaultOptions: a
|
|
2569
2634
|
});
|
|
2570
2635
|
};
|
|
2571
2636
|
|
|
2572
2637
|
const getEl = async (el, options) => {
|
|
2573
2638
|
let res = el;
|
|
2574
2639
|
if (options.target) {
|
|
2575
|
-
if (typeof options.target === "string")
|
|
2576
|
-
|
|
2577
|
-
if (typeof options.target === "function")
|
|
2578
|
-
res = await options.target(el);
|
|
2640
|
+
if (typeof options.target === "string") res = options.target;
|
|
2641
|
+
if (typeof options.target === "function") res = await options.target(el);
|
|
2579
2642
|
}
|
|
2580
2643
|
return res;
|
|
2581
2644
|
};
|
|
@@ -2588,8 +2651,7 @@ const getVisible = (el, options) => {
|
|
|
2588
2651
|
visible = options.visible;
|
|
2589
2652
|
}
|
|
2590
2653
|
}
|
|
2591
|
-
if (visible === false)
|
|
2592
|
-
return { x: "hidden", y: "hidden" };
|
|
2654
|
+
if (visible === false) return { x: "hidden", y: "hidden" };
|
|
2593
2655
|
let x = true;
|
|
2594
2656
|
let y = true;
|
|
2595
2657
|
if (options.x !== void 0) {
|
|
@@ -2612,8 +2674,7 @@ const scrollbar = {
|
|
|
2612
2674
|
mounted: async (el, binding, vnode) => {
|
|
2613
2675
|
const options = (vnode ? binding.value : binding) || {};
|
|
2614
2676
|
const overlayEl = await getEl(el, options);
|
|
2615
|
-
if (!overlayEl)
|
|
2616
|
-
return;
|
|
2677
|
+
if (!overlayEl) return;
|
|
2617
2678
|
const overflow = getVisible(overlayEl, options);
|
|
2618
2679
|
const defaultClassName = "os-theme-dark das-scrollbar";
|
|
2619
2680
|
const theme = options?.className ? `${defaultClassName} ${options?.className}` : defaultClassName;
|
|
@@ -2625,6 +2686,12 @@ const scrollbar = {
|
|
|
2625
2686
|
theme
|
|
2626
2687
|
},
|
|
2627
2688
|
overflow
|
|
2689
|
+
}, {
|
|
2690
|
+
scroll: (instance2, event) => {
|
|
2691
|
+
if (options && options.scroll && typeof options.scroll === "function") {
|
|
2692
|
+
options.scroll(instance2, event);
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2628
2695
|
});
|
|
2629
2696
|
if (options && options.scrollReady) {
|
|
2630
2697
|
options.scrollReady(instance);
|
|
@@ -2632,4 +2699,998 @@ const scrollbar = {
|
|
|
2632
2699
|
}
|
|
2633
2700
|
};
|
|
2634
2701
|
|
|
2635
|
-
|
|
2702
|
+
var _a;
|
|
2703
|
+
const isClient = typeof window !== "undefined";
|
|
2704
|
+
const isString$1 = (val) => typeof val === "string";
|
|
2705
|
+
const noop = () => {
|
|
2706
|
+
};
|
|
2707
|
+
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
2708
|
+
|
|
2709
|
+
function resolveUnref(r) {
|
|
2710
|
+
return typeof r === "function" ? r() : unref(r);
|
|
2711
|
+
}
|
|
2712
|
+
function identity(arg) {
|
|
2713
|
+
return arg;
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
function tryOnScopeDispose(fn) {
|
|
2717
|
+
if (getCurrentScope()) {
|
|
2718
|
+
onScopeDispose(fn);
|
|
2719
|
+
return true;
|
|
2720
|
+
}
|
|
2721
|
+
return false;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
function tryOnMounted(fn, sync = true) {
|
|
2725
|
+
if (getCurrentInstance())
|
|
2726
|
+
onMounted(fn);
|
|
2727
|
+
else if (sync)
|
|
2728
|
+
fn();
|
|
2729
|
+
else
|
|
2730
|
+
nextTick(fn);
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
function unrefElement(elRef) {
|
|
2734
|
+
var _a;
|
|
2735
|
+
const plain = resolveUnref(elRef);
|
|
2736
|
+
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
const defaultWindow = isClient ? window : void 0;
|
|
2740
|
+
|
|
2741
|
+
function useEventListener(...args) {
|
|
2742
|
+
let target;
|
|
2743
|
+
let events;
|
|
2744
|
+
let listeners;
|
|
2745
|
+
let options;
|
|
2746
|
+
if (isString$1(args[0]) || Array.isArray(args[0])) {
|
|
2747
|
+
[events, listeners, options] = args;
|
|
2748
|
+
target = defaultWindow;
|
|
2749
|
+
} else {
|
|
2750
|
+
[target, events, listeners, options] = args;
|
|
2751
|
+
}
|
|
2752
|
+
if (!target)
|
|
2753
|
+
return noop;
|
|
2754
|
+
if (!Array.isArray(events))
|
|
2755
|
+
events = [events];
|
|
2756
|
+
if (!Array.isArray(listeners))
|
|
2757
|
+
listeners = [listeners];
|
|
2758
|
+
const cleanups = [];
|
|
2759
|
+
const cleanup = () => {
|
|
2760
|
+
cleanups.forEach((fn) => fn());
|
|
2761
|
+
cleanups.length = 0;
|
|
2762
|
+
};
|
|
2763
|
+
const register = (el, event, listener, options2) => {
|
|
2764
|
+
el.addEventListener(event, listener, options2);
|
|
2765
|
+
return () => el.removeEventListener(event, listener, options2);
|
|
2766
|
+
};
|
|
2767
|
+
const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
|
|
2768
|
+
cleanup();
|
|
2769
|
+
if (!el)
|
|
2770
|
+
return;
|
|
2771
|
+
cleanups.push(...events.flatMap((event) => {
|
|
2772
|
+
return listeners.map((listener) => register(el, event, listener, options2));
|
|
2773
|
+
}));
|
|
2774
|
+
}, { immediate: true, flush: "post" });
|
|
2775
|
+
const stop = () => {
|
|
2776
|
+
stopWatch();
|
|
2777
|
+
cleanup();
|
|
2778
|
+
};
|
|
2779
|
+
tryOnScopeDispose(stop);
|
|
2780
|
+
return stop;
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
function useSupported(callback, sync = false) {
|
|
2784
|
+
const isSupported = ref();
|
|
2785
|
+
const update = () => isSupported.value = Boolean(callback());
|
|
2786
|
+
update();
|
|
2787
|
+
tryOnMounted(update, sync);
|
|
2788
|
+
return isSupported;
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2792
|
+
const globalKey = "__vueuse_ssr_handlers__";
|
|
2793
|
+
_global[globalKey] = _global[globalKey] || {};
|
|
2794
|
+
|
|
2795
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
2796
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
2797
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
2798
|
+
var __objRest$2 = (source, exclude) => {
|
|
2799
|
+
var target = {};
|
|
2800
|
+
for (var prop in source)
|
|
2801
|
+
if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2802
|
+
target[prop] = source[prop];
|
|
2803
|
+
if (source != null && __getOwnPropSymbols$g)
|
|
2804
|
+
for (var prop of __getOwnPropSymbols$g(source)) {
|
|
2805
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
|
|
2806
|
+
target[prop] = source[prop];
|
|
2807
|
+
}
|
|
2808
|
+
return target;
|
|
2809
|
+
};
|
|
2810
|
+
function useResizeObserver(target, callback, options = {}) {
|
|
2811
|
+
const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]);
|
|
2812
|
+
let observer;
|
|
2813
|
+
const isSupported = useSupported(() => window && "ResizeObserver" in window);
|
|
2814
|
+
const cleanup = () => {
|
|
2815
|
+
if (observer) {
|
|
2816
|
+
observer.disconnect();
|
|
2817
|
+
observer = void 0;
|
|
2818
|
+
}
|
|
2819
|
+
};
|
|
2820
|
+
const stopWatch = watch(() => unrefElement(target), (el) => {
|
|
2821
|
+
cleanup();
|
|
2822
|
+
if (isSupported.value && window && el) {
|
|
2823
|
+
observer = new ResizeObserver(callback);
|
|
2824
|
+
observer.observe(el, observerOptions);
|
|
2825
|
+
}
|
|
2826
|
+
}, { immediate: true, flush: "post" });
|
|
2827
|
+
const stop = () => {
|
|
2828
|
+
cleanup();
|
|
2829
|
+
stopWatch();
|
|
2830
|
+
};
|
|
2831
|
+
tryOnScopeDispose(stop);
|
|
2832
|
+
return {
|
|
2833
|
+
isSupported,
|
|
2834
|
+
stop
|
|
2835
|
+
};
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
var SwipeDirection;
|
|
2839
|
+
(function(SwipeDirection2) {
|
|
2840
|
+
SwipeDirection2["UP"] = "UP";
|
|
2841
|
+
SwipeDirection2["RIGHT"] = "RIGHT";
|
|
2842
|
+
SwipeDirection2["DOWN"] = "DOWN";
|
|
2843
|
+
SwipeDirection2["LEFT"] = "LEFT";
|
|
2844
|
+
SwipeDirection2["NONE"] = "NONE";
|
|
2845
|
+
})(SwipeDirection || (SwipeDirection = {}));
|
|
2846
|
+
|
|
2847
|
+
var __defProp = Object.defineProperty;
|
|
2848
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2849
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2850
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
2851
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2852
|
+
var __spreadValues = (a, b) => {
|
|
2853
|
+
for (var prop in b || (b = {}))
|
|
2854
|
+
if (__hasOwnProp.call(b, prop))
|
|
2855
|
+
__defNormalProp(a, prop, b[prop]);
|
|
2856
|
+
if (__getOwnPropSymbols)
|
|
2857
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
2858
|
+
if (__propIsEnum.call(b, prop))
|
|
2859
|
+
__defNormalProp(a, prop, b[prop]);
|
|
2860
|
+
}
|
|
2861
|
+
return a;
|
|
2862
|
+
};
|
|
2863
|
+
const _TransitionPresets = {
|
|
2864
|
+
easeInSine: [0.12, 0, 0.39, 0],
|
|
2865
|
+
easeOutSine: [0.61, 1, 0.88, 1],
|
|
2866
|
+
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
2867
|
+
easeInQuad: [0.11, 0, 0.5, 0],
|
|
2868
|
+
easeOutQuad: [0.5, 1, 0.89, 1],
|
|
2869
|
+
easeInOutQuad: [0.45, 0, 0.55, 1],
|
|
2870
|
+
easeInCubic: [0.32, 0, 0.67, 0],
|
|
2871
|
+
easeOutCubic: [0.33, 1, 0.68, 1],
|
|
2872
|
+
easeInOutCubic: [0.65, 0, 0.35, 1],
|
|
2873
|
+
easeInQuart: [0.5, 0, 0.75, 0],
|
|
2874
|
+
easeOutQuart: [0.25, 1, 0.5, 1],
|
|
2875
|
+
easeInOutQuart: [0.76, 0, 0.24, 1],
|
|
2876
|
+
easeInQuint: [0.64, 0, 0.78, 0],
|
|
2877
|
+
easeOutQuint: [0.22, 1, 0.36, 1],
|
|
2878
|
+
easeInOutQuint: [0.83, 0, 0.17, 1],
|
|
2879
|
+
easeInExpo: [0.7, 0, 0.84, 0],
|
|
2880
|
+
easeOutExpo: [0.16, 1, 0.3, 1],
|
|
2881
|
+
easeInOutExpo: [0.87, 0, 0.13, 1],
|
|
2882
|
+
easeInCirc: [0.55, 0, 1, 0.45],
|
|
2883
|
+
easeOutCirc: [0, 0.55, 0.45, 1],
|
|
2884
|
+
easeInOutCirc: [0.85, 0, 0.15, 1],
|
|
2885
|
+
easeInBack: [0.36, 0, 0.66, -0.56],
|
|
2886
|
+
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
2887
|
+
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
2888
|
+
};
|
|
2889
|
+
__spreadValues({
|
|
2890
|
+
linear: identity
|
|
2891
|
+
}, _TransitionPresets);
|
|
2892
|
+
|
|
2893
|
+
/**
|
|
2894
|
+
* @vue/shared v3.4.27
|
|
2895
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
2896
|
+
* @license MIT
|
|
2897
|
+
**/
|
|
2898
|
+
|
|
2899
|
+
|
|
2900
|
+
|
|
2901
|
+
!!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
|
2902
|
+
!!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
|
|
2903
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2904
|
+
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
2905
|
+
const isString = (val) => typeof val === "string";
|
|
2906
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
2907
|
+
|
|
2908
|
+
/**
|
|
2909
|
+
* The inverse of `_.toPairs`; this method returns an object composed
|
|
2910
|
+
* from key-value `pairs`.
|
|
2911
|
+
*
|
|
2912
|
+
* @static
|
|
2913
|
+
* @memberOf _
|
|
2914
|
+
* @since 4.0.0
|
|
2915
|
+
* @category Array
|
|
2916
|
+
* @param {Array} pairs The key-value pairs.
|
|
2917
|
+
* @returns {Object} Returns the new object.
|
|
2918
|
+
* @example
|
|
2919
|
+
*
|
|
2920
|
+
* _.fromPairs([['a', 1], ['b', 2]]);
|
|
2921
|
+
* // => { 'a': 1, 'b': 2 }
|
|
2922
|
+
*/
|
|
2923
|
+
function fromPairs(pairs) {
|
|
2924
|
+
var index = -1,
|
|
2925
|
+
length = pairs == null ? 0 : pairs.length,
|
|
2926
|
+
result = {};
|
|
2927
|
+
|
|
2928
|
+
while (++index < length) {
|
|
2929
|
+
var pair = pairs[index];
|
|
2930
|
+
result[pair[0]] = pair[1];
|
|
2931
|
+
}
|
|
2932
|
+
return result;
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
const isNumber = (val) => typeof val === "number";
|
|
2936
|
+
const isStringNumber = (val) => {
|
|
2937
|
+
if (!isString(val)) {
|
|
2938
|
+
return false;
|
|
2939
|
+
}
|
|
2940
|
+
return !Number.isNaN(Number(val));
|
|
2941
|
+
};
|
|
2942
|
+
|
|
2943
|
+
class ElementPlusError extends Error {
|
|
2944
|
+
constructor(m) {
|
|
2945
|
+
super(m);
|
|
2946
|
+
this.name = "ElementPlusError";
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
function throwError(scope, m) {
|
|
2950
|
+
throw new ElementPlusError(`[${scope}] ${m}`);
|
|
2951
|
+
}
|
|
2952
|
+
function debugWarn(scope, message) {
|
|
2953
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2954
|
+
const error = isString(scope) ? new ElementPlusError(`[${scope}] ${message}`) : scope;
|
|
2955
|
+
console.warn(error);
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
const SCOPE = "utils/dom/style";
|
|
2960
|
+
function addUnit(value, defaultUnit = "px") {
|
|
2961
|
+
if (!value)
|
|
2962
|
+
return "";
|
|
2963
|
+
if (isNumber(value) || isStringNumber(value)) {
|
|
2964
|
+
return `${value}${defaultUnit}`;
|
|
2965
|
+
} else if (isString(value)) {
|
|
2966
|
+
return value;
|
|
2967
|
+
}
|
|
2968
|
+
debugWarn(SCOPE, "binding value must be a string or number");
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
const epPropKey = "__epPropKey";
|
|
2972
|
+
const definePropType = (val) => val;
|
|
2973
|
+
const isEpProp = (val) => isObject(val) && !!val[epPropKey];
|
|
2974
|
+
const buildProp = (prop, key) => {
|
|
2975
|
+
if (!isObject(prop) || isEpProp(prop))
|
|
2976
|
+
return prop;
|
|
2977
|
+
const { values, required, default: defaultValue, type, validator } = prop;
|
|
2978
|
+
const _validator = values || validator ? (val) => {
|
|
2979
|
+
let valid = false;
|
|
2980
|
+
let allowedValues = [];
|
|
2981
|
+
if (values) {
|
|
2982
|
+
allowedValues = Array.from(values);
|
|
2983
|
+
if (hasOwn(prop, "default")) {
|
|
2984
|
+
allowedValues.push(defaultValue);
|
|
2985
|
+
}
|
|
2986
|
+
valid || (valid = allowedValues.includes(val));
|
|
2987
|
+
}
|
|
2988
|
+
if (validator)
|
|
2989
|
+
valid || (valid = validator(val));
|
|
2990
|
+
if (!valid && allowedValues.length > 0) {
|
|
2991
|
+
const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
|
|
2992
|
+
warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
|
|
2993
|
+
}
|
|
2994
|
+
return valid;
|
|
2995
|
+
} : void 0;
|
|
2996
|
+
const epProp = {
|
|
2997
|
+
type,
|
|
2998
|
+
required: !!required,
|
|
2999
|
+
validator: _validator,
|
|
3000
|
+
[epPropKey]: true
|
|
3001
|
+
};
|
|
3002
|
+
if (hasOwn(prop, "default"))
|
|
3003
|
+
epProp.default = defaultValue;
|
|
3004
|
+
return epProp;
|
|
3005
|
+
};
|
|
3006
|
+
const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
|
|
3007
|
+
key,
|
|
3008
|
+
buildProp(option, key)
|
|
3009
|
+
]));
|
|
3010
|
+
|
|
3011
|
+
const withInstall = (main, extra) => {
|
|
3012
|
+
main.install = (app) => {
|
|
3013
|
+
for (const comp of [main, ...Object.values({})]) {
|
|
3014
|
+
app.component(comp.name, comp);
|
|
3015
|
+
}
|
|
3016
|
+
};
|
|
3017
|
+
return main;
|
|
3018
|
+
};
|
|
3019
|
+
|
|
3020
|
+
const defaultNamespace = "el";
|
|
3021
|
+
const statePrefix = "is-";
|
|
3022
|
+
const _bem = (namespace, block, blockSuffix, element, modifier) => {
|
|
3023
|
+
let cls = `${namespace}-${block}`;
|
|
3024
|
+
if (blockSuffix) {
|
|
3025
|
+
cls += `-${blockSuffix}`;
|
|
3026
|
+
}
|
|
3027
|
+
if (element) {
|
|
3028
|
+
cls += `__${element}`;
|
|
3029
|
+
}
|
|
3030
|
+
if (modifier) {
|
|
3031
|
+
cls += `--${modifier}`;
|
|
3032
|
+
}
|
|
3033
|
+
return cls;
|
|
3034
|
+
};
|
|
3035
|
+
const namespaceContextKey = Symbol("namespaceContextKey");
|
|
3036
|
+
const useGetDerivedNamespace = (namespaceOverrides) => {
|
|
3037
|
+
const derivedNamespace = (getCurrentInstance$1() ? inject(namespaceContextKey, ref$1(defaultNamespace)) : ref$1(defaultNamespace));
|
|
3038
|
+
const namespace = computed(() => {
|
|
3039
|
+
return unref$1(derivedNamespace) || defaultNamespace;
|
|
3040
|
+
});
|
|
3041
|
+
return namespace;
|
|
3042
|
+
};
|
|
3043
|
+
const useNamespace = (block, namespaceOverrides) => {
|
|
3044
|
+
const namespace = useGetDerivedNamespace();
|
|
3045
|
+
const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
|
|
3046
|
+
const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
|
|
3047
|
+
const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
|
|
3048
|
+
const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
|
|
3049
|
+
const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
|
|
3050
|
+
const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
|
|
3051
|
+
const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
|
|
3052
|
+
const is = (name, ...args) => {
|
|
3053
|
+
const state = args.length >= 1 ? args[0] : true;
|
|
3054
|
+
return name && state ? `${statePrefix}${name}` : "";
|
|
3055
|
+
};
|
|
3056
|
+
const cssVar = (object) => {
|
|
3057
|
+
const styles = {};
|
|
3058
|
+
for (const key in object) {
|
|
3059
|
+
if (object[key]) {
|
|
3060
|
+
styles[`--${namespace.value}-${key}`] = object[key];
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
return styles;
|
|
3064
|
+
};
|
|
3065
|
+
const cssVarBlock = (object) => {
|
|
3066
|
+
const styles = {};
|
|
3067
|
+
for (const key in object) {
|
|
3068
|
+
if (object[key]) {
|
|
3069
|
+
styles[`--${namespace.value}-${block}-${key}`] = object[key];
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
return styles;
|
|
3073
|
+
};
|
|
3074
|
+
const cssVarName = (name) => `--${namespace.value}-${name}`;
|
|
3075
|
+
const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
|
|
3076
|
+
return {
|
|
3077
|
+
namespace,
|
|
3078
|
+
b,
|
|
3079
|
+
e,
|
|
3080
|
+
m,
|
|
3081
|
+
be,
|
|
3082
|
+
em,
|
|
3083
|
+
bm,
|
|
3084
|
+
bem,
|
|
3085
|
+
is,
|
|
3086
|
+
cssVar,
|
|
3087
|
+
cssVarName,
|
|
3088
|
+
cssVarBlock,
|
|
3089
|
+
cssVarBlockName
|
|
3090
|
+
};
|
|
3091
|
+
};
|
|
3092
|
+
|
|
3093
|
+
var _export_sfc$1 = (sfc, props) => {
|
|
3094
|
+
const target = sfc.__vccOpts || sfc;
|
|
3095
|
+
for (const [key, val] of props) {
|
|
3096
|
+
target[key] = val;
|
|
3097
|
+
}
|
|
3098
|
+
return target;
|
|
3099
|
+
};
|
|
3100
|
+
|
|
3101
|
+
const GAP = 4;
|
|
3102
|
+
const BAR_MAP = {
|
|
3103
|
+
vertical: {
|
|
3104
|
+
offset: "offsetHeight",
|
|
3105
|
+
scroll: "scrollTop",
|
|
3106
|
+
scrollSize: "scrollHeight",
|
|
3107
|
+
size: "height",
|
|
3108
|
+
key: "vertical",
|
|
3109
|
+
axis: "Y",
|
|
3110
|
+
client: "clientY",
|
|
3111
|
+
direction: "top"
|
|
3112
|
+
},
|
|
3113
|
+
horizontal: {
|
|
3114
|
+
offset: "offsetWidth",
|
|
3115
|
+
scroll: "scrollLeft",
|
|
3116
|
+
scrollSize: "scrollWidth",
|
|
3117
|
+
size: "width",
|
|
3118
|
+
key: "horizontal",
|
|
3119
|
+
axis: "X",
|
|
3120
|
+
client: "clientX",
|
|
3121
|
+
direction: "left"
|
|
3122
|
+
}
|
|
3123
|
+
};
|
|
3124
|
+
const renderThumbStyle = ({
|
|
3125
|
+
move,
|
|
3126
|
+
size,
|
|
3127
|
+
bar
|
|
3128
|
+
}) => ({
|
|
3129
|
+
[bar.size]: size,
|
|
3130
|
+
transform: `translate${bar.axis}(${move}%)`
|
|
3131
|
+
});
|
|
3132
|
+
|
|
3133
|
+
const scrollbarContextKey = Symbol("scrollbarContextKey");
|
|
3134
|
+
|
|
3135
|
+
const thumbProps = buildProps({
|
|
3136
|
+
vertical: Boolean,
|
|
3137
|
+
size: String,
|
|
3138
|
+
move: Number,
|
|
3139
|
+
ratio: {
|
|
3140
|
+
type: Number,
|
|
3141
|
+
required: true
|
|
3142
|
+
},
|
|
3143
|
+
always: Boolean
|
|
3144
|
+
});
|
|
3145
|
+
|
|
3146
|
+
const COMPONENT_NAME$1 = "Thumb";
|
|
3147
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3148
|
+
__name: "thumb",
|
|
3149
|
+
props: thumbProps,
|
|
3150
|
+
setup(__props) {
|
|
3151
|
+
const props = __props;
|
|
3152
|
+
const scrollbar = inject(scrollbarContextKey);
|
|
3153
|
+
const ns = useNamespace("scrollbar");
|
|
3154
|
+
if (!scrollbar)
|
|
3155
|
+
throwError(COMPONENT_NAME$1, "can not inject scrollbar context");
|
|
3156
|
+
const instance = ref$1();
|
|
3157
|
+
const thumb = ref$1();
|
|
3158
|
+
const thumbState = ref$1({});
|
|
3159
|
+
const visible = ref$1(false);
|
|
3160
|
+
let cursorDown = false;
|
|
3161
|
+
let cursorLeave = false;
|
|
3162
|
+
let originalOnSelectStart = isClient ? document.onselectstart : null;
|
|
3163
|
+
const bar = computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
|
|
3164
|
+
const thumbStyle = computed(() => renderThumbStyle({
|
|
3165
|
+
size: props.size,
|
|
3166
|
+
move: props.move,
|
|
3167
|
+
bar: bar.value
|
|
3168
|
+
}));
|
|
3169
|
+
const offsetRatio = computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
|
|
3170
|
+
const clickThumbHandler = (e) => {
|
|
3171
|
+
var _a;
|
|
3172
|
+
e.stopPropagation();
|
|
3173
|
+
if (e.ctrlKey || [1, 2].includes(e.button))
|
|
3174
|
+
return;
|
|
3175
|
+
(_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();
|
|
3176
|
+
startDrag(e);
|
|
3177
|
+
const el = e.currentTarget;
|
|
3178
|
+
if (!el)
|
|
3179
|
+
return;
|
|
3180
|
+
thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
|
|
3181
|
+
};
|
|
3182
|
+
const clickTrackHandler = (e) => {
|
|
3183
|
+
if (!thumb.value || !instance.value || !scrollbar.wrapElement)
|
|
3184
|
+
return;
|
|
3185
|
+
const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
|
|
3186
|
+
const thumbHalf = thumb.value[bar.value.offset] / 2;
|
|
3187
|
+
const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
|
|
3188
|
+
scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
|
|
3189
|
+
};
|
|
3190
|
+
const startDrag = (e) => {
|
|
3191
|
+
e.stopImmediatePropagation();
|
|
3192
|
+
cursorDown = true;
|
|
3193
|
+
document.addEventListener("mousemove", mouseMoveDocumentHandler);
|
|
3194
|
+
document.addEventListener("mouseup", mouseUpDocumentHandler);
|
|
3195
|
+
originalOnSelectStart = document.onselectstart;
|
|
3196
|
+
document.onselectstart = () => false;
|
|
3197
|
+
};
|
|
3198
|
+
const mouseMoveDocumentHandler = (e) => {
|
|
3199
|
+
if (!instance.value || !thumb.value)
|
|
3200
|
+
return;
|
|
3201
|
+
if (cursorDown === false)
|
|
3202
|
+
return;
|
|
3203
|
+
const prevPage = thumbState.value[bar.value.axis];
|
|
3204
|
+
if (!prevPage)
|
|
3205
|
+
return;
|
|
3206
|
+
const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
|
|
3207
|
+
const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
|
|
3208
|
+
const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
|
|
3209
|
+
scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
|
|
3210
|
+
};
|
|
3211
|
+
const mouseUpDocumentHandler = () => {
|
|
3212
|
+
cursorDown = false;
|
|
3213
|
+
thumbState.value[bar.value.axis] = 0;
|
|
3214
|
+
document.removeEventListener("mousemove", mouseMoveDocumentHandler);
|
|
3215
|
+
document.removeEventListener("mouseup", mouseUpDocumentHandler);
|
|
3216
|
+
restoreOnselectstart();
|
|
3217
|
+
if (cursorLeave)
|
|
3218
|
+
visible.value = false;
|
|
3219
|
+
};
|
|
3220
|
+
const mouseMoveScrollbarHandler = () => {
|
|
3221
|
+
cursorLeave = false;
|
|
3222
|
+
visible.value = !!props.size;
|
|
3223
|
+
};
|
|
3224
|
+
const mouseLeaveScrollbarHandler = () => {
|
|
3225
|
+
cursorLeave = true;
|
|
3226
|
+
visible.value = cursorDown;
|
|
3227
|
+
};
|
|
3228
|
+
onBeforeUnmount(() => {
|
|
3229
|
+
restoreOnselectstart();
|
|
3230
|
+
document.removeEventListener("mouseup", mouseUpDocumentHandler);
|
|
3231
|
+
});
|
|
3232
|
+
const restoreOnselectstart = () => {
|
|
3233
|
+
if (document.onselectstart !== originalOnSelectStart)
|
|
3234
|
+
document.onselectstart = originalOnSelectStart;
|
|
3235
|
+
};
|
|
3236
|
+
useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
|
|
3237
|
+
useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
|
|
3238
|
+
return (_ctx, _cache) => {
|
|
3239
|
+
return openBlock(), createBlock(Transition, {
|
|
3240
|
+
name: unref$1(ns).b("fade"),
|
|
3241
|
+
persisted: ""
|
|
3242
|
+
}, {
|
|
3243
|
+
default: withCtx(() => [
|
|
3244
|
+
withDirectives(createElementVNode("div", {
|
|
3245
|
+
ref_key: "instance",
|
|
3246
|
+
ref: instance,
|
|
3247
|
+
class: normalizeClass([unref$1(ns).e("bar"), unref$1(ns).is(unref$1(bar).key)]),
|
|
3248
|
+
onMousedown: clickTrackHandler
|
|
3249
|
+
}, [
|
|
3250
|
+
createElementVNode("div", {
|
|
3251
|
+
ref_key: "thumb",
|
|
3252
|
+
ref: thumb,
|
|
3253
|
+
class: normalizeClass(unref$1(ns).e("thumb")),
|
|
3254
|
+
style: normalizeStyle(unref$1(thumbStyle)),
|
|
3255
|
+
onMousedown: clickThumbHandler
|
|
3256
|
+
}, null, 38)
|
|
3257
|
+
], 34), [
|
|
3258
|
+
[vShow, _ctx.always || visible.value]
|
|
3259
|
+
])
|
|
3260
|
+
]),
|
|
3261
|
+
_: 1
|
|
3262
|
+
}, 8, ["name"]);
|
|
3263
|
+
};
|
|
3264
|
+
}
|
|
3265
|
+
});
|
|
3266
|
+
var Thumb = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/thumb.vue"]]);
|
|
3267
|
+
|
|
3268
|
+
const barProps = buildProps({
|
|
3269
|
+
always: {
|
|
3270
|
+
type: Boolean,
|
|
3271
|
+
default: true
|
|
3272
|
+
},
|
|
3273
|
+
width: String,
|
|
3274
|
+
height: String,
|
|
3275
|
+
ratioX: {
|
|
3276
|
+
type: Number,
|
|
3277
|
+
default: 1
|
|
3278
|
+
},
|
|
3279
|
+
ratioY: {
|
|
3280
|
+
type: Number,
|
|
3281
|
+
default: 1
|
|
3282
|
+
}
|
|
3283
|
+
});
|
|
3284
|
+
|
|
3285
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3286
|
+
__name: "bar",
|
|
3287
|
+
props: barProps,
|
|
3288
|
+
setup(__props, { expose }) {
|
|
3289
|
+
const props = __props;
|
|
3290
|
+
const moveX = ref$1(0);
|
|
3291
|
+
const moveY = ref$1(0);
|
|
3292
|
+
const handleScroll = (wrap) => {
|
|
3293
|
+
if (wrap) {
|
|
3294
|
+
const offsetHeight = wrap.offsetHeight - GAP;
|
|
3295
|
+
const offsetWidth = wrap.offsetWidth - GAP;
|
|
3296
|
+
moveY.value = wrap.scrollTop * 100 / offsetHeight * props.ratioY;
|
|
3297
|
+
moveX.value = wrap.scrollLeft * 100 / offsetWidth * props.ratioX;
|
|
3298
|
+
}
|
|
3299
|
+
};
|
|
3300
|
+
expose({
|
|
3301
|
+
handleScroll
|
|
3302
|
+
});
|
|
3303
|
+
return (_ctx, _cache) => {
|
|
3304
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
3305
|
+
createVNode(Thumb, {
|
|
3306
|
+
move: moveX.value,
|
|
3307
|
+
ratio: _ctx.ratioX,
|
|
3308
|
+
size: _ctx.width,
|
|
3309
|
+
always: _ctx.always
|
|
3310
|
+
}, null, 8, ["move", "ratio", "size", "always"]),
|
|
3311
|
+
createVNode(Thumb, {
|
|
3312
|
+
move: moveY.value,
|
|
3313
|
+
ratio: _ctx.ratioY,
|
|
3314
|
+
size: _ctx.height,
|
|
3315
|
+
vertical: "",
|
|
3316
|
+
always: _ctx.always
|
|
3317
|
+
}, null, 8, ["move", "ratio", "size", "always"])
|
|
3318
|
+
], 64);
|
|
3319
|
+
};
|
|
3320
|
+
}
|
|
3321
|
+
});
|
|
3322
|
+
var Bar = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/bar.vue"]]);
|
|
3323
|
+
|
|
3324
|
+
const scrollbarProps = buildProps({
|
|
3325
|
+
height: {
|
|
3326
|
+
type: [String, Number],
|
|
3327
|
+
default: ""
|
|
3328
|
+
},
|
|
3329
|
+
maxHeight: {
|
|
3330
|
+
type: [String, Number],
|
|
3331
|
+
default: ""
|
|
3332
|
+
},
|
|
3333
|
+
native: {
|
|
3334
|
+
type: Boolean,
|
|
3335
|
+
default: false
|
|
3336
|
+
},
|
|
3337
|
+
wrapStyle: {
|
|
3338
|
+
type: definePropType([String, Object, Array]),
|
|
3339
|
+
default: ""
|
|
3340
|
+
},
|
|
3341
|
+
wrapClass: {
|
|
3342
|
+
type: [String, Array],
|
|
3343
|
+
default: ""
|
|
3344
|
+
},
|
|
3345
|
+
viewClass: {
|
|
3346
|
+
type: [String, Array],
|
|
3347
|
+
default: ""
|
|
3348
|
+
},
|
|
3349
|
+
viewStyle: {
|
|
3350
|
+
type: [String, Array, Object],
|
|
3351
|
+
default: ""
|
|
3352
|
+
},
|
|
3353
|
+
noresize: Boolean,
|
|
3354
|
+
tag: {
|
|
3355
|
+
type: String,
|
|
3356
|
+
default: "div"
|
|
3357
|
+
},
|
|
3358
|
+
always: Boolean,
|
|
3359
|
+
minSize: {
|
|
3360
|
+
type: Number,
|
|
3361
|
+
default: 20
|
|
3362
|
+
},
|
|
3363
|
+
id: String,
|
|
3364
|
+
role: String,
|
|
3365
|
+
ariaLabel: String,
|
|
3366
|
+
ariaOrientation: {
|
|
3367
|
+
type: String,
|
|
3368
|
+
values: ["horizontal", "vertical"]
|
|
3369
|
+
}
|
|
3370
|
+
});
|
|
3371
|
+
const scrollbarEmits = {
|
|
3372
|
+
scroll: ({
|
|
3373
|
+
scrollTop,
|
|
3374
|
+
scrollLeft
|
|
3375
|
+
}) => [scrollTop, scrollLeft].every(isNumber)
|
|
3376
|
+
};
|
|
3377
|
+
|
|
3378
|
+
const COMPONENT_NAME = "ElScrollbar";
|
|
3379
|
+
const __default__ = defineComponent({
|
|
3380
|
+
name: COMPONENT_NAME
|
|
3381
|
+
});
|
|
3382
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3383
|
+
...__default__,
|
|
3384
|
+
props: scrollbarProps,
|
|
3385
|
+
emits: scrollbarEmits,
|
|
3386
|
+
setup(__props, { expose, emit }) {
|
|
3387
|
+
const props = __props;
|
|
3388
|
+
const ns = useNamespace("scrollbar");
|
|
3389
|
+
let stopResizeObserver = void 0;
|
|
3390
|
+
let stopResizeListener = void 0;
|
|
3391
|
+
const scrollbarRef = ref$1();
|
|
3392
|
+
const wrapRef = ref$1();
|
|
3393
|
+
const resizeRef = ref$1();
|
|
3394
|
+
const sizeWidth = ref$1("0");
|
|
3395
|
+
const sizeHeight = ref$1("0");
|
|
3396
|
+
const barRef = ref$1();
|
|
3397
|
+
const ratioY = ref$1(1);
|
|
3398
|
+
const ratioX = ref$1(1);
|
|
3399
|
+
const wrapStyle = computed(() => {
|
|
3400
|
+
const style = {};
|
|
3401
|
+
if (props.height)
|
|
3402
|
+
style.height = addUnit(props.height);
|
|
3403
|
+
if (props.maxHeight)
|
|
3404
|
+
style.maxHeight = addUnit(props.maxHeight);
|
|
3405
|
+
return [props.wrapStyle, style];
|
|
3406
|
+
});
|
|
3407
|
+
const wrapKls = computed(() => {
|
|
3408
|
+
return [
|
|
3409
|
+
props.wrapClass,
|
|
3410
|
+
ns.e("wrap"),
|
|
3411
|
+
{ [ns.em("wrap", "hidden-default")]: !props.native }
|
|
3412
|
+
];
|
|
3413
|
+
});
|
|
3414
|
+
const resizeKls = computed(() => {
|
|
3415
|
+
return [ns.e("view"), props.viewClass];
|
|
3416
|
+
});
|
|
3417
|
+
const handleScroll = () => {
|
|
3418
|
+
var _a;
|
|
3419
|
+
if (wrapRef.value) {
|
|
3420
|
+
(_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
|
|
3421
|
+
emit("scroll", {
|
|
3422
|
+
scrollTop: wrapRef.value.scrollTop,
|
|
3423
|
+
scrollLeft: wrapRef.value.scrollLeft
|
|
3424
|
+
});
|
|
3425
|
+
}
|
|
3426
|
+
};
|
|
3427
|
+
function scrollTo(arg1, arg2) {
|
|
3428
|
+
if (isObject(arg1)) {
|
|
3429
|
+
wrapRef.value.scrollTo(arg1);
|
|
3430
|
+
} else if (isNumber(arg1) && isNumber(arg2)) {
|
|
3431
|
+
wrapRef.value.scrollTo(arg1, arg2);
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
const setScrollTop = (value) => {
|
|
3435
|
+
if (!isNumber(value)) {
|
|
3436
|
+
debugWarn(COMPONENT_NAME, "value must be a number");
|
|
3437
|
+
return;
|
|
3438
|
+
}
|
|
3439
|
+
wrapRef.value.scrollTop = value;
|
|
3440
|
+
};
|
|
3441
|
+
const setScrollLeft = (value) => {
|
|
3442
|
+
if (!isNumber(value)) {
|
|
3443
|
+
debugWarn(COMPONENT_NAME, "value must be a number");
|
|
3444
|
+
return;
|
|
3445
|
+
}
|
|
3446
|
+
wrapRef.value.scrollLeft = value;
|
|
3447
|
+
};
|
|
3448
|
+
const update = () => {
|
|
3449
|
+
if (!wrapRef.value)
|
|
3450
|
+
return;
|
|
3451
|
+
const offsetHeight = wrapRef.value.offsetHeight - GAP;
|
|
3452
|
+
const offsetWidth = wrapRef.value.offsetWidth - GAP;
|
|
3453
|
+
const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight;
|
|
3454
|
+
const originalWidth = offsetWidth ** 2 / wrapRef.value.scrollWidth;
|
|
3455
|
+
const height = Math.max(originalHeight, props.minSize);
|
|
3456
|
+
const width = Math.max(originalWidth, props.minSize);
|
|
3457
|
+
ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
|
|
3458
|
+
ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
|
|
3459
|
+
sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
|
|
3460
|
+
sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
|
|
3461
|
+
};
|
|
3462
|
+
watch$1(() => props.noresize, (noresize) => {
|
|
3463
|
+
if (noresize) {
|
|
3464
|
+
stopResizeObserver == null ? void 0 : stopResizeObserver();
|
|
3465
|
+
stopResizeListener == null ? void 0 : stopResizeListener();
|
|
3466
|
+
} else {
|
|
3467
|
+
({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
|
|
3468
|
+
stopResizeListener = useEventListener("resize", update);
|
|
3469
|
+
}
|
|
3470
|
+
}, { immediate: true });
|
|
3471
|
+
watch$1(() => [props.maxHeight, props.height], () => {
|
|
3472
|
+
if (!props.native)
|
|
3473
|
+
nextTick$1(() => {
|
|
3474
|
+
var _a;
|
|
3475
|
+
update();
|
|
3476
|
+
if (wrapRef.value) {
|
|
3477
|
+
(_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
|
|
3478
|
+
}
|
|
3479
|
+
});
|
|
3480
|
+
});
|
|
3481
|
+
provide(scrollbarContextKey, reactive({
|
|
3482
|
+
scrollbarElement: scrollbarRef,
|
|
3483
|
+
wrapElement: wrapRef
|
|
3484
|
+
}));
|
|
3485
|
+
onMounted$1(() => {
|
|
3486
|
+
if (!props.native)
|
|
3487
|
+
nextTick$1(() => {
|
|
3488
|
+
update();
|
|
3489
|
+
});
|
|
3490
|
+
});
|
|
3491
|
+
onUpdated(() => update());
|
|
3492
|
+
expose({
|
|
3493
|
+
wrapRef,
|
|
3494
|
+
update,
|
|
3495
|
+
scrollTo,
|
|
3496
|
+
setScrollTop,
|
|
3497
|
+
setScrollLeft,
|
|
3498
|
+
handleScroll
|
|
3499
|
+
});
|
|
3500
|
+
return (_ctx, _cache) => {
|
|
3501
|
+
return openBlock(), createElementBlock("div", {
|
|
3502
|
+
ref_key: "scrollbarRef",
|
|
3503
|
+
ref: scrollbarRef,
|
|
3504
|
+
class: normalizeClass(unref$1(ns).b())
|
|
3505
|
+
}, [
|
|
3506
|
+
createElementVNode("div", {
|
|
3507
|
+
ref_key: "wrapRef",
|
|
3508
|
+
ref: wrapRef,
|
|
3509
|
+
class: normalizeClass(unref$1(wrapKls)),
|
|
3510
|
+
style: normalizeStyle(unref$1(wrapStyle)),
|
|
3511
|
+
onScroll: handleScroll
|
|
3512
|
+
}, [
|
|
3513
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
3514
|
+
id: _ctx.id,
|
|
3515
|
+
ref_key: "resizeRef",
|
|
3516
|
+
ref: resizeRef,
|
|
3517
|
+
class: normalizeClass(unref$1(resizeKls)),
|
|
3518
|
+
style: normalizeStyle(_ctx.viewStyle),
|
|
3519
|
+
role: _ctx.role,
|
|
3520
|
+
"aria-label": _ctx.ariaLabel,
|
|
3521
|
+
"aria-orientation": _ctx.ariaOrientation
|
|
3522
|
+
}, {
|
|
3523
|
+
default: withCtx(() => [
|
|
3524
|
+
renderSlot(_ctx.$slots, "default")
|
|
3525
|
+
]),
|
|
3526
|
+
_: 3
|
|
3527
|
+
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
|
|
3528
|
+
], 38),
|
|
3529
|
+
!_ctx.native ? (openBlock(), createBlock(Bar, {
|
|
3530
|
+
key: 0,
|
|
3531
|
+
ref_key: "barRef",
|
|
3532
|
+
ref: barRef,
|
|
3533
|
+
height: sizeHeight.value,
|
|
3534
|
+
width: sizeWidth.value,
|
|
3535
|
+
always: _ctx.always,
|
|
3536
|
+
"ratio-x": ratioX.value,
|
|
3537
|
+
"ratio-y": ratioY.value
|
|
3538
|
+
}, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
|
|
3539
|
+
], 2);
|
|
3540
|
+
};
|
|
3541
|
+
}
|
|
3542
|
+
});
|
|
3543
|
+
var Scrollbar$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
|
|
3544
|
+
|
|
3545
|
+
const ElScrollbar = withInstall(Scrollbar$1);
|
|
3546
|
+
|
|
3547
|
+
function useZoomObserver(target, scrollbarRef) {
|
|
3548
|
+
if (!target || !scrollbarRef.value) return;
|
|
3549
|
+
let zoomObserver = null;
|
|
3550
|
+
let zoomTimer = null;
|
|
3551
|
+
zoomObserver = new MutationObserver((mutations) => {
|
|
3552
|
+
for (let i = 0; i < mutations.length; i++) {
|
|
3553
|
+
if (mutations[i].type === "attributes" && mutations[i].attributeName === "style") {
|
|
3554
|
+
if (/zoom|scale/g.test(mutations[i].target?.style?.cssText)) {
|
|
3555
|
+
if (zoomTimer) clearTimeout(zoomTimer);
|
|
3556
|
+
zoomTimer = setTimeout(() => {
|
|
3557
|
+
scrollbarRef.value?.update();
|
|
3558
|
+
}, 200);
|
|
3559
|
+
break;
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
});
|
|
3564
|
+
const zoomConfig = { attributes: true };
|
|
3565
|
+
for (let i = 0; i < target.children[0].children.length; i++) {
|
|
3566
|
+
if (zoomObserver) zoomObserver.observe(target.children[0].children[i], zoomConfig);
|
|
3567
|
+
}
|
|
3568
|
+
onUnmounted(() => {
|
|
3569
|
+
if (zoomObserver) zoomObserver.disconnect();
|
|
3570
|
+
});
|
|
3571
|
+
}
|
|
3572
|
+
let prevScrollHeight = 0;
|
|
3573
|
+
function useChildListObserver(target, scrollbarRef) {
|
|
3574
|
+
if (!target || !scrollbarRef.value) return;
|
|
3575
|
+
let observer = null;
|
|
3576
|
+
let childTimer = null;
|
|
3577
|
+
observer = new MutationObserver((mutations) => {
|
|
3578
|
+
for (let i = 0; i < mutations.length; i++) {
|
|
3579
|
+
if (mutations[i].type === "childList") {
|
|
3580
|
+
if (childTimer) clearTimeout(childTimer);
|
|
3581
|
+
childTimer = setTimeout(() => {
|
|
3582
|
+
scrollbarRef.value?.update();
|
|
3583
|
+
}, 200);
|
|
3584
|
+
break;
|
|
3585
|
+
} else if (mutations[i].type === "attributes" && target?.scrollHeight !== prevScrollHeight) {
|
|
3586
|
+
prevScrollHeight = target?.scrollHeight;
|
|
3587
|
+
if (childTimer) clearTimeout(childTimer);
|
|
3588
|
+
childTimer = setTimeout(() => {
|
|
3589
|
+
scrollbarRef.value?.update();
|
|
3590
|
+
}, 200);
|
|
3591
|
+
break;
|
|
3592
|
+
}
|
|
3593
|
+
}
|
|
3594
|
+
});
|
|
3595
|
+
const config = { childList: true, subtree: true, attributes: true };
|
|
3596
|
+
if (observer) observer.observe(target, config);
|
|
3597
|
+
onUnmounted(() => {
|
|
3598
|
+
if (observer) observer.disconnect();
|
|
3599
|
+
});
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3603
|
+
__name: "scrollbar",
|
|
3604
|
+
props: {
|
|
3605
|
+
wrapClass: { type: String, required: false, default: "" },
|
|
3606
|
+
viewClass: { type: String, required: false, default: "" }
|
|
3607
|
+
},
|
|
3608
|
+
setup(__props, { expose: __expose }) {
|
|
3609
|
+
__expose();
|
|
3610
|
+
const props = __props;
|
|
3611
|
+
const scrollbarRef = ref$1(null);
|
|
3612
|
+
function getFlexStyles(element) {
|
|
3613
|
+
var styles = window.getComputedStyle(element);
|
|
3614
|
+
var flexStyles = {
|
|
3615
|
+
display: styles.display,
|
|
3616
|
+
"flex-direction": styles["flex-direction"],
|
|
3617
|
+
"flex-wrap": styles["flex-wrap"],
|
|
3618
|
+
"flex-flow": styles["flex-flow"],
|
|
3619
|
+
"justify-content": styles["justify-content"],
|
|
3620
|
+
"align-items": styles["align-items"],
|
|
3621
|
+
"align-content": styles["align-content"],
|
|
3622
|
+
"flex-grow": styles["flex-grow"],
|
|
3623
|
+
"flex-shrink": styles["flex-shrink"],
|
|
3624
|
+
"flex-basis": styles["flex-basis"],
|
|
3625
|
+
flex: styles.flex,
|
|
3626
|
+
order: styles.order
|
|
3627
|
+
};
|
|
3628
|
+
console.log(element, flexStyles.display);
|
|
3629
|
+
return flexStyles.display === "flex" ? flexStyles : {};
|
|
3630
|
+
}
|
|
3631
|
+
const popupZIndex = ref$1(1);
|
|
3632
|
+
const scrollbarStyle = computed(() => ({
|
|
3633
|
+
"--das-ui-scrollbar-z-index": popupZIndex.value
|
|
3634
|
+
}));
|
|
3635
|
+
const scrollbarClassName = ref$1("");
|
|
3636
|
+
let observer = null;
|
|
3637
|
+
let zoomObserver = null;
|
|
3638
|
+
onMounted$1(() => {
|
|
3639
|
+
scrollbarClassName.value = `das-scrollbar-pro-${parseInt(Math.random() * 1e8)}`;
|
|
3640
|
+
createStyle(scrollbarClassName.value, [
|
|
3641
|
+
{
|
|
3642
|
+
className: `.das-scrollbar-pro-wrap .inherit-scrollbar-parent-flex`,
|
|
3643
|
+
style: getFlexStyles(scrollbarRef.value.wrapRef.parentNode.parentNode)
|
|
3644
|
+
}
|
|
3645
|
+
]);
|
|
3646
|
+
popupZIndex.value = useZIndex().nextZIndex();
|
|
3647
|
+
const targetNode = scrollbarRef.value.wrapRef;
|
|
3648
|
+
console.log("targetNode-----------", targetNode.children[0].children);
|
|
3649
|
+
useChildListObserver(targetNode, scrollbarRef);
|
|
3650
|
+
useZoomObserver(targetNode, scrollbarRef);
|
|
3651
|
+
});
|
|
3652
|
+
const __returned__ = { props, scrollbarRef, getFlexStyles, popupZIndex, scrollbarStyle, scrollbarClassName, get observer() {
|
|
3653
|
+
return observer;
|
|
3654
|
+
}, set observer(v) {
|
|
3655
|
+
observer = v;
|
|
3656
|
+
}, get zoomObserver() {
|
|
3657
|
+
return zoomObserver;
|
|
3658
|
+
}, set zoomObserver(v) {
|
|
3659
|
+
zoomObserver = v;
|
|
3660
|
+
}, get ElScrollbar() {
|
|
3661
|
+
return ElScrollbar;
|
|
3662
|
+
} };
|
|
3663
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
3664
|
+
return __returned__;
|
|
3665
|
+
}
|
|
3666
|
+
});
|
|
3667
|
+
|
|
3668
|
+
var _export_sfc = (sfc, props) => {
|
|
3669
|
+
const target = sfc.__vccOpts || sfc;
|
|
3670
|
+
for (const [key, val] of props) {
|
|
3671
|
+
target[key] = val;
|
|
3672
|
+
}
|
|
3673
|
+
return target;
|
|
3674
|
+
};
|
|
3675
|
+
|
|
3676
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3677
|
+
return openBlock(), createBlock($setup["ElScrollbar"], mergeProps({
|
|
3678
|
+
ref: "scrollbarRef",
|
|
3679
|
+
class: "das-scrollbar-pro " + $setup.scrollbarClassName
|
|
3680
|
+
}, _ctx.$attrs, {
|
|
3681
|
+
"wrap-class": "das-scrollbar-pro-wrap " + $props.wrapClass,
|
|
3682
|
+
"view-class": "das-scrollbar-pro-view inherit-scrollbar-parent-flex" + $props.viewClass,
|
|
3683
|
+
style: $setup.scrollbarStyle
|
|
3684
|
+
}), {
|
|
3685
|
+
default: withCtx(() => [
|
|
3686
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
3687
|
+
]),
|
|
3688
|
+
_: 3
|
|
3689
|
+
/* FORWARDED */
|
|
3690
|
+
}, 16, ["class", "wrap-class", "view-class", "style"]);
|
|
3691
|
+
}
|
|
3692
|
+
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-41d11606"], ["__file", "/Users/xiecp/das/das-fe/framework/packages/das-ui/packages/components/scrollbar/src/scrollbar.vue"]]);
|
|
3693
|
+
|
|
3694
|
+
const DasScrollbar = withInstall$1(Scrollbar);
|
|
3695
|
+
|
|
3696
|
+
export { DasScrollbar, scrollbar as vScrollbar };
|