bkui-vue 0.0.1-beta.88 → 0.0.1-beta.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +11 -11
- package/dist/index.esm.js +62 -62
- package/dist/index.umd.js +13 -13
- package/lib/form/index.js +1 -1
- package/lib/radio/index.d.ts +0 -1
- package/lib/radio/index.js +1 -1
- package/lib/radio/radio-button.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -208,20 +208,20 @@ function isShadowRoot(node) {
|
|
208
208
|
}
|
209
209
|
function applyStyles(_ref) {
|
210
210
|
var state = _ref.state;
|
211
|
-
Object.keys(state.elements).forEach(function(
|
212
|
-
var style = state.styles[
|
213
|
-
var attributes = state.attributes[
|
214
|
-
var element = state.elements[
|
211
|
+
Object.keys(state.elements).forEach(function(name) {
|
212
|
+
var style = state.styles[name] || {};
|
213
|
+
var attributes = state.attributes[name] || {};
|
214
|
+
var element = state.elements[name];
|
215
215
|
if (!isHTMLElement(element) || !getNodeName(element)) {
|
216
216
|
return;
|
217
217
|
}
|
218
218
|
Object.assign(element.style, style);
|
219
|
-
Object.keys(attributes).forEach(function(
|
220
|
-
var value = attributes[
|
219
|
+
Object.keys(attributes).forEach(function(name2) {
|
220
|
+
var value = attributes[name2];
|
221
221
|
if (value === false) {
|
222
|
-
element.removeAttribute(
|
222
|
+
element.removeAttribute(name2);
|
223
223
|
} else {
|
224
|
-
element.setAttribute(
|
224
|
+
element.setAttribute(name2, value === true ? "" : value);
|
225
225
|
}
|
226
226
|
});
|
227
227
|
});
|
@@ -246,10 +246,10 @@ function effect$2(_ref2) {
|
|
246
246
|
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
247
247
|
}
|
248
248
|
return function() {
|
249
|
-
Object.keys(state.elements).forEach(function(
|
250
|
-
var element = state.elements[
|
251
|
-
var attributes = state.attributes[
|
252
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(
|
249
|
+
Object.keys(state.elements).forEach(function(name) {
|
250
|
+
var element = state.elements[name];
|
251
|
+
var attributes = state.attributes[name] || {};
|
252
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
253
253
|
var style = styleProperties.reduce(function(style2, property) {
|
254
254
|
style2[property] = "";
|
255
255
|
return style2;
|
@@ -428,7 +428,7 @@ var toPaddingObject = function toPaddingObject2(padding, state) {
|
|
428
428
|
};
|
429
429
|
function arrow(_ref) {
|
430
430
|
var _state$modifiersData$;
|
431
|
-
var state = _ref.state,
|
431
|
+
var state = _ref.state, name = _ref.name, options = _ref.options;
|
432
432
|
var arrowElement = state.elements.arrow;
|
433
433
|
var popperOffsets2 = state.modifiersData.popperOffsets;
|
434
434
|
var basePlacement = getBasePlacement(state.placement);
|
@@ -452,7 +452,7 @@ function arrow(_ref) {
|
|
452
452
|
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
453
453
|
var offset2 = within(min2, center, max2);
|
454
454
|
var axisProp = axis;
|
455
|
-
state.modifiersData[
|
455
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
456
456
|
}
|
457
457
|
function effect$1(_ref2) {
|
458
458
|
var state = _ref2.state, options = _ref2.options;
|
@@ -908,8 +908,8 @@ function getExpandedFallbackPlacements(placement) {
|
|
908
908
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
909
909
|
}
|
910
910
|
function flip(_ref) {
|
911
|
-
var state = _ref.state, options = _ref.options,
|
912
|
-
if (state.modifiersData[
|
911
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
912
|
+
if (state.modifiersData[name]._skip) {
|
913
913
|
return;
|
914
914
|
}
|
915
915
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
@@ -989,7 +989,7 @@ function flip(_ref) {
|
|
989
989
|
}
|
990
990
|
}
|
991
991
|
if (state.placement !== firstFittingPlacement) {
|
992
|
-
state.modifiersData[
|
992
|
+
state.modifiersData[name]._skip = true;
|
993
993
|
state.placement = firstFittingPlacement;
|
994
994
|
state.reset = true;
|
995
995
|
}
|
@@ -1024,7 +1024,7 @@ function isAnySideFullyClipped(overflow) {
|
|
1024
1024
|
});
|
1025
1025
|
}
|
1026
1026
|
function hide(_ref) {
|
1027
|
-
var state = _ref.state,
|
1027
|
+
var state = _ref.state, name = _ref.name;
|
1028
1028
|
var referenceRect = state.rects.reference;
|
1029
1029
|
var popperRect = state.rects.popper;
|
1030
1030
|
var preventedOffsets = state.modifiersData.preventOverflow;
|
@@ -1038,7 +1038,7 @@ function hide(_ref) {
|
|
1038
1038
|
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
1039
1039
|
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
1040
1040
|
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
1041
|
-
state.modifiersData[
|
1041
|
+
state.modifiersData[name] = {
|
1042
1042
|
referenceClippingOffsets,
|
1043
1043
|
popperEscapeOffsets,
|
1044
1044
|
isReferenceHidden,
|
@@ -1073,7 +1073,7 @@ function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
1073
1073
|
};
|
1074
1074
|
}
|
1075
1075
|
function offset(_ref2) {
|
1076
|
-
var state = _ref2.state, options = _ref2.options,
|
1076
|
+
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
1077
1077
|
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
1078
1078
|
var data2 = placements$1.reduce(function(acc, placement) {
|
1079
1079
|
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
@@ -1084,7 +1084,7 @@ function offset(_ref2) {
|
|
1084
1084
|
state.modifiersData.popperOffsets.x += x2;
|
1085
1085
|
state.modifiersData.popperOffsets.y += y2;
|
1086
1086
|
}
|
1087
|
-
state.modifiersData[
|
1087
|
+
state.modifiersData[name] = data2;
|
1088
1088
|
}
|
1089
1089
|
var offset$1 = {
|
1090
1090
|
name: "offset",
|
@@ -1094,8 +1094,8 @@ var offset$1 = {
|
|
1094
1094
|
fn: offset
|
1095
1095
|
};
|
1096
1096
|
function popperOffsets(_ref) {
|
1097
|
-
var state = _ref.state,
|
1098
|
-
state.modifiersData[
|
1097
|
+
var state = _ref.state, name = _ref.name;
|
1098
|
+
state.modifiersData[name] = computeOffsets({
|
1099
1099
|
reference: state.rects.reference,
|
1100
1100
|
element: state.rects.popper,
|
1101
1101
|
strategy: "absolute",
|
@@ -1113,7 +1113,7 @@ function getAltAxis(axis) {
|
|
1113
1113
|
return axis === "x" ? "y" : "x";
|
1114
1114
|
}
|
1115
1115
|
function preventOverflow(_ref) {
|
1116
|
-
var state = _ref.state, options = _ref.options,
|
1116
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
1117
1117
|
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
1118
1118
|
var overflow = detectOverflow(state, {
|
1119
1119
|
boundary,
|
@@ -1194,7 +1194,7 @@ function preventOverflow(_ref) {
|
|
1194
1194
|
popperOffsets2[altAxis] = _preventedOffset;
|
1195
1195
|
data2[altAxis] = _preventedOffset - _offset;
|
1196
1196
|
}
|
1197
|
-
state.modifiersData[
|
1197
|
+
state.modifiersData[name] = data2;
|
1198
1198
|
}
|
1199
1199
|
var preventOverflow$1 = {
|
1200
1200
|
name: "preventOverflow",
|
@@ -1395,12 +1395,12 @@ function popperGenerator(generatorOptions) {
|
|
1395
1395
|
index = -1;
|
1396
1396
|
continue;
|
1397
1397
|
}
|
1398
|
-
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
|
1398
|
+
var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
1399
1399
|
if (typeof fn2 === "function") {
|
1400
1400
|
state = fn2({
|
1401
1401
|
state,
|
1402
1402
|
options: _options,
|
1403
|
-
name
|
1403
|
+
name,
|
1404
1404
|
instance
|
1405
1405
|
}) || state;
|
1406
1406
|
}
|
@@ -1427,11 +1427,11 @@ function popperGenerator(generatorOptions) {
|
|
1427
1427
|
});
|
1428
1428
|
function runModifierEffects() {
|
1429
1429
|
state.orderedModifiers.forEach(function(_ref3) {
|
1430
|
-
var
|
1430
|
+
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect2 = _ref3.effect;
|
1431
1431
|
if (typeof effect2 === "function") {
|
1432
1432
|
var cleanupFn = effect2({
|
1433
1433
|
state,
|
1434
|
-
name
|
1434
|
+
name,
|
1435
1435
|
instance,
|
1436
1436
|
options: options2
|
1437
1437
|
});
|
@@ -2284,13 +2284,13 @@ class PropTypes extends propTypesNS {
|
|
2284
2284
|
default: "top"
|
2285
2285
|
});
|
2286
2286
|
}
|
2287
|
-
static commonType(types = [],
|
2288
|
-
return j(
|
2287
|
+
static commonType(types = [], name = "commonType") {
|
2288
|
+
return j(name.replace(/^\S/, (s2) => s2.toUpperCase()), {
|
2289
2289
|
type: String,
|
2290
2290
|
validator: (val) => {
|
2291
2291
|
const valid = types.includes(val);
|
2292
2292
|
if (!valid) {
|
2293
|
-
console.error(`invalid ${
|
2293
|
+
console.error(`invalid ${name}, ${val}, the ${name} must be one of \u3010${types.join(" | ")}\u3011`);
|
2294
2294
|
}
|
2295
2295
|
return valid;
|
2296
2296
|
},
|
@@ -2405,7 +2405,7 @@ function generate(node, key, rootAttrs) {
|
|
2405
2405
|
const bkIcon = (props, context) => {
|
2406
2406
|
const _a = __spreadValues(__spreadValues({}, context.attrs), props), {
|
2407
2407
|
data: data2,
|
2408
|
-
name
|
2408
|
+
name,
|
2409
2409
|
width,
|
2410
2410
|
height,
|
2411
2411
|
fill
|
@@ -2417,7 +2417,7 @@ const bkIcon = (props, context) => {
|
|
2417
2417
|
"fill"
|
2418
2418
|
]);
|
2419
2419
|
const rootAttrs = `width: ${width}; height: ${height}; fill: ${fill}`;
|
2420
|
-
return createVNode("span", restProps, [generate(data2,
|
2420
|
+
return createVNode("span", restProps, [generate(data2, name, rootAttrs)]);
|
2421
2421
|
};
|
2422
2422
|
bkIcon.inheritAttrs = false;
|
2423
2423
|
bkIcon.displayName = "bkIcon";
|
@@ -9126,8 +9126,8 @@ var Component$u = defineComponent({
|
|
9126
9126
|
const newVal = handleNumber(props.step, false);
|
9127
9127
|
ctx.emit(EVENTS$2.UPDATE, newVal);
|
9128
9128
|
}
|
9129
|
-
function getCls(
|
9130
|
-
return `${inputClsPrefix.value}--${
|
9129
|
+
function getCls(name) {
|
9130
|
+
return `${inputClsPrefix.value}--${name}`;
|
9131
9131
|
}
|
9132
9132
|
function handleVisibleChange() {
|
9133
9133
|
pwdVisible.value = !pwdVisible.value;
|
@@ -10527,7 +10527,7 @@ const useRadio = () => {
|
|
10527
10527
|
const formItem = useFormItem();
|
10528
10528
|
const radioGroup = inject(radioGroupKey, EMPTY_OBJ);
|
10529
10529
|
const isGroup = !isEmptyObj(radioGroup);
|
10530
|
-
const isChecked = ref(
|
10530
|
+
const isChecked = ref(false);
|
10531
10531
|
const isDisabled = computed(() => {
|
10532
10532
|
if (isGroup && radioGroup.props.disabled) {
|
10533
10533
|
return true;
|
@@ -10537,6 +10537,8 @@ const useRadio = () => {
|
|
10537
10537
|
if (isGroup) {
|
10538
10538
|
watch(() => radioGroup.props.modelValue, (modelValue) => {
|
10539
10539
|
isChecked.value = modelValue === props.label;
|
10540
|
+
}, {
|
10541
|
+
immediate: true
|
10540
10542
|
});
|
10541
10543
|
} else {
|
10542
10544
|
watch(() => props.modelValue, (modelValue) => {
|
@@ -10670,7 +10672,6 @@ var RadioButton = defineComponent({
|
|
10670
10672
|
} = useRadio();
|
10671
10673
|
return {
|
10672
10674
|
isFocused,
|
10673
|
-
realName: name,
|
10674
10675
|
isChecked,
|
10675
10676
|
isDisabled,
|
10676
10677
|
setChecked,
|
@@ -13331,11 +13332,11 @@ var useColumnResize = (colgroups, immediate = true) => {
|
|
13331
13332
|
colgroups.forEach((col) => {
|
13332
13333
|
if (col.resizable !== false) {
|
13333
13334
|
Object.keys(handler).forEach((event) => {
|
13334
|
-
const
|
13335
|
-
if (!col.listeners.has(
|
13336
|
-
col.listeners.set(
|
13335
|
+
const name = getEventName(event);
|
13336
|
+
if (!col.listeners.has(name)) {
|
13337
|
+
col.listeners.set(name, []);
|
13337
13338
|
}
|
13338
|
-
col.listeners.get(
|
13339
|
+
col.listeners.get(name).push(handler[event]);
|
13339
13340
|
});
|
13340
13341
|
}
|
13341
13342
|
});
|
@@ -13343,9 +13344,9 @@ var useColumnResize = (colgroups, immediate = true) => {
|
|
13343
13344
|
const resetResizeEvents = () => {
|
13344
13345
|
colgroups.forEach((col) => {
|
13345
13346
|
Object.keys(handler).forEach((event) => {
|
13346
|
-
const
|
13347
|
-
if (col.listeners.has(
|
13348
|
-
const listeners = col.listeners.get(
|
13347
|
+
const name = getEventName(event);
|
13348
|
+
if (col.listeners.has(name)) {
|
13349
|
+
const listeners = col.listeners.get(name);
|
13349
13350
|
listeners.splice(0, listeners.length);
|
13350
13351
|
}
|
13351
13352
|
});
|
@@ -15970,11 +15971,11 @@ const tabNavEventProps = {
|
|
15970
15971
|
},
|
15971
15972
|
tabChange: {
|
15972
15973
|
type: Function,
|
15973
|
-
default: (
|
15974
|
+
default: (name) => name
|
15974
15975
|
},
|
15975
15976
|
tabRemove: {
|
15976
15977
|
type: Function,
|
15977
|
-
default: (
|
15978
|
+
default: (name) => name
|
15978
15979
|
},
|
15979
15980
|
tabSort: {
|
15980
15981
|
type: Function,
|
@@ -16043,7 +16044,7 @@ var TabNav = defineComponent({
|
|
16043
16044
|
return null;
|
16044
16045
|
}
|
16045
16046
|
const {
|
16046
|
-
name
|
16047
|
+
name,
|
16047
16048
|
label,
|
16048
16049
|
closable,
|
16049
16050
|
visible,
|
@@ -16053,7 +16054,7 @@ var TabNav = defineComponent({
|
|
16053
16054
|
if (!visible) {
|
16054
16055
|
return false;
|
16055
16056
|
}
|
16056
|
-
if (props.active ===
|
16057
|
+
if (props.active === name) {
|
16057
16058
|
hasFindActive = true;
|
16058
16059
|
}
|
16059
16060
|
const renderLabel = (label2) => {
|
@@ -16072,7 +16073,7 @@ var TabNav = defineComponent({
|
|
16072
16073
|
return label2;
|
16073
16074
|
};
|
16074
16075
|
list.push({
|
16075
|
-
name
|
16076
|
+
name,
|
16076
16077
|
closable,
|
16077
16078
|
visible,
|
16078
16079
|
disabled,
|
@@ -16118,8 +16119,8 @@ var TabNav = defineComponent({
|
|
16118
16119
|
}
|
16119
16120
|
props.tabSort(dragStartIndex.value, index, sortType);
|
16120
16121
|
},
|
16121
|
-
handleTabChange(
|
16122
|
-
props.tabChange(
|
16122
|
+
handleTabChange(name) {
|
16123
|
+
props.tabChange(name);
|
16123
16124
|
},
|
16124
16125
|
handleTabRemove(index, panel) {
|
16125
16126
|
props.tabRemove(index, panel);
|
@@ -16151,7 +16152,7 @@ var TabNav = defineComponent({
|
|
16151
16152
|
return null;
|
16152
16153
|
}
|
16153
16154
|
const {
|
16154
|
-
name
|
16155
|
+
name,
|
16155
16156
|
disabled,
|
16156
16157
|
tabLabel
|
16157
16158
|
} = item;
|
@@ -16160,15 +16161,15 @@ var TabNav = defineComponent({
|
|
16160
16161
|
if (disabled) {
|
16161
16162
|
classNames.push("bk-tab-header--disabled");
|
16162
16163
|
}
|
16163
|
-
if (active ===
|
16164
|
+
if (active === name) {
|
16164
16165
|
classNames.push("bk-tab-header--active");
|
16165
16166
|
}
|
16166
16167
|
return classNames.join(" ");
|
16167
16168
|
};
|
16168
16169
|
const getValue = (curentValue, parentValue) => curentValue || parentValue;
|
16169
16170
|
return createVNode("div", {
|
16170
|
-
"key":
|
16171
|
-
"onClick": () => this.handleTabChange(
|
16171
|
+
"key": name,
|
16172
|
+
"onClick": () => this.handleTabChange(name),
|
16172
16173
|
"draggable": getValue(item.sortable, sortable),
|
16173
16174
|
"onDragstart": (e) => dragstart(index, e),
|
16174
16175
|
"onDragenter": (e) => {
|
@@ -16305,10 +16306,10 @@ var Tab = defineComponent({
|
|
16305
16306
|
e
|
16306
16307
|
});
|
16307
16308
|
},
|
16308
|
-
tabChange(
|
16309
|
-
emit("change",
|
16310
|
-
emit("tab-change",
|
16311
|
-
emit("update:active",
|
16309
|
+
tabChange(name) {
|
16310
|
+
emit("change", name);
|
16311
|
+
emit("tab-change", name);
|
16312
|
+
emit("update:active", name);
|
16312
16313
|
},
|
16313
16314
|
tabRemove(index, panel) {
|
16314
16315
|
emit("remove", index, panel);
|
@@ -22949,8 +22950,7 @@ var FormItem = defineComponent({
|
|
22949
22950
|
rules = props.rules;
|
22950
22951
|
}
|
22951
22952
|
rules = getTriggerRules(trigger, mergeRules(rules, getRulesFromProps(props)));
|
22952
|
-
|
22953
|
-
const value = form2.props.model[props.property];
|
22953
|
+
const value = lodash.exports.get(form2.props.model, props.property);
|
22954
22954
|
const doValidate = (() => {
|
22955
22955
|
let stepIndex = -1;
|
22956
22956
|
return () => {
|