bkui-vue 1.0.3-beta.64 → 1.0.3-beta.65.dialog.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.
- package/dist/index.cjs.js +69 -69
- package/dist/index.esm.js +20112 -19285
- package/dist/index.umd.js +69 -69
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/checkbox/index.js +4 -4
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/dialog/dialog.css +139 -77
- package/lib/dialog/dialog.d.ts +41 -121
- package/lib/dialog/dialog.less +10 -65
- package/lib/dialog/dialog.variable.css +139 -77
- package/lib/dialog/index.d.ts +105 -272
- package/lib/dialog/index.js +91 -100
- package/lib/dialog/props.d.ts +8 -48
- package/lib/info-box/index.d.ts +2 -2
- package/lib/info-box/index.js +312 -173
- package/lib/info-box/info-box.css +63 -7
- package/lib/info-box/info-box.d.ts +17 -16
- package/lib/info-box/info-box.less +76 -14
- package/lib/info-box/info-box.variable.css +63 -7
- package/lib/info-box/render-component.d.ts +4 -0
- package/lib/modal/index.d.ts +45 -325
- package/lib/modal/index.js +187 -666
- package/lib/modal/mask.d.ts +6 -0
- package/lib/modal/modal.css +131 -31
- package/lib/modal/modal.d.ts +16 -126
- package/lib/modal/modal.less +84 -28
- package/lib/modal/modal.variable.css +131 -31
- package/lib/modal/props.mixin.d.ts +2 -53
- package/lib/radio/index.js +5 -5
- package/lib/scrollbar/index.d.ts +14 -0
- package/lib/scrollbar/index.js +18740 -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 +236 -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 +74 -0
- package/lib/scrollbar/scrollbar.less +93 -0
- package/lib/scrollbar/scrollbar.variable.css +203 -0
- package/lib/select/index.d.ts +0 -33
- package/lib/select/index.js +2 -5
- package/lib/select/select.css +5 -19
- package/lib/select/select.d.ts +0 -11
- package/lib/select/select.less +6 -26
- package/lib/select/select.variable.css +5 -19
- package/lib/select/selectTagInput.d.ts +0 -7
- package/lib/shared/index.d.ts +0 -1
- package/lib/shared/index.js +1 -48
- package/lib/sideslider/index.d.ts +31 -222
- package/lib/sideslider/index.js +49 -36
- package/lib/sideslider/sideslider.css +4 -42
- package/lib/sideslider/sideslider.d.ts +14 -105
- package/lib/sideslider/sideslider.less +13 -58
- package/lib/sideslider/sideslider.variable.css +4 -42
- package/lib/table/const.d.ts +1 -1
- package/lib/table/index.d.ts +23 -0
- package/lib/table/index.js +184 -47
- package/lib/table/plugins/use-fixed-column.d.ts +1 -1
- 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 +8 -0
- package/lib/table/table.css +97 -42
- package/lib/table/table.d.ts +11 -0
- package/lib/table/table.less +43 -58
- package/lib/table/table.variable.css +97 -42
- package/lib/table/use-attributes.d.ts +1 -0
- package/lib/table/use-render.d.ts +1 -1
- package/lib/table-column/index.js +6 -2
- package/lib/tree/index.d.ts +23 -0
- package/lib/tree/index.js +9 -3
- package/lib/tree/props.d.ts +8 -0
- package/lib/tree/tree.css +75 -2
- package/lib/tree/tree.d.ts +11 -0
- package/lib/tree/tree.variable.css +75 -2
- package/lib/virtual-render/index.d.ts +27 -0
- package/lib/virtual-render/index.js +264 -63
- 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 +23 -0
- package/lib/virtual-render/v-virtual-render.d.ts +2 -1
- package/lib/virtual-render/virtual-render.css +75 -2
- package/lib/virtual-render/virtual-render.d.ts +13 -0
- package/lib/virtual-render/virtual-render.less +3 -3
- package/lib/virtual-render/virtual-render.variable.css +75 -2
- package/package.json +1 -1
- package/lib/shared/mask.d.ts +0 -11
package/lib/table/index.js
CHANGED
@@ -122,7 +122,7 @@ function defineProperty_defineProperty(obj, key, value) {
|
|
122
122
|
;// CONCATENATED MODULE: external "vue"
|
123
123
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
124
124
|
var external_vue_y = x => () => x
|
125
|
-
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
|
125
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["isProxy"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isProxy, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRaw, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["unref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.unref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect });
|
126
126
|
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
|
127
127
|
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
128
128
|
/* harmony default export */ const esm_browser_native = ({
|
@@ -295,7 +295,7 @@ var COLUMN_ATTRIBUTE = {
|
|
295
295
|
/**
|
296
296
|
* Y 轴滚动条宽度
|
297
297
|
*/
|
298
|
-
var SCROLLY_WIDTH =
|
298
|
+
var SCROLLY_WIDTH = 0;
|
299
299
|
/**
|
300
300
|
* 默认行高
|
301
301
|
*/
|
@@ -723,7 +723,11 @@ var tableProps = {
|
|
723
723
|
/**
|
724
724
|
* 是否支持行拖拽排序
|
725
725
|
*/
|
726
|
-
rowDraggable: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.func, shared_namespaceObject.PropTypes.bool, shared_namespaceObject.PropTypes.object]).def(false)
|
726
|
+
rowDraggable: shared_namespaceObject.PropTypes.oneOfType([shared_namespaceObject.PropTypes.func, shared_namespaceObject.PropTypes.bool, shared_namespaceObject.PropTypes.object]).def(false),
|
727
|
+
/**
|
728
|
+
* 是否支持shift键多行选择
|
729
|
+
*/
|
730
|
+
shiftMultiChecked: shared_namespaceObject.PropTypes.bool.def(false)
|
727
731
|
};
|
728
732
|
;// CONCATENATED MODULE: ../../packages/table/src/components/table-column.tsx
|
729
733
|
|
@@ -1496,7 +1500,6 @@ function _toConsumableArray(arr) {
|
|
1496
1500
|
*/
|
1497
1501
|
|
1498
1502
|
|
1499
|
-
|
1500
1503
|
/**
|
1501
1504
|
* 固定列Hooks
|
1502
1505
|
*/
|
@@ -1583,13 +1586,12 @@ function _toConsumableArray(arr) {
|
|
1583
1586
|
* @returns
|
1584
1587
|
*/
|
1585
1588
|
var resolveFixedColumnStyle = function resolveFixedColumnStyle(column) {
|
1586
|
-
var hasScrollY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1587
1589
|
if (!column.fixed || isHiddenColumn(column)) {
|
1588
1590
|
return {};
|
1589
1591
|
}
|
1590
1592
|
var fixedOffset = {
|
1591
1593
|
left: 0,
|
1592
|
-
right:
|
1594
|
+
right: -1
|
1593
1595
|
};
|
1594
1596
|
var fixedPos = resolveFixColPos(column);
|
1595
1597
|
fixedOffset[fixedPos] = getPreColumnOffset(fixedPos, column, fixedOffset[fixedPos]);
|
@@ -3199,6 +3201,7 @@ const loading_less_namespaceObject = loading_less_x({ });
|
|
3199
3201
|
return refScrollLoading.value !== null && (typeof refScrollLoading.value === 'boolean' && refScrollLoading.value || typeof_typeof(refScrollLoading.value) === 'object');
|
3200
3202
|
});
|
3201
3203
|
var renderScrollLoading = function renderScrollLoading() {
|
3204
|
+
var _ctx$slots$fixedBotto3, _ctx$slots$fixedBotto4, _ctx$slots2;
|
3202
3205
|
if (isRender.value) {
|
3203
3206
|
var _ctx$slots$fixedBotto, _ctx$slots$fixedBotto2, _ctx$slots;
|
3204
3207
|
var _getLoadingOption = getLoadingOption(),
|
@@ -3217,6 +3220,7 @@ const loading_less_namespaceObject = loading_less_x({ });
|
|
3217
3220
|
indicator: indicator
|
3218
3221
|
}, null);
|
3219
3222
|
}
|
3223
|
+
return (_ctx$slots$fixedBotto3 = (_ctx$slots$fixedBotto4 = (_ctx$slots2 = ctx.slots).fixedBottom) === null || _ctx$slots$fixedBotto4 === void 0 ? void 0 : _ctx$slots$fixedBotto4.call(_ctx$slots2)) !== null && _ctx$slots$fixedBotto3 !== void 0 ? _ctx$slots$fixedBotto3 : null;
|
3220
3224
|
};
|
3221
3225
|
return {
|
3222
3226
|
renderScrollLoading: renderScrollLoading
|
@@ -3304,9 +3308,9 @@ var resolvePaginationOption = function resolvePaginationOption(propPagination, d
|
|
3304
3308
|
if (!props.pagination) {
|
3305
3309
|
return;
|
3306
3310
|
}
|
3307
|
-
localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread(
|
3311
|
+
localPagination.value = props.remotePagination ? pagination : use_pagination_objectSpread({
|
3308
3312
|
count: indexData.length
|
3309
|
-
});
|
3313
|
+
}, pagination);
|
3310
3314
|
};
|
3311
3315
|
/**
|
3312
3316
|
* 重置当前分页开始位置 & 结束位置
|
@@ -3371,35 +3375,35 @@ var resolvePaginationOption = function resolvePaginationOption(propPagination, d
|
|
3371
3375
|
}
|
3372
3376
|
pageData.length = 0;
|
3373
3377
|
pageData.push.apply(pageData, _toConsumableArray(sourceData.slice(startIndex.value, endIndex.value)));
|
3374
|
-
|
3378
|
+
if (Array.isArray(filterFn)) {
|
3379
|
+
multiFilter(filterFn, pageData);
|
3380
|
+
} else {
|
3381
|
+
filter(pageData, filterFn);
|
3382
|
+
}
|
3375
3383
|
sort(pageData, sortFn, column, type, sortScope);
|
3376
3384
|
resolveLocalPagination();
|
3377
3385
|
};
|
3378
3386
|
var resolvePageDataBySortList = function resolvePageDataBySortList(multiCol) {
|
3379
3387
|
resolvePageData(null, null, null, null, null, multiCol);
|
3380
3388
|
};
|
3381
|
-
var
|
3382
|
-
|
3389
|
+
var getCurrentPageData = function getCurrentPageData() {
|
3390
|
+
return indexData.slice(startIndex.value, endIndex.value);
|
3391
|
+
};
|
3392
|
+
var multiFilter = function multiFilter(filterFnList, origin) {
|
3393
|
+
var sourceData = (origin !== null && origin !== void 0 ? origin : indexData).slice();
|
3383
3394
|
var target = filterFnList.reduce(function (result, fn) {
|
3384
3395
|
return filter(result, fn);
|
3385
3396
|
}, sourceData);
|
3386
3397
|
pageData.length = 0;
|
3387
3398
|
pageData.push.apply(pageData, _toConsumableArray(getRawData(target)));
|
3388
3399
|
};
|
3389
|
-
var handlePaginationChange = function handlePaginationChange() {
|
3400
|
+
var handlePaginationChange = function handlePaginationChange(filterFn, sortFn) {
|
3390
3401
|
pagination = resolvePaginationOption(props.pagination, pagination);
|
3391
3402
|
resolveLocalPagination();
|
3392
3403
|
resetStartEndIndex();
|
3393
|
-
resolvePageData();
|
3404
|
+
resolvePageData(filterFn, sortFn);
|
3394
3405
|
};
|
3395
3406
|
handlePaginationChange();
|
3396
|
-
(0,external_vue_namespaceObject.watch)(function () {
|
3397
|
-
return [props.pagination];
|
3398
|
-
}, function () {
|
3399
|
-
handlePaginationChange();
|
3400
|
-
}, {
|
3401
|
-
deep: true
|
3402
|
-
});
|
3403
3407
|
return {
|
3404
3408
|
pageData: pageData,
|
3405
3409
|
indexData: indexData,
|
@@ -3407,7 +3411,9 @@ var resolvePaginationOption = function resolvePaginationOption(propPagination, d
|
|
3407
3411
|
resolvePageData: resolvePageData,
|
3408
3412
|
resolveIndexData: resolveIndexData,
|
3409
3413
|
resolvePageDataBySortList: resolvePageDataBySortList,
|
3414
|
+
handlePaginationChange: handlePaginationChange,
|
3410
3415
|
resetStartEndIndex: resetStartEndIndex,
|
3416
|
+
getCurrentPageData: getCurrentPageData,
|
3411
3417
|
multiFilter: multiFilter,
|
3412
3418
|
sort: sort
|
3413
3419
|
};
|
@@ -3486,6 +3492,8 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
3486
3492
|
localPagination = _usePagination.localPagination,
|
3487
3493
|
resolvePageData = _usePagination.resolvePageData,
|
3488
3494
|
resolvePageDataBySortList = _usePagination.resolvePageDataBySortList,
|
3495
|
+
handlePaginationChange = _usePagination.handlePaginationChange,
|
3496
|
+
getCurrentPageData = _usePagination.getCurrentPageData,
|
3489
3497
|
multiFilter = _usePagination.multiFilter,
|
3490
3498
|
sort = _usePagination.sort,
|
3491
3499
|
resetStartEndIndex = _usePagination.resetStartEndIndex,
|
@@ -3608,13 +3616,15 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
3608
3616
|
var getColumnFilterFn = function getColumnFilterFn(col) {
|
3609
3617
|
return getColumnAttribute(col, COLUMN_ATTRIBUTE.COL_FILTER_FN);
|
3610
3618
|
};
|
3611
|
-
var
|
3612
|
-
|
3619
|
+
var getFilterFnList = function getFilterFnList() {
|
3620
|
+
return formatData.columns.filter(function (col) {
|
3613
3621
|
return !isHiddenColumn(col) && typeof getColumnFilterFn(col) === 'function';
|
3614
3622
|
}).map(function (col) {
|
3615
3623
|
return getColumnFilterFn(col);
|
3616
3624
|
});
|
3617
|
-
|
3625
|
+
};
|
3626
|
+
var filter = function filter() {
|
3627
|
+
multiFilter(getFilterFnList(), getCurrentPageData());
|
3618
3628
|
};
|
3619
3629
|
/**
|
3620
3630
|
* 按照指定列排序
|
@@ -4075,6 +4085,13 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
4075
4085
|
var setIndexData = function setIndexData() {
|
4076
4086
|
return resolveIndexData();
|
4077
4087
|
};
|
4088
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
4089
|
+
return [props.pagination];
|
4090
|
+
}, function () {
|
4091
|
+
handlePaginationChange(getFilterFnList());
|
4092
|
+
}, {
|
4093
|
+
deep: true
|
4094
|
+
});
|
4078
4095
|
return {
|
4079
4096
|
formatColumns: formatColumns,
|
4080
4097
|
formatDataSchema: formatDataSchema,
|
@@ -4112,7 +4129,8 @@ var tableSchemaResponse = function tableSchemaResponse(props) {
|
|
4112
4129
|
pageData: pageData,
|
4113
4130
|
localPagination: localPagination,
|
4114
4131
|
formatData: formatData,
|
4115
|
-
setIndexData: setIndexData
|
4132
|
+
setIndexData: setIndexData,
|
4133
|
+
getFilterFnList: getFilterFnList
|
4116
4134
|
};
|
4117
4135
|
};
|
4118
4136
|
/* harmony default export */ const use_attributes = (tableSchemaResponse);
|
@@ -5604,10 +5622,10 @@ function head_filter_isSlot(s) {
|
|
5604
5622
|
if (scope.data.length) {
|
5605
5623
|
return scope.data.map(function (item) {
|
5606
5624
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
5607
|
-
"class": "list-item"
|
5625
|
+
"class": "list-item",
|
5626
|
+
"key": item.value
|
5608
5627
|
}, [(0,external_vue_namespaceObject.createVNode)(checkbox_namespaceObject["default"], {
|
5609
5628
|
"label": item.value,
|
5610
|
-
"key": item.$index,
|
5611
5629
|
"immediateEmitChange": false,
|
5612
5630
|
"checked": state.checked.includes(item.value),
|
5613
5631
|
"modelValue": state.checked.includes(item.value),
|
@@ -6112,6 +6130,88 @@ function use_head_cell_isSlot(s) {
|
|
6112
6130
|
getTH: getTH
|
6113
6131
|
};
|
6114
6132
|
});
|
6133
|
+
;// CONCATENATED MODULE: ../../packages/table/src/plugins/use-shift-key.tsx
|
6134
|
+
/*
|
6135
|
+
* Tencent is pleased to support the open source community by making
|
6136
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
6137
|
+
*
|
6138
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
6139
|
+
*
|
6140
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
6141
|
+
*
|
6142
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
6143
|
+
*
|
6144
|
+
* ---------------------------------------------------
|
6145
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
6146
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
6147
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
6148
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6149
|
+
*
|
6150
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
6151
|
+
* the Software.
|
6152
|
+
*
|
6153
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
6154
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
6155
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
6156
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
6157
|
+
* IN THE SOFTWARE.
|
6158
|
+
*/
|
6159
|
+
|
6160
|
+
/* harmony default export */ const use_shift_key = (function (props) {
|
6161
|
+
var isShiftKeyDown = (0,external_vue_namespaceObject.ref)(false);
|
6162
|
+
var store = {
|
6163
|
+
start: null,
|
6164
|
+
end: null
|
6165
|
+
};
|
6166
|
+
var handleKeyDown = function handleKeyDown(e) {
|
6167
|
+
if (e.key === 'Shift') {
|
6168
|
+
isShiftKeyDown.value = true;
|
6169
|
+
}
|
6170
|
+
};
|
6171
|
+
var handleKeyUp = function handleKeyUp(e) {
|
6172
|
+
if (e.key === 'Shift') {
|
6173
|
+
isShiftKeyDown.value = false;
|
6174
|
+
clearStore();
|
6175
|
+
}
|
6176
|
+
};
|
6177
|
+
var setStore = function setStore(row, index) {
|
6178
|
+
if (store.start === null && store.end === null) {
|
6179
|
+
store.start = {
|
6180
|
+
index: index,
|
6181
|
+
row: row
|
6182
|
+
};
|
6183
|
+
return false;
|
6184
|
+
}
|
6185
|
+
store.end = {
|
6186
|
+
index: index,
|
6187
|
+
row: row
|
6188
|
+
};
|
6189
|
+
return true;
|
6190
|
+
};
|
6191
|
+
var clearStore = function clearStore() {
|
6192
|
+
store.start = null;
|
6193
|
+
store.end = null;
|
6194
|
+
};
|
6195
|
+
if (props.shiftMultiChecked) {
|
6196
|
+
window.addEventListener('keydown', handleKeyDown);
|
6197
|
+
window.addEventListener('keyup', handleKeyUp);
|
6198
|
+
}
|
6199
|
+
var getStore = function getStore() {
|
6200
|
+
return store;
|
6201
|
+
};
|
6202
|
+
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
6203
|
+
if (props.shiftMultiChecked) {
|
6204
|
+
window.removeEventListener('keydown', handleKeyDown);
|
6205
|
+
window.removeEventListener('keyup', handleKeyUp);
|
6206
|
+
}
|
6207
|
+
});
|
6208
|
+
return {
|
6209
|
+
isShiftKeyDown: isShiftKeyDown,
|
6210
|
+
setStore: setStore,
|
6211
|
+
getStore: getStore,
|
6212
|
+
clearStore: clearStore
|
6213
|
+
};
|
6214
|
+
});
|
6115
6215
|
;// CONCATENATED MODULE: ../../packages/table/src/use-render.tsx
|
6116
6216
|
|
6117
6217
|
|
@@ -6163,10 +6263,11 @@ function use_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
6163
6263
|
|
6164
6264
|
|
6165
6265
|
|
6266
|
+
|
6166
6267
|
function use_render_isSlot(s) {
|
6167
6268
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
|
6168
6269
|
}
|
6169
|
-
/* harmony default export */ const use_render = (function (props, context, tableResp,
|
6270
|
+
/* harmony default export */ const use_render = (function (props, context, tableResp, head, root, resetTableHeight) {
|
6170
6271
|
var t = (0,config_provider_namespaceObject.useLocale)('table');
|
6171
6272
|
var uuid = esm_browser_v4();
|
6172
6273
|
var formatData = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -6178,6 +6279,10 @@ function use_render_isSlot(s) {
|
|
6178
6279
|
var settings = (0,external_vue_namespaceObject.computed)(function () {
|
6179
6280
|
return formatData.value.settings;
|
6180
6281
|
});
|
6282
|
+
var _useShiftKey = use_shift_key(props),
|
6283
|
+
isShiftKeyDown = _useShiftKey.isShiftKeyDown,
|
6284
|
+
getStore = _useShiftKey.getStore,
|
6285
|
+
setStore = _useShiftKey.setStore;
|
6181
6286
|
// const activeSortIndex = ref(null);
|
6182
6287
|
/**
|
6183
6288
|
* 过滤当前可渲染的列
|
@@ -6304,8 +6409,7 @@ function use_render_isSlot(s) {
|
|
6304
6409
|
'--row-height': "".concat(resolvePropVal(config, 'height', ['thead']), "px"),
|
6305
6410
|
backgroundColor: props.thead.color
|
6306
6411
|
};
|
6307
|
-
|
6308
|
-
resolveFixedColumnStyle = _useFixedColumn.resolveFixedColumnStyle;
|
6412
|
+
// const { resolveFixedColumnStyle } = useFixedColumn(props, tableResp, head);
|
6309
6413
|
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("thead", {
|
6310
6414
|
"style": rowStyle
|
6311
6415
|
}, [(0,external_vue_namespaceObject.createVNode)(table_row, null, {
|
@@ -6314,7 +6418,7 @@ function use_render_isSlot(s) {
|
|
6314
6418
|
var _props$thead$color, _props$thead;
|
6315
6419
|
var _useHeadCell = use_head_cell(props, context, column, tableResp),
|
6316
6420
|
getTH = _useHeadCell.getTH;
|
6317
|
-
var headStyle = Object.assign({}, resolveFixedColumnStyle(column
|
6421
|
+
var headStyle = Object.assign({}, resolveFixedColumnStyle(column), {
|
6318
6422
|
'--background-color': DEF_COLOR[(_props$thead$color = (_props$thead = props.thead) === null || _props$thead === void 0 ? void 0 : _props$thead.color) !== null && _props$thead$color !== void 0 ? _props$thead$color : IHeadColor.DEF1]
|
6319
6423
|
});
|
6320
6424
|
var classList = [getHeadColumnClass(column, index), getColumnCustomClass(column), column.align || props.headerAlign || props.align];
|
@@ -6390,13 +6494,14 @@ function use_render_isSlot(s) {
|
|
6390
6494
|
return result;
|
6391
6495
|
})]);
|
6392
6496
|
};
|
6393
|
-
var
|
6394
|
-
resolveFixedColumnStyle =
|
6497
|
+
var _useFixedColumn = use_fixed_column(props, tableResp, head),
|
6498
|
+
resolveFixedColumnStyle = _useFixedColumn.resolveFixedColumnStyle;
|
6395
6499
|
var getRowRender = function getRowRender(row, rowIndex, preRow, rows, rowSpanMap, needRowSpan) {
|
6396
6500
|
var isChild = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
6397
6501
|
var rowLength = rows.length;
|
6398
6502
|
var rowStyle = [].concat(_toConsumableArray(formatPropAsArray(props.rowStyle, [row, rowIndex])), [{
|
6399
|
-
'--row-height': "".concat(getRowHeight(row, rowIndex), "px")
|
6503
|
+
'--row-height': "".concat(getRowHeight(row, rowIndex), "px"),
|
6504
|
+
'--scroll-x': "".concat(tableResp.formatData.layout.translateX, "px")
|
6400
6505
|
}]);
|
6401
6506
|
var rowClass = [].concat(_toConsumableArray(formatPropAsArray(props.rowClass, [row, rowIndex])), ["hover-".concat(props.rowHover), rowIndex % 2 === 1 && props.stripe ? 'stripe-row' : '']);
|
6402
6507
|
var rowId = tableResp.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_UID);
|
@@ -6407,7 +6512,6 @@ function use_render_isSlot(s) {
|
|
6407
6512
|
return [(0,external_vue_namespaceObject.createVNode)("tr", (0,external_vue_namespaceObject.mergeProps)({
|
6408
6513
|
"style": rowStyle,
|
6409
6514
|
"class": rowClass,
|
6410
|
-
"data-row-id": rowId,
|
6411
6515
|
"key": rowId,
|
6412
6516
|
"data-row-index": rowIndex,
|
6413
6517
|
"onClick": function onClick(e) {
|
@@ -6458,11 +6562,14 @@ function use_render_isSlot(s) {
|
|
6458
6562
|
};
|
6459
6563
|
context.emit(type, args);
|
6460
6564
|
};
|
6565
|
+
var columnKey = "".concat(rowId, "_").concat(index);
|
6566
|
+
var cellKey = "".concat(rowId, "_").concat(index, "_cell");
|
6461
6567
|
return (0,external_vue_namespaceObject.createVNode)("td", {
|
6462
6568
|
"class": cellClass,
|
6463
6569
|
"style": cellStyle,
|
6464
6570
|
"colspan": colspan,
|
6465
6571
|
"rowspan": rowspan,
|
6572
|
+
"key": columnKey,
|
6466
6573
|
"onClick": function onClick(event) {
|
6467
6574
|
return handleEmit(event, EMIT_EVENTS.CELL_CLICK);
|
6468
6575
|
},
|
@@ -6470,6 +6577,7 @@ function use_render_isSlot(s) {
|
|
6470
6577
|
return handleEmit(event, EMIT_EVENTS.CELL_DBL_CLICK);
|
6471
6578
|
}
|
6472
6579
|
}, [(0,external_vue_namespaceObject.createVNode)(table_cell, {
|
6580
|
+
"key": cellKey,
|
6473
6581
|
"class": tdCtxClass,
|
6474
6582
|
"column": column,
|
6475
6583
|
"row": row,
|
@@ -6601,6 +6709,38 @@ function use_render_isSlot(s) {
|
|
6601
6709
|
data: props.data
|
6602
6710
|
});
|
6603
6711
|
};
|
6712
|
+
var beforeRowChange = function beforeRowChange() {
|
6713
|
+
if (isShiftKeyDown.value && !isAll) {
|
6714
|
+
var result = setStore(row, index);
|
6715
|
+
if (result) {
|
6716
|
+
var _tableResp$pageData$s;
|
6717
|
+
var _getStore = getStore(),
|
6718
|
+
start = _getStore.start,
|
6719
|
+
end = _getStore.end;
|
6720
|
+
var startIndex = start.index < end.index ? start.index : end.index;
|
6721
|
+
var endIndex = start.index < end.index ? end.index : start.index;
|
6722
|
+
((_tableResp$pageData$s = tableResp.pageData.slice(startIndex, endIndex + 1)) !== null && _tableResp$pageData$s !== void 0 ? _tableResp$pageData$s : []).forEach(function (item) {
|
6723
|
+
tableResp.setRowSelection(item, true);
|
6724
|
+
});
|
6725
|
+
}
|
6726
|
+
context.emit(EMIT_EVENTS.ROW_SELECT, {
|
6727
|
+
row: row,
|
6728
|
+
index: index,
|
6729
|
+
checked: true,
|
6730
|
+
data: props.data,
|
6731
|
+
isShiftKeyDown: true
|
6732
|
+
});
|
6733
|
+
context.emit(EMIT_EVENTS.ROW_SELECT_CHANGE, {
|
6734
|
+
row: row,
|
6735
|
+
index: index,
|
6736
|
+
checked: true,
|
6737
|
+
data: props.data,
|
6738
|
+
isShiftKeyDown: true
|
6739
|
+
});
|
6740
|
+
return Promise.resolve(!result);
|
6741
|
+
}
|
6742
|
+
return Promise.resolve(true);
|
6743
|
+
};
|
6604
6744
|
var indeterminate = tableResp.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION_INDETERMINATE);
|
6605
6745
|
var isChecked = tableResp.getRowAttribute(row, TABLE_ROW_ATTRIBUTE.ROW_SELECTION);
|
6606
6746
|
var isEnable = isRowSelectEnable(props, {
|
@@ -6612,7 +6752,8 @@ function use_render_isSlot(s) {
|
|
6612
6752
|
"onChange": handleChecked,
|
6613
6753
|
"disabled": !isEnable,
|
6614
6754
|
"modelValue": isChecked,
|
6615
|
-
"indeterminate": indeterminate
|
6755
|
+
"indeterminate": indeterminate,
|
6756
|
+
"beforeChange": beforeRowChange
|
6616
6757
|
}, null);
|
6617
6758
|
};
|
6618
6759
|
var renderExpandColumn = function renderExpandColumn(row, column, index, rows) {
|
@@ -6811,7 +6952,6 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6811
6952
|
wrapperStyle = _useClass.wrapperStyle,
|
6812
6953
|
contentStyle = _useClass.contentStyle,
|
6813
6954
|
headStyle = _useClass.headStyle,
|
6814
|
-
hasScrollYRef = _useClass.hasScrollYRef,
|
6815
6955
|
hasFooter = _useClass.hasFooter,
|
6816
6956
|
footerStyle = _useClass.footerStyle,
|
6817
6957
|
tableBodyClass = _useClass.tableBodyClass,
|
@@ -6832,17 +6972,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6832
6972
|
updateFixClass = _useFixedColumn.updateFixClass;
|
6833
6973
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
6834
6974
|
resolveClassName = _usePrefix.resolveClassName;
|
6835
|
-
var styleRef = (0,external_vue_namespaceObject.computed)(function () {
|
6836
|
-
return {
|
6837
|
-
hasScrollY: hasScrollYRef.value
|
6838
|
-
};
|
6839
|
-
});
|
6840
6975
|
use_observer_resize(root, function () {
|
6841
6976
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
6842
6977
|
resolveFixedColumns(tableOffsetRight.value);
|
6843
6978
|
});
|
6844
6979
|
});
|
6845
|
-
var _useRender = use_render(props, ctx, tableSchema,
|
6980
|
+
var _useRender = use_render(props, ctx, tableSchema, head, root, resetTableHeight),
|
6846
6981
|
renderTableBodySchema = _useRender.renderTableBodySchema,
|
6847
6982
|
renderTableFooter = _useRender.renderTableFooter,
|
6848
6983
|
renderTableHeadSchema = _useRender.renderTableHeadSchema;
|
@@ -6864,13 +6999,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6864
6999
|
tableSchema.formatColumns(columns);
|
6865
7000
|
resolveFixedColumns(tableOffsetRight.value);
|
6866
7001
|
tableSchema.setIndexData().then(function () {
|
6867
|
-
// tableSchema.formatDataSchema(props.data);
|
6868
7002
|
tableSchema.resetStartEndIndex();
|
6869
7003
|
if (isFirstLoad.value) {
|
6870
7004
|
tableSchema.resolveByDefColumns();
|
6871
7005
|
isFirstLoad.value = false;
|
6872
7006
|
} else {
|
6873
|
-
tableSchema.resolvePageData();
|
7007
|
+
tableSchema.resolvePageData(tableSchema.getFilterFnList());
|
6874
7008
|
}
|
6875
7009
|
registerResizeEvent();
|
6876
7010
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
@@ -6984,8 +7118,12 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6984
7118
|
"throttleDelay": 120,
|
6985
7119
|
"scrollEvent": true,
|
6986
7120
|
"rowKey": props.rowKey,
|
7121
|
+
"scrollbar": {
|
7122
|
+
enabled: true
|
7123
|
+
},
|
6987
7124
|
"enabled": props.virtualEnabled,
|
6988
|
-
"keepAlive": true
|
7125
|
+
"keepAlive": true,
|
7126
|
+
"autoIndex": false
|
6989
7127
|
}), {
|
6990
7128
|
beforeContent: function beforeContent() {
|
6991
7129
|
return renderPrepend();
|
@@ -6994,8 +7132,7 @@ function table_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
6994
7132
|
return renderTableBodySchema(scope.data);
|
6995
7133
|
},
|
6996
7134
|
afterSection: function afterSection() {
|
6997
|
-
return [
|
6998
|
-
(0,external_vue_namespaceObject.createVNode)("div", {
|
7135
|
+
return [(0,external_vue_namespaceObject.createVNode)("div", {
|
6999
7136
|
"class": resizeColumnClass,
|
7000
7137
|
"style": resizeColumnStyle.value
|
7001
7138
|
}, null)];
|
@@ -6,7 +6,7 @@ import { ITableResponse } from '../use-attributes';
|
|
6
6
|
*/
|
7
7
|
declare const _default: (props: TablePropTypes, tableResp: ITableResponse, head?: Ref<HTMLElement>) => {
|
8
8
|
fixedWrapperClass: string;
|
9
|
-
resolveFixedColumnStyle: (column: Column
|
9
|
+
resolveFixedColumnStyle: (column: Column) => {
|
10
10
|
[x: string]: string;
|
11
11
|
};
|
12
12
|
resolveFixedColumns: (tableOffsetRight: any) => void;
|
@@ -14,8 +14,10 @@ declare const _default: (props: TablePropTypes) => {
|
|
14
14
|
resolvePageData: (filterFn?: any, sortFn?: any, column?: Column, type?: string, sortScope?: any, multiCol?: any) => void;
|
15
15
|
resolveIndexData: () => Promise<void>;
|
16
16
|
resolvePageDataBySortList: (multiCol?: any) => void;
|
17
|
+
handlePaginationChange: (filterFn?: any, sortFn?: any) => void;
|
17
18
|
resetStartEndIndex: () => void;
|
18
|
-
|
19
|
+
getCurrentPageData: () => any[];
|
20
|
+
multiFilter: (filterFnList: ((row: any, index: any, data: any) => void)[], origin?: any) => void;
|
19
21
|
sort: (sourceData: any[], sortFn: any, column: Column, type: string, sortScope: SortScope) => void;
|
20
22
|
};
|
21
23
|
export default _default;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { TablePropTypes } from '../props';
|
2
|
+
declare const _default: (props: TablePropTypes) => {
|
3
|
+
isShiftKeyDown: import("vue").Ref<boolean>;
|
4
|
+
setStore: (row: any, index: number) => boolean;
|
5
|
+
getStore: () => {
|
6
|
+
start: any;
|
7
|
+
end: any;
|
8
|
+
};
|
9
|
+
clearStore: () => void;
|
10
|
+
};
|
11
|
+
export default _default;
|
package/lib/table/props.d.ts
CHANGED
@@ -560,5 +560,13 @@ export declare const tableProps: {
|
|
560
560
|
rowDraggable: import("vue-types").VueTypeDef<any> & {
|
561
561
|
default: any;
|
562
562
|
};
|
563
|
+
/**
|
564
|
+
* 是否支持shift键多行选择
|
565
|
+
*/
|
566
|
+
shiftMultiChecked: import("vue-types").VueTypeValidableDef<boolean> & {
|
567
|
+
default: boolean;
|
568
|
+
} & {
|
569
|
+
default: boolean;
|
570
|
+
};
|
563
571
|
};
|
564
572
|
export {};
|