nada-designer-element-plus 0.0.0-stage → 1.1.14
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/LICENSE +21 -0
- package/dist/chunks/button.cjs +31 -0
- package/dist/chunks/button.mjs +29 -0
- package/dist/chunks/card.cjs +35 -0
- package/dist/chunks/card.mjs +33 -0
- package/dist/chunks/cascader.cjs +21 -0
- package/dist/chunks/cascader.mjs +19 -0
- package/dist/chunks/checkbox.cjs +37 -0
- package/dist/chunks/checkbox.mjs +35 -0
- package/dist/chunks/col.cjs +37 -0
- package/dist/chunks/col.mjs +35 -0
- package/dist/chunks/collapse.cjs +41 -0
- package/dist/chunks/collapse.mjs +39 -0
- package/dist/chunks/collapseItem.cjs +39 -0
- package/dist/chunks/collapseItem.mjs +37 -0
- package/dist/chunks/date-picker.cjs +21 -0
- package/dist/chunks/date-picker.mjs +19 -0
- package/dist/chunks/form.cjs +102 -0
- package/dist/chunks/form.mjs +100 -0
- package/dist/chunks/formItem.cjs +43 -0
- package/dist/chunks/formItem.mjs +41 -0
- package/dist/chunks/input-number.cjs +21 -0
- package/dist/chunks/input-number.mjs +19 -0
- package/dist/chunks/input.cjs +21 -0
- package/dist/chunks/input.mjs +19 -0
- package/dist/chunks/modal.cjs +105 -0
- package/dist/chunks/modal.mjs +103 -0
- package/dist/chunks/radio.cjs +42 -0
- package/dist/chunks/radio.mjs +40 -0
- package/dist/chunks/row.cjs +41 -0
- package/dist/chunks/row.mjs +39 -0
- package/dist/chunks/select.cjs +35 -0
- package/dist/chunks/select.mjs +33 -0
- package/dist/chunks/tabPane.cjs +58 -0
- package/dist/chunks/tabPane.mjs +56 -0
- package/dist/chunks/tabs.cjs +64 -0
- package/dist/chunks/tabs.mjs +62 -0
- package/dist/chunks/textarea.cjs +22 -0
- package/dist/chunks/textarea.mjs +20 -0
- package/dist/chunks/uploadFile.cjs +103 -0
- package/dist/chunks/uploadFile.mjs +101 -0
- package/dist/chunks/uploadImage.cjs +135 -0
- package/dist/chunks/uploadImage.mjs +133 -0
- package/dist/index.cjs +2819 -0
- package/dist/index.d.cts +39 -0
- package/dist/index.d.mts +39 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.mjs +2816 -0
- package/package.json +36 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 kchengz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
const button = vue.defineComponent({
|
|
7
|
+
props: {
|
|
8
|
+
componentSchema: {
|
|
9
|
+
default: () => ({}),
|
|
10
|
+
type: Object
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
setup(props, { slots }) {
|
|
14
|
+
return () => {
|
|
15
|
+
var _a;
|
|
16
|
+
const componentProps = {
|
|
17
|
+
...(_a = props.componentSchema) == null ? void 0 : _a.props
|
|
18
|
+
};
|
|
19
|
+
return vue.h(elementPlus.ElButton, componentProps, {
|
|
20
|
+
default: () => vue.renderSlot(slots, "default", {}, () => {
|
|
21
|
+
var _a2;
|
|
22
|
+
return [
|
|
23
|
+
(_a2 = props.componentSchema) == null ? void 0 : _a2.label
|
|
24
|
+
];
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
exports.default = button;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent, h, renderSlot } from 'vue';
|
|
2
|
+
import { ElButton } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
const button = defineComponent({
|
|
5
|
+
props: {
|
|
6
|
+
componentSchema: {
|
|
7
|
+
default: () => ({}),
|
|
8
|
+
type: Object
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
setup(props, { slots }) {
|
|
12
|
+
return () => {
|
|
13
|
+
var _a;
|
|
14
|
+
const componentProps = {
|
|
15
|
+
...(_a = props.componentSchema) == null ? void 0 : _a.props
|
|
16
|
+
};
|
|
17
|
+
return h(ElButton, componentProps, {
|
|
18
|
+
default: () => renderSlot(slots, "default", {}, () => {
|
|
19
|
+
var _a2;
|
|
20
|
+
return [
|
|
21
|
+
(_a2 = props.componentSchema) == null ? void 0 : _a2.label
|
|
22
|
+
];
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export { button as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
const card = vue.defineComponent({
|
|
7
|
+
props: {
|
|
8
|
+
componentSchema: {
|
|
9
|
+
default: () => ({}),
|
|
10
|
+
required: true,
|
|
11
|
+
type: Object
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(props, { slots }) {
|
|
15
|
+
return () => {
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
const componentSchema = {
|
|
18
|
+
...props.componentSchema,
|
|
19
|
+
header: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : ""
|
|
20
|
+
};
|
|
21
|
+
const children = (_c = componentSchema.children) != null ? _c : [];
|
|
22
|
+
delete componentSchema.children;
|
|
23
|
+
let vNodeClildren = null;
|
|
24
|
+
vNodeClildren = children.length > 0 ? () => children.map(
|
|
25
|
+
(node) => vue.renderSlot(slots, "node", { componentSchema: node })
|
|
26
|
+
) : () => [vue.renderSlot(slots, "default")];
|
|
27
|
+
return vue.h(elementPlus.ElCard, componentSchema, {
|
|
28
|
+
default: () => vue.renderSlot(slots, "edit-node", {}, vNodeClildren),
|
|
29
|
+
header: () => vue.renderSlot(slots, "header")
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
exports.default = card;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent, renderSlot, h } from 'vue';
|
|
2
|
+
import { ElCard } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
const card = defineComponent({
|
|
5
|
+
props: {
|
|
6
|
+
componentSchema: {
|
|
7
|
+
default: () => ({}),
|
|
8
|
+
required: true,
|
|
9
|
+
type: Object
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setup(props, { slots }) {
|
|
13
|
+
return () => {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
const componentSchema = {
|
|
16
|
+
...props.componentSchema,
|
|
17
|
+
header: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : ""
|
|
18
|
+
};
|
|
19
|
+
const children = (_c = componentSchema.children) != null ? _c : [];
|
|
20
|
+
delete componentSchema.children;
|
|
21
|
+
let vNodeClildren = null;
|
|
22
|
+
vNodeClildren = children.length > 0 ? () => children.map(
|
|
23
|
+
(node) => renderSlot(slots, "node", { componentSchema: node })
|
|
24
|
+
) : () => [renderSlot(slots, "default")];
|
|
25
|
+
return h(ElCard, componentSchema, {
|
|
26
|
+
default: () => renderSlot(slots, "edit-node", {}, vNodeClildren),
|
|
27
|
+
header: () => renderSlot(slots, "header")
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export { card as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
7
|
+
__name: "cascader",
|
|
8
|
+
props: {
|
|
9
|
+
placeholder: { type: String, required: false, default: "\u8BF7\u9009\u62E9" }
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElCascader), {
|
|
15
|
+
placeholder: props.placeholder
|
|
16
|
+
}, null, 8, ["placeholder"]);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineComponent, createBlock, openBlock, unref } from 'vue';
|
|
2
|
+
import { ElCascader } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "cascader",
|
|
6
|
+
props: {
|
|
7
|
+
placeholder: { type: String, required: false, default: "\u8BF7\u9009\u62E9" }
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
return (_ctx, _cache) => {
|
|
12
|
+
return openBlock(), createBlock(unref(ElCascader), {
|
|
13
|
+
placeholder: props.placeholder
|
|
14
|
+
}, null, 8, ["placeholder"]);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
require('element-plus/es/components/select/style/css');
|
|
6
|
+
|
|
7
|
+
const checkbox = vue.defineComponent({
|
|
8
|
+
emits: ["update:modelValue"],
|
|
9
|
+
setup(_, { attrs, emit }) {
|
|
10
|
+
function handleUpdate(e = null) {
|
|
11
|
+
emit("update:modelValue", e);
|
|
12
|
+
}
|
|
13
|
+
return () => {
|
|
14
|
+
const props = {
|
|
15
|
+
...attrs,
|
|
16
|
+
"onUpdate:modelValue": handleUpdate
|
|
17
|
+
};
|
|
18
|
+
return vue.h(elementPlus.ElCheckboxGroup, props, {
|
|
19
|
+
default: () => {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
return [
|
|
22
|
+
(props == null ? void 0 : props.radioButton) ? (_a = props.options) == null ? void 0 : _a.map(
|
|
23
|
+
(option) => vue.h(elementPlus.ElCheckboxButton, {
|
|
24
|
+
label: option.label,
|
|
25
|
+
value: option.value
|
|
26
|
+
})
|
|
27
|
+
) : (_b = props.options) == null ? void 0 : _b.map(
|
|
28
|
+
(option) => vue.h(elementPlus.ElCheckbox, { label: option.label, value: option.value })
|
|
29
|
+
)
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
exports.default = checkbox;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { ElCheckboxGroup, ElCheckboxButton, ElCheckbox } from 'element-plus';
|
|
3
|
+
import 'element-plus/es/components/select/style/css';
|
|
4
|
+
|
|
5
|
+
const checkbox = defineComponent({
|
|
6
|
+
emits: ["update:modelValue"],
|
|
7
|
+
setup(_, { attrs, emit }) {
|
|
8
|
+
function handleUpdate(e = null) {
|
|
9
|
+
emit("update:modelValue", e);
|
|
10
|
+
}
|
|
11
|
+
return () => {
|
|
12
|
+
const props = {
|
|
13
|
+
...attrs,
|
|
14
|
+
"onUpdate:modelValue": handleUpdate
|
|
15
|
+
};
|
|
16
|
+
return h(ElCheckboxGroup, props, {
|
|
17
|
+
default: () => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return [
|
|
20
|
+
(props == null ? void 0 : props.radioButton) ? (_a = props.options) == null ? void 0 : _a.map(
|
|
21
|
+
(option) => h(ElCheckboxButton, {
|
|
22
|
+
label: option.label,
|
|
23
|
+
value: option.value
|
|
24
|
+
})
|
|
25
|
+
) : (_b = props.options) == null ? void 0 : _b.map(
|
|
26
|
+
(option) => h(ElCheckbox, { label: option.label, value: option.value })
|
|
27
|
+
)
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { checkbox as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
const col = vue.defineComponent({
|
|
7
|
+
props: {
|
|
8
|
+
componentSchema: {
|
|
9
|
+
default: () => ({}),
|
|
10
|
+
required: true,
|
|
11
|
+
type: Object
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(props, { slots }) {
|
|
15
|
+
return () => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const componentSchema = {
|
|
18
|
+
...props.componentSchema,
|
|
19
|
+
title: (_a = props.componentSchema) == null ? void 0 : _a.label
|
|
20
|
+
};
|
|
21
|
+
const children = (_b = componentSchema.children) != null ? _b : [];
|
|
22
|
+
delete componentSchema.children;
|
|
23
|
+
return vue.h(elementPlus.ElCol, componentSchema, {
|
|
24
|
+
default: () => vue.renderSlot(
|
|
25
|
+
slots,
|
|
26
|
+
"edit-node",
|
|
27
|
+
{},
|
|
28
|
+
() => children.map(
|
|
29
|
+
(node) => vue.renderSlot(slots, "node", { componentSchema: node })
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
exports.default = col;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineComponent, h, renderSlot } from 'vue';
|
|
2
|
+
import { ElCol } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
const col = defineComponent({
|
|
5
|
+
props: {
|
|
6
|
+
componentSchema: {
|
|
7
|
+
default: () => ({}),
|
|
8
|
+
required: true,
|
|
9
|
+
type: Object
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setup(props, { slots }) {
|
|
13
|
+
return () => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const componentSchema = {
|
|
16
|
+
...props.componentSchema,
|
|
17
|
+
title: (_a = props.componentSchema) == null ? void 0 : _a.label
|
|
18
|
+
};
|
|
19
|
+
const children = (_b = componentSchema.children) != null ? _b : [];
|
|
20
|
+
delete componentSchema.children;
|
|
21
|
+
return h(ElCol, componentSchema, {
|
|
22
|
+
default: () => renderSlot(
|
|
23
|
+
slots,
|
|
24
|
+
"edit-node",
|
|
25
|
+
{},
|
|
26
|
+
() => children.map(
|
|
27
|
+
(node) => renderSlot(slots, "node", { componentSchema: node })
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { col as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
const collapse = vue.defineComponent({
|
|
7
|
+
props: {
|
|
8
|
+
componentSchema: {
|
|
9
|
+
default: () => ({}),
|
|
10
|
+
required: true,
|
|
11
|
+
type: Object
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(props, { slots }) {
|
|
15
|
+
return () => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const componentSchema = {
|
|
18
|
+
...props.componentSchema,
|
|
19
|
+
title: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : ""
|
|
20
|
+
};
|
|
21
|
+
const children = componentSchema.children;
|
|
22
|
+
delete componentSchema.children;
|
|
23
|
+
return vue.h(elementPlus.ElCollapse, componentSchema, {
|
|
24
|
+
default: () => [
|
|
25
|
+
vue.renderSlot(
|
|
26
|
+
slots,
|
|
27
|
+
"edit-node",
|
|
28
|
+
{},
|
|
29
|
+
() => children.map(
|
|
30
|
+
(subcomponentSchema) => vue.renderSlot(slots, "node", {
|
|
31
|
+
componentSchema: subcomponentSchema
|
|
32
|
+
})
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
exports.default = collapse;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent, h, renderSlot } from 'vue';
|
|
2
|
+
import { ElCollapse } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
const collapse = defineComponent({
|
|
5
|
+
props: {
|
|
6
|
+
componentSchema: {
|
|
7
|
+
default: () => ({}),
|
|
8
|
+
required: true,
|
|
9
|
+
type: Object
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setup(props, { slots }) {
|
|
13
|
+
return () => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const componentSchema = {
|
|
16
|
+
...props.componentSchema,
|
|
17
|
+
title: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : ""
|
|
18
|
+
};
|
|
19
|
+
const children = componentSchema.children;
|
|
20
|
+
delete componentSchema.children;
|
|
21
|
+
return h(ElCollapse, componentSchema, {
|
|
22
|
+
default: () => [
|
|
23
|
+
renderSlot(
|
|
24
|
+
slots,
|
|
25
|
+
"edit-node",
|
|
26
|
+
{},
|
|
27
|
+
() => children.map(
|
|
28
|
+
(subcomponentSchema) => renderSlot(slots, "node", {
|
|
29
|
+
componentSchema: subcomponentSchema
|
|
30
|
+
})
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { collapse as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
const collapseItem = vue.defineComponent({
|
|
7
|
+
props: {
|
|
8
|
+
componentSchema: {
|
|
9
|
+
default: () => ({}),
|
|
10
|
+
require: true,
|
|
11
|
+
type: Object
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(props, { slots }) {
|
|
15
|
+
return () => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const componentSchema = {
|
|
18
|
+
...props.componentSchema,
|
|
19
|
+
title: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : ""
|
|
20
|
+
};
|
|
21
|
+
const children = componentSchema.children;
|
|
22
|
+
delete componentSchema.children;
|
|
23
|
+
return vue.h(elementPlus.ElCollapseItem, componentSchema, {
|
|
24
|
+
default: () => vue.renderSlot(
|
|
25
|
+
slots,
|
|
26
|
+
"edit-node",
|
|
27
|
+
{},
|
|
28
|
+
() => children.map(
|
|
29
|
+
(subcomponentSchema) => vue.renderSlot(slots, "node", {
|
|
30
|
+
componentSchema: subcomponentSchema
|
|
31
|
+
})
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
exports.default = collapseItem;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent, h, renderSlot } from 'vue';
|
|
2
|
+
import { ElCollapseItem } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
const collapseItem = defineComponent({
|
|
5
|
+
props: {
|
|
6
|
+
componentSchema: {
|
|
7
|
+
default: () => ({}),
|
|
8
|
+
require: true,
|
|
9
|
+
type: Object
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
setup(props, { slots }) {
|
|
13
|
+
return () => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const componentSchema = {
|
|
16
|
+
...props.componentSchema,
|
|
17
|
+
title: (_b = (_a = props.componentSchema) == null ? void 0 : _a.label) != null ? _b : ""
|
|
18
|
+
};
|
|
19
|
+
const children = componentSchema.children;
|
|
20
|
+
delete componentSchema.children;
|
|
21
|
+
return h(ElCollapseItem, componentSchema, {
|
|
22
|
+
default: () => renderSlot(
|
|
23
|
+
slots,
|
|
24
|
+
"edit-node",
|
|
25
|
+
{},
|
|
26
|
+
() => children.map(
|
|
27
|
+
(subcomponentSchema) => renderSlot(slots, "node", {
|
|
28
|
+
componentSchema: subcomponentSchema
|
|
29
|
+
})
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { collapseItem as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const elementPlus = require('element-plus');
|
|
5
|
+
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
7
|
+
__name: "date-picker",
|
|
8
|
+
props: {
|
|
9
|
+
placeholder: { type: String, required: false, default: "\u8BF7\u9009\u62E9" }
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDatePicker), {
|
|
15
|
+
placeholder: props.placeholder
|
|
16
|
+
}, null, 8, ["placeholder"]);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineComponent, createBlock, openBlock, unref } from 'vue';
|
|
2
|
+
import { ElDatePicker } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "date-picker",
|
|
6
|
+
props: {
|
|
7
|
+
placeholder: { type: String, required: false, default: "\u8BF7\u9009\u62E9" }
|
|
8
|
+
},
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const props = __props;
|
|
11
|
+
return (_ctx, _cache) => {
|
|
12
|
+
return openBlock(), createBlock(unref(ElDatePicker), {
|
|
13
|
+
placeholder: props.placeholder
|
|
14
|
+
}, null, 8, ["placeholder"]);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const nadaDesigner = require('nada-designer');
|
|
5
|
+
const elementPlus = require('element-plus');
|
|
6
|
+
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
8
|
+
...{
|
|
9
|
+
inheritAttrs: false
|
|
10
|
+
},
|
|
11
|
+
__name: "form",
|
|
12
|
+
props: {
|
|
13
|
+
componentSchema: { type: Object, required: true, default: () => ({ type: "" }) },
|
|
14
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
15
|
+
},
|
|
16
|
+
setup(__props, { expose: __expose }) {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
const props = __props;
|
|
19
|
+
nadaDesigner.provideBuilderDisabled(vue.computed(() => props.disabled));
|
|
20
|
+
const form = vue.ref(null);
|
|
21
|
+
const { formData, formInstances } = nadaDesigner.useForm(
|
|
22
|
+
(_c = (_b = (_a = props.componentSchema) == null ? void 0 : _a.props) == null ? void 0 : _b.name) != null ? _c : "default"
|
|
23
|
+
);
|
|
24
|
+
function getData() {
|
|
25
|
+
return formData;
|
|
26
|
+
}
|
|
27
|
+
function setData(data) {
|
|
28
|
+
Object.assign(formData, data);
|
|
29
|
+
}
|
|
30
|
+
function resetData() {
|
|
31
|
+
var _a2;
|
|
32
|
+
(_a2 = form.value) == null ? void 0 : _a2.resetFields();
|
|
33
|
+
}
|
|
34
|
+
function validate() {
|
|
35
|
+
var _a2;
|
|
36
|
+
return (_a2 = form.value) == null ? void 0 : _a2.validate();
|
|
37
|
+
}
|
|
38
|
+
vue.onMounted(async () => {
|
|
39
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
40
|
+
if (((_a2 = props.componentSchema) == null ? void 0 : _a2.type) === "form" && formInstances.value && form.value) {
|
|
41
|
+
const name = (_f = (_e = (_c2 = (_b2 = props.componentSchema) == null ? void 0 : _b2.props) == null ? void 0 : _c2.name) != null ? _e : (_d = props.componentSchema) == null ? void 0 : _d.name) != null ? _f : "default";
|
|
42
|
+
formInstances.value[name] = form.value;
|
|
43
|
+
form.value.getData = getData;
|
|
44
|
+
form.value.setData = setData;
|
|
45
|
+
form.value.resetData = resetData;
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const formProps = vue.computed(() => {
|
|
50
|
+
const recordProps = props.componentSchema.props;
|
|
51
|
+
let labelCol = recordProps.labelCol;
|
|
52
|
+
let wrapperCol = recordProps.wrapperCol;
|
|
53
|
+
if (recordProps.labelLayout === "fixed") {
|
|
54
|
+
labelCol = {
|
|
55
|
+
style: `width:${typeof recordProps.labelWidth === "number" ? `${recordProps.labelWidth}px` : recordProps.labelWidth}`
|
|
56
|
+
};
|
|
57
|
+
wrapperCol = { style: "width:auto;flex:1" };
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
...recordProps,
|
|
61
|
+
labelCol,
|
|
62
|
+
wrapperCol
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
const children = vue.computed(() => {
|
|
66
|
+
var _a2;
|
|
67
|
+
return (_a2 = props.componentSchema.children) != null ? _a2 : [];
|
|
68
|
+
});
|
|
69
|
+
__expose({
|
|
70
|
+
form,
|
|
71
|
+
getData,
|
|
72
|
+
resetData,
|
|
73
|
+
setData,
|
|
74
|
+
validate
|
|
75
|
+
});
|
|
76
|
+
return (_ctx, _cache) => {
|
|
77
|
+
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElForm), vue.mergeProps({
|
|
78
|
+
ref_key: "form",
|
|
79
|
+
ref: form,
|
|
80
|
+
model: vue.unref(formData)
|
|
81
|
+
}, formProps.value), {
|
|
82
|
+
default: vue.withCtx(() => [
|
|
83
|
+
vue.renderSlot(_ctx.$slots, "edit-node", {}, () => [
|
|
84
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
85
|
+
vue.Fragment,
|
|
86
|
+
null,
|
|
87
|
+
vue.renderList(children.value, (item) => {
|
|
88
|
+
return vue.renderSlot(_ctx.$slots, "node", { componentSchema: item });
|
|
89
|
+
}),
|
|
90
|
+
256
|
|
91
|
+
/* UNKEYED_FRAGMENT */
|
|
92
|
+
))
|
|
93
|
+
])
|
|
94
|
+
]),
|
|
95
|
+
_: 3
|
|
96
|
+
/* FORWARDED */
|
|
97
|
+
}, 16, ["model"]);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
exports.default = _sfc_main;
|