@skyux/ag-grid 5.7.0 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation.json +5 -5
- 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 +33 -20
- 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
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
import { Injectable, Optional } from '@angular/core';
|
|
2
|
-
import { SkyLibResourcesService } from '@skyux/i18n';
|
|
3
|
-
import { SkyThemeService } from '@skyux/theme';
|
|
4
|
-
import { Subject } from 'rxjs';
|
|
5
|
-
import { takeUntil } from 'rxjs/operators';
|
|
6
|
-
import { SkyAgGridAdapterService } from './ag-grid-adapter.service';
|
|
7
|
-
import { SkyAgGridCellEditorAutocompleteComponent } from './cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component';
|
|
8
|
-
import { SkyAgGridCellEditorCurrencyComponent } from './cell-editors/cell-editor-currency/cell-editor-currency.component';
|
|
9
|
-
import { SkyAgGridCellEditorDatepickerComponent } from './cell-editors/cell-editor-datepicker/cell-editor-datepicker.component';
|
|
10
|
-
import { SkyAgGridCellEditorLookupComponent } from './cell-editors/cell-editor-lookup/cell-editor-lookup.component';
|
|
11
|
-
import { SkyAgGridCellEditorNumberComponent } from './cell-editors/cell-editor-number/cell-editor-number.component';
|
|
12
|
-
import { SkyAgGridCellEditorTextComponent } from './cell-editors/cell-editor-text/cell-editor-text.component';
|
|
13
|
-
import { SkyAgGridCellRendererCurrencyValidatorComponent } from './cell-renderers/cell-renderer-currency/cell-renderer-currency-validator.component';
|
|
14
|
-
import { SkyAgGridCellRendererCurrencyComponent } from './cell-renderers/cell-renderer-currency/cell-renderer-currency.component';
|
|
15
|
-
import { SkyAgGridCellRendererLookupComponent } from './cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component';
|
|
16
|
-
import { SkyAgGridCellRendererRowSelectorComponent } from './cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.component';
|
|
17
|
-
import { SkyAgGridCellRendererValidatorTooltipComponent } from './cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.component';
|
|
18
|
-
import { SkyCellClass } from './types/cell-class';
|
|
19
|
-
import { SkyCellType } from './types/cell-type';
|
|
20
|
-
import { SkyHeaderClass } from './types/header-class';
|
|
21
|
-
import { applySkyLookupPropertiesDefaults } from './types/lookup-properties';
|
|
22
|
-
import * as i0 from "@angular/core";
|
|
23
|
-
import * as i1 from "./ag-grid-adapter.service";
|
|
24
|
-
import * as i2 from "@skyux/theme";
|
|
25
|
-
import * as i3 from "@skyux/i18n";
|
|
26
|
-
function autocompleteComparator(value1, value2) {
|
|
27
|
-
if (value1 && value2) {
|
|
28
|
-
if (value1.name > value2.name) {
|
|
29
|
-
return 1;
|
|
30
|
-
}
|
|
31
|
-
if (value1.name < value2.name) {
|
|
32
|
-
return -1;
|
|
33
|
-
}
|
|
34
|
-
return 0;
|
|
35
|
-
}
|
|
36
|
-
return value1 ? 1 : -1;
|
|
37
|
-
}
|
|
38
|
-
function autocompleteFormatter(params) {
|
|
39
|
-
return params.value && params.value.name;
|
|
40
|
-
}
|
|
41
|
-
function dateComparator(date1, date2) {
|
|
42
|
-
let date1value = date1;
|
|
43
|
-
let date2value = date2;
|
|
44
|
-
if (typeof date1value === 'string') {
|
|
45
|
-
date1value = new Date(date1);
|
|
46
|
-
}
|
|
47
|
-
if (typeof date2value === 'string') {
|
|
48
|
-
date2value = new Date(date2);
|
|
49
|
-
}
|
|
50
|
-
if (date1value && date2value) {
|
|
51
|
-
if (date1value > date2value) {
|
|
52
|
-
return 1;
|
|
53
|
-
}
|
|
54
|
-
if (date1value < date2value) {
|
|
55
|
-
return -1;
|
|
56
|
-
}
|
|
57
|
-
return 0;
|
|
58
|
-
}
|
|
59
|
-
return date1value ? 1 : -1;
|
|
60
|
-
}
|
|
61
|
-
function getValidatorCellRendererSelector(component, fallback) {
|
|
62
|
-
return (params) => {
|
|
63
|
-
var _a, _b;
|
|
64
|
-
if (params.colDef &&
|
|
65
|
-
typeof ((_b = (_a = params.colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.validator) === 'function') {
|
|
66
|
-
if (!params.colDef.cellRendererParams.skyComponentProperties.validator(params.value, params.data, params.rowIndex)) {
|
|
67
|
-
return {
|
|
68
|
-
component,
|
|
69
|
-
params: Object.assign({}, params.colDef.cellRendererParams),
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return fallback;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
let rowNodeId = -1;
|
|
77
|
-
/**
|
|
78
|
-
* `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.
|
|
79
|
-
*/
|
|
80
|
-
export class SkyAgGridService {
|
|
81
|
-
constructor(agGridAdapterService, themeSvc, resources) {
|
|
82
|
-
this.agGridAdapterService = agGridAdapterService;
|
|
83
|
-
this.themeSvc = themeSvc;
|
|
84
|
-
this.resources = resources;
|
|
85
|
-
this.ngUnsubscribe = new Subject();
|
|
86
|
-
/*istanbul ignore else*/
|
|
87
|
-
if (this.themeSvc) {
|
|
88
|
-
this.themeSvc.settingsChange
|
|
89
|
-
.pipe(takeUntil(this.ngUnsubscribe))
|
|
90
|
-
.subscribe((settingsChange) => (this.currentTheme = settingsChange.currentSettings));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
ngOnDestroy() {
|
|
94
|
-
this.ngUnsubscribe.next();
|
|
95
|
-
this.ngUnsubscribe.complete();
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* 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.
|
|
99
|
-
* @param args
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
getGridOptions(args) {
|
|
103
|
-
const defaultGridOptions = this.getDefaultGridOptions(args);
|
|
104
|
-
const mergedGridOptions = this.mergeGridOptions(defaultGridOptions, args.gridOptions);
|
|
105
|
-
return mergedGridOptions;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* 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.
|
|
109
|
-
* @param args
|
|
110
|
-
* @returns
|
|
111
|
-
*/
|
|
112
|
-
getEditableGridOptions(args) {
|
|
113
|
-
const defaultGridOptions = this.getDefaultEditableGridOptions(args);
|
|
114
|
-
const mergedGridOptions = this.mergeGridOptions(defaultGridOptions, args.gridOptions);
|
|
115
|
-
return mergedGridOptions;
|
|
116
|
-
}
|
|
117
|
-
mergeGridOptions(defaultGridOptions, providedGridOptions) {
|
|
118
|
-
const mergedGridOptions = Object.assign(Object.assign(Object.assign({}, defaultGridOptions), providedGridOptions), { columnTypes: Object.assign(Object.assign({}, providedGridOptions.columnTypes), defaultGridOptions.columnTypes), defaultColDef: Object.assign(Object.assign(Object.assign({}, defaultGridOptions.defaultColDef), providedGridOptions.defaultColDef), {
|
|
119
|
-
// allow consumers to override all defaultColDef properties except cellClassRules, which we reserve for styling
|
|
120
|
-
cellClassRules: defaultGridOptions.defaultColDef.cellClassRules }), icons: Object.assign(Object.assign({}, defaultGridOptions.icons), providedGridOptions.icons) });
|
|
121
|
-
return mergedGridOptions;
|
|
122
|
-
}
|
|
123
|
-
getDefaultGridOptions(args) {
|
|
124
|
-
var _a, _b, _c, _d, _e, _f;
|
|
125
|
-
// cellClassRules can be functions or string expressions
|
|
126
|
-
const cellClassRuleTrueExpression = 'true';
|
|
127
|
-
function getEditableFn(isUneditable) {
|
|
128
|
-
return function (params) {
|
|
129
|
-
let isEditable = params.colDef.editable;
|
|
130
|
-
if (typeof isEditable === 'function') {
|
|
131
|
-
const column = params.columnApi.getColumn(params.colDef.field);
|
|
132
|
-
isEditable = isEditable(Object.assign(Object.assign({}, params), { column }));
|
|
133
|
-
}
|
|
134
|
-
return isUneditable ? !isEditable : isEditable;
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
const editableCellClassRules = {
|
|
138
|
-
[SkyCellClass.Editable]: getEditableFn(),
|
|
139
|
-
[SkyCellClass.Uneditable]: getEditableFn(true),
|
|
140
|
-
};
|
|
141
|
-
function getValidatorFn() {
|
|
142
|
-
return function (param) {
|
|
143
|
-
var _a, _b;
|
|
144
|
-
if (param.colDef &&
|
|
145
|
-
typeof ((_b = (_a = param.colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.validator) === 'function') {
|
|
146
|
-
return !param.colDef.cellRendererParams.skyComponentProperties.validator(param.value, param.data, param.rowIndex);
|
|
147
|
-
}
|
|
148
|
-
return false;
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
const validatorCellClassRules = {
|
|
152
|
-
[SkyCellClass.Invalid]: getValidatorFn(),
|
|
153
|
-
};
|
|
154
|
-
const defaultSkyGridOptions = {
|
|
155
|
-
columnTypes: {
|
|
156
|
-
[SkyCellType.Autocomplete]: {
|
|
157
|
-
cellClassRules: Object.assign({ [SkyCellClass.Autocomplete]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
158
|
-
cellEditorFramework: SkyAgGridCellEditorAutocompleteComponent,
|
|
159
|
-
valueFormatter: autocompleteFormatter,
|
|
160
|
-
comparator: autocompleteComparator,
|
|
161
|
-
minWidth: 185,
|
|
162
|
-
},
|
|
163
|
-
[SkyCellType.Currency]: {
|
|
164
|
-
cellClassRules: Object.assign(Object.assign({ [SkyCellClass.Currency]: cellClassRuleTrueExpression }, validatorCellClassRules), editableCellClassRules),
|
|
165
|
-
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-currency-validator', { component: 'sky-ag-grid-cell-renderer-currency' }),
|
|
166
|
-
cellEditorFramework: SkyAgGridCellEditorCurrencyComponent,
|
|
167
|
-
headerClass: SkyHeaderClass.RightAligned,
|
|
168
|
-
minWidth: 185,
|
|
169
|
-
},
|
|
170
|
-
[SkyCellType.Date]: {
|
|
171
|
-
cellClassRules: Object.assign({ [SkyCellClass.Date]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
172
|
-
cellEditorFramework: SkyAgGridCellEditorDatepickerComponent,
|
|
173
|
-
comparator: dateComparator,
|
|
174
|
-
minWidth: ((_b = (_a = this.currentTheme) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.name) === 'modern' ? 180 : 160,
|
|
175
|
-
valueFormatter: (params) => this.dateFormatter(params, args.locale),
|
|
176
|
-
},
|
|
177
|
-
[SkyCellType.Lookup]: {
|
|
178
|
-
cellClassRules: Object.assign({ [SkyCellClass.Lookup]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
179
|
-
cellEditorFramework: SkyAgGridCellEditorLookupComponent,
|
|
180
|
-
cellRendererFramework: SkyAgGridCellRendererLookupComponent,
|
|
181
|
-
valueFormatter: (params) => {
|
|
182
|
-
const lookupProperties = applySkyLookupPropertiesDefaults(params);
|
|
183
|
-
return (params.value || [])
|
|
184
|
-
.map((value) => {
|
|
185
|
-
return value[lookupProperties.descriptorProperty];
|
|
186
|
-
})
|
|
187
|
-
.filter((value) => value !== '' && value !== undefined)
|
|
188
|
-
.join('; ');
|
|
189
|
-
},
|
|
190
|
-
minWidth: 185,
|
|
191
|
-
},
|
|
192
|
-
[SkyCellType.Number]: {
|
|
193
|
-
cellClassRules: Object.assign({ [SkyCellClass.Number]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
194
|
-
cellEditorFramework: SkyAgGridCellEditorNumberComponent,
|
|
195
|
-
headerClass: SkyHeaderClass.RightAligned,
|
|
196
|
-
},
|
|
197
|
-
[SkyCellType.RowSelector]: {
|
|
198
|
-
cellClassRules: {
|
|
199
|
-
[SkyCellClass.RowSelector]: cellClassRuleTrueExpression,
|
|
200
|
-
[SkyCellClass.Uneditable]: cellClassRuleTrueExpression,
|
|
201
|
-
},
|
|
202
|
-
cellRendererFramework: SkyAgGridCellRendererRowSelectorComponent,
|
|
203
|
-
headerName: '',
|
|
204
|
-
minWidth: 55,
|
|
205
|
-
maxWidth: 55,
|
|
206
|
-
sortable: false,
|
|
207
|
-
width: 55,
|
|
208
|
-
},
|
|
209
|
-
[SkyCellType.Text]: {
|
|
210
|
-
cellClassRules: Object.assign({ [SkyCellClass.Text]: cellClassRuleTrueExpression }, editableCellClassRules),
|
|
211
|
-
cellEditorFramework: SkyAgGridCellEditorTextComponent,
|
|
212
|
-
},
|
|
213
|
-
[SkyCellType.Validator]: {
|
|
214
|
-
cellClassRules: Object.assign(Object.assign({}, validatorCellClassRules), editableCellClassRules),
|
|
215
|
-
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-validator-tooltip'),
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
defaultColDef: {
|
|
219
|
-
cellClassRules: editableCellClassRules,
|
|
220
|
-
minWidth: 100,
|
|
221
|
-
resizable: true,
|
|
222
|
-
sortable: true,
|
|
223
|
-
suppressKeyboardEvent: (keypress) => this.suppressTab(keypress),
|
|
224
|
-
},
|
|
225
|
-
domLayout: 'autoHeight',
|
|
226
|
-
enterMovesDownAfterEdit: true,
|
|
227
|
-
frameworkComponents: {
|
|
228
|
-
'sky-ag-grid-cell-renderer-currency': SkyAgGridCellRendererCurrencyComponent,
|
|
229
|
-
'sky-ag-grid-cell-renderer-currency-validator': SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
230
|
-
'sky-ag-grid-cell-renderer-validator-tooltip': SkyAgGridCellRendererValidatorTooltipComponent,
|
|
231
|
-
},
|
|
232
|
-
getRowNodeId(data) {
|
|
233
|
-
if ('id' in data && data.id !== undefined) {
|
|
234
|
-
return `${data.id}`;
|
|
235
|
-
}
|
|
236
|
-
return `${rowNodeId--}`;
|
|
237
|
-
},
|
|
238
|
-
getRowClass: (params) => {
|
|
239
|
-
if (params.node.id) {
|
|
240
|
-
return `sky-ag-grid-row-${params.node.id}`;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
return undefined;
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
headerHeight: ((_d = (_c = this.currentTheme) === null || _c === void 0 ? void 0 : _c.theme) === null || _d === void 0 ? void 0 : _d.name) === 'modern' ? 60 : 37,
|
|
247
|
-
icons: {
|
|
248
|
-
sortDescending: this.getIconTemplate('caret-down'),
|
|
249
|
-
sortAscending: this.getIconTemplate('caret-up'),
|
|
250
|
-
columnMoveMove: this.getIconTemplate('arrows'),
|
|
251
|
-
columnMoveHide: this.getIconTemplate('arrows'),
|
|
252
|
-
columnMoveLeft: this.getIconTemplate('arrows'),
|
|
253
|
-
columnMoveRight: this.getIconTemplate('arrows'),
|
|
254
|
-
columnMovePin: this.getIconTemplate('arrows'),
|
|
255
|
-
},
|
|
256
|
-
onCellFocused: () => this.onCellFocused(),
|
|
257
|
-
rowHeight: ((_f = (_e = this.currentTheme) === null || _e === void 0 ? void 0 : _e.theme) === null || _f === void 0 ? void 0 : _f.name) === 'modern' ? 60 : 38,
|
|
258
|
-
rowMultiSelectWithClick: true,
|
|
259
|
-
rowSelection: 'multiple',
|
|
260
|
-
singleClickEdit: true,
|
|
261
|
-
// tslint:disable-next-line: no-null-keyword
|
|
262
|
-
sortingOrder: ['desc', 'asc', null],
|
|
263
|
-
stopEditingWhenGridLosesFocus: false,
|
|
264
|
-
suppressRowClickSelection: true,
|
|
265
|
-
suppressDragLeaveHidesColumns: true,
|
|
266
|
-
};
|
|
267
|
-
defaultSkyGridOptions.columnTypes[SkyCellType.CurrencyValidator] = Object.assign(Object.assign({}, defaultSkyGridOptions.columnTypes[SkyCellType.Currency]), { cellRendererParams: {
|
|
268
|
-
skyComponentProperties: {
|
|
269
|
-
validator: (value, data, rowIndex) => {
|
|
270
|
-
return !!`${value || ''}`.match(/^[^0-9]*(\d+[,.]?)+\d*[^0-9]*$/);
|
|
271
|
-
},
|
|
272
|
-
validatorMessage: 'Please enter a valid currency',
|
|
273
|
-
},
|
|
274
|
-
} });
|
|
275
|
-
/*istanbul ignore else*/
|
|
276
|
-
if (this.resources) {
|
|
277
|
-
this.resources
|
|
278
|
-
.getString('sky_ag_grid_cell_renderer_currency_validator_message')
|
|
279
|
-
.subscribe((value) => {
|
|
280
|
-
defaultSkyGridOptions.columnTypes[SkyCellType.CurrencyValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
defaultSkyGridOptions.columnTypes[SkyCellType.NumberValidator] = Object.assign(Object.assign(Object.assign({}, defaultSkyGridOptions.columnTypes[SkyCellType.Validator]), defaultSkyGridOptions.columnTypes[SkyCellType.Number]), { cellClassRules: Object.assign(Object.assign({}, defaultSkyGridOptions.columnTypes[SkyCellType.Validator]
|
|
284
|
-
.cellClassRules), defaultSkyGridOptions.columnTypes[SkyCellType.Number].cellClassRules), cellRendererParams: {
|
|
285
|
-
skyComponentProperties: {
|
|
286
|
-
validator: (value, data, rowIndex) => {
|
|
287
|
-
return !!value && !isNaN(parseFloat(value));
|
|
288
|
-
},
|
|
289
|
-
validatorMessage: 'Please enter a valid number',
|
|
290
|
-
},
|
|
291
|
-
} });
|
|
292
|
-
/*istanbul ignore else*/
|
|
293
|
-
if (this.resources) {
|
|
294
|
-
this.resources
|
|
295
|
-
.getString('sky_ag_grid_cell_renderer_number_validator_message')
|
|
296
|
-
.subscribe((value) => {
|
|
297
|
-
defaultSkyGridOptions.columnTypes[SkyCellType.NumberValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
return defaultSkyGridOptions;
|
|
301
|
-
}
|
|
302
|
-
onCellFocused() {
|
|
303
|
-
const currentElement = this.agGridAdapterService.getFocusedElement();
|
|
304
|
-
this.agGridAdapterService.focusOnFocusableChildren(currentElement);
|
|
305
|
-
}
|
|
306
|
-
getDefaultEditableGridOptions(args) {
|
|
307
|
-
const defaultGridOptions = this.getDefaultGridOptions(args);
|
|
308
|
-
defaultGridOptions.rowSelection = 'none';
|
|
309
|
-
return defaultGridOptions;
|
|
310
|
-
}
|
|
311
|
-
dateFormatter(params, locale = 'en-us') {
|
|
312
|
-
const dateConfig = { year: 'numeric', month: '2-digit', day: '2-digit' };
|
|
313
|
-
let date = params.value;
|
|
314
|
-
if (date && typeof date === 'string') {
|
|
315
|
-
date = new Date(params.value);
|
|
316
|
-
}
|
|
317
|
-
const formattedDate = date &&
|
|
318
|
-
date.toLocaleDateString &&
|
|
319
|
-
date.toLocaleDateString(locale, dateConfig);
|
|
320
|
-
if (date && date.getTime && !isNaN(date.getTime())) {
|
|
321
|
-
return formattedDate;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
getIconTemplate(iconName) {
|
|
325
|
-
return `<i class="fa fa-${iconName}"></i>`;
|
|
326
|
-
}
|
|
327
|
-
suppressTab(params) {
|
|
328
|
-
if (params.event.code === 'Tab') {
|
|
329
|
-
if (params.editing) {
|
|
330
|
-
const currentlyFocusedEl = this.agGridAdapterService.getFocusedElement();
|
|
331
|
-
// inline cell editors have the 'ag-cell' class, while popup editors have the 'ag-popup-editor' class
|
|
332
|
-
const cellEl = this.agGridAdapterService.getElementOrParentWithClass(currentlyFocusedEl, 'ag-cell');
|
|
333
|
-
const popupEl = this.agGridAdapterService.getElementOrParentWithClass(currentlyFocusedEl, 'ag-popup-editor');
|
|
334
|
-
const parentEl = cellEl || popupEl;
|
|
335
|
-
const nextFocusableElementInCell = this.agGridAdapterService.getNextFocusableElement(currentlyFocusedEl, parentEl, params.event.shiftKey);
|
|
336
|
-
return !!nextFocusableElementInCell;
|
|
337
|
-
}
|
|
338
|
-
return true;
|
|
339
|
-
}
|
|
340
|
-
return false;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
SkyAgGridService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridService, deps: [{ token: i1.SkyAgGridAdapterService }, { token: i2.SkyThemeService, optional: true }, { token: i3.SkyLibResourcesService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
344
|
-
SkyAgGridService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridService, providedIn: 'any' });
|
|
345
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridService, decorators: [{
|
|
346
|
-
type: Injectable,
|
|
347
|
-
args: [{
|
|
348
|
-
providedIn: 'any',
|
|
349
|
-
}]
|
|
350
|
-
}], ctorParameters: function () { return [{ type: i1.SkyAgGridAdapterService }, { type: i2.SkyThemeService, decorators: [{
|
|
351
|
-
type: Optional
|
|
352
|
-
}] }, { type: i3.SkyLibResourcesService, decorators: [{
|
|
353
|
-
type: Optional
|
|
354
|
-
}] }]; } });
|
|
355
|
-
//# sourceMappingURL=ag-grid.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ag-grid.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/ag-grid.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,eAAe,EAAoB,MAAM,cAAc,CAAC;AAWjE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,wCAAwC,EAAE,MAAM,4EAA4E,CAAC;AACtI,OAAO,EAAE,oCAAoC,EAAE,MAAM,oEAAoE,CAAC;AAC1H,OAAO,EAAE,sCAAsC,EAAE,MAAM,wEAAwE,CAAC;AAChI,OAAO,EAAE,kCAAkC,EAAE,MAAM,gEAAgE,CAAC;AACpH,OAAO,EAAE,kCAAkC,EAAE,MAAM,gEAAgE,CAAC;AACpH,OAAO,EAAE,gCAAgC,EAAE,MAAM,4DAA4D,CAAC;AAC9G,OAAO,EAAE,+CAA+C,EAAE,MAAM,oFAAoF,CAAC;AACrJ,OAAO,EAAE,sCAAsC,EAAE,MAAM,0EAA0E,CAAC;AAClI,OAAO,EAAE,oCAAoC,EAAE,MAAM,sEAAsE,CAAC;AAC5H,OAAO,EAAE,yCAAyC,EAAE,MAAM,kFAAkF,CAAC;AAC7I,OAAO,EAAE,8CAA8C,EAAE,MAAM,4FAA4F,CAAC;AAC5J,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,C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AU,EAAE,KAAK;iBAClB;;0BAUI,QAAQ;;0BACR,QAAQ","sourcesContent":["import { Injectable, OnDestroy, Optional } from '@angular/core';\nimport { SkyLibResourcesService } from '@skyux/i18n';\nimport { SkyThemeService, SkyThemeSettings } from '@skyux/theme';\n\nimport {\n CellClassParams,\n GridOptions,\n ICellRendererParams,\n RowClassParams,\n SuppressKeyboardEventParams,\n ValueFormatterParams,\n} from 'ag-grid-community';\nimport { EditableCallbackParams } from 'ag-grid-community/dist/lib/entities/colDef';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAgGridAdapterService } from './ag-grid-adapter.service';\nimport { SkyAgGridCellEditorAutocompleteComponent } from './cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component';\nimport { SkyAgGridCellEditorCurrencyComponent } from './cell-editors/cell-editor-currency/cell-editor-currency.component';\nimport { SkyAgGridCellEditorDatepickerComponent } from './cell-editors/cell-editor-datepicker/cell-editor-datepicker.component';\nimport { SkyAgGridCellEditorLookupComponent } from './cell-editors/cell-editor-lookup/cell-editor-lookup.component';\nimport { SkyAgGridCellEditorNumberComponent } from './cell-editors/cell-editor-number/cell-editor-number.component';\nimport { SkyAgGridCellEditorTextComponent } from './cell-editors/cell-editor-text/cell-editor-text.component';\nimport { SkyAgGridCellRendererCurrencyValidatorComponent } from './cell-renderers/cell-renderer-currency/cell-renderer-currency-validator.component';\nimport { SkyAgGridCellRendererCurrencyComponent } from './cell-renderers/cell-renderer-currency/cell-renderer-currency.component';\nimport { SkyAgGridCellRendererLookupComponent } from './cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component';\nimport { SkyAgGridCellRendererRowSelectorComponent } from './cell-renderers/cell-renderer-row-selector/cell-renderer-row-selector.component';\nimport { SkyAgGridCellRendererValidatorTooltipComponent } from './cell-renderers/cell-renderer-validator-tooltip/cell-renderer-validator-tooltip.component';\nimport { SkyCellClass } from './types/cell-class';\nimport { SkyCellType } from './types/cell-type';\nimport { SkyHeaderClass } from './types/header-class';\nimport { applySkyLookupPropertiesDefaults } from './types/lookup-properties';\nimport { SkyGetGridOptionsArgs } from './types/sky-grid-options';\n\nfunction autocompleteComparator(\n value1: { name: string },\n value2: { name: string }\n): number {\n if (value1 && value2) {\n if (value1.name > value2.name) {\n return 1;\n }\n\n if (value1.name < value2.name) {\n return -1;\n }\n\n return 0;\n }\n\n return value1 ? 1 : -1;\n}\n\nfunction autocompleteFormatter(\n params: ValueFormatterParams\n): string | undefined {\n return params.value && params.value.name;\n}\n\nfunction dateComparator(date1: any, date2: any): number {\n let date1value = date1;\n let date2value = date2;\n\n if (typeof date1value === 'string') {\n date1value = new Date(date1);\n }\n\n if (typeof date2value === 'string') {\n date2value = new Date(date2);\n }\n\n if (date1value && date2value) {\n if (date1value > date2value) {\n return 1;\n }\n\n if (date1value < date2value) {\n return -1;\n }\n\n return 0;\n }\n\n return date1value ? 1 : -1;\n}\n\nfunction getValidatorCellRendererSelector(component: string, fallback?: any) {\n return (params: ICellRendererParams) => {\n if (\n params.colDef &&\n typeof params.colDef.cellRendererParams?.skyComponentProperties\n ?.validator === 'function'\n ) {\n if (\n !params.colDef.cellRendererParams.skyComponentProperties.validator(\n params.value,\n params.data,\n params.rowIndex\n )\n ) {\n return {\n component,\n params: {\n ...params.colDef.cellRendererParams,\n },\n };\n }\n }\n return fallback;\n };\n}\n\nlet rowNodeId = -1;\n\n/**\n * `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.\n */\n@Injectable({\n providedIn: 'any',\n})\nexport class SkyAgGridService implements OnDestroy {\n /**\n * @internal\n */\n public currentTheme: SkyThemeSettings;\n private ngUnsubscribe = new Subject();\n\n constructor(\n private agGridAdapterService: SkyAgGridAdapterService,\n @Optional() private themeSvc?: SkyThemeService,\n @Optional() private resources?: SkyLibResourcesService\n ) {\n /*istanbul ignore else*/\n if (this.themeSvc) {\n this.themeSvc.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(\n (settingsChange) =>\n (this.currentTheme = settingsChange.currentSettings)\n );\n }\n }\n\n public ngOnDestroy() {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * 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.\n * @param args\n * @returns\n */\n public getGridOptions(args: SkyGetGridOptionsArgs): GridOptions {\n const defaultGridOptions = this.getDefaultGridOptions(args);\n const mergedGridOptions = this.mergeGridOptions(\n defaultGridOptions,\n args.gridOptions\n );\n\n return mergedGridOptions;\n }\n\n /**\n * 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.\n * @param args\n * @returns\n */\n public getEditableGridOptions(args: SkyGetGridOptionsArgs): GridOptions {\n const defaultGridOptions = this.getDefaultEditableGridOptions(args);\n const mergedGridOptions = this.mergeGridOptions(\n defaultGridOptions,\n args.gridOptions\n );\n\n return mergedGridOptions;\n }\n\n private mergeGridOptions(\n defaultGridOptions: GridOptions,\n providedGridOptions: GridOptions\n ): GridOptions {\n const mergedGridOptions = {\n ...defaultGridOptions,\n ...providedGridOptions,\n columnTypes: {\n ...providedGridOptions.columnTypes,\n // apply default second to prevent consumers from overwriting our default column types\n ...defaultGridOptions.columnTypes,\n },\n defaultColDef: {\n ...defaultGridOptions.defaultColDef,\n ...providedGridOptions.defaultColDef,\n // allow consumers to override all defaultColDef properties except cellClassRules, which we reserve for styling\n cellClassRules: defaultGridOptions.defaultColDef.cellClassRules,\n },\n icons: {\n ...defaultGridOptions.icons,\n ...providedGridOptions.icons,\n },\n };\n\n return mergedGridOptions;\n }\n\n private getDefaultGridOptions(args: SkyGetGridOptionsArgs): GridOptions {\n // cellClassRules can be functions or string expressions\n const cellClassRuleTrueExpression = 'true';\n\n function getEditableFn(\n isUneditable?: boolean\n ): (params: CellClassParams) => boolean {\n return function (params: CellClassParams): boolean {\n let isEditable = params.colDef.editable;\n\n if (typeof isEditable === 'function') {\n const column = params.columnApi.getColumn(params.colDef.field);\n isEditable = isEditable({\n ...params,\n column,\n } as EditableCallbackParams);\n }\n\n return isUneditable ? !isEditable : isEditable;\n };\n }\n\n const editableCellClassRules = {\n [SkyCellClass.Editable]: getEditableFn(),\n [SkyCellClass.Uneditable]: getEditableFn(true),\n };\n\n function getValidatorFn(): (params: CellClassParams) => boolean {\n return function (param: CellClassParams) {\n if (\n param.colDef &&\n typeof param.colDef.cellRendererParams?.skyComponentProperties\n ?.validator === 'function'\n ) {\n return !param.colDef.cellRendererParams.skyComponentProperties.validator(\n param.value,\n param.data,\n param.rowIndex\n );\n }\n return false;\n };\n }\n\n const validatorCellClassRules = {\n [SkyCellClass.Invalid]: getValidatorFn(),\n };\n\n const defaultSkyGridOptions: GridOptions = {\n columnTypes: {\n [SkyCellType.Autocomplete]: {\n cellClassRules: {\n [SkyCellClass.Autocomplete]: cellClassRuleTrueExpression,\n ...editableCellClassRules,\n },\n cellEditorFramework: SkyAgGridCellEditorAutocompleteComponent,\n valueFormatter: autocompleteFormatter,\n comparator: autocompleteComparator,\n minWidth: 185,\n },\n [SkyCellType.Currency]: {\n cellClassRules: {\n [SkyCellClass.Currency]: cellClassRuleTrueExpression,\n ...validatorCellClassRules,\n ...editableCellClassRules,\n },\n cellRendererSelector: getValidatorCellRendererSelector(\n 'sky-ag-grid-cell-renderer-currency-validator',\n { component: 'sky-ag-grid-cell-renderer-currency' }\n ),\n cellEditorFramework: SkyAgGridCellEditorCurrencyComponent,\n headerClass: SkyHeaderClass.RightAligned,\n minWidth: 185,\n },\n [SkyCellType.Date]: {\n cellClassRules: {\n [SkyCellClass.Date]: cellClassRuleTrueExpression,\n ...editableCellClassRules,\n },\n cellEditorFramework: SkyAgGridCellEditorDatepickerComponent,\n comparator: dateComparator,\n minWidth: this.currentTheme?.theme?.name === 'modern' ? 180 : 160,\n valueFormatter: (params: ValueFormatterParams) =>\n this.dateFormatter(params, args.locale),\n },\n [SkyCellType.Lookup]: {\n cellClassRules: {\n [SkyCellClass.Lookup]: cellClassRuleTrueExpression,\n ...editableCellClassRules,\n },\n cellEditorFramework: SkyAgGridCellEditorLookupComponent,\n cellRendererFramework: SkyAgGridCellRendererLookupComponent,\n valueFormatter: (params) => {\n const lookupProperties = applySkyLookupPropertiesDefaults(params);\n return (params.value || [])\n .map((value) => {\n return value[lookupProperties.descriptorProperty];\n })\n .filter((value) => value !== '' && value !== undefined)\n .join('; ');\n },\n minWidth: 185,\n },\n [SkyCellType.Number]: {\n cellClassRules: {\n [SkyCellClass.Number]: cellClassRuleTrueExpression,\n ...editableCellClassRules,\n },\n cellEditorFramework: SkyAgGridCellEditorNumberComponent,\n headerClass: SkyHeaderClass.RightAligned,\n },\n [SkyCellType.RowSelector]: {\n cellClassRules: {\n [SkyCellClass.RowSelector]: cellClassRuleTrueExpression,\n [SkyCellClass.Uneditable]: cellClassRuleTrueExpression,\n },\n cellRendererFramework: SkyAgGridCellRendererRowSelectorComponent,\n headerName: '',\n minWidth: 55,\n maxWidth: 55,\n sortable: false,\n width: 55,\n },\n [SkyCellType.Text]: {\n cellClassRules: {\n [SkyCellClass.Text]: cellClassRuleTrueExpression,\n ...editableCellClassRules,\n },\n cellEditorFramework: SkyAgGridCellEditorTextComponent,\n },\n [SkyCellType.Validator]: {\n cellClassRules: {\n ...validatorCellClassRules,\n ...editableCellClassRules,\n },\n cellRendererSelector: getValidatorCellRendererSelector(\n 'sky-ag-grid-cell-renderer-validator-tooltip'\n ),\n },\n },\n defaultColDef: {\n cellClassRules: editableCellClassRules,\n minWidth: 100,\n resizable: true,\n sortable: true,\n suppressKeyboardEvent: (keypress: SuppressKeyboardEventParams) =>\n this.suppressTab(keypress),\n },\n domLayout: 'autoHeight',\n enterMovesDownAfterEdit: true,\n frameworkComponents: {\n 'sky-ag-grid-cell-renderer-currency':\n SkyAgGridCellRendererCurrencyComponent,\n 'sky-ag-grid-cell-renderer-currency-validator':\n SkyAgGridCellRendererCurrencyValidatorComponent,\n 'sky-ag-grid-cell-renderer-validator-tooltip':\n SkyAgGridCellRendererValidatorTooltipComponent,\n },\n getRowNodeId(data: any): string {\n if ('id' in data && data.id !== undefined) {\n return `${data.id}`;\n }\n return `${rowNodeId--}`;\n },\n getRowClass: (params: RowClassParams) => {\n if (params.node.id) {\n return `sky-ag-grid-row-${params.node.id}`;\n } else {\n return undefined;\n }\n },\n headerHeight: this.currentTheme?.theme?.name === 'modern' ? 60 : 37,\n icons: {\n sortDescending: this.getIconTemplate('caret-down'),\n sortAscending: this.getIconTemplate('caret-up'),\n columnMoveMove: this.getIconTemplate('arrows'),\n columnMoveHide: this.getIconTemplate('arrows'),\n columnMoveLeft: this.getIconTemplate('arrows'),\n columnMoveRight: this.getIconTemplate('arrows'),\n columnMovePin: this.getIconTemplate('arrows'),\n },\n onCellFocused: () => this.onCellFocused(),\n rowHeight: this.currentTheme?.theme?.name === 'modern' ? 60 : 38,\n rowMultiSelectWithClick: true,\n rowSelection: 'multiple',\n singleClickEdit: true,\n // tslint:disable-next-line: no-null-keyword\n sortingOrder: ['desc', 'asc', null],\n stopEditingWhenGridLosesFocus: false,\n suppressRowClickSelection: true,\n suppressDragLeaveHidesColumns: true,\n };\n\n defaultSkyGridOptions.columnTypes[SkyCellType.CurrencyValidator] = {\n ...defaultSkyGridOptions.columnTypes[SkyCellType.Currency],\n cellRendererParams: {\n skyComponentProperties: {\n validator: (value: any, data: any, rowIndex: number) => {\n return !!`${value || ''}`.match(/^[^0-9]*(\\d+[,.]?)+\\d*[^0-9]*$/);\n },\n validatorMessage: 'Please enter a valid currency',\n },\n },\n };\n /*istanbul ignore else*/\n if (this.resources) {\n this.resources\n .getString('sky_ag_grid_cell_renderer_currency_validator_message')\n .subscribe((value) => {\n defaultSkyGridOptions.columnTypes[\n SkyCellType.CurrencyValidator\n ].cellRendererParams.skyComponentProperties.validatorMessage = value;\n });\n }\n\n defaultSkyGridOptions.columnTypes[SkyCellType.NumberValidator] = {\n ...defaultSkyGridOptions.columnTypes[SkyCellType.Validator],\n ...defaultSkyGridOptions.columnTypes[SkyCellType.Number],\n cellClassRules: {\n ...defaultSkyGridOptions.columnTypes[SkyCellType.Validator]\n .cellClassRules,\n ...defaultSkyGridOptions.columnTypes[SkyCellType.Number].cellClassRules,\n },\n cellRendererParams: {\n skyComponentProperties: {\n validator: (value: any, data: any, rowIndex: number) => {\n return !!value && !isNaN(parseFloat(value));\n },\n validatorMessage: 'Please enter a valid number',\n },\n },\n };\n /*istanbul ignore else*/\n if (this.resources) {\n this.resources\n .getString('sky_ag_grid_cell_renderer_number_validator_message')\n .subscribe((value) => {\n defaultSkyGridOptions.columnTypes[\n SkyCellType.NumberValidator\n ].cellRendererParams.skyComponentProperties.validatorMessage = value;\n });\n }\n\n return defaultSkyGridOptions;\n }\n\n private onCellFocused(): void {\n const currentElement = this.agGridAdapterService.getFocusedElement();\n\n this.agGridAdapterService.focusOnFocusableChildren(currentElement);\n }\n\n private getDefaultEditableGridOptions(\n args: SkyGetGridOptionsArgs\n ): GridOptions {\n const defaultGridOptions = this.getDefaultGridOptions(args);\n\n defaultGridOptions.rowSelection = 'none';\n\n return defaultGridOptions;\n }\n\n private dateFormatter(\n params: ValueFormatterParams,\n locale: string = 'en-us'\n ): string | undefined {\n const dateConfig = { year: 'numeric', month: '2-digit', day: '2-digit' };\n let date: Date = params.value;\n\n if (date && typeof date === 'string') {\n date = new Date(params.value);\n }\n\n const formattedDate =\n date &&\n date.toLocaleDateString &&\n date.toLocaleDateString(locale, dateConfig as Intl.DateTimeFormatOptions);\n\n if (date && date.getTime && !isNaN(date.getTime())) {\n return formattedDate;\n }\n }\n\n private getIconTemplate(iconName: string): string {\n return `<i class=\"fa fa-${iconName}\"></i>`;\n }\n\n private suppressTab(params: SuppressKeyboardEventParams): boolean {\n if (params.event.code === 'Tab') {\n if (params.editing) {\n const currentlyFocusedEl =\n this.agGridAdapterService.getFocusedElement();\n // inline cell editors have the 'ag-cell' class, while popup editors have the 'ag-popup-editor' class\n const cellEl = this.agGridAdapterService.getElementOrParentWithClass(\n currentlyFocusedEl,\n 'ag-cell'\n );\n const popupEl = this.agGridAdapterService.getElementOrParentWithClass(\n currentlyFocusedEl,\n 'ag-popup-editor'\n );\n const parentEl = cellEl || popupEl;\n\n const nextFocusableElementInCell =\n this.agGridAdapterService.getNextFocusableElement(\n currentlyFocusedEl,\n parentEl,\n params.event.shiftKey\n );\n return !!nextFocusableElementInCell;\n }\n return true;\n }\n return false;\n }\n}\n"]}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, ElementRef, ViewChild, } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "@skyux/lookup";
|
|
4
|
-
import * as i2 from "@angular/forms";
|
|
5
|
-
import * as i3 from "@skyux/i18n";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export class SkyAgGridCellEditorAutocompleteComponent {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.skyComponentProperties = {};
|
|
12
|
-
}
|
|
13
|
-
agInit(params) {
|
|
14
|
-
this.params = params;
|
|
15
|
-
this.currentSelection = this.params.value;
|
|
16
|
-
this.columnHeader = this.params.colDef && this.params.colDef.headerName;
|
|
17
|
-
this.rowNumber = this.params.rowIndex + 1;
|
|
18
|
-
this.skyComponentProperties = this.params.skyComponentProperties || {};
|
|
19
|
-
}
|
|
20
|
-
afterGuiAttached() {
|
|
21
|
-
this.input.nativeElement.focus();
|
|
22
|
-
}
|
|
23
|
-
getValue() {
|
|
24
|
-
return this.currentSelection;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
SkyAgGridCellEditorAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
SkyAgGridCellEditorAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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.λ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.λ1, selector: "input[skyAutocomplete], textarea[skyAutocomplete]", inputs: ["autocompleteAttribute", "disabled"] }, { type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i3.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorAutocompleteComponent, decorators: [{
|
|
30
|
-
type: Component,
|
|
31
|
-
args: [{
|
|
32
|
-
selector: 'sky-ag-grid-cell-editor-autocomplete',
|
|
33
|
-
templateUrl: './cell-editor-autocomplete.component.html',
|
|
34
|
-
styleUrls: ['./cell-editor-autocomplete.component.scss'],
|
|
35
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
36
|
-
}]
|
|
37
|
-
}], propDecorators: { input: [{
|
|
38
|
-
type: ViewChild,
|
|
39
|
-
args: ['skyCellEditorAutocomplete', { read: ElementRef }]
|
|
40
|
-
}] } });
|
|
41
|
-
//# sourceMappingURL=cell-editor-autocomplete.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-autocomplete.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;;;;;AAOvB;;GAEG;AAOH,MAAM,OAAO,wCAAwC;IANrD;QAYS,2BAAsB,GAA8B,EAAE,CAAC;KAqB/D;IAfQ,MAAM,CAAC,MAAuC;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;QACxE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC1C,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC,sBAAsB,IAAI,EAAE,CAAC;IACzE,CAAC;IAEM,gBAAgB;QACrB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IACnC,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;;sIA1BU,wCAAwC;0HAAxC,wCAAwC,2KASH,UAAU,6BC9B5D,8nCA8BA;4FDTa,wCAAwC;kBANpD,SAAS;mBAAC;oBACT,QAAQ,EAAE,sCAAsC;oBAChD,WAAW,EAAE,2CAA2C;oBACxD,SAAS,EAAE,CAAC,2CAA2C,CAAC;oBACxD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAWQ,KAAK;sBADX,SAAS;uBAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewChild,\n} from '@angular/core';\n\nimport { ICellEditorAngularComp } from 'ag-grid-angular';\n\nimport { SkyAutocompleteProperties } from '../../types/autocomplete-properties';\nimport { SkyCellEditorAutocompleteParams } from '../../types/cell-editor-autocomplete-params';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-ag-grid-cell-editor-autocomplete',\n templateUrl: './cell-editor-autocomplete.component.html',\n styleUrls: ['./cell-editor-autocomplete.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyAgGridCellEditorAutocompleteComponent\n implements ICellEditorAngularComp\n{\n public currentSelection: any;\n public columnHeader: string;\n public rowNumber: number;\n public skyComponentProperties: SkyAutocompleteProperties = {};\n private params: SkyCellEditorAutocompleteParams;\n\n @ViewChild('skyCellEditorAutocomplete', { read: ElementRef })\n public input: ElementRef;\n\n public agInit(params: SkyCellEditorAutocompleteParams) {\n this.params = params;\n this.currentSelection = this.params.value;\n this.columnHeader = this.params.colDef && this.params.colDef.headerName;\n this.rowNumber = this.params.rowIndex + 1;\n this.skyComponentProperties = this.params.skyComponentProperties || {};\n }\n\n public afterGuiAttached(): void {\n this.input.nativeElement.focus();\n }\n\n public getValue(): any {\n return this.currentSelection;\n }\n}\n","<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"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { FormsModule } from '@angular/forms';
|
|
3
|
-
import { SkyAutocompleteModule } from '@skyux/lookup';
|
|
4
|
-
import { SkyAgGridResourcesModule } from '../../../shared/sky-ag-grid-resources.module';
|
|
5
|
-
import { SkyAgGridCellEditorAutocompleteComponent } from '../cell-editor-autocomplete/cell-editor-autocomplete.component';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export class SkyAgGridCellEditorAutocompleteModule {
|
|
8
|
-
}
|
|
9
|
-
SkyAgGridCellEditorAutocompleteModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
-
SkyAgGridCellEditorAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, declarations: [SkyAgGridCellEditorAutocompleteComponent], imports: [FormsModule, SkyAgGridResourcesModule, SkyAutocompleteModule], exports: [SkyAgGridCellEditorAutocompleteComponent] });
|
|
11
|
-
SkyAgGridCellEditorAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, imports: [[FormsModule, SkyAgGridResourcesModule, SkyAutocompleteModule]] });
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, decorators: [{
|
|
13
|
-
type: NgModule,
|
|
14
|
-
args: [{
|
|
15
|
-
imports: [FormsModule, SkyAgGridResourcesModule, SkyAutocompleteModule],
|
|
16
|
-
declarations: [SkyAgGridCellEditorAutocompleteComponent],
|
|
17
|
-
exports: [SkyAgGridCellEditorAutocompleteComponent],
|
|
18
|
-
}]
|
|
19
|
-
}] });
|
|
20
|
-
//# sourceMappingURL=cell-editor-autocomplete.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-autocomplete.module.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,wCAAwC,EAAE,MAAM,gEAAgE,CAAC;;AAO1H,MAAM,OAAO,qCAAqC;;mIAArC,qCAAqC;oIAArC,qCAAqC,iBAHjC,wCAAwC,aAD7C,WAAW,EAAE,wBAAwB,EAAE,qBAAqB,aAE5D,wCAAwC;oIAEvC,qCAAqC,YAJvC,CAAC,WAAW,EAAE,wBAAwB,EAAE,qBAAqB,CAAC;4FAI5D,qCAAqC;kBALjD,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,WAAW,EAAE,wBAAwB,EAAE,qBAAqB,CAAC;oBACvE,YAAY,EAAE,CAAC,wCAAwC,CAAC;oBACxD,OAAO,EAAE,CAAC,wCAAwC,CAAC;iBACpD","sourcesContent":["import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyAutocompleteModule } from '@skyux/lookup';\n\nimport { SkyAgGridResourcesModule } from '../../../shared/sky-ag-grid-resources.module';\nimport { SkyAgGridCellEditorAutocompleteComponent } from '../cell-editor-autocomplete/cell-editor-autocomplete.component';\n\n@NgModule({\n imports: [FormsModule, SkyAgGridResourcesModule, SkyAutocompleteModule],\n declarations: [SkyAgGridCellEditorAutocompleteComponent],\n exports: [SkyAgGridCellEditorAutocompleteComponent],\n})\nexport class SkyAgGridCellEditorAutocompleteModule {}\n"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, ElementRef, ViewChild, } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "@angular/forms";
|
|
4
|
-
import * as i2 from "@skyux/autonumeric";
|
|
5
|
-
import * as i3 from "@skyux/i18n";
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export class SkyAgGridCellEditorCurrencyComponent {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.skyComponentProperties = {};
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
15
|
-
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
16
|
-
*/
|
|
17
|
-
agInit(params) {
|
|
18
|
-
this.params = params;
|
|
19
|
-
this.value = this.params.value;
|
|
20
|
-
this.columnHeader = this.params.colDef.headerName;
|
|
21
|
-
this.rowNumber = this.params.rowIndex + 1;
|
|
22
|
-
this.columnWidth = this.params.column.getActualWidth();
|
|
23
|
-
this.rowHeightWithoutBorders =
|
|
24
|
-
this.params.node && this.params.node.rowHeight - 4;
|
|
25
|
-
this.skyComponentProperties = this.params.skyComponentProperties || {
|
|
26
|
-
decimalPlaces: 2,
|
|
27
|
-
currencySymbol: '$',
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* 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.
|
|
32
|
-
*/
|
|
33
|
-
afterGuiAttached() {
|
|
34
|
-
this.input.nativeElement.focus();
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
38
|
-
*/
|
|
39
|
-
getValue() {
|
|
40
|
-
return this.value;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
SkyAgGridCellEditorCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
-
SkyAgGridCellEditorCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i3.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, decorators: [{
|
|
46
|
-
type: Component,
|
|
47
|
-
args: [{
|
|
48
|
-
selector: 'sky-ag-grid-cell-editor-currency',
|
|
49
|
-
templateUrl: './cell-editor-currency.component.html',
|
|
50
|
-
styleUrls: ['./cell-editor-currency.component.scss'],
|
|
51
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
52
|
-
}]
|
|
53
|
-
}], propDecorators: { input: [{
|
|
54
|
-
type: ViewChild,
|
|
55
|
-
args: ['skyCellEditorCurrency', { read: ElementRef }]
|
|
56
|
-
}] } });
|
|
57
|
-
//# sourceMappingURL=cell-editor-currency.component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-currency.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;;;;;AAOvB;;GAEG;AAOH,MAAM,OAAO,oCAAoC;IANjD;QAUS,2BAAsB,GAA0B,EAAE,CAAC;KA0C3D;IA/BC;;;OAGG;IACI,MAAM,CAAC,MAAmC;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QACvD,IAAI,CAAC,uBAAuB;YAC1B,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACrD,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAAC,sBAAsB,IAAI;YAClE,aAAa,EAAE,CAAC;YAChB,cAAc,EAAE,GAAG;SACpB,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;kIA7CU,oCAAoC;sHAApC,oCAAoC,mKAYH,UAAU,6BCjCxD,wVAYA;4FDSa,oCAAoC;kBANhD,SAAS;mBAAC;oBACT,QAAQ,EAAE,kCAAkC;oBAC5C,WAAW,EAAE,uCAAuC;oBACpD,SAAS,EAAE,CAAC,uCAAuC,CAAC;oBACpD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAcS,KAAK;sBADZ,SAAS;uBAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewChild,\n} from '@angular/core';\n\nimport { ICellEditorAngularComp } from 'ag-grid-angular';\n\nimport { SkyCellEditorCurrencyParams } from '../../types/cell-editor-currency-params';\nimport { SkyCurrencyProperties } from '../../types/currency-properties';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-ag-grid-cell-editor-currency',\n templateUrl: './cell-editor-currency.component.html',\n styleUrls: ['./cell-editor-currency.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyAgGridCellEditorCurrencyComponent\n implements ICellEditorAngularComp\n{\n public value: number;\n public skyComponentProperties: SkyCurrencyProperties = {};\n public columnHeader: string;\n public columnWidth: number;\n public rowHeightWithoutBorders: number;\n public rowNumber: number;\n\n private params: SkyCellEditorCurrencyParams;\n\n @ViewChild('skyCellEditorCurrency', { read: ElementRef })\n private input: ElementRef;\n\n /**\n * agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.\n * @param params The cell editor params that include data about the cell, column, row, and grid.\n */\n public agInit(params: SkyCellEditorCurrencyParams): void {\n this.params = params;\n this.value = this.params.value;\n this.columnHeader = this.params.colDef.headerName;\n this.rowNumber = this.params.rowIndex + 1;\n this.columnWidth = this.params.column.getActualWidth();\n this.rowHeightWithoutBorders =\n this.params.node && this.params.node.rowHeight - 4;\n this.skyComponentProperties = this.params.skyComponentProperties || {\n decimalPlaces: 2,\n currencySymbol: '$',\n };\n }\n\n /**\n * 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.\n */\n public afterGuiAttached(): void {\n this.input.nativeElement.focus();\n }\n\n /**\n * getValue is called by agGrid when editing is stopped to get the new value of the cell.\n */\n public getValue(): number {\n return this.value;\n }\n}\n","<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"]}
|
package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { FormsModule } from '@angular/forms';
|
|
3
|
-
import { SkyAutonumericModule } from '@skyux/autonumeric';
|
|
4
|
-
import { SkyAgGridResourcesModule } from '../../../shared/sky-ag-grid-resources.module';
|
|
5
|
-
import { SkyAgGridCellEditorCurrencyComponent } from './cell-editor-currency.component';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export class SkyAgGridCellEditorCurrencyModule {
|
|
8
|
-
}
|
|
9
|
-
SkyAgGridCellEditorCurrencyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
-
SkyAgGridCellEditorCurrencyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, declarations: [SkyAgGridCellEditorCurrencyComponent], imports: [SkyAgGridResourcesModule, FormsModule, SkyAutonumericModule], exports: [SkyAgGridCellEditorCurrencyComponent] });
|
|
11
|
-
SkyAgGridCellEditorCurrencyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, imports: [[SkyAgGridResourcesModule, FormsModule, SkyAutonumericModule]] });
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, decorators: [{
|
|
13
|
-
type: NgModule,
|
|
14
|
-
args: [{
|
|
15
|
-
imports: [SkyAgGridResourcesModule, FormsModule, SkyAutonumericModule],
|
|
16
|
-
declarations: [SkyAgGridCellEditorCurrencyComponent],
|
|
17
|
-
exports: [SkyAgGridCellEditorCurrencyComponent],
|
|
18
|
-
}]
|
|
19
|
-
}] });
|
|
20
|
-
//# sourceMappingURL=cell-editor-currency.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-currency.module.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,OAAO,EAAE,oCAAoC,EAAE,MAAM,kCAAkC,CAAC;;AAOxF,MAAM,OAAO,iCAAiC;;+HAAjC,iCAAiC;gIAAjC,iCAAiC,iBAH7B,oCAAoC,aADzC,wBAAwB,EAAE,WAAW,EAAE,oBAAoB,aAE3D,oCAAoC;gIAEnC,iCAAiC,YAJnC,CAAC,wBAAwB,EAAE,WAAW,EAAE,oBAAoB,CAAC;4FAI3D,iCAAiC;kBAL7C,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,wBAAwB,EAAE,WAAW,EAAE,oBAAoB,CAAC;oBACtE,YAAY,EAAE,CAAC,oCAAoC,CAAC;oBACpD,OAAO,EAAE,CAAC,oCAAoC,CAAC;iBAChD","sourcesContent":["import { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { SkyAutonumericModule } from '@skyux/autonumeric';\n\nimport { SkyAgGridResourcesModule } from '../../../shared/sky-ag-grid-resources.module';\n\nimport { SkyAgGridCellEditorCurrencyComponent } from './cell-editor-currency.component';\n\n@NgModule({\n imports: [SkyAgGridResourcesModule, FormsModule, SkyAutonumericModule],\n declarations: [SkyAgGridCellEditorCurrencyComponent],\n exports: [SkyAgGridCellEditorCurrencyComponent],\n})\nexport class SkyAgGridCellEditorCurrencyModule {}\n"]}
|