@epic-designer/antd 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 (62) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunks/button.cjs +44 -0
  3. package/dist/chunks/button.mjs +42 -0
  4. package/dist/chunks/card.cjs +39 -0
  5. package/dist/chunks/card.mjs +37 -0
  6. package/dist/chunks/col.cjs +39 -0
  7. package/dist/chunks/col.mjs +37 -0
  8. package/dist/chunks/datePicker.cjs +47 -0
  9. package/dist/chunks/datePicker.mjs +45 -0
  10. package/dist/chunks/form.cjs +116 -0
  11. package/dist/chunks/form.mjs +114 -0
  12. package/dist/chunks/formItem.cjs +24 -0
  13. package/dist/chunks/formItem.mjs +22 -0
  14. package/dist/chunks/modal.cjs +136 -0
  15. package/dist/chunks/modal.mjs +134 -0
  16. package/dist/chunks/row.cjs +39 -0
  17. package/dist/chunks/row.mjs +37 -0
  18. package/dist/chunks/uploadFile.cjs +138 -0
  19. package/dist/chunks/uploadFile.mjs +136 -0
  20. package/dist/chunks/uploadImage.cjs +152 -0
  21. package/dist/chunks/uploadImage.mjs +150 -0
  22. package/dist/index.cjs +3047 -0
  23. package/dist/index.d.cts +5 -0
  24. package/dist/index.d.mts +5 -0
  25. package/dist/index.d.ts +5 -0
  26. package/dist/index.mjs +3045 -0
  27. package/package.json +38 -0
  28. package/src/button/button.vue +19 -0
  29. package/src/button/index.ts +204 -0
  30. package/src/card/card.ts +38 -0
  31. package/src/card/index.ts +65 -0
  32. package/src/cascader/cascader.vue +24 -0
  33. package/src/cascader/index.ts +201 -0
  34. package/src/checkbox/index.ts +101 -0
  35. package/src/col/col.ts +38 -0
  36. package/src/col/index.ts +22 -0
  37. package/src/color-picker/index.ts +109 -0
  38. package/src/date-picker/datePicker.ts +48 -0
  39. package/src/date-picker/index.ts +301 -0
  40. package/src/form/form.vue +153 -0
  41. package/src/form/index.ts +196 -0
  42. package/src/form-item/formItem.vue +12 -0
  43. package/src/form-item/index.ts +10 -0
  44. package/src/index.less +33 -0
  45. package/src/index.ts +131 -0
  46. package/src/input/index.ts +171 -0
  47. package/src/input-number/index.ts +182 -0
  48. package/src/input-password/index.ts +154 -0
  49. package/src/modal/index.ts +20 -0
  50. package/src/modal/modal.vue +98 -0
  51. package/src/radio/index.ts +107 -0
  52. package/src/row/index.ts +116 -0
  53. package/src/row/row.ts +38 -0
  54. package/src/select/index.ts +231 -0
  55. package/src/slider/index.ts +145 -0
  56. package/src/switch/index.ts +143 -0
  57. package/src/textarea/index.ts +164 -0
  58. package/src/time-picker/index.ts +192 -0
  59. package/src/upload-file/index.ts +90 -0
  60. package/src/upload-file/uploadFile.vue +145 -0
  61. package/src/upload-image/index.ts +71 -0
  62. package/src/upload-image/uploadImage.vue +167 -0
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@epic-designer/antd",
3
+ "version": "1.0.5",
4
+ "description": "epic-designer base antd ui",
5
+ "private": false,
6
+ "author": "kchengz",
7
+ "type": "module",
8
+ "files": [
9
+ "dist",
10
+ "src"
11
+ ],
12
+ "main": "./dist/index.mjs",
13
+ "module": "./dist/index.mjs",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.mjs",
19
+ "require": "./dist/index.cjs"
20
+ }
21
+ },
22
+ "peerDependencies": {
23
+ "ant-design-vue": ">=3.2.20",
24
+ "epic-designer": ">=1.0.5",
25
+ "vue": ">=3.1.0"
26
+ },
27
+ "devDependencies": {
28
+ "@rollup/plugin-alias": "^6.0.0",
29
+ "@vitejs/plugin-vue": "^5.2.1",
30
+ "ant-design-vue": "^4.2.6",
31
+ "tsx": "^4.20.6",
32
+ "unbuild": "^3.6.1"
33
+ },
34
+ "scripts": {
35
+ "build": "unbuild",
36
+ "stub": "tsx dev-stub.ts"
37
+ }
38
+ }
@@ -0,0 +1,19 @@
1
+ <script lang="ts" setup>
2
+ import type { ComponentSchema } from '@epic-designer/types';
3
+
4
+ import type { PropType } from 'vue';
5
+
6
+ import { Button } from 'ant-design-vue';
7
+
8
+ const props = defineProps({
9
+ componentSchema: {
10
+ default: () => ({}),
11
+ type: Object as PropType<ComponentSchema>,
12
+ },
13
+ });
14
+ </script>
15
+ <template>
16
+ <Button v-bind="props.componentSchema?.componentProps">
17
+ <slot>{{ props.componentSchema?.label }}</slot>
18
+ </Button>
19
+ </template>
@@ -0,0 +1,204 @@
1
+ import type { ComponentConfigModel } from '@epic-designer/types';
2
+
3
+ export default {
4
+ component: () => import('./button.vue'),
5
+ config: {
6
+ attribute: [
7
+ {
8
+ field: 'label',
9
+ label: '标题',
10
+ type: 'input',
11
+ },
12
+ {
13
+ componentProps: {
14
+ clearable: true,
15
+ options: [
16
+ {
17
+ label: 'primary',
18
+ value: 'primary',
19
+ },
20
+ {
21
+ label: 'ghost',
22
+ value: 'ghost',
23
+ },
24
+ {
25
+ label: 'dashed',
26
+ value: 'dashed',
27
+ },
28
+ {
29
+ label: 'link',
30
+ value: 'link',
31
+ },
32
+ {
33
+ label: 'text',
34
+ value: 'text',
35
+ },
36
+ {
37
+ label: 'default',
38
+ value: 'default',
39
+ },
40
+ ],
41
+ placeholder: '请选择',
42
+ },
43
+ field: 'componentProps.type',
44
+ label: '类型',
45
+ type: 'select',
46
+ },
47
+ {
48
+ componentProps: {
49
+ clearable: true,
50
+ options: [
51
+ {
52
+ label: 'button',
53
+ value: 'button',
54
+ },
55
+ {
56
+ label: 'submit',
57
+ value: 'submit',
58
+ },
59
+ {
60
+ label: 'reset',
61
+ value: 'reset',
62
+ },
63
+ ],
64
+ placeholder: '请选择',
65
+ },
66
+ field: 'componentProps.htmlType',
67
+ label: '操作类型',
68
+ type: 'select',
69
+ },
70
+ {
71
+ componentProps: {
72
+ allowClear: true,
73
+ placeholder: '请输入',
74
+ },
75
+ field: 'componentProps.href',
76
+ label: '链接',
77
+ type: 'input',
78
+ },
79
+ {
80
+ componentProps: {
81
+ clearable: true,
82
+ options: [
83
+ {
84
+ label: 'blank',
85
+ value: '_blank',
86
+ },
87
+ {
88
+ label: 'parent',
89
+ value: '_parent',
90
+ },
91
+ {
92
+ label: 'self',
93
+ value: '_self',
94
+ },
95
+ {
96
+ label: 'top',
97
+ value: '_top',
98
+ },
99
+ ],
100
+ placeholder: '请选择',
101
+ },
102
+ field: 'componentProps.target',
103
+ label: '链接打开方式',
104
+ show: ({ values }) => values.componentProps?.href,
105
+ type: 'select',
106
+ },
107
+ {
108
+ componentProps: {
109
+ allowClear: true,
110
+ options: [
111
+ {
112
+ label: 'default',
113
+ value: 'default',
114
+ },
115
+ {
116
+ label: 'small',
117
+ value: 'small',
118
+ },
119
+ {
120
+ label: 'large',
121
+ value: 'large',
122
+ },
123
+ ],
124
+ placeholder: '请选择',
125
+ },
126
+ field: 'componentProps.size',
127
+ label: '尺寸',
128
+ type: 'select',
129
+ },
130
+ {
131
+ componentProps: {
132
+ clearable: true,
133
+ options: [
134
+ {
135
+ label: 'default',
136
+ value: 'default',
137
+ },
138
+ {
139
+ label: 'circle',
140
+ value: 'circle',
141
+ },
142
+ {
143
+ label: 'round',
144
+ value: 'round',
145
+ },
146
+ ],
147
+ placeholder: '请选择',
148
+ },
149
+ field: 'componentProps.shape',
150
+ label: '形状',
151
+ type: 'select',
152
+ },
153
+ {
154
+ field: 'componentProps.ghost',
155
+ label: '幽灵按钮',
156
+ type: 'switch',
157
+ },
158
+ {
159
+ field: 'componentProps.loading',
160
+ label: '加载状态',
161
+ type: 'switch',
162
+ },
163
+ {
164
+ field: 'componentProps.block',
165
+ label: '宽度自适应',
166
+ type: 'switch',
167
+ },
168
+ {
169
+ field: 'componentProps.danger',
170
+ label: '危险按钮',
171
+ type: 'switch',
172
+ },
173
+ {
174
+ field: 'componentProps.disabled',
175
+ label: '禁用',
176
+ type: 'switch',
177
+ },
178
+ {
179
+ field: 'componentProps.hidden',
180
+ label: '隐藏',
181
+ type: 'switch',
182
+ },
183
+ ],
184
+ event: [
185
+ {
186
+ description: '点击按钮时',
187
+ type: 'click',
188
+ },
189
+ {
190
+ description: '双击按钮时',
191
+ type: 'dblclick',
192
+ },
193
+ ],
194
+ },
195
+ defaultSchema: {
196
+ field: 'input',
197
+ input: false,
198
+ label: '按钮',
199
+ type: 'button',
200
+ },
201
+ groupName: '表单',
202
+ icon: 'icon--epic--fit-screen-rounded',
203
+ sort: 1200,
204
+ } as ComponentConfigModel;
@@ -0,0 +1,38 @@
1
+ import type { ComponentSchema } from '@epic-designer/types';
2
+
3
+ import type { PropType } from 'vue';
4
+
5
+ import { defineComponent, h, renderSlot } from 'vue';
6
+
7
+ import { Card } from 'ant-design-vue';
8
+
9
+ export default defineComponent({
10
+ props: {
11
+ componentSchema: {
12
+ default: () => ({}),
13
+ require: true,
14
+ type: Object as PropType<ComponentSchema>,
15
+ },
16
+ },
17
+ setup(props, { slots }) {
18
+ return () => {
19
+ const componentSchema = {
20
+ ...props.componentSchema,
21
+ title: props.componentSchema?.label ?? '',
22
+ } as Record<string, any>;
23
+ const children = componentSchema.children ?? [];
24
+ delete componentSchema.children;
25
+
26
+ return h(Card, componentSchema, {
27
+ default: () =>
28
+ renderSlot(slots, 'edit-node', {}, () =>
29
+ children.map((subcomponentSchema: ComponentSchema) =>
30
+ renderSlot(slots, 'node', {
31
+ componentSchema: subcomponentSchema,
32
+ }),
33
+ ),
34
+ ),
35
+ });
36
+ };
37
+ },
38
+ });
@@ -0,0 +1,65 @@
1
+ import type { ComponentConfigModel } from '@epic-designer/types';
2
+
3
+ export default {
4
+ component: () => import('./card'),
5
+ config: {
6
+ attribute: [
7
+ {
8
+ field: 'label',
9
+ label: '标题',
10
+ type: 'input',
11
+ },
12
+ {
13
+ componentProps: {
14
+ allowClear: true,
15
+ options: [
16
+ {
17
+ label: 'default',
18
+ value: 'default',
19
+ },
20
+ {
21
+ label: 'small',
22
+ value: 'small',
23
+ },
24
+ ],
25
+ placeholder: '请选择',
26
+ },
27
+ field: 'componentProps.size',
28
+ label: '尺寸',
29
+ type: 'select',
30
+ },
31
+ {
32
+ componentProps: {
33
+ checkedValue: false,
34
+ unCheckedValue: true,
35
+ },
36
+ field: 'componentProps.bordered',
37
+ label: '无边框',
38
+ type: 'switch',
39
+ },
40
+ {
41
+ field: 'componentProps.hoverable',
42
+ label: '鼠标悬停阴影',
43
+ type: 'switch',
44
+ },
45
+ {
46
+ field: 'componentProps.loading',
47
+ label: '加载状态',
48
+ type: 'switch',
49
+ },
50
+ {
51
+ field: 'componentProps.hidden',
52
+ label: '隐藏',
53
+ type: 'switch',
54
+ },
55
+ ],
56
+ },
57
+ defaultSchema: {
58
+ label: '卡片布局',
59
+ type: 'card',
60
+ children: [],
61
+ },
62
+ groupName: '布局',
63
+ icon: 'icon--epic--wysiwyg-rounded',
64
+ sort: 700,
65
+ } as ComponentConfigModel;
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import { computed, useAttrs } from 'vue';
3
+
4
+ import { Cascader } from 'ant-design-vue';
5
+
6
+ const emits = defineEmits<{
7
+ 'update:modelValue': any;
8
+ }>();
9
+ const attrs = useAttrs();
10
+ const getComponentProps = computed(() => ({
11
+ ...attrs,
12
+ 'onUpdate:value': handleUpdate,
13
+ showCheckedStrategy:
14
+ Cascader[(attrs.showCheckedStrategy as string) ?? 'SHOW_PARENT'],
15
+ value: attrs.modelValue,
16
+ }));
17
+
18
+ function handleUpdate(e = null): void {
19
+ emits('update:modelValue', e);
20
+ }
21
+ </script>
22
+ <template>
23
+ <Cascader v-bind="getComponentProps" />
24
+ </template>
@@ -0,0 +1,201 @@
1
+ import type { ComponentConfigModel } from '@epic-designer/types';
2
+
3
+ export default {
4
+ bindModel: 'value',
5
+ component: async () => (await import('ant-design-vue')).Cascader,
6
+ config: {
7
+ attribute: [
8
+ {
9
+ field: 'field',
10
+ label: '字段名',
11
+ type: 'input',
12
+ },
13
+ {
14
+ field: 'label',
15
+ label: '标题',
16
+ type: 'input',
17
+ },
18
+ {
19
+ field: 'componentProps.defaultValue',
20
+ label: '默认值',
21
+ type: 'cascader',
22
+ },
23
+ {
24
+ field: 'componentProps.placeholder',
25
+ label: '占位内容',
26
+ type: 'input',
27
+ },
28
+ {
29
+ componentProps: {
30
+ allowClear: true,
31
+ options: [
32
+ {
33
+ label: '大号',
34
+ value: 'large',
35
+ },
36
+ {
37
+ label: '中等',
38
+ value: 'middle',
39
+ },
40
+ {
41
+ label: '小型',
42
+ value: 'small',
43
+ },
44
+ ],
45
+ placeholder: '请选择',
46
+ },
47
+ field: 'componentProps.size',
48
+ label: '尺寸',
49
+ type: 'select',
50
+ },
51
+ {
52
+ componentProps: {
53
+ allowClear: true,
54
+ options: [
55
+ {
56
+ label: 'bottomLeft',
57
+ value: 'bottomLeft',
58
+ },
59
+ {
60
+ label: 'bottomRight',
61
+ value: 'bottomRight',
62
+ },
63
+ {
64
+ label: 'topLeft',
65
+ value: 'topLeft',
66
+ },
67
+ {
68
+ label: 'topRight',
69
+ value: 'topRight',
70
+ },
71
+ ],
72
+ placeholder: '请选择',
73
+ },
74
+ field: 'componentProps.placement',
75
+ label: '弹出框位置',
76
+ type: 'select',
77
+ },
78
+ {
79
+ field: 'componentProps.showSearch',
80
+ label: '可搜索',
81
+ type: 'switch',
82
+ },
83
+ {
84
+ componentProps: {
85
+ checkedValue: false,
86
+ unCheckedValue: true,
87
+ },
88
+ field: 'componentProps.bordered',
89
+ label: '无边框',
90
+ type: 'switch',
91
+ },
92
+ {
93
+ field: 'componentProps.multiple',
94
+ label: '多选',
95
+ type: 'switch',
96
+ },
97
+ {
98
+ componentProps: {
99
+ placeholder: '请输入',
100
+ },
101
+ field: 'componentProps.maxTagTextLength',
102
+ label: '标签最大长度',
103
+ show: ({ values }) => values.componentProps.multiple,
104
+ type: 'number',
105
+ },
106
+ {
107
+ componentProps: {
108
+ placeholder: '请输入',
109
+ },
110
+ field: 'componentProps.maxTagCount',
111
+ label: '标签显示数量',
112
+ show: ({ values }) => values.componentProps.multiple,
113
+ type: 'number',
114
+ },
115
+
116
+ {
117
+ componentProps: {
118
+ clearable: true,
119
+ options: [
120
+ {
121
+ label: 'SHOW_PARENT',
122
+ value: 'SHOW_PARENT',
123
+ },
124
+ {
125
+ label: 'SHOW_CHILD',
126
+ value: 'SHOW_CHILD',
127
+ },
128
+ ],
129
+ placeholder: '请选择',
130
+ },
131
+ field: 'componentProps.showCheckedStrategy',
132
+ label: '回填方式',
133
+ show: ({ values }) => values.componentProps.multiple,
134
+ type: 'select',
135
+ },
136
+
137
+ {
138
+ field: 'componentProps.allowClear',
139
+ label: '可清空',
140
+ type: 'switch',
141
+ },
142
+ {
143
+ field: 'componentProps.disabled',
144
+ label: '禁用',
145
+ type: 'switch',
146
+ },
147
+ {
148
+ field: 'componentProps.hidden',
149
+ label: '隐藏',
150
+ type: 'switch',
151
+ },
152
+ {
153
+ componentProps: {
154
+ tree: true,
155
+ },
156
+ field: 'componentProps.options',
157
+ label: '选项管理',
158
+ layout: 'vertical',
159
+ type: 'EOptionsEditor',
160
+ },
161
+ {
162
+ componentProps: {
163
+ ruleType: 'array',
164
+ },
165
+ description: '校验规则需要配合表单使用',
166
+ field: 'rules',
167
+ label: '表单校验',
168
+ layout: 'vertical',
169
+ type: 'ERuleEditor',
170
+ },
171
+ ],
172
+ event: [
173
+ {
174
+ description: '值变化时',
175
+ type: 'change',
176
+ },
177
+ ],
178
+ },
179
+ defaultSchema: {
180
+ componentProps: {
181
+ options: [
182
+ {
183
+ label: '选项1',
184
+ value: '选项1',
185
+ },
186
+ {
187
+ label: '选项2',
188
+ value: '选项2',
189
+ },
190
+ ],
191
+ placeholder: '请选择',
192
+ },
193
+ field: 'cascader',
194
+ input: true,
195
+ label: '级联选择器',
196
+ type: 'cascader',
197
+ },
198
+ groupName: '表单',
199
+ icon: 'icon--epic--full-coverage-outline',
200
+ sort: 900,
201
+ } as ComponentConfigModel;
@@ -0,0 +1,101 @@
1
+ import type { ComponentConfigModel } from '@epic-designer/types';
2
+
3
+ export default {
4
+ bindModel: 'value',
5
+ component: async () => (await import('ant-design-vue')).CheckboxGroup,
6
+ config: {
7
+ attribute: [
8
+ {
9
+ field: 'field',
10
+ label: '字段名',
11
+ type: 'input',
12
+ },
13
+ {
14
+ field: 'label',
15
+ label: '标题',
16
+ type: 'input',
17
+ },
18
+ {
19
+ field: 'componentProps.defaultValue',
20
+ label: '默认值',
21
+ type: 'checkbox',
22
+ },
23
+ {
24
+ componentProps: {
25
+ allowClear: true,
26
+ options: [
27
+ {
28
+ label: '大号',
29
+ value: 'large',
30
+ },
31
+ {
32
+ label: '中等',
33
+ value: 'middle',
34
+ },
35
+ {
36
+ label: '小型',
37
+ value: 'small',
38
+ },
39
+ ],
40
+ placeholder: '请选择',
41
+ },
42
+ field: 'componentProps.size',
43
+ label: '尺寸',
44
+ type: 'select',
45
+ },
46
+ {
47
+ field: 'componentProps.disabled',
48
+ label: '禁用',
49
+ type: 'switch',
50
+ },
51
+ {
52
+ field: 'componentProps.hidden',
53
+ label: '隐藏',
54
+ type: 'switch',
55
+ },
56
+ {
57
+ field: 'componentProps.options',
58
+ label: '选项管理',
59
+ layout: 'vertical',
60
+ type: 'EOptionsEditor',
61
+ },
62
+ {
63
+ componentProps: {
64
+ ruleType: 'array',
65
+ },
66
+ description: '校验规则需要配合表单使用',
67
+ field: 'rules',
68
+ label: '表单校验',
69
+ layout: 'vertical',
70
+ type: 'ERuleEditor',
71
+ },
72
+ ],
73
+ event: [
74
+ {
75
+ description: '值变化时',
76
+ type: 'change',
77
+ },
78
+ ],
79
+ },
80
+ defaultSchema: {
81
+ componentProps: {
82
+ options: [
83
+ {
84
+ label: '选项1',
85
+ value: '选项1',
86
+ },
87
+ {
88
+ label: '选项2',
89
+ value: '选项2',
90
+ },
91
+ ],
92
+ },
93
+ field: 'checkbox',
94
+ input: true,
95
+ label: '多选框',
96
+ type: 'checkbox',
97
+ },
98
+ groupName: '表单',
99
+ icon: 'icon--epic--dialogs-outline-rounded',
100
+ sort: 860,
101
+ } as ComponentConfigModel;