@stonecrop/aform 0.7.9 → 0.8.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 +98 -1
- package/dist/aform.js +2594 -503
- 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/index.js +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +96 -1
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +5 -7
- package/src/components/AForm.vue +108 -39
- package/src/components/form/AFieldset.vue +1 -1
- package/src/index.ts +2 -0
- package/src/types/index.ts +108 -1
package/dist/aform.d.ts
CHANGED
|
@@ -1138,6 +1138,50 @@ updateGanttBar: (event: GanttDragEvent) => void;
|
|
|
1138
1138
|
updateRows: (newRows: TableRow[]) => void;
|
|
1139
1139
|
}, "clearFilter" | "closeModal" | "createConnection" | "deleteConnection" | "getCellData" | "getCellDisplayValue" | "getConnectionsForBar" | "getFormattedValue" | "getHandlesForBar" | "getHeaderCellStyle" | "getIndent" | "getRowExpandSymbol" | "isRowGantt" | "isRowVisible" | "registerConnectionHandle" | "registerGanttBar" | "resizeColumn" | "setCellData" | "setCellText" | "setFilter" | "sortByColumn" | "toggleRowExpand" | "unregisterConnectionHandle" | "unregisterGanttBar" | "updateGanttBar" | "updateRows">>;
|
|
1140
1140
|
|
|
1141
|
+
/**
|
|
1142
|
+
* Schema structure for defining nested doctype fields inside AForm
|
|
1143
|
+
*
|
|
1144
|
+
* @remarks
|
|
1145
|
+
* When a field has `fieldtype: 'Doctype'`, the `options` property contains the slug
|
|
1146
|
+
* of the referenced doctype. The `schema` property is populated by the framework's
|
|
1147
|
+
* `registry.resolveSchema()` method with the resolved child schema fields.
|
|
1148
|
+
*
|
|
1149
|
+
* Before resolution: `{ fieldname: 'address', fieldtype: 'Doctype', options: 'address' }`
|
|
1150
|
+
* After resolution: `{ fieldname: 'address', fieldtype: 'Doctype', options: 'address', schema: [...resolved fields...] }`
|
|
1151
|
+
*
|
|
1152
|
+
* Users can also manually provide the `schema` property without using the framework registry.
|
|
1153
|
+
*
|
|
1154
|
+
* @public
|
|
1155
|
+
*/
|
|
1156
|
+
export declare type DoctypeSchema = BaseSchema & {
|
|
1157
|
+
/**
|
|
1158
|
+
* The field type - must be 'Doctype' for nested doctype fields
|
|
1159
|
+
* @public
|
|
1160
|
+
*/
|
|
1161
|
+
fieldtype: 'Doctype';
|
|
1162
|
+
/**
|
|
1163
|
+
* The slug of the referenced doctype in the registry
|
|
1164
|
+
* @public
|
|
1165
|
+
*/
|
|
1166
|
+
options: string;
|
|
1167
|
+
/**
|
|
1168
|
+
* The label to display above the nested form section
|
|
1169
|
+
* @public
|
|
1170
|
+
*/
|
|
1171
|
+
label?: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* The resolved child schema fields, populated by `registry.resolveSchema()`
|
|
1174
|
+
* or provided manually for standalone usage
|
|
1175
|
+
* @public
|
|
1176
|
+
*/
|
|
1177
|
+
schema?: SchemaTypes[];
|
|
1178
|
+
/**
|
|
1179
|
+
* Indicate whether the nested form is read-only
|
|
1180
|
+
* @public
|
|
1181
|
+
*/
|
|
1182
|
+
readOnly?: boolean;
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1141
1185
|
/**
|
|
1142
1186
|
* Schema structure for defining fieldsets inside AForm
|
|
1143
1187
|
* @public
|
|
@@ -1367,7 +1411,7 @@ export { Login }
|
|
|
1367
1411
|
* Superset of all schema types for AForm
|
|
1368
1412
|
* @public
|
|
1369
1413
|
*/
|
|
1370
|
-
export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema;
|
|
1414
|
+
export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema | DoctypeSchema | TableDoctypeSchema;
|
|
1371
1415
|
|
|
1372
1416
|
/**
|
|
1373
1417
|
* Table column definition.
|
|
@@ -1603,6 +1647,59 @@ export declare interface TableDisplay {
|
|
|
1603
1647
|
rowModified?: boolean;
|
|
1604
1648
|
}
|
|
1605
1649
|
|
|
1650
|
+
/**
|
|
1651
|
+
* Schema structure for defining 1:many child table fields inside AForm
|
|
1652
|
+
*
|
|
1653
|
+
* @remarks
|
|
1654
|
+
* When a field has `fieldtype: 'Table'`, the `options` property contains the slug
|
|
1655
|
+
* of the child doctype whose records appear as table rows.
|
|
1656
|
+
*
|
|
1657
|
+
* `Registry.resolveSchema()` auto-derives `columns` from the child doctype's schema
|
|
1658
|
+
* fields and sets sensible defaults for `component` (`'ATable'`) and `config` (`{ view: 'list' }`).
|
|
1659
|
+
*
|
|
1660
|
+
* Users can override any auto-derived property by specifying it explicitly on the schema field.
|
|
1661
|
+
* Row data comes from the parent form's data model at `data[fieldname]` (an array).
|
|
1662
|
+
*
|
|
1663
|
+
* @public
|
|
1664
|
+
*/
|
|
1665
|
+
export declare type TableDoctypeSchema = BaseSchema & {
|
|
1666
|
+
/**
|
|
1667
|
+
* The field type — must be 'Table' for 1:many child table fields
|
|
1668
|
+
* @public
|
|
1669
|
+
*/
|
|
1670
|
+
fieldtype: 'Table';
|
|
1671
|
+
/**
|
|
1672
|
+
* The slug of the child doctype in the registry
|
|
1673
|
+
* @public
|
|
1674
|
+
*/
|
|
1675
|
+
options: string;
|
|
1676
|
+
/**
|
|
1677
|
+
* The label to display above the table section
|
|
1678
|
+
* @public
|
|
1679
|
+
*/
|
|
1680
|
+
label?: string;
|
|
1681
|
+
/**
|
|
1682
|
+
* Table columns — auto-derived from child doctype schema if not provided
|
|
1683
|
+
* @public
|
|
1684
|
+
*/
|
|
1685
|
+
columns?: TableColumn[];
|
|
1686
|
+
/**
|
|
1687
|
+
* Table configuration — defaults to `{ view: 'list' }` if not provided
|
|
1688
|
+
* @public
|
|
1689
|
+
*/
|
|
1690
|
+
config?: TableConfig;
|
|
1691
|
+
/**
|
|
1692
|
+
* Table rows — populated from the parent form's data model at `data[fieldname]`
|
|
1693
|
+
* @public
|
|
1694
|
+
*/
|
|
1695
|
+
rows?: TableRow[];
|
|
1696
|
+
/**
|
|
1697
|
+
* Indicate whether the table is read-only
|
|
1698
|
+
* @public
|
|
1699
|
+
*/
|
|
1700
|
+
readOnly?: boolean;
|
|
1701
|
+
};
|
|
1702
|
+
|
|
1606
1703
|
/**
|
|
1607
1704
|
* Table modal definition.
|
|
1608
1705
|
* @public
|