@stonecrop/aform 0.10.16 → 0.11.0

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
@@ -113,121 +113,6 @@ export declare type ComponentProps = {
113
113
  };
114
114
  };
115
115
 
116
- /**
117
- * Schema structure for a 1:many child table field inside AForm
118
- *
119
- * @remarks
120
- * When a field has `fieldtype: 'Doctype'` with `cardinality: 'many'`, it represents
121
- * a 1:many child table. The `options` property contains the slug of the child doctype
122
- * whose records appear as table rows.
123
- *
124
- * `Registry.resolveSchema()` auto-derives `columns` from the child doctype's schema
125
- * fields and sets sensible defaults for `component` (`'ATable'`) and `config` (`{ view: 'list' }`).
126
- *
127
- * Users can override any auto-derived property by specifying it explicitly on the schema field.
128
- * Row data comes from the parent form's data model at `data[fieldname]` (an array).
129
- *
130
- * @public
131
- */
132
- export declare type DoctypeManySchema = BaseSchema & {
133
- /**
134
- * The field type - must be 'Doctype' for nested doctype fields
135
- * @public
136
- */
137
- fieldtype: 'Doctype';
138
- /**
139
- * The slug of the child doctype in the registry
140
- * @public
141
- */
142
- options: string;
143
- /**
144
- * The label to display above the table section
145
- * @public
146
- */
147
- label?: string;
148
- /**
149
- * The cardinality of the relationship — `'many'` means 1:many child table
150
- * @public
151
- */
152
- cardinality: 'many';
153
- /**
154
- * Table columns — auto-derived from child doctype schema if not provided
155
- * @public
156
- */
157
- columns?: TableColumn[];
158
- /**
159
- * Table configuration — defaults to `{ view: 'list' }` if not provided
160
- * @public
161
- */
162
- config?: TableConfig;
163
- /**
164
- * Table rows — populated from the parent form's data model at `data[fieldname]`
165
- * @public
166
- */
167
- rows?: TableRow[];
168
- /**
169
- * The component to render — defaults to `'ATable'` when resolved
170
- * @public
171
- */
172
- component?: string;
173
- };
174
-
175
- /**
176
- * Schema structure for a 1:1 nested doctype field inside AForm
177
- *
178
- * @remarks
179
- * When a field has `fieldtype: 'Doctype'` without `cardinality: 'many'`, it represents
180
- * a 1:1 nested form. The `options` property contains the slug of the referenced doctype.
181
- * The `schema` property is populated by the framework's `registry.resolveSchema()` method
182
- * with the resolved child schema fields.
183
- *
184
- * Before resolution: `{ fieldname: 'address', fieldtype: 'Doctype', options: 'address' }`
185
- * After resolution: `{ fieldname: 'address', fieldtype: 'Doctype', options: 'address', schema: [...resolved fields...] }`
186
- *
187
- * Users can also manually provide the `schema` property without using the framework registry.
188
- *
189
- * @public
190
- */
191
- export declare type DoctypeOneSchema = BaseSchema & {
192
- /**
193
- * The field type - must be 'Doctype' for nested doctype fields
194
- * @public
195
- */
196
- fieldtype: 'Doctype';
197
- /**
198
- * The slug of the referenced doctype in the registry
199
- * @public
200
- */
201
- options: string;
202
- /**
203
- * The label to display above the nested form section
204
- * @public
205
- */
206
- label?: string;
207
- /**
208
- * The cardinality of the relationship — `'one'` or omitted means 1:1 nested form
209
- * @public
210
- */
211
- cardinality?: 'one';
212
- /**
213
- * The resolved child schema fields, populated by `registry.resolveSchema()`
214
- * or provided manually for standalone usage
215
- * @public
216
- */
217
- schema?: SchemaTypes[];
218
- };
219
-
220
- /**
221
- * Discriminated union for Doctype fields — either 1:1 nested form or 1:many child table
222
- *
223
- * @remarks
224
- * Use `isDoctypeMany()` type guard to narrow to `DoctypeManySchema`.
225
- * When `cardinality` is `'many'` or omitted, the field is a 1:1 nested form.
226
- *
227
- * @public
228
- */
229
- export declare type DoctypeSchema = DoctypeOneSchema | DoctypeManySchema;
230
-
231
116
  /**
232
117
  * Schema structure for defining fieldsets inside AForm
233
118
  * @public
@@ -242,7 +127,7 @@ export declare type FieldsetSchema = BaseSchema & {
242
127
  * The schemas to be rendered inside the fieldset
243
128
  * @public
244
129
  */
245
- schema?: (FormSchema | TableSchema)[];
130
+ schema?: SchemaTypes[];
246
131
  /**
247
132
  * Indicate whether the fieldset is collapsible
248
133
  * @public
@@ -265,7 +150,7 @@ export declare type FormSchema = BaseSchema & {
265
150
  * Align the field in the form
266
151
  * @beta
267
152
  */
268
- align?: string;
153
+ align?: CanvasTextAlign;
269
154
  /**
270
155
  * Indicate whether the field is editable
271
156
  * @beta
@@ -308,22 +193,13 @@ export declare type FormSchema = BaseSchema & {
308
193
  */
309
194
  export declare function install(app: App): void;
310
195
 
311
- /**
312
- * Type guard that checks whether a Doctype schema field has `cardinality: 'many'`
313
- *
314
- * @param field - A DoctypeSchema field to check
315
- * @returns `true` if the field has `cardinality: 'many'`
316
- * @public
317
- */
318
- export declare function isDoctypeMany(field: DoctypeSchema): field is DoctypeManySchema;
319
-
320
196
  export { Login }
321
197
 
322
198
  /**
323
199
  * Superset of all schema types for AForm
324
200
  * @public
325
201
  */
326
- export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema | DoctypeSchema;
202
+ export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema;
327
203
 
328
204
  /**
329
205
  * Schema structure for defining tables inside AForm