bkui-vue 1.0.3-beta.60 → 1.0.3-beta.60.scrollbar.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +52 -50
- package/dist/index.esm.js +14678 -13989
- package/dist/index.umd.js +52 -50
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/index.js +1 -1
- package/lib/alert/index.js +1 -1
- package/lib/animate-number/index.js +7 -8
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/index.js +1 -1
- package/lib/button/index.js +1 -1
- package/lib/card/index.js +1 -1
- package/lib/cascader/index.js +38 -42
- package/lib/checkbox/index.js +6 -7
- package/lib/collapse/index.js +11 -12
- package/lib/collapse-transition/index.js +3 -4
- package/lib/color-picker/index.js +10 -13
- package/lib/components.d.ts +0 -1
- package/lib/components.js +1 -2
- package/lib/config-provider/index.js +1 -1
- package/lib/container/index.js +10 -12
- package/lib/date-picker/index.js +2 -2
- package/lib/dialog/dialog.css +9 -7
- package/lib/dialog/dialog.variable.css +9 -7
- package/lib/dialog/index.js +4 -4
- package/lib/directives/index.js +1 -1
- package/lib/divider/index.js +2 -3
- package/lib/dropdown/index.js +6 -8
- package/lib/exception/index.js +1 -1
- package/lib/fixed-navbar/index.js +2 -3
- package/lib/form/index.js +1 -1
- package/lib/icon/angle-double-down-line.js +1 -1
- package/lib/icon/angle-double-left-line.js +1 -1
- package/lib/icon/angle-double-left.js +1 -1
- package/lib/icon/angle-double-right-line.js +1 -1
- package/lib/icon/angle-double-right.js +1 -1
- package/lib/icon/angle-double-up-line.js +1 -1
- package/lib/icon/angle-down-fill.js +1 -1
- package/lib/icon/angle-down-line.js +1 -1
- package/lib/icon/angle-down.js +1 -1
- package/lib/icon/angle-left.js +1 -1
- package/lib/icon/angle-right.js +1 -1
- package/lib/icon/angle-up-fill.js +1 -1
- package/lib/icon/angle-up.js +1 -1
- package/lib/icon/archive-fill.js +1 -1
- package/lib/icon/arrows-left.js +1 -1
- package/lib/icon/arrows-right.js +1 -1
- package/lib/icon/assistant.js +1 -1
- package/lib/icon/audio-fill.js +1 -1
- package/lib/icon/bk.js +1 -1
- package/lib/icon/circle.js +1 -1
- package/lib/icon/close-line.js +1 -1
- package/lib/icon/close.js +1 -1
- package/lib/icon/code.js +1 -1
- package/lib/icon/cog-shape.js +1 -1
- package/lib/icon/collapse-left.js +1 -1
- package/lib/icon/copy-shape.js +1 -1
- package/lib/icon/copy.js +1 -1
- package/lib/icon/data-shape.js +1 -1
- package/lib/icon/del.js +1 -1
- package/lib/icon/doc-fill.js +1 -1
- package/lib/icon/done.js +1 -1
- package/lib/icon/down-shape.js +1 -1
- package/lib/icon/down-small.js +1 -1
- package/lib/icon/edit-line.js +1 -1
- package/lib/icon/ellipsis.js +1 -1
- package/lib/icon/enlarge-line.js +1 -1
- package/lib/icon/error.js +1 -1
- package/lib/icon/excel-fill.js +1 -1
- package/lib/icon/exclamation-circle-shape.js +1 -1
- package/lib/icon/eye.js +1 -1
- package/lib/icon/filliscreen-line.js +1 -1
- package/lib/icon/fix-line.js +1 -1
- package/lib/icon/fix-shape.js +1 -1
- package/lib/icon/folder-open.js +1 -1
- package/lib/icon/folder-shape-open.js +1 -1
- package/lib/icon/folder-shape.js +1 -1
- package/lib/icon/folder.js +1 -1
- package/lib/icon/funnel.js +1 -1
- package/lib/icon/grag-fill.js +1 -1
- package/lib/icon/help-document-fill.js +1 -1
- package/lib/icon/help-fill.js +1 -1
- package/lib/icon/help.js +1 -1
- package/lib/icon/image-fill.js +1 -1
- package/lib/icon/img-error.js +1 -1
- package/lib/icon/img-placehoulder.js +1 -1
- package/lib/icon/info-line.js +1 -1
- package/lib/icon/info.js +1 -1
- package/lib/icon/left-shape.js +1 -1
- package/lib/icon/left-turn-line.js +1 -1
- package/lib/icon/loading.js +1 -1
- package/lib/icon/narrow-line.js +1 -1
- package/lib/icon/original.js +1 -1
- package/lib/icon/pdf-fill.js +1 -1
- package/lib/icon/play-shape.js +1 -1
- package/lib/icon/plus.js +1 -1
- package/lib/icon/ppt-fill.js +1 -1
- package/lib/icon/qq.js +1 -1
- package/lib/icon/right-shape.js +1 -1
- package/lib/icon/right-turn-line.js +1 -1
- package/lib/icon/search.js +1 -1
- package/lib/icon/share.js +1 -1
- package/lib/icon/spinner.js +1 -1
- package/lib/icon/success.js +1 -1
- package/lib/icon/switcher-loading.js +1 -1
- package/lib/icon/text-all.js +1 -1
- package/lib/icon/text-file.js +1 -1
- package/lib/icon/text-fill.js +1 -1
- package/lib/icon/transfer.js +1 -1
- package/lib/icon/tree-application-shape.js +1 -1
- package/lib/icon/unfull-screen.js +1 -1
- package/lib/icon/unvisible.js +1 -1
- package/lib/icon/up-shape.js +1 -1
- package/lib/icon/upload.js +1 -1
- package/lib/icon/video-fill.js +1 -1
- package/lib/icon/warn.js +1 -1
- package/lib/icon/weixin-pro.js +1 -1
- package/lib/icon/weixin.js +1 -1
- package/lib/image/index.js +10 -11
- package/lib/info-box/index.js +4 -5
- package/lib/input/index.js +4 -4
- package/lib/link/index.js +2 -2
- package/lib/loading/index.js +11 -12
- package/lib/menu/index.js +2 -3
- package/lib/message/index.js +1 -1
- package/lib/modal/hooks.d.ts +1 -1
- package/lib/modal/index.d.ts +0 -3
- package/lib/modal/index.js +26 -25
- package/lib/modal/modal.css +9 -7
- package/lib/modal/modal.d.ts +0 -1
- package/lib/modal/modal.less +18 -11
- package/lib/modal/modal.variable.css +9 -7
- package/lib/navigation/index.js +7 -9
- package/lib/notify/index.js +1 -1
- package/lib/overflow-title/index.js +9 -10
- package/lib/pagination/index.js +1 -1
- package/lib/plugin-popover/index.js +26 -30
- package/lib/pop-confirm/index.js +4 -5
- package/lib/popover/index.js +26 -30
- package/lib/popover2/index.js +2 -2
- package/lib/process/index.js +4 -4
- package/lib/progress/index.js +5 -6
- package/lib/radio/index.js +6 -7
- package/lib/rate/index.js +1 -1
- package/lib/resize-layout/index.js +1 -1
- package/lib/search-select/index.d.ts +12 -327
- package/lib/search-select/index.js +350 -633
- package/lib/search-select/input.d.ts +2 -7
- package/lib/search-select/search-select.css +6 -20
- package/lib/search-select/search-select.d.ts +4 -109
- package/lib/search-select/search-select.less +12 -16
- package/lib/search-select/search-select.variable.css +6 -20
- package/lib/search-select/selected.d.ts +5 -107
- package/lib/search-select/utils.d.ts +1 -13
- package/lib/select/index.d.ts +9 -32
- package/lib/select/index.js +5 -8
- package/lib/select/select.d.ts +3 -14
- package/lib/shared/index.js +5 -8
- package/lib/sideslider/index.js +4 -4
- package/lib/sideslider/sideslider.css +5 -0
- package/lib/sideslider/sideslider.less +14 -8
- package/lib/sideslider/sideslider.variable.css +5 -0
- package/lib/slider/index.d.ts +3 -3
- package/lib/slider/index.js +19 -20
- package/lib/slider/slider.d.ts +1 -1
- package/lib/steps/index.d.ts +3 -3
- package/lib/steps/index.js +4 -4
- package/lib/steps/steps.d.ts +1 -1
- package/lib/swiper/index.js +1 -1
- package/lib/switcher/index.js +1 -1
- package/lib/tab/index.d.ts +4 -4
- package/lib/tab/index.js +3 -4
- package/lib/tab/tab.d.ts +1 -1
- package/lib/table/const.d.ts +1 -1
- package/lib/table/index.d.ts +9 -9
- package/lib/table/index.js +24 -26
- package/lib/table/plugins/use-fixed-column.d.ts +1 -1
- package/lib/table/table.css +96 -42
- package/lib/table/table.d.ts +3 -3
- package/lib/table/table.less +41 -56
- package/lib/table/table.variable.css +96 -42
- package/lib/table/use-render.d.ts +1 -1
- package/lib/table-column/index.js +2 -2
- package/lib/tag/index.js +1 -1
- package/lib/tag-input/index.js +3 -4
- package/lib/timeline/index.js +0 -1
- package/lib/transfer/index.d.ts +3 -3
- package/lib/transfer/transfer.d.ts +1 -1
- package/lib/tree/index.js +10 -12
- package/lib/tree/tree.css +75 -2
- package/lib/tree/tree.variable.css +75 -2
- package/lib/upload/index.d.ts +4 -16
- package/lib/upload/index.js +34 -25
- package/lib/upload/props.d.ts +0 -3
- package/lib/upload/upload-trigger.d.ts +0 -6
- package/lib/upload/upload.d.ts +1 -7
- package/lib/virtual-render/bk-scrollbar.css +74 -0
- package/lib/virtual-render/bk-scrollbar.d.ts +10 -0
- package/lib/virtual-render/bk-scrollbar.less +93 -0
- package/lib/virtual-render/bk-scrollbar.variable.css +203 -0
- package/lib/virtual-render/index.d.ts +4 -0
- package/lib/virtual-render/index.js +2542 -235
- package/lib/virtual-render/props.d.ts +7 -0
- package/lib/virtual-render/scrollbar-core/can-use-dom.d.ts +2 -0
- package/lib/virtual-render/scrollbar-core/helpers.d.ts +5 -0
- package/lib/virtual-render/scrollbar-core/index.d.ts +213 -0
- package/lib/virtual-render/scrollbar-core/mouse-wheel.d.ts +5 -0
- package/lib/virtual-render/scrollbar-core/scrollbar-width.d.ts +1 -0
- package/lib/virtual-render/use-fix-top.d.ts +2 -7
- package/lib/virtual-render/use-scrollbar.d.ts +23 -0
- package/lib/virtual-render/v-virtual-render.d.ts +2 -1
- package/lib/virtual-render/virtual-render.css +75 -2
- package/lib/virtual-render/virtual-render.d.ts +2 -0
- package/lib/virtual-render/virtual-render.less +2 -2
- package/lib/virtual-render/virtual-render.variable.css +75 -2
- package/package.json +5 -1
@@ -1,13 +1,173 @@
|
|
1
1
|
import "../styles/reset.css";
|
2
2
|
import "./virtual-render.less";
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__components_96ad247a__ from "./components";
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__config_provider_e8e4cbd4__ from "./config-provider";
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__directives_37095733__ from "./directives";
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__hooks_627f7bfe__ from "./hooks";
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__plugins_a82c42d7__ from "./plugins";
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__preset_b854ea38__ from "./preset";
|
3
9
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
|
4
10
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
5
11
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
12
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
6
13
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
7
|
-
/******/
|
8
|
-
|
14
|
+
/******/ var __webpack_modules__ = ({
|
15
|
+
|
16
|
+
/***/ 6064:
|
17
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
18
|
+
|
19
|
+
/* harmony import */ var _preset__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(804);
|
20
|
+
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4151);
|
21
|
+
/* harmony reexport (checked) */ if(__webpack_require__.o(_components__WEBPACK_IMPORTED_MODULE_1__, "usePrefix")) __webpack_require__.d(__webpack_exports__, { usePrefix: function() { return _components__WEBPACK_IMPORTED_MODULE_1__.usePrefix; } });
|
22
|
+
/* harmony import */ var _bkui_vue_directives__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6120);
|
23
|
+
/* harmony reexport (checked) */ if(__webpack_require__.o(_bkui_vue_directives__WEBPACK_IMPORTED_MODULE_2__, "usePrefix")) __webpack_require__.d(__webpack_exports__, { usePrefix: function() { return _bkui_vue_directives__WEBPACK_IMPORTED_MODULE_2__.usePrefix; } });
|
24
|
+
/* harmony import */ var _bkui_vue_plugins__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4794);
|
25
|
+
/* harmony import */ var _bkui_vue_config_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(635);
|
26
|
+
/* harmony reexport (checked) */ if(__webpack_require__.o(_bkui_vue_config_provider__WEBPACK_IMPORTED_MODULE_4__, "usePrefix")) __webpack_require__.d(__webpack_exports__, { usePrefix: function() { return _bkui_vue_config_provider__WEBPACK_IMPORTED_MODULE_4__.usePrefix; } });
|
27
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6253);
|
28
|
+
/* harmony reexport (checked) */ if(__webpack_require__.o(_hooks__WEBPACK_IMPORTED_MODULE_5__, "usePrefix")) __webpack_require__.d(__webpack_exports__, { usePrefix: function() { return _hooks__WEBPACK_IMPORTED_MODULE_5__.usePrefix; } });
|
29
|
+
/*
|
30
|
+
* Tencent is pleased to support the open source community by making
|
31
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
32
|
+
*
|
33
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
34
|
+
*
|
35
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
36
|
+
*
|
37
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
38
|
+
*
|
39
|
+
* ---------------------------------------------------
|
40
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
41
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
42
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
43
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
44
|
+
*
|
45
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
46
|
+
* the Software.
|
47
|
+
*
|
48
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
49
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
50
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
51
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
52
|
+
* IN THE SOFTWARE.
|
53
|
+
*/
|
54
|
+
// import '@bkui-vue/styles';
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
/***/ }),
|
64
|
+
|
65
|
+
/***/ 9131:
|
66
|
+
/***/ ((module) => {
|
67
|
+
|
68
|
+
var canUseDOM = !!(
|
69
|
+
typeof window !== 'undefined' &&
|
70
|
+
window.document &&
|
71
|
+
window.document.createElement
|
72
|
+
);
|
73
|
+
|
74
|
+
module.exports = canUseDOM;
|
75
|
+
|
76
|
+
/***/ }),
|
77
|
+
|
78
|
+
/***/ 4151:
|
79
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
80
|
+
|
81
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
82
|
+
var y = x => () => x
|
83
|
+
module.exports = x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__components_96ad247a__.usePrefix });
|
84
|
+
|
85
|
+
/***/ }),
|
86
|
+
|
87
|
+
/***/ 635:
|
88
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
89
|
+
|
90
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
91
|
+
var y = x => () => x
|
92
|
+
module.exports = x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_e8e4cbd4__.usePrefix });
|
93
|
+
|
94
|
+
/***/ }),
|
95
|
+
|
96
|
+
/***/ 6120:
|
97
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
98
|
+
|
99
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
100
|
+
var y = x => () => x
|
101
|
+
module.exports = x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__directives_37095733__.usePrefix });
|
102
|
+
|
103
|
+
/***/ }),
|
104
|
+
|
105
|
+
/***/ 6253:
|
106
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
107
|
+
|
108
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
109
|
+
var y = x => () => x
|
110
|
+
module.exports = x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__hooks_627f7bfe__.usePrefix });
|
111
|
+
|
112
|
+
/***/ }),
|
113
|
+
|
114
|
+
/***/ 4794:
|
115
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
116
|
+
|
117
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
118
|
+
var y = x => () => x
|
119
|
+
module.exports = x({ });
|
120
|
+
|
121
|
+
/***/ }),
|
122
|
+
|
123
|
+
/***/ 804:
|
124
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
125
|
+
|
126
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
127
|
+
var y = x => () => x
|
128
|
+
module.exports = x({ });
|
129
|
+
|
130
|
+
/***/ })
|
131
|
+
|
132
|
+
/******/ });
|
133
|
+
/************************************************************************/
|
134
|
+
/******/ // The module cache
|
135
|
+
/******/ var __webpack_module_cache__ = {};
|
136
|
+
/******/
|
137
|
+
/******/ // The require function
|
138
|
+
/******/ function __webpack_require__(moduleId) {
|
139
|
+
/******/ // Check if module is in cache
|
140
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
141
|
+
/******/ if (cachedModule !== undefined) {
|
142
|
+
/******/ return cachedModule.exports;
|
143
|
+
/******/ }
|
144
|
+
/******/ // Create a new module (and put it into the cache)
|
145
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
146
|
+
/******/ // no module.id needed
|
147
|
+
/******/ // no module.loaded needed
|
148
|
+
/******/ exports: {}
|
149
|
+
/******/ };
|
150
|
+
/******/
|
151
|
+
/******/ // Execute the module function
|
152
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
153
|
+
/******/
|
154
|
+
/******/ // Return the exports of the module
|
155
|
+
/******/ return module.exports;
|
156
|
+
/******/ }
|
9
157
|
/******/
|
10
158
|
/************************************************************************/
|
159
|
+
/******/ /* webpack/runtime/compat get default export */
|
160
|
+
/******/ (() => {
|
161
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
162
|
+
/******/ __webpack_require__.n = (module) => {
|
163
|
+
/******/ var getter = module && module.__esModule ?
|
164
|
+
/******/ () => (module['default']) :
|
165
|
+
/******/ () => (module);
|
166
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
167
|
+
/******/ return getter;
|
168
|
+
/******/ };
|
169
|
+
/******/ })();
|
170
|
+
/******/
|
11
171
|
/******/ /* webpack/runtime/define property getters */
|
12
172
|
/******/ (() => {
|
13
173
|
/******/ // define getter functions for harmony exports
|
@@ -25,14 +185,38 @@ import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/th
|
|
25
185
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
26
186
|
/******/ })();
|
27
187
|
/******/
|
188
|
+
/******/ /* webpack/runtime/make namespace object */
|
189
|
+
/******/ (() => {
|
190
|
+
/******/ // define __esModule on exports
|
191
|
+
/******/ __webpack_require__.r = (exports) => {
|
192
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
193
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
194
|
+
/******/ }
|
195
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
196
|
+
/******/ };
|
197
|
+
/******/ })();
|
198
|
+
/******/
|
28
199
|
/************************************************************************/
|
29
200
|
var __webpack_exports__ = {};
|
201
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
202
|
+
(() => {
|
30
203
|
|
31
204
|
// EXPORTS
|
32
205
|
__webpack_require__.d(__webpack_exports__, {
|
33
206
|
"default": () => (/* binding */ src)
|
34
207
|
});
|
35
208
|
|
209
|
+
// NAMESPACE OBJECT: ../../packages/virtual-render/src/scrollbar-core/helpers.ts
|
210
|
+
var helpers_namespaceObject = {};
|
211
|
+
__webpack_require__.r(helpers_namespaceObject);
|
212
|
+
__webpack_require__.d(helpers_namespaceObject, {
|
213
|
+
addClasses: () => (addClasses),
|
214
|
+
classNamesToQuery: () => (classNamesToQuery),
|
215
|
+
getElementDocument: () => (getElementDocument),
|
216
|
+
getElementWindow: () => (getElementWindow),
|
217
|
+
removeClasses: () => (removeClasses)
|
218
|
+
});
|
219
|
+
|
36
220
|
;// CONCATENATED MODULE: external "../shared"
|
37
221
|
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
38
222
|
var y = x => () => x
|
@@ -86,51 +270,2195 @@ function _typeof(o) {
|
|
86
270
|
}
|
87
271
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
88
272
|
|
89
|
-
function toPrimitive(t, r) {
|
90
|
-
if ("object" != _typeof(t) || !t) return t;
|
91
|
-
var e = t[Symbol.toPrimitive];
|
92
|
-
if (void 0 !== e) {
|
93
|
-
var i = e.call(t, r || "default");
|
94
|
-
if ("object" != _typeof(i)) return i;
|
95
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
96
|
-
}
|
97
|
-
return ("string" === r ? String : Number)(t);
|
98
|
-
}
|
99
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
273
|
+
function toPrimitive(t, r) {
|
274
|
+
if ("object" != _typeof(t) || !t) return t;
|
275
|
+
var e = t[Symbol.toPrimitive];
|
276
|
+
if (void 0 !== e) {
|
277
|
+
var i = e.call(t, r || "default");
|
278
|
+
if ("object" != _typeof(i)) return i;
|
279
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
280
|
+
}
|
281
|
+
return ("string" === r ? String : Number)(t);
|
282
|
+
}
|
283
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
284
|
+
|
285
|
+
|
286
|
+
function toPropertyKey(t) {
|
287
|
+
var i = toPrimitive(t, "string");
|
288
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
289
|
+
}
|
290
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
291
|
+
|
292
|
+
function _defineProperty(obj, key, value) {
|
293
|
+
key = toPropertyKey(key);
|
294
|
+
if (key in obj) {
|
295
|
+
Object.defineProperty(obj, key, {
|
296
|
+
value: value,
|
297
|
+
enumerable: true,
|
298
|
+
configurable: true,
|
299
|
+
writable: true
|
300
|
+
});
|
301
|
+
} else {
|
302
|
+
obj[key] = value;
|
303
|
+
}
|
304
|
+
return obj;
|
305
|
+
}
|
306
|
+
;// CONCATENATED MODULE: external "vue"
|
307
|
+
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
308
|
+
var external_vue_y = x => () => x
|
309
|
+
const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
310
|
+
;// CONCATENATED MODULE: external "../config-provider"
|
311
|
+
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
312
|
+
var config_provider_y = x => () => x
|
313
|
+
const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
|
314
|
+
;// CONCATENATED MODULE: external "vue-types"
|
315
|
+
var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
316
|
+
var external_vue_types_y = x => () => x
|
317
|
+
const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
|
318
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/props.ts
|
319
|
+
|
320
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
321
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
322
|
+
/*
|
323
|
+
* Tencent is pleased to support the open source community by making
|
324
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
325
|
+
*
|
326
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
327
|
+
*
|
328
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
329
|
+
*
|
330
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
331
|
+
*
|
332
|
+
* ---------------------------------------------------
|
333
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
334
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
335
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
336
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
337
|
+
*
|
338
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
339
|
+
* the Software.
|
340
|
+
*
|
341
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
342
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
343
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
344
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
345
|
+
* IN THE SOFTWARE.
|
346
|
+
*/
|
347
|
+
|
348
|
+
|
349
|
+
var EventProps = {
|
350
|
+
onContentScroll: Function
|
351
|
+
};
|
352
|
+
var virtualRenderProps = _objectSpread({
|
353
|
+
/** 传入原始数据源 */
|
354
|
+
list: shared_namespaceObject.PropTypes.array.def([]),
|
355
|
+
/**
|
356
|
+
* 是否启用此功能
|
357
|
+
* 如果设置为false,则此组件只会渲染两层指定的 容器,默认渲染两层 div
|
358
|
+
* 设置为true才会启用所有的虚拟渲染 & 滚动相关计算
|
359
|
+
* 此属性设置为了兼容需要按需开启\关闭虚拟渲染场景,避免外层设计两套样式架构
|
360
|
+
* Note: 目前此属性不支持动态修改
|
361
|
+
*/
|
362
|
+
enabled: shared_namespaceObject.PropTypes.bool.def(true),
|
363
|
+
/**
|
364
|
+
* 是否启用内置的Scroll Listener
|
365
|
+
* 当启用虚拟滚动时(enabled = true),滚动监听为内置生效
|
366
|
+
* 只有当(enabled = false)时此配置项才生效
|
367
|
+
*/
|
368
|
+
scrollEvent: shared_namespaceObject.PropTypes.bool.def(false),
|
369
|
+
/**
|
370
|
+
* 每行数据高度
|
371
|
+
* 默认为数值类型,默认高度 30px
|
372
|
+
* 如果每行高度不一致,可为回调函数:(index: number, row: any[]): number => {}
|
373
|
+
* 函数参数为当前行index & 当前行数据 row,row为数组,当不分组时,为当前行item
|
374
|
+
* 如果有分组展示, index 为当前分组 index, row为数组,当前行分组所有 item 数据
|
375
|
+
*/
|
376
|
+
lineHeight: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.number, shared_namespaceObject.PropTypes.func]).def(30),
|
377
|
+
/** 整体最小高度 */
|
378
|
+
minHeight: shared_namespaceObject.PropTypes.number.def(30),
|
379
|
+
/** 整体最大高度 */
|
380
|
+
maxHeight: shared_namespaceObject.PropTypes.number,
|
381
|
+
/**
|
382
|
+
* 整体高度
|
383
|
+
* 可设置具体值,如果设置为 100%,则组件会自动计算外层DOM元素offsetHeight,用于计算可渲染行数
|
384
|
+
*/
|
385
|
+
height: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.string.def('100%'), shared_namespaceObject.PropTypes.number]).def('100%'),
|
386
|
+
/**
|
387
|
+
* 渲染区域宽度
|
388
|
+
* 如果设置 100% 则自适应外层元素宽度
|
389
|
+
*/
|
390
|
+
width: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.string.def('100%'), shared_namespaceObject.PropTypes.number]).def('100%'),
|
391
|
+
/** 最外层元素ClassName */
|
392
|
+
className: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.string), shared_namespaceObject.PropTypes.object, shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.object), shared_namespaceObject.PropTypes.string]).def(''),
|
393
|
+
/** 内层层元素ClassName */
|
394
|
+
contentClassName: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.string), shared_namespaceObject.PropTypes.object, shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.object), shared_namespaceObject.PropTypes.string]).def(''),
|
395
|
+
/** 内层元素样式 */
|
396
|
+
contentStyle: shared_namespaceObject.PropTypes.object.def({}),
|
397
|
+
/** 用于自定义X轴滚动条样式 */
|
398
|
+
scrollXName: shared_namespaceObject.PropTypes.string.def((0,shared_namespaceObject.resolveClassName)('F-scroll-x')),
|
399
|
+
/** 用于自定义Y轴滚动条样式 */
|
400
|
+
scrollYName: shared_namespaceObject.PropTypes.string.def((0,shared_namespaceObject.resolveClassName)('F-scroll-y')),
|
401
|
+
/** 分组展示,一行数据可能有多条数据 */
|
402
|
+
groupItemCount: shared_namespaceObject.PropTypes.number.def(1),
|
403
|
+
/** 预加载行数,避免空白渲染 */
|
404
|
+
preloadItemCount: shared_namespaceObject.PropTypes.number.def(1),
|
405
|
+
/** 外层Dom元素需要渲染成的目标元素 */
|
406
|
+
renderAs: shared_namespaceObject.PropTypes.string.def('div'),
|
407
|
+
/** 内容层渲染成目标元素 */
|
408
|
+
contentAs: shared_namespaceObject.PropTypes.string.def('div'),
|
409
|
+
/** top 滚动填充 */
|
410
|
+
scrollOffsetTop: shared_namespaceObject.PropTypes.number.def(0),
|
411
|
+
/**
|
412
|
+
* 内置滚动位置
|
413
|
+
* 可选:container (最外层容器),content(内容层容器)
|
414
|
+
* Note: container 慎选,需要自己处理样式 & 位置
|
415
|
+
*/
|
416
|
+
scrollPosition: shared_namespaceObject.PropTypes.string.def('content'),
|
417
|
+
/**
|
418
|
+
* 绝对高度 | 实际高估
|
419
|
+
* 可选值: auto(根据行高和行数计算, LineHeight * List.length) number(外层给定高度,若为0,则不显示)
|
420
|
+
*/
|
421
|
+
abosuteHeight: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.string.def('auto'), shared_namespaceObject.PropTypes.number]).def('auto'),
|
422
|
+
/**
|
423
|
+
* 滚动刷新计算间隔时间
|
424
|
+
* 默认60 ms
|
425
|
+
*/
|
426
|
+
throttleDelay: shared_namespaceObject.PropTypes.number.def(60),
|
427
|
+
rowKey: shared_namespaceObject.PropTypes.string.def(undefined),
|
428
|
+
/**
|
429
|
+
* 数据改变时是否保持之前的状态
|
430
|
+
* 保持滚动条位置、当前渲染区间
|
431
|
+
*/
|
432
|
+
keepAlive: shared_namespaceObject.PropTypes.bool.def(false),
|
433
|
+
/**
|
434
|
+
* 是否允许滚动条改变原有DOM结构
|
435
|
+
*/
|
436
|
+
scrollbar: (0,external_vue_types_namespaceObject.toType)('IScrollbarOption', {
|
437
|
+
"default": {
|
438
|
+
enabled: false
|
439
|
+
}
|
440
|
+
}),
|
441
|
+
/**
|
442
|
+
* 数据监听改变时,是否自动重置位置到[0, 0]
|
443
|
+
*/
|
444
|
+
autoReset: shared_namespaceObject.PropTypes.bool.def(true),
|
445
|
+
wrapperStyle: shared_namespaceObject.PropTypes.any.def({})
|
446
|
+
}, EventProps);
|
447
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-fix-top.tsx
|
448
|
+
/*
|
449
|
+
* Tencent is pleased to support the open source community by making
|
450
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
451
|
+
*
|
452
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
453
|
+
*
|
454
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
455
|
+
*
|
456
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
457
|
+
*
|
458
|
+
* ---------------------------------------------------
|
459
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
460
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
461
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
462
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
463
|
+
*
|
464
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
465
|
+
* the Software.
|
466
|
+
*
|
467
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
468
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
469
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
470
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
471
|
+
* IN THE SOFTWARE.
|
472
|
+
*/
|
473
|
+
/* harmony default export */ const use_fix_top = (function (props, scrollTo) {
|
474
|
+
/**
|
475
|
+
* 指定元素滚动到顶部
|
476
|
+
* @param param0
|
477
|
+
*/
|
478
|
+
var fixToTop = function fixToTop(params) {
|
479
|
+
var id = params.id,
|
480
|
+
index = params.index,
|
481
|
+
item = params.item;
|
482
|
+
var targetIndex = typeof index === 'number' ? index - 1 : 0;
|
483
|
+
if (id !== undefined) {
|
484
|
+
var _props$list$findIndex;
|
485
|
+
targetIndex = (_props$list$findIndex = props.list.findIndex(function (row) {
|
486
|
+
return row[props.rowKey] === id;
|
487
|
+
})) !== null && _props$list$findIndex !== void 0 ? _props$list$findIndex : targetIndex;
|
488
|
+
}
|
489
|
+
if (item !== undefined) {
|
490
|
+
var _props$list$findIndex2;
|
491
|
+
targetIndex = (_props$list$findIndex2 = props.list.findIndex(function (row) {
|
492
|
+
return item[props.rowKey] === row[props.rowKey];
|
493
|
+
})) !== null && _props$list$findIndex2 !== void 0 ? _props$list$findIndex2 : targetIndex;
|
494
|
+
}
|
495
|
+
if (typeof targetIndex === 'number') {
|
496
|
+
var resolvedIndex = targetIndex >= 0 ? targetIndex : 0;
|
497
|
+
var offsetY = resolvedIndex * props.lineHeight;
|
498
|
+
scrollTo(0, offsetY);
|
499
|
+
}
|
500
|
+
return null;
|
501
|
+
};
|
502
|
+
return {
|
503
|
+
fixToTop: fixToTop
|
504
|
+
};
|
505
|
+
});
|
506
|
+
// EXTERNAL MODULE: ../../packages/bkui-vue/index.ts
|
507
|
+
var bkui_vue = __webpack_require__(6064);
|
508
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
509
|
+
function _classCallCheck(instance, Constructor) {
|
510
|
+
if (!(instance instanceof Constructor)) {
|
511
|
+
throw new TypeError("Cannot call a class as a function");
|
512
|
+
}
|
513
|
+
}
|
514
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
|
515
|
+
|
516
|
+
function _defineProperties(target, props) {
|
517
|
+
for (var i = 0; i < props.length; i++) {
|
518
|
+
var descriptor = props[i];
|
519
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
520
|
+
descriptor.configurable = true;
|
521
|
+
if ("value" in descriptor) descriptor.writable = true;
|
522
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
523
|
+
}
|
524
|
+
}
|
525
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
526
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
527
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
528
|
+
Object.defineProperty(Constructor, "prototype", {
|
529
|
+
writable: false
|
530
|
+
});
|
531
|
+
return Constructor;
|
532
|
+
}
|
533
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
534
|
+
function _assertThisInitialized(self) {
|
535
|
+
if (self === void 0) {
|
536
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
537
|
+
}
|
538
|
+
return self;
|
539
|
+
}
|
540
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
541
|
+
|
542
|
+
|
543
|
+
function _possibleConstructorReturn(self, call) {
|
544
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
545
|
+
return call;
|
546
|
+
} else if (call !== void 0) {
|
547
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
548
|
+
}
|
549
|
+
return _assertThisInitialized(self);
|
550
|
+
}
|
551
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
552
|
+
function _getPrototypeOf(o) {
|
553
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
554
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
555
|
+
};
|
556
|
+
return _getPrototypeOf(o);
|
557
|
+
}
|
558
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
559
|
+
function _setPrototypeOf(o, p) {
|
560
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
561
|
+
o.__proto__ = p;
|
562
|
+
return o;
|
563
|
+
};
|
564
|
+
return _setPrototypeOf(o, p);
|
565
|
+
}
|
566
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/inherits.js
|
567
|
+
|
568
|
+
function _inherits(subClass, superClass) {
|
569
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
570
|
+
throw new TypeError("Super expression must either be null or a function");
|
571
|
+
}
|
572
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
573
|
+
constructor: {
|
574
|
+
value: subClass,
|
575
|
+
writable: true,
|
576
|
+
configurable: true
|
577
|
+
}
|
578
|
+
});
|
579
|
+
Object.defineProperty(subClass, "prototype", {
|
580
|
+
writable: false
|
581
|
+
});
|
582
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
583
|
+
}
|
584
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
585
|
+
function _arrayWithHoles(arr) {
|
586
|
+
if (Array.isArray(arr)) return arr;
|
587
|
+
}
|
588
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
589
|
+
function _iterableToArrayLimit(r, l) {
|
590
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
591
|
+
if (null != t) {
|
592
|
+
var e,
|
593
|
+
n,
|
594
|
+
i,
|
595
|
+
u,
|
596
|
+
a = [],
|
597
|
+
f = !0,
|
598
|
+
o = !1;
|
599
|
+
try {
|
600
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
601
|
+
if (Object(t) !== t) return;
|
602
|
+
f = !1;
|
603
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
604
|
+
} catch (r) {
|
605
|
+
o = !0, n = r;
|
606
|
+
} finally {
|
607
|
+
try {
|
608
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
609
|
+
} finally {
|
610
|
+
if (o) throw n;
|
611
|
+
}
|
612
|
+
}
|
613
|
+
return a;
|
614
|
+
}
|
615
|
+
}
|
616
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
617
|
+
function _nonIterableRest() {
|
618
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
619
|
+
}
|
620
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
function _slicedToArray(arr, i) {
|
626
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
627
|
+
}
|
628
|
+
// EXTERNAL MODULE: ../../node_modules/can-use-dom/index.js
|
629
|
+
var can_use_dom = __webpack_require__(9131);
|
630
|
+
var can_use_dom_default = /*#__PURE__*/__webpack_require__.n(can_use_dom);
|
631
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/isObject.js
|
632
|
+
/**
|
633
|
+
* Checks if `value` is the
|
634
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
635
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
636
|
+
*
|
637
|
+
* @static
|
638
|
+
* @memberOf _
|
639
|
+
* @since 0.1.0
|
640
|
+
* @category Lang
|
641
|
+
* @param {*} value The value to check.
|
642
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
643
|
+
* @example
|
644
|
+
*
|
645
|
+
* _.isObject({});
|
646
|
+
* // => true
|
647
|
+
*
|
648
|
+
* _.isObject([1, 2, 3]);
|
649
|
+
* // => true
|
650
|
+
*
|
651
|
+
* _.isObject(_.noop);
|
652
|
+
* // => true
|
653
|
+
*
|
654
|
+
* _.isObject(null);
|
655
|
+
* // => false
|
656
|
+
*/
|
657
|
+
function isObject(value) {
|
658
|
+
var type = typeof value;
|
659
|
+
return value != null && (type == 'object' || type == 'function');
|
660
|
+
}
|
661
|
+
|
662
|
+
/* harmony default export */ const lodash_es_isObject = (isObject);
|
663
|
+
|
664
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_freeGlobal.js
|
665
|
+
/** Detect free variable `global` from Node.js. */
|
666
|
+
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
667
|
+
|
668
|
+
/* harmony default export */ const _freeGlobal = (freeGlobal);
|
669
|
+
|
670
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_root.js
|
671
|
+
|
672
|
+
|
673
|
+
/** Detect free variable `self`. */
|
674
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
675
|
+
|
676
|
+
/** Used as a reference to the global object. */
|
677
|
+
var root = _freeGlobal || freeSelf || Function('return this')();
|
678
|
+
|
679
|
+
/* harmony default export */ const _root = (root);
|
680
|
+
|
681
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/now.js
|
682
|
+
|
683
|
+
|
684
|
+
/**
|
685
|
+
* Gets the timestamp of the number of milliseconds that have elapsed since
|
686
|
+
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
687
|
+
*
|
688
|
+
* @static
|
689
|
+
* @memberOf _
|
690
|
+
* @since 2.4.0
|
691
|
+
* @category Date
|
692
|
+
* @returns {number} Returns the timestamp.
|
693
|
+
* @example
|
694
|
+
*
|
695
|
+
* _.defer(function(stamp) {
|
696
|
+
* console.log(_.now() - stamp);
|
697
|
+
* }, _.now());
|
698
|
+
* // => Logs the number of milliseconds it took for the deferred invocation.
|
699
|
+
*/
|
700
|
+
var now = function() {
|
701
|
+
return _root.Date.now();
|
702
|
+
};
|
703
|
+
|
704
|
+
/* harmony default export */ const lodash_es_now = (now);
|
705
|
+
|
706
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_trimmedEndIndex.js
|
707
|
+
/** Used to match a single whitespace character. */
|
708
|
+
var reWhitespace = /\s/;
|
709
|
+
|
710
|
+
/**
|
711
|
+
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
712
|
+
* character of `string`.
|
713
|
+
*
|
714
|
+
* @private
|
715
|
+
* @param {string} string The string to inspect.
|
716
|
+
* @returns {number} Returns the index of the last non-whitespace character.
|
717
|
+
*/
|
718
|
+
function trimmedEndIndex(string) {
|
719
|
+
var index = string.length;
|
720
|
+
|
721
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
722
|
+
return index;
|
723
|
+
}
|
724
|
+
|
725
|
+
/* harmony default export */ const _trimmedEndIndex = (trimmedEndIndex);
|
726
|
+
|
727
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_baseTrim.js
|
728
|
+
|
729
|
+
|
730
|
+
/** Used to match leading whitespace. */
|
731
|
+
var reTrimStart = /^\s+/;
|
732
|
+
|
733
|
+
/**
|
734
|
+
* The base implementation of `_.trim`.
|
735
|
+
*
|
736
|
+
* @private
|
737
|
+
* @param {string} string The string to trim.
|
738
|
+
* @returns {string} Returns the trimmed string.
|
739
|
+
*/
|
740
|
+
function baseTrim(string) {
|
741
|
+
return string
|
742
|
+
? string.slice(0, _trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
743
|
+
: string;
|
744
|
+
}
|
745
|
+
|
746
|
+
/* harmony default export */ const _baseTrim = (baseTrim);
|
747
|
+
|
748
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_Symbol.js
|
749
|
+
|
750
|
+
|
751
|
+
/** Built-in value references. */
|
752
|
+
var _Symbol_Symbol = _root.Symbol;
|
753
|
+
|
754
|
+
/* harmony default export */ const _Symbol = (_Symbol_Symbol);
|
755
|
+
|
756
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_getRawTag.js
|
757
|
+
|
758
|
+
|
759
|
+
/** Used for built-in method references. */
|
760
|
+
var objectProto = Object.prototype;
|
761
|
+
|
762
|
+
/** Used to check objects for own properties. */
|
763
|
+
var _getRawTag_hasOwnProperty = objectProto.hasOwnProperty;
|
764
|
+
|
765
|
+
/**
|
766
|
+
* Used to resolve the
|
767
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
768
|
+
* of values.
|
769
|
+
*/
|
770
|
+
var nativeObjectToString = objectProto.toString;
|
771
|
+
|
772
|
+
/** Built-in value references. */
|
773
|
+
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
774
|
+
|
775
|
+
/**
|
776
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
777
|
+
*
|
778
|
+
* @private
|
779
|
+
* @param {*} value The value to query.
|
780
|
+
* @returns {string} Returns the raw `toStringTag`.
|
781
|
+
*/
|
782
|
+
function getRawTag(value) {
|
783
|
+
var isOwn = _getRawTag_hasOwnProperty.call(value, symToStringTag),
|
784
|
+
tag = value[symToStringTag];
|
785
|
+
|
786
|
+
try {
|
787
|
+
value[symToStringTag] = undefined;
|
788
|
+
var unmasked = true;
|
789
|
+
} catch (e) {}
|
790
|
+
|
791
|
+
var result = nativeObjectToString.call(value);
|
792
|
+
if (unmasked) {
|
793
|
+
if (isOwn) {
|
794
|
+
value[symToStringTag] = tag;
|
795
|
+
} else {
|
796
|
+
delete value[symToStringTag];
|
797
|
+
}
|
798
|
+
}
|
799
|
+
return result;
|
800
|
+
}
|
801
|
+
|
802
|
+
/* harmony default export */ const _getRawTag = (getRawTag);
|
803
|
+
|
804
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_objectToString.js
|
805
|
+
/** Used for built-in method references. */
|
806
|
+
var _objectToString_objectProto = Object.prototype;
|
807
|
+
|
808
|
+
/**
|
809
|
+
* Used to resolve the
|
810
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
811
|
+
* of values.
|
812
|
+
*/
|
813
|
+
var _objectToString_nativeObjectToString = _objectToString_objectProto.toString;
|
814
|
+
|
815
|
+
/**
|
816
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
817
|
+
*
|
818
|
+
* @private
|
819
|
+
* @param {*} value The value to convert.
|
820
|
+
* @returns {string} Returns the converted string.
|
821
|
+
*/
|
822
|
+
function objectToString(value) {
|
823
|
+
return _objectToString_nativeObjectToString.call(value);
|
824
|
+
}
|
825
|
+
|
826
|
+
/* harmony default export */ const _objectToString = (objectToString);
|
827
|
+
|
828
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/_baseGetTag.js
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
/** `Object#toString` result references. */
|
834
|
+
var nullTag = '[object Null]',
|
835
|
+
undefinedTag = '[object Undefined]';
|
836
|
+
|
837
|
+
/** Built-in value references. */
|
838
|
+
var _baseGetTag_symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
839
|
+
|
840
|
+
/**
|
841
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
842
|
+
*
|
843
|
+
* @private
|
844
|
+
* @param {*} value The value to query.
|
845
|
+
* @returns {string} Returns the `toStringTag`.
|
846
|
+
*/
|
847
|
+
function baseGetTag(value) {
|
848
|
+
if (value == null) {
|
849
|
+
return value === undefined ? undefinedTag : nullTag;
|
850
|
+
}
|
851
|
+
return (_baseGetTag_symToStringTag && _baseGetTag_symToStringTag in Object(value))
|
852
|
+
? _getRawTag(value)
|
853
|
+
: _objectToString(value);
|
854
|
+
}
|
855
|
+
|
856
|
+
/* harmony default export */ const _baseGetTag = (baseGetTag);
|
857
|
+
|
858
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/isObjectLike.js
|
859
|
+
/**
|
860
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
861
|
+
* and has a `typeof` result of "object".
|
862
|
+
*
|
863
|
+
* @static
|
864
|
+
* @memberOf _
|
865
|
+
* @since 4.0.0
|
866
|
+
* @category Lang
|
867
|
+
* @param {*} value The value to check.
|
868
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
869
|
+
* @example
|
870
|
+
*
|
871
|
+
* _.isObjectLike({});
|
872
|
+
* // => true
|
873
|
+
*
|
874
|
+
* _.isObjectLike([1, 2, 3]);
|
875
|
+
* // => true
|
876
|
+
*
|
877
|
+
* _.isObjectLike(_.noop);
|
878
|
+
* // => false
|
879
|
+
*
|
880
|
+
* _.isObjectLike(null);
|
881
|
+
* // => false
|
882
|
+
*/
|
883
|
+
function isObjectLike(value) {
|
884
|
+
return value != null && typeof value == 'object';
|
885
|
+
}
|
886
|
+
|
887
|
+
/* harmony default export */ const lodash_es_isObjectLike = (isObjectLike);
|
888
|
+
|
889
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/isSymbol.js
|
890
|
+
|
891
|
+
|
892
|
+
|
893
|
+
/** `Object#toString` result references. */
|
894
|
+
var symbolTag = '[object Symbol]';
|
895
|
+
|
896
|
+
/**
|
897
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
898
|
+
*
|
899
|
+
* @static
|
900
|
+
* @memberOf _
|
901
|
+
* @since 4.0.0
|
902
|
+
* @category Lang
|
903
|
+
* @param {*} value The value to check.
|
904
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
905
|
+
* @example
|
906
|
+
*
|
907
|
+
* _.isSymbol(Symbol.iterator);
|
908
|
+
* // => true
|
909
|
+
*
|
910
|
+
* _.isSymbol('abc');
|
911
|
+
* // => false
|
912
|
+
*/
|
913
|
+
function isSymbol(value) {
|
914
|
+
return typeof value == 'symbol' ||
|
915
|
+
(lodash_es_isObjectLike(value) && _baseGetTag(value) == symbolTag);
|
916
|
+
}
|
917
|
+
|
918
|
+
/* harmony default export */ const lodash_es_isSymbol = (isSymbol);
|
919
|
+
|
920
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/toNumber.js
|
921
|
+
|
922
|
+
|
923
|
+
|
924
|
+
|
925
|
+
/** Used as references for various `Number` constants. */
|
926
|
+
var NAN = 0 / 0;
|
927
|
+
|
928
|
+
/** Used to detect bad signed hexadecimal string values. */
|
929
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
930
|
+
|
931
|
+
/** Used to detect binary string values. */
|
932
|
+
var reIsBinary = /^0b[01]+$/i;
|
933
|
+
|
934
|
+
/** Used to detect octal string values. */
|
935
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
936
|
+
|
937
|
+
/** Built-in method references without a dependency on `root`. */
|
938
|
+
var freeParseInt = parseInt;
|
939
|
+
|
940
|
+
/**
|
941
|
+
* Converts `value` to a number.
|
942
|
+
*
|
943
|
+
* @static
|
944
|
+
* @memberOf _
|
945
|
+
* @since 4.0.0
|
946
|
+
* @category Lang
|
947
|
+
* @param {*} value The value to process.
|
948
|
+
* @returns {number} Returns the number.
|
949
|
+
* @example
|
950
|
+
*
|
951
|
+
* _.toNumber(3.2);
|
952
|
+
* // => 3.2
|
953
|
+
*
|
954
|
+
* _.toNumber(Number.MIN_VALUE);
|
955
|
+
* // => 5e-324
|
956
|
+
*
|
957
|
+
* _.toNumber(Infinity);
|
958
|
+
* // => Infinity
|
959
|
+
*
|
960
|
+
* _.toNumber('3.2');
|
961
|
+
* // => 3.2
|
962
|
+
*/
|
963
|
+
function toNumber(value) {
|
964
|
+
if (typeof value == 'number') {
|
965
|
+
return value;
|
966
|
+
}
|
967
|
+
if (lodash_es_isSymbol(value)) {
|
968
|
+
return NAN;
|
969
|
+
}
|
970
|
+
if (lodash_es_isObject(value)) {
|
971
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
972
|
+
value = lodash_es_isObject(other) ? (other + '') : other;
|
973
|
+
}
|
974
|
+
if (typeof value != 'string') {
|
975
|
+
return value === 0 ? value : +value;
|
976
|
+
}
|
977
|
+
value = _baseTrim(value);
|
978
|
+
var isBinary = reIsBinary.test(value);
|
979
|
+
return (isBinary || reIsOctal.test(value))
|
980
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
981
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
982
|
+
}
|
983
|
+
|
984
|
+
/* harmony default export */ const lodash_es_toNumber = (toNumber);
|
985
|
+
|
986
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/debounce.js
|
987
|
+
|
988
|
+
|
989
|
+
|
990
|
+
|
991
|
+
/** Error message constants. */
|
992
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
993
|
+
|
994
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
995
|
+
var nativeMax = Math.max,
|
996
|
+
nativeMin = Math.min;
|
997
|
+
|
998
|
+
/**
|
999
|
+
* Creates a debounced function that delays invoking `func` until after `wait`
|
1000
|
+
* milliseconds have elapsed since the last time the debounced function was
|
1001
|
+
* invoked. The debounced function comes with a `cancel` method to cancel
|
1002
|
+
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
1003
|
+
* Provide `options` to indicate whether `func` should be invoked on the
|
1004
|
+
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
1005
|
+
* with the last arguments provided to the debounced function. Subsequent
|
1006
|
+
* calls to the debounced function return the result of the last `func`
|
1007
|
+
* invocation.
|
1008
|
+
*
|
1009
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
1010
|
+
* invoked on the trailing edge of the timeout only if the debounced function
|
1011
|
+
* is invoked more than once during the `wait` timeout.
|
1012
|
+
*
|
1013
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
1014
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
1015
|
+
*
|
1016
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
1017
|
+
* for details over the differences between `_.debounce` and `_.throttle`.
|
1018
|
+
*
|
1019
|
+
* @static
|
1020
|
+
* @memberOf _
|
1021
|
+
* @since 0.1.0
|
1022
|
+
* @category Function
|
1023
|
+
* @param {Function} func The function to debounce.
|
1024
|
+
* @param {number} [wait=0] The number of milliseconds to delay.
|
1025
|
+
* @param {Object} [options={}] The options object.
|
1026
|
+
* @param {boolean} [options.leading=false]
|
1027
|
+
* Specify invoking on the leading edge of the timeout.
|
1028
|
+
* @param {number} [options.maxWait]
|
1029
|
+
* The maximum time `func` is allowed to be delayed before it's invoked.
|
1030
|
+
* @param {boolean} [options.trailing=true]
|
1031
|
+
* Specify invoking on the trailing edge of the timeout.
|
1032
|
+
* @returns {Function} Returns the new debounced function.
|
1033
|
+
* @example
|
1034
|
+
*
|
1035
|
+
* // Avoid costly calculations while the window size is in flux.
|
1036
|
+
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
1037
|
+
*
|
1038
|
+
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
1039
|
+
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
1040
|
+
* 'leading': true,
|
1041
|
+
* 'trailing': false
|
1042
|
+
* }));
|
1043
|
+
*
|
1044
|
+
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
1045
|
+
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
1046
|
+
* var source = new EventSource('/stream');
|
1047
|
+
* jQuery(source).on('message', debounced);
|
1048
|
+
*
|
1049
|
+
* // Cancel the trailing debounced invocation.
|
1050
|
+
* jQuery(window).on('popstate', debounced.cancel);
|
1051
|
+
*/
|
1052
|
+
function debounce(func, wait, options) {
|
1053
|
+
var lastArgs,
|
1054
|
+
lastThis,
|
1055
|
+
maxWait,
|
1056
|
+
result,
|
1057
|
+
timerId,
|
1058
|
+
lastCallTime,
|
1059
|
+
lastInvokeTime = 0,
|
1060
|
+
leading = false,
|
1061
|
+
maxing = false,
|
1062
|
+
trailing = true;
|
1063
|
+
|
1064
|
+
if (typeof func != 'function') {
|
1065
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
1066
|
+
}
|
1067
|
+
wait = lodash_es_toNumber(wait) || 0;
|
1068
|
+
if (lodash_es_isObject(options)) {
|
1069
|
+
leading = !!options.leading;
|
1070
|
+
maxing = 'maxWait' in options;
|
1071
|
+
maxWait = maxing ? nativeMax(lodash_es_toNumber(options.maxWait) || 0, wait) : maxWait;
|
1072
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
1073
|
+
}
|
1074
|
+
|
1075
|
+
function invokeFunc(time) {
|
1076
|
+
var args = lastArgs,
|
1077
|
+
thisArg = lastThis;
|
1078
|
+
|
1079
|
+
lastArgs = lastThis = undefined;
|
1080
|
+
lastInvokeTime = time;
|
1081
|
+
result = func.apply(thisArg, args);
|
1082
|
+
return result;
|
1083
|
+
}
|
1084
|
+
|
1085
|
+
function leadingEdge(time) {
|
1086
|
+
// Reset any `maxWait` timer.
|
1087
|
+
lastInvokeTime = time;
|
1088
|
+
// Start the timer for the trailing edge.
|
1089
|
+
timerId = setTimeout(timerExpired, wait);
|
1090
|
+
// Invoke the leading edge.
|
1091
|
+
return leading ? invokeFunc(time) : result;
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
function remainingWait(time) {
|
1095
|
+
var timeSinceLastCall = time - lastCallTime,
|
1096
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
1097
|
+
timeWaiting = wait - timeSinceLastCall;
|
1098
|
+
|
1099
|
+
return maxing
|
1100
|
+
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
1101
|
+
: timeWaiting;
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
function shouldInvoke(time) {
|
1105
|
+
var timeSinceLastCall = time - lastCallTime,
|
1106
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
1107
|
+
|
1108
|
+
// Either this is the first call, activity has stopped and we're at the
|
1109
|
+
// trailing edge, the system time has gone backwards and we're treating
|
1110
|
+
// it as the trailing edge, or we've hit the `maxWait` limit.
|
1111
|
+
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
1112
|
+
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
1113
|
+
}
|
1114
|
+
|
1115
|
+
function timerExpired() {
|
1116
|
+
var time = lodash_es_now();
|
1117
|
+
if (shouldInvoke(time)) {
|
1118
|
+
return trailingEdge(time);
|
1119
|
+
}
|
1120
|
+
// Restart the timer.
|
1121
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
1122
|
+
}
|
1123
|
+
|
1124
|
+
function trailingEdge(time) {
|
1125
|
+
timerId = undefined;
|
1126
|
+
|
1127
|
+
// Only invoke if we have `lastArgs` which means `func` has been
|
1128
|
+
// debounced at least once.
|
1129
|
+
if (trailing && lastArgs) {
|
1130
|
+
return invokeFunc(time);
|
1131
|
+
}
|
1132
|
+
lastArgs = lastThis = undefined;
|
1133
|
+
return result;
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
function cancel() {
|
1137
|
+
if (timerId !== undefined) {
|
1138
|
+
clearTimeout(timerId);
|
1139
|
+
}
|
1140
|
+
lastInvokeTime = 0;
|
1141
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
function flush() {
|
1145
|
+
return timerId === undefined ? result : trailingEdge(lodash_es_now());
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
function debounced() {
|
1149
|
+
var time = lodash_es_now(),
|
1150
|
+
isInvoking = shouldInvoke(time);
|
1151
|
+
|
1152
|
+
lastArgs = arguments;
|
1153
|
+
lastThis = this;
|
1154
|
+
lastCallTime = time;
|
1155
|
+
|
1156
|
+
if (isInvoking) {
|
1157
|
+
if (timerId === undefined) {
|
1158
|
+
return leadingEdge(lastCallTime);
|
1159
|
+
}
|
1160
|
+
if (maxing) {
|
1161
|
+
// Handle invocations in a tight loop.
|
1162
|
+
clearTimeout(timerId);
|
1163
|
+
timerId = setTimeout(timerExpired, wait);
|
1164
|
+
return invokeFunc(lastCallTime);
|
1165
|
+
}
|
1166
|
+
}
|
1167
|
+
if (timerId === undefined) {
|
1168
|
+
timerId = setTimeout(timerExpired, wait);
|
1169
|
+
}
|
1170
|
+
return result;
|
1171
|
+
}
|
1172
|
+
debounced.cancel = cancel;
|
1173
|
+
debounced.flush = flush;
|
1174
|
+
return debounced;
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
/* harmony default export */ const lodash_es_debounce = (debounce);
|
1178
|
+
|
1179
|
+
;// CONCATENATED MODULE: ../../node_modules/lodash-es/throttle.js
|
1180
|
+
|
1181
|
+
|
1182
|
+
|
1183
|
+
/** Error message constants. */
|
1184
|
+
var throttle_FUNC_ERROR_TEXT = 'Expected a function';
|
1185
|
+
|
1186
|
+
/**
|
1187
|
+
* Creates a throttled function that only invokes `func` at most once per
|
1188
|
+
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
1189
|
+
* method to cancel delayed `func` invocations and a `flush` method to
|
1190
|
+
* immediately invoke them. Provide `options` to indicate whether `func`
|
1191
|
+
* should be invoked on the leading and/or trailing edge of the `wait`
|
1192
|
+
* timeout. The `func` is invoked with the last arguments provided to the
|
1193
|
+
* throttled function. Subsequent calls to the throttled function return the
|
1194
|
+
* result of the last `func` invocation.
|
1195
|
+
*
|
1196
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
1197
|
+
* invoked on the trailing edge of the timeout only if the throttled function
|
1198
|
+
* is invoked more than once during the `wait` timeout.
|
1199
|
+
*
|
1200
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
1201
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
1202
|
+
*
|
1203
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
1204
|
+
* for details over the differences between `_.throttle` and `_.debounce`.
|
1205
|
+
*
|
1206
|
+
* @static
|
1207
|
+
* @memberOf _
|
1208
|
+
* @since 0.1.0
|
1209
|
+
* @category Function
|
1210
|
+
* @param {Function} func The function to throttle.
|
1211
|
+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
1212
|
+
* @param {Object} [options={}] The options object.
|
1213
|
+
* @param {boolean} [options.leading=true]
|
1214
|
+
* Specify invoking on the leading edge of the timeout.
|
1215
|
+
* @param {boolean} [options.trailing=true]
|
1216
|
+
* Specify invoking on the trailing edge of the timeout.
|
1217
|
+
* @returns {Function} Returns the new throttled function.
|
1218
|
+
* @example
|
1219
|
+
*
|
1220
|
+
* // Avoid excessively updating the position while scrolling.
|
1221
|
+
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
1222
|
+
*
|
1223
|
+
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
1224
|
+
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
1225
|
+
* jQuery(element).on('click', throttled);
|
1226
|
+
*
|
1227
|
+
* // Cancel the trailing throttled invocation.
|
1228
|
+
* jQuery(window).on('popstate', throttled.cancel);
|
1229
|
+
*/
|
1230
|
+
function throttle(func, wait, options) {
|
1231
|
+
var leading = true,
|
1232
|
+
trailing = true;
|
1233
|
+
|
1234
|
+
if (typeof func != 'function') {
|
1235
|
+
throw new TypeError(throttle_FUNC_ERROR_TEXT);
|
1236
|
+
}
|
1237
|
+
if (lodash_es_isObject(options)) {
|
1238
|
+
leading = 'leading' in options ? !!options.leading : leading;
|
1239
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
1240
|
+
}
|
1241
|
+
return lodash_es_debounce(func, wait, {
|
1242
|
+
'leading': leading,
|
1243
|
+
'maxWait': wait,
|
1244
|
+
'trailing': trailing
|
1245
|
+
});
|
1246
|
+
}
|
1247
|
+
|
1248
|
+
/* harmony default export */ const lodash_es_throttle = (throttle);
|
1249
|
+
|
1250
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/scrollbar-core/helpers.ts
|
1251
|
+
|
1252
|
+
/*
|
1253
|
+
* Tencent is pleased to support the open source community by making
|
1254
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1255
|
+
*
|
1256
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1257
|
+
*
|
1258
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1259
|
+
*
|
1260
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1261
|
+
*
|
1262
|
+
* ---------------------------------------------------
|
1263
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1264
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1265
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1266
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1267
|
+
*
|
1268
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1269
|
+
* the Software.
|
1270
|
+
*
|
1271
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1272
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1273
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1274
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1275
|
+
* IN THE SOFTWARE.
|
1276
|
+
*/
|
1277
|
+
function getElementWindow(element) {
|
1278
|
+
var _element$ownerDocumen, _element$ownerDocumen2;
|
1279
|
+
return (_element$ownerDocumen = element === null || element === void 0 || (_element$ownerDocumen2 = element.ownerDocument) === null || _element$ownerDocumen2 === void 0 ? void 0 : _element$ownerDocumen2.defaultView) !== null && _element$ownerDocumen !== void 0 ? _element$ownerDocumen : window;
|
1280
|
+
}
|
1281
|
+
function getElementDocument(element) {
|
1282
|
+
var _element$ownerDocumen3;
|
1283
|
+
return (_element$ownerDocumen3 = element === null || element === void 0 ? void 0 : element.ownerDocument) !== null && _element$ownerDocumen3 !== void 0 ? _element$ownerDocumen3 : document;
|
1284
|
+
}
|
1285
|
+
function addClasses(el, classes) {
|
1286
|
+
var _el$classList;
|
1287
|
+
if (!el) return;
|
1288
|
+
(_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(classes.split(' ')));
|
1289
|
+
}
|
1290
|
+
function removeClasses(el, classes) {
|
1291
|
+
if (!el) return;
|
1292
|
+
classes.split(' ').forEach(function (className) {
|
1293
|
+
el.classList.remove(className);
|
1294
|
+
});
|
1295
|
+
}
|
1296
|
+
function classNamesToQuery(classNames) {
|
1297
|
+
return ".".concat(classNames.split(' ').join('.'));
|
1298
|
+
}
|
1299
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/scrollbar-core/mouse-wheel.ts
|
1300
|
+
/*
|
1301
|
+
* Tencent is pleased to support the open source community by making
|
1302
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1303
|
+
*
|
1304
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1305
|
+
*
|
1306
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1307
|
+
*
|
1308
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1309
|
+
*
|
1310
|
+
* ---------------------------------------------------
|
1311
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1312
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1313
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1314
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1315
|
+
*
|
1316
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1317
|
+
* the Software.
|
1318
|
+
*
|
1319
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1320
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1321
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1322
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1323
|
+
* IN THE SOFTWARE.
|
1324
|
+
*/
|
1325
|
+
/* harmony default export */ const mouse_wheel = (function (fn) {
|
1326
|
+
var DELTA_SCALE = {
|
1327
|
+
STANDARD: 1,
|
1328
|
+
OTHERS: -3
|
1329
|
+
};
|
1330
|
+
var DELTA_MODE = [1.0, 28.0, 500.0];
|
1331
|
+
var getDeltaMode = function getDeltaMode(mode) {
|
1332
|
+
return DELTA_MODE[mode] || DELTA_MODE[0];
|
1333
|
+
};
|
1334
|
+
var normalizeDelta = function normalizeDelta(evt) {
|
1335
|
+
if ('deltaX' in evt) {
|
1336
|
+
var mode = getDeltaMode(evt.deltaMode);
|
1337
|
+
return {
|
1338
|
+
x: evt.deltaX / DELTA_SCALE.STANDARD * mode,
|
1339
|
+
y: evt.deltaY / DELTA_SCALE.STANDARD * mode,
|
1340
|
+
evt: evt
|
1341
|
+
};
|
1342
|
+
}
|
1343
|
+
if ('wheelDeltaX' in evt) {
|
1344
|
+
return {
|
1345
|
+
x: evt.wheelDeltaX / DELTA_SCALE.OTHERS,
|
1346
|
+
y: evt.wheelDeltaY / DELTA_SCALE.OTHERS,
|
1347
|
+
evt: evt
|
1348
|
+
};
|
1349
|
+
}
|
1350
|
+
// ie with touchpad
|
1351
|
+
return {
|
1352
|
+
x: 0,
|
1353
|
+
y: evt.wheelDelta / DELTA_SCALE.OTHERS,
|
1354
|
+
evt: evt
|
1355
|
+
};
|
1356
|
+
};
|
1357
|
+
var eventName = 'onwheel' in window || document.implementation.hasFeature('Events.wheel', '3.0') ? 'wheel' : 'mousewheel';
|
1358
|
+
var resolveEventResponse = function resolveEventResponse(e) {
|
1359
|
+
fn(normalizeDelta(e));
|
1360
|
+
};
|
1361
|
+
var addWheelEvent = function addWheelEvent(target) {
|
1362
|
+
target.addEventListener(eventName, resolveEventResponse);
|
1363
|
+
};
|
1364
|
+
var removeWheelEvent = function removeWheelEvent(target) {
|
1365
|
+
target.removeEventListener(eventName, resolveEventResponse);
|
1366
|
+
};
|
1367
|
+
return {
|
1368
|
+
addWheelEvent: addWheelEvent,
|
1369
|
+
removeWheelEvent: removeWheelEvent
|
1370
|
+
};
|
1371
|
+
});
|
1372
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/scrollbar-core/can-use-dom.ts
|
1373
|
+
/*
|
1374
|
+
* Tencent is pleased to support the open source community by making
|
1375
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1376
|
+
*
|
1377
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1378
|
+
*
|
1379
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1380
|
+
*
|
1381
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1382
|
+
*
|
1383
|
+
* ---------------------------------------------------
|
1384
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1385
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1386
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1387
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1388
|
+
*
|
1389
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1390
|
+
* the Software.
|
1391
|
+
*
|
1392
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1393
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1394
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1395
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1396
|
+
* IN THE SOFTWARE.
|
1397
|
+
*/
|
1398
|
+
/* harmony default export */ const scrollbar_core_can_use_dom = (function () {
|
1399
|
+
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
1400
|
+
});
|
1401
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/scrollbar-core/scrollbar-width.ts
|
1402
|
+
/*
|
1403
|
+
* Tencent is pleased to support the open source community by making
|
1404
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1405
|
+
*
|
1406
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1407
|
+
*
|
1408
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1409
|
+
*
|
1410
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1411
|
+
*
|
1412
|
+
* ---------------------------------------------------
|
1413
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1414
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1415
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1416
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1417
|
+
*
|
1418
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1419
|
+
* the Software.
|
1420
|
+
*
|
1421
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1422
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1423
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1424
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1425
|
+
* IN THE SOFTWARE.
|
1426
|
+
*/
|
1427
|
+
|
1428
|
+
var cachedScrollbarWidth = null;
|
1429
|
+
var cachedDevicePixelRatio = null;
|
1430
|
+
if (scrollbar_core_can_use_dom()) {
|
1431
|
+
window.addEventListener('resize', function () {
|
1432
|
+
if (cachedDevicePixelRatio !== window.devicePixelRatio) {
|
1433
|
+
cachedDevicePixelRatio = window.devicePixelRatio;
|
1434
|
+
cachedScrollbarWidth = null;
|
1435
|
+
}
|
1436
|
+
});
|
1437
|
+
}
|
1438
|
+
function scrollbarWidth() {
|
1439
|
+
if (cachedScrollbarWidth === null) {
|
1440
|
+
if (typeof document === 'undefined') {
|
1441
|
+
cachedScrollbarWidth = 0;
|
1442
|
+
return cachedScrollbarWidth;
|
1443
|
+
}
|
1444
|
+
var _document = document,
|
1445
|
+
body = _document.body;
|
1446
|
+
var box = document.createElement('div');
|
1447
|
+
box.classList.add('simplebar-hide-scrollbar');
|
1448
|
+
body.appendChild(box);
|
1449
|
+
var width = box.getBoundingClientRect().right;
|
1450
|
+
body.removeChild(box);
|
1451
|
+
cachedScrollbarWidth = width;
|
1452
|
+
}
|
1453
|
+
return cachedScrollbarWidth;
|
1454
|
+
}
|
1455
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/scrollbar-core/index.ts
|
1456
|
+
|
1457
|
+
|
1458
|
+
|
1459
|
+
|
1460
|
+
|
1461
|
+
function scrollbar_core_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
1462
|
+
function scrollbar_core_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? scrollbar_core_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : scrollbar_core_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
1463
|
+
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
1464
|
+
/*
|
1465
|
+
* Tencent is pleased to support the open source community by making
|
1466
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1467
|
+
*
|
1468
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1469
|
+
*
|
1470
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1471
|
+
*
|
1472
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1473
|
+
*
|
1474
|
+
* ---------------------------------------------------
|
1475
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1476
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1477
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1478
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1479
|
+
*
|
1480
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1481
|
+
* the Software.
|
1482
|
+
*
|
1483
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1484
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1485
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1486
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1487
|
+
* IN THE SOFTWARE.
|
1488
|
+
*/
|
1489
|
+
|
1490
|
+
|
1491
|
+
|
1492
|
+
|
1493
|
+
|
1494
|
+
var scrollbar_core_getElementWindow = getElementWindow,
|
1495
|
+
scrollbar_core_getElementDocument = getElementDocument,
|
1496
|
+
scrollbar_core_addClasses = addClasses,
|
1497
|
+
scrollbar_core_removeClasses = removeClasses,
|
1498
|
+
scrollbar_core_classNamesToQuery = classNamesToQuery;
|
1499
|
+
var SimpleBarCore = /*#__PURE__*/function () {
|
1500
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
1501
|
+
function SimpleBarCore(element) {
|
1502
|
+
var _this = this;
|
1503
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1504
|
+
_classCallCheck(this, SimpleBarCore);
|
1505
|
+
_defineProperty(this, "removePreventClickId", null);
|
1506
|
+
_defineProperty(this, "minScrollbarWidth", 20);
|
1507
|
+
_defineProperty(this, "stopScrollDelay", 175);
|
1508
|
+
_defineProperty(this, "isScrolling", false);
|
1509
|
+
_defineProperty(this, "isMouseEntering", false);
|
1510
|
+
_defineProperty(this, "isDragging", false);
|
1511
|
+
_defineProperty(this, "scrollXTicking", false);
|
1512
|
+
_defineProperty(this, "scrollYTicking", false);
|
1513
|
+
_defineProperty(this, "wrapperEl", null);
|
1514
|
+
_defineProperty(this, "contentEl", null);
|
1515
|
+
_defineProperty(this, "delegateXContent", null);
|
1516
|
+
_defineProperty(this, "delegateYContent", null);
|
1517
|
+
_defineProperty(this, "rtlHelpers", null);
|
1518
|
+
_defineProperty(this, "scrollbarWidth", 0);
|
1519
|
+
_defineProperty(this, "resizeObserver", null);
|
1520
|
+
_defineProperty(this, "mutationObserver", null);
|
1521
|
+
_defineProperty(this, "elStyles", null);
|
1522
|
+
_defineProperty(this, "isRtl", null);
|
1523
|
+
_defineProperty(this, "mouseX", 0);
|
1524
|
+
_defineProperty(this, "mouseY", 0);
|
1525
|
+
_defineProperty(this, "mouseWheelInstance", null);
|
1526
|
+
_defineProperty(this, "wheelOffset", 0);
|
1527
|
+
/**
|
1528
|
+
* 最外层滚动容器滚动实际位置缓存器
|
1529
|
+
*/
|
1530
|
+
_defineProperty(this, "wrapperScrollValue", {
|
1531
|
+
scrollTop: 0,
|
1532
|
+
scrollLeft: 0
|
1533
|
+
});
|
1534
|
+
/**
|
1535
|
+
* 模拟滚动条内部缩略滚动器滚动位置缓存器
|
1536
|
+
*/
|
1537
|
+
_defineProperty(this, "wrapperScrollMap", {});
|
1538
|
+
_defineProperty(this, "onMouseMove", function () {});
|
1539
|
+
_defineProperty(this, "onWindowResize", function () {});
|
1540
|
+
_defineProperty(this, "onStopScrolling", function () {});
|
1541
|
+
_defineProperty(this, "onMouseEntered", function () {});
|
1542
|
+
_defineProperty(this, "onMouseWheel", function () {});
|
1543
|
+
/**
|
1544
|
+
* On scroll event handling
|
1545
|
+
*/
|
1546
|
+
_defineProperty(this, "onScroll", function () {
|
1547
|
+
var elWindow = scrollbar_core_getElementWindow(_this.el);
|
1548
|
+
if (!_this.scrollXTicking) {
|
1549
|
+
elWindow.requestAnimationFrame(_this.scrollX);
|
1550
|
+
_this.scrollXTicking = true;
|
1551
|
+
}
|
1552
|
+
if (!_this.scrollYTicking) {
|
1553
|
+
elWindow.requestAnimationFrame(_this.scrollY);
|
1554
|
+
_this.scrollYTicking = true;
|
1555
|
+
}
|
1556
|
+
if (!_this.isScrolling) {
|
1557
|
+
_this.isScrolling = true;
|
1558
|
+
scrollbar_core_addClasses(_this.el, _this.classNames.scrolling);
|
1559
|
+
}
|
1560
|
+
_this.showScrollbar('x');
|
1561
|
+
_this.showScrollbar('y');
|
1562
|
+
_this.onStopScrolling();
|
1563
|
+
});
|
1564
|
+
_defineProperty(this, "scrollX", function () {
|
1565
|
+
if (_this.axis.x.isOverflowing) {
|
1566
|
+
_this.positionScrollbar('x');
|
1567
|
+
}
|
1568
|
+
_this.scrollXTicking = false;
|
1569
|
+
});
|
1570
|
+
_defineProperty(this, "scrollY", function () {
|
1571
|
+
if (_this.axis.y.isOverflowing) {
|
1572
|
+
_this.positionScrollbar('y');
|
1573
|
+
}
|
1574
|
+
_this.scrollYTicking = false;
|
1575
|
+
});
|
1576
|
+
_defineProperty(this, "_onMouseWheel", function (args) {
|
1577
|
+
var nextPostiion = _this.wheelOffset + args.y;
|
1578
|
+
if (_this.scrollToAxisPosition(nextPostiion, 'y')) {
|
1579
|
+
args.evt.stopPropagation();
|
1580
|
+
args.evt.preventDefault();
|
1581
|
+
args.evt.stopImmediatePropagation();
|
1582
|
+
_this.showScrollbar('y');
|
1583
|
+
if (_this.mouseWeelTimer) {
|
1584
|
+
clearTimeout(_this.mouseWeelTimer);
|
1585
|
+
_this.mouseWeelTimer = null;
|
1586
|
+
}
|
1587
|
+
_this.mouseWeelTimer = setTimeout(function () {
|
1588
|
+
_this.hideScrollbar('y');
|
1589
|
+
}, 200);
|
1590
|
+
}
|
1591
|
+
});
|
1592
|
+
_defineProperty(this, "_onStopScrolling", function () {
|
1593
|
+
scrollbar_core_removeClasses(_this.el, _this.classNames.scrolling);
|
1594
|
+
if (_this.options.autoHide) {
|
1595
|
+
_this.hideScrollbar('x');
|
1596
|
+
_this.hideScrollbar('y');
|
1597
|
+
}
|
1598
|
+
_this.isScrolling = false;
|
1599
|
+
});
|
1600
|
+
_defineProperty(this, "onMouseEnter", function () {
|
1601
|
+
_this.mouseWeelTimer && clearTimeout(_this.mouseWeelTimer);
|
1602
|
+
if (!_this.isMouseEntering) {
|
1603
|
+
scrollbar_core_addClasses(_this.el, _this.classNames.mouseEntered);
|
1604
|
+
_this.showScrollbar('x');
|
1605
|
+
_this.showScrollbar('y');
|
1606
|
+
_this.isMouseEntering = true;
|
1607
|
+
}
|
1608
|
+
_this.onMouseEntered();
|
1609
|
+
});
|
1610
|
+
_defineProperty(this, "_onMouseEntered", function () {
|
1611
|
+
scrollbar_core_removeClasses(_this.el, _this.classNames.mouseEntered);
|
1612
|
+
if (_this.options.autoHide) {
|
1613
|
+
_this.hideScrollbar('x');
|
1614
|
+
_this.hideScrollbar('y');
|
1615
|
+
}
|
1616
|
+
_this.isMouseEntering = false;
|
1617
|
+
});
|
1618
|
+
_defineProperty(this, "_onMouseMove", function (e) {
|
1619
|
+
_this.mouseX = e.clientX;
|
1620
|
+
_this.mouseY = e.clientY;
|
1621
|
+
if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
|
1622
|
+
_this.onMouseMoveForAxis('x');
|
1623
|
+
}
|
1624
|
+
if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
|
1625
|
+
_this.onMouseMoveForAxis('y');
|
1626
|
+
}
|
1627
|
+
});
|
1628
|
+
_defineProperty(this, "onMouseLeave", function () {
|
1629
|
+
_this.onMouseMove.cancel();
|
1630
|
+
if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
|
1631
|
+
_this.onMouseLeaveForAxis('x');
|
1632
|
+
}
|
1633
|
+
if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
|
1634
|
+
_this.onMouseLeaveForAxis('y');
|
1635
|
+
}
|
1636
|
+
_this.mouseX = -1;
|
1637
|
+
_this.mouseY = -1;
|
1638
|
+
});
|
1639
|
+
_defineProperty(this, "_onWindowResize", function () {
|
1640
|
+
// Recalculate scrollbarWidth in case it's a zoom
|
1641
|
+
_this.scrollbarWidth = _this.getScrollbarWidth();
|
1642
|
+
});
|
1643
|
+
_defineProperty(this, "onPointerEvent", function (e) {
|
1644
|
+
if (!_this.axis.x.track.el || !_this.axis.y.track.el || !_this.axis.x.scrollbar.el || !_this.axis.y.scrollbar.el) return;
|
1645
|
+
var isWithinTrackXBounds;
|
1646
|
+
var isWithinTrackYBounds;
|
1647
|
+
_this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();
|
1648
|
+
_this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();
|
1649
|
+
if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
|
1650
|
+
isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect);
|
1651
|
+
}
|
1652
|
+
if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
|
1653
|
+
isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect);
|
1654
|
+
}
|
1655
|
+
// If any pointer event is called on the scrollbar
|
1656
|
+
if (isWithinTrackXBounds || isWithinTrackYBounds) {
|
1657
|
+
// Prevent event leaking
|
1658
|
+
e.stopPropagation();
|
1659
|
+
if (e.type === 'pointerdown' && e.pointerType !== 'touch') {
|
1660
|
+
if (isWithinTrackXBounds) {
|
1661
|
+
_this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect();
|
1662
|
+
if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) {
|
1663
|
+
_this.onDragStart(e, 'x');
|
1664
|
+
} else {
|
1665
|
+
_this.onTrackClick(e, 'x');
|
1666
|
+
}
|
1667
|
+
}
|
1668
|
+
if (isWithinTrackYBounds) {
|
1669
|
+
_this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect();
|
1670
|
+
if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) {
|
1671
|
+
_this.onDragStart(e, 'y');
|
1672
|
+
} else {
|
1673
|
+
_this.onTrackClick(e, 'y');
|
1674
|
+
}
|
1675
|
+
}
|
1676
|
+
}
|
1677
|
+
}
|
1678
|
+
});
|
1679
|
+
/**
|
1680
|
+
* Drag scrollbar handle
|
1681
|
+
*/
|
1682
|
+
_defineProperty(this, "drag", function (e) {
|
1683
|
+
var _track$rect$_this$axi, _track$rect, _track$rect$_this$axi2, _track$rect2;
|
1684
|
+
if (!_this.draggedAxis || !_this.wrapperEl) return;
|
1685
|
+
var eventOffset;
|
1686
|
+
var track = _this.axis[_this.draggedAxis].track;
|
1687
|
+
var scrollbar = _this.axis[_this.draggedAxis].scrollbar;
|
1688
|
+
e.preventDefault();
|
1689
|
+
e.stopPropagation();
|
1690
|
+
if (_this.draggedAxis === 'y') {
|
1691
|
+
eventOffset = e.pageY;
|
1692
|
+
} else {
|
1693
|
+
eventOffset = e.pageX;
|
1694
|
+
}
|
1695
|
+
// Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).
|
1696
|
+
var dragPos = eventOffset - ((_track$rect$_this$axi = (_track$rect = track.rect) === null || _track$rect === void 0 ? void 0 : _track$rect[_this.axis[_this.draggedAxis].offsetAttr]) !== null && _track$rect$_this$axi !== void 0 ? _track$rect$_this$axi : 0) - _this.axis[_this.draggedAxis].dragOffset;
|
1697
|
+
dragPos = _this.draggedAxis === 'x' && _this.isRtl ? ((_track$rect$_this$axi2 = (_track$rect2 = track.rect) === null || _track$rect2 === void 0 ? void 0 : _track$rect2[_this.axis[_this.draggedAxis].sizeAttr]) !== null && _track$rect$_this$axi2 !== void 0 ? _track$rect$_this$axi2 : 0) - scrollbar.size - dragPos : dragPos;
|
1698
|
+
var scrollPos = _this.getPointerPosition(dragPos, _this.draggedAxis);
|
1699
|
+
_this.scrollToAxisPosition(scrollPos, _this.draggedAxis);
|
1700
|
+
});
|
1701
|
+
_defineProperty(this, "getPointerPosition", function (dragPos, axis) {
|
1702
|
+
var _track$rect$_this$axi3, _track$rect3, _this$wrapperEl$_this, _this$wrapperEl, _this$elStyles$_this$, _this$elStyles;
|
1703
|
+
var track = _this.axis[axis].track;
|
1704
|
+
var trackSize = (_track$rect$_this$axi3 = (_track$rect3 = track.rect) === null || _track$rect3 === void 0 ? void 0 : _track$rect3[_this.axis[axis].sizeAttr]) !== null && _track$rect$_this$axi3 !== void 0 ? _track$rect$_this$axi3 : 0;
|
1705
|
+
var scrollbar = _this.axis[axis].scrollbar;
|
1706
|
+
var contentSize = (_this$wrapperEl$_this = (_this$wrapperEl = _this.wrapperEl) === null || _this$wrapperEl === void 0 ? void 0 : _this$wrapperEl[_this.axis[axis].scrollSizeAttr]) !== null && _this$wrapperEl$_this !== void 0 ? _this$wrapperEl$_this : 0;
|
1707
|
+
var hostSize = parseInt((_this$elStyles$_this$ = (_this$elStyles = _this.elStyles) === null || _this$elStyles === void 0 ? void 0 : _this$elStyles[_this.axis[axis].sizeAttr]) !== null && _this$elStyles$_this$ !== void 0 ? _this$elStyles$_this$ : '0px', 10);
|
1708
|
+
// Convert the mouse position into a percentage of the scrollbar height/width.
|
1709
|
+
var dragPerc = dragPos / (trackSize - scrollbar.size);
|
1710
|
+
// Scroll the content by the same percentage.
|
1711
|
+
var scrollPos = dragPerc * (contentSize - hostSize);
|
1712
|
+
// Fix browsers inconsistency on RTL
|
1713
|
+
if (axis === 'x' && _this.isRtl) {
|
1714
|
+
var _SimpleBarCore$getRtl;
|
1715
|
+
scrollPos = (_SimpleBarCore$getRtl = SimpleBarCore.getRtlHelpers()) !== null && _SimpleBarCore$getRtl !== void 0 && _SimpleBarCore$getRtl.isScrollingToNegative ? -scrollPos : scrollPos;
|
1716
|
+
}
|
1717
|
+
return scrollPos;
|
1718
|
+
});
|
1719
|
+
_defineProperty(this, "scrollToAxisPosition", function (scrollPos, axisValue) {
|
1720
|
+
var _this$wrapperScrollVa;
|
1721
|
+
var getFormatPosition = function getFormatPosition() {
|
1722
|
+
if (scrollPos < 0) {
|
1723
|
+
return 0;
|
1724
|
+
}
|
1725
|
+
if (axisValue === 'y') {
|
1726
|
+
var diffHeight = _this.wrapperEl.scrollHeight - _this.wrapperEl.offsetHeight;
|
1727
|
+
return scrollPos >= diffHeight ? diffHeight : scrollPos;
|
1728
|
+
}
|
1729
|
+
var diffWidth = _this.wrapperEl.scrollWidth - _this.wrapperEl.offsetWidth;
|
1730
|
+
return scrollPos >= diffWidth ? diffWidth : scrollPos;
|
1731
|
+
};
|
1732
|
+
var scrollAttr = _this.axis[axisValue].scrollOffsetAttr;
|
1733
|
+
var resolvedValue = getFormatPosition();
|
1734
|
+
var scrollValue = (_this$wrapperScrollVa = _this.wrapperScrollValue[scrollAttr]) !== null && _this$wrapperScrollVa !== void 0 ? _this$wrapperScrollVa : 0;
|
1735
|
+
if (scrollValue !== resolvedValue) {
|
1736
|
+
_this.fixedScrollTo(axisValue, resolvedValue);
|
1737
|
+
return true;
|
1738
|
+
}
|
1739
|
+
return false;
|
1740
|
+
});
|
1741
|
+
_defineProperty(this, "fixedScrollTo", function (axisValue, resolvedValue) {
|
1742
|
+
var _this$options, _this$options$onScrol;
|
1743
|
+
var getStyleValue = function getStyleValue(key) {
|
1744
|
+
var xValue = _this.axis[key].track.el.style.getPropertyValue('--scroll-offset-x');
|
1745
|
+
var yValye = _this.axis[key].track.el.style.getPropertyValue('--scroll-offset-y');
|
1746
|
+
return [xValue ? xValue : '0px', yValye ? yValye : '0px'];
|
1747
|
+
};
|
1748
|
+
var scrollAttr = _this.axis[axisValue].scrollOffsetAttr;
|
1749
|
+
Object.assign(_this.wrapperScrollValue, _defineProperty({}, scrollAttr, resolvedValue));
|
1750
|
+
if (_this.options.useSystemScrollXBehavior && axisValue === 'x' || _this.options.useSystemScrollYBehavior && axisValue === 'y') {
|
1751
|
+
_this.wrapperEl[scrollAttr] = resolvedValue;
|
1752
|
+
var _getStyleValue = getStyleValue('y'),
|
1753
|
+
_getStyleValue2 = _slicedToArray(_getStyleValue, 2),
|
1754
|
+
verticalX = _getStyleValue2[0],
|
1755
|
+
verticalY = _getStyleValue2[1];
|
1756
|
+
var _getStyleValue3 = getStyleValue('x'),
|
1757
|
+
_getStyleValue4 = _slicedToArray(_getStyleValue3, 2),
|
1758
|
+
horiX = _getStyleValue4[0],
|
1759
|
+
horiY = _getStyleValue4[1];
|
1760
|
+
var old = {
|
1761
|
+
x: {
|
1762
|
+
x: horiX,
|
1763
|
+
y: horiY
|
1764
|
+
},
|
1765
|
+
y: {
|
1766
|
+
x: verticalX,
|
1767
|
+
y: verticalY
|
1768
|
+
}
|
1769
|
+
};
|
1770
|
+
['x', 'y'].forEach(function (key) {
|
1771
|
+
old[key][axisValue] = "".concat(resolvedValue, "px");
|
1772
|
+
_this.axis[key].track.el.style.setProperty('--scroll-offset-x', old[key].x);
|
1773
|
+
_this.axis[key].track.el.style.setProperty('--scroll-offset-y', old[key].y);
|
1774
|
+
});
|
1775
|
+
}
|
1776
|
+
if (axisValue === 'y') {
|
1777
|
+
_this.wheelOffset = resolvedValue;
|
1778
|
+
}
|
1779
|
+
(_this$options = _this.options) === null || _this$options === void 0 || (_this$options$onScrol = _this$options.onScrollCallback) === null || _this$options$onScrol === void 0 || _this$options$onScrol.call(_this$options, {
|
1780
|
+
x: _this.wrapperScrollValue.scrollLeft,
|
1781
|
+
y: _this.wrapperScrollValue.scrollTop
|
1782
|
+
});
|
1783
|
+
_this.positionScrollbar(axisValue);
|
1784
|
+
});
|
1785
|
+
/**
|
1786
|
+
* End scroll handle drag
|
1787
|
+
*/
|
1788
|
+
_defineProperty(this, "onEndDrag", function (e) {
|
1789
|
+
_this.isDragging = false;
|
1790
|
+
var elDocument = scrollbar_core_getElementDocument(_this.el);
|
1791
|
+
var elWindow = scrollbar_core_getElementWindow(_this.el);
|
1792
|
+
e.preventDefault();
|
1793
|
+
e.stopPropagation();
|
1794
|
+
scrollbar_core_removeClasses(_this.el, _this.classNames.dragging);
|
1795
|
+
_this.onStopScrolling();
|
1796
|
+
elDocument.removeEventListener('mousemove', _this.drag, true);
|
1797
|
+
elDocument.removeEventListener('mouseup', _this.onEndDrag, true);
|
1798
|
+
_this.removePreventClickId = elWindow.setTimeout(function () {
|
1799
|
+
// Remove these asynchronously so we still suppress click events
|
1800
|
+
// generated simultaneously with mouseup.
|
1801
|
+
elDocument.removeEventListener('click', _this.preventClick, true);
|
1802
|
+
elDocument.removeEventListener('dblclick', _this.preventClick, true);
|
1803
|
+
_this.removePreventClickId = null;
|
1804
|
+
scrollbar_core_removeClasses(_this.axis[_this.draggedAxis].track.el, _this.classNames.hover);
|
1805
|
+
});
|
1806
|
+
});
|
1807
|
+
/**
|
1808
|
+
* Handler to ignore click events during drag
|
1809
|
+
*/
|
1810
|
+
_defineProperty(this, "preventClick", function (e) {
|
1811
|
+
e.preventDefault();
|
1812
|
+
e.stopPropagation();
|
1813
|
+
});
|
1814
|
+
this.el = element;
|
1815
|
+
this.options = scrollbar_core_objectSpread(scrollbar_core_objectSpread({}, SimpleBarCore.defaultOptions), options);
|
1816
|
+
this.classNames = scrollbar_core_objectSpread(scrollbar_core_objectSpread({}, SimpleBarCore.defaultOptions.classNames), options.classNames);
|
1817
|
+
this.axis = {
|
1818
|
+
x: {
|
1819
|
+
scrollOffsetAttr: 'scrollLeft',
|
1820
|
+
sizeAttr: 'width',
|
1821
|
+
scrollSizeAttr: 'scrollWidth',
|
1822
|
+
offsetSizeAttr: 'offsetWidth',
|
1823
|
+
offsetAttr: 'left',
|
1824
|
+
overflowAttr: 'overflowX',
|
1825
|
+
dragOffset: 0,
|
1826
|
+
isOverflowing: true,
|
1827
|
+
forceVisible: false,
|
1828
|
+
track: {
|
1829
|
+
size: null,
|
1830
|
+
el: null,
|
1831
|
+
rect: null,
|
1832
|
+
isVisible: false
|
1833
|
+
},
|
1834
|
+
scrollbar: {
|
1835
|
+
size: null,
|
1836
|
+
el: null,
|
1837
|
+
rect: null,
|
1838
|
+
isVisible: false
|
1839
|
+
}
|
1840
|
+
},
|
1841
|
+
y: {
|
1842
|
+
scrollOffsetAttr: 'scrollTop',
|
1843
|
+
sizeAttr: 'height',
|
1844
|
+
scrollSizeAttr: 'scrollHeight',
|
1845
|
+
offsetSizeAttr: 'offsetHeight',
|
1846
|
+
offsetAttr: 'top',
|
1847
|
+
overflowAttr: 'overflowY',
|
1848
|
+
dragOffset: 0,
|
1849
|
+
isOverflowing: true,
|
1850
|
+
forceVisible: false,
|
1851
|
+
track: {
|
1852
|
+
size: null,
|
1853
|
+
el: null,
|
1854
|
+
rect: null,
|
1855
|
+
isVisible: false
|
1856
|
+
},
|
1857
|
+
scrollbar: {
|
1858
|
+
size: null,
|
1859
|
+
el: null,
|
1860
|
+
rect: null,
|
1861
|
+
isVisible: false
|
1862
|
+
}
|
1863
|
+
}
|
1864
|
+
};
|
1865
|
+
if (_typeof(this.el) !== 'object' || !this.el.nodeName) {
|
1866
|
+
throw new Error("Argument passed to SimpleBar must be an HTML element instead of ".concat(this.el));
|
1867
|
+
}
|
1868
|
+
this.onMouseMove = lodash_es_throttle(this._onMouseMove, 64);
|
1869
|
+
this.onWindowResize = lodash_es_debounce(this._onWindowResize, 64, {
|
1870
|
+
leading: true
|
1871
|
+
});
|
1872
|
+
this.onStopScrolling = lodash_es_debounce(this._onStopScrolling, this.stopScrollDelay);
|
1873
|
+
this.onMouseEntered = lodash_es_debounce(this._onMouseEntered, this.stopScrollDelay);
|
1874
|
+
this.mouseWheelInstance = mouse_wheel(this._onMouseWheel);
|
1875
|
+
this.init();
|
1876
|
+
}
|
1877
|
+
return _createClass(SimpleBarCore, [{
|
1878
|
+
key: "getScrollbarWidth",
|
1879
|
+
value: function getScrollbarWidth() {
|
1880
|
+
// Try/catch for FF 56 throwing on undefined computedStyles
|
1881
|
+
try {
|
1882
|
+
// Detect browsers supporting CSS scrollbar styling and do not calculate
|
1883
|
+
if (this.wrapperEl && getComputedStyle(this.wrapperEl, '::-webkit-scrollbar').display === 'none' || 'scrollbarWidth' in document.documentElement.style || '-ms-overflow-style' in document.documentElement.style) {
|
1884
|
+
return 0;
|
1885
|
+
}
|
1886
|
+
return scrollbarWidth();
|
1887
|
+
} catch (e) {
|
1888
|
+
return scrollbarWidth();
|
1889
|
+
}
|
1890
|
+
}
|
1891
|
+
}, {
|
1892
|
+
key: "init",
|
1893
|
+
value: function init() {
|
1894
|
+
// We stop here on server-side
|
1895
|
+
if ((can_use_dom_default())) {
|
1896
|
+
this.initDOM();
|
1897
|
+
this.rtlHelpers = SimpleBarCore.getRtlHelpers();
|
1898
|
+
this.scrollbarWidth = this.getScrollbarWidth();
|
1899
|
+
this.recalculate();
|
1900
|
+
this.initListeners();
|
1901
|
+
}
|
1902
|
+
}
|
1903
|
+
}, {
|
1904
|
+
key: "initDOM",
|
1905
|
+
value: function initDOM() {
|
1906
|
+
var _this$options$wrapper, _this$options$content, _this$axis$x$track$el, _this$axis$y$track$el;
|
1907
|
+
// assume that element has his DOM already initiated
|
1908
|
+
this.wrapperEl = (_this$options$wrapper = this.options.wrapperNode) !== null && _this$options$wrapper !== void 0 ? _this$options$wrapper : this.el.querySelector(scrollbar_core_classNamesToQuery(this.classNames.wrapper));
|
1909
|
+
this.contentEl = (_this$options$content = this.options.contentNode) !== null && _this$options$content !== void 0 ? _this$options$content : this.el.querySelector(scrollbar_core_classNamesToQuery(this.classNames.contentEl));
|
1910
|
+
this.axis.x.track.el = this.findChild(this.el, "".concat(scrollbar_core_classNamesToQuery(this.classNames.track)).concat(scrollbar_core_classNamesToQuery(this.classNames.horizontal)));
|
1911
|
+
this.axis.y.track.el = this.findChild(this.el, "".concat(scrollbar_core_classNamesToQuery(this.classNames.track)).concat(scrollbar_core_classNamesToQuery(this.classNames.vertical)));
|
1912
|
+
this.axis.x.scrollbar.el = ((_this$axis$x$track$el = this.axis.x.track.el) === null || _this$axis$x$track$el === void 0 ? void 0 : _this$axis$x$track$el.querySelector(scrollbar_core_classNamesToQuery(this.classNames.scrollbar))) || null;
|
1913
|
+
this.axis.y.scrollbar.el = ((_this$axis$y$track$el = this.axis.y.track.el) === null || _this$axis$y$track$el === void 0 ? void 0 : _this$axis$y$track$el.querySelector(scrollbar_core_classNamesToQuery(this.classNames.scrollbar))) || null;
|
1914
|
+
if (!this.options.autoHide) {
|
1915
|
+
scrollbar_core_addClasses(this.axis.x.scrollbar.el, this.classNames.visible);
|
1916
|
+
scrollbar_core_addClasses(this.axis.y.scrollbar.el, this.classNames.visible);
|
1917
|
+
}
|
1918
|
+
}
|
1919
|
+
}, {
|
1920
|
+
key: "initListeners",
|
1921
|
+
value: function initListeners() {
|
1922
|
+
var _this$mouseWheelInsta,
|
1923
|
+
_this2 = this;
|
1924
|
+
var elWindow = scrollbar_core_getElementWindow(this.el);
|
1925
|
+
// Event listeners
|
1926
|
+
(_this$mouseWheelInsta = this.mouseWheelInstance) === null || _this$mouseWheelInsta === void 0 || _this$mouseWheelInsta.addWheelEvent(this.el);
|
1927
|
+
this.el.addEventListener('mouseenter', this.onMouseEnter);
|
1928
|
+
this.el.addEventListener('pointerdown', this.onPointerEvent, true);
|
1929
|
+
this.el.addEventListener('mousemove', this.onMouseMove);
|
1930
|
+
this.el.addEventListener('mouseleave', this.onMouseLeave);
|
1931
|
+
// Browser zoom triggers a window resize
|
1932
|
+
elWindow.addEventListener('resize', this.onWindowResize);
|
1933
|
+
if (!this.contentEl) return;
|
1934
|
+
if (window.ResizeObserver) {
|
1935
|
+
// Hack for https://github.com/WICG/ResizeObserver/issues/38
|
1936
|
+
var resizeObserverStarted = false;
|
1937
|
+
var resizeObserver = elWindow.ResizeObserver || ResizeObserver;
|
1938
|
+
// eslint-disable-next-line new-cap
|
1939
|
+
this.resizeObserver = new resizeObserver(function () {
|
1940
|
+
if (!resizeObserverStarted) return;
|
1941
|
+
elWindow.requestAnimationFrame(function () {
|
1942
|
+
_this2.recalculate();
|
1943
|
+
});
|
1944
|
+
});
|
1945
|
+
this.resizeObserver.observe(this.el);
|
1946
|
+
this.resizeObserver.observe(this.contentEl);
|
1947
|
+
if (this.delegateXContent) {
|
1948
|
+
this.resizeObserver.observe(this.delegateXContent);
|
1949
|
+
}
|
1950
|
+
if (this.delegateYContent) {
|
1951
|
+
this.resizeObserver.observe(this.delegateYContent);
|
1952
|
+
}
|
1953
|
+
elWindow.requestAnimationFrame(function () {
|
1954
|
+
resizeObserverStarted = true;
|
1955
|
+
});
|
1956
|
+
}
|
1957
|
+
// This is required to detect horizontal scroll. Vertical scroll only needs the resizeObserver.
|
1958
|
+
this.mutationObserver = new elWindow.MutationObserver(function () {
|
1959
|
+
elWindow.requestAnimationFrame(function () {
|
1960
|
+
_this2.recalculate();
|
1961
|
+
});
|
1962
|
+
});
|
1963
|
+
this.mutationObserver.observe(this.contentEl, {
|
1964
|
+
childList: true,
|
1965
|
+
subtree: true,
|
1966
|
+
characterData: true
|
1967
|
+
});
|
1968
|
+
}
|
1969
|
+
}, {
|
1970
|
+
key: "recalculate",
|
1971
|
+
value: function recalculate() {
|
1972
|
+
if (!this.contentEl || !this.wrapperEl) return;
|
1973
|
+
var elWindow = scrollbar_core_getElementWindow(this.el);
|
1974
|
+
this.elStyles = elWindow.getComputedStyle(this.el);
|
1975
|
+
this.isRtl = this.elStyles.direction === 'rtl';
|
1976
|
+
var wrapperOffsetWidth = this.wrapperEl.offsetWidth;
|
1977
|
+
var wrapperOffsetHeight = this.wrapperEl.offsetHeight;
|
1978
|
+
var wrapperScrollHeight = this.wrapperEl.scrollHeight;
|
1979
|
+
var wrapperScrollWidth = this.wrapperEl.scrollWidth;
|
1980
|
+
this.axis.x.isOverflowing = wrapperOffsetWidth !== 0 && wrapperScrollWidth > wrapperOffsetWidth;
|
1981
|
+
this.axis.y.isOverflowing = wrapperScrollHeight > wrapperOffsetHeight;
|
1982
|
+
this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true;
|
1983
|
+
this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true;
|
1984
|
+
// Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset)
|
1985
|
+
var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0;
|
1986
|
+
var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
|
1987
|
+
this.axis.x.isOverflowing = this.axis.x.isOverflowing && wrapperScrollWidth > wrapperOffsetWidth - offsetForYScrollbar;
|
1988
|
+
this.axis.y.isOverflowing = this.axis.y.isOverflowing && wrapperScrollHeight > wrapperOffsetHeight - offsetForXScrollbar;
|
1989
|
+
this.axis.x.scrollbar.size = this.getScrollbarSize('x');
|
1990
|
+
this.axis.y.scrollbar.size = this.getScrollbarSize('y');
|
1991
|
+
if (this.axis.x.scrollbar.el) this.axis.x.scrollbar.el.style.width = "".concat(this.axis.x.scrollbar.size, "px");
|
1992
|
+
if (this.axis.y.scrollbar.el) this.axis.y.scrollbar.el.style.height = "".concat(this.axis.y.scrollbar.size, "px");
|
1993
|
+
this.positionScrollbar('x');
|
1994
|
+
this.positionScrollbar('y');
|
1995
|
+
this.toggleTrackVisibility('x');
|
1996
|
+
this.toggleTrackVisibility('y');
|
1997
|
+
}
|
1998
|
+
/**
|
1999
|
+
* Calculate scrollbar size
|
2000
|
+
*/
|
2001
|
+
}, {
|
2002
|
+
key: "getScrollbarSize",
|
2003
|
+
value: function getScrollbarSize() {
|
2004
|
+
var _this3 = this,
|
2005
|
+
_this$axis$axis$track,
|
2006
|
+
_this$axis$axis$track2;
|
2007
|
+
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
|
2008
|
+
if (!this.axis[axis].isOverflowing || !this.contentEl) {
|
2009
|
+
return 0;
|
2010
|
+
}
|
2011
|
+
var getContentTarget = function getContentTarget() {
|
2012
|
+
var _this3$options$delega2;
|
2013
|
+
if (axis === 'x') {
|
2014
|
+
var _this3$options$delega;
|
2015
|
+
return (_this3$options$delega = _this3.options.delegateXContent) !== null && _this3$options$delega !== void 0 ? _this3$options$delega : _this3.contentEl;
|
2016
|
+
}
|
2017
|
+
return (_this3$options$delega2 = _this3.options.delegateYContent) !== null && _this3$options$delega2 !== void 0 ? _this3$options$delega2 : _this3.contentEl;
|
2018
|
+
};
|
2019
|
+
var contentSize = getContentTarget()[this.axis[axis].scrollSizeAttr];
|
2020
|
+
var trackSize = (_this$axis$axis$track = (_this$axis$axis$track2 = this.axis[axis].track.el) === null || _this$axis$axis$track2 === void 0 ? void 0 : _this$axis$axis$track2[this.axis[axis].offsetSizeAttr]) !== null && _this$axis$axis$track !== void 0 ? _this$axis$axis$track : 0;
|
2021
|
+
var scrollbarRatio = trackSize / contentSize;
|
2022
|
+
var scrollbarSize;
|
2023
|
+
// Calculate new height/position of drag handle.
|
2024
|
+
scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize);
|
2025
|
+
if (this.options.scrollbarMaxSize) {
|
2026
|
+
scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize);
|
2027
|
+
}
|
2028
|
+
return scrollbarSize;
|
2029
|
+
}
|
2030
|
+
}, {
|
2031
|
+
key: "positionScrollbar",
|
2032
|
+
value: function positionScrollbar() {
|
2033
|
+
var _this$axis$axis$track3, _SimpleBarCore$getRtl2;
|
2034
|
+
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
|
2035
|
+
var scrollbar = this.axis[axis].scrollbar;
|
2036
|
+
if (!this.axis[axis].isOverflowing || !this.wrapperEl || !scrollbar.el || !this.elStyles) {
|
2037
|
+
return;
|
2038
|
+
}
|
2039
|
+
var contentSize = this.wrapperEl[this.axis[axis].scrollSizeAttr];
|
2040
|
+
var trackSize = ((_this$axis$axis$track3 = this.axis[axis].track.el) === null || _this$axis$axis$track3 === void 0 ? void 0 : _this$axis$axis$track3[this.axis[axis].offsetSizeAttr]) || 0;
|
2041
|
+
var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);
|
2042
|
+
var scrollOffset = this.wrapperScrollValue[this.axis[axis].scrollOffsetAttr];
|
2043
|
+
scrollOffset = axis === 'x' && this.isRtl && (_SimpleBarCore$getRtl2 = SimpleBarCore.getRtlHelpers()) !== null && _SimpleBarCore$getRtl2 !== void 0 && _SimpleBarCore$getRtl2.isScrollOriginAtZero ? -scrollOffset : scrollOffset;
|
2044
|
+
if (axis === 'x' && this.isRtl) {
|
2045
|
+
var _SimpleBarCore$getRtl3;
|
2046
|
+
scrollOffset = (_SimpleBarCore$getRtl3 = SimpleBarCore.getRtlHelpers()) !== null && _SimpleBarCore$getRtl3 !== void 0 && _SimpleBarCore$getRtl3.isScrollingToNegative ? scrollOffset : -scrollOffset;
|
2047
|
+
}
|
2048
|
+
var scrollPourcent = scrollOffset / (contentSize - hostSize);
|
2049
|
+
var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent);
|
2050
|
+
handleOffset = axis === 'x' && this.isRtl ? -handleOffset + (trackSize - scrollbar.size) : handleOffset;
|
2051
|
+
var scrollAttr = this.axis[axis].scrollOffsetAttr;
|
2052
|
+
Object.assign(this.wrapperScrollMap, _defineProperty({}, scrollAttr, handleOffset));
|
2053
|
+
scrollbar.el.style.transform = axis === 'x' ? "translate3d(".concat(handleOffset, "px, 0, 0)") : "translate3d(0, ".concat(handleOffset, "px, 0)");
|
2054
|
+
}
|
2055
|
+
}, {
|
2056
|
+
key: "toggleTrackVisibility",
|
2057
|
+
value: function toggleTrackVisibility() {
|
2058
|
+
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
|
2059
|
+
var track = this.axis[axis].track.el;
|
2060
|
+
var scrollbar = this.axis[axis].scrollbar.el;
|
2061
|
+
if (!track || !scrollbar || !this.wrapperEl) return;
|
2062
|
+
if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) {
|
2063
|
+
track.style.visibility = 'visible';
|
2064
|
+
// this.wrapperEl.style[this.axis[axis].overflowAttr] = 'scroll';
|
2065
|
+
this.el.classList.add("".concat(this.classNames.scrollable, "-").concat(axis));
|
2066
|
+
} else {
|
2067
|
+
track.style.visibility = 'hidden';
|
2068
|
+
// this.wrapperEl.style[this.axis[axis].overflowAttr] = 'hidden';
|
2069
|
+
this.el.classList.remove("".concat(this.classNames.scrollable, "-").concat(axis));
|
2070
|
+
}
|
2071
|
+
// Even if forceVisible is enabled, scrollbar itself should be hidden
|
2072
|
+
if (this.axis[axis].isOverflowing) {
|
2073
|
+
scrollbar.style.display = 'block';
|
2074
|
+
} else {
|
2075
|
+
scrollbar.style.display = 'none';
|
2076
|
+
}
|
2077
|
+
}
|
2078
|
+
}, {
|
2079
|
+
key: "showScrollbar",
|
2080
|
+
value: function showScrollbar() {
|
2081
|
+
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
|
2082
|
+
if (this.axis[axis].isOverflowing && !this.axis[axis].scrollbar.isVisible) {
|
2083
|
+
scrollbar_core_addClasses(this.axis[axis].scrollbar.el, this.classNames.visible);
|
2084
|
+
this.axis[axis].scrollbar.isVisible = true;
|
2085
|
+
}
|
2086
|
+
}
|
2087
|
+
}, {
|
2088
|
+
key: "hideScrollbar",
|
2089
|
+
value: function hideScrollbar() {
|
2090
|
+
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
|
2091
|
+
if (this.isDragging) return;
|
2092
|
+
if (this.axis[axis].isOverflowing && this.axis[axis].scrollbar.isVisible) {
|
2093
|
+
scrollbar_core_removeClasses(this.axis[axis].scrollbar.el, this.classNames.visible);
|
2094
|
+
this.axis[axis].scrollbar.isVisible = false;
|
2095
|
+
}
|
2096
|
+
}
|
2097
|
+
}, {
|
2098
|
+
key: "onMouseMoveForAxis",
|
2099
|
+
value: function onMouseMoveForAxis() {
|
2100
|
+
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
|
2101
|
+
var currentAxis = this.axis[axis];
|
2102
|
+
if (!currentAxis.track.el || !currentAxis.scrollbar.el) return;
|
2103
|
+
currentAxis.track.rect = currentAxis.track.el.getBoundingClientRect();
|
2104
|
+
currentAxis.scrollbar.rect = currentAxis.scrollbar.el.getBoundingClientRect();
|
2105
|
+
if (this.isWithinBounds(currentAxis.track.rect)) {
|
2106
|
+
this.showScrollbar(axis);
|
2107
|
+
scrollbar_core_addClasses(currentAxis.track.el, this.classNames.hover);
|
2108
|
+
if (this.isWithinBounds(currentAxis.scrollbar.rect)) {
|
2109
|
+
scrollbar_core_addClasses(currentAxis.scrollbar.el, this.classNames.hover);
|
2110
|
+
} else {
|
2111
|
+
if (!this.isDragging) {
|
2112
|
+
scrollbar_core_removeClasses(currentAxis.scrollbar.el, this.classNames.hover);
|
2113
|
+
}
|
2114
|
+
}
|
2115
|
+
} else {
|
2116
|
+
if (!this.isDragging) {
|
2117
|
+
scrollbar_core_removeClasses(currentAxis.track.el, this.classNames.hover);
|
2118
|
+
}
|
2119
|
+
if (this.options.autoHide) {
|
2120
|
+
this.hideScrollbar(axis);
|
2121
|
+
}
|
2122
|
+
}
|
2123
|
+
}
|
2124
|
+
}, {
|
2125
|
+
key: "onMouseLeaveForAxis",
|
2126
|
+
value: function onMouseLeaveForAxis() {
|
2127
|
+
var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'y';
|
2128
|
+
if (this.isDragging) {
|
2129
|
+
return;
|
2130
|
+
}
|
2131
|
+
scrollbar_core_removeClasses(this.axis[axis].track.el, this.classNames.hover);
|
2132
|
+
scrollbar_core_removeClasses(this.axis[axis].scrollbar.el, this.classNames.hover);
|
2133
|
+
if (this.options.autoHide) {
|
2134
|
+
this.hideScrollbar(axis);
|
2135
|
+
}
|
2136
|
+
}
|
2137
|
+
}, {
|
2138
|
+
key: "onDragStart",
|
2139
|
+
value:
|
2140
|
+
/**
|
2141
|
+
* on scrollbar handle drag movement starts
|
2142
|
+
*/
|
2143
|
+
function onDragStart(e) {
|
2144
|
+
var _scrollbar$rect;
|
2145
|
+
var axis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'y';
|
2146
|
+
this.isDragging = true;
|
2147
|
+
var elDocument = scrollbar_core_getElementDocument(this.el);
|
2148
|
+
var elWindow = scrollbar_core_getElementWindow(this.el);
|
2149
|
+
var scrollbar = this.axis[axis].scrollbar;
|
2150
|
+
// Measure how far the user's mouse is from the top of the scrollbar drag handle.
|
2151
|
+
var eventOffset = axis === 'y' ? e.pageY : e.pageX;
|
2152
|
+
this.axis[axis].dragOffset = eventOffset - (((_scrollbar$rect = scrollbar.rect) === null || _scrollbar$rect === void 0 ? void 0 : _scrollbar$rect[this.axis[axis].offsetAttr]) || 0);
|
2153
|
+
this.draggedAxis = axis;
|
2154
|
+
scrollbar_core_addClasses(this.el, this.classNames.dragging);
|
2155
|
+
elDocument.addEventListener('mousemove', this.drag, true);
|
2156
|
+
elDocument.addEventListener('mouseup', this.onEndDrag, true);
|
2157
|
+
if (this.removePreventClickId === null) {
|
2158
|
+
elDocument.addEventListener('click', this.preventClick, true);
|
2159
|
+
elDocument.addEventListener('dblclick', this.preventClick, true);
|
2160
|
+
} else {
|
2161
|
+
elWindow.clearTimeout(this.removePreventClickId);
|
2162
|
+
this.removePreventClickId = null;
|
2163
|
+
}
|
2164
|
+
}
|
2165
|
+
}, {
|
2166
|
+
key: "onTrackClick",
|
2167
|
+
value: function onTrackClick(e) {
|
2168
|
+
var _scrollbar$rect$this$,
|
2169
|
+
_scrollbar$rect2,
|
2170
|
+
_this$wrapperScrollMa,
|
2171
|
+
_this4 = this;
|
2172
|
+
var axis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'y';
|
2173
|
+
var currentAxis = this.axis[axis];
|
2174
|
+
if (!this.options.clickOnTrack || !currentAxis.scrollbar.el || !this.wrapperEl) return;
|
2175
|
+
// Preventing the event's default to trigger click underneath
|
2176
|
+
e.preventDefault();
|
2177
|
+
var elWindow = scrollbar_core_getElementWindow(this.el);
|
2178
|
+
this.axis[axis].scrollbar.rect = currentAxis.scrollbar.el.getBoundingClientRect();
|
2179
|
+
var scrollbar = this.axis[axis].scrollbar;
|
2180
|
+
var scrollbarOffset = (_scrollbar$rect$this$ = (_scrollbar$rect2 = scrollbar.rect) === null || _scrollbar$rect2 === void 0 ? void 0 : _scrollbar$rect2[this.axis[axis].offsetAttr]) !== null && _scrollbar$rect$this$ !== void 0 ? _scrollbar$rect$this$ : 0;
|
2181
|
+
var rect = this.wrapperEl.getBoundingClientRect();
|
2182
|
+
// 获取鼠标相对于视口的位置
|
2183
|
+
var x = e.clientX;
|
2184
|
+
var y = e.clientY;
|
2185
|
+
// 计算鼠标相对于目标元素的相对位置
|
2186
|
+
var relativeX = x - rect.left;
|
2187
|
+
var relativeY = y - rect.top;
|
2188
|
+
var hostSize = axis === 'y' ? relativeY : relativeX;
|
2189
|
+
var scrolled = (_this$wrapperScrollMa = this.wrapperScrollMap[this.axis[axis].scrollOffsetAttr]) !== null && _this$wrapperScrollMa !== void 0 ? _this$wrapperScrollMa : 0;
|
2190
|
+
var t = axis === 'y' ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset;
|
2191
|
+
var dir = t < 0 ? -1 : 1;
|
2192
|
+
var scrollSize = dir === -1 ? scrolled - hostSize : hostSize - scrolled;
|
2193
|
+
var speed = scrollSize > 40 ? 40 : scrollSize;
|
2194
|
+
var scrollTo = function scrollTo() {
|
2195
|
+
if (!_this4.wrapperEl) return;
|
2196
|
+
if (scrollSize > 0) {
|
2197
|
+
scrolled = scrolled + dir * speed;
|
2198
|
+
scrollSize -= speed;
|
2199
|
+
var resolvedValue = _this4.getPointerPosition(scrolled, axis);
|
2200
|
+
_this4.scrollToAxisPosition(resolvedValue, axis);
|
2201
|
+
elWindow.requestAnimationFrame(scrollTo);
|
2202
|
+
}
|
2203
|
+
};
|
2204
|
+
scrollTo();
|
2205
|
+
}
|
2206
|
+
/**
|
2207
|
+
* Getter for content element
|
2208
|
+
*/
|
2209
|
+
}, {
|
2210
|
+
key: "getContentElement",
|
2211
|
+
value: function getContentElement() {
|
2212
|
+
return this.contentEl;
|
2213
|
+
}
|
2214
|
+
/**
|
2215
|
+
* Getter for original scrolling element
|
2216
|
+
*/
|
2217
|
+
}, {
|
2218
|
+
key: "getScrollElement",
|
2219
|
+
value: function getScrollElement() {
|
2220
|
+
return this.wrapperEl;
|
2221
|
+
}
|
2222
|
+
}, {
|
2223
|
+
key: "removeListeners",
|
2224
|
+
value: function removeListeners() {
|
2225
|
+
var _this$mouseWheelInsta2;
|
2226
|
+
var elWindow = scrollbar_core_getElementWindow(this.el);
|
2227
|
+
(_this$mouseWheelInsta2 = this.mouseWheelInstance) === null || _this$mouseWheelInsta2 === void 0 || _this$mouseWheelInsta2.removeWheelEvent(this.el);
|
2228
|
+
// Event listeners
|
2229
|
+
this.el.removeEventListener('mouseenter', this.onMouseEnter);
|
2230
|
+
this.el.removeEventListener('pointerdown', this.onPointerEvent, true);
|
2231
|
+
this.el.removeEventListener('mousemove', this.onMouseMove);
|
2232
|
+
this.el.removeEventListener('mouseleave', this.onMouseLeave);
|
2233
|
+
if (this.wrapperEl) {
|
2234
|
+
this.wrapperEl.removeEventListener('scroll', this.onScroll);
|
2235
|
+
}
|
2236
|
+
elWindow.removeEventListener('resize', this.onWindowResize);
|
2237
|
+
if (this.mutationObserver) {
|
2238
|
+
this.mutationObserver.disconnect();
|
2239
|
+
}
|
2240
|
+
if (this.resizeObserver) {
|
2241
|
+
this.resizeObserver.disconnect();
|
2242
|
+
}
|
2243
|
+
// Cancel all debounced functions
|
2244
|
+
this.onMouseMove.cancel();
|
2245
|
+
this.onWindowResize.cancel();
|
2246
|
+
this.onStopScrolling.cancel();
|
2247
|
+
this.onMouseEntered.cancel();
|
2248
|
+
}
|
2249
|
+
/**
|
2250
|
+
* Remove all listeners from DOM nodes
|
2251
|
+
*/
|
2252
|
+
}, {
|
2253
|
+
key: "unMount",
|
2254
|
+
value: function unMount() {
|
2255
|
+
this.removeListeners();
|
2256
|
+
}
|
2257
|
+
/**
|
2258
|
+
* Check if mouse is within bounds
|
2259
|
+
*/
|
2260
|
+
}, {
|
2261
|
+
key: "isWithinBounds",
|
2262
|
+
value: function isWithinBounds(bbox) {
|
2263
|
+
return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height;
|
2264
|
+
}
|
2265
|
+
/**
|
2266
|
+
* Find element children matches query
|
2267
|
+
*/
|
2268
|
+
}, {
|
2269
|
+
key: "findChild",
|
2270
|
+
value: function findChild(el, query) {
|
2271
|
+
var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
2272
|
+
return Array.prototype.filter.call(el.children, function (child) {
|
2273
|
+
return matches.call(child, query);
|
2274
|
+
})[0];
|
2275
|
+
}
|
2276
|
+
}], [{
|
2277
|
+
key: "getRtlHelpers",
|
2278
|
+
value:
|
2279
|
+
/**
|
2280
|
+
* Helper to fix browsers inconsistency on RTL:
|
2281
|
+
* - Firefox inverts the scrollbar initial position
|
2282
|
+
* - IE11 inverts both scrollbar position and scrolling offset
|
2283
|
+
*/
|
2284
|
+
function getRtlHelpers() {
|
2285
|
+
if (SimpleBarCore.rtlHelpers) {
|
2286
|
+
return SimpleBarCore.rtlHelpers;
|
2287
|
+
}
|
2288
|
+
var dummyDiv = document.createElement('div');
|
2289
|
+
dummyDiv.innerHTML = '<div class="simplebar-dummy-scrollbar-size"><div></div></div>';
|
2290
|
+
var scrollbarDummyEl = dummyDiv.firstElementChild;
|
2291
|
+
var dummyChild = scrollbarDummyEl === null || scrollbarDummyEl === void 0 ? void 0 : scrollbarDummyEl.firstElementChild;
|
2292
|
+
if (!dummyChild) return null;
|
2293
|
+
document.body.appendChild(scrollbarDummyEl);
|
2294
|
+
scrollbarDummyEl.scrollLeft = 0;
|
2295
|
+
var dummyContainerOffset = SimpleBarCore.getOffset(scrollbarDummyEl);
|
2296
|
+
var dummyChildOffset = SimpleBarCore.getOffset(dummyChild);
|
2297
|
+
scrollbarDummyEl.scrollLeft = -999;
|
2298
|
+
var dummyChildOffsetAfterScroll = SimpleBarCore.getOffset(dummyChild);
|
2299
|
+
document.body.removeChild(scrollbarDummyEl);
|
2300
|
+
SimpleBarCore.rtlHelpers = {
|
2301
|
+
// determines if the scrolling is responding with negative values
|
2302
|
+
isScrollOriginAtZero: dummyContainerOffset.left !== dummyChildOffset.left,
|
2303
|
+
// determines if the origin scrollbar position is inverted or not (positioned on left or right)
|
2304
|
+
isScrollingToNegative: dummyChildOffset.left !== dummyChildOffsetAfterScroll.left
|
2305
|
+
};
|
2306
|
+
return SimpleBarCore.rtlHelpers;
|
2307
|
+
}
|
2308
|
+
}, {
|
2309
|
+
key: "getOffset",
|
2310
|
+
value: function getOffset(el) {
|
2311
|
+
var rect = el.getBoundingClientRect();
|
2312
|
+
var elDocument = scrollbar_core_getElementDocument(el);
|
2313
|
+
var elWindow = scrollbar_core_getElementWindow(el);
|
2314
|
+
return {
|
2315
|
+
top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop),
|
2316
|
+
left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft)
|
2317
|
+
};
|
2318
|
+
}
|
2319
|
+
}]);
|
2320
|
+
}();
|
2321
|
+
_defineProperty(SimpleBarCore, "rtlHelpers", null);
|
2322
|
+
_defineProperty(SimpleBarCore, "defaultOptions", {
|
2323
|
+
forceVisible: false,
|
2324
|
+
clickOnTrack: true,
|
2325
|
+
scrollbarMinSize: 25,
|
2326
|
+
scrollbarMaxSize: 0,
|
2327
|
+
ariaLabel: 'scrollable content',
|
2328
|
+
classNames: {
|
2329
|
+
contentEl: 'simplebar-content',
|
2330
|
+
wrapper: 'simplebar-wrapper',
|
2331
|
+
scrollbar: 'simplebar-scrollbar',
|
2332
|
+
track: 'simplebar-track',
|
2333
|
+
visible: 'simplebar-visible',
|
2334
|
+
horizontal: 'simplebar-horizontal',
|
2335
|
+
vertical: 'simplebar-vertical',
|
2336
|
+
hover: 'simplebar-hover',
|
2337
|
+
dragging: 'simplebar-dragging',
|
2338
|
+
scrolling: 'simplebar-scrolling',
|
2339
|
+
scrollable: 'simplebar-scrollable',
|
2340
|
+
mouseEntered: 'simplebar-mouse-entered'
|
2341
|
+
},
|
2342
|
+
scrollableNode: null,
|
2343
|
+
contentNode: null,
|
2344
|
+
wrapperNode: null,
|
2345
|
+
/**
|
2346
|
+
* 如果是自定义虚拟滚动,content可能是position absolute,此时需要一个实际支撑的元素
|
2347
|
+
*/
|
2348
|
+
delegateXContent: null,
|
2349
|
+
delegateYContent: null,
|
2350
|
+
autoHide: true,
|
2351
|
+
useSystemScrollXBehavior: true,
|
2352
|
+
useSystemScrollYBehavior: true,
|
2353
|
+
onScrollCallback: null
|
2354
|
+
});
|
2355
|
+
/**
|
2356
|
+
* Static functions
|
2357
|
+
*/
|
2358
|
+
_defineProperty(SimpleBarCore, "helpers", helpers_namespaceObject);
|
2359
|
+
|
2360
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/bk-scrollbar.ts
|
2361
|
+
|
2362
|
+
|
2363
|
+
|
100
2364
|
|
101
2365
|
|
102
|
-
function toPropertyKey(t) {
|
103
|
-
var i = toPrimitive(t, "string");
|
104
|
-
return "symbol" == _typeof(i) ? i : String(i);
|
105
|
-
}
|
106
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
107
2366
|
|
108
|
-
function
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
2367
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
2368
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
2369
|
+
/*
|
2370
|
+
* Tencent is pleased to support the open source community by making
|
2371
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
2372
|
+
*
|
2373
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
2374
|
+
*
|
2375
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2376
|
+
*
|
2377
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
2378
|
+
*
|
2379
|
+
* ---------------------------------------------------
|
2380
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
2381
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
2382
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
2383
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2384
|
+
*
|
2385
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
2386
|
+
* the Software.
|
2387
|
+
*
|
2388
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
2389
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
2390
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
2391
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2392
|
+
* IN THE SOFTWARE.
|
2393
|
+
*/
|
2394
|
+
|
2395
|
+
var _SimpleBarCore$helper = SimpleBarCore.helpers,
|
2396
|
+
bk_scrollbar_addClasses = _SimpleBarCore$helper.addClasses,
|
2397
|
+
bk_scrollbar_classNamesToQuery = _SimpleBarCore$helper.classNamesToQuery;
|
2398
|
+
var BkSimpleBar = /*#__PURE__*/function (_SimpleBarCore) {
|
2399
|
+
function BkSimpleBar() {
|
2400
|
+
var _this;
|
2401
|
+
_classCallCheck(this, BkSimpleBar);
|
2402
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
2403
|
+
args[_key] = arguments[_key];
|
2404
|
+
}
|
2405
|
+
_this = _callSuper(this, BkSimpleBar, [].concat(args));
|
2406
|
+
// // Save a reference to the instance, so we know this DOM node has already been instancied
|
2407
|
+
BkSimpleBar.instances.set(args[0], _this);
|
2408
|
+
return _this;
|
119
2409
|
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
var
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
2410
|
+
_inherits(BkSimpleBar, _SimpleBarCore);
|
2411
|
+
return _createClass(BkSimpleBar, [{
|
2412
|
+
key: "initDOM",
|
2413
|
+
value: function initDOM() {
|
2414
|
+
var _this$options$wrapper, _this$options$content;
|
2415
|
+
this.wrapperEl = (_this$options$wrapper = this.options.wrapperNode) !== null && _this$options$wrapper !== void 0 ? _this$options$wrapper : this.createScrollElement(this.classNames.wrapper);
|
2416
|
+
this.contentEl = (_this$options$content = this.options.contentNode) !== null && _this$options$content !== void 0 ? _this$options$content : this.createScrollElement(this.classNames.contentEl);
|
2417
|
+
this.delegateXContent = this.options.delegateXContent;
|
2418
|
+
this.delegateYContent = this.options.delegateYContent;
|
2419
|
+
if (!this.axis.x.track.el || !this.axis.y.track.el) {
|
2420
|
+
var track = document.createElement('div');
|
2421
|
+
var scrollbar = document.createElement('div');
|
2422
|
+
bk_scrollbar_addClasses(track, this.classNames.track);
|
2423
|
+
bk_scrollbar_addClasses(scrollbar, this.classNames.scrollbar);
|
2424
|
+
track.appendChild(scrollbar);
|
2425
|
+
this.axis.x.track.el = track.cloneNode(true);
|
2426
|
+
bk_scrollbar_addClasses(this.axis.x.track.el, this.classNames.horizontal);
|
2427
|
+
this.axis.y.track.el = track.cloneNode(true);
|
2428
|
+
bk_scrollbar_addClasses(this.axis.y.track.el, this.classNames.vertical);
|
2429
|
+
this.el.appendChild(this.axis.x.track.el);
|
2430
|
+
this.el.appendChild(this.axis.y.track.el);
|
2431
|
+
}
|
2432
|
+
SimpleBarCore.prototype.initDOM.call(this);
|
2433
|
+
}
|
2434
|
+
}, {
|
2435
|
+
key: "unMount",
|
2436
|
+
value: function unMount() {
|
2437
|
+
SimpleBarCore.prototype.unMount.call(this);
|
2438
|
+
BkSimpleBar.instances["delete"](this.el);
|
2439
|
+
}
|
2440
|
+
}, {
|
2441
|
+
key: "createScrollElement",
|
2442
|
+
value: function createScrollElement(className) {
|
2443
|
+
var createEl = function createEl() {
|
2444
|
+
var el = document.createElement('div');
|
2445
|
+
bk_scrollbar_addClasses(el, className);
|
2446
|
+
return el;
|
2447
|
+
};
|
2448
|
+
var origin = this.el.querySelector(bk_scrollbar_classNamesToQuery(className));
|
2449
|
+
return origin !== null && origin !== void 0 ? origin : createEl();
|
2450
|
+
}
|
2451
|
+
}], [{
|
2452
|
+
key: "removeObserver",
|
2453
|
+
value: function removeObserver() {
|
2454
|
+
var _BkSimpleBar$globalOb;
|
2455
|
+
(_BkSimpleBar$globalOb = BkSimpleBar.globalObserver) === null || _BkSimpleBar$globalOb === void 0 || _BkSimpleBar$globalOb.disconnect();
|
2456
|
+
}
|
2457
|
+
}]);
|
2458
|
+
}(SimpleBarCore);
|
2459
|
+
_defineProperty(BkSimpleBar, "instances", new WeakMap());
|
131
2460
|
|
132
|
-
|
133
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
2461
|
+
;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-scrollbar.tsx
|
134
2462
|
/*
|
135
2463
|
* Tencent is pleased to support the open source community by making
|
136
2464
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -157,174 +2485,60 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
157
2485
|
* IN THE SOFTWARE.
|
158
2486
|
*/
|
159
2487
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
var
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
*/
|
179
|
-
scrollEvent: shared_namespaceObject.PropTypes.bool.def(false),
|
180
|
-
/**
|
181
|
-
* 每行数据高度
|
182
|
-
* 默认为数值类型,默认高度 30px
|
183
|
-
* 如果每行高度不一致,可为回调函数:(index: number, row: any[]): number => {}
|
184
|
-
* 函数参数为当前行index & 当前行数据 row,row为数组,当不分组时,为当前行item
|
185
|
-
* 如果有分组展示, index 为当前分组 index, row为数组,当前行分组所有 item 数据
|
186
|
-
*/
|
187
|
-
lineHeight: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.number, shared_namespaceObject.PropTypes.func]).def(30),
|
188
|
-
/** 整体最小高度 */
|
189
|
-
minHeight: shared_namespaceObject.PropTypes.number.def(30),
|
190
|
-
/** 整体最大高度 */
|
191
|
-
maxHeight: shared_namespaceObject.PropTypes.number,
|
192
|
-
/**
|
193
|
-
* 整体高度
|
194
|
-
* 可设置具体值,如果设置为 100%,则组件会自动计算外层DOM元素offsetHeight,用于计算可渲染行数
|
195
|
-
*/
|
196
|
-
height: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.string.def('100%'), shared_namespaceObject.PropTypes.number]).def('100%'),
|
197
|
-
/**
|
198
|
-
* 渲染区域宽度
|
199
|
-
* 如果设置 100% 则自适应外层元素宽度
|
200
|
-
*/
|
201
|
-
width: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.string.def('100%'), shared_namespaceObject.PropTypes.number]).def('100%'),
|
202
|
-
/** 最外层元素ClassName */
|
203
|
-
className: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.string), shared_namespaceObject.PropTypes.object, shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.object), shared_namespaceObject.PropTypes.string]).def(''),
|
204
|
-
/** 内层层元素ClassName */
|
205
|
-
contentClassName: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.string), shared_namespaceObject.PropTypes.object, shared_namespaceObject.PropTypes.arrayOf(shared_namespaceObject.PropTypes.object), shared_namespaceObject.PropTypes.string]).def(''),
|
206
|
-
/** 内层元素样式 */
|
207
|
-
contentStyle: shared_namespaceObject.PropTypes.object.def({}),
|
208
|
-
/** 用于自定义X轴滚动条样式 */
|
209
|
-
scrollXName: shared_namespaceObject.PropTypes.string.def((0,shared_namespaceObject.resolveClassName)('F-scroll-x')),
|
210
|
-
/** 用于自定义Y轴滚动条样式 */
|
211
|
-
scrollYName: shared_namespaceObject.PropTypes.string.def((0,shared_namespaceObject.resolveClassName)('F-scroll-y')),
|
212
|
-
/** 分组展示,一行数据可能有多条数据 */
|
213
|
-
groupItemCount: shared_namespaceObject.PropTypes.number.def(1),
|
214
|
-
/** 预加载行数,避免空白渲染 */
|
215
|
-
preloadItemCount: shared_namespaceObject.PropTypes.number.def(1),
|
216
|
-
/** 外层Dom元素需要渲染成的目标元素 */
|
217
|
-
renderAs: shared_namespaceObject.PropTypes.string.def('div'),
|
218
|
-
/** 内容层渲染成目标元素 */
|
219
|
-
contentAs: shared_namespaceObject.PropTypes.string.def('div'),
|
220
|
-
/** top 滚动填充 */
|
221
|
-
scrollOffsetTop: shared_namespaceObject.PropTypes.number.def(0),
|
222
|
-
/**
|
223
|
-
* 内置滚动位置
|
224
|
-
* 可选:container (最外层容器),content(内容层容器)
|
225
|
-
* Note: container 慎选,需要自己处理样式 & 位置
|
226
|
-
*/
|
227
|
-
scrollPosition: shared_namespaceObject.PropTypes.string.def('content'),
|
228
|
-
/**
|
229
|
-
* 绝对高度 | 实际高估
|
230
|
-
* 可选值: auto(根据行高和行数计算, LineHeight * List.length) number(外层给定高度,若为0,则不显示)
|
231
|
-
*/
|
232
|
-
abosuteHeight: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.string.def('auto'), shared_namespaceObject.PropTypes.number]).def('auto'),
|
233
|
-
/**
|
234
|
-
* 滚动刷新计算间隔时间
|
235
|
-
* 默认60 ms
|
236
|
-
*/
|
237
|
-
throttleDelay: shared_namespaceObject.PropTypes.number.def(60),
|
238
|
-
rowKey: shared_namespaceObject.PropTypes.string.def(undefined),
|
239
|
-
/**
|
240
|
-
* 数据改变时是否保持之前的状态
|
241
|
-
* 保持滚动条位置、当前渲染区间
|
242
|
-
*/
|
243
|
-
keepAlive: shared_namespaceObject.PropTypes.bool.def(false),
|
244
|
-
/**
|
245
|
-
* 数据监听改变时,是否自动重置位置到[0, 0]
|
246
|
-
*/
|
247
|
-
autoReset: shared_namespaceObject.PropTypes.bool.def(true),
|
248
|
-
wrapperStyle: shared_namespaceObject.PropTypes.any.def({})
|
249
|
-
}, EventProps);
|
250
|
-
;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-fix-top.tsx
|
251
|
-
/* harmony default export */ const use_fix_top = (function (props, refRoot) {
|
252
|
-
var scrollTo = function scrollTo() {
|
253
|
-
var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
254
|
-
left: 0,
|
255
|
-
top: 0
|
256
|
-
};
|
257
|
-
var left = option.left,
|
258
|
-
top = option.top;
|
259
|
-
refRoot.value.scrollTo(left, top);
|
2488
|
+
|
2489
|
+
/* harmony default export */ const use_scrollbar = (function (target, props) {
|
2490
|
+
var instance = null;
|
2491
|
+
var _usePrefix = (0,bkui_vue.usePrefix)(),
|
2492
|
+
resolveClassName = _usePrefix.resolveClassName;
|
2493
|
+
var classNames = {
|
2494
|
+
contentEl: resolveClassName('scrollbar-content-el'),
|
2495
|
+
wrapper: resolveClassName('scrollbar-wrapper'),
|
2496
|
+
scrollbar: resolveClassName('scrollbar'),
|
2497
|
+
track: resolveClassName('scrollbar-track'),
|
2498
|
+
visible: resolveClassName('scrollbar-visible'),
|
2499
|
+
horizontal: resolveClassName('scrollbar-horizontal'),
|
2500
|
+
vertical: resolveClassName('scrollbar-vertical'),
|
2501
|
+
hover: resolveClassName('scrollbar-hover'),
|
2502
|
+
dragging: resolveClassName('scrollbar-dragging'),
|
2503
|
+
scrolling: resolveClassName('scrollbar-scrolling'),
|
2504
|
+
scrollable: resolveClassName('scrollbar-scrollable'),
|
2505
|
+
mouseEntered: resolveClassName('scrollbar-mouse-entered')
|
260
2506
|
};
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
targetIndex = (_props$list$findIndex2 = props.list.findIndex(function (row) {
|
279
|
-
return item[props.rowKey] === row[props.rowKey];
|
280
|
-
})) !== null && _props$list$findIndex2 !== void 0 ? _props$list$findIndex2 : targetIndex;
|
281
|
-
}
|
282
|
-
if (typeof targetIndex === 'number') {
|
283
|
-
var resolvedIndex = targetIndex >= 0 ? targetIndex : 0;
|
284
|
-
var offsetY = resolvedIndex * props.lineHeight;
|
285
|
-
scrollTo({
|
286
|
-
left: 0,
|
287
|
-
top: offsetY
|
288
|
-
});
|
2507
|
+
var init = function init(scrollFn, delegateXContent, delegateYContent) {
|
2508
|
+
instance = new BkSimpleBar(target.value, {
|
2509
|
+
classNames: classNames,
|
2510
|
+
wrapperNode: target.value,
|
2511
|
+
useSystemScrollYBehavior: !props.enabled,
|
2512
|
+
useSystemScrollXBehavior: true,
|
2513
|
+
delegateXContent: delegateXContent,
|
2514
|
+
delegateYContent: delegateYContent,
|
2515
|
+
onScrollCallback: scrollFn
|
2516
|
+
});
|
2517
|
+
// instance.getScrollElement().addEventListener('scroll', scrollFn);
|
2518
|
+
};
|
2519
|
+
var scrollTo = function scrollTo(x, y) {
|
2520
|
+
var _props$scrollbar;
|
2521
|
+
if ((_props$scrollbar = props.scrollbar) !== null && _props$scrollbar !== void 0 && _props$scrollbar.enabled) {
|
2522
|
+
// instance.s.scrollTo(x, y, 100, { keepStruct: props.scrollbar?.keepStruct ?? false });
|
2523
|
+
return;
|
289
2524
|
}
|
2525
|
+
target.value.scrollTo(x, y);
|
290
2526
|
};
|
291
2527
|
return {
|
292
|
-
|
293
|
-
|
2528
|
+
init: init,
|
2529
|
+
instance: instance,
|
2530
|
+
scrollTo: scrollTo,
|
2531
|
+
classNames: classNames
|
294
2532
|
};
|
295
2533
|
});
|
296
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
297
|
-
function _classCallCheck(instance, Constructor) {
|
298
|
-
if (!(instance instanceof Constructor)) {
|
299
|
-
throw new TypeError("Cannot call a class as a function");
|
300
|
-
}
|
301
|
-
}
|
302
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
|
303
|
-
|
304
|
-
function _defineProperties(target, props) {
|
305
|
-
for (var i = 0; i < props.length; i++) {
|
306
|
-
var descriptor = props[i];
|
307
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
308
|
-
descriptor.configurable = true;
|
309
|
-
if ("value" in descriptor) descriptor.writable = true;
|
310
|
-
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
311
|
-
}
|
312
|
-
}
|
313
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
314
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
315
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
316
|
-
Object.defineProperty(Constructor, "prototype", {
|
317
|
-
writable: false
|
318
|
-
});
|
319
|
-
return Constructor;
|
320
|
-
}
|
321
2534
|
;// CONCATENATED MODULE: external "lodash/throttle"
|
322
2535
|
var throttle_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
323
2536
|
var throttle_y = x => () => x
|
324
|
-
const
|
2537
|
+
const external_lodash_throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__["default"] });
|
325
2538
|
;// CONCATENATED MODULE: ../../packages/virtual-render/src/v-virtual-render.ts
|
326
2539
|
|
327
2540
|
|
2541
|
+
|
328
2542
|
/*
|
329
2543
|
* Tencent is pleased to support the open source community by making
|
330
2544
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -375,14 +2589,14 @@ function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
|
|
375
2589
|
diffHeight: diffHeight
|
376
2590
|
};
|
377
2591
|
}
|
378
|
-
function computedVirtualIndex(lineHeight, callback, pagination,
|
379
|
-
if (!event.
|
2592
|
+
function computedVirtualIndex(lineHeight, callback, pagination, wrapper, event) {
|
2593
|
+
if (!wrapper || !event.offset) {
|
380
2594
|
return;
|
381
2595
|
}
|
382
|
-
var elScrollTop = event.
|
383
|
-
var elScrollLeft = event.
|
384
|
-
var elScrollHeight =
|
385
|
-
var elOffsetHeight =
|
2596
|
+
var elScrollTop = event.offset.y;
|
2597
|
+
var elScrollLeft = event.offset.x;
|
2598
|
+
var elScrollHeight = wrapper.scrollHeight;
|
2599
|
+
var elOffsetHeight = wrapper.offsetHeight;
|
386
2600
|
var count = pagination.count,
|
387
2601
|
groupItemCount = pagination.groupItemCount;
|
388
2602
|
var targetStartIndex = 0;
|
@@ -402,7 +2616,8 @@ function computedVirtualIndex(lineHeight, callback, pagination, _el, event) {
|
|
402
2616
|
}
|
403
2617
|
var bottom = elScrollHeight - elOffsetHeight - elScrollTop;
|
404
2618
|
typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop, translateY, elScrollLeft, {
|
405
|
-
bottom: bottom >= 0 ? bottom : 0
|
2619
|
+
bottom: bottom >= 0 ? bottom : 0,
|
2620
|
+
scrollbar: event
|
406
2621
|
});
|
407
2622
|
return {
|
408
2623
|
targetStartIndex: targetStartIndex,
|
@@ -414,13 +2629,39 @@ function computedVirtualIndex(lineHeight, callback, pagination, _el, event) {
|
|
414
2629
|
}
|
415
2630
|
var VisibleRender = /*#__PURE__*/function () {
|
416
2631
|
function VisibleRender(binding, el) {
|
2632
|
+
var _this = this;
|
417
2633
|
_classCallCheck(this, VisibleRender);
|
2634
|
+
_defineProperty(this, "getEvent", function (event) {
|
2635
|
+
var _this$binding$value$s = _this.binding.value.scrollbar,
|
2636
|
+
scrollbar = _this$binding$value$s === void 0 ? {
|
2637
|
+
enabled: false
|
2638
|
+
} : _this$binding$value$s;
|
2639
|
+
if (scrollbar.enabled) {
|
2640
|
+
var _event$offset;
|
2641
|
+
return {
|
2642
|
+
offset: (_event$offset = event.offset) !== null && _event$offset !== void 0 ? _event$offset : event
|
2643
|
+
};
|
2644
|
+
}
|
2645
|
+
if (event !== null && event !== void 0 && event.offset) {
|
2646
|
+
return {
|
2647
|
+
offset: event === null || event === void 0 ? void 0 : event.offset
|
2648
|
+
};
|
2649
|
+
}
|
2650
|
+
var elScrollTop = event.target.scrollTop;
|
2651
|
+
var elScrollLeft = event.target.scrollLeft;
|
2652
|
+
return {
|
2653
|
+
offset: {
|
2654
|
+
x: elScrollLeft,
|
2655
|
+
y: elScrollTop
|
2656
|
+
}
|
2657
|
+
};
|
2658
|
+
});
|
418
2659
|
this.binding = binding;
|
419
2660
|
this.wrapper = el;
|
420
2661
|
var throttleDelay = binding.value.throttleDelay;
|
421
2662
|
this.delay = throttleDelay;
|
422
2663
|
}
|
423
|
-
_createClass(VisibleRender, [{
|
2664
|
+
return _createClass(VisibleRender, [{
|
424
2665
|
key: "render",
|
425
2666
|
value: function render(e) {
|
426
2667
|
var _this$binding$value = this.binding.value,
|
@@ -431,11 +2672,13 @@ var VisibleRender = /*#__PURE__*/function () {
|
|
431
2672
|
pagination = _this$binding$value$p === void 0 ? {} : _this$binding$value$p,
|
432
2673
|
onlyScroll = _this$binding$value.onlyScroll;
|
433
2674
|
if (onlyScroll) {
|
434
|
-
var
|
435
|
-
var
|
436
|
-
var
|
2675
|
+
var _e$offset, _e$offset$x, _e$offset2;
|
2676
|
+
var elScrollTop = (_e$offset = e.offset) === null || _e$offset === void 0 ? void 0 : _e$offset.y;
|
2677
|
+
var elScrollLeft = (_e$offset$x = (_e$offset2 = e.offset) === null || _e$offset2 === void 0 ? void 0 : _e$offset2.x) !== null && _e$offset$x !== void 0 ? _e$offset$x : 0;
|
2678
|
+
var bottom = this.wrapper.scrollHeight - this.wrapper.offsetHeight - elScrollTop;
|
437
2679
|
handleScrollCallback(e, null, null, elScrollTop, elScrollTop, elScrollLeft, {
|
438
|
-
bottom: bottom >= 0 ? bottom : 0
|
2680
|
+
bottom: bottom >= 0 ? bottom : 0,
|
2681
|
+
scrollbar: e
|
439
2682
|
});
|
440
2683
|
return;
|
441
2684
|
}
|
@@ -457,7 +2700,7 @@ var VisibleRender = /*#__PURE__*/function () {
|
|
457
2700
|
}, {
|
458
2701
|
key: "executeThrottledRender",
|
459
2702
|
value: function executeThrottledRender(e) {
|
460
|
-
(0,
|
2703
|
+
(0,external_lodash_throttle_namespaceObject["default"])(this.render.bind(this), this.delay)(this.getEvent(e));
|
461
2704
|
}
|
462
2705
|
}, {
|
463
2706
|
key: "install",
|
@@ -477,7 +2720,6 @@ var VisibleRender = /*#__PURE__*/function () {
|
|
477
2720
|
this.binding = binding;
|
478
2721
|
}
|
479
2722
|
}]);
|
480
|
-
return VisibleRender;
|
481
2723
|
}();
|
482
2724
|
var instance = null;
|
483
2725
|
/* harmony default export */ const v_virtual_render = ({
|
@@ -532,28 +2774,46 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
532
2774
|
|
533
2775
|
|
534
2776
|
|
2777
|
+
|
535
2778
|
/* harmony default export */ const use_tag_render = (function (props, ctx) {
|
536
2779
|
var renderAs = props.renderAs,
|
537
2780
|
contentAs = props.contentAs;
|
2781
|
+
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
2782
|
+
var _useScrollbar = use_scrollbar(refRoot, props),
|
2783
|
+
init = _useScrollbar.init,
|
2784
|
+
scrollTo = _useScrollbar.scrollTo,
|
2785
|
+
classNames = _useScrollbar.classNames;
|
2786
|
+
var contentStyle = (0,external_vue_namespaceObject.reactive)({
|
2787
|
+
x: 0,
|
2788
|
+
y: 0
|
2789
|
+
});
|
2790
|
+
var computedStyle = (0,external_vue_namespaceObject.computed)(function () {
|
2791
|
+
return use_tag_render_objectSpread({}, props.contentStyle);
|
2792
|
+
});
|
538
2793
|
/** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
|
539
2794
|
var handleScrollCallback = function handleScrollCallback(event, _startIndex, _endIndex, _scrollTop, translateY, scrollLeft, pos) {
|
2795
|
+
var scrollbar = pos.scrollbar;
|
2796
|
+
if (scrollbar !== null && scrollbar !== void 0 && scrollbar.offset) {
|
2797
|
+
var _scrollbar$offset;
|
2798
|
+
Object.assign(contentStyle, (_scrollbar$offset = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.offset) !== null && _scrollbar$offset !== void 0 ? _scrollbar$offset : {});
|
2799
|
+
}
|
540
2800
|
ctx.emit('content-scroll', [event, {
|
541
2801
|
translateY: translateY,
|
542
2802
|
translateX: scrollLeft,
|
543
2803
|
pos: pos
|
544
2804
|
}]);
|
545
2805
|
};
|
546
|
-
var
|
2806
|
+
var renderInstance = null;
|
547
2807
|
var binding = (0,external_vue_namespaceObject.computed)(function () {
|
548
2808
|
return {
|
549
2809
|
lineHeight: props.lineHeight,
|
2810
|
+
scrollbar: props.scrollbar,
|
550
2811
|
handleScrollCallback: handleScrollCallback,
|
551
2812
|
pagination: {},
|
552
2813
|
throttleDelay: props.throttleDelay,
|
553
2814
|
onlyScroll: props.scrollEvent
|
554
2815
|
};
|
555
2816
|
});
|
556
|
-
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
557
2817
|
/** 虚拟渲染外层容器样式 */
|
558
2818
|
var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
|
559
2819
|
var _props$maxHeight;
|
@@ -565,20 +2825,36 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
565
2825
|
maxHeight: (_props$maxHeight = props.maxHeight) !== null && _props$maxHeight !== void 0 ? _props$maxHeight : height
|
566
2826
|
}, props.wrapperStyle);
|
567
2827
|
});
|
568
|
-
var _useFixTop = use_fix_top(props,
|
569
|
-
scrollTo = _useFixTop.scrollTo,
|
2828
|
+
var _useFixTop = use_fix_top(props, scrollTo),
|
570
2829
|
fixToTop = _useFixTop.fixToTop;
|
571
2830
|
ctx.expose({
|
572
2831
|
scrollTo: scrollTo,
|
573
2832
|
fixToTop: fixToTop
|
574
2833
|
});
|
575
2834
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
576
|
-
|
577
|
-
|
2835
|
+
var _props$scrollbar;
|
2836
|
+
renderInstance = new VisibleRender(binding, refRoot.value);
|
2837
|
+
if ((_props$scrollbar = props.scrollbar) !== null && _props$scrollbar !== void 0 && _props$scrollbar.enabled) {
|
2838
|
+
init(renderInstance.executeThrottledRender.bind(renderInstance));
|
2839
|
+
return;
|
2840
|
+
}
|
2841
|
+
renderInstance.install();
|
578
2842
|
});
|
579
2843
|
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
580
|
-
var
|
581
|
-
(
|
2844
|
+
var _renderInstance;
|
2845
|
+
(_renderInstance = renderInstance) === null || _renderInstance === void 0 || _renderInstance.uninstall();
|
2846
|
+
});
|
2847
|
+
var wrapperClassNames = (0,external_vue_namespaceObject.computed)(function () {
|
2848
|
+
if (props.scrollbar.enabled) {
|
2849
|
+
return [props.className, classNames.wrapper];
|
2850
|
+
}
|
2851
|
+
return [props.className];
|
2852
|
+
});
|
2853
|
+
var contentClassNames = (0,external_vue_namespaceObject.computed)(function () {
|
2854
|
+
if (props.scrollbar.enabled) {
|
2855
|
+
return [props.contentClassName, classNames.contentEl];
|
2856
|
+
}
|
2857
|
+
return [props.contentClassName];
|
582
2858
|
});
|
583
2859
|
return {
|
584
2860
|
rendAsTag: function rendAsTag() {
|
@@ -586,12 +2862,12 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
586
2862
|
return (0,external_vue_namespaceObject.h)(
|
587
2863
|
// @ts-ignore:next-line
|
588
2864
|
renderAs, {
|
589
|
-
"class":
|
2865
|
+
"class": wrapperClassNames.value,
|
590
2866
|
style: wrapperStyle.value,
|
591
2867
|
ref: refRoot
|
592
2868
|
}, [(_ctx$slots$beforeCont = (_ctx$slots$beforeCont2 = (_ctx$slots = ctx.slots).beforeContent) === null || _ctx$slots$beforeCont2 === void 0 ? void 0 : _ctx$slots$beforeCont2.call(_ctx$slots)) !== null && _ctx$slots$beforeCont !== void 0 ? _ctx$slots$beforeCont : '', (0,external_vue_namespaceObject.h)(contentAs, {
|
593
|
-
"class":
|
594
|
-
style:
|
2869
|
+
"class": contentClassNames.value,
|
2870
|
+
style: computedStyle.value
|
595
2871
|
}, [(_ctx$slots$default = (_ctx$slots$default2 = (_ctx$slots2 = ctx.slots)["default"]) === null || _ctx$slots$default2 === void 0 ? void 0 : _ctx$slots$default2.call(_ctx$slots2, {
|
596
2872
|
data: props.list
|
597
2873
|
})) !== null && _ctx$slots$default !== void 0 ? _ctx$slots$default : '']), (_ctx$slots$afterConte = (_ctx$slots$afterConte2 = (_ctx$slots3 = ctx.slots).afterContent) === null || _ctx$slots$afterConte2 === void 0 ? void 0 : _ctx$slots$afterConte2.call(_ctx$slots3)) !== null && _ctx$slots$afterConte !== void 0 ? _ctx$slots$afterConte : '', (_ctx$slots$afterSecti = (_ctx$slots$afterSecti2 = (_ctx$slots4 = ctx.slots).afterSection) === null || _ctx$slots$afterSecti2 === void 0 ? void 0 : _ctx$slots$afterSecti2.call(_ctx$slots4)) !== null && _ctx$slots$afterSecti !== void 0 ? _ctx$slots$afterSecti : '']);
|
@@ -640,6 +2916,7 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
640
2916
|
|
641
2917
|
|
642
2918
|
|
2919
|
+
|
643
2920
|
/* harmony default export */ const virtual_render = ((0,external_vue_namespaceObject.defineComponent)({
|
644
2921
|
name: 'VirtualRender',
|
645
2922
|
directives: {
|
@@ -671,10 +2948,16 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
671
2948
|
lineHeight: props.lineHeight,
|
672
2949
|
handleScrollCallback: handleScrollCallback,
|
673
2950
|
pagination: pagination,
|
674
|
-
throttleDelay: props.throttleDelay
|
2951
|
+
throttleDelay: props.throttleDelay,
|
2952
|
+
scrollbar: props.scrollbar
|
675
2953
|
};
|
676
2954
|
});
|
677
2955
|
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
2956
|
+
var _useScrollbar = use_scrollbar(refRoot, props),
|
2957
|
+
init = _useScrollbar.init,
|
2958
|
+
scrollTo = _useScrollbar.scrollTo,
|
2959
|
+
classNames = _useScrollbar.classNames;
|
2960
|
+
var refVirtualSection = (0,external_vue_namespaceObject.ref)(null);
|
678
2961
|
var instance = null;
|
679
2962
|
var pagination = (0,external_vue_namespaceObject.reactive)({
|
680
2963
|
startIndex: 0,
|
@@ -717,7 +3000,18 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
717
3000
|
}
|
718
3001
|
};
|
719
3002
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
3003
|
+
var _props$scrollbar;
|
720
3004
|
instance = new VisibleRender(binding, refRoot.value);
|
3005
|
+
if ((_props$scrollbar = props.scrollbar) !== null && _props$scrollbar !== void 0 && _props$scrollbar.enabled) {
|
3006
|
+
init(instance.executeThrottledRender.bind(instance), null, refVirtualSection.value);
|
3007
|
+
instance.executeThrottledRender.call(instance, {
|
3008
|
+
offset: {
|
3009
|
+
x: 0,
|
3010
|
+
y: 0
|
3011
|
+
}
|
3012
|
+
});
|
3013
|
+
return;
|
3014
|
+
}
|
721
3015
|
instance.install();
|
722
3016
|
});
|
723
3017
|
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
@@ -781,10 +3075,7 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
781
3075
|
});
|
782
3076
|
/** 展示列表内容区域样式 */
|
783
3077
|
var innerContentStyle = (0,external_vue_namespaceObject.computed)(function () {
|
784
|
-
return props.scrollPosition === 'content' ? {
|
785
|
-
top: "".concat(pagination.scrollTop + props.scrollOffsetTop, "px"),
|
786
|
-
transform: "translateY(-".concat(pagination.translateY, "px)")
|
787
|
-
} : {};
|
3078
|
+
return props.scrollPosition === 'content' ? {} : {};
|
788
3079
|
});
|
789
3080
|
/** 虚拟渲染外层容器样式 */
|
790
3081
|
var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -809,7 +3100,7 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
809
3100
|
resolveClassName = _usePrefix.resolveClassName;
|
810
3101
|
/** 外层样式列表 */
|
811
3102
|
var wrapperClass = (0,external_vue_namespaceObject.computed)(function () {
|
812
|
-
return [resolveClassName('virtual-render')
|
3103
|
+
return [resolveClassName('virtual-render')].concat(_toConsumableArray(resolvePropClassName(props.className)), [props.scrollPosition === 'container' ? resolveClassName('virtual-content') : '']);
|
813
3104
|
});
|
814
3105
|
/** 内容区域样式列表 */
|
815
3106
|
var innerClass = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -820,20 +3111,33 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
820
3111
|
* @param keepLastPostion
|
821
3112
|
*/
|
822
3113
|
var reset = function reset() {
|
3114
|
+
var _instance2;
|
823
3115
|
handleChangeListConfig();
|
824
3116
|
afterListDataReset();
|
3117
|
+
(_instance2 = instance) === null || _instance2 === void 0 || _instance2.executeThrottledRender.call(instance, {
|
3118
|
+
offset: {
|
3119
|
+
x: 0,
|
3120
|
+
y: 0
|
3121
|
+
}
|
3122
|
+
});
|
825
3123
|
};
|
826
|
-
var _useFixTop = use_fix_top(props,
|
827
|
-
scrollTo = _useFixTop.scrollTo,
|
3124
|
+
var _useFixTop = use_fix_top(props, scrollTo),
|
828
3125
|
fixToTop = _useFixTop.fixToTop;
|
829
3126
|
(0,external_vue_namespaceObject.watch)(function () {
|
830
3127
|
return [props.lineHeight, props.height, props.list, props.maxHeight];
|
831
3128
|
}, function () {
|
832
|
-
var
|
833
|
-
(
|
3129
|
+
var _instance3;
|
3130
|
+
(_instance3 = instance) === null || _instance3 === void 0 || _instance3.setBinding(binding);
|
834
3131
|
handleChangeListConfig();
|
835
3132
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
3133
|
+
var _instance4;
|
836
3134
|
afterListDataReset();
|
3135
|
+
(_instance4 = instance) === null || _instance4 === void 0 || _instance4.executeThrottledRender.call(instance, {
|
3136
|
+
offset: {
|
3137
|
+
x: 0,
|
3138
|
+
y: 0
|
3139
|
+
}
|
3140
|
+
});
|
837
3141
|
});
|
838
3142
|
}, {
|
839
3143
|
deep: true,
|
@@ -850,14 +3154,15 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
850
3154
|
// @ts-ignore:next-line
|
851
3155
|
renderAs || 'div', {
|
852
3156
|
ref: refRoot,
|
853
|
-
"class": wrapperClass.value,
|
3157
|
+
"class": [].concat(_toConsumableArray(wrapperClass.value), [classNames.wrapper]),
|
854
3158
|
style: wrapperStyle.value
|
855
3159
|
}, [(_ctx$slots$beforeCont = (_ctx$slots$beforeCont2 = (_ctx$slots = ctx.slots).beforeContent) === null || _ctx$slots$beforeCont2 === void 0 ? void 0 : _ctx$slots$beforeCont2.call(_ctx$slots)) !== null && _ctx$slots$beforeCont !== void 0 ? _ctx$slots$beforeCont : '', (0,external_vue_namespaceObject.h)(contentAs || 'div', {
|
856
|
-
"class": innerClass.value,
|
3160
|
+
"class": [].concat(_toConsumableArray(innerClass.value), [classNames.contentEl]),
|
857
3161
|
style: virtual_render_objectSpread(virtual_render_objectSpread({}, innerContentStyle.value), props.contentStyle)
|
858
3162
|
}, [(_ctx$slots$default = (_ctx$slots$default2 = (_ctx$slots2 = ctx.slots)["default"]) === null || _ctx$slots$default2 === void 0 ? void 0 : _ctx$slots$default2.call(_ctx$slots2, {
|
859
3163
|
data: calcList.value
|
860
3164
|
})) !== null && _ctx$slots$default !== void 0 ? _ctx$slots$default : '']), (_ctx$slots$afterConte = (_ctx$slots$afterConte2 = (_ctx$slots3 = ctx.slots).afterContent) === null || _ctx$slots$afterConte2 === void 0 ? void 0 : _ctx$slots$afterConte2.call(_ctx$slots3)) !== null && _ctx$slots$afterConte !== void 0 ? _ctx$slots$afterConte : '', (0,external_vue_namespaceObject.h)('div', {
|
3165
|
+
ref: refVirtualSection,
|
861
3166
|
"class": [resolveClassName('virtual-section')],
|
862
3167
|
style: innerStyle.value
|
863
3168
|
}), (_ctx$slots$afterSecti = (_ctx$slots$afterSecti2 = (_ctx$slots4 = ctx.slots).afterSection) === null || _ctx$slots$afterSecti2 === void 0 ? void 0 : _ctx$slots$afterSecti2.call(_ctx$slots4)) !== null && _ctx$slots$afterSecti !== void 0 ? _ctx$slots$afterSecti : '']);
|
@@ -899,5 +3204,7 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
899
3204
|
|
900
3205
|
var BkVirtualRender = (0,shared_namespaceObject.withInstall)(virtual_render);
|
901
3206
|
/* harmony default export */ const src = (BkVirtualRender);
|
3207
|
+
})();
|
3208
|
+
|
902
3209
|
var __webpack_exports__default = __webpack_exports__["default"];
|
903
3210
|
export { __webpack_exports__default as default };
|