@sap-ux/adp-tooling 0.12.64 → 0.12.65
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/preview/change-handler.js +56 -1
- package/package.json +1 -1
- package/templates/rta/common/analytical-custom-column.xml +22 -0
- package/templates/rta/v2/m-table-custom-column-cell.xml +4 -0
- package/templates/rta/v2/m-table-custom-column.xml +10 -0
- package/templates/rta/v4/mdc-custom-column.xml +8 -0
|
@@ -11,6 +11,10 @@ const crypto_1 = require("crypto");
|
|
|
11
11
|
const OBJECT_PAGE_CUSTOM_SECTION = 'OBJECT_PAGE_CUSTOM_SECTION';
|
|
12
12
|
const CUSTOM_ACTION = 'CUSTOM_ACTION';
|
|
13
13
|
const OBJECT_PAGE_HEADER_FIELD = 'OBJECT_PAGE_HEADER_FIELD';
|
|
14
|
+
const V2_SMART_TABLE_COLUMN = 'V2_SMART_TABLE_COLUMN';
|
|
15
|
+
const V2_SMART_TABLE_CELL = 'V2_SMART_TABLE_CELL';
|
|
16
|
+
const V4_MDC_TABLE_COLUMN = 'V4_MDC_TABLE_COLUMN';
|
|
17
|
+
const ANALYTICAL_TABLE_COLUMN = 'ANALYTICAL_TABLE_COLUMN';
|
|
14
18
|
const TABLE_ACTION = 'TABLE_ACTION';
|
|
15
19
|
const fragmentTemplateDefinitions = {
|
|
16
20
|
[OBJECT_PAGE_CUSTOM_SECTION]: {
|
|
@@ -60,6 +64,57 @@ const fragmentTemplateDefinitions = {
|
|
|
60
64
|
}
|
|
61
65
|
};
|
|
62
66
|
}
|
|
67
|
+
},
|
|
68
|
+
[V2_SMART_TABLE_COLUMN]: {
|
|
69
|
+
path: 'v2/m-table-custom-column.xml',
|
|
70
|
+
getData: () => {
|
|
71
|
+
const uuid = (0, crypto_1.randomBytes)(4).toString('hex');
|
|
72
|
+
return {
|
|
73
|
+
ids: {
|
|
74
|
+
column: `column-${uuid}`,
|
|
75
|
+
columnTitle: `column-title-${uuid}`
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
[V2_SMART_TABLE_CELL]: {
|
|
81
|
+
path: 'v2/m-table-custom-column-cell.xml',
|
|
82
|
+
getData: () => {
|
|
83
|
+
const uuid = (0, crypto_1.randomBytes)(4).toString('hex');
|
|
84
|
+
return {
|
|
85
|
+
ids: {
|
|
86
|
+
text: `cell-text-${uuid}`
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
[V4_MDC_TABLE_COLUMN]: {
|
|
92
|
+
path: 'v4/mdc-custom-column.xml',
|
|
93
|
+
getData: () => {
|
|
94
|
+
const uuid = (0, crypto_1.randomBytes)(4).toString('hex');
|
|
95
|
+
return {
|
|
96
|
+
ids: {
|
|
97
|
+
column: `column-${uuid}`,
|
|
98
|
+
text: `text-${uuid}`
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
[ANALYTICAL_TABLE_COLUMN]: {
|
|
104
|
+
path: 'common/analytical-custom-column.xml',
|
|
105
|
+
getData: (change) => {
|
|
106
|
+
const uuid = (0, crypto_1.randomBytes)(4).toString('hex');
|
|
107
|
+
const columnIndex = change.content.index;
|
|
108
|
+
return {
|
|
109
|
+
ids: {
|
|
110
|
+
column: `column-${uuid}`,
|
|
111
|
+
label: `label-${uuid}`,
|
|
112
|
+
text: `text-${uuid}`,
|
|
113
|
+
customData: `custom-data-${uuid}`,
|
|
114
|
+
index: columnIndex.toFixed(0)
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
63
118
|
}
|
|
64
119
|
};
|
|
65
120
|
/**
|
|
@@ -117,7 +172,7 @@ function addXmlFragment(basePath, change, fs, logger) {
|
|
|
117
172
|
if (templateConfig) {
|
|
118
173
|
const fragmentTemplatePath = (0, path_1.join)(__dirname, '../../templates/rta', templateConfig.path);
|
|
119
174
|
const text = fs.read(fragmentTemplatePath);
|
|
120
|
-
const template = (0, ejs_1.render)(text, templateConfig.getData());
|
|
175
|
+
const template = (0, ejs_1.render)(text, templateConfig.getData(change));
|
|
121
176
|
fs.write(fullPath, template);
|
|
122
177
|
}
|
|
123
178
|
else {
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.12.
|
|
12
|
+
"version": "0.12.65",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- Use stable and unique id's!-->
|
|
2
|
+
<core:FragmentDefinition xmlns="sap.m" xmlns:table="sap.ui.table" xmlns:smartfield="sap.ui.comp.smartfield" xmlns:core="sap.ui.core">
|
|
3
|
+
<table:AnalyticalColumn
|
|
4
|
+
grouped="false"
|
|
5
|
+
autoResizable="true"
|
|
6
|
+
width="150px"
|
|
7
|
+
hAlign="Left"
|
|
8
|
+
summed="false"
|
|
9
|
+
id="<%- ids.column %>" >
|
|
10
|
+
|
|
11
|
+
<Label id="<%- ids.label %>" text="New Column"></Label>
|
|
12
|
+
|
|
13
|
+
<table:template>
|
|
14
|
+
<Text id="<%- ids.text %>" text="Sample data"/>
|
|
15
|
+
</table:template>
|
|
16
|
+
|
|
17
|
+
<table:customData>
|
|
18
|
+
<core:CustomData key="p13nData" id="<%- ids.customData %>"
|
|
19
|
+
value='\{"columnKey": "<%- ids.column %>", "columnIndex": "<%- ids.index %>"}' />
|
|
20
|
+
</table:customData>
|
|
21
|
+
</table:AnalyticalColumn>
|
|
22
|
+
</core:FragmentDefinition>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!-- Use stable and unique IDs!-->
|
|
2
|
+
<core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>
|
|
3
|
+
<!-- add your xml here -->
|
|
4
|
+
<Column id="<%- ids.column %>"
|
|
5
|
+
width="12em"
|
|
6
|
+
hAlign="Left"
|
|
7
|
+
vAlign="Middle">
|
|
8
|
+
<Text id="<%- ids.columnTitle %>" text="New column" />
|
|
9
|
+
</Column>
|
|
10
|
+
</core:FragmentDefinition>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m" xmlns:table="sap.ui.mdc.table">
|
|
2
|
+
<table:Column
|
|
3
|
+
id="<%- ids.column %>"
|
|
4
|
+
width="10%"
|
|
5
|
+
header="New Column">
|
|
6
|
+
<Text id="<%- ids.text %>" text="Sample data"/>
|
|
7
|
+
</table:Column>
|
|
8
|
+
</core:FragmentDefinition>
|