bkui-vue 0.0.1-beta.392 → 0.0.1-beta.394

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.
Files changed (155) hide show
  1. package/dist/index.cjs.js +40 -40
  2. package/dist/index.esm.js +1129 -1100
  3. package/dist/index.umd.js +39 -39
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -353
  7. package/lib/alert/index.js +1 -251
  8. package/lib/animate-number/index.js +1 -226
  9. package/lib/backtop/index.js +1 -260
  10. package/lib/badge/index.js +1 -274
  11. package/lib/breadcrumb/index.js +1 -329
  12. package/lib/button/index.js +1 -371
  13. package/lib/card/index.js +1 -326
  14. package/lib/cascader/index.js +1 -2168
  15. package/lib/checkbox/index.js +1 -571
  16. package/lib/code-diff/index.js +1 -5520
  17. package/lib/collapse/index.js +1 -698
  18. package/lib/color-picker/index.js +1 -2816
  19. package/lib/components.js +1 -759
  20. package/lib/container/index.js +1 -369
  21. package/lib/date-picker/index.js +1 -5601
  22. package/lib/dialog/index.js +1 -545
  23. package/lib/directives/index.js +2 -1427
  24. package/lib/directives/index.js.LICENSE.txt +14 -0
  25. package/lib/dist.index.js +1 -166
  26. package/lib/divider/index.js +1 -512
  27. package/lib/dropdown/index.js +1 -414
  28. package/lib/exception/index.js +1 -405
  29. package/lib/fixed-navbar/index.js +1 -214
  30. package/lib/form/index.js +1 -986
  31. package/lib/icon/angle-double-down-line.js +1 -426
  32. package/lib/icon/angle-double-left-line.js +1 -426
  33. package/lib/icon/angle-double-left.js +1 -426
  34. package/lib/icon/angle-double-right-line.js +1 -426
  35. package/lib/icon/angle-double-right.js +1 -426
  36. package/lib/icon/angle-double-up-line.js +1 -426
  37. package/lib/icon/angle-down-fill.js +1 -426
  38. package/lib/icon/angle-down-line.js +1 -426
  39. package/lib/icon/angle-down.js +1 -426
  40. package/lib/icon/angle-left.js +1 -426
  41. package/lib/icon/angle-right.js +1 -426
  42. package/lib/icon/angle-up-fill.js +1 -426
  43. package/lib/icon/angle-up.js +1 -426
  44. package/lib/icon/archive-fill.js +1 -426
  45. package/lib/icon/arrows-left.js +1 -426
  46. package/lib/icon/arrows-right.js +1 -426
  47. package/lib/icon/audio-fill.js +1 -426
  48. package/lib/icon/bk.js +1 -426
  49. package/lib/icon/circle.js +1 -426
  50. package/lib/icon/close-line.js +1 -426
  51. package/lib/icon/close.js +1 -426
  52. package/lib/icon/code.js +1 -426
  53. package/lib/icon/cog-shape.js +1 -426
  54. package/lib/icon/collapse-left.js +1 -426
  55. package/lib/icon/copy.js +1 -426
  56. package/lib/icon/data-shape.js +1 -426
  57. package/lib/icon/del.js +1 -426
  58. package/lib/icon/doc-fill.js +1 -426
  59. package/lib/icon/done.js +1 -426
  60. package/lib/icon/down-shape.js +1 -426
  61. package/lib/icon/down-small.js +1 -426
  62. package/lib/icon/edit-line.js +1 -426
  63. package/lib/icon/ellipsis.js +1 -426
  64. package/lib/icon/enlarge-line.js +1 -426
  65. package/lib/icon/error.js +1 -426
  66. package/lib/icon/excel-fill.js +1 -426
  67. package/lib/icon/exclamation-circle-shape.js +1 -426
  68. package/lib/icon/eye.js +1 -426
  69. package/lib/icon/filliscreen-line.js +1 -426
  70. package/lib/icon/folder-open.js +1 -426
  71. package/lib/icon/folder-shape-open.js +1 -426
  72. package/lib/icon/folder-shape.js +1 -426
  73. package/lib/icon/folder.js +1 -426
  74. package/lib/icon/funnel.js +1 -426
  75. package/lib/icon/help-document-fill.js +1 -426
  76. package/lib/icon/help-fill.js +1 -426
  77. package/lib/icon/help.js +1 -426
  78. package/lib/icon/image-fill.js +1 -426
  79. package/lib/icon/img-placehoulder.js +1 -448
  80. package/lib/icon/index.js +1 -2275
  81. package/lib/icon/info-line.js +1 -448
  82. package/lib/icon/info.js +1 -448
  83. package/lib/icon/left-shape.js +1 -448
  84. package/lib/icon/left-turn-line.js +1 -448
  85. package/lib/icon/narrow-line.js +1 -448
  86. package/lib/icon/original.js +1 -448
  87. package/lib/icon/pdf-fill.js +1 -448
  88. package/lib/icon/play-shape.js +1 -448
  89. package/lib/icon/plus.js +1 -448
  90. package/lib/icon/ppt-fill.js +1 -448
  91. package/lib/icon/qq.js +1 -448
  92. package/lib/icon/right-shape.js +1 -448
  93. package/lib/icon/right-turn-line.js +1 -448
  94. package/lib/icon/search.js +1 -448
  95. package/lib/icon/share.js +1 -448
  96. package/lib/icon/spinner.js +1 -448
  97. package/lib/icon/success.js +1 -448
  98. package/lib/icon/switcher-loading.js +1 -448
  99. package/lib/icon/text-file.js +1 -448
  100. package/lib/icon/text-fill.js +1 -448
  101. package/lib/icon/transfer.js +1 -448
  102. package/lib/icon/tree-application-shape.js +1 -448
  103. package/lib/icon/unfull-screen.js +1 -448
  104. package/lib/icon/unvisible.js +1 -448
  105. package/lib/icon/up-shape.js +1 -448
  106. package/lib/icon/upload.js +1 -448
  107. package/lib/icon/video-fill.js +1 -448
  108. package/lib/icon/warn.js +1 -448
  109. package/lib/icon/weixin.js +1 -448
  110. package/lib/image/index.js +1 -873
  111. package/lib/index.js +1 -169
  112. package/lib/info-box/index.js +1 -1784
  113. package/lib/input/index.js +1 -846
  114. package/lib/link/index.js +1 -226
  115. package/lib/loading/index.js +1 -309
  116. package/lib/menu/index.js +1 -796
  117. package/lib/message/index.js +1 -401
  118. package/lib/modal/index.js +1 -395
  119. package/lib/navigation/index.js +1 -431
  120. package/lib/notify/index.js +1 -430
  121. package/lib/overflow-title/index.js +1 -512
  122. package/lib/pagination/index.js +1 -1026
  123. package/lib/plugin-popover/index.js +1 -2447
  124. package/lib/plugins/index.js +1 -130
  125. package/lib/popover/index.js +1 -2453
  126. package/lib/popover2/index.js +1 -172
  127. package/lib/preset.js +1 -129
  128. package/lib/process/index.js +1 -1417
  129. package/lib/progress/index.js +1 -479
  130. package/lib/radio/index.js +1 -649
  131. package/lib/rate/index.js +1 -358
  132. package/lib/resize-layout/index.js +1 -495
  133. package/lib/search-select/index.js +1 -3388
  134. package/lib/search-select/search-select.css +1 -1
  135. package/lib/search-select/search-select.less +1 -1
  136. package/lib/search-select/search-select.variable.css +1 -1
  137. package/lib/select/index.js +1 -2819
  138. package/lib/shared/index.js +1 -2813
  139. package/lib/sideslider/index.js +1 -1362
  140. package/lib/slider/index.js +1 -2060
  141. package/lib/steps/index.js +1 -1504
  142. package/lib/swiper/index.js +1 -374
  143. package/lib/switcher/index.js +1 -308
  144. package/lib/tab/index.js +1 -919
  145. package/lib/table/index.js +1 -6635
  146. package/lib/table-column/index.js +1 -737
  147. package/lib/tag/index.js +1 -278
  148. package/lib/tag-input/index.js +1 -1897
  149. package/lib/time-picker/index.js +1 -142
  150. package/lib/timeline/index.js +1 -315
  151. package/lib/transfer/index.js +1 -658
  152. package/lib/tree/index.js +1 -2917
  153. package/lib/upload/index.js +1 -3735
  154. package/lib/virtual-render/index.js +1 -825
  155. package/package.json +2 -1
