@skyux/ag-grid 7.0.0-beta.13 → 7.0.0-beta.16
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/documentation.json +622 -585
- package/esm2020/lib/modules/ag-grid/ag-grid-adapter.service.mjs +3 -1
- package/esm2020/lib/modules/ag-grid/ag-grid-data-manager-adapter.directive.mjs +129 -110
- package/esm2020/lib/modules/ag-grid/ag-grid-row-delete.component.mjs +2 -2
- package/esm2020/lib/modules/ag-grid/ag-grid-row-delete.directive.mjs +126 -114
- package/esm2020/lib/modules/ag-grid/ag-grid-wrapper.component.mjs +90 -84
- package/esm2020/lib/modules/ag-grid/ag-grid.service.mjs +292 -294
- package/esm2020/lib/modules/ag-grid/apply-lookup-properties-defaults.mjs +13 -9
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.mjs +27 -22
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.mjs +28 -24
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.mjs +59 -53
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.mjs +43 -37
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.mjs +31 -27
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.mjs +31 -27
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency-validator.component.mjs +5 -3
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.component.mjs +22 -17
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.mjs +1 -1
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.component.mjs +27 -20
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.component.mjs +2 -1
- package/esm2020/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator-tooltip.component.mjs +31 -27
- package/esm2020/lib/modules/ag-grid/header/header-group.component.mjs +12 -12
- package/esm2020/lib/modules/ag-grid/header/header.component.mjs +20 -20
- package/esm2020/lib/modules/ag-grid/types/autocomplete-properties.mjs +1 -1
- package/esm2020/lib/modules/ag-grid/types/cell-class.mjs +2 -17
- package/esm2020/lib/modules/ag-grid/types/cell-editor-utils.mjs +7 -2
- package/esm2020/lib/modules/ag-grid/types/header-group-info.mjs +1 -1
- package/esm2020/lib/modules/ag-grid/types/header-info.mjs +1 -1
- package/esm2020/lib/modules/ag-grid/types/lookup-properties.mjs +1 -1
- package/esm2020/lib/modules/ag-grid/types/validator-properties.mjs +1 -1
- package/fesm2015/skyux-ag-grid.mjs +960 -858
- package/fesm2015/skyux-ag-grid.mjs.map +1 -1
- package/fesm2020/skyux-ag-grid.mjs +981 -908
- package/fesm2020/skyux-ag-grid.mjs.map +1 -1
- package/lib/modules/ag-grid/ag-grid-adapter.service.d.ts +1 -1
- package/lib/modules/ag-grid/ag-grid-data-manager-adapter.directive.d.ts +4 -22
- package/lib/modules/ag-grid/ag-grid-row-delete.component.d.ts +2 -2
- package/lib/modules/ag-grid/ag-grid-row-delete.directive.d.ts +5 -18
- package/lib/modules/ag-grid/ag-grid-wrapper.component.d.ts +1 -7
- package/lib/modules/ag-grid/ag-grid.service.d.ts +0 -11
- package/lib/modules/ag-grid/apply-lookup-properties-defaults.d.ts +1 -23
- package/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.d.ts +3 -3
- package/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.d.ts +7 -8
- package/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.d.ts +5 -8
- package/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.d.ts +2 -6
- package/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.d.ts +8 -8
- package/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.d.ts +8 -8
- package/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency-validator.component.d.ts +1 -1
- package/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.component.d.ts +9 -10
- package/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.d.ts +2 -2
- package/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.component.d.ts +6 -8
- package/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.component.d.ts +3 -3
- package/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator-tooltip.component.d.ts +4 -7
- package/lib/modules/ag-grid/header/header-group.component.d.ts +4 -4
- package/lib/modules/ag-grid/header/header.component.d.ts +4 -4
- package/lib/modules/ag-grid/types/autocomplete-properties.d.ts +5 -4
- package/lib/modules/ag-grid/types/cell-class.d.ts +1 -1
- package/lib/modules/ag-grid/types/cell-editor-utils.d.ts +2 -1
- package/lib/modules/ag-grid/types/header-group-info.d.ts +2 -2
- package/lib/modules/ag-grid/types/header-info.d.ts +2 -2
- package/lib/modules/ag-grid/types/lookup-properties.d.ts +3 -3
- package/lib/modules/ag-grid/types/validator-properties.d.ts +2 -2
- package/package.json +12 -12
|
@@ -15,9 +15,9 @@ import { SkyInlineDeleteModule } from '@skyux/layout';
|
|
|
15
15
|
import * as i1$2 from '@skyux/theme';
|
|
16
16
|
import { SkyThemeModule } from '@skyux/theme';
|
|
17
17
|
import { AgGridAngular, AgGridModule } from 'ag-grid-angular';
|
|
18
|
-
import { fromEvent, Subject, BehaviorSubject, Subscription } from 'rxjs';
|
|
19
|
-
import { first, takeUntil, filter } from 'rxjs/operators';
|
|
20
18
|
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
19
|
+
import { fromEvent, Subject, BehaviorSubject, Subscription, fromEventPattern } from 'rxjs';
|
|
20
|
+
import { first, takeUntil, filter } from 'rxjs/operators';
|
|
21
21
|
import * as i1$1 from '@angular/forms';
|
|
22
22
|
import { UntypedFormGroup, UntypedFormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
23
23
|
import { KeyCode, PopupComponent, Events, Column, RowNode } from 'ag-grid-community';
|
|
@@ -43,6 +43,7 @@ class SkyAgGridAdapterService {
|
|
|
43
43
|
else if (element.parentElement) {
|
|
44
44
|
return this.getElementOrParentWithClass(element.parentElement, className);
|
|
45
45
|
}
|
|
46
|
+
return undefined;
|
|
46
47
|
}
|
|
47
48
|
setFocusedElementById(parentEl, selector) {
|
|
48
49
|
const element = parentEl.querySelector(`#${selector}`);
|
|
@@ -66,6 +67,7 @@ class SkyAgGridAdapterService {
|
|
|
66
67
|
return focusableChildren[nextIndex];
|
|
67
68
|
}
|
|
68
69
|
}
|
|
70
|
+
return undefined;
|
|
69
71
|
}
|
|
70
72
|
focusOnFocusableChildren(element) {
|
|
71
73
|
const focusableChildren = this.skyAdapterService.getFocusableChildren(element);
|
|
@@ -87,8 +89,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
87
89
|
* @internal
|
|
88
90
|
*/
|
|
89
91
|
function applySkyLookupPropertiesDefaults(skyLookupProperties) {
|
|
92
|
+
/* istanbul ignore if */
|
|
93
|
+
if (!skyLookupProperties) {
|
|
94
|
+
return {};
|
|
95
|
+
}
|
|
90
96
|
return {
|
|
91
|
-
addClick: skyLookupProperties.addClick
|
|
97
|
+
addClick: skyLookupProperties.addClick,
|
|
92
98
|
ariaLabel: skyLookupProperties.ariaLabel || '',
|
|
93
99
|
autocompleteAttribute: skyLookupProperties.autocompleteAttribute || 'off',
|
|
94
100
|
data: skyLookupProperties.data || [],
|
|
@@ -96,16 +102,16 @@ function applySkyLookupPropertiesDefaults(skyLookupProperties) {
|
|
|
96
102
|
descriptorProperty: skyLookupProperties.descriptorProperty || 'name',
|
|
97
103
|
disabled: skyLookupProperties.disabled || false,
|
|
98
104
|
enableShowMore: skyLookupProperties.enableShowMore || false,
|
|
99
|
-
idProperty: skyLookupProperties.idProperty
|
|
105
|
+
idProperty: skyLookupProperties.idProperty,
|
|
100
106
|
placeholderText: skyLookupProperties.placeholderText || '',
|
|
101
|
-
propertiesToSearch: skyLookupProperties.propertiesToSearch
|
|
102
|
-
search: skyLookupProperties.search
|
|
103
|
-
searchAsync: skyLookupProperties.searchAsync
|
|
107
|
+
propertiesToSearch: skyLookupProperties.propertiesToSearch,
|
|
108
|
+
search: skyLookupProperties.search,
|
|
109
|
+
searchAsync: skyLookupProperties.searchAsync,
|
|
104
110
|
searchFilters: skyLookupProperties.searchFilters || [],
|
|
105
|
-
searchResultsLimit: skyLookupProperties.searchResultsLimit
|
|
106
|
-
searchResultTemplate: skyLookupProperties.searchResultTemplate
|
|
111
|
+
searchResultsLimit: skyLookupProperties.searchResultsLimit,
|
|
112
|
+
searchResultTemplate: skyLookupProperties.searchResultTemplate,
|
|
107
113
|
searchTextMinimumCharacters: skyLookupProperties.searchTextMinimumCharacters || 1,
|
|
108
|
-
selectMode: skyLookupProperties.selectMode
|
|
114
|
+
selectMode: skyLookupProperties.selectMode,
|
|
109
115
|
showAddButton: skyLookupProperties.showAddButton || false,
|
|
110
116
|
showMoreConfig: skyLookupProperties.showMoreConfig || {},
|
|
111
117
|
wrapperClass: 'ag-custom-component-popup',
|
|
@@ -131,7 +137,7 @@ class SkyAgGridCellEditorUtils {
|
|
|
131
137
|
* @param params The editor's initializing parameters.
|
|
132
138
|
*/
|
|
133
139
|
static getEditorInitialAction(params) {
|
|
134
|
-
if (params.cellStartedEdit) {
|
|
140
|
+
if (params === null || params === void 0 ? void 0 : params.cellStartedEdit) {
|
|
135
141
|
if (params.eventKey === KeyCode.BACKSPACE ||
|
|
136
142
|
params.eventKey === KeyCode.DELETE) {
|
|
137
143
|
return SkyAgGridCellEditorInitialAction.Delete;
|
|
@@ -152,6 +158,11 @@ class SkyAgGridCellEditorUtils {
|
|
|
152
158
|
return SkyAgGridCellEditorInitialAction.Untouched;
|
|
153
159
|
}
|
|
154
160
|
}
|
|
161
|
+
static subtractOrZero(minuend, subtrahend) {
|
|
162
|
+
// Swapping minuend with subtrahend when minuend is null or undefined results in
|
|
163
|
+
// the subtrahend being subtracted from itself, which will always be 0.
|
|
164
|
+
return (minuend !== null && minuend !== void 0 ? minuend : subtrahend) - subtrahend;
|
|
165
|
+
}
|
|
155
166
|
}
|
|
156
167
|
|
|
157
168
|
var _SkyAgGridCellEditorAutocompleteComponent_triggerType;
|
|
@@ -170,36 +181,43 @@ class SkyAgGridCellEditorAutocompleteComponent {
|
|
|
170
181
|
this.params = params;
|
|
171
182
|
__classPrivateFieldSet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
172
183
|
const control = this.editorForm.get('selection');
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
if (control) {
|
|
185
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, "f")) {
|
|
186
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
187
|
+
control.setValue(undefined);
|
|
188
|
+
break;
|
|
189
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
190
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
191
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
192
|
+
default:
|
|
193
|
+
control.setValue(params.value);
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
183
196
|
}
|
|
184
197
|
this.columnHeader = this.params.colDef && this.params.colDef.headerName;
|
|
185
198
|
this.rowNumber = this.params.rowIndex + 1;
|
|
186
199
|
this.skyComponentProperties = this.params.skyComponentProperties || {};
|
|
187
200
|
}
|
|
188
201
|
afterGuiAttached() {
|
|
189
|
-
|
|
190
|
-
if (
|
|
191
|
-
this.input.nativeElement.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
202
|
+
var _a;
|
|
203
|
+
if (this.input) {
|
|
204
|
+
this.input.nativeElement.focus();
|
|
205
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
206
|
+
const charPress = (_a = this.params) === null || _a === void 0 ? void 0 : _a.charPress;
|
|
207
|
+
this.input.nativeElement.select();
|
|
208
|
+
this.input.nativeElement.setRangeText(charPress);
|
|
209
|
+
// Ensure the cursor is at the end of the text.
|
|
210
|
+
this.input.nativeElement.setSelectionRange(charPress.length, charPress.length);
|
|
211
|
+
this.input.nativeElement.dispatchEvent(new Event('input'));
|
|
212
|
+
}
|
|
213
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
214
|
+
this.input.nativeElement.select();
|
|
215
|
+
}
|
|
199
216
|
}
|
|
200
217
|
}
|
|
201
218
|
getValue() {
|
|
202
|
-
|
|
219
|
+
var _a;
|
|
220
|
+
const val = (_a = this.editorForm.get('selection')) === null || _a === void 0 ? void 0 : _a.value;
|
|
203
221
|
return val !== undefined && val !== null ? val : undefined;
|
|
204
222
|
}
|
|
205
223
|
}
|
|
@@ -214,30 +232,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
214
232
|
args: ['skyCellEditorAutocomplete', { read: ElementRef }]
|
|
215
233
|
}] } });
|
|
216
234
|
|
|
217
|
-
var _SkyAgGridCellEditorCurrencyComponent_triggerType;
|
|
235
|
+
var _SkyAgGridCellEditorCurrencyComponent_triggerType, _SkyAgGridCellEditorCurrencyComponent_changeDetector;
|
|
218
236
|
/**
|
|
219
237
|
* @internal
|
|
220
238
|
*/
|
|
221
239
|
class SkyAgGridCellEditorCurrencyComponent {
|
|
222
240
|
constructor(changeDetector) {
|
|
223
|
-
this.changeDetector = changeDetector;
|
|
224
241
|
this.skyComponentProperties = {};
|
|
225
242
|
this.editorForm = new UntypedFormGroup({
|
|
226
243
|
currency: new UntypedFormControl(),
|
|
227
244
|
});
|
|
228
245
|
_SkyAgGridCellEditorCurrencyComponent_triggerType.set(this, void 0);
|
|
246
|
+
_SkyAgGridCellEditorCurrencyComponent_changeDetector.set(this, void 0);
|
|
247
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorCurrencyComponent_changeDetector, changeDetector, "f");
|
|
229
248
|
}
|
|
230
249
|
/**
|
|
231
250
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
232
251
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
233
252
|
*/
|
|
234
253
|
agInit(params) {
|
|
254
|
+
var _a;
|
|
235
255
|
this.params = params;
|
|
236
256
|
this.columnHeader = this.params.colDef.headerName;
|
|
237
257
|
this.rowNumber = this.params.rowIndex + 1;
|
|
238
258
|
this.columnWidth = this.params.column.getActualWidth();
|
|
239
|
-
this.rowHeightWithoutBorders =
|
|
240
|
-
this.params.node && this.params.node.rowHeight - 4;
|
|
259
|
+
this.rowHeightWithoutBorders = SkyAgGridCellEditorUtils.subtractOrZero((_a = this.params.node) === null || _a === void 0 ? void 0 : _a.rowHeight, 4);
|
|
241
260
|
this.skyComponentProperties = this.params.skyComponentProperties || {
|
|
242
261
|
decimalPlaces: 2,
|
|
243
262
|
currencySymbol: '$',
|
|
@@ -247,29 +266,33 @@ class SkyAgGridCellEditorCurrencyComponent {
|
|
|
247
266
|
* afterGuiAttached is called by agGrid after the editor is rendered in the DOM. Once it is attached the editor is ready to be focused on.
|
|
248
267
|
*/
|
|
249
268
|
afterGuiAttached() {
|
|
250
|
-
|
|
269
|
+
var _a, _b, _c;
|
|
270
|
+
(_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeElement.focus();
|
|
251
271
|
// This setup is in `afterGuiAttached` due to the lifecycle of autonumeric which will highlight the initial value if it is in place when it renders.
|
|
252
272
|
// Since we don't want that, we set the initial value after autonumeric initializes.
|
|
253
273
|
__classPrivateFieldSet(this, _SkyAgGridCellEditorCurrencyComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(this.params), "f");
|
|
254
274
|
const control = this.editorForm.get('currency');
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
275
|
+
if (control) {
|
|
276
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorCurrencyComponent_triggerType, "f")) {
|
|
277
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
278
|
+
control.setValue(undefined);
|
|
279
|
+
break;
|
|
280
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
281
|
+
control.setValue(parseFloat(String((_b = this.params) === null || _b === void 0 ? void 0 : _b.charPress)) || undefined);
|
|
282
|
+
break;
|
|
283
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
284
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
285
|
+
default:
|
|
286
|
+
control.setValue(parseFloat(String((_c = this.params) === null || _c === void 0 ? void 0 : _c.value)));
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
267
289
|
}
|
|
268
|
-
this.
|
|
290
|
+
__classPrivateFieldGet(this, _SkyAgGridCellEditorCurrencyComponent_changeDetector, "f").markForCheck();
|
|
269
291
|
// Without the `setTimeout` there is inconsistent behavior with the highlighting when no initial value is present.
|
|
270
292
|
setTimeout(() => {
|
|
293
|
+
var _a;
|
|
271
294
|
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorCurrencyComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
272
|
-
this.input.nativeElement.select();
|
|
295
|
+
(_a = this.input) === null || _a === void 0 ? void 0 : _a.nativeElement.select();
|
|
273
296
|
}
|
|
274
297
|
}, 100);
|
|
275
298
|
}
|
|
@@ -277,18 +300,21 @@ class SkyAgGridCellEditorCurrencyComponent {
|
|
|
277
300
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
278
301
|
*/
|
|
279
302
|
getValue() {
|
|
280
|
-
|
|
303
|
+
var _a;
|
|
304
|
+
const val = (_a = this.editorForm.get('currency')) === null || _a === void 0 ? void 0 : _a.value;
|
|
281
305
|
return val !== undefined && val !== null ? val : undefined;
|
|
282
306
|
}
|
|
283
307
|
/**
|
|
284
308
|
* The autoNumeric library's event handler suppresses the escape key event. This additional handler re-enables AG Grid's default functionality.
|
|
285
309
|
*/
|
|
286
310
|
onPressEscape() {
|
|
287
|
-
this.params
|
|
288
|
-
|
|
311
|
+
if (this.params) {
|
|
312
|
+
this.params.api.stopEditing(true);
|
|
313
|
+
this.params.api.setFocusedCell(this.params.rowIndex, this.params.column);
|
|
314
|
+
}
|
|
289
315
|
}
|
|
290
316
|
}
|
|
291
|
-
_SkyAgGridCellEditorCurrencyComponent_triggerType = new WeakMap();
|
|
317
|
+
_SkyAgGridCellEditorCurrencyComponent_triggerType = new WeakMap(), _SkyAgGridCellEditorCurrencyComponent_changeDetector = new WeakMap();
|
|
292
318
|
SkyAgGridCellEditorCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
293
319
|
SkyAgGridCellEditorCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorCurrencyComponent, selector: "sky-ag-grid-cell-editor-currency", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorCurrency"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"currency\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_currency_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [skyAutonumeric]=\"skyComponentProperties\"\n [skyAutonumericFormChangesUnformatted]=\"!!params?.charPress\"\n (keyup.escape)=\"onPressEscape()\"\n #skyCellEditorCurrency\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2$1.λ1, selector: "input[skyAutonumeric]", inputs: ["skyAutonumeric", "skyAutonumericFormChangesUnformatted"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
294
320
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, decorators: [{
|
|
@@ -299,20 +325,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
299
325
|
args: ['skyCellEditorCurrency', { read: ElementRef }]
|
|
300
326
|
}] } });
|
|
301
327
|
|
|
302
|
-
var _SkyAgGridCellEditorDatepickerComponent_triggerType;
|
|
328
|
+
var _SkyAgGridCellEditorDatepickerComponent_params, _SkyAgGridCellEditorDatepickerComponent_triggerType, _SkyAgGridCellEditorDatepickerComponent_changeDetector, _SkyAgGridCellEditorDatepickerComponent_themeSvc;
|
|
303
329
|
/**
|
|
304
330
|
* @internal
|
|
305
331
|
*/
|
|
306
332
|
class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
307
333
|
constructor(changeDetector, themeSvc) {
|
|
308
334
|
super();
|
|
309
|
-
this.changeDetector = changeDetector;
|
|
310
|
-
this.themeSvc = themeSvc;
|
|
311
335
|
this.editorForm = new UntypedFormGroup({
|
|
312
336
|
date: new UntypedFormControl(),
|
|
313
337
|
});
|
|
314
338
|
this.skyComponentProperties = {};
|
|
339
|
+
_SkyAgGridCellEditorDatepickerComponent_params.set(this, void 0);
|
|
315
340
|
_SkyAgGridCellEditorDatepickerComponent_triggerType.set(this, void 0);
|
|
341
|
+
_SkyAgGridCellEditorDatepickerComponent_changeDetector.set(this, void 0);
|
|
342
|
+
_SkyAgGridCellEditorDatepickerComponent_themeSvc.set(this, void 0);
|
|
343
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorDatepickerComponent_changeDetector, changeDetector, "f");
|
|
344
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorDatepickerComponent_themeSvc, themeSvc, "f");
|
|
316
345
|
}
|
|
317
346
|
/**
|
|
318
347
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
@@ -320,41 +349,42 @@ class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
|
320
349
|
*/
|
|
321
350
|
agInit(params) {
|
|
322
351
|
var _a, _b;
|
|
323
|
-
this
|
|
352
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorDatepickerComponent_params, params, "f");
|
|
324
353
|
__classPrivateFieldSet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
325
354
|
const control = this.editorForm.get('date');
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
355
|
+
if (control) {
|
|
356
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f")) {
|
|
357
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
358
|
+
control.setValue(undefined);
|
|
359
|
+
break;
|
|
360
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
361
|
+
control.setValue(params.charPress);
|
|
362
|
+
break;
|
|
363
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
364
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
365
|
+
default:
|
|
366
|
+
control.setValue(params.value);
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
if ((_a = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_params, "f").skyComponentProperties) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
370
|
+
control.disable();
|
|
371
|
+
}
|
|
341
372
|
}
|
|
342
|
-
this.
|
|
343
|
-
this.skyComponentProperties = this.
|
|
344
|
-
this.columnWidth = this.
|
|
373
|
+
__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_changeDetector, "f").markForCheck();
|
|
374
|
+
this.skyComponentProperties = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_params, "f").skyComponentProperties || {};
|
|
375
|
+
this.columnWidth = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_params, "f").column.getActualWidth();
|
|
345
376
|
this.columnWidthWithoutBorders = this.columnWidth - 2;
|
|
346
|
-
this.rowHeightWithoutBorders =
|
|
347
|
-
|
|
348
|
-
|
|
377
|
+
this.rowHeightWithoutBorders = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_params, "f").node.rowHeight - 3;
|
|
378
|
+
(_b = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_themeSvc, "f")) === null || _b === void 0 ? void 0 : _b.settingsChange.subscribe((themeSettings) => {
|
|
379
|
+
var _a, _b, _c;
|
|
349
380
|
if (themeSettings.currentSettings.theme.name === 'modern') {
|
|
350
381
|
this.columnWidthWithoutBorders = this.columnWidth;
|
|
351
|
-
this.rowHeightWithoutBorders =
|
|
352
|
-
this.params.node && this.params.node.rowHeight;
|
|
382
|
+
this.rowHeightWithoutBorders = (_b = (_a = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_params, "f")) === null || _a === void 0 ? void 0 : _a.node) === null || _b === void 0 ? void 0 : _b.rowHeight;
|
|
353
383
|
}
|
|
354
384
|
else {
|
|
355
|
-
this.columnWidthWithoutBorders =
|
|
356
|
-
|
|
357
|
-
|
|
385
|
+
this.columnWidthWithoutBorders =
|
|
386
|
+
this.columnWidth === undefined ? undefined : this.columnWidth - 2;
|
|
387
|
+
this.rowHeightWithoutBorders = SkyAgGridCellEditorUtils.subtractOrZero((_c = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_params, "f")) === null || _c === void 0 ? void 0 : _c.node.rowHeight, 3);
|
|
358
388
|
}
|
|
359
389
|
});
|
|
360
390
|
}
|
|
@@ -362,36 +392,41 @@ class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
|
362
392
|
* afterGuiAttached is called by agGrid after the editor is rendered in the DOM. Once it is attached the editor is ready to be focused on.
|
|
363
393
|
*/
|
|
364
394
|
afterGuiAttached() {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
datepickerInputEl
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
395
|
+
var _a, _b;
|
|
396
|
+
const datepickerInputEl = (_a = this.datepickerInput) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
397
|
+
if (datepickerInputEl) {
|
|
398
|
+
datepickerInputEl.focus();
|
|
399
|
+
// Programatically set the value of in the input; however, do not do this via the form control so that the value is not formatted when editing starts.
|
|
400
|
+
// Watch for the first blur and fire a 'change' event as programatic changes won't queue a change event, but we need to do this so that formatting happens if the user tabs to the calendar button.
|
|
401
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
402
|
+
fromEvent(datepickerInputEl, 'blur')
|
|
403
|
+
.pipe(first())
|
|
404
|
+
.subscribe(() => {
|
|
405
|
+
datepickerInputEl.dispatchEvent(new Event('change'));
|
|
406
|
+
});
|
|
407
|
+
datepickerInputEl.select();
|
|
408
|
+
const charPress = (_b = __classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_params, "f")) === null || _b === void 0 ? void 0 : _b.charPress;
|
|
409
|
+
if (charPress) {
|
|
410
|
+
datepickerInputEl.setRangeText(charPress);
|
|
411
|
+
// Ensure the cursor is at the end of the text.
|
|
412
|
+
datepickerInputEl.setSelectionRange(charPress.length, charPress.length);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
416
|
+
datepickerInputEl.select();
|
|
417
|
+
}
|
|
384
418
|
}
|
|
385
419
|
}
|
|
386
420
|
/**
|
|
387
421
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
388
422
|
*/
|
|
389
423
|
getValue() {
|
|
390
|
-
|
|
391
|
-
|
|
424
|
+
var _a, _b;
|
|
425
|
+
(_a = this.datepickerInput) === null || _a === void 0 ? void 0 : _a.nativeElement.blur();
|
|
426
|
+
return (_b = this.editorForm.get('date')) === null || _b === void 0 ? void 0 : _b.value;
|
|
392
427
|
}
|
|
393
428
|
}
|
|
394
|
-
_SkyAgGridCellEditorDatepickerComponent_triggerType = new WeakMap();
|
|
429
|
+
_SkyAgGridCellEditorDatepickerComponent_params = new WeakMap(), _SkyAgGridCellEditorDatepickerComponent_triggerType = new WeakMap(), _SkyAgGridCellEditorDatepickerComponent_changeDetector = new WeakMap(), _SkyAgGridCellEditorDatepickerComponent_themeSvc = new WeakMap();
|
|
395
430
|
SkyAgGridCellEditorDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
396
431
|
SkyAgGridCellEditorDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorDatepickerComponent, selector: "sky-ag-grid-cell-editor-datepicker", viewQueries: [{ propertyName: "datepickerInput", first: true, predicate: ["skyCellEditorDatepickerInput"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"sky-ag-grid-cell-editor-datepicker\"\n [formGroup]=\"editorForm\"\n [style.width.px]=\"columnWidthWithoutBorders\"\n>\n <sky-datepicker\n data-sky-id=\"cell-datepicker\"\n pickerClass=\"ag-custom-component-popup\"\n >\n <input\n formControlName=\"date\"\n skyDatepickerInput\n [minDate]=\"skyComponentProperties.minDate\"\n [maxDate]=\"skyComponentProperties.maxDate\"\n [dateFormat]=\"skyComponentProperties.dateFormat\"\n [startingDay]=\"skyComponentProperties.startingDay\"\n [skyDatepickerNoValidate]=\"skyComponentProperties.skyDatepickerNoValidate\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n #skyCellEditorDatepickerInput\n />\n </sky-datepicker>\n</div>\n", styles: [".sky-ag-grid-cell-editor-datepicker{position:relative;top:1px;left:1px}.sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control{box-shadow:none;border-width:1px;border-style:solid;border-color:transparent #cdcfd2 transparent transparent}.sky-ag-grid-cell-editor-datepicker sky-datepicker .sky-input-group-datepicker-btn{border-radius:0}:host-context(.sky-theme-modern) .sky-ag-grid-cell-editor-datepicker{position:static;top:initial;left:initial}:host-context(.sky-theme-modern) .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control{border-radius:0;border:1px solid #1870B8}:host-context(.sky-theme-modern) .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control:focus{border-width:2px!important}.sky-theme-modern .sky-ag-grid-cell-editor-datepicker{position:static;top:initial;left:initial}.sky-theme-modern .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control{border-radius:0;border:1px solid #1870B8}.sky-theme-modern .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control:focus{border-width:2px!important}\n"], dependencies: [{ kind: "component", type: i2$2.λ2, selector: "sky-datepicker", inputs: ["pickerClass"], outputs: ["calendarDateRangeChange"] }, { kind: "directive", type: i2$2.λ3, selector: "[skyDatepickerInput]", inputs: ["dateFormat", "disabled", "maxDate", "minDate", "skyDatepickerInput", "skyDatepickerNoValidate", "startingDay", "strict"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
397
432
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, decorators: [{
|
|
@@ -406,14 +441,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
406
441
|
args: ['skyCellEditorDatepickerInput', { read: ElementRef }]
|
|
407
442
|
}] } });
|
|
408
443
|
|
|
409
|
-
var _SkyAgGridCellEditorLookupComponent_triggerType;
|
|
444
|
+
var _SkyAgGridCellEditorLookupComponent_instances, _SkyAgGridCellEditorLookupComponent_params, _SkyAgGridCellEditorLookupComponent_triggerType, _SkyAgGridCellEditorLookupComponent_changeDetector, _SkyAgGridCellEditorLookupComponent_elementRef, _SkyAgGridCellEditorLookupComponent_updateComponentProperties;
|
|
410
445
|
/**
|
|
411
446
|
* @internal
|
|
412
447
|
*/
|
|
413
448
|
class SkyAgGridCellEditorLookupComponent {
|
|
414
449
|
constructor(changeDetector, elementRef) {
|
|
415
|
-
this
|
|
416
|
-
this.elementRef = elementRef;
|
|
450
|
+
_SkyAgGridCellEditorLookupComponent_instances.add(this);
|
|
417
451
|
this.isAlive = false;
|
|
418
452
|
this.editorForm = new UntypedFormGroup({
|
|
419
453
|
selection: new UntypedFormControl({
|
|
@@ -422,61 +456,73 @@ class SkyAgGridCellEditorLookupComponent {
|
|
|
422
456
|
}),
|
|
423
457
|
});
|
|
424
458
|
this.useAsyncSearch = false;
|
|
459
|
+
_SkyAgGridCellEditorLookupComponent_params.set(this, void 0);
|
|
425
460
|
_SkyAgGridCellEditorLookupComponent_triggerType.set(this, void 0);
|
|
461
|
+
_SkyAgGridCellEditorLookupComponent_changeDetector.set(this, void 0);
|
|
462
|
+
_SkyAgGridCellEditorLookupComponent_elementRef.set(this, void 0);
|
|
463
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorLookupComponent_changeDetector, changeDetector, "f");
|
|
464
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorLookupComponent_elementRef, elementRef, "f");
|
|
426
465
|
}
|
|
427
466
|
agInit(params) {
|
|
428
|
-
|
|
429
|
-
|
|
467
|
+
var _a;
|
|
468
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorLookupComponent_params, params, "f");
|
|
469
|
+
if (!Array.isArray(__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_params, "f").value)) {
|
|
430
470
|
throw new Error(`Lookup value must be an array`);
|
|
431
471
|
}
|
|
432
472
|
__classPrivateFieldSet(this, _SkyAgGridCellEditorLookupComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
433
473
|
const control = this.editorForm.get('selection');
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
474
|
+
if (control) {
|
|
475
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f")) {
|
|
476
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
477
|
+
control.setValue([]);
|
|
478
|
+
break;
|
|
479
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
480
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
481
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
482
|
+
default:
|
|
483
|
+
control.setValue(params.value);
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
if ((_a = __classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_params, "f").skyComponentProperties) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
487
|
+
control.disable();
|
|
488
|
+
}
|
|
447
489
|
}
|
|
448
|
-
this.skyComponentProperties = this.
|
|
490
|
+
this.skyComponentProperties = __classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_instances, "m", _SkyAgGridCellEditorLookupComponent_updateComponentProperties).call(this, __classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_params, "f"));
|
|
449
491
|
this.useAsyncSearch =
|
|
450
492
|
typeof this.skyComponentProperties.searchAsync === 'function';
|
|
451
493
|
this.isAlive = true;
|
|
452
|
-
this.width = this.
|
|
453
|
-
this.
|
|
454
|
-
|
|
455
|
-
this.
|
|
494
|
+
this.width = __classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_params, "f").column.getActualWidth();
|
|
495
|
+
__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_params, "f").column.addEventListener('uiColumnResized', (event) => {
|
|
496
|
+
var _a;
|
|
497
|
+
this.width = (_a = event.column) === null || _a === void 0 ? void 0 : _a.getActualWidth();
|
|
498
|
+
__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_changeDetector, "f").markForCheck();
|
|
456
499
|
});
|
|
457
|
-
this.
|
|
500
|
+
__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_changeDetector, "f").markForCheck();
|
|
458
501
|
}
|
|
459
502
|
isCancelAfterEnd() {
|
|
460
503
|
// Shut down components to commit values before final value syncs to grid.
|
|
461
504
|
this.isAlive = false;
|
|
462
|
-
this.
|
|
505
|
+
__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_changeDetector, "f").detectChanges();
|
|
463
506
|
return false;
|
|
464
507
|
}
|
|
465
508
|
getGui() {
|
|
466
|
-
return this.
|
|
509
|
+
return __classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_elementRef, "f").nativeElement;
|
|
467
510
|
}
|
|
511
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
468
512
|
getValue() {
|
|
469
|
-
|
|
513
|
+
var _a;
|
|
514
|
+
return (_a = this.editorForm.get('selection')) === null || _a === void 0 ? void 0 : _a.value;
|
|
470
515
|
}
|
|
471
516
|
isPopup() {
|
|
472
517
|
return true;
|
|
473
518
|
}
|
|
474
519
|
afterGuiAttached() {
|
|
475
|
-
|
|
520
|
+
var _a;
|
|
521
|
+
const lookupInput = __classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_elementRef, "f").nativeElement.querySelector('.sky-lookup-input');
|
|
476
522
|
lookupInput.focus();
|
|
477
523
|
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
478
524
|
lookupInput.select();
|
|
479
|
-
lookupInput.setRangeText(this.
|
|
525
|
+
lookupInput.setRangeText((_a = __classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_params, "f")) === null || _a === void 0 ? void 0 : _a.charPress);
|
|
480
526
|
// Ensure the cursor is at the end of the text.
|
|
481
527
|
lookupInput.setSelectionRange(lookupInput.value.length, lookupInput.value.length);
|
|
482
528
|
lookupInput.dispatchEvent(new Event('input'));
|
|
@@ -485,23 +531,22 @@ class SkyAgGridCellEditorLookupComponent {
|
|
|
485
531
|
lookupInput.select();
|
|
486
532
|
}
|
|
487
533
|
}
|
|
488
|
-
updateComponentProperties(params) {
|
|
489
|
-
const skyLookupProperties = params.skyComponentProperties;
|
|
490
|
-
return applySkyLookupPropertiesDefaults(skyLookupProperties);
|
|
491
|
-
}
|
|
492
534
|
}
|
|
493
|
-
_SkyAgGridCellEditorLookupComponent_triggerType = new WeakMap()
|
|
535
|
+
_SkyAgGridCellEditorLookupComponent_params = new WeakMap(), _SkyAgGridCellEditorLookupComponent_triggerType = new WeakMap(), _SkyAgGridCellEditorLookupComponent_changeDetector = new WeakMap(), _SkyAgGridCellEditorLookupComponent_elementRef = new WeakMap(), _SkyAgGridCellEditorLookupComponent_instances = new WeakSet(), _SkyAgGridCellEditorLookupComponent_updateComponentProperties = function _SkyAgGridCellEditorLookupComponent_updateComponentProperties(params) {
|
|
536
|
+
const skyLookupProperties = params.skyComponentProperties;
|
|
537
|
+
return applySkyLookupPropertiesDefaults(skyLookupProperties);
|
|
538
|
+
};
|
|
494
539
|
SkyAgGridCellEditorLookupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
495
|
-
SkyAgGridCellEditorLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorLookupComponent, selector: "sky-ag-grid-cell-editor-lookup", host: { properties: { "style.width.px": "this.width" } }, ngImport: i0, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n (searchAsync)=\"skyComponentProperties
|
|
540
|
+
SkyAgGridCellEditorLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorLookupComponent, selector: "sky-ag-grid-cell-editor-lookup", host: { properties: { "style.width.px": "this.width" } }, ngImport: i0, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n (searchAsync)=\"skyComponentProperties?.searchAsync($event)\"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n<sky-input-box\n *ngIf=\"isAlive && !useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [search]=\"skyComponentProperties?.search\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.λ10, selector: "sky-input-box", inputs: ["hasErrors", "disabled"] }, { kind: "component", type: i2.λ4, selector: "sky-lookup", inputs: ["ariaLabel", "ariaLabelledBy", "autocompleteAttribute", "data", "disabled", "enableShowMore", "placeholderText", "idProperty", "showAddButton", "showMoreConfig", "selectMode", "wrapperClass"], outputs: ["addClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
496
541
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, decorators: [{
|
|
497
542
|
type: Component,
|
|
498
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-lookup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n (searchAsync)=\"skyComponentProperties
|
|
543
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-lookup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n (searchAsync)=\"skyComponentProperties?.searchAsync($event)\"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n<sky-input-box\n *ngIf=\"isAlive && !useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [search]=\"skyComponentProperties?.search\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n", styles: [":host{display:block}\n"] }]
|
|
499
544
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { width: [{
|
|
500
545
|
type: HostBinding,
|
|
501
546
|
args: ['style.width.px']
|
|
502
547
|
}] } });
|
|
503
548
|
|
|
504
|
-
var _SkyAgGridCellEditorNumberComponent_triggerType;
|
|
549
|
+
var _SkyAgGridCellEditorNumberComponent_params, _SkyAgGridCellEditorNumberComponent_triggerType;
|
|
505
550
|
/**
|
|
506
551
|
* @internal
|
|
507
552
|
*/
|
|
@@ -510,6 +555,7 @@ class SkyAgGridCellEditorNumberComponent {
|
|
|
510
555
|
this.editorForm = new UntypedFormGroup({
|
|
511
556
|
number: new UntypedFormControl(),
|
|
512
557
|
});
|
|
558
|
+
_SkyAgGridCellEditorNumberComponent_params.set(this, void 0);
|
|
513
559
|
_SkyAgGridCellEditorNumberComponent_triggerType.set(this, void 0);
|
|
514
560
|
}
|
|
515
561
|
/**
|
|
@@ -517,60 +563,64 @@ class SkyAgGridCellEditorNumberComponent {
|
|
|
517
563
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
518
564
|
*/
|
|
519
565
|
agInit(params) {
|
|
520
|
-
var _a, _b;
|
|
521
|
-
this
|
|
566
|
+
var _a, _b, _c;
|
|
567
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorNumberComponent_params, params, "f");
|
|
522
568
|
__classPrivateFieldSet(this, _SkyAgGridCellEditorNumberComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
523
569
|
const control = this.editorForm.get('number');
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
570
|
+
if (control) {
|
|
571
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_triggerType, "f")) {
|
|
572
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
573
|
+
control.setValue(undefined);
|
|
574
|
+
break;
|
|
575
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
576
|
+
control.setValue(parseFloat((_a = __classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_params, "f")) === null || _a === void 0 ? void 0 : _a.charPress) || undefined);
|
|
577
|
+
break;
|
|
578
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
579
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
580
|
+
default:
|
|
581
|
+
control.setValue(params.value);
|
|
582
|
+
break;
|
|
583
|
+
}
|
|
536
584
|
}
|
|
537
|
-
this.max = (
|
|
538
|
-
this.min = (
|
|
539
|
-
this.columnHeader = this.
|
|
540
|
-
this.rowNumber = this.
|
|
541
|
-
this.columnWidth = this.
|
|
542
|
-
this.rowHeightWithoutBorders =
|
|
543
|
-
this.params.node && this.params.node.rowHeight - 4;
|
|
585
|
+
this.max = (_b = params.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.max;
|
|
586
|
+
this.min = (_c = params.skyComponentProperties) === null || _c === void 0 ? void 0 : _c.min;
|
|
587
|
+
this.columnHeader = __classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_params, "f").colDef.headerName;
|
|
588
|
+
this.rowNumber = __classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_params, "f").rowIndex + 1;
|
|
589
|
+
this.columnWidth = __classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_params, "f").column.getActualWidth();
|
|
590
|
+
this.rowHeightWithoutBorders = __classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_params, "f").node.rowHeight - 4;
|
|
544
591
|
}
|
|
545
592
|
/**
|
|
546
593
|
* afterGuiAttached is called by agGrid after the editor is rendered in the DOM. Once it is attached the editor is ready to be focused on.
|
|
547
594
|
*/
|
|
548
595
|
afterGuiAttached() {
|
|
549
|
-
this.input
|
|
550
|
-
|
|
551
|
-
this.
|
|
596
|
+
if (this.input) {
|
|
597
|
+
this.input.nativeElement.focus();
|
|
598
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
599
|
+
this.input.nativeElement.select();
|
|
600
|
+
}
|
|
552
601
|
}
|
|
553
602
|
}
|
|
554
603
|
/**
|
|
555
604
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
556
605
|
*/
|
|
557
606
|
getValue() {
|
|
558
|
-
|
|
607
|
+
var _a;
|
|
608
|
+
const val = (_a = this.editorForm.get('number')) === null || _a === void 0 ? void 0 : _a.value;
|
|
559
609
|
return val !== undefined && val !== null ? val : undefined;
|
|
560
610
|
}
|
|
561
611
|
}
|
|
562
|
-
_SkyAgGridCellEditorNumberComponent_triggerType = new WeakMap();
|
|
612
|
+
_SkyAgGridCellEditorNumberComponent_params = new WeakMap(), _SkyAgGridCellEditorNumberComponent_triggerType = new WeakMap();
|
|
563
613
|
SkyAgGridCellEditorNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
564
|
-
SkyAgGridCellEditorNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorNumberComponent, selector: "sky-ag-grid-cell-editor-number", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorNumber"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"number\"\n type=\"number\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_number_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [max]=\"max\"\n [min]=\"min\"\n #skyCellEditorNumber\n />\n</ng-container>\n", styles: ["input{border:none;text-align:right}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
614
|
+
SkyAgGridCellEditorNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorNumberComponent, selector: "sky-ag-grid-cell-editor-number", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorNumber"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"number\"\n type=\"number\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_number_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [max]=\"max ?? null\"\n [min]=\"min ?? null\"\n #skyCellEditorNumber\n />\n</ng-container>\n", styles: ["input{border:none;text-align:right}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1$1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
565
615
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, decorators: [{
|
|
566
616
|
type: Component,
|
|
567
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-number', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"number\"\n type=\"number\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_number_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [max]=\"max\"\n [min]=\"min\"\n #skyCellEditorNumber\n />\n</ng-container>\n", styles: ["input{border:none;text-align:right}\n"] }]
|
|
617
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-number', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"number\"\n type=\"number\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_number_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [max]=\"max ?? null\"\n [min]=\"min ?? null\"\n #skyCellEditorNumber\n />\n</ng-container>\n", styles: ["input{border:none;text-align:right}\n"] }]
|
|
568
618
|
}], propDecorators: { input: [{
|
|
569
619
|
type: ViewChild,
|
|
570
620
|
args: ['skyCellEditorNumber', { read: ElementRef }]
|
|
571
621
|
}] } });
|
|
572
622
|
|
|
573
|
-
var _SkyAgGridCellEditorTextComponent_triggerType;
|
|
623
|
+
var _SkyAgGridCellEditorTextComponent_params, _SkyAgGridCellEditorTextComponent_triggerType;
|
|
574
624
|
/**
|
|
575
625
|
* @internal
|
|
576
626
|
*/
|
|
@@ -579,6 +629,7 @@ class SkyAgGridCellEditorTextComponent {
|
|
|
579
629
|
this.editorForm = new UntypedFormGroup({
|
|
580
630
|
text: new UntypedFormControl(),
|
|
581
631
|
});
|
|
632
|
+
_SkyAgGridCellEditorTextComponent_params.set(this, void 0);
|
|
582
633
|
_SkyAgGridCellEditorTextComponent_triggerType.set(this, void 0);
|
|
583
634
|
}
|
|
584
635
|
/**
|
|
@@ -587,126 +638,134 @@ class SkyAgGridCellEditorTextComponent {
|
|
|
587
638
|
*/
|
|
588
639
|
agInit(params) {
|
|
589
640
|
var _a;
|
|
590
|
-
this
|
|
641
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorTextComponent_params, params, "f");
|
|
591
642
|
__classPrivateFieldSet(this, _SkyAgGridCellEditorTextComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
592
643
|
const control = this.editorForm.get('text');
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
644
|
+
if (control) {
|
|
645
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_triggerType, "f")) {
|
|
646
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
647
|
+
control.setValue(undefined);
|
|
648
|
+
break;
|
|
649
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
650
|
+
control.setValue(params.charPress);
|
|
651
|
+
break;
|
|
652
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
653
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
654
|
+
default:
|
|
655
|
+
control.setValue(params.value);
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
605
658
|
}
|
|
606
659
|
this.maxlength = (_a = params.skyComponentProperties) === null || _a === void 0 ? void 0 : _a.maxlength;
|
|
607
|
-
this.columnHeader = this.
|
|
608
|
-
this.rowNumber = this.
|
|
609
|
-
this.columnWidth = this.
|
|
610
|
-
this.rowHeightWithoutBorders =
|
|
611
|
-
this.params.node && this.params.node.rowHeight - 4;
|
|
660
|
+
this.columnHeader = __classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_params, "f").colDef.headerName;
|
|
661
|
+
this.rowNumber = __classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_params, "f").rowIndex + 1;
|
|
662
|
+
this.columnWidth = __classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_params, "f").column.getActualWidth();
|
|
663
|
+
this.rowHeightWithoutBorders = __classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_params, "f").node.rowHeight - 4;
|
|
612
664
|
}
|
|
613
665
|
/**
|
|
614
666
|
* afterGuiAttached is called by agGrid after the editor is rendered in the DOM. Once it is attached the editor is ready to be focused on.
|
|
615
667
|
*/
|
|
616
668
|
afterGuiAttached() {
|
|
617
|
-
this.input
|
|
618
|
-
|
|
619
|
-
this.
|
|
669
|
+
if (this.input) {
|
|
670
|
+
this.input.nativeElement.focus();
|
|
671
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
672
|
+
this.input.nativeElement.select();
|
|
673
|
+
}
|
|
620
674
|
}
|
|
621
675
|
}
|
|
622
676
|
/**
|
|
623
677
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
624
678
|
*/
|
|
625
679
|
getValue() {
|
|
626
|
-
|
|
680
|
+
var _a;
|
|
681
|
+
return ((_a = this.editorForm.get('text')) === null || _a === void 0 ? void 0 : _a.value) || undefined;
|
|
627
682
|
}
|
|
628
683
|
}
|
|
629
|
-
_SkyAgGridCellEditorTextComponent_triggerType = new WeakMap();
|
|
684
|
+
_SkyAgGridCellEditorTextComponent_params = new WeakMap(), _SkyAgGridCellEditorTextComponent_triggerType = new WeakMap();
|
|
630
685
|
SkyAgGridCellEditorTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
631
|
-
SkyAgGridCellEditorTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorTextComponent, selector: "sky-ag-grid-cell-editor-text", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorText"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"text\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_text_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [maxlength]=\"maxlength\"\n #skyCellEditorText\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
686
|
+
SkyAgGridCellEditorTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellEditorTextComponent, selector: "sky-ag-grid-cell-editor-text", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorText"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"text\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_text_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [maxlength]=\"maxlength ?? null\"\n #skyCellEditorText\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
632
687
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellEditorTextComponent, decorators: [{
|
|
633
688
|
type: Component,
|
|
634
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-text', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"text\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_text_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [maxlength]=\"maxlength\"\n #skyCellEditorText\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"] }]
|
|
689
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-text', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"text\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_text_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [maxlength]=\"maxlength ?? null\"\n #skyCellEditorText\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"] }]
|
|
635
690
|
}], propDecorators: { input: [{
|
|
636
691
|
type: ViewChild,
|
|
637
692
|
args: ['skyCellEditorText', { read: ElementRef }]
|
|
638
693
|
}] } });
|
|
639
694
|
|
|
695
|
+
var _SkyAgGridCellValidatorTooltipComponent_instances, _SkyAgGridCellValidatorTooltipComponent_hoverTimeout, _SkyAgGridCellValidatorTooltipComponent_changeDetector, _SkyAgGridCellValidatorTooltipComponent_scheduleDelayedPopover, _SkyAgGridCellValidatorTooltipComponent_cancelDelayedPopover;
|
|
640
696
|
/**
|
|
641
697
|
* @internal
|
|
642
698
|
*/
|
|
643
699
|
class SkyAgGridCellValidatorTooltipComponent {
|
|
644
700
|
constructor(changeDetector) {
|
|
645
|
-
this
|
|
701
|
+
_SkyAgGridCellValidatorTooltipComponent_instances.add(this);
|
|
646
702
|
this.popoverMessageStream = new Subject();
|
|
703
|
+
_SkyAgGridCellValidatorTooltipComponent_hoverTimeout.set(this, void 0);
|
|
704
|
+
_SkyAgGridCellValidatorTooltipComponent_changeDetector.set(this, void 0);
|
|
705
|
+
__classPrivateFieldSet(this, _SkyAgGridCellValidatorTooltipComponent_changeDetector, changeDetector, "f");
|
|
647
706
|
}
|
|
648
707
|
set params(value) {
|
|
649
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
708
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
650
709
|
this.cellRendererParams = value;
|
|
651
710
|
/*istanbul ignore next*/
|
|
652
|
-
(_a = this.cellRendererParams
|
|
711
|
+
(_b = (_a = this.cellRendererParams) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.addEventListener(Events.EVENT_CELL_FOCUSED, (eventParams) => {
|
|
712
|
+
var _a, _b;
|
|
653
713
|
// We want to close any popovers that are opened when other cells are focused, but open a popover if the current cell is focused.
|
|
654
714
|
if (!(eventParams.column instanceof Column) ||
|
|
655
715
|
eventParams.column.getColId() !==
|
|
656
|
-
this.cellRendererParams.column.getColId() ||
|
|
716
|
+
((_b = (_a = this.cellRendererParams) === null || _a === void 0 ? void 0 : _a.column) === null || _b === void 0 ? void 0 : _b.getColId()) ||
|
|
657
717
|
eventParams.rowIndex !== this.cellRendererParams.rowIndex) {
|
|
658
718
|
this.hidePopover();
|
|
659
719
|
}
|
|
660
720
|
});
|
|
661
721
|
/*istanbul ignore next*/
|
|
662
|
-
(
|
|
722
|
+
(_d = (_c = this.cellRendererParams) === null || _c === void 0 ? void 0 : _c.eGridCell) === null || _d === void 0 ? void 0 : _d.addEventListener('keyup', (event) => {
|
|
663
723
|
if (['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp'].includes(event.key)) {
|
|
664
724
|
this.showPopover();
|
|
665
725
|
}
|
|
666
726
|
});
|
|
667
|
-
(
|
|
668
|
-
this.
|
|
727
|
+
(_f = (_e = this.cellRendererParams) === null || _e === void 0 ? void 0 : _e.eGridCell) === null || _f === void 0 ? void 0 : _f.addEventListener('mouseenter', () => {
|
|
728
|
+
__classPrivateFieldGet(this, _SkyAgGridCellValidatorTooltipComponent_instances, "m", _SkyAgGridCellValidatorTooltipComponent_scheduleDelayedPopover).call(this);
|
|
669
729
|
});
|
|
670
|
-
(
|
|
730
|
+
(_h = (_g = this.cellRendererParams) === null || _g === void 0 ? void 0 : _g.eGridCell) === null || _h === void 0 ? void 0 : _h.addEventListener('mouseleave', () => {
|
|
671
731
|
this.hidePopover();
|
|
672
732
|
});
|
|
673
733
|
/*istanbul ignore next*/
|
|
674
|
-
(
|
|
734
|
+
(_k = (_j = this.cellRendererParams) === null || _j === void 0 ? void 0 : _j.api) === null || _k === void 0 ? void 0 : _k.addEventListener(Events.EVENT_CELL_EDITING_STARTED, () => {
|
|
675
735
|
this.hidePopover();
|
|
676
736
|
});
|
|
677
|
-
if (typeof ((
|
|
737
|
+
if (typeof ((_m = (_l = this.cellRendererParams) === null || _l === void 0 ? void 0 : _l.skyComponentProperties) === null || _m === void 0 ? void 0 : _m.validatorMessage) === 'function') {
|
|
678
738
|
this.validatorMessage =
|
|
679
739
|
this.cellRendererParams.skyComponentProperties.validatorMessage(this.cellRendererParams.value, this.cellRendererParams.data, this.cellRendererParams.rowIndex);
|
|
680
740
|
}
|
|
681
741
|
else {
|
|
682
742
|
this.validatorMessage =
|
|
683
|
-
(
|
|
743
|
+
(_p = (_o = this.cellRendererParams) === null || _o === void 0 ? void 0 : _o.skyComponentProperties) === null || _p === void 0 ? void 0 : _p.validatorMessage;
|
|
684
744
|
}
|
|
685
|
-
this.
|
|
745
|
+
__classPrivateFieldGet(this, _SkyAgGridCellValidatorTooltipComponent_changeDetector, "f").markForCheck();
|
|
686
746
|
}
|
|
687
747
|
hidePopover() {
|
|
688
|
-
this.
|
|
748
|
+
__classPrivateFieldGet(this, _SkyAgGridCellValidatorTooltipComponent_instances, "m", _SkyAgGridCellValidatorTooltipComponent_cancelDelayedPopover).call(this);
|
|
689
749
|
this.popoverMessageStream.next({ type: SkyPopoverMessageType.Close });
|
|
690
750
|
}
|
|
691
751
|
showPopover() {
|
|
692
|
-
this.
|
|
752
|
+
__classPrivateFieldGet(this, _SkyAgGridCellValidatorTooltipComponent_instances, "m", _SkyAgGridCellValidatorTooltipComponent_cancelDelayedPopover).call(this);
|
|
693
753
|
this.popoverMessageStream.next({ type: SkyPopoverMessageType.Open });
|
|
694
754
|
}
|
|
695
|
-
scheduleDelayedPopover() {
|
|
696
|
-
/* istanbul ignore else */
|
|
697
|
-
if (!this._hoverTimeout) {
|
|
698
|
-
this._hoverTimeout = window.setTimeout(() => {
|
|
699
|
-
this.showPopover();
|
|
700
|
-
}, 300);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
cancelDelayedPopover() {
|
|
704
|
-
if (this._hoverTimeout) {
|
|
705
|
-
window.clearTimeout(this._hoverTimeout);
|
|
706
|
-
this._hoverTimeout = undefined;
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
755
|
}
|
|
756
|
+
_SkyAgGridCellValidatorTooltipComponent_hoverTimeout = new WeakMap(), _SkyAgGridCellValidatorTooltipComponent_changeDetector = new WeakMap(), _SkyAgGridCellValidatorTooltipComponent_instances = new WeakSet(), _SkyAgGridCellValidatorTooltipComponent_scheduleDelayedPopover = function _SkyAgGridCellValidatorTooltipComponent_scheduleDelayedPopover() {
|
|
757
|
+
/* istanbul ignore else */
|
|
758
|
+
if (!__classPrivateFieldGet(this, _SkyAgGridCellValidatorTooltipComponent_hoverTimeout, "f")) {
|
|
759
|
+
__classPrivateFieldSet(this, _SkyAgGridCellValidatorTooltipComponent_hoverTimeout, window.setTimeout(() => {
|
|
760
|
+
this.showPopover();
|
|
761
|
+
}, 300), "f");
|
|
762
|
+
}
|
|
763
|
+
}, _SkyAgGridCellValidatorTooltipComponent_cancelDelayedPopover = function _SkyAgGridCellValidatorTooltipComponent_cancelDelayedPopover() {
|
|
764
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellValidatorTooltipComponent_hoverTimeout, "f")) {
|
|
765
|
+
window.clearTimeout(__classPrivateFieldGet(this, _SkyAgGridCellValidatorTooltipComponent_hoverTimeout, "f"));
|
|
766
|
+
__classPrivateFieldSet(this, _SkyAgGridCellValidatorTooltipComponent_hoverTimeout, undefined, "f");
|
|
767
|
+
}
|
|
768
|
+
};
|
|
710
769
|
SkyAgGridCellValidatorTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellValidatorTooltipComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
711
770
|
SkyAgGridCellValidatorTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellValidatorTooltipComponent, selector: "sky-ag-grid-cell-validator-tooltip", inputs: { params: "params" }, ngImport: i0, template: "<div\n [skyPopover]=\"validatorPopover\"\n [skyPopoverMessageStream]=\"popoverMessageStream\"\n class=\"sky-validator-cell\"\n>\n <ng-content></ng-content>\n <sky-status-indicator\n descriptionType=\"none\"\n indicatorType=\"danger\"\n class=\"sky-pull-right\"\n ></sky-status-indicator>\n</div>\n<sky-popover #validatorPopover popoverType=\"danger\">\n {{ validatorMessage }}\n</sky-popover>\n", styles: [":host div.sky-validator-cell{height:100%;width:100%}:host div.sky-validator-cell:focus{outline:none}\n"], dependencies: [{ kind: "component", type: i1$3.λ6, selector: "sky-popover", inputs: ["alignment", "dismissOnBlur", "placement", "popoverTitle", "popoverType"], outputs: ["popoverClosed", "popoverOpened"] }, { kind: "directive", type: i1$3.λ7, selector: "[skyPopover]", inputs: ["skyPopover", "skyPopoverAlignment", "skyPopoverMessageStream", "skyPopoverPlacement", "skyPopoverTrigger"] }, { kind: "component", type: i3$2.λ10, selector: "sky-status-indicator", inputs: ["indicatorType", "descriptionType", "customDescription"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
712
771
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellValidatorTooltipComponent, decorators: [{
|
|
@@ -716,11 +775,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
716
775
|
type: Input
|
|
717
776
|
}] } });
|
|
718
777
|
|
|
778
|
+
var _SkyAgGridCellRendererCurrencyComponent_instances, _SkyAgGridCellRendererCurrencyComponent_updateProperties;
|
|
719
779
|
/**
|
|
720
780
|
* @internal
|
|
721
781
|
*/
|
|
722
782
|
class SkyAgGridCellRendererCurrencyComponent {
|
|
723
783
|
constructor() {
|
|
784
|
+
_SkyAgGridCellRendererCurrencyComponent_instances.add(this);
|
|
724
785
|
this.skyComponentProperties = {};
|
|
725
786
|
this.numericOptions = {};
|
|
726
787
|
}
|
|
@@ -732,31 +793,33 @@ class SkyAgGridCellRendererCurrencyComponent {
|
|
|
732
793
|
* @param params The cell renderer params that include data about the cell, column, row, and grid.
|
|
733
794
|
*/
|
|
734
795
|
agInit(params) {
|
|
735
|
-
this.
|
|
796
|
+
__classPrivateFieldGet(this, _SkyAgGridCellRendererCurrencyComponent_instances, "m", _SkyAgGridCellRendererCurrencyComponent_updateProperties).call(this, params);
|
|
736
797
|
}
|
|
798
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
737
799
|
refresh(params) {
|
|
738
800
|
return false;
|
|
739
801
|
}
|
|
740
|
-
updateProperties(params) {
|
|
741
|
-
var _a;
|
|
742
|
-
this._params = params;
|
|
743
|
-
this.value = this._params.value;
|
|
744
|
-
this.columnHeader = this._params.colDef && this._params.colDef.headerName;
|
|
745
|
-
this.rowNumber = this._params.rowIndex + 1;
|
|
746
|
-
this.columnWidth = (_a = this._params.column) === null || _a === void 0 ? void 0 : _a.getActualWidth();
|
|
747
|
-
this.rowHeightWithoutBorders =
|
|
748
|
-
this._params.node && this._params.node.rowHeight - 4;
|
|
749
|
-
this.skyComponentProperties = this._params.skyComponentProperties || {};
|
|
750
|
-
this.skyComponentProperties.format = 'currency';
|
|
751
|
-
this.skyComponentProperties.minDigits = 2;
|
|
752
|
-
this.skyComponentProperties.truncate = false;
|
|
753
|
-
}
|
|
754
802
|
}
|
|
803
|
+
_SkyAgGridCellRendererCurrencyComponent_instances = new WeakSet(), _SkyAgGridCellRendererCurrencyComponent_updateProperties = function _SkyAgGridCellRendererCurrencyComponent_updateProperties(params) {
|
|
804
|
+
var _a, _b, _c, _d;
|
|
805
|
+
this.value = params.value;
|
|
806
|
+
this.columnHeader = (_a = params.colDef) === null || _a === void 0 ? void 0 : _a.headerName;
|
|
807
|
+
this.rowNumber = params.rowIndex + 1;
|
|
808
|
+
this.columnWidth = (_b = params.column) === null || _b === void 0 ? void 0 : _b.getActualWidth();
|
|
809
|
+
this.rowHeightWithoutBorders =
|
|
810
|
+
typeof ((_c = params.node) === null || _c === void 0 ? void 0 : _c.rowHeight) === 'number'
|
|
811
|
+
? ((_d = params.node) === null || _d === void 0 ? void 0 : _d.rowHeight) - 4
|
|
812
|
+
: undefined;
|
|
813
|
+
this.skyComponentProperties = params.skyComponentProperties || {};
|
|
814
|
+
this.skyComponentProperties.format = 'currency';
|
|
815
|
+
this.skyComponentProperties.minDigits = 2;
|
|
816
|
+
this.skyComponentProperties.truncate = false;
|
|
817
|
+
};
|
|
755
818
|
SkyAgGridCellRendererCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellRendererCurrencyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
756
|
-
SkyAgGridCellRendererCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellRendererCurrencyComponent, selector: "sky-ag-grid-cell-renderer-currency", inputs: { params: "params" }, ngImport: i0, template: "<span\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n>\n {{ value | skyNumeric: skyComponentProperties
|
|
819
|
+
SkyAgGridCellRendererCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellRendererCurrencyComponent, selector: "sky-ag-grid-cell-renderer-currency", inputs: { params: "params" }, ngImport: i0, template: "<span\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n>\n {{\n value === undefined\n ? undefined\n : (value | skyNumeric: skyComponentProperties)\n }}\n</span>\n", styles: ["input{border:none;padding-left:11px}\n"], dependencies: [{ kind: "pipe", type: i1.SkyNumericPipe, name: "skyNumeric" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
757
820
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellRendererCurrencyComponent, decorators: [{
|
|
758
821
|
type: Component,
|
|
759
|
-
args: [{ selector: 'sky-ag-grid-cell-renderer-currency', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n>\n {{ value | skyNumeric: skyComponentProperties
|
|
822
|
+
args: [{ selector: 'sky-ag-grid-cell-renderer-currency', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n>\n {{\n value === undefined\n ? undefined\n : (value | skyNumeric: skyComponentProperties)\n }}\n</span>\n", styles: ["input{border:none;padding-left:11px}\n"] }]
|
|
760
823
|
}], propDecorators: { params: [{
|
|
761
824
|
type: Input
|
|
762
825
|
}] } });
|
|
@@ -779,18 +842,20 @@ class SkyAgGridCellRendererCurrencyValidatorComponent {
|
|
|
779
842
|
this.cellRendererParams = params;
|
|
780
843
|
this.changeDetector.markForCheck();
|
|
781
844
|
}
|
|
845
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
782
846
|
isNumeric(value) {
|
|
783
847
|
return !isNaN(parseFloat(value));
|
|
784
848
|
}
|
|
849
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
785
850
|
refresh(params) {
|
|
786
851
|
return false;
|
|
787
852
|
}
|
|
788
853
|
}
|
|
789
854
|
SkyAgGridCellRendererCurrencyValidatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellRendererCurrencyValidatorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
790
|
-
SkyAgGridCellRendererCurrencyValidatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellRendererCurrencyValidatorComponent, selector: "sky-ag-grid-cell-renderer-currency-validator", inputs: { parameters: "parameters" }, ngImport: i0, template: "<sky-ag-grid-cell-validator-tooltip
|
|
855
|
+
SkyAgGridCellRendererCurrencyValidatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellRendererCurrencyValidatorComponent, selector: "sky-ag-grid-cell-renderer-currency-validator", inputs: { parameters: "parameters" }, ngImport: i0, template: "<sky-ag-grid-cell-validator-tooltip\n *ngIf=\"cellRendererParams\"\n [params]=\"cellRendererParams\"\n>\n <sky-ag-grid-cell-renderer-currency\n *ngIf=\"isNumeric(cellRendererParams.value); else rawValue\"\n [params]=\"cellRendererParams\"\n ></sky-ag-grid-cell-renderer-currency>\n <ng-template #rawValue>{{ cellRendererParams.value }}</ng-template>\n</sky-ag-grid-cell-validator-tooltip>\n", dependencies: [{ kind: "directive", type: i2$3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SkyAgGridCellValidatorTooltipComponent, selector: "sky-ag-grid-cell-validator-tooltip", inputs: ["params"] }, { kind: "component", type: SkyAgGridCellRendererCurrencyComponent, selector: "sky-ag-grid-cell-renderer-currency", inputs: ["params"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
791
856
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellRendererCurrencyValidatorComponent, decorators: [{
|
|
792
857
|
type: Component,
|
|
793
|
-
args: [{ selector: 'sky-ag-grid-cell-renderer-currency-validator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-ag-grid-cell-validator-tooltip
|
|
858
|
+
args: [{ selector: 'sky-ag-grid-cell-renderer-currency-validator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-ag-grid-cell-validator-tooltip\n *ngIf=\"cellRendererParams\"\n [params]=\"cellRendererParams\"\n>\n <sky-ag-grid-cell-renderer-currency\n *ngIf=\"isNumeric(cellRendererParams.value); else rawValue\"\n [params]=\"cellRendererParams\"\n ></sky-ag-grid-cell-renderer-currency>\n <ng-template #rawValue>{{ cellRendererParams.value }}</ng-template>\n</sky-ag-grid-cell-validator-tooltip>\n" }]
|
|
794
859
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { parameters: [{
|
|
795
860
|
type: Input
|
|
796
861
|
}] } });
|
|
@@ -822,31 +887,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
822
887
|
args: [{ selector: 'sky-cell-renderer-lookup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"summaryCount > 5; else showValue\">\n {{ 'skyux_lookup_tokens_summary' | skyLibResources: summaryCount }}\n</ng-container>\n<ng-template #showValue>{{ value }}</ng-template>\n", styles: [":host{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
|
|
823
888
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
824
889
|
|
|
890
|
+
var _SkyAgGridCellRendererRowSelectorComponent_instances, _SkyAgGridCellRendererRowSelectorComponent_params, _SkyAgGridCellRendererRowSelectorComponent_changeDetector, _SkyAgGridCellRendererRowSelectorComponent_rowSelectedListener;
|
|
825
891
|
/**
|
|
826
892
|
* @internal
|
|
827
893
|
*/
|
|
828
894
|
class SkyAgGridCellRendererRowSelectorComponent {
|
|
829
|
-
constructor(
|
|
830
|
-
this
|
|
895
|
+
constructor(changeDetector) {
|
|
896
|
+
_SkyAgGridCellRendererRowSelectorComponent_instances.add(this);
|
|
897
|
+
_SkyAgGridCellRendererRowSelectorComponent_params.set(this, void 0);
|
|
898
|
+
_SkyAgGridCellRendererRowSelectorComponent_changeDetector.set(this, void 0);
|
|
899
|
+
__classPrivateFieldSet(this, _SkyAgGridCellRendererRowSelectorComponent_changeDetector, changeDetector, "f");
|
|
831
900
|
}
|
|
832
901
|
/**
|
|
833
902
|
* agInit is called by agGrid once after the cell is created and provides the renderer with the information it needs.
|
|
834
903
|
* @param params The cell renderer params that include data about the cell, column, row, and grid.
|
|
835
904
|
*/
|
|
836
905
|
agInit(params) {
|
|
837
|
-
|
|
838
|
-
this
|
|
839
|
-
this.
|
|
840
|
-
this.
|
|
906
|
+
var _a;
|
|
907
|
+
__classPrivateFieldSet(this, _SkyAgGridCellRendererRowSelectorComponent_params, params, "f");
|
|
908
|
+
this.dataField = (_a = __classPrivateFieldGet(this, _SkyAgGridCellRendererRowSelectorComponent_params, "f").colDef) === null || _a === void 0 ? void 0 : _a.field;
|
|
909
|
+
this.rowNode = __classPrivateFieldGet(this, _SkyAgGridCellRendererRowSelectorComponent_params, "f").node;
|
|
910
|
+
this.rowNumber = __classPrivateFieldGet(this, _SkyAgGridCellRendererRowSelectorComponent_params, "f").rowIndex + 1;
|
|
841
911
|
if (this.dataField) {
|
|
842
|
-
this.checked = this.
|
|
843
|
-
this.rowNode.setSelected(this.checked);
|
|
912
|
+
this.checked = __classPrivateFieldGet(this, _SkyAgGridCellRendererRowSelectorComponent_params, "f").value;
|
|
913
|
+
this.rowNode.setSelected(!!this.checked);
|
|
844
914
|
}
|
|
845
915
|
else {
|
|
846
916
|
this.checked = this.rowNode.isSelected();
|
|
847
917
|
}
|
|
848
918
|
this.rowNode.addEventListener(RowNode.EVENT_ROW_SELECTED, (event) => {
|
|
849
|
-
this.
|
|
919
|
+
__classPrivateFieldGet(this, _SkyAgGridCellRendererRowSelectorComponent_instances, "m", _SkyAgGridCellRendererRowSelectorComponent_rowSelectedListener).call(this, event);
|
|
850
920
|
});
|
|
851
921
|
}
|
|
852
922
|
/**
|
|
@@ -858,19 +928,21 @@ class SkyAgGridCellRendererRowSelectorComponent {
|
|
|
858
928
|
return false;
|
|
859
929
|
}
|
|
860
930
|
updateRow() {
|
|
861
|
-
this.rowNode
|
|
862
|
-
|
|
863
|
-
this.
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
rowSelectedListener(event) {
|
|
867
|
-
this.checked = event.node.isSelected();
|
|
868
|
-
if (this.dataField) {
|
|
869
|
-
this.rowNode.data[this.dataField] = this.checked;
|
|
931
|
+
if (this.rowNode) {
|
|
932
|
+
this.rowNode.setSelected(!!this.checked);
|
|
933
|
+
if (this.dataField) {
|
|
934
|
+
this.rowNode.data[this.dataField] = this.checked;
|
|
935
|
+
}
|
|
870
936
|
}
|
|
871
|
-
this.changeDetection.markForCheck();
|
|
872
937
|
}
|
|
873
938
|
}
|
|
939
|
+
_SkyAgGridCellRendererRowSelectorComponent_params = new WeakMap(), _SkyAgGridCellRendererRowSelectorComponent_changeDetector = new WeakMap(), _SkyAgGridCellRendererRowSelectorComponent_instances = new WeakSet(), _SkyAgGridCellRendererRowSelectorComponent_rowSelectedListener = function _SkyAgGridCellRendererRowSelectorComponent_rowSelectedListener(event) {
|
|
940
|
+
this.checked = event.node.isSelected();
|
|
941
|
+
if (this.rowNode && this.dataField) {
|
|
942
|
+
this.rowNode.data[this.dataField] = this.checked;
|
|
943
|
+
}
|
|
944
|
+
__classPrivateFieldGet(this, _SkyAgGridCellRendererRowSelectorComponent_changeDetector, "f").markForCheck();
|
|
945
|
+
};
|
|
874
946
|
SkyAgGridCellRendererRowSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellRendererRowSelectorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
875
947
|
SkyAgGridCellRendererRowSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridCellRendererRowSelectorComponent, selector: "sky-ag-grid-cell-renderer-row-selector", ngImport: i0, template: "<sky-checkbox\n data-sky-id=\"row-checkbox\"\n [tabindex]=\"-1\"\n [label]=\"'sky_ag_grid_row_selector_aria_label' | skyLibResources: rowNumber\"\n [attr.aria-label]=\"\n 'sky_ag_grid_row_selector_aria_label' | skyLibResources: rowNumber\n \"\n [(ngModel)]=\"checked\"\n (change)=\"updateRow()\"\n>\n</sky-checkbox>\n", styles: [".sky-ag-grid-cell-row-selector .sky-switch-control{top:-6px}\n"], dependencies: [{ kind: "component", type: i3$1.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i3.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
876
948
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridCellRendererRowSelectorComponent, decorators: [{
|
|
@@ -899,6 +971,7 @@ class SkyAgGridCellRendererValidatorTooltipComponent {
|
|
|
899
971
|
}
|
|
900
972
|
this.changeDetector.markForCheck();
|
|
901
973
|
}
|
|
974
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
902
975
|
refresh(params) {
|
|
903
976
|
return false;
|
|
904
977
|
}
|
|
@@ -957,13 +1030,13 @@ class SkyAgGridHeaderGroupComponent {
|
|
|
957
1030
|
__classPrivateFieldSet(this, _SkyAgGridHeaderGroupComponent_agIntialized, true, "f");
|
|
958
1031
|
this.params = params;
|
|
959
1032
|
__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_subscriptions, "f").unsubscribe();
|
|
960
|
-
if (!
|
|
1033
|
+
if (!params) {
|
|
961
1034
|
return;
|
|
962
1035
|
}
|
|
963
1036
|
__classPrivateFieldSet(this, _SkyAgGridHeaderGroupComponent_subscriptions, new Subscription(), "f");
|
|
964
|
-
__classPrivateFieldSet(this, _SkyAgGridHeaderGroupComponent_columnGroup,
|
|
1037
|
+
__classPrivateFieldSet(this, _SkyAgGridHeaderGroupComponent_columnGroup, params.columnGroup.getProvidedColumnGroup(), "f");
|
|
965
1038
|
if (__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_columnGroup, "f").isExpandable()) {
|
|
966
|
-
__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_subscriptions, "f").add(
|
|
1039
|
+
__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_subscriptions, "f").add(fromEventPattern((handler) => params.api.addEventListener(Events.EVENT_COLUMN_GROUP_OPENED, handler), (handler) => params.api.removeEventListener(Events.EVENT_COLUMN_GROUP_OPENED, handler)).subscribe((event) => {
|
|
967
1040
|
if (event.columnGroup === __classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_columnGroup, "f")) {
|
|
968
1041
|
__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_isExpandedSubject, "f").next(__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_columnGroup, "f").isExpanded());
|
|
969
1042
|
}
|
|
@@ -973,29 +1046,30 @@ class SkyAgGridHeaderGroupComponent {
|
|
|
973
1046
|
__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_changeDetector, "f").markForCheck();
|
|
974
1047
|
}
|
|
975
1048
|
setExpanded($event) {
|
|
976
|
-
|
|
1049
|
+
var _a;
|
|
1050
|
+
(_a = this.params) === null || _a === void 0 ? void 0 : _a.setExpanded($event);
|
|
977
1051
|
}
|
|
978
1052
|
}
|
|
979
1053
|
_SkyAgGridHeaderGroupComponent_columnGroup = new WeakMap(), _SkyAgGridHeaderGroupComponent_isExpandedSubject = new WeakMap(), _SkyAgGridHeaderGroupComponent_subscriptions = new WeakMap(), _SkyAgGridHeaderGroupComponent_changeDetector = new WeakMap(), _SkyAgGridHeaderGroupComponent_dynamicComponentService = new WeakMap(), _SkyAgGridHeaderGroupComponent_viewInitialized = new WeakMap(), _SkyAgGridHeaderGroupComponent_agIntialized = new WeakMap(), _SkyAgGridHeaderGroupComponent_instances = new WeakSet(), _SkyAgGridHeaderGroupComponent_updateInlineHelp = function _SkyAgGridHeaderGroupComponent_updateInlineHelp() {
|
|
980
|
-
var _a, _b, _c;
|
|
1054
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
981
1055
|
if (!__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_viewInitialized, "f") || !__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_agIntialized, "f")) {
|
|
982
1056
|
return;
|
|
983
1057
|
}
|
|
984
1058
|
const colGroupDef = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.columnGroup) === null || _b === void 0 ? void 0 : _b.getColGroupDef();
|
|
985
1059
|
const inlineHelpComponent = (_c = colGroupDef === null || colGroupDef === void 0 ? void 0 : colGroupDef.headerGroupComponentParams) === null || _c === void 0 ? void 0 : _c.inlineHelpComponent;
|
|
986
1060
|
if (inlineHelpComponent) {
|
|
1061
|
+
const headerGroupInfo = new SkyAgGridHeaderGroupInfo();
|
|
1062
|
+
headerGroupInfo.columnGroup = (_d = this.params) === null || _d === void 0 ? void 0 : _d.columnGroup;
|
|
1063
|
+
headerGroupInfo.context = (_e = this.params) === null || _e === void 0 ? void 0 : _e.context;
|
|
1064
|
+
headerGroupInfo.displayName = (_f = this.params) === null || _f === void 0 ? void 0 : _f.displayName;
|
|
987
1065
|
__classPrivateFieldGet(this, _SkyAgGridHeaderGroupComponent_dynamicComponentService, "f").createComponent(inlineHelpComponent, {
|
|
988
1066
|
providers: [
|
|
989
1067
|
{
|
|
990
1068
|
provide: SkyAgGridHeaderGroupInfo,
|
|
991
|
-
useValue:
|
|
992
|
-
columnGroup: this.params.columnGroup,
|
|
993
|
-
context: this.params.context,
|
|
994
|
-
displayName: this.params.displayName,
|
|
995
|
-
},
|
|
1069
|
+
useValue: headerGroupInfo,
|
|
996
1070
|
},
|
|
997
1071
|
],
|
|
998
|
-
referenceEl: this.inlineHelpContainer.nativeElement,
|
|
1072
|
+
referenceEl: (_g = this.inlineHelpContainer) === null || _g === void 0 ? void 0 : _g.nativeElement,
|
|
999
1073
|
location: SkyDynamicComponentLocation.ElementBottom,
|
|
1000
1074
|
});
|
|
1001
1075
|
}
|
|
@@ -1056,12 +1130,12 @@ class SkyAgGridHeaderComponent {
|
|
|
1056
1130
|
__classPrivateFieldSet(this, _SkyAgGridHeaderComponent_agIntialized, true, "f");
|
|
1057
1131
|
this.params = params;
|
|
1058
1132
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_subscriptions, "f").unsubscribe();
|
|
1059
|
-
if (!
|
|
1133
|
+
if (!params) {
|
|
1060
1134
|
return;
|
|
1061
1135
|
}
|
|
1062
1136
|
__classPrivateFieldSet(this, _SkyAgGridHeaderComponent_subscriptions, new Subscription(), "f");
|
|
1063
1137
|
if (params.column.isFilterAllowed()) {
|
|
1064
|
-
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_subscriptions, "f").add(
|
|
1138
|
+
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_subscriptions, "f").add(fromEventPattern((handler) => params.column.addEventListener(Events.EVENT_FILTER_CHANGED, handler), (handler) => params.column.removeEventListener(Events.EVENT_FILTER_CHANGED, handler)).subscribe(() => {
|
|
1065
1139
|
const isFilterActive = params.column.isFilterActive();
|
|
1066
1140
|
if (isFilterActive !== this.filterEnabled$.getValue()) {
|
|
1067
1141
|
this.filterEnabled$.next(isFilterActive);
|
|
@@ -1070,11 +1144,11 @@ class SkyAgGridHeaderComponent {
|
|
|
1070
1144
|
}
|
|
1071
1145
|
if (params.enableSorting) {
|
|
1072
1146
|
// Column sort state changes
|
|
1073
|
-
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_subscriptions, "f").add(
|
|
1147
|
+
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_subscriptions, "f").add(fromEventPattern((handler) => params.column.addEventListener(Events.EVENT_SORT_CHANGED, handler), (handler) => params.column.removeEventListener(Events.EVENT_SORT_CHANGED, handler)).subscribe(() => {
|
|
1074
1148
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_instances, "m", _SkyAgGridHeaderComponent_updateSort).call(this);
|
|
1075
1149
|
}));
|
|
1076
1150
|
// Other column sort state changes, for multi-column sorting
|
|
1077
|
-
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_subscriptions, "f").add(
|
|
1151
|
+
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_subscriptions, "f").add(fromEventPattern((handler) => params.api.addEventListener(Events.EVENT_SORT_CHANGED, handler), (handler) => params.api.removeEventListener(Events.EVENT_SORT_CHANGED, handler)).subscribe(() => {
|
|
1078
1152
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_instances, "m", _SkyAgGridHeaderComponent_updateSortIndex).call(this);
|
|
1079
1153
|
}));
|
|
1080
1154
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_instances, "m", _SkyAgGridHeaderComponent_updateSort).call(this);
|
|
@@ -1084,10 +1158,12 @@ class SkyAgGridHeaderComponent {
|
|
|
1084
1158
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_changeDetector, "f").markForCheck();
|
|
1085
1159
|
}
|
|
1086
1160
|
onMenuClick($event) {
|
|
1087
|
-
|
|
1161
|
+
var _a;
|
|
1162
|
+
(_a = this.params) === null || _a === void 0 ? void 0 : _a.showColumnMenu($event.target);
|
|
1088
1163
|
}
|
|
1089
1164
|
onSortRequested(event) {
|
|
1090
|
-
|
|
1165
|
+
var _a;
|
|
1166
|
+
(_a = this.params) === null || _a === void 0 ? void 0 : _a.progressSort(!!event.shiftKey);
|
|
1091
1167
|
}
|
|
1092
1168
|
refresh(params) {
|
|
1093
1169
|
this.agInit(params);
|
|
@@ -1095,26 +1171,27 @@ class SkyAgGridHeaderComponent {
|
|
|
1095
1171
|
}
|
|
1096
1172
|
}
|
|
1097
1173
|
_SkyAgGridHeaderComponent_subscriptions = new WeakMap(), _SkyAgGridHeaderComponent_changeDetector = new WeakMap(), _SkyAgGridHeaderComponent_dynamicComponentService = new WeakMap(), _SkyAgGridHeaderComponent_inlineHelpComponentRef = new WeakMap(), _SkyAgGridHeaderComponent_viewInitialized = new WeakMap(), _SkyAgGridHeaderComponent_agIntialized = new WeakMap(), _SkyAgGridHeaderComponent_instances = new WeakSet(), _SkyAgGridHeaderComponent_updateInlineHelp = function _SkyAgGridHeaderComponent_updateInlineHelp() {
|
|
1174
|
+
var _a, _b, _c, _d, _e;
|
|
1098
1175
|
if (!__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_viewInitialized, "f") || !__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_agIntialized, "f")) {
|
|
1099
1176
|
return;
|
|
1100
1177
|
}
|
|
1101
|
-
const inlineHelpComponent = this.params.inlineHelpComponent;
|
|
1178
|
+
const inlineHelpComponent = (_a = this.params) === null || _a === void 0 ? void 0 : _a.inlineHelpComponent;
|
|
1102
1179
|
if (inlineHelpComponent &&
|
|
1103
1180
|
(!__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_inlineHelpComponentRef, "f") ||
|
|
1104
1181
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_inlineHelpComponentRef, "f").componentType !== inlineHelpComponent)) {
|
|
1105
1182
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_dynamicComponentService, "f").removeComponent(__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_inlineHelpComponentRef, "f"));
|
|
1183
|
+
const headerInfo = new SkyAgGridHeaderInfo();
|
|
1184
|
+
headerInfo.column = (_b = this.params) === null || _b === void 0 ? void 0 : _b.column;
|
|
1185
|
+
headerInfo.context = (_c = this.params) === null || _c === void 0 ? void 0 : _c.context;
|
|
1186
|
+
headerInfo.displayName = (_d = this.params) === null || _d === void 0 ? void 0 : _d.displayName;
|
|
1106
1187
|
__classPrivateFieldSet(this, _SkyAgGridHeaderComponent_inlineHelpComponentRef, __classPrivateFieldGet(this, _SkyAgGridHeaderComponent_dynamicComponentService, "f").createComponent(inlineHelpComponent, {
|
|
1107
1188
|
providers: [
|
|
1108
1189
|
{
|
|
1109
1190
|
provide: SkyAgGridHeaderInfo,
|
|
1110
|
-
useValue:
|
|
1111
|
-
column: this.params.column,
|
|
1112
|
-
context: this.params.context,
|
|
1113
|
-
displayName: this.params.displayName,
|
|
1114
|
-
},
|
|
1191
|
+
useValue: headerInfo,
|
|
1115
1192
|
},
|
|
1116
1193
|
],
|
|
1117
|
-
referenceEl: this.inlineHelpContainer.nativeElement,
|
|
1194
|
+
referenceEl: (_e = this.inlineHelpContainer) === null || _e === void 0 ? void 0 : _e.nativeElement,
|
|
1118
1195
|
location: SkyDynamicComponentLocation.ElementBottom,
|
|
1119
1196
|
}), "f");
|
|
1120
1197
|
}
|
|
@@ -1122,13 +1199,16 @@ _SkyAgGridHeaderComponent_subscriptions = new WeakMap(), _SkyAgGridHeaderCompone
|
|
|
1122
1199
|
__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_dynamicComponentService, "f").removeComponent(__classPrivateFieldGet(this, _SkyAgGridHeaderComponent_inlineHelpComponentRef, "f"));
|
|
1123
1200
|
}
|
|
1124
1201
|
}, _SkyAgGridHeaderComponent_updateSort = function _SkyAgGridHeaderComponent_updateSort() {
|
|
1125
|
-
|
|
1202
|
+
var _a;
|
|
1203
|
+
this.sortOrder$.next(((_a = this.params) === null || _a === void 0 ? void 0 : _a.column.getSort()) || undefined);
|
|
1126
1204
|
}, _SkyAgGridHeaderComponent_updateSortIndex = function _SkyAgGridHeaderComponent_updateSortIndex() {
|
|
1127
|
-
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1205
|
+
var _a, _b, _c, _d;
|
|
1206
|
+
const sortIndex = (_a = this.params) === null || _a === void 0 ? void 0 : _a.column.getSortIndex();
|
|
1207
|
+
const otherSortColumns = (_d = (_c = (_b = this.params) === null || _b === void 0 ? void 0 : _b.columnApi) === null || _c === void 0 ? void 0 : _c.getColumns()) === null || _d === void 0 ? void 0 : _d.some((column) => {
|
|
1208
|
+
var _a;
|
|
1209
|
+
return column.getColId() !== ((_a = this.params) === null || _a === void 0 ? void 0 : _a.column.getColId()) &&
|
|
1210
|
+
!!column.getSort();
|
|
1211
|
+
});
|
|
1132
1212
|
if (sortIndex !== undefined && sortIndex !== null && otherSortColumns) {
|
|
1133
1213
|
this.sortIndexDisplay$.next(`${sortIndex + 1}`);
|
|
1134
1214
|
}
|
|
@@ -1146,23 +1226,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1146
1226
|
args: ['inlineHelpContainer', { read: ElementRef, static: true }]
|
|
1147
1227
|
}] } });
|
|
1148
1228
|
|
|
1149
|
-
/**
|
|
1150
|
-
* @internal
|
|
1151
|
-
*/
|
|
1152
|
-
var SkyCellClass;
|
|
1153
|
-
(function (SkyCellClass) {
|
|
1154
|
-
SkyCellClass["Autocomplete"] = "sky-ag-grid-cell-autocomplete";
|
|
1155
|
-
SkyCellClass["Currency"] = "sky-ag-grid-cell-currency";
|
|
1156
|
-
SkyCellClass["Date"] = "sky-ag-grid-cell-date";
|
|
1157
|
-
SkyCellClass["Editable"] = "sky-ag-grid-cell-editable";
|
|
1158
|
-
SkyCellClass["Invalid"] = "sky-ag-grid-cell-invalid";
|
|
1159
|
-
SkyCellClass["Lookup"] = "sky-ag-grid-cell-lookup";
|
|
1160
|
-
SkyCellClass["Number"] = "sky-ag-grid-cell-number";
|
|
1161
|
-
SkyCellClass["RowSelector"] = "sky-ag-grid-cell-row-selector";
|
|
1162
|
-
SkyCellClass["Text"] = "sky-ag-grid-cell-text";
|
|
1163
|
-
SkyCellClass["Uneditable"] = "sky-ag-grid-cell-uneditable";
|
|
1164
|
-
})(SkyCellClass || (SkyCellClass = {}));
|
|
1165
|
-
|
|
1166
1229
|
/**
|
|
1167
1230
|
* These column types can be used by setting the AG Grid [column definition `type`](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing) to one of the following values.
|
|
1168
1231
|
* <br/>
|
|
@@ -1264,7 +1327,7 @@ var SkyHeaderClass;
|
|
|
1264
1327
|
SkyHeaderClass["RightAligned"] = "sky-ag-grid-header-right-aligned";
|
|
1265
1328
|
})(SkyHeaderClass || (SkyHeaderClass = {}));
|
|
1266
1329
|
|
|
1267
|
-
var _SkyAgGridService_instances, _SkyAgGridService_currentTheme, _SkyAgGridService_getRowHeight;
|
|
1330
|
+
var _SkyAgGridService_instances, _SkyAgGridService_keyMap, _SkyAgGridService_ngUnsubscribe, _SkyAgGridService_currentTheme, _SkyAgGridService_agGridAdapterService, _SkyAgGridService_resources, _SkyAgGridService_mergeGridOptions, _SkyAgGridService_getDefaultGridOptions, _SkyAgGridService_onCellFocused, _SkyAgGridService_getDefaultEditableGridOptions, _SkyAgGridService_dateFormatter, _SkyAgGridService_getIconTemplate, _SkyAgGridService_suppressTab, _SkyAgGridService_getRowHeight;
|
|
1268
1331
|
function autocompleteComparator(value1, value2) {
|
|
1269
1332
|
if (value1 && value2) {
|
|
1270
1333
|
if (value1.name > value2.name) {
|
|
@@ -1300,7 +1363,9 @@ function dateComparator(date1, date2) {
|
|
|
1300
1363
|
}
|
|
1301
1364
|
return date1value ? 1 : -1;
|
|
1302
1365
|
}
|
|
1366
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1303
1367
|
function getValidatorCellRendererSelector(component, fallback) {
|
|
1368
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1304
1369
|
return (params) => {
|
|
1305
1370
|
var _a, _b;
|
|
1306
1371
|
if (params.colDef &&
|
|
@@ -1321,24 +1386,27 @@ let rowNodeId = -1;
|
|
|
1321
1386
|
*/
|
|
1322
1387
|
class SkyAgGridService {
|
|
1323
1388
|
constructor(agGridAdapterService, themeSvc, resources) {
|
|
1324
|
-
this.agGridAdapterService = agGridAdapterService;
|
|
1325
|
-
this.resources = resources;
|
|
1326
1389
|
_SkyAgGridService_instances.add(this);
|
|
1327
|
-
|
|
1328
|
-
this
|
|
1390
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1391
|
+
_SkyAgGridService_keyMap.set(this, new WeakMap());
|
|
1392
|
+
_SkyAgGridService_ngUnsubscribe.set(this, new Subject());
|
|
1329
1393
|
_SkyAgGridService_currentTheme.set(this, undefined);
|
|
1394
|
+
_SkyAgGridService_agGridAdapterService.set(this, void 0);
|
|
1395
|
+
_SkyAgGridService_resources.set(this, void 0);
|
|
1396
|
+
__classPrivateFieldSet(this, _SkyAgGridService_agGridAdapterService, agGridAdapterService, "f");
|
|
1397
|
+
__classPrivateFieldSet(this, _SkyAgGridService_resources, resources, "f");
|
|
1330
1398
|
/*istanbul ignore else*/
|
|
1331
1399
|
if (themeSvc) {
|
|
1332
1400
|
themeSvc.settingsChange
|
|
1333
|
-
.pipe(takeUntil(this
|
|
1401
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridService_ngUnsubscribe, "f")))
|
|
1334
1402
|
.subscribe((settingsChange) => {
|
|
1335
1403
|
__classPrivateFieldSet(this, _SkyAgGridService_currentTheme, settingsChange.currentSettings, "f");
|
|
1336
1404
|
});
|
|
1337
1405
|
}
|
|
1338
1406
|
}
|
|
1339
1407
|
ngOnDestroy() {
|
|
1340
|
-
this.
|
|
1341
|
-
this.
|
|
1408
|
+
__classPrivateFieldGet(this, _SkyAgGridService_ngUnsubscribe, "f").next();
|
|
1409
|
+
__classPrivateFieldGet(this, _SkyAgGridService_ngUnsubscribe, "f").complete();
|
|
1342
1410
|
}
|
|
1343
1411
|
/**
|
|
1344
1412
|
* Returns [AG Grid `gridOptions`](https://www.ag-grid.com/javascript-grid-properties/) with default SKY UX options, styling, and cell renderers registered for read-only grids.
|
|
@@ -1346,8 +1414,8 @@ class SkyAgGridService {
|
|
|
1346
1414
|
* @returns
|
|
1347
1415
|
*/
|
|
1348
1416
|
getGridOptions(args) {
|
|
1349
|
-
const defaultGridOptions = this.
|
|
1350
|
-
const mergedGridOptions = this.
|
|
1417
|
+
const defaultGridOptions = __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getDefaultGridOptions).call(this, args);
|
|
1418
|
+
const mergedGridOptions = __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_mergeGridOptions).call(this, defaultGridOptions, args.gridOptions);
|
|
1351
1419
|
return mergedGridOptions;
|
|
1352
1420
|
}
|
|
1353
1421
|
/**
|
|
@@ -1356,254 +1424,249 @@ class SkyAgGridService {
|
|
|
1356
1424
|
* @returns
|
|
1357
1425
|
*/
|
|
1358
1426
|
getEditableGridOptions(args) {
|
|
1359
|
-
const defaultGridOptions = this.
|
|
1360
|
-
const mergedGridOptions = this.
|
|
1427
|
+
const defaultGridOptions = __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getDefaultEditableGridOptions).call(this, args);
|
|
1428
|
+
const mergedGridOptions = __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_mergeGridOptions).call(this, defaultGridOptions, args.gridOptions);
|
|
1361
1429
|
return mergedGridOptions;
|
|
1362
1430
|
}
|
|
1363
1431
|
getHeaderHeight() {
|
|
1364
1432
|
var _a, _b;
|
|
1365
1433
|
return ((_b = (_a = __classPrivateFieldGet(this, _SkyAgGridService_currentTheme, "f")) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.name) === 'modern' ? 60 : 37;
|
|
1366
1434
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
}
|
|
1391
|
-
const editableCellClassRules = {
|
|
1392
|
-
[SkyCellClass.Editable]: getEditableFn(),
|
|
1393
|
-
[SkyCellClass.Uneditable]: getEditableFn(true),
|
|
1435
|
+
}
|
|
1436
|
+
_SkyAgGridService_keyMap = new WeakMap(), _SkyAgGridService_ngUnsubscribe = new WeakMap(), _SkyAgGridService_currentTheme = new WeakMap(), _SkyAgGridService_agGridAdapterService = new WeakMap(), _SkyAgGridService_resources = new WeakMap(), _SkyAgGridService_instances = new WeakSet(), _SkyAgGridService_mergeGridOptions = function _SkyAgGridService_mergeGridOptions(defaultGridOptions, providedGridOptions) {
|
|
1437
|
+
var _a;
|
|
1438
|
+
const mergedGridOptions = Object.assign(Object.assign(Object.assign({}, defaultGridOptions), providedGridOptions), { components: Object.assign(Object.assign({}, providedGridOptions.components), defaultGridOptions.components), columnTypes: Object.assign(Object.assign({}, providedGridOptions.columnTypes), defaultGridOptions.columnTypes), defaultColDef: Object.assign(Object.assign(Object.assign({}, defaultGridOptions.defaultColDef), providedGridOptions.defaultColDef), {
|
|
1439
|
+
// allow consumers to override all defaultColDef properties except cellClassRules, which we reserve for styling
|
|
1440
|
+
cellClassRules: (_a = defaultGridOptions.defaultColDef) === null || _a === void 0 ? void 0 : _a.cellClassRules }), defaultColGroupDef: Object.assign(Object.assign({}, defaultGridOptions.defaultColGroupDef), providedGridOptions.defaultColGroupDef), icons: Object.assign(Object.assign({}, defaultGridOptions.icons), providedGridOptions.icons) });
|
|
1441
|
+
// Prefer `getRowNodeId` over `getNodeId` if set by the consumer, for backward compatibility.
|
|
1442
|
+
if (mergedGridOptions.getRowNodeId) {
|
|
1443
|
+
delete mergedGridOptions.getRowId;
|
|
1444
|
+
}
|
|
1445
|
+
return mergedGridOptions;
|
|
1446
|
+
}, _SkyAgGridService_getDefaultGridOptions = function _SkyAgGridService_getDefaultGridOptions(args) {
|
|
1447
|
+
var _a, _b;
|
|
1448
|
+
// cellClassRules can be functions or string expressions
|
|
1449
|
+
const cellClassRuleTrueExpression = () => true;
|
|
1450
|
+
function getEditableFn(isUneditable) {
|
|
1451
|
+
return function (params) {
|
|
1452
|
+
let isEditable = params.colDef.editable;
|
|
1453
|
+
if (typeof isEditable === 'function') {
|
|
1454
|
+
const column = params.columnApi.getColumn(params.colDef.field);
|
|
1455
|
+
isEditable = isEditable(Object.assign(Object.assign({}, params), { column }));
|
|
1456
|
+
}
|
|
1457
|
+
return isUneditable ? !isEditable : !!isEditable;
|
|
1394
1458
|
};
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1459
|
+
}
|
|
1460
|
+
const editableCellClassRules = {
|
|
1461
|
+
["sky-ag-grid-cell-editable" /* SkyCellClass.Editable */]: getEditableFn(),
|
|
1462
|
+
["sky-ag-grid-cell-uneditable" /* SkyCellClass.Uneditable */]: getEditableFn(true),
|
|
1463
|
+
};
|
|
1464
|
+
function getValidatorFn() {
|
|
1465
|
+
return function (param) {
|
|
1466
|
+
var _a, _b;
|
|
1467
|
+
if (param.colDef &&
|
|
1468
|
+
typeof ((_b = (_a = param.colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.validator) === 'function') {
|
|
1469
|
+
return !param.colDef.cellRendererParams.skyComponentProperties.validator(param.value, param.data, param.rowIndex);
|
|
1470
|
+
}
|
|
1471
|
+
return false;
|
|
1407
1472
|
};
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
cellEditor: SkyAgGridCellEditorCurrencyComponent,
|
|
1421
|
-
headerClass: SkyHeaderClass.RightAligned,
|
|
1422
|
-
minWidth: 185,
|
|
1423
|
-
},
|
|
1424
|
-
[SkyCellType.Date]: {
|
|
1425
|
-
cellClassRules: Object.assign({ [SkyCellClass.Date]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
1426
|
-
cellEditor: SkyAgGridCellEditorDatepickerComponent,
|
|
1427
|
-
comparator: dateComparator,
|
|
1428
|
-
minWidth: ((_b = (_a = __classPrivateFieldGet(this, _SkyAgGridService_currentTheme, "f")) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.name) === 'modern' ? 180 : 160,
|
|
1429
|
-
valueFormatter: (params) => this.dateFormatter(params, args.locale),
|
|
1430
|
-
},
|
|
1431
|
-
[SkyCellType.Lookup]: {
|
|
1432
|
-
cellClassRules: Object.assign({ [SkyCellClass.Lookup]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
1433
|
-
cellEditor: SkyAgGridCellEditorLookupComponent,
|
|
1434
|
-
cellRenderer: SkyAgGridCellRendererLookupComponent,
|
|
1435
|
-
valueFormatter: (params) => {
|
|
1436
|
-
const lookupProperties = applySkyLookupPropertiesDefaults(params);
|
|
1437
|
-
return (params.value || [])
|
|
1438
|
-
.map((value) => {
|
|
1439
|
-
return value[lookupProperties.descriptorProperty];
|
|
1440
|
-
})
|
|
1441
|
-
.filter((value) => value !== '' && value !== undefined)
|
|
1442
|
-
.join('; ');
|
|
1443
|
-
},
|
|
1444
|
-
minWidth: 185,
|
|
1445
|
-
},
|
|
1446
|
-
[SkyCellType.Number]: {
|
|
1447
|
-
cellClassRules: Object.assign(Object.assign({ [SkyCellClass.Number]: cellClassRuleTrueExpression }, validatorCellClassRules), editableCellClassRules),
|
|
1448
|
-
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
1449
|
-
cellEditor: SkyAgGridCellEditorNumberComponent,
|
|
1450
|
-
headerClass: SkyHeaderClass.RightAligned,
|
|
1451
|
-
},
|
|
1452
|
-
[SkyCellType.RowSelector]: {
|
|
1453
|
-
cellClassRules: {
|
|
1454
|
-
[SkyCellClass.RowSelector]: cellClassRuleTrueExpression,
|
|
1455
|
-
[SkyCellClass.Uneditable]: cellClassRuleTrueExpression,
|
|
1456
|
-
},
|
|
1457
|
-
cellRenderer: SkyAgGridCellRendererRowSelectorComponent,
|
|
1458
|
-
headerName: '',
|
|
1459
|
-
minWidth: 55,
|
|
1460
|
-
maxWidth: 55,
|
|
1461
|
-
sortable: false,
|
|
1462
|
-
width: 55,
|
|
1463
|
-
},
|
|
1464
|
-
[SkyCellType.Text]: {
|
|
1465
|
-
cellClassRules: Object.assign(Object.assign({ [SkyCellClass.Text]: cellClassRuleTrueExpression }, validatorCellClassRules), editableCellClassRules),
|
|
1466
|
-
cellEditor: SkyAgGridCellEditorTextComponent,
|
|
1467
|
-
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
1468
|
-
},
|
|
1469
|
-
[SkyCellType.Validator]: {
|
|
1470
|
-
cellClassRules: Object.assign(Object.assign({}, validatorCellClassRules), editableCellClassRules),
|
|
1471
|
-
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
1472
|
-
},
|
|
1473
|
+
}
|
|
1474
|
+
const validatorCellClassRules = {
|
|
1475
|
+
["sky-ag-grid-cell-invalid" /* SkyCellClass.Invalid */]: getValidatorFn(),
|
|
1476
|
+
};
|
|
1477
|
+
const defaultSkyGridOptions = {
|
|
1478
|
+
columnTypes: {
|
|
1479
|
+
[SkyCellType.Autocomplete]: {
|
|
1480
|
+
cellClassRules: Object.assign({ ["sky-ag-grid-cell-autocomplete" /* SkyCellClass.Autocomplete */]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
1481
|
+
cellEditor: SkyAgGridCellEditorAutocompleteComponent,
|
|
1482
|
+
valueFormatter: autocompleteFormatter,
|
|
1483
|
+
comparator: autocompleteComparator,
|
|
1484
|
+
minWidth: 185,
|
|
1473
1485
|
},
|
|
1474
|
-
|
|
1475
|
-
cellClassRules: editableCellClassRules,
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
suppressKeyboardEvent: (keypress) => this.suppressTab(keypress),
|
|
1486
|
+
[SkyCellType.Currency]: {
|
|
1487
|
+
cellClassRules: Object.assign(Object.assign({ ["sky-ag-grid-cell-currency" /* SkyCellClass.Currency */]: cellClassRuleTrueExpression }, validatorCellClassRules), editableCellClassRules),
|
|
1488
|
+
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-currency-validator', { component: 'sky-ag-grid-cell-renderer-currency' }),
|
|
1489
|
+
cellEditor: SkyAgGridCellEditorCurrencyComponent,
|
|
1490
|
+
headerClass: SkyHeaderClass.RightAligned,
|
|
1491
|
+
minWidth: 185,
|
|
1481
1492
|
},
|
|
1482
|
-
|
|
1483
|
-
|
|
1493
|
+
[SkyCellType.Date]: {
|
|
1494
|
+
cellClassRules: Object.assign({ ["sky-ag-grid-cell-date" /* SkyCellClass.Date */]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
1495
|
+
cellEditor: SkyAgGridCellEditorDatepickerComponent,
|
|
1496
|
+
comparator: dateComparator,
|
|
1497
|
+
minWidth: ((_b = (_a = __classPrivateFieldGet(this, _SkyAgGridService_currentTheme, "f")) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.name) === 'modern' ? 180 : 160,
|
|
1498
|
+
valueFormatter: (params) => __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_dateFormatter).call(this, params, args.locale),
|
|
1484
1499
|
},
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1500
|
+
[SkyCellType.Lookup]: {
|
|
1501
|
+
cellClassRules: Object.assign({ ["sky-ag-grid-cell-lookup" /* SkyCellClass.Lookup */]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
1502
|
+
cellEditor: SkyAgGridCellEditorLookupComponent,
|
|
1503
|
+
cellRenderer: SkyAgGridCellRendererLookupComponent,
|
|
1504
|
+
valueFormatter: (params) => {
|
|
1505
|
+
const lookupProperties = applySkyLookupPropertiesDefaults(params);
|
|
1506
|
+
return (params.value || [])
|
|
1507
|
+
.map((value) => {
|
|
1508
|
+
return value[lookupProperties.descriptorProperty];
|
|
1509
|
+
})
|
|
1510
|
+
.filter((value) => value !== '' && value !== undefined)
|
|
1511
|
+
.join('; ');
|
|
1512
|
+
},
|
|
1513
|
+
minWidth: 185,
|
|
1491
1514
|
},
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
if (!this.keyMap.has(params.data)) {
|
|
1498
|
-
this.keyMap.set(params.data, `${rowNodeId--}`);
|
|
1499
|
-
}
|
|
1500
|
-
return this.keyMap.get(params.data);
|
|
1515
|
+
[SkyCellType.Number]: {
|
|
1516
|
+
cellClassRules: Object.assign(Object.assign({ ["sky-ag-grid-cell-number" /* SkyCellClass.Number */]: cellClassRuleTrueExpression }, validatorCellClassRules), editableCellClassRules),
|
|
1517
|
+
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
1518
|
+
cellEditor: SkyAgGridCellEditorNumberComponent,
|
|
1519
|
+
headerClass: SkyHeaderClass.RightAligned,
|
|
1501
1520
|
},
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1521
|
+
[SkyCellType.RowSelector]: {
|
|
1522
|
+
cellClassRules: {
|
|
1523
|
+
["sky-ag-grid-cell-row-selector" /* SkyCellClass.RowSelector */]: cellClassRuleTrueExpression,
|
|
1524
|
+
["sky-ag-grid-cell-uneditable" /* SkyCellClass.Uneditable */]: cellClassRuleTrueExpression,
|
|
1525
|
+
},
|
|
1526
|
+
cellRenderer: SkyAgGridCellRendererRowSelectorComponent,
|
|
1527
|
+
headerName: '',
|
|
1528
|
+
minWidth: 55,
|
|
1529
|
+
maxWidth: 55,
|
|
1530
|
+
sortable: false,
|
|
1531
|
+
width: 55,
|
|
1509
1532
|
},
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
columnMoveMove: this.getIconTemplate('arrows'),
|
|
1515
|
-
columnMoveHide: this.getIconTemplate('arrows'),
|
|
1516
|
-
columnMoveLeft: this.getIconTemplate('arrows'),
|
|
1517
|
-
columnMoveRight: this.getIconTemplate('arrows'),
|
|
1518
|
-
columnMovePin: this.getIconTemplate('arrows'),
|
|
1533
|
+
[SkyCellType.Text]: {
|
|
1534
|
+
cellClassRules: Object.assign(Object.assign({ ["sky-ag-grid-cell-text" /* SkyCellClass.Text */]: cellClassRuleTrueExpression }, validatorCellClassRules), editableCellClassRules),
|
|
1535
|
+
cellEditor: SkyAgGridCellEditorTextComponent,
|
|
1536
|
+
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
1519
1537
|
},
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1538
|
+
[SkyCellType.Validator]: {
|
|
1539
|
+
cellClassRules: Object.assign(Object.assign({}, validatorCellClassRules), editableCellClassRules),
|
|
1540
|
+
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
1541
|
+
},
|
|
1542
|
+
},
|
|
1543
|
+
defaultColDef: {
|
|
1544
|
+
cellClassRules: editableCellClassRules,
|
|
1545
|
+
headerComponent: SkyAgGridHeaderComponent,
|
|
1546
|
+
minWidth: 100,
|
|
1547
|
+
resizable: true,
|
|
1548
|
+
sortable: true,
|
|
1549
|
+
suppressKeyboardEvent: (keypress) => __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_suppressTab).call(this, keypress),
|
|
1550
|
+
},
|
|
1551
|
+
defaultColGroupDef: {
|
|
1552
|
+
headerGroupComponent: SkyAgGridHeaderGroupComponent,
|
|
1553
|
+
},
|
|
1554
|
+
domLayout: 'autoHeight',
|
|
1555
|
+
enterMovesDownAfterEdit: true,
|
|
1556
|
+
components: {
|
|
1557
|
+
'sky-ag-grid-cell-renderer-currency': SkyAgGridCellRendererCurrencyComponent,
|
|
1558
|
+
'sky-ag-grid-cell-renderer-currency-validator': SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
1559
|
+
'sky-ag-grid-cell-renderer-validator-tooltip': SkyAgGridCellRendererValidatorTooltipComponent,
|
|
1560
|
+
},
|
|
1561
|
+
getRowId: (params) => {
|
|
1562
|
+
const dataId = params.data.id;
|
|
1563
|
+
if (dataId !== undefined) {
|
|
1564
|
+
return `${params.data.id}`;
|
|
1565
|
+
}
|
|
1566
|
+
if (!__classPrivateFieldGet(this, _SkyAgGridService_keyMap, "f").has(params.data)) {
|
|
1567
|
+
__classPrivateFieldGet(this, _SkyAgGridService_keyMap, "f").set(params.data, `${rowNodeId--}`);
|
|
1568
|
+
}
|
|
1569
|
+
return __classPrivateFieldGet(this, _SkyAgGridService_keyMap, "f").get(params.data);
|
|
1570
|
+
},
|
|
1571
|
+
getRowClass: (params) => {
|
|
1572
|
+
if (params.node.id) {
|
|
1573
|
+
return `sky-ag-grid-row-${params.node.id}`;
|
|
1574
|
+
}
|
|
1575
|
+
else {
|
|
1576
|
+
return undefined;
|
|
1577
|
+
}
|
|
1578
|
+
},
|
|
1579
|
+
headerHeight: this.getHeaderHeight(),
|
|
1580
|
+
icons: {
|
|
1581
|
+
sortDescending: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getIconTemplate).call(this, 'caret-down'),
|
|
1582
|
+
sortAscending: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getIconTemplate).call(this, 'caret-up'),
|
|
1583
|
+
columnMoveMove: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getIconTemplate).call(this, 'arrows'),
|
|
1584
|
+
columnMoveHide: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getIconTemplate).call(this, 'arrows'),
|
|
1585
|
+
columnMoveLeft: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getIconTemplate).call(this, 'arrows'),
|
|
1586
|
+
columnMoveRight: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getIconTemplate).call(this, 'arrows'),
|
|
1587
|
+
columnMovePin: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getIconTemplate).call(this, 'arrows'),
|
|
1588
|
+
},
|
|
1589
|
+
onCellFocused: () => __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_onCellFocused).call(this),
|
|
1590
|
+
rowHeight: __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getRowHeight).call(this),
|
|
1591
|
+
getRowHeight: () => __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getRowHeight).call(this),
|
|
1592
|
+
rowMultiSelectWithClick: true,
|
|
1593
|
+
rowSelection: 'multiple',
|
|
1594
|
+
singleClickEdit: true,
|
|
1595
|
+
sortingOrder: ['desc', 'asc', null],
|
|
1596
|
+
suppressRowClickSelection: true,
|
|
1597
|
+
suppressDragLeaveHidesColumns: true,
|
|
1598
|
+
};
|
|
1599
|
+
const columnTypes = defaultSkyGridOptions.columnTypes;
|
|
1600
|
+
columnTypes[SkyCellType.CurrencyValidator] = Object.assign(Object.assign({}, columnTypes[SkyCellType.Currency]), { cellRendererParams: {
|
|
1601
|
+
skyComponentProperties: {
|
|
1602
|
+
validator: (value) => {
|
|
1603
|
+
return !!`${value || ''}`.match(/^[^0-9]*(\d+[,.]?)+\d*[^0-9]*$/);
|
|
1536
1604
|
},
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
validatorMessage: 'Please enter a valid number',
|
|
1605
|
+
validatorMessage: 'Please enter a valid currency',
|
|
1606
|
+
},
|
|
1607
|
+
} });
|
|
1608
|
+
/*istanbul ignore else*/
|
|
1609
|
+
if (__classPrivateFieldGet(this, _SkyAgGridService_resources, "f")) {
|
|
1610
|
+
__classPrivateFieldGet(this, _SkyAgGridService_resources, "f")
|
|
1611
|
+
.getString('sky_ag_grid_cell_renderer_currency_validator_message')
|
|
1612
|
+
.subscribe((value) => {
|
|
1613
|
+
columnTypes[SkyCellType.CurrencyValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
columnTypes[SkyCellType.NumberValidator] = Object.assign(Object.assign(Object.assign({}, columnTypes[SkyCellType.Validator]), columnTypes[SkyCellType.Number]), { cellClassRules: Object.assign(Object.assign({}, columnTypes[SkyCellType.Validator].cellClassRules), columnTypes[SkyCellType.Number].cellClassRules), cellRendererParams: {
|
|
1617
|
+
skyComponentProperties: {
|
|
1618
|
+
validator: (value) => {
|
|
1619
|
+
return !!value && !isNaN(parseFloat(value));
|
|
1553
1620
|
},
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
const nextFocusableElementInCell = this.agGridAdapterService.getNextFocusableElement(currentlyFocusedEl, parentEl, params.event.shiftKey);
|
|
1599
|
-
return !!nextFocusableElementInCell;
|
|
1600
|
-
}
|
|
1601
|
-
return true;
|
|
1621
|
+
validatorMessage: 'Please enter a valid number',
|
|
1622
|
+
},
|
|
1623
|
+
} });
|
|
1624
|
+
/*istanbul ignore else*/
|
|
1625
|
+
if (__classPrivateFieldGet(this, _SkyAgGridService_resources, "f")) {
|
|
1626
|
+
__classPrivateFieldGet(this, _SkyAgGridService_resources, "f")
|
|
1627
|
+
.getString('sky_ag_grid_cell_renderer_number_validator_message')
|
|
1628
|
+
.subscribe((value) => {
|
|
1629
|
+
columnTypes[SkyCellType.NumberValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
return defaultSkyGridOptions;
|
|
1633
|
+
}, _SkyAgGridService_onCellFocused = function _SkyAgGridService_onCellFocused() {
|
|
1634
|
+
const currentElement = __classPrivateFieldGet(this, _SkyAgGridService_agGridAdapterService, "f").getFocusedElement();
|
|
1635
|
+
__classPrivateFieldGet(this, _SkyAgGridService_agGridAdapterService, "f").focusOnFocusableChildren(currentElement);
|
|
1636
|
+
}, _SkyAgGridService_getDefaultEditableGridOptions = function _SkyAgGridService_getDefaultEditableGridOptions(args) {
|
|
1637
|
+
const defaultGridOptions = __classPrivateFieldGet(this, _SkyAgGridService_instances, "m", _SkyAgGridService_getDefaultGridOptions).call(this, args);
|
|
1638
|
+
defaultGridOptions.rowSelection = undefined;
|
|
1639
|
+
return defaultGridOptions;
|
|
1640
|
+
}, _SkyAgGridService_dateFormatter = function _SkyAgGridService_dateFormatter(params, locale = 'en-us') {
|
|
1641
|
+
const dateConfig = { year: 'numeric', month: '2-digit', day: '2-digit' };
|
|
1642
|
+
let date = params.value;
|
|
1643
|
+
if (date && typeof date === 'string') {
|
|
1644
|
+
date = new Date(params.value);
|
|
1645
|
+
}
|
|
1646
|
+
const formattedDate = date &&
|
|
1647
|
+
date.toLocaleDateString &&
|
|
1648
|
+
date.toLocaleDateString(locale, dateConfig);
|
|
1649
|
+
if (date && date.getTime && !isNaN(date.getTime())) {
|
|
1650
|
+
return formattedDate;
|
|
1651
|
+
}
|
|
1652
|
+
return '';
|
|
1653
|
+
}, _SkyAgGridService_getIconTemplate = function _SkyAgGridService_getIconTemplate(iconName) {
|
|
1654
|
+
return `<i class="fa fa-${iconName}"></i>`;
|
|
1655
|
+
}, _SkyAgGridService_suppressTab = function _SkyAgGridService_suppressTab(params) {
|
|
1656
|
+
if (params.event.code === 'Tab') {
|
|
1657
|
+
if (params.editing) {
|
|
1658
|
+
const currentlyFocusedEl = __classPrivateFieldGet(this, _SkyAgGridService_agGridAdapterService, "f").getFocusedElement();
|
|
1659
|
+
// inline cell editors have the 'ag-cell' class, while popup editors have the 'ag-popup-editor' class
|
|
1660
|
+
const cellEl = __classPrivateFieldGet(this, _SkyAgGridService_agGridAdapterService, "f").getElementOrParentWithClass(currentlyFocusedEl, 'ag-cell');
|
|
1661
|
+
const popupEl = __classPrivateFieldGet(this, _SkyAgGridService_agGridAdapterService, "f").getElementOrParentWithClass(currentlyFocusedEl, 'ag-popup-editor');
|
|
1662
|
+
const parentEl = cellEl || popupEl;
|
|
1663
|
+
const nextFocusableElementInCell = __classPrivateFieldGet(this, _SkyAgGridService_agGridAdapterService, "f").getNextFocusableElement(currentlyFocusedEl, parentEl, params.event.shiftKey);
|
|
1664
|
+
return !!nextFocusableElementInCell;
|
|
1602
1665
|
}
|
|
1603
|
-
return
|
|
1666
|
+
return true;
|
|
1604
1667
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1668
|
+
return false;
|
|
1669
|
+
}, _SkyAgGridService_getRowHeight = function _SkyAgGridService_getRowHeight() {
|
|
1607
1670
|
var _a, _b;
|
|
1608
1671
|
return ((_b = (_a = __classPrivateFieldGet(this, _SkyAgGridService_currentTheme, "f")) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.name) === 'modern' ? 60 : 38;
|
|
1609
1672
|
};
|
|
@@ -1622,21 +1685,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1622
1685
|
}] }];
|
|
1623
1686
|
} });
|
|
1624
1687
|
|
|
1625
|
-
var _SkyAgGridWrapperComponent_instances, _SkyAgGridWrapperComponent_agGridService, _SkyAgGridWrapperComponent_ngUnsubscribe, _SkyAgGridWrapperComponent_themeSvc, _SkyAgGridWrapperComponent_wrapperClasses, _SkyAgGridWrapperComponent_currentTheme, _SkyAgGridWrapperComponent_moveHorizontalScroll;
|
|
1688
|
+
var _SkyAgGridWrapperComponent_instances, _SkyAgGridWrapperComponent_isInEditMode_get, _SkyAgGridWrapperComponent__viewkeeperClasses, _SkyAgGridWrapperComponent_agGridService, _SkyAgGridWrapperComponent_ngUnsubscribe, _SkyAgGridWrapperComponent_themeSvc, _SkyAgGridWrapperComponent_wrapperClasses, _SkyAgGridWrapperComponent_currentTheme, _SkyAgGridWrapperComponent_adapterService, _SkyAgGridWrapperComponent_changeDetector, _SkyAgGridWrapperComponent_elementRef, _SkyAgGridWrapperComponent_document, _SkyAgGridWrapperComponent_moveHorizontalScroll;
|
|
1626
1689
|
let idIndex = 0;
|
|
1627
1690
|
class SkyAgGridWrapperComponent {
|
|
1628
1691
|
constructor(adapterService, changeDetector, elementRef, document, agGridService, themeSvc) {
|
|
1629
|
-
this.adapterService = adapterService;
|
|
1630
|
-
this.changeDetector = changeDetector;
|
|
1631
|
-
this.elementRef = elementRef;
|
|
1632
|
-
this.document = document;
|
|
1633
1692
|
_SkyAgGridWrapperComponent_instances.add(this);
|
|
1634
|
-
this
|
|
1693
|
+
_SkyAgGridWrapperComponent__viewkeeperClasses.set(this, []);
|
|
1635
1694
|
_SkyAgGridWrapperComponent_agGridService.set(this, void 0);
|
|
1636
1695
|
_SkyAgGridWrapperComponent_ngUnsubscribe.set(this, new Subject());
|
|
1637
1696
|
_SkyAgGridWrapperComponent_themeSvc.set(this, void 0);
|
|
1638
1697
|
_SkyAgGridWrapperComponent_wrapperClasses.set(this, new BehaviorSubject([`ag-theme-sky-default`]));
|
|
1639
1698
|
_SkyAgGridWrapperComponent_currentTheme.set(this, undefined);
|
|
1699
|
+
_SkyAgGridWrapperComponent_adapterService.set(this, void 0);
|
|
1700
|
+
_SkyAgGridWrapperComponent_changeDetector.set(this, void 0);
|
|
1701
|
+
_SkyAgGridWrapperComponent_elementRef.set(this, void 0);
|
|
1702
|
+
_SkyAgGridWrapperComponent_document.set(this, void 0);
|
|
1703
|
+
__classPrivateFieldSet(this, _SkyAgGridWrapperComponent_adapterService, adapterService, "f");
|
|
1704
|
+
__classPrivateFieldSet(this, _SkyAgGridWrapperComponent_changeDetector, changeDetector, "f");
|
|
1705
|
+
__classPrivateFieldSet(this, _SkyAgGridWrapperComponent_elementRef, elementRef, "f");
|
|
1706
|
+
__classPrivateFieldSet(this, _SkyAgGridWrapperComponent_document, document, "f");
|
|
1640
1707
|
idIndex++;
|
|
1641
1708
|
this.afterAnchorId = 'sky-ag-grid-nav-anchor-after-' + idIndex;
|
|
1642
1709
|
this.beforeAnchorId = 'sky-ag-grid-nav-anchor-before-' + idIndex;
|
|
@@ -1646,57 +1713,61 @@ class SkyAgGridWrapperComponent {
|
|
|
1646
1713
|
this.wrapperClasses$ = __classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f").asObservable();
|
|
1647
1714
|
}
|
|
1648
1715
|
get viewkeeperClasses() {
|
|
1649
|
-
return this
|
|
1716
|
+
return __classPrivateFieldGet(this, _SkyAgGridWrapperComponent__viewkeeperClasses, "f");
|
|
1650
1717
|
}
|
|
1651
1718
|
set viewkeeperClasses(value) {
|
|
1652
|
-
this
|
|
1653
|
-
this.
|
|
1719
|
+
__classPrivateFieldSet(this, _SkyAgGridWrapperComponent__viewkeeperClasses, value, "f");
|
|
1720
|
+
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_changeDetector, "f").markForCheck();
|
|
1654
1721
|
}
|
|
1655
1722
|
ngAfterContentInit() {
|
|
1656
1723
|
var _a;
|
|
1657
|
-
if (this.agGrid
|
|
1658
|
-
this.agGrid.gridOptions
|
|
1659
|
-
|
|
1660
|
-
this.
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1724
|
+
if (this.agGrid) {
|
|
1725
|
+
if (this.agGrid.gridOptions &&
|
|
1726
|
+
this.agGrid.gridOptions.domLayout === 'autoHeight') {
|
|
1727
|
+
if ((_a = this.agGrid.gridOptions.context) === null || _a === void 0 ? void 0 : _a.enableTopScroll) {
|
|
1728
|
+
this.viewkeeperClasses.push('.ag-header', '.ag-body-horizontal-scroll');
|
|
1729
|
+
}
|
|
1730
|
+
else {
|
|
1731
|
+
this.viewkeeperClasses.push('.ag-header');
|
|
1732
|
+
}
|
|
1664
1733
|
}
|
|
1734
|
+
this.agGrid.gridReady
|
|
1735
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1736
|
+
.subscribe(() => {
|
|
1737
|
+
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_instances, "m", _SkyAgGridWrapperComponent_moveHorizontalScroll).call(this);
|
|
1738
|
+
});
|
|
1739
|
+
this.agGrid.firstDataRendered
|
|
1740
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1741
|
+
.subscribe(() => {
|
|
1742
|
+
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_instances, "m", _SkyAgGridWrapperComponent_moveHorizontalScroll).call(this);
|
|
1743
|
+
});
|
|
1744
|
+
this.agGrid.rowDataUpdated
|
|
1745
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1746
|
+
.subscribe(() => {
|
|
1747
|
+
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_instances, "m", _SkyAgGridWrapperComponent_moveHorizontalScroll).call(this);
|
|
1748
|
+
});
|
|
1749
|
+
this.agGrid.cellEditingStarted
|
|
1750
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1751
|
+
.subscribe((params) => {
|
|
1752
|
+
if (params.colDef.type) {
|
|
1753
|
+
const types = Array.isArray(params.colDef.type)
|
|
1754
|
+
? params.colDef.type
|
|
1755
|
+
: [params.colDef.type];
|
|
1756
|
+
const addClasses = types.map((t) => `sky-ag-grid-cell-editing-${t}`);
|
|
1757
|
+
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f").next([
|
|
1758
|
+
...__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f").getValue(),
|
|
1759
|
+
...addClasses,
|
|
1760
|
+
]);
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1763
|
+
this.agGrid.cellEditingStopped
|
|
1764
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1765
|
+
.subscribe(() => {
|
|
1766
|
+
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f").next(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f")
|
|
1767
|
+
.getValue()
|
|
1768
|
+
.filter((c) => c.startsWith('ag-theme-')));
|
|
1769
|
+
});
|
|
1665
1770
|
}
|
|
1666
|
-
this.agGrid.gridReady.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f"))).subscribe(() => {
|
|
1667
|
-
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_instances, "m", _SkyAgGridWrapperComponent_moveHorizontalScroll).call(this);
|
|
1668
|
-
});
|
|
1669
|
-
this.agGrid.firstDataRendered
|
|
1670
|
-
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1671
|
-
.subscribe(() => {
|
|
1672
|
-
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_instances, "m", _SkyAgGridWrapperComponent_moveHorizontalScroll).call(this);
|
|
1673
|
-
});
|
|
1674
|
-
this.agGrid.rowDataUpdated
|
|
1675
|
-
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1676
|
-
.subscribe(() => {
|
|
1677
|
-
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_instances, "m", _SkyAgGridWrapperComponent_moveHorizontalScroll).call(this);
|
|
1678
|
-
});
|
|
1679
|
-
this.agGrid.cellEditingStarted
|
|
1680
|
-
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1681
|
-
.subscribe((params) => {
|
|
1682
|
-
if (params.colDef.type) {
|
|
1683
|
-
const types = Array.isArray(params.colDef.type)
|
|
1684
|
-
? params.colDef.type
|
|
1685
|
-
: [params.colDef.type];
|
|
1686
|
-
const addClasses = types.map((t) => `sky-ag-grid-cell-editing-${t}`);
|
|
1687
|
-
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f").next([
|
|
1688
|
-
...__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f").getValue(),
|
|
1689
|
-
...addClasses,
|
|
1690
|
-
]);
|
|
1691
|
-
}
|
|
1692
|
-
});
|
|
1693
|
-
this.agGrid.cellEditingStopped
|
|
1694
|
-
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f")))
|
|
1695
|
-
.subscribe(() => {
|
|
1696
|
-
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f").next(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_wrapperClasses, "f")
|
|
1697
|
-
.getValue()
|
|
1698
|
-
.filter((c) => c.startsWith('ag-theme-')));
|
|
1699
|
-
});
|
|
1700
1771
|
}
|
|
1701
1772
|
ngOnDestroy() {
|
|
1702
1773
|
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f").next();
|
|
@@ -1705,6 +1776,7 @@ class SkyAgGridWrapperComponent {
|
|
|
1705
1776
|
ngOnInit() {
|
|
1706
1777
|
var _a;
|
|
1707
1778
|
(_a = __classPrivateFieldGet(this, _SkyAgGridWrapperComponent_themeSvc, "f")) === null || _a === void 0 ? void 0 : _a.settingsChange.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_ngUnsubscribe, "f"))).subscribe((settings) => {
|
|
1779
|
+
var _a;
|
|
1708
1780
|
let agThemeClass;
|
|
1709
1781
|
if (settings.currentSettings.theme.name === 'modern') {
|
|
1710
1782
|
agThemeClass = `ag-theme-sky-modern-${settings.currentSettings.mode.name}`;
|
|
@@ -1722,7 +1794,7 @@ class SkyAgGridWrapperComponent {
|
|
|
1722
1794
|
// Initial theme settings.
|
|
1723
1795
|
__classPrivateFieldSet(this, _SkyAgGridWrapperComponent_currentTheme, settings.currentSettings, "f");
|
|
1724
1796
|
}
|
|
1725
|
-
else if (this.agGrid.api) {
|
|
1797
|
+
else if ((_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.api) {
|
|
1726
1798
|
// On subsequent theme changes, we need to call the api to re-render the grid.
|
|
1727
1799
|
__classPrivateFieldSet(this, _SkyAgGridWrapperComponent_currentTheme, settings.currentSettings, "f");
|
|
1728
1800
|
this.agGrid.api.setHeaderHeight(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_agGridService, "f").getHeaderHeight());
|
|
@@ -1735,60 +1807,60 @@ class SkyAgGridWrapperComponent {
|
|
|
1735
1807
|
* Prevent closing a modal when focused in AG Grid.
|
|
1736
1808
|
*/
|
|
1737
1809
|
onKeyUpEscape($event) {
|
|
1810
|
+
var _a;
|
|
1738
1811
|
$event.stopPropagation();
|
|
1739
|
-
this.agGrid.api.stopEditing(true);
|
|
1812
|
+
(_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.api.stopEditing(true);
|
|
1740
1813
|
}
|
|
1741
1814
|
onGridKeydown(event) {
|
|
1742
|
-
if (this.agGrid && !this
|
|
1815
|
+
if (this.agGrid && !__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_instances, "a", _SkyAgGridWrapperComponent_isInEditMode_get) && event.key === 'Tab') {
|
|
1743
1816
|
const idToFocus = event.shiftKey
|
|
1744
1817
|
? this.beforeAnchorId
|
|
1745
1818
|
: this.afterAnchorId;
|
|
1746
|
-
this.
|
|
1819
|
+
__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_adapterService, "f").setFocusedElementById(__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_elementRef, "f").nativeElement, idToFocus);
|
|
1747
1820
|
}
|
|
1748
1821
|
}
|
|
1749
1822
|
onAnchorFocus(event) {
|
|
1823
|
+
var _a, _b, _c;
|
|
1750
1824
|
const gridId = this.gridId;
|
|
1751
1825
|
const relatedTarget = event.relatedTarget;
|
|
1752
1826
|
const previousFocusedId = relatedTarget && relatedTarget.id;
|
|
1753
1827
|
const previousWasCell = relatedTarget &&
|
|
1754
|
-
!!this.
|
|
1828
|
+
!!__classPrivateFieldGet(this, _SkyAgGridWrapperComponent_adapterService, "f").getElementOrParentWithClass(relatedTarget, 'ag-cell');
|
|
1755
1829
|
if (previousFocusedId !== gridId && !previousWasCell) {
|
|
1756
|
-
const columns = this.agGrid.columnApi.getAllDisplayedColumns();
|
|
1757
|
-
const firstColumn = columns
|
|
1758
|
-
const rowIndex = this.agGrid.api.getFirstDisplayedRow();
|
|
1759
|
-
if (firstColumn && rowIndex >= 0) {
|
|
1760
|
-
this.agGrid.api.setFocusedCell(rowIndex, firstColumn);
|
|
1830
|
+
const columns = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.columnApi.getAllDisplayedColumns();
|
|
1831
|
+
const firstColumn = columns === null || columns === void 0 ? void 0 : columns[0];
|
|
1832
|
+
const rowIndex = (_b = this.agGrid) === null || _b === void 0 ? void 0 : _b.api.getFirstDisplayedRow();
|
|
1833
|
+
if (firstColumn && rowIndex !== undefined && rowIndex >= 0) {
|
|
1834
|
+
(_c = this.agGrid) === null || _c === void 0 ? void 0 : _c.api.setFocusedCell(rowIndex, firstColumn);
|
|
1761
1835
|
}
|
|
1762
1836
|
}
|
|
1763
1837
|
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
}
|
|
1772
|
-
else {
|
|
1773
|
-
let innerEditing = false;
|
|
1774
|
-
this.agGrid.api.forEachDetailGridInfo((detailGrid) => {
|
|
1775
|
-
if (detailGrid.api.getEditingCells().length > 0) {
|
|
1776
|
-
innerEditing = true;
|
|
1777
|
-
}
|
|
1778
|
-
});
|
|
1779
|
-
return innerEditing;
|
|
1780
|
-
}
|
|
1838
|
+
}
|
|
1839
|
+
_SkyAgGridWrapperComponent__viewkeeperClasses = new WeakMap(), _SkyAgGridWrapperComponent_agGridService = new WeakMap(), _SkyAgGridWrapperComponent_ngUnsubscribe = new WeakMap(), _SkyAgGridWrapperComponent_themeSvc = new WeakMap(), _SkyAgGridWrapperComponent_wrapperClasses = new WeakMap(), _SkyAgGridWrapperComponent_currentTheme = new WeakMap(), _SkyAgGridWrapperComponent_adapterService = new WeakMap(), _SkyAgGridWrapperComponent_changeDetector = new WeakMap(), _SkyAgGridWrapperComponent_elementRef = new WeakMap(), _SkyAgGridWrapperComponent_document = new WeakMap(), _SkyAgGridWrapperComponent_instances = new WeakSet(), _SkyAgGridWrapperComponent_isInEditMode_get = function _SkyAgGridWrapperComponent_isInEditMode_get() {
|
|
1840
|
+
/* istanbul ignore else */
|
|
1841
|
+
if (this.agGrid && this.agGrid.api) {
|
|
1842
|
+
const primaryGridEditing = this.agGrid.api.getEditingCells().length > 0;
|
|
1843
|
+
if (primaryGridEditing) {
|
|
1844
|
+
return true;
|
|
1781
1845
|
}
|
|
1782
1846
|
else {
|
|
1783
|
-
|
|
1847
|
+
let innerEditing = false;
|
|
1848
|
+
this.agGrid.api.forEachDetailGridInfo((detailGrid) => {
|
|
1849
|
+
if ((detailGrid === null || detailGrid === void 0 ? void 0 : detailGrid.api) && detailGrid.api.getEditingCells().length > 0) {
|
|
1850
|
+
innerEditing = true;
|
|
1851
|
+
}
|
|
1852
|
+
});
|
|
1853
|
+
return innerEditing;
|
|
1784
1854
|
}
|
|
1785
1855
|
}
|
|
1786
|
-
|
|
1787
|
-
|
|
1856
|
+
else {
|
|
1857
|
+
return false;
|
|
1858
|
+
}
|
|
1859
|
+
}, _SkyAgGridWrapperComponent_moveHorizontalScroll = function _SkyAgGridWrapperComponent_moveHorizontalScroll() {
|
|
1788
1860
|
var _a;
|
|
1789
1861
|
if (this.agGrid && this.agGrid.api) {
|
|
1790
1862
|
const toTop = !!((_a = this.agGrid.gridOptions.context) === null || _a === void 0 ? void 0 : _a.enableTopScroll);
|
|
1791
|
-
const root = this.
|
|
1863
|
+
const root = __classPrivateFieldGet(this, _SkyAgGridWrapperComponent_elementRef, "f").nativeElement.querySelector('.ag-root');
|
|
1792
1864
|
const header = root.querySelector('.ag-header');
|
|
1793
1865
|
const floatingBottom = root.querySelector('.ag-floating-bottom');
|
|
1794
1866
|
const scrollbar = root.querySelector('.ag-body-horizontal-scroll');
|
|
@@ -1799,12 +1871,12 @@ _SkyAgGridWrapperComponent_agGridService = new WeakMap(), _SkyAgGridWrapperCompo
|
|
|
1799
1871
|
}
|
|
1800
1872
|
const isTop = !!root.children[1].matches('.ag-body-horizontal-scroll');
|
|
1801
1873
|
if (toTop && !isTop) {
|
|
1802
|
-
const fragment = this.
|
|
1874
|
+
const fragment = __classPrivateFieldGet(this, _SkyAgGridWrapperComponent_document, "f").createDocumentFragment();
|
|
1803
1875
|
fragment.appendChild(scrollbar);
|
|
1804
1876
|
header.after(fragment);
|
|
1805
1877
|
}
|
|
1806
1878
|
else if (!toTop && isTop) {
|
|
1807
|
-
const fragment = this.
|
|
1879
|
+
const fragment = __classPrivateFieldGet(this, _SkyAgGridWrapperComponent_document, "f").createDocumentFragment();
|
|
1808
1880
|
fragment.appendChild(scrollbar);
|
|
1809
1881
|
floatingBottom.after(fragment);
|
|
1810
1882
|
}
|
|
@@ -1830,138 +1902,153 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
1830
1902
|
}]
|
|
1831
1903
|
}] } });
|
|
1832
1904
|
|
|
1905
|
+
var _SkyAgGridDataManagerAdapterDirective_instances, _SkyAgGridDataManagerAdapterDirective_currentAgGrid, _SkyAgGridDataManagerAdapterDirective_currentDataState, _SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper, _SkyAgGridDataManagerAdapterDirective_dataStateSub, _SkyAgGridDataManagerAdapterDirective_viewConfig, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, _SkyAgGridDataManagerAdapterDirective_changeDetector, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, _SkyAgGridDataManagerAdapterDirective_checkForAgGrid, _SkyAgGridDataManagerAdapterDirective_checkForSkyAgGridWrapper, _SkyAgGridDataManagerAdapterDirective_unregisterAgGrid, _SkyAgGridDataManagerAdapterDirective_unregisterSkyAgGridWrapper, _SkyAgGridDataManagerAdapterDirective_registerSkyAgGridWrapper, _SkyAgGridDataManagerAdapterDirective_registerAgGrid, _SkyAgGridDataManagerAdapterDirective_updateColumnsInCurrentDataState, _SkyAgGridDataManagerAdapterDirective_getColumnOrder, _SkyAgGridDataManagerAdapterDirective_displayColumns, _SkyAgGridDataManagerAdapterDirective_selectAll, _SkyAgGridDataManagerAdapterDirective_clearAll;
|
|
1833
1906
|
/**
|
|
1834
1907
|
* @internal
|
|
1835
1908
|
*/
|
|
1836
1909
|
class SkyAgGridDataManagerAdapterDirective {
|
|
1837
1910
|
constructor(changeDetector, dataManagerSvc) {
|
|
1838
|
-
this
|
|
1839
|
-
this
|
|
1840
|
-
this
|
|
1911
|
+
_SkyAgGridDataManagerAdapterDirective_instances.add(this);
|
|
1912
|
+
_SkyAgGridDataManagerAdapterDirective_currentAgGrid.set(this, void 0);
|
|
1913
|
+
_SkyAgGridDataManagerAdapterDirective_currentDataState.set(this, void 0);
|
|
1914
|
+
_SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper.set(this, void 0);
|
|
1915
|
+
_SkyAgGridDataManagerAdapterDirective_dataStateSub.set(this, void 0);
|
|
1916
|
+
_SkyAgGridDataManagerAdapterDirective_viewConfig.set(this, void 0);
|
|
1917
|
+
_SkyAgGridDataManagerAdapterDirective_ngUnsubscribe.set(this, new Subject());
|
|
1918
|
+
_SkyAgGridDataManagerAdapterDirective_changeDetector.set(this, void 0);
|
|
1919
|
+
_SkyAgGridDataManagerAdapterDirective_dataManagerSvc.set(this, void 0);
|
|
1920
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_changeDetector, changeDetector, "f");
|
|
1921
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, dataManagerSvc, "f");
|
|
1841
1922
|
}
|
|
1842
1923
|
ngAfterContentInit() {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
.
|
|
1849
|
-
.subscribe(() => this.
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
.subscribe(() => this.checkForSkyAgGridWrapper());
|
|
1924
|
+
var _a, _b;
|
|
1925
|
+
if (this.viewId) {
|
|
1926
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").setViewkeeperClasses(this.viewId, ['.ag-header']);
|
|
1927
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").getViewById(this.viewId), "f");
|
|
1928
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_checkForAgGrid).call(this);
|
|
1929
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_checkForSkyAgGridWrapper).call(this);
|
|
1930
|
+
(_a = this.agGridList) === null || _a === void 0 ? void 0 : _a.changes.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f"))).subscribe(() => __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_checkForAgGrid).call(this));
|
|
1931
|
+
(_b = this.skyAgGridWrapperList) === null || _b === void 0 ? void 0 : _b.changes.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f"))).subscribe(() => __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_checkForSkyAgGridWrapper).call(this));
|
|
1932
|
+
}
|
|
1853
1933
|
}
|
|
1854
1934
|
ngOnDestroy() {
|
|
1855
|
-
this.
|
|
1856
|
-
this.
|
|
1935
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f").next();
|
|
1936
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f").complete();
|
|
1857
1937
|
}
|
|
1858
|
-
|
|
1938
|
+
}
|
|
1939
|
+
_SkyAgGridDataManagerAdapterDirective_currentAgGrid = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_currentDataState = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_dataStateSub = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_viewConfig = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_changeDetector = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_dataManagerSvc = new WeakMap(), _SkyAgGridDataManagerAdapterDirective_instances = new WeakSet(), _SkyAgGridDataManagerAdapterDirective_checkForAgGrid = function _SkyAgGridDataManagerAdapterDirective_checkForAgGrid() {
|
|
1940
|
+
if (this.agGridList) {
|
|
1859
1941
|
const agGridCount = this.agGridList.length;
|
|
1860
1942
|
/* istanbul ignore else */
|
|
1861
1943
|
if (agGridCount === 0) {
|
|
1862
|
-
this.
|
|
1944
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_unregisterAgGrid).call(this);
|
|
1863
1945
|
}
|
|
1864
|
-
else if (this.agGridList.first !== this
|
|
1865
|
-
this.
|
|
1946
|
+
else if (this.agGridList.first !== __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentAgGrid, "f")) {
|
|
1947
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_registerAgGrid).call(this);
|
|
1866
1948
|
}
|
|
1867
1949
|
if (agGridCount > 1) {
|
|
1868
1950
|
console.warn('More than one ag-grid child component was found. Using the first ag-Grid.');
|
|
1869
1951
|
}
|
|
1870
1952
|
}
|
|
1871
|
-
|
|
1953
|
+
}, _SkyAgGridDataManagerAdapterDirective_checkForSkyAgGridWrapper = function _SkyAgGridDataManagerAdapterDirective_checkForSkyAgGridWrapper() {
|
|
1954
|
+
if (this.skyAgGridWrapperList) {
|
|
1872
1955
|
const skyAgGridWrapperCount = this.skyAgGridWrapperList.length;
|
|
1873
1956
|
/* istanbul ignore else */
|
|
1874
1957
|
if (skyAgGridWrapperCount === 0) {
|
|
1875
|
-
this.
|
|
1958
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_unregisterSkyAgGridWrapper).call(this);
|
|
1876
1959
|
}
|
|
1877
|
-
else if (this.skyAgGridWrapperList.first !== this
|
|
1878
|
-
this.
|
|
1960
|
+
else if (this.skyAgGridWrapperList.first !== __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper, "f")) {
|
|
1961
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_registerSkyAgGridWrapper).call(this);
|
|
1879
1962
|
}
|
|
1880
1963
|
if (skyAgGridWrapperCount > 1) {
|
|
1881
1964
|
console.warn('More than one ag-grid child component was found. Using the first ag-Grid.');
|
|
1882
1965
|
}
|
|
1883
1966
|
}
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
}
|
|
1890
|
-
}
|
|
1891
|
-
unregisterSkyAgGridWrapper() {
|
|
1892
|
-
this.currentSkyAgGridWrapper = undefined;
|
|
1893
|
-
}
|
|
1894
|
-
registerSkyAgGridWrapper() {
|
|
1895
|
-
this.unregisterSkyAgGridWrapper();
|
|
1896
|
-
this.currentSkyAgGridWrapper = this.skyAgGridWrapperList.first;
|
|
1897
|
-
setTimeout(() => {
|
|
1898
|
-
if (this.currentSkyAgGridWrapper) {
|
|
1899
|
-
this.currentSkyAgGridWrapper.viewkeeperClasses = [];
|
|
1900
|
-
}
|
|
1901
|
-
});
|
|
1967
|
+
}, _SkyAgGridDataManagerAdapterDirective_unregisterAgGrid = function _SkyAgGridDataManagerAdapterDirective_unregisterAgGrid() {
|
|
1968
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_currentAgGrid, undefined, "f");
|
|
1969
|
+
/* istanbul ignore if */
|
|
1970
|
+
if (__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataStateSub, "f")) {
|
|
1971
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataStateSub, "f").unsubscribe();
|
|
1902
1972
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1973
|
+
}, _SkyAgGridDataManagerAdapterDirective_unregisterSkyAgGridWrapper = function _SkyAgGridDataManagerAdapterDirective_unregisterSkyAgGridWrapper() {
|
|
1974
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper, undefined, "f");
|
|
1975
|
+
}, _SkyAgGridDataManagerAdapterDirective_registerSkyAgGridWrapper = function _SkyAgGridDataManagerAdapterDirective_registerSkyAgGridWrapper() {
|
|
1976
|
+
var _a;
|
|
1977
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_unregisterSkyAgGridWrapper).call(this);
|
|
1978
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper, (_a = this.skyAgGridWrapperList) === null || _a === void 0 ? void 0 : _a.first, "f");
|
|
1979
|
+
setTimeout(() => {
|
|
1980
|
+
if (__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper, "f")) {
|
|
1981
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentSkyAgGridWrapper, "f").viewkeeperClasses = [];
|
|
1982
|
+
}
|
|
1983
|
+
});
|
|
1984
|
+
}, _SkyAgGridDataManagerAdapterDirective_registerAgGrid = function _SkyAgGridDataManagerAdapterDirective_registerAgGrid() {
|
|
1985
|
+
var _a;
|
|
1986
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_unregisterAgGrid).call(this);
|
|
1987
|
+
const agGrid = (_a = this.agGridList) === null || _a === void 0 ? void 0 : _a.first;
|
|
1988
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_currentAgGrid, agGrid, "f");
|
|
1989
|
+
if (agGrid) {
|
|
1990
|
+
agGrid.gridReady.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f"))).subscribe(() => {
|
|
1908
1991
|
var _a;
|
|
1909
|
-
this
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1992
|
+
if (__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f") && this.viewId) {
|
|
1993
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").onSelectAllClick = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_selectAll).bind(this);
|
|
1994
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").onClearAllClick = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_clearAll).bind(this);
|
|
1995
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").updateViewConfig(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f"));
|
|
1996
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_dataStateSub, __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f")
|
|
1997
|
+
.getDataStateUpdates(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").id)
|
|
1998
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f")))
|
|
1999
|
+
.subscribe((dataState) => {
|
|
2000
|
+
__classPrivateFieldSet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, dataState, "f");
|
|
2001
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_displayColumns).call(this, dataState);
|
|
2002
|
+
}), "f");
|
|
2003
|
+
if ((_a = agGrid.gridOptions.context) === null || _a === void 0 ? void 0 : _a.enableTopScroll) {
|
|
2004
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").setViewkeeperClasses(this.viewId, [
|
|
2005
|
+
'.ag-header',
|
|
2006
|
+
'.ag-body-horizontal-scroll',
|
|
2007
|
+
]);
|
|
2008
|
+
}
|
|
2009
|
+
agGrid.api.sizeColumnsToFit();
|
|
1924
2010
|
}
|
|
1925
|
-
agGrid.api.sizeColumnsToFit();
|
|
1926
2011
|
});
|
|
1927
2012
|
agGrid.columnMoved
|
|
1928
|
-
.pipe(takeUntil(this
|
|
2013
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f")), filter((event) => ![
|
|
1929
2014
|
'gridInitializing',
|
|
1930
2015
|
'uiColumnResized',
|
|
1931
2016
|
'uiColumnDragged',
|
|
1932
2017
|
'api',
|
|
1933
2018
|
].includes(event.source)))
|
|
1934
2019
|
.subscribe((value) => {
|
|
1935
|
-
this.
|
|
2020
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_updateColumnsInCurrentDataState).call(this, value.columnApi);
|
|
1936
2021
|
});
|
|
1937
2022
|
agGrid.dragStopped
|
|
1938
|
-
.pipe(takeUntil(this
|
|
2023
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f")))
|
|
1939
2024
|
.subscribe((value) => {
|
|
1940
|
-
this.
|
|
2025
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_updateColumnsInCurrentDataState).call(this, value.columnApi);
|
|
1941
2026
|
});
|
|
1942
2027
|
agGrid.rowSelected
|
|
1943
|
-
.pipe(takeUntil(this
|
|
2028
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f")))
|
|
1944
2029
|
.subscribe((event) => {
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2030
|
+
if (__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f") && __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f")) {
|
|
2031
|
+
const row = event.node;
|
|
2032
|
+
const selectedIds = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f").selectedIds || [];
|
|
2033
|
+
const rowIndex = selectedIds.indexOf(row.data.id);
|
|
2034
|
+
if (row.isSelected() && rowIndex === -1) {
|
|
2035
|
+
selectedIds.push(row.data.id);
|
|
2036
|
+
}
|
|
2037
|
+
else if (!row.isSelected() && rowIndex !== -1) {
|
|
2038
|
+
selectedIds.splice(rowIndex, 1);
|
|
2039
|
+
}
|
|
2040
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f").selectedIds = selectedIds;
|
|
2041
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").updateDataState(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f"), __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").id);
|
|
2042
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_changeDetector, "f").markForCheck();
|
|
1953
2043
|
}
|
|
1954
|
-
this.currentDataState.selectedIds = selectedIds;
|
|
1955
|
-
this.dataManagerSvc.updateDataState(this.currentDataState, this.viewConfig.id);
|
|
1956
|
-
this.changeDetector.markForCheck();
|
|
1957
2044
|
});
|
|
1958
|
-
agGrid.sortChanged.pipe(takeUntil(this
|
|
2045
|
+
agGrid.sortChanged.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_ngUnsubscribe, "f"))).subscribe(() => {
|
|
1959
2046
|
const gridColumnStates = agGrid.columnApi.getColumnState();
|
|
1960
2047
|
let sortOption;
|
|
1961
2048
|
/* istanbul ignore else */
|
|
1962
2049
|
if (gridColumnStates.length) {
|
|
1963
2050
|
const activeSortColumnState = gridColumnStates.find((aGridColumnState) => aGridColumnState.sortIndex === 0);
|
|
1964
|
-
const dataManagerConfig = this.
|
|
2051
|
+
const dataManagerConfig = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").getCurrentDataManagerConfig();
|
|
1965
2052
|
/* istanbul ignore else */
|
|
1966
2053
|
if (dataManagerConfig.sortOptions && activeSortColumnState) {
|
|
1967
2054
|
sortOption = dataManagerConfig.sortOptions.find((option) => {
|
|
@@ -1973,34 +2060,38 @@ class SkyAgGridDataManagerAdapterDirective {
|
|
|
1973
2060
|
sortOption = undefined;
|
|
1974
2061
|
}
|
|
1975
2062
|
}
|
|
1976
|
-
this
|
|
1977
|
-
|
|
2063
|
+
if (__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f") && __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f")) {
|
|
2064
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f").activeSortOption = sortOption;
|
|
2065
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").updateDataState(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f"), __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").id);
|
|
2066
|
+
}
|
|
1978
2067
|
});
|
|
1979
2068
|
}
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
const
|
|
1983
|
-
|
|
1984
|
-
|
|
2069
|
+
}, _SkyAgGridDataManagerAdapterDirective_updateColumnsInCurrentDataState = function _SkyAgGridDataManagerAdapterDirective_updateColumnsInCurrentDataState(columnApi) {
|
|
2070
|
+
if (__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f") && __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f")) {
|
|
2071
|
+
const columnOrder = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_getColumnOrder).call(this, columnApi);
|
|
2072
|
+
const viewState = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f").getViewStateById(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").id);
|
|
2073
|
+
if (viewState &&
|
|
2074
|
+
(viewState.displayedColumnIds.length !== columnOrder.length ||
|
|
2075
|
+
viewState.displayedColumnIds.some((col, i) => col !== columnOrder[i]))) {
|
|
1985
2076
|
viewState.displayedColumnIds = columnOrder;
|
|
1986
|
-
this.
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
const viewState = dataState.getViewStateById(this.
|
|
2077
|
+
__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_dataManagerSvc, "f").updateDataState(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentDataState, "f").addOrUpdateView(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").id, viewState), __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").id);
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
}, _SkyAgGridDataManagerAdapterDirective_getColumnOrder = function _SkyAgGridDataManagerAdapterDirective_getColumnOrder(columnApi) {
|
|
2081
|
+
return columnApi
|
|
2082
|
+
.getColumnState()
|
|
2083
|
+
.filter((state) => !state.hide)
|
|
2084
|
+
.map((state) => state.colId);
|
|
2085
|
+
}, _SkyAgGridDataManagerAdapterDirective_displayColumns = function _SkyAgGridDataManagerAdapterDirective_displayColumns(dataState) {
|
|
2086
|
+
const agGrid = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_currentAgGrid, "f");
|
|
2087
|
+
if (agGrid && __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f")) {
|
|
2088
|
+
const viewState = dataState.getViewStateById(__classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_viewConfig, "f").id);
|
|
1998
2089
|
let displayedColumnIds = [];
|
|
1999
2090
|
/*istanbul ignore else*/
|
|
2000
|
-
if (viewState.displayedColumnIds) {
|
|
2091
|
+
if (viewState === null || viewState === void 0 ? void 0 : viewState.displayedColumnIds) {
|
|
2001
2092
|
displayedColumnIds = viewState.displayedColumnIds;
|
|
2002
2093
|
}
|
|
2003
|
-
const columnOrder = this.
|
|
2094
|
+
const columnOrder = __classPrivateFieldGet(this, _SkyAgGridDataManagerAdapterDirective_instances, "m", _SkyAgGridDataManagerAdapterDirective_getColumnOrder).call(this, agGrid.columnApi);
|
|
2004
2095
|
if (displayedColumnIds.length !== columnOrder.length ||
|
|
2005
2096
|
displayedColumnIds.some((col, i) => col !== columnOrder[i])) {
|
|
2006
2097
|
const hideColumns = agGrid.columnApi
|
|
@@ -2012,15 +2103,15 @@ class SkyAgGridDataManagerAdapterDirective {
|
|
|
2012
2103
|
agGrid.columnApi.moveColumns(displayedColumnIds, 0);
|
|
2013
2104
|
}
|
|
2014
2105
|
}
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
}
|
|
2106
|
+
}, _SkyAgGridDataManagerAdapterDirective_selectAll = function _SkyAgGridDataManagerAdapterDirective_selectAll() {
|
|
2107
|
+
var _a;
|
|
2108
|
+
const agGrid = (_a = this.agGridList) === null || _a === void 0 ? void 0 : _a.first;
|
|
2109
|
+
agGrid === null || agGrid === void 0 ? void 0 : agGrid.api.selectAll();
|
|
2110
|
+
}, _SkyAgGridDataManagerAdapterDirective_clearAll = function _SkyAgGridDataManagerAdapterDirective_clearAll() {
|
|
2111
|
+
var _a;
|
|
2112
|
+
const agGrid = (_a = this.agGridList) === null || _a === void 0 ? void 0 : _a.first;
|
|
2113
|
+
agGrid === null || agGrid === void 0 ? void 0 : agGrid.api.deselectAll();
|
|
2114
|
+
};
|
|
2024
2115
|
SkyAgGridDataManagerAdapterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridDataManagerAdapterDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$4.SkyDataManagerService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2025
2116
|
SkyAgGridDataManagerAdapterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridDataManagerAdapterDirective, selector: "[skyAgGridDataManagerAdapter]", inputs: { viewId: "viewId" }, queries: [{ propertyName: "agGridList", predicate: AgGridAngular, descendants: true }, { propertyName: "skyAgGridWrapperList", predicate: SkyAgGridWrapperComponent, descendants: true }], ngImport: i0 });
|
|
2026
2117
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridDataManagerAdapterDirective, decorators: [{
|
|
@@ -2111,13 +2202,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2111
2202
|
args: ['inlineDeleteTemplateRef', { read: TemplateRef }]
|
|
2112
2203
|
}] } });
|
|
2113
2204
|
|
|
2205
|
+
var _SkyAgGridRowDeleteDirective_instances, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, _SkyAgGridRowDeleteDirective_ngUnsubscribe, _SkyAgGridRowDeleteDirective_rowDeleteComponent, _SkyAgGridRowDeleteDirective_rowDeleteContents, _SkyAgGridRowDeleteDirective_rowDeleteIdsInternal, _SkyAgGridRowDeleteDirective_affixService, _SkyAgGridRowDeleteDirective_changeDetector, _SkyAgGridRowDeleteDirective_elementRef, _SkyAgGridRowDeleteDirective_overlayService, _SkyAgGridRowDeleteDirective_viewContainerRef, _SkyAgGridRowDeleteDirective_affixToRow, _SkyAgGridRowDeleteDirective_destroyRowDelete, _SkyAgGridRowDeleteDirective_updateRowDeleteStates;
|
|
2114
2206
|
class SkyAgGridRowDeleteDirective {
|
|
2115
2207
|
constructor(affixService, changeDetector, elementRef, overlayService, viewContainerRef) {
|
|
2116
|
-
this
|
|
2117
|
-
this.changeDetector = changeDetector;
|
|
2118
|
-
this.elementRef = elementRef;
|
|
2119
|
-
this.overlayService = overlayService;
|
|
2120
|
-
this.viewContainerRef = viewContainerRef;
|
|
2208
|
+
_SkyAgGridRowDeleteDirective_instances.add(this);
|
|
2121
2209
|
/**
|
|
2122
2210
|
* Emits a `SkyAgGridRowDeleteCancelArgs` object when a row's inline delete is cancelled.
|
|
2123
2211
|
*/
|
|
@@ -2130,48 +2218,61 @@ class SkyAgGridRowDeleteDirective {
|
|
|
2130
2218
|
* Emits when the list of ids of the data in the rows where inline deletes are shown changes.
|
|
2131
2219
|
*/
|
|
2132
2220
|
this.rowDeleteIdsChange = new EventEmitter();
|
|
2133
|
-
this
|
|
2134
|
-
this
|
|
2135
|
-
this
|
|
2221
|
+
_SkyAgGridRowDeleteDirective_rowDeleteConfigs.set(this, []);
|
|
2222
|
+
_SkyAgGridRowDeleteDirective_ngUnsubscribe.set(this, new Subject());
|
|
2223
|
+
_SkyAgGridRowDeleteDirective_rowDeleteComponent.set(this, void 0);
|
|
2224
|
+
_SkyAgGridRowDeleteDirective_rowDeleteContents.set(this, {});
|
|
2225
|
+
_SkyAgGridRowDeleteDirective_rowDeleteIdsInternal.set(this, void 0);
|
|
2226
|
+
_SkyAgGridRowDeleteDirective_affixService.set(this, void 0);
|
|
2227
|
+
_SkyAgGridRowDeleteDirective_changeDetector.set(this, void 0);
|
|
2228
|
+
_SkyAgGridRowDeleteDirective_elementRef.set(this, void 0);
|
|
2229
|
+
_SkyAgGridRowDeleteDirective_overlayService.set(this, void 0);
|
|
2230
|
+
_SkyAgGridRowDeleteDirective_viewContainerRef.set(this, void 0);
|
|
2231
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_affixService, affixService, "f");
|
|
2232
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_changeDetector, changeDetector, "f");
|
|
2233
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_elementRef, elementRef, "f");
|
|
2234
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_overlayService, overlayService, "f");
|
|
2235
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_viewContainerRef, viewContainerRef, "f");
|
|
2136
2236
|
}
|
|
2137
2237
|
/**
|
|
2138
2238
|
* Specifies the ids of the data in the rows on which inline delete's should be shown.
|
|
2139
2239
|
*/
|
|
2140
2240
|
set rowDeleteIds(value) {
|
|
2141
|
-
this
|
|
2241
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_rowDeleteIdsInternal, value, "f");
|
|
2142
2242
|
if (!value) {
|
|
2143
|
-
for (const config of this
|
|
2144
|
-
this.
|
|
2243
|
+
for (const config of __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f")) {
|
|
2244
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_destroyRowDelete).call(this, config.id);
|
|
2145
2245
|
}
|
|
2146
|
-
this.
|
|
2246
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_changeDetector, "f").markForCheck();
|
|
2147
2247
|
return;
|
|
2148
2248
|
}
|
|
2149
2249
|
for (const id of value) {
|
|
2150
|
-
const existingConfig = this.
|
|
2250
|
+
const existingConfig = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f").find((config) => config.id === id);
|
|
2151
2251
|
if (existingConfig) {
|
|
2152
2252
|
existingConfig.pending = false;
|
|
2153
2253
|
}
|
|
2154
|
-
else {
|
|
2155
|
-
this.
|
|
2254
|
+
else if (__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteComponent, "f") && this.agGrid) {
|
|
2255
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f").push({
|
|
2156
2256
|
id: id,
|
|
2157
2257
|
pending: false,
|
|
2158
2258
|
});
|
|
2159
|
-
const overlay = this.
|
|
2259
|
+
const overlay = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_overlayService, "f").create({
|
|
2160
2260
|
enableScroll: true,
|
|
2161
2261
|
showBackdrop: false,
|
|
2162
2262
|
closeOnNavigation: true,
|
|
2163
2263
|
enableClose: false,
|
|
2164
2264
|
enablePointerEvents: true,
|
|
2165
2265
|
});
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2266
|
+
if (__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteComponent, "f").inlineDeleteTemplateRef) {
|
|
2267
|
+
overlay.attachTemplate(__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteComponent, "f").inlineDeleteTemplateRef, {
|
|
2268
|
+
$implicit: this.agGrid.api.getRowNode(id),
|
|
2269
|
+
tableWidth: () => __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_elementRef, "f").nativeElement.querySelector('.sky-ag-grid')
|
|
2270
|
+
.offsetWidth,
|
|
2271
|
+
getRowDeleteItem: (row) => this.getRowDeleteItem(row),
|
|
2272
|
+
cancelRowDelete: (row) => this.cancelRowDelete(row),
|
|
2273
|
+
confirmRowDelete: (row) => this.confirmRowDelete(row),
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2175
2276
|
/**
|
|
2176
2277
|
* We are manually setting the z-index here because overlays will always be on top of
|
|
2177
2278
|
* the omnibar. This manual setting is 2 less than the omnibar's z-index of 1000 and one less than
|
|
@@ -2180,125 +2281,126 @@ class SkyAgGridRowDeleteDirective {
|
|
|
2180
2281
|
*/
|
|
2181
2282
|
overlay.componentRef.instance.zIndex = '998';
|
|
2182
2283
|
setTimeout(() => {
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
const affixer = this.affixService.createAffixer(inlineDeleteRef);
|
|
2189
|
-
this.affixToRow(affixer, id);
|
|
2190
|
-
this.rowDeleteContents[id] = {
|
|
2284
|
+
var _a, _b;
|
|
2285
|
+
const inlineDeleteRef = (_b = (_a = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteComponent, "f")) === null || _a === void 0 ? void 0 : _a.inlineDeleteRefs) === null || _b === void 0 ? void 0 : _b.toArray().find((elRef) => elRef.nativeElement.id === 'row-delete-ref-' + id);
|
|
2286
|
+
const affixer = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_affixService, "f").createAffixer(inlineDeleteRef);
|
|
2287
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_affixToRow).call(this, affixer, id);
|
|
2288
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteContents, "f")[id] = {
|
|
2191
2289
|
affixer: affixer,
|
|
2192
2290
|
overlay: overlay,
|
|
2193
2291
|
};
|
|
2194
2292
|
});
|
|
2195
2293
|
}
|
|
2196
2294
|
}
|
|
2197
|
-
for (const config of this
|
|
2295
|
+
for (const config of __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f")) {
|
|
2198
2296
|
if (value.indexOf(config.id) < 0) {
|
|
2199
|
-
this.
|
|
2297
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_destroyRowDelete).call(this, config.id);
|
|
2200
2298
|
}
|
|
2201
2299
|
}
|
|
2202
|
-
this.
|
|
2300
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_changeDetector, "f").markForCheck();
|
|
2203
2301
|
}
|
|
2204
2302
|
get rowDeleteIds() {
|
|
2205
|
-
return this
|
|
2206
|
-
}
|
|
2207
|
-
get tableWidth() {
|
|
2208
|
-
return this.elementRef.nativeElement.querySelectorAll('.sky-ag-grid')[0]
|
|
2209
|
-
.offsetWidth;
|
|
2303
|
+
return __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteIdsInternal, "f");
|
|
2210
2304
|
}
|
|
2211
2305
|
ngAfterContentInit() {
|
|
2212
|
-
this
|
|
2213
|
-
this.agGrid
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2306
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_rowDeleteComponent, __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_viewContainerRef, "f").createComponent(SkyAgGridRowDeleteComponent).instance, "f");
|
|
2307
|
+
if (this.agGrid) {
|
|
2308
|
+
this.agGrid.rowDataUpdated
|
|
2309
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_ngUnsubscribe, "f")))
|
|
2310
|
+
.subscribe(() => {
|
|
2311
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_updateRowDeleteStates).call(this);
|
|
2312
|
+
});
|
|
2313
|
+
this.agGrid.sortChanged
|
|
2314
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_ngUnsubscribe, "f")))
|
|
2315
|
+
.subscribe(() => {
|
|
2316
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_updateRowDeleteStates).call(this);
|
|
2317
|
+
});
|
|
2318
|
+
this.agGrid.filterChanged
|
|
2319
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_ngUnsubscribe, "f")))
|
|
2320
|
+
.subscribe(() => {
|
|
2321
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_updateRowDeleteStates).call(this);
|
|
2322
|
+
});
|
|
2323
|
+
}
|
|
2228
2324
|
}
|
|
2229
2325
|
ngOnDestroy() {
|
|
2230
|
-
this.
|
|
2231
|
-
this.
|
|
2232
|
-
Object.keys(this
|
|
2233
|
-
this.
|
|
2326
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_ngUnsubscribe, "f").next();
|
|
2327
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_ngUnsubscribe, "f").complete();
|
|
2328
|
+
Object.keys(__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteContents, "f")).forEach((id) => {
|
|
2329
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_destroyRowDelete).call(this, id);
|
|
2234
2330
|
});
|
|
2235
2331
|
}
|
|
2236
2332
|
cancelRowDelete(row) {
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2333
|
+
if (row.id) {
|
|
2334
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f").filter((config) => config.id !== row.id), "f");
|
|
2335
|
+
this.rowDeleteCancel.emit({ id: row.id });
|
|
2336
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_destroyRowDelete).call(this, row.id);
|
|
2337
|
+
}
|
|
2240
2338
|
}
|
|
2241
2339
|
confirmRowDelete(row) {
|
|
2242
|
-
|
|
2243
|
-
|
|
2340
|
+
if (row.id) {
|
|
2341
|
+
const rowConfig = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f").find((config) => config.id === row.id);
|
|
2342
|
+
if (rowConfig) {
|
|
2343
|
+
rowConfig.pending = true;
|
|
2344
|
+
this.rowDeleteConfirm.emit({ id: row.id });
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2244
2347
|
}
|
|
2245
2348
|
getRowDeleteItem(row) {
|
|
2246
|
-
return this.
|
|
2349
|
+
return __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f").find((rowDelete) => rowDelete.id === row.id);
|
|
2247
2350
|
}
|
|
2248
|
-
|
|
2249
|
-
|
|
2351
|
+
}
|
|
2352
|
+
_SkyAgGridRowDeleteDirective_rowDeleteConfigs = new WeakMap(), _SkyAgGridRowDeleteDirective_ngUnsubscribe = new WeakMap(), _SkyAgGridRowDeleteDirective_rowDeleteComponent = new WeakMap(), _SkyAgGridRowDeleteDirective_rowDeleteContents = new WeakMap(), _SkyAgGridRowDeleteDirective_rowDeleteIdsInternal = new WeakMap(), _SkyAgGridRowDeleteDirective_affixService = new WeakMap(), _SkyAgGridRowDeleteDirective_changeDetector = new WeakMap(), _SkyAgGridRowDeleteDirective_elementRef = new WeakMap(), _SkyAgGridRowDeleteDirective_overlayService = new WeakMap(), _SkyAgGridRowDeleteDirective_viewContainerRef = new WeakMap(), _SkyAgGridRowDeleteDirective_instances = new WeakSet(), _SkyAgGridRowDeleteDirective_affixToRow = function _SkyAgGridRowDeleteDirective_affixToRow(affixer, id) {
|
|
2353
|
+
let rowElement = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_elementRef, "f").nativeElement.querySelector(`
|
|
2250
2354
|
[row-id="${id}"] div[aria-colindex="1"],
|
|
2251
2355
|
.ag-row.sky-ag-grid-row-${id} div[aria-colindex="1"]
|
|
2252
2356
|
`);
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
}
|
|
2357
|
+
// This covers cases where AG Grid places the column index on an inner element (such as with the `enableCellTextSelection` option)
|
|
2358
|
+
// This appears to have been fixed by AG Grid in version 24 and so it is not testable after that version.
|
|
2359
|
+
/* istanbul ignore if */
|
|
2360
|
+
if (!rowElement) {
|
|
2361
|
+
const columns = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_elementRef, "f").nativeElement.querySelectorAll('[row-id="' + id + '"] > div');
|
|
2362
|
+
for (let i = 0; i < columns.length; i++) {
|
|
2363
|
+
if (columns[i].querySelector('[aria-colindex="1"]')) {
|
|
2364
|
+
rowElement = columns[i];
|
|
2365
|
+
break;
|
|
2263
2366
|
}
|
|
2264
2367
|
}
|
|
2265
|
-
affixer.affixTo(rowElement, {
|
|
2266
|
-
autoFitContext: SkyAffixAutoFitContext.Viewport,
|
|
2267
|
-
isSticky: true,
|
|
2268
|
-
placement: 'above',
|
|
2269
|
-
verticalAlignment: 'top',
|
|
2270
|
-
horizontalAlignment: 'left',
|
|
2271
|
-
enableAutoFit: false,
|
|
2272
|
-
});
|
|
2273
2368
|
}
|
|
2274
|
-
|
|
2369
|
+
affixer.affixTo(rowElement, {
|
|
2370
|
+
autoFitContext: SkyAffixAutoFitContext.Viewport,
|
|
2371
|
+
isSticky: true,
|
|
2372
|
+
placement: 'above',
|
|
2373
|
+
verticalAlignment: 'top',
|
|
2374
|
+
horizontalAlignment: 'left',
|
|
2375
|
+
enableAutoFit: false,
|
|
2376
|
+
});
|
|
2377
|
+
}, _SkyAgGridRowDeleteDirective_destroyRowDelete = function _SkyAgGridRowDeleteDirective_destroyRowDelete(id) {
|
|
2378
|
+
var _a;
|
|
2379
|
+
const rowDeleteContents = __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteContents, "f")[id];
|
|
2380
|
+
/* sanity check */
|
|
2381
|
+
/* istanbul ignore else */
|
|
2382
|
+
if (rowDeleteContents) {
|
|
2383
|
+
rowDeleteContents.affixer.destroy();
|
|
2384
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_overlayService, "f").close(rowDeleteContents.overlay);
|
|
2385
|
+
delete __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteContents, "f")[id];
|
|
2386
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f").filter((config) => config.id !== id), "f");
|
|
2387
|
+
__classPrivateFieldSet(this, _SkyAgGridRowDeleteDirective_rowDeleteIdsInternal, (_a = this.rowDeleteIds) === null || _a === void 0 ? void 0 : _a.filter((arrayId) => arrayId !== id), "f");
|
|
2388
|
+
this.rowDeleteIdsChange.emit(__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteIdsInternal, "f"));
|
|
2389
|
+
}
|
|
2390
|
+
}, _SkyAgGridRowDeleteDirective_updateRowDeleteStates = function _SkyAgGridRowDeleteDirective_updateRowDeleteStates() {
|
|
2391
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteConfigs, "f").forEach((config) => {
|
|
2275
2392
|
var _a;
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
}
|
|
2288
|
-
updateRowDeleteStates() {
|
|
2289
|
-
this.rowDeleteConfigs.forEach((config) => {
|
|
2290
|
-
if (!this.agGrid.api.getRowNode(config.id)) {
|
|
2291
|
-
this.destroyRowDelete(config.id);
|
|
2292
|
-
}
|
|
2293
|
-
else {
|
|
2294
|
-
// We must reaffix things when the data changes because the rows rerender and the previous element that the delete was affixed
|
|
2295
|
-
// to is destroyed.
|
|
2296
|
-
this.affixToRow(this.rowDeleteContents[config.id].affixer, config.id);
|
|
2297
|
-
}
|
|
2298
|
-
});
|
|
2299
|
-
this.changeDetector.markForCheck();
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2393
|
+
if (!((_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.api.getRowNode(config.id))) {
|
|
2394
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_destroyRowDelete).call(this, config.id);
|
|
2395
|
+
}
|
|
2396
|
+
else {
|
|
2397
|
+
// We must reaffix things when the data changes because the rows rerender and the previous element that the delete was affixed
|
|
2398
|
+
// to is destroyed.
|
|
2399
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_instances, "m", _SkyAgGridRowDeleteDirective_affixToRow).call(this, __classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_rowDeleteContents, "f")[config.id].affixer, config.id);
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2402
|
+
__classPrivateFieldGet(this, _SkyAgGridRowDeleteDirective_changeDetector, "f").markForCheck();
|
|
2403
|
+
};
|
|
2302
2404
|
SkyAgGridRowDeleteDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridRowDeleteDirective, deps: [{ token: i1.SkyAffixService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.SkyOverlayService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2303
2405
|
SkyAgGridRowDeleteDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.0", type: SkyAgGridRowDeleteDirective, selector: "[skyAgGridRowDelete]", inputs: { rowDeleteIds: "rowDeleteIds" }, outputs: { rowDeleteCancel: "rowDeleteCancel", rowDeleteConfirm: "rowDeleteConfirm", rowDeleteIdsChange: "rowDeleteIdsChange" }, queries: [{ propertyName: "agGrid", first: true, predicate: AgGridAngular, descendants: true }], ngImport: i0 });
|
|
2304
2406
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyAgGridRowDeleteDirective, decorators: [{
|
|
@@ -2696,5 +2798,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
|
2696
2798
|
* Generated bundle index. Do not edit.
|
|
2697
2799
|
*/
|
|
2698
2800
|
|
|
2699
|
-
export { SkyAgGridCellEditorInitialAction, SkyAgGridCellEditorUtils, SkyAgGridHeaderGroupInfo, SkyAgGridHeaderInfo, SkyAgGridModule, SkyAgGridService,
|
|
2801
|
+
export { SkyAgGridCellEditorInitialAction, SkyAgGridCellEditorUtils, SkyAgGridHeaderGroupInfo, SkyAgGridHeaderInfo, SkyAgGridModule, SkyAgGridService, SkyCellType, SkyHeaderClass, SkyAgGridCellEditorAutocompleteComponent as λ1, SkyAgGridCellRendererValidatorTooltipComponent as λ10, SkyAgGridCellValidatorTooltipComponent as λ11, SkyAgGridWrapperComponent as λ12, SkyAgGridRowDeleteDirective as λ13, SkyAgGridDataManagerAdapterDirective as λ14, SkyAgGridCellEditorLookupComponent as λ15, SkyAgGridCellRendererLookupComponent as λ16, SkyAgGridHeaderComponent as λ17, SkyAgGridHeaderGroupComponent as λ18, SkyAgGridCellEditorTextComponent as λ2, SkyAgGridCellEditorCurrencyComponent as λ3, SkyAgGridCellEditorNumberComponent as λ4, SkyAgGridCellEditorDatepickerComponent as λ5, SkyAgGridRowDeleteComponent as λ6, SkyAgGridCellRendererRowSelectorComponent as λ7, SkyAgGridCellRendererCurrencyValidatorComponent as λ8, SkyAgGridCellRendererCurrencyComponent as λ9 };
|
|
2700
2802
|
//# sourceMappingURL=skyux-ag-grid.mjs.map
|