bkui-vue 0.0.1-beta.46 → 0.0.1-beta.47
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 +303 -213
- package/dist/index.umd.js +20 -20
- package/dist/style.css +1 -1
- package/lib/checkbox/checkbox.css +12 -0
- package/lib/checkbox/checkbox.d.ts +5 -11
- package/lib/checkbox/checkbox.less +17 -0
- package/lib/checkbox/checkbox.variable.css +12 -0
- package/lib/checkbox/common.d.ts +3 -3
- package/lib/checkbox/index.d.ts +10 -18
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/type.d.ts +2 -6
- package/lib/form/compose-form-item.d.ts +16 -0
- package/lib/form/form.css +73 -12
- package/lib/form/form.less +120 -46
- package/lib/form/form.variable.css +167 -12
- package/lib/form/index.d.ts +17 -1
- package/lib/form/index.js +1 -1
- package/lib/icon/index.js +1 -0
- package/lib/icon/info-line.js +1 -0
- package/lib/icon/info.js +1 -0
- package/lib/icon/left-shape.js +1 -0
- package/lib/icon/play-shape.js +1 -0
- package/lib/icon/plus.js +1 -0
- package/lib/icon/qq.js +1 -0
- package/lib/icon/right-shape.js +1 -0
- package/lib/icon/search.js +1 -0
- package/lib/icon/share.js +1 -0
- package/lib/icon/spinner.js +1 -0
- package/lib/icon/success.js +1 -0
- package/lib/icon/switcher-loading.js +1 -0
- package/lib/icon/text-file.js +1 -0
- package/lib/icon/tree-application-shape.js +1 -0
- package/lib/icon/unvisible.js +1 -0
- package/lib/icon/up-shape.js +1 -0
- package/lib/icon/warn.js +1 -0
- package/lib/icon/weixin.js +1 -0
- package/lib/input/index.js +1 -0
- package/lib/link/index.js +1 -0
- package/lib/loading/index.js +1 -0
- package/lib/menu/index.js +1 -0
- package/lib/message/index.js +1 -0
- package/lib/modal/index.js +1 -0
- package/lib/navigation/index.js +1 -0
- package/lib/notify/index.js +1 -0
- package/lib/pagination/index.js +1 -0
- package/lib/popover/index.js +1 -0
- package/lib/process/index.js +1 -0
- package/lib/progress/index.js +1 -0
- package/lib/radio/common.d.ts +5 -5
- package/lib/radio/index.d.ts +17 -16
- package/lib/radio/index.js +1 -0
- package/lib/radio/radio-button.d.ts +5 -4
- package/lib/radio/radio.css +2 -2
- package/lib/radio/radio.d.ts +4 -4
- package/lib/radio/radio.less +2 -2
- package/lib/radio/radio.variable.css +2 -2
- package/lib/radio/type.d.ts +9 -4
- package/lib/rate/index.js +1 -0
- package/lib/resize-layout/index.js +1 -0
- package/lib/select/index.js +1 -0
- package/lib/shared/index.js +1 -0
- package/lib/sideslider/index.js +1 -0
- package/lib/slider/index.js +1 -0
- package/lib/steps/index.js +1 -0
- package/lib/swiper/index.js +1 -0
- package/lib/switcher/index.js +1 -0
- package/lib/tab/index.js +1 -0
- package/lib/table/index.js +1 -0
- package/lib/table/table.css +90 -0
- package/lib/table/table.d.ts +0 -1
- package/lib/table/table.less +2 -1
- package/lib/table/table.variable.css +104 -14
- package/lib/tag/index.js +1 -0
- package/lib/tag-input/index.js +1 -0
- package/lib/timeline/index.js +1 -0
- package/lib/transfer/index.js +1 -0
- package/lib/tree/index.js +1 -0
- package/lib/virtual-render/index.js +1 -0
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
@@ -93,7 +93,7 @@ const BKLAYERD_INDEX_EFAULT_VALUE = {
|
|
93
93
|
};
|
94
94
|
class BKZIndexManager {
|
95
95
|
constructor() {
|
96
|
-
this
|
96
|
+
__publicField(this, "storageLayerIndexValue", {});
|
97
97
|
this.copyDefaultValue();
|
98
98
|
}
|
99
99
|
getNextIndex(type) {
|
@@ -204,20 +204,20 @@ function isShadowRoot(node) {
|
|
204
204
|
}
|
205
205
|
function applyStyles(_ref) {
|
206
206
|
var state = _ref.state;
|
207
|
-
Object.keys(state.elements).forEach(function(
|
208
|
-
var style = state.styles[
|
209
|
-
var attributes = state.attributes[
|
210
|
-
var element = state.elements[
|
207
|
+
Object.keys(state.elements).forEach(function(name2) {
|
208
|
+
var style = state.styles[name2] || {};
|
209
|
+
var attributes = state.attributes[name2] || {};
|
210
|
+
var element = state.elements[name2];
|
211
211
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
212
212
|
return;
|
213
213
|
}
|
214
214
|
Object.assign(element.style, style);
|
215
|
-
Object.keys(attributes).forEach(function(
|
216
|
-
var value = attributes[
|
215
|
+
Object.keys(attributes).forEach(function(name3) {
|
216
|
+
var value = attributes[name3];
|
217
217
|
if (value === false) {
|
218
|
-
element.removeAttribute(
|
218
|
+
element.removeAttribute(name3);
|
219
219
|
} else {
|
220
|
-
element.setAttribute(
|
220
|
+
element.setAttribute(name3, value === true ? "" : value);
|
221
221
|
}
|
222
222
|
});
|
223
223
|
});
|
@@ -242,10 +242,10 @@ function effect$2(_ref2) {
|
|
242
242
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
243
243
|
}
|
244
244
|
return function() {
|
245
|
-
Object.keys(state.elements).forEach(function(
|
246
|
-
var element = state.elements[
|
247
|
-
var attributes = state.attributes[
|
248
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(
|
245
|
+
Object.keys(state.elements).forEach(function(name2) {
|
246
|
+
var element = state.elements[name2];
|
247
|
+
var attributes = state.attributes[name2] || {};
|
248
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name2) ? state.styles[name2] : initialStyles[name2]);
|
249
249
|
var style = styleProperties.reduce(function(style2, property) {
|
250
250
|
style2[property] = "";
|
251
251
|
return style2;
|
@@ -424,7 +424,7 @@ var toPaddingObject = function toPaddingObject2(padding, state) {
|
|
424
424
|
};
|
425
425
|
function arrow(_ref) {
|
426
426
|
var _state$modifiersData$;
|
427
|
-
var state = _ref.state,
|
427
|
+
var state = _ref.state, name2 = _ref.name, options = _ref.options;
|
428
428
|
var arrowElement = state.elements.arrow;
|
429
429
|
var popperOffsets2 = state.modifiersData.popperOffsets;
|
430
430
|
var basePlacement = getBasePlacement(state.placement);
|
@@ -448,7 +448,7 @@ function arrow(_ref) {
|
|
448
448
|
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
449
449
|
var offset2 = within(min2, center, max2);
|
450
450
|
var axisProp = axis;
|
451
|
-
state.modifiersData[
|
451
|
+
state.modifiersData[name2] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
452
452
|
}
|
453
453
|
function effect$1(_ref2) {
|
454
454
|
var state = _ref2.state, options = _ref2.options;
|
@@ -904,8 +904,8 @@ function getExpandedFallbackPlacements(placement) {
|
|
904
904
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
905
905
|
}
|
906
906
|
function flip(_ref) {
|
907
|
-
var state = _ref.state, options = _ref.options,
|
908
|
-
if (state.modifiersData[
|
907
|
+
var state = _ref.state, options = _ref.options, name2 = _ref.name;
|
908
|
+
if (state.modifiersData[name2]._skip) {
|
909
909
|
return;
|
910
910
|
}
|
911
911
|
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;
|
@@ -985,7 +985,7 @@ function flip(_ref) {
|
|
985
985
|
}
|
986
986
|
}
|
987
987
|
if (state.placement !== firstFittingPlacement) {
|
988
|
-
state.modifiersData[
|
988
|
+
state.modifiersData[name2]._skip = true;
|
989
989
|
state.placement = firstFittingPlacement;
|
990
990
|
state.reset = true;
|
991
991
|
}
|
@@ -1020,7 +1020,7 @@ function isAnySideFullyClipped(overflow) {
|
|
1020
1020
|
});
|
1021
1021
|
}
|
1022
1022
|
function hide(_ref) {
|
1023
|
-
var state = _ref.state,
|
1023
|
+
var state = _ref.state, name2 = _ref.name;
|
1024
1024
|
var referenceRect = state.rects.reference;
|
1025
1025
|
var popperRect = state.rects.popper;
|
1026
1026
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
@@ -1034,7 +1034,7 @@ function hide(_ref) {
|
|
1034
1034
|
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
1035
1035
|
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
1036
1036
|
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
1037
|
-
state.modifiersData[
|
1037
|
+
state.modifiersData[name2] = {
|
1038
1038
|
referenceClippingOffsets,
|
1039
1039
|
popperEscapeOffsets,
|
1040
1040
|
isReferenceHidden,
|
@@ -1069,7 +1069,7 @@ function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
1069
1069
|
};
|
1070
1070
|
}
|
1071
1071
|
function offset(_ref2) {
|
1072
|
-
var state = _ref2.state, options = _ref2.options,
|
1072
|
+
var state = _ref2.state, options = _ref2.options, name2 = _ref2.name;
|
1073
1073
|
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
1074
1074
|
var data2 = placements$1.reduce(function(acc, placement) {
|
1075
1075
|
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
@@ -1080,7 +1080,7 @@ function offset(_ref2) {
|
|
1080
1080
|
state.modifiersData.popperOffsets.x += x2;
|
1081
1081
|
state.modifiersData.popperOffsets.y += y2;
|
1082
1082
|
}
|
1083
|
-
state.modifiersData[
|
1083
|
+
state.modifiersData[name2] = data2;
|
1084
1084
|
}
|
1085
1085
|
var offset$1 = {
|
1086
1086
|
name: "offset",
|
@@ -1090,8 +1090,8 @@ var offset$1 = {
|
|
1090
1090
|
fn: offset
|
1091
1091
|
};
|
1092
1092
|
function popperOffsets(_ref) {
|
1093
|
-
var state = _ref.state,
|
1094
|
-
state.modifiersData[
|
1093
|
+
var state = _ref.state, name2 = _ref.name;
|
1094
|
+
state.modifiersData[name2] = computeOffsets({
|
1095
1095
|
reference: state.rects.reference,
|
1096
1096
|
element: state.rects.popper,
|
1097
1097
|
strategy: "absolute",
|
@@ -1109,7 +1109,7 @@ function getAltAxis(axis) {
|
|
1109
1109
|
return axis === "x" ? "y" : "x";
|
1110
1110
|
}
|
1111
1111
|
function preventOverflow(_ref) {
|
1112
|
-
var state = _ref.state, options = _ref.options,
|
1112
|
+
var state = _ref.state, options = _ref.options, name2 = _ref.name;
|
1113
1113
|
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;
|
1114
1114
|
var overflow = detectOverflow(state, {
|
1115
1115
|
boundary,
|
@@ -1190,7 +1190,7 @@ function preventOverflow(_ref) {
|
|
1190
1190
|
popperOffsets2[altAxis] = _preventedOffset;
|
1191
1191
|
data2[altAxis] = _preventedOffset - _offset;
|
1192
1192
|
}
|
1193
|
-
state.modifiersData[
|
1193
|
+
state.modifiersData[name2] = data2;
|
1194
1194
|
}
|
1195
1195
|
var preventOverflow$1 = {
|
1196
1196
|
name: "preventOverflow",
|
@@ -1391,12 +1391,12 @@ function popperGenerator(generatorOptions) {
|
|
1391
1391
|
index = -1;
|
1392
1392
|
continue;
|
1393
1393
|
}
|
1394
|
-
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
1394
|
+
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name2 = _state$orderedModifie.name;
|
1395
1395
|
if (typeof fn2 === "function") {
|
1396
1396
|
state = fn2({
|
1397
1397
|
state,
|
1398
1398
|
options: _options,
|
1399
|
-
name,
|
1399
|
+
name: name2,
|
1400
1400
|
instance
|
1401
1401
|
}) || state;
|
1402
1402
|
}
|
@@ -1423,11 +1423,11 @@ function popperGenerator(generatorOptions) {
|
|
1423
1423
|
});
|
1424
1424
|
function runModifierEffects() {
|
1425
1425
|
state.orderedModifiers.forEach(function(_ref3) {
|
1426
|
-
var
|
1426
|
+
var name2 = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
1427
1427
|
if (typeof effect2 === "function") {
|
1428
1428
|
var cleanupFn = effect2({
|
1429
1429
|
state,
|
1430
|
-
name,
|
1430
|
+
name: name2,
|
1431
1431
|
instance,
|
1432
1432
|
options: options2
|
1433
1433
|
});
|
@@ -1529,21 +1529,22 @@ function isElement$1(obj) {
|
|
1529
1529
|
}
|
1530
1530
|
class BKPopover {
|
1531
1531
|
constructor(reference2, popperRefer, options) {
|
1532
|
+
__publicField(this, "isShow", false);
|
1533
|
+
__publicField(this, "trigger");
|
1534
|
+
__publicField(this, "instance");
|
1535
|
+
__publicField(this, "reference");
|
1536
|
+
__publicField(this, "referenceTarget");
|
1537
|
+
__publicField(this, "popperRefer");
|
1538
|
+
__publicField(this, "instanceOptions");
|
1539
|
+
__publicField(this, "delay", 50);
|
1540
|
+
__publicField(this, "isInnerPopper", false);
|
1541
|
+
__publicField(this, "disabled", false);
|
1542
|
+
__publicField(this, "afterShow", null);
|
1543
|
+
__publicField(this, "afterHidden", null);
|
1544
|
+
__publicField(this, "appendTo", "parent");
|
1545
|
+
__publicField(this, "container", null);
|
1546
|
+
__publicField(this, "fixOnBoundary", false);
|
1532
1547
|
var _a, _b;
|
1533
|
-
this.isShow = false;
|
1534
|
-
this.trigger = void 0;
|
1535
|
-
this.instance = void 0;
|
1536
|
-
this.reference = void 0;
|
1537
|
-
this.referenceTarget = void 0;
|
1538
|
-
this.popperRefer = void 0;
|
1539
|
-
this.delay = 50;
|
1540
|
-
this.isInnerPopper = false;
|
1541
|
-
this.disabled = false;
|
1542
|
-
this.afterShow = null;
|
1543
|
-
this.afterHidden = null;
|
1544
|
-
this.appendTo = "parent";
|
1545
|
-
this.container = null;
|
1546
|
-
this.fixOnBoundary = false;
|
1547
1548
|
this.instanceOptions = this.initDefaultOptions(options);
|
1548
1549
|
this.reference = this.resolveInputSelectorToHtmlElement(reference2);
|
1549
1550
|
this.popperRefer = this.resolveInputSelectorToHtmlElement(popperRefer);
|
@@ -1773,13 +1774,15 @@ const random = (n2, str = lowerStr) => {
|
|
1773
1774
|
};
|
1774
1775
|
class BkMaskManager {
|
1775
1776
|
constructor(config) {
|
1776
|
-
this
|
1777
|
-
this
|
1778
|
-
this
|
1779
|
-
this
|
1780
|
-
this
|
1781
|
-
this
|
1782
|
-
this
|
1777
|
+
__publicField(this, "mask");
|
1778
|
+
__publicField(this, "backupMask");
|
1779
|
+
__publicField(this, "multiInstance", false);
|
1780
|
+
__publicField(this, "uniqueMaskAttrTag", "");
|
1781
|
+
__publicField(this, "parentNode", document.body);
|
1782
|
+
__publicField(this, "activeInstance");
|
1783
|
+
__publicField(this, "zIndexStore", /* @__PURE__ */ new Map());
|
1784
|
+
__publicField(this, "lastUUID", null);
|
1785
|
+
__publicField(this, "maskStyle", {
|
1783
1786
|
position: "absolute",
|
1784
1787
|
left: 0,
|
1785
1788
|
top: 0,
|
@@ -1787,7 +1790,7 @@ class BkMaskManager {
|
|
1787
1790
|
right: 0,
|
1788
1791
|
display: "none",
|
1789
1792
|
"background-color": "rgba(0,0,0,.6)"
|
1790
|
-
};
|
1793
|
+
});
|
1791
1794
|
const { multiInstance = false, maskAttrTag = "auto", parentNode = document.body, maskStyle = {} } = config || {};
|
1792
1795
|
this.activeInstance = void 0;
|
1793
1796
|
this.multiInstance = multiInstance;
|
@@ -1890,6 +1893,8 @@ class BkMaskManager {
|
|
1890
1893
|
const bKMaskManager = new BkMaskManager({});
|
1891
1894
|
class BKPopIndexManager {
|
1892
1895
|
constructor() {
|
1896
|
+
__publicField(this, "popInstanceList");
|
1897
|
+
__publicField(this, "uuidAttrName");
|
1893
1898
|
this.popInstanceList = [];
|
1894
1899
|
this.uuidAttrName = "data-bk-pop-uuid";
|
1895
1900
|
}
|
@@ -2282,13 +2287,13 @@ class PropTypes extends propTypesNS {
|
|
2282
2287
|
default: "top"
|
2283
2288
|
});
|
2284
2289
|
}
|
2285
|
-
static commonType(types = [],
|
2286
|
-
return j(
|
2290
|
+
static commonType(types = [], name2 = "commonType") {
|
2291
|
+
return j(name2.replace(/^\S/, (s2) => s2.toUpperCase()), {
|
2287
2292
|
type: String,
|
2288
2293
|
validator: (val) => {
|
2289
2294
|
const valid = types.includes(val);
|
2290
2295
|
if (!valid) {
|
2291
|
-
console.error(`invalid ${
|
2296
|
+
console.error(`invalid ${name2}, ${val}, the ${name2} must be one of \u3010${types.join(" | ")}\u3011`);
|
2292
2297
|
}
|
2293
2298
|
return valid;
|
2294
2299
|
},
|
@@ -2352,7 +2357,7 @@ function generate(node, key, rootAttrs) {
|
|
2352
2357
|
const bkIcon = (props, context) => {
|
2353
2358
|
const _a = __spreadValues(__spreadValues({}, context.attrs), props), {
|
2354
2359
|
data: data2,
|
2355
|
-
name,
|
2360
|
+
name: name2,
|
2356
2361
|
width,
|
2357
2362
|
height,
|
2358
2363
|
fill
|
@@ -2364,7 +2369,7 @@ const bkIcon = (props, context) => {
|
|
2364
2369
|
"fill"
|
2365
2370
|
]);
|
2366
2371
|
const rootAttrs = `width: ${width}; height: ${height}; fill: ${fill}`;
|
2367
|
-
return createVNode("span", restProps, [generate(data2,
|
2372
|
+
return createVNode("span", restProps, [generate(data2, name2, rootAttrs)]);
|
2368
2373
|
};
|
2369
2374
|
bkIcon.inheritAttrs = false;
|
2370
2375
|
bkIcon.displayName = "bkIcon";
|
@@ -8678,10 +8683,10 @@ const checkboxGroupKey = Symbol("CheckboxGroup");
|
|
8678
8683
|
function useFocus$2() {
|
8679
8684
|
const isFocus = ref(false);
|
8680
8685
|
const blur = () => {
|
8681
|
-
isFocus.value =
|
8686
|
+
isFocus.value = false;
|
8682
8687
|
};
|
8683
8688
|
const focus = () => {
|
8684
|
-
isFocus.value =
|
8689
|
+
isFocus.value = true;
|
8685
8690
|
};
|
8686
8691
|
return [
|
8687
8692
|
isFocus,
|
@@ -8699,50 +8704,44 @@ const useCheckbox = () => {
|
|
8699
8704
|
} = currentInstance;
|
8700
8705
|
const checkboxGroup = inject(checkboxGroupKey, EMPTY_OBJ);
|
8701
8706
|
const isGroup = !isEmptyObj(checkboxGroup);
|
8702
|
-
const
|
8703
|
-
isLocalChecked: props.checked
|
8704
|
-
});
|
8705
|
-
const isChecked = computed(() => {
|
8706
|
-
if (isGroup) {
|
8707
|
-
return checkboxGroup.state.localValue.includes(props.label);
|
8708
|
-
}
|
8709
|
-
if (props.modelValue !== void 0) {
|
8710
|
-
if (props.modelValue === props.label || props.modelValue === props.trueLabel) {
|
8711
|
-
return true;
|
8712
|
-
}
|
8713
|
-
}
|
8714
|
-
return state.isLocalChecked;
|
8715
|
-
});
|
8716
|
-
state.isLocalChecked = isChecked.value;
|
8717
|
-
const value = computed(() => {
|
8718
|
-
if (isGroup) {
|
8719
|
-
return isChecked.value ? props.label : "";
|
8720
|
-
}
|
8721
|
-
if (isChecked.value) {
|
8722
|
-
return props.trueLabel !== "" ? props.trueLabel : props.label;
|
8723
|
-
}
|
8724
|
-
return props.falseLabel !== "" ? props.falseLabel : "";
|
8725
|
-
});
|
8707
|
+
const isChecked = ref(props.checked);
|
8726
8708
|
const isDisabled = computed(() => {
|
8727
8709
|
if (isGroup && checkboxGroup.props.disabled) {
|
8728
8710
|
return true;
|
8729
8711
|
}
|
8730
8712
|
return props.disabled;
|
8731
8713
|
});
|
8714
|
+
if (isGroup) {
|
8715
|
+
watch(() => checkboxGroup.props.modelValue, (modelValue) => {
|
8716
|
+
isChecked.value = modelValue.includes(props.label);
|
8717
|
+
});
|
8718
|
+
} else {
|
8719
|
+
watch(() => props.modelValue, (modelValue) => {
|
8720
|
+
if (modelValue === "") {
|
8721
|
+
return;
|
8722
|
+
}
|
8723
|
+
isChecked.value = modelValue === props.trueLabel;
|
8724
|
+
}, {
|
8725
|
+
immediate: true
|
8726
|
+
});
|
8727
|
+
}
|
8728
|
+
const setChecked = (value = true) => {
|
8729
|
+
isChecked.value = value;
|
8730
|
+
};
|
8732
8731
|
const handleChange = (event) => {
|
8733
8732
|
if (isDisabled.value) {
|
8734
8733
|
return;
|
8735
8734
|
}
|
8736
8735
|
const $targetInput = event.target;
|
8737
|
-
|
8738
|
-
|
8739
|
-
emit("
|
8736
|
+
isChecked.value = $targetInput.checked;
|
8737
|
+
const nextValue = isChecked.value ? props.trueLabel : props.falseLabel;
|
8738
|
+
emit("change", nextValue);
|
8739
|
+
emit("update:modelValue", nextValue);
|
8740
8740
|
if (isGroup) {
|
8741
|
-
checkboxGroup.handleChange(
|
8741
|
+
checkboxGroup.handleChange();
|
8742
8742
|
}
|
8743
8743
|
nextTick(() => {
|
8744
8744
|
if ($targetInput.checked !== isChecked.value) {
|
8745
|
-
state.isLocalChecked = isChecked.value;
|
8746
8745
|
$targetInput.checked = isChecked.value;
|
8747
8746
|
}
|
8748
8747
|
});
|
@@ -8758,16 +8757,16 @@ const useCheckbox = () => {
|
|
8758
8757
|
}
|
8759
8758
|
});
|
8760
8759
|
return {
|
8761
|
-
value,
|
8762
8760
|
isChecked,
|
8763
8761
|
isDisabled,
|
8762
|
+
setChecked,
|
8764
8763
|
handleChange
|
8765
8764
|
};
|
8766
8765
|
};
|
8767
8766
|
const checkboxProps = {
|
8768
|
-
modelValue: PropTypes.oneOfType([String, Number, Boolean]).def(
|
8769
|
-
label: PropTypes.oneOfType([String, Number, Boolean])
|
8770
|
-
trueLabel: PropTypes.oneOfType([String, Number, Boolean]).def(
|
8767
|
+
modelValue: PropTypes.oneOfType([String, Number, Boolean]).def(""),
|
8768
|
+
label: PropTypes.oneOfType([String, Number, Boolean]),
|
8769
|
+
trueLabel: PropTypes.oneOfType([String, Number, Boolean]).def(true),
|
8771
8770
|
falseLabel: PropTypes.oneOfType([String, Number, Boolean]).def(""),
|
8772
8771
|
disabled: PropTypes.bool.def(false),
|
8773
8772
|
checked: PropTypes.bool.def(false),
|
@@ -8785,16 +8784,16 @@ var Component$o = defineComponent({
|
|
8785
8784
|
focus: handleFocus
|
8786
8785
|
}] = useFocus$2();
|
8787
8786
|
const {
|
8788
|
-
value,
|
8789
8787
|
isChecked,
|
8790
8788
|
isDisabled,
|
8789
|
+
setChecked,
|
8791
8790
|
handleChange
|
8792
8791
|
} = useCheckbox();
|
8793
8792
|
return {
|
8794
|
-
currentValue: value,
|
8795
8793
|
isFocus,
|
8796
8794
|
isChecked,
|
8797
8795
|
isDisabled,
|
8796
|
+
setChecked,
|
8798
8797
|
handleBlur,
|
8799
8798
|
handleFocus,
|
8800
8799
|
handleChange
|
@@ -8803,9 +8802,10 @@ var Component$o = defineComponent({
|
|
8803
8802
|
render() {
|
8804
8803
|
const checkboxClass = classes({
|
8805
8804
|
"bk-checkbox": true,
|
8806
|
-
"is-
|
8805
|
+
"is-focused": this.isFocus,
|
8807
8806
|
"is-checked": this.isChecked,
|
8808
|
-
"is-disabled": this.isDisabled
|
8807
|
+
"is-disabled": this.isDisabled,
|
8808
|
+
"is-indeterminated": this.indeterminate
|
8809
8809
|
});
|
8810
8810
|
return createVNode("label", {
|
8811
8811
|
"class": checkboxClass
|
@@ -8815,11 +8815,10 @@ var Component$o = defineComponent({
|
|
8815
8815
|
"role": "checkbox",
|
8816
8816
|
"type": "checkbox",
|
8817
8817
|
"class": "bk-checkbox-original",
|
8818
|
-
"value": this.currentValue,
|
8819
8818
|
"disabled": this.isDisabled,
|
8820
8819
|
"checked": this.isChecked,
|
8821
8820
|
"onChange": this.handleChange
|
8822
|
-
}, null)]), createVNode("span", {
|
8821
|
+
}, null)]), this.$slots.default ? this.$slots.default() : createVNode("span", {
|
8823
8822
|
"class": "bk-checkbox-label"
|
8824
8823
|
}, [this.label])]);
|
8825
8824
|
}
|
@@ -8834,12 +8833,6 @@ var CheckboxGroup = defineComponent({
|
|
8834
8833
|
props: checkboxGroupProps,
|
8835
8834
|
emits: ["change", "update:modelValue"],
|
8836
8835
|
setup(props, context) {
|
8837
|
-
const state = reactive({
|
8838
|
-
localValue: props.modelValue ? [...props.modelValue] : []
|
8839
|
-
});
|
8840
|
-
watch(() => props.modelValue, (modelValue = []) => {
|
8841
|
-
state.localValue = [...modelValue];
|
8842
|
-
});
|
8843
8836
|
const checkboxInstanceList = [];
|
8844
8837
|
const register = (checkboxContext) => {
|
8845
8838
|
checkboxInstanceList.push(checkboxContext);
|
@@ -8850,45 +8843,38 @@ var CheckboxGroup = defineComponent({
|
|
8850
8843
|
checkboxInstanceList.splice(index, 1);
|
8851
8844
|
}
|
8852
8845
|
};
|
8853
|
-
const handleChange = (
|
8854
|
-
|
8855
|
-
|
8856
|
-
|
8857
|
-
|
8858
|
-
|
8859
|
-
|
8860
|
-
result.push(item);
|
8861
|
-
}
|
8862
|
-
return result;
|
8863
|
-
}, []);
|
8864
|
-
}
|
8865
|
-
if (!props.modelValue) {
|
8866
|
-
state.localValue = nextValue;
|
8867
|
-
}
|
8846
|
+
const handleChange = () => {
|
8847
|
+
const nextValue = checkboxInstanceList.reduce((result, checkboxInstance) => {
|
8848
|
+
if (checkboxInstance.isChecked) {
|
8849
|
+
result.push(checkboxInstance.label);
|
8850
|
+
}
|
8851
|
+
return result;
|
8852
|
+
}, []);
|
8868
8853
|
context.emit("update:modelValue", nextValue);
|
8869
8854
|
context.emit("change", nextValue);
|
8870
8855
|
};
|
8871
8856
|
provide(checkboxGroupKey, {
|
8872
8857
|
name: "CheckboxGroup",
|
8873
8858
|
props,
|
8874
|
-
state,
|
8875
8859
|
register,
|
8876
8860
|
unregister,
|
8877
8861
|
handleChange
|
8878
8862
|
});
|
8879
8863
|
onMounted(() => {
|
8880
|
-
|
8881
|
-
|
8882
|
-
|
8864
|
+
const modelValue = props.modelValue || [];
|
8865
|
+
checkboxInstanceList.forEach((checkboxInstance) => {
|
8866
|
+
if (modelValue.includes(checkboxInstance.label)) {
|
8867
|
+
checkboxInstance.setChecked(true);
|
8883
8868
|
}
|
8884
8869
|
});
|
8885
8870
|
});
|
8886
8871
|
return {};
|
8887
8872
|
},
|
8888
8873
|
render() {
|
8874
|
+
var _a;
|
8889
8875
|
return createVNode("div", {
|
8890
8876
|
"class": "bk-checkbox-group"
|
8891
|
-
}, [this.$slots.default()]);
|
8877
|
+
}, [(_a = this.$slots) == null ? void 0 : _a.default()]);
|
8892
8878
|
}
|
8893
8879
|
});
|
8894
8880
|
const BkCheckbox = withInstallProps(Component$o, { Group: CheckboxGroup });
|
@@ -8928,7 +8914,7 @@ var Component$n = defineComponent({
|
|
8928
8914
|
}
|
8929
8915
|
if (props.activeName !== null && props.activeName !== void 0 && props.activeName !== "") {
|
8930
8916
|
const activeNames = resolvePropsActiveValue(props.activeName);
|
8931
|
-
return activeNames.map((
|
8917
|
+
return activeNames.map((name2) => collapseData.value.findIndex((item) => item[props.idFiled] === name2));
|
8932
8918
|
}
|
8933
8919
|
return resolvePropsActiveValue((_a = props.activeIndex) != null ? _a : 0);
|
8934
8920
|
});
|
@@ -9478,8 +9464,8 @@ var Component$i = defineComponent({
|
|
9478
9464
|
const newVal = handleNumber(props.step, false);
|
9479
9465
|
ctx.emit(EventEnum["update:modelValue"], newVal);
|
9480
9466
|
}
|
9481
|
-
function getCls(
|
9482
|
-
return `${inputClsPrefix.value}--${
|
9467
|
+
function getCls(name2) {
|
9468
|
+
return `${inputClsPrefix.value}--${name2}`;
|
9483
9469
|
}
|
9484
9470
|
function handleVisibleChange() {
|
9485
9471
|
pwdVisible.value = !pwdVisible.value;
|
@@ -9961,70 +9947,88 @@ var Component$f = defineComponent({
|
|
9961
9947
|
const BkProgress = withInstall(Component$f);
|
9962
9948
|
const radioGroupKey = Symbol("RadioGroup");
|
9963
9949
|
function useFocus$1() {
|
9964
|
-
const
|
9950
|
+
const isFocused = ref(false);
|
9965
9951
|
const blur = () => {
|
9966
|
-
|
9952
|
+
isFocused.value = false;
|
9967
9953
|
};
|
9968
9954
|
const focus = () => {
|
9969
|
-
|
9955
|
+
isFocused.value = true;
|
9970
9956
|
};
|
9971
9957
|
return [
|
9972
|
-
|
9958
|
+
isFocused,
|
9973
9959
|
{
|
9974
9960
|
blur,
|
9975
9961
|
focus
|
9976
9962
|
}
|
9977
9963
|
];
|
9978
9964
|
}
|
9979
|
-
|
9965
|
+
const useRadio = () => {
|
9966
|
+
const currentInstance = getCurrentInstance();
|
9980
9967
|
const {
|
9981
9968
|
props,
|
9982
9969
|
emit
|
9983
|
-
} =
|
9970
|
+
} = currentInstance;
|
9984
9971
|
const radioGroup = inject(radioGroupKey, EMPTY_OBJ);
|
9985
9972
|
const isGroup = !isEmptyObj(radioGroup);
|
9986
|
-
const
|
9987
|
-
isLocalChecked: props.checked
|
9988
|
-
});
|
9989
|
-
const isCheck = computed(() => {
|
9990
|
-
if (isGroup) {
|
9991
|
-
return radioGroup.state.localValue === props.label;
|
9992
|
-
}
|
9993
|
-
if (props.modelValue !== "") {
|
9994
|
-
return props.modelValue === props.label;
|
9995
|
-
}
|
9996
|
-
return state.isLocalChecked;
|
9997
|
-
});
|
9998
|
-
state.isLocalChecked = isCheck.value;
|
9973
|
+
const isChecked = ref(props.checked);
|
9999
9974
|
const isDisabled = computed(() => {
|
10000
9975
|
if (isGroup && radioGroup.props.disabled) {
|
10001
9976
|
return true;
|
10002
9977
|
}
|
10003
9978
|
return props.disabled;
|
10004
9979
|
});
|
10005
|
-
|
10006
|
-
|
10007
|
-
|
10008
|
-
}
|
10009
|
-
|
10010
|
-
|
10011
|
-
|
9980
|
+
if (isGroup) {
|
9981
|
+
watch(() => radioGroup.props.modelValue, (modelValue) => {
|
9982
|
+
isChecked.value = modelValue === props.label;
|
9983
|
+
});
|
9984
|
+
} else {
|
9985
|
+
watch(() => props.modelValue, (modelValue) => {
|
9986
|
+
if (modelValue === "") {
|
9987
|
+
return;
|
9988
|
+
}
|
9989
|
+
isChecked.value = modelValue === props.label;
|
9990
|
+
}, {
|
9991
|
+
immediate: true
|
9992
|
+
});
|
9993
|
+
}
|
9994
|
+
const setChecked = (value = true) => {
|
9995
|
+
isChecked.value = value;
|
9996
|
+
};
|
9997
|
+
const handleChange = (event) => {
|
10012
9998
|
if (isDisabled.value) {
|
10013
9999
|
return;
|
10014
10000
|
}
|
10015
|
-
|
10016
|
-
|
10001
|
+
const $targetInput = event.target;
|
10002
|
+
isChecked.value = $targetInput.checked;
|
10003
|
+
const nextValue = isChecked.value ? props.label : "";
|
10004
|
+
emit("change", nextValue);
|
10005
|
+
emit("update:modelValue", nextValue);
|
10017
10006
|
if (isGroup) {
|
10018
|
-
radioGroup.handleChange(
|
10007
|
+
radioGroup.handleChange(currentInstance.proxy);
|
10019
10008
|
}
|
10009
|
+
nextTick(() => {
|
10010
|
+
if ($targetInput.checked !== isChecked.value) {
|
10011
|
+
$targetInput.checked = isChecked.value;
|
10012
|
+
}
|
10013
|
+
});
|
10020
10014
|
};
|
10015
|
+
onMounted(() => {
|
10016
|
+
if (isGroup) {
|
10017
|
+
radioGroup.register(currentInstance.proxy);
|
10018
|
+
}
|
10019
|
+
});
|
10020
|
+
onBeforeUnmount(() => {
|
10021
|
+
if (isGroup) {
|
10022
|
+
radioGroup.unregister(currentInstance.proxy);
|
10023
|
+
}
|
10024
|
+
});
|
10021
10025
|
return {
|
10022
|
-
|
10023
|
-
isCheck,
|
10026
|
+
isChecked,
|
10024
10027
|
isDisabled,
|
10025
|
-
|
10028
|
+
setChecked,
|
10029
|
+
handleChange
|
10026
10030
|
};
|
10027
|
-
}
|
10031
|
+
};
|
10028
10032
|
const radioProps = {
|
10029
10033
|
name: PropTypes.string.def(""),
|
10030
10034
|
label: PropTypes.oneOfType([String, Number, Boolean]).isRequired,
|
@@ -10037,32 +10041,32 @@ var Component$e = defineComponent({
|
|
10037
10041
|
props: radioProps,
|
10038
10042
|
emits: ["change", "update:modelValue"],
|
10039
10043
|
setup() {
|
10040
|
-
const [
|
10044
|
+
const [isFocused, {
|
10041
10045
|
blur: handleBlur,
|
10042
10046
|
focus: handleFocus
|
10043
10047
|
}] = useFocus$1();
|
10044
10048
|
const {
|
10045
|
-
|
10046
|
-
isCheck,
|
10049
|
+
isChecked,
|
10047
10050
|
isDisabled,
|
10048
|
-
|
10051
|
+
setChecked,
|
10052
|
+
handleChange
|
10049
10053
|
} = useRadio();
|
10050
10054
|
return {
|
10051
|
-
|
10052
|
-
|
10053
|
-
isCheck,
|
10055
|
+
isFocused,
|
10056
|
+
isChecked,
|
10054
10057
|
isDisabled,
|
10058
|
+
setChecked,
|
10055
10059
|
handleBlur,
|
10056
10060
|
handleFocus,
|
10057
|
-
|
10061
|
+
handleChange
|
10058
10062
|
};
|
10059
10063
|
},
|
10060
10064
|
render() {
|
10061
10065
|
const radioClass = classes({
|
10062
10066
|
"bk-radio": true,
|
10063
|
-
"is-
|
10067
|
+
"is-focused": this.isFocused,
|
10064
10068
|
"is-disabled": this.isDisabled,
|
10065
|
-
"is-checked": this.
|
10069
|
+
"is-checked": this.isChecked
|
10066
10070
|
});
|
10067
10071
|
return createVNode("label", {
|
10068
10072
|
"class": radioClass,
|
@@ -10071,13 +10075,12 @@ var Component$e = defineComponent({
|
|
10071
10075
|
"class": "bk-radio-input",
|
10072
10076
|
"type": "radio",
|
10073
10077
|
"tabindex": "0",
|
10074
|
-
"name": this.realName,
|
10075
10078
|
"value": this.label,
|
10076
|
-
"checked": this.
|
10079
|
+
"checked": this.isChecked,
|
10077
10080
|
"disabled": this.isDisabled,
|
10078
10081
|
"onFocus": this.handleFocus,
|
10079
10082
|
"onBlur": this.handleBlur,
|
10080
|
-
"onChange": this.
|
10083
|
+
"onChange": this.handleChange
|
10081
10084
|
}, null), createVNode("span", {
|
10082
10085
|
"class": "bk-radio-text"
|
10083
10086
|
}, [this.$slots.default ? this.$slots.default() : this.label])]);
|
@@ -10096,32 +10099,33 @@ var RadioButton = defineComponent({
|
|
10096
10099
|
props: radioButtonProps,
|
10097
10100
|
emits: ["change", "update:modelValue"],
|
10098
10101
|
setup() {
|
10099
|
-
const [
|
10102
|
+
const [isFocused, {
|
10100
10103
|
blur: handleBlur,
|
10101
10104
|
focus: handleFocus
|
10102
10105
|
}] = useFocus$1();
|
10103
10106
|
const {
|
10104
|
-
|
10105
|
-
isCheck,
|
10107
|
+
isChecked,
|
10106
10108
|
isDisabled,
|
10107
|
-
|
10109
|
+
setChecked,
|
10110
|
+
handleChange
|
10108
10111
|
} = useRadio();
|
10109
10112
|
return {
|
10110
|
-
|
10113
|
+
isFocused,
|
10111
10114
|
realName: name,
|
10112
|
-
|
10115
|
+
isChecked,
|
10113
10116
|
isDisabled,
|
10117
|
+
setChecked,
|
10114
10118
|
handleBlur,
|
10115
10119
|
handleFocus,
|
10116
|
-
|
10120
|
+
handleChange
|
10117
10121
|
};
|
10118
10122
|
},
|
10119
10123
|
render() {
|
10120
10124
|
const radioClass = classes({
|
10121
10125
|
"bk-radio-button": true,
|
10122
|
-
"is-
|
10126
|
+
"is-focused": this.isFocused,
|
10123
10127
|
"is-disabled": this.isDisabled,
|
10124
|
-
"is-checked": this.
|
10128
|
+
"is-checked": this.isChecked
|
10125
10129
|
});
|
10126
10130
|
return createVNode("label", {
|
10127
10131
|
"class": radioClass,
|
@@ -10130,13 +10134,12 @@ var RadioButton = defineComponent({
|
|
10130
10134
|
"class": "bk-radio-button-input",
|
10131
10135
|
"type": "radio",
|
10132
10136
|
"tabindex": "0",
|
10133
|
-
"name": this.realName,
|
10134
10137
|
"value": this.label,
|
10135
|
-
"checked": this.
|
10138
|
+
"checked": this.isChecked,
|
10136
10139
|
"disabled": this.isDisabled,
|
10137
10140
|
"onFocus": this.handleFocus,
|
10138
10141
|
"onBlur": this.handleBlur,
|
10139
|
-
"onChange": this.
|
10142
|
+
"onChange": this.handleChange
|
10140
10143
|
}, null), createVNode("div", {
|
10141
10144
|
"class": "bk-radio-button-text"
|
10142
10145
|
}, [this.$slots.default ? this.$slots.default() : this.label])]);
|
@@ -10152,21 +10155,40 @@ var RadioGroup = defineComponent({
|
|
10152
10155
|
props: radioGroupProps,
|
10153
10156
|
emits: ["change", "update:modelValue"],
|
10154
10157
|
setup(props, context) {
|
10155
|
-
const
|
10156
|
-
|
10157
|
-
|
10158
|
-
|
10159
|
-
|
10160
|
-
|
10161
|
-
|
10162
|
-
|
10163
|
-
|
10158
|
+
const radioInstanceList = [];
|
10159
|
+
const register = (radioContext) => {
|
10160
|
+
radioInstanceList.push(radioContext);
|
10161
|
+
};
|
10162
|
+
const unregister = (radioContext) => {
|
10163
|
+
const index = radioInstanceList.indexOf(radioContext);
|
10164
|
+
if (index > -1) {
|
10165
|
+
radioInstanceList.splice(index, 1);
|
10166
|
+
}
|
10167
|
+
};
|
10168
|
+
const handleChange = (checkedRadioInstance) => {
|
10169
|
+
const nextValue = checkedRadioInstance.label;
|
10170
|
+
radioInstanceList.forEach((radioInstance) => {
|
10171
|
+
if (radioInstance !== checkedRadioInstance) {
|
10172
|
+
radioInstance.setChecked(false);
|
10173
|
+
}
|
10174
|
+
});
|
10175
|
+
context.emit("update:modelValue", nextValue);
|
10176
|
+
context.emit("change", nextValue);
|
10164
10177
|
};
|
10165
10178
|
provide(radioGroupKey, {
|
10166
10179
|
props,
|
10167
|
-
|
10180
|
+
register,
|
10181
|
+
unregister,
|
10168
10182
|
handleChange
|
10169
10183
|
});
|
10184
|
+
onMounted(() => {
|
10185
|
+
if (props.modelValue === "") {
|
10186
|
+
return;
|
10187
|
+
}
|
10188
|
+
radioInstanceList.forEach((radioInstance) => {
|
10189
|
+
radioInstance.setChecked(radioInstance.label === props.modelValue);
|
10190
|
+
});
|
10191
|
+
});
|
10170
10192
|
return {};
|
10171
10193
|
},
|
10172
10194
|
render() {
|
@@ -12853,7 +12875,6 @@ var SortType = /* @__PURE__ */ ((SortType2) => {
|
|
12853
12875
|
SortType2["DESC"] = "desc";
|
12854
12876
|
return SortType2;
|
12855
12877
|
})(SortType || {});
|
12856
|
-
var headSort = "";
|
12857
12878
|
var HeadSort = defineComponent({
|
12858
12879
|
name: "HeadSort",
|
12859
12880
|
props: {
|
@@ -13112,7 +13133,6 @@ class TableRender {
|
|
13112
13133
|
})]);
|
13113
13134
|
}
|
13114
13135
|
}
|
13115
|
-
var headFilter = "";
|
13116
13136
|
var Component$4 = defineComponent({
|
13117
13137
|
name: "Table",
|
13118
13138
|
props: tableProps,
|
@@ -14253,11 +14273,11 @@ const tabNavEventProps = {
|
|
14253
14273
|
},
|
14254
14274
|
tabChange: {
|
14255
14275
|
type: Function,
|
14256
|
-
default: (
|
14276
|
+
default: (name2) => name2
|
14257
14277
|
},
|
14258
14278
|
tabRemove: {
|
14259
14279
|
type: Function,
|
14260
|
-
default: (
|
14280
|
+
default: (name2) => name2
|
14261
14281
|
},
|
14262
14282
|
tabSort: {
|
14263
14283
|
type: Function,
|
@@ -14325,7 +14345,7 @@ var TabNav = defineComponent({
|
|
14325
14345
|
return null;
|
14326
14346
|
}
|
14327
14347
|
const {
|
14328
|
-
name,
|
14348
|
+
name: name2,
|
14329
14349
|
label,
|
14330
14350
|
closable,
|
14331
14351
|
visible,
|
@@ -14335,7 +14355,7 @@ var TabNav = defineComponent({
|
|
14335
14355
|
if (!visible) {
|
14336
14356
|
return false;
|
14337
14357
|
}
|
14338
|
-
if (props.active ===
|
14358
|
+
if (props.active === name2) {
|
14339
14359
|
hasFindActive = true;
|
14340
14360
|
}
|
14341
14361
|
const renderLabel = (label2) => {
|
@@ -14354,7 +14374,7 @@ var TabNav = defineComponent({
|
|
14354
14374
|
return label2;
|
14355
14375
|
};
|
14356
14376
|
list.push({
|
14357
|
-
name,
|
14377
|
+
name: name2,
|
14358
14378
|
closable,
|
14359
14379
|
visible,
|
14360
14380
|
disabled,
|
@@ -14410,8 +14430,8 @@ var TabNav = defineComponent({
|
|
14410
14430
|
}
|
14411
14431
|
this.tabSort(this.dragStartIndex, index, sortType);
|
14412
14432
|
},
|
14413
|
-
handleTabChange(
|
14414
|
-
this.tabChange(
|
14433
|
+
handleTabChange(name2) {
|
14434
|
+
this.tabChange(name2);
|
14415
14435
|
},
|
14416
14436
|
handleTabRemove(index, panel) {
|
14417
14437
|
this.tabRemove(index, panel);
|
@@ -14435,7 +14455,7 @@ var TabNav = defineComponent({
|
|
14435
14455
|
return null;
|
14436
14456
|
}
|
14437
14457
|
const {
|
14438
|
-
name,
|
14458
|
+
name: name2,
|
14439
14459
|
disabled,
|
14440
14460
|
tabLabel
|
14441
14461
|
} = item;
|
@@ -14444,15 +14464,15 @@ var TabNav = defineComponent({
|
|
14444
14464
|
if (disabled) {
|
14445
14465
|
classNames.push("bk-tab-header--disabled");
|
14446
14466
|
}
|
14447
|
-
if (active ===
|
14467
|
+
if (active === name2) {
|
14448
14468
|
classNames.push("bk-tab-header--active");
|
14449
14469
|
}
|
14450
14470
|
return classNames.join(" ");
|
14451
14471
|
};
|
14452
14472
|
const getValue = (curentValue, parentValue) => curentValue || parentValue;
|
14453
14473
|
return createVNode("div", {
|
14454
|
-
"key":
|
14455
|
-
"onClick": () => this.handleTabChange(
|
14474
|
+
"key": name2,
|
14475
|
+
"onClick": () => this.handleTabChange(name2),
|
14456
14476
|
"draggable": getValue(item.sortable, sortable),
|
14457
14477
|
"onDragstart": (e) => dragstart(index, e),
|
14458
14478
|
"onDragenter": (e) => {
|
@@ -14599,10 +14619,10 @@ var Tab = defineComponent({
|
|
14599
14619
|
e
|
14600
14620
|
});
|
14601
14621
|
},
|
14602
|
-
tabChange(
|
14603
|
-
this.$emit("change",
|
14604
|
-
this.$emit("tab-change",
|
14605
|
-
this.$emit("update:active",
|
14622
|
+
tabChange(name2) {
|
14623
|
+
this.$emit("change", name2);
|
14624
|
+
this.$emit("tab-change", name2);
|
14625
|
+
this.$emit("update:active", name2);
|
14606
14626
|
},
|
14607
14627
|
tabRemove(index, panel) {
|
14608
14628
|
this.$emit("remove", index, panel);
|
@@ -20250,6 +20270,76 @@ var Component = defineComponent({
|
|
20250
20270
|
}
|
20251
20271
|
});
|
20252
20272
|
const BkTree = withInstall(Component);
|
20273
|
+
const isCustomComponent = (node) => node.__v_isVNode;
|
20274
|
+
var ComposeFormItem = defineComponent({
|
20275
|
+
name: "ComposeFormItem",
|
20276
|
+
props: {
|
20277
|
+
headBackgroundColor: {
|
20278
|
+
type: String,
|
20279
|
+
default: "#FAFBFD"
|
20280
|
+
},
|
20281
|
+
tailBackgroundColor: String
|
20282
|
+
},
|
20283
|
+
render() {
|
20284
|
+
if (!this.$slots.default) {
|
20285
|
+
return null;
|
20286
|
+
}
|
20287
|
+
const childrenArr = this.$slots.default();
|
20288
|
+
console.log("from render = ", childrenArr);
|
20289
|
+
if (childrenArr.length > 1) {
|
20290
|
+
const childrenLength = childrenArr.length;
|
20291
|
+
let startIndex = 0;
|
20292
|
+
let headChildren = null;
|
20293
|
+
while (startIndex < childrenLength) {
|
20294
|
+
if (isCustomComponent(childrenArr[startIndex])) {
|
20295
|
+
headChildren = childrenArr[startIndex];
|
20296
|
+
break;
|
20297
|
+
}
|
20298
|
+
startIndex = startIndex + 1;
|
20299
|
+
}
|
20300
|
+
let tailIndex = childrenLength - 1;
|
20301
|
+
let tailChildren = null;
|
20302
|
+
while (tailIndex >= 0 && tailIndex > startIndex) {
|
20303
|
+
if (isCustomComponent(childrenArr[tailIndex])) {
|
20304
|
+
tailChildren = childrenArr[tailIndex];
|
20305
|
+
break;
|
20306
|
+
}
|
20307
|
+
tailIndex = tailIndex - 1;
|
20308
|
+
}
|
20309
|
+
if (headChildren && tailChildren) {
|
20310
|
+
if (!headChildren.props) {
|
20311
|
+
headChildren.props = {};
|
20312
|
+
}
|
20313
|
+
let headChildClass = "bk-compose-form-item-head";
|
20314
|
+
if (headChildren.props.class) {
|
20315
|
+
headChildClass += ` ${headChildren.props.class}`;
|
20316
|
+
}
|
20317
|
+
if (this.headBackgroundColor) {
|
20318
|
+
headChildren.props.style = Object.assign(headChildren.props.style || {}, {
|
20319
|
+
"background-color": this.headBackgroundColor
|
20320
|
+
});
|
20321
|
+
}
|
20322
|
+
headChildren.props.class = headChildClass;
|
20323
|
+
if (!tailChildren.props) {
|
20324
|
+
tailChildren.props = {};
|
20325
|
+
}
|
20326
|
+
let tailChildStaticClass = "bk-compose-form-item-tail";
|
20327
|
+
if (tailChildren.props.class) {
|
20328
|
+
tailChildStaticClass += ` ${tailChildren.props.class}`;
|
20329
|
+
}
|
20330
|
+
if (this.tailBackgroundColor) {
|
20331
|
+
tailChildren.props.style = Object.assign(tailChildren.props.style || {}, {
|
20332
|
+
"background-color": this.tailBackgroundColor
|
20333
|
+
});
|
20334
|
+
}
|
20335
|
+
tailChildren.props.class = tailChildStaticClass;
|
20336
|
+
}
|
20337
|
+
}
|
20338
|
+
return h$1("div", {
|
20339
|
+
class: "bk-compose-form-item"
|
20340
|
+
}, childrenArr);
|
20341
|
+
}
|
20342
|
+
});
|
20253
20343
|
const formKey$1 = Symbol("form");
|
20254
20344
|
const getFormKey = () => formKey$1;
|
20255
20345
|
const formKey = getFormKey();
|
@@ -20544,7 +20634,7 @@ var FormItem = defineComponent({
|
|
20544
20634
|
}, [this.$slots.error ? this.$slots.error(this.errorMessage) : this.errorMessage])])]);
|
20545
20635
|
}
|
20546
20636
|
});
|
20547
|
-
const BkForm = withInstallProps(Form, { FormItem });
|
20637
|
+
const BkForm = withInstallProps(Form, { FormItem, ComposeFormItem });
|
20548
20638
|
var Dropdown = defineComponent({
|
20549
20639
|
name: "BkDropdown",
|
20550
20640
|
props: {
|