@tmagic/table 1.8.0-manmanyu.27 → 1.8.0-manmanyu.28

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.
@@ -1,5 +1,5 @@
1
- import ActionButton_vue_vue_type_script_setup_true_lang_default from "./ActionButton.vue_vue_type_script_setup_true_lang.js";
1
+ import ActionButton_vue_vue_type_script_lang_default from "./ActionButton.vue_vue_type_script_lang.js";
2
2
  //#region packages/table/src/ActionButton.vue
3
- var ActionButton_default = ActionButton_vue_vue_type_script_setup_true_lang_default;
3
+ var ActionButton_default = ActionButton_vue_vue_type_script_lang_default;
4
4
  //#endregion
5
5
  export { ActionButton_default as default };
@@ -0,0 +1,51 @@
1
+ import { disabled, formatActionText } from "./actionHelpers.js";
2
+ import { defineComponent, h, vShow, withDirectives } from "vue";
3
+ import { TMagicButton, TMagicTooltip } from "@tmagic/design";
4
+ //#region packages/table/src/ActionButton.vue?vue&type=script&lang.ts
5
+ var ActionButton_vue_vue_type_script_lang_default = defineComponent({
6
+ name: "MTableActionButton",
7
+ props: {
8
+ action: {
9
+ type: Object,
10
+ required: true
11
+ },
12
+ row: {
13
+ type: null,
14
+ required: true
15
+ },
16
+ index: {
17
+ type: Number,
18
+ required: true
19
+ },
20
+ btnClass: {
21
+ type: String,
22
+ default: "action-btn"
23
+ },
24
+ visible: {
25
+ type: Boolean,
26
+ default: true
27
+ }
28
+ },
29
+ emits: ["click"],
30
+ setup(props, { emit }) {
31
+ const onClick = () => emit("click", props.action, props.row, props.index);
32
+ return () => {
33
+ const button = withDirectives(h(TMagicButton, {
34
+ class: props.btnClass,
35
+ link: true,
36
+ size: "small",
37
+ type: props.action.buttonType || "primary",
38
+ icon: props.action.icon,
39
+ disabled: disabled(props.action.disabled, props.row),
40
+ onClick
41
+ }, () => h("span", { innerHTML: formatActionText(props.action.text, props.row) })), [[vShow, props.visible]]);
42
+ if (!props.action.tooltip) return button;
43
+ return h(TMagicTooltip, {
44
+ placement: props.action.tooltipPlacement || "top",
45
+ content: props.action.tooltip
46
+ }, () => button);
47
+ };
48
+ }
49
+ });
50
+ //#endregion
51
+ export { ActionButton_vue_vue_type_script_lang_default as default };