bkui-vue 0.0.2-beta.81 → 0.0.2-beta.82

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