@progress/kendo-angular-pivotgrid 0.2.0-dev.202208181233 → 0.2.0-dev.202208181339

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 (43) hide show
  1. package/bundles/kendo-angular-pivotgrid.umd.js +1 -1
  2. package/configurator/configurator.component.d.ts +96 -0
  3. package/configurator/configurator.service.d.ts +17 -0
  4. package/configurator/draggable.directive.d.ts +32 -0
  5. package/configurator/drop-cue.service.d.ts +22 -0
  6. package/configurator/drop-target.directive.d.ts +32 -0
  7. package/data-binding/base-binding-directive.d.ts +27 -5
  8. package/data-binding/local-binding.directive.d.ts +8 -1
  9. package/data-binding/olap-binding.directive.d.ts +13 -1
  10. package/data-binding/pivotgrid-data.service.d.ts +8 -3
  11. package/esm2015/configurator/configurator.component.js +512 -0
  12. package/esm2015/configurator/configurator.service.js +38 -0
  13. package/esm2015/configurator/draggable.directive.js +94 -0
  14. package/esm2015/configurator/drop-cue.service.js +64 -0
  15. package/esm2015/configurator/drop-target.directive.js +82 -0
  16. package/esm2015/data-binding/base-binding-directive.js +68 -9
  17. package/esm2015/data-binding/local-binding.directive.js +20 -8
  18. package/esm2015/data-binding/olap-binding.directive.js +131 -6
  19. package/esm2015/data-binding/pivotgrid-data.service.js +9 -1
  20. package/esm2015/localization/custom-messages.component.js +41 -0
  21. package/esm2015/localization/localized-messages.directive.js +36 -0
  22. package/esm2015/localization/messages.js +71 -0
  23. package/esm2015/main.js +8 -0
  24. package/esm2015/models/configuration-change-event.js +18 -0
  25. package/esm2015/models/configurator-settings.js +14 -0
  26. package/esm2015/models/expanded-change-event.js +18 -0
  27. package/esm2015/package-metadata.js +1 -1
  28. package/esm2015/pivotgrid.component.js +337 -63
  29. package/esm2015/pivotgrid.module.js +43 -16
  30. package/esm2015/util.js +59 -0
  31. package/fesm2015/kendo-angular-pivotgrid.js +1567 -106
  32. package/localization/custom-messages.component.d.ts +18 -0
  33. package/localization/localized-messages.directive.d.ts +16 -0
  34. package/localization/messages.d.ts +160 -0
  35. package/main.d.ts +6 -0
  36. package/models/configuration-change-event.d.ts +36 -0
  37. package/models/configurator-settings.d.ts +32 -0
  38. package/models/expanded-change-event.d.ts +27 -0
  39. package/package.json +7 -1
  40. package/pivotgrid.component.d.ts +27 -3
  41. package/pivotgrid.module.d.ts +15 -7
  42. package/rendering/pivotgrid-table.component.d.ts +2 -2
  43. package/util.d.ts +23 -0
@@ -11,25 +11,33 @@ import { fromEvent, Subscription } from 'rxjs';
11
11
  import { syncScroll, syncWheel } from './util';
12
12
  // eslint-disable-next-line rxjs/ban-operators
13
13
  import { merge } from 'rxjs/operators';
14
+ import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
14
15
  import * as i0 from "@angular/core";
15
16
  import * as i1 from "./data-binding/pivotgrid-data.service";
16
- import * as i2 from "@progress/kendo-angular-common";
17
- import * as i3 from "./rendering/pivotgrid-table.component";
18
- import * as i4 from "@progress/kendo-angular-indicators";
19
- import * as i5 from "@angular/common";
17
+ import * as i2 from "@progress/kendo-angular-l10n";
18
+ import * as i3 from "@progress/kendo-angular-common";
19
+ import * as i4 from "./rendering/pivotgrid-table.component";
20
+ import * as i5 from "@progress/kendo-angular-indicators";
21
+ import * as i6 from "./configurator/configurator.component";
22
+ import * as i7 from "./localization/localized-messages.directive";
23
+ import * as i8 from "@angular/common";
20
24
  const DEFAULT_LOADER_SETTINGS = {
21
25
  type: 'converging-spinner',
22
26
  themeColor: 'primary',
23
27
  size: 'large'
24
28
  };
29
+ const DEFAULT_CONFIGURATOR_SETTINGS = {
30
+ position: 'right',
31
+ horizontal: false
32
+ };
25
33
  /**
26
34
  * Represents the Kendo UI PivotGrid component for Angular.
27
35
  */
