@gct-paas/v-ben 0.1.4-dev.11 → 0.1.4-dev.13
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.min.css +2 -1
- package/dist/loader.esm.min.js +693 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +7 -8
- package/es/components/index.mjs +7 -0
- package/es/components/v-ben-button/index.mjs +7 -8
- package/es/components/v-ben-button/src/BasicButton.vue.mjs +5 -40
- package/es/components/v-ben-button/src/BasicButton.vue_vue_type_script_setup_true_lang.mjs +37 -0
- package/es/components/v-ben-button/src/PopConfirmButton.vue.mjs +5 -46
- package/es/components/v-ben-button/src/PopConfirmButton.vue_vue_type_script_lang.mjs +36 -0
- package/es/components/v-ben-button/src/custom-button.vue.mjs +7 -7
- package/es/components/v-ben-button/src/custom-button.vue_vue_type_script_setup_true_name_custom-button_lang.mjs +22 -0
- package/es/components/v-ben-button/src/props.mjs +27 -27
- package/es/components/v-ben-dropdown/index.mjs +4 -4
- package/es/components/v-ben-dropdown/src/Dropdown.vue.mjs +5 -113
- package/es/components/v-ben-dropdown/src/Dropdown.vue_vue_type_script_setup_true_lang.mjs +87 -0
- package/es/components/v-ben-table/index.mjs +3 -0
- package/es/components/v-ben-table/src/BasicTable.vue.d.ts +6 -6
- package/es/components/v-ben-table/src/BasicTable.vue.mjs +33 -49
- package/es/components/v-ben-table/src/BasicTable.vue_vue_type_script_lang.mjs +41 -0
- package/es/components/v-ben-table/src/components/HeaderCell.vue.mjs +8 -8
- package/es/components/v-ben-table/src/components/HeaderCell.vue_vue_type_script_lang.mjs +15 -0
- package/es/components/v-ben-table/src/components/TableAction.vue.mjs +6 -174
- package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_script_setup_true_lang.mjs +145 -0
- package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_style_index_0_lang.css +37 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue.mjs +6 -181
- package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_script_setup_true_lang.mjs +159 -0
- package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_style_index_0_lang.css +37 -0
- package/es/components/v-ben-table/src/props.d.ts +2 -2
- package/es/components/v-ben-table/src/props.mjs +155 -134
- package/es/hooks/useDesign.mjs +8 -7
- package/es/index.mjs +12 -14
- package/es/loader.d.ts +1 -0
- package/es/utils/is.mjs +29 -35
- package/package.json +6 -6
- package/dist/index.esm.min.mjs +0 -796
- package/dist/index.min.cjs +0 -1
- package/dist/index.system.min.js +0 -1
- package/es/components/v-ben-button/src/BasicButton.vue2.mjs +0 -5
- package/es/components/v-ben-button/src/PopConfirmButton.vue2.mjs +0 -5
- package/es/components/v-ben-button/src/custom-button.vue3.mjs +0 -32
- package/es/components/v-ben-dropdown/src/Dropdown.vue2.mjs +0 -5
- package/es/components/v-ben-table/src/BasicTable.vue2.mjs +0 -48
- package/es/components/v-ben-table/src/components/HeaderCell.vue2.mjs +0 -20
- package/es/components/v-ben-table/src/components/TableAction.css +0 -37
- package/es/components/v-ben-table/src/components/TableAction.vue3.mjs +0 -6
- package/es/components/v-ben-table/src/components/TableActionAuto.css +0 -37
- package/es/components/v-ben-table/src/components/TableActionAuto.vue3.mjs +0 -6
- /package/es/components/v-ben-button/src/{custom-button.css → custom-button.vue_vue_type_style_index_0_scoped_305f4090_lang.css} +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return target;
|
|
1
|
+
//#region \0plugin-vue:export-helper
|
|
2
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
3
|
+
const target = sfc.__vccOpts || sfc;
|
|
4
|
+
for (const [key, val] of props) target[key] = val;
|
|
5
|
+
return target;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
export {
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _plugin_vue_export_helper_default as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./v-ben-table/src/BasicTable.vue.mjs";
|
|
2
|
+
import "./v-ben-table/src/components/TableAction.vue.mjs";
|
|
3
|
+
import "./v-ben-table/src/components/TableActionAuto.vue.mjs";
|
|
4
|
+
import "./v-ben-table/index.mjs";
|
|
5
|
+
import "./v-ben-button/src/custom-button.vue.mjs";
|
|
6
|
+
import "./v-ben-button/index.mjs";
|
|
7
|
+
import "./v-ben-dropdown/index.mjs";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import BasicButton_default from "./src/BasicButton.vue.mjs";
|
|
2
|
+
import PopConfirmButton_default from "./src/PopConfirmButton.vue.mjs";
|
|
3
|
+
import "./src/custom-button.vue.mjs";
|
|
4
|
+
//#region src/components/v-ben-button/index.ts
|
|
5
|
+
var Button = BasicButton_default;
|
|
6
|
+
var PopConfirmButton = PopConfirmButton_default;
|
|
7
|
+
//#endregion
|
|
9
8
|
export { Button, PopConfirmButton };
|
|
@@ -1,40 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
...{
|
|
7
|
-
name: "AButton",
|
|
8
|
-
extends: Button,
|
|
9
|
-
inheritAttrs: false
|
|
10
|
-
},
|
|
11
|
-
__name: "BasicButton",
|
|
12
|
-
props: buttonProps,
|
|
13
|
-
setup(__props) {
|
|
14
|
-
const props = __props;
|
|
15
|
-
const attrs = useAttrs();
|
|
16
|
-
const getButtonClass = computed(() => {
|
|
17
|
-
const { color, disabled } = props;
|
|
18
|
-
return [
|
|
19
|
-
{
|
|
20
|
-
[`ant-btn-${color}`]: !!color,
|
|
21
|
-
[`is-disabled`]: disabled
|
|
22
|
-
}
|
|
23
|
-
];
|
|
24
|
-
});
|
|
25
|
-
const getBindValue = computed(() => ({ ...unref(attrs), ...props }));
|
|
26
|
-
return (_ctx, _cache) => {
|
|
27
|
-
return openBlock(), createBlock(unref(Button), mergeProps(getBindValue.value, {
|
|
28
|
-
class: getButtonClass.value,
|
|
29
|
-
onClick: _ctx.onClick
|
|
30
|
-
}), {
|
|
31
|
-
default: withCtx((data) => [
|
|
32
|
-
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(data || {})))
|
|
33
|
-
]),
|
|
34
|
-
_: 3
|
|
35
|
-
}, 16, ["class", "onClick"]);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
export { _sfc_main as default };
|
|
1
|
+
import BasicButton_vue_vue_type_script_setup_true_lang_default from "./BasicButton.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region src/components/v-ben-button/src/BasicButton.vue
|
|
3
|
+
var BasicButton_default = BasicButton_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { BasicButton_default as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { buttonProps } from "./props.mjs";
|
|
2
|
+
import { computed, createBlock, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderSlot, unref, useAttrs, withCtx } from "vue";
|
|
3
|
+
import { Button } from "ant-design-vue";
|
|
4
|
+
//#region src/components/v-ben-button/src/BasicButton.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var BasicButton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "AButton",
|
|
7
|
+
extends: Button,
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "BasicButton",
|
|
10
|
+
props: buttonProps,
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
const attrs = useAttrs();
|
|
14
|
+
const getButtonClass = computed(() => {
|
|
15
|
+
const { color, disabled } = props;
|
|
16
|
+
return [{
|
|
17
|
+
[`ant-btn-${color}`]: !!color,
|
|
18
|
+
[`is-disabled`]: disabled
|
|
19
|
+
}];
|
|
20
|
+
});
|
|
21
|
+
const getBindValue = computed(() => ({
|
|
22
|
+
...unref(attrs),
|
|
23
|
+
...props
|
|
24
|
+
}));
|
|
25
|
+
return (_ctx, _cache) => {
|
|
26
|
+
return openBlock(), createBlock(unref(Button), mergeProps(getBindValue.value, {
|
|
27
|
+
class: getButtonClass.value,
|
|
28
|
+
onClick: _ctx.onClick
|
|
29
|
+
}), {
|
|
30
|
+
default: withCtx((data) => [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(data || {})))]),
|
|
31
|
+
_: 3
|
|
32
|
+
}, 16, ["class", "onClick"]);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { BasicButton_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -1,46 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const props = {
|
|
8
|
-
/**
|
|
9
|
-
* Whether to enable the drop-down menu
|
|
10
|
-
* @default: true
|
|
11
|
-
*/
|
|
12
|
-
enable: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
default: true
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const _sfc_main = defineComponent({
|
|
18
|
-
name: "PopButton",
|
|
19
|
-
inheritAttrs: false,
|
|
20
|
-
props,
|
|
21
|
-
setup(props2, { slots }) {
|
|
22
|
-
const attrs = useAttrs();
|
|
23
|
-
const getBindValues = computed(() => {
|
|
24
|
-
return Object.assign(
|
|
25
|
-
{
|
|
26
|
-
okText: t("sys.okText"),
|
|
27
|
-
cancelText: t("sys.cancelText"),
|
|
28
|
-
overlayStyle: {}
|
|
29
|
-
},
|
|
30
|
-
{ ...props2, ...unref(attrs) }
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
return () => {
|
|
34
|
-
const bindValues = omit(unref(getBindValues), "icon");
|
|
35
|
-
const btnBind = omit(bindValues, "title");
|
|
36
|
-
if (btnBind.disabled) btnBind.color = "";
|
|
37
|
-
const Button = h(_sfc_main$1, btnBind, slots);
|
|
38
|
-
if (!props2.enable) {
|
|
39
|
-
return Button;
|
|
40
|
-
}
|
|
41
|
-
return h(Popconfirm, bindValues, { default: () => Button });
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export { _sfc_main as default };
|
|
1
|
+
import PopConfirmButton_vue_vue_type_script_lang_default from "./PopConfirmButton.vue_vue_type_script_lang.mjs";
|
|
2
|
+
//#region src/components/v-ben-button/src/PopConfirmButton.vue
|
|
3
|
+
var PopConfirmButton_default = PopConfirmButton_vue_vue_type_script_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { PopConfirmButton_default as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import BasicButton_default from "./BasicButton.vue.mjs";
|
|
2
|
+
import { computed, defineComponent, h, unref, useAttrs } from "vue";
|
|
3
|
+
import { omit } from "lodash-es";
|
|
4
|
+
import { Popconfirm } from "ant-design-vue";
|
|
5
|
+
import { t } from "@gct-paas/core";
|
|
6
|
+
var PopConfirmButton_vue_vue_type_script_lang_default = defineComponent({
|
|
7
|
+
name: "PopButton",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: { enable: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: true
|
|
12
|
+
} },
|
|
13
|
+
setup(props, { slots }) {
|
|
14
|
+
const attrs = useAttrs();
|
|
15
|
+
const getBindValues = computed(() => {
|
|
16
|
+
return Object.assign({
|
|
17
|
+
okText: t("sys.okText"),
|
|
18
|
+
cancelText: t("sys.cancelText"),
|
|
19
|
+
overlayStyle: {}
|
|
20
|
+
}, {
|
|
21
|
+
...props,
|
|
22
|
+
...unref(attrs)
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return () => {
|
|
26
|
+
const bindValues = omit(unref(getBindValues), "icon");
|
|
27
|
+
const btnBind = omit(bindValues, "title");
|
|
28
|
+
if (btnBind.disabled) btnBind.color = "";
|
|
29
|
+
const Button = h(BasicButton_default, btnBind, slots);
|
|
30
|
+
if (!props.enable) return Button;
|
|
31
|
+
return h(Popconfirm, bindValues, { default: () => Button });
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { PopConfirmButton_vue_vue_type_script_lang_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
+
import custom_button_vue_vue_type_script_setup_true_name_custom_button_lang_default from "./custom-button.vue_vue_type_script_setup_true_name_custom-button_lang.mjs";
|
|
3
|
+
import './custom-button.vue_vue_type_style_index_0_scoped_305f4090_lang.css';/* empty css */
|
|
4
|
+
//#region src/components/v-ben-button/src/custom-button.vue
|
|
5
|
+
var custom_button_default = /* @__PURE__ */ _plugin_vue_export_helper_default(custom_button_vue_vue_type_script_setup_true_name_custom_button_lang_default, [["__scopeId", "data-v-305f4090"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { custom_button_default as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createElementBlock, createElementVNode, defineComponent, openBlock, renderSlot, toDisplayString, withModifiers } from "vue";
|
|
2
|
+
//#region src/components/v-ben-button/src/custom-button.vue?vue&type=script&setup=true&name=custom-button&lang.ts
|
|
3
|
+
var _hoisted_1 = { class: "custom-btn-container" };
|
|
4
|
+
var _hoisted_2 = { class: "btn-left-title" };
|
|
5
|
+
var custom_button_vue_vue_type_script_setup_true_name_custom_button_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "custom-button",
|
|
7
|
+
props: { title: {} },
|
|
8
|
+
emits: ["btn-left-click", "btn-right-click"],
|
|
9
|
+
setup(__props) {
|
|
10
|
+
return (_ctx, _cache) => {
|
|
11
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
12
|
+
class: "btn-left",
|
|
13
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => _ctx.$emit("btn-left-click"), ["stop"]))
|
|
14
|
+
}, [renderSlot(_ctx.$slots, "left-icon", {}, void 0, true), createElementVNode("div", _hoisted_2, toDisplayString(__props.title), 1)]), createElementVNode("div", {
|
|
15
|
+
class: "btn-right",
|
|
16
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.$emit("btn-right-click"), ["stop"]))
|
|
17
|
+
}, [renderSlot(_ctx.$slots, "right-icon", {}, void 0, true)])]);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { custom_button_vue_vue_type_script_setup_true_name_custom_button_lang_default as default };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
//#region src/components/v-ben-button/src/props.ts
|
|
2
|
+
var validColors = [
|
|
3
|
+
"primary",
|
|
4
|
+
"error",
|
|
5
|
+
"warning",
|
|
6
|
+
"success",
|
|
7
|
+
""
|
|
8
|
+
];
|
|
9
|
+
var buttonProps = {
|
|
10
|
+
color: {
|
|
11
|
+
type: String,
|
|
12
|
+
validator: (v) => validColors.includes(v),
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
loading: { type: Boolean },
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
preIcon: { type: String },
|
|
18
|
+
postIcon: { type: String },
|
|
19
|
+
iconSize: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 14
|
|
22
|
+
},
|
|
23
|
+
onClick: {
|
|
24
|
+
type: Function,
|
|
25
|
+
default: null
|
|
26
|
+
}
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
//#endregion
|
|
29
29
|
export { buttonProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import Dropdown_default from "./src/Dropdown.vue.mjs";
|
|
2
|
+
//#region src/components/v-ben-dropdown/index.ts
|
|
3
|
+
var Dropdown = Dropdown_default;
|
|
4
|
+
//#endregion
|
|
5
5
|
export { Dropdown };
|
|
@@ -1,113 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const _hoisted_1 = { class: "ml-1" };
|
|
7
|
-
const _hoisted_2 = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "ml-1"
|
|
10
|
-
};
|
|
11
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
-
...{
|
|
13
|
-
name: "VDropdown"
|
|
14
|
-
},
|
|
15
|
-
__name: "Dropdown",
|
|
16
|
-
props: {
|
|
17
|
-
popconfirm: Boolean,
|
|
18
|
-
/**
|
|
19
|
-
* the trigger mode which executes the drop-down action
|
|
20
|
-
* @default ['hover']
|
|
21
|
-
* @type string[]
|
|
22
|
-
*/
|
|
23
|
-
trigger: {
|
|
24
|
-
type: Array,
|
|
25
|
-
default: () => {
|
|
26
|
-
return ["contextmenu"];
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
dropMenuList: {
|
|
30
|
-
type: Array,
|
|
31
|
-
default: () => []
|
|
32
|
-
},
|
|
33
|
-
selectedKeys: {
|
|
34
|
-
type: Array,
|
|
35
|
-
default: () => []
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
emits: ["menuEvent"],
|
|
39
|
-
setup(__props, { emit: __emit }) {
|
|
40
|
-
const ADropdown = Dropdown;
|
|
41
|
-
const AMenu = Menu;
|
|
42
|
-
const AMenuItem = Menu.Item;
|
|
43
|
-
const AMenuDivider = Menu.Divider;
|
|
44
|
-
const APopconfirm = Popconfirm;
|
|
45
|
-
const props = __props;
|
|
46
|
-
const emit = __emit;
|
|
47
|
-
function handleClickMenu(item) {
|
|
48
|
-
const { event } = item;
|
|
49
|
-
const menu = props.dropMenuList.find((item2) => `${item2.event}` === `${event}`);
|
|
50
|
-
emit("menuEvent", menu);
|
|
51
|
-
item.onClick?.();
|
|
52
|
-
}
|
|
53
|
-
function getPopConfirmAttrs(attrs) {
|
|
54
|
-
const originAttrs = omit(attrs, ["confirm", "cancel", "icon"]);
|
|
55
|
-
if (!attrs.onConfirm && attrs.confirm && isFunction(attrs.confirm))
|
|
56
|
-
originAttrs["onConfirm"] = attrs.confirm;
|
|
57
|
-
if (!attrs.onCancel && attrs.cancel && isFunction(attrs.cancel))
|
|
58
|
-
originAttrs["onCancel"] = attrs.cancel;
|
|
59
|
-
return originAttrs;
|
|
60
|
-
}
|
|
61
|
-
const getAttr = (key) => ({ key });
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return openBlock(), createBlock(unref(ADropdown), mergeProps({ trigger: __props.trigger }, _ctx.$attrs), {
|
|
64
|
-
overlay: withCtx(() => [
|
|
65
|
-
createVNode(unref(AMenu), { "selected-keys": __props.selectedKeys }, {
|
|
66
|
-
default: withCtx(() => [
|
|
67
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dropMenuList, (item) => {
|
|
68
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
69
|
-
key: `${item.event}`
|
|
70
|
-
}, [
|
|
71
|
-
createVNode(unref(AMenuItem), mergeProps({
|
|
72
|
-
class: item.class
|
|
73
|
-
}, { ref_for: true }, getAttr(item.event), {
|
|
74
|
-
disabled: item.disabled,
|
|
75
|
-
onClick: ($event) => handleClickMenu(item)
|
|
76
|
-
}), {
|
|
77
|
-
default: withCtx(() => [
|
|
78
|
-
__props.popconfirm && item.popConfirm ? (openBlock(), createBlock(unref(APopconfirm), mergeProps({
|
|
79
|
-
key: 0,
|
|
80
|
-
ref_for: true
|
|
81
|
-
}, getPopConfirmAttrs(item.popConfirm)), {
|
|
82
|
-
default: withCtx(() => [
|
|
83
|
-
createElementVNode("div", null, [
|
|
84
|
-
createElementVNode("span", _hoisted_1, toDisplayString(item.text), 1)
|
|
85
|
-
])
|
|
86
|
-
]),
|
|
87
|
-
_: 2
|
|
88
|
-
}, 1040)) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(item.text), 1))
|
|
89
|
-
]),
|
|
90
|
-
_: 2
|
|
91
|
-
}, 1040, ["class", "disabled", "onClick"]),
|
|
92
|
-
item.divider ? (openBlock(), createBlock(unref(AMenuDivider), {
|
|
93
|
-
key: `d-${item.event}`
|
|
94
|
-
})) : createCommentVNode("", true)
|
|
95
|
-
], 64);
|
|
96
|
-
}), 128))
|
|
97
|
-
]),
|
|
98
|
-
_: 1
|
|
99
|
-
}, 8, ["selected-keys"])
|
|
100
|
-
]),
|
|
101
|
-
default: withCtx(() => [
|
|
102
|
-
createElementVNode("span", null, [
|
|
103
|
-
renderSlot(_ctx.$slots, "default")
|
|
104
|
-
]),
|
|
105
|
-
createTextVNode(" " + toDisplayString(__props.dropMenuList) + " ", 1)
|
|
106
|
-
]),
|
|
107
|
-
_: 3
|
|
108
|
-
}, 16, ["trigger"]);
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
export { _sfc_main as default };
|
|
1
|
+
import Dropdown_vue_vue_type_script_setup_true_lang_default from "./Dropdown.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region src/components/v-ben-dropdown/src/Dropdown.vue
|
|
3
|
+
var Dropdown_default = Dropdown_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { Dropdown_default as default };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { isFunction } from "../../../utils/is.mjs";
|
|
2
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, openBlock, renderList, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
3
|
+
import { omit } from "lodash-es";
|
|
4
|
+
import { Dropdown, Menu, Popconfirm } from "ant-design-vue";
|
|
5
|
+
//#region src/components/v-ben-dropdown/src/Dropdown.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var _hoisted_1 = { class: "ml-1" };
|
|
7
|
+
var _hoisted_2 = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "ml-1"
|
|
10
|
+
};
|
|
11
|
+
var Dropdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12
|
+
name: "VDropdown",
|
|
13
|
+
__name: "Dropdown",
|
|
14
|
+
props: {
|
|
15
|
+
popconfirm: Boolean,
|
|
16
|
+
trigger: {
|
|
17
|
+
type: Array,
|
|
18
|
+
default: () => {
|
|
19
|
+
return ["contextmenu"];
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
dropMenuList: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => []
|
|
25
|
+
},
|
|
26
|
+
selectedKeys: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => []
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
emits: ["menuEvent"],
|
|
32
|
+
setup(__props, { emit: __emit }) {
|
|
33
|
+
const ADropdown = Dropdown;
|
|
34
|
+
const AMenu = Menu;
|
|
35
|
+
const AMenuItem = Menu.Item;
|
|
36
|
+
const AMenuDivider = Menu.Divider;
|
|
37
|
+
const APopconfirm = Popconfirm;
|
|
38
|
+
const props = __props;
|
|
39
|
+
const emit = __emit;
|
|
40
|
+
function handleClickMenu(item) {
|
|
41
|
+
const { event } = item;
|
|
42
|
+
emit("menuEvent", props.dropMenuList.find((item) => `${item.event}` === `${event}`));
|
|
43
|
+
item.onClick?.();
|
|
44
|
+
}
|
|
45
|
+
function getPopConfirmAttrs(attrs) {
|
|
46
|
+
const originAttrs = omit(attrs, [
|
|
47
|
+
"confirm",
|
|
48
|
+
"cancel",
|
|
49
|
+
"icon"
|
|
50
|
+
]);
|
|
51
|
+
if (!attrs.onConfirm && attrs.confirm && isFunction(attrs.confirm)) originAttrs["onConfirm"] = attrs.confirm;
|
|
52
|
+
if (!attrs.onCancel && attrs.cancel && isFunction(attrs.cancel)) originAttrs["onCancel"] = attrs.cancel;
|
|
53
|
+
return originAttrs;
|
|
54
|
+
}
|
|
55
|
+
const getAttr = (key) => ({ key });
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
return openBlock(), createBlock(unref(ADropdown), mergeProps({ trigger: __props.trigger }, _ctx.$attrs), {
|
|
58
|
+
overlay: withCtx(() => [createVNode(unref(AMenu), { "selected-keys": __props.selectedKeys }, {
|
|
59
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dropMenuList, (item) => {
|
|
60
|
+
return openBlock(), createElementBlock(Fragment, { key: `${item.event}` }, [createVNode(unref(AMenuItem), mergeProps({ class: item.class }, { ref_for: true }, getAttr(item.event), {
|
|
61
|
+
disabled: item.disabled,
|
|
62
|
+
onClick: ($event) => handleClickMenu(item)
|
|
63
|
+
}), {
|
|
64
|
+
default: withCtx(() => [__props.popconfirm && item.popConfirm ? (openBlock(), createBlock(unref(APopconfirm), mergeProps({
|
|
65
|
+
key: 0,
|
|
66
|
+
ref_for: true
|
|
67
|
+
}, getPopConfirmAttrs(item.popConfirm)), {
|
|
68
|
+
default: withCtx(() => [createElementVNode("div", null, [createElementVNode("span", _hoisted_1, toDisplayString(item.text), 1)])]),
|
|
69
|
+
_: 2
|
|
70
|
+
}, 1040)) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(item.text), 1))]),
|
|
71
|
+
_: 2
|
|
72
|
+
}, 1040, [
|
|
73
|
+
"class",
|
|
74
|
+
"disabled",
|
|
75
|
+
"onClick"
|
|
76
|
+
]), item.divider ? (openBlock(), createBlock(unref(AMenuDivider), { key: `d-${item.event}` })) : createCommentVNode("", true)], 64);
|
|
77
|
+
}), 128))]),
|
|
78
|
+
_: 1
|
|
79
|
+
}, 8, ["selected-keys"])]),
|
|
80
|
+
default: withCtx(() => [createElementVNode("span", null, [renderSlot(_ctx.$slots, "default")]), createTextVNode(" " + toDisplayString(__props.dropMenuList) + " ", 1)]),
|
|
81
|
+
_: 3
|
|
82
|
+
}, 16, ["trigger"]);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Dropdown_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -132,8 +132,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
132
132
|
};
|
|
133
133
|
scroll: {
|
|
134
134
|
type: import('vue').PropType<{
|
|
135
|
-
x
|
|
136
|
-
y
|
|
135
|
+
x?: number | string | true;
|
|
136
|
+
y?: number | string;
|
|
137
137
|
}>;
|
|
138
138
|
default: null;
|
|
139
139
|
};
|
|
@@ -306,8 +306,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
306
306
|
};
|
|
307
307
|
scroll: {
|
|
308
308
|
type: import('vue').PropType<{
|
|
309
|
-
x
|
|
310
|
-
y
|
|
309
|
+
x?: number | string | true;
|
|
310
|
+
y?: number | string;
|
|
311
311
|
}>;
|
|
312
312
|
default: null;
|
|
313
313
|
};
|
|
@@ -380,8 +380,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
380
380
|
pagination: boolean | import('./types/pagination').PaginationProps;
|
|
381
381
|
loading: boolean;
|
|
382
382
|
scroll: {
|
|
383
|
-
x
|
|
384
|
-
y
|
|
383
|
+
x?: number | string | true;
|
|
384
|
+
y?: number | string;
|
|
385
385
|
};
|
|
386
386
|
rowDraggable: boolean;
|
|
387
387
|
supportSameLevel: boolean;
|