igniteui-angular 13.2.2 → 13.2.5

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.
Files changed (41) hide show
  1. package/esm2020/lib/directives/for-of/for_of.directive.mjs +2 -2
  2. package/esm2020/lib/grids/api.service.mjs +3 -4
  3. package/esm2020/lib/grids/columns/column-layout.component.mjs +3 -3
  4. package/esm2020/lib/grids/columns/column.component.mjs +4 -4
  5. package/esm2020/lib/grids/common/crud.service.mjs +3 -3
  6. package/esm2020/lib/grids/common/events.mjs +1 -1
  7. package/esm2020/lib/grids/filtering/advanced-filtering/advanced-filtering-dialog.component.mjs +2 -2
  8. package/esm2020/lib/grids/filtering/grid-filtering.service.mjs +7 -7
  9. package/esm2020/lib/grids/grid/grid.component.mjs +11 -11
  10. package/esm2020/lib/grids/grid-base.directive.mjs +84 -68
  11. package/esm2020/lib/grids/grid-mrl-navigation.service.mjs +2 -2
  12. package/esm2020/lib/grids/grid-public-row.mjs +3 -3
  13. package/esm2020/lib/grids/grouping/group-by-area.directive.mjs +2 -2
  14. package/esm2020/lib/grids/grouping/tree-grid-group-by-area.component.mjs +6 -6
  15. package/esm2020/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.mjs +4 -5
  16. package/esm2020/lib/grids/hierarchical-grid/hierarchical-grid.component.mjs +26 -14
  17. package/esm2020/lib/grids/hierarchical-grid/row-island.component.mjs +7 -11
  18. package/esm2020/lib/grids/pivot-grid/pivot-grid.component.mjs +22 -9
  19. package/esm2020/lib/grids/state.directive.mjs +9 -9
  20. package/esm2020/lib/grids/summaries/grid-summary.service.mjs +5 -5
  21. package/esm2020/lib/grids/tree-grid/tree-grid.component.mjs +27 -9
  22. package/esm2020/lib/services/exporter-common/base-export-service.mjs +3 -3
  23. package/esm2020/lib/splitter/splitter-pane/splitter-pane.component.mjs +61 -11
  24. package/esm2020/lib/splitter/splitter.component.mjs +20 -3
  25. package/fesm2015/igniteui-angular.mjs +294 -173
  26. package/fesm2015/igniteui-angular.mjs.map +1 -1
  27. package/fesm2020/igniteui-angular.mjs +292 -173
  28. package/fesm2020/igniteui-angular.mjs.map +1 -1
  29. package/lib/core/styles/themes/schemas/dark/_stepper.scss +6 -1
  30. package/lib/grids/common/events.d.ts +1 -0
  31. package/lib/grids/grid-base.directive.d.ts +7 -1
  32. package/lib/grids/hierarchical-grid/hierarchical-grid.component.d.ts +2 -1
  33. package/lib/grids/hierarchical-grid/row-island.component.d.ts +1 -0
  34. package/lib/grids/pivot-grid/pivot-grid.component.d.ts +4 -0
  35. package/lib/grids/tree-grid/tree-grid.component.d.ts +2 -2
  36. package/lib/splitter/splitter-pane/splitter-pane.component.d.ts +19 -5
  37. package/migrations/update-13_0_0/changes/inputs.json +416 -1
  38. package/migrations/update-13_0_0/index.js +208 -0
  39. package/package.json +1 -1
  40. package/styles/igniteui-indigo-dark.css +1 -1
  41. package/styles/maps/igniteui-indigo-dark.css.map +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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-angular",
3
- "version": "13.2.2",
3
+ "version": "13.2.5",
4
4
  "description": "Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps",
5
5
  "author": "Infragistics",
6
6
  "license": "SEE LICENSE IN LICENSE",