@stonecrop/aform 0.3.4 → 0.3.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/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
- * Base schemda for AForm components
36
- * @beta
35
+ * Basic field structure for AForm schemas
36
+ * @public
37
37
  */
38
- export declare type BasicSchema = {
39
- component: string;
38
+ export declare type BaseSchema = {
39
+ /**
40
+ * The fieldname for the schema field
41
+ * @public
42
+ */
40
43
  fieldname: string;
41
- value: any;
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
- * Fieldset schema
58
- * @beta
74
+ * Schema structure for defining fieldsets inside AForm
75
+ * @public
59
76
  */
60
- export declare type FieldsetSchema = BasicSchema & {
61
- label: string;
62
- schema: (FormSchema | TableSchema)[];
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
- * Form schema
68
- * @beta
96
+ * Schema structure for defining forms inside AForm
97
+ * @public
69
98
  */
70
- export declare type FormSchema = BasicSchema & {
71
- align: string;
72
- edit: boolean;
73
- fieldtype: string;
74
- label: string;
75
- name: string;
76
- width: string;
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
- * @beta
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
- * Table schema
157
- * @beta
224
+ * Schema structure for defining tables inside AForm
225
+ * @public
158
226
  */
159
- export declare type TableSchema = BasicSchema & {
160
- columns: TableColumn[];
161
- config: TableConfig;
162
- rows: TableRow[];
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 { }