bkui-vue 0.0.1-beta.171 → 0.0.1-beta.174
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 +32 -32
- package/dist/index.esm.js +508 -179
- package/dist/index.umd.js +34 -34
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.d.ts +1 -1
- package/lib/affix/index.d.ts +4 -4
- package/lib/badge/badge.d.ts +1 -1
- package/lib/badge/index.d.ts +4 -4
- package/lib/dialog/dialog.d.ts +1 -1
- package/lib/dialog/index.d.ts +4 -4
- package/lib/directives/ellipsis.d.ts +4 -0
- package/lib/directives/index.d.ts +1 -0
- package/lib/directives/index.js +1 -1
- package/lib/dropdown/dropdown.css +1 -2
- package/lib/dropdown/dropdown.less +1 -2
- package/lib/dropdown/dropdown.variable.css +1 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/loading/index.d.ts +4 -4
- package/lib/loading/loading.d.ts +1 -1
- package/lib/menu/index.d.ts +4 -4
- package/lib/menu/menu.d.ts +1 -1
- package/lib/message/messageConstructor.d.ts +1 -1
- package/lib/modal/index.d.ts +4 -4
- package/lib/modal/modal.d.ts +1 -1
- package/lib/notify/notifyConstructor.d.ts +2 -2
- package/lib/plugins/index.d.ts +1 -0
- package/lib/plugins/index.js +1 -0
- package/lib/popover/index.d.ts +4 -4
- package/lib/popover/popover.d.ts +1 -1
- package/lib/popover2/index.d.ts +8 -4
- package/lib/popover2/index.js +1 -1
- package/lib/popover2/plugin-popover.d.ts +7 -2
- package/lib/popover2/popover2.d.ts +2 -1
- package/lib/popover2/utils.d.ts +1 -0
- package/lib/sideslider/index.d.ts +4 -4
- package/lib/sideslider/sideslider.d.ts +1 -1
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/tab-panel.d.ts +1 -1
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +54 -0
- package/lib/table/table.css +4 -0
- package/lib/table/table.d.ts +2 -6
- package/lib/table/table.less +8 -2
- package/lib/table/table.variable.css +4 -0
- package/lib/table/use-common.d.ts +1 -1
- package/lib/table/utils.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key2, value) => {
|
|
33
33
|
__defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
34
34
|
return value;
|
35
35
|
};
|
36
|
-
import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, isVNode, withDirectives, vShow, renderSlot, Fragment, toRefs, onUnmounted, Teleport, resolveDirective, customRef, onBeforeMount, toRef, vModelText, watchEffect, onUpdated, render as render$1, shallowRef,
|
36
|
+
import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, isVNode, withDirectives, vShow, renderSlot, Fragment, toRefs, onUnmounted, Teleport, resolveDirective, createApp, customRef, onBeforeMount, toRef, vModelText, watchEffect, onUpdated, render as render$1, shallowRef, toRaw, withModifiers, TransitionGroup } from "vue";
|
37
37
|
var reset = "";
|
38
38
|
var alert = "";
|
39
39
|
var affix = "";
|
@@ -8280,15 +8280,15 @@ const editLine = (props2, context) => {
|
|
8280
8280
|
editLine.displayName = "editLine";
|
8281
8281
|
editLine.inheritAttrs = false;
|
8282
8282
|
const data$n = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M320 512c0 35.199999999999996-28.8 64-64 64s-64-28.8-64-64c0-35.199999999999996 28.8-64 64-64s64 28.8 64 64zM512 448c-35.199999999999996 0-64 28.8-64 64s28.8 64 64 64 64-28.8 64-64c0-35.199999999999996-28.8-64-64-64zM768 448c-35.199999999999996 0-64 28.8-64 64s28.8 64 64 64 64-28.8 64-64c0-35.199999999999996-28.8-64-64-64z"}}]}');
|
8283
|
-
const ellipsis = (props2, context) => {
|
8283
|
+
const ellipsis$1 = (props2, context) => {
|
8284
8284
|
const p2 = __spreadValues(__spreadValues({}, props2), context.attrs);
|
8285
8285
|
return createVNode(bkIcon, mergeProps(p2, {
|
8286
8286
|
"data": data$n,
|
8287
8287
|
"name": "ellipsis"
|
8288
8288
|
}), null);
|
8289
8289
|
};
|
8290
|
-
ellipsis.displayName = "ellipsis";
|
8291
|
-
ellipsis.inheritAttrs = false;
|
8290
|
+
ellipsis$1.displayName = "ellipsis";
|
8291
|
+
ellipsis$1.inheritAttrs = false;
|
8292
8292
|
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"d":"M885.76 840.64l-148.96-149.12a344.16 344.16 0 1 0-45.28 45.28l149.12 148.96a32 32 0 1 0 45.12-45.12ZM472 752A280 280 0 1 1 752 472 280.32 280.32 0 0 1 472 752Z"}},{"type":"element","name":"path","attributes":{"d":"M576 448H496V368a32 32 0 0 0-64 0v80H352a32 32 0 0 0 0 64h80v80a32 32 0 0 0 64 0V512h80a32 32 0 0 0 0-64Z"}}]}');
|
8293
8293
|
const data$m = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 1024 1024","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;"},"elements":[{"type":"element","name":"path","attributes":{"fill-rule":"evenodd","d":"M452.7573333333333 510.91200000000003L225.83338666666668 737.8346666666666 286.1730133333333 798.1738666666666 513.0965333333334 571.2511999999999 739.8399999999999 797.9946666666666 797.9946666666666 739.8399999999999 571.2511999999999 513.0965333333334 798.1738666666666 286.1730133333333 737.8346666666666 225.83338666666668 510.91200000000003 452.7573333333333 283.9867733333333 225.83338666666668 225.83338666666668 283.9867733333333 452.7573333333333 510.91200000000003Z","clip-rule":"evenodd"}}]}');
|
8294
8294
|
const error = (props2, context) => {
|
@@ -9932,7 +9932,7 @@ const collapseMotion$1 = (emit) => ({
|
|
9932
9932
|
emit("after-leave");
|
9933
9933
|
}
|
9934
9934
|
});
|
9935
|
-
function _isSlot$
|
9935
|
+
function _isSlot$8(s2) {
|
9936
9936
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
9937
9937
|
}
|
9938
9938
|
var CollapsePanel = defineComponent({
|
@@ -10027,7 +10027,7 @@ var CollapsePanel = defineComponent({
|
|
10027
10027
|
"class": `bk-collapse-item ${props2.disabled ? "is-disabled" : ""} ${isActive.value ? "bk-collapse-item-active" : ""}`
|
10028
10028
|
}, [createVNode("div", {
|
10029
10029
|
"onClick": () => clickItem(props2)
|
10030
|
-
}, [renderHeader()]), createVNode(Transition, transition.value, _isSlot$
|
10030
|
+
}, [renderHeader()]), createVNode(Transition, transition.value, _isSlot$8(_slot = renderPanel()) ? _slot : {
|
10031
10031
|
default: () => [_slot]
|
10032
10032
|
})]);
|
10033
10033
|
};
|
@@ -10271,7 +10271,7 @@ const props = __spreadProps(__spreadValues({}, propsMixin$1), {
|
|
10271
10271
|
dialogType: PropTypes.commonType(["show", "operation", "confirm", "process"], "dialogType").def("operation"),
|
10272
10272
|
isLoading: PropTypes.bool.def(false)
|
10273
10273
|
});
|
10274
|
-
function _isSlot$
|
10274
|
+
function _isSlot$7(s2) {
|
10275
10275
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
10276
10276
|
}
|
10277
10277
|
var Dialog = defineComponent({
|
@@ -10478,7 +10478,7 @@ var Dialog = defineComponent({
|
|
10478
10478
|
"class": className,
|
10479
10479
|
"style": this.data.moveStyle,
|
10480
10480
|
"onQuickClose": this.handleQuickClose
|
10481
|
-
}), _isSlot$
|
10481
|
+
}), _isSlot$7(dialogSlot) ? dialogSlot : {
|
10482
10482
|
default: () => [dialogSlot]
|
10483
10483
|
});
|
10484
10484
|
}
|
@@ -11264,6 +11264,67 @@ function hide$1(el) {
|
|
11264
11264
|
onHide();
|
11265
11265
|
}
|
11266
11266
|
}
|
11267
|
+
const resolveOptions = (el, binding) => {
|
11268
|
+
const options = {
|
11269
|
+
content: "",
|
11270
|
+
target: el
|
11271
|
+
};
|
11272
|
+
if (typeof binding.value === "object") {
|
11273
|
+
Object.assign(options, binding.value);
|
11274
|
+
} else {
|
11275
|
+
options.content = binding.value;
|
11276
|
+
}
|
11277
|
+
return options;
|
11278
|
+
};
|
11279
|
+
const createInstance = (el, binding) => {
|
11280
|
+
let instance = null;
|
11281
|
+
let createTimer = null;
|
11282
|
+
const options = resolveOptions(el, binding);
|
11283
|
+
const { disabled } = options;
|
11284
|
+
if (disabled || instance) {
|
11285
|
+
return;
|
11286
|
+
}
|
11287
|
+
const handleMouseEnter = () => {
|
11288
|
+
createTimer && clearTimeout(createTimer);
|
11289
|
+
createTimer = setTimeout(() => {
|
11290
|
+
const targetOptions = resolveOptions(el, binding);
|
11291
|
+
targetOptions.content = targetOptions.content || el.innerHTML;
|
11292
|
+
instance = createPopoverComponent(targetOptions);
|
11293
|
+
setTimeout(() => {
|
11294
|
+
instance.show();
|
11295
|
+
});
|
11296
|
+
}, 100);
|
11297
|
+
};
|
11298
|
+
const handleMouseLeave = () => {
|
11299
|
+
if (createTimer) {
|
11300
|
+
clearTimeout(createTimer);
|
11301
|
+
}
|
11302
|
+
instance == null ? void 0 : instance.hide();
|
11303
|
+
instance == null ? void 0 : instance.close();
|
11304
|
+
instance = null;
|
11305
|
+
};
|
11306
|
+
el.addEventListener("mouseenter", handleMouseEnter);
|
11307
|
+
el.addEventListener("mouseleave", handleMouseLeave);
|
11308
|
+
Object.assign(binding, {
|
11309
|
+
__cached: {
|
11310
|
+
handleMouseEnter,
|
11311
|
+
handleMouseLeave
|
11312
|
+
}
|
11313
|
+
});
|
11314
|
+
};
|
11315
|
+
const ellipsis = {
|
11316
|
+
mounted(el, binding) {
|
11317
|
+
createInstance(el, binding);
|
11318
|
+
},
|
11319
|
+
beforeUnmount(el, binding) {
|
11320
|
+
if (binding.__cached) {
|
11321
|
+
const { handleMouseEnter, handleMouseLeave } = binding.__cached;
|
11322
|
+
el.removeEventListener("mouseenter", handleMouseEnter);
|
11323
|
+
el.removeEventListener("mouseleave", handleMouseLeave);
|
11324
|
+
binding.__cached = null;
|
11325
|
+
}
|
11326
|
+
}
|
11327
|
+
};
|
11267
11328
|
var Arrow = defineComponent({
|
11268
11329
|
name: "PopArrow",
|
11269
11330
|
render() {
|
@@ -12908,6 +12969,10 @@ var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) =>
|
|
12908
12969
|
cleanup
|
12909
12970
|
};
|
12910
12971
|
};
|
12972
|
+
const isAvailableId = (query) => {
|
12973
|
+
const container2 = document.querySelector(query);
|
12974
|
+
return container2 instanceof HTMLElement;
|
12975
|
+
};
|
12911
12976
|
let popContainerId = null;
|
12912
12977
|
let fullscreenReferId = null;
|
12913
12978
|
let parentNodeReferId = null;
|
@@ -12952,10 +13017,6 @@ var usePopperId = (props2, prefix = "#") => {
|
|
12952
13017
|
});
|
12953
13018
|
return resolvedBoundary;
|
12954
13019
|
};
|
12955
|
-
const isAvailableId = (query) => {
|
12956
|
-
const container2 = document.querySelector(query);
|
12957
|
-
return container2 instanceof HTMLElement;
|
12958
|
-
};
|
12959
13020
|
if (popContainerId === null || !isAvailableId(`#${popContainerId}`)) {
|
12960
13021
|
popContainerId = `id_${uuid_1.v4()}`;
|
12961
13022
|
const popContainer = document.createElement("div");
|
@@ -13123,7 +13184,8 @@ var Component$p = defineComponent({
|
|
13123
13184
|
const isFullscreen = ref(false);
|
13124
13185
|
const {
|
13125
13186
|
showPopover,
|
13126
|
-
hidePopover
|
13187
|
+
hidePopover,
|
13188
|
+
updatePopover
|
13127
13189
|
} = useFloating(props2, ctx, refReference, refContent, refArrow, refRoot);
|
13128
13190
|
const {
|
13129
13191
|
onMountedFn,
|
@@ -13170,6 +13232,7 @@ var Component$p = defineComponent({
|
|
13170
13232
|
theme,
|
13171
13233
|
transBoundary,
|
13172
13234
|
handleClickOutside,
|
13235
|
+
updatePopover,
|
13173
13236
|
hide: hide2,
|
13174
13237
|
show: show2
|
13175
13238
|
};
|
@@ -13212,6 +13275,149 @@ var Component$p = defineComponent({
|
|
13212
13275
|
});
|
13213
13276
|
}
|
13214
13277
|
});
|
13278
|
+
function createPopoverComponent(options) {
|
13279
|
+
let $PopoverInstance = null;
|
13280
|
+
let $PopoverInstanceVm = null;
|
13281
|
+
let $PopoverInstanceEl = null;
|
13282
|
+
const resolvedOptions = __spreadProps(__spreadValues({
|
13283
|
+
boundary: "body",
|
13284
|
+
placement: "top",
|
13285
|
+
autoVisibility: false
|
13286
|
+
}, options), {
|
13287
|
+
trigger: "manual"
|
13288
|
+
});
|
13289
|
+
const isElement2 = (element) => element instanceof Element || element instanceof HTMLDocument;
|
13290
|
+
const popoverComponent = {
|
13291
|
+
name: "$popover",
|
13292
|
+
setup(_2, {
|
13293
|
+
expose
|
13294
|
+
}) {
|
13295
|
+
const refProps = ref(resolvedOptions);
|
13296
|
+
const refReference = ref();
|
13297
|
+
const referStyle = ref({
|
13298
|
+
position: "absolute",
|
13299
|
+
pointerEvents: "none",
|
13300
|
+
left: 0,
|
13301
|
+
top: 0,
|
13302
|
+
width: "auto",
|
13303
|
+
height: "auto",
|
13304
|
+
transform: ""
|
13305
|
+
});
|
13306
|
+
const updateStyle = (target) => {
|
13307
|
+
if (isElement2(target)) {
|
13308
|
+
const {
|
13309
|
+
x: x2,
|
13310
|
+
y: y2,
|
13311
|
+
width,
|
13312
|
+
height
|
13313
|
+
} = target.getBoundingClientRect();
|
13314
|
+
Object.assign(referStyle.value, {
|
13315
|
+
width: `${width}px`,
|
13316
|
+
height: `${height}px`,
|
13317
|
+
transform: `translate3d(${x2}px,${y2}px,0)`
|
13318
|
+
});
|
13319
|
+
return;
|
13320
|
+
}
|
13321
|
+
const {
|
13322
|
+
clientX,
|
13323
|
+
clientY
|
13324
|
+
} = target;
|
13325
|
+
Object.assign(referStyle.value, {
|
13326
|
+
transform: `translate3d(${clientX}px,${clientY}px,0)`,
|
13327
|
+
width: "10px",
|
13328
|
+
height: "10px"
|
13329
|
+
});
|
13330
|
+
};
|
13331
|
+
updateStyle(refProps.value.target);
|
13332
|
+
const show3 = () => {
|
13333
|
+
var _a, _b;
|
13334
|
+
(_b = (_a = refReference.value) == null ? void 0 : _a.show) == null ? void 0 : _b.call(_a);
|
13335
|
+
};
|
13336
|
+
const hide3 = () => {
|
13337
|
+
var _a, _b;
|
13338
|
+
(_b = (_a = refReference.value) == null ? void 0 : _a.hide) == null ? void 0 : _b.call(_a);
|
13339
|
+
};
|
13340
|
+
const attrs = computed(() => {
|
13341
|
+
const excludeKeys = ["target"];
|
13342
|
+
return Object.keys(refProps.value).filter((key2) => !excludeKeys.includes(key2)).reduce((out, curKey) => __spreadProps(__spreadValues({}, out), {
|
13343
|
+
[curKey]: refProps.value[curKey]
|
13344
|
+
}), {});
|
13345
|
+
});
|
13346
|
+
const updateTarget = (target) => {
|
13347
|
+
var _a, _b;
|
13348
|
+
refProps.value.target = target;
|
13349
|
+
updateStyle(target);
|
13350
|
+
(_b = (_a = refReference.value) == null ? void 0 : _a.updatePopover) == null ? void 0 : _b.call(_a);
|
13351
|
+
nextTick(() => {
|
13352
|
+
var _a2, _b2;
|
13353
|
+
(_b2 = (_a2 = refReference.value) == null ? void 0 : _a2.updatePopover) == null ? void 0 : _b2.call(_a2);
|
13354
|
+
});
|
13355
|
+
};
|
13356
|
+
expose({
|
13357
|
+
show: show3,
|
13358
|
+
hide: hide3,
|
13359
|
+
updateTarget
|
13360
|
+
});
|
13361
|
+
return () => createVNode(Component$p, mergeProps(attrs.value, {
|
13362
|
+
"ref": refReference
|
13363
|
+
}), {
|
13364
|
+
default: () => [createVNode("span", {
|
13365
|
+
"style": referStyle.value
|
13366
|
+
}, null)]
|
13367
|
+
});
|
13368
|
+
}
|
13369
|
+
};
|
13370
|
+
function getBoundaryDom(boundary) {
|
13371
|
+
if (/^body$/i.test(boundary)) {
|
13372
|
+
return document.body;
|
13373
|
+
}
|
13374
|
+
if (/^parent$/i.test(boundary)) {
|
13375
|
+
if (isElement2(resolvedOptions.target)) {
|
13376
|
+
return resolvedOptions.target.parentNode;
|
13377
|
+
}
|
13378
|
+
return resolvedOptions.target.target.parentNode;
|
13379
|
+
}
|
13380
|
+
if (typeof boundary === "string" && isAvailableId(boundary)) {
|
13381
|
+
return document.querySelector(boundary);
|
13382
|
+
}
|
13383
|
+
return document.body;
|
13384
|
+
}
|
13385
|
+
if ($PopoverInstance === null) {
|
13386
|
+
$PopoverInstanceEl = document.createElement("div");
|
13387
|
+
getBoundaryDom(resolvedOptions.boundary).append($PopoverInstanceEl);
|
13388
|
+
setTimeout(() => {
|
13389
|
+
$PopoverInstance = createApp(popoverComponent);
|
13390
|
+
$PopoverInstanceVm = $PopoverInstance.mount($PopoverInstanceEl);
|
13391
|
+
});
|
13392
|
+
}
|
13393
|
+
function close2() {
|
13394
|
+
if ($PopoverInstance) {
|
13395
|
+
$PopoverInstance.unmount();
|
13396
|
+
$PopoverInstanceVm = null;
|
13397
|
+
$PopoverInstance = null;
|
13398
|
+
$PopoverInstanceEl.remove();
|
13399
|
+
}
|
13400
|
+
}
|
13401
|
+
function show2() {
|
13402
|
+
$PopoverInstanceVm == null ? void 0 : $PopoverInstanceVm.show();
|
13403
|
+
}
|
13404
|
+
function update(e) {
|
13405
|
+
$PopoverInstanceVm == null ? void 0 : $PopoverInstanceVm.updateTarget(e);
|
13406
|
+
}
|
13407
|
+
function hide2() {
|
13408
|
+
$PopoverInstanceVm == null ? void 0 : $PopoverInstanceVm.hide();
|
13409
|
+
}
|
13410
|
+
return {
|
13411
|
+
close: close2,
|
13412
|
+
show: show2,
|
13413
|
+
hide: hide2,
|
13414
|
+
update,
|
13415
|
+
vm: $PopoverInstanceVm,
|
13416
|
+
get $el() {
|
13417
|
+
return $PopoverInstanceVm.$el;
|
13418
|
+
}
|
13419
|
+
};
|
13420
|
+
}
|
13215
13421
|
const BkPopover2 = withInstall(Component$p);
|
13216
13422
|
const Circle = (_2, {
|
13217
13423
|
attrs,
|
@@ -13332,7 +13538,7 @@ const Line = (_2, {
|
|
13332
13538
|
"style": titleStyle
|
13333
13539
|
}, [showDefault()])])]), showDefault(false)]);
|
13334
13540
|
};
|
13335
|
-
function _isSlot$
|
13541
|
+
function _isSlot$6(s2) {
|
13336
13542
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
13337
13543
|
}
|
13338
13544
|
var Component$o = defineComponent({
|
@@ -13397,11 +13603,11 @@ var Component$o = defineComponent({
|
|
13397
13603
|
const $props = __spreadProps(__spreadValues({}, this.$props), {
|
13398
13604
|
percent: this.validPercent(this.percent)
|
13399
13605
|
});
|
13400
|
-
let progress2 = createVNode(Line, $props, _isSlot$
|
13606
|
+
let progress2 = createVNode(Line, $props, _isSlot$6(progressInfo) ? progressInfo : {
|
13401
13607
|
default: () => [progressInfo]
|
13402
13608
|
});
|
13403
13609
|
if (this.type === "circle" || this.type === "dashboard") {
|
13404
|
-
progress2 = createVNode(Circle, $props, _isSlot$
|
13610
|
+
progress2 = createVNode(Circle, $props, _isSlot$6(progressInfo) ? progressInfo : {
|
13405
13611
|
default: () => [progressInfo]
|
13406
13612
|
});
|
13407
13613
|
}
|
@@ -15366,7 +15572,7 @@ var Component$i = defineComponent({
|
|
15366
15572
|
}
|
15367
15573
|
});
|
15368
15574
|
const BkSelect = withInstallProps(Component$i, { Option: BkOption, Group: OptionGroup });
|
15369
|
-
function _isSlot$
|
15575
|
+
function _isSlot$5(s2) {
|
15370
15576
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
15371
15577
|
}
|
15372
15578
|
const {
|
@@ -15460,7 +15666,7 @@ var Component$h = defineComponent({
|
|
15460
15666
|
"onHidden": handleHidden,
|
15461
15667
|
"onShown": handleShown,
|
15462
15668
|
"onClose": handleClose
|
15463
|
-
}), _isSlot$
|
15669
|
+
}), _isSlot$5(dialogSlot) ? dialogSlot : {
|
15464
15670
|
default: () => [dialogSlot]
|
15465
15671
|
});
|
15466
15672
|
};
|
@@ -15793,6 +15999,97 @@ const DEFAULT_SIZE_LIST = [
|
|
15793
15999
|
{ value: "medium", label: "\u4E2D", height: SETTING_SIZE.medium },
|
15794
16000
|
{ value: "large", label: "\u5927", height: SETTING_SIZE.large }
|
15795
16001
|
];
|
16002
|
+
var SortScope = /* @__PURE__ */ ((SortScope2) => {
|
16003
|
+
SortScope2["CURRENT"] = "current";
|
16004
|
+
SortScope2["ALL"] = "all";
|
16005
|
+
return SortScope2;
|
16006
|
+
})(SortScope || {});
|
16007
|
+
const IColumnType = {
|
16008
|
+
label: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
16009
|
+
field: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
16010
|
+
render: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
16011
|
+
width: PropTypes.oneOfType([PropTypes.number.def(void 0), PropTypes.string.def("auto")]),
|
16012
|
+
minWidth: PropTypes.oneOfType([PropTypes.number.def(void 0), PropTypes.string.def("auto")]).def(),
|
16013
|
+
showOverflowTooltip: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
16014
|
+
content: PropTypes.string,
|
16015
|
+
disabled: PropTypes.bool
|
16016
|
+
})]).def(false),
|
16017
|
+
type: PropTypes.commonType(["selection", "index", "expand", "none"], "columnType").def("none"),
|
16018
|
+
resizable: PropTypes.bool.def(true),
|
16019
|
+
fixed: PropTypes.oneOfType([
|
16020
|
+
PropTypes.bool,
|
16021
|
+
PropTypes.commonType(["left", "right"], "fixed")
|
16022
|
+
]).def(false),
|
16023
|
+
sort: PropTypes.oneOfType([
|
16024
|
+
PropTypes.shape({
|
16025
|
+
sortFn: PropTypes.func.def(void 0),
|
16026
|
+
sortScope: PropTypes.commonType(Object.values(SortScope)).def("current")
|
16027
|
+
}),
|
16028
|
+
PropTypes.bool,
|
16029
|
+
PropTypes.string
|
16030
|
+
]).def(false),
|
16031
|
+
filter: PropTypes.oneOfType([
|
16032
|
+
PropTypes.shape({
|
16033
|
+
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
16034
|
+
filterFn: PropTypes.func.def(void 0),
|
16035
|
+
match: PropTypes.commonType(["full", "fuzzy"], "full"),
|
16036
|
+
filterScope: PropTypes.commonType(Object.values(SortScope)).def("current"),
|
16037
|
+
btnSave: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).def("\u786E\u5B9A"),
|
16038
|
+
btnReset: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).def("\u91CD\u7F6E")
|
16039
|
+
}),
|
16040
|
+
PropTypes.bool,
|
16041
|
+
PropTypes.string
|
16042
|
+
]).def(false)
|
16043
|
+
};
|
16044
|
+
const tableProps = {
|
16045
|
+
data: PropTypes.arrayOf(PropTypes.any).def([]),
|
16046
|
+
columns: PropTypes.arrayOf(PropTypes.shape(IColumnType)).def([]),
|
16047
|
+
activeColumn: PropTypes.oneOfType([PropTypes.number.def(-1), PropTypes.arrayOf(PropTypes.number.def(-1))]),
|
16048
|
+
columnPick: PropTypes.commonType(["multi", "single", "disabled"], "columnPick").def("disabled"),
|
16049
|
+
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto"),
|
16050
|
+
minHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(LINE_HEIGHT * 2),
|
16051
|
+
maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto"),
|
16052
|
+
rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]).def(LINE_HEIGHT),
|
16053
|
+
headHeight: PropTypes.number.def(LINE_HEIGHT),
|
16054
|
+
showHead: PropTypes.bool.def(true),
|
16055
|
+
thead: PropTypes.shape({
|
16056
|
+
height: PropTypes.number.def(LINE_HEIGHT),
|
16057
|
+
isShow: PropTypes.bool.def(true),
|
16058
|
+
cellFn: PropTypes.func.def(void 0)
|
16059
|
+
}),
|
16060
|
+
virtualEnabled: PropTypes.bool.def(false),
|
16061
|
+
border: PropTypes.arrayOf(PropTypes.commonType(BORDER_OPTIONS, "border")).def([BORDER_OPTION.ROW]),
|
16062
|
+
pagination: PropTypes.oneOfType([PropTypes.bool.def(false), PropTypes.object.def({})]).def(false),
|
16063
|
+
remotePagination: PropTypes.bool.def(false),
|
16064
|
+
emptyText: PropTypes.string.def("\u6682\u65E0\u6570\u636E"),
|
16065
|
+
settings: PropTypes.oneOfType([
|
16066
|
+
PropTypes.shape({
|
16067
|
+
fields: PropTypes.arrayOf(PropTypes.shape({
|
16068
|
+
label: PropTypes.string,
|
16069
|
+
field: PropTypes.string,
|
16070
|
+
disabled: PropTypes.bool
|
16071
|
+
})),
|
16072
|
+
checked: PropTypes.arrayOf(PropTypes.string),
|
16073
|
+
limit: PropTypes.number.def(0),
|
16074
|
+
size: PropTypes.size(["small", "medium", "large"]).def("small"),
|
16075
|
+
sizeList: PropTypes.shape([])
|
16076
|
+
}),
|
16077
|
+
PropTypes.bool
|
16078
|
+
]).def(false),
|
16079
|
+
rowClass: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
16080
|
+
rowStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
16081
|
+
cellStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
16082
|
+
cellClass: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
16083
|
+
scrollLoading: PropTypes.oneOfType([
|
16084
|
+
PropTypes.object,
|
16085
|
+
PropTypes.bool
|
16086
|
+
]).def(void 0),
|
16087
|
+
reserveExpand: PropTypes.bool.def(false),
|
16088
|
+
rowKey: PropTypes.oneOfType([
|
16089
|
+
PropTypes.string,
|
16090
|
+
PropTypes.func
|
16091
|
+
]).def(TABLE_ROW_ATTRIBUTE.ROW_INDEX)
|
16092
|
+
};
|
15796
16093
|
const resolvePaginationOption = (propPagination, defVal) => {
|
15797
16094
|
if (!!propPagination) {
|
15798
16095
|
if (typeof propPagination === "object") {
|
@@ -15828,27 +16125,35 @@ var userPagination = (props2, indexData) => {
|
|
15828
16125
|
endIndex.value = pagination2.current * pagination2.limit;
|
15829
16126
|
};
|
15830
16127
|
const pageData = reactive([]);
|
15831
|
-
const sort = (sortFn) => {
|
16128
|
+
const sort = (sourceData, sortFn) => {
|
15832
16129
|
if (typeof sortFn === "function") {
|
15833
|
-
|
16130
|
+
sourceData.sort(sortFn);
|
15834
16131
|
}
|
15835
16132
|
};
|
15836
|
-
const filter = (filterFn) => {
|
16133
|
+
const filter = (sourceData, filterFn) => {
|
15837
16134
|
if (typeof filterFn === "function") {
|
15838
|
-
const filterVals =
|
15839
|
-
|
16135
|
+
const filterVals = sourceData.filter((row, index) => filterFn(row, index, props2.data));
|
16136
|
+
sourceData.splice(0, sourceData.length, ...filterVals);
|
15840
16137
|
}
|
15841
16138
|
};
|
15842
|
-
const resolvePageData = (filterFn, sortFn) => {
|
15843
|
-
|
15844
|
-
|
15845
|
-
|
16139
|
+
const resolvePageData = (filterFn, sortFn, activeSortColumn) => {
|
16140
|
+
var _a;
|
16141
|
+
const sourceData = indexData.slice();
|
16142
|
+
const {
|
16143
|
+
sortScope
|
16144
|
+
} = (_a = activeSortColumn == null ? void 0 : activeSortColumn.sort) != null ? _a : {};
|
16145
|
+
if (sortScope === SortScope.ALL) {
|
16146
|
+
sort(sourceData, sortFn);
|
16147
|
+
}
|
16148
|
+
pageData.splice(0, pageData.length, ...sourceData.slice(startIndex.value, endIndex.value));
|
16149
|
+
filter(pageData, filterFn);
|
16150
|
+
sort(pageData, sortFn);
|
15846
16151
|
};
|
15847
|
-
const watchEffectFn = (filterFn, sortFn) => {
|
16152
|
+
const watchEffectFn = (filterFn, sortFn, activeSortColumn) => {
|
15848
16153
|
pagination2 = resolvePaginationOption(props2.pagination, pagination2);
|
15849
16154
|
resolveLocalPagination();
|
15850
16155
|
resetStartEndIndex();
|
15851
|
-
resolvePageData(filterFn, sortFn);
|
16156
|
+
resolvePageData(filterFn, sortFn, activeSortColumn);
|
15852
16157
|
};
|
15853
16158
|
const resolveLocalPagination = () => {
|
15854
16159
|
if (!props2.pagination) {
|
@@ -15906,91 +16211,7 @@ var useScrollLoading = (props2, ctx) => {
|
|
15906
16211
|
renderScrollLoading
|
15907
16212
|
};
|
15908
16213
|
};
|
15909
|
-
|
15910
|
-
SortScope2["CURRENT"] = "current";
|
15911
|
-
SortScope2["ALL"] = "all";
|
15912
|
-
return SortScope2;
|
15913
|
-
})(SortScope || {});
|
15914
|
-
const tableProps = {
|
15915
|
-
data: PropTypes.arrayOf(PropTypes.any).def([]),
|
15916
|
-
columns: PropTypes.arrayOf(PropTypes.shape({
|
15917
|
-
label: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
15918
|
-
field: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
15919
|
-
render: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
15920
|
-
width: PropTypes.oneOfType([PropTypes.number.def(void 0), PropTypes.string.def("auto")]),
|
15921
|
-
minWidth: PropTypes.oneOfType([PropTypes.number.def(void 0), PropTypes.string.def("auto")]).def(),
|
15922
|
-
type: PropTypes.commonType(["selection", "index", "expand", "none"], "columnType").def("none"),
|
15923
|
-
resizable: PropTypes.bool.def(true),
|
15924
|
-
fixed: PropTypes.oneOfType([
|
15925
|
-
PropTypes.bool,
|
15926
|
-
PropTypes.commonType(["left", "right"], "fixed")
|
15927
|
-
]).def(false),
|
15928
|
-
sort: PropTypes.oneOfType([
|
15929
|
-
PropTypes.shape({
|
15930
|
-
sortFn: PropTypes.func.def(void 0),
|
15931
|
-
sortScope: PropTypes.commonType(Object.values(SortScope)).def("current")
|
15932
|
-
}),
|
15933
|
-
PropTypes.bool,
|
15934
|
-
PropTypes.string
|
15935
|
-
]).def(false),
|
15936
|
-
filter: PropTypes.oneOfType([
|
15937
|
-
PropTypes.shape({
|
15938
|
-
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
15939
|
-
filterFn: PropTypes.func.def(void 0),
|
15940
|
-
btnSave: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).def("\u786E\u5B9A"),
|
15941
|
-
btnReset: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).def("\u91CD\u7F6E")
|
15942
|
-
}),
|
15943
|
-
PropTypes.bool,
|
15944
|
-
PropTypes.string
|
15945
|
-
]).def(false)
|
15946
|
-
})).def([]),
|
15947
|
-
activeColumn: PropTypes.oneOfType([PropTypes.number.def(-1), PropTypes.arrayOf(PropTypes.number.def(-1))]),
|
15948
|
-
columnPick: PropTypes.commonType(["multi", "single", "disabled"], "columnPick").def("disabled"),
|
15949
|
-
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto"),
|
15950
|
-
minHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(LINE_HEIGHT * 2),
|
15951
|
-
maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto"),
|
15952
|
-
rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]).def(LINE_HEIGHT),
|
15953
|
-
headHeight: PropTypes.number.def(LINE_HEIGHT),
|
15954
|
-
showHead: PropTypes.bool.def(true),
|
15955
|
-
thead: PropTypes.shape({
|
15956
|
-
height: PropTypes.number.def(LINE_HEIGHT),
|
15957
|
-
isShow: PropTypes.bool.def(true),
|
15958
|
-
cellFn: PropTypes.func.def(void 0)
|
15959
|
-
}),
|
15960
|
-
virtualEnabled: PropTypes.bool.def(false),
|
15961
|
-
border: PropTypes.arrayOf(PropTypes.commonType(BORDER_OPTIONS, "border")).def([BORDER_OPTION.ROW]),
|
15962
|
-
pagination: PropTypes.oneOfType([PropTypes.bool.def(false), PropTypes.object.def({})]).def(false),
|
15963
|
-
remotePagination: PropTypes.bool.def(false),
|
15964
|
-
emptyText: PropTypes.string.def("\u6682\u65E0\u6570\u636E"),
|
15965
|
-
settings: PropTypes.oneOfType([
|
15966
|
-
PropTypes.shape({
|
15967
|
-
fields: PropTypes.arrayOf(PropTypes.shape({
|
15968
|
-
label: PropTypes.string,
|
15969
|
-
field: PropTypes.string,
|
15970
|
-
disabled: PropTypes.bool
|
15971
|
-
})),
|
15972
|
-
checked: PropTypes.arrayOf(PropTypes.string),
|
15973
|
-
limit: PropTypes.number.def(0),
|
15974
|
-
size: PropTypes.size(["small", "medium", "large"]).def("small"),
|
15975
|
-
sizeList: PropTypes.shape([])
|
15976
|
-
}),
|
15977
|
-
PropTypes.bool
|
15978
|
-
]).def(false),
|
15979
|
-
rowClass: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
15980
|
-
rowStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
15981
|
-
cellStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
15982
|
-
cellClass: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
15983
|
-
scrollLoading: PropTypes.oneOfType([
|
15984
|
-
PropTypes.object,
|
15985
|
-
PropTypes.bool
|
15986
|
-
]).def(void 0),
|
15987
|
-
reserveExpand: PropTypes.bool.def(false),
|
15988
|
-
rowKey: PropTypes.oneOfType([
|
15989
|
-
PropTypes.string,
|
15990
|
-
PropTypes.func
|
15991
|
-
]).def(TABLE_ROW_ATTRIBUTE.ROW_INDEX)
|
15992
|
-
};
|
15993
|
-
function _isSlot$3(s2) {
|
16214
|
+
function _isSlot$4(s2) {
|
15994
16215
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
15995
16216
|
}
|
15996
16217
|
var useLimit = () => {
|
@@ -16036,7 +16257,7 @@ var useLimit = () => {
|
|
16036
16257
|
"modelValue": localLimit.value,
|
16037
16258
|
"onChange": handleLimitChange,
|
16038
16259
|
"disabled": proxy.disabled
|
16039
|
-
}, _isSlot$
|
16260
|
+
}, _isSlot$4(_slot = proxy.limitList.map((num, index) => createVNode(BkOption, {
|
16040
16261
|
"value": num,
|
16041
16262
|
"label": `${num}`,
|
16042
16263
|
"key": `${index}_${num}`
|
@@ -16150,7 +16371,7 @@ var useList = () => {
|
|
16150
16371
|
"key": "pre-batch",
|
16151
16372
|
"class": "bk-pagination-list-pre-batch",
|
16152
16373
|
"onClick": handlePreBatch
|
16153
|
-
}, [createVNode(ellipsis, null, null)]), list.value.map((num) => createVNode("div", {
|
16374
|
+
}, [createVNode(ellipsis$1, null, null)]), list.value.map((num) => createVNode("div", {
|
16154
16375
|
"class": {
|
16155
16376
|
"bk-pagination-list-item": true,
|
16156
16377
|
"is-active": localCurrent.value === num
|
@@ -16161,7 +16382,7 @@ var useList = () => {
|
|
16161
16382
|
"key": "next-batch",
|
16162
16383
|
"class": "bk-pagination-list-next-batch",
|
16163
16384
|
"onClick": handleNextBatch
|
16164
|
-
}, [createVNode(ellipsis, null, null)]), proxy.totalPageNum > 1 && createVNode("div", {
|
16385
|
+
}, [createVNode(ellipsis$1, null, null)]), proxy.totalPageNum > 1 && createVNode("div", {
|
16165
16386
|
"class": {
|
16166
16387
|
"bk-pagination-list-item": true,
|
16167
16388
|
"is-active": localCurrent.value === proxy.totalPageNum
|
@@ -16431,30 +16652,6 @@ var Component$e = defineComponent({
|
|
16431
16652
|
}
|
16432
16653
|
});
|
16433
16654
|
const BkPagination = withInstall(Component$e);
|
16434
|
-
var TableRow = defineComponent({
|
16435
|
-
name: "TableRow",
|
16436
|
-
render() {
|
16437
|
-
var _a, _b;
|
16438
|
-
return createVNode(Fragment, null, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]);
|
16439
|
-
}
|
16440
|
-
});
|
16441
|
-
var BodyEmpty = defineComponent({
|
16442
|
-
name: "BodyEmpty",
|
16443
|
-
props: {
|
16444
|
-
list: PropTypes.array.def([]),
|
16445
|
-
filterList: PropTypes.array.def([]),
|
16446
|
-
emptyText: PropTypes.string.def("\u6682\u65E0\u6570\u636E")
|
16447
|
-
},
|
16448
|
-
emits: ["change"],
|
16449
|
-
setup(props2) {
|
16450
|
-
const type = computed(() => props2.list.length === 0 ? "empty" : "search-empty");
|
16451
|
-
return () => createVNode(BkException, {
|
16452
|
-
"scene": "part",
|
16453
|
-
"type": type.value,
|
16454
|
-
"description": props2.emptyText
|
16455
|
-
}, null);
|
16456
|
-
}
|
16457
|
-
});
|
16458
16655
|
const resolvePropVal = (prop, key2, args) => {
|
16459
16656
|
if (typeof key2 === "string") {
|
16460
16657
|
if (Object.prototype.hasOwnProperty.call(prop, key2)) {
|
@@ -16653,7 +16850,102 @@ const hasRootScrollY = (root, querySelector, offsetHeight = 0) => {
|
|
16653
16850
|
}
|
16654
16851
|
return false;
|
16655
16852
|
};
|
16656
|
-
|
16853
|
+
const getElementTextWidth = (element, text) => {
|
16854
|
+
function getTextWidth(text2, font) {
|
16855
|
+
const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
|
16856
|
+
const context = canvas.getContext("2d");
|
16857
|
+
context.font = font;
|
16858
|
+
const metrics = context.measureText(text2);
|
16859
|
+
return metrics.width;
|
16860
|
+
}
|
16861
|
+
function getCssStyle(element2, prop) {
|
16862
|
+
return window.getComputedStyle(element2, null).getPropertyValue(prop);
|
16863
|
+
}
|
16864
|
+
function getCanvasFont(el = document.body) {
|
16865
|
+
const fontWeight = getCssStyle(el, "font-weight") || "normal";
|
16866
|
+
const fontSize = getCssStyle(el, "font-size") || "16px";
|
16867
|
+
const fontFamily = getCssStyle(el, "font-family") || "Times New Roman";
|
16868
|
+
return `${fontWeight} ${fontSize} ${fontFamily}`;
|
16869
|
+
}
|
16870
|
+
return getTextWidth(text || (element == null ? void 0 : element.innerHTML), getCanvasFont(element));
|
16871
|
+
};
|
16872
|
+
var TableCell = defineComponent({
|
16873
|
+
name: "TableCell",
|
16874
|
+
props: {
|
16875
|
+
column: PropTypes.any.def({}),
|
16876
|
+
row: PropTypes.any.def({})
|
16877
|
+
},
|
16878
|
+
setup(props2, {
|
16879
|
+
slots
|
16880
|
+
}) {
|
16881
|
+
const refRoot = ref();
|
16882
|
+
const isTipsEnabled = ref(false);
|
16883
|
+
const {
|
16884
|
+
showOverflowTooltip = false
|
16885
|
+
} = props2.column || {};
|
16886
|
+
const resolveTooltipOption = () => {
|
16887
|
+
let disabled = true;
|
16888
|
+
let content = refRoot.value.innerText;
|
16889
|
+
if (typeof showOverflowTooltip === "boolean") {
|
16890
|
+
disabled = !showOverflowTooltip;
|
16891
|
+
}
|
16892
|
+
if (typeof showOverflowTooltip === "object") {
|
16893
|
+
disabled = showOverflowTooltip.disabled;
|
16894
|
+
if (typeof showOverflowTooltip.content === "function") {
|
16895
|
+
content = showOverflowTooltip.content(props2.column, props2.row);
|
16896
|
+
}
|
16897
|
+
content = showOverflowTooltip.content || refRoot.value.innerText;
|
16898
|
+
}
|
16899
|
+
return {
|
16900
|
+
disabled,
|
16901
|
+
content
|
16902
|
+
};
|
16903
|
+
};
|
16904
|
+
onMounted(() => {
|
16905
|
+
if (props2.column.showOverflowTooltip) {
|
16906
|
+
const textWidth = getElementTextWidth(refRoot.value);
|
16907
|
+
const cellWidth = refRoot.value.clientWidth;
|
16908
|
+
isTipsEnabled.value = textWidth > cellWidth;
|
16909
|
+
if (isTipsEnabled.value) {
|
16910
|
+
const bindings = ref(resolveTooltipOption());
|
16911
|
+
createInstance(refRoot.value, bindings);
|
16912
|
+
}
|
16913
|
+
}
|
16914
|
+
});
|
16915
|
+
return () => {
|
16916
|
+
var _a;
|
16917
|
+
return createVNode("div", {
|
16918
|
+
"class": "cell",
|
16919
|
+
"ref": refRoot
|
16920
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
16921
|
+
};
|
16922
|
+
}
|
16923
|
+
});
|
16924
|
+
var TableRow = defineComponent({
|
16925
|
+
name: "TableRow",
|
16926
|
+
render() {
|
16927
|
+
var _a, _b;
|
16928
|
+
return createVNode(Fragment, null, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]);
|
16929
|
+
}
|
16930
|
+
});
|
16931
|
+
var BodyEmpty = defineComponent({
|
16932
|
+
name: "BodyEmpty",
|
16933
|
+
props: {
|
16934
|
+
list: PropTypes.array.def([]),
|
16935
|
+
filterList: PropTypes.array.def([]),
|
16936
|
+
emptyText: PropTypes.string.def("\u6682\u65E0\u6570\u636E")
|
16937
|
+
},
|
16938
|
+
emits: ["change"],
|
16939
|
+
setup(props2) {
|
16940
|
+
const type = computed(() => props2.list.length === 0 ? "empty" : "search-empty");
|
16941
|
+
return () => createVNode(BkException, {
|
16942
|
+
"scene": "part",
|
16943
|
+
"type": type.value,
|
16944
|
+
"description": props2.emptyText
|
16945
|
+
}, null);
|
16946
|
+
}
|
16947
|
+
});
|
16948
|
+
function _isSlot$3(s2) {
|
16657
16949
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
16658
16950
|
}
|
16659
16951
|
var HeadFilter = defineComponent({
|
@@ -16695,7 +16987,18 @@ var HeadFilter = defineComponent({
|
|
16695
16987
|
checked: state.checked.includes(item.value)
|
16696
16988
|
}));
|
16697
16989
|
});
|
16698
|
-
const
|
16990
|
+
const getRegExp = (searchValue, flags = "ig") => new RegExp(`${searchValue}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), flags);
|
16991
|
+
const defaultFilterFn = (checked, row) => {
|
16992
|
+
const {
|
16993
|
+
match: match2
|
16994
|
+
} = column.filter;
|
16995
|
+
const matchText = getRowText(row, resolvePropVal(column, "field", [column, row]), column);
|
16996
|
+
if (match2 === "full") {
|
16997
|
+
checked.includes(matchText);
|
16998
|
+
}
|
16999
|
+
return checked.some((str) => getRegExp(str, "img").test(matchText));
|
17000
|
+
};
|
17001
|
+
const filterFn = typeof column.filter.filterFn === "function" ? (checked, row, index, data2) => column.filter.filterFn(checked, row, props2.column, index, data2) : (checked, row) => checked.length ? defaultFilterFn(checked, row) : true;
|
16699
17002
|
const handleBtnSaveClick = () => {
|
16700
17003
|
handleFilterChange(true);
|
16701
17004
|
emit("filterSave", [...state.checked]);
|
@@ -16785,7 +17088,7 @@ var HeadFilter = defineComponent({
|
|
16785
17088
|
"modelValue": state.checked,
|
16786
17089
|
"onUpdate:modelValue": ($event) => state.checked = $event,
|
16787
17090
|
"onChange": () => handleFilterChange(false)
|
16788
|
-
}, _isSlot$
|
17091
|
+
}, _isSlot$3(_slot = localData.value.map((item) => createVNode("div", {
|
16789
17092
|
"class": "list-item"
|
16790
17093
|
}, [createVNode(BkCheckbox, {
|
16791
17094
|
"label": item.value
|
@@ -16865,7 +17168,7 @@ class TablePlugins {
|
|
16865
17168
|
this.ctx = ctx;
|
16866
17169
|
}
|
16867
17170
|
}
|
16868
|
-
function _isSlot$
|
17171
|
+
function _isSlot$2(s2) {
|
16869
17172
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
16870
17173
|
}
|
16871
17174
|
var Settings = defineComponent({
|
@@ -17035,7 +17338,7 @@ var Settings = defineComponent({
|
|
17035
17338
|
"class": "setting-body-fields",
|
17036
17339
|
"modelValue": checkedFields.value,
|
17037
17340
|
"onUpdate:modelValue": ($event) => checkedFields.value = $event
|
17038
|
-
}, _isSlot$
|
17341
|
+
}, _isSlot$2(_slot2 = renderFields.value.map((item, index) => {
|
17039
17342
|
let _slot;
|
17040
17343
|
return createVNode("div", {
|
17041
17344
|
"class": "field-item"
|
@@ -17043,7 +17346,7 @@ var Settings = defineComponent({
|
|
17043
17346
|
"label": resolvePropVal(item, "field", [item, index]),
|
17044
17347
|
"checked": checkedFields.value.includes(resolvePropVal(item, "field", [item, index])),
|
17045
17348
|
"disabled": isItemReadonly(item, index)
|
17046
|
-
}, _isSlot$
|
17349
|
+
}, _isSlot$2(_slot = resolvePropVal(item, "label", [item, index])) ? _slot : {
|
17047
17350
|
default: () => [_slot]
|
17048
17351
|
})]);
|
17049
17352
|
})) ? _slot2 : {
|
@@ -17070,10 +17373,11 @@ var Settings = defineComponent({
|
|
17070
17373
|
});
|
17071
17374
|
var useFixedColumn = (props2, colgroups, hasScrollY) => {
|
17072
17375
|
const footHeight = computed(() => props2.pagination && props2.data.length ? LINE_HEIGHT : 0);
|
17073
|
-
const resolveColumnClass = (column) => ({
|
17376
|
+
const resolveColumnClass = (column, scrollX, offsetRight) => ({
|
17074
17377
|
column_fixed: !!column.fixed,
|
17075
17378
|
column_fixed_left: column.fixed !== "right",
|
17076
|
-
column_fixed_right: column.fixed === "right"
|
17379
|
+
column_fixed_right: column.fixed === "right",
|
17380
|
+
shadow: column.fixed === "right" ? scrollX < offsetRight : scrollX > 0
|
17077
17381
|
});
|
17078
17382
|
const resolveFixColPos = (column) => column.fixed === "right" ? "right" : "left";
|
17079
17383
|
const resolveFixOffset = {
|
@@ -17086,31 +17390,31 @@ var useFixedColumn = (props2, colgroups, hasScrollY) => {
|
|
17086
17390
|
return outOffset;
|
17087
17391
|
}, hasScrollY ? SCROLLY_WIDTH : 0)
|
17088
17392
|
};
|
17089
|
-
const
|
17393
|
+
const resolveFixRightOffset = resolveFixOffset.right;
|
17090
17394
|
const getFixedColumnStyleResolve = () => {
|
17091
|
-
const resolveFixedColumnStyle = (column,
|
17395
|
+
const resolveFixedColumnStyle = (column, fixedOffset2) => {
|
17092
17396
|
if (!column.fixed) {
|
17093
17397
|
return {};
|
17094
17398
|
}
|
17095
17399
|
const fixedPos = resolveFixColPos(column);
|
17096
17400
|
const opt = fixedPos === "right" ? -1 : 1;
|
17097
|
-
const offsetX = `${
|
17098
|
-
|
17401
|
+
const offsetX = `${fixedOffset2[fixedPos]}px`;
|
17402
|
+
fixedOffset2[fixedPos] = fixedOffset2[fixedPos] + getColumnReactWidth(column) * opt;
|
17099
17403
|
return {
|
17100
17404
|
[fixedPos]: offsetX
|
17101
17405
|
};
|
17102
17406
|
};
|
17103
|
-
const rightOffsetWidth =
|
17104
|
-
const
|
17407
|
+
const rightOffsetWidth = resolveFixRightOffset(true);
|
17408
|
+
const fixedOffset = {
|
17105
17409
|
left: 0,
|
17106
17410
|
right: rightOffsetWidth
|
17107
17411
|
};
|
17108
17412
|
return {
|
17109
|
-
|
17413
|
+
fixedOffset,
|
17110
17414
|
resolveFixedColumnStyle
|
17111
17415
|
};
|
17112
17416
|
};
|
17113
|
-
const renderFixedColumns = () => {
|
17417
|
+
const renderFixedColumns = (scrollX, offsetRight) => {
|
17114
17418
|
const resolveColumnStyle = (colPos) => ({
|
17115
17419
|
width: `${resolveFixOffset[colPos](false)}px`,
|
17116
17420
|
bottom: `${footHeight.value}px`
|
@@ -17124,7 +17428,7 @@ var useFixedColumn = (props2, colgroups, hasScrollY) => {
|
|
17124
17428
|
const isExist = colPosExist[colPos];
|
17125
17429
|
colPosExist[colPos] = true;
|
17126
17430
|
return isExist ? "" : createVNode("div", {
|
17127
|
-
"class": resolveColumnClass(col),
|
17431
|
+
"class": resolveColumnClass(col, scrollX, offsetRight),
|
17128
17432
|
"style": resolveColumnStyle(colPos)
|
17129
17433
|
}, null);
|
17130
17434
|
});
|
@@ -17136,6 +17440,9 @@ var useFixedColumn = (props2, colgroups, hasScrollY) => {
|
|
17136
17440
|
getFixedColumnStyleResolve
|
17137
17441
|
};
|
17138
17442
|
};
|
17443
|
+
function _isSlot$1(s2) {
|
17444
|
+
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
17445
|
+
}
|
17139
17446
|
class TableRender {
|
17140
17447
|
constructor(props2, ctx, reactiveProp, colgroups) {
|
17141
17448
|
__publicField(this, "getRowHeight", (row, rowIndex) => {
|
@@ -17348,20 +17655,23 @@ class TableRender {
|
|
17348
17655
|
} = useFixedColumn(this.props, this.colgroups);
|
17349
17656
|
const {
|
17350
17657
|
resolveFixedColumnStyle,
|
17351
|
-
|
17658
|
+
fixedOffset
|
17352
17659
|
} = getFixedColumnStyleResolve();
|
17353
17660
|
return createVNode("thead", {
|
17354
17661
|
"style": rowStyle
|
17355
17662
|
}, [createVNode(TableRow, null, {
|
17356
|
-
default: () => [createVNode("tr", null, [this.filterColgroups.map((column, index) =>
|
17357
|
-
|
17358
|
-
"
|
17359
|
-
|
17360
|
-
|
17361
|
-
|
17362
|
-
|
17363
|
-
|
17364
|
-
|
17663
|
+
default: () => [createVNode("tr", null, [this.filterColgroups.map((column, index) => {
|
17664
|
+
let _slot;
|
17665
|
+
return createVNode("th", mergeProps({
|
17666
|
+
"colspan": 1,
|
17667
|
+
"rowspan": 1,
|
17668
|
+
"class": this.getHeadColumnClass(column, index),
|
17669
|
+
"style": resolveFixedColumnStyle(column, fixedOffset),
|
17670
|
+
"onClick": () => this.handleColumnHeadClick(index)
|
17671
|
+
}, resolveEventListener(column)), [createVNode(TableCell, null, _isSlot$1(_slot = renderHeadCell(column, index)) ? _slot : {
|
17672
|
+
default: () => [_slot]
|
17673
|
+
})]);
|
17674
|
+
})])]
|
17365
17675
|
})]);
|
17366
17676
|
}
|
17367
17677
|
renderTBody(rows) {
|
@@ -17375,7 +17685,7 @@ class TableRender {
|
|
17375
17685
|
const rowClass = [...formatPropAsArray(this.props.rowClass, [row, rowIndex, this])];
|
17376
17686
|
const {
|
17377
17687
|
resolveFixedColumnStyle,
|
17378
|
-
|
17688
|
+
fixedOffset
|
17379
17689
|
} = getFixedColumnStyleResolve();
|
17380
17690
|
const rowKey = `${this.uuid}-${row[TABLE_ROW_ATTRIBUTE.ROW_UID]}`;
|
17381
17691
|
return [createVNode(TableRow, {
|
@@ -17387,7 +17697,8 @@ class TableRender {
|
|
17387
17697
|
"onClick": (e) => this.handleRowClick(e, row, rowIndex, rows),
|
17388
17698
|
"onDblclick": (e) => this.handleRowDblClick(e, row, rowIndex, rows)
|
17389
17699
|
}, [this.filterColgroups.map((column, index) => {
|
17390
|
-
|
17700
|
+
let _slot2;
|
17701
|
+
const cellStyle = [resolveFixedColumnStyle(column, fixedOffset), ...formatPropAsArray(this.props.cellStyle, [column, index, row, rowIndex, this])];
|
17391
17702
|
const cellClass = [this.getColumnClass(column, index), ...formatPropAsArray(this.props.cellClass, [column, index, row, rowIndex, this]), {
|
17392
17703
|
"expand-row": row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND]
|
17393
17704
|
}];
|
@@ -17402,9 +17713,13 @@ class TableRender {
|
|
17402
17713
|
"key": cellKey,
|
17403
17714
|
"colspan": 1,
|
17404
17715
|
"rowspan": 1
|
17405
|
-
}, [createVNode(
|
17406
|
-
"class": tdCtxClass
|
17407
|
-
|
17716
|
+
}, [createVNode(TableCell, {
|
17717
|
+
"class": tdCtxClass,
|
17718
|
+
"column": column,
|
17719
|
+
"row": row
|
17720
|
+
}, _isSlot$1(_slot2 = this.renderCell(row, column, rowIndex, rows)) ? _slot2 : {
|
17721
|
+
default: () => [_slot2]
|
17722
|
+
})]);
|
17408
17723
|
})])]
|
17409
17724
|
}), this.renderExpandRow(row, rowClass)];
|
17410
17725
|
})]);
|
@@ -17844,7 +18159,7 @@ const useInit = (props2) => {
|
|
17844
18159
|
});
|
17845
18160
|
});
|
17846
18161
|
};
|
17847
|
-
const { renderFixedColumns, fixedWrapperClass } = useFixedColumn(props2, colgroups);
|
18162
|
+
const { renderFixedColumns, fixedWrapperClass } = useFixedColumn(props2, colgroups, false);
|
17848
18163
|
return {
|
17849
18164
|
colgroups,
|
17850
18165
|
dragOffsetXStyle,
|
@@ -17865,10 +18180,12 @@ var Component$d = defineComponent({
|
|
17865
18180
|
emits: EMIT_EVENT_TYPES,
|
17866
18181
|
setup(props2, ctx) {
|
17867
18182
|
let columnSortFn = null;
|
18183
|
+
let activeSortColumn = null;
|
17868
18184
|
let columnFilterFn = null;
|
17869
18185
|
let observerIns = null;
|
17870
18186
|
const root = ref();
|
17871
18187
|
const refVirtualRender = ref();
|
18188
|
+
const tableOffsetRight = ref(0);
|
17872
18189
|
const {
|
17873
18190
|
colgroups,
|
17874
18191
|
dragOffsetXStyle,
|
@@ -17900,9 +18217,18 @@ var Component$d = defineComponent({
|
|
17900
18217
|
hasFooter
|
17901
18218
|
} = useClass(props2, root, reactiveSchema, pageData);
|
17902
18219
|
const tableRender = new TableRender(props2, ctx, reactiveSchema, colgroups);
|
18220
|
+
const updateOffsetRight = () => {
|
18221
|
+
const $tableContent = root.value.querySelector(".bk-table-body-content");
|
18222
|
+
const $table = $tableContent.querySelector("table");
|
18223
|
+
if ($table) {
|
18224
|
+
const $tableScrollWidth = $table.scrollWidth;
|
18225
|
+
const $contentWidth = $tableContent.clientWidth;
|
18226
|
+
tableOffsetRight.value = $tableScrollWidth - $contentWidth;
|
18227
|
+
}
|
18228
|
+
};
|
17903
18229
|
watch(() => [props2.data, props2.pagination], () => {
|
17904
18230
|
initIndexData(props2.reserveExpand);
|
17905
|
-
watchEffectFn(columnFilterFn, columnSortFn);
|
18231
|
+
watchEffectFn(columnFilterFn, columnSortFn, activeSortColumn);
|
17906
18232
|
nextTick(() => {
|
17907
18233
|
resetTableHeight(root.value);
|
17908
18234
|
updateBorderClass(root.value);
|
@@ -17915,6 +18241,7 @@ var Component$d = defineComponent({
|
|
17915
18241
|
if ((root == null ? void 0 : root.value) instanceof HTMLElement) {
|
17916
18242
|
const offset2 = getColumnsWidthOffsetWidth();
|
17917
18243
|
resolveColumnWidth(root.value, colgroups, 20, offset2);
|
18244
|
+
updateOffsetRight();
|
17918
18245
|
}
|
17919
18246
|
});
|
17920
18247
|
tableRender.on(EVENTS$1.ON_SORT_BY_CLICK, (args) => {
|
@@ -17927,7 +18254,8 @@ var Component$d = defineComponent({
|
|
17927
18254
|
} = args;
|
17928
18255
|
if (typeof sortFn === "function") {
|
17929
18256
|
columnSortFn = sortFn;
|
17930
|
-
|
18257
|
+
activeSortColumn = column;
|
18258
|
+
resolvePageData(columnFilterFn, columnSortFn, activeSortColumn);
|
17931
18259
|
(_b = (_a = refVirtualRender.value) == null ? void 0 : _a.reset) == null ? void 0 : _b.call(_a);
|
17932
18260
|
}
|
17933
18261
|
ctx.emit(EMITEVENTS.COLUMN_SORT, {
|
@@ -17945,7 +18273,7 @@ var Component$d = defineComponent({
|
|
17945
18273
|
} = args;
|
17946
18274
|
if (typeof filterFn === "function") {
|
17947
18275
|
columnFilterFn = filterFn;
|
17948
|
-
resolvePageData(columnFilterFn, columnSortFn);
|
18276
|
+
resolvePageData(columnFilterFn, columnSortFn, activeSortColumn);
|
17949
18277
|
(_b = (_a = refVirtualRender.value) == null ? void 0 : _a.reset) == null ? void 0 : _b.call(_a);
|
17950
18278
|
}
|
17951
18279
|
ctx.emit(EMITEVENTS.COLUMN_FILTER, {
|
@@ -18011,6 +18339,7 @@ var Component$d = defineComponent({
|
|
18011
18339
|
}));
|
18012
18340
|
}, true)();
|
18013
18341
|
}
|
18342
|
+
updateOffsetRight();
|
18014
18343
|
};
|
18015
18344
|
onMounted(() => {
|
18016
18345
|
observerIns = observerResize(root.value, () => {
|
@@ -18089,7 +18418,7 @@ var Component$d = defineComponent({
|
|
18089
18418
|
}),
|
18090
18419
|
createVNode("div", {
|
18091
18420
|
"class": fixedWrapperClass
|
18092
|
-
}, [renderFixedColumns(), createVNode("div", {
|
18421
|
+
}, [renderFixedColumns(reactiveSchema.scrollTranslateX, tableOffsetRight.value), createVNode("div", {
|
18093
18422
|
"class": resizeColumnClass,
|
18094
18423
|
"style": resizeColumnStyle.value
|
18095
18424
|
}, null), createVNode("div", {
|
@@ -35195,4 +35524,4 @@ var preset = {
|
|
35195
35524
|
install: createInstall(),
|
35196
35525
|
version: "0.0.1"
|
35197
35526
|
};
|
35198
|
-
export { BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkSteps as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps$2 as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTag as Tag, TagInput, BkSteps$1 as TimeLine, BkTimePicker as TimePicker, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel };
|
35527
|
+
export { BkAffix as Affix, BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkBreadcrumb as Breadcrumb, BkButton as Button, BkCard as Card, BkCascader as Cascader, BkCheckbox as Checkbox, BkCodeDiff as CodeDiff, BkCollapse as Collapse, BkColorPicker as ColorPicker, BkContainer as Container, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, InfoBox, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkPopover2 as Popover2, BkSteps as Process, BkProgress as Progress, BkRadio as Radio, BkRate as Rate, BkResizeLayout as ResizeLayout, BkSelect as Select, BkSideslider as Sideslider, Slider, BkSteps$2 as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, BkTable as Table, BkTag as Tag, TagInput, BkSteps$1 as TimeLine, BkTimePicker as TimePicker, Transfer, BkTree as Tree, Upload, BkVirtualRender as VirtualRender, ellipsis as bkEllipsis, createInstance as bkEllipsisInstance, tooltips as bkTooltips, ClickOutside as clickoutside, BkContainer as containerProps, preset as default, mousewheel };
|