bkui-vue 0.0.1-beta.86 → 0.0.1-beta.89
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 +13 -13
- package/dist/index.esm.js +149 -98
- package/dist/index.umd.js +15 -15
- package/dist/style.css +1 -1
- package/lib/breadcrumb/index.js +1 -1
- package/lib/dialog/dialog.css +21 -21
- package/lib/dialog/dialog.less +23 -23
- package/lib/dialog/dialog.variable.css +21 -21
- package/lib/dialog/index.js +1 -1
- package/lib/form/index.js +1 -1
- package/lib/radio/index.d.ts +0 -1
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio-button.d.ts +0 -1
- package/lib/switcher/index.d.ts +8 -8
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.css +5 -5
- package/lib/switcher/switcher.d.ts +3 -3
- package/lib/switcher/switcher.less +2 -2
- package/lib/switcher/switcher.variable.css +5 -5
- package/lib/table/index.d.ts +38 -1
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +11 -0
- package/lib/table/table.css +8 -0
- package/lib/table/table.d.ts +17 -0
- package/lib/table/table.less +12 -0
- package/lib/table/table.variable.css +8 -0
- package/lib/table/utils.d.ts +1 -0
- package/lib/tree/index.d.ts +24 -1
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +9 -0
- package/lib/tree/tree.d.ts +11 -0
- package/package.json +1 -2
package/dist/index.esm.js
CHANGED
@@ -208,20 +208,20 @@ function isShadowRoot(node) {
|
|
208
208
|
}
|
209
209
|
function applyStyles(_ref) {
|
210
210
|
var state = _ref.state;
|
211
|
-
Object.keys(state.elements).forEach(function(
|
212
|
-
var style = state.styles[
|
213
|
-
var attributes = state.attributes[
|
214
|
-
var element = state.elements[
|
211
|
+
Object.keys(state.elements).forEach(function(name) {
|
212
|
+
var style = state.styles[name] || {};
|
213
|
+
var attributes = state.attributes[name] || {};
|
214
|
+
var element = state.elements[name];
|
215
215
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
216
216
|
return;
|
217
217
|
}
|
218
218
|
Object.assign(element.style, style);
|
219
|
-
Object.keys(attributes).forEach(function(
|
220
|
-
var value = attributes[
|
219
|
+
Object.keys(attributes).forEach(function(name2) {
|
220
|
+
var value = attributes[name2];
|
221
221
|
if (value === false) {
|
222
|
-
element.removeAttribute(
|
222
|
+
element.removeAttribute(name2);
|
223
223
|
} else {
|
224
|
-
element.setAttribute(
|
224
|
+
element.setAttribute(name2, value === true ? "" : value);
|
225
225
|
}
|
226
226
|
});
|
227
227
|
});
|
@@ -246,10 +246,10 @@ function effect$2(_ref2) {
|
|
246
246
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
247
247
|
}
|
248
248
|
return function() {
|
249
|
-
Object.keys(state.elements).forEach(function(
|
250
|
-
var element = state.elements[
|
251
|
-
var attributes = state.attributes[
|
252
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(
|
249
|
+
Object.keys(state.elements).forEach(function(name) {
|
250
|
+
var element = state.elements[name];
|
251
|
+
var attributes = state.attributes[name] || {};
|
252
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
253
253
|
var style = styleProperties.reduce(function(style2, property) {
|
254
254
|
style2[property] = "";
|
255
255
|
return style2;
|
@@ -428,7 +428,7 @@ var toPaddingObject = function toPaddingObject2(padding, state) {
|
|
428
428
|
};
|
429
429
|
function arrow(_ref) {
|
430
430
|
var _state$modifiersData$;
|
431
|
-
var state = _ref.state,
|
431
|
+
var state = _ref.state, name = _ref.name, options = _ref.options;
|
432
432
|
var arrowElement = state.elements.arrow;
|
433
433
|
var popperOffsets2 = state.modifiersData.popperOffsets;
|
434
434
|
var basePlacement = getBasePlacement(state.placement);
|
@@ -452,7 +452,7 @@ function arrow(_ref) {
|
|
452
452
|
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
453
453
|
var offset2 = within(min2, center, max2);
|
454
454
|
var axisProp = axis;
|
455
|
-
state.modifiersData[
|
455
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
456
456
|
}
|
457
457
|
function effect$1(_ref2) {
|
458
458
|
var state = _ref2.state, options = _ref2.options;
|
@@ -908,8 +908,8 @@ function getExpandedFallbackPlacements(placement) {
|
|
908
908
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
909
909
|
}
|
910
910
|
function flip(_ref) {
|
911
|
-
var state = _ref.state, options = _ref.options,
|
912
|
-
if (state.modifiersData[
|
911
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
912
|
+
if (state.modifiersData[name]._skip) {
|
913
913
|
return;
|
914
914
|
}
|
915
915
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
@@ -989,7 +989,7 @@ function flip(_ref) {
|
|
989
989
|
}
|
990
990
|
}
|
991
991
|
if (state.placement !== firstFittingPlacement) {
|
992
|
-
state.modifiersData[
|
992
|
+
state.modifiersData[name]._skip = true;
|
993
993
|
state.placement = firstFittingPlacement;
|
994
994
|
state.reset = true;
|
995
995
|
}
|
@@ -1024,7 +1024,7 @@ function isAnySideFullyClipped(overflow) {
|
|
1024
1024
|
});
|
1025
1025
|
}
|
1026
1026
|
function hide(_ref) {
|
1027
|
-
var state = _ref.state,
|
1027
|
+
var state = _ref.state, name = _ref.name;
|
1028
1028
|
var referenceRect = state.rects.reference;
|
1029
1029
|
var popperRect = state.rects.popper;
|
1030
1030
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
@@ -1038,7 +1038,7 @@ function hide(_ref) {
|
|
1038
1038
|
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
1039
1039
|
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
1040
1040
|
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
1041
|
-
state.modifiersData[
|
1041
|
+
state.modifiersData[name] = {
|
1042
1042
|
referenceClippingOffsets,
|
1043
1043
|
popperEscapeOffsets,
|
1044
1044
|
isReferenceHidden,
|
@@ -1073,7 +1073,7 @@ function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
1073
1073
|
};
|
1074
1074
|
}
|
1075
1075
|
function offset(_ref2) {
|
1076
|
-
var state = _ref2.state, options = _ref2.options,
|
1076
|
+
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
1077
1077
|
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
1078
1078
|
var data2 = placements$1.reduce(function(acc, placement) {
|
1079
1079
|
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
@@ -1084,7 +1084,7 @@ function offset(_ref2) {
|
|
1084
1084
|
state.modifiersData.popperOffsets.x += x2;
|
1085
1085
|
state.modifiersData.popperOffsets.y += y2;
|
1086
1086
|
}
|
1087
|
-
state.modifiersData[
|
1087
|
+
state.modifiersData[name] = data2;
|
1088
1088
|
}
|
1089
1089
|
var offset$1 = {
|
1090
1090
|
name: "offset",
|
@@ -1094,8 +1094,8 @@ var offset$1 = {
|
|
1094
1094
|
fn: offset
|
1095
1095
|
};
|
1096
1096
|
function popperOffsets(_ref) {
|
1097
|
-
var state = _ref.state,
|
1098
|
-
state.modifiersData[
|
1097
|
+
var state = _ref.state, name = _ref.name;
|
1098
|
+
state.modifiersData[name] = computeOffsets({
|
1099
1099
|
reference: state.rects.reference,
|
1100
1100
|
element: state.rects.popper,
|
1101
1101
|
strategy: "absolute",
|
@@ -1113,7 +1113,7 @@ function getAltAxis(axis) {
|
|
1113
1113
|
return axis === "x" ? "y" : "x";
|
1114
1114
|
}
|
1115
1115
|
function preventOverflow(_ref) {
|
1116
|
-
var state = _ref.state, options = _ref.options,
|
1116
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
1117
1117
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
1118
1118
|
var overflow = detectOverflow(state, {
|
1119
1119
|
boundary,
|
@@ -1194,7 +1194,7 @@ function preventOverflow(_ref) {
|
|
1194
1194
|
popperOffsets2[altAxis] = _preventedOffset;
|
1195
1195
|
data2[altAxis] = _preventedOffset - _offset;
|
1196
1196
|
}
|
1197
|
-
state.modifiersData[
|
1197
|
+
state.modifiersData[name] = data2;
|
1198
1198
|
}
|
1199
1199
|
var preventOverflow$1 = {
|
1200
1200
|
name: "preventOverflow",
|
@@ -1395,12 +1395,12 @@ function popperGenerator(generatorOptions) {
|
|
1395
1395
|
index = -1;
|
1396
1396
|
continue;
|
1397
1397
|
}
|
1398
|
-
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
1398
|
+
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
1399
1399
|
if (typeof fn2 === "function") {
|
1400
1400
|
state = fn2({
|
1401
1401
|
state,
|
1402
1402
|
options: _options,
|
1403
|
-
name
|
1403
|
+
name,
|
1404
1404
|
instance
|
1405
1405
|
}) || state;
|
1406
1406
|
}
|
@@ -1427,11 +1427,11 @@ function popperGenerator(generatorOptions) {
|
|
1427
1427
|
});
|
1428
1428
|
function runModifierEffects() {
|
1429
1429
|
state.orderedModifiers.forEach(function(_ref3) {
|
1430
|
-
var
|
1430
|
+
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
1431
1431
|
if (typeof effect2 === "function") {
|
1432
1432
|
var cleanupFn = effect2({
|
1433
1433
|
state,
|
1434
|
-
name
|
1434
|
+
name,
|
1435
1435
|
instance,
|
1436
1436
|
options: options2
|
1437
1437
|
});
|
@@ -2284,13 +2284,13 @@ class PropTypes extends propTypesNS {
|
|
2284
2284
|
default: "top"
|
2285
2285
|
});
|
2286
2286
|
}
|
2287
|
-
static commonType(types = [],
|
2288
|
-
return j(
|
2287
|
+
static commonType(types = [], name = "commonType") {
|
2288
|
+
return j(name.replace(/^\S/, (s2) => s2.toUpperCase()), {
|
2289
2289
|
type: String,
|
2290
2290
|
validator: (val) => {
|
2291
2291
|
const valid = types.includes(val);
|
2292
2292
|
if (!valid) {
|
2293
|
-
console.error(`invalid ${
|
2293
|
+
console.error(`invalid ${name}, ${val}, the ${name} must be one of \u3010${types.join(" | ")}\u3011`);
|
2294
2294
|
}
|
2295
2295
|
return valid;
|
2296
2296
|
},
|
@@ -2405,7 +2405,7 @@ function generate(node, key, rootAttrs) {
|
|
2405
2405
|
const bkIcon = (props, context) => {
|
2406
2406
|
const _a = __spreadValues(__spreadValues({}, context.attrs), props), {
|
2407
2407
|
data: data2,
|
2408
|
-
name
|
2408
|
+
name,
|
2409
2409
|
width,
|
2410
2410
|
height,
|
2411
2411
|
fill
|
@@ -2417,7 +2417,7 @@ const bkIcon = (props, context) => {
|
|
2417
2417
|
"fill"
|
2418
2418
|
]);
|
2419
2419
|
const rootAttrs = `width: ${width}; height: ${height}; fill: ${fill}`;
|
2420
|
-
return createVNode("span", restProps, [generate(data2,
|
2420
|
+
return createVNode("span", restProps, [generate(data2, name, rootAttrs)]);
|
2421
2421
|
};
|
2422
2422
|
bkIcon.inheritAttrs = false;
|
2423
2423
|
bkIcon.displayName = "bkIcon";
|
@@ -8741,7 +8741,7 @@ var BreadcrumbItem = defineComponent({
|
|
8741
8741
|
"bk-breadcrumb-item": true
|
8742
8742
|
}, `${props.extCls || ""}`);
|
8743
8743
|
return () => {
|
8744
|
-
var _a;
|
8744
|
+
var _a, _b;
|
8745
8745
|
return createVNode("span", {
|
8746
8746
|
"class": classCtx
|
8747
8747
|
}, [createVNode("span", {
|
@@ -8749,7 +8749,7 @@ var BreadcrumbItem = defineComponent({
|
|
8749
8749
|
"class": `bk-breadcrumb-item-inner ${to ? "is-link" : ""}`,
|
8750
8750
|
"role": "link",
|
8751
8751
|
"onClick": handleClick
|
8752
|
-
}, [(_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)]), (parent == null ? void 0 : parent.separatorClass) ? createVNode("i", {
|
8752
|
+
}, [(_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)]), (slots == null ? void 0 : slots.separator) ? (_b = slots == null ? void 0 : slots.separator) == null ? void 0 : _b.call(slots) : (parent == null ? void 0 : parent.separatorClass) ? createVNode("i", {
|
8753
8753
|
"class": `bk-breadcrumb-separator ${parent.separatorClass}`
|
8754
8754
|
}, null) : createVNode("span", {
|
8755
8755
|
"class": "bk-breadcrumb-separator",
|
@@ -9126,8 +9126,8 @@ var Component$u = defineComponent({
|
|
9126
9126
|
const newVal = handleNumber(props.step, false);
|
9127
9127
|
ctx.emit(EVENTS$2.UPDATE, newVal);
|
9128
9128
|
}
|
9129
|
-
function getCls(
|
9130
|
-
return `${inputClsPrefix.value}--${
|
9129
|
+
function getCls(name) {
|
9130
|
+
return `${inputClsPrefix.value}--${name}`;
|
9131
9131
|
}
|
9132
9132
|
function handleVisibleChange() {
|
9133
9133
|
pwdVisible.value = !pwdVisible.value;
|
@@ -9827,7 +9827,7 @@ var Component$p = defineComponent({
|
|
9827
9827
|
};
|
9828
9828
|
data2.positionX = 0;
|
9829
9829
|
data2.positionY = 0;
|
9830
|
-
},
|
9830
|
+
}, 250);
|
9831
9831
|
}
|
9832
9832
|
});
|
9833
9833
|
const handleClose = () => {
|
@@ -9912,15 +9912,15 @@ var Component$p = defineComponent({
|
|
9912
9912
|
return [createVNode("div", {
|
9913
9913
|
"class": ["bk-dialog-tool", this.fullscreen || !this.draggable ? "" : "move", this.draggable ? "content-dragging" : ""],
|
9914
9914
|
"onMousedown": this.moveHandler
|
9915
|
-
}, [(_c = (_b = (_a = this.$slots).tools) == null ? void 0 : _b.call(_a)) != null ? _c : "", createVNode("
|
9916
|
-
"class": ["bk-dialog-close", this.closeIcon ? "" : "close-icon"],
|
9917
|
-
"onClick": this.handleClose
|
9918
|
-
}, [createTextVNode("+")])]), createVNode("div", {
|
9915
|
+
}, [(_c = (_b = (_a = this.$slots).tools) == null ? void 0 : _b.call(_a)) != null ? _c : ""]), createVNode("div", {
|
9919
9916
|
"class": "bk-dialog-header"
|
9920
9917
|
}, [createVNode("span", {
|
9921
9918
|
"class": "bk-dialog-title",
|
9922
9919
|
"style": `text-align: ${this.headerAlign}`
|
9923
|
-
}, [(_f = (_e = (_d = this.$slots).header) == null ? void 0 : _e.call(_d)) != null ? _f : this.title])
|
9920
|
+
}, [(_f = (_e = (_d = this.$slots).header) == null ? void 0 : _e.call(_d)) != null ? _f : this.title]), createVNode("span", {
|
9921
|
+
"class": ["bk-dialog-close", this.closeIcon ? "" : "close-icon"],
|
9922
|
+
"onClick": this.handleClose
|
9923
|
+
}, [createTextVNode("+")])])];
|
9924
9924
|
},
|
9925
9925
|
default: () => {
|
9926
9926
|
var _a, _b, _c;
|
@@ -10527,7 +10527,7 @@ const useRadio = () => {
|
|
10527
10527
|
const formItem = useFormItem();
|
10528
10528
|
const radioGroup = inject(radioGroupKey, EMPTY_OBJ);
|
10529
10529
|
const isGroup = !isEmptyObj(radioGroup);
|
10530
|
-
const isChecked = ref(
|
10530
|
+
const isChecked = ref(false);
|
10531
10531
|
const isDisabled = computed(() => {
|
10532
10532
|
if (isGroup && radioGroup.props.disabled) {
|
10533
10533
|
return true;
|
@@ -10537,6 +10537,8 @@ const useRadio = () => {
|
|
10537
10537
|
if (isGroup) {
|
10538
10538
|
watch(() => radioGroup.props.modelValue, (modelValue) => {
|
10539
10539
|
isChecked.value = modelValue === props.label;
|
10540
|
+
}, {
|
10541
|
+
immediate: true
|
10540
10542
|
});
|
10541
10543
|
} else {
|
10542
10544
|
watch(() => props.modelValue, (modelValue) => {
|
@@ -10670,7 +10672,6 @@ var RadioButton = defineComponent({
|
|
10670
10672
|
} = useRadio();
|
10671
10673
|
return {
|
10672
10674
|
isFocused,
|
10673
|
-
realName: name,
|
10674
10675
|
isChecked,
|
10675
10676
|
isDisabled,
|
10676
10677
|
setChecked,
|
@@ -12643,7 +12644,7 @@ var Component$c = defineComponent({
|
|
12643
12644
|
offText: PropTypes.string.def("OFF"),
|
12644
12645
|
isSquare: PropTypes.bool,
|
12645
12646
|
extCls: PropTypes.string,
|
12646
|
-
|
12647
|
+
beforeChange: PropTypes.func.def(void 0),
|
12647
12648
|
trueValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]).def(true),
|
12648
12649
|
falseValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]).def(false),
|
12649
12650
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]).def(false),
|
@@ -12669,7 +12670,7 @@ var Component$c = defineComponent({
|
|
12669
12670
|
"is-checked": isChecked.value,
|
12670
12671
|
"is-unchecked": !isChecked.value,
|
12671
12672
|
"is-loading": isLoading.value,
|
12672
|
-
primary: props.theme === "primary"
|
12673
|
+
"bk-primary": props.theme === "primary"
|
12673
12674
|
};
|
12674
12675
|
if (props.size && !props.showText) {
|
12675
12676
|
const sizeStr = `bk-switcher-${props.size}`;
|
@@ -12701,8 +12702,8 @@ var Component$c = defineComponent({
|
|
12701
12702
|
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change");
|
12702
12703
|
};
|
12703
12704
|
let goodJob = true;
|
12704
|
-
if (typeof props.
|
12705
|
-
goodJob = props.
|
12705
|
+
if (typeof props.beforeChange === "function") {
|
12706
|
+
goodJob = props.beforeChange(lastValue);
|
12706
12707
|
if (typeof goodJob.then === "function") {
|
12707
12708
|
isLoading.value = true;
|
12708
12709
|
return goodJob.then(() => {
|
@@ -13331,11 +13332,11 @@ var useColumnResize = (colgroups, immediate = true) => {
|
|
13331
13332
|
colgroups.forEach((col) => {
|
13332
13333
|
if (col.resizable !== false) {
|
13333
13334
|
Object.keys(handler).forEach((event) => {
|
13334
|
-
const
|
13335
|
-
if (!col.listeners.has(
|
13336
|
-
col.listeners.set(
|
13335
|
+
const name = getEventName(event);
|
13336
|
+
if (!col.listeners.has(name)) {
|
13337
|
+
col.listeners.set(name, []);
|
13337
13338
|
}
|
13338
|
-
col.listeners.get(
|
13339
|
+
col.listeners.get(name).push(handler[event]);
|
13339
13340
|
});
|
13340
13341
|
}
|
13341
13342
|
});
|
@@ -13343,9 +13344,9 @@ var useColumnResize = (colgroups, immediate = true) => {
|
|
13343
13344
|
const resetResizeEvents = () => {
|
13344
13345
|
colgroups.forEach((col) => {
|
13345
13346
|
Object.keys(handler).forEach((event) => {
|
13346
|
-
const
|
13347
|
-
if (col.listeners.has(
|
13348
|
-
const listeners = col.listeners.get(
|
13347
|
+
const name = getEventName(event);
|
13348
|
+
if (col.listeners.has(name)) {
|
13349
|
+
const listeners = col.listeners.get(name);
|
13349
13350
|
listeners.splice(0, listeners.length);
|
13350
13351
|
}
|
13351
13352
|
});
|
@@ -13512,6 +13513,47 @@ var userPagination = (props) => {
|
|
13512
13513
|
watchEffectFn
|
13513
13514
|
};
|
13514
13515
|
};
|
13516
|
+
var useScrollLoading = (props, ctx) => {
|
13517
|
+
const refScrollLoading = toRef(props, "scrollLoading");
|
13518
|
+
const getLoadingOption = () => {
|
13519
|
+
if (typeof refScrollLoading.value === "boolean") {
|
13520
|
+
return {
|
13521
|
+
loading: !!refScrollLoading.value,
|
13522
|
+
inline: true,
|
13523
|
+
title: "",
|
13524
|
+
size: BkLoadingSize.Normal,
|
13525
|
+
mode: BkLoadingMode.Default,
|
13526
|
+
indicator: null
|
13527
|
+
};
|
13528
|
+
}
|
13529
|
+
return refScrollLoading.value;
|
13530
|
+
};
|
13531
|
+
const isRender = computed(() => refScrollLoading.value !== null && (typeof refScrollLoading.value === "boolean" && refScrollLoading.value || typeof refScrollLoading.value === "object"));
|
13532
|
+
const renderScrollLoading = () => {
|
13533
|
+
var _a, _b, _c;
|
13534
|
+
if (isRender.value) {
|
13535
|
+
const {
|
13536
|
+
loading: loading2,
|
13537
|
+
size,
|
13538
|
+
mode,
|
13539
|
+
title,
|
13540
|
+
inline,
|
13541
|
+
indicator
|
13542
|
+
} = getLoadingOption();
|
13543
|
+
return (_c = (_b = (_a = ctx.slots).fixedBottom) == null ? void 0 : _b.call(_a)) != null ? _c : createVNode(BkLoading, {
|
13544
|
+
loading: loading2,
|
13545
|
+
size,
|
13546
|
+
mode,
|
13547
|
+
title,
|
13548
|
+
inline,
|
13549
|
+
indicator
|
13550
|
+
}, null);
|
13551
|
+
}
|
13552
|
+
};
|
13553
|
+
return {
|
13554
|
+
renderScrollLoading
|
13555
|
+
};
|
13556
|
+
};
|
13515
13557
|
var SortScope = /* @__PURE__ */ ((SortScope2) => {
|
13516
13558
|
SortScope2["CURRENT"] = "current";
|
13517
13559
|
SortScope2["ALL"] = "all";
|
@@ -13576,7 +13618,11 @@ const tableProps = {
|
|
13576
13618
|
rowClass: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
13577
13619
|
rowStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
13578
13620
|
cellStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
13579
|
-
cellClass: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({})
|
13621
|
+
cellClass: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.func]).def({}),
|
13622
|
+
scrollLoading: PropTypes.oneOfType([
|
13623
|
+
PropTypes.object,
|
13624
|
+
PropTypes.bool
|
13625
|
+
]).def(void 0)
|
13580
13626
|
};
|
13581
13627
|
function _isSlot$2(s2) {
|
13582
13628
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
@@ -14880,7 +14926,7 @@ var Component$9 = defineComponent({
|
|
14880
14926
|
const {
|
14881
14927
|
bottom: bottom2
|
14882
14928
|
} = pos;
|
14883
|
-
if (bottom2 <= 2 && preBottom
|
14929
|
+
if (bottom2 <= 2 && preBottom > bottom2) {
|
14884
14930
|
debounce(60, () => {
|
14885
14931
|
ctx.emit(EMITEVENTS.SCROLL_BOTTOM, __spreadProps(__spreadValues({}, pos), {
|
14886
14932
|
translateX,
|
@@ -14903,9 +14949,6 @@ var Component$9 = defineComponent({
|
|
14903
14949
|
observerIns = null;
|
14904
14950
|
tableRender.destroy();
|
14905
14951
|
});
|
14906
|
-
ctx.expose({
|
14907
|
-
plugins: tableRender.plugins
|
14908
|
-
});
|
14909
14952
|
const tableBodyClass = __spreadProps(__spreadValues({}, contentClass), {
|
14910
14953
|
"__is-empty": !pageData.length
|
14911
14954
|
});
|
@@ -14918,8 +14961,12 @@ var Component$9 = defineComponent({
|
|
14918
14961
|
"offset-x": true
|
14919
14962
|
};
|
14920
14963
|
const loadingRowClass = {
|
14921
|
-
|
14964
|
+
"scroll-loading": true,
|
14965
|
+
_bottom: true
|
14922
14966
|
};
|
14967
|
+
const {
|
14968
|
+
renderScrollLoading
|
14969
|
+
} = useScrollLoading(props, ctx);
|
14923
14970
|
return () => createVNode("div", {
|
14924
14971
|
"class": tableClass.value,
|
14925
14972
|
"style": wrapperStyle.value,
|
@@ -14950,7 +14997,7 @@ var Component$9 = defineComponent({
|
|
14950
14997
|
"style": dragOffsetXStyle.value
|
14951
14998
|
}, null), createVNode("div", {
|
14952
14999
|
"class": loadingRowClass
|
14953
|
-
},
|
15000
|
+
}, [renderScrollLoading()])]),
|
14954
15001
|
createVNode("div", {
|
14955
15002
|
"class": footerClass.value
|
14956
15003
|
}, [hasFooter.value && tableRender.renderTableFooter(localPagination.value)])
|
@@ -15924,11 +15971,11 @@ const tabNavEventProps = {
|
|
15924
15971
|
},
|
15925
15972
|
tabChange: {
|
15926
15973
|
type: Function,
|
15927
|
-
default: (
|
15974
|
+
default: (name) => name
|
15928
15975
|
},
|
15929
15976
|
tabRemove: {
|
15930
15977
|
type: Function,
|
15931
|
-
default: (
|
15978
|
+
default: (name) => name
|
15932
15979
|
},
|
15933
15980
|
tabSort: {
|
15934
15981
|
type: Function,
|
@@ -15997,7 +16044,7 @@ var TabNav = defineComponent({
|
|
15997
16044
|
return null;
|
15998
16045
|
}
|
15999
16046
|
const {
|
16000
|
-
name
|
16047
|
+
name,
|
16001
16048
|
label,
|
16002
16049
|
closable,
|
16003
16050
|
visible,
|
@@ -16007,7 +16054,7 @@ var TabNav = defineComponent({
|
|
16007
16054
|
if (!visible) {
|
16008
16055
|
return false;
|
16009
16056
|
}
|
16010
|
-
if (props.active ===
|
16057
|
+
if (props.active === name) {
|
16011
16058
|
hasFindActive = true;
|
16012
16059
|
}
|
16013
16060
|
const renderLabel = (label2) => {
|
@@ -16026,7 +16073,7 @@ var TabNav = defineComponent({
|
|
16026
16073
|
return label2;
|
16027
16074
|
};
|
16028
16075
|
list.push({
|
16029
|
-
name
|
16076
|
+
name,
|
16030
16077
|
closable,
|
16031
16078
|
visible,
|
16032
16079
|
disabled,
|
@@ -16072,8 +16119,8 @@ var TabNav = defineComponent({
|
|
16072
16119
|
}
|
16073
16120
|
props.tabSort(dragStartIndex.value, index, sortType);
|
16074
16121
|
},
|
16075
|
-
handleTabChange(
|
16076
|
-
props.tabChange(
|
16122
|
+
handleTabChange(name) {
|
16123
|
+
props.tabChange(name);
|
16077
16124
|
},
|
16078
16125
|
handleTabRemove(index, panel) {
|
16079
16126
|
props.tabRemove(index, panel);
|
@@ -16105,7 +16152,7 @@ var TabNav = defineComponent({
|
|
16105
16152
|
return null;
|
16106
16153
|
}
|
16107
16154
|
const {
|
16108
|
-
name
|
16155
|
+
name,
|
16109
16156
|
disabled,
|
16110
16157
|
tabLabel
|
16111
16158
|
} = item;
|
@@ -16114,15 +16161,15 @@ var TabNav = defineComponent({
|
|
16114
16161
|
if (disabled) {
|
16115
16162
|
classNames.push("bk-tab-header--disabled");
|
16116
16163
|
}
|
16117
|
-
if (active ===
|
16164
|
+
if (active === name) {
|
16118
16165
|
classNames.push("bk-tab-header--active");
|
16119
16166
|
}
|
16120
16167
|
return classNames.join(" ");
|
16121
16168
|
};
|
16122
16169
|
const getValue = (curentValue, parentValue) => curentValue || parentValue;
|
16123
16170
|
return createVNode("div", {
|
16124
|
-
"key":
|
16125
|
-
"onClick": () => this.handleTabChange(
|
16171
|
+
"key": name,
|
16172
|
+
"onClick": () => this.handleTabChange(name),
|
16126
16173
|
"draggable": getValue(item.sortable, sortable),
|
16127
16174
|
"onDragstart": (e) => dragstart(index, e),
|
16128
16175
|
"onDragenter": (e) => {
|
@@ -16259,10 +16306,10 @@ var Tab = defineComponent({
|
|
16259
16306
|
e
|
16260
16307
|
});
|
16261
16308
|
},
|
16262
|
-
tabChange(
|
16263
|
-
emit("change",
|
16264
|
-
emit("tab-change",
|
16265
|
-
emit("update:active",
|
16309
|
+
tabChange(name) {
|
16310
|
+
emit("change", name);
|
16311
|
+
emit("tab-change", name);
|
16312
|
+
emit("update:active", name);
|
16266
16313
|
},
|
16267
16314
|
tabRemove(index, panel) {
|
16268
16315
|
emit("remove", index, panel);
|
@@ -21409,7 +21456,8 @@ const treeProps = {
|
|
21409
21456
|
dragSort: PropTypes.bool.def(false),
|
21410
21457
|
selectable: PropTypes.bool.def(true),
|
21411
21458
|
selected: PropTypes.oneOfType([PropTypes.string, null, PropTypes.number, PropTypes.object]).def(null),
|
21412
|
-
autoCheckChildren: PropTypes.bool.def(true)
|
21459
|
+
autoCheckChildren: PropTypes.bool.def(true),
|
21460
|
+
autoOpenParentNode: PropTypes.bool.def(true)
|
21413
21461
|
};
|
21414
21462
|
var useEmpty = (props, {
|
21415
21463
|
slots
|
@@ -21461,7 +21509,8 @@ var useNodeAttribute = (flatData, props) => {
|
|
21461
21509
|
}
|
21462
21510
|
return false;
|
21463
21511
|
};
|
21464
|
-
const
|
21512
|
+
const isParentNodeOpened = (node) => isItemOpen(getNodeAttr2(node, NODE_ATTRIBUTES.PARENT_ID));
|
21513
|
+
const checkNodeIsOpen = (node) => isRootNode(node) || isParentNodeOpened(node);
|
21465
21514
|
const getSourceNodeByPath = (path) => {
|
21466
21515
|
const paths = path.split("-");
|
21467
21516
|
return paths.reduce((pre, nodeIndex) => {
|
@@ -21772,15 +21821,14 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
|
|
21772
21821
|
};
|
21773
21822
|
const setNodeOpened = (item, isOpen = null, e = null, fireEmit = true) => {
|
21774
21823
|
const newVal = isOpen === null ? !isItemOpen(item) : !!isOpen;
|
21824
|
+
if (!newVal) {
|
21825
|
+
renderData.value.filter((node) => String.prototype.startsWith.call(getNodePath(node), getNodePath(item))).forEach((filterNode) => setNodeAttr(filterNode, NODE_ATTRIBUTES.IS_OPEN, newVal));
|
21826
|
+
}
|
21775
21827
|
setNodeAttr(item, NODE_ATTRIBUTES.IS_OPEN, newVal);
|
21776
21828
|
if (fireEmit) {
|
21777
21829
|
const emitEvent = isItemOpen(item) ? EVENTS.NODE_EXPAND : EVENTS.NODE_COLLAPSE;
|
21778
21830
|
ctx.emit(emitEvent, [item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e]);
|
21779
21831
|
}
|
21780
|
-
if (newVal) {
|
21781
|
-
return;
|
21782
|
-
}
|
21783
|
-
renderData.value.filter((node) => String.prototype.startsWith.call(getNodePath(node), getNodePath(item))).forEach((filterNode) => setNodeAttr(filterNode, NODE_ATTRIBUTES.IS_OPEN, newVal));
|
21784
21832
|
};
|
21785
21833
|
const setNodeAction = (args, action, value) => {
|
21786
21834
|
if (Array.isArray(args)) {
|
@@ -22267,7 +22315,8 @@ var useTreeInit = (props) => {
|
|
22267
22315
|
[NODE_ATTRIBUTES.IS_MATCH]: () => true,
|
22268
22316
|
[NODE_ATTRIBUTES.IS_SELECTED]: (uuid2) => props2.selected === uuid2,
|
22269
22317
|
[NODE_ATTRIBUTES.IS_CACHED]: () => false,
|
22270
|
-
[NODE_ATTRIBUTES.IS_ASYNC]: () => null
|
22318
|
+
[NODE_ATTRIBUTES.IS_ASYNC]: () => null,
|
22319
|
+
[NODE_ATTRIBUTES.IS_LOADING]: () => false
|
22271
22320
|
};
|
22272
22321
|
function getCachedTreeNodeAttr(uuid2, node, cachedAttr, defVal = void 0) {
|
22273
22322
|
let defaultValue = defVal;
|
@@ -22294,11 +22343,11 @@ var useTreeInit = (props) => {
|
|
22294
22343
|
}
|
22295
22344
|
return getCachedTreeNodeAttr(uuid2, node, NODE_ATTRIBUTES.IS_SELECTED, props2.selected === uuid2);
|
22296
22345
|
}
|
22297
|
-
function
|
22298
|
-
|
22299
|
-
|
22300
|
-
|
22301
|
-
return
|
22346
|
+
function isNodeOpend(uuid2, item, parent) {
|
22347
|
+
var _a2;
|
22348
|
+
const isItemOpened = getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_OPEN);
|
22349
|
+
const isParentOpened = schema.has(parent) ? (_a2 = schema.get(parent)) == null ? void 0 : _a2[NODE_ATTRIBUTES.IS_OPEN] : true;
|
22350
|
+
return isItemOpened && isParentOpened;
|
22302
22351
|
}
|
22303
22352
|
function validateIsOpenLoopFn(target) {
|
22304
22353
|
return !target[NODE_ATTRIBUTES.IS_OPEN];
|
@@ -22314,6 +22363,12 @@ var useTreeInit = (props) => {
|
|
22314
22363
|
const uuid2 = `${getUid(item)}`;
|
22315
22364
|
const currentPath = path !== null ? `${path}-${i}` : `${i}`;
|
22316
22365
|
const hasChildren = !!(item[children] || []).length;
|
22366
|
+
let isOpened = getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_OPEN);
|
22367
|
+
if (props2.autoOpenParentNode) {
|
22368
|
+
isOpened && loopUpdateNodeAttr(parent, NODE_ATTRIBUTES.IS_OPEN, true, validateIsOpenLoopFn);
|
22369
|
+
} else {
|
22370
|
+
isOpened = isNodeOpend(uuid2, item, parent);
|
22371
|
+
}
|
22317
22372
|
const attrs = {
|
22318
22373
|
[NODE_ATTRIBUTES.DEPTH]: depth,
|
22319
22374
|
[NODE_ATTRIBUTES.INDEX]: i,
|
@@ -22325,11 +22380,11 @@ var useTreeInit = (props) => {
|
|
22325
22380
|
[NODE_ATTRIBUTES.ORDER]: order2,
|
22326
22381
|
[NODE_ATTRIBUTES.IS_SELECTED]: isCachedTreeNodeSelected(uuid2, item),
|
22327
22382
|
[NODE_ATTRIBUTES.IS_MATCH]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_MATCH),
|
22328
|
-
[NODE_ATTRIBUTES.IS_OPEN]:
|
22383
|
+
[NODE_ATTRIBUTES.IS_OPEN]: isOpened,
|
22329
22384
|
[NODE_ATTRIBUTES.IS_CHECKED]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_CHECKED),
|
22330
22385
|
[NODE_ATTRIBUTES.IS_CACHED]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_CACHED),
|
22331
22386
|
[NODE_ATTRIBUTES.IS_ASYNC]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_ASYNC),
|
22332
|
-
[NODE_ATTRIBUTES.IS_LOADING]:
|
22387
|
+
[NODE_ATTRIBUTES.IS_LOADING]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_LOADING),
|
22333
22388
|
[children]: null
|
22334
22389
|
};
|
22335
22390
|
Object.assign(item, {
|
@@ -22340,9 +22395,6 @@ var useTreeInit = (props) => {
|
|
22340
22395
|
outputData.push(__spreadProps(__spreadValues({}, item), {
|
22341
22396
|
[children]: null
|
22342
22397
|
}));
|
22343
|
-
if (attrs[NODE_ATTRIBUTES.IS_OPEN]) {
|
22344
|
-
loopUpdateNodeAttr(parent, NODE_ATTRIBUTES.IS_OPEN, true, validateIsOpenLoopFn);
|
22345
|
-
}
|
22346
22398
|
if (Object.prototype.hasOwnProperty.call(item, children)) {
|
22347
22399
|
flatten(item[children] || [], depth + 1, uuid2, currentPath);
|
22348
22400
|
}
|
@@ -22898,8 +22950,7 @@ var FormItem = defineComponent({
|
|
22898
22950
|
rules = props.rules;
|
22899
22951
|
}
|
22900
22952
|
rules = getTriggerRules(trigger, mergeRules(rules, getRulesFromProps(props)));
|
22901
|
-
|
22902
|
-
const value = form2.props.model[props.property];
|
22953
|
+
const value = lodash.exports.get(form2.props.model, props.property);
|
22903
22954
|
const doValidate = (() => {
|
22904
22955
|
let stepIndex = -1;
|
22905
22956
|
return () => {
|