bkui-vue 0.0.1-beta.34 → 0.0.1-beta.37
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/bkui-vue.cjs.js +168 -34
- package/dist/bkui-vue.esm.js +165 -35
- package/dist/bkui-vue.umd.js +168 -34
- package/dist/style.css +56 -19
- package/lib/button/button.css +3 -0
- package/lib/button/button.less +3 -0
- package/lib/button/button.variable.css +3 -0
- package/lib/components.d.ts +2 -0
- package/lib/input/index.d.ts +31 -5
- package/lib/input/input.css +41 -1
- package/lib/input/input.d.ts +20 -3
- package/lib/input/input.js +1 -1
- package/lib/input/input.less +51 -2
- package/lib/input/input.variable.css +42 -1
- package/lib/shared/index.d.ts +1 -0
- package/lib/shared/shared.js +1 -1
- package/lib/slider/slider.js +1 -1
- package/lib/table/render.d.ts +2 -0
- package/lib/table/table.css +9 -8
- package/lib/table/table.js +1 -1
- package/lib/table/table.less +10 -15
- package/lib/table/table.variable.css +9 -8
- package/lib/virtual-render/virtual-render.css +3 -10
- package/lib/virtual-render/virtual-render.less +3 -11
- package/lib/virtual-render/virtual-render.variable.css +3 -10
- package/package.json +1 -1
package/dist/bkui-vue.cjs.js
CHANGED
@@ -9262,8 +9262,9 @@ const inputType = {
|
|
9262
9262
|
showControl: PropTypes.bool.def(true),
|
9263
9263
|
showClearOnlyHover: PropTypes.bool.def(false),
|
9264
9264
|
precision: PropTypes.number.def(0).validate((val) => val >= 0 && val < 20),
|
9265
|
-
modelValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
9266
|
-
size: PropTypes.size()
|
9265
|
+
modelValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).def(""),
|
9266
|
+
size: PropTypes.size(),
|
9267
|
+
rows: PropTypes.number
|
9267
9268
|
};
|
9268
9269
|
const inputEvents = ["update:modelValue", "focus", "blur", "change", "clear", "input", "keypress", "keydown", "keyup", "enter", "paste"];
|
9269
9270
|
const EventEnum = stringEnum([...inputEvents]);
|
@@ -9275,7 +9276,8 @@ var Component$i = vue.defineComponent({
|
|
9275
9276
|
setup(props, ctx) {
|
9276
9277
|
const isFocused = vue.ref(false);
|
9277
9278
|
const isCNInput = vue.ref(false);
|
9278
|
-
const
|
9279
|
+
const isTextArea = vue.computed(() => props.type === "textarea");
|
9280
|
+
const inputClsPrefix = vue.computed(() => isTextArea.value ? "bk-textarea" : "bk-input");
|
9279
9281
|
const _a = ctx.attrs, {
|
9280
9282
|
class: cls,
|
9281
9283
|
style
|
@@ -9284,13 +9286,13 @@ var Component$i = vue.defineComponent({
|
|
9284
9286
|
"style"
|
9285
9287
|
]);
|
9286
9288
|
const inputCls = vue.computed(() => classes({
|
9287
|
-
[`${inputClsPrefix}--${props.size}`]: !!props.size,
|
9289
|
+
[`${inputClsPrefix.value}--${props.size}`]: !!props.size,
|
9288
9290
|
"is-focused": isFocused.value,
|
9289
9291
|
"is-readonly": props.readonly,
|
9290
9292
|
"is-disabled": props.disabled,
|
9291
9293
|
"is-simplicity": props.behavior === "simplicity",
|
9292
9294
|
[`${cls}`]: !!cls
|
9293
|
-
}, inputClsPrefix));
|
9295
|
+
}, inputClsPrefix.value));
|
9294
9296
|
const suffixIconMap = {
|
9295
9297
|
search: () => vue.createVNode(search, null, null),
|
9296
9298
|
password: () => vue.createVNode(eye, {
|
@@ -9376,11 +9378,28 @@ var Component$i = vue.defineComponent({
|
|
9376
9378
|
ctx.emit(EventEnum["update:modelValue"], newVal);
|
9377
9379
|
}
|
9378
9380
|
function getCls(name) {
|
9379
|
-
return `${inputClsPrefix}--${name}`;
|
9381
|
+
return `${inputClsPrefix.value}--${name}`;
|
9380
9382
|
}
|
9381
9383
|
function handleVisibleChange() {
|
9382
9384
|
pwdVisible.value = !pwdVisible.value;
|
9383
9385
|
}
|
9386
|
+
const bindProps = vue.computed(() => ({
|
9387
|
+
value: props.modelValue,
|
9388
|
+
maxlength: props.maxlength,
|
9389
|
+
placeholder: props.placeholder,
|
9390
|
+
readonly: props.readonly,
|
9391
|
+
disabled: props.disabled,
|
9392
|
+
onInput: handleInput,
|
9393
|
+
onFocus: handleFocus,
|
9394
|
+
onBlur: handleBlur,
|
9395
|
+
onPaste: handlePaste,
|
9396
|
+
onChange: handleChange,
|
9397
|
+
onKeypress: handleKeyPress,
|
9398
|
+
onKeydown: handleKeydown,
|
9399
|
+
onKeyup: handleKeyup,
|
9400
|
+
onCompositionstart: handleCompositionStart,
|
9401
|
+
onCompositionend: handleCompositionEnd
|
9402
|
+
}));
|
9384
9403
|
return () => {
|
9385
9404
|
var _a2, _b, _c, _d, _e, _f;
|
9386
9405
|
return vue.createVNode("div", {
|
@@ -9390,31 +9409,18 @@ var Component$i = vue.defineComponent({
|
|
9390
9409
|
"class": getCls("prefix-area")
|
9391
9410
|
}, [vue.createVNode("span", {
|
9392
9411
|
"class": getCls("prefix-area--text")
|
9393
|
-
}, [props.prefix])]), vue.createVNode("
|
9394
|
-
"
|
9395
|
-
|
9412
|
+
}, [props.prefix])]), isTextArea.value ? vue.createVNode("textarea", vue.mergeProps(inputAttrs, bindProps.value, {
|
9413
|
+
"rows": props.rows
|
9414
|
+
}), null) : vue.createVNode("input", vue.mergeProps(inputAttrs, {
|
9415
|
+
"class": `${inputClsPrefix.value}--text`,
|
9396
9416
|
"type": pwdVisible.value && props.type === "password" ? "text" : props.type,
|
9397
|
-
"maxlength": props.maxlength,
|
9398
9417
|
"step": props.step,
|
9399
9418
|
"max": props.max,
|
9400
|
-
"min": props.min
|
9401
|
-
|
9402
|
-
"readonly": props.readonly,
|
9403
|
-
"disabled": props.disabled,
|
9404
|
-
"onInput": handleInput,
|
9405
|
-
"onFocus": handleFocus,
|
9406
|
-
"onBlur": handleBlur,
|
9407
|
-
"onPaste": handlePaste,
|
9408
|
-
"onChange": handleChange,
|
9409
|
-
"onKeypress": handleKeyPress,
|
9410
|
-
"onKeydown": handleKeydown,
|
9411
|
-
"onKeyup": handleKeyup,
|
9412
|
-
"onCompositionstart": handleCompositionStart,
|
9413
|
-
"onCompositionend": handleCompositionEnd
|
9414
|
-
}), null), props.clearable && !!props.modelValue && vue.createVNode(close$1, {
|
9419
|
+
"min": props.min
|
9420
|
+
}, bindProps.value), null), !isTextArea.value && props.clearable && !!props.modelValue && vue.createVNode(close$1, {
|
9415
9421
|
"onClick": clear,
|
9416
9422
|
"class": clearCls.value
|
9417
|
-
}, null), suffixIcon.value, typeof props.maxlength === "number" && props.showWordLimit && vue.createVNode("p", {
|
9423
|
+
}, null), suffixIcon.value, typeof props.maxlength === "number" && (props.showWordLimit || isTextArea.value) && vue.createVNode("p", {
|
9418
9424
|
"class": getCls("max-length")
|
9419
9425
|
}, [props.modelValue.toString().length, vue.createTextVNode("/"), vue.createVNode("span", null, [ceilMaxLength.value])]), isNumberInput.value && props.showControl && vue.createVNode("div", {
|
9420
9426
|
"class": getCls("number-control")
|
@@ -12489,7 +12495,7 @@ const resolveColumnWidth = (root, colgroups, autoWidth = 20) => {
|
|
12489
12495
|
const {
|
12490
12496
|
width
|
12491
12497
|
} = root.getBoundingClientRect() || {};
|
12492
|
-
let avgWidth = width;
|
12498
|
+
let avgWidth = width - 4;
|
12493
12499
|
const avgColIndexList = [];
|
12494
12500
|
const resolveColNumberWidth = (col, numWidth, resetAvgWidth = true) => {
|
12495
12501
|
Object.assign(col, {
|
@@ -12573,11 +12579,13 @@ const resolvePaginationOption = (propPagination, defVal) => {
|
|
12573
12579
|
};
|
12574
12580
|
class TableRender {
|
12575
12581
|
constructor(props, ctx, reactiveProp, colgroups) {
|
12582
|
+
__publicField(this, "getColumnClass", (colIndex) => `${this.uuid}-column-${colIndex}`);
|
12576
12583
|
this.props = props;
|
12577
12584
|
this.context = ctx;
|
12578
12585
|
this.reactiveProp = reactiveProp;
|
12579
12586
|
this.colgroups = colgroups;
|
12580
12587
|
this.plugins = new TablePlugins(props, ctx);
|
12588
|
+
this.uuid = random(8);
|
12581
12589
|
}
|
12582
12590
|
get propActiveCols() {
|
12583
12591
|
return this.reactiveProp.activeColumns;
|
@@ -12659,12 +12667,13 @@ class TableRender {
|
|
12659
12667
|
"style": rowStyle,
|
12660
12668
|
"onClick": (e) => this.handleRowClick(e, row, index, rows),
|
12661
12669
|
"onDblclick": (e) => this.handleRowDblClick(e, row, index, rows)
|
12662
|
-
}, [this.props.columns.map((column) => vue.createVNode("td", {
|
12670
|
+
}, [this.props.columns.map((column, index2) => vue.createVNode("td", {
|
12671
|
+
"class": this.getColumnClass(index2),
|
12663
12672
|
"colspan": 1,
|
12664
12673
|
"rowspan": 1
|
12665
12674
|
}, [vue.createVNode("div", {
|
12666
12675
|
"class": "cell"
|
12667
|
-
}, [this.renderCell(row, column,
|
12676
|
+
}, [this.renderCell(row, column, index2, rows)])]))]);
|
12668
12677
|
})]);
|
12669
12678
|
}
|
12670
12679
|
handleRowClick(e, row, index, rows) {
|
@@ -12688,12 +12697,10 @@ class TableRender {
|
|
12688
12697
|
const colCls = classes({
|
12689
12698
|
active: this.isColActive(index)
|
12690
12699
|
});
|
12691
|
-
const
|
12692
|
-
width: resolveWidth(column.calcWidth)
|
12693
|
-
};
|
12700
|
+
const width = `${resolveWidth(column.calcWidth)}`.replace(/px$/i, "");
|
12694
12701
|
return vue.createVNode("col", {
|
12695
12702
|
"class": colCls,
|
12696
|
-
"
|
12703
|
+
"width": width
|
12697
12704
|
}, null);
|
12698
12705
|
})]);
|
12699
12706
|
}
|
@@ -20091,6 +20098,125 @@ var FormItem = vue.defineComponent({
|
|
20091
20098
|
}
|
20092
20099
|
});
|
20093
20100
|
const BkForm = withInstallProps(Form, { FormItem });
|
20101
|
+
var Dropdown = vue.defineComponent({
|
20102
|
+
name: "BkDropdown",
|
20103
|
+
props: {
|
20104
|
+
isShow: PropTypes.bool.def(false),
|
20105
|
+
placement: PropTypes.commonType(["auto", "auto-start", "auto-end", "top", "right", "bottom", "left", "top-start", "top-end", "bottom-start", "bottom-end", "right-start", "right-end", "left-start", "left-end"], "placement").def("bottom"),
|
20106
|
+
trigger: PropTypes.commonType(["hover", "click", "manual"], "trigger").def("hover"),
|
20107
|
+
disabled: PropTypes.bool.def(false),
|
20108
|
+
extCls: PropTypes.string
|
20109
|
+
},
|
20110
|
+
emits: ["showChange"],
|
20111
|
+
setup(props, {
|
20112
|
+
emit
|
20113
|
+
}) {
|
20114
|
+
let popoverInstance = /* @__PURE__ */ Object.create(null);
|
20115
|
+
const reference2 = vue.ref(null);
|
20116
|
+
const refContent = vue.ref(null);
|
20117
|
+
vue.onMounted(() => {
|
20118
|
+
registerDropdown();
|
20119
|
+
});
|
20120
|
+
vue.onBeforeUnmount(() => {
|
20121
|
+
destoryDropdown();
|
20122
|
+
});
|
20123
|
+
vue.watch(() => props.isShow, (val) => {
|
20124
|
+
vue.nextTick(() => {
|
20125
|
+
if (props.trigger === "manual" && popoverInstance && !props.disabled) {
|
20126
|
+
val ? popoverInstance.show() : popoverInstance.hide();
|
20127
|
+
}
|
20128
|
+
});
|
20129
|
+
});
|
20130
|
+
vue.watch(() => props.disabled, (val) => handleUpdateDisabled(val));
|
20131
|
+
const registerDropdown = () => {
|
20132
|
+
if (props.disabled)
|
20133
|
+
return;
|
20134
|
+
popoverInstance = new BKPopover(reference2.value, refContent.value, {
|
20135
|
+
placement: props.placement,
|
20136
|
+
trigger: props.trigger
|
20137
|
+
});
|
20138
|
+
props.trigger === "manual" && props.isShow && popoverInstance.show();
|
20139
|
+
};
|
20140
|
+
const destoryDropdown = () => {
|
20141
|
+
if (popoverInstance) {
|
20142
|
+
const instance = popoverInstance;
|
20143
|
+
instance.isShow && instance.hide();
|
20144
|
+
instance.destroy();
|
20145
|
+
popoverInstance = null;
|
20146
|
+
props.trigger === "manual" && emit("showChange", false);
|
20147
|
+
}
|
20148
|
+
};
|
20149
|
+
const handleUpdateDisabled = (val) => {
|
20150
|
+
const instance = popoverInstance;
|
20151
|
+
props.trigger === "manual" && !val && emit("showChange", false);
|
20152
|
+
instance.updateDisabled(val);
|
20153
|
+
};
|
20154
|
+
return {
|
20155
|
+
reference: reference2,
|
20156
|
+
refContent
|
20157
|
+
};
|
20158
|
+
},
|
20159
|
+
render() {
|
20160
|
+
var _a, _b, _c, _d;
|
20161
|
+
const wrapperClasses = classes({
|
20162
|
+
"bk-dropdown": true
|
20163
|
+
}, this.$props.extCls);
|
20164
|
+
return vue.createVNode("div", {
|
20165
|
+
"class": wrapperClasses
|
20166
|
+
}, [vue.createVNode("div", {
|
20167
|
+
"ref": "reference",
|
20168
|
+
"class": "bk-dropdown-reference"
|
20169
|
+
}, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), vue.createVNode("div", {
|
20170
|
+
"ref": "refContent",
|
20171
|
+
"class": "bk-dropdown-content"
|
20172
|
+
}, [(_d = (_c = this.$slots).content) == null ? void 0 : _d.call(_c)])]);
|
20173
|
+
}
|
20174
|
+
});
|
20175
|
+
var DropdownItem = vue.defineComponent({
|
20176
|
+
name: "BkDropdownItem",
|
20177
|
+
props: {
|
20178
|
+
extCls: PropTypes.string
|
20179
|
+
},
|
20180
|
+
emits: ["click"],
|
20181
|
+
setup(props, {
|
20182
|
+
emit
|
20183
|
+
}) {
|
20184
|
+
const handleClick = (evt) => {
|
20185
|
+
emit("click", evt);
|
20186
|
+
};
|
20187
|
+
const wrapperCLasses = vue.computed(() => ["bk-dropdown-item", props.extCls]);
|
20188
|
+
return {
|
20189
|
+
wrapperCLasses,
|
20190
|
+
handleClick
|
20191
|
+
};
|
20192
|
+
},
|
20193
|
+
render() {
|
20194
|
+
var _a, _b;
|
20195
|
+
return vue.createVNode("li", {
|
20196
|
+
"class": this.wrapperCLasses,
|
20197
|
+
"onClick": this.handleClick
|
20198
|
+
}, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]);
|
20199
|
+
}
|
20200
|
+
});
|
20201
|
+
var DropdownMenu = vue.defineComponent({
|
20202
|
+
name: "BkDropdownMenu",
|
20203
|
+
props: {
|
20204
|
+
extCls: PropTypes.string
|
20205
|
+
},
|
20206
|
+
setup(props) {
|
20207
|
+
const wrapperCLasses = vue.computed(() => ["bk-dropdown-menu", props.extCls]);
|
20208
|
+
return {
|
20209
|
+
wrapperCLasses
|
20210
|
+
};
|
20211
|
+
},
|
20212
|
+
render() {
|
20213
|
+
var _a, _b;
|
20214
|
+
return vue.createVNode("ul", {
|
20215
|
+
"class": this.wrapperCLasses
|
20216
|
+
}, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]);
|
20217
|
+
}
|
20218
|
+
});
|
20219
|
+
const BkDropdown = withInstallProps(Dropdown, { DropdownMenu, DropdownItem });
|
20094
20220
|
var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
20095
20221
|
__proto__: null,
|
20096
20222
|
Alert: BkAlert,
|
@@ -20140,7 +20266,11 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
20140
20266
|
Tree: BkTree,
|
20141
20267
|
VirtualRender: BkVirtualRender,
|
20142
20268
|
Form: BkForm,
|
20143
|
-
FormItem
|
20269
|
+
FormItem,
|
20270
|
+
Pagination: BkPagination,
|
20271
|
+
Dropdown: BkDropdown,
|
20272
|
+
DropdownMenu,
|
20273
|
+
DropdownItem
|
20144
20274
|
}, Symbol.toStringTag, { value: "Module" }));
|
20145
20275
|
const createInstall = (prefix = "Bk") => (app) => {
|
20146
20276
|
const pre = app.config.globalProperties.bkUIPrefix || prefix;
|
@@ -20175,6 +20305,9 @@ exports.Collapse = BkCollaspe;
|
|
20175
20305
|
exports.DatePicker = BkDatePicker;
|
20176
20306
|
exports.Dialog = BkDialog;
|
20177
20307
|
exports.Divider = BkDivider;
|
20308
|
+
exports.Dropdown = BkDropdown;
|
20309
|
+
exports.DropdownItem = DropdownItem;
|
20310
|
+
exports.DropdownMenu = DropdownMenu;
|
20178
20311
|
exports.Exception = BkException;
|
20179
20312
|
exports.FixedNavbar = BkFixedNavbar;
|
20180
20313
|
exports.Form = BkForm;
|
@@ -20187,6 +20320,7 @@ exports.Message = Message;
|
|
20187
20320
|
exports.Modal = BkModal;
|
20188
20321
|
exports.Navigation = Navigation;
|
20189
20322
|
exports.Notify = Notify;
|
20323
|
+
exports.Pagination = BkPagination;
|
20190
20324
|
exports.Popover = BkPopover;
|
20191
20325
|
exports.Progress = BkProgress;
|
20192
20326
|
exports.Radio = BkRadio;
|
package/dist/bkui-vue.esm.js
CHANGED
@@ -9260,8 +9260,9 @@ const inputType = {
|
|
9260
9260
|
showControl: PropTypes.bool.def(true),
|
9261
9261
|
showClearOnlyHover: PropTypes.bool.def(false),
|
9262
9262
|
precision: PropTypes.number.def(0).validate((val) => val >= 0 && val < 20),
|
9263
|
-
modelValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
9264
|
-
size: PropTypes.size()
|
9263
|
+
modelValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).def(""),
|
9264
|
+
size: PropTypes.size(),
|
9265
|
+
rows: PropTypes.number
|
9265
9266
|
};
|
9266
9267
|
const inputEvents = ["update:modelValue", "focus", "blur", "change", "clear", "input", "keypress", "keydown", "keyup", "enter", "paste"];
|
9267
9268
|
const EventEnum = stringEnum([...inputEvents]);
|
@@ -9273,7 +9274,8 @@ var Component$i = defineComponent({
|
|
9273
9274
|
setup(props, ctx) {
|
9274
9275
|
const isFocused = ref(false);
|
9275
9276
|
const isCNInput = ref(false);
|
9276
|
-
const
|
9277
|
+
const isTextArea = computed(() => props.type === "textarea");
|
9278
|
+
const inputClsPrefix = computed(() => isTextArea.value ? "bk-textarea" : "bk-input");
|
9277
9279
|
const _a = ctx.attrs, {
|
9278
9280
|
class: cls,
|
9279
9281
|
style
|
@@ -9282,13 +9284,13 @@ var Component$i = defineComponent({
|
|
9282
9284
|
"style"
|
9283
9285
|
]);
|
9284
9286
|
const inputCls = computed(() => classes({
|
9285
|
-
[`${inputClsPrefix}--${props.size}`]: !!props.size,
|
9287
|
+
[`${inputClsPrefix.value}--${props.size}`]: !!props.size,
|
9286
9288
|
"is-focused": isFocused.value,
|
9287
9289
|
"is-readonly": props.readonly,
|
9288
9290
|
"is-disabled": props.disabled,
|
9289
9291
|
"is-simplicity": props.behavior === "simplicity",
|
9290
9292
|
[`${cls}`]: !!cls
|
9291
|
-
}, inputClsPrefix));
|
9293
|
+
}, inputClsPrefix.value));
|
9292
9294
|
const suffixIconMap = {
|
9293
9295
|
search: () => createVNode(search, null, null),
|
9294
9296
|
password: () => createVNode(eye, {
|
@@ -9374,11 +9376,28 @@ var Component$i = defineComponent({
|
|
9374
9376
|
ctx.emit(EventEnum["update:modelValue"], newVal);
|
9375
9377
|
}
|
9376
9378
|
function getCls(name) {
|
9377
|
-
return `${inputClsPrefix}--${name}`;
|
9379
|
+
return `${inputClsPrefix.value}--${name}`;
|
9378
9380
|
}
|
9379
9381
|
function handleVisibleChange() {
|
9380
9382
|
pwdVisible.value = !pwdVisible.value;
|
9381
9383
|
}
|
9384
|
+
const bindProps = computed(() => ({
|
9385
|
+
value: props.modelValue,
|
9386
|
+
maxlength: props.maxlength,
|
9387
|
+
placeholder: props.placeholder,
|
9388
|
+
readonly: props.readonly,
|
9389
|
+
disabled: props.disabled,
|
9390
|
+
onInput: handleInput,
|
9391
|
+
onFocus: handleFocus,
|
9392
|
+
onBlur: handleBlur,
|
9393
|
+
onPaste: handlePaste,
|
9394
|
+
onChange: handleChange,
|
9395
|
+
onKeypress: handleKeyPress,
|
9396
|
+
onKeydown: handleKeydown,
|
9397
|
+
onKeyup: handleKeyup,
|
9398
|
+
onCompositionstart: handleCompositionStart,
|
9399
|
+
onCompositionend: handleCompositionEnd
|
9400
|
+
}));
|
9382
9401
|
return () => {
|
9383
9402
|
var _a2, _b, _c, _d, _e, _f;
|
9384
9403
|
return createVNode("div", {
|
@@ -9388,31 +9407,18 @@ var Component$i = defineComponent({
|
|
9388
9407
|
"class": getCls("prefix-area")
|
9389
9408
|
}, [createVNode("span", {
|
9390
9409
|
"class": getCls("prefix-area--text")
|
9391
|
-
}, [props.prefix])]), createVNode("
|
9392
|
-
"
|
9393
|
-
|
9410
|
+
}, [props.prefix])]), isTextArea.value ? createVNode("textarea", mergeProps(inputAttrs, bindProps.value, {
|
9411
|
+
"rows": props.rows
|
9412
|
+
}), null) : createVNode("input", mergeProps(inputAttrs, {
|
9413
|
+
"class": `${inputClsPrefix.value}--text`,
|
9394
9414
|
"type": pwdVisible.value && props.type === "password" ? "text" : props.type,
|
9395
|
-
"maxlength": props.maxlength,
|
9396
9415
|
"step": props.step,
|
9397
9416
|
"max": props.max,
|
9398
|
-
"min": props.min
|
9399
|
-
|
9400
|
-
"readonly": props.readonly,
|
9401
|
-
"disabled": props.disabled,
|
9402
|
-
"onInput": handleInput,
|
9403
|
-
"onFocus": handleFocus,
|
9404
|
-
"onBlur": handleBlur,
|
9405
|
-
"onPaste": handlePaste,
|
9406
|
-
"onChange": handleChange,
|
9407
|
-
"onKeypress": handleKeyPress,
|
9408
|
-
"onKeydown": handleKeydown,
|
9409
|
-
"onKeyup": handleKeyup,
|
9410
|
-
"onCompositionstart": handleCompositionStart,
|
9411
|
-
"onCompositionend": handleCompositionEnd
|
9412
|
-
}), null), props.clearable && !!props.modelValue && createVNode(close$1, {
|
9417
|
+
"min": props.min
|
9418
|
+
}, bindProps.value), null), !isTextArea.value && props.clearable && !!props.modelValue && createVNode(close$1, {
|
9413
9419
|
"onClick": clear,
|
9414
9420
|
"class": clearCls.value
|
9415
|
-
}, null), suffixIcon.value, typeof props.maxlength === "number" && props.showWordLimit && createVNode("p", {
|
9421
|
+
}, null), suffixIcon.value, typeof props.maxlength === "number" && (props.showWordLimit || isTextArea.value) && createVNode("p", {
|
9416
9422
|
"class": getCls("max-length")
|
9417
9423
|
}, [props.modelValue.toString().length, createTextVNode("/"), createVNode("span", null, [ceilMaxLength.value])]), isNumberInput.value && props.showControl && createVNode("div", {
|
9418
9424
|
"class": getCls("number-control")
|
@@ -12487,7 +12493,7 @@ const resolveColumnWidth = (root, colgroups, autoWidth = 20) => {
|
|
12487
12493
|
const {
|
12488
12494
|
width
|
12489
12495
|
} = root.getBoundingClientRect() || {};
|
12490
|
-
let avgWidth = width;
|
12496
|
+
let avgWidth = width - 4;
|
12491
12497
|
const avgColIndexList = [];
|
12492
12498
|
const resolveColNumberWidth = (col, numWidth, resetAvgWidth = true) => {
|
12493
12499
|
Object.assign(col, {
|
@@ -12571,11 +12577,13 @@ const resolvePaginationOption = (propPagination, defVal) => {
|
|
12571
12577
|
};
|
12572
12578
|
class TableRender {
|
12573
12579
|
constructor(props, ctx, reactiveProp, colgroups) {
|
12580
|
+
__publicField(this, "getColumnClass", (colIndex) => `${this.uuid}-column-${colIndex}`);
|
12574
12581
|
this.props = props;
|
12575
12582
|
this.context = ctx;
|
12576
12583
|
this.reactiveProp = reactiveProp;
|
12577
12584
|
this.colgroups = colgroups;
|
12578
12585
|
this.plugins = new TablePlugins(props, ctx);
|
12586
|
+
this.uuid = random(8);
|
12579
12587
|
}
|
12580
12588
|
get propActiveCols() {
|
12581
12589
|
return this.reactiveProp.activeColumns;
|
@@ -12657,12 +12665,13 @@ class TableRender {
|
|
12657
12665
|
"style": rowStyle,
|
12658
12666
|
"onClick": (e) => this.handleRowClick(e, row, index, rows),
|
12659
12667
|
"onDblclick": (e) => this.handleRowDblClick(e, row, index, rows)
|
12660
|
-
}, [this.props.columns.map((column) => createVNode("td", {
|
12668
|
+
}, [this.props.columns.map((column, index2) => createVNode("td", {
|
12669
|
+
"class": this.getColumnClass(index2),
|
12661
12670
|
"colspan": 1,
|
12662
12671
|
"rowspan": 1
|
12663
12672
|
}, [createVNode("div", {
|
12664
12673
|
"class": "cell"
|
12665
|
-
}, [this.renderCell(row, column,
|
12674
|
+
}, [this.renderCell(row, column, index2, rows)])]))]);
|
12666
12675
|
})]);
|
12667
12676
|
}
|
12668
12677
|
handleRowClick(e, row, index, rows) {
|
@@ -12686,12 +12695,10 @@ class TableRender {
|
|
12686
12695
|
const colCls = classes({
|
12687
12696
|
active: this.isColActive(index)
|
12688
12697
|
});
|
12689
|
-
const
|
12690
|
-
width: resolveWidth(column.calcWidth)
|
12691
|
-
};
|
12698
|
+
const width = `${resolveWidth(column.calcWidth)}`.replace(/px$/i, "");
|
12692
12699
|
return createVNode("col", {
|
12693
12700
|
"class": colCls,
|
12694
|
-
"
|
12701
|
+
"width": width
|
12695
12702
|
}, null);
|
12696
12703
|
})]);
|
12697
12704
|
}
|
@@ -20089,6 +20096,125 @@ var FormItem = defineComponent({
|
|
20089
20096
|
}
|
20090
20097
|
});
|
20091
20098
|
const BkForm = withInstallProps(Form, { FormItem });
|
20099
|
+
var Dropdown = defineComponent({
|
20100
|
+
name: "BkDropdown",
|
20101
|
+
props: {
|
20102
|
+
isShow: PropTypes.bool.def(false),
|
20103
|
+
placement: PropTypes.commonType(["auto", "auto-start", "auto-end", "top", "right", "bottom", "left", "top-start", "top-end", "bottom-start", "bottom-end", "right-start", "right-end", "left-start", "left-end"], "placement").def("bottom"),
|
20104
|
+
trigger: PropTypes.commonType(["hover", "click", "manual"], "trigger").def("hover"),
|
20105
|
+
disabled: PropTypes.bool.def(false),
|
20106
|
+
extCls: PropTypes.string
|
20107
|
+
},
|
20108
|
+
emits: ["showChange"],
|
20109
|
+
setup(props, {
|
20110
|
+
emit
|
20111
|
+
}) {
|
20112
|
+
let popoverInstance = /* @__PURE__ */ Object.create(null);
|
20113
|
+
const reference2 = ref(null);
|
20114
|
+
const refContent = ref(null);
|
20115
|
+
onMounted(() => {
|
20116
|
+
registerDropdown();
|
20117
|
+
});
|
20118
|
+
onBeforeUnmount(() => {
|
20119
|
+
destoryDropdown();
|
20120
|
+
});
|
20121
|
+
watch(() => props.isShow, (val) => {
|
20122
|
+
nextTick(() => {
|
20123
|
+
if (props.trigger === "manual" && popoverInstance && !props.disabled) {
|
20124
|
+
val ? popoverInstance.show() : popoverInstance.hide();
|
20125
|
+
}
|
20126
|
+
});
|
20127
|
+
});
|
20128
|
+
watch(() => props.disabled, (val) => handleUpdateDisabled(val));
|
20129
|
+
const registerDropdown = () => {
|
20130
|
+
if (props.disabled)
|
20131
|
+
return;
|
20132
|
+
popoverInstance = new BKPopover(reference2.value, refContent.value, {
|
20133
|
+
placement: props.placement,
|
20134
|
+
trigger: props.trigger
|
20135
|
+
});
|
20136
|
+
props.trigger === "manual" && props.isShow && popoverInstance.show();
|
20137
|
+
};
|
20138
|
+
const destoryDropdown = () => {
|
20139
|
+
if (popoverInstance) {
|
20140
|
+
const instance = popoverInstance;
|
20141
|
+
instance.isShow && instance.hide();
|
20142
|
+
instance.destroy();
|
20143
|
+
popoverInstance = null;
|
20144
|
+
props.trigger === "manual" && emit("showChange", false);
|
20145
|
+
}
|
20146
|
+
};
|
20147
|
+
const handleUpdateDisabled = (val) => {
|
20148
|
+
const instance = popoverInstance;
|
20149
|
+
props.trigger === "manual" && !val && emit("showChange", false);
|
20150
|
+
instance.updateDisabled(val);
|
20151
|
+
};
|
20152
|
+
return {
|
20153
|
+
reference: reference2,
|
20154
|
+
refContent
|
20155
|
+
};
|
20156
|
+
},
|
20157
|
+
render() {
|
20158
|
+
var _a, _b, _c, _d;
|
20159
|
+
const wrapperClasses = classes({
|
20160
|
+
"bk-dropdown": true
|
20161
|
+
}, this.$props.extCls);
|
20162
|
+
return createVNode("div", {
|
20163
|
+
"class": wrapperClasses
|
20164
|
+
}, [createVNode("div", {
|
20165
|
+
"ref": "reference",
|
20166
|
+
"class": "bk-dropdown-reference"
|
20167
|
+
}, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), createVNode("div", {
|
20168
|
+
"ref": "refContent",
|
20169
|
+
"class": "bk-dropdown-content"
|
20170
|
+
}, [(_d = (_c = this.$slots).content) == null ? void 0 : _d.call(_c)])]);
|
20171
|
+
}
|
20172
|
+
});
|
20173
|
+
var DropdownItem = defineComponent({
|
20174
|
+
name: "BkDropdownItem",
|
20175
|
+
props: {
|
20176
|
+
extCls: PropTypes.string
|
20177
|
+
},
|
20178
|
+
emits: ["click"],
|
20179
|
+
setup(props, {
|
20180
|
+
emit
|
20181
|
+
}) {
|
20182
|
+
const handleClick = (evt) => {
|
20183
|
+
emit("click", evt);
|
20184
|
+
};
|
20185
|
+
const wrapperCLasses = computed(() => ["bk-dropdown-item", props.extCls]);
|
20186
|
+
return {
|
20187
|
+
wrapperCLasses,
|
20188
|
+
handleClick
|
20189
|
+
};
|
20190
|
+
},
|
20191
|
+
render() {
|
20192
|
+
var _a, _b;
|
20193
|
+
return createVNode("li", {
|
20194
|
+
"class": this.wrapperCLasses,
|
20195
|
+
"onClick": this.handleClick
|
20196
|
+
}, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]);
|
20197
|
+
}
|
20198
|
+
});
|
20199
|
+
var DropdownMenu = defineComponent({
|
20200
|
+
name: "BkDropdownMenu",
|
20201
|
+
props: {
|
20202
|
+
extCls: PropTypes.string
|
20203
|
+
},
|
20204
|
+
setup(props) {
|
20205
|
+
const wrapperCLasses = computed(() => ["bk-dropdown-menu", props.extCls]);
|
20206
|
+
return {
|
20207
|
+
wrapperCLasses
|
20208
|
+
};
|
20209
|
+
},
|
20210
|
+
render() {
|
20211
|
+
var _a, _b;
|
20212
|
+
return createVNode("ul", {
|
20213
|
+
"class": this.wrapperCLasses
|
20214
|
+
}, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]);
|
20215
|
+
}
|
20216
|
+
});
|
20217
|
+
const BkDropdown = withInstallProps(Dropdown, { DropdownMenu, DropdownItem });
|
20092
20218
|
var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
20093
20219
|
__proto__: null,
|
20094
20220
|
Alert: BkAlert,
|
@@ -20138,7 +20264,11 @@ var components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
|
|
20138
20264
|
Tree: BkTree,
|
20139
20265
|
VirtualRender: BkVirtualRender,
|
20140
20266
|
Form: BkForm,
|
20141
|
-
FormItem
|
20267
|
+
FormItem,
|
20268
|
+
Pagination: BkPagination,
|
20269
|
+
Dropdown: BkDropdown,
|
20270
|
+
DropdownMenu,
|
20271
|
+
DropdownItem
|
20142
20272
|
}, Symbol.toStringTag, { value: "Module" }));
|
20143
20273
|
const createInstall = (prefix = "Bk") => (app) => {
|
20144
20274
|
const pre = app.config.globalProperties.bkUIPrefix || prefix;
|
@@ -20156,4 +20286,4 @@ var preset = {
|
|
20156
20286
|
install: createInstall(),
|
20157
20287
|
version: "0.0.1"
|
20158
20288
|
};
|
20159
|
-
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, 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, 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 };
|
20289
|
+
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 };
|