igniteui-angular 13.2.3 → 13.2.6
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/esm2020/lib/directives/for-of/for_of.directive.mjs +2 -2
- package/esm2020/lib/grids/api.service.mjs +2 -3
- package/esm2020/lib/grids/common/crud.service.mjs +3 -3
- package/esm2020/lib/grids/common/events.mjs +1 -1
- package/esm2020/lib/grids/grid-base.directive.mjs +24 -13
- package/esm2020/lib/grids/hierarchical-grid/hierarchical-grid.component.mjs +10 -1
- package/esm2020/lib/grids/pivot-grid/pivot-grid.component.mjs +34 -9
- package/esm2020/lib/grids/tree-grid/tree-grid.component.mjs +21 -3
- package/esm2020/lib/simple-combo/simple-combo.component.mjs +2 -2
- package/esm2020/lib/splitter/splitter-pane/splitter-pane.component.mjs +61 -11
- package/esm2020/lib/splitter/splitter.component.mjs +20 -3
- package/esm2020/lib/tree/tree.component.mjs +30 -1
- package/fesm2015/igniteui-angular.mjs +198 -40
- package/fesm2015/igniteui-angular.mjs.map +1 -1
- package/fesm2020/igniteui-angular.mjs +196 -40
- package/fesm2020/igniteui-angular.mjs.map +1 -1
- package/lib/grids/common/events.d.ts +1 -0
- package/lib/grids/grid-base.directive.d.ts +5 -0
- package/lib/grids/hierarchical-grid/hierarchical-grid.component.d.ts +2 -0
- package/lib/grids/pivot-grid/pivot-grid.component.d.ts +13 -0
- package/lib/splitter/splitter-pane/splitter-pane.component.d.ts +19 -5
- package/lib/tree/tree.component.d.ts +29 -0
- package/migrations/update-13_0_0/changes/inputs.json +416 -1
- package/migrations/update-13_0_0/index.js +208 -0
- package/package.json +1 -1
|
@@ -10,13 +10,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const UpdateChanges_1 = require("../common/UpdateChanges");
|
|
13
|
+
const util_1 = require("../common/util");
|
|
14
|
+
const import_helper_js_1 = require("../common/import-helper.js");
|
|
13
15
|
const version = '13.0.0';
|
|
14
16
|
exports.default = () => (host, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
17
|
var _a;
|
|
16
18
|
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
|
|
19
|
+
const { HtmlParser } = yield (0, import_helper_js_1.nativeImport)('@angular/compiler');
|
|
17
20
|
const update = new UpdateChanges_1.UpdateChanges(__dirname, host, context);
|
|
21
|
+
const changes = new Map();
|
|
18
22
|
const tsFiles = update.tsFiles;
|
|
19
23
|
const SERVICES = ['IgxCsvExporterService', 'IgxExcelExporterService'];
|
|
24
|
+
const TAGS = ['igx-grid', 'igx-tree-grid', 'igx-hierarchical-grid', 'igx-row-island'];
|
|
25
|
+
const toolbarProp = ['[showToolbar]', 'showToolbar', '[toolbarTitle]', 'toolbarTitle',
|
|
26
|
+
'[columnHiding]', 'columnHiding', '[columnHidingTitle]', 'columnHidingTitle', '[hiddenColumnsText]', 'hiddenColumnsText',
|
|
27
|
+
'[columnPinning]', 'columnPinning', '[columnPinningTitle]', 'columnPinningTitle', '[pinnedColumnsText]', 'pinnedColumnsText',
|
|
28
|
+
'[exportExcel]', 'exportExcel', '[exportExcelText]', 'exportExcelText',
|
|
29
|
+
'[exportCsv]', 'exportCsv', '[exportCsvText]', 'exportCsvText', '[exportText]', 'exportText'];
|
|
30
|
+
const actionsLeft = ['igx-grid-toolbar-advanced-filtering'];
|
|
20
31
|
const moduleTsFiles = tsFiles.filter(x => x.endsWith('.module.ts'));
|
|
21
32
|
for (const path of moduleTsFiles) {
|
|
22
33
|
let content = (_a = host.read(path)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
@@ -36,5 +47,202 @@ exports.default = () => (host, context) => __awaiter(void 0, void 0, void 0, fun
|
|
|
36
47
|
host.overwrite(path, content);
|
|
37
48
|
}
|
|
38
49
|
}
|
|
50
|
+
const applyChanges = () => {
|
|
51
|
+
var _a;
|
|
52
|
+
for (const [path, change] of changes.entries()) {
|
|
53
|
+
let buffer = (_a = host.read(path)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
54
|
+
change.sort((c, c1) => c.position - c1.position)
|
|
55
|
+
.reverse()
|
|
56
|
+
.forEach(c => buffer = c.apply(buffer));
|
|
57
|
+
host.overwrite(path, buffer);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const addChange = (path, change) => {
|
|
61
|
+
if (changes.has(path)) {
|
|
62
|
+
changes.get(path).push(change);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
changes.set(path, [change]);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const buildToolbar = (node, attributes) => {
|
|
69
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
70
|
+
let result = '';
|
|
71
|
+
const toolbar = (0, util_1.findElementNodes)(node, ['igx-grid-toolbar'])[0];
|
|
72
|
+
result += `\n<igx-grid-toolbar`;
|
|
73
|
+
const showToolbar = !toolbar || ((_a = attributes['showToolbar']) === null || _a === void 0 ? void 0 : _a.value) ? attributes['showToolbar'] : (0, util_1.getAttribute)(toolbar, ['*ngIf', '[*gIf]'])[0];
|
|
74
|
+
if (showToolbar && showToolbar.value) {
|
|
75
|
+
result += ` *ngIf="${showToolbar.value}"`;
|
|
76
|
+
}
|
|
77
|
+
result += '>';
|
|
78
|
+
const toolbarTitle = !!toolbar ? (0, util_1.findElementNodes)([toolbar], ['igx-grid-toolbar-title'])[0] : null;
|
|
79
|
+
const title = !toolbarTitle || ((_b = attributes['toolbarTitle']) === null || _b === void 0 ? void 0 : _b.value) ? attributes['toolbarTitle'] : (toolbarTitle.children)[0];
|
|
80
|
+
if (title && title.value) {
|
|
81
|
+
result += `\n<igx-grid-toolbar-title>${title.value}</igx-grid-toolbar-title>`;
|
|
82
|
+
}
|
|
83
|
+
// has actions
|
|
84
|
+
const hasHiding = Object.keys(attributes).filter(x => x.toLowerCase().includes('hid')).length > 0 || !!(toolbar && (0, util_1.findElementNodes)([toolbar], ['igx-grid-toolbar-hiding'])[0]);
|
|
85
|
+
const hasPinning = Object.keys(attributes).filter(x => x.toLowerCase().includes('pin')).length > 0 || !!(toolbar && (0, util_1.findElementNodes)([toolbar], ['igx-grid-toolbar-pinning'])[0]);
|
|
86
|
+
const hasExporting = Object.keys(attributes).filter(x => x.toLowerCase().includes('export')).length > 0 || !!(toolbar && (0, util_1.findElementNodes)([toolbar], ['igx-grid-toolbar-exporter'])[0]);
|
|
87
|
+
const hasActions = hasHiding || hasPinning || hasExporting;
|
|
88
|
+
if (hasActions) {
|
|
89
|
+
result += '\n<igx-grid-toolbar-actions>';
|
|
90
|
+
}
|
|
91
|
+
const hiding = !!toolbar ? (0, util_1.findElementNodes)([toolbar], ['igx-grid-toolbar-hiding'])[0] : null;
|
|
92
|
+
const showHiding = !hiding || ((_c = attributes['columnHiding']) === null || _c === void 0 ? void 0 : _c.value) ? attributes['columnHiding'] : (0, util_1.getAttribute)(hiding, ['*ngIf', '[*ngIf]'])[0];
|
|
93
|
+
if (hasHiding) {
|
|
94
|
+
result += `\n<igx-grid-toolbar-hiding`;
|
|
95
|
+
}
|
|
96
|
+
if (showHiding && showHiding.value) {
|
|
97
|
+
result += `${showHiding.value !== "'true'" ? ` *ngIf="${showHiding.value}"` : ''}`;
|
|
98
|
+
}
|
|
99
|
+
const hidingTitle = !hiding || ((_d = attributes['columnHidingTitle']) === null || _d === void 0 ? void 0 : _d.value) ? attributes['columnHidingTitle'] : (0, util_1.getAttribute)(hiding, ['title', '[title]'])[0];
|
|
100
|
+
if (hidingTitle && hidingTitle.value) {
|
|
101
|
+
result += ` title="${hidingTitle.value}"`;
|
|
102
|
+
}
|
|
103
|
+
let buttonText = !hiding || ((_e = attributes['hiddenColumnsText']) === null || _e === void 0 ? void 0 : _e.value) ? attributes['hiddenColumnsText'] : (0, util_1.getAttribute)(hiding, ['buttonText', '[buttonText]'])[0];
|
|
104
|
+
if (buttonText && buttonText.value) {
|
|
105
|
+
result += ` buttonText="${buttonText.value}"`;
|
|
106
|
+
}
|
|
107
|
+
if (hasHiding) {
|
|
108
|
+
result += '></igx-grid-toolbar-hiding>';
|
|
109
|
+
}
|
|
110
|
+
const pinning = !!toolbar ? (0, util_1.findElementNodes)([toolbar], ['igx-grid-toolbar-pinning'])[0] : null;
|
|
111
|
+
const showPinning = !pinning || ((_f = attributes['columnPinning']) === null || _f === void 0 ? void 0 : _f.value) ? attributes['columnPinning'] : (0, util_1.getAttribute)(pinning, ['*ngIf', '[*ngIf]'])[0];
|
|
112
|
+
if (hasPinning) {
|
|
113
|
+
result += `\n<igx-grid-toolbar-pinning`;
|
|
114
|
+
}
|
|
115
|
+
if (showPinning && showPinning.value) {
|
|
116
|
+
result += `${showPinning.value !== "'true'" ? ` *ngIf="${showPinning.value}"` : ''}`;
|
|
117
|
+
}
|
|
118
|
+
const pinningTitle = !pinning || ((_g = attributes['columnPinningTitle']) === null || _g === void 0 ? void 0 : _g.value) ? attributes['columnPinningTitle'] : (0, util_1.getAttribute)(pinning, ['title', '[title]'])[0];
|
|
119
|
+
if (pinningTitle && pinningTitle.value) {
|
|
120
|
+
result += ` title="${pinningTitle.value}"`;
|
|
121
|
+
}
|
|
122
|
+
buttonText = !pinning || ((_h = attributes['pinnedColumnsText']) === null || _h === void 0 ? void 0 : _h.value) ? attributes['pinnedColumnsText'] : (0, util_1.getAttribute)(pinning, ['buttonText', '[buttonText]'])[0];
|
|
123
|
+
if (buttonText && buttonText.value) {
|
|
124
|
+
result += ` buttonText="${buttonText.value}"`;
|
|
125
|
+
}
|
|
126
|
+
if (hasPinning) {
|
|
127
|
+
result += '></igx-grid-toolbar-pinning>';
|
|
128
|
+
}
|
|
129
|
+
const exporting = !!toolbar ? (0, util_1.findElementNodes)([toolbar], ['igx-grid-toolbar-exporter'])[0] : null;
|
|
130
|
+
const showExcelExporter = !exporting || ((_j = attributes['exportExcel']) === null || _j === void 0 ? void 0 : _j.value) ? attributes['exportExcel'] : (0, util_1.getAttribute)(exporting, ['exportExcel', '[exportExcel]'])[0];
|
|
131
|
+
const showCsvExporter = !exporting || ((_k = attributes['exportCsv']) === null || _k === void 0 ? void 0 : _k.value) ? attributes['exportCsv'] : (0, util_1.getAttribute)(exporting, ['exportCSV', '[exportCSV]'])[0];
|
|
132
|
+
if (hasExporting) {
|
|
133
|
+
result += `\n<igx-grid-toolbar-exporter`;
|
|
134
|
+
}
|
|
135
|
+
if (showExcelExporter && showExcelExporter.value) {
|
|
136
|
+
result += ` exportExcel="${showExcelExporter.value}"`;
|
|
137
|
+
}
|
|
138
|
+
if (showCsvExporter && showCsvExporter.value) {
|
|
139
|
+
result += ` exportCSV="${showCsvExporter.value}"`;
|
|
140
|
+
}
|
|
141
|
+
if (hasExporting) {
|
|
142
|
+
result += '>';
|
|
143
|
+
}
|
|
144
|
+
const excelTitle = !exporting || ((_l = attributes['exportExcelText']) === null || _l === void 0 ? void 0 : _l.value) ? attributes['exportExcelText'] : getExportText(exporting, 'excelText');
|
|
145
|
+
if (excelTitle && excelTitle.value) {
|
|
146
|
+
result += excelTitle.template ? '\n' + excelTitle.value : `\n<span excelText>${excelTitle.value}</span>`;
|
|
147
|
+
}
|
|
148
|
+
const csvTitle = !exporting || ((_m = attributes['exportCsvText']) === null || _m === void 0 ? void 0 : _m.value) ? attributes['exportCsvText'] : getExportText(exporting, 'csvText');
|
|
149
|
+
if (csvTitle && csvTitle.value) {
|
|
150
|
+
result += csvTitle.template ? '\n' + csvTitle.value : `\n<span csvText>${csvTitle.value}</span>`;
|
|
151
|
+
}
|
|
152
|
+
const exportTitle = !exporting || ((_o = attributes['exportText']) === null || _o === void 0 ? void 0 : _o.value) ? attributes['exportText'] : getExportText(exporting, 'text');
|
|
153
|
+
if (exportTitle && exportTitle.value) {
|
|
154
|
+
result += '\n' + exportTitle.value;
|
|
155
|
+
}
|
|
156
|
+
if (hasExporting) {
|
|
157
|
+
result += '\n</igx-grid-toolbar-exporter>';
|
|
158
|
+
}
|
|
159
|
+
//add any actions left
|
|
160
|
+
if (toolbar) {
|
|
161
|
+
const actions = (0, util_1.findElementNodes)([toolbar], actionsLeft);
|
|
162
|
+
actions.forEach(action => {
|
|
163
|
+
const { startTag, file, endTag } = (0, util_1.getSourceOffset)(action);
|
|
164
|
+
const text = file.content.substring(startTag.start, endTag.end);
|
|
165
|
+
result += '\n' + text;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (hasActions) {
|
|
169
|
+
result += '\n</igx-grid-toolbar-actions>';
|
|
170
|
+
}
|
|
171
|
+
const toolbarChildren = (_p = toolbar) === null || _p === void 0 ? void 0 : _p.children.filter(child => child.name && !child.name.includes('toolbar'));
|
|
172
|
+
toolbarChildren === null || toolbarChildren === void 0 ? void 0 : toolbarChildren.forEach(child => {
|
|
173
|
+
const { startTag, endTag, file } = (0, util_1.getSourceOffset)(child);
|
|
174
|
+
const replaceText = file.content.substring(startTag.start, endTag.end);
|
|
175
|
+
result += '\n' + replaceText;
|
|
176
|
+
});
|
|
177
|
+
return result + `\n</igx-grid-toolbar>`;
|
|
178
|
+
};
|
|
179
|
+
const clearOldToolbar = (grid) => {
|
|
180
|
+
const node = (0, util_1.findElementNodes)(grid, 'igx-grid-toolbar')[0];
|
|
181
|
+
if (!node) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const { startTag, endTag, file } = (0, util_1.getSourceOffset)(node);
|
|
185
|
+
const replaceText = file.content.substring(startTag.start, endTag.end);
|
|
186
|
+
addChange(file.url, new util_1.FileChange(startTag.start, '', replaceText, 'replace'));
|
|
187
|
+
applyChanges();
|
|
188
|
+
changes.clear();
|
|
189
|
+
};
|
|
190
|
+
const getExportText = (exporter, type) => {
|
|
191
|
+
const element = exporter.children.find(el => {
|
|
192
|
+
if (type === 'text' && !!el.value && el.value.trim().length > 0) {
|
|
193
|
+
return el;
|
|
194
|
+
}
|
|
195
|
+
else if (!!el.attrs && (0, util_1.hasAttribute)(el, type)) {
|
|
196
|
+
return el;
|
|
197
|
+
}
|
|
198
|
+
return undefined;
|
|
199
|
+
});
|
|
200
|
+
if (!element) {
|
|
201
|
+
return '';
|
|
202
|
+
}
|
|
203
|
+
if (type !== 'text') {
|
|
204
|
+
const { startTag, endTag, file } = (0, util_1.getSourceOffset)(element);
|
|
205
|
+
const replaceText = file.content.substring(startTag.start, endTag.end);
|
|
206
|
+
return { value: replaceText, template: true };
|
|
207
|
+
}
|
|
208
|
+
return element;
|
|
209
|
+
};
|
|
210
|
+
for (const path of update.templateFiles) {
|
|
211
|
+
//update toolbar
|
|
212
|
+
const tags = TAGS.slice(0, 3);
|
|
213
|
+
(0, util_1.findElementNodes)((0, util_1.parseFile)(new HtmlParser(), host, path), tags)
|
|
214
|
+
.filter(grid => (0, util_1.hasAttribute)(grid, toolbarProp))
|
|
215
|
+
.map(node => (0, util_1.getSourceOffset)(node))
|
|
216
|
+
.reverse()
|
|
217
|
+
.forEach(offset => {
|
|
218
|
+
const { startTag, file, node } = offset;
|
|
219
|
+
const attributes = new Object();
|
|
220
|
+
(0, util_1.getAttribute)(node, toolbarProp).forEach(attr => attributes[attr.name.replace(/[\[\]]+/g, '')] =
|
|
221
|
+
{ name: attr.name.replace(/[\[\]]+/g, ''), value: attr.value });
|
|
222
|
+
const text = buildToolbar(node, attributes);
|
|
223
|
+
clearOldToolbar(node);
|
|
224
|
+
addChange(file.url, new util_1.FileChange(startTag.end, text));
|
|
225
|
+
applyChanges();
|
|
226
|
+
changes.clear();
|
|
227
|
+
});
|
|
228
|
+
//update row island in that file too
|
|
229
|
+
(0, util_1.findElementNodes)((0, util_1.parseFile)(new HtmlParser(), host, path), 'igx-row-island')
|
|
230
|
+
.filter(grid => (0, util_1.hasAttribute)(grid, toolbarProp))
|
|
231
|
+
.map(node => (0, util_1.getSourceOffset)(node))
|
|
232
|
+
.reverse()
|
|
233
|
+
.forEach(offset => {
|
|
234
|
+
const { startTag, file, node } = offset;
|
|
235
|
+
const attributes = new Object();
|
|
236
|
+
(0, util_1.getAttribute)(node, toolbarProp).forEach(attr => attributes[attr.name.replace(/[\[\]]+/g, '')] =
|
|
237
|
+
{ name: attr.name.replace(/[\[\]]+/g, ''), value: attr.value });
|
|
238
|
+
const text = buildToolbar(node, attributes);
|
|
239
|
+
clearOldToolbar(node);
|
|
240
|
+
addChange(file.url, new util_1.FileChange(startTag.end, text));
|
|
241
|
+
applyChanges();
|
|
242
|
+
changes.clear();
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
applyChanges();
|
|
246
|
+
changes.clear();
|
|
39
247
|
update.applyChanges();
|
|
40
248
|
});
|
package/package.json
CHANGED