@skyux/grids 4.0.6 → 5.0.1
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/LICENSE +21 -0
- package/bundles/skyux-grids.umd.js +864 -744
- package/bundles/skyux-grids.umd.js.map +1 -1
- package/documentation.json +4089 -0
- package/esm2015/modules/grid/grid-adapter.service.js +22 -24
- package/esm2015/modules/grid/grid-cell.component.js +30 -32
- package/esm2015/modules/grid/grid-column.component.js +54 -63
- package/esm2015/modules/grid/grid-column.model.js +1 -1
- package/esm2015/modules/grid/grid.component.js +216 -210
- package/esm2015/modules/grid/grid.module.js +51 -30
- package/esm2015/modules/grid/types/grid-column-alignment.js +2 -1
- package/esm2015/modules/grid/types/grid-column-description-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-column-heading-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-column-inline-help-popover-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-column-width-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-message-type.js +1 -1
- package/esm2015/modules/grid/types/grid-message.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-cancel-args.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-config.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-confirm-args.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-contents.js +2 -1
- package/esm2015/modules/grid/types/grid-selected-rows-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-selected-rows-source.js +1 -1
- package/esm2015/modules/grid/types/grid-ui-config.js +2 -1
- package/esm2015/modules/shared/skyux-grids-resources.module.js +45 -0
- package/esm2015/public-api.js +20 -0
- package/esm2015/skyux-grids.js +2 -6
- package/fesm2015/skyux-grids.js +486 -482
- package/fesm2015/skyux-grids.js.map +1 -1
- package/modules/grid/grid-adapter.service.d.ts +3 -0
- package/modules/grid/grid-cell.component.d.ts +3 -0
- package/modules/grid/grid-column.component.d.ts +5 -1
- package/modules/grid/grid.component.d.ts +6 -4
- package/modules/grid/grid.module.d.ts +16 -0
- package/modules/shared/skyux-grids-resources.module.d.ts +14 -0
- package/package.json +15 -30
- package/{public_api.d.ts → public-api.d.ts} +0 -0
- package/skyux-grids.d.ts +2 -5
- package/CHANGELOG.md +0 -188
- package/bundles/skyux-grids.umd.min.js +0 -16
- package/bundles/skyux-grids.umd.min.js.map +0 -1
- package/esm2015/modules/shared/grids-resources.module.js +0 -20
- package/esm2015/plugin-resources/grids-resources-provider.js +0 -16
- package/esm2015/polyfills.js +0 -29
- package/esm2015/public_api.js +0 -9
- package/esm5/modules/grid/grid-adapter.service.js +0 -106
- package/esm5/modules/grid/grid-cell.component.js +0 -59
- package/esm5/modules/grid/grid-column.component.js +0 -129
- package/esm5/modules/grid/grid-column.model.js +0 -27
- package/esm5/modules/grid/grid.component.js +0 -1016
- package/esm5/modules/grid/grid.module.js +0 -53
- package/esm5/modules/grid/types/grid-column-alignment.js +0 -1
- package/esm5/modules/grid/types/grid-column-description-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-column-heading-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-column-inline-help-popover-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-column-width-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-message-type.js +0 -20
- package/esm5/modules/grid/types/grid-message.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-cancel-args.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-config.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-confirm-args.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-contents.js +0 -1
- package/esm5/modules/grid/types/grid-selected-rows-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-selected-rows-source.js +0 -12
- package/esm5/modules/grid/types/grid-ui-config.js +0 -1
- package/esm5/modules/shared/grids-resources.module.js +0 -23
- package/esm5/plugin-resources/grids-resources-provider.js +0 -17
- package/esm5/polyfills.js +0 -29
- package/esm5/public_api.js +0 -9
- package/esm5/skyux-grids.js +0 -9
- package/fesm5/skyux-grids.js +0 -1463
- package/fesm5/skyux-grids.js.map +0 -1
- package/modules/shared/grids-resources.module.d.ts +0 -2
- package/plugin-resources/grids-resources-provider.d.ts +0 -5
- package/polyfills.d.ts +0 -0
- package/skyux-grids.metadata.json +0 -1
- package/src/assets/locales/resources_en_US.json +0 -6
package/fesm2015/skyux-grids.js
CHANGED
|
@@ -1,54 +1,113 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, TemplateRef, Component, ChangeDetectionStrategy, Input, ContentChildren, ViewContainerRef, ViewChild, Output, ViewChildren, HostListener, NgModule } from '@angular/core';
|
|
3
|
+
import * as i8 from '@angular/common';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i10 from '@angular/forms';
|
|
4
6
|
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import * as i2 from 'ng2-dragula';
|
|
5
8
|
import { DragulaService, DragulaModule } from 'ng2-dragula';
|
|
6
|
-
import
|
|
9
|
+
import * as i1 from '@skyux/core';
|
|
10
|
+
import { SkyAffixAutoFitContext, SkyAffixModule, SkyOverlayModule } from '@skyux/core';
|
|
11
|
+
import * as i5 from '@skyux/forms';
|
|
7
12
|
import { SkyCheckboxModule } from '@skyux/forms';
|
|
13
|
+
import * as i4 from '@skyux/indicators';
|
|
8
14
|
import { SkyHelpInlineModule, SkyIconModule, SkyTextHighlightModule } from '@skyux/indicators';
|
|
15
|
+
import * as i7 from '@skyux/layout';
|
|
9
16
|
import { SkyInlineDeleteModule } from '@skyux/layout';
|
|
17
|
+
import * as i9 from '@skyux/popovers';
|
|
10
18
|
import { SkyPopoverModule } from '@skyux/popovers';
|
|
19
|
+
import { getData, ListItemModel } from '@skyux/list-builder-common';
|
|
11
20
|
import { Subject, BehaviorSubject, fromEvent, merge } from 'rxjs';
|
|
12
21
|
import { takeUntil, take, map, distinctUntilChanged, takeWhile } from 'rxjs/operators';
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
var SkyGridMessageType;
|
|
17
|
-
(function (SkyGridMessageType) {
|
|
18
|
-
/**
|
|
19
|
-
* Selects the multiselect checkboxes for all rows in the grid.
|
|
20
|
-
*/
|
|
21
|
-
SkyGridMessageType[SkyGridMessageType["SelectAll"] = 0] = "SelectAll";
|
|
22
|
-
/**
|
|
23
|
-
* Clears the multiselect checkboxes for all rows in the grid.
|
|
24
|
-
*/
|
|
25
|
-
SkyGridMessageType[SkyGridMessageType["ClearAll"] = 1] = "ClearAll";
|
|
26
|
-
/**
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
SkyGridMessageType[SkyGridMessageType["PromptDeleteRow"] = 2] = "PromptDeleteRow";
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
SkyGridMessageType[SkyGridMessageType["AbortDeleteRow"] = 3] = "AbortDeleteRow";
|
|
34
|
-
})(SkyGridMessageType || (SkyGridMessageType = {}));
|
|
22
|
+
import * as i11 from '@skyux/i18n';
|
|
23
|
+
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
35
24
|
|
|
25
|
+
const GRID_HEADER_DRAGGING_CLASS = 'sky-grid-header-dragging';
|
|
26
|
+
const GRID_HEADER_LOCKED_SELECTOR = '.sky-grid-header-locked';
|
|
27
|
+
const GRID_HEADER_RESIZE_HANDLE = '.sky-grid-resize-handle';
|
|
28
|
+
const GRID_ROW_DELETE_SELECTOR = '.sky-grid-row-delete-heading';
|
|
29
|
+
const GRID_MULTISELECT_SELECTOR = '.sky-grid-multiselect-cell';
|
|
36
30
|
/**
|
|
37
31
|
* @internal
|
|
38
32
|
*/
|
|
39
|
-
|
|
40
|
-
(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
class SkyGridAdapterService {
|
|
34
|
+
constructor(rendererFactory) {
|
|
35
|
+
this.rendererFactory = rendererFactory;
|
|
36
|
+
this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
|
|
37
|
+
}
|
|
38
|
+
initializeDragAndDrop(dragulaService, dropCallback) {
|
|
39
|
+
dragulaService.drag.subscribe(([, source]) => source.classList.add(GRID_HEADER_DRAGGING_CLASS));
|
|
40
|
+
dragulaService.dragend.subscribe(([, source]) => source.classList.remove(GRID_HEADER_DRAGGING_CLASS));
|
|
41
|
+
dragulaService.drop.subscribe(([, , container]) => {
|
|
42
|
+
let columnIds = [];
|
|
43
|
+
let nodes = container.querySelectorAll(`th:not(${GRID_MULTISELECT_SELECTOR}):not(${GRID_ROW_DELETE_SELECTOR})`);
|
|
44
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
45
|
+
let el = nodes[i];
|
|
46
|
+
let id = el.getAttribute('sky-cmp-id');
|
|
47
|
+
columnIds.push(id);
|
|
48
|
+
}
|
|
49
|
+
dropCallback(columnIds);
|
|
50
|
+
});
|
|
51
|
+
dragulaService.setOptions('sky-grid-heading', {
|
|
52
|
+
moves: (el, container, handle) => {
|
|
53
|
+
const columns = container.querySelectorAll('th div');
|
|
54
|
+
const isLeftOfLocked = this.isLeftOfLocked(handle, columns);
|
|
55
|
+
return (!el.querySelector(GRID_HEADER_LOCKED_SELECTOR) &&
|
|
56
|
+
handle !== undefined &&
|
|
57
|
+
!handle.matches(GRID_HEADER_RESIZE_HANDLE) &&
|
|
58
|
+
!handle.matches(GRID_MULTISELECT_SELECTOR) &&
|
|
59
|
+
!handle.matches(GRID_ROW_DELETE_SELECTOR) &&
|
|
60
|
+
!isLeftOfLocked);
|
|
61
|
+
},
|
|
62
|
+
accepts: (el, target, source, sibling) => {
|
|
63
|
+
if (sibling === undefined || !sibling) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
const columns = source.querySelectorAll('th div');
|
|
67
|
+
const siblingDiv = sibling.querySelector('div');
|
|
68
|
+
const isLeftOfLocked = this.isLeftOfLocked(siblingDiv, columns);
|
|
69
|
+
return (!sibling.matches(GRID_HEADER_LOCKED_SELECTOR) &&
|
|
70
|
+
!sibling.matches(GRID_HEADER_RESIZE_HANDLE) &&
|
|
71
|
+
!isLeftOfLocked);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
getRowHeight(el, index) {
|
|
76
|
+
return (el.nativeElement.querySelectorAll('tbody tr')[index].scrollHeight + 'px');
|
|
77
|
+
}
|
|
78
|
+
setStyle(el, style, value) {
|
|
79
|
+
if (el) {
|
|
80
|
+
this.renderer.setStyle(el.nativeElement, style, value);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
isLeftOfLocked(handle, columns) {
|
|
84
|
+
let sourceColumn = handle;
|
|
85
|
+
for (let column of Array.from(columns)) {
|
|
86
|
+
if (column.contains(handle)) {
|
|
87
|
+
sourceColumn = column;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
for (let i = columns.length - 1; i >= 0; i--) {
|
|
91
|
+
if (columns[i].classList.contains('sky-grid-header-locked')) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (columns[i] === sourceColumn) {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
SkyGridAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridAdapterService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
102
|
+
SkyGridAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridAdapterService });
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridAdapterService, decorators: [{
|
|
104
|
+
type: Injectable
|
|
105
|
+
}], ctorParameters: function () { return [{ type: i0.RendererFactory2 }]; } });
|
|
47
106
|
|
|
48
107
|
/**
|
|
49
108
|
* Specifies the column information.
|
|
50
109
|
*/
|
|
51
|
-
|
|
110
|
+
class SkyGridColumnComponent {
|
|
52
111
|
constructor() {
|
|
53
112
|
/**
|
|
54
113
|
* Specifies the horizontal alignment of the column's data and header.
|
|
@@ -65,7 +124,7 @@ let SkyGridColumnComponent = class SkyGridColumnComponent {
|
|
|
65
124
|
* the column executes a string compare on the column data.
|
|
66
125
|
* @default (value, searchText) => value.toString().toLowerCase().indexOf(searchText) !== -1
|
|
67
126
|
*/
|
|
68
|
-
|
|
127
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
69
128
|
this.searchFunction = this.search;
|
|
70
129
|
this.descriptionChanges = new EventEmitter();
|
|
71
130
|
this.descriptionModelChanges = new EventEmitter();
|
|
@@ -79,7 +138,7 @@ let SkyGridColumnComponent = class SkyGridColumnComponent {
|
|
|
79
138
|
this.headingModelChanges.emit({
|
|
80
139
|
value: this.heading,
|
|
81
140
|
id: this.id,
|
|
82
|
-
field: this.field
|
|
141
|
+
field: this.field,
|
|
83
142
|
});
|
|
84
143
|
}
|
|
85
144
|
if (changes.description && changes.description.firstChange === false) {
|
|
@@ -87,14 +146,15 @@ let SkyGridColumnComponent = class SkyGridColumnComponent {
|
|
|
87
146
|
this.descriptionModelChanges.emit({
|
|
88
147
|
value: this.description,
|
|
89
148
|
id: this.id,
|
|
90
|
-
field: this.field
|
|
149
|
+
field: this.field,
|
|
91
150
|
});
|
|
92
151
|
}
|
|
93
|
-
if (changes.inlineHelpPopover &&
|
|
152
|
+
if (changes.inlineHelpPopover &&
|
|
153
|
+
changes.inlineHelpPopover.firstChange === false) {
|
|
94
154
|
this.inlineHelpPopoverModelChanges.emit({
|
|
95
155
|
value: this.inlineHelpPopover,
|
|
96
156
|
id: this.id,
|
|
97
|
-
field: this.field
|
|
157
|
+
field: this.field,
|
|
98
158
|
});
|
|
99
159
|
}
|
|
100
160
|
}
|
|
@@ -112,59 +172,50 @@ let SkyGridColumnComponent = class SkyGridColumnComponent {
|
|
|
112
172
|
/* tslint:enable */
|
|
113
173
|
return false;
|
|
114
174
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
]
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
],
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
],
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
],
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
],
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
]
|
|
158
|
-
|
|
159
|
-
ContentChildren(TemplateRef)
|
|
160
|
-
], SkyGridColumnComponent.prototype, "templates", void 0);
|
|
161
|
-
SkyGridColumnComponent = __decorate([
|
|
162
|
-
Component({
|
|
163
|
-
selector: 'sky-grid-column',
|
|
164
|
-
template: '<ng-content></ng-content>',
|
|
165
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
166
|
-
})
|
|
167
|
-
], SkyGridColumnComponent);
|
|
175
|
+
}
|
|
176
|
+
SkyGridColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
177
|
+
SkyGridColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyGridColumnComponent, selector: "sky-grid-column", inputs: { alignment: "alignment", description: "description", excludeFromHighlighting: "excludeFromHighlighting", field: "field", heading: "heading", hidden: "hidden", id: "id", inlineHelpPopover: "inlineHelpPopover", isSortable: "isSortable", locked: "locked", searchFunction: ["search", "searchFunction"], type: "type", templateInput: ["template", "templateInput"], width: "width" }, queries: [{ propertyName: "templates", predicate: TemplateRef }], usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridColumnComponent, decorators: [{
|
|
179
|
+
type: Component,
|
|
180
|
+
args: [{
|
|
181
|
+
selector: 'sky-grid-column',
|
|
182
|
+
template: '<ng-content></ng-content>',
|
|
183
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
184
|
+
}]
|
|
185
|
+
}], propDecorators: { alignment: [{
|
|
186
|
+
type: Input
|
|
187
|
+
}], description: [{
|
|
188
|
+
type: Input
|
|
189
|
+
}], excludeFromHighlighting: [{
|
|
190
|
+
type: Input
|
|
191
|
+
}], field: [{
|
|
192
|
+
type: Input
|
|
193
|
+
}], heading: [{
|
|
194
|
+
type: Input
|
|
195
|
+
}], hidden: [{
|
|
196
|
+
type: Input
|
|
197
|
+
}], id: [{
|
|
198
|
+
type: Input
|
|
199
|
+
}], inlineHelpPopover: [{
|
|
200
|
+
type: Input
|
|
201
|
+
}], isSortable: [{
|
|
202
|
+
type: Input
|
|
203
|
+
}], locked: [{
|
|
204
|
+
type: Input
|
|
205
|
+
}], searchFunction: [{
|
|
206
|
+
type: Input,
|
|
207
|
+
args: ['search']
|
|
208
|
+
}], type: [{
|
|
209
|
+
type: Input
|
|
210
|
+
}], templateInput: [{
|
|
211
|
+
type: Input,
|
|
212
|
+
args: ['template']
|
|
213
|
+
}], width: [{
|
|
214
|
+
type: Input
|
|
215
|
+
}], templates: [{
|
|
216
|
+
type: ContentChildren,
|
|
217
|
+
args: [TemplateRef]
|
|
218
|
+
}] } });
|
|
168
219
|
|
|
169
220
|
/**
|
|
170
221
|
* @internal
|
|
@@ -191,120 +242,83 @@ class SkyGridColumnModel {
|
|
|
191
242
|
}
|
|
192
243
|
}
|
|
193
244
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
245
|
+
var SkyGridMessageType;
|
|
246
|
+
(function (SkyGridMessageType) {
|
|
247
|
+
/**
|
|
248
|
+
* Selects the multiselect checkboxes for all rows in the grid.
|
|
249
|
+
*/
|
|
250
|
+
SkyGridMessageType[SkyGridMessageType["SelectAll"] = 0] = "SelectAll";
|
|
251
|
+
/**
|
|
252
|
+
* Clears the multiselect checkboxes for all rows in the grid.
|
|
253
|
+
*/
|
|
254
|
+
SkyGridMessageType[SkyGridMessageType["ClearAll"] = 1] = "ClearAll";
|
|
255
|
+
/**
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
SkyGridMessageType[SkyGridMessageType["PromptDeleteRow"] = 2] = "PromptDeleteRow";
|
|
259
|
+
/**
|
|
260
|
+
* @internal
|
|
261
|
+
*/
|
|
262
|
+
SkyGridMessageType[SkyGridMessageType["AbortDeleteRow"] = 3] = "AbortDeleteRow";
|
|
263
|
+
})(SkyGridMessageType || (SkyGridMessageType = {}));
|
|
264
|
+
|
|
199
265
|
/**
|
|
200
266
|
* @internal
|
|
201
267
|
*/
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
dropCallback(columnIds);
|
|
219
|
-
});
|
|
220
|
-
dragulaService.setOptions('sky-grid-heading', {
|
|
221
|
-
moves: (el, container, handle) => {
|
|
222
|
-
const columns = container.querySelectorAll('th div');
|
|
223
|
-
const isLeftOfLocked = this.isLeftOfLocked(handle, columns);
|
|
224
|
-
return !el.querySelector(GRID_HEADER_LOCKED_SELECTOR)
|
|
225
|
-
&& handle !== undefined
|
|
226
|
-
&& !handle.matches(GRID_HEADER_RESIZE_HANDLE)
|
|
227
|
-
&& !handle.matches(GRID_MULTISELECT_SELECTOR)
|
|
228
|
-
&& !handle.matches(GRID_ROW_DELETE_SELECTOR)
|
|
229
|
-
&& !isLeftOfLocked;
|
|
230
|
-
},
|
|
231
|
-
accepts: (el, target, source, sibling) => {
|
|
232
|
-
if (sibling === undefined || !sibling) {
|
|
233
|
-
return true;
|
|
234
|
-
}
|
|
235
|
-
const columns = source.querySelectorAll('th div');
|
|
236
|
-
const siblingDiv = sibling.querySelector('div');
|
|
237
|
-
const isLeftOfLocked = this.isLeftOfLocked(siblingDiv, columns);
|
|
238
|
-
return ((!sibling.matches(GRID_HEADER_LOCKED_SELECTOR)
|
|
239
|
-
&& !sibling.matches(GRID_HEADER_RESIZE_HANDLE)))
|
|
240
|
-
&& !isLeftOfLocked;
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
getRowHeight(el, index) {
|
|
245
|
-
return el.nativeElement.querySelectorAll('tbody tr')[index].scrollHeight + 'px';
|
|
268
|
+
var SkyGridSelectedRowsSource;
|
|
269
|
+
(function (SkyGridSelectedRowsSource) {
|
|
270
|
+
SkyGridSelectedRowsSource[SkyGridSelectedRowsSource["CheckboxChange"] = 0] = "CheckboxChange";
|
|
271
|
+
SkyGridSelectedRowsSource[SkyGridSelectedRowsSource["ClearAll"] = 1] = "ClearAll";
|
|
272
|
+
SkyGridSelectedRowsSource[SkyGridSelectedRowsSource["RowClick"] = 2] = "RowClick";
|
|
273
|
+
SkyGridSelectedRowsSource[SkyGridSelectedRowsSource["SelectAll"] = 3] = "SelectAll";
|
|
274
|
+
SkyGridSelectedRowsSource[SkyGridSelectedRowsSource["SelectedRowIdsChange"] = 4] = "SelectedRowIdsChange";
|
|
275
|
+
})(SkyGridSelectedRowsSource || (SkyGridSelectedRowsSource = {}));
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* @internal
|
|
279
|
+
*/
|
|
280
|
+
class SkyGridCellComponent {
|
|
281
|
+
ngOnInit() {
|
|
282
|
+
this.container.createEmbeddedView(this.template, this);
|
|
246
283
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
this.renderer.setStyle(el.nativeElement, style, value);
|
|
250
|
-
}
|
|
284
|
+
get row() {
|
|
285
|
+
return this.item.data;
|
|
251
286
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (column.contains(handle)) {
|
|
256
|
-
sourceColumn = column;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
for (let i = (columns.length - 1); i >= 0; i--) {
|
|
260
|
-
if (columns[i].classList.contains('sky-grid-header-locked')) {
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
if (columns[i] === sourceColumn) {
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
287
|
+
get value() {
|
|
288
|
+
if (this.item.data && (this.fieldSelector || this.columnId)) {
|
|
289
|
+
return getData(this.item.data, this.fieldSelector || this.columnId);
|
|
266
290
|
}
|
|
267
|
-
return
|
|
291
|
+
return undefined;
|
|
268
292
|
}
|
|
269
|
-
};
|
|
270
|
-
SkyGridAdapterService.ctorParameters = () => [
|
|
271
|
-
{ type: RendererFactory2 }
|
|
272
|
-
];
|
|
273
|
-
SkyGridAdapterService = __decorate([
|
|
274
|
-
Injectable()
|
|
275
|
-
], SkyGridAdapterService);
|
|
276
|
-
|
|
277
|
-
// tslint:disable:no-null-keyword
|
|
278
|
-
// Polyfill for Element.closest().
|
|
279
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
|
|
280
|
-
// Returns the closest ancestor of the current element (or the current element itself) which
|
|
281
|
-
// matches the selectors given in parameter. If there isn't such an ancestor, it returns null.
|
|
282
|
-
if (!Element.prototype.closest) {
|
|
283
|
-
Element.prototype.closest = function (s) {
|
|
284
|
-
let el = this;
|
|
285
|
-
/* istanbul ignore if */
|
|
286
|
-
if (!document.documentElement.contains(el)) {
|
|
287
|
-
return null;
|
|
288
|
-
}
|
|
289
|
-
do {
|
|
290
|
-
if (el.matches(s)) {
|
|
291
|
-
return el;
|
|
292
|
-
}
|
|
293
|
-
el = el.parentElement || el.parentNode;
|
|
294
|
-
} while (el !== null && el.nodeType === 1);
|
|
295
|
-
return null;
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
// Polyfill for Element.matches().
|
|
299
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
|
300
|
-
// Returns true if the element would be selected by the specified selector string.
|
|
301
|
-
if (!Element.prototype.matches) {
|
|
302
|
-
Element.prototype.matches = Element.prototype.msMatchesSelector
|
|
303
|
-
/* istanbul ignore next */ || Element.prototype.webkitMatchesSelector;
|
|
304
293
|
}
|
|
294
|
+
SkyGridCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
295
|
+
SkyGridCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyGridCellComponent, selector: "sky-grid-cell", inputs: { item: "item", columnId: "columnId", template: "template", fieldSelector: "fieldSelector" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["cell"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-template #cell></ng-template>', isInline: true, styles: [":host{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px;min-height:35px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
296
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridCellComponent, decorators: [{
|
|
297
|
+
type: Component,
|
|
298
|
+
args: [{
|
|
299
|
+
selector: 'sky-grid-cell',
|
|
300
|
+
template: '<ng-template #cell></ng-template>',
|
|
301
|
+
styleUrls: ['./grid-cell.component.scss'],
|
|
302
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
303
|
+
}]
|
|
304
|
+
}], propDecorators: { item: [{
|
|
305
|
+
type: Input
|
|
306
|
+
}], columnId: [{
|
|
307
|
+
type: Input
|
|
308
|
+
}], template: [{
|
|
309
|
+
type: Input
|
|
310
|
+
}], fieldSelector: [{
|
|
311
|
+
type: Input
|
|
312
|
+
}], container: [{
|
|
313
|
+
type: ViewChild,
|
|
314
|
+
args: ['cell', {
|
|
315
|
+
read: ViewContainerRef,
|
|
316
|
+
static: true,
|
|
317
|
+
}]
|
|
318
|
+
}] } });
|
|
305
319
|
|
|
306
320
|
let nextId = 0;
|
|
307
|
-
|
|
321
|
+
class SkyGridComponent {
|
|
308
322
|
constructor(affixService, changeDetector, dragulaService, gridAdapter, overlayService, skyWindow, uiConfigService) {
|
|
309
323
|
this.affixService = affixService;
|
|
310
324
|
this.changeDetector = changeDetector;
|
|
@@ -382,7 +396,7 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
382
396
|
this.items = new Array();
|
|
383
397
|
this.currentSortField = new BehaviorSubject({
|
|
384
398
|
fieldSelector: '',
|
|
385
|
-
descending: false
|
|
399
|
+
descending: false,
|
|
386
400
|
});
|
|
387
401
|
}
|
|
388
402
|
/**
|
|
@@ -396,14 +410,12 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
396
410
|
this.setDisplayedColumns();
|
|
397
411
|
}
|
|
398
412
|
// Ensure that the ids have changed.
|
|
399
|
-
if (!currentIds ||
|
|
400
|
-
!value ||
|
|
401
|
-
!this.arraysEqual(value, currentIds)) {
|
|
413
|
+
if (!currentIds || !value || !this.arraysEqual(value, currentIds)) {
|
|
402
414
|
// This variable ensures that we do not set user config options or fire the change event
|
|
403
415
|
// on the first time that the columns are set up
|
|
404
416
|
if (this.selectedColumnIdsSet) {
|
|
405
417
|
this.setUserConfig({
|
|
406
|
-
selectedColumnIds: value
|
|
418
|
+
selectedColumnIds: value,
|
|
407
419
|
});
|
|
408
420
|
this.selectedColumnIdsChange.emit(this._selectedColumnIds);
|
|
409
421
|
if (this.isResized) {
|
|
@@ -462,7 +474,9 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
462
474
|
ngOnChanges(changes) {
|
|
463
475
|
if (changes.columns && this.columns) {
|
|
464
476
|
if (this.selectedColumnIds) {
|
|
465
|
-
this.selectedColumnIds = this.selectedColumnIds.filter(columnId =>
|
|
477
|
+
this.selectedColumnIds = this.selectedColumnIds.filter((columnId) => {
|
|
478
|
+
return this.columns.find((column) => column.id === columnId);
|
|
479
|
+
});
|
|
466
480
|
}
|
|
467
481
|
this.setDisplayedColumns(true);
|
|
468
482
|
}
|
|
@@ -471,8 +485,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
471
485
|
// This set timeout is necessary to ensure the data has rendered in the grid
|
|
472
486
|
setTimeout(() => {
|
|
473
487
|
// This cleans up any lingering row deletes for items that have been removed.
|
|
474
|
-
Object.keys(this.rowDeleteContents).forEach(id => {
|
|
475
|
-
if (!this.data.find(item => item.id === id)) {
|
|
488
|
+
Object.keys(this.rowDeleteContents).forEach((id) => {
|
|
489
|
+
if (!this.data.find((item) => item.id === id)) {
|
|
476
490
|
this.destroyRowDelete(id);
|
|
477
491
|
}
|
|
478
492
|
else {
|
|
@@ -485,7 +499,7 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
485
499
|
placement: 'above',
|
|
486
500
|
verticalAlignment: 'top',
|
|
487
501
|
horizontalAlignment: 'left',
|
|
488
|
-
enableAutoFit: false
|
|
502
|
+
enableAutoFit: false,
|
|
489
503
|
});
|
|
490
504
|
}
|
|
491
505
|
});
|
|
@@ -503,7 +517,7 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
503
517
|
this.multiselectSelectionChange.complete();
|
|
504
518
|
this.ngUnsubscribe.next();
|
|
505
519
|
this.ngUnsubscribe.complete();
|
|
506
|
-
Object.keys(this.rowDeleteContents).forEach(id => {
|
|
520
|
+
Object.keys(this.rowDeleteContents).forEach((id) => {
|
|
507
521
|
this.destroyRowDelete(id);
|
|
508
522
|
});
|
|
509
523
|
}
|
|
@@ -551,15 +565,17 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
551
565
|
sortByColumn(column) {
|
|
552
566
|
if (!this.isDraggingResizeHandle && column.isSortable) {
|
|
553
567
|
this.currentSortField
|
|
554
|
-
.pipe(take(1), map(field => {
|
|
568
|
+
.pipe(take(1), map((field) => {
|
|
555
569
|
let selector = {
|
|
556
570
|
fieldSelector: column.field,
|
|
557
|
-
descending: true
|
|
571
|
+
descending: true,
|
|
558
572
|
};
|
|
559
|
-
if (field &&
|
|
573
|
+
if (field &&
|
|
574
|
+
field.fieldSelector === column.field &&
|
|
575
|
+
field.descending) {
|
|
560
576
|
selector = {
|
|
561
577
|
fieldSelector: column.field,
|
|
562
|
-
descending: false
|
|
578
|
+
descending: false,
|
|
563
579
|
};
|
|
564
580
|
}
|
|
565
581
|
this.sortFieldChange.emit(selector);
|
|
@@ -569,28 +585,32 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
569
585
|
}
|
|
570
586
|
}
|
|
571
587
|
getSortDirection(columnField) {
|
|
572
|
-
return this.currentSortField
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
588
|
+
return this.currentSortField.pipe(distinctUntilChanged(), map((field) => {
|
|
589
|
+
return field.fieldSelector === columnField
|
|
590
|
+
? field.descending
|
|
591
|
+
? 'desc'
|
|
592
|
+
: 'asc'
|
|
593
|
+
: undefined;
|
|
576
594
|
}));
|
|
577
595
|
}
|
|
578
596
|
getAriaSortDirection(column) {
|
|
579
|
-
return this.currentSortField
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
597
|
+
return this.currentSortField.pipe(distinctUntilChanged(), map((field) => {
|
|
598
|
+
return field.fieldSelector === column.field
|
|
599
|
+
? field.descending
|
|
600
|
+
? 'descending'
|
|
601
|
+
: 'ascending'
|
|
602
|
+
: column.isSortable
|
|
603
|
+
? 'none'
|
|
604
|
+
: undefined;
|
|
583
605
|
}));
|
|
584
606
|
}
|
|
585
607
|
getCaretVisibility(columnField) {
|
|
586
|
-
return this.currentSortField
|
|
587
|
-
.pipe(distinctUntilChanged(), map(field => {
|
|
608
|
+
return this.currentSortField.pipe(distinctUntilChanged(), map((field) => {
|
|
588
609
|
return field.fieldSelector === columnField ? 'visible' : 'hidden';
|
|
589
610
|
}));
|
|
590
611
|
}
|
|
591
612
|
getHelpInlineClass(columnField) {
|
|
592
|
-
return this.getCaretVisibility(columnField)
|
|
593
|
-
.pipe(map((visibility) => {
|
|
613
|
+
return this.getCaretVisibility(columnField).pipe(map((visibility) => {
|
|
594
614
|
return visibility === 'hidden';
|
|
595
615
|
}));
|
|
596
616
|
}
|
|
@@ -599,8 +619,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
599
619
|
}
|
|
600
620
|
updateColumnHeading(change) {
|
|
601
621
|
const foundColumnModel = this.columns.find((column) => {
|
|
602
|
-
return (change.id !== undefined && change.id === column.id ||
|
|
603
|
-
change.field !== undefined && change.field === column.field);
|
|
622
|
+
return ((change.id !== undefined && change.id === column.id) ||
|
|
623
|
+
(change.field !== undefined && change.field === column.field));
|
|
604
624
|
});
|
|
605
625
|
/* istanbul ignore else */
|
|
606
626
|
if (foundColumnModel) {
|
|
@@ -610,8 +630,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
610
630
|
}
|
|
611
631
|
updateInlineHelpPopover(change) {
|
|
612
632
|
const foundColumnModel = this.columns.find((column) => {
|
|
613
|
-
return (change.id !== undefined && change.id === column.id ||
|
|
614
|
-
change.field !== undefined && change.field === column.field);
|
|
633
|
+
return ((change.id !== undefined && change.id === column.id) ||
|
|
634
|
+
(change.field !== undefined && change.field === column.field));
|
|
615
635
|
});
|
|
616
636
|
/* istanbul ignore else */
|
|
617
637
|
if (foundColumnModel) {
|
|
@@ -621,8 +641,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
621
641
|
}
|
|
622
642
|
updateColumnDescription(change) {
|
|
623
643
|
const foundColumnModel = this.columns.find((column) => {
|
|
624
|
-
return (change.id !== undefined && change.id === column.id ||
|
|
625
|
-
change.field !== undefined && change.field === column.field);
|
|
644
|
+
return ((change.id !== undefined && change.id === column.id) ||
|
|
645
|
+
(change.field !== undefined && change.field === column.field));
|
|
626
646
|
});
|
|
627
647
|
/* istanbul ignore else */
|
|
628
648
|
if (foundColumnModel) {
|
|
@@ -717,7 +737,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
717
737
|
onRowClick(event, selectedItem) {
|
|
718
738
|
/* istanbul ignore else */
|
|
719
739
|
if (this.enableMultiselect) {
|
|
720
|
-
if (event.target === event.currentTarget ||
|
|
740
|
+
if (event.target === event.currentTarget ||
|
|
741
|
+
!this.isInteractiveElement(event)) {
|
|
721
742
|
selectedItem.isSelected = !selectedItem.isSelected;
|
|
722
743
|
this.changeDetector.markForCheck();
|
|
723
744
|
this.emitSelectedRows(SkyGridSelectedRowsSource.RowClick);
|
|
@@ -734,16 +755,16 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
734
755
|
return this.gridAdapter.getRowHeight(this.tableElementRef, index);
|
|
735
756
|
}
|
|
736
757
|
cancelRowDelete(id) {
|
|
737
|
-
this.rowDeleteConfigs = this.rowDeleteConfigs.filter(config => config.id !== id);
|
|
758
|
+
this.rowDeleteConfigs = this.rowDeleteConfigs.filter((config) => config.id !== id);
|
|
738
759
|
this.rowDeleteCancel.emit({ id: id });
|
|
739
760
|
this.destroyRowDelete(id);
|
|
740
761
|
}
|
|
741
762
|
confirmRowDelete(id) {
|
|
742
|
-
this.rowDeleteConfigs.find(config => config.id === id).pending = true;
|
|
763
|
+
this.rowDeleteConfigs.find((config) => config.id === id).pending = true;
|
|
743
764
|
this.rowDeleteConfirm.emit({ id: id });
|
|
744
765
|
}
|
|
745
766
|
getRowDeleteItem(id) {
|
|
746
|
-
return this.rowDeleteConfigs.find(rowDelete => rowDelete.id === id);
|
|
767
|
+
return this.rowDeleteConfigs.find((rowDelete) => rowDelete.id === id);
|
|
747
768
|
}
|
|
748
769
|
// Prevent touch devices from inadvertently scrolling grid while dragging columns.
|
|
749
770
|
onTouchMove(event) {
|
|
@@ -778,10 +799,12 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
778
799
|
}
|
|
779
800
|
}
|
|
780
801
|
checkUserColumnWidthsForScroll() {
|
|
781
|
-
if (!this.showTopScroll &&
|
|
802
|
+
if (!this.showTopScroll &&
|
|
803
|
+
this.columnElementRefs &&
|
|
804
|
+
this.columnElementRefs.length > 0) {
|
|
782
805
|
let columnsWidthTotal = 0;
|
|
783
806
|
const windowSize = this.skyWindow.nativeWindow.innerWidth;
|
|
784
|
-
this.columnElementRefs.forEach(col => {
|
|
807
|
+
this.columnElementRefs.forEach((col) => {
|
|
785
808
|
if (!this.showTopScroll) {
|
|
786
809
|
let computedWidth = parseFloat(window.getComputedStyle(col.nativeElement).width);
|
|
787
810
|
let offsetWidth = col.nativeElement.offsetWidth;
|
|
@@ -824,21 +847,25 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
824
847
|
/* sanity check */
|
|
825
848
|
/* istanbul ignore else */
|
|
826
849
|
if (message.data && message.data.promptDeleteRow) {
|
|
827
|
-
const existingConfig = this.rowDeleteConfigs
|
|
828
|
-
.find(config => config.id === message.data.promptDeleteRow.id);
|
|
850
|
+
const existingConfig = this.rowDeleteConfigs.find((config) => config.id === message.data.promptDeleteRow.id);
|
|
829
851
|
if (existingConfig) {
|
|
830
852
|
existingConfig.pending = false;
|
|
831
853
|
}
|
|
832
854
|
else {
|
|
833
|
-
this.rowDeleteConfigs.push({
|
|
855
|
+
this.rowDeleteConfigs.push({
|
|
856
|
+
id: message.data.promptDeleteRow.id,
|
|
857
|
+
pending: false,
|
|
858
|
+
});
|
|
834
859
|
let overlay = this.overlayService.create({
|
|
835
860
|
enableScroll: true,
|
|
836
861
|
showBackdrop: false,
|
|
837
862
|
closeOnNavigation: true,
|
|
838
863
|
enableClose: false,
|
|
839
|
-
enablePointerEvents: true
|
|
864
|
+
enablePointerEvents: true,
|
|
865
|
+
});
|
|
866
|
+
overlay.attachTemplate(this.inlineDeleteTemplateRef, {
|
|
867
|
+
$implicit: this.data.find((item) => item.id === message.data.promptDeleteRow.id),
|
|
840
868
|
});
|
|
841
|
-
overlay.attachTemplate(this.inlineDeleteTemplateRef, { $implicit: this.data.find(item => item.id === message.data.promptDeleteRow.id) });
|
|
842
869
|
/**
|
|
843
870
|
* We are manually setting the z-index here because overlays will always be on top of
|
|
844
871
|
* the omnibar. This manual setting is 1 less than the omnibar's z-index of 1000. We
|
|
@@ -847,9 +874,11 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
847
874
|
*/
|
|
848
875
|
overlay.componentRef.instance.zIndex = '999';
|
|
849
876
|
setTimeout(() => {
|
|
850
|
-
const inlineDeleteRef = this.inlineDeleteRefs
|
|
851
|
-
.
|
|
852
|
-
|
|
877
|
+
const inlineDeleteRef = this.inlineDeleteRefs
|
|
878
|
+
.toArray()
|
|
879
|
+
.find((elRef) => {
|
|
880
|
+
return (elRef.nativeElement.id ===
|
|
881
|
+
'row-delete-ref-' + message.data.promptDeleteRow.id);
|
|
853
882
|
});
|
|
854
883
|
let affixer = this.affixService.createAffixer(inlineDeleteRef);
|
|
855
884
|
let rowElement = this.tableElementRef.nativeElement.querySelector('[sky-cmp-id="' + message.data.promptDeleteRow.id + '"]');
|
|
@@ -859,11 +888,11 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
859
888
|
placement: 'above',
|
|
860
889
|
verticalAlignment: 'top',
|
|
861
890
|
horizontalAlignment: 'left',
|
|
862
|
-
enableAutoFit: false
|
|
891
|
+
enableAutoFit: false,
|
|
863
892
|
});
|
|
864
893
|
this.rowDeleteContents[message.data.promptDeleteRow.id] = {
|
|
865
894
|
affixer: affixer,
|
|
866
|
-
overlay: overlay
|
|
895
|
+
overlay: overlay,
|
|
867
896
|
};
|
|
868
897
|
});
|
|
869
898
|
}
|
|
@@ -873,7 +902,7 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
873
902
|
/* sanity check */
|
|
874
903
|
/* istanbul ignore else */
|
|
875
904
|
if (message.data && message.data.abortDeleteRow) {
|
|
876
|
-
this.rowDeleteConfigs = this.rowDeleteConfigs.filter(config => config.id !== message.data.abortDeleteRow.id);
|
|
905
|
+
this.rowDeleteConfigs = this.rowDeleteConfigs.filter((config) => config.id !== message.data.abortDeleteRow.id);
|
|
877
906
|
this.destroyRowDelete(message.data.abortDeleteRow.id);
|
|
878
907
|
}
|
|
879
908
|
break;
|
|
@@ -891,10 +920,15 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
891
920
|
if (this.selectedColumnIds !== undefined) {
|
|
892
921
|
// setup displayed columns
|
|
893
922
|
this.displayedColumns = this.selectedColumnIds
|
|
894
|
-
.filter(
|
|
923
|
+
.filter((columnId) => {
|
|
924
|
+
return this.columns.find((column) => column.id === columnId);
|
|
925
|
+
})
|
|
926
|
+
.map((columnId) => {
|
|
927
|
+
return this.columns.filter((column) => column.id === columnId)[0];
|
|
928
|
+
});
|
|
895
929
|
}
|
|
896
930
|
else if (respectHidden) {
|
|
897
|
-
this.displayedColumns = this.columns.filter(column => {
|
|
931
|
+
this.displayedColumns = this.columns.filter((column) => {
|
|
898
932
|
return !column.hidden;
|
|
899
933
|
});
|
|
900
934
|
}
|
|
@@ -904,12 +938,15 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
904
938
|
}
|
|
905
939
|
transformData() {
|
|
906
940
|
// Transform data into object with id and data properties
|
|
907
|
-
if (this.data &&
|
|
941
|
+
if (this.data &&
|
|
942
|
+
this.data.length > 0 &&
|
|
943
|
+
this.data[0].id &&
|
|
944
|
+
!this.data[0].data) {
|
|
908
945
|
if (this.multiselectRowId) {
|
|
909
946
|
this.items = this.getGridDataWithSelectedRows();
|
|
910
947
|
}
|
|
911
948
|
else {
|
|
912
|
-
this.items = this.data.map(item => new ListItemModel(item.id, item));
|
|
949
|
+
this.items = this.data.map((item) => new ListItemModel(item.id, item));
|
|
913
950
|
}
|
|
914
951
|
}
|
|
915
952
|
else {
|
|
@@ -918,7 +955,7 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
918
955
|
}
|
|
919
956
|
getGridDataWithSelectedRows() {
|
|
920
957
|
let selectedRows = this.getSelectedRows();
|
|
921
|
-
return this.data.map(item => {
|
|
958
|
+
return this.data.map((item) => {
|
|
922
959
|
let checked;
|
|
923
960
|
if (item.hasOwnProperty(this.multiselectRowId)) {
|
|
924
961
|
checked = selectedRows.indexOf(item[this.multiselectRowId]) > -1;
|
|
@@ -932,7 +969,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
932
969
|
applySelectedRows() {
|
|
933
970
|
if (this.items && this.items.length > 0 && this.selectedRowIds) {
|
|
934
971
|
for (let i = 0; i < this.items.length; i++) {
|
|
935
|
-
this.items[i].isSelected =
|
|
972
|
+
this.items[i].isSelected =
|
|
973
|
+
this.selectedRowIds.indexOf(this.items[i].id) > -1;
|
|
936
974
|
}
|
|
937
975
|
this.changeDetector.markForCheck();
|
|
938
976
|
}
|
|
@@ -941,7 +979,7 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
941
979
|
this.currentSortField.next(this.sortField || { fieldSelector: '', descending: false });
|
|
942
980
|
}
|
|
943
981
|
getColumnsFromComponent() {
|
|
944
|
-
this.columns = this.columnComponents.map(columnComponent => {
|
|
982
|
+
this.columns = this.columnComponents.map((columnComponent) => {
|
|
945
983
|
return new SkyGridColumnModel(columnComponent.template, columnComponent);
|
|
946
984
|
});
|
|
947
985
|
}
|
|
@@ -990,8 +1028,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
990
1028
|
this.columnElementRefs.forEach((col, index) => {
|
|
991
1029
|
let computedWidth = parseFloat(window.getComputedStyle(col.nativeElement).width);
|
|
992
1030
|
let offsetWidth = col.nativeElement.offsetWidth;
|
|
993
|
-
|
|
994
|
-
this.getColumnModelByIndex(index).width =
|
|
1031
|
+
/* istanbul ignore next */
|
|
1032
|
+
this.getColumnModelByIndex(index).width = Math.max(computedWidth || offsetWidth, this.minColWidth);
|
|
995
1033
|
});
|
|
996
1034
|
// 'scroll' tables should be allowed to expand outside of their constraints.
|
|
997
1035
|
if (this.fit === 'scroll') {
|
|
@@ -1005,11 +1043,11 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1005
1043
|
}
|
|
1006
1044
|
getColumnWidthModelChange() {
|
|
1007
1045
|
let columnWidthModelChange = new Array();
|
|
1008
|
-
this.columns.forEach(column => {
|
|
1046
|
+
this.columns.forEach((column) => {
|
|
1009
1047
|
columnWidthModelChange.push({
|
|
1010
1048
|
id: column.id,
|
|
1011
1049
|
field: column.field,
|
|
1012
|
-
width: column.width
|
|
1050
|
+
width: column.width,
|
|
1013
1051
|
});
|
|
1014
1052
|
});
|
|
1015
1053
|
return columnWidthModelChange;
|
|
@@ -1038,13 +1076,13 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1038
1076
|
});
|
|
1039
1077
|
}
|
|
1040
1078
|
getRangeInputByIndex(index) {
|
|
1041
|
-
return this.columnRangeInputElementRefs.find(input => input.nativeElement.getAttribute('sky-cmp-index') === index.toString());
|
|
1079
|
+
return this.columnRangeInputElementRefs.find((input) => input.nativeElement.getAttribute('sky-cmp-index') === index.toString());
|
|
1042
1080
|
}
|
|
1043
1081
|
getColumnModelByIndex(index) {
|
|
1044
1082
|
return this.displayedColumns[Number(index)];
|
|
1045
1083
|
}
|
|
1046
1084
|
getMaxRangeByIndex(index) {
|
|
1047
|
-
let columnElementRef = this.columnElementRefs.find(th => th.nativeElement.getAttribute('sky-cmp-index') === index);
|
|
1085
|
+
let columnElementRef = this.columnElementRefs.find((th) => th.nativeElement.getAttribute('sky-cmp-index') === index);
|
|
1048
1086
|
let rangeInput = columnElementRef.nativeElement.querySelector('.sky-grid-column-input-aria-only');
|
|
1049
1087
|
return Number(rangeInput.max);
|
|
1050
1088
|
}
|
|
@@ -1052,10 +1090,11 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1052
1090
|
return this.getColumnModelByIndex(this.displayedColumns.length - 1);
|
|
1053
1091
|
}
|
|
1054
1092
|
addDelimeter(text, delimiter) {
|
|
1055
|
-
return text.filter(val => val).join(delimiter);
|
|
1093
|
+
return text.filter((val) => val).join(delimiter);
|
|
1056
1094
|
}
|
|
1057
1095
|
destroyRowDelete(id) {
|
|
1058
1096
|
const rowDeleteContents = this.rowDeleteContents[id];
|
|
1097
|
+
/* istanbul ignore else */
|
|
1059
1098
|
if (rowDeleteContents) {
|
|
1060
1099
|
rowDeleteContents.affixer.destroy();
|
|
1061
1100
|
this.overlayService.close(rowDeleteContents.overlay);
|
|
@@ -1065,14 +1104,16 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1065
1104
|
emitSelectedRows(source) {
|
|
1066
1105
|
let selectedRows = {
|
|
1067
1106
|
selectedRowIds: this.getSelectedRows(),
|
|
1068
|
-
source: source
|
|
1107
|
+
source: source,
|
|
1069
1108
|
};
|
|
1070
1109
|
this.multiselectSelectionChange.emit(selectedRows);
|
|
1071
1110
|
}
|
|
1072
1111
|
getSelectedRows() {
|
|
1073
|
-
return this.items
|
|
1112
|
+
return this.items
|
|
1113
|
+
.filter((item) => {
|
|
1074
1114
|
return item.isSelected;
|
|
1075
|
-
})
|
|
1115
|
+
})
|
|
1116
|
+
.map((item) => {
|
|
1076
1117
|
if (item.data.hasOwnProperty(this.multiselectRowId)) {
|
|
1077
1118
|
return item.data[this.multiselectRowId];
|
|
1078
1119
|
}
|
|
@@ -1097,19 +1138,21 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1097
1138
|
}
|
|
1098
1139
|
setResizeBarPosition(xPosition) {
|
|
1099
1140
|
let parentScroll = this.tableContainerElementRef.nativeElement.scrollLeft;
|
|
1100
|
-
let resizeBarX = xPosition -
|
|
1141
|
+
let resizeBarX = xPosition -
|
|
1142
|
+
this.tableElementRef.nativeElement.getBoundingClientRect().left -
|
|
1143
|
+
parentScroll;
|
|
1101
1144
|
this.gridAdapter.setStyle(this.resizeBar, 'left', resizeBarX + 'px');
|
|
1102
1145
|
}
|
|
1103
1146
|
applyUserConfig() {
|
|
1104
1147
|
return new Promise((resolve) => {
|
|
1105
|
-
this.uiConfigService
|
|
1148
|
+
this.uiConfigService
|
|
1149
|
+
.getConfig(this.settingsKey)
|
|
1106
1150
|
.pipe(take(1))
|
|
1107
1151
|
.subscribe((config) => {
|
|
1108
1152
|
/* istanbul ignore else */
|
|
1109
1153
|
if (config && config.selectedColumnIds) {
|
|
1110
1154
|
// Remove any columnIds that don't exist in the current data set.
|
|
1111
|
-
|
|
1112
|
-
this.selectedColumnIds = filteredColumnIds;
|
|
1155
|
+
this.selectedColumnIds = config.selectedColumnIds.filter((id) => this.columns.find((column) => column.id === id));
|
|
1113
1156
|
this.changeDetector.markForCheck();
|
|
1114
1157
|
}
|
|
1115
1158
|
resolve();
|
|
@@ -1122,7 +1165,8 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1122
1165
|
if (!this.settingsKey) {
|
|
1123
1166
|
return;
|
|
1124
1167
|
}
|
|
1125
|
-
this.uiConfigService
|
|
1168
|
+
this.uiConfigService
|
|
1169
|
+
.setConfig(this.settingsKey, config)
|
|
1126
1170
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1127
1171
|
.subscribe(() => { }, (err) => {
|
|
1128
1172
|
console.warn('Could not save grid settings.');
|
|
@@ -1131,8 +1175,7 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1131
1175
|
}
|
|
1132
1176
|
initColumns() {
|
|
1133
1177
|
/* istanbul ignore else */
|
|
1134
|
-
if (this.columnComponents.length !== 0 ||
|
|
1135
|
-
this.columns !== undefined) {
|
|
1178
|
+
if (this.columnComponents.length !== 0 || this.columns !== undefined) {
|
|
1136
1179
|
/* istanbul ignore else */
|
|
1137
1180
|
/* sanity check */
|
|
1138
1181
|
if (this.columnComponents.length > 0) {
|
|
@@ -1146,249 +1189,210 @@ let SkyGridComponent = class SkyGridComponent {
|
|
|
1146
1189
|
this.subscriptions.push(this.columnComponents.changes.subscribe(() => this.updateColumns()));
|
|
1147
1190
|
// Watch for column heading changes:
|
|
1148
1191
|
this.columnComponents.forEach((comp) => {
|
|
1149
|
-
this.subscriptions.push(comp.headingModelChanges
|
|
1150
|
-
.subscribe((change) => {
|
|
1192
|
+
this.subscriptions.push(comp.headingModelChanges.subscribe((change) => {
|
|
1151
1193
|
this.updateColumnHeading(change);
|
|
1152
1194
|
}));
|
|
1153
|
-
this.subscriptions.push(comp.descriptionModelChanges
|
|
1154
|
-
.subscribe((change) => {
|
|
1195
|
+
this.subscriptions.push(comp.descriptionModelChanges.subscribe((change) => {
|
|
1155
1196
|
this.updateColumnDescription(change);
|
|
1156
1197
|
}));
|
|
1157
|
-
this.subscriptions.push(comp.inlineHelpPopoverModelChanges
|
|
1158
|
-
.subscribe((change) => {
|
|
1198
|
+
this.subscriptions.push(comp.inlineHelpPopoverModelChanges.subscribe((change) => {
|
|
1159
1199
|
this.updateInlineHelpPopover(change);
|
|
1160
1200
|
}));
|
|
1161
1201
|
});
|
|
1162
1202
|
}
|
|
1163
1203
|
arraysEqual(arrayA, arrayB) {
|
|
1164
|
-
return arrayA.length === arrayB.length &&
|
|
1165
|
-
arrayA.every((value, index) => value === arrayB[index]);
|
|
1204
|
+
return (arrayA.length === arrayB.length &&
|
|
1205
|
+
arrayA.every((value, index) => value === arrayB[index]));
|
|
1166
1206
|
}
|
|
1167
|
-
}
|
|
1168
|
-
SkyGridComponent
|
|
1169
|
-
{ type: SkyAffixService },
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
]
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
]
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
],
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
],
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
],
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
],
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
],
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
],
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
],
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
]
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
]
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
]
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
]
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
]
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
]
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
]
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
]
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
]
|
|
1252
|
-
|
|
1253
|
-
ViewChild('inlineDeleteTemplateRef', { read: TemplateRef })
|
|
1254
|
-
], SkyGridComponent.prototype, "inlineDeleteTemplateRef", void 0);
|
|
1255
|
-
__decorate([
|
|
1256
|
-
ViewChild('gridContainer')
|
|
1257
|
-
], SkyGridComponent.prototype, "tableContainerElementRef", void 0);
|
|
1258
|
-
__decorate([
|
|
1259
|
-
ViewChild('gridTable')
|
|
1260
|
-
], SkyGridComponent.prototype, "tableElementRef", void 0);
|
|
1261
|
-
__decorate([
|
|
1262
|
-
ViewChild('topScrollContainer')
|
|
1263
|
-
], SkyGridComponent.prototype, "topScrollContainerElementRef", void 0);
|
|
1264
|
-
__decorate([
|
|
1265
|
-
ViewChild('resizeBar')
|
|
1266
|
-
], SkyGridComponent.prototype, "resizeBar", void 0);
|
|
1267
|
-
__decorate([
|
|
1268
|
-
HostListener('window:resize')
|
|
1269
|
-
], SkyGridComponent.prototype, "onWindowResize", null);
|
|
1270
|
-
SkyGridComponent = __decorate([
|
|
1271
|
-
Component({
|
|
1272
|
-
selector: 'sky-grid',
|
|
1273
|
-
template: "<div class=\"sky-grid\">\n <div *ngIf=\"showTopScroll\"\n class=\"sky-grid-top-scroll-container\"\n (scroll)=\"onTopScroll($event)\"\n #topScrollContainer\n >\n <div\n class=\"sky-grid-top-scroll\"\n [style.width.px]=\"getTopScrollWidth()\"\n ></div>\n </div>\n <div\n class=\"sky-grid-table-container\"\n [style.height.px]=\"height\"\n [style.width.px]=\"width\"\n (scroll)=\"onGridScroll($event)\"\n #gridContainer\n >\n <table\n class=\"sky-grid-table\"\n [ngClass]=\"getTableClassNames()\"\n #gridTable>\n <thead>\n <tr dragula=\"sky-grid-heading\">\n <th *ngIf=\"enableMultiselect\"\n class=\"sky-grid-heading sky-grid-multiselect-cell sky-grid-header-locked\"\n scope=\"col\"\n [style.max-width.px]=\"minColWidth\"\n [style.width.px]=\"minColWidth\"\n >\n <span class=\"screen-reader-only\">\n {{ 'skyux_grid_multiselect_select_row' | skyLibResources }}\n </span>\n </th>\n <th *ngFor=\"let column of displayedColumns; let last = last, let i = index\"\n class=\"sky-grid-heading sky-field-label\"\n scope=\"col\"\n [attr.sky-cmp-index]=\"i\"\n [attr.sky-cmp-id]=\"column.id || column.field\"\n [attr.aria-sort]=\"getAriaSortDirection(column) | async\"\n [id]=\"'sky-grid-' + gridId + '-column-' + i\"\n [ngClass]=\"'sky-grid-column-alignment-' + column.alignment\"\n [style.max-width.px]=\"column.width\"\n [style.width.px]=\"column.width\"\n [tabIndex]=\"column.isSortable ? 0 : -1\"\n (mouseup)=\"sortByColumn(column)\"\n (keydown)=\"onKeydown($event, column)\"\n (touchmove)=\"onTouchMove($event)\"\n #gridCol\n >\n <div\n class=\"overflow\"\n [ngClass]=\"getTableHeaderClassNames(column)\"\n [style.max-width.px]=\"column.width - 1\"\n [style.width.px]=\"column.width - 1\"\n >\n <span *ngIf=\"(getCaretVisibility(column.field) | async) === 'hidden'\"\n class=\"sky-grid-header-caret-hidden-spacing\"\n ></span>\n <!-- The no spacing here is intentional to avoid extra spaces due to these being inline elements -->\n <span\n class=\"sky-grid-header-text\"\n >{{column.heading?.trim()}}</span>\n <sky-icon\n class=\"sky-grid-heading-sort\"\n [ngClass]=\"'sky-grid-heading-sort-' + (getCaretVisibility(column.field) | async)\"\n [icon]=\"getCaretIconNames(column)\"\n >\n </sky-icon>\n <sky-help-inline *ngIf=\"column.inlineHelpPopover\"\n [ngClass]=\"{\n 'sky-grid-help-inline-sort-hidden' : getHelpInlineClass(column.field) | async\n }\"\n [skyPopover]=\"column.inlineHelpPopover\"\n (keydown.enter)=\"$event.stopPropagation()\"\n (keydown.space)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.stopPropagation()\"\n (mouseup)=\"$event.stopPropagation()\"\n >\n </sky-help-inline>\n </div>\n <span\n *ngIf=\"(fit==='width' && !last) || (fit==='scroll')\"\n aria-hidden=\"true\"\n class=\"sky-grid-resize-handle\"\n tabindex=\"-1\"\n [attr.sky-cmp-index]=\"i\"\n (mousedown)=\"onResizeColumnStart($event)\"\n (touchstart)=\"onResizeColumnStart($event)\"\n >\n </span>\n <input\n aria-label=\"Width of column\"\n class=\"sky-grid-column-input-aria-only\"\n role=\"slider\"\n type=\"range\"\n [attr.aria-controls]=\"'sky-grid-' + gridId + '-column-' + i\"\n [attr.aria-valuemin]=\"minColWidth\"\n [attr.aria-valuemax]=\"maxColWidth\"\n [attr.aria-valuenow]=\"column.width\"\n [attr.sky-cmp-index]=\"i\"\n [min]=\"minColWidth\"\n [max]=\"maxColWidth\"\n [step]=\"columnResizeStep\"\n [(ngModel)]=\"column.width\"\n (blur)=\"onResizeHandleBlur($event)\"\n (focus)=\"onResizeHandleFocus($event)\"\n (keydown)=\"onKeydownResizeCol($event)\"\n (change)=\"onInputChangeResizeCol($event)\"\n #colSizeRange />\n </th>\n </tr>\n </thead>\n <tbody class=\"sky-grid-tbody\">\n <tr\n class=\"sky-grid-row\"\n *ngFor=\"let item of items; let i = index\"\n [attr.aria-current]=\"isRowHighlighted(item.id) ? true : null\"\n [attr.aria-selected]=\"item.isSelected\"\n [attr.sky-cmp-id]=\"item.id\"\n [ngClass]=\"{\n 'sky-grid-multiselect-selected-row' : item.isSelected,\n 'sky-grid-multiselect-row' : enableMultiselect,\n 'sky-grid-row-highlight' : isRowHighlighted(item.id)\n }\"\n (click)=\"onRowClick($event, item)\"\n >\n <td *ngIf=\"enableMultiselect\"\n class=\"sky-grid-multiselect-cell sky-grid-header-locked\"\n >\n <div\n [style.max-width.px]=\"minColWidth\"\n [style.width.px]=\"minColWidth\"\n >\n <sky-checkbox\n [label]=\"'skyux_grid_multiselect_select_row' | skyLibResources\"\n (change)=\"onMultiselectCheckboxChange()\"\n [(ngModel)]=\"item.isSelected\"\n >\n </sky-checkbox>\n </div>\n </td>\n <td *ngFor=\"let column of displayedColumns; let last = last; let i = index\"\n class=\"sky-grid-cell\"\n [ngClass]=\"'sky-grid-column-alignment-' + column.alignment\"\n [style.max-width.px]=\"column.width\"\n [style.width.px]=\"column.width\"\n >\n <sky-grid-cell\n [skyHighlight]=\"!column.excludeFromHighlighting ? highlightText : undefined\"\n [template]=\"column.template || defaultCellTemplate\"\n [fieldSelector]=\"column.field\"\n [item]=\"item\"\n [columnId]=\"column.id\"\n [attr.sky-cmp-id]=\"column.id || column.field\">\n </sky-grid-cell>\n </td>\n </tr>\n </tbody>\n </table>\n <div *ngIf=\"showResizeBar\"\n aria-hidden=\"true\"\n id=\"sky-grid-resize-bar\"\n tabindex=\"-1\"\n #resizeBar\n >\n </div>\n </div>\n</div>\n\n<ng-template #defaultCellTemplate let-row=\"row\" let-value=\"value\">{{value}}</ng-template>\n\n<ng-template\n let-item\n #inlineDeleteTemplateRef\n>\n <div\n [id]=\"'row-delete-ref-' + item.id\"\n [ngStyle]='{\n \"height\": getRowHeight(0),\n \"position\": \"fixed\",\n \"width\": tableWidth + \"px\"\n }'\n #inlineDeleteRef\n >\n <sky-inline-delete\n [pending]=\"getRowDeleteItem(item.id).pending\"\n (cancelTriggered)=\"cancelRowDelete(item.id)\"\n (deleteTriggered)=\"confirmRowDelete(item.id)\"\n ></sky-inline-delete>\n </div>\n</ng-template>\n",
|
|
1274
|
-
viewProviders: [DragulaService],
|
|
1275
|
-
providers: [
|
|
1276
|
-
SkyGridAdapterService
|
|
1277
|
-
],
|
|
1278
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1279
|
-
styles: [".sky-grid{position:relative;display:block}.sky-grid-table-container{overflow:auto}.sky-grid-table{position:relative;table-layout:fixed;border-collapse:collapse;margin:0;font-size:15px;min-width:100%}.sky-grid-table.sky-grid-fit{max-width:100%;width:100%}.sky-grid-tbody{background-color:#fff}.sky-grid-row{border-bottom:1px dotted #cdcfd2}.sky-grid-row:nth-child(odd){background-color:#fbfbfb}.sky-grid-row.sky-grid-row-highlight{border-top:1px solid #0974a1;box-shadow:0 0 0 3px inset #0974a1}.sky-grid-row .sky-grid-cell{padding:0;min-width:10px}.sky-grid-heading{position:relative;border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:0 solid #cdcfd2;padding:0;cursor:pointer;background-color:#fff;overflow:visible;background-clip:padding-box;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;-moz-user-select:none;-ms-user-select:none;user-select:none}.sky-grid-heading:first-child{border-left:1px solid transparent}.sky-grid-heading.sky-grid-header-dragging{background-color:#eeeeef}.sky-grid-heading.sky-grid-column-alignment-center .sky-grid-heading-sort,.sky-grid-heading.sky-grid-column-alignment-left .sky-grid-heading-sort{width:14px}.sky-grid-heading.sky-grid-column-alignment-center .sky-grid-help-inline-sort-hidden,.sky-grid-heading.sky-grid-column-alignment-left .sky-grid-help-inline-sort-hidden{margin-left:-14px;margin-right:14px}.sky-grid-heading.sky-grid-column-alignment-right .sky-grid-header-caret-hidden-spacing{padding-left:14px}.sky-grid-heading.sky-grid-column-alignment-right .sky-grid-heading-sort-visible{width:14px}.sky-grid-heading div{padding:8px}.sky-grid-heading .overflow{text-overflow:ellipsis;white-space:nowrap;position:relative;z-index:1;overflow:hidden;min-width:100%}.sky-grid-heading .sky-grid-column-input-aria-only{-webkit-appearance:none;-moz-appearance:none;height:100%;width:5px;position:absolute;display:block;top:0;bottom:0;right:0}.sky-grid-heading .sky-grid-column-input-aria-only::-moz-range-track{background:0 0}.sky-grid-heading .sky-grid-column-input-aria-only::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0;background:0 0;display:none}.sky-grid-heading .sky-grid-column-input-aria-only::-ms-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0;background:0 0;display:none}.sky-grid-heading .sky-grid-column-input-aria-only::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0;background:0 0;display:none}.sky-grid-heading .sky-grid-column-input-aria-only:focus{background-color:#00b4f1}.sky-grid-column-alignment-left{text-align:left}.sky-grid-column-alignment-center{text-align:center}.sky-grid-column-alignment-right{text-align:right}.sky-grid-multiselect-cell{padding:0;text-align:center}.sky-grid-multiselect-cell ::ng-deep.sky-switch-control{margin:0 auto}th.sky-grid-multiselect-cell{cursor:default}th.sky-grid-multiselect-cell .screen-reader-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:0;white-space:nowrap}@-moz-document url-prefix(){.sky-grid-multiselect-row td{border-left:0 solid transparent;border-right:0 solid transparent}}.sky-grid-multiselect-row:hover{background-color:#e9e4f1}.sky-grid-multiselect-row:hover:nth-child(odd){background:#e9e4f1}.sky-grid-multiselect-selected-row{background:#f1eef6;border-top:1px solid #dadbf6;border-bottom:1px solid #dadbf6}.sky-grid-multiselect-selected-row:nth-child(odd){background:#f1eef6}.sky-grid-has-toolbar .sky-grid-heading{border-top-width:0}.sky-grid-heading-sort.sky-grid-heading-sort-hidden{visibility:hidden}.sky-grid-heading-sort.sky-grid-heading-sort-visible{visibility:visible;padding-left:5px}.sky-grid-resize-handle{position:absolute;right:0;top:0;bottom:0;width:30px;z-index:2;min-height:20px;height:100%!important;vertical-align:middle;cursor:col-resize}.sky-grid-resize-handle:hover::after{background-color:#00b4f1}.sky-grid-resize-handle:after{position:absolute;right:0;top:0;bottom:0;width:5px;height:100%;content:\"\"}#sky-grid-resize-bar{position:absolute;top:0;left:0;z-index:99;height:100%;width:5px;background:#00b4f1;opacity:.6}tr{position:relative}.sky-grid-top-scroll-container{overflow:auto}.sky-grid-top-scroll{height:1px}"]
|
|
1280
|
-
})
|
|
1281
|
-
], SkyGridComponent);
|
|
1207
|
+
}
|
|
1208
|
+
SkyGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridComponent, deps: [{ token: i1.SkyAffixService }, { token: i0.ChangeDetectorRef }, { token: i2.DragulaService }, { token: SkyGridAdapterService }, { token: i1.SkyOverlayService }, { token: i1.SkyAppWindowRef }, { token: i1.SkyUIConfigService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1209
|
+
SkyGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyGridComponent, selector: "sky-grid", inputs: { columns: "columns", data: "data", enableMultiselect: "enableMultiselect", fit: "fit", hasToolbar: "hasToolbar", height: "height", highlightText: "highlightText", messageStream: "messageStream", multiselectRowId: "multiselectRowId", rowHighlightedId: "rowHighlightedId", selectedColumnIds: "selectedColumnIds", selectedRowIds: "selectedRowIds", settingsKey: "settingsKey", sortField: "sortField", width: "width" }, outputs: { columnWidthChange: "columnWidthChange", multiselectSelectionChange: "multiselectSelectionChange", rowDeleteCancel: "rowDeleteCancel", rowDeleteConfirm: "rowDeleteConfirm", selectedColumnIdsChange: "selectedColumnIdsChange", sortFieldChange: "sortFieldChange" }, host: { listeners: { "window:resize": "onWindowResize()" } }, providers: [SkyGridAdapterService], queries: [{ propertyName: "columnComponents", predicate: SkyGridColumnComponent }], viewQueries: [{ propertyName: "inlineDeleteTemplateRef", first: true, predicate: ["inlineDeleteTemplateRef"], descendants: true, read: TemplateRef }, { propertyName: "tableContainerElementRef", first: true, predicate: ["gridContainer"], descendants: true }, { propertyName: "tableElementRef", first: true, predicate: ["gridTable"], descendants: true }, { propertyName: "topScrollContainerElementRef", first: true, predicate: ["topScrollContainer"], descendants: true }, { propertyName: "resizeBar", first: true, predicate: ["resizeBar"], descendants: true }, { propertyName: "columnElementRefs", predicate: ["gridCol"], descendants: true }, { propertyName: "columnRangeInputElementRefs", predicate: ["colSizeRange"], descendants: true }, { propertyName: "inlineDeleteRefs", predicate: ["inlineDeleteRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"sky-grid\">\n <div\n *ngIf=\"showTopScroll\"\n class=\"sky-grid-top-scroll-container\"\n (scroll)=\"onTopScroll($event)\"\n #topScrollContainer\n >\n <div\n class=\"sky-grid-top-scroll\"\n [style.width.px]=\"getTopScrollWidth()\"\n ></div>\n </div>\n <div\n class=\"sky-grid-table-container\"\n [style.height.px]=\"height\"\n [style.width.px]=\"width\"\n (scroll)=\"onGridScroll($event)\"\n #gridContainer\n >\n <table class=\"sky-grid-table\" [ngClass]=\"getTableClassNames()\" #gridTable>\n <thead>\n <tr dragula=\"sky-grid-heading\">\n <th\n *ngIf=\"enableMultiselect\"\n class=\"\n sky-grid-heading sky-grid-multiselect-cell sky-grid-header-locked\n \"\n scope=\"col\"\n [style.max-width.px]=\"minColWidth\"\n [style.width.px]=\"minColWidth\"\n >\n <span class=\"screen-reader-only\">\n {{ 'skyux_grid_multiselect_select_row' | skyLibResources }}\n </span>\n </th>\n <th\n *ngFor=\"\n let column of displayedColumns;\n let last = last;\n let i = index\n \"\n class=\"sky-grid-heading sky-field-label\"\n scope=\"col\"\n [attr.sky-cmp-index]=\"i\"\n [attr.sky-cmp-id]=\"column.id || column.field\"\n [attr.aria-sort]=\"getAriaSortDirection(column) | async\"\n [id]=\"'sky-grid-' + gridId + '-column-' + i\"\n [ngClass]=\"'sky-grid-column-alignment-' + column.alignment\"\n [style.max-width.px]=\"column.width\"\n [style.width.px]=\"column.width\"\n [tabIndex]=\"column.isSortable ? 0 : -1\"\n (mouseup)=\"sortByColumn(column)\"\n (keydown)=\"onKeydown($event, column)\"\n (touchmove)=\"onTouchMove($event)\"\n #gridCol\n >\n <div\n class=\"overflow\"\n [ngClass]=\"getTableHeaderClassNames(column)\"\n [style.max-width.px]=\"column.width - 1\"\n [style.width.px]=\"column.width - 1\"\n >\n <span\n *ngIf=\"(getCaretVisibility(column.field) | async) === 'hidden'\"\n class=\"sky-grid-header-caret-hidden-spacing\"\n ></span>\n <!-- The no spacing here is intentional to avoid extra spaces due to these being inline elements -->\n <span class=\"sky-grid-header-text\">{{\n column.heading?.trim()\n }}</span>\n <sky-icon\n class=\"sky-grid-heading-sort\"\n [ngClass]=\"\n 'sky-grid-heading-sort-' +\n (getCaretVisibility(column.field) | async)\n \"\n [icon]=\"getCaretIconNames(column)\"\n >\n </sky-icon>\n <sky-help-inline\n *ngIf=\"column.inlineHelpPopover\"\n [ngClass]=\"{\n 'sky-grid-help-inline-sort-hidden':\n getHelpInlineClass(column.field) | async\n }\"\n [skyPopover]=\"column.inlineHelpPopover\"\n (keydown.enter)=\"$event.stopPropagation()\"\n (keydown.space)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.stopPropagation()\"\n (mouseup)=\"$event.stopPropagation()\"\n >\n </sky-help-inline>\n </div>\n <span\n *ngIf=\"(fit === 'width' && !last) || fit === 'scroll'\"\n aria-hidden=\"true\"\n class=\"sky-grid-resize-handle\"\n tabindex=\"-1\"\n [attr.sky-cmp-index]=\"i\"\n (mousedown)=\"onResizeColumnStart($event)\"\n (touchstart)=\"onResizeColumnStart($event)\"\n >\n </span>\n <input\n aria-label=\"Width of column\"\n class=\"sky-grid-column-input-aria-only\"\n role=\"slider\"\n type=\"range\"\n [attr.aria-controls]=\"'sky-grid-' + gridId + '-column-' + i\"\n [attr.aria-valuemin]=\"minColWidth\"\n [attr.aria-valuemax]=\"maxColWidth\"\n [attr.aria-valuenow]=\"column.width\"\n [attr.sky-cmp-index]=\"i\"\n [min]=\"minColWidth\"\n [max]=\"maxColWidth\"\n [step]=\"columnResizeStep\"\n [(ngModel)]=\"column.width\"\n (blur)=\"onResizeHandleBlur($event)\"\n (focus)=\"onResizeHandleFocus($event)\"\n (keydown)=\"onKeydownResizeCol($event)\"\n (change)=\"onInputChangeResizeCol($event)\"\n #colSizeRange\n />\n </th>\n </tr>\n </thead>\n <tbody class=\"sky-grid-tbody\">\n <tr\n class=\"sky-grid-row\"\n *ngFor=\"let item of items; let i = index\"\n [attr.aria-current]=\"isRowHighlighted(item.id) ? true : null\"\n [attr.aria-selected]=\"item.isSelected\"\n [attr.sky-cmp-id]=\"item.id\"\n [ngClass]=\"{\n 'sky-grid-multiselect-selected-row': item.isSelected,\n 'sky-grid-multiselect-row': enableMultiselect,\n 'sky-grid-row-highlight': isRowHighlighted(item.id)\n }\"\n (click)=\"onRowClick($event, item)\"\n >\n <td\n *ngIf=\"enableMultiselect\"\n class=\"sky-grid-multiselect-cell sky-grid-header-locked\"\n >\n <div\n [style.max-width.px]=\"minColWidth\"\n [style.width.px]=\"minColWidth\"\n >\n <sky-checkbox\n [label]=\"'skyux_grid_multiselect_select_row' | skyLibResources\"\n (change)=\"onMultiselectCheckboxChange()\"\n [(ngModel)]=\"item.isSelected\"\n >\n </sky-checkbox>\n </div>\n </td>\n <td\n *ngFor=\"\n let column of displayedColumns;\n let last = last;\n let i = index\n \"\n class=\"sky-grid-cell\"\n [ngClass]=\"'sky-grid-column-alignment-' + column.alignment\"\n [style.max-width.px]=\"column.width\"\n [style.width.px]=\"column.width\"\n >\n <sky-grid-cell\n [skyHighlight]=\"\n !column.excludeFromHighlighting ? highlightText : undefined\n \"\n [template]=\"column.template || defaultCellTemplate\"\n [fieldSelector]=\"column.field\"\n [item]=\"item\"\n [columnId]=\"column.id\"\n [attr.sky-cmp-id]=\"column.id || column.field\"\n >\n </sky-grid-cell>\n </td>\n </tr>\n </tbody>\n </table>\n <div\n *ngIf=\"showResizeBar\"\n aria-hidden=\"true\"\n id=\"sky-grid-resize-bar\"\n tabindex=\"-1\"\n #resizeBar\n ></div>\n </div>\n</div>\n\n<ng-template #defaultCellTemplate let-row=\"row\" let-value=\"value\">{{\n value\n}}</ng-template>\n\n<ng-template let-item #inlineDeleteTemplateRef>\n <div\n [id]=\"'row-delete-ref-' + item.id\"\n [ngStyle]=\"{\n height: getRowHeight(0),\n position: 'fixed',\n width: tableWidth + 'px'\n }\"\n #inlineDeleteRef\n >\n <sky-inline-delete\n [pending]=\"getRowDeleteItem(item.id).pending\"\n (cancelTriggered)=\"cancelRowDelete(item.id)\"\n (deleteTriggered)=\"confirmRowDelete(item.id)\"\n ></sky-inline-delete>\n </div>\n</ng-template>\n", styles: [".sky-grid{position:relative;display:block}.sky-grid-table-container{overflow:auto}.sky-grid-table{position:relative;table-layout:fixed;border-collapse:collapse;margin:0;font-size:15px;min-width:100%}.sky-grid-table.sky-grid-fit{max-width:100%;width:100%}.sky-grid-tbody{background-color:#fff}.sky-grid-row{border-bottom:1px dotted #cdcfd2}.sky-grid-row:nth-child(odd){background-color:#fbfbfb}.sky-grid-row.sky-grid-row-highlight{border-top:1px solid #0974a1;box-shadow:0 0 0 3px inset #0974a1}.sky-grid-row .sky-grid-cell{padding:0;min-width:10px}.sky-grid-heading{position:relative;border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:1px solid #cdcfd2;border-right-width:0px;padding:0;cursor:pointer;background-color:#fff;overflow:visible;background-clip:padding-box;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;user-select:none}.sky-grid-heading:first-child{border-left:1px solid transparent}.sky-grid-heading.sky-grid-header-dragging{background-color:#eeeeef}.sky-grid-heading.sky-grid-column-alignment-left .sky-grid-heading-sort,.sky-grid-heading.sky-grid-column-alignment-center .sky-grid-heading-sort{width:14px}.sky-grid-heading.sky-grid-column-alignment-left .sky-grid-help-inline-sort-hidden,.sky-grid-heading.sky-grid-column-alignment-center .sky-grid-help-inline-sort-hidden{margin-left:-14px;margin-right:14px}.sky-grid-heading.sky-grid-column-alignment-right .sky-grid-header-caret-hidden-spacing{padding-left:14px}.sky-grid-heading.sky-grid-column-alignment-right .sky-grid-heading-sort-visible{width:14px}.sky-grid-heading div{padding:8px}.sky-grid-heading .overflow{text-overflow:ellipsis;white-space:nowrap;position:relative;z-index:1;overflow:hidden;min-width:100%}.sky-grid-heading .sky-grid-column-input-aria-only{-webkit-appearance:none;-moz-appearance:none;height:100%;width:5px;position:absolute;display:block;top:0;bottom:0;right:0}.sky-grid-heading .sky-grid-column-input-aria-only::-moz-range-track{background:transparent}.sky-grid-heading .sky-grid-column-input-aria-only::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-grid-heading .sky-grid-column-input-aria-only::-ms-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-grid-heading .sky-grid-column-input-aria-only::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0 none;background:none;display:none}.sky-grid-heading .sky-grid-column-input-aria-only:focus{background-color:#00b4f1}.sky-grid-column-alignment-left{text-align:left}.sky-grid-column-alignment-center{text-align:center}.sky-grid-column-alignment-right{text-align:right}.sky-grid-multiselect-cell{padding:0;text-align:center}.sky-grid-multiselect-cell ::ng-deep .sky-switch-control{margin:0 auto}th.sky-grid-multiselect-cell{cursor:default}th.sky-grid-multiselect-cell .screen-reader-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:none;white-space:nowrap}@-moz-document url-prefix(){.sky-grid-multiselect-row td{border-left:0px solid transparent;border-right:0px solid transparent}}.sky-grid-multiselect-row:hover{background-color:#e9e4f1}.sky-grid-multiselect-row:hover:nth-child(odd){background:#e9e4f1}.sky-grid-multiselect-selected-row{background:#f1eef6;border-top:1px solid #dadbf6;border-bottom:1px solid #dadbf6}.sky-grid-multiselect-selected-row:nth-child(odd){background:#f1eef6}.sky-grid-has-toolbar .sky-grid-heading{border-top-width:0px}.sky-grid-heading-sort.sky-grid-heading-sort-hidden{visibility:hidden}.sky-grid-heading-sort.sky-grid-heading-sort-visible{visibility:visible;padding-left:5px}.sky-grid-resize-handle{position:absolute;right:0;top:0;bottom:0;width:30px;z-index:2;min-height:20px;height:100%!important;vertical-align:middle;cursor:col-resize}.sky-grid-resize-handle:hover:after{background-color:#00b4f1}.sky-grid-resize-handle:after{position:absolute;right:0;top:0;bottom:0;width:5px;height:100%;content:\"\"}#sky-grid-resize-bar{position:absolute;top:0;left:0;z-index:99;height:100%;width:5px;background:#00b4f1;opacity:.6}tr{position:relative}.sky-grid-top-scroll-container{overflow:auto}.sky-grid-top-scroll{height:1px}\n"], components: [{ type: i4.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i4.λ3, selector: "sky-help-inline", outputs: ["actionClick"] }, { type: i5.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: SkyGridCellComponent, selector: "sky-grid-cell", inputs: ["item", "columnId", "template", "fieldSelector"] }, { type: i7.λ8, selector: "sky-inline-delete", inputs: ["pending"], outputs: ["cancelTriggered", "deleteTriggered"] }], directives: [{ type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.DragulaDirective, selector: "[dragula]", inputs: ["dragula", "dragulaModel", "dragulaOptions"] }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9.λ7, selector: "[skyPopover]", inputs: ["skyPopover", "skyPopoverAlignment", "skyPopoverMessageStream", "skyPopoverPlacement", "skyPopoverTrigger"] }, { type: i10.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { type: i10.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i4.λ11, selector: "[skyHighlight]", inputs: ["skyHighlight"] }, { type: i8.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], pipes: { "skyLibResources": i11.SkyLibResourcesPipe, "async": i8.AsyncPipe }, viewProviders: [DragulaService], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridComponent, decorators: [{
|
|
1211
|
+
type: Component,
|
|
1212
|
+
args: [{
|
|
1213
|
+
selector: 'sky-grid',
|
|
1214
|
+
templateUrl: './grid.component.html',
|
|
1215
|
+
styleUrls: ['./grid.component.scss'],
|
|
1216
|
+
viewProviders: [DragulaService],
|
|
1217
|
+
providers: [SkyGridAdapterService],
|
|
1218
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1219
|
+
}]
|
|
1220
|
+
}], ctorParameters: function () { return [{ type: i1.SkyAffixService }, { type: i0.ChangeDetectorRef }, { type: i2.DragulaService }, { type: SkyGridAdapterService }, { type: i1.SkyOverlayService }, { type: i1.SkyAppWindowRef }, { type: i1.SkyUIConfigService }]; }, propDecorators: { columns: [{
|
|
1221
|
+
type: Input
|
|
1222
|
+
}], data: [{
|
|
1223
|
+
type: Input
|
|
1224
|
+
}], enableMultiselect: [{
|
|
1225
|
+
type: Input
|
|
1226
|
+
}], fit: [{
|
|
1227
|
+
type: Input
|
|
1228
|
+
}], hasToolbar: [{
|
|
1229
|
+
type: Input
|
|
1230
|
+
}], height: [{
|
|
1231
|
+
type: Input
|
|
1232
|
+
}], highlightText: [{
|
|
1233
|
+
type: Input
|
|
1234
|
+
}], messageStream: [{
|
|
1235
|
+
type: Input
|
|
1236
|
+
}], multiselectRowId: [{
|
|
1237
|
+
type: Input
|
|
1238
|
+
}], rowHighlightedId: [{
|
|
1239
|
+
type: Input
|
|
1240
|
+
}], selectedColumnIds: [{
|
|
1241
|
+
type: Input
|
|
1242
|
+
}], selectedRowIds: [{
|
|
1243
|
+
type: Input
|
|
1244
|
+
}], settingsKey: [{
|
|
1245
|
+
type: Input
|
|
1246
|
+
}], sortField: [{
|
|
1247
|
+
type: Input
|
|
1248
|
+
}], width: [{
|
|
1249
|
+
type: Input
|
|
1250
|
+
}], columnWidthChange: [{
|
|
1251
|
+
type: Output
|
|
1252
|
+
}], multiselectSelectionChange: [{
|
|
1253
|
+
type: Output
|
|
1254
|
+
}], rowDeleteCancel: [{
|
|
1255
|
+
type: Output
|
|
1256
|
+
}], rowDeleteConfirm: [{
|
|
1257
|
+
type: Output
|
|
1258
|
+
}], selectedColumnIdsChange: [{
|
|
1259
|
+
type: Output
|
|
1260
|
+
}], sortFieldChange: [{
|
|
1261
|
+
type: Output
|
|
1262
|
+
}], columnComponents: [{
|
|
1263
|
+
type: ContentChildren,
|
|
1264
|
+
args: [SkyGridColumnComponent]
|
|
1265
|
+
}], columnElementRefs: [{
|
|
1266
|
+
type: ViewChildren,
|
|
1267
|
+
args: ['gridCol']
|
|
1268
|
+
}], columnRangeInputElementRefs: [{
|
|
1269
|
+
type: ViewChildren,
|
|
1270
|
+
args: ['colSizeRange']
|
|
1271
|
+
}], inlineDeleteRefs: [{
|
|
1272
|
+
type: ViewChildren,
|
|
1273
|
+
args: ['inlineDeleteRef']
|
|
1274
|
+
}], inlineDeleteTemplateRef: [{
|
|
1275
|
+
type: ViewChild,
|
|
1276
|
+
args: ['inlineDeleteTemplateRef', { read: TemplateRef }]
|
|
1277
|
+
}], tableContainerElementRef: [{
|
|
1278
|
+
type: ViewChild,
|
|
1279
|
+
args: ['gridContainer']
|
|
1280
|
+
}], tableElementRef: [{
|
|
1281
|
+
type: ViewChild,
|
|
1282
|
+
args: ['gridTable']
|
|
1283
|
+
}], topScrollContainerElementRef: [{
|
|
1284
|
+
type: ViewChild,
|
|
1285
|
+
args: ['topScrollContainer']
|
|
1286
|
+
}], resizeBar: [{
|
|
1287
|
+
type: ViewChild,
|
|
1288
|
+
args: ['resizeBar']
|
|
1289
|
+
}], onWindowResize: [{
|
|
1290
|
+
type: HostListener,
|
|
1291
|
+
args: ['window:resize']
|
|
1292
|
+
}] } });
|
|
1282
1293
|
|
|
1283
1294
|
/**
|
|
1284
|
-
*
|
|
1295
|
+
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
1296
|
+
* The contents of this file were automatically generated by
|
|
1297
|
+
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/skyux-grids' schematic.
|
|
1298
|
+
* To update this file, simply rerun the command.
|
|
1285
1299
|
*/
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
this.container.createEmbeddedView(this.template, this);
|
|
1289
|
-
}
|
|
1290
|
-
get row() {
|
|
1291
|
-
return this.item.data;
|
|
1292
|
-
}
|
|
1293
|
-
get value() {
|
|
1294
|
-
if (this.item.data && (this.fieldSelector || this.columnId)) {
|
|
1295
|
-
return getData(this.item.data, this.fieldSelector || this.columnId);
|
|
1296
|
-
}
|
|
1297
|
-
return undefined;
|
|
1298
|
-
}
|
|
1300
|
+
const RESOURCES = {
|
|
1301
|
+
'EN-US': { skyux_grid_multiselect_select_row: { message: 'Select row' } },
|
|
1299
1302
|
};
|
|
1300
|
-
|
|
1301
|
-
Input()
|
|
1302
|
-
], SkyGridCellComponent.prototype, "item", void 0);
|
|
1303
|
-
__decorate([
|
|
1304
|
-
Input()
|
|
1305
|
-
], SkyGridCellComponent.prototype, "columnId", void 0);
|
|
1306
|
-
__decorate([
|
|
1307
|
-
Input()
|
|
1308
|
-
], SkyGridCellComponent.prototype, "template", void 0);
|
|
1309
|
-
__decorate([
|
|
1310
|
-
Input()
|
|
1311
|
-
], SkyGridCellComponent.prototype, "fieldSelector", void 0);
|
|
1312
|
-
__decorate([
|
|
1313
|
-
ViewChild('cell', {
|
|
1314
|
-
read: ViewContainerRef,
|
|
1315
|
-
static: true
|
|
1316
|
-
})
|
|
1317
|
-
], SkyGridCellComponent.prototype, "container", void 0);
|
|
1318
|
-
SkyGridCellComponent = __decorate([
|
|
1319
|
-
Component({
|
|
1320
|
-
selector: 'sky-grid-cell',
|
|
1321
|
-
template: '<ng-template #cell></ng-template>',
|
|
1322
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1323
|
-
styles: [":host{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px;min-height:35px}"]
|
|
1324
|
-
})
|
|
1325
|
-
], SkyGridCellComponent);
|
|
1326
|
-
|
|
1327
|
-
let SkyGridsResourcesProvider = class SkyGridsResourcesProvider {
|
|
1328
|
-
constructor() {
|
|
1329
|
-
this.resources = { "EN-US": { "skyux_grid_multiselect_select_row": "Select row" } };
|
|
1330
|
-
}
|
|
1303
|
+
class SkyuxGridsResourcesProvider {
|
|
1331
1304
|
getString(localeInfo, name) {
|
|
1332
|
-
return
|
|
1305
|
+
return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
|
1333
1306
|
}
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
};
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
],
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Import into any component library module that needs to use resource strings.
|
|
1310
|
+
*/
|
|
1311
|
+
class SkyuxGridsResourcesModule {
|
|
1312
|
+
}
|
|
1313
|
+
SkyuxGridsResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyuxGridsResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1314
|
+
SkyuxGridsResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyuxGridsResourcesModule, exports: [SkyI18nModule] });
|
|
1315
|
+
SkyuxGridsResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyuxGridsResourcesModule, providers: [
|
|
1316
|
+
{
|
|
1317
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
1318
|
+
useClass: SkyuxGridsResourcesProvider,
|
|
1319
|
+
multi: true,
|
|
1320
|
+
},
|
|
1321
|
+
], imports: [SkyI18nModule] });
|
|
1322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyuxGridsResourcesModule, decorators: [{
|
|
1323
|
+
type: NgModule,
|
|
1324
|
+
args: [{
|
|
1325
|
+
exports: [SkyI18nModule],
|
|
1326
|
+
providers: [
|
|
1327
|
+
{
|
|
1328
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
1329
|
+
useClass: SkyuxGridsResourcesProvider,
|
|
1330
|
+
multi: true,
|
|
1331
|
+
},
|
|
1332
|
+
],
|
|
1333
|
+
}]
|
|
1334
|
+
}] });
|
|
1353
1335
|
|
|
1354
|
-
|
|
1355
|
-
}
|
|
1356
|
-
SkyGridModule =
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1336
|
+
class SkyGridModule {
|
|
1337
|
+
}
|
|
1338
|
+
SkyGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1339
|
+
SkyGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridModule, declarations: [SkyGridComponent,
|
|
1340
|
+
SkyGridColumnComponent,
|
|
1341
|
+
SkyGridCellComponent], imports: [CommonModule,
|
|
1342
|
+
DragulaModule,
|
|
1343
|
+
FormsModule,
|
|
1344
|
+
SkyAffixModule,
|
|
1345
|
+
SkyCheckboxModule,
|
|
1346
|
+
SkyuxGridsResourcesModule,
|
|
1347
|
+
SkyHelpInlineModule,
|
|
1348
|
+
SkyIconModule,
|
|
1349
|
+
SkyInlineDeleteModule,
|
|
1350
|
+
SkyOverlayModule,
|
|
1351
|
+
SkyPopoverModule,
|
|
1352
|
+
SkyTextHighlightModule], exports: [SkyGridComponent, SkyGridColumnComponent] });
|
|
1353
|
+
SkyGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridModule, imports: [[
|
|
1364
1354
|
CommonModule,
|
|
1365
1355
|
DragulaModule,
|
|
1366
1356
|
FormsModule,
|
|
1367
1357
|
SkyAffixModule,
|
|
1368
1358
|
SkyCheckboxModule,
|
|
1369
|
-
|
|
1359
|
+
SkyuxGridsResourcesModule,
|
|
1370
1360
|
SkyHelpInlineModule,
|
|
1371
1361
|
SkyIconModule,
|
|
1372
1362
|
SkyInlineDeleteModule,
|
|
1373
1363
|
SkyOverlayModule,
|
|
1374
1364
|
SkyPopoverModule,
|
|
1375
|
-
SkyTextHighlightModule
|
|
1376
|
-
]
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1365
|
+
SkyTextHighlightModule,
|
|
1366
|
+
]] });
|
|
1367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyGridModule, decorators: [{
|
|
1368
|
+
type: NgModule,
|
|
1369
|
+
args: [{
|
|
1370
|
+
declarations: [
|
|
1371
|
+
SkyGridComponent,
|
|
1372
|
+
SkyGridColumnComponent,
|
|
1373
|
+
SkyGridCellComponent,
|
|
1374
|
+
],
|
|
1375
|
+
imports: [
|
|
1376
|
+
CommonModule,
|
|
1377
|
+
DragulaModule,
|
|
1378
|
+
FormsModule,
|
|
1379
|
+
SkyAffixModule,
|
|
1380
|
+
SkyCheckboxModule,
|
|
1381
|
+
SkyuxGridsResourcesModule,
|
|
1382
|
+
SkyHelpInlineModule,
|
|
1383
|
+
SkyIconModule,
|
|
1384
|
+
SkyInlineDeleteModule,
|
|
1385
|
+
SkyOverlayModule,
|
|
1386
|
+
SkyPopoverModule,
|
|
1387
|
+
SkyTextHighlightModule,
|
|
1388
|
+
],
|
|
1389
|
+
exports: [SkyGridComponent, SkyGridColumnComponent],
|
|
1390
|
+
}]
|
|
1391
|
+
}] });
|
|
1388
1392
|
|
|
1389
1393
|
/**
|
|
1390
1394
|
* Generated bundle index. Do not edit.
|
|
1391
1395
|
*/
|
|
1392
1396
|
|
|
1393
|
-
export { SkyGridColumnComponent, SkyGridColumnModel, SkyGridComponent, SkyGridMessageType, SkyGridModule, SkyGridSelectedRowsSource
|
|
1397
|
+
export { SkyGridColumnComponent, SkyGridColumnModel, SkyGridComponent, SkyGridMessageType, SkyGridModule, SkyGridSelectedRowsSource };
|
|
1394
1398
|
//# sourceMappingURL=skyux-grids.js.map
|