@tmagic/form 1.0.0-beta.1
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/style.css +161 -0
- package/dist/tmagic-form.es.js +3749 -0
- package/dist/tmagic-form.es.js.map +1 -0
- package/dist/tmagic-form.umd.js +3790 -0
- package/dist/tmagic-form.umd.js.map +1 -0
- package/dist/types/src/Form.vue.d.ts +304 -0
- package/dist/types/src/FormDialog.vue.d.ts +641 -0
- package/dist/types/src/containers/Container.vue.d.ts +69 -0
- package/dist/types/src/containers/Fieldset.vue.d.ts +56 -0
- package/dist/types/src/containers/GroupList.vue.d.ts +56 -0
- package/dist/types/src/containers/GroupListItem.vue.d.ts +72 -0
- package/dist/types/src/containers/Panel.vue.d.ts +41 -0
- package/dist/types/src/containers/Row.vue.d.ts +42 -0
- package/dist/types/src/containers/Step.vue.d.ts +45 -0
- package/dist/types/src/containers/Table.vue.d.ts +1401 -0
- package/dist/types/src/containers/Tabs.vue.d.ts +45 -0
- package/dist/types/src/fields/Cascader.vue.d.ts +1748 -0
- package/dist/types/src/fields/Checkbox.vue.d.ts +59 -0
- package/dist/types/src/fields/CheckboxGroup.vue.d.ts +56 -0
- package/dist/types/src/fields/Date.vue.d.ts +58 -0
- package/dist/types/src/fields/DateTime.vue.d.ts +57 -0
- package/dist/types/src/fields/Daterange.vue.d.ts +57 -0
- package/dist/types/src/fields/Display.vue.d.ts +3 -0
- package/dist/types/src/fields/DynamicField.vue.d.ts +76 -0
- package/dist/types/src/fields/Hidden.vue.d.ts +3 -0
- package/dist/types/src/fields/Link.vue.d.ts +1365 -0
- package/dist/types/src/fields/Number.vue.d.ts +59 -0
- package/dist/types/src/fields/RadioGroup.vue.d.ts +55 -0
- package/dist/types/src/fields/Select.vue.d.ts +975 -0
- package/dist/types/src/fields/Switch.vue.d.ts +59 -0
- package/dist/types/src/fields/Text.vue.d.ts +61 -0
- package/dist/types/src/fields/Textarea.vue.d.ts +56 -0
- package/dist/types/src/fields/Time.vue.d.ts +54 -0
- package/dist/types/src/index.d.ts +36 -0
- package/dist/types/src/schema.d.ts +495 -0
- package/dist/types/src/shims-vue.d.ts +6 -0
- package/dist/types/src/utils/config.d.ts +3 -0
- package/dist/types/src/utils/fieldProps.d.ts +21 -0
- package/dist/types/src/utils/form.d.ts +8 -0
- package/dist/types/src/utils/useAddField.d.ts +1 -0
- package/dist/types/src/vite-env.d.ts +1 -0
- package/package.json +51 -0
- package/src/Form.vue +188 -0
- package/src/FormDialog.vue +163 -0
- package/src/containers/Container.vue +263 -0
- package/src/containers/Fieldset.vue +138 -0
- package/src/containers/GroupList.vue +152 -0
- package/src/containers/GroupListItem.vue +159 -0
- package/src/containers/Panel.vue +106 -0
- package/src/containers/Row.vue +68 -0
- package/src/containers/Step.vue +82 -0
- package/src/containers/Table.vue +624 -0
- package/src/containers/Tabs.vue +176 -0
- package/src/fields/Cascader.vue +147 -0
- package/src/fields/Checkbox.vue +67 -0
- package/src/fields/CheckboxGroup.vue +44 -0
- package/src/fields/ColorPicker.vue +38 -0
- package/src/fields/Date.vue +51 -0
- package/src/fields/DateTime.vue +59 -0
- package/src/fields/Daterange.vue +75 -0
- package/src/fields/Display.vue +34 -0
- package/src/fields/DynamicField.vue +109 -0
- package/src/fields/Hidden.vue +29 -0
- package/src/fields/Link.vue +112 -0
- package/src/fields/Number.vue +53 -0
- package/src/fields/RadioGroup.vue +33 -0
- package/src/fields/Select.vue +393 -0
- package/src/fields/Switch.vue +65 -0
- package/src/fields/Text.vue +134 -0
- package/src/fields/Textarea.vue +62 -0
- package/src/fields/Time.vue +48 -0
- package/src/index.ts +127 -0
- package/src/schema.ts +638 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/theme/date-time.scss +7 -0
- package/src/theme/fieldset.scss +24 -0
- package/src/theme/form-dialog.scss +13 -0
- package/src/theme/form.scss +30 -0
- package/src/theme/group-list.scss +23 -0
- package/src/theme/index.scss +9 -0
- package/src/theme/link.scss +3 -0
- package/src/theme/panel.scss +18 -0
- package/src/theme/select.scss +3 -0
- package/src/theme/table.scss +69 -0
- package/src/theme/tabs.scss +25 -0
- package/src/utils/config.ts +27 -0
- package/src/utils/containerProps.ts +50 -0
- package/src/utils/createForm.ts +25 -0
- package/src/utils/fieldProps.ts +39 -0
- package/src/utils/form.ts +266 -0
- package/src/utils/useAddField.ts +40 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.json +9 -0
- package/vite.config.ts +27 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
.m-form-dialog .el-dialog__body {
|
|
2
|
+
padding: 0 !important;
|
|
3
|
+
}
|
|
4
|
+
.m-form-dialog .m-dialog-body {
|
|
5
|
+
padding: 0 20px;
|
|
6
|
+
}
|
|
7
|
+
.m-form-dialog .el-table .m-form-item .el-form-item {
|
|
8
|
+
margin-bottom: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.fade-enter-active,
|
|
12
|
+
.fade-leave-active {
|
|
13
|
+
transition: opacity 0.5s;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.fade-enter, .fade-leave-to {
|
|
17
|
+
opacity: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.m-form,
|
|
21
|
+
.m-form-panel.el-card .el-card__body {
|
|
22
|
+
color: #333;
|
|
23
|
+
background-color: #fff;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.m-form .m-form-tip {
|
|
27
|
+
color: rgba(0, 0, 0, 0.45);
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
transition: color 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.m-form .m-form-schematic {
|
|
33
|
+
max-width: 50%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.el-table .cell > div.m-form-container {
|
|
38
|
+
display: block;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.magic-datetime-picker-popper .el-picker-panel__footer button:first-child {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
div.m-fields-link {
|
|
46
|
+
width: fit-content;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
fieldset.m-fieldset {
|
|
50
|
+
position: relative;
|
|
51
|
+
border: 1px solid #e5e5e5;
|
|
52
|
+
margin-top: 10px;
|
|
53
|
+
margin-bottom: 10px;
|
|
54
|
+
min-inline-size: auto;
|
|
55
|
+
}
|
|
56
|
+
fieldset.m-fieldset legend {
|
|
57
|
+
font-size: 14px;
|
|
58
|
+
position: absolute;
|
|
59
|
+
border: 0;
|
|
60
|
+
top: -10px;
|
|
61
|
+
left: 20px;
|
|
62
|
+
background: white;
|
|
63
|
+
width: auto;
|
|
64
|
+
padding: 0px 3px;
|
|
65
|
+
font-weight: bold;
|
|
66
|
+
line-height: 20px;
|
|
67
|
+
}
|
|
68
|
+
fieldset.m-fieldset .m-form-tip {
|
|
69
|
+
margin-left: 5px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.m-fields-group-list .el-button--text {
|
|
73
|
+
padding: 0;
|
|
74
|
+
margin-bottom: 7px;
|
|
75
|
+
}
|
|
76
|
+
.m-fields-group-list .el-tree-node__expand-icon {
|
|
77
|
+
padding: 0;
|
|
78
|
+
margin-bottom: 7px;
|
|
79
|
+
}
|
|
80
|
+
.m-fields-group-list .el-tree-node__expand-icon.expand {
|
|
81
|
+
transform: rotate(90deg);
|
|
82
|
+
}
|
|
83
|
+
.m-fields-group-list .m-fields-group-list-item {
|
|
84
|
+
border-bottom: 1px solid #ebeef5;
|
|
85
|
+
margin-bottom: 7px;
|
|
86
|
+
}
|
|
87
|
+
.m-fields-group-list .m-fields-group-list-item:last-of-type {
|
|
88
|
+
border-bottom: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.m-form-panel .el-card__header:hover {
|
|
92
|
+
background: #f2f6fc;
|
|
93
|
+
}
|
|
94
|
+
.m-form-panel .el-card__header a {
|
|
95
|
+
color: #409eff;
|
|
96
|
+
}
|
|
97
|
+
.m-form-panel .el-card__body {
|
|
98
|
+
padding: 10px;
|
|
99
|
+
}
|
|
100
|
+
.m-form-panel .m-form-tip {
|
|
101
|
+
margin-left: 5px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.m-fields-table {
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
.m-fields-table.fixed {
|
|
108
|
+
position: fixed;
|
|
109
|
+
top: 0;
|
|
110
|
+
right: 0;
|
|
111
|
+
left: 0;
|
|
112
|
+
bottom: 0;
|
|
113
|
+
z-index: 100;
|
|
114
|
+
}
|
|
115
|
+
.m-fields-table.fixed::before {
|
|
116
|
+
content: " ";
|
|
117
|
+
display: block;
|
|
118
|
+
background: rgba(0, 0, 0, 0.5);
|
|
119
|
+
position: fixed;
|
|
120
|
+
top: 0;
|
|
121
|
+
right: 0;
|
|
122
|
+
left: 0;
|
|
123
|
+
bottom: 0;
|
|
124
|
+
z-index: 100;
|
|
125
|
+
}
|
|
126
|
+
.m-fields-table.fixed > .el-form-item__content {
|
|
127
|
+
z-index: 101;
|
|
128
|
+
position: relative;
|
|
129
|
+
margin: 10vh auto;
|
|
130
|
+
max-width: fit-content;
|
|
131
|
+
}
|
|
132
|
+
.m-fields-table.fixed table {
|
|
133
|
+
width: 95vw !important;
|
|
134
|
+
}
|
|
135
|
+
.m-fields-table th {
|
|
136
|
+
background-color: #f2f2f2 !important;
|
|
137
|
+
color: #333 !important;
|
|
138
|
+
}
|
|
139
|
+
.m-fields-table .el-table td,
|
|
140
|
+
.m-fields-table .el-table th {
|
|
141
|
+
padding: 0 !important;
|
|
142
|
+
}
|
|
143
|
+
.m-fields-table .el-table__column--dropable {
|
|
144
|
+
cursor: move;
|
|
145
|
+
}
|
|
146
|
+
.m-fields-table .el-form-item__content .el-input-group {
|
|
147
|
+
vertical-align: middle;
|
|
148
|
+
}
|
|
149
|
+
.m-fields-table.m-fields-table-item-extra tr.expanded td {
|
|
150
|
+
border-bottom: 0;
|
|
151
|
+
}
|
|
152
|
+
.m-fields-table .el-table__expanded-cell .m-form-tip {
|
|
153
|
+
margin-left: 80px;
|
|
154
|
+
}
|
|
155
|
+
.m-fields-table .el-form-item {
|
|
156
|
+
margin-bottom: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.m-select {
|
|
160
|
+
width: 100%;
|
|
161
|
+
}
|