bkui-vue 2.0.1-beta.5 → 2.0.1-beta.50.select.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/index.cjs.js +154 -154
  2. package/dist/index.esm.js +19768 -20657
  3. package/dist/index.umd.js +154 -154
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/collapse/collapse.css +0 -11
  7. package/lib/collapse/collapse.d.ts +0 -11
  8. package/lib/collapse/collapse.less +1 -15
  9. package/lib/collapse/collapse.variable.css +0 -11
  10. package/lib/collapse/index.d.ts +0 -23
  11. package/lib/collapse/index.js +1 -9
  12. package/lib/collapse/props.d.ts +0 -8
  13. package/lib/components.d.ts +0 -1
  14. package/lib/components.js +0 -1
  15. package/lib/date-picker/base/year-table.d.ts +2 -2
  16. package/lib/date-picker/index.js +19 -93
  17. package/lib/date-picker/interface.d.ts +1 -1
  18. package/lib/date-picker/panel/date-range.d.ts +63 -1
  19. package/lib/date-picker/utils.d.ts +0 -4
  20. package/lib/dialog/dialog.css +84 -135
  21. package/lib/dialog/dialog.d.ts +132 -38
  22. package/lib/dialog/dialog.less +76 -9
  23. package/lib/dialog/dialog.variable.css +84 -135
  24. package/lib/dialog/index.d.ts +311 -96
  25. package/lib/dialog/index.js +221 -197
  26. package/lib/dialog/props.d.ts +47 -10
  27. package/lib/info-box/index.d.ts +2 -2
  28. package/lib/info-box/index.js +173 -328
  29. package/lib/info-box/info-box.css +7 -63
  30. package/lib/info-box/info-box.d.ts +16 -18
  31. package/lib/info-box/info-box.less +14 -76
  32. package/lib/info-box/info-box.variable.css +7 -63
  33. package/lib/input/index.js +1 -2
  34. package/lib/modal/hooks.d.ts +1 -1
  35. package/lib/modal/index.d.ts +345 -29
  36. package/lib/modal/index.js +703 -218
  37. package/lib/modal/modal.css +32 -131
  38. package/lib/modal/modal.d.ts +132 -11
  39. package/lib/modal/modal.less +29 -83
  40. package/lib/modal/modal.variable.css +32 -131
  41. package/lib/modal/props.mixin.d.ts +52 -4
  42. package/lib/overflow-title/index.js +52 -46
  43. package/lib/radio/index.d.ts +0 -29
  44. package/lib/radio/index.js +16 -34
  45. package/lib/radio/radio-button.d.ts +0 -10
  46. package/lib/radio/radio-group.d.ts +0 -10
  47. package/lib/radio/radio.d.ts +0 -10
  48. package/lib/select/index.d.ts +19 -0
  49. package/lib/select/index.js +21 -8
  50. package/lib/select/select.css +2 -1
  51. package/lib/select/select.d.ts +9 -0
  52. package/lib/select/select.less +2 -1
  53. package/lib/select/select.variable.css +2 -1
  54. package/lib/shared/index.d.ts +1 -0
  55. package/lib/shared/index.js +48 -4
  56. package/lib/shared/mask.d.ts +11 -0
  57. package/lib/sideslider/index.d.ts +218 -42
  58. package/lib/sideslider/index.js +40 -65
  59. package/lib/sideslider/sideslider.css +86 -17
  60. package/lib/sideslider/sideslider.d.ts +104 -20
  61. package/lib/sideslider/sideslider.less +107 -27
  62. package/lib/sideslider/sideslider.variable.css +86 -17
  63. package/lib/slider/index.d.ts +0 -19
  64. package/lib/slider/index.js +5 -45
  65. package/lib/slider/slider.css +0 -14
  66. package/lib/slider/slider.d.ts +0 -9
  67. package/lib/slider/slider.less +0 -15
  68. package/lib/slider/slider.variable.css +0 -14
  69. package/lib/table/components/table-cell.d.ts +2 -3
  70. package/lib/table/components/table-column.d.ts +119 -3
  71. package/lib/table/const.d.ts +4 -4
  72. package/lib/table/index.d.ts +107 -26
  73. package/lib/table/index.js +563 -17798
  74. package/lib/table/plugins/head-filter.css +4 -8
  75. package/lib/table/plugins/head-filter.less +3 -6
  76. package/lib/table/plugins/head-filter.variable.css +4 -8
  77. package/lib/table/plugins/use-active-columns.d.ts +2 -2
  78. package/lib/table/plugins/use-fixed-column.d.ts +1 -1
  79. package/lib/table/plugins/use-pagination.d.ts +1 -3
  80. package/lib/table/props.d.ts +3 -11
  81. package/lib/table/table.css +46 -106
  82. package/lib/table/table.d.ts +0 -11
  83. package/lib/table/table.less +58 -43
  84. package/lib/table/table.variable.css +46 -106
  85. package/lib/table/use-attributes.d.ts +1 -2
  86. package/lib/table/use-column.d.ts +10 -9
  87. package/lib/table/use-common.d.ts +1 -1
  88. package/lib/table/use-render.d.ts +1 -1
  89. package/lib/table-column/index.d.ts +299 -9
  90. package/lib/table-column/index.js +282 -24
  91. package/lib/tree/constant.d.ts +1 -3
  92. package/lib/tree/index.d.ts +0 -44
  93. package/lib/tree/index.js +25 -17548
  94. package/lib/tree/props.d.ts +0 -18
  95. package/lib/tree/tree.css +2 -76
  96. package/lib/tree/tree.d.ts +2 -28
  97. package/lib/tree/tree.variable.css +2 -76
  98. package/lib/tree/use-node-attribute.d.ts +0 -9
  99. package/lib/virtual-render/index.d.ts +0 -27
  100. package/lib/virtual-render/index.js +80 -295
  101. package/lib/virtual-render/props.d.ts +0 -16
  102. package/lib/virtual-render/use-fix-top.d.ts +7 -2
  103. package/lib/virtual-render/v-virtual-render.d.ts +1 -2
  104. package/lib/virtual-render/virtual-render.css +2 -76
  105. package/lib/virtual-render/virtual-render.d.ts +0 -13
  106. package/lib/virtual-render/virtual-render.less +3 -3
  107. package/lib/virtual-render/virtual-render.variable.css +2 -76
  108. package/package.json +1 -1
  109. package/lib/info-box/render-component.d.ts +0 -4
  110. package/lib/modal/mask.d.ts +0 -6
  111. package/lib/scrollbar/index.d.ts +0 -15
  112. package/lib/scrollbar/index.js +0 -18763
  113. package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +0 -2
  114. package/lib/scrollbar/scrollbar-core/helpers.d.ts +0 -5
  115. package/lib/scrollbar/scrollbar-core/index.d.ts +0 -241
  116. package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +0 -5
  117. package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +0 -1
  118. package/lib/scrollbar/scrollbar.css +0 -75
  119. package/lib/scrollbar/scrollbar.less +0 -94
  120. package/lib/scrollbar/scrollbar.variable.css +0 -204
  121. package/lib/table/plugins/use-column-template.d.ts +0 -7
  122. package/lib/table/plugins/use-shift-key.d.ts +0 -13
  123. package/lib/tree/use-intersection-observer.d.ts +0 -27
  124. package/lib/virtual-render/use-scrollbar.d.ts +0 -24
