@epic-designer/antd 1.1.4-beta.3 → 1.1.4-beta.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.
- package/dist/chunks/input.cjs +15 -15
- package/dist/chunks/input.mjs +16 -16
- package/dist/chunks/modal.cjs +13 -9
- package/dist/chunks/modal.mjs +14 -10
- package/package.json +1 -1
- package/src/input/input.vue +49 -48
- package/src/modal/modal.vue +10 -8
package/dist/chunks/input.cjs
CHANGED
|
@@ -6,23 +6,24 @@ const antDesignVue = require('ant-design-vue');
|
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
7
7
|
__name: "input",
|
|
8
8
|
props: {
|
|
9
|
-
componentSchema: { type: Object, required:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
componentSchema: { type: Object, required: false, default: () => ({
|
|
10
|
+
field: "",
|
|
11
|
+
type: "input"
|
|
12
|
+
}) },
|
|
13
|
+
dataSelector: { type: Boolean, required: false, default: false },
|
|
14
|
+
options: { type: Array, required: false, default: () => [] }
|
|
12
15
|
},
|
|
13
16
|
setup(__props) {
|
|
14
17
|
const props = __props;
|
|
15
|
-
const eventBus = vue.inject("eventBus");
|
|
16
18
|
const formData = vue.inject("formData", {});
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
+
const eventBus = vue.inject("eventBus", null);
|
|
20
|
+
const handleDataSelector = () => {
|
|
21
|
+
eventBus == null ? void 0 : eventBus.emit("openDataSelector", props.componentSchema, props.options);
|
|
19
22
|
};
|
|
20
|
-
eventBus == null ? void 0 : eventBus.on("
|
|
23
|
+
eventBus == null ? void 0 : eventBus.on("dataSelector:selected", (data) => {
|
|
21
24
|
if (data.nodeId !== props.componentSchema.id) {
|
|
22
25
|
return;
|
|
23
26
|
}
|
|
24
|
-
console.log("setRemoteSelectorData", data.record);
|
|
25
|
-
console.log("formData", formData);
|
|
26
27
|
formData[props.componentSchema.field] = data.record.value;
|
|
27
28
|
});
|
|
28
29
|
return (_ctx, _cache) => {
|
|
@@ -33,14 +34,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
33
34
|
_: 2
|
|
34
35
|
/* DYNAMIC */
|
|
35
36
|
}, [
|
|
36
|
-
props.
|
|
37
|
+
props.dataSelector ? {
|
|
37
38
|
name: "suffix",
|
|
38
39
|
fn: vue.withCtx(() => [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})) : vue.createCommentVNode("v-if", true)
|
|
40
|
+
vue.createElementVNode("span", {
|
|
41
|
+
onClick: handleDataSelector,
|
|
42
|
+
class: "iconfont icon--epic icon--epic--search-rounded"
|
|
43
|
+
})
|
|
44
44
|
]),
|
|
45
45
|
key: "0"
|
|
46
46
|
} : void 0
|
package/dist/chunks/input.mjs
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { defineComponent, inject, createBlock, openBlock, unref, createSlots, withCtx,
|
|
1
|
+
import { defineComponent, inject, createBlock, openBlock, unref, createSlots, withCtx, createElementVNode } from 'vue';
|
|
2
2
|
import { Input } from 'ant-design-vue';
|
|
3
3
|
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "input",
|
|
6
6
|
props: {
|
|
7
|
-
componentSchema: { type: Object, required:
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
componentSchema: { type: Object, required: false, default: () => ({
|
|
8
|
+
field: "",
|
|
9
|
+
type: "input"
|
|
10
|
+
}) },
|
|
11
|
+
dataSelector: { type: Boolean, required: false, default: false },
|
|
12
|
+
options: { type: Array, required: false, default: () => [] }
|
|
10
13
|
},
|
|
11
14
|
setup(__props) {
|
|
12
15
|
const props = __props;
|
|
13
|
-
const eventBus = inject("eventBus");
|
|
14
16
|
const formData = inject("formData", {});
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
+
const eventBus = inject("eventBus", null);
|
|
18
|
+
const handleDataSelector = () => {
|
|
19
|
+
eventBus == null ? void 0 : eventBus.emit("openDataSelector", props.componentSchema, props.options);
|
|
17
20
|
};
|
|
18
|
-
eventBus == null ? void 0 : eventBus.on("
|
|
21
|
+
eventBus == null ? void 0 : eventBus.on("dataSelector:selected", (data) => {
|
|
19
22
|
if (data.nodeId !== props.componentSchema.id) {
|
|
20
23
|
return;
|
|
21
24
|
}
|
|
22
|
-
console.log("setRemoteSelectorData", data.record);
|
|
23
|
-
console.log("formData", formData);
|
|
24
25
|
formData[props.componentSchema.field] = data.record.value;
|
|
25
26
|
});
|
|
26
27
|
return (_ctx, _cache) => {
|
|
@@ -31,14 +32,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
31
32
|
_: 2
|
|
32
33
|
/* DYNAMIC */
|
|
33
34
|
}, [
|
|
34
|
-
props.
|
|
35
|
+
props.dataSelector ? {
|
|
35
36
|
name: "suffix",
|
|
36
37
|
fn: withCtx(() => [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})) : createCommentVNode("v-if", true)
|
|
38
|
+
createElementVNode("span", {
|
|
39
|
+
onClick: handleDataSelector,
|
|
40
|
+
class: "iconfont icon--epic icon--epic--search-rounded"
|
|
41
|
+
})
|
|
42
42
|
]),
|
|
43
43
|
key: "0"
|
|
44
44
|
} : void 0
|
package/dist/chunks/modal.cjs
CHANGED
|
@@ -4,7 +4,10 @@ const vue = require('vue');
|
|
|
4
4
|
const antDesignVue = require('ant-design-vue');
|
|
5
5
|
|
|
6
6
|
const _hoisted_1 = { class: "epic-modal-main epic-scoped" };
|
|
7
|
-
const _hoisted_2 = {
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "epic-modal-footer"
|
|
10
|
+
};
|
|
8
11
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
12
|
__name: "modal",
|
|
10
13
|
props: {
|
|
@@ -12,6 +15,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
12
15
|
componentSchema: { type: Object, required: false, default: () => ({
|
|
13
16
|
type: "modal"
|
|
14
17
|
}) },
|
|
18
|
+
fixedHeight: { type: Boolean, required: false, default: true },
|
|
19
|
+
footer: { type: Boolean, required: false, default: true },
|
|
15
20
|
hideConfirm: { type: Boolean, required: false },
|
|
16
21
|
okText: { type: String, required: false, default: "\u786E\u5B9A" }
|
|
17
22
|
},
|
|
@@ -32,22 +37,21 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
37
|
top: "56px",
|
|
33
38
|
width: "auto"
|
|
34
39
|
};
|
|
35
|
-
const bodyStyle = {
|
|
36
|
-
height: "calc(100vh - 108px)",
|
|
37
|
-
padding: 0
|
|
38
|
-
};
|
|
39
40
|
const getProps = vue.computed(() => {
|
|
40
41
|
var _a, _b;
|
|
41
42
|
return {
|
|
42
43
|
...props.componentSchema,
|
|
43
44
|
...attrs,
|
|
44
|
-
bodyStyle
|
|
45
|
+
bodyStyle: {
|
|
46
|
+
height: props.fixedHeight ? "calc(100vh - 108px)" : "auto",
|
|
47
|
+
padding: 0
|
|
48
|
+
},
|
|
45
49
|
dialogStyle,
|
|
46
50
|
footer: null,
|
|
47
51
|
"onUpdate:open": updateModelValue,
|
|
48
52
|
"onUpdate:visible": updateModelValue,
|
|
49
53
|
open: attrs.modelValue,
|
|
50
|
-
style: "top:20px",
|
|
54
|
+
style: props.fixedHeight ? "top:20px" : "",
|
|
51
55
|
title: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : "",
|
|
52
56
|
visible: firstNumber > 3 ? void 0 : attrs.modelValue,
|
|
53
57
|
wrapClassName: "epic-modal-ant",
|
|
@@ -88,7 +92,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
88
92
|
])
|
|
89
93
|
])
|
|
90
94
|
]),
|
|
91
|
-
vue.
|
|
95
|
+
props.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
92
96
|
vue.createVNode(vue.unref(antDesignVue.Space), { align: "end" }, {
|
|
93
97
|
default: vue.withCtx(() => [
|
|
94
98
|
vue.createVNode(vue.unref(antDesignVue.Button), { onClick: handleClose }, {
|
|
@@ -121,7 +125,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
121
125
|
_: 1
|
|
122
126
|
/* STABLE */
|
|
123
127
|
})
|
|
124
|
-
])
|
|
128
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
125
129
|
]),
|
|
126
130
|
_: 3
|
|
127
131
|
/* FORWARDED */
|
package/dist/chunks/modal.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { defineComponent, useAttrs, computed, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode,
|
|
1
|
+
import { defineComponent, useAttrs, computed, createBlock, openBlock, unref, normalizeProps, guardReactiveProps, withCtx, createElementVNode, createElementBlock, createCommentVNode, renderSlot, Fragment, renderList, createVNode, createTextVNode, toDisplayString } from 'vue';
|
|
2
2
|
import { version, Modal, Space, Button } from 'ant-design-vue';
|
|
3
3
|
|
|
4
4
|
const _hoisted_1 = { class: "epic-modal-main epic-scoped" };
|
|
5
|
-
const _hoisted_2 = {
|
|
5
|
+
const _hoisted_2 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "epic-modal-footer"
|
|
8
|
+
};
|
|
6
9
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
10
|
__name: "modal",
|
|
8
11
|
props: {
|
|
@@ -10,6 +13,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
13
|
componentSchema: { type: Object, required: false, default: () => ({
|
|
11
14
|
type: "modal"
|
|
12
15
|
}) },
|
|
16
|
+
fixedHeight: { type: Boolean, required: false, default: true },
|
|
17
|
+
footer: { type: Boolean, required: false, default: true },
|
|
13
18
|
hideConfirm: { type: Boolean, required: false },
|
|
14
19
|
okText: { type: String, required: false, default: "\u786E\u5B9A" }
|
|
15
20
|
},
|
|
@@ -30,22 +35,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
35
|
top: "56px",
|
|
31
36
|
width: "auto"
|
|
32
37
|
};
|
|
33
|
-
const bodyStyle = {
|
|
34
|
-
height: "calc(100vh - 108px)",
|
|
35
|
-
padding: 0
|
|
36
|
-
};
|
|
37
38
|
const getProps = computed(() => {
|
|
38
39
|
var _a, _b;
|
|
39
40
|
return {
|
|
40
41
|
...props.componentSchema,
|
|
41
42
|
...attrs,
|
|
42
|
-
bodyStyle
|
|
43
|
+
bodyStyle: {
|
|
44
|
+
height: props.fixedHeight ? "calc(100vh - 108px)" : "auto",
|
|
45
|
+
padding: 0
|
|
46
|
+
},
|
|
43
47
|
dialogStyle,
|
|
44
48
|
footer: null,
|
|
45
49
|
"onUpdate:open": updateModelValue,
|
|
46
50
|
"onUpdate:visible": updateModelValue,
|
|
47
51
|
open: attrs.modelValue,
|
|
48
|
-
style: "top:20px",
|
|
52
|
+
style: props.fixedHeight ? "top:20px" : "",
|
|
49
53
|
title: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : "",
|
|
50
54
|
visible: firstNumber > 3 ? void 0 : attrs.modelValue,
|
|
51
55
|
wrapClassName: "epic-modal-ant",
|
|
@@ -86,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
90
|
])
|
|
87
91
|
])
|
|
88
92
|
]),
|
|
89
|
-
|
|
93
|
+
props.footer ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
90
94
|
createVNode(unref(Space), { align: "end" }, {
|
|
91
95
|
default: withCtx(() => [
|
|
92
96
|
createVNode(unref(Button), { onClick: handleClose }, {
|
|
@@ -119,7 +123,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
119
123
|
_: 1
|
|
120
124
|
/* STABLE */
|
|
121
125
|
})
|
|
122
|
-
])
|
|
126
|
+
])) : createCommentVNode("v-if", true)
|
|
123
127
|
]),
|
|
124
128
|
_: 3
|
|
125
129
|
/* FORWARDED */
|
package/package.json
CHANGED
package/src/input/input.vue
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import type { ComponentSchema } from '@epic-designer/types';
|
|
3
|
-
|
|
4
|
-
import { inject } from 'vue';
|
|
5
|
-
|
|
6
|
-
import { EventBus } from '@epic-designer/hooks';
|
|
7
|
-
import { Input } from 'ant-design-vue';
|
|
8
|
-
|
|
9
|
-
const props = withDefaults(
|
|
10
|
-
defineProps<{
|
|
11
|
-
componentSchema
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}>(),
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { ComponentSchema } from '@epic-designer/types';
|
|
3
|
+
|
|
4
|
+
import { inject } from 'vue';
|
|
5
|
+
|
|
6
|
+
import { EventBus } from '@epic-designer/hooks';
|
|
7
|
+
import { Input } from 'ant-design-vue';
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<{
|
|
11
|
+
componentSchema?: ComponentSchema;
|
|
12
|
+
dataSelector?: boolean;
|
|
13
|
+
options?: any[];
|
|
14
|
+
}>(),
|
|
15
|
+
{
|
|
16
|
+
componentSchema: () => ({
|
|
17
|
+
field: '',
|
|
18
|
+
type: 'input',
|
|
19
|
+
}),
|
|
20
|
+
dataSelector: false,
|
|
21
|
+
options: () => [],
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const formData = inject<Record<string, any>>('formData', {});
|
|
26
|
+
const eventBus = inject<EventBus | null>('eventBus', null);
|
|
27
|
+
|
|
28
|
+
const handleDataSelector = () => {
|
|
29
|
+
eventBus?.emit('openDataSelector', props.componentSchema, props.options);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
eventBus?.on('dataSelector:selected', (data) => {
|
|
33
|
+
if (data.nodeId !== props.componentSchema.id) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
formData[props.componentSchema.field!] = data.record.value;
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
<template>
|
|
41
|
+
<Input>
|
|
42
|
+
<template #suffix v-if="props.dataSelector">
|
|
43
|
+
<span
|
|
44
|
+
@click="handleDataSelector"
|
|
45
|
+
class="iconfont icon--epic icon--epic--search-rounded"
|
|
46
|
+
></span>
|
|
47
|
+
</template>
|
|
48
|
+
</Input>
|
|
49
|
+
</template>
|
package/src/modal/modal.vue
CHANGED
|
@@ -9,6 +9,8 @@ const props = withDefaults(
|
|
|
9
9
|
defineProps<{
|
|
10
10
|
cancelText?: string;
|
|
11
11
|
componentSchema?: ComponentSchema;
|
|
12
|
+
fixedHeight?: boolean;
|
|
13
|
+
footer?: boolean;
|
|
12
14
|
hideConfirm?: boolean;
|
|
13
15
|
okText?: string;
|
|
14
16
|
}>(),
|
|
@@ -17,6 +19,8 @@ const props = withDefaults(
|
|
|
17
19
|
componentSchema: () => ({
|
|
18
20
|
type: 'modal',
|
|
19
21
|
}),
|
|
22
|
+
fixedHeight: true,
|
|
23
|
+
footer: true,
|
|
20
24
|
okText: '确定',
|
|
21
25
|
},
|
|
22
26
|
);
|
|
@@ -37,21 +41,19 @@ const dialogStyle = {
|
|
|
37
41
|
width: 'auto',
|
|
38
42
|
};
|
|
39
43
|
|
|
40
|
-
const bodyStyle = {
|
|
41
|
-
height: 'calc(100vh - 108px)',
|
|
42
|
-
padding: 0,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
44
|
const getProps = computed<Record<string, any>>(() => ({
|
|
46
45
|
...props.componentSchema,
|
|
47
46
|
...attrs,
|
|
48
|
-
bodyStyle
|
|
47
|
+
bodyStyle: {
|
|
48
|
+
height: props.fixedHeight ? 'calc(100vh - 108px)' : 'auto',
|
|
49
|
+
padding: 0,
|
|
50
|
+
},
|
|
49
51
|
dialogStyle,
|
|
50
52
|
footer: null,
|
|
51
53
|
'onUpdate:open': updateModelValue,
|
|
52
54
|
'onUpdate:visible': updateModelValue,
|
|
53
55
|
open: attrs.modelValue,
|
|
54
|
-
style: 'top:20px',
|
|
56
|
+
style: props.fixedHeight ? 'top:20px' : '',
|
|
55
57
|
title: props.componentSchema?.label ?? '',
|
|
56
58
|
visible: firstNumber > 3 ? undefined : attrs.modelValue,
|
|
57
59
|
wrapClassName: 'epic-modal-ant',
|
|
@@ -86,7 +88,7 @@ function handleClose() {
|
|
|
86
88
|
</slot>
|
|
87
89
|
</slot>
|
|
88
90
|
</div>
|
|
89
|
-
<div class="epic-modal-footer">
|
|
91
|
+
<div v-if="props.footer" class="epic-modal-footer">
|
|
90
92
|
<Space align="end">
|
|
91
93
|
<Button @click="handleClose"> {{ props.cancelText }} </Button>
|
|
92
94
|
<Button v-if="!props.hideConfirm" type="primary" @click="handleOk">
|