bkui-vue 0.0.1-beta.45 → 0.0.1-beta.48
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 +27 -27
- package/dist/index.esm.js +698 -319
- package/dist/index.umd.js +28 -28
- package/dist/style.css +1 -1
- package/lib/button/index.js +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/dialog/dialog.d.ts +89 -17
- package/lib/dialog/index.d.ts +191 -36
- package/lib/dialog/index.js +1 -1
- 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/funnel.d.ts +4 -0
- package/lib/icon/funnel.js +1 -0
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.js +1 -1
- package/lib/loading/index.js +1 -1
- package/lib/modal/index.d.ts +149 -1
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal.css +20 -0
- package/lib/modal/modal.d.ts +58 -0
- package/lib/modal/modal.less +25 -0
- package/lib/modal/modal.variable.css +20 -0
- package/lib/modal/props.mixin.d.ts +26 -0
- package/lib/popover/index.d.ts +33 -2
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.d.ts +16 -1
- package/lib/popover/props.d.ts +12 -0
- package/lib/radio/common.d.ts +5 -5
- package/lib/radio/index.d.ts +17 -16
- package/lib/radio/index.js +1 -1
- 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 -1
- package/lib/sideslider/index.d.ts +123 -1
- package/lib/sideslider/index.js +1 -1
- package/lib/sideslider/sideslider.d.ts +58 -0
- package/lib/slider/index.js +1 -1
- package/lib/switcher/switcher.less +2 -0
- 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/plugins/head-filter.css +68 -0
- package/lib/table/plugins/head-filter.less +83 -0
- package/lib/table/plugins/head-filter.variable.css +162 -0
- package/lib/table/plugins/head-sort.css +22 -0
- package/lib/table/plugins/head-sort.less +28 -0
- package/lib/table/plugins/head-sort.variable.css +116 -0
- package/lib/table/props.d.ts +8 -1
- package/lib/table/render.d.ts +10 -15
- package/lib/table/table.css +94 -26
- package/lib/table/table.less +9 -28
- package/lib/table/table.variable.css +108 -40
- package/lib/table/utils.d.ts +10 -1
- package/package.json +30 -16
- package/lib/dialog/dialog.css +0 -68
- package/lib/dialog/dialog.less +0 -80
- package/lib/dialog/dialog.variable.css +0 -68
package/dist/index.esm.js
CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
34
34
|
return value;
|
35
35
|
};
|
36
|
-
import { createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, Transition, getCurrentInstance, provide, inject,
|
36
|
+
import { createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, Transition, getCurrentInstance, provide, inject, nextTick, isVNode, createTextVNode, Fragment, toRefs, customRef, onBeforeMount, withDirectives, vShow, toRef, unref, resolveDirective, vModelText, watchEffect, onUpdated, render, onUnmounted, Teleport } from "vue";
|
37
37
|
var reset = "";
|
38
38
|
var alert = "";
|
39
39
|
var backtop = "";
|
@@ -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,45 +2369,54 @@ 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";
|
2371
2376
|
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":"M512 744.64L789.6 462.72 880 554.56 512 928 144 554.56 234.4 462.72 512 744.64z"}},{"type":"element","name":"path","attributes":{"d":"M144 187.68L234.4 96 512 377.76 789.6 96 880 187.68 512 561.28 144 187.68z"}}]}');
|
2372
2377
|
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":"M279.36 512L561.28 789.6 469.44 880 96 512 469.44 144 561.28 234.4 279.36 512z"}},{"type":"element","name":"path","attributes":{"d":"M836.32 144L928 234.4 646.08 512 928 789.6 836.32 880 462.72 512 836.32 144z"}}]}');
|
2373
|
-
const data$
|
2378
|
+
const data$y = 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":"M697.6 281.6l48 48-176 176 176 176-48 48-224-224L697.6 281.6z"}},{"type":"element","name":"path","attributes":{"d":"M505.6 281.6l48 48-176 176 176 176-48 48-224-224L505.6 281.6z"}}]}');
|
2374
2379
|
const angleDoubleLeft = (props, context) => {
|
2375
2380
|
const p2 = __spreadValues(__spreadValues({}, props), context.attrs);
|
2376
2381
|
return createVNode(bkIcon, mergeProps(p2, {
|
2377
|
-
"data": data$
|
2382
|
+
"data": data$y,
|
2378
2383
|
"name": "angleDoubleLeft"
|
2379
2384
|
}), null);
|
2380
2385
|
};
|
2381
2386
|
angleDoubleLeft.displayName = "angleDoubleLeft";
|
2382
2387
|
angleDoubleLeft.inheritAttrs = false;
|
2383
2388
|
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":"M744.64 512L462.72 789.6 554.56 880 928 512 554.56 144 462.72 234.4 744.64 512z"}},{"type":"element","name":"path","attributes":{"d":"M187.68 144L96 234.4 377.76 512 96 789.6 187.68 880 561.28 512 187.68 144z"}}]}');
|
2384
|
-
const data$
|
2389
|
+
const data$x = 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":"M358.4 729.6l-48-48 176-176-176-176 48-48 224 224L358.4 729.6z"}},{"type":"element","name":"path","attributes":{"d":"M550.4 729.6l-48-48 176-176-176-176 48-48 224 224L550.4 729.6z"}}]}');
|
2385
2390
|
const angleDoubleRight = (props, context) => {
|
2386
2391
|
const p2 = __spreadValues(__spreadValues({}, props), context.attrs);
|
2387
2392
|
return createVNode(bkIcon, mergeProps(p2, {
|
2388
|
-
"data": data$
|
2393
|
+
"data": data$x,
|
2389
2394
|
"name": "angleDoubleRight"
|
2390
2395
|
}), null);
|
2391
2396
|
};
|
2392
2397
|
angleDoubleRight.displayName = "angleDoubleRight";
|
2393
2398
|
angleDoubleRight.inheritAttrs = false;
|
2394
2399
|
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":"M512 279.36L789.6 561.28 880 469.44 512 96 144 469.44 234.4 561.28 512 279.36z"}},{"type":"element","name":"path","attributes":{"d":"M144 836.32L234.4 928 512 646.08 789.6 928 880 836.32 512 462.72 144 836.32z"}}]}');
|
2395
|
-
const data$
|
2400
|
+
const data$w = 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":"M512 256L96 704 187.04 704 512 704 836.96 704 928 704 512 256z"}}]}');
|
2396
2401
|
const angleDownFill = (props, context) => {
|
2397
2402
|
const p2 = __spreadValues(__spreadValues({}, props), context.attrs);
|
2398
2403
|
return createVNode(bkIcon, mergeProps(p2, {
|
2399
|
-
"data": data$
|
2404
|
+
"data": data$w,
|
2400
2405
|
"name": "angleDownFill"
|
2401
2406
|
}), null);
|
2402
2407
|
};
|
2403
2408
|
angleDownFill.displayName = "angleDownFill";
|
2404
2409
|
angleDownFill.inheritAttrs = false;
|
2405
|
-
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":"M512 762.56L98.72 349.28 189.28 258.72 512 581.44 834.72 258.72 925.28 349.28 512 762.56z"}}]}');
|
2410
|
+
const data$v = 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":"M512 762.56L98.72 349.28 189.28 258.72 512 581.44 834.72 258.72 925.28 349.28 512 762.56z"}}]}');
|
2411
|
+
const angleDownLine = (props, context) => {
|
2412
|
+
const p2 = __spreadValues(__spreadValues({}, props), context.attrs);
|
2413
|
+
return createVNode(bkIcon, mergeProps(p2, {
|
2414
|
+
"data": data$v,
|
2415
|
+
"name": "angleDownLine"
|
2416
|
+
}), null);
|
2417
|
+
};
|
2418
|
+
angleDownLine.displayName = "angleDownLine";
|
2419
|
+
angleDownLine.inheritAttrs = false;
|
2406
2420
|
const data$u = 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":"M288 448L336 400 512 576 688 400 736 448 512 672z"}}]}');
|
2407
2421
|
const angleDown = (props, context) => {
|
2408
2422
|
const p2 = __spreadValues(__spreadValues({}, props), context.attrs);
|
@@ -2589,6 +2603,7 @@ const folder = (props, context) => {
|
|
2589
2603
|
};
|
2590
2604
|
folder.displayName = "folder";
|
2591
2605
|
folder.inheritAttrs = false;
|
2606
|
+
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":"M860.8 128H163.2a32 32 0 0 0-27.36 52l295.2 336 0.96 0V896l160-82.72V516.8l0.96 0 295.2-336A32 32 0 0 0 860.8 128Z"}}]}');
|
2592
2607
|
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","class":"bk-icon","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;","overflow":"hidden","viewBox":"0 0 1024 1024"},"elements":[{"type":"element","name":"path","attributes":{"d":"M512 64C264 64 64 264 64 512c0 57.6 11.2 113.6 32 166.4V896c0 17.6 14.4 32 32 32h217.6C576 1019.2 836.8 908.8 928 678.4S908.8 187.2 678.4 96C625.6 75.2 569.6 64 512 64zM500.8 721.6c-27.2 0-48-20.8-48-48s20.8-48 48-48c27.2 0 48 20.8 48 48S528 721.6 500.8 721.6zM587.2 507.2c-36.8 20.8-48 35.2-48 62.4v14.4H464v-16c-3.2-44.8 11.2-70.4 51.2-92.8 36.8-22.4 48-35.2 48-60.8s-20.8-44.8-52.8-44.8c-28.8-1.6-52.8 19.2-56 48 0 1.6 0 1.6 0 3.2h-76.8c1.6-70.4 49.6-118.4 136-118.4 80 0 132.8 44.8 132.8 110.4C648 454.4 627.2 484.8 587.2 507.2z"}}]}');
|
2593
2608
|
JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","class":"bk-icon","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;","overflow":"hidden","viewBox":"0 0 1024 1024"},"elements":[{"type":"element","name":"path","attributes":{"d":"M512 64C264 64 64 264 64 512s200 448 448 448 448-200 448-448S760 64 512 64zM500.8 721.6c-27.2 0-48-20.8-48-48s20.8-48 48-48c27.2 0 48 20.8 48 48S528 721.6 500.8 721.6zM587.2 507.2c-36.8 20.8-48 35.2-48 62.4v14.4H464v-16c-3.2-44.8 11.2-70.4 51.2-92.8 36.8-22.4 48-35.2 48-60.8s-20.8-44.8-52.8-44.8c-28.8-1.6-52.8 19.2-56 48 0 1.6 0 1.6 0 3.2h-76.8c1.6-70.4 49.6-118.4 136-118.4 80 0 132.8 44.8 132.8 110.4C648 454.4 627.2 484.8 587.2 507.2z"}}]}');
|
2594
2609
|
const data$c = JSON.parse('{"type":"element","name":"svg","attributes":{"xmlns":"http://www.w3.org/2000/svg","class":"bk-icon","style":"width: 1em; height: 1em; vertical-align: middle;fill: currentColor;overflow: hidden;","overflow":"hidden","viewBox":"0 0 1024 1024"},"elements":[{"type":"element","name":"path","attributes":{"d":"M512 128c212.8 0 384 171.2 384 384S724.8 896 512 896 128 724.8 128 512 299.2 128 512 128M512 64C264 64 64 264 64 512s200 448 448 448 448-200 448-448S760 64 512 64z"}},{"type":"element","name":"path","attributes":{"d":"M548.8 673.6A48 48 0 0 1 500.8 721.6 48 48 0 0 1 452.8 673.6 48 48 0 0 1 548.8 673.6z"}},{"type":"element","name":"path","attributes":{"d":"M513.6 302.4c80 0 132.8 44.8 132.8 110.4 0 41.6-20.8 72-60.8 96-40 24-48 35.2-48 62.4v14.4H464v-16c-3.2-44.8 11.2-70.4 51.2-92.8 36.8-22.4 48-35.2 48-60.8s-20.8-44.8-52.8-44.8c-28.8-1.6-52.8 19.2-56 48 0 1.6 0 1.6 0 3.2h-76.8C377.6 352 427.2 302.4 513.6 302.4z"}}]}');
|
@@ -8510,13 +8525,13 @@ var Component$r = defineComponent({
|
|
8510
8525
|
var _a, _b;
|
8511
8526
|
return createVNode("div", {
|
8512
8527
|
"class": loadingWrapperCls.value
|
8513
|
-
}, [props.loading &&
|
8528
|
+
}, [props.loading && [createVNode("div", {
|
8514
8529
|
"class": containerCls.value
|
8515
8530
|
}, [indicator.value, hasTitle.value && createVNode("div", {
|
8516
8531
|
"class": "bk-loading-title"
|
8517
8532
|
}, [props.title])]), ctx.slots.default && createVNode("div", {
|
8518
8533
|
"class": "bk-loading-mask"
|
8519
|
-
}, null)]
|
8534
|
+
}, null)], (_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
8520
8535
|
};
|
8521
8536
|
}
|
8522
8537
|
});
|
@@ -8572,6 +8587,8 @@ var Component$q = defineComponent({
|
|
8572
8587
|
});
|
8573
8588
|
const loadingSize = computed(() => props.size === BkLoadingSize.Small ? BkLoadingSize.Mini : BkLoadingSize.Small);
|
8574
8589
|
const handleClick = () => {
|
8590
|
+
if (props.loading)
|
8591
|
+
return;
|
8575
8592
|
emit("click");
|
8576
8593
|
};
|
8577
8594
|
const handleMouseOver = () => {
|
@@ -8592,12 +8609,13 @@ var Component$q = defineComponent({
|
|
8592
8609
|
"onClick": handleClick,
|
8593
8610
|
"onMouseover": handleMouseOver,
|
8594
8611
|
"onMouseleave": handleMouseout
|
8595
|
-
}), [props.loading
|
8612
|
+
}), [props.loading ? createVNode(BkLoading, {
|
8613
|
+
"loading": true,
|
8596
8614
|
"class": `${btnClsPrefix}-loading`,
|
8597
8615
|
"mode": props.laodingMode,
|
8598
8616
|
"theme": loadingTheme.value,
|
8599
8617
|
"size": loadingSize.value
|
8600
|
-
}, null)
|
8618
|
+
}, null) : slots.default && createVNode("span", {
|
8601
8619
|
"class": `${btnClsPrefix}-text`
|
8602
8620
|
}, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)])]);
|
8603
8621
|
};
|
@@ -8665,10 +8683,10 @@ const checkboxGroupKey = Symbol("CheckboxGroup");
|
|
8665
8683
|
function useFocus$2() {
|
8666
8684
|
const isFocus = ref(false);
|
8667
8685
|
const blur = () => {
|
8668
|
-
isFocus.value =
|
8686
|
+
isFocus.value = false;
|
8669
8687
|
};
|
8670
8688
|
const focus = () => {
|
8671
|
-
isFocus.value =
|
8689
|
+
isFocus.value = true;
|
8672
8690
|
};
|
8673
8691
|
return [
|
8674
8692
|
isFocus,
|
@@ -8686,50 +8704,44 @@ const useCheckbox = () => {
|
|
8686
8704
|
} = currentInstance;
|
8687
8705
|
const checkboxGroup = inject(checkboxGroupKey, EMPTY_OBJ);
|
8688
8706
|
const isGroup = !isEmptyObj(checkboxGroup);
|
8689
|
-
const
|
8690
|
-
isLocalChecked: props.checked
|
8691
|
-
});
|
8692
|
-
const isChecked = computed(() => {
|
8693
|
-
if (isGroup) {
|
8694
|
-
return checkboxGroup.state.localValue.includes(props.label);
|
8695
|
-
}
|
8696
|
-
if (props.modelValue !== void 0) {
|
8697
|
-
if (props.modelValue === props.label || props.modelValue === props.trueLabel) {
|
8698
|
-
return true;
|
8699
|
-
}
|
8700
|
-
}
|
8701
|
-
return state.isLocalChecked;
|
8702
|
-
});
|
8703
|
-
state.isLocalChecked = isChecked.value;
|
8704
|
-
const value = computed(() => {
|
8705
|
-
if (isGroup) {
|
8706
|
-
return isChecked.value ? props.label : "";
|
8707
|
-
}
|
8708
|
-
if (isChecked.value) {
|
8709
|
-
return props.trueLabel !== "" ? props.trueLabel : props.label;
|
8710
|
-
}
|
8711
|
-
return props.falseLabel !== "" ? props.falseLabel : "";
|
8712
|
-
});
|
8707
|
+
const isChecked = ref(props.checked);
|
8713
8708
|
const isDisabled = computed(() => {
|
8714
8709
|
if (isGroup && checkboxGroup.props.disabled) {
|
8715
8710
|
return true;
|
8716
8711
|
}
|
8717
8712
|
return props.disabled;
|
8718
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
|
+
};
|
8719
8731
|
const handleChange = (event) => {
|
8720
8732
|
if (isDisabled.value) {
|
8721
8733
|
return;
|
8722
8734
|
}
|
8723
8735
|
const $targetInput = event.target;
|
8724
|
-
|
8725
|
-
|
8726
|
-
emit("
|
8736
|
+
isChecked.value = $targetInput.checked;
|
8737
|
+
const nextValue = isChecked.value ? props.trueLabel : props.falseLabel;
|
8738
|
+
emit("change", nextValue);
|
8739
|
+
emit("update:modelValue", nextValue);
|
8727
8740
|
if (isGroup) {
|
8728
|
-
checkboxGroup.handleChange(
|
8741
|
+
checkboxGroup.handleChange();
|
8729
8742
|
}
|
8730
8743
|
nextTick(() => {
|
8731
8744
|
if ($targetInput.checked !== isChecked.value) {
|
8732
|
-
state.isLocalChecked = isChecked.value;
|
8733
8745
|
$targetInput.checked = isChecked.value;
|
8734
8746
|
}
|
8735
8747
|
});
|
@@ -8745,16 +8757,16 @@ const useCheckbox = () => {
|
|
8745
8757
|
}
|
8746
8758
|
});
|
8747
8759
|
return {
|
8748
|
-
value,
|
8749
8760
|
isChecked,
|
8750
8761
|
isDisabled,
|
8762
|
+
setChecked,
|
8751
8763
|
handleChange
|
8752
8764
|
};
|
8753
8765
|
};
|
8754
8766
|
const checkboxProps = {
|
8755
|
-
modelValue: PropTypes.oneOfType([String, Number, Boolean]).def(
|
8756
|
-
label: PropTypes.oneOfType([String, Number, Boolean])
|
8757
|
-
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),
|
8758
8770
|
falseLabel: PropTypes.oneOfType([String, Number, Boolean]).def(""),
|
8759
8771
|
disabled: PropTypes.bool.def(false),
|
8760
8772
|
checked: PropTypes.bool.def(false),
|
@@ -8772,16 +8784,16 @@ var Component$o = defineComponent({
|
|
8772
8784
|
focus: handleFocus
|
8773
8785
|
}] = useFocus$2();
|
8774
8786
|
const {
|
8775
|
-
value,
|
8776
8787
|
isChecked,
|
8777
8788
|
isDisabled,
|
8789
|
+
setChecked,
|
8778
8790
|
handleChange
|
8779
8791
|
} = useCheckbox();
|
8780
8792
|
return {
|
8781
|
-
currentValue: value,
|
8782
8793
|
isFocus,
|
8783
8794
|
isChecked,
|
8784
8795
|
isDisabled,
|
8796
|
+
setChecked,
|
8785
8797
|
handleBlur,
|
8786
8798
|
handleFocus,
|
8787
8799
|
handleChange
|
@@ -8790,9 +8802,10 @@ var Component$o = defineComponent({
|
|
8790
8802
|
render() {
|
8791
8803
|
const checkboxClass = classes({
|
8792
8804
|
"bk-checkbox": true,
|
8793
|
-
"is-
|
8805
|
+
"is-focused": this.isFocus,
|
8794
8806
|
"is-checked": this.isChecked,
|
8795
|
-
"is-disabled": this.isDisabled
|
8807
|
+
"is-disabled": this.isDisabled,
|
8808
|
+
"is-indeterminated": this.indeterminate
|
8796
8809
|
});
|
8797
8810
|
return createVNode("label", {
|
8798
8811
|
"class": checkboxClass
|
@@ -8802,11 +8815,10 @@ var Component$o = defineComponent({
|
|
8802
8815
|
"role": "checkbox",
|
8803
8816
|
"type": "checkbox",
|
8804
8817
|
"class": "bk-checkbox-original",
|
8805
|
-
"value": this.currentValue,
|
8806
8818
|
"disabled": this.isDisabled,
|
8807
8819
|
"checked": this.isChecked,
|
8808
8820
|
"onChange": this.handleChange
|
8809
|
-
}, null)]), createVNode("span", {
|
8821
|
+
}, null)]), this.$slots.default ? this.$slots.default() : createVNode("span", {
|
8810
8822
|
"class": "bk-checkbox-label"
|
8811
8823
|
}, [this.label])]);
|
8812
8824
|
}
|
@@ -8816,17 +8828,11 @@ const checkboxGroupProps = {
|
|
8816
8828
|
modelValue: PropTypes.array,
|
8817
8829
|
disabled: PropTypes.bool
|
8818
8830
|
};
|
8819
|
-
var
|
8831
|
+
var BkCheckboxGroup = defineComponent({
|
8820
8832
|
name: "CheckboxGroup",
|
8821
8833
|
props: checkboxGroupProps,
|
8822
8834
|
emits: ["change", "update:modelValue"],
|
8823
8835
|
setup(props, context) {
|
8824
|
-
const state = reactive({
|
8825
|
-
localValue: props.modelValue ? [...props.modelValue] : []
|
8826
|
-
});
|
8827
|
-
watch(() => props.modelValue, (modelValue = []) => {
|
8828
|
-
state.localValue = [...modelValue];
|
8829
|
-
});
|
8830
8836
|
const checkboxInstanceList = [];
|
8831
8837
|
const register = (checkboxContext) => {
|
8832
8838
|
checkboxInstanceList.push(checkboxContext);
|
@@ -8837,48 +8843,41 @@ var CheckboxGroup = defineComponent({
|
|
8837
8843
|
checkboxInstanceList.splice(index, 1);
|
8838
8844
|
}
|
8839
8845
|
};
|
8840
|
-
const handleChange = (
|
8841
|
-
|
8842
|
-
|
8843
|
-
|
8844
|
-
|
8845
|
-
|
8846
|
-
|
8847
|
-
result.push(item);
|
8848
|
-
}
|
8849
|
-
return result;
|
8850
|
-
}, []);
|
8851
|
-
}
|
8852
|
-
if (!props.modelValue) {
|
8853
|
-
state.localValue = nextValue;
|
8854
|
-
}
|
8846
|
+
const handleChange = () => {
|
8847
|
+
const nextValue = checkboxInstanceList.reduce((result, checkboxInstance) => {
|
8848
|
+
if (checkboxInstance.isChecked) {
|
8849
|
+
result.push(checkboxInstance.label);
|
8850
|
+
}
|
8851
|
+
return result;
|
8852
|
+
}, []);
|
8855
8853
|
context.emit("update:modelValue", nextValue);
|
8856
8854
|
context.emit("change", nextValue);
|
8857
8855
|
};
|
8858
8856
|
provide(checkboxGroupKey, {
|
8859
8857
|
name: "CheckboxGroup",
|
8860
8858
|
props,
|
8861
|
-
state,
|
8862
8859
|
register,
|
8863
8860
|
unregister,
|
8864
8861
|
handleChange
|
8865
8862
|
});
|
8866
8863
|
onMounted(() => {
|
8867
|
-
|
8868
|
-
|
8869
|
-
|
8864
|
+
const modelValue = props.modelValue || [];
|
8865
|
+
checkboxInstanceList.forEach((checkboxInstance) => {
|
8866
|
+
if (modelValue.includes(checkboxInstance.label)) {
|
8867
|
+
checkboxInstance.setChecked(true);
|
8870
8868
|
}
|
8871
8869
|
});
|
8872
8870
|
});
|
8873
8871
|
return {};
|
8874
8872
|
},
|
8875
8873
|
render() {
|
8874
|
+
var _a;
|
8876
8875
|
return createVNode("div", {
|
8877
8876
|
"class": "bk-checkbox-group"
|
8878
|
-
}, [this.$slots.default()]);
|
8877
|
+
}, [(_a = this.$slots) == null ? void 0 : _a.default()]);
|
8879
8878
|
}
|
8880
8879
|
});
|
8881
|
-
const BkCheckbox = withInstallProps(Component$o, { Group:
|
8880
|
+
const BkCheckbox = withInstallProps(Component$o, { Group: BkCheckboxGroup });
|
8882
8881
|
var Component$n = defineComponent({
|
8883
8882
|
name: "Collapse",
|
8884
8883
|
props: {
|
@@ -8915,7 +8914,7 @@ var Component$n = defineComponent({
|
|
8915
8914
|
}
|
8916
8915
|
if (props.activeName !== null && props.activeName !== void 0 && props.activeName !== "") {
|
8917
8916
|
const activeNames = resolvePropsActiveValue(props.activeName);
|
8918
|
-
return activeNames.map((
|
8917
|
+
return activeNames.map((name2) => collapseData.value.findIndex((item) => item[props.idFiled] === name2));
|
8919
8918
|
}
|
8920
8919
|
return resolvePropsActiveValue((_a = props.activeIndex) != null ? _a : 0);
|
8921
8920
|
});
|
@@ -8993,6 +8992,45 @@ const propsMixin$1 = {
|
|
8993
8992
|
showMask: {
|
8994
8993
|
type: Boolean,
|
8995
8994
|
default: true
|
8995
|
+
},
|
8996
|
+
closeIcon: {
|
8997
|
+
type: Boolean,
|
8998
|
+
default: true
|
8999
|
+
},
|
9000
|
+
escClose: {
|
9001
|
+
type: Boolean,
|
9002
|
+
default: true
|
9003
|
+
},
|
9004
|
+
maskClose: {
|
9005
|
+
type: Boolean,
|
9006
|
+
default: true
|
9007
|
+
},
|
9008
|
+
fullscreen: {
|
9009
|
+
type: Boolean,
|
9010
|
+
default: false
|
9011
|
+
},
|
9012
|
+
size: {
|
9013
|
+
type: String,
|
9014
|
+
default: "normal",
|
9015
|
+
validator: (value) => {
|
9016
|
+
const dialogSize = ["normal", "small", "medium", "large"];
|
9017
|
+
if (dialogSize.indexOf(value) < 0) {
|
9018
|
+
console.error(`dialogSize property is not valid: '${value}',\u3010${dialogSize.join(" | ")}\u3011`);
|
9019
|
+
return false;
|
9020
|
+
}
|
9021
|
+
return true;
|
9022
|
+
}
|
9023
|
+
},
|
9024
|
+
renderDirective: {
|
9025
|
+
type: String,
|
9026
|
+
default: "show",
|
9027
|
+
validator: (value) => {
|
9028
|
+
if (["show", "if"].indexOf(value) < 0) {
|
9029
|
+
console.error(`type render-directive is not valid: '${value}'`);
|
9030
|
+
return false;
|
9031
|
+
}
|
9032
|
+
return true;
|
9033
|
+
}
|
8996
9034
|
}
|
8997
9035
|
};
|
8998
9036
|
var Component$m = defineComponent({
|
@@ -9014,6 +9052,7 @@ var Component$m = defineComponent({
|
|
9014
9052
|
return {
|
9015
9053
|
width: this.dialogWidth,
|
9016
9054
|
height: this.dialogHeight,
|
9055
|
+
minHeigth: `${200}px`,
|
9017
9056
|
display: this.visible ? "inherit" : "none"
|
9018
9057
|
};
|
9019
9058
|
}
|
@@ -9044,7 +9083,7 @@ var Component$m = defineComponent({
|
|
9044
9083
|
render() {
|
9045
9084
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
9046
9085
|
return createVNode("div", {
|
9047
|
-
"class": ["bk-modal-wrapper",
|
9086
|
+
"class": ["bk-modal-wrapper", this.size, this.customClass, this.fullscreen ? "bk-model-fullscreen" : ""],
|
9048
9087
|
"style": this.compStyle
|
9049
9088
|
}, [this.isShow ? createVNode("div", {
|
9050
9089
|
"class": "bk-modal-body"
|
@@ -9058,7 +9097,7 @@ var Component$m = defineComponent({
|
|
9058
9097
|
}
|
9059
9098
|
});
|
9060
9099
|
const BkModal = withInstallProps(Component$m, { propsMixin: propsMixin$1 }, true);
|
9061
|
-
function _isSlot$
|
9100
|
+
function _isSlot$4(s2) {
|
9062
9101
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
9063
9102
|
}
|
9064
9103
|
var Component$l = defineComponent({
|
@@ -9068,6 +9107,14 @@ var Component$l = defineComponent({
|
|
9068
9107
|
BkButton
|
9069
9108
|
},
|
9070
9109
|
props: __spreadProps(__spreadValues({}, propsMixin$1), {
|
9110
|
+
width: {
|
9111
|
+
type: [Number, String],
|
9112
|
+
default: null
|
9113
|
+
},
|
9114
|
+
height: {
|
9115
|
+
type: [Number, String],
|
9116
|
+
default: null
|
9117
|
+
},
|
9071
9118
|
confirmText: {
|
9072
9119
|
type: String,
|
9073
9120
|
default: "\u786E\u5B9A"
|
@@ -9103,30 +9150,62 @@ var Component$l = defineComponent({
|
|
9103
9150
|
}
|
9104
9151
|
return true;
|
9105
9152
|
}
|
9153
|
+
},
|
9154
|
+
theme: {
|
9155
|
+
type: String,
|
9156
|
+
default: "primary",
|
9157
|
+
validator: (value) => {
|
9158
|
+
if (["primary", "warning", "success", "danger"].indexOf(value) < 0) {
|
9159
|
+
console.error(`theme property is not valid: '${value}'`);
|
9160
|
+
return false;
|
9161
|
+
}
|
9162
|
+
return true;
|
9163
|
+
}
|
9106
9164
|
}
|
9107
9165
|
}),
|
9108
|
-
emits: ["closed", "update:isShow"],
|
9166
|
+
emits: ["closed", "update:isShow", "confirm"],
|
9167
|
+
mounted() {
|
9168
|
+
if (this.escClose) {
|
9169
|
+
addEventListener("keydown", this.escCloseHandler);
|
9170
|
+
}
|
9171
|
+
},
|
9172
|
+
beforeDestory() {
|
9173
|
+
if (this.escClose) {
|
9174
|
+
removeEventListener("keydown", this.escCloseHandler);
|
9175
|
+
}
|
9176
|
+
},
|
9109
9177
|
methods: {
|
9110
9178
|
handleClose() {
|
9111
9179
|
this.$emit("update:isShow", false);
|
9112
9180
|
this.$emit("closed");
|
9181
|
+
},
|
9182
|
+
handleConfirm() {
|
9183
|
+
this.$emit("update:isShow", false);
|
9184
|
+
this.$emit("confirm");
|
9185
|
+
},
|
9186
|
+
escCloseHandler(e) {
|
9187
|
+
if (this.isShow && this.closeIcon) {
|
9188
|
+
if (e.keyCode === 27) {
|
9189
|
+
this.handleClose();
|
9190
|
+
}
|
9191
|
+
}
|
9113
9192
|
}
|
9114
9193
|
},
|
9115
9194
|
render() {
|
9116
9195
|
const dialogSlot = {
|
9117
9196
|
header: () => {
|
9118
9197
|
var _a, _b, _c;
|
9119
|
-
return
|
9198
|
+
return [createVNode("div", {
|
9120
9199
|
"class": "bk-dialog-tool"
|
9121
9200
|
}, [createVNode("span", {
|
9122
|
-
"class": "bk-dialog-close",
|
9201
|
+
"class": ["bk-dialog-close", this.closeIcon ? "" : "close-icon"],
|
9123
9202
|
"onClick": this.handleClose
|
9124
9203
|
}, [createTextVNode("+")])]), createVNode("div", {
|
9125
9204
|
"class": "bk-dialog-header"
|
9126
9205
|
}, [createVNode("span", {
|
9127
9206
|
"class": "bk-dialog-title",
|
9128
9207
|
"style": `text-align: ${this.headerAlign}`
|
9129
|
-
}, [(_c = (_b = (_a = this.$slots).header) == null ? void 0 : _b.call(_a)) != null ? _c : this.title])])]
|
9208
|
+
}, [(_c = (_b = (_a = this.$slots).header) == null ? void 0 : _b.call(_a)) != null ? _c : this.title])])];
|
9130
9209
|
},
|
9131
9210
|
default: () => {
|
9132
9211
|
var _a, _b, _c;
|
@@ -9138,11 +9217,12 @@ var Component$l = defineComponent({
|
|
9138
9217
|
"class": "bk-dialog-footer",
|
9139
9218
|
"style": `text-align: ${this.footerAlign}`
|
9140
9219
|
}, [(_c = (_b = (_a = this.$slots).footer) == null ? void 0 : _b.call(_a)) != null ? _c : createVNode(Fragment, null, [createVNode(BkButton, {
|
9141
|
-
"onClick": this.
|
9142
|
-
"theme":
|
9220
|
+
"onClick": this.handleConfirm,
|
9221
|
+
"theme": this.theme
|
9143
9222
|
}, {
|
9144
9223
|
default: () => [this.confirmText]
|
9145
9224
|
}), createVNode(BkButton, {
|
9225
|
+
"style": "margin-left: 8px;",
|
9146
9226
|
"onClick": this.handleClose
|
9147
9227
|
}, {
|
9148
9228
|
default: () => [this.cancelText]
|
@@ -9152,7 +9232,7 @@ var Component$l = defineComponent({
|
|
9152
9232
|
const className = `bk-dialog-wrapper ${this.scrollable ? "scroll-able" : ""}`;
|
9153
9233
|
return createVNode(BkModal, mergeProps(this.$props, {
|
9154
9234
|
"class": className
|
9155
|
-
}), _isSlot$
|
9235
|
+
}), _isSlot$4(dialogSlot) ? dialogSlot : {
|
9156
9236
|
default: () => [dialogSlot]
|
9157
9237
|
});
|
9158
9238
|
}
|
@@ -9384,8 +9464,8 @@ var Component$i = defineComponent({
|
|
9384
9464
|
const newVal = handleNumber(props.step, false);
|
9385
9465
|
ctx.emit(EventEnum["update:modelValue"], newVal);
|
9386
9466
|
}
|
9387
|
-
function getCls(
|
9388
|
-
return `${inputClsPrefix.value}--${
|
9467
|
+
function getCls(name2) {
|
9468
|
+
return `${inputClsPrefix.value}--${name2}`;
|
9389
9469
|
}
|
9390
9470
|
function handleVisibleChange() {
|
9391
9471
|
pwdVisible.value = !pwdVisible.value;
|
@@ -9483,8 +9563,12 @@ var Component$h = defineComponent({
|
|
9483
9563
|
});
|
9484
9564
|
const BkLink = withInstall(Component$h);
|
9485
9565
|
const placements = ["auto", "auto-start", "auto-end", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"];
|
9486
|
-
const
|
9487
|
-
|
9566
|
+
const EventProps$1 = {
|
9567
|
+
onAfterHidden: Function,
|
9568
|
+
onAfterShow: Function
|
9569
|
+
};
|
9570
|
+
const PopoverProps = __spreadValues({
|
9571
|
+
isShow: PropTypes.bool.def(false),
|
9488
9572
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).def("auto"),
|
9489
9573
|
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).def("auto"),
|
9490
9574
|
content: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).def(""),
|
@@ -9507,11 +9591,20 @@ const PopoverProps = {
|
|
9507
9591
|
}
|
9508
9592
|
]),
|
9509
9593
|
boundary: PropTypes.oneOfType([PropTypes.string.def("parent"), PropTypes.instanceOf(HTMLElement)]),
|
9510
|
-
fixOnBoundary: PropTypes.bool.def(false)
|
9511
|
-
|
9594
|
+
fixOnBoundary: PropTypes.bool.def(false),
|
9595
|
+
stopBehaviors: PropTypes.oneOfType([
|
9596
|
+
PropTypes.arrayOf(PropTypes.commonType([
|
9597
|
+
"stopPropagation",
|
9598
|
+
"stopImmediatePropagation",
|
9599
|
+
"preventDefault"
|
9600
|
+
], "stopBehaviors")),
|
9601
|
+
PropTypes.string
|
9602
|
+
]).def([])
|
9603
|
+
}, EventProps$1);
|
9512
9604
|
var Component$g = defineComponent({
|
9513
9605
|
name: "Popover",
|
9514
9606
|
props: PopoverProps,
|
9607
|
+
emits: ["afterHidden", "afterShow", "update:isShow"],
|
9515
9608
|
setup(props, ctx) {
|
9516
9609
|
let isPopInstance = false;
|
9517
9610
|
let popoverInstance = /* @__PURE__ */ Object.create(null);
|
@@ -9544,22 +9637,24 @@ var Component$g = defineComponent({
|
|
9544
9637
|
customThemes
|
9545
9638
|
};
|
9546
9639
|
});
|
9547
|
-
const
|
9640
|
+
const handlePopShow = (val) => {
|
9548
9641
|
var _a, _b;
|
9549
|
-
if (
|
9642
|
+
if (isPopInstance) {
|
9550
9643
|
val ? (_a = popoverInstance.show) == null ? void 0 : _a.call(popoverInstance) : (_b = popoverInstance.hide) == null ? void 0 : _b.call(popoverInstance);
|
9551
9644
|
}
|
9552
9645
|
};
|
9553
9646
|
watch(() => props.isShow, (val) => {
|
9554
|
-
|
9647
|
+
handlePopShow(val);
|
9555
9648
|
}, {
|
9556
9649
|
immediate: true
|
9557
9650
|
});
|
9558
9651
|
const handleClose = () => {
|
9559
9652
|
ctx.emit("update:isShow", false);
|
9653
|
+
ctx.emit("afterHidden", false);
|
9560
9654
|
};
|
9561
9655
|
const handleShown = () => {
|
9562
9656
|
ctx.emit("update:isShow", true);
|
9657
|
+
ctx.emit("afterShow", false);
|
9563
9658
|
};
|
9564
9659
|
const getOptions = () => ({
|
9565
9660
|
theme: compTheme.value.systemThemes.join(" "),
|
@@ -9583,7 +9678,7 @@ var Component$g = defineComponent({
|
|
9583
9678
|
const initPopInstance = () => {
|
9584
9679
|
popoverInstance = new BKPopover(reference2.value, refContent.value, getOptions());
|
9585
9680
|
isPopInstance = true;
|
9586
|
-
|
9681
|
+
handlePopShow(isShow.value);
|
9587
9682
|
};
|
9588
9683
|
const update = () => {
|
9589
9684
|
destroyPopInstance();
|
@@ -9605,6 +9700,19 @@ var Component$g = defineComponent({
|
|
9605
9700
|
[`data-${cur}-theme`]: true
|
9606
9701
|
}, out), {});
|
9607
9702
|
const contentClass = `bk-popover-content ${customThemeCls}`;
|
9703
|
+
const handleClickContent = (e) => {
|
9704
|
+
const stopBehaviorFn = (behavior) => {
|
9705
|
+
if (typeof e[behavior] === "function") {
|
9706
|
+
e[behavior]();
|
9707
|
+
}
|
9708
|
+
};
|
9709
|
+
if (Array.isArray(props.stopBehaviors)) {
|
9710
|
+
props.stopBehaviors.forEach(stopBehaviorFn);
|
9711
|
+
}
|
9712
|
+
if (typeof props.stopBehaviors === "string") {
|
9713
|
+
stopBehaviorFn(props.stopBehaviors);
|
9714
|
+
}
|
9715
|
+
};
|
9608
9716
|
return () => {
|
9609
9717
|
var _a, _b;
|
9610
9718
|
return createVNode("div", {
|
@@ -9624,7 +9732,9 @@ var Component$g = defineComponent({
|
|
9624
9732
|
"ref": refContent,
|
9625
9733
|
"class": contentClass,
|
9626
9734
|
"style": compStyle.value
|
9627
|
-
}, customTheme
|
9735
|
+
}, customTheme, {
|
9736
|
+
"onClick": handleClickContent
|
9737
|
+
}), [(_c = (_b2 = (_a2 = ctx.slots).content) == null ? void 0 : _b2.call(_a2)) != null ? _c : content.value, arrow2.value && createVNode("div", {
|
9628
9738
|
"class": "arrow",
|
9629
9739
|
"data-popper-arrow": true
|
9630
9740
|
}, null)])];
|
@@ -9753,7 +9863,7 @@ const Line = (_2, {
|
|
9753
9863
|
"style": titleStyle
|
9754
9864
|
}, [showDefault()])])]), showDefault(false)]);
|
9755
9865
|
};
|
9756
|
-
function _isSlot$
|
9866
|
+
function _isSlot$3(s2) {
|
9757
9867
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
9758
9868
|
}
|
9759
9869
|
var Component$f = defineComponent({
|
@@ -9818,11 +9928,11 @@ var Component$f = defineComponent({
|
|
9818
9928
|
const $props = __spreadProps(__spreadValues({}, this.$props), {
|
9819
9929
|
percent: this.validPercent(this.percent)
|
9820
9930
|
});
|
9821
|
-
let progress2 = createVNode(Line, $props, _isSlot$
|
9931
|
+
let progress2 = createVNode(Line, $props, _isSlot$3(progressInfo) ? progressInfo : {
|
9822
9932
|
default: () => [progressInfo]
|
9823
9933
|
});
|
9824
9934
|
if (this.type === "circle" || this.type === "dashboard") {
|
9825
|
-
progress2 = createVNode(Circle, $props, _isSlot$
|
9935
|
+
progress2 = createVNode(Circle, $props, _isSlot$3(progressInfo) ? progressInfo : {
|
9826
9936
|
default: () => [progressInfo]
|
9827
9937
|
});
|
9828
9938
|
}
|
@@ -9837,70 +9947,88 @@ var Component$f = defineComponent({
|
|
9837
9947
|
const BkProgress = withInstall(Component$f);
|
9838
9948
|
const radioGroupKey = Symbol("RadioGroup");
|
9839
9949
|
function useFocus$1() {
|
9840
|
-
const
|
9950
|
+
const isFocused = ref(false);
|
9841
9951
|
const blur = () => {
|
9842
|
-
|
9952
|
+
isFocused.value = false;
|
9843
9953
|
};
|
9844
9954
|
const focus = () => {
|
9845
|
-
|
9955
|
+
isFocused.value = true;
|
9846
9956
|
};
|
9847
9957
|
return [
|
9848
|
-
|
9958
|
+
isFocused,
|
9849
9959
|
{
|
9850
9960
|
blur,
|
9851
9961
|
focus
|
9852
9962
|
}
|
9853
9963
|
];
|
9854
9964
|
}
|
9855
|
-
|
9965
|
+
const useRadio = () => {
|
9966
|
+
const currentInstance = getCurrentInstance();
|
9856
9967
|
const {
|
9857
9968
|
props,
|
9858
9969
|
emit
|
9859
|
-
} =
|
9970
|
+
} = currentInstance;
|
9860
9971
|
const radioGroup = inject(radioGroupKey, EMPTY_OBJ);
|
9861
9972
|
const isGroup = !isEmptyObj(radioGroup);
|
9862
|
-
const
|
9863
|
-
isLocalChecked: props.checked
|
9864
|
-
});
|
9865
|
-
const isCheck = computed(() => {
|
9866
|
-
if (isGroup) {
|
9867
|
-
return radioGroup.state.localValue === props.label;
|
9868
|
-
}
|
9869
|
-
if (props.modelValue !== "") {
|
9870
|
-
return props.modelValue === props.label;
|
9871
|
-
}
|
9872
|
-
return state.isLocalChecked;
|
9873
|
-
});
|
9874
|
-
state.isLocalChecked = isCheck.value;
|
9973
|
+
const isChecked = ref(props.checked);
|
9875
9974
|
const isDisabled = computed(() => {
|
9876
9975
|
if (isGroup && radioGroup.props.disabled) {
|
9877
9976
|
return true;
|
9878
9977
|
}
|
9879
9978
|
return props.disabled;
|
9880
9979
|
});
|
9881
|
-
|
9882
|
-
|
9883
|
-
|
9884
|
-
}
|
9885
|
-
|
9886
|
-
|
9887
|
-
|
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) => {
|
9888
9998
|
if (isDisabled.value) {
|
9889
9999
|
return;
|
9890
10000
|
}
|
9891
|
-
|
9892
|
-
|
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);
|
9893
10006
|
if (isGroup) {
|
9894
|
-
radioGroup.handleChange(
|
10007
|
+
radioGroup.handleChange(currentInstance.proxy);
|
9895
10008
|
}
|
10009
|
+
nextTick(() => {
|
10010
|
+
if ($targetInput.checked !== isChecked.value) {
|
10011
|
+
$targetInput.checked = isChecked.value;
|
10012
|
+
}
|
10013
|
+
});
|
9896
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
|
+
});
|
9897
10025
|
return {
|
9898
|
-
|
9899
|
-
isCheck,
|
10026
|
+
isChecked,
|
9900
10027
|
isDisabled,
|
9901
|
-
|
10028
|
+
setChecked,
|
10029
|
+
handleChange
|
9902
10030
|
};
|
9903
|
-
}
|
10031
|
+
};
|
9904
10032
|
const radioProps = {
|
9905
10033
|
name: PropTypes.string.def(""),
|
9906
10034
|
label: PropTypes.oneOfType([String, Number, Boolean]).isRequired,
|
@@ -9913,32 +10041,32 @@ var Component$e = defineComponent({
|
|
9913
10041
|
props: radioProps,
|
9914
10042
|
emits: ["change", "update:modelValue"],
|
9915
10043
|
setup() {
|
9916
|
-
const [
|
10044
|
+
const [isFocused, {
|
9917
10045
|
blur: handleBlur,
|
9918
10046
|
focus: handleFocus
|
9919
10047
|
}] = useFocus$1();
|
9920
10048
|
const {
|
9921
|
-
|
9922
|
-
isCheck,
|
10049
|
+
isChecked,
|
9923
10050
|
isDisabled,
|
9924
|
-
|
10051
|
+
setChecked,
|
10052
|
+
handleChange
|
9925
10053
|
} = useRadio();
|
9926
10054
|
return {
|
9927
|
-
|
9928
|
-
|
9929
|
-
isCheck,
|
10055
|
+
isFocused,
|
10056
|
+
isChecked,
|
9930
10057
|
isDisabled,
|
10058
|
+
setChecked,
|
9931
10059
|
handleBlur,
|
9932
10060
|
handleFocus,
|
9933
|
-
|
10061
|
+
handleChange
|
9934
10062
|
};
|
9935
10063
|
},
|
9936
10064
|
render() {
|
9937
10065
|
const radioClass = classes({
|
9938
10066
|
"bk-radio": true,
|
9939
|
-
"is-
|
10067
|
+
"is-focused": this.isFocused,
|
9940
10068
|
"is-disabled": this.isDisabled,
|
9941
|
-
"is-checked": this.
|
10069
|
+
"is-checked": this.isChecked
|
9942
10070
|
});
|
9943
10071
|
return createVNode("label", {
|
9944
10072
|
"class": radioClass,
|
@@ -9947,13 +10075,12 @@ var Component$e = defineComponent({
|
|
9947
10075
|
"class": "bk-radio-input",
|
9948
10076
|
"type": "radio",
|
9949
10077
|
"tabindex": "0",
|
9950
|
-
"name": this.realName,
|
9951
10078
|
"value": this.label,
|
9952
|
-
"checked": this.
|
10079
|
+
"checked": this.isChecked,
|
9953
10080
|
"disabled": this.isDisabled,
|
9954
10081
|
"onFocus": this.handleFocus,
|
9955
10082
|
"onBlur": this.handleBlur,
|
9956
|
-
"onChange": this.
|
10083
|
+
"onChange": this.handleChange
|
9957
10084
|
}, null), createVNode("span", {
|
9958
10085
|
"class": "bk-radio-text"
|
9959
10086
|
}, [this.$slots.default ? this.$slots.default() : this.label])]);
|
@@ -9972,32 +10099,33 @@ var RadioButton = defineComponent({
|
|
9972
10099
|
props: radioButtonProps,
|
9973
10100
|
emits: ["change", "update:modelValue"],
|
9974
10101
|
setup() {
|
9975
|
-
const [
|
10102
|
+
const [isFocused, {
|
9976
10103
|
blur: handleBlur,
|
9977
10104
|
focus: handleFocus
|
9978
10105
|
}] = useFocus$1();
|
9979
10106
|
const {
|
9980
|
-
|
9981
|
-
isCheck,
|
10107
|
+
isChecked,
|
9982
10108
|
isDisabled,
|
9983
|
-
|
10109
|
+
setChecked,
|
10110
|
+
handleChange
|
9984
10111
|
} = useRadio();
|
9985
10112
|
return {
|
9986
|
-
|
10113
|
+
isFocused,
|
9987
10114
|
realName: name,
|
9988
|
-
|
10115
|
+
isChecked,
|
9989
10116
|
isDisabled,
|
10117
|
+
setChecked,
|
9990
10118
|
handleBlur,
|
9991
10119
|
handleFocus,
|
9992
|
-
|
10120
|
+
handleChange
|
9993
10121
|
};
|
9994
10122
|
},
|
9995
10123
|
render() {
|
9996
10124
|
const radioClass = classes({
|
9997
10125
|
"bk-radio-button": true,
|
9998
|
-
"is-
|
10126
|
+
"is-focused": this.isFocused,
|
9999
10127
|
"is-disabled": this.isDisabled,
|
10000
|
-
"is-checked": this.
|
10128
|
+
"is-checked": this.isChecked
|
10001
10129
|
});
|
10002
10130
|
return createVNode("label", {
|
10003
10131
|
"class": radioClass,
|
@@ -10006,13 +10134,12 @@ var RadioButton = defineComponent({
|
|
10006
10134
|
"class": "bk-radio-button-input",
|
10007
10135
|
"type": "radio",
|
10008
10136
|
"tabindex": "0",
|
10009
|
-
"name": this.realName,
|
10010
10137
|
"value": this.label,
|
10011
|
-
"checked": this.
|
10138
|
+
"checked": this.isChecked,
|
10012
10139
|
"disabled": this.isDisabled,
|
10013
10140
|
"onFocus": this.handleFocus,
|
10014
10141
|
"onBlur": this.handleBlur,
|
10015
|
-
"onChange": this.
|
10142
|
+
"onChange": this.handleChange
|
10016
10143
|
}, null), createVNode("div", {
|
10017
10144
|
"class": "bk-radio-button-text"
|
10018
10145
|
}, [this.$slots.default ? this.$slots.default() : this.label])]);
|
@@ -10028,21 +10155,40 @@ var RadioGroup = defineComponent({
|
|
10028
10155
|
props: radioGroupProps,
|
10029
10156
|
emits: ["change", "update:modelValue"],
|
10030
10157
|
setup(props, context) {
|
10031
|
-
const
|
10032
|
-
|
10033
|
-
|
10034
|
-
|
10035
|
-
|
10036
|
-
|
10037
|
-
|
10038
|
-
|
10039
|
-
|
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);
|
10040
10177
|
};
|
10041
10178
|
provide(radioGroupKey, {
|
10042
10179
|
props,
|
10043
|
-
|
10180
|
+
register,
|
10181
|
+
unregister,
|
10044
10182
|
handleChange
|
10045
10183
|
});
|
10184
|
+
onMounted(() => {
|
10185
|
+
if (props.modelValue === "") {
|
10186
|
+
return;
|
10187
|
+
}
|
10188
|
+
radioInstanceList.forEach((radioInstance) => {
|
10189
|
+
radioInstance.setChecked(radioInstance.label === props.modelValue);
|
10190
|
+
});
|
10191
|
+
});
|
10046
10192
|
return {};
|
10047
10193
|
},
|
10048
10194
|
render() {
|
@@ -10175,7 +10321,7 @@ var Component$d = defineComponent({
|
|
10175
10321
|
"onChooseRate": chooseRate,
|
10176
10322
|
"onChangeHover": changeHover,
|
10177
10323
|
"onMouseleave": () => changeHover(0)
|
10178
|
-
}, commonAttrs), null) :
|
10324
|
+
}, commonAttrs), null) : [createVNode(star, mergeProps({
|
10179
10325
|
"rate": 5,
|
10180
10326
|
"style": starStyle.value,
|
10181
10327
|
"class": "bk-score-real",
|
@@ -10183,7 +10329,7 @@ var Component$d = defineComponent({
|
|
10183
10329
|
}, commonAttrs), null), createVNode(star, mergeProps({
|
10184
10330
|
"rate": 0,
|
10185
10331
|
"editable": false
|
10186
|
-
}, commonAttrs), null)]
|
10332
|
+
}, commonAttrs), null)]]);
|
10187
10333
|
}
|
10188
10334
|
});
|
10189
10335
|
const BkRate = withInstall(Component$d);
|
@@ -11414,7 +11560,7 @@ var Component$a = defineComponent({
|
|
11414
11560
|
}
|
11415
11561
|
});
|
11416
11562
|
const BkSelect = withInstallProps(Component$a, { Option: BkOption, Group: OptionGroup });
|
11417
|
-
function _isSlot$
|
11563
|
+
function _isSlot$2(s2) {
|
11418
11564
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
11419
11565
|
}
|
11420
11566
|
const {
|
@@ -11454,14 +11600,14 @@ var Component$9 = defineComponent({
|
|
11454
11600
|
const dialogSlot = {
|
11455
11601
|
header: () => {
|
11456
11602
|
var _a, _b, _c;
|
11457
|
-
return
|
11603
|
+
return [createVNode("div", {
|
11458
11604
|
"class": "bk-sideslider-header"
|
11459
11605
|
}, [createVNode("span", {
|
11460
11606
|
"class": `bk-sideslider-close ${this.direction}`,
|
11461
11607
|
"onClick": this.handleClose
|
11462
11608
|
}, null), createVNode("span", {
|
11463
11609
|
"class": `bk-sideslider-title ${this.direction}`
|
11464
|
-
}, [(_c = (_b = (_a = this.$slots).header) == null ? void 0 : _b.call(_a)) != null ? _c : "Header"])])]
|
11610
|
+
}, [(_c = (_b = (_a = this.$slots).header) == null ? void 0 : _b.call(_a)) != null ? _c : "Header"])])];
|
11465
11611
|
},
|
11466
11612
|
default: () => {
|
11467
11613
|
var _a, _b, _c;
|
@@ -11475,7 +11621,7 @@ var Component$9 = defineComponent({
|
|
11475
11621
|
return createVNode(BkModal, mergeProps(this.$props, {
|
11476
11622
|
"class": className,
|
11477
11623
|
"style": `${this.direction}: 0`
|
11478
|
-
}), _isSlot$
|
11624
|
+
}), _isSlot$2(dialogSlot) ? dialogSlot : {
|
11479
11625
|
default: () => [dialogSlot]
|
11480
11626
|
});
|
11481
11627
|
}
|
@@ -11990,11 +12136,14 @@ const tableProps = {
|
|
11990
12136
|
field: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
11991
12137
|
render: PropTypes.oneOfType([PropTypes.func.def(() => ""), PropTypes.string.def("")]),
|
11992
12138
|
width: PropTypes.oneOfType([PropTypes.number.def(void 0), PropTypes.string.def("auto")]),
|
11993
|
-
type: PropTypes.commonType(["selection", "index", "expand"], "columnType").def(""),
|
12139
|
+
type: PropTypes.commonType(["selection", "index", "expand", "none"], "columnType").def("none"),
|
11994
12140
|
sort: PropTypes.oneOfType([PropTypes.shape({
|
11995
|
-
sortby: PropTypes.string.def(""),
|
11996
12141
|
sortFn: PropTypes.func.def(null),
|
11997
12142
|
sortScope: PropTypes.commonType(Object.values(SortScope)).def("current")
|
12143
|
+
}), PropTypes.bool]).def(false),
|
12144
|
+
filter: PropTypes.oneOfType([PropTypes.shape({
|
12145
|
+
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
12146
|
+
filterFn: PropTypes.func.def(null)
|
11998
12147
|
}), PropTypes.bool]).def(false)
|
11999
12148
|
})),
|
12000
12149
|
activeColumn: PropTypes.oneOfType([PropTypes.number.def(-1), PropTypes.arrayOf(PropTypes.number.def(-1))]),
|
@@ -12014,7 +12163,7 @@ const tableProps = {
|
|
12014
12163
|
pagination: PropTypes.oneOfType([PropTypes.bool.def(false), PropTypes.object.def({})]).def(false),
|
12015
12164
|
remotePagination: PropTypes.bool.def(false)
|
12016
12165
|
};
|
12017
|
-
function _isSlot(s2) {
|
12166
|
+
function _isSlot$1(s2) {
|
12018
12167
|
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
12019
12168
|
}
|
12020
12169
|
var useLimit = () => {
|
@@ -12059,7 +12208,7 @@ var useLimit = () => {
|
|
12059
12208
|
"modelValue": localLimit.value,
|
12060
12209
|
"onChange": handleLimitChange,
|
12061
12210
|
"disabled": proxy.disabled
|
12062
|
-
}, _isSlot(_slot = proxy.limitList.map((num, index) => createVNode(BkOption, {
|
12211
|
+
}, _isSlot$1(_slot = proxy.limitList.map((num, index) => createVNode(BkOption, {
|
12063
12212
|
"value": num,
|
12064
12213
|
"label": num,
|
12065
12214
|
"key": `${index}_${num}`
|
@@ -12459,14 +12608,6 @@ var Component$5 = defineComponent({
|
|
12459
12608
|
}
|
12460
12609
|
});
|
12461
12610
|
const BkPagination = withInstall(Component$5);
|
12462
|
-
class TablePlugins {
|
12463
|
-
constructor(props, ctx) {
|
12464
|
-
__publicField(this, "props", null);
|
12465
|
-
__publicField(this, "ctx", null);
|
12466
|
-
this.props = props;
|
12467
|
-
this.ctx = ctx;
|
12468
|
-
}
|
12469
|
-
}
|
12470
12611
|
const resolvePropVal = (prop, key, args) => {
|
12471
12612
|
if (Object.prototype.hasOwnProperty.call(prop, key)) {
|
12472
12613
|
if (typeof prop[key] === "function") {
|
@@ -12611,15 +12752,179 @@ const resolveHeadConfig = (props) => {
|
|
12611
12752
|
height: headHeight
|
12612
12753
|
}, __spreadValues({}, thead));
|
12613
12754
|
};
|
12755
|
+
const getRowText = (row, key, column) => {
|
12756
|
+
if (column.type === "index") {
|
12757
|
+
return row.__$table_row_index;
|
12758
|
+
}
|
12759
|
+
return row[key];
|
12760
|
+
};
|
12761
|
+
function _isSlot(s2) {
|
12762
|
+
return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
|
12763
|
+
}
|
12764
|
+
var HeadFilter = defineComponent({
|
12765
|
+
name: "HeadFilter",
|
12766
|
+
props: {
|
12767
|
+
column: PropTypes.any.def({}),
|
12768
|
+
height: PropTypes.number.def(40)
|
12769
|
+
},
|
12770
|
+
emits: ["change"],
|
12771
|
+
setup(props, {
|
12772
|
+
emit
|
12773
|
+
}) {
|
12774
|
+
const {
|
12775
|
+
column
|
12776
|
+
} = props;
|
12777
|
+
const isShow = ref(false);
|
12778
|
+
const state = reactive({
|
12779
|
+
isOpen: false,
|
12780
|
+
checked: []
|
12781
|
+
});
|
12782
|
+
const headClass = computed(() => classes({
|
12783
|
+
[resolveClassName("table-head-action")]: true,
|
12784
|
+
"column-filter": true,
|
12785
|
+
"--row-height": `${props.height}px`,
|
12786
|
+
active: state.checked.length,
|
12787
|
+
opened: state.isOpen
|
12788
|
+
}));
|
12789
|
+
const headFilterContentClass = classes({
|
12790
|
+
[resolveClassName("table-head-filter")]: true
|
12791
|
+
});
|
12792
|
+
const handlePopShow = (isOpen) => {
|
12793
|
+
state.isOpen = isOpen;
|
12794
|
+
};
|
12795
|
+
const modifiers = [{
|
12796
|
+
name: "offset",
|
12797
|
+
options: {
|
12798
|
+
offset: [0, 0]
|
12799
|
+
}
|
12800
|
+
}];
|
12801
|
+
const theme = `light ${resolveClassName("table-head-filter")}`;
|
12802
|
+
const localData = computed(() => {
|
12803
|
+
const {
|
12804
|
+
list = []
|
12805
|
+
} = column.filter;
|
12806
|
+
return list.map((item) => __spreadProps(__spreadValues({}, item), {
|
12807
|
+
checked: state.checked.includes(item.value)
|
12808
|
+
}));
|
12809
|
+
});
|
12810
|
+
const filterFn = typeof column.filter.filterFn === "function" ? (checked, row, index, data2) => column.filter.filterFn(checked, row, props.column, index, data2) : (checked, row) => checked.length ? checked.includes(getRowText(row, resolvePropVal(column, "field", [column, row]), column)) : true;
|
12811
|
+
const handleBtnSaveClick = () => {
|
12812
|
+
emit("change", [...state.checked], filterFn);
|
12813
|
+
isShow.value = false;
|
12814
|
+
};
|
12815
|
+
const handleBtnResetClick = () => {
|
12816
|
+
if (state.checked.length) {
|
12817
|
+
state.checked.splice(0, state.checked.length);
|
12818
|
+
}
|
12819
|
+
};
|
12820
|
+
return () => createVNode(BkPopover, mergeProps({
|
12821
|
+
"trigger": "click",
|
12822
|
+
"isShow": isShow.value,
|
12823
|
+
"placement": "bottom-end",
|
12824
|
+
"stopBehaviors": ["stopPropagation"],
|
12825
|
+
"arrow": false
|
12826
|
+
}, {
|
12827
|
+
modifiers,
|
12828
|
+
theme
|
12829
|
+
}, {
|
12830
|
+
"boundary": document.body,
|
12831
|
+
"onAfterShow": () => handlePopShow(true),
|
12832
|
+
"onAfterHidden": () => handlePopShow(false)
|
12833
|
+
}), {
|
12834
|
+
default: () => createVNode(angleDownLine, {
|
12835
|
+
"class": headClass.value,
|
12836
|
+
"onClick": () => isShow.value = true
|
12837
|
+
}, null),
|
12838
|
+
content: () => {
|
12839
|
+
let _slot;
|
12840
|
+
return createVNode("div", {
|
12841
|
+
"class": headFilterContentClass
|
12842
|
+
}, [createVNode(BkCheckboxGroup, {
|
12843
|
+
"class": "content-list",
|
12844
|
+
"modelValue": state.checked,
|
12845
|
+
"onUpdate:modelValue": ($event) => state.checked = $event
|
12846
|
+
}, _isSlot(_slot = localData.value.map((item) => createVNode("div", {
|
12847
|
+
"class": "list-item"
|
12848
|
+
}, [createVNode(BkCheckbox, {
|
12849
|
+
"label": item.value
|
12850
|
+
}, {
|
12851
|
+
default: () => [item.text]
|
12852
|
+
})]))) ? _slot : {
|
12853
|
+
default: () => [_slot]
|
12854
|
+
}), createVNode("div", {
|
12855
|
+
"class": "content-footer"
|
12856
|
+
}, [createVNode("span", {
|
12857
|
+
"class": "btn-filter-save",
|
12858
|
+
"onClick": handleBtnSaveClick
|
12859
|
+
}, [createTextVNode("\u786E\u5B9A")]), createVNode("span", {
|
12860
|
+
"class": "btn-filter-split"
|
12861
|
+
}, null), createVNode("span", {
|
12862
|
+
"class": ["btn-filter-reset", state.checked.length ? "" : "disable"],
|
12863
|
+
"onClick": handleBtnResetClick
|
12864
|
+
}, [createTextVNode("\u91CD\u7F6E")])])]);
|
12865
|
+
}
|
12866
|
+
});
|
12867
|
+
}
|
12868
|
+
});
|
12869
|
+
var SortType = /* @__PURE__ */ ((SortType2) => {
|
12870
|
+
SortType2["ASC"] = "asc";
|
12871
|
+
SortType2["DESC"] = "desc";
|
12872
|
+
return SortType2;
|
12873
|
+
})(SortType || {});
|
12874
|
+
var HeadSort = defineComponent({
|
12875
|
+
name: "HeadSort",
|
12876
|
+
props: {
|
12877
|
+
column: PropTypes.any.def({})
|
12878
|
+
},
|
12879
|
+
emits: ["change"],
|
12880
|
+
setup(props, {
|
12881
|
+
emit
|
12882
|
+
}) {
|
12883
|
+
const sortType = ref("");
|
12884
|
+
const hanldeSortClick = (e, type) => {
|
12885
|
+
var _a, _b;
|
12886
|
+
e.stopImmediatePropagation();
|
12887
|
+
e.stopPropagation();
|
12888
|
+
e.preventDefault();
|
12889
|
+
sortType.value = type;
|
12890
|
+
const fieldName = props.column.field;
|
12891
|
+
const getVal = (row) => getRowText(row, fieldName, props.column);
|
12892
|
+
const sortFn0 = (a2, b2) => {
|
12893
|
+
const val0 = getVal(a2);
|
12894
|
+
const val1 = getVal(b2);
|
12895
|
+
if (typeof val0 === "number" && typeof val1 === "number") {
|
12896
|
+
return val0 - val1;
|
12897
|
+
}
|
12898
|
+
return String.prototype.localeCompare.call(val0, val1);
|
12899
|
+
};
|
12900
|
+
const sortFn = typeof ((_a = props.column.sort) == null ? void 0 : _a.sortFn) === "function" ? (_b = props.column.sort) == null ? void 0 : _b.sortFn : sortFn0;
|
12901
|
+
const execFn = (_a2, _b2) => sortFn(_a2, _b2) * (type === SortType.DESC ? -1 : 1);
|
12902
|
+
emit("change", execFn, type);
|
12903
|
+
};
|
12904
|
+
return () => createVNode("span", {
|
12905
|
+
"class": resolveClassName("head-cell-sort")
|
12906
|
+
}, [createVNode(angleDownFill, {
|
12907
|
+
"class": ["sort-action", "sort-asc", sortType.value === SortType.ASC ? "active" : ""],
|
12908
|
+
"onClick": (e) => hanldeSortClick(e, SortType.ASC)
|
12909
|
+
}, null), createVNode(angleUpFill, {
|
12910
|
+
"class": ["sort-action", "sort-desc", sortType.value === SortType.DESC ? "active" : ""],
|
12911
|
+
"onClick": (e) => hanldeSortClick(e, SortType.DESC)
|
12912
|
+
}, null)]);
|
12913
|
+
}
|
12914
|
+
});
|
12915
|
+
class TablePlugins {
|
12916
|
+
constructor(props, ctx) {
|
12917
|
+
__publicField(this, "props", null);
|
12918
|
+
__publicField(this, "ctx", null);
|
12919
|
+
this.props = props;
|
12920
|
+
this.ctx = ctx;
|
12921
|
+
}
|
12922
|
+
}
|
12614
12923
|
let EVENTS;
|
12615
12924
|
(function(EVENTS2) {
|
12616
12925
|
EVENTS2["ON_SORT_BY_CLICK"] = "onSortByClick";
|
12926
|
+
EVENTS2["ON_FILTER_CLICK"] = "onFilterClick";
|
12617
12927
|
})(EVENTS || (EVENTS = {}));
|
12618
|
-
let SortType;
|
12619
|
-
(function(SortType2) {
|
12620
|
-
SortType2["ASC"] = "asc";
|
12621
|
-
SortType2["DESC"] = "desc";
|
12622
|
-
})(SortType || (SortType = {}));
|
12623
12928
|
class TableRender {
|
12624
12929
|
constructor(props, ctx, reactiveProp, colgroups) {
|
12625
12930
|
__publicField(this, "getColumnClass", (colIndex) => `${this.uuid}-column-${colIndex}`);
|
@@ -12711,6 +13016,36 @@ class TableRender {
|
|
12711
13016
|
this.context.emit("column-pick", this.propActiveCols);
|
12712
13017
|
}
|
12713
13018
|
}
|
13019
|
+
getSortCell(column, index) {
|
13020
|
+
const hanldeSortClick = (sortFn, type) => {
|
13021
|
+
this.emitEvent(EVENTS.ON_SORT_BY_CLICK, [{
|
13022
|
+
sortFn,
|
13023
|
+
column,
|
13024
|
+
index,
|
13025
|
+
type
|
13026
|
+
}]);
|
13027
|
+
};
|
13028
|
+
return createVNode(HeadSort, {
|
13029
|
+
"column": column,
|
13030
|
+
"onChange": hanldeSortClick
|
13031
|
+
}, null);
|
13032
|
+
}
|
13033
|
+
getFilterCell(column, index) {
|
13034
|
+
const handleFilterChange = (checked, filterFn) => {
|
13035
|
+
const filterFn0 = (row, index2) => filterFn(checked, row, index2);
|
13036
|
+
this.emitEvent(EVENTS.ON_FILTER_CLICK, [{
|
13037
|
+
filterFn: filterFn0,
|
13038
|
+
checked,
|
13039
|
+
column,
|
13040
|
+
index
|
13041
|
+
}]);
|
13042
|
+
};
|
13043
|
+
return createVNode(HeadFilter, {
|
13044
|
+
"column": column,
|
13045
|
+
"height": this.props.headHeight,
|
13046
|
+
"onChange": handleFilterChange
|
13047
|
+
}, null);
|
13048
|
+
}
|
12714
13049
|
renderHeader() {
|
12715
13050
|
const config = resolveHeadConfig(this.props);
|
12716
13051
|
const {
|
@@ -12719,47 +13054,13 @@ class TableRender {
|
|
12719
13054
|
const rowStyle = {
|
12720
13055
|
"--row-height": `${resolvePropVal(config, "height", ["thead"])}px`
|
12721
13056
|
};
|
12722
|
-
const hanldeSortClick = (e, column, index, type) => {
|
12723
|
-
var _a, _b;
|
12724
|
-
e.stopImmediatePropagation();
|
12725
|
-
e.stopPropagation();
|
12726
|
-
e.preventDefault();
|
12727
|
-
const fieldName = column.field;
|
12728
|
-
const getVal = (row) => this.getRowText(row, fieldName, column);
|
12729
|
-
const sortFn0 = (a2, b2) => {
|
12730
|
-
const val0 = getVal(a2);
|
12731
|
-
const val1 = getVal(b2);
|
12732
|
-
if (typeof val0 === "number" && typeof val1 === "number") {
|
12733
|
-
return val0 - val1;
|
12734
|
-
}
|
12735
|
-
return String.prototype.localeCompare.call(val0, val1);
|
12736
|
-
};
|
12737
|
-
Object.assign(column, {
|
12738
|
-
_sort_reg: type
|
12739
|
-
});
|
12740
|
-
const sortFn = typeof ((_a = column.sort) == null ? void 0 : _a.sortFn) === "function" ? (_b = column.sort) == null ? void 0 : _b.sortFn : sortFn0;
|
12741
|
-
const execFn = (_a2, _b2) => sortFn(_a2, _b2) * (type === SortType.DESC ? -1 : 1);
|
12742
|
-
this.emitEvent(EVENTS.ON_SORT_BY_CLICK, [{
|
12743
|
-
sortFn: execFn,
|
12744
|
-
column,
|
12745
|
-
index,
|
12746
|
-
type
|
12747
|
-
}]);
|
12748
|
-
};
|
12749
13057
|
const renderHeadCell = (column, index) => {
|
12750
13058
|
const cells = [];
|
12751
13059
|
if (column.sort) {
|
12752
|
-
|
12753
|
-
|
12754
|
-
|
12755
|
-
|
12756
|
-
"class": ["sort-action", "sort-asc", sortReg === SortType.ASC ? "active" : ""],
|
12757
|
-
"onClick": (e) => hanldeSortClick(e, column, index, SortType.ASC)
|
12758
|
-
}, null), createVNode(angleUpFill, {
|
12759
|
-
"class": ["sort-action", "sort-desc", sortReg === SortType.DESC ? "active" : ""],
|
12760
|
-
"onClick": (e) => hanldeSortClick(e, column, index, SortType.DESC)
|
12761
|
-
}, null)]);
|
12762
|
-
cells.push(sortCell);
|
13060
|
+
cells.push(this.getSortCell(column, index));
|
13061
|
+
}
|
13062
|
+
if (column.filter) {
|
13063
|
+
cells.push(this.getFilterCell(column, index));
|
12763
13064
|
}
|
12764
13065
|
if (typeof cellFn === "function") {
|
12765
13066
|
cells.unshift(cellFn(column, index));
|
@@ -12805,14 +13106,8 @@ class TableRender {
|
|
12805
13106
|
handleRowDblClick(e, row, index, rows) {
|
12806
13107
|
this.context.emit("rowDblClick", e, row, index, rows, this);
|
12807
13108
|
}
|
12808
|
-
getRowText(row, key, column) {
|
12809
|
-
if (column.type === "index") {
|
12810
|
-
return row.__$table_row_index;
|
12811
|
-
}
|
12812
|
-
return row[key];
|
12813
|
-
}
|
12814
13109
|
renderCell(row, column, index, rows) {
|
12815
|
-
const cell =
|
13110
|
+
const cell = getRowText(row, resolvePropVal(column, "field", [column, row]), column);
|
12816
13111
|
if (typeof column.render === "function") {
|
12817
13112
|
return column.render(cell, row, index, rows);
|
12818
13113
|
}
|
@@ -12846,6 +13141,7 @@ var Component$4 = defineComponent({
|
|
12846
13141
|
const startIndex = ref(0);
|
12847
13142
|
const endIndex = ref(0);
|
12848
13143
|
let columnSortFn = null;
|
13144
|
+
let columnFilterFn = null;
|
12849
13145
|
let pagination2 = reactive({
|
12850
13146
|
count: 0,
|
12851
13147
|
limit: 10,
|
@@ -12890,13 +13186,20 @@ var Component$4 = defineComponent({
|
|
12890
13186
|
__$table_row_index: index + 1
|
12891
13187
|
})));
|
12892
13188
|
const pageData = reactive([]);
|
12893
|
-
|
12894
|
-
pagination2 = resolvePaginationOption(props.pagination, pagination2);
|
12895
|
-
resetStartEndIndex();
|
13189
|
+
const resolvePageData = () => {
|
12896
13190
|
pageData.splice(0, pageData.length, ...indexData.value.slice(startIndex.value, endIndex.value));
|
13191
|
+
if (typeof columnFilterFn === "function") {
|
13192
|
+
const filterVals = pageData.filter((row, index) => columnFilterFn(row, index, props.data));
|
13193
|
+
pageData.splice(0, pageData.length, ...filterVals);
|
13194
|
+
}
|
12897
13195
|
if (typeof columnSortFn === "function") {
|
12898
13196
|
pageData.sort(columnSortFn);
|
12899
13197
|
}
|
13198
|
+
};
|
13199
|
+
watchEffect(() => {
|
13200
|
+
pagination2 = resolvePaginationOption(props.pagination, pagination2);
|
13201
|
+
resetStartEndIndex();
|
13202
|
+
resolvePageData();
|
12900
13203
|
});
|
12901
13204
|
const tableRender = new TableRender(props, ctx, reactiveProp, colgroups);
|
12902
13205
|
tableRender.on(EVENTS.ON_SORT_BY_CLICK, (args) => {
|
@@ -12905,6 +13208,12 @@ var Component$4 = defineComponent({
|
|
12905
13208
|
} = args;
|
12906
13209
|
columnSortFn = sortFn;
|
12907
13210
|
pageData.sort(columnSortFn);
|
13211
|
+
}).on(EVENTS.ON_FILTER_CLICK, (args) => {
|
13212
|
+
const {
|
13213
|
+
filterFn
|
13214
|
+
} = args;
|
13215
|
+
columnFilterFn = filterFn;
|
13216
|
+
resolvePageData();
|
12908
13217
|
});
|
12909
13218
|
const wrapperStyle = computed(() => ({
|
12910
13219
|
minHeight: resolveNumberOrStringToPix(props.minHeight, "auto")
|
@@ -13960,11 +14269,11 @@ const tabNavEventProps = {
|
|
13960
14269
|
},
|
13961
14270
|
tabChange: {
|
13962
14271
|
type: Function,
|
13963
|
-
default: (
|
14272
|
+
default: (name2) => name2
|
13964
14273
|
},
|
13965
14274
|
tabRemove: {
|
13966
14275
|
type: Function,
|
13967
|
-
default: (
|
14276
|
+
default: (name2) => name2
|
13968
14277
|
},
|
13969
14278
|
tabSort: {
|
13970
14279
|
type: Function,
|
@@ -14032,7 +14341,7 @@ var TabNav = defineComponent({
|
|
14032
14341
|
return null;
|
14033
14342
|
}
|
14034
14343
|
const {
|
14035
|
-
name,
|
14344
|
+
name: name2,
|
14036
14345
|
label,
|
14037
14346
|
closable,
|
14038
14347
|
visible,
|
@@ -14042,7 +14351,7 @@ var TabNav = defineComponent({
|
|
14042
14351
|
if (!visible) {
|
14043
14352
|
return false;
|
14044
14353
|
}
|
14045
|
-
if (props.active ===
|
14354
|
+
if (props.active === name2) {
|
14046
14355
|
hasFindActive = true;
|
14047
14356
|
}
|
14048
14357
|
const renderLabel = (label2) => {
|
@@ -14061,7 +14370,7 @@ var TabNav = defineComponent({
|
|
14061
14370
|
return label2;
|
14062
14371
|
};
|
14063
14372
|
list.push({
|
14064
|
-
name,
|
14373
|
+
name: name2,
|
14065
14374
|
closable,
|
14066
14375
|
visible,
|
14067
14376
|
disabled,
|
@@ -14117,8 +14426,8 @@ var TabNav = defineComponent({
|
|
14117
14426
|
}
|
14118
14427
|
this.tabSort(this.dragStartIndex, index, sortType);
|
14119
14428
|
},
|
14120
|
-
handleTabChange(
|
14121
|
-
this.tabChange(
|
14429
|
+
handleTabChange(name2) {
|
14430
|
+
this.tabChange(name2);
|
14122
14431
|
},
|
14123
14432
|
handleTabRemove(index, panel) {
|
14124
14433
|
this.tabRemove(index, panel);
|
@@ -14142,7 +14451,7 @@ var TabNav = defineComponent({
|
|
14142
14451
|
return null;
|
14143
14452
|
}
|
14144
14453
|
const {
|
14145
|
-
name,
|
14454
|
+
name: name2,
|
14146
14455
|
disabled,
|
14147
14456
|
tabLabel
|
14148
14457
|
} = item;
|
@@ -14151,15 +14460,15 @@ var TabNav = defineComponent({
|
|
14151
14460
|
if (disabled) {
|
14152
14461
|
classNames.push("bk-tab-header--disabled");
|
14153
14462
|
}
|
14154
|
-
if (active ===
|
14463
|
+
if (active === name2) {
|
14155
14464
|
classNames.push("bk-tab-header--active");
|
14156
14465
|
}
|
14157
14466
|
return classNames.join(" ");
|
14158
14467
|
};
|
14159
14468
|
const getValue = (curentValue, parentValue) => curentValue || parentValue;
|
14160
14469
|
return createVNode("div", {
|
14161
|
-
"key":
|
14162
|
-
"onClick": () => this.handleTabChange(
|
14470
|
+
"key": name2,
|
14471
|
+
"onClick": () => this.handleTabChange(name2),
|
14163
14472
|
"draggable": getValue(item.sortable, sortable),
|
14164
14473
|
"onDragstart": (e) => dragstart(index, e),
|
14165
14474
|
"onDragenter": (e) => {
|
@@ -14306,10 +14615,10 @@ var Tab = defineComponent({
|
|
14306
14615
|
e
|
14307
14616
|
});
|
14308
14617
|
},
|
14309
|
-
tabChange(
|
14310
|
-
this.$emit("change",
|
14311
|
-
this.$emit("tab-change",
|
14312
|
-
this.$emit("update:active",
|
14618
|
+
tabChange(name2) {
|
14619
|
+
this.$emit("change", name2);
|
14620
|
+
this.$emit("tab-change", name2);
|
14621
|
+
this.$emit("update:active", name2);
|
14313
14622
|
},
|
14314
14623
|
tabRemove(index, panel) {
|
14315
14624
|
this.$emit("remove", index, panel);
|
@@ -19957,6 +20266,76 @@ var Component = defineComponent({
|
|
19957
20266
|
}
|
19958
20267
|
});
|
19959
20268
|
const BkTree = withInstall(Component);
|
20269
|
+
const isCustomComponent = (node) => node.__v_isVNode;
|
20270
|
+
var ComposeFormItem = defineComponent({
|
20271
|
+
name: "ComposeFormItem",
|
20272
|
+
props: {
|
20273
|
+
headBackgroundColor: {
|
20274
|
+
type: String,
|
20275
|
+
default: "#FAFBFD"
|
20276
|
+
},
|
20277
|
+
tailBackgroundColor: String
|
20278
|
+
},
|
20279
|
+
render() {
|
20280
|
+
if (!this.$slots.default) {
|
20281
|
+
return null;
|
20282
|
+
}
|
20283
|
+
const childrenArr = this.$slots.default();
|
20284
|
+
console.log("from render = ", childrenArr);
|
20285
|
+
if (childrenArr.length > 1) {
|
20286
|
+
const childrenLength = childrenArr.length;
|
20287
|
+
let startIndex = 0;
|
20288
|
+
let headChildren = null;
|
20289
|
+
while (startIndex < childrenLength) {
|
20290
|
+
if (isCustomComponent(childrenArr[startIndex])) {
|
20291
|
+
headChildren = childrenArr[startIndex];
|
20292
|
+
break;
|
20293
|
+
}
|
20294
|
+
startIndex = startIndex + 1;
|
20295
|
+
}
|
20296
|
+
let tailIndex = childrenLength - 1;
|
20297
|
+
let tailChildren = null;
|
20298
|
+
while (tailIndex >= 0 && tailIndex > startIndex) {
|
20299
|
+
if (isCustomComponent(childrenArr[tailIndex])) {
|
20300
|
+
tailChildren = childrenArr[tailIndex];
|
20301
|
+
break;
|
20302
|
+
}
|
20303
|
+
tailIndex = tailIndex - 1;
|
20304
|
+
}
|
20305
|
+
if (headChildren && tailChildren) {
|
20306
|
+
if (!headChildren.props) {
|
20307
|
+
headChildren.props = {};
|
20308
|
+
}
|
20309
|
+
let headChildClass = "bk-compose-form-item-head";
|
20310
|
+
if (headChildren.props.class) {
|
20311
|
+
headChildClass += ` ${headChildren.props.class}`;
|
20312
|
+
}
|
20313
|
+
if (this.headBackgroundColor) {
|
20314
|
+
headChildren.props.style = Object.assign(headChildren.props.style || {}, {
|
20315
|
+
"background-color": this.headBackgroundColor
|
20316
|
+
});
|
20317
|
+
}
|
20318
|
+
headChildren.props.class = headChildClass;
|
20319
|
+
if (!tailChildren.props) {
|
20320
|
+
tailChildren.props = {};
|
20321
|
+
}
|
20322
|
+
let tailChildStaticClass = "bk-compose-form-item-tail";
|
20323
|
+
if (tailChildren.props.class) {
|
20324
|
+
tailChildStaticClass += ` ${tailChildren.props.class}`;
|
20325
|
+
}
|
20326
|
+
if (this.tailBackgroundColor) {
|
20327
|
+
tailChildren.props.style = Object.assign(tailChildren.props.style || {}, {
|
20328
|
+
"background-color": this.tailBackgroundColor
|
20329
|
+
});
|
20330
|
+
}
|
20331
|
+
tailChildren.props.class = tailChildStaticClass;
|
20332
|
+
}
|
20333
|
+
}
|
20334
|
+
return h$1("div", {
|
20335
|
+
class: "bk-compose-form-item"
|
20336
|
+
}, childrenArr);
|
20337
|
+
}
|
20338
|
+
});
|
19960
20339
|
const formKey$1 = Symbol("form");
|
19961
20340
|
const getFormKey = () => formKey$1;
|
19962
20341
|
const formKey = getFormKey();
|
@@ -20251,7 +20630,7 @@ var FormItem = defineComponent({
|
|
20251
20630
|
}, [this.$slots.error ? this.$slots.error(this.errorMessage) : this.errorMessage])])]);
|
20252
20631
|
}
|
20253
20632
|
});
|
20254
|
-
const BkForm = withInstallProps(Form, { FormItem });
|
20633
|
+
const BkForm = withInstallProps(Form, { FormItem, ComposeFormItem });
|
20255
20634
|
var Dropdown = defineComponent({
|
20256
20635
|
name: "BkDropdown",
|
20257
20636
|
props: {
|
@@ -20383,7 +20762,7 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
20383
20762
|
ButtonGroup,
|
20384
20763
|
Card: BkCard,
|
20385
20764
|
Checkbox: BkCheckbox,
|
20386
|
-
CheckboxGroup,
|
20765
|
+
CheckboxGroup: BkCheckboxGroup,
|
20387
20766
|
Collapse: BkCollaspe,
|
20388
20767
|
Dialog: BkDialog,
|
20389
20768
|
Exception: BkException,
|
@@ -20442,4 +20821,4 @@ var preset = {
|
|
20442
20821
|
install: createInstall(),
|
20443
20822
|
version: "0.0.1"
|
20444
20823
|
};
|
20445
|
-
export { BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkOption, OptionGroup as BkOptionGroup, BkBreadcrumb as Breadcrumb, BreadcrumbItem, BkButton as Button, ButtonGroup, BkCard as Card, BkCheckbox as Checkbox, CheckboxGroup, BkCollaspe as Collapse, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, DropdownItem, DropdownMenu, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, FormItem, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkProgress as Progress, BkRadio as Radio, RadioButton, RadioGroup, BkRate as Rate, BkSelect as Select, BkSideslider as Sideslider, BkSteps as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, TabPanel, BkTable as Table, BkTag as Tag, TagInput, Transfer, BkTree as Tree, BkVirtualRender as VirtualRender, tooltips as bkTooltips, ClickOutside as clickoutside, preset as default, mousewheel };
|
20824
|
+
export { BkAlert as Alert, BkAnimateNumber as AnimateNumber, BkBacktop as Backtop, BkBadge as Badge, BkOption, OptionGroup as BkOptionGroup, BkBreadcrumb as Breadcrumb, BreadcrumbItem, BkButton as Button, ButtonGroup, BkCard as Card, BkCheckbox as Checkbox, BkCheckboxGroup as CheckboxGroup, BkCollaspe as Collapse, BkDatePicker as DatePicker, BkDialog as Dialog, BkDivider as Divider, BkDropdown as Dropdown, DropdownItem, DropdownMenu, BkException as Exception, BkFixedNavbar as FixedNavbar, BkForm as Form, FormItem, BkInput as Input, BkLink as Link, BkLoading as Loading, BkMenu as Menu, Message, BkModal as Modal, Navigation, Notify, BkPagination as Pagination, BkPopover as Popover, BkProgress as Progress, BkRadio as Radio, RadioButton, RadioGroup, BkRate as Rate, BkSelect as Select, BkSideslider as Sideslider, BkSteps as Steps, BkSwiper as Swiper, BkSwitcher as Switcher, BkTab as Tab, TabPanel, BkTable as Table, BkTag as Tag, TagInput, Transfer, BkTree as Tree, BkVirtualRender as VirtualRender, tooltips as bkTooltips, ClickOutside as clickoutside, preset as default, mousewheel };
|