28
36
  export class PivotGridComponent {
29
- constructor(hostEl, zone, dataService, _scrollbarWidthService) {
30
- this.hostEl = hostEl;
37
+ constructor(hostEl, zone, dataService, localization, _scrollbarWidthService) {
31
38
  this.zone = zone;
32
39
  this.dataService = dataService;
40
+ this.localization = localization;
33
41
  this.hostClass = true;
34
42
  this.ariaRole = 'grid';
35
43
  /**
@@ -41,12 +49,13 @@ export class PivotGridComponent {
41
49
  this.resizeObservers = [];
42
50
  this._loaderSettings = DEFAULT_LOADER_SETTINGS;
43
51
  this.subs = new Subscription();
52
+ this.rtl = false;
44
53
  this.resizeContainer = (axis, element) => {
45
54
  const isRows = axis === 'Rows';
46
- const wrapper = this.hostEl.nativeElement;
55
+ const table = this.table.nativeElement;
47
56
  const size = isRows ? 'offsetHeight' : 'offsetWidth';
48
- wrapper.style[`gridTemplate${axis}`] = '';
49
- wrapper.style[`gridTemplate${axis}`] = `${element[size]}px 1fr`;
57
+ table.style[`gridTemplate${axis}`] = '';
58
+ table.style[`gridTemplate${axis}`] = `${element[size]}px 1fr`;
50
59
  };
51
60
  this.handleScroll = (event) => {
52
61
  if (event.target === this.valuesTable.nativeElement) {
@@ -63,8 +72,31 @@ export class PivotGridComponent {
63
72
  }
64
73
  };
65
74
  validatePackage(packageMetadata);
75
+ this.subs.add(this.localization.changes.subscribe(({ rtl }) => {
76
+ this.rtl = rtl;
77
+ this.direction = this.rtl ? 'rtl' : 'ltr';
78
+ }));
66
79
  dataService.wrapper = hostEl.nativeElement;
67
80
  }
81
+ get rightPositionClass() {
82
+ var _a;
83
+ return ((_a = this.configuratorSettings) === null || _a === void 0 ? void 0 : _a.position) === 'right';
84
+ }
85
+ get leftPositionClass() {
86
+ var _a;
87
+ return ((_a = this.configuratorSettings) === null || _a === void 0 ? void 0 : _a.position) === 'left';
88
+ }
89
+ get bottomPositionClass() {
90
+ var _a;
91
+ return ((_a = this.configuratorSettings) === null || _a === void 0 ? void 0 : _a.position) === 'bottom';
92
+ }
93
+ get topPositionClass() {
94
+ var _a;
95
+ return ((_a = this.configuratorSettings) === null || _a === void 0 ? void 0 : _a.position) === 'top';
96
+ }
97
+ get dir() {
98
+ return this.direction;
99
+ }
68
100
  /**
69
101
  * Specify the type, size and color of the PivotGrid's loader.
70
102
  *
@@ -80,6 +112,15 @@ export class PivotGridComponent {
80
112
  get loaderSettings() {
81
113
  return this._loaderSettings;
82
114
  }
115
+ /**
116
+ * @hidden
117
+ */
118
+ get loadingText() {
119
+ return this.localization.get('loading');
120
+ }
121
+ get configuratorSettings() {
122
+ return this.configurator && Object.assign({}, DEFAULT_CONFIGURATOR_SETTINGS, this.configurator);
123
+ }
83
124
  ngAfterViewInit() {
84
125
  if (isDocumentAvailable()) {
85
126
  this.zone.runOutsideAngular(() => {
@@ -102,67 +143,277 @@ export class PivotGridComponent {
102
143
  this.resizeObservers.forEach(o => o.disconnect());
103
144
  this.subs.unsubscribe();
104
145
  }
146
+ /**
147
+ * @hidden
148
+ */
149
+ messageFor(localizationToken) {
150
+ return this.localization.get(localizationToken);
151
+ }
105
152
  }
106
- PivotGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.PivotGridDataService }, { token: i2.ScrollbarWidthService }], target: i0.ɵɵFactoryTarget.Component });
107
- PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridComponent, selector: "kendo-pivotgrid", inputs: { loaderSettings: "loaderSettings", columnHeadersWidth: "columnHeadersWidth" }, host: { properties: { "class.k-pivotgrid": "this.hostClass", "attr.role": "this.ariaRole" } }, providers: [
108
- PivotGridDataService
109
- ], viewQueries: [{ propertyName: "colHeadersTable", first: true, predicate: ["colHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "rowHeadersTable", first: true, predicate: ["rowHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "valuesTable", first: true, predicate: ["valuesTable"], descendants: true, read: ElementRef }], ngImport: i0, template: `
110
- <span class="k-pivotgrid-empty-cell"></span>
111
- <kendo-pivotgrid-table
112
- #colHeadersTable
113
- [colWidth]="columnHeadersWidth"
114
- class="k-pivotgrid-column-headers"
115
- tableType="columnHeader"></kendo-pivotgrid-table>
116
- <kendo-pivotgrid-table
117
- #rowHeadersTable
118
- class="k-pivotgrid-row-headers"
119
- tableType="rowHeader"></kendo-pivotgrid-table>
120
- <kendo-pivotgrid-table
121
- #valuesTable
122
- [colWidth]="columnHeadersWidth"
123
- class="k-pivotgrid-values"
124
- tableType="values"></kendo-pivotgrid-table>
125
-
126
- <div *ngIf="loading" class="k-loader">
127
- <kendo-loader
128
- [type]="loaderSettings?.type"
129
- [themeColor]="loaderSettings?.themeColor"
130
- [size]="loaderSettings?.size"
131
- >
132
- </kendo-loader>
153
+ PivotGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.PivotGridDataService }, { token: i2.LocalizationService }, { token: i3.ScrollbarWidthService }], target: i0.ɵɵFactoryTarget.Component });
154
+ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridComponent, selector: "kendo-pivotgrid", inputs: { loaderSettings: "loaderSettings", configurator: "configurator", columnHeadersWidth: "columnHeadersWidth" }, host: { properties: { "class.k-d-flex": "this.hostClass", "class.k-pos-relative": "this.hostClass", "class.k-flex-row": "this.rightPositionClass", "class.k-flex-row-reverse": "this.leftPositionClass", "class.k-flex-column": "this.bottomPositionClass", "class.k-flex-column-reverse": "this.topPositionClass", "attr.dir": "this.dir", "attr.role": "this.ariaRole" } }, providers: [
155
+ PivotGridDataService,
156
+ LocalizationService,
157
+ {
158
+ provide: L10N_PREFIX,
159
+ useValue: 'kendo.pivotgrid'
160
+ }
161
+ ], viewQueries: [{ propertyName: "colHeadersTable", first: true, predicate: ["colHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "rowHeadersTable", first: true, predicate: ["rowHeadersTable"], descendants: true, read: ElementRef }, { propertyName: "valuesTable", first: true, predicate: ["valuesTable"], descendants: true, read: ElementRef }, { propertyName: "table", first: true, predicate: ["table"], descendants: true, read: ElementRef }], ngImport: i0, template: `
162
+ <ng-container kendoPivotGridLocalizedMessages
163
+ i18n-loading="kendo.pivotgrid.loading|The loading text"
164
+ loading="Loading"
165
+
166
+ i18n-emptyCellLabel="kendo.pivotgrid.emptyCellLabel|The value of the aria-label attribute placed on the focusable empty cell element"
167
+ emptyCellLabel="PivotGrid Empty Cell"
168
+
169
+ i18n-fieldMenuFilterItemLabel="kendo.pivotgrid.fieldMenuFilterItemLabel|The text content of the filter item in the column and row fields menu"
170
+ fieldMenuFilterItemLabel="Filter"
171
+
172
+ i18n-fieldMenuSortAscendingItemLabel="kendo.pivotgrid.fieldMenuSortAscendingItemLabel|The text content of the sort ascending item in the column and row fields menu"
173
+ fieldMenuSortAscendingItemLabel="Sort ascending"
174
+
175
+ i18n-fieldMenuSortDescendingItemLabel="kendo.pivotgrid.fieldMenuSortDescendingItemLabel|The text content of the sort descending item in the column and row fields menu"
176
+ fieldMenuSortDescendingItemLabel="Sort descending"
177
+
178
+ i18n-filterInputLabel="kendo.pivotgrid.filterInputLabel|The label of the filter input"
179
+ filterInputLabel="{{ '{fields} Filter' }}"
180
+
181
+ i18n-filterOperatorsDropDownLabel="kendo.pivotgrid.filterOperatorsDropDownLabel|The label of the filter operators DropDownList"
182
+ filterOperatorsDropDownLabel="{{ '{fields} Filter Operators' }}"
183
+
184
+ i18n-filterEqOperator="kendo.pivotgrid.filterEqOperator|The text of the equal filter operator"
185
+ filterEqOperator="Is equal to"
186
+
187
+ i18n-filterNotEqOperator="kendo.pivotgrid.filterNotEqOperator|The text of the not equal filter operator"
188
+ filterNotEqOperator="Is not equal to"
189
+
190
+ i18n-filterIsNullOperator="kendo.pivotgrid.filterIsNullOperator|The text of the is null filter operator"
191
+ filterIsNullOperator="Is null"
192
+
193
+ i18n-filterIsNotNullOperator="kendo.pivotgrid.filterIsNotNullOperator|The text of the is not null filter operator"
194
+ filterIsNotNullOperator="Is not null"
195
+
196
+ i18n-filterIsEmptyOperator="kendo.pivotgrid.filterIsEmptyOperator|The text of the is empty filter operator"
197
+ filterIsEmptyOperator="Is empty"
198
+
199
+ i18n-filterIsNotEmptyOperator="kendo.pivotgrid.filterIsNotEmptyOperator|The text of the is not empty filter operator"
200
+ filterIsNotEmptyOperator="Is not empty"
201
+
202
+ i18n-filterStartsWithOperator="kendo.pivotgrid.filterStartsWithOperator|The text of the starts with filter operator"
203
+ filterStartsWithOperator="Starts with"
204
+
205
+ i18n-filterContainsOperator="kendo.pivotgrid.filterContainsOperator|The text of the contains filter operator"
206
+ filterContainsOperator="Contains"
207
+
208
+ i18n-filterNotContainsOperator="kendo.pivotgrid.filterNotContainsOperator|The text of the does not contain filter operator"
209
+ filterNotContainsOperator="Does not contain"
210
+
211
+ i18n-filterEndsWithOperator="kendo.pivotgrid.filterEndsWithOperator|The text of the ends with filter operator"
212
+ filterEndsWithOperator="Ends with"
213
+
214
+ i18n-filterFilterButton="kendo.pivotgrid.filterFilterButton|The text of the filter button"
215
+ filterFilterButton="Filter"
216
+
217
+ i18n-filterClearButton="kendo.pivotgrid.filterClearButton|The text of the clear filter button"
218
+ filterClearButton="Clear"
219
+
220
+ i18n-configuratorButtonText="kendo.pivotgrid.configuratorButtonText|The text content of the button that opens and closes the PivotGrid configurator"
221
+ configuratorButtonText="Change Settings"
222
+
223
+ i18n-configuratorHeaderText="kendo.pivotgrid.configuratorHeaderText|The text content of the PivotGrid configurator title element"
224
+ configuratorHeaderText="Settings"
225
+
226
+ i18n-configuratorFieldsText="kendo.pivotgrid.configuratorFieldsText|The text content of the PivotGrid configurator fields section title element"
227
+ configuratorFieldsText="Fields"
228
+
229
+ i18n-configuratorColumnsText="kendo.pivotgrid.configuratorColumnsText|The text content of the PivotGrid configurator columns section title element"
230
+ configuratorColumnsText="Columns"
231
+
232
+ i18n-configuratorRowsText="kendo.pivotgrid.configuratorRowsText|The text content of the PivotGrid configurator rows section title element"
233
+ configuratorRowsText="Rows"
234
+
235
+ i18n-configuratorValuesText="kendo.pivotgrid.configuratorValuesText|The text content of the PivotGrid configurator values section title element"
236
+ configuratorValuesText="Values"
237
+
238
+ i18n-configuratorCancelButtonText="kendo.pivotgrid.configuratorCancelButtonText|The text content of the PivotGrid configurator configurator Cancel button"
239
+ configuratorCancelButtonText="Cancel"
240
+
241
+ i18n-configuratorApplyButtonText="kendo.pivotgrid.configuratorApplyButtonText|The text content of the PivotGrid configurator configurator Apply button"
242
+ configuratorApplyButtonText="Apply"></ng-container>
243
+
244
+ <div #table class="k-pivotgrid">
245
+ <span class="k-pivotgrid-empty-cell" [attr.aria-label]="messageFor('emptyCellLabel')"></span>
246
+ <kendo-pivotgrid-table
247
+ #colHeadersTable
248
+ [colWidth]="columnHeadersWidth"
249
+ class="k-pivotgrid-column-headers"
250
+ tableType="columnHeader"></kendo-pivotgrid-table>
251
+ <kendo-pivotgrid-table
252
+ #rowHeadersTable
253
+ class="k-pivotgrid-row-headers"
254
+ tableType="rowHeader"></kendo-pivotgrid-table>
255
+ <kendo-pivotgrid-table
256
+ #valuesTable
257
+ [colWidth]="columnHeadersWidth"
258
+ class="k-pivotgrid-values"
259
+ tableType="values"></kendo-pivotgrid-table>
260
+
261
+ <div *ngIf="loading" class="k-loader">
262
+ <kendo-loader
263
+ [type]="loaderSettings?.type"
264
+ [themeColor]="loaderSettings?.themeColor"
265
+ [size]="loaderSettings?.size"
266
+ >
267
+ </kendo-loader>
268
+ <span class="k-loading-text">{{ loadingText }}</span>
269
+ </div>
133
270
  </div>
134
- `, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "], components: [{ type: i3.PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType", "colWidth"] }, { type: i4.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
271
+
272
+ <kendo-pivotgrid-configurator
273
+ *ngIf="showConfigurator"
274
+ [horizontal]="configuratorSettings.horizontal">
275
+ </kendo-pivotgrid-configurator>
276
+
277
+ <div *ngIf="configurator"
278
+ class="k-pivotgrid-configurator-button"
279
+ (click)="showConfigurator = !showConfigurator">
280
+ <span>{{ messageFor('configuratorButtonText') }}<span class="k-icon k-i-gear k-color-inherit"></span>
281
+ </span>
282
+ </div>
283
+ `, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "], components: [{ type: i4.PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType", "colWidth"] }, { type: i5.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }, { type: i6.PivotGridConfiguratorComponent, selector: "kendo-pivotgrid-configurator", inputs: ["horizontal"] }], directives: [{ type: i7.LocalizedMessagesDirective, selector: "[kendoPivotGridLocalizedMessages]" }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
135
284
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, decorators: [{
136
285
  type: Component,
137
286
  args: [{
138
287
  selector: 'kendo-pivotgrid',
139
288
  providers: [
140
- PivotGridDataService
289
+ PivotGridDataService,
290
+ LocalizationService,
291
+ {
292
+ provide: L10N_PREFIX,
293
+ useValue: 'kendo.pivotgrid'
294
+ }
141
295
  ],
142
296
  template: `
143
- <span class="k-pivotgrid-empty-cell"></span>
144
- <kendo-pivotgrid-table
145
- #colHeadersTable
146
- [colWidth]="columnHeadersWidth"
147
- class="k-pivotgrid-column-headers"
148
- tableType="columnHeader"></kendo-pivotgrid-table>
149
- <kendo-pivotgrid-table
150
- #rowHeadersTable
151
- class="k-pivotgrid-row-headers"
152
- tableType="rowHeader"></kendo-pivotgrid-table>
153
- <kendo-pivotgrid-table
154
- #valuesTable
155
- [colWidth]="columnHeadersWidth"
156
- class="k-pivotgrid-values"
157
- tableType="values"></kendo-pivotgrid-table>
158
-
159
- <div *ngIf="loading" class="k-loader">
160
- <kendo-loader
161
- [type]="loaderSettings?.type"
162
- [themeColor]="loaderSettings?.themeColor"
163
- [size]="loaderSettings?.size"
164
- >
165
- </kendo-loader>
297
+ <ng-container kendoPivotGridLocalizedMessages
298
+ i18n-loading="kendo.pivotgrid.loading|The loading text"
299
+ loading="Loading"
300
+
301
+ i18n-emptyCellLabel="kendo.pivotgrid.emptyCellLabel|The value of the aria-label attribute placed on the focusable empty cell element"
302
+ emptyCellLabel="PivotGrid Empty Cell"
303
+
304
+ i18n-fieldMenuFilterItemLabel="kendo.pivotgrid.fieldMenuFilterItemLabel|The text content of the filter item in the column and row fields menu"
305
+ fieldMenuFilterItemLabel="Filter"
306
+
307
+ i18n-fieldMenuSortAscendingItemLabel="kendo.pivotgrid.fieldMenuSortAscendingItemLabel|The text content of the sort ascending item in the column and row fields menu"
308
+ fieldMenuSortAscendingItemLabel="Sort ascending"
309
+
310
+ i18n-fieldMenuSortDescendingItemLabel="kendo.pivotgrid.fieldMenuSortDescendingItemLabel|The text content of the sort descending item in the column and row fields menu"
311
+ fieldMenuSortDescendingItemLabel="Sort descending"
312
+
313
+ i18n-filterInputLabel="kendo.pivotgrid.filterInputLabel|The label of the filter input"
314
+ filterInputLabel="{{ '{fields} Filter' }}"
315
+
316
+ i18n-filterOperatorsDropDownLabel="kendo.pivotgrid.filterOperatorsDropDownLabel|The label of the filter operators DropDownList"
317
+ filterOperatorsDropDownLabel="{{ '{fields} Filter Operators' }}"
318
+
319
+ i18n-filterEqOperator="kendo.pivotgrid.filterEqOperator|The text of the equal filter operator"
320
+ filterEqOperator="Is equal to"
321
+
322
+ i18n-filterNotEqOperator="kendo.pivotgrid.filterNotEqOperator|The text of the not equal filter operator"
323
+ filterNotEqOperator="Is not equal to"
324
+
325
+ i18n-filterIsNullOperator="kendo.pivotgrid.filterIsNullOperator|The text of the is null filter operator"
326
+ filterIsNullOperator="Is null"
327
+
328
+ i18n-filterIsNotNullOperator="kendo.pivotgrid.filterIsNotNullOperator|The text of the is not null filter operator"
329
+ filterIsNotNullOperator="Is not null"
330
+
331
+ i18n-filterIsEmptyOperator="kendo.pivotgrid.filterIsEmptyOperator|The text of the is empty filter operator"
332
+ filterIsEmptyOperator="Is empty"
333
+
334
+ i18n-filterIsNotEmptyOperator="kendo.pivotgrid.filterIsNotEmptyOperator|The text of the is not empty filter operator"
335
+ filterIsNotEmptyOperator="Is not empty"
336
+
337
+ i18n-filterStartsWithOperator="kendo.pivotgrid.filterStartsWithOperator|The text of the starts with filter operator"
338
+ filterStartsWithOperator="Starts with"
339
+
340
+ i18n-filterContainsOperator="kendo.pivotgrid.filterContainsOperator|The text of the contains filter operator"
341
+ filterContainsOperator="Contains"
342
+
343
+ i18n-filterNotContainsOperator="kendo.pivotgrid.filterNotContainsOperator|The text of the does not contain filter operator"
344
+ filterNotContainsOperator="Does not contain"
345
+
346
+ i18n-filterEndsWithOperator="kendo.pivotgrid.filterEndsWithOperator|The text of the ends with filter operator"
347
+ filterEndsWithOperator="Ends with"
348
+
349
+ i18n-filterFilterButton="kendo.pivotgrid.filterFilterButton|The text of the filter button"
350
+ filterFilterButton="Filter"
351
+
352
+ i18n-filterClearButton="kendo.pivotgrid.filterClearButton|The text of the clear filter button"
353
+ filterClearButton="Clear"
354
+
355
+ i18n-configuratorButtonText="kendo.pivotgrid.configuratorButtonText|The text content of the button that opens and closes the PivotGrid configurator"
356
+ configuratorButtonText="Change Settings"
357
+
358
+ i18n-configuratorHeaderText="kendo.pivotgrid.configuratorHeaderText|The text content of the PivotGrid configurator title element"
359
+ configuratorHeaderText="Settings"
360
+
361
+ i18n-configuratorFieldsText="kendo.pivotgrid.configuratorFieldsText|The text content of the PivotGrid configurator fields section title element"
362
+ configuratorFieldsText="Fields"
363
+
364
+ i18n-configuratorColumnsText="kendo.pivotgrid.configuratorColumnsText|The text content of the PivotGrid configurator columns section title element"
365
+ configuratorColumnsText="Columns"
366
+
367
+ i18n-configuratorRowsText="kendo.pivotgrid.configuratorRowsText|The text content of the PivotGrid configurator rows section title element"
368
+ configuratorRowsText="Rows"
369
+
370
+ i18n-configuratorValuesText="kendo.pivotgrid.configuratorValuesText|The text content of the PivotGrid configurator values section title element"
371
+ configuratorValuesText="Values"
372
+
373
+ i18n-configuratorCancelButtonText="kendo.pivotgrid.configuratorCancelButtonText|The text content of the PivotGrid configurator configurator Cancel button"
374
+ configuratorCancelButtonText="Cancel"
375
+
376
+ i18n-configuratorApplyButtonText="kendo.pivotgrid.configuratorApplyButtonText|The text content of the PivotGrid configurator configurator Apply button"
377
+ configuratorApplyButtonText="Apply"></ng-container>
378
+
379
+ <div #table class="k-pivotgrid">
380
+ <span class="k-pivotgrid-empty-cell" [attr.aria-label]="messageFor('emptyCellLabel')"></span>
381
+ <kendo-pivotgrid-table
382
+ #colHeadersTable
383
+ [colWidth]="columnHeadersWidth"
384
+ class="k-pivotgrid-column-headers"
385
+ tableType="columnHeader"></kendo-pivotgrid-table>
386
+ <kendo-pivotgrid-table
387
+ #rowHeadersTable
388
+ class="k-pivotgrid-row-headers"
389
+ tableType="rowHeader"></kendo-pivotgrid-table>
390
+ <kendo-pivotgrid-table
391
+ #valuesTable
392
+ [colWidth]="columnHeadersWidth"
393
+ class="k-pivotgrid-values"
394
+ tableType="values"></kendo-pivotgrid-table>
395
+
396
+ <div *ngIf="loading" class="k-loader">
397
+ <kendo-loader
398
+ [type]="loaderSettings?.type"
399
+ [themeColor]="loaderSettings?.themeColor"
400
+ [size]="loaderSettings?.size"
401
+ >
402
+ </kendo-loader>
403
+ <span class="k-loading-text">{{ loadingText }}</span>
404
+ </div>
405
+ </div>
406
+
407
+ <kendo-pivotgrid-configurator
408
+ *ngIf="showConfigurator"
409
+ [horizontal]="configuratorSettings.horizontal">
410
+ </kendo-pivotgrid-configurator>
411
+
412
+ <div *ngIf="configurator"
413
+ class="k-pivotgrid-configurator-button"
414
+ (click)="showConfigurator = !showConfigurator">
415
+ <span>{{ messageFor('configuratorButtonText') }}<span class="k-icon k-i-gear k-color-inherit"></span>
416
+ </span>
166
417
  </div>
167
418
  `,
168
419
  styles: [`
@@ -175,9 +426,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
175
426
  }
176
427
  `]
177
428
  }]
178
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.PivotGridDataService }, { type: i2.ScrollbarWidthService }]; }, propDecorators: { hostClass: [{
429
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.PivotGridDataService }, { type: i2.LocalizationService }, { type: i3.ScrollbarWidthService }]; }, propDecorators: { hostClass: [{
430
+ type: HostBinding,
431
+ args: ['class.k-d-flex']
432
+ }, {
433
+ type: HostBinding,
434
+ args: ['class.k-pos-relative']
435
+ }], rightPositionClass: [{
436
+ type: HostBinding,
437
+ args: ['class.k-flex-row']
438
+ }], leftPositionClass: [{
439
+ type: HostBinding,
440
+ args: ['class.k-flex-row-reverse']
441
+ }], bottomPositionClass: [{
179
442
  type: HostBinding,
180
- args: ['class.k-pivotgrid']
443
+ args: ['class.k-flex-column']
444
+ }], topPositionClass: [{
445
+ type: HostBinding,
446
+ args: ['class.k-flex-column-reverse']
447
+ }], dir: [{
448
+ type: HostBinding,
449
+ args: ['attr.dir']
181
450
  }], ariaRole: [{
182
451
  type: HostBinding,
183
452
  args: ['attr.role']
@@ -190,8 +459,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
190
459
  }], valuesTable: [{
191
460
  type: ViewChild,
192
461
  args: ['valuesTable', { read: ElementRef }]
462
+ }], table: [{
463
+ type: ViewChild,
464
+ args: ['table', { read: ElementRef }]
193
465
  }], loaderSettings: [{
194
466
  type: Input
467
+ }], configurator: [{
468
+ type: Input
195
469
  }], columnHeadersWidth: [{
196
470
  type: Input
197
471
  }] } });
