@kp-ui/lowcode 1.0.69 → 1.0.71

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,173 +0,0 @@
1
- import { defineComponent, useAttrs, useSlots, ref, createBlock, openBlock, createVNode, Teleport, withDirectives, mergeProps, Fragment, resolveComponent, resolveDirective, isVNode } from "vue";
2
- import { Modal } from "ant-design-vue";
3
- import { FullscreenExitOutlined, FullscreenOutlined, CloseOutlined } from "@ant-design/icons-vue";
4
- import { useVModel } from "../../../../../node_modules/.pnpm/@vueuse_core@11.3.0_vue@3.5.16_typescript@5.8.2_/node_modules/@vueuse/core/index.js";
5
- import { getUuidKey } from "@kp-ui/tool";
6
- import { useI18n } from "@kp-ui/i18n";
7
- function _isSlot(s) {
8
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
9
- }
10
- const _sfc_main = /* @__PURE__ */ defineComponent({
11
- __name: "index",
12
- props: {
13
- useFull: {
14
- type: Boolean,
15
- default: true
16
- },
17
- visible: {
18
- type: Boolean
19
- },
20
- width: {
21
- default: "600px"
22
- },
23
- height: {
24
- default: "440px"
25
- },
26
- getContainer: {
27
- type: Function,
28
- default: () => document.body
29
- },
30
- draggable: {
31
- type: Boolean
32
- },
33
- bodyStyle: {
34
- default: () => ({})
35
- },
36
- title: {},
37
- type: {
38
- default: ""
39
- },
40
- saveButtonProps: {
41
- default: () => ({})
42
- },
43
- saveText: {},
44
- leftNum: {}
45
- },
46
- emits: ["update:visible", "save"],
47
- setup(__props, {
48
- emit: __emit
49
- }) {
50
- const {
51
- t
52
- } = useI18n();
53
- const props = __props;
54
- const emit = __emit;
55
- const attrs = useAttrs();
56
- const slots = useSlots();
57
- const innerVisible = useVModel(props, "visible", emit);
58
- const fullscreen = ref(false);
59
- const ModalClass = getUuidKey();
60
- const onClose = () => {
61
- fullscreen.value = false;
62
- emit("update:visible", false);
63
- };
64
- const DefaultRightBtn = () => {
65
- if (props.type === "") return null;
66
- if (props.type === "view") {
67
- let _slot;
68
- return createVNode(resolveComponent("a-button"), {
69
- "class": "tpf-button",
70
- "onClick": () => onClose()
71
- }, _isSlot(_slot = t("lang.关闭")) ? _slot : {
72
- default: () => [_slot]
73
- });
74
- }
75
- if (props.type === "edit") {
76
- let _slot2;
77
- return createVNode(Fragment, null, [createVNode(resolveComponent("a-button"), {
78
- "class": "tpf-button",
79
- "onClick": () => onClose()
80
- }, _isSlot(_slot2 = t("lang.取消")) ? _slot2 : {
81
- default: () => [_slot2]
82
- }), createVNode(resolveComponent("a-button"), mergeProps({
83
- "class": "tpf-button"
84
- }, {
85
- type: "primary",
86
- onClick: () => emit("save"),
87
- ...props.saveButtonProps
88
- }), {
89
- default: () => [props.saveText || t("lang.保存")]
90
- })]);
91
- }
92
- return null;
93
- };
94
- const DefaultLeftText = () => {
95
- if (typeof props.leftNum === "number") {
96
- return createVNode("div", null, [`${t("lang.已选择")}${props.leftNum}${t("lang.条数据")}`]);
97
- }
98
- return null;
99
- };
100
- const vNode = () => {
101
- const {
102
- draggable,
103
- getContainer,
104
- height,
105
- width,
106
- useFull,
107
- bodyStyle
108
- } = props;
109
- return createVNode(Teleport, {
110
- "to": getContainer()
111
- }, {
112
- default: () => [withDirectives(createVNode("div", {
113
- "class": ModalClass
114
- }, [createVNode(Modal, mergeProps({
115
- "transitionName": !innerVisible.value ? "" : "zoom",
116
- "maskTransitionName": !innerVisible.value ? "" : "fade",
117
- "title": props.title,
118
- "destroyOnClose": true,
119
- "bodyStyle": {
120
- height,
121
- overflow: "auto",
122
- ...bodyStyle
123
- },
124
- "class": `tpf-model ${fullscreen.value ? "fullscreen" : ""}`,
125
- "centered": true,
126
- "getContainer": () => document.querySelector(`.${ModalClass}`),
127
- "keyboard": false,
128
- "maskClosable": false,
129
- "width": width,
130
- "visible": innerVisible.value,
131
- "onUpdate:visible": ($event) => innerVisible.value = $event
132
- }, attrs), {
133
- ...slots,
134
- closeIcon: () => {
135
- const Com = fullscreen.value ? FullscreenExitOutlined : FullscreenOutlined;
136
- return createVNode(resolveComponent("a-space"), {
137
- "style": {
138
- padding: "0 20px 0 0"
139
- }
140
- }, {
141
- default: () => [useFull && createVNode("div", {
142
- "style": {
143
- padding: "0 6px"
144
- },
145
- "onClick": (e) => {
146
- e.stopPropagation();
147
- e.preventDefault();
148
- fullscreen.value = !fullscreen.value;
149
- }
150
- }, [createVNode(Com, null, null)]), createVNode(CloseOutlined, {
151
- "onClick": onClose
152
- }, null)]
153
- });
154
- },
155
- footer: () => createVNode(Fragment, null, [createVNode("div", {
156
- "class": "footer-left",
157
- "style": {
158
- paddingTop: "5px"
159
- }
160
- }, [slots.footerLeft ? slots.footerLeft() : createVNode(DefaultLeftText, null, null)]), createVNode("div", {
161
- "class": "footer-right"
162
- }, [slots.footerRight ? slots.footerRight() : createVNode(DefaultRightBtn, null, null)])])
163
- })]), [[resolveDirective("dragModal"), draggable]])]
164
- });
165
- };
166
- return (_ctx, _cache) => {
167
- return openBlock(), createBlock(vNode);
168
- };
169
- }
170
- });
171
- export {
172
- _sfc_main as default
173
- };