@acorex/data-grid 6.5.71 → 6.5.72
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -2
- package/esm2022/acorex-data-grid.mjs +5 -0
- package/esm2022/index.mjs +18 -0
- package/esm2022/lib/data-grid/columns/check-column.component.mjs +109 -0
- package/esm2022/lib/data-grid/columns/column.component.mjs +168 -0
- package/esm2022/lib/data-grid/columns/command-column.component.mjs +115 -0
- package/esm2022/lib/data-grid/columns/date-column.component.mjs +115 -0
- package/esm2022/lib/data-grid/columns/row-number-column.component.mjs +38 -0
- package/esm2022/lib/data-grid/columns/selection-column.component.mjs +43 -0
- package/esm2022/lib/data-grid/columns/text-column.component.mjs +97 -0
- package/esm2022/lib/data-grid/datagrid.component.mjs +721 -0
- package/esm2022/lib/data-grid/datagrid.events.mjs +2 -0
- package/esm2022/lib/data-grid/datagrid.module.mjs +143 -0
- package/esm2022/lib/data-grid/filters/filter.component.mjs +39 -0
- package/esm2022/lib/data-grid/templates/cell-template.component.mjs +58 -0
- package/esm2022/lib/data-grid/templates/detail-template.component.mjs +51 -0
- package/esm2022/lib/data-grid/templates/row-template.component.mjs +48 -0
- package/esm2022/lib/data-lov/data-lov-popup/data-lov-popup.component.mjs +121 -0
- package/esm2022/lib/data-lov/data-lov.component.mjs +175 -0
- package/esm2022/lib/data-lov/data-lov.module.mjs +23 -0
- package/{fesm2020 → fesm2022}/acorex-data-grid.mjs +380 -319
- package/fesm2022/acorex-data-grid.mjs.map +1 -0
- package/lib/data-grid/columns/check-column.component.d.ts +4 -4
- package/lib/data-grid/columns/column.component.d.ts +1 -1
- package/lib/data-grid/columns/command-column.component.d.ts +3 -3
- package/lib/data-grid/columns/date-column.component.d.ts +2 -2
- package/lib/data-grid/columns/row-number-column.component.d.ts +1 -1
- package/lib/data-grid/columns/selection-column.component.d.ts +1 -1
- package/lib/data-grid/columns/text-column.component.d.ts +3 -3
- package/lib/data-grid/datagrid.component.d.ts +1 -1
- package/lib/data-grid/filters/filter.component.d.ts +1 -1
- package/lib/data-grid/templates/cell-template.component.d.ts +2 -2
- package/lib/data-grid/templates/detail-template.component.d.ts +2 -2
- package/lib/data-grid/templates/row-template.component.d.ts +2 -2
- package/lib/data-lov/data-lov-popup/data-lov-popup.component.d.ts +1 -1
- package/lib/data-lov/data-lov.component.d.ts +1 -1
- package/package.json +12 -21
- package/acorex-data-grid.d.ts +0 -5
- package/esm2020/acorex-data-grid.mjs +0 -5
- package/esm2020/lib/data-grid/columns/check-column.component.mjs +0 -117
- package/esm2020/lib/data-grid/columns/column.component.mjs +0 -164
- package/esm2020/lib/data-grid/columns/command-column.component.mjs +0 -117
- package/esm2020/lib/data-grid/columns/date-column.component.mjs +0 -111
- package/esm2020/lib/data-grid/columns/row-number-column.component.mjs +0 -37
- package/esm2020/lib/data-grid/columns/selection-column.component.mjs +0 -42
- package/esm2020/lib/data-grid/columns/text-column.component.mjs +0 -89
- package/esm2020/lib/data-grid/datagrid.component.mjs +0 -698
- package/esm2020/lib/data-grid/datagrid.events.mjs +0 -2
- package/esm2020/lib/data-grid/datagrid.module.mjs +0 -145
- package/esm2020/lib/data-grid/filters/filter.component.mjs +0 -39
- package/esm2020/lib/data-grid/templates/cell-template.component.mjs +0 -53
- package/esm2020/lib/data-grid/templates/detail-template.component.mjs +0 -46
- package/esm2020/lib/data-grid/templates/row-template.component.mjs +0 -43
- package/esm2020/lib/data-lov/data-lov-popup/data-lov-popup.component.mjs +0 -114
- package/esm2020/lib/data-lov/data-lov.component.mjs +0 -165
- package/esm2020/lib/data-lov/data-lov.module.mjs +0 -23
- package/esm2020/public-api.mjs +0 -18
- package/fesm2015/acorex-data-grid.mjs +0 -1915
- package/fesm2015/acorex-data-grid.mjs.map +0 -1
- package/fesm2020/acorex-data-grid.mjs.map +0 -1
- /package/{public-api.d.ts → index.d.ts} +0 -0
package/README.md
CHANGED
@@ -0,0 +1,5 @@
|
|
1
|
+
/**
|
2
|
+
* Generated bundle index. Do not edit.
|
3
|
+
*/
|
4
|
+
export * from './index';
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNvcmV4LWRhdGEtZ3JpZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZGF0YS1ncmlkL3NyYy9hY29yZXgtZGF0YS1ncmlkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export * from './lib/data-grid/columns/check-column.component';
|
2
|
+
export * from './lib/data-grid/columns/column.component';
|
3
|
+
export * from './lib/data-grid/columns/command-column.component';
|
4
|
+
export * from './lib/data-grid/columns/date-column.component';
|
5
|
+
export * from './lib/data-grid/columns/selection-column.component';
|
6
|
+
export * from './lib/data-grid/columns/text-column.component';
|
7
|
+
export * from './lib/data-grid/columns/row-number-column.component';
|
8
|
+
export * from './lib/data-grid/datagrid.component';
|
9
|
+
export * from './lib/data-grid/datagrid.events';
|
10
|
+
export * from './lib/data-grid/datagrid.module';
|
11
|
+
export * from './lib/data-grid/filters/filter.component';
|
12
|
+
export * from './lib/data-grid/templates/cell-template.component';
|
13
|
+
export * from './lib/data-grid/templates/row-template.component';
|
14
|
+
export * from './lib/data-grid/templates/detail-template.component';
|
15
|
+
export * from './lib/data-lov/data-lov-popup/data-lov-popup.component';
|
16
|
+
export * from './lib/data-lov/data-lov.component';
|
17
|
+
export * from './lib/data-lov/data-lov.module';
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8u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ZnJvbSAnLi9saWIvZGF0YS1ncmlkL2NvbHVtbnMvdGV4dC1jb2x1bW4uY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2RhdGEtZ3JpZC9jb2x1bW5zL3Jvdy1udW1iZXItY29sdW1uLmNvbXBvbmVudCc7XG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2RhdGEtZ3JpZC9kYXRhZ3JpZC5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZGF0YS1ncmlkL2RhdGFncmlkLmV2ZW50cyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9kYXRhLWdyaWQvZGF0YWdyaWQubW9kdWxlJztcblxuZXhwb3J0ICogZnJvbSAnLi9saWIvZGF0YS1ncmlkL2ZpbHRlcnMvZmlsdGVyLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9kYXRhLWdyaWQvdGVtcGxhdGVzL2NlbGwtdGVtcGxhdGUuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2RhdGEtZ3JpZC90ZW1wbGF0ZXMvcm93LXRlbXBsYXRlLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9kYXRhLWdyaWQvdGVtcGxhdGVzL2RldGFpbC10ZW1wbGF0ZS5jb21wb25lbnQnO1xuXG5leHBvcnQgKiBmcm9tICcuL2xpYi9kYXRhLWxvdi9kYXRhLWxvdi1wb3B1cC9kYXRhLWxvdi1wb3B1cC5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZGF0YS1sb3YvZGF0YS1sb3YuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2RhdGEtbG92L2RhdGEtbG92Lm1vZHVsZSc7XG4iXX0=
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { Component, ChangeDetectionStrategy, ViewChild, ViewContainerRef, } from '@angular/core';
|
2
|
+
import { AXGridDataColumn } from './column.component';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@acorex/components";
|
5
|
+
import * as i2 from "../filters/filter.component";
|
6
|
+
export class AXGridCheckColumn extends AXGridDataColumn {
|
7
|
+
constructor() {
|
8
|
+
super();
|
9
|
+
}
|
10
|
+
render() {
|
11
|
+
const col = super.render();
|
12
|
+
if (!col.cellRendererFramework) {
|
13
|
+
col.cellRendererFramework = BooleanRenderer;
|
14
|
+
}
|
15
|
+
if (this.allowFiltering) {
|
16
|
+
col.filterFramework = BooleanFilterRenderer;
|
17
|
+
}
|
18
|
+
return col;
|
19
|
+
}
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridCheckColumn, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AXGridCheckColumn, selector: "ax-check-column", providers: [{ provide: AXGridDataColumn, useExisting: AXGridCheckColumn }], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
22
|
+
}
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridCheckColumn, decorators: [{
|
24
|
+
type: Component,
|
25
|
+
args: [{
|
26
|
+
selector: 'ax-check-column',
|
27
|
+
template: '',
|
28
|
+
providers: [{ provide: AXGridDataColumn, useExisting: AXGridCheckColumn }],
|
29
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
30
|
+
}]
|
31
|
+
}], ctorParameters: function () { return []; } });
|
32
|
+
export class BooleanRenderer {
|
33
|
+
value;
|
34
|
+
constructor() { }
|
35
|
+
agInit(params) {
|
36
|
+
this.value = params.value;
|
37
|
+
}
|
38
|
+
refresh(params) {
|
39
|
+
this.value = params.value;
|
40
|
+
return true;
|
41
|
+
}
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BooleanRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
43
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BooleanRenderer, selector: "ng-component", ngImport: i0, template: ` <ax-check-box [value]="value" readonly="true"></ax-check-box> `, isInline: true, dependencies: [{ kind: "component", type: i1.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["readonly", "disabled", "size", "label", "tabIndex", "indeterminate", "value"], outputs: ["onValueChanged", "valueChange", "onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
44
|
+
}
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BooleanRenderer, decorators: [{
|
46
|
+
type: Component,
|
47
|
+
args: [{
|
48
|
+
template: ` <ax-check-box [value]="value" readonly="true"></ax-check-box> `,
|
49
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
50
|
+
}]
|
51
|
+
}], ctorParameters: function () { return []; } });
|
52
|
+
export class BooleanFilterRenderer {
|
53
|
+
value = null;
|
54
|
+
params;
|
55
|
+
valueGetter;
|
56
|
+
input;
|
57
|
+
selectItem = [
|
58
|
+
{ value: 0, label: 'True' },
|
59
|
+
{ value: 1, label: 'False' },
|
60
|
+
];
|
61
|
+
agInit(params) {
|
62
|
+
this.params = params;
|
63
|
+
this.valueGetter = params.valueGetter;
|
64
|
+
}
|
65
|
+
isFilterActive() {
|
66
|
+
return this.value !== null && this.value !== undefined;
|
67
|
+
}
|
68
|
+
doesFilterPass(params) {
|
69
|
+
return this.value === this.valueGetter(params.node);
|
70
|
+
}
|
71
|
+
getModel() {
|
72
|
+
return { value: this.value };
|
73
|
+
}
|
74
|
+
setModel(model) {
|
75
|
+
this.value = model ? model.value : null;
|
76
|
+
}
|
77
|
+
ngAfterViewInit(params) {
|
78
|
+
window.setTimeout(() => {
|
79
|
+
this.input.element.nativeElement.focus();
|
80
|
+
});
|
81
|
+
}
|
82
|
+
onChange(newValue) {
|
83
|
+
if (this.value !== newValue) {
|
84
|
+
this.value = newValue;
|
85
|
+
this.params.filterChangedCallback();
|
86
|
+
}
|
87
|
+
}
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BooleanFilterRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
89
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BooleanFilterRenderer, selector: "ng-component", viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
|
90
|
+
<ax-data-grid-filter>
|
91
|
+
<ax-select-box label="Select Box" [items]="selectItem"></ax-select-box>
|
92
|
+
</ax-data-grid-filter>
|
93
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["showDropDownButton", "rowInputTemplate", "showCheckBox", "readonly", "rtl", "disabled", "placeholder", "size", "allowNull", "textAlign", "bufferSize", "remoteOperation", "fitParent", "dropdownWidth", "onDemandTranslate", "dataSource", "validation", "disabledCallback", "allowSearch", "textField", "valueField", "disabledField", "mode", "items", "selectedItems", "selectedValues"], outputs: ["dropdownToggle", "itemsChange", "onBlur", "onFocus", "selectionChanged", "selectedItemsChange", "selectedValuesChange"] }, { kind: "component", type: i2.AXDataGridFilterComponent, selector: "ax-data-grid-filter" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
94
|
+
}
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BooleanFilterRenderer, decorators: [{
|
96
|
+
type: Component,
|
97
|
+
args: [{
|
98
|
+
template: `
|
99
|
+
<ax-data-grid-filter>
|
100
|
+
<ax-select-box label="Select Box" [items]="selectItem"></ax-select-box>
|
101
|
+
</ax-data-grid-filter>
|
102
|
+
`,
|
103
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
104
|
+
}]
|
105
|
+
}], propDecorators: { input: [{
|
106
|
+
type: ViewChild,
|
107
|
+
args: ['input', { static: true, read: ViewContainerRef }]
|
108
|
+
}] } });
|
109
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2stY29sdW1uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZGF0YS1ncmlkL3NyYy9saWIvZGF0YS1ncmlkL2NvbHVtbnMvY2hlY2stY29sdW1uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsZ0JBQWdCLEdBQ2pCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDOzs7O0FBZ0J0RCxNQUFNLE9BQU8saUJBQWtCLFNBQVEsZ0JBQWdCO0lBQ3JEO1FBQ0UsS0FBSyxFQUFFLENBQUM7SUFDVixDQUFDO0lBRUQsTUFBTTtRQUNKLE1BQU0sR0FBRyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUMzQixJQUFJLENBQUMsR0FBRyxDQUFDLHFCQUFxQixFQUFFO1lBQzlCLEdBQUcsQ0FBQyxxQkFBcUIsR0FBRyxlQUFlLENBQUM7U0FDN0M7UUFDRCxJQUFJLElBQUksQ0FBQyxjQUFjLEVBQUU7WUFDdkIsR0FBRyxDQUFDLGVBQWUsR0FBRyxxQkFBcUIsQ0FBQztTQUM3QztRQUNELE9BQU8sR0FBRyxDQUFDO0lBQ2IsQ0FBQzt3R0FkVSxpQkFBaUI7NEZBQWpCLGlCQUFpQi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|
+
import { Input, ContentChild, Directive } from '@angular/core';
|
3
|
+
import { AXDataGridCellTemplateComponent } from '../templates/cell-template.component';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export class AXGridDataColumn {
|
6
|
+
cellTemplate;
|
7
|
+
width = 100;
|
8
|
+
maxWidth;
|
9
|
+
minWidth;
|
10
|
+
pinned = null;
|
11
|
+
allowSorting = true;
|
12
|
+
allowFiltering = AXConfig.get('datagrid.allowFiltering') || false;
|
13
|
+
;
|
14
|
+
cellClass;
|
15
|
+
sort = null;
|
16
|
+
field = '';
|
17
|
+
caption = '';
|
18
|
+
cellRendererParams;
|
19
|
+
checkbox = false;
|
20
|
+
headerCheckbox = false;
|
21
|
+
groupIndex = -1;
|
22
|
+
treeIndex = -1;
|
23
|
+
enableRowGroup = false;
|
24
|
+
hide = false;
|
25
|
+
floatingFilter = AXConfig.get('datagrid.floatingFilter') || false;
|
26
|
+
disableMenu = false;
|
27
|
+
resizable = true;
|
28
|
+
menuColumnDisable = false;
|
29
|
+
menuItemDisable = false;
|
30
|
+
constructor() { }
|
31
|
+
render() {
|
32
|
+
const col = {
|
33
|
+
field: this.field,
|
34
|
+
width: this.width,
|
35
|
+
};
|
36
|
+
col.resizable = this.resizable;
|
37
|
+
col.suppressMenu = this.disableMenu;
|
38
|
+
col.menuTabs = ['filterMenuTab', 'columnsMenuTab', 'generalMenuTab'];
|
39
|
+
col.floatingFilter = this.floatingFilter;
|
40
|
+
if (!this.allowFiltering) {
|
41
|
+
col.filter = false;
|
42
|
+
col.menuTabs = col.menuTabs.filter(c => c != 'filterMenuTab');
|
43
|
+
col.floatingFilter = false;
|
44
|
+
}
|
45
|
+
if (this.menuColumnDisable == true) {
|
46
|
+
col.menuTabs = col.menuTabs.filter(c => c != 'columnsMenuTab');
|
47
|
+
}
|
48
|
+
if (this.menuItemDisable == true) {
|
49
|
+
col.menuTabs = col.menuTabs.filter(c => c != 'generalMenuTab');
|
50
|
+
}
|
51
|
+
if (this.caption) {
|
52
|
+
col.headerName = this.caption;
|
53
|
+
}
|
54
|
+
if (this.minWidth) {
|
55
|
+
col.minWidth = this.minWidth;
|
56
|
+
}
|
57
|
+
if (this.maxWidth) {
|
58
|
+
col.maxWidth = this.maxWidth;
|
59
|
+
}
|
60
|
+
if (this.pinned) {
|
61
|
+
col.pinned = this.pinned === 'start' ? 'right' : 'left';
|
62
|
+
// TODO: Change based on layout
|
63
|
+
}
|
64
|
+
if (this.allowSorting) {
|
65
|
+
col.sortable = this.allowSorting;
|
66
|
+
}
|
67
|
+
if (this.sort) {
|
68
|
+
col.sort = this.sort;
|
69
|
+
}
|
70
|
+
if (this.groupIndex >= 0) {
|
71
|
+
col.rowGroupIndex = this.groupIndex;
|
72
|
+
col.rowGroup = true;
|
73
|
+
this.enableRowGroup = true;
|
74
|
+
}
|
75
|
+
if (this.treeIndex >= 0) {
|
76
|
+
col.rowGroupIndex = this.treeIndex;
|
77
|
+
col.rowGroup = false;
|
78
|
+
}
|
79
|
+
if (this.hide) {
|
80
|
+
col.hide = true;
|
81
|
+
}
|
82
|
+
if (this.enableRowGroup) {
|
83
|
+
col.enableRowGroup = this.enableRowGroup;
|
84
|
+
}
|
85
|
+
if (this.cellClass) {
|
86
|
+
const THAT = this;
|
87
|
+
if (this.cellClass instanceof Function) {
|
88
|
+
col.cellClass = (p) => {
|
89
|
+
return THAT.cellClass({
|
90
|
+
column: THAT,
|
91
|
+
rowIndex: p.node.rowIndex,
|
92
|
+
rowLevel: p.node.level,
|
93
|
+
data: p.data,
|
94
|
+
value: p.value
|
95
|
+
});
|
96
|
+
};
|
97
|
+
}
|
98
|
+
else {
|
99
|
+
col.cellClass = this.cellClass;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
//
|
103
|
+
if (this.cellTemplate != null) {
|
104
|
+
col.cellRendererFramework = this.cellTemplate.renderer;
|
105
|
+
col.cellRendererParams = this.cellTemplate.params;
|
106
|
+
}
|
107
|
+
if (this.checkbox) {
|
108
|
+
col.checkboxSelection = (params) => {
|
109
|
+
return true;
|
110
|
+
};
|
111
|
+
// col.headerCheckboxSelection = this.headerCheckbox;
|
112
|
+
}
|
113
|
+
return col;
|
114
|
+
}
|
115
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridDataColumn, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
116
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AXGridDataColumn, inputs: { width: "width", maxWidth: "maxWidth", minWidth: "minWidth", pinned: "pinned", allowSorting: "allowSorting", allowFiltering: "allowFiltering", cellClass: "cellClass", sort: "sort", field: "field", caption: "caption", cellRendererParams: "cellRendererParams", checkbox: "checkbox", headerCheckbox: "headerCheckbox", groupIndex: "groupIndex", treeIndex: "treeIndex", enableRowGroup: "enableRowGroup", hide: "hide", floatingFilter: "floatingFilter", disableMenu: "disableMenu", resizable: "resizable", menuColumnDisable: "menuColumnDisable", menuItemDisable: "menuItemDisable" }, queries: [{ propertyName: "cellTemplate", first: true, predicate: AXDataGridCellTemplateComponent, descendants: true }], ngImport: i0 });
|
117
|
+
}
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridDataColumn, decorators: [{
|
119
|
+
type: Directive
|
120
|
+
}], ctorParameters: function () { return []; }, propDecorators: { cellTemplate: [{
|
121
|
+
type: ContentChild,
|
122
|
+
args: [AXDataGridCellTemplateComponent]
|
123
|
+
}], width: [{
|
124
|
+
type: Input
|
125
|
+
}], maxWidth: [{
|
126
|
+
type: Input
|
127
|
+
}], minWidth: [{
|
128
|
+
type: Input
|
129
|
+
}], pinned: [{
|
130
|
+
type: Input
|
131
|
+
}], allowSorting: [{
|
132
|
+
type: Input
|
133
|
+
}], allowFiltering: [{
|
134
|
+
type: Input
|
135
|
+
}], cellClass: [{
|
136
|
+
type: Input
|
137
|
+
}], sort: [{
|
138
|
+
type: Input
|
139
|
+
}], field: [{
|
140
|
+
type: Input
|
141
|
+
}], caption: [{
|
142
|
+
type: Input
|
143
|
+
}], cellRendererParams: [{
|
144
|
+
type: Input
|
145
|
+
}], checkbox: [{
|
146
|
+
type: Input
|
147
|
+
}], headerCheckbox: [{
|
148
|
+
type: Input
|
149
|
+
}], groupIndex: [{
|
150
|
+
type: Input
|
151
|
+
}], treeIndex: [{
|
152
|
+
type: Input
|
153
|
+
}], enableRowGroup: [{
|
154
|
+
type: Input
|
155
|
+
}], hide: [{
|
156
|
+
type: Input
|
157
|
+
}], floatingFilter: [{
|
158
|
+
type: Input
|
159
|
+
}], disableMenu: [{
|
160
|
+
type: Input
|
161
|
+
}], resizable: [{
|
162
|
+
type: Input
|
163
|
+
}], menuColumnDisable: [{
|
164
|
+
type: Input
|
165
|
+
}], menuItemDisable: [{
|
166
|
+
type: Input
|
167
|
+
}] } });
|
168
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sdW1uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvZGF0YS1ncmlkL3NyYy9saWIvZGF0YS1ncmlkL2NvbHVtbnMvY29sdW1uLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxLQUFLLEVBQUUsWUFBWSxFQUFlLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUU1RSxPQUFPLEVBQUUsK0JBQStCLEVBQUUsTUFBTSxzQ0FBc0MsQ0FBQzs7QUFLdkYsTUFBTSxPQUFnQixnQkFBZ0I7SUFJbEMsWUFBWSxDQUFrQztJQUc5QyxLQUFLLEdBQVcsR0FBRyxDQUFDO0lBR3BCLFFBQVEsQ0FBU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lzLmNhcHRpb247XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMubWluV2lkdGgpIHtcbiAgICAgICAgICAgIGNvbC5taW5XaWR0aCA9IHRoaXMubWluV2lkdGg7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMubWF4V2lkdGgpIHtcbiAgICAgICAgICAgIGNvbC5tYXhXaWR0aCA9IHRoaXMubWF4V2lkdGg7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMucGlubmVkKSB7XG4gICAgICAgICAgICBjb2wucGlubmVkID0gdGhpcy5waW5uZWQgPT09ICdzdGFydCcgPyAncmlnaHQnIDogJ2xlZnQnO1xuICAgICAgICAgICAgLy8gVE9ETzogQ2hhbmdlIGJhc2VkIG9uIGxheW91dFxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLmFsbG93U29ydGluZykge1xuICAgICAgICAgICAgY29sLnNvcnRhYmxlID0gdGhpcy5hbGxvd1NvcnRpbmc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMuc29ydCkge1xuICAgICAgICAgICAgY29sLnNvcnQgPSB0aGlzLnNvcnQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5ncm91cEluZGV4ID49IDApIHtcbiAgICAgICAgICAgIGNvbC5yb3dHcm91cEluZGV4ID0gdGhpcy5ncm91cEluZGV4O1xuICAgICAgICAgICAgY29sLnJvd0dyb3VwID0gdHJ1ZTtcbiAgICAgICAgICAgIHRoaXMuZW5hYmxlUm93R3JvdXAgPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMudHJlZUluZGV4ID49IDApIHtcbiAgICAgICAgICAgIGNvbC5yb3dHcm91cEluZGV4ID0gdGhpcy50cmVlSW5kZXg7XG4gICAgICAgICAgICBjb2wucm93R3JvdXAgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5oaWRlKSB7XG4gICAgICAgICAgICBjb2wuaGlkZSA9IHRydWU7XG5cbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5lbmFibGVSb3dHcm91cCkge1xuICAgICAgICAgICAgY29sLmVuYWJsZVJvd0dyb3VwID0gdGhpcy5lbmFibGVSb3dHcm91cDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmNlbGxDbGFzcykge1xuICAgICAgICAgICAgY29uc3QgVEhBVCA9IHRoaXM7XG4gICAgICAgICAgICBpZiAodGhpcy5jZWxsQ2xhc3MgaW5zdGFuY2VvZiBGdW5jdGlvbikge1xuICAgICAgICAgICAgICAgIGNvbC5jZWxsQ2xhc3MgPSAocCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gVEhBVC5jZWxsQ2xhc3Moe1xuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBUSEFULFxuICAgICAgICAgICAgICAgICAgICAgICAgcm93SW5kZXg6IHAubm9kZS5yb3dJbmRleCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJvd0xldmVsOiBwLm5vZGUubGV2ZWwsXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBwLmRhdGEsXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcC52YWx1ZVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29sLmNlbGxDbGFzcyA9IHRoaXMuY2VsbENsYXNzO1xuXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy9cbiAgICAgICAgaWYgKHRoaXMuY2VsbFRlbXBsYXRlICE9IG51bGwpIHtcbiAgICAgICAgICAgIGNvbC5jZWxsUmVuZGVyZXJGcmFtZXdvcmsgPSB0aGlzLmNlbGxUZW1wbGF0ZS5yZW5kZXJlcjtcbiAgICAgICAgICAgIGNvbC5jZWxsUmVuZGVyZXJQYXJhbXMgPSB0aGlzLmNlbGxUZW1wbGF0ZS5wYXJhbXM7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5jaGVja2JveCkge1xuICAgICAgICAgICAgY29sLmNoZWNrYm94U2VsZWN0aW9uID0gKHBhcmFtcykgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIC8vICBjb2wuaGVhZGVyQ2hlY2tib3hTZWxlY3Rpb24gPSB0aGlzLmhlYWRlckNoZWNrYm94O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjb2w7XG4gICAgfVxufVxuXG5cblxuXG5cblxuXG5cbiJdfQ==
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import { AXGridDataColumn } from './column.component';
|
2
|
+
import { ChangeDetectionStrategy, Component, Input, EventEmitter, ViewEncapsulation, Output } from '@angular/core';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@angular/common";
|
5
|
+
export class AXGridCommandColumn extends AXGridDataColumn {
|
6
|
+
items = [];
|
7
|
+
onItemClick = new EventEmitter();
|
8
|
+
render() {
|
9
|
+
const col = super.render();
|
10
|
+
if (!col.cellRendererFramework) {
|
11
|
+
col.cellRendererFramework = CommandRenderer;
|
12
|
+
}
|
13
|
+
col.cellRendererParams = {
|
14
|
+
items: this.items,
|
15
|
+
onClick: (e) => {
|
16
|
+
this.onItemClick.emit({
|
17
|
+
command: e.name,
|
18
|
+
data: e.data,
|
19
|
+
rowIndex: e.rowIndex,
|
20
|
+
rowLevel: e.rowLevel,
|
21
|
+
htmlEvent: e.htmlEvent
|
22
|
+
});
|
23
|
+
}
|
24
|
+
};
|
25
|
+
col.sortable = false;
|
26
|
+
col.filter = false;
|
27
|
+
col.valueGetter = (params) => {
|
28
|
+
return this.items;
|
29
|
+
};
|
30
|
+
return col;
|
31
|
+
}
|
32
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridCommandColumn, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
33
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AXGridCommandColumn, selector: "ax-command-column", inputs: { items: "items" }, outputs: { onItemClick: "onItemClick" }, providers: [{ provide: AXGridDataColumn, useExisting: AXGridCommandColumn }], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
34
|
+
}
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridCommandColumn, decorators: [{
|
36
|
+
type: Component,
|
37
|
+
args: [{
|
38
|
+
selector: 'ax-command-column',
|
39
|
+
template: '',
|
40
|
+
providers: [{ provide: AXGridDataColumn, useExisting: AXGridCommandColumn }],
|
41
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
42
|
+
encapsulation: ViewEncapsulation.None
|
43
|
+
}]
|
44
|
+
}], propDecorators: { items: [{
|
45
|
+
type: Input
|
46
|
+
}], onItemClick: [{
|
47
|
+
type: Output
|
48
|
+
}] } });
|
49
|
+
export class CommandRenderer {
|
50
|
+
items = [];
|
51
|
+
node;
|
52
|
+
clickCallback;
|
53
|
+
constructor() { }
|
54
|
+
agInit(params) {
|
55
|
+
this.mapParams(params);
|
56
|
+
}
|
57
|
+
refresh(params) {
|
58
|
+
this.mapParams(params);
|
59
|
+
return true;
|
60
|
+
}
|
61
|
+
mapParams(params) {
|
62
|
+
this.node = params.node;
|
63
|
+
this.items = typeof params.items == 'function' ? params.items({ data: this.node.data }) : Array.isArray(params.items) ? params.items : [];
|
64
|
+
this.clickCallback = params.onClick;
|
65
|
+
}
|
66
|
+
onClick(item, e) {
|
67
|
+
if (this.clickCallback && !item.disable) {
|
68
|
+
this.clickCallback({
|
69
|
+
name: item.name,
|
70
|
+
rowLevel: this.node.level,
|
71
|
+
rowIndex: this.node.rowIndex,
|
72
|
+
data: this.node.data,
|
73
|
+
htmlEvent: e
|
74
|
+
});
|
75
|
+
}
|
76
|
+
}
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommandRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
78
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CommandRenderer, selector: "ax-command-cell", ngImport: i0, template: `
|
79
|
+
<ng-container *ngFor="let item of items; let i = index">
|
80
|
+
<button *ngIf="item.visible !== false"
|
81
|
+
class="ax button md ax-grid-command-button {{ item.style || 'ax primary blank' }}"
|
82
|
+
[class.disabled]="item.disable"
|
83
|
+
type="button"
|
84
|
+
[title]="item.tooltip"
|
85
|
+
[attr.tabindex]="i"
|
86
|
+
(click)="onClick(item, $event)"
|
87
|
+
>
|
88
|
+
<i [ngClass]="item.icon"></i>{{ item.text }}
|
89
|
+
</button>
|
90
|
+
</ng-container>
|
91
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
92
|
+
}
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CommandRenderer, decorators: [{
|
94
|
+
type: Component,
|
95
|
+
args: [{
|
96
|
+
selector: 'ax-command-cell',
|
97
|
+
template: `
|
98
|
+
<ng-container *ngFor="let item of items; let i = index">
|
99
|
+
<button *ngIf="item.visible !== false"
|
100
|
+
class="ax button md ax-grid-command-button {{ item.style || 'ax primary blank' }}"
|
101
|
+
[class.disabled]="item.disable"
|
102
|
+
type="button"
|
103
|
+
[title]="item.tooltip"
|
104
|
+
[attr.tabindex]="i"
|
105
|
+
(click)="onClick(item, $event)"
|
106
|
+
>
|
107
|
+
<i [ngClass]="item.icon"></i>{{ item.text }}
|
108
|
+
</button>
|
109
|
+
</ng-container>
|
110
|
+
`,
|
111
|
+
encapsulation: ViewEncapsulation.None,
|
112
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
113
|
+
}]
|
114
|
+
}], ctorParameters: function () { return []; } });
|
115
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZC1jb2x1bW4uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9kYXRhLWdyaWQvc3JjL2xpYi9kYXRhLWdyaWQvY29sdW1ucy9jb21tYW5kLWNvbHVtbi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDdEQsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsWUFBWSxFQUFFLGlCQUFpQixFQUFFLE1BQU0sRUFBcUIsTUFBTSxlQUFlLENBQUM7OztBQWV0SSxNQUFNLE9BQU8sbUJBQW9CLFNBQVEsZ0JBQWdCO0lBRXZELEtBQUssR0FBNEMsRUFBRSxDQUFDO0lBR3BELFdBQVcsR0FBd0MsSUFBSSxZQUFZLEVBQXlCLENBQUM7SUFFN0YsTUFBTTtRQUNKLE1BQU0sR0FBRyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQUMzQixJQUFJLENBQUMsR0FBRyxDQUFDLHFCQUFxQixFQUFFO1lBQzlCLEdBQUcsQ0FBQyxxQkFBcUIsR0FBRyxlQUFlLENBQU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gZGF0YTogdGhpcy5ub2RlLmRhdGEgfSkgOiBBcnJheS5pc0FycmF5KHBhcmFtcy5pdGVtcykgPyBwYXJhbXMuaXRlbXMgOiBbXTtcbiAgICB0aGlzLmNsaWNrQ2FsbGJhY2sgPSBwYXJhbXMub25DbGljaztcbiAgfVxuXG4gIG9uQ2xpY2soaXRlbTogQVhNZW51SXRlbSwgZTogTW91c2VFdmVudCkge1xuICAgIGlmICh0aGlzLmNsaWNrQ2FsbGJhY2sgJiYgIWl0ZW0uZGlzYWJsZSkge1xuICAgICAgdGhpcy5jbGlja0NhbGxiYWNrKHtcbiAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxuICAgICAgICByb3dMZXZlbDogdGhpcy5ub2RlLmxldmVsLFxuICAgICAgICByb3dJbmRleDogdGhpcy5ub2RlLnJvd0luZGV4LFxuICAgICAgICBkYXRhOiB0aGlzLm5vZGUuZGF0YSxcbiAgICAgICAgaHRtbEV2ZW50OiBlXG4gICAgICB9KTtcbiAgICB9XG4gIH1cbn1cbiJdfQ==
|
@@ -0,0 +1,115 @@
|
|
1
|
+
import { Component, ChangeDetectionStrategy, Input, ViewEncapsulation, ViewChild, ElementRef } from '@angular/core';
|
2
|
+
import { AXGridDataColumn } from './column.component';
|
3
|
+
import { AXDateTime, AXConfig } from '@acorex/core';
|
4
|
+
import { AXDatePickerComponent } from '@acorex/components';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
import * as i1 from "@acorex/components";
|
7
|
+
export class AXGridDateColumn extends AXGridDataColumn {
|
8
|
+
constructor() {
|
9
|
+
super();
|
10
|
+
}
|
11
|
+
format;
|
12
|
+
type = AXConfig.get('dateTime.type');
|
13
|
+
render() {
|
14
|
+
const col = super.render();
|
15
|
+
col.cellRendererParams = {
|
16
|
+
format: this.format,
|
17
|
+
};
|
18
|
+
col.comparator = (valueA, valueB) => {
|
19
|
+
const date1 = AXDateTime.convert(valueA);
|
20
|
+
const date2 = AXDateTime.convert(valueB);
|
21
|
+
//
|
22
|
+
if (date1 === null && date2 === null) {
|
23
|
+
return 0;
|
24
|
+
}
|
25
|
+
if (date1 === null) {
|
26
|
+
return -1;
|
27
|
+
}
|
28
|
+
if (date2 === null) {
|
29
|
+
return 1;
|
30
|
+
}
|
31
|
+
return (date1.date.getTime() - date2.date.getTime());
|
32
|
+
};
|
33
|
+
col.valueFormatter = (params) => {
|
34
|
+
const date = AXDateTime.convert(params.value, this.type);
|
35
|
+
if (date) {
|
36
|
+
return date.format(this.format);
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
return null;
|
40
|
+
}
|
41
|
+
};
|
42
|
+
col.filter = 'agDateColumnFilter';
|
43
|
+
// col.floatingFilter = true;
|
44
|
+
return col;
|
45
|
+
}
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridDateColumn, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AXGridDateColumn, selector: "ax-date-column", inputs: { format: "format", type: "type" }, providers: [{ provide: AXGridDataColumn, useExisting: AXGridDateColumn }], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
48
|
+
}
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXGridDateColumn, decorators: [{
|
50
|
+
type: Component,
|
51
|
+
args: [{
|
52
|
+
selector: 'ax-date-column',
|
53
|
+
template: '',
|
54
|
+
providers: [{ provide: AXGridDataColumn, useExisting: AXGridDateColumn }],
|
55
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
56
|
+
}]
|
57
|
+
}], ctorParameters: function () { return []; }, propDecorators: { format: [{
|
58
|
+
type: Input
|
59
|
+
}], type: [{
|
60
|
+
type: Input
|
61
|
+
}] } });
|
62
|
+
export class AXDatePickerFilterComponent {
|
63
|
+
datePicker;
|
64
|
+
div;
|
65
|
+
selectableHoliday = false;
|
66
|
+
type = 'jalali';
|
67
|
+
date;
|
68
|
+
params;
|
69
|
+
picker;
|
70
|
+
agInit(params) {
|
71
|
+
this.params = params;
|
72
|
+
}
|
73
|
+
ngAfterViewInit() {
|
74
|
+
}
|
75
|
+
ngOnDestroy() {
|
76
|
+
}
|
77
|
+
onDateChanged(selectedDates) {
|
78
|
+
//this.date = selectedDates[0] || null;
|
79
|
+
this.params.onDateChanged();
|
80
|
+
}
|
81
|
+
getDate() {
|
82
|
+
return this.date;
|
83
|
+
}
|
84
|
+
setDate(date) {
|
85
|
+
this.date = date || null;
|
86
|
+
//this.picker.setDate(date);
|
87
|
+
}
|
88
|
+
setInputPlaceholder(placeholder) {
|
89
|
+
//this.div.nativeElement.setAttribute('placeholder', placeholder);
|
90
|
+
}
|
91
|
+
onValueChanged(e) {
|
92
|
+
this.setDate(e.value);
|
93
|
+
this.onDateChanged(e.value);
|
94
|
+
}
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXDatePickerFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
96
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AXDatePickerFilterComponent, selector: "ax-data-picker-filter", viewQueries: [{ propertyName: "datePicker", first: true, predicate: AXDatePickerComponent, descendants: true }, { propertyName: "div", first: true, predicate: ["div"], descendants: true, read: ElementRef }], ngImport: i0, template: `<ax-date-picker [selectableHoliday]="selectableHoliday" [allowClear]="true" (onValueChanged)="onValueChanged($event)" size="sm">
|
97
|
+
</ax-date-picker>`, isInline: true, dependencies: [{ kind: "component", type: i1.AXDatePickerComponent, selector: "ax-date-picker", inputs: ["dayStyle", "dayMinMaxResoan", "validation", "placeholder", "min", "max", "readonly", "disabled", "allowClear", "textAlign", "showToday", "selectableHoliday", "dateType", "showTodayButton", "openByClick", "size", "type", "value"], outputs: ["typeChange", "onValueChanged", "valueChange"] }], encapsulation: i0.ViewEncapsulation.None });
|
98
|
+
}
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXDatePickerFilterComponent, decorators: [{
|
100
|
+
type: Component,
|
101
|
+
args: [{
|
102
|
+
selector: 'ax-data-picker-filter',
|
103
|
+
template: `<ax-date-picker [selectableHoliday]="selectableHoliday" [allowClear]="true" (onValueChanged)="onValueChanged($event)" size="sm">
|
104
|
+
</ax-date-picker>`,
|
105
|
+
host: {},
|
106
|
+
encapsulation: ViewEncapsulation.None
|
107
|
+
}]
|
108
|
+
}], propDecorators: { datePicker: [{
|
109
|
+
type: ViewChild,
|
110
|
+
args: [AXDatePickerComponent]
|
111
|
+
}], div: [{
|
112
|
+
type: ViewChild,
|
113
|
+
args: ['div', { read: ElementRef }]
|
114
|
+
}] } });
|
115
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS1jb2x1bW4uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9kYXRhLWdyaWQvc3JjL2xpYi9kYXRhLWdyaWQvY29sdW1ucy9kYXRlLWNvbHVtbi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUNMLFNBQVMsRUFDVCx1QkFBdUIsRUFDdkIsS0FBSyxFQUNMLGlCQUFpQixFQUNqQixTQUFTLEVBQ1QsVUFBVSxFQUNYLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxVQUFVLEVBQUUsUUFBUSxFQUFrQixNQUFNLGNBQWMsQ0FBQztBQUNwRSxPQUFPLEVBQUUscUJBQXFCLEVBQ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