@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.
@@ -103,7 +103,7 @@ export type FormSchema = BaseSchema & {
103
103
  * Align the field in the form
104
104
  * @beta
105
105
  */
106
- align?: string
106
+ align?: CanvasTextAlign
107
107
 
108
108
  /**
109
109
  * Indicate whether the field is editable
@@ -184,7 +184,7 @@ export type FieldsetSchema = BaseSchema & {
184
184
  * The schemas to be rendered inside the fieldset
185
185
  * @public
186
186
  */
187
- schema?: (FormSchema | TableSchema)[]
187
+ schema?: SchemaTypes[]
188
188
 
189
189
  /**
190
190
  * Indicate whether the fieldset is collapsible
@@ -193,134 +193,8 @@ export type FieldsetSchema = BaseSchema & {
193
193
  collapsible?: boolean
194
194
  }
195
195
 
196
- /**
197
- * Schema structure for a 1:1 nested doctype field inside AForm
198
- *
199
- * @remarks
200
- * When a field has `fieldtype: 'Doctype'` without `cardinality: 'many'`, it represents
201
- * a 1:1 nested form. The `options` property contains the slug of the referenced doctype.
202
- * The `schema` property is populated by the framework's `registry.resolveSchema()` method
203
- * with the resolved child schema fields.
204
- *
205
- * Before resolution: `{ fieldname: 'address', fieldtype: 'Doctype', options: 'address' }`
206
- * After resolution: `{ fieldname: 'address', fieldtype: 'Doctype', options: 'address', schema: [...resolved fields...] }`
207
- *
208
- * Users can also manually provide the `schema` property without using the framework registry.
209
- *
210
- * @public
211
- */
212
- export type DoctypeOneSchema = BaseSchema & {
213
- /**
214
- * The field type - must be 'Doctype' for nested doctype fields
215
- * @public
216
- */
217
- fieldtype: 'Doctype'
218
-
219
- /**
220
- * The slug of the referenced doctype in the registry
221
- * @public
222
- */
223
- options: string
224
-
225
- /**
226
- * The label to display above the nested form section
227
- * @public
228
- */
229
- label?: string
230
-
231
- /**
232
- * The cardinality of the relationship — `'one'` or omitted means 1:1 nested form
233
- * @public
234
- */
235
- cardinality?: 'one'
236
-
237
- /**
238
- * The resolved child schema fields, populated by `registry.resolveSchema()`
239
- * or provided manually for standalone usage
240
- * @public
241
- */
242
- schema?: SchemaTypes[]
243
- }
244
-
245
- /**
246
- * Schema structure for a 1:many child table field inside AForm
247
- *
248
- * @remarks
249
- * When a field has `fieldtype: 'Doctype'` with `cardinality: 'many'`, it represents
250
- * a 1:many child table. The `options` property contains the slug of the child doctype
251
- * whose records appear as table rows.
252
- *
253
- * `Registry.resolveSchema()` auto-derives `columns` from the child doctype's schema
254
- * fields and sets sensible defaults for `component` (`'ATable'`) and `config` (`{ view: 'list' }`).
255
- *
256
- * Users can override any auto-derived property by specifying it explicitly on the schema field.
257
- * Row data comes from the parent form's data model at `data[fieldname]` (an array).
258
- *
259
- * @public
260
- */
261
- export type DoctypeManySchema = BaseSchema & {
262
- /**
263
- * The field type - must be 'Doctype' for nested doctype fields
264
- * @public
265
- */
266
- fieldtype: 'Doctype'
267
-
268
- /**
269
- * The slug of the child doctype in the registry
270
- * @public
271
- */
272
- options: string
273
-
274
- /**
275
- * The label to display above the table section
276
- * @public
277
- */
278
- label?: string
279
-
280
- /**
281
- * The cardinality of the relationship — `'many'` means 1:many child table
282
- * @public
283
- */
284
- cardinality: 'many'
285
-
286
- /**
287
- * Table columns — auto-derived from child doctype schema if not provided
288
- * @public
289
- */
290
- columns?: TableColumn[]
291
-
292
- /**
293
- * Table configuration — defaults to `{ view: 'list' }` if not provided
294
- * @public
295
- */
296
- config?: TableConfig
297
-
298
- /**
299
- * Table rows — populated from the parent form's data model at `data[fieldname]`
300
- * @public
301
- */
302
- rows?: TableRow[]
303
-
304
- /**
305
- * The component to render — defaults to `'ATable'` when resolved
306
- * @public
307
- */
308
- component?: string
309
- }
310
-
311
- /**
312
- * Discriminated union for Doctype fields — either 1:1 nested form or 1:many child table
313
- *
314
- * @remarks
315
- * Use `isDoctypeMany()` type guard to narrow to `DoctypeManySchema`.
316
- * When `cardinality` is `'many'` or omitted, the field is a 1:1 nested form.
317
- *
318
- * @public
319
- */
320
- export type DoctypeSchema = DoctypeOneSchema | DoctypeManySchema
321
-
322
196
  /**
323
197
  * Superset of all schema types for AForm
324
198
  * @public
325
199
  */
326
- export type SchemaTypes = FormSchema | TableSchema | FieldsetSchema | DoctypeSchema
200
+ export type SchemaTypes = FormSchema | TableSchema | FieldsetSchema
@@ -1,6 +0,0 @@
1
- /*
2
-
3
- Import custom themes here, e.g.
4
- @import url('purple_theme.css');
5
-
6
- */
@@ -1,84 +0,0 @@
1
- /* Styles for all types of fields: Text and Number Inputs, Radios, Checkboxes, etc. */
2
- /* .form-element {
3
- min-width: 40ch;
4
- border: 1px solid transparent;
5
- padding: 0;
6
- margin: 0;
7
- margin-right: 0.5rem;
8
- margin-bottom: 0.5rem;
9
- } */
10
- /* .input-field {
11
- outline: 1px solid transparent;
12
- border: 1px solid var(--sc-input-border-color);
13
- padding: 0.25rem;
14
- margin: 0 0 0 0;
15
- border-radius: 0 0 0.25rem 0.25rem;
16
- box-sizing: border-box;
17
- width: 100%;
18
- }
19
- .field-label {
20
- color: var(--sc-input-label-color);
21
- display: block;
22
- min-height: 1.15rem;
23
- padding: 0.25rem;
24
- margin: 0rem;
25
- z-index: 2;
26
- font-size: 1rem;
27
- font-weight: bold;
28
- background: white;
29
- width: 100%;
30
- box-sizing: border-box;
31
- background: var(--sc-gray-5);
32
- border: 1px solid var(--sc-input-border-color);
33
- border-bottom: none;
34
- }
35
- p.error {
36
- display: block;
37
- min-height: 1.15rem;
38
- padding: 0rem;
39
- padding-left: 0.5rem;
40
- margin: 0.5rem 0 0.25rem 0rem;
41
- border: 1px solid transparent;
42
- width: 100%;
43
- color: var(--sc-brand-danger);
44
- font-size: 0.8rem;
45
- }
46
-
47
- .input-field:focus {
48
- border: 1px solid var(--sc-input-active-border-color);
49
- }
50
-
51
- .input-field:focus + .field-label {
52
- color: var(--sc-input-active-label-color);
53
- }
54
-
55
- /** CHECKBOX **/
56
- /* .checkbox {
57
- visibility: hidden;
58
- display: none;
59
- }
60
-
61
- .checkbox + .custom-checkbox:before {
62
- content: '⬡';
63
- font-size: 1.2rem;
64
- cursor: pointer;
65
- margin-right: 0.25rem;
66
- }
67
-
68
- .checkbox:checked + .custom-checkbox:before {
69
- content: '⬣';
70
- }
71
-
72
- .custom-checkbox {
73
- display: inline-block;
74
- line-height: 0;
75
- }
76
-
77
- .checkbox-container {
78
- width: 100%;
79
- display: inline-block;
80
- }
81
-
82
- .checkbox-container:hover + .field-label {
83
- color: var(--sc-input-active-label-color);
84
- } */
@@ -1,2 +0,0 @@
1
- @import url('@stonecrop/themes/default.css');
2
- @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
@@ -1,9 +0,0 @@
1
- @import url('https://fonts.googleapis.com/css2?family=Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');
2
-
3
- :root {
4
- --sc-primary-color: #645caa;
5
- }
6
-
7
- :root [data-theme='purple'] {
8
- --sc-row-color-zebra-light: #ebc7e8;
9
- }