@progress/kendo-angular-grid 14.4.0-develop.13 → 14.4.0-develop.15

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 (38) hide show
  1. package/common/clipboard-types.d.ts +102 -0
  2. package/common/clipboard.directive.d.ts +53 -0
  3. package/common/clipboard.service.d.ts +28 -0
  4. package/common/dom-events.service.d.ts +1 -0
  5. package/common/error-messages.d.ts +12 -0
  6. package/databinding.directive.d.ts +1 -1
  7. package/esm2020/column-menu/column-menu-item-base.mjs +2 -1
  8. package/esm2020/columns/column-base.mjs +3 -2
  9. package/esm2020/columns/column-group.component.mjs +2 -1
  10. package/esm2020/columns/span-column.component.mjs +2 -1
  11. package/esm2020/common/clipboard-types.mjs +5 -0
  12. package/esm2020/common/clipboard.directive.mjs +190 -0
  13. package/esm2020/common/clipboard.service.mjs +191 -0
  14. package/esm2020/common/dom-events.service.mjs +1 -0
  15. package/esm2020/common/error-messages.mjs +46 -1
  16. package/esm2020/databinding.directive.mjs +3 -2
  17. package/esm2020/editing-directives/local-edit.service.mjs +2 -2
  18. package/esm2020/excel/excel.service.mjs +2 -1
  19. package/esm2020/grid.component.mjs +40 -34
  20. package/esm2020/grid.module.mjs +8 -4
  21. package/esm2020/grouping/group-scroll-binding.directive.mjs +2 -3
  22. package/esm2020/index.mjs +2 -0
  23. package/esm2020/package-metadata.mjs +2 -2
  24. package/esm2020/pdf/pdf.component.mjs +3 -2
  25. package/esm2020/pdf/pdf.service.mjs +2 -1
  26. package/esm2020/rendering/details/detail-template.directive.mjs +2 -1
  27. package/esm2020/selection/selection-default.mjs +11 -5
  28. package/esm2020/utils.mjs +10 -0
  29. package/fesm2015/progress-kendo-angular-grid.mjs +498 -72
  30. package/fesm2020/progress-kendo-angular-grid.mjs +495 -72
  31. package/grid.component.d.ts +7 -1
  32. package/grid.module.d.ts +99 -98
  33. package/index.d.ts +3 -1
  34. package/package.json +16 -16
  35. package/schematics/ngAdd/index.js +3 -3
  36. package/selection/selection-default.d.ts +10 -4
  37. package/selection/types.d.ts +6 -0
  38. package/utils.d.ts +8 -0
@@ -3,6 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { EventEmitter, Injectable, isDevMode } from '@angular/core';
6
+ import { GridConfigurationErrorMessages } from '../common/error-messages';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * @hidden
@@ -26,7 +27,7 @@ export class PDFService {
26
27
  emitEvent(emitter, args) {
27
28
  if (emitter.observers.length === 0) {
28
29
  if (isDevMode()) {
29
- throw new Error('Creating PDF requires including the PDFModule and adding the <kendo-grid-pdf> component.');
30
+ throw new Error(GridConfigurationErrorMessages.requiredModule('PDF', 'PDFModule', '<kendo-grid-pdf>'));
30
31
  }
31
32
  }
32
33
  else {
@@ -3,6 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Directive, TemplateRef, Optional, Input } from '@angular/core';
6
+ import { GridConfigurationErrorMessages } from '../../common/error-messages';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * Represents the detail template of the Grid ([more information and examples]({% slug detailrowtemplate_grid %})).
@@ -32,7 +33,7 @@ export class DetailTemplateDirective {
32
33
  */
33
34
  set showIf(fn) {
34
35
  if (typeof fn !== 'function') {
35
- throw new Error(`showIf must be a function, but received ${JSON.stringify(fn)}.`);
36
+ throw new Error(GridConfigurationErrorMessages.functionType('showIf', fn));
36
37
  }
37
38
  this._condition = fn;
38
39
  }
@@ -34,6 +34,9 @@ export class Selection {
34
34
  this.cellSelectionState = new PairSet();
35
35
  this.init();
36
36
  }
37
+ /**
38
+ * @hidden
39
+ */
37
40
  get isCellSelectionMode() {
38
41
  return isPresent(this.ctx.grid.selectable) && this.ctx.grid.selectable['cell'];
39
42
  }
@@ -87,6 +90,14 @@ export class Selection {
87
90
  }
88
91
  return row.index;
89
92
  }
93
+ /**
94
+ * @hidden
95
+ */
96
+ stateToArray() {
97
+ return this.isCellSelectionMode ?
98
+ this.cellSelectionState.toArray('itemKey', 'columnKey') :
99
+ Array.from(this.rowSelectionState);
100
+ }
90
101
  getSelectionItem(row, col, colIndex) {
91
102
  const itemIdentifiers = {};
92
103
  itemIdentifiers.itemKey = this.getItemKey(row);
@@ -147,11 +158,6 @@ export class Selection {
147
158
  this.rowSelectionState = new Set(selectedKeys);
148
159
  }
149
160
  }
150
- stateToArray() {
151
- return this.isCellSelectionMode ?
152
- this.cellSelectionState.toArray('itemKey', 'columnKey') :
153
- Array.from(this.rowSelectionState);
154
- }
155
161
  }
156
162
  Selection.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Selection, deps: [{ token: i1.ContextService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
157
163
  Selection.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Selection, selector: "kendo-grid-selection-base", inputs: { selectedKeys: "selectedKeys", rangeSelectionStartRow: "rangeSelectionStartRow", rangeSelectionStartColumnIndex: "rangeSelectionStartColumnIndex", selectionKey: ["kendoGridSelectBy", "selectionKey"], columnKey: "columnKey" }, outputs: { selectedKeysChange: "selectedKeysChange" }, usesOnChanges: true, ngImport: i0 });
package/esm2020/utils.mjs CHANGED
@@ -129,3 +129,13 @@ export const nodesToArray = (nodes) => [].slice.call(nodes);
129
129
  * @hidden
130
130
  */
131
131
  export const replaceMessagePlaceholder = (message, name, value) => message.replace(new RegExp(`\{\\s*${name}\\s*\}`, 'g'), value);
132
+ /**
133
+ * @hidden
134
+ */
135
+ export const recursiveFlatMap = (item) => isGroupResult(item) ? item.items.flatMap(recursiveFlatMap) : [item];
136
+ /**
137
+ * @hidden
138
+ */
139
+ export const isGroupResult = (obj) => {
140
+ return 'aggregates' in obj && 'items' in obj && 'field' in obj && 'value' in obj;
141
+ };