@stonecrop/aform 0.3.4 → 0.3.6
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/aform.d.ts +108 -28
- package/dist/aform.js +423 -419
- package/dist/aform.js.map +1 -1
- package/dist/aform.umd.cjs +2 -2
- package/dist/aform.umd.cjs.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/directives/mask.js +33 -0
- package/dist/index.js +0 -4
- package/dist/src/directives/mask.d.ts +7 -0
- package/dist/src/directives/mask.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +144 -28
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/form/ACheckbox.vue +8 -1
- package/src/components/form/ADate.vue +1 -0
- package/src/components/form/ADatePicker.vue +2 -0
- package/src/components/form/AFieldset.vue +2 -0
- package/src/components/form/ANumericInput.vue +8 -1
- package/src/components/form/ATextInput.vue +9 -1
- package/src/directives/mask.ts +34 -1
- package/src/index.ts +2 -6
- package/src/types/index.ts +163 -28
package/dist/aform.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import AFieldset from './components/form/AFieldset.vue';
|
|
|
7
7
|
import AFileAttach from './components/form/AFileAttach.vue';
|
|
8
8
|
import AForm from './components/AForm.vue';
|
|
9
9
|
import ANumericInput from './components/form/ANumericInput.vue';
|
|
10
|
-
import { App } from 'vue';
|
|
10
|
+
import type { App } from 'vue';
|
|
11
11
|
import ATextInput from './components/form/ATextInput.vue';
|
|
12
12
|
import Login from './components/utilities/Login.vue';
|
|
13
13
|
|
|
@@ -32,13 +32,30 @@ export { ANumericInput }
|
|
|
32
32
|
export { ATextInput }
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @
|
|
35
|
+
* Basic field structure for AForm schemas
|
|
36
|
+
* @public
|
|
37
37
|
*/
|
|
38
|
-
export declare type
|
|
39
|
-
|
|
38
|
+
export declare type BaseSchema = {
|
|
39
|
+
/**
|
|
40
|
+
* The fieldname for the schema field
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
40
43
|
fieldname: string;
|
|
41
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The component to render
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* This must be a string that represents the component to render. The registration of the component
|
|
49
|
+
* should be done in the main application.
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
component?: string;
|
|
54
|
+
/**
|
|
55
|
+
* A placeholder value for the field
|
|
56
|
+
* @beta
|
|
57
|
+
*/
|
|
58
|
+
value?: any;
|
|
42
59
|
};
|
|
43
60
|
|
|
44
61
|
/**
|
|
@@ -54,26 +71,77 @@ export declare type CellContext = {
|
|
|
54
71
|
};
|
|
55
72
|
|
|
56
73
|
/**
|
|
57
|
-
*
|
|
58
|
-
* @
|
|
74
|
+
* Schema structure for defining fieldsets inside AForm
|
|
75
|
+
* @public
|
|
59
76
|
*/
|
|
60
|
-
export declare type FieldsetSchema =
|
|
61
|
-
|
|
62
|
-
|
|
77
|
+
export declare type FieldsetSchema = BaseSchema & {
|
|
78
|
+
/**
|
|
79
|
+
* The label to display in the fieldset
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
label?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The schemas to be rendered inside the fieldset
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
schema?: (FormSchema | TableSchema)[];
|
|
88
|
+
/**
|
|
89
|
+
* Indicate whether the fieldset is collapsible
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
63
92
|
collapsible?: boolean;
|
|
64
93
|
};
|
|
65
94
|
|
|
66
95
|
/**
|
|
67
|
-
*
|
|
68
|
-
* @
|
|
96
|
+
* Schema structure for defining forms inside AForm
|
|
97
|
+
* @public
|
|
69
98
|
*/
|
|
70
|
-
export declare type FormSchema =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
99
|
+
export declare type FormSchema = BaseSchema & {
|
|
100
|
+
/**
|
|
101
|
+
* Align the field in the form
|
|
102
|
+
* @beta
|
|
103
|
+
*/
|
|
104
|
+
align?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Indicate whether the field is editable
|
|
107
|
+
* @beta
|
|
108
|
+
*/
|
|
109
|
+
edit?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The field type for the schema field
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* This must be a string that represents the field type. A mask string will be automatically
|
|
115
|
+
* applied for the following field types:
|
|
116
|
+
* - Date ('##/##/####')
|
|
117
|
+
* - Datetime ('####/##/## ##:##')
|
|
118
|
+
* - Time ('##:##')
|
|
119
|
+
* - Fulltime ('##:##:##')
|
|
120
|
+
* - Phone ('(###) ### - ####')
|
|
121
|
+
* - Card ('#### #### #### ####')
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
fieldtype?: string;
|
|
126
|
+
/**
|
|
127
|
+
* The label to display in the form
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
label?: string;
|
|
131
|
+
/**
|
|
132
|
+
* The unique identifier for the field
|
|
133
|
+
* @beta
|
|
134
|
+
*/
|
|
135
|
+
name?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The width of the field element.
|
|
138
|
+
* @beta
|
|
139
|
+
*/
|
|
140
|
+
width?: string;
|
|
141
|
+
/**
|
|
142
|
+
* The mask string for the field
|
|
143
|
+
* @beta
|
|
144
|
+
*/
|
|
77
145
|
mask?: string;
|
|
78
146
|
};
|
|
79
147
|
|
|
@@ -87,8 +155,8 @@ export declare function install(app: App): void;
|
|
|
87
155
|
export { Login }
|
|
88
156
|
|
|
89
157
|
/**
|
|
90
|
-
* Superset of schema types
|
|
91
|
-
* @
|
|
158
|
+
* Superset of all schema types for AForm
|
|
159
|
+
* @public
|
|
92
160
|
*/
|
|
93
161
|
export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema;
|
|
94
162
|
|
|
@@ -153,13 +221,25 @@ export declare type TableRow = {
|
|
|
153
221
|
};
|
|
154
222
|
|
|
155
223
|
/**
|
|
156
|
-
*
|
|
157
|
-
* @
|
|
224
|
+
* Schema structure for defining tables inside AForm
|
|
225
|
+
* @public
|
|
158
226
|
*/
|
|
159
|
-
export declare type TableSchema =
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
227
|
+
export declare type TableSchema = BaseSchema & {
|
|
228
|
+
/**
|
|
229
|
+
* The columns to display in the table
|
|
230
|
+
* @public
|
|
231
|
+
*/
|
|
232
|
+
columns?: TableColumn[];
|
|
233
|
+
/**
|
|
234
|
+
* The configuration for the table
|
|
235
|
+
* @public
|
|
236
|
+
*/
|
|
237
|
+
config?: TableConfig;
|
|
238
|
+
/**
|
|
239
|
+
* The rows to display in the table
|
|
240
|
+
* @public
|
|
241
|
+
*/
|
|
242
|
+
rows?: TableRow[];
|
|
163
243
|
};
|
|
164
244
|
|
|
165
245
|
export { }
|