bkui-vue 0.0.1-beta.120 → 0.0.1-beta.123
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 +19 -19
- package/dist/index.esm.js +35 -17
- package/dist/index.umd.js +18 -18
- package/dist/style.css +1 -1
- package/lib/table/const.d.ts +4 -0
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +5 -0
- package/lib/table/table.css +19 -3
- package/lib/table/table.less +3 -4
- package/lib/table/table.variable.css +19 -3
- package/lib/table/use-common.d.ts +4 -2
- package/lib/tree/tree.css +17 -0
- package/lib/tree/tree.less +2 -0
- package/lib/tree/tree.variable.css +17 -0
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/virtual-render.css +17 -17
- package/lib/virtual-render/virtual-render.less +2 -23
- package/lib/virtual-render/virtual-render.variable.css +119 -17
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -14902,8 +14902,8 @@ const virtualRenderProps = __spreadValues({
|
|
14902
14902
|
className: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.object, PropTypes.arrayOf(PropTypes.object), PropTypes.string]).def(""),
|
14903
14903
|
contentClassName: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.object, PropTypes.arrayOf(PropTypes.object), PropTypes.string]).def(""),
|
14904
14904
|
contentStyle: PropTypes.object.def({}),
|
14905
|
-
scrollXName: PropTypes.string.def("
|
14906
|
-
scrollYName: PropTypes.string.def("
|
14905
|
+
scrollXName: PropTypes.string.def(resolveClassName("F-scroll-x")),
|
14906
|
+
scrollYName: PropTypes.string.def(resolveClassName("F-scroll-y")),
|
14907
14907
|
groupItemCount: PropTypes.number.def(1),
|
14908
14908
|
preloadItemCount: PropTypes.number.def(1),
|
14909
14909
|
renderAs: PropTypes.string.def("div"),
|
@@ -15036,7 +15036,7 @@ var Component$d = defineComponent({
|
|
15036
15036
|
renderAs,
|
15037
15037
|
contentAs
|
15038
15038
|
} = props;
|
15039
|
-
const
|
15039
|
+
const resolvePropClassName = (prop) => {
|
15040
15040
|
if (typeof prop === "string") {
|
15041
15041
|
return [prop];
|
15042
15042
|
}
|
@@ -15144,8 +15144,8 @@ var Component$d = defineComponent({
|
|
15144
15144
|
display: isHidden ? "none" : "block"
|
15145
15145
|
};
|
15146
15146
|
});
|
15147
|
-
const wrapperClass = computed(() => ["
|
15148
|
-
const innerClass = computed(() => [props.scrollPosition === "content" ? "
|
15147
|
+
const wrapperClass = computed(() => [resolveClassName("virtual-render"), props.scrollXName, props.scrollYName, ...resolvePropClassName(props.className), props.scrollPosition === "container" ? resolveClassName("virtual-content") : ""]);
|
15148
|
+
const innerClass = computed(() => [props.scrollPosition === "content" ? resolveClassName("virtual-content") : "", ...resolvePropClassName(props.contentClassName)]);
|
15149
15149
|
const vVirtualRender = resolveDirective("bkVirtualRender");
|
15150
15150
|
const dirModifier = {
|
15151
15151
|
lineHeight: props.lineHeight,
|
@@ -15172,7 +15172,7 @@ var Component$d = defineComponent({
|
|
15172
15172
|
}, [(_f = (_e = (_d = ctx.slots).default) == null ? void 0 : _e.call(_d, {
|
15173
15173
|
data: calcList.value
|
15174
15174
|
})) != null ? _f : ""]), [[vVirtualRender, dirModifier]]), (_i = (_h = (_g = ctx.slots).afterContent) == null ? void 0 : _h.call(_g)) != null ? _i : "", h$1("div", {
|
15175
|
-
class: ["
|
15175
|
+
class: [resolveClassName("virtual-section")],
|
15176
15176
|
style: innerStyle.value
|
15177
15177
|
})]);
|
15178
15178
|
};
|
@@ -15225,6 +15225,7 @@ const TABLE_ROW_ATTRIBUTE = {
|
|
15225
15225
|
ROW_UID: "__$uuid",
|
15226
15226
|
ROW_EXPAND: "__row_expand"
|
15227
15227
|
};
|
15228
|
+
const SCROLLY_WIDTH = 4;
|
15228
15229
|
const resolvePaginationOption = (propPagination, defVal) => {
|
15229
15230
|
if (!!propPagination) {
|
15230
15231
|
if (typeof propPagination === "object") {
|
@@ -15377,7 +15378,7 @@ const tableProps = {
|
|
15377
15378
|
activeColumn: PropTypes.oneOfType([PropTypes.number.def(-1), PropTypes.arrayOf(PropTypes.number.def(-1))]),
|
15378
15379
|
columnPick: PropTypes.commonType(["multi", "single", "disabled"], "columnPick").def("disabled"),
|
15379
15380
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto"),
|
15380
|
-
minHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(
|
15381
|
+
minHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(80),
|
15381
15382
|
maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def("auto"),
|
15382
15383
|
rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.func]).def(40),
|
15383
15384
|
headHeight: PropTypes.number.def(40),
|
@@ -16413,7 +16414,7 @@ var useFixedColumn = (props, colgroups, hasScrollY) => {
|
|
16413
16414
|
right: (ignoreFirst = true) => colgroups.filter((col) => col.fixed === "right").reduce((offset2, curr, index) => {
|
16414
16415
|
const outOffset = ignoreFirst && index === 0 ? offset2 : offset2 + getColumnReactWidth(curr);
|
16415
16416
|
return outOffset;
|
16416
|
-
}, hasScrollY ?
|
16417
|
+
}, hasScrollY ? SCROLLY_WIDTH : 0)
|
16417
16418
|
};
|
16418
16419
|
const reolveFixRightOffset = resolveFixOffset.right;
|
16419
16420
|
const getFixedColumnStyleResolve = () => {
|
@@ -17015,8 +17016,18 @@ const useClass = (props, root, reactiveProp, pageData) => {
|
|
17015
17016
|
[resolveClassName("table-footer")]: true,
|
17016
17017
|
["is-hidden"]: !props.pagination || !props.data.length
|
17017
17018
|
}));
|
17019
|
+
const resolveWidth2 = () => {
|
17020
|
+
if (props.columns.every((col) => /^\d+\.?\d*(px)?$/ig.test(`${col.width}`))) {
|
17021
|
+
const rectWidth = props.columns.reduce((width, col) => width + Number(`${col.width}`.replace(/px/ig, "")), 0);
|
17022
|
+
const offset2 = hasScrollY.value ? SCROLLY_WIDTH : 0;
|
17023
|
+
return `${rectWidth + offset2}px`;
|
17024
|
+
}
|
17025
|
+
return "100%";
|
17026
|
+
};
|
17018
17027
|
const wrapperStyle = computed(() => ({
|
17019
|
-
minHeight: resolveNumberOrStringToPix(props.minHeight, "auto")
|
17028
|
+
minHeight: resolveNumberOrStringToPix(props.minHeight, "auto"),
|
17029
|
+
width: resolveWidth2(),
|
17030
|
+
maxWidth: "100%"
|
17020
17031
|
}));
|
17021
17032
|
const resolvePropHeight = (height, defaultValue) => {
|
17022
17033
|
const strHeight = String(height);
|
@@ -17065,7 +17076,7 @@ const useClass = (props, root, reactiveProp, pageData) => {
|
|
17065
17076
|
const getColumnsWidthOffsetWidth = () => {
|
17066
17077
|
let offsetWidth = 0;
|
17067
17078
|
if (hasScrollY.value) {
|
17068
|
-
offsetWidth = offsetWidth +
|
17079
|
+
offsetWidth = offsetWidth + SCROLLY_WIDTH;
|
17069
17080
|
}
|
17070
17081
|
if (props.border.includes(BORDER_OPTION.OUTER) && !props.border.includes(BORDER_OPTION.NONE)) {
|
17071
17082
|
offsetWidth = offsetWidth + 2;
|
@@ -17314,9 +17325,11 @@ var Component$b = defineComponent({
|
|
17314
17325
|
};
|
17315
17326
|
onMounted(() => {
|
17316
17327
|
observerIns = observerResize(root.value, () => {
|
17317
|
-
if (props.height === "100%") {
|
17328
|
+
if (props.height === "100%" || props.height === "auto") {
|
17318
17329
|
resetTableHeight(root.value);
|
17319
17330
|
}
|
17331
|
+
const offset2 = getColumnsWidthOffsetWidth();
|
17332
|
+
resolveColumnWidth(root.value, colgroups, 20, offset2);
|
17320
17333
|
}, 60, true);
|
17321
17334
|
observerIns.start();
|
17322
17335
|
});
|
@@ -17328,9 +17341,9 @@ var Component$b = defineComponent({
|
|
17328
17341
|
ctx.expose({
|
17329
17342
|
setRowExpand
|
17330
17343
|
});
|
17331
|
-
const tableBodyClass = __spreadProps(__spreadValues({}, contentClass), {
|
17344
|
+
const tableBodyClass = computed(() => __spreadProps(__spreadValues({}, contentClass), {
|
17332
17345
|
"__is-empty": !pageData.length
|
17333
|
-
});
|
17346
|
+
}));
|
17334
17347
|
const tableBodyContentClass = {
|
17335
17348
|
[resolveClassName("table-body-content")]: true,
|
17336
17349
|
"with-virtual-render": props.virtualEnabled
|
@@ -17349,6 +17362,10 @@ var Component$b = defineComponent({
|
|
17349
17362
|
const {
|
17350
17363
|
renderScrollLoading
|
17351
17364
|
} = useScrollLoading(props, ctx);
|
17365
|
+
const scrollClass = props.virtualEnabled ? {} : {
|
17366
|
+
scrollXName: "",
|
17367
|
+
scrollYName: ""
|
17368
|
+
};
|
17352
17369
|
return () => createVNode("div", {
|
17353
17370
|
"class": tableClass.value,
|
17354
17371
|
"style": wrapperStyle.value,
|
@@ -17358,18 +17375,19 @@ var Component$b = defineComponent({
|
|
17358
17375
|
"class": headClass,
|
17359
17376
|
"style": headStyle.value
|
17360
17377
|
}, [tableRender.renderTableHeadSchema()]),
|
17361
|
-
createVNode(BkVirtualRender, {
|
17378
|
+
createVNode(BkVirtualRender, mergeProps({
|
17362
17379
|
"ref": refVirtualRender,
|
17363
17380
|
"lineHeight": tableRender.getRowHeight,
|
17364
|
-
"class": tableBodyClass,
|
17381
|
+
"class": tableBodyClass.value,
|
17365
17382
|
"style": contentStyle,
|
17366
|
-
"list": pageData
|
17383
|
+
"list": pageData
|
17384
|
+
}, scrollClass, {
|
17367
17385
|
"contentClassName": tableBodyContentClass,
|
17368
17386
|
"onContentScroll": handleScrollChanged,
|
17369
17387
|
"throttleDelay": 0,
|
17370
17388
|
"scrollEvent": true,
|
17371
17389
|
"enabled": props.virtualEnabled
|
17372
|
-
}, {
|
17390
|
+
}), {
|
17373
17391
|
default: (scope) => tableRender.renderTableBodySchema(scope.data || props.data)
|
17374
17392
|
}),
|
17375
17393
|
createVNode("div", {
|