@@ -3,8 +3,6 @@ import "./virtual-render.less";
3
3
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
4
4
  import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
6
- import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
7
- import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_scrollbar_918447d0__ from "../scrollbar";
8
6
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
9
7
  /******/ // The require scope
10
8
  /******/ var __webpack_require__ = {};
@@ -124,15 +122,11 @@ function _defineProperty(obj, key, value) {
124
122
  ;// CONCATENATED MODULE: external "vue"
125
123
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
126
124
  var external_vue_y = x => () => x
127
- 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, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
125
+ 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 });
128
126
  ;// CONCATENATED MODULE: external "../config-provider"
129
127
  var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
130
128
  var config_provider_y = x => () => x
131
129
  const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
132
- ;// CONCATENATED MODULE: external "vue-types"
133
- var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
134
- var external_vue_types_y = x => () => x
135
- const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
136
130
  ;// CONCATENATED MODULE: ../../packages/virtual-render/src/props.ts
137
131
 
138
132
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -163,7 +157,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
163
157
  * IN THE SOFTWARE.
164
158
  */
165
159
 
166
-
167
160
  var EventProps = {
168
161
  onContentScroll: Function
169
162
  };
@@ -248,52 +241,23 @@ var virtualRenderProps = _objectSpread({
248
241
  * 保持滚动条位置、当前渲染区间
249
242
  */
250
243
  keepAlive: shared_namespaceObject.PropTypes.bool.def(false),
251
- /**
252
- * 是否允许滚动条改变原有DOM结构
253
- */
254
- scrollbar: (0,external_vue_types_namespaceObject.toType)('IScrollbarOption', {
255
- "default": {
256
- enabled: true
257
- }
258
- }),
259
244
  /**
260
245
  * 数据监听改变时,是否自动重置位置到[0, 0]
261
246
  */
262
247
  autoReset: shared_namespaceObject.PropTypes.bool.def(true),
263
- wrapperStyle: shared_namespaceObject.PropTypes.any.def({}),
264
- /**
265
- * 传入数据如果没有设置rowKey,是否自动生成$index作为唯一ID
266
- * $index的值默认为index
267
- */
268
- autoIndex: shared_namespaceObject.PropTypes.bool.def(true)
248
+ wrapperStyle: shared_namespaceObject.PropTypes.any.def({})
269
249
  }, EventProps);