@@ -1,825 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("lodash"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "lodash"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("lodash")) : factory(root["../shared"], root["vue"], root["lodash"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__467__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 4212:
16
- /***/ ((module) => {
17
-
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
19
-
20
- /***/ }),
21
-
22
- /***/ 467:
23
- /***/ ((module) => {
24
-
25
- module.exports = __WEBPACK_EXTERNAL_MODULE__467__;
26
-
27
- /***/ }),
28
-
29
- /***/ 748:
30
- /***/ ((module) => {
31
-
32
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
33
-
34
- /***/ })
35
-
36
- /******/ });
37
- /************************************************************************/
38
- /******/ // The module cache
39
- /******/ var __webpack_module_cache__ = {};
40
- /******/
41
- /******/ // The require function
42
- /******/ function __webpack_require__(moduleId) {
43
- /******/ // Check if module is in cache
44
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
45
- /******/ if (cachedModule !== undefined) {
46
- /******/ return cachedModule.exports;
47
- /******/ }
48
- /******/ // Create a new module (and put it into the cache)
49
- /******/ var module = __webpack_module_cache__[moduleId] = {
50
- /******/ // no module.id needed
51
- /******/ // no module.loaded needed
52
- /******/ exports: {}
53
- /******/ };
54
- /******/
55
- /******/ // Execute the module function
56
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
57
- /******/
58
- /******/ // Return the exports of the module
59
- /******/ return module.exports;
60
- /******/ }
61
- /******/
62
- /************************************************************************/
63
- /******/ /* webpack/runtime/define property getters */
64
- /******/ (() => {
65
- /******/ // define getter functions for harmony exports
66
- /******/ __webpack_require__.d = (exports, definition) => {
67
- /******/ for(var key in definition) {
68
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
69
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
70
- /******/ }
71
- /******/ }
72
- /******/ };
73
- /******/ })();
74
- /******/
75
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
76
- /******/ (() => {
77
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
78
- /******/ })();
79
- /******/
80
- /******/ /* webpack/runtime/make namespace object */
81
- /******/ (() => {
82
- /******/ // define __esModule on exports
83
- /******/ __webpack_require__.r = (exports) => {
84
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
85
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
86
- /******/ }
87
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
88
- /******/ };
89
- /******/ })();
90
- /******/
91
- /************************************************************************/
92
- var __webpack_exports__ = {};
93
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
94
- (() => {
95
- // ESM COMPAT FLAG
96
- __webpack_require__.r(__webpack_exports__);
97
-
98
- // EXPORTS
99
- __webpack_require__.d(__webpack_exports__, {
100
- "default": () => (/* binding */ src)
101
- });
102
-
103
- // EXTERNAL MODULE: external "../shared"
104
- var external_shared_ = __webpack_require__(4212);
105
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
106
- function _arrayLikeToArray(arr, len) {
107
- if (len == null || len > arr.length) len = arr.length;
108
-
109
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
110
- arr2[i] = arr[i];
111
- }
112
-
113
- return arr2;
114
- }
115
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
116
-
117
- function _arrayWithoutHoles(arr) {
118
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
119
- }
120
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
121
- function _iterableToArray(iter) {
122
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
123
- }
124
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
125
-
126
- function _unsupportedIterableToArray(o, minLen) {
127
- if (!o) return;
128
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
129
- var n = Object.prototype.toString.call(o).slice(8, -1);
130
- if (n === "Object" && o.constructor) n = o.constructor.name;
131
- if (n === "Map" || n === "Set") return Array.from(o);
132
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
133
- }
134
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
135
- function _nonIterableSpread() {
136
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
137
- }
138
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
139
-
140
-
141
-
142
-
143
- function _toConsumableArray(arr) {
144
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
145
- }
146
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
147
- function _typeof(obj) {
148
- "@babel/helpers - typeof";
149
-
150
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
151
- return typeof obj;
152
- } : function (obj) {
153
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
154
- }, _typeof(obj);
155
- }
156
- // EXTERNAL MODULE: external "vue"
157
- var external_vue_ = __webpack_require__(748);
158
- ;// CONCATENATED MODULE: ../../packages/virtual-render/src/props.ts
159
- /*
160
- * Tencent is pleased to support the open source community by making
161
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
162
- *
163
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
164
- *
165
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
166
- *
167
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
168
- *
169
- * ---------------------------------------------------
170
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
171
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
172
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
173
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
174
- *
175
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
176
- * the Software.
177
- *
178
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
179
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
180
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
181
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
182
- * IN THE SOFTWARE.
183
- */
184
-
185
- var EventProps = {
186
- onContentScroll: Function
187
- };
188
- var virtualRenderProps = Object.assign({
189
- /** 传入原始数据源 */
190
- list: external_shared_.PropTypes.array.def([]),
191
-
192
- /**
193
- * 是否启用此功能
194
- * 如果设置为false,则此组件只会渲染两层指定的 容器,默认渲染两层 div
195
- * 设置为true才会启用所有的虚拟渲染 & 滚动相关计算
196
- * 此属性设置为了兼容需要按需开启\关闭虚拟渲染场景,避免外层设计两套样式架构
197
- * Note: 目前此属性不支持动态修改
198
- */
199
- enabled: external_shared_.PropTypes.bool.def(true),
200
-
201
- /**
202
- * 是否启用内置的Scroll Listener
203
- * 当启用虚拟滚动时(enabled = true),滚动监听为内置生效
204
- * 只有当(enabled = false)时此配置项才生效
205
- */
206
- scrollEvent: external_shared_.PropTypes.bool.def(false),
207
-
208
- /**
209
- * 每行数据高度
210
- * 默认为数值类型,默认高度 30px
211
- * 如果每行高度不一致,可为回调函数:(index: number, row: any[]): number => {}
212
- * 函数参数为当前行index & 当前行数据 row,row为数组,当不分组时,为当前行item
213
- * 如果有分组展示, index 为当前分组 index, row为数组,当前行分组所有 item 数据
214
- */
215
- lineHeight: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.number, external_shared_.PropTypes.func]).def(30),
216
-
217
- /** 整体最小高度 */
218
- minHeight: external_shared_.PropTypes.number.def(30),
219
-
220
- /**
221
- * 整体高度
222
- * 可设置具体值,如果设置为 100%,则组件会自动计算外层DOM元素offsetHeight,用于计算可渲染行数
223
- */
224
- height: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string.def('100%'), external_shared_.PropTypes.number]).def('100%'),
225
-
226
- /**
227
- * 渲染区域宽度
228
- * 如果设置 100% 则自适应外层元素宽度
229
- */
230
- width: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string.def('100%'), external_shared_.PropTypes.number]).def('100%'),
231
-
232
- /** 最外层元素ClassName */
233
- className: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.string), external_shared_.PropTypes.object, external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.object), external_shared_.PropTypes.string]).def(''),
234
-
235
- /** 内层层元素ClassName */
236
- contentClassName: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.string), external_shared_.PropTypes.object, external_shared_.PropTypes.arrayOf(external_shared_.PropTypes.object), external_shared_.PropTypes.string]).def(''),
237
-
238
- /** 内层元素样式 */
239
- contentStyle: external_shared_.PropTypes.object.def({}),
240
-
241
- /** 用于自定义X轴滚动条样式 */
242
- scrollXName: external_shared_.PropTypes.string.def((0,external_shared_.resolveClassName)('F-scroll-x')),
243
-
244
- /** 用于自定义Y轴滚动条样式 */
245
- scrollYName: external_shared_.PropTypes.string.def((0,external_shared_.resolveClassName)('F-scroll-y')),
246
-
247
- /** 分组展示,一行数据可能有多条数据 */
248
- groupItemCount: external_shared_.PropTypes.number.def(1),
249
-
250
- /** 预加载行数,避免空白渲染 */
251
- preloadItemCount: external_shared_.PropTypes.number.def(1),
252
-
253
- /** 外层Dom元素需要渲染成的目标元素 */
254
- renderAs: external_shared_.PropTypes.string.def('div'),
255
-
256
- /** 内容层渲染成目标元素 */
257
- contentAs: external_shared_.PropTypes.string.def('div'),
258
-
259
- /** top 滚动填充 */
260
- scrollOffsetTop: external_shared_.PropTypes.number.def(0),
261
-
262
- /**
263
- * 内置滚动位置
264
- * 可选:container (最外层容器),content(内容层容器)
265
- * Note: container 慎选,需要自己处理样式 & 位置
266
- */
267
- scrollPosition: external_shared_.PropTypes.string.def('content'),
268
-
269
- /**
270
- * 绝对高度 | 实际高估
271
- * 可选值: auto(根据行高和行数计算, LineHeight * List.length) number(外层给定高度,若为0,则不显示)
272
- */
273
- abosuteHeight: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string.def('auto'), external_shared_.PropTypes.number]).def('auto'),
274
-
275
- /**
276
- * 滚动刷新计算间隔时间
277
- * 默认60 ms
278
- */
279
- throttleDelay: external_shared_.PropTypes.number.def(60),
280
- rowKey: external_shared_.PropTypes.string.def(undefined)
281
- }, EventProps);
282
- ;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-tag-render.tsx
283
- /*
284
- * Tencent is pleased to support the open source community by making
285
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
286
- *
287
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
288
- *
289
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
290
- *
291
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
292
- *
293
- * ---------------------------------------------------
294
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
295
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
296
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
297
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
298
- *
299
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
300
- * the Software.
301
- *
302
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
303
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
304
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
305
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
306
- * IN THE SOFTWARE.
307
- */
308
-
309
- /* harmony default export */ const use_tag_render = (function (props, ctx) {
310
- var renderAs = props.renderAs,
311
- contentAs = props.contentAs;
312
- /** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
313
-
314
- var handleScrollCallback = function handleScrollCallback(event, _startIndex, _endIndex, _scrollTop, translateY, scrollLeft, pos) {
315
- ctx.emit('content-scroll', [event, {
316
- translateY: translateY,
317
- translateX: scrollLeft,
318
- pos: pos
319
- }]);
320
- };
321
-
322
- var vVirtualRender = (0,external_vue_.resolveDirective)('bkVirtualRender');
323
- var dirModifier = {
324
- lineHeight: props.lineHeight,
325
- handleScrollCallback: handleScrollCallback,
326
- pagination: {},
327
- throttleDelay: props.throttleDelay,
328
- onlyScroll: props.scrollEvent
329
- };
330
- return {
331
- rendAsTag: function rendAsTag() {
332
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
333
-
334
- return (0,external_vue_.h)( // @ts-ignore:next-line
335
- renderAs, {
336
- "class": props.className
337
- }, [(_c = (_b = (_a = ctx.slots).beforeContent) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '', (0,external_vue_.withDirectives)((0,external_vue_.h)(contentAs, {
338
- "class": props.contentClassName,
339
- style: props.contentStyle
340
- }, [(_f = (_e = (_d = ctx.slots)["default"]) === null || _e === void 0 ? void 0 : _e.call(_d, {
341
- data: props.list
342
- })) !== null && _f !== void 0 ? _f : '']), [[vVirtualRender, dirModifier]]), (_j = (_h = (_g = ctx.slots).afterContent) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : '', (_m = (_l = (_k = ctx.slots).afterSection) === null || _l === void 0 ? void 0 : _l.call(_k)) !== null && _m !== void 0 ? _m : '']);
343
- }
344
- };
345
- });
346
- // EXTERNAL MODULE: external "lodash"
347
- var external_lodash_ = __webpack_require__(467);
348
- ;// CONCATENATED MODULE: ../../packages/virtual-render/src/v-virtual-render.ts
349
- var _this = undefined;
350
-
351
- /*
352
- * Tencent is pleased to support the open source community by making
353
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
354
- *
355
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
356
- *
357
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
358
- *
359
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
360
- *
361
- * ---------------------------------------------------
362
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
363
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
364
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
365
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
366
- *
367
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
368
- * the Software.
369
- *
370
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
371
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
372
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
373
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
374
- * IN THE SOFTWARE.
375
- */
376
-
377
- /**
378
- * @file v-virtual-render
379
- *
380
- * Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
381
- */
382
-
383
-
384
- function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
385
- var startIndex = 0;
386
- var height = 0;
387
- var diffHeight = 0;
388
- var lastHeight = 0;
389
-
390
- for (; startIndex < maxCount; startIndex++) {
391
- lastHeight = callback(startIndex, [startIndex * groupItemCount, (startIndex + 1) * groupItemCount, 'virtual']);
392
-
393
- if (height + lastHeight > maxHeight) {
394
- diffHeight = maxHeight - height;
395
- break;
396
- }
397
-
398
- height += lastHeight;
399
- }
400
-
401
- return {
402
- startIndex: startIndex,
403
- height: height,
404
- diffHeight: diffHeight
405
- };
406
- }
407
-
408
- function computedVirtualIndex(lineHeight, callback, pagination, el, event) {
409
- if (!el) {
410
- return;
411
- }
412
-
413
- var elScrollTop = el.scrollTop;
414
- var elScrollLeft = el.scrollLeft;
415
- var scrollTop = pagination.scrollTop,
416
- count = pagination.count,
417
- groupItemCount = pagination.groupItemCount,
418
- startIndex = pagination.startIndex,
419
- endIndex = pagination.endIndex,
420
- scrollLeft = pagination.scrollLeft;
421
- var offsetHeight = el.offsetHeight;
422
- var targetStartIndex = 0;
423
- var targetEndIndex = 0;
424
- var translateY = 0;
425
-
426
- if (typeof lineHeight === 'number') {
427
- targetStartIndex = Math.floor(elScrollTop / lineHeight);
428
- targetEndIndex = Math.ceil(offsetHeight / lineHeight) + targetStartIndex;
429
- translateY = elScrollTop % lineHeight;
430
- }
431
-
432
- if (typeof lineHeight === 'function') {
433
- var startValue = getMatchedIndex(count, elScrollTop, groupItemCount, lineHeight);
434
- targetStartIndex = startValue.startIndex > 0 ? startValue.startIndex : 0;
435
- translateY = startValue.diffHeight;
436
- var endValue = getMatchedIndex(count, offsetHeight, groupItemCount, lineHeight);
437
- targetEndIndex = endValue.startIndex + targetStartIndex + 1;
438
- }
439
-
440
- if (elScrollTop !== scrollTop || targetStartIndex !== startIndex || targetEndIndex !== endIndex || scrollLeft !== elScrollLeft) {
441
- var bottom = el.scrollHeight - el.offsetHeight - el.scrollTop;
442
- typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop, translateY, elScrollLeft, {
443
- bottom: bottom >= 0 ? bottom : 0
444
- });
445
- }
446
- }
447
-
448
- function visibleRender(e, wrapper, binding) {
449
- var _binding$value = binding.value,
450
- _binding$value$lineHe = _binding$value.lineHeight,
451
- lineHeight = _binding$value$lineHe === void 0 ? 30 : _binding$value$lineHe,
452
- handleScrollCallback = _binding$value.handleScrollCallback,
453
- _binding$value$pagina = _binding$value.pagination,
454
- pagination = _binding$value$pagina === void 0 ? {} : _binding$value$pagina,
455
- onlyScroll = _binding$value.onlyScroll;
456
-
457
- if (onlyScroll) {
458
- var elScrollTop = wrapper.scrollTop;
459
- var elScrollLeft = wrapper.scrollLeft;
460
- var bottom = wrapper.scrollHeight - wrapper.offsetHeight - wrapper.scrollTop;
461
- handleScrollCallback(e, null, null, elScrollTop, elScrollTop, elScrollLeft, {
462
- bottom: bottom >= 0 ? bottom : 0
463
- });
464
- return;
465
- }
466
-
467
- var startIndex = pagination.startIndex,
468
- endIndex = pagination.endIndex,
469
- groupItemCount = pagination.groupItemCount,
470
- count = pagination.count,
471
- scrollTop = pagination.scrollTop,
472
- scrollLeft = pagination.scrollLeft;
473
- computedVirtualIndex(lineHeight, handleScrollCallback, {
474
- scrollTop: scrollTop,
475
- startIndex: startIndex,
476
- endIndex: endIndex,
477
- groupItemCount: groupItemCount,
478
- count: count,
479
- scrollLeft: scrollLeft
480
- }, wrapper, e);
481
- }
482
-
483
- var throttledRender = function throttledRender() {
484
- var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 60;
485
- return (0,external_lodash_.throttle)(function (e, wrapper, binding) {
486
- return visibleRender(e, wrapper, binding);
487
- }, delay);
488
- }; // const debounceRender = (delay = 60) => debounce((e, wrapper, binding) => visibleRender(e, wrapper, binding), delay);
489
-
490
-
491
- var executeThrottledRender = function executeThrottledRender(e, wrapper, binding) {
492
- var delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 60;
493
- Reflect.apply(throttledRender(delay), _this, [e, wrapper, binding]);
494
- };
495
-
496
- /* harmony default export */ const v_virtual_render = ({
497
- mounted: function mounted(el, binding) {
498
- var wrapper = el.parentNode;
499
- var throttleDelay = binding.value.throttleDelay;
500
- wrapper.addEventListener('scroll', function (e) {
501
- // @ts-ignore:next-line
502
- executeThrottledRender(e, wrapper, binding, throttleDelay);
503
- });
504
- },
505
- unbind: function unbind(el) {
506
- if (el) {
507
- var wrapper = el.parentNode;
508
-
509
- if (!wrapper) {
510
- return;
511
- }
512
-
513
- wrapper.removeEventListener('scroll', throttledRender);
514
- }
515
- }
516
- });
517
- ;// CONCATENATED MODULE: ../../packages/virtual-render/src/virtual-render.tsx
518
-
519
-
520
-
521
- /*
522
- * Tencent is pleased to support the open source community by making
523
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
524
- *
525
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
526
- *
527
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
528
- *
529
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
530
- *
531
- * ---------------------------------------------------
532
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
533
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
534
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
535
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
536
- *
537
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
538
- * the Software.
539
- *
540
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
541
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
542
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
543
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
544
- * IN THE SOFTWARE.
545
- */
546
-
547
- /**
548
- * @file virtual-render
549
- *
550
- * Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
551
- */
552
-
553
-
554
-
555
-
556
-
557
- /* harmony default export */ const virtual_render = ((0,external_vue_.defineComponent)({
558
- name: 'VirtualRender',
559
- directives: {
560
- bkVirtualRender: v_virtual_render
561
- },
562
- props: virtualRenderProps,
563
- emits: ['content-scroll'],
564
- setup: function setup(props, ctx) {
565
- var _this = this;
566
-
567
- var renderAs = props.renderAs,
568
- contentAs = props.contentAs;
569
-
570
- var resolvePropClassName = function resolvePropClassName(prop) {
571
- if (typeof prop === 'string') {
572
- return [prop];
573
- }
574
-
575
- if (_typeof(prop) === 'object' && !Array.isArray(prop)) {
576
- return [prop];
577
- }
578
-
579
- return prop;
580
- };
581
-
582
- if (!props.enabled) {
583
- var _useTagRender = use_tag_render(props, ctx),
584
- rendAsTag = _useTagRender.rendAsTag;
585
-
586
- return rendAsTag;
587
- }
588
-
589
- var refRoot = (0,external_vue_.ref)(null);
590
- var pagination = (0,external_vue_.reactive)({
591
- startIndex: 0,
592
- endIndex: 0,
593
- scrollTop: 1,
594
- scrollLeft: 0,
595
- translateY: 0,
596
- translateX: 0,
597
- count: 0,
598
- pos: {},
599
- groupItemCount: props.groupItemCount
600
- });
601
- /** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
602
-
603
- var handleScrollCallback = function handleScrollCallback(event, startIndex, endIndex, scrollTop, translateY, scrollLeft, pos) {
604
- pagination.startIndex = startIndex;
605
- pagination.endIndex = endIndex;
606
- pagination.scrollTop = scrollTop; // 设置偏移量,避免行高较大时出现卡顿式的滚动
607
-
608
- pagination.translateY = translateY;
609
- pagination.translateX = scrollLeft;
610
- pagination.scrollLeft = scrollLeft;
611
- pagination.pos = pos;
612
- ctx.emit('content-scroll', [event, pagination]);
613
- };
614
-
615
- (0,external_vue_.onMounted)(function () {
616
- (0,external_vue_.nextTick)(function () {
617
- handleListChanged(props.list);
618
- afterListDataReset();
619
- });
620
- });
621
- (0,external_vue_.watch)(function () {
622
- return props.list;
623
- }, function () {
624
- handleChangeListConfig();
625
- afterListDataReset();
626
- }, {
627
- deep: true
628
- });
629
- (0,external_vue_.watch)(function () {
630
- return props.lineHeight;
631
- }, function () {
632
- handleChangeListConfig();
633
- afterListDataReset();
634
- });
635
-
636
- var handleChangeListConfig = function handleChangeListConfig() {
637
- /** 数据改变时激活当前表单,使其渲染DOM */
638
- handleListChanged(props.list);
639
- };
640
- /** 如果有分组状态,计算总行数 */
641
-
642
-
643
- var listLength = (0,external_vue_.ref)(0);
644
- /** 实际高度,根据行高和总行数计算出来的实际高度 */
645
-
646
- var innerHeight = (0,external_vue_.ref)(0);
647
- /**
648
- * 列表数据改变时,处理相关参数
649
- */
650
-
651
- var handleListChanged = function handleListChanged(list) {
652
- listLength.value = Math.ceil((list || []).length / props.groupItemCount);
653
- pagination.count = listLength.value;
654
- pagination.startIndex = 0;
655
- pagination.endIndex = 0;
656
- pagination.translateY = 0;
657
- pagination.scrollTop = 0;
658
- var isAuto = typeof props.abosuteHeight === 'string' && props.abosuteHeight === 'auto';
659
-
660
- if (isAuto) {
661
- if (typeof props.lineHeight === 'function') {
662
- innerHeight.value = 0;
663
- var fnValue = 0;
664
-
665
- for (var i = 0; i < listLength.value; i++) {
666
- var fnVal = props.lineHeight.call(_this, i, list.slice(i * props.groupItemCount, props.groupItemCount));
667
- fnValue += typeof fnVal === 'number' ? fnVal : 0;
668
- }
669
-
670
- innerHeight.value = fnValue;
671
- } else {
672
- innerHeight.value = props.lineHeight * listLength.value;
673
- }
674
- } else {
675
- innerHeight.value = props.abosuteHeight;
676
- }
677
- };
678
- /** 列表数据重置之后的处理事项 */
679
-
680
-
681
- var afterListDataReset = function afterListDataReset() {
682
- var scrollTop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
683
-
684
- var _a;
685
-
686
- var el = (_a = refRoot.value) === null || _a === void 0 ? void 0 : _a.parentNode;
687
- computedVirtualIndex(props.lineHeight, handleScrollCallback, pagination, el, null);
688
-
689
- if (scrollTop && refRoot.value) {
690
- refRoot.value.scrollTo(0, 0);
691
- }
692
- };
693
- /** 映射传入的数组为新的数组,增加 $index属性,用来处理唯一Index */
694
-
695
-
696
- var localList = (0,external_vue_.computed)(function () {
697
- if (props.rowKey !== undefined) {
698
- return props.list;
699
- }
700
-
701
- return (props.list || []).map(function (item, index) {
702
- return Object.assign(Object.assign({}, item), {
703
- $index: index
704
- });
705
- });
706
- });
707
- /** 计算出来的当前页数据 */
708
-
709
- var calcList = (0,external_vue_.computed)(function () {
710
- return localList.value.slice(pagination.startIndex * props.groupItemCount, (pagination.endIndex + props.preloadItemCount) * props.groupItemCount);
711
- });
712
- /** 展示列表内容区域样式 */
713
-
714
- var innerContentStyle = (0,external_vue_.computed)(function () {
715
- return props.scrollPosition === 'content' ? {
716
- top: "".concat(pagination.scrollTop + props.scrollOffsetTop, "px"),
717
- transform: "translateY(-".concat(pagination.translateY, "px)")
718
- } : {};
719
- });
720
- /** 虚拟渲染外层容器样式 */
721
-
722
- var wrapperStyle = (0,external_vue_.computed)(function () {
723
- return Object.assign({
724
- height: typeof props.height === 'number' ? "".concat(props.height, "px") : props.height,
725
- width: typeof props.width === 'number' ? "".concat(props.width, "px") : props.width,
726
- display: 'inline-block'
727
- }, props.scrollPosition === 'container' ? innerContentStyle.value : {});
728
- });
729
- /** 虚拟渲染区域内置占位区域样式,用来撑起总高度,出现滚动条 */
730
-
731
- var innerStyle = (0,external_vue_.computed)(function () {
732
- var isHidden = typeof props.abosuteHeight === 'number' && props.abosuteHeight === 0;
733
- return {
734
- height: "".concat(innerHeight.value < props.minHeight ? props.minHeight : innerHeight.value, "px"),
735
- display: isHidden ? 'none' : 'block'
736
- };
737
- });
738
- /** 外层样式列表 */
739
-
740
- var wrapperClass = (0,external_vue_.computed)(function () {
741
- return [(0,external_shared_.resolveClassName)('virtual-render'), props.scrollXName, props.scrollYName].concat(_toConsumableArray(resolvePropClassName(props.className)), [props.scrollPosition === 'container' ? (0,external_shared_.resolveClassName)('virtual-content') : '']);
742
- });
743
- /** 内容区域样式列表 */
744
-
745
- var innerClass = (0,external_vue_.computed)(function () {
746
- return [props.scrollPosition === 'content' ? (0,external_shared_.resolveClassName)('virtual-content') : ''].concat(_toConsumableArray(resolvePropClassName(props.contentClassName)));
747
- });
748
- var vVirtualRender = (0,external_vue_.resolveDirective)('bkVirtualRender');
749
- var dirModifier = {
750
- lineHeight: props.lineHeight,
751
- handleScrollCallback: handleScrollCallback,
752
- pagination: pagination,
753
- throttleDelay: props.throttleDelay
754
- };
755
-
756
- var reset = function reset() {
757
- handleChangeListConfig();
758
- afterListDataReset();
759
- };
760
-
761
- ctx.expose({
762
- reset: reset
763
- });
764
- return function () {
765
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
766
-
767
- return (0,external_vue_.h)( // @ts-ignore:next-line
768
- renderAs || 'div', {
769
- ref: refRoot,
770
- "class": wrapperClass.value,
771
- style: wrapperStyle.value
772
- }, [(_c = (_b = (_a = ctx.slots).beforeContent) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '', (0,external_vue_.withDirectives)((0,external_vue_.h)(contentAs || 'div', {
773
- "class": innerClass.value,
774
- style: Object.assign(Object.assign({}, innerContentStyle.value), props.contentStyle)
775
- }, [(_f = (_e = (_d = ctx.slots)["default"]) === null || _e === void 0 ? void 0 : _e.call(_d, {
776
- data: calcList.value
777
- })) !== null && _f !== void 0 ? _f : '']), [[vVirtualRender, dirModifier]]), (_j = (_h = (_g = ctx.slots).afterContent) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : '', (0,external_vue_.h)('div', {
778
- "class": [(0,external_shared_.resolveClassName)('virtual-section')],
779
- style: innerStyle.value
780
- }), (_m = (_l = (_k = ctx.slots).afterSection) === null || _l === void 0 ? void 0 : _l.call(_k)) !== null && _m !== void 0 ? _m : '']);
781
- };
782
- }
783
- }));
784
- ;// CONCATENATED MODULE: ../../packages/virtual-render/src/index.ts
785
- /*
786
- * Tencent is pleased to support the open source community by making
787
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
788
- *
789
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
790
- *
791
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
792
- *
793
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
794
- *
795
- * ---------------------------------------------------
796
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
797
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
798
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
799
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
800
- *
801
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
802
- * the Software.
803
- *
804
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
805
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
806
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
807
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
808
- * IN THE SOFTWARE.
809
- */
810
-
811
- /**
812
- * @file virtual-render enter
813
- *
814
- * Copyright © 2012-2019 Tencent BlueKing. All Rights Reserved. 蓝鲸智云 版权所有
815
- */
816
-
817
-
818
- var BkVirtualRender = (0,external_shared_.withInstall)(virtual_render);
819
- /* harmony default export */ const src = (BkVirtualRender);
820
- })();
821
-
822
- /******/ return __webpack_exports__;
823
- /******/ })()
824
- ;
825
- });
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("lodash"));else if("function"==typeof define&&define.amd)define(["../shared","vue","lodash"],t);else{var o="object"==typeof exports?t(require("../shared"),require("vue"),require("lodash")):t(e["../shared"],e.vue,e.lodash);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,((e,t,o)=>(()=>{"use strict";var r={4212:t=>{t.exports=e},467:e=>{e.exports=o},748:e=>{e.exports=t}},n={};function l(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}};return r[e](o,o.exports,l),o.exports}l.d=(e,t)=>{for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{l.r(s),l.d(s,{default:()=>m});var e=l(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function o(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,o):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var n=l(748),i={onContentScroll:Function},a=Object.assign({list:e.PropTypes.array.def([]),enabled:e.PropTypes.bool.def(!0),scrollEvent:e.PropTypes.bool.def(!1),lineHeight:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.func]).def(30),minHeight:e.PropTypes.number.def(30),height:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),width:e.PropTypes.oneOfType([e.PropTypes.string.def("100%"),e.PropTypes.number]).def("100%"),className:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentClassName:e.PropTypes.oneOfType([e.PropTypes.arrayOf(e.PropTypes.string),e.PropTypes.object,e.PropTypes.arrayOf(e.PropTypes.object),e.PropTypes.string]).def(""),contentStyle:e.PropTypes.object.def({}),scrollXName:e.PropTypes.string.def((0,e.resolveClassName)("F-scroll-x")),scrollYName:e.PropTypes.string.def((0,e.resolveClassName)("F-scroll-y")),groupItemCount:e.PropTypes.number.def(1),preloadItemCount:e.PropTypes.number.def(1),renderAs:e.PropTypes.string.def("div"),contentAs:e.PropTypes.string.def("div"),scrollOffsetTop:e.PropTypes.number.def(0),scrollPosition:e.PropTypes.string.def("content"),abosuteHeight:e.PropTypes.oneOfType([e.PropTypes.string.def("auto"),e.PropTypes.number]).def("auto"),throttleDelay:e.PropTypes.number.def(60),rowKey:e.PropTypes.string.def(void 0)},i),u=l(467),c=void 0;function p(e,t,o,r){for(var n=0,l=0,s=0,i=0;n<e;n++){if(l+(i=r(n,[n*o,(n+1)*o,"virtual"]))>t){s=t-l;break}l+=i}return{startIndex:n,height:l,diffHeight:s}}function f(e,t,o,r,n){if(r){var l=r.scrollTop,s=r.scrollLeft,i=o.scrollTop,a=o.count,u=o.groupItemCount,c=o.startIndex,f=o.endIndex,d=o.scrollLeft,v=r.offsetHeight,y=0,h=0,m=0;if("number"==typeof e&&(y=Math.floor(l/e),h=Math.ceil(v/e)+y,m=l%e),"function"==typeof e){var g=p(a,l,u,e);y=g.startIndex>0?g.startIndex:0,m=g.diffHeight,h=p(a,v,u,e).startIndex+y+1}if(l!==i||y!==c||h!==f||d!==s){var b=r.scrollHeight-r.offsetHeight-r.scrollTop;"function"==typeof t&&t(n,y,h,l,m,s,{bottom:b>=0?b:0})}}}function d(e,t,o){var r=o.value,n=r.lineHeight,l=void 0===n?30:n,s=r.handleScrollCallback,i=r.pagination,a=void 0===i?{}:i;if(r.onlyScroll){var u=t.scrollTop,c=t.scrollLeft,p=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,u,u,c,{bottom:p>=0?p:0})}else{var d=a.startIndex,v=a.endIndex,y=a.groupItemCount,h=a.count;f(l,s,{scrollTop:a.scrollTop,startIndex:d,endIndex:v,groupItemCount:y,count:h,scrollLeft:a.scrollLeft},t,e)}}var v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return(0,u.throttle)((function(e,t,o){return d(e,t,o)}),e)};const y={mounted:function(e,t){var o=e.parentNode,r=t.value.throttleDelay;o.addEventListener("scroll",(function(e){!function(e,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;Reflect.apply(v(r),c,[e,t,o])}(e,o,t,r)}))},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",v)}}},h=(0,n.defineComponent)({name:"VirtualRender",directives:{bkVirtualRender:y},props:a,emits:["content-scroll"],setup:function(t,l){var s=this,i=t.renderAs,a=t.contentAs,u=function(e){return"string"==typeof e?[e]:"object"!==r(e)||Array.isArray(e)?e:[e]};if(!t.enabled){var c=function(e,t){var o=e.renderAs,r=e.contentAs,l=(0,n.resolveDirective)("bkVirtualRender"),s={lineHeight:e.lineHeight,handleScrollCallback:function(e,o,r,n,l,s,i){t.emit("content-scroll",[e,{translateY:l,translateX:s,pos:i}])},pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},i=(0,n.ref)(null);return t.expose({scrollTo:function(e){var t=e.left,o=void 0===t?0:t,r=e.top,n=void 0===r?0:r;i.value.scrollTo(o,n)}}),{rendAsTag:function(){var a,u,c,p,f,d,v,y,h,m,g,b;return(0,n.h)(o,{class:e.className,ref:i},[null!==(c=null===(u=(a=t.slots).beforeContent)||void 0===u?void 0:u.call(a))&&void 0!==c?c:"",(0,n.withDirectives)((0,n.h)(r,{class:e.contentClassName,style:e.contentStyle},[null!==(d=null===(f=(p=t.slots).default)||void 0===f?void 0:f.call(p,{data:e.list}))&&void 0!==d?d:""]),[[l,s]]),null!==(h=null===(y=(v=t.slots).afterContent)||void 0===y?void 0:y.call(v))&&void 0!==h?h:"",null!==(b=null===(g=(m=t.slots).afterSection)||void 0===g?void 0:g.call(m))&&void 0!==b?b:""])}}}(t,l);return c.rendAsTag}var p=(0,n.ref)(null),d=(0,n.reactive)({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:t.groupItemCount}),v=function(e,t,o,r,n,s,i){d.startIndex=t,d.endIndex=o,d.scrollTop=r,d.translateY=n,d.translateX=s,d.scrollLeft=s,d.pos=i,l.emit("content-scroll",[e,d])};(0,n.onMounted)((function(){(0,n.nextTick)((function(){g(t.list),b()}))})),(0,n.watch)((function(){return t.list}),(function(){y(),b()}),{deep:!0}),(0,n.watch)((function(){return t.lineHeight}),(function(){y(),b()}));var y=function(){g(t.list)},h=(0,n.ref)(0),m=(0,n.ref)(0),g=function(e){if(h.value=Math.ceil((e||[]).length/t.groupItemCount),d.count=h.value,d.startIndex=0,d.endIndex=0,d.translateY=0,d.scrollTop=0,"string"==typeof t.abosuteHeight&&"auto"===t.abosuteHeight)if("function"==typeof t.lineHeight){m.value=0;for(var o=0,r=0;r<h.value;r++){var n=t.lineHeight.call(s,r,e.slice(r*t.groupItemCount,t.groupItemCount));o+="number"==typeof n?n:0}m.value=o}else m.value=t.lineHeight*h.value;else m.value=t.abosuteHeight},b=function(){var e,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=null===(e=p.value)||void 0===e?void 0:e.parentNode;f(t.lineHeight,v,d,r,null),o&&p.value&&p.value.scrollTo(0,0)},T=(0,n.computed)((function(){return void 0!==t.rowKey?t.list:(t.list||[]).map((function(e,t){return Object.assign(Object.assign({},e),{$index:t})}))})),P=(0,n.computed)((function(){return T.value.slice(d.startIndex*t.groupItemCount,(d.endIndex+t.preloadItemCount)*t.groupItemCount)})),x=(0,n.computed)((function(){return"content"===t.scrollPosition?{top:"".concat(d.scrollTop+t.scrollOffsetTop,"px"),transform:"translateY(-".concat(d.translateY,"px)")}:{}})),I=(0,n.computed)((function(){return Object.assign({height:"number"==typeof t.height?"".concat(t.height,"px"):t.height,width:"number"==typeof t.width?"".concat(t.width,"px"):t.width,display:"inline-block"},"container"===t.scrollPosition?x.value:{})})),C=(0,n.computed)((function(){var e="number"==typeof t.abosuteHeight&&0===t.abosuteHeight;return{height:"".concat(m.value<t.minHeight?t.minHeight:m.value,"px"),display:e?"none":"block"}})),H=(0,n.computed)((function(){return[(0,e.resolveClassName)("virtual-render"),t.scrollXName,t.scrollYName].concat(o(u(t.className)),["container"===t.scrollPosition?(0,e.resolveClassName)("virtual-content"):""])})),S=(0,n.computed)((function(){return["content"===t.scrollPosition?(0,e.resolveClassName)("virtual-content"):""].concat(o(u(t.contentClassName)))})),O=(0,n.resolveDirective)("bkVirtualRender"),j={lineHeight:t.lineHeight,handleScrollCallback:v,pagination:d,throttleDelay:t.throttleDelay};return l.expose({reset:function(){y(),b()},scrollTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{left:0,top:0},t=e.left,o=e.top;p.value.scrollTo(t,o)}}),function(){var o,r,s,u,c,f,d,v,y,h,m,g;return(0,n.h)(i||"div",{ref:p,class:H.value,style:I.value},[null!==(s=null===(r=(o=l.slots).beforeContent)||void 0===r?void 0:r.call(o))&&void 0!==s?s:"",(0,n.withDirectives)((0,n.h)(a||"div",{class:S.value,style:Object.assign(Object.assign({},x.value),t.contentStyle)},[null!==(f=null===(c=(u=l.slots).default)||void 0===c?void 0:c.call(u,{data:P.value}))&&void 0!==f?f:""]),[[O,j]]),null!==(y=null===(v=(d=l.slots).afterContent)||void 0===v?void 0:v.call(d))&&void 0!==y?y:"",(0,n.h)("div",{class:[(0,e.resolveClassName)("virtual-section")],style:C.value}),null!==(g=null===(m=(h=l.slots).afterSection)||void 0===m?void 0:m.call(h))&&void 0!==g?g:""])}}}),m=(0,e.withInstall)(h)})(),s})()));