@skyux/ag-grid 5.7.2 → 6.0.0-beta.2
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 +2 -2
- package/esm2020/index.mjs +28 -0
- package/esm2020/lib/modules/ag-grid/ag-grid-adapter.service.mjs +55 -0
- package/esm2020/lib/modules/ag-grid/ag-grid-data-manager-adapter.directive.mjs +211 -0
- package/esm2020/lib/modules/ag-grid/ag-grid-row-delete.component.mjs +77 -0
- package/esm2020/lib/modules/ag-grid/ag-grid-row-delete.directive.mjs +229 -0
- package/esm2020/lib/modules/ag-grid/ag-grid-wrapper.component.mjs +92 -0
- package/esm2020/lib/modules/ag-grid/ag-grid.module.mjs +101 -0
- package/esm2020/lib/modules/ag-grid/ag-grid.service.mjs +408 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.mjs +36 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.mjs +20 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.mjs +52 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.mjs +20 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.mjs +70 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.mjs +19 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.mjs +68 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.module.mjs +38 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.mjs +44 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.mjs +19 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.mjs +44 -0
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.module.mjs +19 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency-validator.component.mjs +39 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.component.mjs +48 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.module.mjs +47 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.mjs +29 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.module.mjs +19 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.component.mjs +62 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.module.mjs +20 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.component.mjs +36 -0
- package/esm2020/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.module.mjs +18 -0
- package/esm2020/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator-tooltip.component.mjs +78 -0
- package/esm2020/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator.module.mjs +20 -0
- package/esm2020/lib/modules/ag-grid/types/ag-grid-row-delete-cancel-args.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/ag-grid-row-delete-config.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/ag-grid-row-delete-confirm-args.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/ag-grid-row-delete-contents.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/autocomplete-properties.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-class.mjs +17 -0
- package/esm2020/lib/modules/ag-grid/types/cell-editor-autocomplete-params.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-editor-currency-params.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-editor-datepicker-params.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-editor-lookup-params.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-renderer-currency-params.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-renderer-lookup-params.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-renderer-validator-params.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/cell-type.mjs +93 -0
- package/esm2020/lib/modules/ag-grid/types/currency-properties.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/datepicker-properties.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/header-class.mjs +8 -0
- package/esm2020/lib/modules/ag-grid/types/lookup-properties.mjs +26 -0
- package/esm2020/lib/modules/ag-grid/types/sky-grid-options.mjs +2 -0
- package/esm2020/lib/modules/ag-grid/types/validator-options.mjs +2 -0
- package/esm2020/lib/modules/shared/sky-ag-grid-resources.module.mjs +71 -0
- package/esm2020/skyux-ag-grid.mjs +5 -0
- package/fesm2015/{skyux-ag-grid.js → skyux-ag-grid.mjs} +176 -248
- package/fesm2015/skyux-ag-grid.mjs.map +1 -0
- package/fesm2020/skyux-ag-grid.mjs +2084 -0
- package/fesm2020/skyux-ag-grid.mjs.map +1 -0
- package/package.json +37 -21
- package/bundles/skyux-ag-grid.umd.js +0 -2569
- package/esm2015/index.js +0 -28
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/ag-grid-adapter.service.js +0 -55
- package/esm2015/lib/modules/ag-grid/ag-grid-adapter.service.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/ag-grid-data-manager-adapter.directive.js +0 -211
- package/esm2015/lib/modules/ag-grid/ag-grid-data-manager-adapter.directive.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/ag-grid-row-delete.component.js +0 -77
- package/esm2015/lib/modules/ag-grid/ag-grid-row-delete.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/ag-grid-row-delete.directive.js +0 -230
- package/esm2015/lib/modules/ag-grid/ag-grid-row-delete.directive.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/ag-grid-wrapper.component.js +0 -96
- package/esm2015/lib/modules/ag-grid/ag-grid-wrapper.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/ag-grid.module.js +0 -122
- package/esm2015/lib/modules/ag-grid/ag-grid.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/ag-grid.service.js +0 -355
- package/esm2015/lib/modules/ag-grid/ag-grid.service.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.js +0 -41
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.js +0 -20
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.js +0 -57
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.js +0 -20
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.js +0 -77
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.js +0 -19
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.js +0 -74
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.module.js +0 -38
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.js +0 -49
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.js +0 -19
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.js +0 -49
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.module.js +0 -19
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency-validator.component.js +0 -43
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency-validator.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.component.js +0 -54
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.module.js +0 -47
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-currency/cell-renderer-currency.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.js +0 -35
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.module.js +0 -19
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.component.js +0 -68
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.module.js +0 -20
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.component.js +0 -41
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.module.js +0 -18
- package/esm2015/lib/modules/ag-grid/cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator-tooltip.component.js +0 -83
- package/esm2015/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator-tooltip.component.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator.module.js +0 -20
- package/esm2015/lib/modules/ag-grid/cell-validator/ag-grid-cell-validator.module.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-cancel-args.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-cancel-args.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-config.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-config.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-confirm-args.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-confirm-args.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-contents.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/ag-grid-row-delete-contents.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/autocomplete-properties.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/autocomplete-properties.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-class.js +0 -17
- package/esm2015/lib/modules/ag-grid/types/cell-class.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-editor-autocomplete-params.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/cell-editor-autocomplete-params.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-editor-currency-params.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/cell-editor-currency-params.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-editor-datepicker-params.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/cell-editor-datepicker-params.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-editor-lookup-params.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/cell-editor-lookup-params.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-renderer-currency-params.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/cell-renderer-currency-params.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-renderer-lookup-params.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/cell-renderer-lookup-params.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-renderer-validator-params.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/cell-renderer-validator-params.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/cell-type.js +0 -93
- package/esm2015/lib/modules/ag-grid/types/cell-type.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/currency-properties.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/currency-properties.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/datepicker-properties.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/datepicker-properties.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/header-class.js +0 -8
- package/esm2015/lib/modules/ag-grid/types/header-class.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/lookup-properties.js +0 -26
- package/esm2015/lib/modules/ag-grid/types/lookup-properties.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/sky-grid-options.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/sky-grid-options.js.map +0 -1
- package/esm2015/lib/modules/ag-grid/types/validator-options.js +0 -2
- package/esm2015/lib/modules/ag-grid/types/validator-options.js.map +0 -1
- package/esm2015/lib/modules/shared/sky-ag-grid-resources.module.js +0 -71
- package/esm2015/lib/modules/shared/sky-ag-grid-resources.module.js.map +0 -1
- package/esm2015/skyux-ag-grid.js +0 -5
- package/esm2015/skyux-ag-grid.js.map +0 -1
- package/fesm2015/skyux-ag-grid.js.map +0 -1
|
@@ -0,0 +1,2084 @@
|
|
|
1
|
+
import * as i3 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Injectable, Component, ChangeDetectionStrategy, ContentChild, Directive, Input, ContentChildren, TemplateRef, ViewChildren, ViewChild, EventEmitter, Output, NgModule, ElementRef, ViewEncapsulation, Optional } from '@angular/core';
|
|
5
|
+
import * as i1 from '@skyux/core';
|
|
6
|
+
import { SkyAffixAutoFitContext, SkyNumericModule, SkyViewkeeperModule } from '@skyux/core';
|
|
7
|
+
import * as i1$1 from '@skyux/data-manager';
|
|
8
|
+
import { SkyDataManagerModule } from '@skyux/data-manager';
|
|
9
|
+
import * as i1$2 from '@skyux/layout';
|
|
10
|
+
import { SkyInlineDeleteModule } from '@skyux/layout';
|
|
11
|
+
import { AgGridAngular, AgGridModule } from 'ag-grid-angular';
|
|
12
|
+
import { Subject } from 'rxjs';
|
|
13
|
+
import { takeUntil, filter } from 'rxjs/operators';
|
|
14
|
+
import * as i1$4 from '@angular/forms';
|
|
15
|
+
import { FormsModule, FormGroup, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
16
|
+
import * as i1$3 from '@skyux/lookup';
|
|
17
|
+
import { SkyAutocompleteModule, SkyLookupModule } from '@skyux/lookup';
|
|
18
|
+
import * as i3$1 from '@skyux/i18n';
|
|
19
|
+
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
20
|
+
import * as i2 from '@skyux/autonumeric';
|
|
21
|
+
import { SkyAutonumericModule } from '@skyux/autonumeric';
|
|
22
|
+
import * as i2$1 from '@skyux/datetime';
|
|
23
|
+
import { SkyDatepickerModule } from '@skyux/datetime';
|
|
24
|
+
import * as i1$5 from '@skyux/theme';
|
|
25
|
+
import { PopupComponent, Events, RowNode } from 'ag-grid-community';
|
|
26
|
+
import * as i1$6 from '@skyux/forms';
|
|
27
|
+
import { SkyInputBoxModule, SkyCheckboxModule } from '@skyux/forms';
|
|
28
|
+
import * as i1$7 from '@skyux/indicators';
|
|
29
|
+
import { SkyStatusIndicatorModule } from '@skyux/indicators';
|
|
30
|
+
import * as i2$2 from '@skyux/popovers';
|
|
31
|
+
import { SkyPopoverMessageType, SkyPopoverModule } from '@skyux/popovers';
|
|
32
|
+
|
|
33
|
+
class SkyAgGridAdapterService {
|
|
34
|
+
constructor(skyAdapterService) {
|
|
35
|
+
this.skyAdapterService = skyAdapterService;
|
|
36
|
+
}
|
|
37
|
+
getElementOrParentWithClass(element, className) {
|
|
38
|
+
if (element && element.classList.contains(className)) {
|
|
39
|
+
return element;
|
|
40
|
+
}
|
|
41
|
+
else if (element.parentElement) {
|
|
42
|
+
return this.getElementOrParentWithClass(element.parentElement, className);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
setFocusedElementById(parentEl, selector) {
|
|
46
|
+
const element = parentEl.querySelector(`#${selector}`);
|
|
47
|
+
/* istanbul ignore else */
|
|
48
|
+
if (element) {
|
|
49
|
+
element.focus();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
getFocusedElement() {
|
|
53
|
+
return document.activeElement;
|
|
54
|
+
}
|
|
55
|
+
getNextFocusableElement(currentEl, parentEl, moveFocusLeft) {
|
|
56
|
+
if (parentEl) {
|
|
57
|
+
const focusableChildren = this.skyAdapterService.getFocusableChildren(parentEl);
|
|
58
|
+
const currentElementIndex = focusableChildren.indexOf(currentEl);
|
|
59
|
+
const nextIndex = moveFocusLeft
|
|
60
|
+
? currentElementIndex - 1
|
|
61
|
+
: currentElementIndex + 1;
|
|
62
|
+
if ((!moveFocusLeft && focusableChildren.length >= nextIndex) ||
|
|
63
|
+
(moveFocusLeft && nextIndex >= 0)) {
|
|
64
|
+
return focusableChildren[nextIndex];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
focusOnFocusableChildren(element) {
|
|
69
|
+
const focusableChildren = this.skyAdapterService.getFocusableChildren(element);
|
|
70
|
+
if (focusableChildren.length) {
|
|
71
|
+
focusableChildren[0].focus();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
SkyAgGridAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridAdapterService, deps: [{ token: i1.SkyCoreAdapterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
76
|
+
SkyAgGridAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridAdapterService, providedIn: 'root' });
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridAdapterService, decorators: [{
|
|
78
|
+
type: Injectable,
|
|
79
|
+
args: [{
|
|
80
|
+
providedIn: 'root',
|
|
81
|
+
}]
|
|
82
|
+
}], ctorParameters: function () { return [{ type: i1.SkyCoreAdapterService }]; } });
|
|
83
|
+
|
|
84
|
+
let idIndex = 0;
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
class SkyAgGridWrapperComponent {
|
|
89
|
+
constructor(adapterService, changeDetector, elementRef) {
|
|
90
|
+
this.adapterService = adapterService;
|
|
91
|
+
this.changeDetector = changeDetector;
|
|
92
|
+
this.elementRef = elementRef;
|
|
93
|
+
this._viewkeeperClasses = [];
|
|
94
|
+
idIndex++;
|
|
95
|
+
this.afterAnchorId = 'sky-ag-grid-nav-anchor-after-' + idIndex;
|
|
96
|
+
this.beforeAnchorId = 'sky-ag-grid-nav-anchor-before-' + idIndex;
|
|
97
|
+
this.gridId = 'sky-ag-grid-' + idIndex;
|
|
98
|
+
}
|
|
99
|
+
get viewkeeperClasses() {
|
|
100
|
+
return this._viewkeeperClasses;
|
|
101
|
+
}
|
|
102
|
+
set viewkeeperClasses(value) {
|
|
103
|
+
this._viewkeeperClasses = value;
|
|
104
|
+
this.changeDetector.markForCheck();
|
|
105
|
+
}
|
|
106
|
+
ngAfterContentInit() {
|
|
107
|
+
if (this.agGrid.gridOptions &&
|
|
108
|
+
this.agGrid.gridOptions.domLayout === 'autoHeight') {
|
|
109
|
+
this.viewkeeperClasses.push('.ag-header');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
onGridKeydown(event) {
|
|
113
|
+
if (this.agGrid && !this.isInEditMode && event.key === 'Tab') {
|
|
114
|
+
const idToFocus = event.shiftKey
|
|
115
|
+
? this.beforeAnchorId
|
|
116
|
+
: this.afterAnchorId;
|
|
117
|
+
this.adapterService.setFocusedElementById(this.elementRef.nativeElement, idToFocus);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
onAnchorFocus(event) {
|
|
121
|
+
const gridId = this.gridId;
|
|
122
|
+
const relatedTarget = event.relatedTarget;
|
|
123
|
+
const previousFocusedId = relatedTarget && relatedTarget.id;
|
|
124
|
+
const previousWasCell = relatedTarget &&
|
|
125
|
+
!!this.adapterService.getElementOrParentWithClass(relatedTarget, 'ag-cell');
|
|
126
|
+
if (previousFocusedId !== gridId && !previousWasCell) {
|
|
127
|
+
const columns = this.agGrid.columnApi.getAllDisplayedColumns();
|
|
128
|
+
const firstColumn = columns && columns[0];
|
|
129
|
+
const rowIndex = this.agGrid.api.getFirstDisplayedRow();
|
|
130
|
+
if (firstColumn && rowIndex >= 0) {
|
|
131
|
+
this.agGrid.api.setFocusedCell(rowIndex, firstColumn);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
get isInEditMode() {
|
|
136
|
+
/* Sanity check */
|
|
137
|
+
/* istanbul ignore else */
|
|
138
|
+
if (this.agGrid && this.agGrid.api) {
|
|
139
|
+
const primaryGridEditing = this.agGrid.api.getEditingCells().length > 0;
|
|
140
|
+
if (primaryGridEditing) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
let innerEditing = false;
|
|
145
|
+
this.agGrid.api.forEachDetailGridInfo((detailGrid) => {
|
|
146
|
+
if (detailGrid.api.getEditingCells().length > 0) {
|
|
147
|
+
innerEditing = true;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
return innerEditing;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
SkyAgGridWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridWrapperComponent, deps: [{ token: SkyAgGridAdapterService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
159
|
+
SkyAgGridWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridWrapperComponent, selector: "sky-ag-grid-wrapper", queries: [{ propertyName: "agGrid", first: true, predicate: AgGridAngular, descendants: true, static: true }], ngImport: i0, template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n class=\"sky-ag-grid\"\n tabindex=\"0\"\n [id]=\"gridId\"\n [skyViewkeeper]=\"viewkeeperClasses\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <ng-content></ng-content>\n</div>\n<span\n tabindex=\"0\"\n class=\"nav-anchor\"\n [id]=\"afterAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n", directives: [{ type: i1.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridWrapperComponent, decorators: [{
|
|
161
|
+
type: Component,
|
|
162
|
+
args: [{ selector: 'sky-ag-grid-wrapper', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n class=\"nav-anchor\"\n tabindex=\"0\"\n [id]=\"beforeAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n<div\n class=\"sky-ag-grid\"\n tabindex=\"0\"\n [id]=\"gridId\"\n [skyViewkeeper]=\"viewkeeperClasses\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <ng-content></ng-content>\n</div>\n<span\n tabindex=\"0\"\n class=\"nav-anchor\"\n [id]=\"afterAnchorId\"\n (focusin)=\"onAnchorFocus($event)\"\n>\n</span>\n" }]
|
|
163
|
+
}], ctorParameters: function () { return [{ type: SkyAgGridAdapterService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { agGrid: [{
|
|
164
|
+
type: ContentChild,
|
|
165
|
+
args: [AgGridAngular, {
|
|
166
|
+
static: true,
|
|
167
|
+
}]
|
|
168
|
+
}] } });
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
class SkyAgGridDataManagerAdapterDirective {
|
|
174
|
+
constructor(changeDetector, dataManagerSvc) {
|
|
175
|
+
this.changeDetector = changeDetector;
|
|
176
|
+
this.dataManagerSvc = dataManagerSvc;
|
|
177
|
+
this.ngUnsubscribe = new Subject();
|
|
178
|
+
}
|
|
179
|
+
ngAfterContentInit() {
|
|
180
|
+
this.dataManagerSvc.setViewkeeperClasses(this.viewId, ['.ag-header']);
|
|
181
|
+
this.viewConfig = this.dataManagerSvc.getViewById(this.viewId);
|
|
182
|
+
this.checkForAgGrid();
|
|
183
|
+
this.checkForSkyAgGridWrapper();
|
|
184
|
+
this.agGridList.changes
|
|
185
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
186
|
+
.subscribe(() => this.checkForAgGrid());
|
|
187
|
+
this.skyAgGridWrapperList.changes
|
|
188
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
189
|
+
.subscribe(() => this.checkForSkyAgGridWrapper());
|
|
190
|
+
}
|
|
191
|
+
ngOnDestroy() {
|
|
192
|
+
this.ngUnsubscribe.next();
|
|
193
|
+
this.ngUnsubscribe.complete();
|
|
194
|
+
}
|
|
195
|
+
checkForAgGrid() {
|
|
196
|
+
const agGridCount = this.agGridList.length;
|
|
197
|
+
/* istanbul ignore else */
|
|
198
|
+
if (agGridCount === 0) {
|
|
199
|
+
this.unregisterAgGrid();
|
|
200
|
+
}
|
|
201
|
+
else if (this.agGridList.first !== this.currentAgGrid) {
|
|
202
|
+
this.registerAgGrid();
|
|
203
|
+
}
|
|
204
|
+
if (agGridCount > 1) {
|
|
205
|
+
console.warn('More than one ag-grid child component was found. Using the first ag-Grid.');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
checkForSkyAgGridWrapper() {
|
|
209
|
+
const skyAgGridWrapperCount = this.skyAgGridWrapperList.length;
|
|
210
|
+
/* istanbul ignore else */
|
|
211
|
+
if (skyAgGridWrapperCount === 0) {
|
|
212
|
+
this.unregisterSkyAgGridWrapper();
|
|
213
|
+
}
|
|
214
|
+
else if (this.skyAgGridWrapperList.first !== this.currentSkyAgGridWrapper) {
|
|
215
|
+
this.registerSkyAgGridWrapper();
|
|
216
|
+
}
|
|
217
|
+
if (skyAgGridWrapperCount > 1) {
|
|
218
|
+
console.warn('More than one ag-grid child component was found. Using the first ag-Grid.');
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
unregisterAgGrid() {
|
|
222
|
+
this.currentAgGrid = undefined;
|
|
223
|
+
/* istanbul ignore if */
|
|
224
|
+
if (this.dataStateSub) {
|
|
225
|
+
this.dataStateSub.unsubscribe();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
unregisterSkyAgGridWrapper() {
|
|
229
|
+
this.currentSkyAgGridWrapper = undefined;
|
|
230
|
+
}
|
|
231
|
+
registerSkyAgGridWrapper() {
|
|
232
|
+
this.unregisterSkyAgGridWrapper();
|
|
233
|
+
this.currentSkyAgGridWrapper = this.skyAgGridWrapperList.first;
|
|
234
|
+
setTimeout(() => {
|
|
235
|
+
if (this.currentSkyAgGridWrapper) {
|
|
236
|
+
this.currentSkyAgGridWrapper.viewkeeperClasses = [];
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
registerAgGrid() {
|
|
241
|
+
this.unregisterAgGrid();
|
|
242
|
+
const agGrid = this.agGridList.first;
|
|
243
|
+
this.currentAgGrid = agGrid;
|
|
244
|
+
agGrid.gridReady.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
|
|
245
|
+
this.viewConfig.onSelectAllClick = this.selectAll.bind(this);
|
|
246
|
+
this.viewConfig.onClearAllClick = this.clearAll.bind(this);
|
|
247
|
+
this.dataManagerSvc.updateViewConfig(this.viewConfig);
|
|
248
|
+
this.dataStateSub = this.dataManagerSvc
|
|
249
|
+
.getDataStateUpdates(this.viewConfig.id)
|
|
250
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
251
|
+
.subscribe((dataState) => {
|
|
252
|
+
this.currentDataState = dataState;
|
|
253
|
+
this.displayColumns(dataState);
|
|
254
|
+
});
|
|
255
|
+
agGrid.api.sizeColumnsToFit();
|
|
256
|
+
});
|
|
257
|
+
agGrid.columnMoved
|
|
258
|
+
.pipe(takeUntil(this.ngUnsubscribe), filter((event) => ![
|
|
259
|
+
'gridInitializing',
|
|
260
|
+
'uiColumnResized',
|
|
261
|
+
'uiColumnDragged',
|
|
262
|
+
'api',
|
|
263
|
+
].includes(event.source)))
|
|
264
|
+
.subscribe((value) => {
|
|
265
|
+
this.updateColumnsInCurrentDataState(value.columnApi);
|
|
266
|
+
});
|
|
267
|
+
let currentColumns;
|
|
268
|
+
agGrid.dragStarted
|
|
269
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
270
|
+
.subscribe((value) => {
|
|
271
|
+
currentColumns = this.getColumnOrder(value.columnApi);
|
|
272
|
+
});
|
|
273
|
+
agGrid.dragStopped
|
|
274
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
275
|
+
.subscribe((value) => {
|
|
276
|
+
const newColumns = this.getColumnOrder(value.columnApi);
|
|
277
|
+
const hasChanged = currentColumns.findIndex((colId, i) => colId !== newColumns[i]);
|
|
278
|
+
if (hasChanged > -1) {
|
|
279
|
+
this.updateColumnsInCurrentDataState(value.columnApi);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
agGrid.rowSelected
|
|
283
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
284
|
+
.subscribe((event) => {
|
|
285
|
+
const row = event.node;
|
|
286
|
+
const selectedIds = this.currentDataState.selectedIds || [];
|
|
287
|
+
const rowIndex = selectedIds.indexOf(row.data.id);
|
|
288
|
+
if (row.isSelected() && rowIndex === -1) {
|
|
289
|
+
selectedIds.push(row.data.id);
|
|
290
|
+
}
|
|
291
|
+
else if (!row.isSelected() && rowIndex !== -1) {
|
|
292
|
+
selectedIds.splice(rowIndex, 1);
|
|
293
|
+
}
|
|
294
|
+
this.currentDataState.selectedIds = selectedIds;
|
|
295
|
+
this.dataManagerSvc.updateDataState(this.currentDataState, this.viewConfig.id);
|
|
296
|
+
this.changeDetector.markForCheck();
|
|
297
|
+
});
|
|
298
|
+
agGrid.sortChanged.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
|
|
299
|
+
const gridColumnStates = agGrid.columnApi.getColumnState();
|
|
300
|
+
let sortOption;
|
|
301
|
+
/* istanbul ignore else */
|
|
302
|
+
if (gridColumnStates.length) {
|
|
303
|
+
const activeSortColumnState = gridColumnStates.find((aGridColumnState) => aGridColumnState.sortIndex === 0);
|
|
304
|
+
const dataManagerConfig = this.dataManagerSvc.getCurrentDataManagerConfig();
|
|
305
|
+
/* istanbul ignore else */
|
|
306
|
+
if (dataManagerConfig.sortOptions && activeSortColumnState) {
|
|
307
|
+
sortOption = dataManagerConfig.sortOptions.find((option) => {
|
|
308
|
+
return (option.propertyName === activeSortColumnState.colId &&
|
|
309
|
+
option.descending === (activeSortColumnState.sort === 'desc'));
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
sortOption = undefined;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
this.currentDataState.activeSortOption = sortOption;
|
|
317
|
+
this.dataManagerSvc.updateDataState(this.currentDataState, this.viewConfig.id);
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
updateColumnsInCurrentDataState(columnApi) {
|
|
321
|
+
const columnOrder = this.getColumnOrder(columnApi);
|
|
322
|
+
const viewState = this.currentDataState.getViewStateById(this.viewConfig.id);
|
|
323
|
+
viewState.displayedColumnIds = columnOrder;
|
|
324
|
+
this.dataManagerSvc.updateDataState(this.currentDataState.addOrUpdateView(this.viewConfig.id, viewState), this.viewConfig.id);
|
|
325
|
+
}
|
|
326
|
+
getColumnOrder(columnApi) {
|
|
327
|
+
return columnApi
|
|
328
|
+
.getAllDisplayedVirtualColumns()
|
|
329
|
+
.map((col) => col.getColDef().colId);
|
|
330
|
+
}
|
|
331
|
+
displayColumns(dataState) {
|
|
332
|
+
const agGrid = this.currentAgGrid;
|
|
333
|
+
const viewState = dataState.getViewStateById(this.viewConfig.id);
|
|
334
|
+
let displayedColumnIds = [];
|
|
335
|
+
/*istanbul ignore else*/
|
|
336
|
+
if (viewState.displayedColumnIds) {
|
|
337
|
+
displayedColumnIds = viewState.displayedColumnIds;
|
|
338
|
+
}
|
|
339
|
+
const columns = agGrid.columnApi.getAllColumns();
|
|
340
|
+
for (const column of columns) {
|
|
341
|
+
const colId = column.getColId();
|
|
342
|
+
const colIndex = displayedColumnIds.indexOf(colId);
|
|
343
|
+
agGrid.columnApi.setColumnVisible(colId, colIndex !== -1);
|
|
344
|
+
agGrid.columnApi.moveColumn(colId, colIndex);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
selectAll() {
|
|
348
|
+
const agGrid = this.agGridList.first;
|
|
349
|
+
agGrid.api.selectAll();
|
|
350
|
+
}
|
|
351
|
+
clearAll() {
|
|
352
|
+
const agGrid = this.agGridList.first;
|
|
353
|
+
agGrid.api.deselectAll();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
SkyAgGridDataManagerAdapterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridDataManagerAdapterDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.SkyDataManagerService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
357
|
+
SkyAgGridDataManagerAdapterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridDataManagerAdapterDirective, selector: "[skyAgGridDataManagerAdapter]", inputs: { viewId: "viewId" }, queries: [{ propertyName: "agGridList", predicate: AgGridAngular, descendants: true }, { propertyName: "skyAgGridWrapperList", predicate: SkyAgGridWrapperComponent, descendants: true }], ngImport: i0 });
|
|
358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridDataManagerAdapterDirective, decorators: [{
|
|
359
|
+
type: Directive,
|
|
360
|
+
args: [{
|
|
361
|
+
selector: '[skyAgGridDataManagerAdapter]',
|
|
362
|
+
}]
|
|
363
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.SkyDataManagerService }]; }, propDecorators: { viewId: [{
|
|
364
|
+
type: Input
|
|
365
|
+
}], agGridList: [{
|
|
366
|
+
type: ContentChildren,
|
|
367
|
+
args: [AgGridAngular, { descendants: true }]
|
|
368
|
+
}], skyAgGridWrapperList: [{
|
|
369
|
+
type: ContentChildren,
|
|
370
|
+
args: [SkyAgGridWrapperComponent, { descendants: true }]
|
|
371
|
+
}] } });
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Component for rendering the inline delete template in the overlay.
|
|
375
|
+
* @internal
|
|
376
|
+
*/
|
|
377
|
+
class SkyAgGridRowDeleteComponent {
|
|
378
|
+
}
|
|
379
|
+
SkyAgGridRowDeleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridRowDeleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
380
|
+
SkyAgGridRowDeleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridRowDeleteComponent, selector: "ng-component", viewQueries: [{ propertyName: "inlineDeleteTemplateRef", first: true, predicate: ["inlineDeleteTemplateRef"], descendants: true, read: TemplateRef }, { propertyName: "inlineDeleteRefs", predicate: ["inlineDeleteRef"], descendants: true }], ngImport: i0, template: `
|
|
381
|
+
<ng-template
|
|
382
|
+
let-row
|
|
383
|
+
let-tableWidth="tableWidth()"
|
|
384
|
+
let-getRowDeleteItem="getRowDeleteItem"
|
|
385
|
+
let-cancelRowDelete="cancelRowDelete"
|
|
386
|
+
let-confirmRowDelete="confirmRowDelete"
|
|
387
|
+
#inlineDeleteTemplateRef
|
|
388
|
+
>
|
|
389
|
+
<div
|
|
390
|
+
class="sky-ag-grid-row-delete"
|
|
391
|
+
[id]="'row-delete-ref-' + row.id"
|
|
392
|
+
[ngStyle]="{
|
|
393
|
+
height: row.rowHeight + 'px',
|
|
394
|
+
position: 'fixed',
|
|
395
|
+
width: tableWidth + 'px'
|
|
396
|
+
}"
|
|
397
|
+
#inlineDeleteRef
|
|
398
|
+
>
|
|
399
|
+
<sky-inline-delete
|
|
400
|
+
[pending]="getRowDeleteItem(row).pending"
|
|
401
|
+
(cancelTriggered)="cancelRowDelete(row)"
|
|
402
|
+
(deleteTriggered)="confirmRowDelete(row)"
|
|
403
|
+
></sky-inline-delete>
|
|
404
|
+
</div>
|
|
405
|
+
</ng-template>
|
|
406
|
+
`, isInline: true, components: [{ type: i1$2.λ8, selector: "sky-inline-delete", inputs: ["pending"], outputs: ["cancelTriggered", "deleteTriggered"] }], directives: [{ type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridRowDeleteComponent, decorators: [{
|
|
408
|
+
type: Component,
|
|
409
|
+
args: [{
|
|
410
|
+
template: `
|
|
411
|
+
<ng-template
|
|
412
|
+
let-row
|
|
413
|
+
let-tableWidth="tableWidth()"
|
|
414
|
+
let-getRowDeleteItem="getRowDeleteItem"
|
|
415
|
+
let-cancelRowDelete="cancelRowDelete"
|
|
416
|
+
let-confirmRowDelete="confirmRowDelete"
|
|
417
|
+
#inlineDeleteTemplateRef
|
|
418
|
+
>
|
|
419
|
+
<div
|
|
420
|
+
class="sky-ag-grid-row-delete"
|
|
421
|
+
[id]="'row-delete-ref-' + row.id"
|
|
422
|
+
[ngStyle]="{
|
|
423
|
+
height: row.rowHeight + 'px',
|
|
424
|
+
position: 'fixed',
|
|
425
|
+
width: tableWidth + 'px'
|
|
426
|
+
}"
|
|
427
|
+
#inlineDeleteRef
|
|
428
|
+
>
|
|
429
|
+
<sky-inline-delete
|
|
430
|
+
[pending]="getRowDeleteItem(row).pending"
|
|
431
|
+
(cancelTriggered)="cancelRowDelete(row)"
|
|
432
|
+
(deleteTriggered)="confirmRowDelete(row)"
|
|
433
|
+
></sky-inline-delete>
|
|
434
|
+
</div>
|
|
435
|
+
</ng-template>
|
|
436
|
+
`,
|
|
437
|
+
}]
|
|
438
|
+
}], propDecorators: { inlineDeleteRefs: [{
|
|
439
|
+
type: ViewChildren,
|
|
440
|
+
args: ['inlineDeleteRef']
|
|
441
|
+
}], inlineDeleteTemplateRef: [{
|
|
442
|
+
type: ViewChild,
|
|
443
|
+
args: ['inlineDeleteTemplateRef', { read: TemplateRef }]
|
|
444
|
+
}] } });
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* @internal
|
|
448
|
+
*/
|
|
449
|
+
class SkyAgGridRowDeleteDirective {
|
|
450
|
+
constructor(affixService, changeDetector, elementRef, resolver, overlayService, viewContainerRef) {
|
|
451
|
+
this.affixService = affixService;
|
|
452
|
+
this.changeDetector = changeDetector;
|
|
453
|
+
this.elementRef = elementRef;
|
|
454
|
+
this.resolver = resolver;
|
|
455
|
+
this.overlayService = overlayService;
|
|
456
|
+
this.viewContainerRef = viewContainerRef;
|
|
457
|
+
/**
|
|
458
|
+
* Emits a `SkyAgGridRowDeleteCancelArgs` object when a row's inline delete is cancelled.
|
|
459
|
+
*/
|
|
460
|
+
this.rowDeleteCancel = new EventEmitter();
|
|
461
|
+
/**
|
|
462
|
+
* Emits a `SkyAgGridRowDeleteConfirmArgs` object when a row's inline delete is confirmed.
|
|
463
|
+
*/
|
|
464
|
+
this.rowDeleteConfirm = new EventEmitter();
|
|
465
|
+
/**
|
|
466
|
+
* Emits when the list of ids of the data in the rows where inline deletes are shown changes.
|
|
467
|
+
*/
|
|
468
|
+
this.rowDeleteIdsChange = new EventEmitter();
|
|
469
|
+
this.rowDeleteConfigs = [];
|
|
470
|
+
this.ngUnsubscribe = new Subject();
|
|
471
|
+
this.rowDeleteContents = {};
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Specifies the ids of the data in the rows on which inline delete's should be shown.
|
|
475
|
+
*/
|
|
476
|
+
set rowDeleteIds(value) {
|
|
477
|
+
this._rowDeleteIds = value;
|
|
478
|
+
if (!value) {
|
|
479
|
+
for (const config of this.rowDeleteConfigs) {
|
|
480
|
+
this.destroyRowDelete(config.id);
|
|
481
|
+
}
|
|
482
|
+
this.changeDetector.markForCheck();
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
for (const id of value) {
|
|
486
|
+
const existingConfig = this.rowDeleteConfigs.find((config) => config.id === id);
|
|
487
|
+
if (existingConfig) {
|
|
488
|
+
existingConfig.pending = false;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
this.rowDeleteConfigs.push({
|
|
492
|
+
id: id,
|
|
493
|
+
pending: false,
|
|
494
|
+
});
|
|
495
|
+
const overlay = this.overlayService.create({
|
|
496
|
+
enableScroll: true,
|
|
497
|
+
showBackdrop: false,
|
|
498
|
+
closeOnNavigation: true,
|
|
499
|
+
enableClose: false,
|
|
500
|
+
enablePointerEvents: true,
|
|
501
|
+
});
|
|
502
|
+
overlay.attachTemplate(this.rowDeleteComponent.inlineDeleteTemplateRef, {
|
|
503
|
+
$implicit: this.agGrid.api.getRowNode(id),
|
|
504
|
+
tableWidth: () => {
|
|
505
|
+
return this.tableWidth;
|
|
506
|
+
},
|
|
507
|
+
getRowDeleteItem: (row) => this.getRowDeleteItem(row),
|
|
508
|
+
cancelRowDelete: (row) => this.cancelRowDelete(row),
|
|
509
|
+
confirmRowDelete: (row) => this.confirmRowDelete(row),
|
|
510
|
+
});
|
|
511
|
+
/**
|
|
512
|
+
* We are manually setting the z-index here because overlays will always be on top of
|
|
513
|
+
* the omnibar. This manual setting is 2 less than the omnibar's z-index of 1000 and one less than
|
|
514
|
+
* the header row's viewkeeper which is 999. We discussed changing the overlay service to allow for this
|
|
515
|
+
* but decided against that change at this time due to its niche nature.
|
|
516
|
+
*/
|
|
517
|
+
overlay.componentRef.instance.zIndex = '998';
|
|
518
|
+
setTimeout(() => {
|
|
519
|
+
const inlineDeleteRef = this.rowDeleteComponent.inlineDeleteRefs
|
|
520
|
+
.toArray()
|
|
521
|
+
.find((elRef) => {
|
|
522
|
+
return elRef.nativeElement.id === 'row-delete-ref-' + id;
|
|
523
|
+
});
|
|
524
|
+
const affixer = this.affixService.createAffixer(inlineDeleteRef);
|
|
525
|
+
this.affixToRow(affixer, id);
|
|
526
|
+
this.rowDeleteContents[id] = {
|
|
527
|
+
affixer: affixer,
|
|
528
|
+
overlay: overlay,
|
|
529
|
+
};
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
for (const config of this.rowDeleteConfigs) {
|
|
534
|
+
if (value.indexOf(config.id) < 0) {
|
|
535
|
+
this.destroyRowDelete(config.id);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
this.changeDetector.markForCheck();
|
|
539
|
+
}
|
|
540
|
+
get rowDeleteIds() {
|
|
541
|
+
return this._rowDeleteIds;
|
|
542
|
+
}
|
|
543
|
+
get tableWidth() {
|
|
544
|
+
return this.elementRef.nativeElement.querySelectorAll('.sky-ag-grid')[0]
|
|
545
|
+
.offsetWidth;
|
|
546
|
+
}
|
|
547
|
+
ngAfterContentInit() {
|
|
548
|
+
const factory = this.resolver.resolveComponentFactory(SkyAgGridRowDeleteComponent);
|
|
549
|
+
this.rowDeleteComponent =
|
|
550
|
+
this.viewContainerRef.createComponent(factory).instance;
|
|
551
|
+
this.agGrid.rowDataChanged
|
|
552
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
553
|
+
.subscribe(() => {
|
|
554
|
+
this.updateRowDeleteStates();
|
|
555
|
+
});
|
|
556
|
+
this.agGrid.rowDataUpdated
|
|
557
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
558
|
+
.subscribe(() => {
|
|
559
|
+
this.updateRowDeleteStates();
|
|
560
|
+
});
|
|
561
|
+
this.agGrid.sortChanged
|
|
562
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
563
|
+
.subscribe(() => {
|
|
564
|
+
this.updateRowDeleteStates();
|
|
565
|
+
});
|
|
566
|
+
this.agGrid.filterChanged
|
|
567
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
568
|
+
.subscribe(() => {
|
|
569
|
+
this.updateRowDeleteStates();
|
|
570
|
+
});
|
|
571
|
+
this.agGrid.getRowNodeId = (data) => {
|
|
572
|
+
return data.id.toString();
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
ngOnDestroy() {
|
|
576
|
+
this.ngUnsubscribe.next();
|
|
577
|
+
this.ngUnsubscribe.complete();
|
|
578
|
+
Object.keys(this.rowDeleteContents).forEach((id) => {
|
|
579
|
+
this.destroyRowDelete(id);
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
cancelRowDelete(row) {
|
|
583
|
+
this.rowDeleteConfigs = this.rowDeleteConfigs.filter((config) => config.id !== row.id);
|
|
584
|
+
this.rowDeleteCancel.emit({ id: row.id });
|
|
585
|
+
this.destroyRowDelete(row.id);
|
|
586
|
+
}
|
|
587
|
+
confirmRowDelete(row) {
|
|
588
|
+
this.rowDeleteConfigs.find((config) => config.id === row.id).pending = true;
|
|
589
|
+
this.rowDeleteConfirm.emit({ id: row.id });
|
|
590
|
+
}
|
|
591
|
+
getRowDeleteItem(row) {
|
|
592
|
+
return this.rowDeleteConfigs.find((rowDelete) => rowDelete.id === row.id);
|
|
593
|
+
}
|
|
594
|
+
affixToRow(affixer, id) {
|
|
595
|
+
let rowElement = this.elementRef.nativeElement.querySelector(`
|
|
596
|
+
[row-id="${id}"] div[aria-colindex="1"],
|
|
597
|
+
.ag-row.sky-ag-grid-row-${id} div[aria-colindex="1"]
|
|
598
|
+
`);
|
|
599
|
+
// This covers cases where AG Grid places the column index on an inner element (such as with the `enableCellTextSelection` option)
|
|
600
|
+
// This appears to have been fixed by AG Grid in version 24 and so it is not testable after that version.
|
|
601
|
+
/* istanbul ignore if */
|
|
602
|
+
if (!rowElement) {
|
|
603
|
+
const columns = this.elementRef.nativeElement.querySelectorAll('[row-id="' + id + '"] > div');
|
|
604
|
+
for (let i = 0; i < columns.length; i++) {
|
|
605
|
+
if (columns[i].querySelector('[aria-colindex="1"]')) {
|
|
606
|
+
rowElement = columns[i];
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
affixer.affixTo(rowElement, {
|
|
612
|
+
autoFitContext: SkyAffixAutoFitContext.Viewport,
|
|
613
|
+
isSticky: true,
|
|
614
|
+
placement: 'above',
|
|
615
|
+
verticalAlignment: 'top',
|
|
616
|
+
horizontalAlignment: 'left',
|
|
617
|
+
enableAutoFit: false,
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
destroyRowDelete(id) {
|
|
621
|
+
const rowDeleteContents = this.rowDeleteContents[id];
|
|
622
|
+
/* sanity check */
|
|
623
|
+
/* istanbul ignore else */
|
|
624
|
+
if (rowDeleteContents) {
|
|
625
|
+
rowDeleteContents.affixer.destroy();
|
|
626
|
+
this.overlayService.close(rowDeleteContents.overlay);
|
|
627
|
+
delete this.rowDeleteContents[id];
|
|
628
|
+
this.rowDeleteConfigs = this.rowDeleteConfigs.filter((config) => config.id !== id);
|
|
629
|
+
this._rowDeleteIds = this.rowDeleteIds?.filter((arrayId) => arrayId !== id);
|
|
630
|
+
this.rowDeleteIdsChange.emit(this._rowDeleteIds);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
updateRowDeleteStates() {
|
|
634
|
+
this.rowDeleteConfigs.forEach((config) => {
|
|
635
|
+
if (!this.agGrid.api.getRowNode(config.id)) {
|
|
636
|
+
this.destroyRowDelete(config.id);
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
// We must reaffix things when the data changes because the rows rerender and the previous element that the delete was affixed
|
|
640
|
+
// to is destroyed.
|
|
641
|
+
this.affixToRow(this.rowDeleteContents[config.id].affixer, config.id);
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
this.changeDetector.markForCheck();
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
SkyAgGridRowDeleteDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridRowDeleteDirective, deps: [{ token: i1.SkyAffixService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.ComponentFactoryResolver }, { token: i1.SkyOverlayService }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
648
|
+
SkyAgGridRowDeleteDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.7", 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 });
|
|
649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridRowDeleteDirective, decorators: [{
|
|
650
|
+
type: Directive,
|
|
651
|
+
args: [{
|
|
652
|
+
selector: '[skyAgGridRowDelete]',
|
|
653
|
+
}]
|
|
654
|
+
}], ctorParameters: function () { return [{ type: i1.SkyAffixService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.ComponentFactoryResolver }, { type: i1.SkyOverlayService }, { type: i0.ViewContainerRef }]; }, propDecorators: { rowDeleteIds: [{
|
|
655
|
+
type: Input
|
|
656
|
+
}], rowDeleteCancel: [{
|
|
657
|
+
type: Output
|
|
658
|
+
}], rowDeleteConfirm: [{
|
|
659
|
+
type: Output
|
|
660
|
+
}], rowDeleteIdsChange: [{
|
|
661
|
+
type: Output
|
|
662
|
+
}], agGrid: [{
|
|
663
|
+
type: ContentChild,
|
|
664
|
+
args: [AgGridAngular]
|
|
665
|
+
}] } });
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
669
|
+
* The contents of this file were automatically generated by
|
|
670
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-ag-grid' schematic.
|
|
671
|
+
* To update this file, simply rerun the command.
|
|
672
|
+
*/
|
|
673
|
+
const RESOURCES = {
|
|
674
|
+
'EN-US': {
|
|
675
|
+
sky_ag_grid_row_selector_aria_label: {
|
|
676
|
+
message: 'Row selector for row {0}',
|
|
677
|
+
},
|
|
678
|
+
sky_ag_grid_cell_editor_number_aria_label: {
|
|
679
|
+
message: 'Editable number {0} for row {1}',
|
|
680
|
+
},
|
|
681
|
+
sky_ag_grid_cell_editor_text_aria_label: {
|
|
682
|
+
message: 'Editable text {0} for row {1}',
|
|
683
|
+
},
|
|
684
|
+
sky_ag_grid_cell_editor_autocomplete_aria_label: {
|
|
685
|
+
message: 'Editable autocomplete {0} for row {1}',
|
|
686
|
+
},
|
|
687
|
+
sky_ag_grid_cell_renderer_currency_aria_label: {
|
|
688
|
+
message: 'Editable currency {0} for row {1}',
|
|
689
|
+
},
|
|
690
|
+
sky_ag_grid_cell_renderer_number_validator_message: {
|
|
691
|
+
message: 'Enter a valid number.',
|
|
692
|
+
},
|
|
693
|
+
sky_ag_grid_cell_renderer_currency_validator_message: {
|
|
694
|
+
message: 'Enter a valid currency.',
|
|
695
|
+
},
|
|
696
|
+
skyux_lookup_tokens_summary: { message: '{0} items selected' },
|
|
697
|
+
sky_ag_grid_cell_editor_currency_aria_label: {
|
|
698
|
+
message: 'Editable currency {0} for row {1}',
|
|
699
|
+
},
|
|
700
|
+
},
|
|
701
|
+
};
|
|
702
|
+
class SkyAgGridResourcesProvider {
|
|
703
|
+
getString(localeInfo, name) {
|
|
704
|
+
return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Import into any component library module that needs to use resource strings.
|
|
709
|
+
*/
|
|
710
|
+
class SkyAgGridResourcesModule {
|
|
711
|
+
}
|
|
712
|
+
SkyAgGridResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
713
|
+
SkyAgGridResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridResourcesModule, exports: [SkyI18nModule] });
|
|
714
|
+
SkyAgGridResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridResourcesModule, providers: [
|
|
715
|
+
{
|
|
716
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
717
|
+
useClass: SkyAgGridResourcesProvider,
|
|
718
|
+
multi: true,
|
|
719
|
+
},
|
|
720
|
+
], imports: [SkyI18nModule] });
|
|
721
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridResourcesModule, decorators: [{
|
|
722
|
+
type: NgModule,
|
|
723
|
+
args: [{
|
|
724
|
+
exports: [SkyI18nModule],
|
|
725
|
+
providers: [
|
|
726
|
+
{
|
|
727
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
728
|
+
useClass: SkyAgGridResourcesProvider,
|
|
729
|
+
multi: true,
|
|
730
|
+
},
|
|
731
|
+
],
|
|
732
|
+
}]
|
|
733
|
+
}] });
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* @internal
|
|
737
|
+
*/
|
|
738
|
+
class SkyAgGridCellEditorAutocompleteComponent {
|
|
739
|
+
constructor() {
|
|
740
|
+
this.skyComponentProperties = {};
|
|
741
|
+
}
|
|
742
|
+
agInit(params) {
|
|
743
|
+
this.params = params;
|
|
744
|
+
this.currentSelection = this.params.value;
|
|
745
|
+
this.columnHeader = this.params.colDef && this.params.colDef.headerName;
|
|
746
|
+
this.rowNumber = this.params.rowIndex + 1;
|
|
747
|
+
this.skyComponentProperties = this.params.skyComponentProperties || {};
|
|
748
|
+
}
|
|
749
|
+
afterGuiAttached() {
|
|
750
|
+
this.input.nativeElement.focus();
|
|
751
|
+
}
|
|
752
|
+
getValue() {
|
|
753
|
+
return this.currentSelection;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
SkyAgGridCellEditorAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
757
|
+
SkyAgGridCellEditorAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellEditorAutocompleteComponent, selector: "sky-ag-grid-cell-editor-autocomplete", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorAutocomplete"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"sky-ag-grid-cell-editor-autocomplete\">\n <sky-autocomplete\n [data]=\"skyComponentProperties.data\"\n [debounceTime]=\"skyComponentProperties.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties.descriptorProperty\"\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 (selectionChange)=\"\n skyComponentProperties.selectionChange &&\n skyComponentProperties.selectionChange($event)\n \"\n >\n <input\n skyAutocomplete\n #skyCellEditorAutocomplete\n type=\"text\"\n [(ngModel)]=\"currentSelection\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_autocomplete_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n />\n </sky-autocomplete>\n</div>\n", styles: ["sky-autocomplete input{border:none;box-shadow:none}\n"], components: [{ type: i1$3.λ2, selector: "sky-autocomplete", inputs: ["ariaLabelledBy", "data", "debounceTime", "descriptorProperty", "enableShowMore", "messageStream", "wrapperClass", "propertiesToSearch", "search", "searchResultTemplate", "searchTextMinimumCharacters", "searchFilters", "searchResultsLimit", "showAddButton", "noResultsFoundText", "searchAsyncDisabled"], outputs: ["addClick", "showMoreClick", "selectionChange", "searchAsync"] }], directives: [{ type: i1$3.λ1, selector: "input[skyAutocomplete], textarea[skyAutocomplete]", inputs: ["autocompleteAttribute", "disabled"] }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorAutocompleteComponent, decorators: [{
|
|
759
|
+
type: Component,
|
|
760
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-ag-grid-cell-editor-autocomplete\">\n <sky-autocomplete\n [data]=\"skyComponentProperties.data\"\n [debounceTime]=\"skyComponentProperties.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties.descriptorProperty\"\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 (selectionChange)=\"\n skyComponentProperties.selectionChange &&\n skyComponentProperties.selectionChange($event)\n \"\n >\n <input\n skyAutocomplete\n #skyCellEditorAutocomplete\n type=\"text\"\n [(ngModel)]=\"currentSelection\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_autocomplete_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n />\n </sky-autocomplete>\n</div>\n", styles: ["sky-autocomplete input{border:none;box-shadow:none}\n"] }]
|
|
761
|
+
}], propDecorators: { input: [{
|
|
762
|
+
type: ViewChild,
|
|
763
|
+
args: ['skyCellEditorAutocomplete', { read: ElementRef }]
|
|
764
|
+
}] } });
|
|
765
|
+
|
|
766
|
+
class SkyAgGridCellEditorAutocompleteModule {
|
|
767
|
+
}
|
|
768
|
+
SkyAgGridCellEditorAutocompleteModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
769
|
+
SkyAgGridCellEditorAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, declarations: [SkyAgGridCellEditorAutocompleteComponent], imports: [FormsModule, SkyAgGridResourcesModule, SkyAutocompleteModule], exports: [SkyAgGridCellEditorAutocompleteComponent] });
|
|
770
|
+
SkyAgGridCellEditorAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, imports: [[FormsModule, SkyAgGridResourcesModule, SkyAutocompleteModule]] });
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, decorators: [{
|
|
772
|
+
type: NgModule,
|
|
773
|
+
args: [{
|
|
774
|
+
imports: [FormsModule, SkyAgGridResourcesModule, SkyAutocompleteModule],
|
|
775
|
+
declarations: [SkyAgGridCellEditorAutocompleteComponent],
|
|
776
|
+
exports: [SkyAgGridCellEditorAutocompleteComponent],
|
|
777
|
+
}]
|
|
778
|
+
}] });
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* @internal
|
|
782
|
+
*/
|
|
783
|
+
class SkyAgGridCellEditorCurrencyComponent {
|
|
784
|
+
constructor() {
|
|
785
|
+
this.skyComponentProperties = {};
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
789
|
+
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
790
|
+
*/
|
|
791
|
+
agInit(params) {
|
|
792
|
+
this.params = params;
|
|
793
|
+
this.value = this.params.value;
|
|
794
|
+
this.columnHeader = this.params.colDef.headerName;
|
|
795
|
+
this.rowNumber = this.params.rowIndex + 1;
|
|
796
|
+
this.columnWidth = this.params.column.getActualWidth();
|
|
797
|
+
this.rowHeightWithoutBorders =
|
|
798
|
+
this.params.node && this.params.node.rowHeight - 4;
|
|
799
|
+
this.skyComponentProperties = this.params.skyComponentProperties || {
|
|
800
|
+
decimalPlaces: 2,
|
|
801
|
+
currencySymbol: '$',
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* 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.
|
|
806
|
+
*/
|
|
807
|
+
afterGuiAttached() {
|
|
808
|
+
this.input.nativeElement.focus();
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
812
|
+
*/
|
|
813
|
+
getValue() {
|
|
814
|
+
return this.value;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
SkyAgGridCellEditorCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
818
|
+
SkyAgGridCellEditorCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellEditorCurrencyComponent, selector: "sky-ag-grid-cell-editor-currency", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorCurrency"], descendants: true, read: ElementRef }], ngImport: i0, template: "<input\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 [(ngModel)]=\"value\"\n [skyAutonumeric]=\"skyComponentProperties\"\n #skyCellEditorCurrency\n/>\n", styles: ["input{border:none;padding-left:11px}\n"], directives: [{ type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.λ1, selector: "input[skyAutonumeric]", inputs: ["skyAutonumeric"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
819
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, decorators: [{
|
|
820
|
+
type: Component,
|
|
821
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-currency', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\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 [(ngModel)]=\"value\"\n [skyAutonumeric]=\"skyComponentProperties\"\n #skyCellEditorCurrency\n/>\n", styles: ["input{border:none;padding-left:11px}\n"] }]
|
|
822
|
+
}], propDecorators: { input: [{
|
|
823
|
+
type: ViewChild,
|
|
824
|
+
args: ['skyCellEditorCurrency', { read: ElementRef }]
|
|
825
|
+
}] } });
|
|
826
|
+
|
|
827
|
+
class SkyAgGridCellEditorCurrencyModule {
|
|
828
|
+
}
|
|
829
|
+
SkyAgGridCellEditorCurrencyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
830
|
+
SkyAgGridCellEditorCurrencyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, declarations: [SkyAgGridCellEditorCurrencyComponent], imports: [SkyAgGridResourcesModule, FormsModule, SkyAutonumericModule], exports: [SkyAgGridCellEditorCurrencyComponent] });
|
|
831
|
+
SkyAgGridCellEditorCurrencyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, imports: [[SkyAgGridResourcesModule, FormsModule, SkyAutonumericModule]] });
|
|
832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, decorators: [{
|
|
833
|
+
type: NgModule,
|
|
834
|
+
args: [{
|
|
835
|
+
imports: [SkyAgGridResourcesModule, FormsModule, SkyAutonumericModule],
|
|
836
|
+
declarations: [SkyAgGridCellEditorCurrencyComponent],
|
|
837
|
+
exports: [SkyAgGridCellEditorCurrencyComponent],
|
|
838
|
+
}]
|
|
839
|
+
}] });
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* @internal
|
|
843
|
+
*/
|
|
844
|
+
class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
845
|
+
constructor(themeSvc) {
|
|
846
|
+
super();
|
|
847
|
+
this.themeSvc = themeSvc;
|
|
848
|
+
this.skyComponentProperties = {};
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
852
|
+
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
853
|
+
*/
|
|
854
|
+
agInit(params) {
|
|
855
|
+
this.params = params;
|
|
856
|
+
this.currentDate = this.params.value;
|
|
857
|
+
this.skyComponentProperties = this.params.skyComponentProperties || {};
|
|
858
|
+
this.columnWidth = this.params.column.getActualWidth();
|
|
859
|
+
this.columnWidthWithoutBorders = this.columnWidth - 2;
|
|
860
|
+
this.rowHeightWithoutBorders =
|
|
861
|
+
this.params.node && this.params.node.rowHeight - 3;
|
|
862
|
+
this.themeSvc?.settingsChange.subscribe((themeSettings) => {
|
|
863
|
+
if (themeSettings.currentSettings.theme.name === 'modern') {
|
|
864
|
+
this.columnWidthWithoutBorders = this.columnWidth;
|
|
865
|
+
this.rowHeightWithoutBorders =
|
|
866
|
+
this.params.node && this.params.node.rowHeight;
|
|
867
|
+
}
|
|
868
|
+
else {
|
|
869
|
+
this.columnWidthWithoutBorders = this.columnWidth - 2;
|
|
870
|
+
this.rowHeightWithoutBorders =
|
|
871
|
+
this.params.node && this.params.node.rowHeight - 3;
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* 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.
|
|
877
|
+
*/
|
|
878
|
+
afterGuiAttached() {
|
|
879
|
+
this.focusOnDatepickerInput();
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
883
|
+
*/
|
|
884
|
+
getValue() {
|
|
885
|
+
this.datepickerInput.nativeElement.blur();
|
|
886
|
+
return this.currentDate;
|
|
887
|
+
}
|
|
888
|
+
focusOnDatepickerInput() {
|
|
889
|
+
this.datepickerInput.nativeElement.focus();
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
SkyAgGridCellEditorDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, deps: [{ token: i1$5.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
893
|
+
SkyAgGridCellEditorDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", 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 [style.width.px]=\"columnWidthWithoutBorders\"\n>\n <sky-datepicker\n data-sky-id=\"cell-datepicker\"\n pickerClass=\"ag-custom-component-popup\"\n >\n <input\n skyDatepickerInput\n [disabled]=\"skyComponentProperties.disabled\"\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 [(ngModel)]=\"currentDate\"\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"], components: [{ type: i2$1.λ2, selector: "sky-datepicker", inputs: ["pickerClass"], outputs: ["calendarDateRangeChange"] }], directives: [{ type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2$1.λ3, selector: "[skyDatepickerInput]", inputs: ["dateFormat", "disabled", "maxDate", "minDate", "skyDatepickerInput", "skyDatepickerNoValidate", "startingDay", "strict"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, decorators: [{
|
|
895
|
+
type: Component,
|
|
896
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-datepicker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"sky-ag-grid-cell-editor-datepicker\"\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 skyDatepickerInput\n [disabled]=\"skyComponentProperties.disabled\"\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 [(ngModel)]=\"currentDate\"\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"] }]
|
|
897
|
+
}], ctorParameters: function () { return [{ type: i1$5.SkyThemeService, decorators: [{
|
|
898
|
+
type: Optional
|
|
899
|
+
}] }]; }, propDecorators: { datepickerInput: [{
|
|
900
|
+
type: ViewChild,
|
|
901
|
+
args: ['skyCellEditorDatepickerInput', { read: ElementRef }]
|
|
902
|
+
}] } });
|
|
903
|
+
|
|
904
|
+
class SkyAgGridCellEditorDatepickerModule {
|
|
905
|
+
}
|
|
906
|
+
SkyAgGridCellEditorDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
907
|
+
SkyAgGridCellEditorDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, declarations: [SkyAgGridCellEditorDatepickerComponent], imports: [SkyDatepickerModule, FormsModule], exports: [SkyAgGridCellEditorDatepickerComponent] });
|
|
908
|
+
SkyAgGridCellEditorDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, imports: [[SkyDatepickerModule, FormsModule]] });
|
|
909
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, decorators: [{
|
|
910
|
+
type: NgModule,
|
|
911
|
+
args: [{
|
|
912
|
+
imports: [SkyDatepickerModule, FormsModule],
|
|
913
|
+
declarations: [SkyAgGridCellEditorDatepickerComponent],
|
|
914
|
+
exports: [SkyAgGridCellEditorDatepickerComponent],
|
|
915
|
+
}]
|
|
916
|
+
}] });
|
|
917
|
+
|
|
918
|
+
function applySkyLookupPropertiesDefaults(skyLookupProperties) {
|
|
919
|
+
return {
|
|
920
|
+
addClick: skyLookupProperties.addClick || undefined,
|
|
921
|
+
ariaLabel: skyLookupProperties.ariaLabel || '',
|
|
922
|
+
autocompleteAttribute: skyLookupProperties.autocompleteAttribute || 'off',
|
|
923
|
+
data: skyLookupProperties.data || [],
|
|
924
|
+
debounceTime: skyLookupProperties.debounceTime || 0,
|
|
925
|
+
descriptorProperty: skyLookupProperties.descriptorProperty || 'name',
|
|
926
|
+
disabled: skyLookupProperties.disabled || false,
|
|
927
|
+
enableShowMore: skyLookupProperties.enableShowMore || false,
|
|
928
|
+
idProperty: skyLookupProperties.idProperty || undefined,
|
|
929
|
+
placeholderText: skyLookupProperties.placeholderText || '',
|
|
930
|
+
propertiesToSearch: skyLookupProperties.propertiesToSearch || undefined,
|
|
931
|
+
search: skyLookupProperties.search || undefined,
|
|
932
|
+
searchAsync: skyLookupProperties.searchAsync || undefined,
|
|
933
|
+
searchFilters: skyLookupProperties.searchFilters || [],
|
|
934
|
+
searchResultsLimit: skyLookupProperties.searchResultsLimit || undefined,
|
|
935
|
+
searchResultTemplate: skyLookupProperties.searchResultTemplate || undefined,
|
|
936
|
+
searchTextMinimumCharacters: skyLookupProperties.searchTextMinimumCharacters || 1,
|
|
937
|
+
selectMode: skyLookupProperties.selectMode || undefined,
|
|
938
|
+
showAddButton: skyLookupProperties.showAddButton || false,
|
|
939
|
+
showMoreConfig: skyLookupProperties.showMoreConfig || {},
|
|
940
|
+
wrapperClass: 'ag-custom-component-popup',
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
class SkyAgGridCellEditorLookupComponent {
|
|
945
|
+
constructor(changeDetector, elementRef) {
|
|
946
|
+
this.changeDetector = changeDetector;
|
|
947
|
+
this.elementRef = elementRef;
|
|
948
|
+
this.isAlive = false;
|
|
949
|
+
this.lookupForm = new FormGroup({
|
|
950
|
+
currentSelection: new FormControl({
|
|
951
|
+
value: [],
|
|
952
|
+
disabled: false,
|
|
953
|
+
}),
|
|
954
|
+
});
|
|
955
|
+
this.useAsyncSearch = false;
|
|
956
|
+
}
|
|
957
|
+
agInit(params) {
|
|
958
|
+
this.params = params;
|
|
959
|
+
if (!Array.isArray(this.params.value)) {
|
|
960
|
+
throw new Error(`Lookup value must be an array`);
|
|
961
|
+
}
|
|
962
|
+
const control = this.lookupForm.get('currentSelection');
|
|
963
|
+
control.setValue(this.params.value);
|
|
964
|
+
if (this.params.skyComponentProperties.disabled) {
|
|
965
|
+
control.disable();
|
|
966
|
+
}
|
|
967
|
+
this.skyComponentProperties = this.updateComponentProperties(this.params);
|
|
968
|
+
this.useAsyncSearch =
|
|
969
|
+
typeof this.skyComponentProperties.searchAsync === 'function';
|
|
970
|
+
this.isAlive = true;
|
|
971
|
+
this.changeDetector.markForCheck();
|
|
972
|
+
}
|
|
973
|
+
isCancelAfterEnd() {
|
|
974
|
+
// Shut down components to commit values before final value syncs to grid.
|
|
975
|
+
this.isAlive = false;
|
|
976
|
+
this.changeDetector.detectChanges();
|
|
977
|
+
return false;
|
|
978
|
+
}
|
|
979
|
+
getGui() {
|
|
980
|
+
return this.elementRef.nativeElement;
|
|
981
|
+
}
|
|
982
|
+
getValue() {
|
|
983
|
+
return this.lookupForm.get('currentSelection').value;
|
|
984
|
+
}
|
|
985
|
+
isPopup() {
|
|
986
|
+
return true;
|
|
987
|
+
}
|
|
988
|
+
/*istanbul ignore next*/
|
|
989
|
+
afterGuiAttached() {
|
|
990
|
+
this.elementRef.nativeElement.querySelector('.sky-lookup-input')?.focus();
|
|
991
|
+
}
|
|
992
|
+
updateComponentProperties(params) {
|
|
993
|
+
const skyLookupProperties = params.skyComponentProperties;
|
|
994
|
+
return applySkyLookupPropertiesDefaults(skyLookupProperties);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
SkyAgGridCellEditorLookupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
998
|
+
SkyAgGridCellEditorLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellEditorLookupComponent, selector: "sky-ag-grid-cell-editor-lookup", ngImport: i0, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"lookupForm\"\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=\"currentSelection\"\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]=\"lookupForm\"\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=\"currentSelection\"\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"], components: [{ type: i1$6.λ10, selector: "sky-input-box", inputs: ["hasErrors", "disabled"] }, { type: i1$3.λ4, selector: "sky-lookup", inputs: ["ariaLabel", "ariaLabelledBy", "autocompleteAttribute", "data", "disabled", "enableShowMore", "placeholderText", "idProperty", "showAddButton", "showMoreConfig", "selectMode", "wrapperClass"], outputs: ["addClick"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
999
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, decorators: [{
|
|
1000
|
+
type: Component,
|
|
1001
|
+
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]=\"lookupForm\"\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=\"currentSelection\"\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]=\"lookupForm\"\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=\"currentSelection\"\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"] }]
|
|
1002
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; } });
|
|
1003
|
+
|
|
1004
|
+
class SkyAgGridCellEditorLookupModule {
|
|
1005
|
+
}
|
|
1006
|
+
SkyAgGridCellEditorLookupModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorLookupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1007
|
+
SkyAgGridCellEditorLookupModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorLookupModule, declarations: [SkyAgGridCellEditorLookupComponent], imports: [CommonModule,
|
|
1008
|
+
ReactiveFormsModule,
|
|
1009
|
+
SkyI18nModule,
|
|
1010
|
+
SkyInputBoxModule,
|
|
1011
|
+
SkyLookupModule], exports: [SkyAgGridCellEditorLookupComponent] });
|
|
1012
|
+
SkyAgGridCellEditorLookupModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorLookupModule, imports: [[
|
|
1013
|
+
CommonModule,
|
|
1014
|
+
ReactiveFormsModule,
|
|
1015
|
+
SkyI18nModule,
|
|
1016
|
+
SkyInputBoxModule,
|
|
1017
|
+
SkyLookupModule,
|
|
1018
|
+
]] });
|
|
1019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorLookupModule, decorators: [{
|
|
1020
|
+
type: NgModule,
|
|
1021
|
+
args: [{
|
|
1022
|
+
declarations: [SkyAgGridCellEditorLookupComponent],
|
|
1023
|
+
exports: [SkyAgGridCellEditorLookupComponent],
|
|
1024
|
+
imports: [
|
|
1025
|
+
CommonModule,
|
|
1026
|
+
ReactiveFormsModule,
|
|
1027
|
+
SkyI18nModule,
|
|
1028
|
+
SkyInputBoxModule,
|
|
1029
|
+
SkyLookupModule,
|
|
1030
|
+
],
|
|
1031
|
+
}]
|
|
1032
|
+
}] });
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* @internal
|
|
1036
|
+
*/
|
|
1037
|
+
class SkyAgGridCellEditorNumberComponent {
|
|
1038
|
+
/**
|
|
1039
|
+
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
1040
|
+
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
1041
|
+
*/
|
|
1042
|
+
agInit(params) {
|
|
1043
|
+
this.params = params;
|
|
1044
|
+
this.value = this.params.value;
|
|
1045
|
+
this.columnHeader = this.params.colDef.headerName;
|
|
1046
|
+
this.rowNumber = this.params.rowIndex + 1;
|
|
1047
|
+
this.columnWidth = this.params.column.getActualWidth();
|
|
1048
|
+
this.rowHeightWithoutBorders =
|
|
1049
|
+
this.params.node && this.params.node.rowHeight - 4;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* 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.
|
|
1053
|
+
*/
|
|
1054
|
+
afterGuiAttached() {
|
|
1055
|
+
this.input.nativeElement.focus();
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
1059
|
+
*/
|
|
1060
|
+
getValue() {
|
|
1061
|
+
return this.value;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
SkyAgGridCellEditorNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1065
|
+
SkyAgGridCellEditorNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellEditorNumberComponent, selector: "sky-ag-grid-cell-editor-number", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorNumber"], descendants: true, read: ElementRef }], ngImport: i0, template: "<input\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 [(ngModel)]=\"value\"\n #skyCellEditorNumber\n/>\n", styles: ["input{border:none;text-align:right}\n"], directives: [{ type: i1$4.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1066
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, decorators: [{
|
|
1067
|
+
type: Component,
|
|
1068
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-number', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\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 [(ngModel)]=\"value\"\n #skyCellEditorNumber\n/>\n", styles: ["input{border:none;text-align:right}\n"] }]
|
|
1069
|
+
}], propDecorators: { input: [{
|
|
1070
|
+
type: ViewChild,
|
|
1071
|
+
args: ['skyCellEditorNumber', { read: ElementRef }]
|
|
1072
|
+
}] } });
|
|
1073
|
+
|
|
1074
|
+
class SkyAgGridCellEditorNumberModule {
|
|
1075
|
+
}
|
|
1076
|
+
SkyAgGridCellEditorNumberModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorNumberModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1077
|
+
SkyAgGridCellEditorNumberModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorNumberModule, declarations: [SkyAgGridCellEditorNumberComponent], imports: [SkyAgGridResourcesModule, FormsModule], exports: [SkyAgGridCellEditorNumberComponent] });
|
|
1078
|
+
SkyAgGridCellEditorNumberModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorNumberModule, imports: [[SkyAgGridResourcesModule, FormsModule]] });
|
|
1079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorNumberModule, decorators: [{
|
|
1080
|
+
type: NgModule,
|
|
1081
|
+
args: [{
|
|
1082
|
+
imports: [SkyAgGridResourcesModule, FormsModule],
|
|
1083
|
+
declarations: [SkyAgGridCellEditorNumberComponent],
|
|
1084
|
+
exports: [SkyAgGridCellEditorNumberComponent],
|
|
1085
|
+
}]
|
|
1086
|
+
}] });
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* @internal
|
|
1090
|
+
*/
|
|
1091
|
+
class SkyAgGridCellEditorTextComponent {
|
|
1092
|
+
/**
|
|
1093
|
+
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
1094
|
+
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
1095
|
+
*/
|
|
1096
|
+
agInit(params) {
|
|
1097
|
+
this.params = params;
|
|
1098
|
+
this.value = this.params.charPress || this.params.value;
|
|
1099
|
+
this.columnHeader = this.params.colDef.headerName;
|
|
1100
|
+
this.rowNumber = this.params.rowIndex + 1;
|
|
1101
|
+
this.columnWidth = this.params.column.getActualWidth();
|
|
1102
|
+
this.rowHeightWithoutBorders =
|
|
1103
|
+
this.params.node && this.params.node.rowHeight - 4;
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* 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.
|
|
1107
|
+
*/
|
|
1108
|
+
afterGuiAttached() {
|
|
1109
|
+
this.input.nativeElement.focus();
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
1113
|
+
*/
|
|
1114
|
+
getValue() {
|
|
1115
|
+
return this.value;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
SkyAgGridCellEditorTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1119
|
+
SkyAgGridCellEditorTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellEditorTextComponent, selector: "sky-ag-grid-cell-editor-text", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorText"], descendants: true, read: ElementRef }], ngImport: i0, template: "<input\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 [(ngModel)]=\"value\"\n #skyCellEditorText\n/>\n", styles: ["input{border:none;padding-left:11px}\n"], directives: [{ type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1120
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorTextComponent, decorators: [{
|
|
1121
|
+
type: Component,
|
|
1122
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-text', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\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 [(ngModel)]=\"value\"\n #skyCellEditorText\n/>\n", styles: ["input{border:none;padding-left:11px}\n"] }]
|
|
1123
|
+
}], propDecorators: { input: [{
|
|
1124
|
+
type: ViewChild,
|
|
1125
|
+
args: ['skyCellEditorText', { read: ElementRef }]
|
|
1126
|
+
}] } });
|
|
1127
|
+
|
|
1128
|
+
class SkyAgGridCellEditorTextModule {
|
|
1129
|
+
}
|
|
1130
|
+
SkyAgGridCellEditorTextModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorTextModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1131
|
+
SkyAgGridCellEditorTextModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorTextModule, declarations: [SkyAgGridCellEditorTextComponent], imports: [SkyAgGridResourcesModule, FormsModule], exports: [SkyAgGridCellEditorTextComponent] });
|
|
1132
|
+
SkyAgGridCellEditorTextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorTextModule, imports: [[SkyAgGridResourcesModule, FormsModule]] });
|
|
1133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellEditorTextModule, decorators: [{
|
|
1134
|
+
type: NgModule,
|
|
1135
|
+
args: [{
|
|
1136
|
+
imports: [SkyAgGridResourcesModule, FormsModule],
|
|
1137
|
+
declarations: [SkyAgGridCellEditorTextComponent],
|
|
1138
|
+
exports: [SkyAgGridCellEditorTextComponent],
|
|
1139
|
+
}]
|
|
1140
|
+
}] });
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* @internal
|
|
1144
|
+
*/
|
|
1145
|
+
class SkyAgGridCellValidatorTooltipComponent {
|
|
1146
|
+
constructor(changeDetector, zone) {
|
|
1147
|
+
this.changeDetector = changeDetector;
|
|
1148
|
+
this.zone = zone;
|
|
1149
|
+
this.indicatorShouldShow = true;
|
|
1150
|
+
this.popoverMessageStream = new Subject();
|
|
1151
|
+
}
|
|
1152
|
+
set params(value) {
|
|
1153
|
+
this.cellRendererParams = value;
|
|
1154
|
+
/*istanbul ignore next*/
|
|
1155
|
+
this.cellRendererParams.api?.addEventListener(Events.EVENT_CELL_FOCUSED, (eventParams) => {
|
|
1156
|
+
// We want to close any popovers that are opened when other cells are focused, but open a popover if the current cell is focused.
|
|
1157
|
+
if (eventParams.column.getColId() !==
|
|
1158
|
+
this.cellRendererParams.column.getColId() ||
|
|
1159
|
+
eventParams.rowIndex !== this.cellRendererParams.rowIndex) {
|
|
1160
|
+
this.hidePopover();
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
/*istanbul ignore next*/
|
|
1164
|
+
this.cellRendererParams.eGridCell?.addEventListener('keyup', (event) => {
|
|
1165
|
+
if (['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp'].includes(event.key)) {
|
|
1166
|
+
this.showPopover();
|
|
1167
|
+
}
|
|
1168
|
+
});
|
|
1169
|
+
/*istanbul ignore next*/
|
|
1170
|
+
this.cellRendererParams.api?.addEventListener(Events.EVENT_CELL_EDITING_STARTED, () => {
|
|
1171
|
+
this.hidePopover();
|
|
1172
|
+
});
|
|
1173
|
+
if (typeof this.cellRendererParams.skyComponentProperties
|
|
1174
|
+
?.validatorMessage === 'function') {
|
|
1175
|
+
this.validatorMessage =
|
|
1176
|
+
this.cellRendererParams.skyComponentProperties.validatorMessage(this.cellRendererParams.value, this.cellRendererParams.data, this.cellRendererParams.rowIndex);
|
|
1177
|
+
}
|
|
1178
|
+
else {
|
|
1179
|
+
this.validatorMessage =
|
|
1180
|
+
this.cellRendererParams.skyComponentProperties?.validatorMessage;
|
|
1181
|
+
}
|
|
1182
|
+
this.changeDetector.markForCheck();
|
|
1183
|
+
}
|
|
1184
|
+
hideIndicator() {
|
|
1185
|
+
this.zone.run(() => {
|
|
1186
|
+
this.indicatorShouldShow = false;
|
|
1187
|
+
this.changeDetector.detectChanges();
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
hidePopover() {
|
|
1191
|
+
this.popoverMessageStream.next({ type: SkyPopoverMessageType.Close });
|
|
1192
|
+
}
|
|
1193
|
+
showIndicator() {
|
|
1194
|
+
this.zone.run(() => {
|
|
1195
|
+
this.indicatorShouldShow = true;
|
|
1196
|
+
this.changeDetector.detectChanges();
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
showPopover() {
|
|
1200
|
+
this.popoverMessageStream.next({ type: SkyPopoverMessageType.Open });
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
SkyAgGridCellValidatorTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellValidatorTooltipComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
1204
|
+
SkyAgGridCellValidatorTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", 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 *ngIf=\"indicatorShouldShow\"\n descriptionType=\"none\"\n indicatorType=\"danger\"\n class=\"sky-pull-right\"\n ></sky-status-indicator>\n</div>\n<sky-popover\n #validatorPopover\n (popoverClosed)=\"showIndicator()\"\n (popoverOpened)=\"hideIndicator()\"\n popoverType=\"danger\"\n>\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"], components: [{ type: i1$7.λ10, selector: "sky-status-indicator", inputs: ["indicatorType", "descriptionType", "customDescription"] }, { type: i2$2.λ6, selector: "sky-popover", inputs: ["alignment", "dismissOnBlur", "placement", "popoverTitle", "popoverType"], outputs: ["popoverClosed", "popoverOpened"] }], directives: [{ type: i2$2.λ7, selector: "[skyPopover]", inputs: ["skyPopover", "skyPopoverAlignment", "skyPopoverMessageStream", "skyPopoverPlacement", "skyPopoverTrigger"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellValidatorTooltipComponent, decorators: [{
|
|
1206
|
+
type: Component,
|
|
1207
|
+
args: [{ selector: 'sky-ag-grid-cell-validator-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [skyPopover]=\"validatorPopover\"\n [skyPopoverMessageStream]=\"popoverMessageStream\"\n class=\"sky-validator-cell\"\n>\n <ng-content></ng-content>\n <sky-status-indicator\n *ngIf=\"indicatorShouldShow\"\n descriptionType=\"none\"\n indicatorType=\"danger\"\n class=\"sky-pull-right\"\n ></sky-status-indicator>\n</div>\n<sky-popover\n #validatorPopover\n (popoverClosed)=\"showIndicator()\"\n (popoverOpened)=\"hideIndicator()\"\n popoverType=\"danger\"\n>\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"] }]
|
|
1208
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }]; }, propDecorators: { params: [{
|
|
1209
|
+
type: Input
|
|
1210
|
+
}] } });
|
|
1211
|
+
|
|
1212
|
+
class SkyAgGridCellValidatorModule {
|
|
1213
|
+
}
|
|
1214
|
+
SkyAgGridCellValidatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellValidatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1215
|
+
SkyAgGridCellValidatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellValidatorModule, declarations: [SkyAgGridCellValidatorTooltipComponent], imports: [CommonModule, SkyPopoverModule, SkyStatusIndicatorModule], exports: [SkyAgGridCellValidatorTooltipComponent] });
|
|
1216
|
+
SkyAgGridCellValidatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellValidatorModule, imports: [[CommonModule, SkyPopoverModule, SkyStatusIndicatorModule]] });
|
|
1217
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellValidatorModule, decorators: [{
|
|
1218
|
+
type: NgModule,
|
|
1219
|
+
args: [{
|
|
1220
|
+
declarations: [SkyAgGridCellValidatorTooltipComponent],
|
|
1221
|
+
exports: [SkyAgGridCellValidatorTooltipComponent],
|
|
1222
|
+
imports: [CommonModule, SkyPopoverModule, SkyStatusIndicatorModule],
|
|
1223
|
+
}]
|
|
1224
|
+
}] });
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* @internal
|
|
1228
|
+
*/
|
|
1229
|
+
class SkyAgGridCellRendererCurrencyComponent {
|
|
1230
|
+
constructor() {
|
|
1231
|
+
this.skyComponentProperties = {};
|
|
1232
|
+
this.numericOptions = {};
|
|
1233
|
+
}
|
|
1234
|
+
set params(value) {
|
|
1235
|
+
this.agInit(value);
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* agInit is called by agGrid once after the renderer is created and provides the renderer with the information it needs.
|
|
1239
|
+
* @param params The cell renderer params that include data about the cell, column, row, and grid.
|
|
1240
|
+
*/
|
|
1241
|
+
agInit(params) {
|
|
1242
|
+
this.updateProperties(params);
|
|
1243
|
+
}
|
|
1244
|
+
refresh(params) {
|
|
1245
|
+
return false;
|
|
1246
|
+
}
|
|
1247
|
+
updateProperties(params) {
|
|
1248
|
+
this._params = params;
|
|
1249
|
+
this.value = this._params.value;
|
|
1250
|
+
this.columnHeader = this._params.colDef && this._params.colDef.headerName;
|
|
1251
|
+
this.rowNumber = this._params.rowIndex + 1;
|
|
1252
|
+
this.columnWidth = this._params.column?.getActualWidth();
|
|
1253
|
+
this.rowHeightWithoutBorders =
|
|
1254
|
+
this._params.node && this._params.node.rowHeight - 4;
|
|
1255
|
+
this.skyComponentProperties = this._params.skyComponentProperties || {};
|
|
1256
|
+
this.skyComponentProperties.format = 'currency';
|
|
1257
|
+
this.skyComponentProperties.minDigits = 2;
|
|
1258
|
+
this.skyComponentProperties.truncate = false;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
SkyAgGridCellRendererCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1262
|
+
SkyAgGridCellRendererCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellRendererCurrencyComponent, selector: "sky-ag-grid-cell-renderer-currency", inputs: { params: "params" }, ngImport: i0, template: "<span\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_renderer_currency_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n>\n {{ value | skyNumeric: skyComponentProperties }}\n</span>\n", styles: ["input{border:none;padding-left:11px}\n"], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe, "skyNumeric": i1.SkyNumericPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyComponent, decorators: [{
|
|
1264
|
+
type: Component,
|
|
1265
|
+
args: [{ selector: 'sky-ag-grid-cell-renderer-currency', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_renderer_currency_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n>\n {{ value | skyNumeric: skyComponentProperties }}\n</span>\n", styles: ["input{border:none;padding-left:11px}\n"] }]
|
|
1266
|
+
}], propDecorators: { params: [{
|
|
1267
|
+
type: Input
|
|
1268
|
+
}] } });
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* @internal
|
|
1272
|
+
*/
|
|
1273
|
+
class SkyAgGridCellRendererCurrencyValidatorComponent {
|
|
1274
|
+
constructor(changeDetector) {
|
|
1275
|
+
this.changeDetector = changeDetector;
|
|
1276
|
+
}
|
|
1277
|
+
set parameters(value) {
|
|
1278
|
+
this.agInit(value);
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* agInit is called by agGrid once after the renderer is created and provides the renderer with the information it needs.
|
|
1282
|
+
* @param params The cell renderer params that include data about the cell, column, row, and grid.
|
|
1283
|
+
*/
|
|
1284
|
+
agInit(params) {
|
|
1285
|
+
this.cellRendererParams = params;
|
|
1286
|
+
this.changeDetector.markForCheck();
|
|
1287
|
+
}
|
|
1288
|
+
isNumeric(value) {
|
|
1289
|
+
return !isNaN(parseFloat(value));
|
|
1290
|
+
}
|
|
1291
|
+
refresh(params) {
|
|
1292
|
+
return false;
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
SkyAgGridCellRendererCurrencyValidatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyValidatorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1296
|
+
SkyAgGridCellRendererCurrencyValidatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellRendererCurrencyValidatorComponent, selector: "sky-ag-grid-cell-renderer-currency-validator", inputs: { parameters: "parameters" }, ngImport: i0, template: "<sky-ag-grid-cell-validator-tooltip [params]=\"cellRendererParams\">\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", components: [{ type: SkyAgGridCellValidatorTooltipComponent, selector: "sky-ag-grid-cell-validator-tooltip", inputs: ["params"] }, { type: SkyAgGridCellRendererCurrencyComponent, selector: "sky-ag-grid-cell-renderer-currency", inputs: ["params"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyValidatorComponent, decorators: [{
|
|
1298
|
+
type: Component,
|
|
1299
|
+
args: [{ selector: 'sky-ag-grid-cell-renderer-currency-validator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-ag-grid-cell-validator-tooltip [params]=\"cellRendererParams\">\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" }]
|
|
1300
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { parameters: [{
|
|
1301
|
+
type: Input
|
|
1302
|
+
}] } });
|
|
1303
|
+
|
|
1304
|
+
class SkyAgGridCellRendererCurrencyModule {
|
|
1305
|
+
}
|
|
1306
|
+
SkyAgGridCellRendererCurrencyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1307
|
+
SkyAgGridCellRendererCurrencyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyModule, declarations: [SkyAgGridCellRendererCurrencyComponent,
|
|
1308
|
+
SkyAgGridCellRendererCurrencyValidatorComponent], imports: [CommonModule,
|
|
1309
|
+
SkyAgGridResourcesModule,
|
|
1310
|
+
SkyAgGridCellValidatorModule,
|
|
1311
|
+
FormsModule,
|
|
1312
|
+
SkyNumericModule], exports: [SkyAgGridCellRendererCurrencyComponent,
|
|
1313
|
+
SkyAgGridCellRendererCurrencyValidatorComponent] });
|
|
1314
|
+
SkyAgGridCellRendererCurrencyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyModule, imports: [[
|
|
1315
|
+
CommonModule,
|
|
1316
|
+
SkyAgGridResourcesModule,
|
|
1317
|
+
SkyAgGridCellValidatorModule,
|
|
1318
|
+
FormsModule,
|
|
1319
|
+
SkyNumericModule,
|
|
1320
|
+
]] });
|
|
1321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererCurrencyModule, decorators: [{
|
|
1322
|
+
type: NgModule,
|
|
1323
|
+
args: [{
|
|
1324
|
+
imports: [
|
|
1325
|
+
CommonModule,
|
|
1326
|
+
SkyAgGridResourcesModule,
|
|
1327
|
+
SkyAgGridCellValidatorModule,
|
|
1328
|
+
FormsModule,
|
|
1329
|
+
SkyNumericModule,
|
|
1330
|
+
],
|
|
1331
|
+
declarations: [
|
|
1332
|
+
SkyAgGridCellRendererCurrencyComponent,
|
|
1333
|
+
SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
1334
|
+
],
|
|
1335
|
+
exports: [
|
|
1336
|
+
SkyAgGridCellRendererCurrencyComponent,
|
|
1337
|
+
SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
1338
|
+
],
|
|
1339
|
+
}]
|
|
1340
|
+
}] });
|
|
1341
|
+
|
|
1342
|
+
class SkyAgGridCellRendererLookupComponent {
|
|
1343
|
+
constructor(changeDetector) {
|
|
1344
|
+
this.changeDetector = changeDetector;
|
|
1345
|
+
this.value = '';
|
|
1346
|
+
this.summaryCount = 0;
|
|
1347
|
+
}
|
|
1348
|
+
agInit(params) {
|
|
1349
|
+
this.lookupProperties = applySkyLookupPropertiesDefaults(params);
|
|
1350
|
+
this.summaryCount = params.value?.length || 0;
|
|
1351
|
+
this.value = `${params.valueFormatted}`;
|
|
1352
|
+
this.changeDetector.markForCheck();
|
|
1353
|
+
}
|
|
1354
|
+
refresh(params) {
|
|
1355
|
+
this.agInit(params);
|
|
1356
|
+
return true;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
SkyAgGridCellRendererLookupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererLookupComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1360
|
+
SkyAgGridCellRendererLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellRendererLookupComponent, selector: "sky-cell-renderer-lookup", ngImport: i0, 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"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererLookupComponent, decorators: [{
|
|
1362
|
+
type: Component,
|
|
1363
|
+
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"] }]
|
|
1364
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
1365
|
+
|
|
1366
|
+
class SkyAgGridCellRendererLookupModule {
|
|
1367
|
+
}
|
|
1368
|
+
SkyAgGridCellRendererLookupModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererLookupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1369
|
+
SkyAgGridCellRendererLookupModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererLookupModule, declarations: [SkyAgGridCellRendererLookupComponent], imports: [CommonModule, SkyAgGridResourcesModule], exports: [SkyAgGridCellRendererLookupComponent] });
|
|
1370
|
+
SkyAgGridCellRendererLookupModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererLookupModule, imports: [[CommonModule, SkyAgGridResourcesModule]] });
|
|
1371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererLookupModule, decorators: [{
|
|
1372
|
+
type: NgModule,
|
|
1373
|
+
args: [{
|
|
1374
|
+
declarations: [SkyAgGridCellRendererLookupComponent],
|
|
1375
|
+
exports: [SkyAgGridCellRendererLookupComponent],
|
|
1376
|
+
imports: [CommonModule, SkyAgGridResourcesModule],
|
|
1377
|
+
}]
|
|
1378
|
+
}] });
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* @internal
|
|
1382
|
+
*/
|
|
1383
|
+
class SkyAgGridCellRendererRowSelectorComponent {
|
|
1384
|
+
constructor(changeDetection) {
|
|
1385
|
+
this.changeDetection = changeDetection;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* agInit is called by agGrid once after the cell is created and provides the renderer with the information it needs.
|
|
1389
|
+
* @param params The cell renderer params that include data about the cell, column, row, and grid.
|
|
1390
|
+
*/
|
|
1391
|
+
agInit(params) {
|
|
1392
|
+
this.params = params;
|
|
1393
|
+
this.dataField = this.params.colDef && this.params.colDef.field;
|
|
1394
|
+
this.rowNode = this.params.node;
|
|
1395
|
+
this.rowNumber = this.params.rowIndex + 1;
|
|
1396
|
+
if (this.dataField) {
|
|
1397
|
+
this.checked = this.params.value;
|
|
1398
|
+
this.rowNode.setSelected(this.checked);
|
|
1399
|
+
}
|
|
1400
|
+
else {
|
|
1401
|
+
this.checked = this.rowNode.isSelected();
|
|
1402
|
+
}
|
|
1403
|
+
this.rowNode.addEventListener(RowNode.EVENT_ROW_SELECTED, (event) => {
|
|
1404
|
+
this.rowSelectedListener(event);
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* Used by agGrid to update cell value after a user triggers a refresh. It updates the cell DOM and returns true when the refresh is
|
|
1409
|
+
* successful, or false if the cell should be destroyed and rerendered. If consumers have external logic that changes the value of a
|
|
1410
|
+
* checkbox cell, rerendering it will gurantee the change applies without knowing the consumer's implementation.
|
|
1411
|
+
*/
|
|
1412
|
+
refresh() {
|
|
1413
|
+
return false;
|
|
1414
|
+
}
|
|
1415
|
+
updateRow() {
|
|
1416
|
+
this.rowNode.setSelected(this.checked);
|
|
1417
|
+
if (this.dataField) {
|
|
1418
|
+
this.rowNode.data[this.dataField] = this.checked;
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
rowSelectedListener(event) {
|
|
1422
|
+
this.checked = event.node.isSelected();
|
|
1423
|
+
if (this.dataField) {
|
|
1424
|
+
this.rowNode.data[this.dataField] = this.checked;
|
|
1425
|
+
}
|
|
1426
|
+
this.changeDetection.markForCheck();
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
SkyAgGridCellRendererRowSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererRowSelectorComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1430
|
+
SkyAgGridCellRendererRowSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", 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"], components: [{ type: i1$6.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }], directives: [{ type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererRowSelectorComponent, decorators: [{
|
|
1432
|
+
type: Component,
|
|
1433
|
+
args: [{ selector: 'sky-ag-grid-cell-renderer-row-selector', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, 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"] }]
|
|
1434
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
|
|
1435
|
+
|
|
1436
|
+
class SkyAgGridCellRendererRowSelectorModule {
|
|
1437
|
+
}
|
|
1438
|
+
SkyAgGridCellRendererRowSelectorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererRowSelectorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1439
|
+
SkyAgGridCellRendererRowSelectorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererRowSelectorModule, declarations: [SkyAgGridCellRendererRowSelectorComponent], imports: [SkyAgGridResourcesModule, SkyCheckboxModule, FormsModule], exports: [SkyAgGridCellRendererRowSelectorComponent] });
|
|
1440
|
+
SkyAgGridCellRendererRowSelectorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererRowSelectorModule, imports: [[SkyAgGridResourcesModule, SkyCheckboxModule, FormsModule]] });
|
|
1441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererRowSelectorModule, decorators: [{
|
|
1442
|
+
type: NgModule,
|
|
1443
|
+
args: [{
|
|
1444
|
+
imports: [SkyAgGridResourcesModule, SkyCheckboxModule, FormsModule],
|
|
1445
|
+
declarations: [SkyAgGridCellRendererRowSelectorComponent],
|
|
1446
|
+
exports: [SkyAgGridCellRendererRowSelectorComponent],
|
|
1447
|
+
}]
|
|
1448
|
+
}] });
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* @internal
|
|
1452
|
+
*/
|
|
1453
|
+
class SkyAgGridCellRendererValidatorTooltipComponent {
|
|
1454
|
+
constructor(changeDetector) {
|
|
1455
|
+
this.changeDetector = changeDetector;
|
|
1456
|
+
}
|
|
1457
|
+
set params(value) {
|
|
1458
|
+
this.agInit(value);
|
|
1459
|
+
}
|
|
1460
|
+
agInit(params) {
|
|
1461
|
+
this.cellRendererParams = params;
|
|
1462
|
+
if (typeof params.colDef?.valueFormatter === 'function') {
|
|
1463
|
+
this.value = params.colDef.valueFormatter(params);
|
|
1464
|
+
}
|
|
1465
|
+
else {
|
|
1466
|
+
this.value = params.value;
|
|
1467
|
+
}
|
|
1468
|
+
this.changeDetector.markForCheck();
|
|
1469
|
+
}
|
|
1470
|
+
refresh(params) {
|
|
1471
|
+
return false;
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
SkyAgGridCellRendererValidatorTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1475
|
+
SkyAgGridCellRendererValidatorTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyAgGridCellRendererValidatorTooltipComponent, selector: "sky-ag-grid-cell-renderer-validator-tooltip", inputs: { params: "params" }, ngImport: i0, template: "<sky-ag-grid-cell-validator-tooltip [params]=\"cellRendererParams\">\n {{ value }}\n</sky-ag-grid-cell-validator-tooltip>\n", components: [{ type: SkyAgGridCellValidatorTooltipComponent, selector: "sky-ag-grid-cell-validator-tooltip", inputs: ["params"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipComponent, decorators: [{
|
|
1477
|
+
type: Component,
|
|
1478
|
+
args: [{ selector: 'sky-ag-grid-cell-renderer-validator-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-ag-grid-cell-validator-tooltip [params]=\"cellRendererParams\">\n {{ value }}\n</sky-ag-grid-cell-validator-tooltip>\n" }]
|
|
1479
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { params: [{
|
|
1480
|
+
type: Input
|
|
1481
|
+
}] } });
|
|
1482
|
+
|
|
1483
|
+
class SkyAgGridCellRendererValidatorTooltipModule {
|
|
1484
|
+
}
|
|
1485
|
+
SkyAgGridCellRendererValidatorTooltipModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1486
|
+
SkyAgGridCellRendererValidatorTooltipModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipModule, declarations: [SkyAgGridCellRendererValidatorTooltipComponent], imports: [SkyAgGridCellValidatorModule], exports: [SkyAgGridCellRendererValidatorTooltipComponent] });
|
|
1487
|
+
SkyAgGridCellRendererValidatorTooltipModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipModule, imports: [[SkyAgGridCellValidatorModule]] });
|
|
1488
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridCellRendererValidatorTooltipModule, decorators: [{
|
|
1489
|
+
type: NgModule,
|
|
1490
|
+
args: [{
|
|
1491
|
+
declarations: [SkyAgGridCellRendererValidatorTooltipComponent],
|
|
1492
|
+
exports: [SkyAgGridCellRendererValidatorTooltipComponent],
|
|
1493
|
+
imports: [SkyAgGridCellValidatorModule],
|
|
1494
|
+
}]
|
|
1495
|
+
}] });
|
|
1496
|
+
|
|
1497
|
+
class SkyAgGridModule {
|
|
1498
|
+
}
|
|
1499
|
+
SkyAgGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1500
|
+
SkyAgGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridModule, declarations: [SkyAgGridDataManagerAdapterDirective,
|
|
1501
|
+
SkyAgGridRowDeleteComponent,
|
|
1502
|
+
SkyAgGridRowDeleteDirective,
|
|
1503
|
+
SkyAgGridWrapperComponent], imports: [AgGridModule,
|
|
1504
|
+
CommonModule,
|
|
1505
|
+
SkyAgGridCellEditorAutocompleteModule,
|
|
1506
|
+
SkyAgGridCellEditorDatepickerModule,
|
|
1507
|
+
SkyAgGridCellEditorLookupModule,
|
|
1508
|
+
SkyAgGridCellEditorNumberModule,
|
|
1509
|
+
SkyAgGridCellEditorCurrencyModule,
|
|
1510
|
+
SkyAgGridCellRendererCurrencyModule,
|
|
1511
|
+
SkyAgGridCellRendererLookupModule,
|
|
1512
|
+
SkyAgGridCellRendererRowSelectorModule,
|
|
1513
|
+
SkyAgGridCellRendererValidatorTooltipModule,
|
|
1514
|
+
SkyAgGridCellValidatorModule,
|
|
1515
|
+
SkyAgGridCellEditorTextModule,
|
|
1516
|
+
SkyDataManagerModule,
|
|
1517
|
+
SkyInlineDeleteModule,
|
|
1518
|
+
SkyViewkeeperModule], exports: [SkyAgGridDataManagerAdapterDirective,
|
|
1519
|
+
SkyAgGridRowDeleteComponent,
|
|
1520
|
+
SkyAgGridRowDeleteDirective,
|
|
1521
|
+
SkyAgGridWrapperComponent] });
|
|
1522
|
+
SkyAgGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridModule, imports: [[
|
|
1523
|
+
AgGridModule,
|
|
1524
|
+
CommonModule,
|
|
1525
|
+
SkyAgGridCellEditorAutocompleteModule,
|
|
1526
|
+
SkyAgGridCellEditorDatepickerModule,
|
|
1527
|
+
SkyAgGridCellEditorLookupModule,
|
|
1528
|
+
SkyAgGridCellEditorNumberModule,
|
|
1529
|
+
SkyAgGridCellEditorCurrencyModule,
|
|
1530
|
+
SkyAgGridCellRendererCurrencyModule,
|
|
1531
|
+
SkyAgGridCellRendererLookupModule,
|
|
1532
|
+
SkyAgGridCellRendererRowSelectorModule,
|
|
1533
|
+
SkyAgGridCellRendererValidatorTooltipModule,
|
|
1534
|
+
SkyAgGridCellValidatorModule,
|
|
1535
|
+
SkyAgGridCellEditorTextModule,
|
|
1536
|
+
SkyDataManagerModule,
|
|
1537
|
+
SkyInlineDeleteModule,
|
|
1538
|
+
SkyViewkeeperModule,
|
|
1539
|
+
]] });
|
|
1540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridModule, decorators: [{
|
|
1541
|
+
type: NgModule,
|
|
1542
|
+
args: [{
|
|
1543
|
+
declarations: [
|
|
1544
|
+
SkyAgGridDataManagerAdapterDirective,
|
|
1545
|
+
SkyAgGridRowDeleteComponent,
|
|
1546
|
+
SkyAgGridRowDeleteDirective,
|
|
1547
|
+
SkyAgGridWrapperComponent,
|
|
1548
|
+
],
|
|
1549
|
+
imports: [
|
|
1550
|
+
AgGridModule,
|
|
1551
|
+
CommonModule,
|
|
1552
|
+
SkyAgGridCellEditorAutocompleteModule,
|
|
1553
|
+
SkyAgGridCellEditorDatepickerModule,
|
|
1554
|
+
SkyAgGridCellEditorLookupModule,
|
|
1555
|
+
SkyAgGridCellEditorNumberModule,
|
|
1556
|
+
SkyAgGridCellEditorCurrencyModule,
|
|
1557
|
+
SkyAgGridCellRendererCurrencyModule,
|
|
1558
|
+
SkyAgGridCellRendererLookupModule,
|
|
1559
|
+
SkyAgGridCellRendererRowSelectorModule,
|
|
1560
|
+
SkyAgGridCellRendererValidatorTooltipModule,
|
|
1561
|
+
SkyAgGridCellValidatorModule,
|
|
1562
|
+
SkyAgGridCellEditorTextModule,
|
|
1563
|
+
SkyDataManagerModule,
|
|
1564
|
+
SkyInlineDeleteModule,
|
|
1565
|
+
SkyViewkeeperModule,
|
|
1566
|
+
],
|
|
1567
|
+
exports: [
|
|
1568
|
+
SkyAgGridDataManagerAdapterDirective,
|
|
1569
|
+
SkyAgGridRowDeleteComponent,
|
|
1570
|
+
SkyAgGridRowDeleteDirective,
|
|
1571
|
+
SkyAgGridWrapperComponent,
|
|
1572
|
+
],
|
|
1573
|
+
}]
|
|
1574
|
+
}] });
|
|
1575
|
+
|
|
1576
|
+
/**
|
|
1577
|
+
* @internal
|
|
1578
|
+
*/
|
|
1579
|
+
var SkyCellClass;
|
|
1580
|
+
(function (SkyCellClass) {
|
|
1581
|
+
SkyCellClass["Autocomplete"] = "sky-ag-grid-cell-autocomplete";
|
|
1582
|
+
SkyCellClass["Currency"] = "sky-ag-grid-cell-currency";
|
|
1583
|
+
SkyCellClass["Date"] = "sky-ag-grid-cell-date";
|
|
1584
|
+
SkyCellClass["Editable"] = "sky-ag-grid-cell-editable";
|
|
1585
|
+
SkyCellClass["Invalid"] = "sky-ag-grid-cell-invalid";
|
|
1586
|
+
SkyCellClass["Lookup"] = "sky-ag-grid-cell-lookup";
|
|
1587
|
+
SkyCellClass["Number"] = "sky-ag-grid-cell-number";
|
|
1588
|
+
SkyCellClass["RowSelector"] = "sky-ag-grid-cell-row-selector";
|
|
1589
|
+
SkyCellClass["Text"] = "sky-ag-grid-cell-text";
|
|
1590
|
+
SkyCellClass["Uneditable"] = "sky-ag-grid-cell-uneditable";
|
|
1591
|
+
})(SkyCellClass || (SkyCellClass = {}));
|
|
1592
|
+
|
|
1593
|
+
/**
|
|
1594
|
+
* 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.
|
|
1595
|
+
* <br/>
|
|
1596
|
+
* Any [SKY UX component](https://developer.blackbaud.com/skyux/components) can be made into a [cell editor](https://www.ag-grid.com/javascript-grid-cell-editor/) or [cell renderer](https://www.ag-grid.com/javascript-grid-cell-rendering-components/) component. If you would like to use a component that does not have a column definition yet, please consider [contributing it](https://developer.blackbaud.com/skyux/contribute/contribution-process) to the SKY UX data entry grid module, or [file an issue](https://developer.blackbaud.com/skyux/contribute/contribution-process/file-issue) in the [`@skyux/ag-grid` repo](https://github.com/blackbaud/skyux-ag-grid).
|
|
1597
|
+
*/
|
|
1598
|
+
var SkyCellType;
|
|
1599
|
+
(function (SkyCellType) {
|
|
1600
|
+
/**
|
|
1601
|
+
* **Edit mode**
|
|
1602
|
+
* <br/>
|
|
1603
|
+
* Specifies that cells in the column will be edited as [SKY UX autocomplete components](https://developer.blackbaud.com/skyux/components/autocomplete). You can set any of the autocomplete component's properties by passing `SkyCellEditorAutocompleteParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/javascript-grid-cell-editing/#dynamic-parameters) based on other cell values. See the demo for an example. Text can be entered and a value selected from the provided list.
|
|
1604
|
+
* <br/><br/>
|
|
1605
|
+
* **Read-only mode**
|
|
1606
|
+
* <br/>
|
|
1607
|
+
* Specifies that cells the column will display the currently selected value's name property by default. If the autocomplete needs to show a different property or needs to be formatted in any way, you can [define a `valueFormatter`](https://www.ag-grid.com/javascript-grid-value-formatters/) on the column definition.
|
|
1608
|
+
*/
|
|
1609
|
+
SkyCellType["Autocomplete"] = "skyCellAutocomplete";
|
|
1610
|
+
/**
|
|
1611
|
+
* **Edit mode**
|
|
1612
|
+
* <br/>
|
|
1613
|
+
* Specifies that cells in the column will be edited as a currency amount.
|
|
1614
|
+
* <br/><br/>
|
|
1615
|
+
* **Read-only mode**
|
|
1616
|
+
* <br/>
|
|
1617
|
+
* Formats the display as currency using [SKY UX numeric components](https://developer.blackbaud.com/skyux/components/numeric).
|
|
1618
|
+
*/
|
|
1619
|
+
SkyCellType["Currency"] = "skyCellCurrency";
|
|
1620
|
+
/**
|
|
1621
|
+
* **Edit and read-only modes**
|
|
1622
|
+
* <br/>
|
|
1623
|
+
* Combines SkyCellType.Currency and SkyCellType.Validator, where the value is displayed as a currency and passed to a validator function.
|
|
1624
|
+
*/
|
|
1625
|
+
SkyCellType["CurrencyValidator"] = "skyCellCurrencyValidator";
|
|
1626
|
+
/**
|
|
1627
|
+
* **Edit mode**
|
|
1628
|
+
* <br/>
|
|
1629
|
+
* Specifies that cells in the column will be edited as [SKY UX datepicker components](https://developer.blackbaud.com/skyux/components/datepicker). You can set any of the datepicker component's properties by passing `SkyCellEditorDatepickerParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/javascript-grid-cell-editing/#dynamic-parameters) based on other cell values. See the demo for an example. Date values can be entered.
|
|
1630
|
+
* <br/><br/>
|
|
1631
|
+
* **Read-only mode**
|
|
1632
|
+
* <br/>
|
|
1633
|
+
* Specifies that cells in the column will display the currently selected date formatted as `MM-DD-YYYY`, or the date format of the locale passed to `getGridOptions()`. If you would like to overwrite this format, you can [define a `valueFormatter`](https://www.ag-grid.com/javascript-grid-value-formatters/) on the column definition. See the demo for an example.
|
|
1634
|
+
*/
|
|
1635
|
+
SkyCellType["Date"] = "skyCellDate";
|
|
1636
|
+
/**
|
|
1637
|
+
* **Edit mode**
|
|
1638
|
+
* <br/>
|
|
1639
|
+
* Specifies that cells in the column will be edited as [SKY UX lookup components](https://developer.blackbaud.com/skyux-v5/components/lookup). You can set any of the lookup component's properties by passing `SkyCellEditorLookupParams` in the [column definition's `cellEditorParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing). These params can be updated as other cell edits are made or [provided dynamically](https://www.ag-grid.com/javascript-grid-cell-editing/#dynamic-parameters) based on other cell values. See the demo for an example. Text can be entered and a value selected from the provided list.
|
|
1640
|
+
* <br/><br/>
|
|
1641
|
+
* **Read-only mode**
|
|
1642
|
+
* <br/>
|
|
1643
|
+
* Specifies that cells the column will display, by default, either: the name(s) of the selected value(s) if there are less than 6, or a summary count of the values if there are more than 5. If the lookup needs to show a different property or needs to be formatted in any way, you can [define a `valueFormatter`](https://www.ag-grid.com/javascript-grid-value-formatters/) on the column definition.
|
|
1644
|
+
*/
|
|
1645
|
+
SkyCellType["Lookup"] = "skyCellLookup";
|
|
1646
|
+
/**
|
|
1647
|
+
* **Edit mode**
|
|
1648
|
+
* <br/>
|
|
1649
|
+
* Specifies that cells in the column will be edited as HTML number `inputs`. Only numbers can be entered.
|
|
1650
|
+
* <br/><br/>
|
|
1651
|
+
* **Read-only mode**
|
|
1652
|
+
* <br/>
|
|
1653
|
+
* Specifies that cells in the column will render as the number value.
|
|
1654
|
+
*/
|
|
1655
|
+
SkyCellType["Number"] = "skyCellNumber";
|
|
1656
|
+
/**
|
|
1657
|
+
* **Edit and read-only modes**
|
|
1658
|
+
* <br/>
|
|
1659
|
+
* Combines SkyCellType.Number and SkyCellType.Validator, where the value is displayed as a number and passed to a validator function.
|
|
1660
|
+
*/
|
|
1661
|
+
SkyCellType["NumberValidator"] = "skyCellNumberValidator";
|
|
1662
|
+
/**
|
|
1663
|
+
* **Edit and read-only modes**
|
|
1664
|
+
* <br/>
|
|
1665
|
+
* Specifies that cells in the column will render as [SKY UX checkbox components](https://developer.blackbaud.com/skyux/components/checkbox). It allows the user to select multiple rows, and adds a highlight to selected rows. The [Ag Grid `rowNode`](https://www.ag-grid.com/javascript-grid-row-node/) will be updated to reflect the selected state.
|
|
1666
|
+
*/
|
|
1667
|
+
SkyCellType["RowSelector"] = "skyCellRowSelector";
|
|
1668
|
+
/**
|
|
1669
|
+
* **Edit mode**
|
|
1670
|
+
* <br/>
|
|
1671
|
+
* Specifies that cells in the column will be edited as HTML text `inputs`. Any characters can be entered.
|
|
1672
|
+
* <br/><br/>
|
|
1673
|
+
* **Read-only mode**
|
|
1674
|
+
* <br/>
|
|
1675
|
+
* Specifies cells in the column will render as their string value.
|
|
1676
|
+
*/
|
|
1677
|
+
SkyCellType["Text"] = "skyCellText";
|
|
1678
|
+
/**
|
|
1679
|
+
* **Edit and read-only modes**
|
|
1680
|
+
* <br/>
|
|
1681
|
+
* Specifies cell in the column will be passed to a validator function which flags erroneous entries. You can set the validator function and message by passing them to [column definition's `cellRendererParams` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing) as `skyComponentProperties.validator` and `skyComponentProperties.validatorMessage`. SkyCellType.Validator can be combined with other cell types, such as SkyCellType.Autocomplete or SkyCellType.Date, by using the array syntax for the [column definition's `type` property](https://www.ag-grid.com/angular-data-grid/column-properties/#reference-editing).
|
|
1682
|
+
*/
|
|
1683
|
+
SkyCellType["Validator"] = "skyCellValidator";
|
|
1684
|
+
})(SkyCellType || (SkyCellType = {}));
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* @internal
|
|
1688
|
+
*/
|
|
1689
|
+
var SkyHeaderClass;
|
|
1690
|
+
(function (SkyHeaderClass) {
|
|
1691
|
+
SkyHeaderClass["RightAligned"] = "sky-ag-grid-header-right-aligned";
|
|
1692
|
+
})(SkyHeaderClass || (SkyHeaderClass = {}));
|
|
1693
|
+
|
|
1694
|
+
function autocompleteComparator(value1, value2) {
|
|
1695
|
+
if (value1 && value2) {
|
|
1696
|
+
if (value1.name > value2.name) {
|
|
1697
|
+
return 1;
|
|
1698
|
+
}
|
|
1699
|
+
if (value1.name < value2.name) {
|
|
1700
|
+
return -1;
|
|
1701
|
+
}
|
|
1702
|
+
return 0;
|
|
1703
|
+
}
|
|
1704
|
+
return value1 ? 1 : -1;
|
|
1705
|
+
}
|
|
1706
|
+
function autocompleteFormatter(params) {
|
|
1707
|
+
return params.value && params.value.name;
|
|
1708
|
+
}
|
|
1709
|
+
function dateComparator(date1, date2) {
|
|
1710
|
+
let date1value = date1;
|
|
1711
|
+
let date2value = date2;
|
|
1712
|
+
if (typeof date1value === 'string') {
|
|
1713
|
+
date1value = new Date(date1);
|
|
1714
|
+
}
|
|
1715
|
+
if (typeof date2value === 'string') {
|
|
1716
|
+
date2value = new Date(date2);
|
|
1717
|
+
}
|
|
1718
|
+
if (date1value && date2value) {
|
|
1719
|
+
if (date1value > date2value) {
|
|
1720
|
+
return 1;
|
|
1721
|
+
}
|
|
1722
|
+
if (date1value < date2value) {
|
|
1723
|
+
return -1;
|
|
1724
|
+
}
|
|
1725
|
+
return 0;
|
|
1726
|
+
}
|
|
1727
|
+
return date1value ? 1 : -1;
|
|
1728
|
+
}
|
|
1729
|
+
function getValidatorCellRendererSelector(component, fallback) {
|
|
1730
|
+
return (params) => {
|
|
1731
|
+
if (params.colDef &&
|
|
1732
|
+
typeof params.colDef.cellRendererParams?.skyComponentProperties
|
|
1733
|
+
?.validator === 'function') {
|
|
1734
|
+
if (!params.colDef.cellRendererParams.skyComponentProperties.validator(params.value, params.data, params.rowIndex)) {
|
|
1735
|
+
return {
|
|
1736
|
+
component,
|
|
1737
|
+
params: {
|
|
1738
|
+
...params.colDef.cellRendererParams,
|
|
1739
|
+
},
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
return fallback;
|
|
1744
|
+
};
|
|
1745
|
+
}
|
|
1746
|
+
let rowNodeId = -1;
|
|
1747
|
+
/**
|
|
1748
|
+
* `SkyAgGridService` provides methods to get AG Grid `gridOptions` to ensure grids match SKY UX functionality. The `gridOptions` can be overridden, and include registered SKY UX column types.
|
|
1749
|
+
*/
|
|
1750
|
+
class SkyAgGridService {
|
|
1751
|
+
constructor(agGridAdapterService, themeSvc, resources) {
|
|
1752
|
+
this.agGridAdapterService = agGridAdapterService;
|
|
1753
|
+
this.themeSvc = themeSvc;
|
|
1754
|
+
this.resources = resources;
|
|
1755
|
+
this.ngUnsubscribe = new Subject();
|
|
1756
|
+
/*istanbul ignore else*/
|
|
1757
|
+
if (this.themeSvc) {
|
|
1758
|
+
this.themeSvc.settingsChange
|
|
1759
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1760
|
+
.subscribe((settingsChange) => (this.currentTheme = settingsChange.currentSettings));
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
ngOnDestroy() {
|
|
1764
|
+
this.ngUnsubscribe.next();
|
|
1765
|
+
this.ngUnsubscribe.complete();
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* 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.
|
|
1769
|
+
* @param args
|
|
1770
|
+
* @returns
|
|
1771
|
+
*/
|
|
1772
|
+
getGridOptions(args) {
|
|
1773
|
+
const defaultGridOptions = this.getDefaultGridOptions(args);
|
|
1774
|
+
const mergedGridOptions = this.mergeGridOptions(defaultGridOptions, args.gridOptions);
|
|
1775
|
+
return mergedGridOptions;
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* Returns [AG Grid `gridOptions`](https://www.ag-grid.com/javascript-grid-properties/) with default SKY UX options, styling, and cell editors registered for editable grids.
|
|
1779
|
+
* @param args
|
|
1780
|
+
* @returns
|
|
1781
|
+
*/
|
|
1782
|
+
getEditableGridOptions(args) {
|
|
1783
|
+
const defaultGridOptions = this.getDefaultEditableGridOptions(args);
|
|
1784
|
+
const mergedGridOptions = this.mergeGridOptions(defaultGridOptions, args.gridOptions);
|
|
1785
|
+
return mergedGridOptions;
|
|
1786
|
+
}
|
|
1787
|
+
mergeGridOptions(defaultGridOptions, providedGridOptions) {
|
|
1788
|
+
const mergedGridOptions = {
|
|
1789
|
+
...defaultGridOptions,
|
|
1790
|
+
...providedGridOptions,
|
|
1791
|
+
columnTypes: {
|
|
1792
|
+
...providedGridOptions.columnTypes,
|
|
1793
|
+
// apply default second to prevent consumers from overwriting our default column types
|
|
1794
|
+
...defaultGridOptions.columnTypes,
|
|
1795
|
+
},
|
|
1796
|
+
defaultColDef: {
|
|
1797
|
+
...defaultGridOptions.defaultColDef,
|
|
1798
|
+
...providedGridOptions.defaultColDef,
|
|
1799
|
+
// allow consumers to override all defaultColDef properties except cellClassRules, which we reserve for styling
|
|
1800
|
+
cellClassRules: defaultGridOptions.defaultColDef.cellClassRules,
|
|
1801
|
+
},
|
|
1802
|
+
icons: {
|
|
1803
|
+
...defaultGridOptions.icons,
|
|
1804
|
+
...providedGridOptions.icons,
|
|
1805
|
+
},
|
|
1806
|
+
};
|
|
1807
|
+
return mergedGridOptions;
|
|
1808
|
+
}
|
|
1809
|
+
getDefaultGridOptions(args) {
|
|
1810
|
+
// cellClassRules can be functions or string expressions
|
|
1811
|
+
const cellClassRuleTrueExpression = 'true';
|
|
1812
|
+
function getEditableFn(isUneditable) {
|
|
1813
|
+
return function (params) {
|
|
1814
|
+
let isEditable = params.colDef.editable;
|
|
1815
|
+
if (typeof isEditable === 'function') {
|
|
1816
|
+
const column = params.columnApi.getColumn(params.colDef.field);
|
|
1817
|
+
isEditable = isEditable({
|
|
1818
|
+
...params,
|
|
1819
|
+
column,
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
return isUneditable ? !isEditable : isEditable;
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
const editableCellClassRules = {
|
|
1826
|
+
[SkyCellClass.Editable]: getEditableFn(),
|
|
1827
|
+
[SkyCellClass.Uneditable]: getEditableFn(true),
|
|
1828
|
+
};
|
|
1829
|
+
function getValidatorFn() {
|
|
1830
|
+
return function (param) {
|
|
1831
|
+
if (param.colDef &&
|
|
1832
|
+
typeof param.colDef.cellRendererParams?.skyComponentProperties
|
|
1833
|
+
?.validator === 'function') {
|
|
1834
|
+
return !param.colDef.cellRendererParams.skyComponentProperties.validator(param.value, param.data, param.rowIndex);
|
|
1835
|
+
}
|
|
1836
|
+
return false;
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
const validatorCellClassRules = {
|
|
1840
|
+
[SkyCellClass.Invalid]: getValidatorFn(),
|
|
1841
|
+
};
|
|
1842
|
+
const defaultSkyGridOptions = {
|
|
1843
|
+
columnTypes: {
|
|
1844
|
+
[SkyCellType.Autocomplete]: {
|
|
1845
|
+
cellClassRules: {
|
|
1846
|
+
[SkyCellClass.Autocomplete]: cellClassRuleTrueExpression,
|
|
1847
|
+
...editableCellClassRules,
|
|
1848
|
+
},
|
|
1849
|
+
cellEditorFramework: SkyAgGridCellEditorAutocompleteComponent,
|
|
1850
|
+
valueFormatter: autocompleteFormatter,
|
|
1851
|
+
comparator: autocompleteComparator,
|
|
1852
|
+
minWidth: 185,
|
|
1853
|
+
},
|
|
1854
|
+
[SkyCellType.Currency]: {
|
|
1855
|
+
cellClassRules: {
|
|
1856
|
+
[SkyCellClass.Currency]: cellClassRuleTrueExpression,
|
|
1857
|
+
...validatorCellClassRules,
|
|
1858
|
+
...editableCellClassRules,
|
|
1859
|
+
},
|
|
1860
|
+
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-currency-validator', { component: 'sky-ag-grid-cell-renderer-currency' }),
|
|
1861
|
+
cellEditorFramework: SkyAgGridCellEditorCurrencyComponent,
|
|
1862
|
+
headerClass: SkyHeaderClass.RightAligned,
|
|
1863
|
+
minWidth: 185,
|
|
1864
|
+
},
|
|
1865
|
+
[SkyCellType.Date]: {
|
|
1866
|
+
cellClassRules: {
|
|
1867
|
+
[SkyCellClass.Date]: cellClassRuleTrueExpression,
|
|
1868
|
+
...editableCellClassRules,
|
|
1869
|
+
},
|
|
1870
|
+
cellEditorFramework: SkyAgGridCellEditorDatepickerComponent,
|
|
1871
|
+
comparator: dateComparator,
|
|
1872
|
+
minWidth: this.currentTheme?.theme?.name === 'modern' ? 180 : 160,
|
|
1873
|
+
valueFormatter: (params) => this.dateFormatter(params, args.locale),
|
|
1874
|
+
},
|
|
1875
|
+
[SkyCellType.Lookup]: {
|
|
1876
|
+
cellClassRules: {
|
|
1877
|
+
[SkyCellClass.Lookup]: cellClassRuleTrueExpression,
|
|
1878
|
+
...editableCellClassRules,
|
|
1879
|
+
},
|
|
1880
|
+
cellEditorFramework: SkyAgGridCellEditorLookupComponent,
|
|
1881
|
+
cellRendererFramework: SkyAgGridCellRendererLookupComponent,
|
|
1882
|
+
valueFormatter: (params) => {
|
|
1883
|
+
const lookupProperties = applySkyLookupPropertiesDefaults(params);
|
|
1884
|
+
return (params.value || [])
|
|
1885
|
+
.map((value) => {
|
|
1886
|
+
return value[lookupProperties.descriptorProperty];
|
|
1887
|
+
})
|
|
1888
|
+
.filter((value) => value !== '' && value !== undefined)
|
|
1889
|
+
.join('; ');
|
|
1890
|
+
},
|
|
1891
|
+
minWidth: 185,
|
|
1892
|
+
},
|
|
1893
|
+
[SkyCellType.Number]: {
|
|
1894
|
+
cellClassRules: {
|
|
1895
|
+
[SkyCellClass.Number]: cellClassRuleTrueExpression,
|
|
1896
|
+
...editableCellClassRules,
|
|
1897
|
+
},
|
|
1898
|
+
cellEditorFramework: SkyAgGridCellEditorNumberComponent,
|
|
1899
|
+
headerClass: SkyHeaderClass.RightAligned,
|
|
1900
|
+
},
|
|
1901
|
+
[SkyCellType.RowSelector]: {
|
|
1902
|
+
cellClassRules: {
|
|
1903
|
+
[SkyCellClass.RowSelector]: cellClassRuleTrueExpression,
|
|
1904
|
+
[SkyCellClass.Uneditable]: cellClassRuleTrueExpression,
|
|
1905
|
+
},
|
|
1906
|
+
cellRendererFramework: SkyAgGridCellRendererRowSelectorComponent,
|
|
1907
|
+
headerName: '',
|
|
1908
|
+
minWidth: 55,
|
|
1909
|
+
maxWidth: 55,
|
|
1910
|
+
sortable: false,
|
|
1911
|
+
width: 55,
|
|
1912
|
+
},
|
|
1913
|
+
[SkyCellType.Text]: {
|
|
1914
|
+
cellClassRules: {
|
|
1915
|
+
[SkyCellClass.Text]: cellClassRuleTrueExpression,
|
|
1916
|
+
...editableCellClassRules,
|
|
1917
|
+
},
|
|
1918
|
+
cellEditorFramework: SkyAgGridCellEditorTextComponent,
|
|
1919
|
+
},
|
|
1920
|
+
[SkyCellType.Validator]: {
|
|
1921
|
+
cellClassRules: {
|
|
1922
|
+
...validatorCellClassRules,
|
|
1923
|
+
...editableCellClassRules,
|
|
1924
|
+
},
|
|
1925
|
+
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
1926
|
+
},
|
|
1927
|
+
},
|
|
1928
|
+
defaultColDef: {
|
|
1929
|
+
cellClassRules: editableCellClassRules,
|
|
1930
|
+
minWidth: 100,
|
|
1931
|
+
resizable: true,
|
|
1932
|
+
sortable: true,
|
|
1933
|
+
suppressKeyboardEvent: (keypress) => this.suppressTab(keypress),
|
|
1934
|
+
},
|
|
1935
|
+
domLayout: 'autoHeight',
|
|
1936
|
+
enterMovesDownAfterEdit: true,
|
|
1937
|
+
frameworkComponents: {
|
|
1938
|
+
'sky-ag-grid-cell-renderer-currency': SkyAgGridCellRendererCurrencyComponent,
|
|
1939
|
+
'sky-ag-grid-cell-renderer-currency-validator': SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
1940
|
+
'sky-ag-grid-cell-renderer-validator-tooltip': SkyAgGridCellRendererValidatorTooltipComponent,
|
|
1941
|
+
},
|
|
1942
|
+
getRowNodeId(data) {
|
|
1943
|
+
if ('id' in data && data.id !== undefined) {
|
|
1944
|
+
return `${data.id}`;
|
|
1945
|
+
}
|
|
1946
|
+
return `${rowNodeId--}`;
|
|
1947
|
+
},
|
|
1948
|
+
getRowClass: (params) => {
|
|
1949
|
+
if (params.node.id) {
|
|
1950
|
+
return `sky-ag-grid-row-${params.node.id}`;
|
|
1951
|
+
}
|
|
1952
|
+
else {
|
|
1953
|
+
return undefined;
|
|
1954
|
+
}
|
|
1955
|
+
},
|
|
1956
|
+
headerHeight: this.currentTheme?.theme?.name === 'modern' ? 60 : 37,
|
|
1957
|
+
icons: {
|
|
1958
|
+
sortDescending: this.getIconTemplate('caret-down'),
|
|
1959
|
+
sortAscending: this.getIconTemplate('caret-up'),
|
|
1960
|
+
columnMoveMove: this.getIconTemplate('arrows'),
|
|
1961
|
+
columnMoveHide: this.getIconTemplate('arrows'),
|
|
1962
|
+
columnMoveLeft: this.getIconTemplate('arrows'),
|
|
1963
|
+
columnMoveRight: this.getIconTemplate('arrows'),
|
|
1964
|
+
columnMovePin: this.getIconTemplate('arrows'),
|
|
1965
|
+
},
|
|
1966
|
+
onCellFocused: () => this.onCellFocused(),
|
|
1967
|
+
rowHeight: this.currentTheme?.theme?.name === 'modern' ? 60 : 38,
|
|
1968
|
+
rowMultiSelectWithClick: true,
|
|
1969
|
+
rowSelection: 'multiple',
|
|
1970
|
+
singleClickEdit: true,
|
|
1971
|
+
// tslint:disable-next-line: no-null-keyword
|
|
1972
|
+
sortingOrder: ['desc', 'asc', null],
|
|
1973
|
+
stopEditingWhenGridLosesFocus: false,
|
|
1974
|
+
suppressRowClickSelection: true,
|
|
1975
|
+
suppressDragLeaveHidesColumns: true,
|
|
1976
|
+
};
|
|
1977
|
+
defaultSkyGridOptions.columnTypes[SkyCellType.CurrencyValidator] = {
|
|
1978
|
+
...defaultSkyGridOptions.columnTypes[SkyCellType.Currency],
|
|
1979
|
+
cellRendererParams: {
|
|
1980
|
+
skyComponentProperties: {
|
|
1981
|
+
validator: (value, data, rowIndex) => {
|
|
1982
|
+
return !!`${value || ''}`.match(/^[^0-9]*(\d+[,.]?)+\d*[^0-9]*$/);
|
|
1983
|
+
},
|
|
1984
|
+
validatorMessage: 'Please enter a valid currency',
|
|
1985
|
+
},
|
|
1986
|
+
},
|
|
1987
|
+
};
|
|
1988
|
+
/*istanbul ignore else*/
|
|
1989
|
+
if (this.resources) {
|
|
1990
|
+
this.resources
|
|
1991
|
+
.getString('sky_ag_grid_cell_renderer_currency_validator_message')
|
|
1992
|
+
.subscribe((value) => {
|
|
1993
|
+
defaultSkyGridOptions.columnTypes[SkyCellType.CurrencyValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
defaultSkyGridOptions.columnTypes[SkyCellType.NumberValidator] = {
|
|
1997
|
+
...defaultSkyGridOptions.columnTypes[SkyCellType.Validator],
|
|
1998
|
+
...defaultSkyGridOptions.columnTypes[SkyCellType.Number],
|
|
1999
|
+
cellClassRules: {
|
|
2000
|
+
...defaultSkyGridOptions.columnTypes[SkyCellType.Validator]
|
|
2001
|
+
.cellClassRules,
|
|
2002
|
+
...defaultSkyGridOptions.columnTypes[SkyCellType.Number].cellClassRules,
|
|
2003
|
+
},
|
|
2004
|
+
cellRendererParams: {
|
|
2005
|
+
skyComponentProperties: {
|
|
2006
|
+
validator: (value, data, rowIndex) => {
|
|
2007
|
+
return !!value && !isNaN(parseFloat(value));
|
|
2008
|
+
},
|
|
2009
|
+
validatorMessage: 'Please enter a valid number',
|
|
2010
|
+
},
|
|
2011
|
+
},
|
|
2012
|
+
};
|
|
2013
|
+
/*istanbul ignore else*/
|
|
2014
|
+
if (this.resources) {
|
|
2015
|
+
this.resources
|
|
2016
|
+
.getString('sky_ag_grid_cell_renderer_number_validator_message')
|
|
2017
|
+
.subscribe((value) => {
|
|
2018
|
+
defaultSkyGridOptions.columnTypes[SkyCellType.NumberValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
return defaultSkyGridOptions;
|
|
2022
|
+
}
|
|
2023
|
+
onCellFocused() {
|
|
2024
|
+
const currentElement = this.agGridAdapterService.getFocusedElement();
|
|
2025
|
+
this.agGridAdapterService.focusOnFocusableChildren(currentElement);
|
|
2026
|
+
}
|
|
2027
|
+
getDefaultEditableGridOptions(args) {
|
|
2028
|
+
const defaultGridOptions = this.getDefaultGridOptions(args);
|
|
2029
|
+
defaultGridOptions.rowSelection = 'none';
|
|
2030
|
+
return defaultGridOptions;
|
|
2031
|
+
}
|
|
2032
|
+
dateFormatter(params, locale = 'en-us') {
|
|
2033
|
+
const dateConfig = { year: 'numeric', month: '2-digit', day: '2-digit' };
|
|
2034
|
+
let date = params.value;
|
|
2035
|
+
if (date && typeof date === 'string') {
|
|
2036
|
+
date = new Date(params.value);
|
|
2037
|
+
}
|
|
2038
|
+
const formattedDate = date &&
|
|
2039
|
+
date.toLocaleDateString &&
|
|
2040
|
+
date.toLocaleDateString(locale, dateConfig);
|
|
2041
|
+
if (date && date.getTime && !isNaN(date.getTime())) {
|
|
2042
|
+
return formattedDate;
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
getIconTemplate(iconName) {
|
|
2046
|
+
return `<i class="fa fa-${iconName}"></i>`;
|
|
2047
|
+
}
|
|
2048
|
+
suppressTab(params) {
|
|
2049
|
+
if (params.event.code === 'Tab') {
|
|
2050
|
+
if (params.editing) {
|
|
2051
|
+
const currentlyFocusedEl = this.agGridAdapterService.getFocusedElement();
|
|
2052
|
+
// inline cell editors have the 'ag-cell' class, while popup editors have the 'ag-popup-editor' class
|
|
2053
|
+
const cellEl = this.agGridAdapterService.getElementOrParentWithClass(currentlyFocusedEl, 'ag-cell');
|
|
2054
|
+
const popupEl = this.agGridAdapterService.getElementOrParentWithClass(currentlyFocusedEl, 'ag-popup-editor');
|
|
2055
|
+
const parentEl = cellEl || popupEl;
|
|
2056
|
+
const nextFocusableElementInCell = this.agGridAdapterService.getNextFocusableElement(currentlyFocusedEl, parentEl, params.event.shiftKey);
|
|
2057
|
+
return !!nextFocusableElementInCell;
|
|
2058
|
+
}
|
|
2059
|
+
return true;
|
|
2060
|
+
}
|
|
2061
|
+
return false;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
SkyAgGridService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridService, deps: [{ token: SkyAgGridAdapterService }, { token: i1$5.SkyThemeService, optional: true }, { token: i3$1.SkyLibResourcesService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2065
|
+
SkyAgGridService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridService, providedIn: 'any' });
|
|
2066
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyAgGridService, decorators: [{
|
|
2067
|
+
type: Injectable,
|
|
2068
|
+
args: [{
|
|
2069
|
+
providedIn: 'any',
|
|
2070
|
+
}]
|
|
2071
|
+
}], ctorParameters: function () { return [{ type: SkyAgGridAdapterService }, { type: i1$5.SkyThemeService, decorators: [{
|
|
2072
|
+
type: Optional
|
|
2073
|
+
}] }, { type: i3$1.SkyLibResourcesService, decorators: [{
|
|
2074
|
+
type: Optional
|
|
2075
|
+
}] }]; } });
|
|
2076
|
+
|
|
2077
|
+
// Export any types that should be included in the root.
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* Generated bundle index. Do not edit.
|
|
2081
|
+
*/
|
|
2082
|
+
|
|
2083
|
+
export { SkyAgGridModule, SkyAgGridService, SkyCellClass, SkyCellType, SkyHeaderClass, SkyAgGridCellEditorAutocompleteComponent as λ1, SkyAgGridCellRendererValidatorTooltipComponent as λ10, SkyAgGridCellValidatorTooltipComponent as λ11, SkyAgGridWrapperComponent as λ12, SkyAgGridRowDeleteDirective as λ13, SkyAgGridDataManagerAdapterDirective as λ14, SkyAgGridCellEditorTextComponent as λ2, SkyAgGridCellEditorCurrencyComponent as λ3, SkyAgGridCellEditorNumberComponent as λ4, SkyAgGridCellEditorDatepickerComponent as λ5, SkyAgGridRowDeleteComponent as λ6, SkyAgGridCellRendererRowSelectorComponent as λ7, SkyAgGridCellRendererCurrencyValidatorComponent as λ8, SkyAgGridCellRendererCurrencyComponent as λ9 };
|
|
2084
|
+
//# sourceMappingURL=skyux-ag-grid.mjs.map
|