270
250
  ;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-fix-top.tsx
271
- /*
272
- * Tencent is pleased to support the open source community by making
273
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
274
- *
275
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
276
- *
277
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
278
- *
279
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
280
- *
281
- * ---------------------------------------------------
282
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
283
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
284
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
285
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
286
- *
287
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
288
- * the Software.
289
- *
290
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
291
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
292
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
293
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
294
- * IN THE SOFTWARE.
295
- */
296
- /* harmony default export */ const use_fix_top = (function (props, scrollTo) {
251
+ /* harmony default export */ const use_fix_top = (function (props, refRoot) {
252
+ var scrollTo = function scrollTo() {
253
+ var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
254
+ left: 0,
255
+ top: 0
256
+ };
257
+ var left = option.left,
258
+ top = option.top;
259
+ refRoot.value.scrollTo(left, top);
260
+ };
297
261
  /**
298
262
  * 指定元素滚动到顶部
299
263
  * @param param0
@@ -318,106 +282,15 @@ var virtualRenderProps = _objectSpread({
318
282
  if (typeof targetIndex === 'number') {
319
283
  var resolvedIndex = targetIndex >= 0 ? targetIndex : 0;
320
284
  var offsetY = resolvedIndex * props.lineHeight;
321
- scrollTo(0, offsetY);
322
- }
323
- return null;
324
- };
325
- return {
326
- fixToTop: fixToTop
327
- };
328
- });
329
- ;// CONCATENATED MODULE: external "../scrollbar"
330
- var scrollbar_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
331
- var scrollbar_y = x => () => x
332
- const scrollbar_namespaceObject = scrollbar_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_scrollbar_918447d0__["default"] });
333
- ;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-scrollbar.tsx
334
- /*
335
- * Tencent is pleased to support the open source community by making
336
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
337
- *
338
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
339
- *
340
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
341
- *
342
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
343
- *
344
- * ---------------------------------------------------
345
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
346
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
347
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
348
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
349
- *
350
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
351
- * the Software.
352
- *
353
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
354
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
355
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
356
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
357
- * IN THE SOFTWARE.
358
- */
359
-
360
-
361
- /* harmony default export */ const use_scrollbar = (function (target, props) {
362
- var instance = null;
363
- var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
364
- resolveClassName = _usePrefix.resolveClassName;
365
- var classNames = {
366
- contentEl: resolveClassName('scrollbar-content-el'),
367
- wrapper: resolveClassName('scrollbar-wrapper'),
368
- scrollbar: resolveClassName('scrollbar'),
369
- track: resolveClassName('scrollbar-track'),
370
- visible: resolveClassName('scrollbar-visible'),
371
- horizontal: resolveClassName('scrollbar-horizontal'),
372
- vertical: resolveClassName('scrollbar-vertical'),
373
- hover: resolveClassName('scrollbar-hover'),
374
- dragging: resolveClassName('scrollbar-dragging'),
375
- scrolling: resolveClassName('scrollbar-scrolling'),
376
- scrollable: resolveClassName('scrollbar-scrollable'),
377
- mouseEntered: resolveClassName('scrollbar-mouse-entered')
378
- };
379
- var init = function init(scrollFn, delegateXContent, delegateYContent) {
380
- instance = new scrollbar_namespaceObject["default"](target.value, {
381
- classNames: classNames,
382
- wrapperNode: target.value,
383
- scrollDelegate: {
384
- scrollHeight: null,
385
- scrollWidth: null
386
- },
387
- useSystemScrollYBehavior: !props.enabled,
388
- useSystemScrollXBehavior: true,
389
- delegateXContent: delegateXContent,
390
- delegateYContent: delegateYContent,
391
- onScrollCallback: scrollFn
392
- });
393
- };
394
- var scrollTo = function scrollTo(x, y) {
395
- var _props$scrollbar;
396
- if ((_props$scrollbar = props.scrollbar) !== null && _props$scrollbar !== void 0 && _props$scrollbar.enabled) {
397
- instance.scrollTo({
398
- left: x,
399
- top: y
285
+ scrollTo({
286
+ left: 0,
287
+ top: offsetY
400
288
  });
401
- return;
402
289
  }
403
- target.value.scrollTo(x, y);
404
- };
405
- var updateScrollHeight = function updateScrollHeight(height) {
406
- var _instance, _instance2;
407
- (_instance = instance) === null || _instance === void 0 || _instance.setOptions({
408
- scrollDelegate: {
409
- scrollHeight: height,
410
- scrollWidth: null
411
- }
412
- });
413
- (_instance2 = instance) === null || _instance2 === void 0 || _instance2.recalculate();
414
290
  };
415
291
  return {
416
- init: init,
417
- instance: instance,
418
- scrollTo: scrollTo,
419
- classNames: classNames,
420
- updateScrollHeight: updateScrollHeight
292
+ fixToTop: fixToTop,
293
+ scrollTo: scrollTo
421
294
  };
422
295
  });
423
296
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
@@ -452,7 +325,6 @@ const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTER
452
325
  ;// CONCATENATED MODULE: ../../packages/virtual-render/src/v-virtual-render.ts
453
326
 
454
327
 
455
-
456
328
  /*
457
329
  * Tencent is pleased to support the open source community by making
458
330
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -503,14 +375,14 @@ function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
503
375
  diffHeight: diffHeight
504
376
  };
505
377
  }
506
- function computedVirtualIndex(lineHeight, callback, pagination, wrapper, event) {
507
- if (!wrapper || !event.offset) {
378
+ function computedVirtualIndex(lineHeight, callback, pagination, _el, event) {
379
+ if (!event.target) {
508
380
  return;
509
381
  }
510
- var elScrollTop = event.offset.y;
511
- var elScrollLeft = event.offset.x;
512
- var elScrollHeight = wrapper.scrollHeight;
513
- var elOffsetHeight = wrapper.offsetHeight;
382
+ var elScrollTop = event.target.scrollTop;
383
+ var elScrollLeft = event.target.scrollLeft;
384
+ var elScrollHeight = event.target.scrollHeight;
385
+ var elOffsetHeight = event.target.offsetHeight;
514
386
  var count = pagination.count,
515
387
  groupItemCount = pagination.groupItemCount;
516
388
  var targetStartIndex = 0;
@@ -529,9 +401,8 @@ function computedVirtualIndex(lineHeight, callback, pagination, wrapper, event)
529
401
  targetEndIndex = endValue.startIndex + targetStartIndex;
530
402
  }
531
403
  var bottom = elScrollHeight - elOffsetHeight - elScrollTop;
532
- typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop, elScrollTop, elScrollLeft, {
533
- bottom: bottom >= 0 ? bottom : 0,
534
- scrollbar: event
404
+ typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop, translateY, elScrollLeft, {
405
+ bottom: bottom >= 0 ? bottom : 0
535
406
  });
536
407
  return {
537
408
  targetStartIndex: targetStartIndex,
@@ -543,33 +414,7 @@ function computedVirtualIndex(lineHeight, callback, pagination, wrapper, event)
543
414
  }
544
415
  var VisibleRender = /*#__PURE__*/function () {
545
416
  function VisibleRender(binding, el) {
546
- var _this = this;
547
417
  _classCallCheck(this, VisibleRender);
548
- _defineProperty(this, "getEvent", function (event) {
549
- var _this$binding$value$s = _this.binding.value.scrollbar,
550
- scrollbar = _this$binding$value$s === void 0 ? {
551
- enabled: false
552
- } : _this$binding$value$s;
553
- if (scrollbar.enabled) {
554
- var _event$offset;
555
- return {
556
- offset: (_event$offset = event.offset) !== null && _event$offset !== void 0 ? _event$offset : event
557
- };
558
- }
559
- if (event !== null && event !== void 0 && event.offset) {
560
- return {
561
- offset: event === null || event === void 0 ? void 0 : event.offset
562
- };
563
- }
564
- var elScrollTop = event.target.scrollTop;
565
- var elScrollLeft = event.target.scrollLeft;
566
- return {
567
- offset: {
568
- x: elScrollLeft,
569
- y: elScrollTop
570
- }
571
- };
572
- });
573
418
  this.binding = binding;
574
419
  this.wrapper = el;
575
420
  var throttleDelay = binding.value.throttleDelay;
@@ -586,13 +431,11 @@ var VisibleRender = /*#__PURE__*/function () {
586
431
  pagination = _this$binding$value$p === void 0 ? {} : _this$binding$value$p,
587
432
  onlyScroll = _this$binding$value.onlyScroll;
588
433
  if (onlyScroll) {
589
- var _e$offset, _e$offset$x, _e$offset2;
590
- var elScrollTop = (_e$offset = e.offset) === null || _e$offset === void 0 ? void 0 : _e$offset.y;
591
- var elScrollLeft = (_e$offset$x = (_e$offset2 = e.offset) === null || _e$offset2 === void 0 ? void 0 : _e$offset2.x) !== null && _e$offset$x !== void 0 ? _e$offset$x : 0;
592
- var bottom = this.wrapper.scrollHeight - this.wrapper.offsetHeight - elScrollTop;
434
+ var elScrollTop = this.wrapper.scrollTop;
435
+ var elScrollLeft = this.wrapper.scrollLeft;
436
+ var bottom = this.wrapper.scrollHeight - this.wrapper.offsetHeight - this.wrapper.scrollTop;
593
437
  handleScrollCallback(e, null, null, elScrollTop, elScrollTop, elScrollLeft, {
594
- bottom: bottom >= 0 ? bottom : 0,
595
- scrollbar: e
438
+ bottom: bottom >= 0 ? bottom : 0
596
439
  });
597
440
  return;
598
441
  }
@@ -614,7 +457,7 @@ var VisibleRender = /*#__PURE__*/function () {
614
457
  }, {
615
458
  key: "executeThrottledRender",
616
459
  value: function executeThrottledRender(e) {
617
- (0,throttle_namespaceObject["default"])(this.render.bind(this), this.delay)(this.getEvent(e));
460
+ (0,throttle_namespaceObject["default"])(this.render.bind(this), this.delay)(e);
618
461
  }
619
462
  }, {
620
463
  key: "install",
@@ -689,47 +532,28 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
689
532
 
690
533
 
691
534
 
692
-
693
535
  /* harmony default export */ const use_tag_render = (function (props, ctx) {
694
536
  var renderAs = props.renderAs,
695
537
  contentAs = props.contentAs;
696
- var refRoot = (0,external_vue_namespaceObject.ref)(null);
697
- var refContent = (0,external_vue_namespaceObject.ref)(null);
698
- var _useScrollbar = use_scrollbar(refRoot, props),
699
- init = _useScrollbar.init,
700
- scrollTo = _useScrollbar.scrollTo,
701
- classNames = _useScrollbar.classNames;
702
- var contentStyle = (0,external_vue_namespaceObject.reactive)({
703
- x: 0,
704
- y: 0
705
- });
706
- var computedStyle = (0,external_vue_namespaceObject.computed)(function () {
707
- return use_tag_render_objectSpread({}, props.contentStyle);
708
- });
709
538
  /** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
710
539
  var handleScrollCallback = function handleScrollCallback(event, _startIndex, _endIndex, _scrollTop, translateY, scrollLeft, pos) {
711
- var scrollbar = pos.scrollbar;
712
- if (scrollbar !== null && scrollbar !== void 0 && scrollbar.offset) {
713
- var _scrollbar$offset;
714
- Object.assign(contentStyle, (_scrollbar$offset = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.offset) !== null && _scrollbar$offset !== void 0 ? _scrollbar$offset : {});
715
- }
716
540
  ctx.emit('content-scroll', [event, {
717
541
  translateY: translateY,
718
542
  translateX: scrollLeft,
719
543
  pos: pos
720
544
  }]);
721
545
  };
722
- var renderInstance = null;
546
+ var instance = null;
723
547
  var binding = (0,external_vue_namespaceObject.computed)(function () {
724
548
  return {
725
549
  lineHeight: props.lineHeight,
726
- scrollbar: props.scrollbar,
727
550
  handleScrollCallback: handleScrollCallback,
728
551
  pagination: {},
729
552
  throttleDelay: props.throttleDelay,
730
553
  onlyScroll: props.scrollEvent
731
554
  };
732
555
  });
556
+ var refRoot = (0,external_vue_namespaceObject.ref)(null);
733
557
  /** 虚拟渲染外层容器样式 */
734
558
  var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
735
559
  var _props$maxHeight;
@@ -741,38 +565,20 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
741
565
  maxHeight: (_props$maxHeight = props.maxHeight) !== null && _props$maxHeight !== void 0 ? _props$maxHeight : height
742
566
  }, props.wrapperStyle);
743
567
  });
744
- var _useFixTop = use_fix_top(props, scrollTo),
568
+ var _useFixTop = use_fix_top(props, refRoot),
569
+ scrollTo = _useFixTop.scrollTo,
745
570
  fixToTop = _useFixTop.fixToTop;
746
571
  ctx.expose({
747
572
  scrollTo: scrollTo,
748
- fixToTop: fixToTop,
749
- refRoot: refRoot,
750
- refContent: refContent
573
+ fixToTop: fixToTop
751
574
  });
752
575
  (0,external_vue_namespaceObject.onMounted)(function () {
753
- var _props$scrollbar;
754
- renderInstance = new VisibleRender(binding, refRoot.value);
755
- if ((_props$scrollbar = props.scrollbar) !== null && _props$scrollbar !== void 0 && _props$scrollbar.enabled) {
756
- init(renderInstance.executeThrottledRender.bind(renderInstance));
757
- return;
758
- }
759
- renderInstance.install();
576
+ instance = new VisibleRender(binding, refRoot.value);
577
+ instance.install();
760
578
  });
761
579
  (0,external_vue_namespaceObject.onUnmounted)(function () {
762
- var _renderInstance;
763
- (_renderInstance = renderInstance) === null || _renderInstance === void 0 || _renderInstance.uninstall();
764
- });
765
- var wrapperClassNames = (0,external_vue_namespaceObject.computed)(function () {
766
- if (props.scrollbar.enabled) {
767
- return [props.className, classNames.wrapper];
768
- }
769
- return [props.className];
770
- });
771
- var contentClassNames = (0,external_vue_namespaceObject.computed)(function () {
772
- if (props.scrollbar.enabled) {
773
- return [props.contentClassName, classNames.contentEl];
774
- }
775
- return [props.contentClassName];
580
+ var _instance;
581
+ (_instance = instance) === null || _instance === void 0 || _instance.uninstall();
776
582
  });
777
583
  return {
778
584
  rendAsTag: function rendAsTag() {
@@ -780,13 +586,12 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
780
586
  return (0,external_vue_namespaceObject.h)(
781
587
  // @ts-ignore:next-line
782
588
  renderAs, {
783
- "class": wrapperClassNames.value,
589
+ "class": props.className,
784
590
  style: wrapperStyle.value,
785
591
  ref: refRoot
786
592
  }, [(_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, {
787
- "class": contentClassNames.value,
788
- style: computedStyle.value,
789
- ref: refContent
593
+ "class": props.contentClassName,
594
+ style: props.contentStyle
790
595
  }, [(_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, {
791
596
  data: props.list
792
597
  })) !== 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 : '']);
@@ -835,7 +640,6 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
835
640
 
836
641
 
837
642
 
838
-
839
643
  /* harmony default export */ const virtual_render = ((0,external_vue_namespaceObject.defineComponent)({
840
644
  name: 'VirtualRender',
841
645
  directives: {
@@ -867,17 +671,10 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
867
671
  lineHeight: props.lineHeight,
868
672
  handleScrollCallback: handleScrollCallback,
869
673
  pagination: pagination,
870
- throttleDelay: props.throttleDelay,
871
- scrollbar: props.scrollbar
674
+ throttleDelay: props.throttleDelay
872
675
  };
873
676
  });
874
677
  var refRoot = (0,external_vue_namespaceObject.ref)(null);
875
- var refContent = (0,external_vue_namespaceObject.ref)(null);
876
- var _useScrollbar = use_scrollbar(refRoot, props),
877
- init = _useScrollbar.init,
878
- scrollTo = _useScrollbar.scrollTo,
879
- classNames = _useScrollbar.classNames,
880
- updateScrollHeight = _useScrollbar.updateScrollHeight;
881
678
  var instance = null;
882
679
  var pagination = (0,external_vue_namespaceObject.reactive)({
883
680
  startIndex: 0,
@@ -907,31 +704,20 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
907
704
  var end = (pagination.endIndex + props.preloadItemCount) * props.groupItemCount;
908
705
  var total = localList.value.length;
909
706
  if (total < end) {
707
+ var contentLength = end - start;
910
708
  calcList.value = localList.value.slice(start, total);
911
- end = total;
912
- start = end - Math.floor(refContent.value.offsetHeight / props.lineHeight);
709
+ end = total + 1;
710
+ start = end - contentLength;
913
711
  start = start < 0 ? 0 : start;
914
712
  }
915
- var value = localList.value.slice(start, end);
713
+ var value = localList.value.slice(start, end + 10);
916
714
  calcList.value = value;
917
715
  if (event) {
918
- ctx.emit('content-scroll', [event, pagination, value]);
716
+ ctx.emit('content-scroll', [event, pagination]);
919
717
  }
920
718
  };
921
719
  (0,external_vue_namespaceObject.onMounted)(function () {
922
- var _props$scrollbar;
923
720
  instance = new VisibleRender(binding, refRoot.value);
924
- if ((_props$scrollbar = props.scrollbar) !== null && _props$scrollbar !== void 0 && _props$scrollbar.enabled) {
925
- init(instance.executeThrottledRender.bind(instance));
926
- updateScrollHeight(contentHeight.value);
927
- instance.executeThrottledRender.call(instance, {
928
- offset: {
929
- x: 0,
930
- y: 0
931
- }
932
- });
933
- return;
934
- }
935
721
  instance.install();
936
722
  });
937
723
  (0,external_vue_namespaceObject.onUnmounted)(function () {
@@ -984,7 +770,7 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
984
770
  };
985
771
  /** 映射传入的数组为新的数组,增加 $index属性,用来处理唯一Index */
986
772
  var localList = (0,external_vue_namespaceObject.computed)(function () {
987
- if (props.rowKey !== undefined || !props.autoIndex) {
773
+ if (props.rowKey !== undefined) {
988
774
  return props.list;
989
775
  }
990
776
  return (props.list || []).map(function (item, index) {
@@ -995,27 +781,35 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
995
781
  });
996
782
  /** 展示列表内容区域样式 */
997
783
  var innerContentStyle = (0,external_vue_namespaceObject.computed)(function () {
998
- return props.scrollPosition === 'content' ? {} : {};
784
+ return props.scrollPosition === 'content' ? {
785
+ top: "".concat(pagination.scrollTop + props.scrollOffsetTop, "px"),
786
+ transform: "translateY(-".concat(pagination.translateY, "px)")
787
+ } : {};
999
788
  });
1000
789
  /** 虚拟渲染外层容器样式 */
1001
790
  var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
791
+ var _props$maxHeight;
1002
792
  var height = typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
1003
793
  return virtual_render_objectSpread(virtual_render_objectSpread({
1004
794
  height: height,
1005
795
  width: typeof props.width === 'number' ? "".concat(props.width, "px") : props.width,
1006
796
  display: 'inline-block',
1007
- maxHeight: props.maxHeight ? "".concat(props.maxHeight, "px") : false,
1008
- minHeight: props.minHeight ? "".concat(props.minHeight, "px") : false
797
+ maxHeight: (_props$maxHeight = props.maxHeight) !== null && _props$maxHeight !== void 0 ? _props$maxHeight : height
1009
798
  }, props.scrollPosition === 'container' ? innerContentStyle.value : {}), props.wrapperStyle);
1010
799
  });
1011
- var contentHeight = (0,external_vue_namespaceObject.computed)(function () {
1012
- return innerHeight.value < props.minHeight ? props.minHeight : innerHeight.value;
800
+ /** 虚拟渲染区域内置占位区域样式,用来撑起总高度,出现滚动条 */
801
+ var innerStyle = (0,external_vue_namespaceObject.computed)(function () {
802
+ var isHidden = typeof props.abosuteHeight === 'number' && props.abosuteHeight === 0;
803
+ return {
804
+ height: "".concat(innerHeight.value < props.minHeight ? props.minHeight : innerHeight.value, "px"),
805
+ display: isHidden ? 'none' : 'block'
806
+ };
1013
807
  });
1014
808
  var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1015
809
  resolveClassName = _usePrefix.resolveClassName;
1016
810
  /** 外层样式列表 */
1017
811
  var wrapperClass = (0,external_vue_namespaceObject.computed)(function () {
1018
- return [resolveClassName('virtual-render')].concat(_toConsumableArray(resolvePropClassName(props.className)), [props.scrollPosition === 'container' ? resolveClassName('virtual-content') : '']);
812
+ return [resolveClassName('virtual-render'), props.scrollXName, props.scrollYName].concat(_toConsumableArray(resolvePropClassName(props.className)), [props.scrollPosition === 'container' ? resolveClassName('virtual-content') : '']);
1019
813
  });
1020
814
  /** 内容区域样式列表 */
1021
815
  var innerClass = (0,external_vue_namespaceObject.computed)(function () {
@@ -1026,40 +820,29 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
1026
820
  * @param keepLastPostion
1027
821
  */
1028
822
  var reset = function reset() {
1029
- var _instance2;
1030
823
  handleChangeListConfig();
1031
824
  afterListDataReset();
1032
- (_instance2 = instance) === null || _instance2 === void 0 || _instance2.executeThrottledRender.call(instance, {
1033
- offset: {
1034
- x: 0,
1035
- y: 0
1036
- }
1037
- });
1038
825
  };
1039
- var _useFixTop = use_fix_top(props, scrollTo),
826
+ var _useFixTop = use_fix_top(props, refRoot),
827
+ scrollTo = _useFixTop.scrollTo,
1040
828
  fixToTop = _useFixTop.fixToTop;
1041
- (0,external_vue_namespaceObject.watchEffect)(function () {
1042
- var _instance3;
1043
- (_instance3 = instance) === null || _instance3 === void 0 || _instance3.setBinding(binding);
829
+ (0,external_vue_namespaceObject.watch)(function () {
830
+ return [props.lineHeight, props.height, props.list, props.maxHeight];
831
+ }, function () {
832
+ var _instance2;
833
+ (_instance2 = instance) === null || _instance2 === void 0 || _instance2.setBinding(binding);
1044
834
  handleChangeListConfig();
1045
- updateScrollHeight(contentHeight.value);
1046
835
  (0,external_vue_namespaceObject.nextTick)(function () {
1047
- var _instance4;
1048
836
  afterListDataReset();
1049
- (_instance4 = instance) === null || _instance4 === void 0 || _instance4.executeThrottledRender.call(instance, {
1050
- offset: {
1051
- x: pagination.scrollLeft,
1052
- y: pagination.scrollTop
1053
- }
1054
- });
1055
837
  });
838
+ }, {
839
+ deep: true,
840
+ immediate: true
1056
841
  });
1057
842
  ctx.expose({
1058
843
  reset: reset,
1059
844
  scrollTo: scrollTo,
1060
- fixToTop: fixToTop,
1061
- refRoot: refRoot,
1062
- refContent: refContent
845
+ fixToTop: fixToTop
1063
846
  });
1064
847
  return function () {
1065
848
  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;
@@ -1067,15 +850,17 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
1067
850
  // @ts-ignore:next-line
1068
851
  renderAs || 'div', {
1069
852
  ref: refRoot,
1070
- "class": [].concat(_toConsumableArray(wrapperClass.value), [classNames.wrapper]),
853
+ "class": wrapperClass.value,
1071
854
  style: wrapperStyle.value
1072
855
  }, [(_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', {
1073
- ref: refContent,
1074
- "class": [].concat(_toConsumableArray(innerClass.value), [classNames.contentEl]),
856
+ "class": innerClass.value,
1075
857
  style: virtual_render_objectSpread(virtual_render_objectSpread({}, innerContentStyle.value), props.contentStyle)
1076
858
  }, [(_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, {
1077
859
  data: calcList.value
1078
- })) !== 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 : '']);
860
+ })) !== 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', {
861
+ "class": [resolveClassName('virtual-section')],
862
+ style: innerStyle.value
863
+ }), (_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 : '']);
1079
864
  };
1080
865
  }
1081
866
  }));
@@ -1,7 +1,4 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
- export type IScrollbarOption = {
3
- enabled: boolean;
4
- };
5
2
  export declare const virtualRenderProps: {
6
3
  onContentScroll: FunctionConstructor;
7
4
  /** 传入原始数据源 */
@@ -184,10 +181,6 @@ export declare const virtualRenderProps: {
184
181
  } & {
185
182
  default: boolean;
186
183
  };
187
- /**
188
- * 是否允许滚动条改变原有DOM结构
189
- */
190
- scrollbar: import("vue-types").VueTypeDef<IScrollbarOption>;
191
184
  /**
192
185
  * 数据监听改变时,是否自动重置位置到[0, 0]
193
186
  */
@@ -199,14 +192,5 @@ export declare const virtualRenderProps: {
199
192
  wrapperStyle: import("vue-types").VueTypeValidableDef<any> & {
200
193
  default: any;
201
194
  };
202
- /**
203
- * 传入数据如果没有设置rowKey,是否自动生成$index作为唯一ID
204
- * $index的值默认为index
205
- */
206
- autoIndex: import("vue-types").VueTypeValidableDef<boolean> & {
207
- default: boolean;
208
- } & {
209
- default: boolean;
210
- };
211
195
  };
212
196
  export type VirtualRenderProps = Readonly<ExtractPropTypes<typeof virtualRenderProps>>;
@@ -1,3 +1,4 @@
1
+ import { Ref } from 'vue';
1
2
  import { VirtualRenderProps } from './props';
2
3
  type IFixToTopParams = {
3
4
  index?: number;
@@ -7,7 +8,11 @@ type IFixToTopParams = {
7
8
  };
8
9
  position: number[];
9
10
  };
10
- declare const _default: (props: VirtualRenderProps, scrollTo: (x: any, y: any) => void) => {
11
- fixToTop: (params: IFixToTopParams) => any;
11
+ declare const _default: (props: VirtualRenderProps, refRoot: Ref<HTMLElement>) => {
12
+ fixToTop: (params: IFixToTopParams) => void;
13
+ scrollTo: (option?: {
14
+ left: number;
15
+ top: number;
16
+ }) => void;
12
17
  };
13
18
  export default _default;