@stonecrop/atable 0.13.14 → 0.14.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/README.md +12 -11
- package/dist/assets/index.css +1 -1
- package/dist/atable.d.ts +533 -20
- package/dist/atable.js +1557 -1552
- package/dist/atable.js.map +1 -1
- package/dist/probe.tsbuildinfo +1 -0
- package/dist/src/icons/index.d.ts.map +1 -1
- package/dist/src/icons/index.js +5 -0
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -3
- package/dist/src/schemaToColumns.d.ts +2 -2
- package/dist/src/schemaToColumns.d.ts.map +1 -1
- package/dist/src/schemaToColumns.js +7 -10
- package/dist/src/stores/table.d.ts +523 -12
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/stores/table.js +17 -12
- package/dist/src/types/index.d.ts +14 -3
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/components/ACell.vue +12 -10
- package/src/components/ARow.vue +61 -11
- package/src/components/ARowActions.vue +43 -15
- package/src/components/ATable.vue +18 -2
- package/src/components/ATableColumnFilter.vue +19 -18
- package/src/components/ATableHeader.vue +0 -2
- package/src/components/ATableModal.vue +0 -2
- package/src/icons/index.ts +8 -0
- package/src/index.ts +0 -3
- package/src/schemaToColumns.ts +7 -9
- package/src/stores/table.ts +14 -12
- package/src/types/index.ts +16 -3
- package/src/components/AExpansionRow.vue +0 -105
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Fields are excluded when:
|
|
5
5
|
* - `hidden: true` — field should not be visible in any view
|
|
6
|
-
* - no `
|
|
6
|
+
* - no `component` — non-scalar entry (nested table or fieldset), no column equivalent
|
|
7
7
|
*
|
|
8
8
|
* `fieldname` is renamed to `name`; `hidden` is stripped. All other `ColumnSchema` properties
|
|
9
9
|
* spread through automatically.
|
|
10
10
|
*
|
|
11
|
-
* For
|
|
11
|
+
* For link fields (those carrying `doctype`) without an explicit `cellComponent`:
|
|
12
12
|
* - `linkDoctype` is set from the field's `doctype` property (used by ACell's async resolver).
|
|
13
13
|
* - A synchronous `format` function is added (unless the field already has one) that handles
|
|
14
14
|
* both bare ID strings and pre-resolved `{ id, displayText }` objects.
|
|
@@ -17,16 +17,13 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export function schemaToColumns(schema) {
|
|
19
19
|
return schema
|
|
20
|
-
.filter(f => !f.hidden && f.
|
|
20
|
+
.filter(f => !f.hidden && f.component)
|
|
21
21
|
.map(({ fieldname, hidden: _hidden, ...rest }) => {
|
|
22
22
|
const col = Object.assign({ name: fieldname }, rest);
|
|
23
|
-
// Link fields: store the linked doctype for async resolution by ACell,
|
|
24
|
-
//
|
|
25
|
-
if (rest.
|
|
26
|
-
|
|
27
|
-
const linkedDoctype = typeof fields.doctype === 'string' ? fields.doctype : undefined;
|
|
28
|
-
if (linkedDoctype)
|
|
29
|
-
col.linkDoctype = linkedDoctype;
|
|
23
|
+
// Link fields: store the linked doctype for async resolution by ACell, and add a sync
|
|
24
|
+
// format that handles pre-resolved AFormLinkValue objects.
|
|
25
|
+
if (rest.doctype && !rest.cellComponent) {
|
|
26
|
+
col.linkDoctype = rest.doctype;
|
|
30
27
|
if (!rest.format) {
|
|
31
28
|
col.format = (v) => {
|
|
32
29
|
if (v === null || v === undefined)
|