@@ -4,26 +4,50 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { CommonModule } from '@angular/common';
6
6
  import { NgModule } from '@angular/core';
7
- import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
8
7
  import { IndicatorsModule } from "@progress/kendo-angular-indicators";
8
+ import { ButtonsModule } from "@progress/kendo-angular-buttons";
9
+ import { TreeViewModule } from "@progress/kendo-angular-treeview";
9
10
  import { PivotGridComponent } from './pivotgrid.component';
10
11
  import { PivotGridCellDirective } from './rendering/pivotgrid-cell.directive';
11
12
  import { PivotGridTableComponent } from './rendering/pivotgrid-table.component';
12
- import { EventsModule } from '@progress/kendo-angular-common';
13
+ import { DraggableModule, EventsModule } from '@progress/kendo-angular-common';
13
14
  import { PivotLocalBindingDirective } from './data-binding/local-binding.directive';
14
15
  import { PivotOLAPBindingDirective } from './data-binding/olap-binding.directive';
16
+ import { LocalizedMessagesDirective } from './localization/localized-messages.directive';
17
+ import { CustomMessagesComponent } from './localization/custom-messages.component';
18
+ import { PivotGridConfiguratorComponent } from './configurator/configurator.component';
19
+ import { InputsModule } from '@progress/kendo-angular-inputs';
20
+ import { DraggableChipDirective } from './configurator/draggable.directive';
21
+ import { DropTargetDirective } from './configurator/drop-target.directive';
15
22
  import * as i0 from "@angular/core";
