@kp-ui/lowcode-pc 1.0.4 → 1.0.5

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.
Files changed (26) hide show
  1. package/assets/styles/style.css +13 -13
  2. package/core/src/hooks/useAppRef.js +0 -1
  3. package/core/src/hooks/useAppRef.js.map +1 -1
  4. package/core/src/hooks/useField.js +7 -2
  5. package/core/src/hooks/useField.js.map +1 -1
  6. package/core/src/utils/util.js +4 -14
  7. package/core/src/utils/util.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/desginer/form-widget/container-widget/useTableWidget.js +1 -1
  10. package/src/components/desginer/form-widget/container-widget/vf-dialog-widget.vue2.js +1 -1
  11. package/src/components/desginer/widget-panel/containers/grid-sub-form.js +2 -0
  12. package/src/components/desginer/widget-panel/containers/grid-sub-form.js.map +1 -1
  13. package/src/components/field-widget/button-list-widget.vue2.js +1 -1
  14. package/src/components/form-render/container-items/grid-sub-form-widget.vue.js +1 -1
  15. package/src/components/form-render/container-items/grid-sub-form-widget.vue2.js +65 -110
  16. package/src/components/form-render/container-items/grid-sub-form-widget.vue2.js.map +1 -1
  17. package/src/components/public/ActionButtonListRender.vue.js +127 -50
  18. package/src/components/public/ActionButtonListRender.vue.js.map +1 -1
  19. package/src/components/public/ActionButtonListRender.vue3.js +53 -0
  20. package/src/components/public/{ActionButtonListRender.vue2.js.map → ActionButtonListRender.vue3.js.map} +1 -1
  21. package/src/components/public/ConfigView/CustomPageRender.vue.js +1 -1
  22. package/src/components/public/CustomerModal/CustomerModal.vue2.js +1 -1
  23. package/src/components/public/DynamicDialog.vue.js +1 -1
  24. package/src/components/render/index.vue2.js +1 -1
  25. package/stats.html +1 -1
  26. package/src/components/public/ActionButtonListRender.vue2.js +0 -130
@@ -1,130 +0,0 @@
1
- import { defineComponent, computed } from "vue";
2
- import { SvgIcon, useExecFunction } from "tmgc2-share";
3
- import { ButtonPositionEnum } from "../../../core/src/constants/index.js";
4
- const _sfc_main = defineComponent({
5
- name: "ActionButtonListRender",
6
- components: { SvgIcon },
7
- props: {
8
- options: {
9
- type: Object,
10
- default: () => {
11
- }
12
- },
13
- disabled: {
14
- type: Boolean,
15
- default: false
16
- },
17
- scope: {
18
- type: Object,
19
- default: () => {
20
- }
21
- },
22
- ctx: {
23
- type: Object,
24
- default: () => {
25
- }
26
- },
27
- buttonList: {
28
- type: Array,
29
- default: () => []
30
- },
31
- customClass: {
32
- type: Array,
33
- default: () => []
34
- },
35
- flex: {
36
- type: String,
37
- default: "center"
38
- },
39
- designState: {
40
- type: Boolean,
41
- default: false
42
- }
43
- },
44
- emits: ["on-click"],
45
- setup(props, { emit }) {
46
- const containerStyle = computed(() => ({
47
- "--flex": props.flex
48
- }));
49
- const { executeFunction, asyncExecuteFunction } = useExecFunction();
50
- const isDisabled = computed(
51
- () => {
52
- var _a;
53
- return ((_a = props.options) == null ? void 0 : _a.buttonPosition) !== ButtonPositionEnum.DIY || props.designState;
54
- }
55
- );
56
- const getContainer = computed(
57
- () => {
58
- var _a;
59
- return isDisabled.value ? "body" : ((_a = props.options) == null ? void 0 : _a.getContainer) || "body";
60
- }
61
- );
62
- const visibleButtons = computed(
63
- () => props.buttonList.filter((item) => item.hidden !== 1).filter((item) => !handleHidden(item))
64
- );
65
- const handleClick = async (item) => {
66
- if (props.designState) return;
67
- if (!item.onClick) {
68
- emit("on-click", { item, result: true });
69
- return;
70
- }
71
- if (item.loading) return;
72
- item.loading = true;
73
- try {
74
- const result = await asyncExecuteFunction({
75
- functionBody: item.onClick,
76
- context: props.ctx,
77
- params: props.scope
78
- });
79
- emit("on-click", { item, result });
80
- } catch (error) {
81
- console.error("Button click handler error:", error);
82
- } finally {
83
- item.loading = false;
84
- }
85
- };
86
- const handleDisabled = (item) => {
87
- if (!item.onDisabled) return false;
88
- try {
89
- const result = executeFunction({
90
- functionBody: item.onDisabled,
91
- context: props.ctx,
92
- params: props.scope
93
- });
94
- if (typeof result === "boolean") {
95
- return result;
96
- } else {
97
- return false;
98
- }
99
- } catch (error) {
100
- console.error("Button disabled handler error:", error);
101
- return false;
102
- }
103
- };
104
- const handleHidden = (item) => {
105
- if (!item.onHidden) return false;
106
- try {
107
- return executeFunction({
108
- functionBody: item.onHidden,
109
- context: props.ctx,
110
- params: props.scope
111
- });
112
- } catch (error) {
113
- console.error("Button hidden handler error:", error);
114
- return false;
115
- }
116
- };
117
- return {
118
- getContainer,
119
- isDisabled,
120
- containerStyle,
121
- visibleButtons,
122
- handleClick,
123
- handleDisabled
124
- };
125
- }
126
- });
127
- export {
128
- _sfc_main as default
129
- };
130
- //# sourceMappingURL=ActionButtonListRender.vue2.js.map