bkui-vue 1.0.3-beta.9 → 2.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +71 -73
- package/dist/index.esm.js +21328 -19060
- package/dist/index.umd.js +71 -73
- package/dist/locale/en.esm.js +1 -1
- package/dist/locale/en.esm.js.map +1 -1
- package/dist/locale/en.umd.js +1 -1
- package/dist/locale/en.umd.js.map +1 -1
- package/dist/locale/zh-cn.esm.js +1 -1
- package/dist/locale/zh-cn.esm.js.map +1 -1
- package/dist/locale/zh-cn.umd.js +1 -1
- package/dist/locale/zh-cn.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.variable.css +3 -0
- package/lib/alert/alert.variable.css +3 -0
- package/lib/backtop/backtop.variable.css +3 -0
- package/lib/badge/badge.variable.css +3 -0
- package/lib/breadcrumb/breadcrumb.variable.css +3 -0
- package/lib/button/button.variable.css +3 -0
- package/lib/card/card.variable.css +3 -0
- package/lib/cascader/cascader.variable.css +3 -0
- package/lib/checkbox/checkbox.variable.css +3 -0
- package/lib/checkbox/index.js +4 -4
- package/lib/code-diff/code-diff.variable.css +3 -0
- package/lib/collapse/collapse.css +11 -0
- package/lib/collapse/collapse.d.ts +11 -0
- package/lib/collapse/collapse.less +15 -1
- package/lib/collapse/collapse.variable.css +14 -0
- package/lib/collapse/index.d.ts +23 -0
- package/lib/collapse/index.js +9 -1
- package/lib/collapse/props.d.ts +8 -0
- package/lib/collapse-transition/collapse-transition.variable.css +3 -0
- package/lib/color-picker/color-picker.variable.css +3 -0
- package/lib/components.d.ts +2 -0
- package/lib/components.js +3 -1
- package/lib/config-provider/config-provider.d.ts +3 -0
- package/lib/config-provider/config-provider.variable.css +3 -0
- package/lib/config-provider/index.d.ts +4 -0
- package/lib/config-provider/token.d.ts +1 -0
- package/lib/container/container.variable.css +3 -0
- package/lib/date-picker/base/month-table.d.ts +2 -2
- package/lib/date-picker/date-picker.d.ts +1 -0
- package/lib/date-picker/date-picker.variable.css +3 -0
- package/lib/date-picker/index.d.ts +3 -0
- package/lib/date-picker/index.js +70 -32
- package/lib/date-picker/interface.d.ts +1 -1
- package/lib/date-picker/time-picker.d.ts +1 -0
- package/lib/date-picker/utils.d.ts +4 -0
- package/lib/dialog/dialog.css +176 -150
- package/lib/dialog/dialog.d.ts +40 -109
- package/lib/dialog/dialog.less +51 -124
- package/lib/dialog/dialog.variable.css +179 -150
- package/lib/dialog/index.d.ts +99 -263
- package/lib/dialog/index.js +244 -246
- package/lib/dialog/props.d.ts +10 -35
- package/lib/directives/index.js +0 -1
- package/lib/divider/divider.variable.css +3 -0
- package/lib/dropdown/dropdown.css +3 -1
- package/lib/dropdown/dropdown.variable.css +6 -1
- package/lib/exception/exception.variable.css +3 -0
- package/lib/fixed-navbar/fixed-navbar.variable.css +3 -0
- package/lib/form/form.variable.css +3 -0
- package/lib/form/index.js +3 -1
- package/lib/icon/image-fill.js +82 -167
- package/lib/icon/img-error.js +82 -167
- package/lib/icon/img-placehoulder.js +82 -167
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.js +87 -2427
- package/lib/icon/info-line.js +82 -167
- package/lib/icon/info.js +82 -167
- package/lib/icon/left-shape.js +82 -167
- package/lib/icon/left-turn-line.js +82 -167
- package/lib/icon/loading.js +82 -167
- package/lib/icon/narrow-line.js +82 -167
- package/lib/icon/original.js +82 -167
- package/lib/icon/pdf-fill.js +82 -167
- package/lib/icon/play-shape.js +82 -167
- package/lib/icon/plus.js +82 -167
- package/lib/icon/ppt-fill.js +82 -167
- package/lib/icon/qq.js +82 -167
- package/lib/icon/right-shape.js +82 -167
- package/lib/icon/right-turn-line.js +82 -167
- package/lib/icon/search.js +82 -167
- package/lib/icon/share.js +82 -167
- package/lib/icon/spinner.js +82 -167
- package/lib/icon/success.js +82 -167
- package/lib/icon/switcher-loading.js +82 -167
- package/lib/icon/text-all.d.ts +4 -0
- package/lib/icon/text-all.js +191 -0
- package/lib/icon/text-file.js +82 -167
- package/lib/icon/text-fill.js +82 -167
- package/lib/icon/transfer.js +82 -167
- package/lib/icon/tree-application-shape.js +82 -167
- package/lib/icon/unfull-screen.js +82 -167
- package/lib/icon/unvisible.js +82 -167
- package/lib/icon/up-shape.js +82 -167
- package/lib/icon/upload.js +82 -167
- package/lib/icon/video-fill.js +82 -167
- package/lib/icon/warn.js +82 -167
- package/lib/icon/weixin-pro.js +82 -167
- package/lib/icon/weixin.js +82 -167
- package/lib/image/image-viewer.variable.css +3 -0
- package/lib/image/image.variable.css +3 -0
- package/lib/image/index.js +5 -2
- package/lib/info-box/index.d.ts +2 -2
- package/lib/info-box/index.js +257 -516
- package/lib/info-box/info-box.css +58 -28
- package/lib/info-box/info-box.d.ts +18 -16
- package/lib/info-box/info-box.less +82 -51
- package/lib/info-box/info-box.variable.css +61 -28
- package/lib/info-box/render-component.d.ts +4 -0
- package/lib/input/index.js +7 -1
- package/lib/input/input.variable.css +3 -0
- package/lib/link/link.variable.css +3 -0
- package/lib/loading/loading.variable.css +3 -0
- package/lib/locale/index.js +4 -2
- package/lib/locale/lang/en.d.ts +1 -0
- package/lib/menu/menu.variable.css +3 -0
- package/lib/menu/submenu.variable.css +3 -0
- package/lib/message/message.variable.css +3 -0
- package/lib/modal/hooks.d.ts +6 -0
- package/lib/modal/index.d.ts +41 -309
- package/lib/modal/index.js +285 -671
- package/lib/modal/mask.d.ts +6 -0
- package/lib/modal/modal.css +155 -76
- package/lib/modal/modal.d.ts +18 -116
- package/lib/modal/modal.less +107 -55
- package/lib/modal/modal.variable.css +158 -76
- package/lib/modal/props.mixin.d.ts +5 -41
- package/lib/navigation/navigation.variable.css +3 -0
- package/lib/notify/notify.variable.css +3 -0
- package/lib/overflow-title/index.js +46 -52
- package/lib/pagination/index.js +2 -1
- package/lib/pagination/pagination.variable.css +3 -0
- package/lib/plugin-popover/index.d.ts +1 -1
- package/lib/plugin-popover/index.js +45 -26
- package/lib/pop-confirm/index.js +8 -5
- package/lib/pop-confirm/pop-confirm.variable.css +3 -0
- package/lib/popover/content.d.ts +1 -1
- package/lib/popover/index.js +45 -26
- package/lib/popover/plugin-popover.d.ts +4 -1
- package/lib/popover/popover.css +3 -1
- package/lib/popover/popover.less +4 -1
- package/lib/popover/popover.variable.css +6 -1
- package/lib/preset.d.ts +2 -0
- package/lib/process/process.variable.css +3 -0
- package/lib/progress/progress.variable.css +3 -0
- package/lib/radio/index.d.ts +29 -0
- package/lib/radio/index.js +39 -21
- package/lib/radio/radio-button.d.ts +10 -0
- package/lib/radio/radio-group.d.ts +10 -0
- package/lib/radio/radio.d.ts +10 -0
- package/lib/radio/radio.variable.css +3 -0
- package/lib/rate/rate.variable.css +3 -0
- package/lib/rate/star.variable.css +3 -0
- package/lib/resize-layout/index.js +1 -1
- package/lib/resize-layout/resize-layout.variable.css +3 -0
- package/lib/scrollbar/index.d.ts +15 -0
- package/lib/scrollbar/index.js +18763 -0
- package/lib/scrollbar/scrollbar-core/can-use-dom.d.ts +2 -0
- package/lib/scrollbar/scrollbar-core/helpers.d.ts +5 -0
- package/lib/scrollbar/scrollbar-core/index.d.ts +241 -0
- package/lib/scrollbar/scrollbar-core/mouse-wheel.d.ts +5 -0
- package/lib/scrollbar/scrollbar-core/scrollbar-width.d.ts +1 -0
- package/lib/scrollbar/scrollbar.css +75 -0
- package/lib/scrollbar/scrollbar.less +94 -0
- package/lib/scrollbar/scrollbar.variable.css +204 -0
- package/lib/search-select/index.d.ts +375 -16
- package/lib/search-select/index.js +701 -366
- package/lib/search-select/input.d.ts +14 -5
- package/lib/search-select/search-select.css +20 -6
- package/lib/search-select/search-select.d.ts +129 -7
- package/lib/search-select/search-select.less +16 -12
- package/lib/search-select/search-select.variable.css +23 -6
- package/lib/search-select/selected.d.ts +116 -6
- package/lib/search-select/utils.d.ts +19 -6
- package/lib/select/index.d.ts +124 -6
- package/lib/select/index.js +1336 -72
- package/lib/select/option.d.ts +3 -1
- package/lib/select/pinyin/core.d.ts +14 -0
- package/lib/select/pinyin/dict.d.ts +34 -0
- package/lib/select/pinyin/index.d.ts +2 -0
- package/lib/select/select.css +55 -12
- package/lib/select/select.d.ts +50 -2
- package/lib/select/select.less +69 -19
- package/lib/select/select.variable.css +58 -12
- package/lib/select/selectTagInput.d.ts +7 -0
- package/lib/select/type.d.ts +2 -3
- package/lib/shared/index.d.ts +0 -1
- package/lib/shared/index.js +70 -50
- package/lib/shared/utils.d.ts +12 -0
- package/lib/shared/vue-types.d.ts +5 -0
- package/lib/sideslider/index.d.ts +55 -185
- package/lib/sideslider/index.js +81 -55
- package/lib/sideslider/sideslider.css +26 -90
- package/lib/sideslider/sideslider.d.ts +25 -87
- package/lib/sideslider/sideslider.less +56 -132
- package/lib/sideslider/sideslider.variable.css +29 -90
- package/lib/slider/index.d.ts +19 -0
- package/lib/slider/index.js +45 -5
- package/lib/slider/slider.css +14 -0
- package/lib/slider/slider.d.ts +9 -0
- package/lib/slider/slider.less +15 -0
- package/lib/slider/slider.variable.css +17 -0
- package/lib/steps/steps.variable.css +3 -0
- package/lib/styles/mixins/animate.variable.css +3 -0
- package/lib/styles/mixins/popper.variable.css +3 -0
- package/lib/styles/mixins/scroll.variable.css +3 -0
- package/lib/styles/reset.css +1 -3
- package/lib/styles/reset.less +3 -6
- package/lib/styles/reset.variable.css +4 -3
- package/lib/styles/themes/themes.less +5 -0
- package/lib/swiper/swiper.variable.css +3 -0
- package/lib/switcher/switcher.variable.css +3 -0
- package/lib/tab/tab.variable.css +3 -0
- package/lib/table/cache.d.ts +11 -3
- package/lib/table/components/table-cell.d.ts +3 -2
- package/lib/table/components/table-column.d.ts +7 -17
- package/lib/table/const.d.ts +4 -4
- package/lib/table/index.d.ts +29 -64
- package/lib/table/index.js +18068 -613
- package/lib/table/plugins/head-filter.css +8 -4
- package/lib/table/plugins/head-filter.less +6 -3
- package/lib/table/plugins/head-filter.variable.css +11 -4
- package/lib/table/plugins/head-sort.variable.css +3 -0
- package/lib/table/plugins/settings.variable.css +3 -0
- package/lib/table/plugins/use-active-columns.d.ts +2 -2
- package/lib/table/plugins/use-column-template.d.ts +7 -0
- package/lib/table/plugins/use-draggable.d.ts +2 -2
- package/lib/table/plugins/use-fixed-column.d.ts +1 -1
- package/lib/table/plugins/use-observer-resize.d.ts +5 -0
- package/lib/table/plugins/use-pagination.d.ts +3 -1
- package/lib/table/plugins/use-shift-key.d.ts +11 -0
- package/lib/table/props.d.ts +17 -7
- package/lib/table/table.css +112 -58
- package/lib/table/table.d.ts +11 -0
- package/lib/table/table.less +46 -58
- package/lib/table/table.variable.css +115 -58
- package/lib/table/use-attributes.d.ts +6 -43
- package/lib/table/use-column.d.ts +9 -10
- package/lib/table/use-common.d.ts +1 -1
- package/lib/table/use-render.d.ts +1 -1
- package/lib/table/utils.d.ts +1 -1
- package/lib/table-column/index.d.ts +92 -266
- package/lib/table-column/index.js +24 -98
- package/lib/tag/tag.variable.css +3 -0
- package/lib/tag-input/index.d.ts +4 -4
- package/lib/tag-input/tag-input.d.ts +2 -2
- package/lib/tag-input/tag-input.variable.css +3 -0
- package/lib/tag-input/tag-props.d.ts +1 -1
- package/lib/tag-input/tag-render.d.ts +1 -1
- package/lib/time-picker/index.d.ts +38 -35
- package/lib/time-picker/time-picker.variable.css +3 -0
- package/lib/timeline/index.d.ts +80 -44
- package/lib/timeline/index.js +54 -65
- package/lib/timeline/timeline.d.ts +46 -29
- package/lib/timeline/timeline.variable.css +3 -0
- package/lib/transfer/transfer.variable.css +3 -0
- package/lib/tree/constant.d.ts +3 -1
- package/lib/tree/index.d.ts +44 -0
- package/lib/tree/index.js +17548 -25
- package/lib/tree/props.d.ts +18 -0
- package/lib/tree/tree.css +76 -2
- package/lib/tree/tree.d.ts +28 -2
- package/lib/tree/tree.variable.css +79 -2
- package/lib/tree/use-intersection-observer.d.ts +27 -0
- package/lib/tree/use-node-attribute.d.ts +9 -0
- package/lib/upload/index.d.ts +12 -0
- package/lib/upload/index.js +21 -30
- package/lib/upload/props.d.ts +3 -0
- package/lib/upload/upload-trigger.d.ts +6 -0
- package/lib/upload/upload.d.ts +6 -0
- package/lib/upload/upload.variable.css +3 -0
- package/lib/virtual-render/index.d.ts +36 -9
- package/lib/virtual-render/index.js +295 -80
- package/lib/virtual-render/props.d.ts +16 -0
- package/lib/virtual-render/use-fix-top.d.ts +2 -7
- package/lib/virtual-render/use-scrollbar.d.ts +24 -0
- package/lib/virtual-render/v-virtual-render.d.ts +2 -1
- package/lib/virtual-render/virtual-render.css +76 -2
- package/lib/virtual-render/virtual-render.d.ts +16 -3
- package/lib/virtual-render/virtual-render.less +3 -3
- package/lib/virtual-render/virtual-render.variable.css +79 -2
- package/package.json +1 -1
- package/lib/shared/mask.d.ts +0 -11
@@ -3,6 +3,8 @@ 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";
|
6
8
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
7
9
|
/******/ // The require scope
|
8
10
|
/******/ var __webpack_require__ = {};
|
@@ -122,11 +124,15 @@ function _defineProperty(obj, key, value) {
|
|
122
124
|
;// CONCATENATED MODULE: external "vue"
|
123
125
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
124
126
|
var external_vue_y = x => () => x
|
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, ["
|
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 });
|
126
128
|
;// CONCATENATED MODULE: external "../config-provider"
|
127
129
|
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
128
130
|
var config_provider_y = x => () => x
|
129
131
|
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 });
|
130
136
|
;// CONCATENATED MODULE: ../../packages/virtual-render/src/props.ts
|
131
137
|
|
132
138
|
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; }
|
@@ -157,6 +163,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
157
163
|
* IN THE SOFTWARE.
|
158
164
|
*/
|
159
165
|
|
166
|
+
|
160
167
|
var EventProps = {
|
161
168
|
onContentScroll: Function
|
162
169
|
};
|
@@ -241,23 +248,52 @@ var virtualRenderProps = _objectSpread({
|
|
241
248
|
* 保持滚动条位置、当前渲染区间
|
242
249
|
*/
|
243
250
|
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
|
+
}),
|
244
259
|
/**
|
245
260
|
* 数据监听改变时,是否自动重置位置到[0, 0]
|
246
261
|
*/
|
247
262
|
autoReset: shared_namespaceObject.PropTypes.bool.def(true),
|
248
|
-
wrapperStyle: shared_namespaceObject.PropTypes.any.def({})
|
263
|
+
wrapperStyle: shared_namespaceObject.PropTypes.any.def({}),
|
264
|
+
/**
|
265
|
+
* 传入数据如果没有设置rowKey,是否自动生成$index作为唯一ID
|
266
|
+
* $index的值默认为index
|
267
|
+
*/
|
268
|
+
autoIndex: shared_namespaceObject.PropTypes.bool.def(true)
|
249
269
|
}, EventProps);
|
250
270
|
;// CONCATENATED MODULE: ../../packages/virtual-render/src/use-fix-top.tsx
|
251
|
-
/*
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
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) {
|
261
297
|
/**
|
262
298
|
* 指定元素滚动到顶部
|
263
299
|
* @param param0
|
@@ -282,15 +318,106 @@ var virtualRenderProps = _objectSpread({
|
|
282
318
|
if (typeof targetIndex === 'number') {
|
283
319
|
var resolvedIndex = targetIndex >= 0 ? targetIndex : 0;
|
284
320
|
var offsetY = resolvedIndex * props.lineHeight;
|
285
|
-
scrollTo(
|
286
|
-
|
287
|
-
|
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
|
288
400
|
});
|
401
|
+
return;
|
289
402
|
}
|
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();
|
290
414
|
};
|
291
415
|
return {
|
292
|
-
|
293
|
-
|
416
|
+
init: init,
|
417
|
+
instance: instance,
|
418
|
+
scrollTo: scrollTo,
|
419
|
+
classNames: classNames,
|
420
|
+
updateScrollHeight: updateScrollHeight
|
294
421
|
};
|
295
422
|
});
|
296
423
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
@@ -325,6 +452,7 @@ const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTER
|
|
325
452
|
;// CONCATENATED MODULE: ../../packages/virtual-render/src/v-virtual-render.ts
|
326
453
|
|
327
454
|
|
455
|
+
|
328
456
|
/*
|
329
457
|
* Tencent is pleased to support the open source community by making
|
330
458
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -375,14 +503,14 @@ function getMatchedIndex(maxCount, maxHeight, groupItemCount, callback) {
|
|
375
503
|
diffHeight: diffHeight
|
376
504
|
};
|
377
505
|
}
|
378
|
-
function computedVirtualIndex(lineHeight, callback, pagination,
|
379
|
-
if (!event.
|
506
|
+
function computedVirtualIndex(lineHeight, callback, pagination, wrapper, event) {
|
507
|
+
if (!wrapper || !event.offset) {
|
380
508
|
return;
|
381
509
|
}
|
382
|
-
var elScrollTop = event.
|
383
|
-
var elScrollLeft = event.
|
384
|
-
var elScrollHeight =
|
385
|
-
var elOffsetHeight =
|
510
|
+
var elScrollTop = event.offset.y;
|
511
|
+
var elScrollLeft = event.offset.x;
|
512
|
+
var elScrollHeight = wrapper.scrollHeight;
|
513
|
+
var elOffsetHeight = wrapper.offsetHeight;
|
386
514
|
var count = pagination.count,
|
387
515
|
groupItemCount = pagination.groupItemCount;
|
388
516
|
var targetStartIndex = 0;
|
@@ -401,8 +529,9 @@ function computedVirtualIndex(lineHeight, callback, pagination, _el, event) {
|
|
401
529
|
targetEndIndex = endValue.startIndex + targetStartIndex;
|
402
530
|
}
|
403
531
|
var bottom = elScrollHeight - elOffsetHeight - elScrollTop;
|
404
|
-
typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop,
|
405
|
-
bottom: bottom >= 0 ? bottom : 0
|
532
|
+
typeof callback === 'function' && callback(event, targetStartIndex, targetEndIndex, elScrollTop, elScrollTop, elScrollLeft, {
|
533
|
+
bottom: bottom >= 0 ? bottom : 0,
|
534
|
+
scrollbar: event
|
406
535
|
});
|
407
536
|
return {
|
408
537
|
targetStartIndex: targetStartIndex,
|
@@ -414,7 +543,33 @@ function computedVirtualIndex(lineHeight, callback, pagination, _el, event) {
|
|
414
543
|
}
|
415
544
|
var VisibleRender = /*#__PURE__*/function () {
|
416
545
|
function VisibleRender(binding, el) {
|
546
|
+
var _this = this;
|
417
547
|
_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
|
+
});
|
418
573
|
this.binding = binding;
|
419
574
|
this.wrapper = el;
|
420
575
|
var throttleDelay = binding.value.throttleDelay;
|
@@ -431,11 +586,13 @@ var VisibleRender = /*#__PURE__*/function () {
|
|
431
586
|
pagination = _this$binding$value$p === void 0 ? {} : _this$binding$value$p,
|
432
587
|
onlyScroll = _this$binding$value.onlyScroll;
|
433
588
|
if (onlyScroll) {
|
434
|
-
var
|
435
|
-
var
|
436
|
-
var
|
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;
|
437
593
|
handleScrollCallback(e, null, null, elScrollTop, elScrollTop, elScrollLeft, {
|
438
|
-
bottom: bottom >= 0 ? bottom : 0
|
594
|
+
bottom: bottom >= 0 ? bottom : 0,
|
595
|
+
scrollbar: e
|
439
596
|
});
|
440
597
|
return;
|
441
598
|
}
|
@@ -457,7 +614,7 @@ var VisibleRender = /*#__PURE__*/function () {
|
|
457
614
|
}, {
|
458
615
|
key: "executeThrottledRender",
|
459
616
|
value: function executeThrottledRender(e) {
|
460
|
-
(0,throttle_namespaceObject["default"])(this.render.bind(this), this.delay)(e);
|
617
|
+
(0,throttle_namespaceObject["default"])(this.render.bind(this), this.delay)(this.getEvent(e));
|
461
618
|
}
|
462
619
|
}, {
|
463
620
|
key: "install",
|
@@ -532,28 +689,47 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
532
689
|
|
533
690
|
|
534
691
|
|
692
|
+
|
535
693
|
/* harmony default export */ const use_tag_render = (function (props, ctx) {
|
536
694
|
var renderAs = props.renderAs,
|
537
695
|
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
|
+
});
|
538
709
|
/** 指令触发Scroll事件,计算当前startIndex & endIndex & scrollTop & translateY */
|
539
710
|
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
|
+
}
|
540
716
|
ctx.emit('content-scroll', [event, {
|
541
717
|
translateY: translateY,
|
542
718
|
translateX: scrollLeft,
|
543
719
|
pos: pos
|
544
720
|
}]);
|
545
721
|
};
|
546
|
-
var
|
722
|
+
var renderInstance = null;
|
547
723
|
var binding = (0,external_vue_namespaceObject.computed)(function () {
|
548
724
|
return {
|
549
725
|
lineHeight: props.lineHeight,
|
726
|
+
scrollbar: props.scrollbar,
|
550
727
|
handleScrollCallback: handleScrollCallback,
|
551
728
|
pagination: {},
|
552
729
|
throttleDelay: props.throttleDelay,
|
553
730
|
onlyScroll: props.scrollEvent
|
554
731
|
};
|
555
732
|
});
|
556
|
-
var refRoot = (0,external_vue_namespaceObject.ref)(null);
|
557
733
|
/** 虚拟渲染外层容器样式 */
|
558
734
|
var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
|
559
735
|
var _props$maxHeight;
|
@@ -565,20 +741,38 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
565
741
|
maxHeight: (_props$maxHeight = props.maxHeight) !== null && _props$maxHeight !== void 0 ? _props$maxHeight : height
|
566
742
|
}, props.wrapperStyle);
|
567
743
|
});
|
568
|
-
var _useFixTop = use_fix_top(props,
|
569
|
-
scrollTo = _useFixTop.scrollTo,
|
744
|
+
var _useFixTop = use_fix_top(props, scrollTo),
|
570
745
|
fixToTop = _useFixTop.fixToTop;
|
571
746
|
ctx.expose({
|
572
747
|
scrollTo: scrollTo,
|
573
|
-
fixToTop: fixToTop
|
748
|
+
fixToTop: fixToTop,
|
749
|
+
refRoot: refRoot,
|
750
|
+
refContent: refContent
|
574
751
|
});
|
575
752
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
576
|
-
|
577
|
-
|
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();
|
578
760
|
});
|
579
761
|
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
580
|
-
var
|
581
|
-
(
|
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];
|
582
776
|
});
|
583
777
|
return {
|
584
778
|
rendAsTag: function rendAsTag() {
|
@@ -586,12 +780,13 @@ function use_tag_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
586
780
|
return (0,external_vue_namespaceObject.h)(
|
587
781
|
// @ts-ignore:next-line
|
588
782
|
renderAs, {
|
589
|
-
"class":
|
783
|
+
"class": wrapperClassNames.value,
|
590
784
|
style: wrapperStyle.value,
|
591
785
|
ref: refRoot
|
592
786
|
}, [(_ctx$slots$beforeCont = (_ctx$slots$beforeCont2 = (_ctx$slots = ctx.slots).beforeContent) === null || _ctx$slots$beforeCont2 === void 0 ? void 0 : _ctx$slots$beforeCont2.call(_ctx$slots)) !== null && _ctx$slots$beforeCont !== void 0 ? _ctx$slots$beforeCont : '', (0,external_vue_namespaceObject.h)(contentAs, {
|
593
|
-
"class":
|
594
|
-
style:
|
787
|
+
"class": contentClassNames.value,
|
788
|
+
style: computedStyle.value,
|
789
|
+
ref: refContent
|
595
790
|
}, [(_ctx$slots$default = (_ctx$slots$default2 = (_ctx$slots2 = ctx.slots)["default"]) === null || _ctx$slots$default2 === void 0 ? void 0 : _ctx$slots$default2.call(_ctx$slots2, {
|
596
791
|
data: props.list
|
597
792
|
})) !== null && _ctx$slots$default !== void 0 ? _ctx$slots$default : '']), (_ctx$slots$afterConte = (_ctx$slots$afterConte2 = (_ctx$slots3 = ctx.slots).afterContent) === null || _ctx$slots$afterConte2 === void 0 ? void 0 : _ctx$slots$afterConte2.call(_ctx$slots3)) !== null && _ctx$slots$afterConte !== void 0 ? _ctx$slots$afterConte : '', (_ctx$slots$afterSecti = (_ctx$slots$afterSecti2 = (_ctx$slots4 = ctx.slots).afterSection) === null || _ctx$slots$afterSecti2 === void 0 ? void 0 : _ctx$slots$afterSecti2.call(_ctx$slots4)) !== null && _ctx$slots$afterSecti !== void 0 ? _ctx$slots$afterSecti : '']);
|
@@ -640,6 +835,7 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
640
835
|
|
641
836
|
|
642
837
|
|
838
|
+
|
643
839
|
/* harmony default export */ const virtual_render = ((0,external_vue_namespaceObject.defineComponent)({
|
644
840
|
name: 'VirtualRender',
|
645
841
|
directives: {
|
@@ -671,10 +867,17 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
671
867
|
lineHeight: props.lineHeight,
|
672
868
|
handleScrollCallback: handleScrollCallback,
|
673
869
|
pagination: pagination,
|
674
|
-
throttleDelay: props.throttleDelay
|
870
|
+
throttleDelay: props.throttleDelay,
|
871
|
+
scrollbar: props.scrollbar
|
675
872
|
};
|
676
873
|
});
|
677
874
|
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;
|
678
881
|
var instance = null;
|
679
882
|
var pagination = (0,external_vue_namespaceObject.reactive)({
|
680
883
|
startIndex: 0,
|
@@ -704,20 +907,31 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
704
907
|
var end = (pagination.endIndex + props.preloadItemCount) * props.groupItemCount;
|
705
908
|
var total = localList.value.length;
|
706
909
|
if (total < end) {
|
707
|
-
var contentLength = end - start;
|
708
910
|
calcList.value = localList.value.slice(start, total);
|
709
|
-
end = total
|
710
|
-
start = end -
|
911
|
+
end = total;
|
912
|
+
start = end - Math.floor(refContent.value.offsetHeight / props.lineHeight);
|
711
913
|
start = start < 0 ? 0 : start;
|
712
914
|
}
|
713
|
-
var value = localList.value.slice(start, end
|
915
|
+
var value = localList.value.slice(start, end);
|
714
916
|
calcList.value = value;
|
715
917
|
if (event) {
|
716
|
-
ctx.emit('content-scroll', [event, pagination]);
|
918
|
+
ctx.emit('content-scroll', [event, pagination, value]);
|
717
919
|
}
|
718
920
|
};
|
719
921
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
922
|
+
var _props$scrollbar;
|
720
923
|
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
|
+
}
|
721
935
|
instance.install();
|
722
936
|
});
|
723
937
|
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
@@ -770,7 +984,7 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
770
984
|
};
|
771
985
|
/** 映射传入的数组为新的数组,增加 $index属性,用来处理唯一Index */
|
772
986
|
var localList = (0,external_vue_namespaceObject.computed)(function () {
|
773
|
-
if (props.rowKey !== undefined) {
|
987
|
+
if (props.rowKey !== undefined || !props.autoIndex) {
|
774
988
|
return props.list;
|
775
989
|
}
|
776
990
|
return (props.list || []).map(function (item, index) {
|
@@ -781,35 +995,27 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
781
995
|
});
|
782
996
|
/** 展示列表内容区域样式 */
|
783
997
|
var innerContentStyle = (0,external_vue_namespaceObject.computed)(function () {
|
784
|
-
return props.scrollPosition === 'content' ? {
|
785
|
-
top: "".concat(pagination.scrollTop + props.scrollOffsetTop, "px"),
|
786
|
-
transform: "translateY(-".concat(pagination.translateY, "px)")
|
787
|
-
} : {};
|
998
|
+
return props.scrollPosition === 'content' ? {} : {};
|
788
999
|
});
|
789
1000
|
/** 虚拟渲染外层容器样式 */
|
790
1001
|
var wrapperStyle = (0,external_vue_namespaceObject.computed)(function () {
|
791
|
-
var _props$maxHeight;
|
792
1002
|
var height = typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
|
793
1003
|
return virtual_render_objectSpread(virtual_render_objectSpread({
|
794
1004
|
height: height,
|
795
1005
|
width: typeof props.width === 'number' ? "".concat(props.width, "px") : props.width,
|
796
1006
|
display: 'inline-block',
|
797
|
-
maxHeight:
|
1007
|
+
maxHeight: props.maxHeight ? "".concat(props.maxHeight, "px") : false,
|
1008
|
+
minHeight: props.minHeight ? "".concat(props.minHeight, "px") : false
|
798
1009
|
}, props.scrollPosition === 'container' ? innerContentStyle.value : {}), props.wrapperStyle);
|
799
1010
|
});
|
800
|
-
|
801
|
-
|
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
|
-
};
|
1011
|
+
var contentHeight = (0,external_vue_namespaceObject.computed)(function () {
|
1012
|
+
return innerHeight.value < props.minHeight ? props.minHeight : innerHeight.value;
|
807
1013
|
});
|
808
1014
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
809
1015
|
resolveClassName = _usePrefix.resolveClassName;
|
810
1016
|
/** 外层样式列表 */
|
811
1017
|
var wrapperClass = (0,external_vue_namespaceObject.computed)(function () {
|
812
|
-
return [resolveClassName('virtual-render')
|
1018
|
+
return [resolveClassName('virtual-render')].concat(_toConsumableArray(resolvePropClassName(props.className)), [props.scrollPosition === 'container' ? resolveClassName('virtual-content') : '']);
|
813
1019
|
});
|
814
1020
|
/** 内容区域样式列表 */
|
815
1021
|
var innerClass = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -820,29 +1026,40 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
820
1026
|
* @param keepLastPostion
|
821
1027
|
*/
|
822
1028
|
var reset = function reset() {
|
1029
|
+
var _instance2;
|
823
1030
|
handleChangeListConfig();
|
824
1031
|
afterListDataReset();
|
1032
|
+
(_instance2 = instance) === null || _instance2 === void 0 || _instance2.executeThrottledRender.call(instance, {
|
1033
|
+
offset: {
|
1034
|
+
x: 0,
|
1035
|
+
y: 0
|
1036
|
+
}
|
1037
|
+
});
|
825
1038
|
};
|
826
|
-
var _useFixTop = use_fix_top(props,
|
827
|
-
scrollTo = _useFixTop.scrollTo,
|
1039
|
+
var _useFixTop = use_fix_top(props, scrollTo),
|
828
1040
|
fixToTop = _useFixTop.fixToTop;
|
829
|
-
(0,external_vue_namespaceObject.
|
830
|
-
|
831
|
-
|
832
|
-
var _instance2;
|
833
|
-
(_instance2 = instance) === null || _instance2 === void 0 || _instance2.setBinding(binding);
|
1041
|
+
(0,external_vue_namespaceObject.watchEffect)(function () {
|
1042
|
+
var _instance3;
|
1043
|
+
(_instance3 = instance) === null || _instance3 === void 0 || _instance3.setBinding(binding);
|
834
1044
|
handleChangeListConfig();
|
1045
|
+
updateScrollHeight(contentHeight.value);
|
835
1046
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
1047
|
+
var _instance4;
|
836
1048
|
afterListDataReset();
|
1049
|
+
(_instance4 = instance) === null || _instance4 === void 0 || _instance4.executeThrottledRender.call(instance, {
|
1050
|
+
offset: {
|
1051
|
+
x: pagination.scrollLeft,
|
1052
|
+
y: pagination.scrollTop
|
1053
|
+
}
|
1054
|
+
});
|
837
1055
|
});
|
838
|
-
}, {
|
839
|
-
deep: true,
|
840
|
-
immediate: true
|
841
1056
|
});
|
842
1057
|
ctx.expose({
|
843
1058
|
reset: reset,
|
844
1059
|
scrollTo: scrollTo,
|
845
|
-
fixToTop: fixToTop
|
1060
|
+
fixToTop: fixToTop,
|
1061
|
+
refRoot: refRoot,
|
1062
|
+
refContent: refContent
|
846
1063
|
});
|
847
1064
|
return function () {
|
848
1065
|
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;
|
@@ -850,17 +1067,15 @@ function virtual_render_objectSpread(e) { for (var r = 1; r < arguments.length;
|
|
850
1067
|
// @ts-ignore:next-line
|
851
1068
|
renderAs || 'div', {
|
852
1069
|
ref: refRoot,
|
853
|
-
"class": wrapperClass.value,
|
1070
|
+
"class": [].concat(_toConsumableArray(wrapperClass.value), [classNames.wrapper]),
|
854
1071
|
style: wrapperStyle.value
|
855
1072
|
}, [(_ctx$slots$beforeCont = (_ctx$slots$beforeCont2 = (_ctx$slots = ctx.slots).beforeContent) === null || _ctx$slots$beforeCont2 === void 0 ? void 0 : _ctx$slots$beforeCont2.call(_ctx$slots)) !== null && _ctx$slots$beforeCont !== void 0 ? _ctx$slots$beforeCont : '', (0,external_vue_namespaceObject.h)(contentAs || 'div', {
|
856
|
-
|
1073
|
+
ref: refContent,
|
1074
|
+
"class": [].concat(_toConsumableArray(innerClass.value), [classNames.contentEl]),
|
857
1075
|
style: virtual_render_objectSpread(virtual_render_objectSpread({}, innerContentStyle.value), props.contentStyle)
|
858
1076
|
}, [(_ctx$slots$default = (_ctx$slots$default2 = (_ctx$slots2 = ctx.slots)["default"]) === null || _ctx$slots$default2 === void 0 ? void 0 : _ctx$slots$default2.call(_ctx$slots2, {
|
859
1077
|
data: calcList.value
|
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
|
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 : '']);
|
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 : '']);
|
864
1079
|
};
|
865
1080
|
}
|
866
1081
|
}));
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
2
|
+
export type IScrollbarOption = {
|
3
|
+
enabled: boolean;
|
4
|
+
};
|
2
5
|
export declare const virtualRenderProps: {
|
3
6
|
onContentScroll: FunctionConstructor;
|
4
7
|
/** 传入原始数据源 */
|
@@ -181,6 +184,10 @@ export declare const virtualRenderProps: {
|
|
181
184
|
} & {
|
182
185
|
default: boolean;
|
183
186
|
};
|
187
|
+
/**
|
188
|
+
* 是否允许滚动条改变原有DOM结构
|
189
|
+
*/
|
190
|
+
scrollbar: import("vue-types").VueTypeDef<IScrollbarOption>;
|
184
191
|
/**
|
185
192
|
* 数据监听改变时,是否自动重置位置到[0, 0]
|
186
193
|
*/
|
@@ -192,5 +199,14 @@ export declare const virtualRenderProps: {
|
|
192
199
|
wrapperStyle: import("vue-types").VueTypeValidableDef<any> & {
|
193
200
|
default: any;
|
194
201
|
};
|
202
|
+
/**
|
203
|
+
* 传入数据如果没有设置rowKey,是否自动生成$index作为唯一ID
|
204
|
+
* $index的值默认为index
|
205
|
+
*/
|
206
|
+
autoIndex: import("vue-types").VueTypeValidableDef<boolean> & {
|
207
|
+
default: boolean;
|
208
|
+
} & {
|
209
|
+
default: boolean;
|
210
|
+
};
|
195
211
|
};
|
196
212
|
export type VirtualRenderProps = Readonly<ExtractPropTypes<typeof virtualRenderProps>>;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { Ref } from 'vue';
|
2
1
|
import { VirtualRenderProps } from './props';
|
3
2
|
type IFixToTopParams = {
|
4
3
|
index?: number;
|
@@ -8,11 +7,7 @@ type IFixToTopParams = {
|
|
8
7
|
};
|
9
8
|
position: number[];
|
10
9
|
};
|
11
|
-
declare const _default: (props: VirtualRenderProps,
|
12
|
-
fixToTop: (params: IFixToTopParams) =>
|
13
|
-
scrollTo: (option?: {
|
14
|
-
left: number;
|
15
|
-
top: number;
|
16
|
-
}) => void;
|
10
|
+
declare const _default: (props: VirtualRenderProps, scrollTo: (x: any, y: any) => void) => {
|
11
|
+
fixToTop: (params: IFixToTopParams) => any;
|
17
12
|
};
|
18
13
|
export default _default;
|