@kp-ui/lowcode-pc 1.0.4 → 1.0.6
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/assets/styles/style.css +16 -16
- package/core/src/hooks/useAppRef.js +0 -1
- package/core/src/hooks/useAppRef.js.map +1 -1
- package/core/src/hooks/useField.js +7 -2
- package/core/src/hooks/useField.js.map +1 -1
- package/core/src/utils/util.js +4 -14
- package/core/src/utils/util.js.map +1 -1
- package/package.json +1 -1
- package/src/components/desginer/form-widget/container-widget/useTableWidget.js +1 -1
- package/src/components/desginer/form-widget/container-widget/vf-dialog-widget.vue2.js +1 -1
- package/src/components/desginer/widget-panel/containers/grid-sub-form.js +2 -0
- package/src/components/desginer/widget-panel/containers/grid-sub-form.js.map +1 -1
- package/src/components/desginer/widget-panel/containers/tab-pane.js.map +1 -1
- package/src/components/field-widget/button-list-widget.vue2.js +1 -1
- package/src/components/form-render/container-items/grid-sub-form-widget.vue.js +1 -1
- package/src/components/form-render/container-items/grid-sub-form-widget.vue2.js +65 -110
- package/src/components/form-render/container-items/grid-sub-form-widget.vue2.js.map +1 -1
- package/src/components/form-render/container-items/tab-widget.vue.js +1 -1
- package/src/components/form-render/container-items/tab-widget.vue2.js +7 -0
- package/src/components/form-render/container-items/tab-widget.vue2.js.map +1 -1
- package/src/components/public/ActionButtonListRender.vue.js +127 -50
- package/src/components/public/ActionButtonListRender.vue.js.map +1 -1
- package/src/components/public/ActionButtonListRender.vue3.js +53 -0
- package/src/components/public/{ActionButtonListRender.vue2.js.map → ActionButtonListRender.vue3.js.map} +1 -1
- package/src/components/public/ConfigView/CustomPageRender.vue.js +1 -1
- package/src/components/public/CustomerModal/CustomerModal.vue2.js +1 -1
- package/src/components/public/DynamicDialog.vue.js +1 -1
- package/src/components/render/index.vue2.js +1 -1
- package/stats.html +1 -1
- package/src/components/public/ActionButtonListRender.vue2.js +0 -130
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _sfc_main from "./ActionButtonListRender.vue.js";
|
|
2
|
+
import { resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, createBlock, Teleport, createVNode, withCtx, Fragment, renderList, createCommentVNode, createTextVNode, toDisplayString } from "vue";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6
|
+
const _component_SvgIcon = resolveComponent("SvgIcon");
|
|
7
|
+
const _component_a_button = resolveComponent("a-button");
|
|
8
|
+
const _component_a_space = resolveComponent("a-space");
|
|
9
|
+
return openBlock(), createElementBlock("div", {
|
|
10
|
+
ref: "fieldEditor",
|
|
11
|
+
class: normalizeClass(["button-list-container", ..._ctx.customClass]),
|
|
12
|
+
style: normalizeStyle(_ctx.containerStyle)
|
|
13
|
+
}, [
|
|
14
|
+
(openBlock(), createBlock(Teleport, {
|
|
15
|
+
disabled: _ctx.isDisabled,
|
|
16
|
+
to: _ctx.getContainer
|
|
17
|
+
}, [
|
|
18
|
+
createVNode(_component_a_space, { size: 8 }, {
|
|
19
|
+
default: withCtx(() => [
|
|
20
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.visibleButtons, (item) => {
|
|
21
|
+
return openBlock(), createBlock(_component_a_button, {
|
|
22
|
+
key: item.key,
|
|
23
|
+
type: item.type,
|
|
24
|
+
size: item.size,
|
|
25
|
+
danger: !!item.danger,
|
|
26
|
+
ghost: !!item.ghost,
|
|
27
|
+
class: "tpf-button",
|
|
28
|
+
loading: item.loading,
|
|
29
|
+
disabled: _ctx.handleDisabled(item) || _ctx.disabled || !!item.disabled,
|
|
30
|
+
onClick: ($event) => _ctx.handleClick(item)
|
|
31
|
+
}, {
|
|
32
|
+
default: withCtx(() => [
|
|
33
|
+
item.icon ? (openBlock(), createBlock(_component_SvgIcon, {
|
|
34
|
+
key: 0,
|
|
35
|
+
"icon-class": item.icon,
|
|
36
|
+
class: "button-icon"
|
|
37
|
+
}, null, 8, ["icon-class"])) : createCommentVNode("", true),
|
|
38
|
+
createTextVNode(" " + toDisplayString(item.label), 1)
|
|
39
|
+
]),
|
|
40
|
+
_: 2
|
|
41
|
+
}, 1032, ["type", "size", "danger", "ghost", "loading", "disabled", "onClick"]);
|
|
42
|
+
}), 128))
|
|
43
|
+
]),
|
|
44
|
+
_: 1
|
|
45
|
+
})
|
|
46
|
+
], 8, ["disabled", "to"]))
|
|
47
|
+
], 6);
|
|
48
|
+
}
|
|
49
|
+
const ActionButtonListRender = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-37429548"]]);
|
|
50
|
+
export {
|
|
51
|
+
ActionButtonListRender as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=ActionButtonListRender.vue3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButtonListRender.
|
|
1
|
+
{"version":3,"file":"ActionButtonListRender.vue3.js","sources":["../../../../src/components/public/ActionButtonListRender.vue"],"sourcesContent":["<template>\n <div\n ref=\"fieldEditor\"\n :class=\"['button-list-container', ...customClass]\"\n :style=\"containerStyle\"\n >\n <Teleport :disabled=\"isDisabled\" :to=\"getContainer\">\n <a-space :size=\"8\">\n <a-button\n v-for=\"item in visibleButtons\"\n :key=\"item.key\"\n :type=\"item.type\"\n :size=\"item.size\"\n :danger=\"!!item.danger\"\n :ghost=\"!!item.ghost\"\n class=\"tpf-button\"\n :loading=\"item.loading\"\n :disabled=\"handleDisabled(item) || disabled || !!item.disabled\"\n @click=\"handleClick(item)\"\n >\n <template v-if=\"item.icon\">\n <SvgIcon :icon-class=\"item.icon\" class=\"button-icon\" />\n </template>\n {{ item.label }}\n </a-button>\n </a-space>\n </Teleport>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, computed, PropType } from 'vue';\n import { SvgIcon, useExecFunction } from 'tmgc2-share';\n import type { ActionButton } from '@kp-ui/lowcode-core';\n import { ButtonPositionEnum } from '@kp-ui/lowcode-core';\n\n export default defineComponent({\n name: 'ActionButtonListRender',\n components: { SvgIcon },\n props: {\n options: {\n type: Object,\n default: () => {}\n },\n disabled: {\n type: Boolean,\n default: false\n },\n scope: {\n type: Object,\n default: () => {}\n },\n ctx: {\n type: Object,\n default: () => {}\n },\n buttonList: {\n type: Array as PropType<ActionButton[]>,\n default: () => []\n },\n customClass: {\n type: Array as PropType<string[]>,\n default: () => []\n },\n flex: {\n type: String,\n default: 'center'\n },\n designState: {\n type: Boolean,\n default: false\n }\n },\n emits: ['on-click'],\n setup(props, { emit }) {\n const containerStyle = computed(() => ({\n '--flex': props.flex\n }));\n\n const { executeFunction, asyncExecuteFunction } = useExecFunction();\n\n const isDisabled = computed(\n () => props.options?.buttonPosition !== ButtonPositionEnum.DIY || props.designState\n );\n\n const getContainer = computed(() =>\n isDisabled.value ? 'body' : props.options?.getContainer || 'body'\n );\n\n const visibleButtons = computed(() =>\n props.buttonList\n .filter(item => item.hidden !== 1)\n .filter(item => !handleHidden(item))\n );\n\n const handleClick = async (item: ActionButton) => {\n if (props.designState) return; // 在设计状态下不处理点击事件\n if (!item.onClick) {\n emit('on-click', { item, result: true });\n return;\n }\n if (item.loading) return;\n item.loading = true;\n try {\n const result = await asyncExecuteFunction({\n functionBody: item.onClick,\n context: props.ctx,\n params: props.scope\n });\n emit('on-click', { item, result });\n } catch (error) {\n console.error('Button click handler error:', error);\n } finally {\n item.loading = false;\n }\n };\n\n const handleDisabled = (item: ActionButton): boolean => {\n if (!item.onDisabled) return false;\n\n try {\n const result = executeFunction({\n functionBody: item.onDisabled,\n context: props.ctx,\n params: props.scope\n });\n if (typeof result === 'boolean') {\n return result;\n } else {\n return false;\n }\n } catch (error) {\n console.error('Button disabled handler error:', error);\n return false;\n }\n };\n\n const handleHidden = (item: ActionButton): boolean => {\n if (!item.onHidden) return false;\n\n try {\n return executeFunction({\n functionBody: item.onHidden,\n context: props.ctx,\n params: props.scope\n });\n } catch (error) {\n console.error('Button hidden handler error:', error);\n return false;\n }\n };\n\n return {\n getContainer,\n isDisabled,\n containerStyle,\n visibleButtons,\n handleClick,\n handleDisabled\n };\n }\n });\n</script>\n\n<style lang=\"scss\" scoped>\n .button-list-container {\n flex: 1;\n display: flex;\n justify-content: var(--flex);\n\n .button-icon {\n margin-right: 4px;\n }\n }\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_normalizeStyle","_createBlock","_Teleport","_createVNode","_withCtx","_openBlock","_Fragment","_renderList","_createCommentVNode","_toDisplayString"],"mappings":";;;;;;;;sBACIA,mBA0BM,OAAA;AAAA,IAzBF,KAAI;AAAA,IACH,OAAKC,4CAA+B,KAAA,WAAW,CAAA;AAAA,IAC/C,OAAKC,eAAE,KAAA,cAAc;AAAA,EAAA,GAAA;AAAA,kBAEtBC,YAoBWC,UAAA;AAAA,MApBA,UAAU,KAAA;AAAA,MAAa,IAAI,KAAA;AAAA,IAAA,GAAA;AAAA,MAClCC,YAkBU,oBAAA,EAlBA,MAAM,EAAA,GAAC;AAAA,QAAA,SAAAC,QAET,MAA8B;AAAA,WAAAC,UAAA,IAAA,GADlCP,mBAgBWQ,UAAA,MAAAC,WAfQ,KAAA,gBAAc,CAAtB,SAAI;gCADfN,YAgBW,qBAAA;AAAA,cAdN,KAAK,KAAK;AAAA,cACV,MAAM,KAAK;AAAA,cACX,MAAM,KAAK;AAAA,cACX,QAAM,EAAI,KAAK;AAAA,cACf,OAAK,EAAI,KAAK;AAAA,cACf,OAAM;AAAA,cACL,SAAS,KAAK;AAAA,cACd,UAAU,KAAA,eAAe,IAAI,KAAK,KAAA,YAAQ,EAAM,KAAK;AAAA,cACrD,SAAK,CAAA,WAAE,KAAA,YAAY,IAAI;AAAA,YAAA,GAAA;AAAA,+BAExB,MAEW;AAAA,gBAFK,KAAK,qBACjBA,YAAuD,oBAAA;AAAA,kBAAA,KAAA;AAAA,kBAA7C,cAAY,KAAK;AAAA,kBAAM,OAAM;AAAA,gBAAA,GAAA,MAAA,GAAA,CAAA,YAAA,CAAA,KAAAO,mBAAA,IAAA,IAAA;AAAA,gCAChC,MACXC,gBAAG,KAAK,KAAK,GAAA,CAAA;AAAA,cAAA,CAAA;AAAA;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, createElementBlock, openBlock, createVNode, unref, withCtx, createElementVNode } from "vue";
|
|
2
2
|
import { getLocat } from "@kp-ui/tool";
|
|
3
3
|
import { TpfAddInfoLayout } from "tmgc2-share";
|
|
4
|
-
import ActionButtonListRender from "../ActionButtonListRender.
|
|
4
|
+
import ActionButtonListRender from "../ActionButtonListRender.vue3.js";
|
|
5
5
|
import VFormRender from "../../render/index.vue.js";
|
|
6
6
|
import { useLowcode } from "../../../../core/src/hooks/useLowcode.js";
|
|
7
7
|
const _hoisted_1 = {
|
|
@@ -2,7 +2,7 @@ import { defineComponent, getCurrentInstance, useAttrs, ref, computed, onMounted
|
|
|
2
2
|
import VFormRender from "../../render/index.vue.js";
|
|
3
3
|
import { TpfConfigProvider, TpfModal } from "tmgc2-share";
|
|
4
4
|
import { Skeleton } from "ant-design-vue";
|
|
5
|
-
import ActionButtonListRender from "../ActionButtonListRender.
|
|
5
|
+
import ActionButtonListRender from "../ActionButtonListRender.vue3.js";
|
|
6
6
|
import { useLowcode } from "../../../../core/src/hooks/useLowcode.js";
|
|
7
7
|
import { useI18n } from "../../../../core/src/utils/i18n.js";
|
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -9,7 +9,7 @@ import "lodash-es";
|
|
|
9
9
|
import "ant-design-vue";
|
|
10
10
|
import "../desginer/widget-panel/widgetsConfig.js";
|
|
11
11
|
import "@kp-ui/tool";
|
|
12
|
-
import ActionButtonListRender from "./ActionButtonListRender.
|
|
12
|
+
import ActionButtonListRender from "./ActionButtonListRender.vue3.js";
|
|
13
13
|
import "../form-render/container-items/index.js";
|
|
14
14
|
import { useLowcode } from "../../hooks/useLowcode.js";
|
|
15
15
|
/* empty css */
|
|
@@ -9,7 +9,7 @@ import "../desginer/form-widget/container-widget/index.js";
|
|
|
9
9
|
import "lodash-es";
|
|
10
10
|
import "tmgc2-share";
|
|
11
11
|
import "../desginer/widget-panel/widgetsConfig.js";
|
|
12
|
-
import "../public/ActionButtonListRender.
|
|
12
|
+
import "../public/ActionButtonListRender.vue.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
import "../form-render/container-items/index.js";
|
|
15
15
|
import _sfc_main$3 from "../public/DynamicDialog.vue.js";
|