16
23
  const IMPORTED_MODULES = [
17
24
  CommonModule,
18
25
  EventsModule,
19
- IndicatorsModule
26
+ IndicatorsModule,
27
+ ButtonsModule,
28
+ TreeViewModule,
29
+ InputsModule,
30
+ DraggableModule
20
31
  ];
21
32
  const DECLARATIONS = [
22
33
  PivotGridComponent,
23
34
  PivotGridTableComponent,
35
+ PivotGridConfiguratorComponent,
24
36
  PivotGridCellDirective,
25
37
  PivotLocalBindingDirective,
26
- PivotOLAPBindingDirective
38
+ PivotOLAPBindingDirective,
39
+ DraggableChipDirective,
40
+ DropTargetDirective,
41
+ LocalizedMessagesDirective,
42
+ CustomMessagesComponent
43
+ ];
44
+ const EXPORTS = [
45
+ PivotGridComponent,
46
+ PivotGridTableComponent,
47
+ PivotGridCellDirective,
48
+ PivotLocalBindingDirective,
49
+ PivotOLAPBindingDirective,
50
+ CustomMessagesComponent
27
51
  ];
28
52
  /**
29
53
  * Sample module
@@ -33,28 +57,31 @@ export class PivotGridModule {
33
57
  PivotGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
34
58
  PivotGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridModule, declarations: [PivotGridComponent,
35
59
  PivotGridTableComponent,
60
+ PivotGridConfiguratorComponent,
36
61
  PivotGridCellDirective,
37
62
  PivotLocalBindingDirective,
38
- PivotOLAPBindingDirective], imports: [CommonModule,
63
+ PivotOLAPBindingDirective,
64
+ DraggableChipDirective,
65
+ DropTargetDirective,
66
+ LocalizedMessagesDirective,
67
+ CustomMessagesComponent], imports: [CommonModule,
39
68
  EventsModule,
40
- IndicatorsModule], exports: [PivotGridComponent,
69
+ IndicatorsModule,
70
+ ButtonsModule,
71
+ TreeViewModule,
72
+ InputsModule,
73
+ DraggableModule], exports: [PivotGridComponent,
41
74
  PivotGridTableComponent,
42
75
  PivotGridCellDirective,
43
76
  PivotLocalBindingDirective,
44
- PivotOLAPBindingDirective] });
45
- PivotGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridModule, providers: [{
46
- provide: L10N_PREFIX,
47
- useValue: 'kendo.pivotgrid'
48
- }], imports: [[...IMPORTED_MODULES]] });
77
+ PivotOLAPBindingDirective,
78
+ CustomMessagesComponent] });
79
+ PivotGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridModule, imports: [[...IMPORTED_MODULES]] });
49
80
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridModule, decorators: [{
50
81
  type: NgModule,
51
82
  args: [{
52
83
  imports: [...IMPORTED_MODULES],
53
84
  declarations: [...DECLARATIONS],
54
- exports: [...DECLARATIONS],
55
- providers: [{
56
- provide: L10N_PREFIX,
57
- useValue: 'kendo.pivotgrid'
58
- }]
85
+ exports: [...EXPORTS]
59
86
  }]
60
87
  }] });
package/esm2015/util.js CHANGED
@@ -64,6 +64,54 @@ export const syncWheel = (event, tables, prop, axis) => {
64
64
  tables[1][prop] += delta;
65
65
  }
66
66
  };
67
+ /**
68
+ * @hidden
69
+ */
70
+ export function cloneTo(obj, result) {
71
+ for (let field in obj) {
72
+ if (obj.hasOwnProperty(field)) {
73
+ const value = obj[field];
74
+ if (Array.isArray(value)) {
75
+ result[field] = value.slice(0);
76
+ }
77
+ else if (value && typeof value === 'object' && !(value instanceof Date)) {
78
+ result[field] = result[field] || {};
79
+ cloneTo(value, result[field]);
80
+ }
81
+ else {
82
+ result[field] = value;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ /**
88
+ * @hidden
89
+ */
90
+ export function clone(obj) {
91
+ const result = {};
92
+ cloneTo(obj, result);
93
+ return result;
94
+ }
95
+ /**
96
+ * @hidden
97
+ */
98
+ const getDocument = element => element.ownerDocument.documentElement;
99
+ /**
100
+ * @hidden
101
+ */
102
+ const getWindow = element => element.ownerDocument.defaultView;
103
+ /**
104
+ * @hidden
105
+ */
106
+ export const offset = element => {
107
+ const { clientTop, clientLeft } = getDocument(element);
108
+ const { pageYOffset, pageXOffset } = getWindow(element);
109
+ const { top, left } = element.getBoundingClientRect();
110
+ return {
111
+ top: top + pageYOffset - clientTop,
112
+ left: left + pageXOffset - clientLeft
113
+ };
114
+ };
67
115
  /**
68
116
  * @hidden
69
117
  */
@@ -87,6 +135,17 @@ export const matchAriaAttributes = (wrapper) => {
87
135
  cell.setAttribute('aria-describedby', colHeaderCellsIds.join(' '));
88
136
  });
89
137
  };
138
+ /**
139
+ * @hidden
140
+ */
141
+ export const position = (target, before) => {
142
+ const targetRect = offset(target);
143
+ const { offsetWidth, offsetHeight } = target;
144
+ const left = targetRect.left + (before ? 0 : offsetWidth);
145
+ const top = targetRect.top + offsetHeight / 2;
146
+ const height = offsetHeight;
147
+ return { left, top, height };
148
+ };
90
149
  /**
91
150
  * @hidden
92
151
  */