@stonecrop/atable 0.13.14 → 0.15.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/icons/stonecrop-ui-icon-add.svg +5 -0
- package/dist/icons/stonecrop-ui-icon-delete.svg +5 -0
- package/dist/icons/stonecrop-ui-icon-duplicate.svg +5 -0
- package/dist/icons/stonecrop-ui-icon-insert-above.svg +15 -0
- package/dist/icons/stonecrop-ui-icon-insert-below.svg +15 -0
- package/dist/icons/stonecrop-ui-icon-move.svg +4 -0
- package/dist/icons/stonecrop-ui-icon-open.svg +5 -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/dist/themes/default.css +1 -0
- package/package.json +26 -24
- 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/dist/atable.umd.cjs +0 -51
- package/dist/atable.umd.cjs.map +0 -1
- package/dist/icons/index.js +0 -31
- package/dist/index.js +0 -31
- package/dist/src/tsdoc-metadata.json +0 -11
- package/dist/stores/table.js +0 -795
- package/dist/types/index.js +0 -0
- package/dist/utils.js +0 -7
- package/src/components/AExpansionRow.vue +0 -105
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
3
|
+
<path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
|
|
4
|
+
<polygon points="34 18 30 18 30 30 18 30 18 34 30 34 30 46 34 46 34 34 46 34 46 30 34 30 34 18" style="fill: #000; stroke-width: 0px;"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
3
|
+
<path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
|
|
4
|
+
<polygon points="46.84 19.99 44.01 17.16 32 29.17 19.99 17.16 17.16 19.99 29.17 32 17.16 44.01 19.99 46.84 32 34.83 44.01 46.84 46.84 44.01 34.83 32 46.84 19.99" style="fill: #000; stroke-width: 0px;"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.67">
|
|
3
|
+
<path d="M68.67,16.67h-14.67V2c0-1.1-.9-2-2-2H2C.9,0,0,.9,0,2v50c0,1.1.9,2,2,2h14.67v14.67c0,1.1.9,2,2,2h50c1.1,0,2-.9,2-2V18.67c0-1.1-.9-2-2-2ZM4,4h46v46H4V4ZM66.67,66.67H20.67v-12.67h31.33c1.1,0,2-.9,2-2v-31.33h12.67v46Z" style="fill: #000; stroke-width: 0px;"/>
|
|
4
|
+
<polygon points="41 25 29 25 29 13 25 13 25 25 13 25 13 29 25 29 25 41 29 41 29 29 41 29 41 25" style="fill: #000; stroke-width: 0px;"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
|
|
3
|
+
<path d="M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z"/>
|
|
4
|
+
<path d="M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z"/>
|
|
5
|
+
<g>
|
|
6
|
+
<polygon points="70.6 2.5 68.6 2.5 68.6 2 68.1 2 68.1 0 70.6 0 70.6 2.5"/>
|
|
7
|
+
<path d="M65.3,2h-2.9V0h2.9v2ZM59.6,2h-2.9V0h2.9v2ZM53.9,2h-2.9V0h2.9v2ZM48.2,2h-2.9V0h2.9v2ZM42.4,2h-2.9V0h2.9v2ZM36.7,2h-2.9V0h2.9v2ZM31,2h-2.9V0h2.9v2ZM25.3,2h-2.9V0h2.9v2ZM19.6,2h-2.9V0h2.9v2ZM13.9,2h-2.9V0h2.9v2ZM8.2,2h-2.9V0h2.9v2Z"/>
|
|
8
|
+
<polygon points="2 2.5 0 2.5 0 0 2.5 0 2.5 2 2 2 2 2.5"/>
|
|
9
|
+
<path d="M2,13.4H0v-2.7h2v2.7ZM2,8H0v-2.7h2v2.7Z"/>
|
|
10
|
+
<polygon points="2.5 18.7 0 18.7 0 16.2 2 16.2 2 16.7 2.5 16.7 2.5 18.7"/>
|
|
11
|
+
<path d="M65.3,18.7h-2.9v-2h2.9v2ZM59.6,18.7h-2.9v-2h2.9v2ZM53.9,18.7h-2.9v-2h2.9v2ZM48.2,18.7h-2.9v-2h2.9v2ZM42.4,18.7h-2.9v-2h2.9v2ZM36.7,18.7h-2.9v-2h2.9v2ZM31,18.7h-2.9v-2h2.9v2ZM25.3,18.7h-2.9v-2h2.9v2ZM19.6,18.7h-2.9v-2h2.9v2ZM13.9,18.7h-2.9v-2h2.9v2ZM8.2,18.7h-2.9v-2h2.9v2Z"/>
|
|
12
|
+
<polygon points="70.6 18.7 68.1 18.7 68.1 16.7 68.6 16.7 68.6 16.2 70.6 16.2 70.6 18.7"/>
|
|
13
|
+
<path d="M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z"/>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 70.6 61.5">
|
|
3
|
+
<g>
|
|
4
|
+
<polygon points="70.6 45.3 68.6 45.3 68.6 44.8 68.1 44.8 68.1 42.8 70.6 42.8 70.6 45.3"/>
|
|
5
|
+
<path d="M65.3,44.8h-2.9v-2h2.9v2ZM59.6,44.8h-2.9v-2h2.9v2ZM53.9,44.8h-2.9v-2h2.9v2ZM48.2,44.8h-2.9v-2h2.9v2ZM42.4,44.8h-2.9v-2h2.9v2ZM36.7,44.8h-2.9v-2h2.9v2ZM31,44.8h-2.9v-2h2.9v2ZM25.3,44.8h-2.9v-2h2.9v2ZM19.6,44.8h-2.9v-2h2.9v2ZM13.9,44.8h-2.9v-2h2.9v2ZM8.2,44.8h-2.9v-2h2.9v2Z"/>
|
|
6
|
+
<polygon points="2 45.3 0 45.3 0 42.8 2.5 42.8 2.5 44.8 2 44.8 2 45.3"/>
|
|
7
|
+
<path d="M2,56.3H0v-2.7h2v2.7ZM2,50.8H0v-2.7h2v2.7Z"/>
|
|
8
|
+
<polygon points="2.5 61.5 0 61.5 0 59 2 59 2 59.5 2.5 59.5 2.5 61.5"/>
|
|
9
|
+
<path d="M65.3,61.5h-2.9v-2h2.9v2ZM59.6,61.5h-2.9v-2h2.9v2ZM53.9,61.5h-2.9v-2h2.9v2ZM48.2,61.5h-2.9v-2h2.9v2ZM42.4,61.5h-2.9v-2h2.9v2ZM36.7,61.5h-2.9v-2h2.9v2ZM31,61.5h-2.9v-2h2.9v2ZM25.3,61.5h-2.9v-2h2.9v2ZM19.6,61.5h-2.9v-2h2.9v2ZM13.9,61.5h-2.9v-2h2.9v2ZM8.2,61.5h-2.9v-2h2.9v2Z"/>
|
|
10
|
+
<polygon points="70.6 61.5 68.1 61.5 68.1 59.5 68.6 59.5 68.6 59 70.6 59 70.6 61.5"/>
|
|
11
|
+
<path d="M70.6,56.3h-2v-2.7h2v2.7ZM70.6,50.8h-2v-2.7h2v2.7Z"/>
|
|
12
|
+
</g>
|
|
13
|
+
<path d="M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z"/>
|
|
14
|
+
<path d="M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z"/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70.67 70.64">
|
|
3
|
+
<path d="M70.08,33.9l-9.75-9.75-2.83,2.83,6.33,6.33h-26.51V6.81l6.33,6.33,2.83-2.83L36.75.56c-.75-.75-2.08-.75-2.83,0l-9.75,9.75,2.83,2.83,6.33-6.33v26.5H6.83l6.33-6.33-2.83-2.83L.59,33.9c-.38.38-.59.88-.59,1.41s.21,1.04.59,1.41l9.75,9.75,2.83-2.83-6.33-6.33h26.5v26.51l-6.33-6.33-2.83,2.83,9.75,9.75c.38.38.88.59,1.41.59s1.04-.21,1.41-.59l9.75-9.75-2.83-2.83-6.33,6.33v-26.51h26.51l-6.33,6.33,2.83,2.83,9.75-9.75c.38-.38.59-.88.59-1.41s-.21-1.04-.59-1.41Z" style="fill: #000; stroke-width: 0px;"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
3
|
+
<path d="M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z" style="fill: #000; stroke-width: 0px;"/>
|
|
4
|
+
<polygon points="18,20 18,44 46,32" style="fill: #000; stroke-width: 0px;"/>
|
|
5
|
+
</svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,OAAO,MAAM,iCAAiC,CAAA;AACrD,OAAO,UAAU,MAAM,oCAAoC,CAAA;AAC3D,OAAO,aAAa,MAAM,uCAAuC,CAAA;AACjE,OAAO,eAAe,MAAM,0CAA0C,CAAA;AACtE,OAAO,eAAe,MAAM,0CAA0C,CAAA;AACtE,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AACvD,OAAO,QAAQ,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/icons/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,OAAO,MAAM,iCAAiC,CAAA;AACrD,OAAO,UAAU,MAAM,oCAAoC,CAAA;AAC3D,OAAO,aAAa,MAAM,uCAAuC,CAAA;AACjE,OAAO,eAAe,MAAM,0CAA0C,CAAA;AACtE,OAAO,eAAe,MAAM,0CAA0C,CAAA;AACtE,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AACvD,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AAQvD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAEnG;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAU9C,CAAA"}
|
package/dist/src/icons/index.js
CHANGED
|
@@ -10,6 +10,9 @@ import InsertAboveIcon from './stonecrop-ui-icon-insert-above.svg?raw';
|
|
|
10
10
|
import InsertBelowIcon from './stonecrop-ui-icon-insert-below.svg?raw';
|
|
11
11
|
import MoveIcon from './stonecrop-ui-icon-move.svg?raw';
|
|
12
12
|
import OpenIcon from './stonecrop-ui-icon-open.svg?raw';
|
|
13
|
+
// Directional move icons are inline (no dedicated SVG asset): simple up/down chevrons.
|
|
14
|
+
const MoveUpIcon = '<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 13V3.5M4.5 7 8 3.5 11.5 7" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
15
|
+
const MoveDownIcon = '<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 3v9.5M4.5 9 8 12.5 11.5 9" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
13
16
|
export { AddIcon, DeleteIcon, DuplicateIcon, InsertAboveIcon, InsertBelowIcon, MoveIcon, OpenIcon };
|
|
14
17
|
/**
|
|
15
18
|
* Map of action types to their default icons.
|
|
@@ -23,5 +26,7 @@ export const actionIcons = {
|
|
|
23
26
|
insertAbove: InsertAboveIcon,
|
|
24
27
|
insertBelow: InsertBelowIcon,
|
|
25
28
|
move: MoveIcon,
|
|
29
|
+
moveUp: MoveUpIcon,
|
|
30
|
+
moveDown: MoveDownIcon,
|
|
26
31
|
open: OpenIcon,
|
|
27
32
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
2
|
import ACell from './components/ACell.vue';
|
|
3
|
-
import AExpansionRow from './components/AExpansionRow.vue';
|
|
4
3
|
import AGanttCell from './components/AGanttCell.vue';
|
|
5
4
|
import ARow from './components/ARow.vue';
|
|
6
5
|
import ARowActions from './components/ARowActions.vue';
|
|
@@ -20,5 +19,5 @@ export { AddIcon, DeleteIcon, DuplicateIcon, InsertAboveIcon, InsertBelowIcon, M
|
|
|
20
19
|
* @public
|
|
21
20
|
*/
|
|
22
21
|
declare function install(app: App): void;
|
|
23
|
-
export { ACell,
|
|
22
|
+
export { ACell, AGanttCell, ARow, ARowActions, ATable, ATableHeader, ATableLoading, ATableLoadingBar, ATableModal, install, };
|
|
24
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,OAAO,KAAK,MAAM,wBAAwB,CAAA;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,OAAO,KAAK,MAAM,wBAAwB,CAAA;AAC1C,OAAO,UAAU,MAAM,6BAA6B,CAAA;AACpD,OAAO,IAAI,MAAM,uBAAuB,CAAA;AACxC,OAAO,WAAW,MAAM,8BAA8B,CAAA;AACtD,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,YAAY,MAAM,+BAA+B,CAAA;AACxD,OAAO,aAAa,MAAM,gCAAgC,CAAA;AAC1D,OAAO,gBAAgB,MAAM,mCAAmC,CAAA;AAChE,OAAO,WAAW,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACpE,mBAAmB,SAAS,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGnD,OAAO,EACN,OAAO,EACP,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,WAAW,GACX,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,iBAAS,OAAO,CAAC,GAAG,EAAE,GAAG,QAUxB;AAED,OAAO,EACN,KAAK,EACL,UAAU,EACV,IAAI,EACJ,WAAW,EACX,MAAM,EACN,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,OAAO,GACP,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ACell from './components/ACell.vue';
|
|
2
|
-
import AExpansionRow from './components/AExpansionRow.vue';
|
|
3
2
|
import AGanttCell from './components/AGanttCell.vue';
|
|
4
3
|
import ARow from './components/ARow.vue';
|
|
5
4
|
import ARowActions from './components/ARowActions.vue';
|
|
@@ -19,7 +18,6 @@ export { AddIcon, DeleteIcon, DuplicateIcon, InsertAboveIcon, InsertBelowIcon, M
|
|
|
19
18
|
*/
|
|
20
19
|
function install(app /* options */) {
|
|
21
20
|
app.component('ACell', ACell);
|
|
22
|
-
app.component('AExpansionRow', AExpansionRow);
|
|
23
21
|
app.component('AGanttCell', AGanttCell);
|
|
24
22
|
app.component('ARow', ARow);
|
|
25
23
|
app.component('ARowActions', ARowActions);
|
|
@@ -29,4 +27,4 @@ function install(app /* options */) {
|
|
|
29
27
|
app.component('ATableLoadingBar', ATableLoadingBar);
|
|
30
28
|
app.component('ATableModal', ATableModal);
|
|
31
29
|
}
|
|
32
|
-
export { ACell,
|
|
30
|
+
export { ACell, AGanttCell, ARow, ARowActions, ATable, ATableHeader, ATableLoading, ATableLoadingBar, ATableModal, install, };
|
|
@@ -5,12 +5,12 @@ import type { TableColumn } from './types';
|
|
|
5
5
|
*
|
|
6
6
|
* Fields are excluded when:
|
|
7
7
|
* - `hidden: true` — field should not be visible in any view
|
|
8
|
-
* - no `
|
|
8
|
+
* - no `component` — non-scalar entry (nested table or fieldset), no column equivalent
|
|
9
9
|
*
|
|
10
10
|
* `fieldname` is renamed to `name`; `hidden` is stripped. All other `ColumnSchema` properties
|
|
11
11
|
* spread through automatically.
|
|
12
12
|
*
|
|
13
|
-
* For
|
|
13
|
+
* For link fields (those carrying `doctype`) without an explicit `cellComponent`:
|
|
14
14
|
* - `linkDoctype` is set from the field's `doctype` property (used by ACell's async resolver).
|
|
15
15
|
* - A synchronous `format` function is added (unless the field already has one) that handles
|
|
16
16
|
* both bare ID strings and pre-resolved `{ id, displayText }` objects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaToColumns.d.ts","sourceRoot":"","sources":["../../src/schemaToColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"schemaToColumns.d.ts","sourceRoot":"","sources":["../../src/schemaToColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,CAyBrE"}
|
|
@@ -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)
|