@dereekb/dbx-web 9.20.19 → 9.21.0

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.
Files changed (98) hide show
  1. package/calendar/package.json +2 -2
  2. package/esm2020/lib/layout/content/content.layout.module.mjs +31 -4
  3. package/esm2020/lib/layout/content/content.pit.directive.mjs +19 -0
  4. package/esm2020/lib/layout/content/index.mjs +2 -1
  5. package/esm2020/lib/layout/list/list.wrapper.mjs +1 -1
  6. package/esm2020/table/dereekb-dbx-web-table.mjs +5 -0
  7. package/esm2020/table/index.mjs +2 -0
  8. package/esm2020/table/lib/date/date.table.column.header.component.mjs +49 -0
  9. package/esm2020/table/lib/date/daterange.table.cell.input.component.mjs +166 -0
  10. package/esm2020/table/lib/date/index.mjs +4 -0
  11. package/esm2020/table/lib/date/table.date.module.mjs +68 -0
  12. package/esm2020/table/lib/index.mjs +18 -0
  13. package/esm2020/table/lib/table.cell.action.component.mjs +28 -0
  14. package/esm2020/table/lib/table.cell.input.component.mjs +31 -0
  15. package/esm2020/table/lib/table.cell.summaryend.component.mjs +28 -0
  16. package/esm2020/table/lib/table.cell.summarystart.component.mjs +31 -0
  17. package/esm2020/table/lib/table.column.directive.mjs +30 -0
  18. package/esm2020/table/lib/table.column.footer.component.mjs +35 -0
  19. package/esm2020/table/lib/table.column.header.component.mjs +35 -0
  20. package/esm2020/table/lib/table.component.mjs +59 -0
  21. package/esm2020/table/lib/table.directive.mjs +37 -0
  22. package/esm2020/table/lib/table.item.action.component.mjs +35 -0
  23. package/esm2020/table/lib/table.item.cell.component.mjs +39 -0
  24. package/esm2020/table/lib/table.item.directive.mjs +30 -0
  25. package/esm2020/table/lib/table.item.header.component.mjs +27 -0
  26. package/esm2020/table/lib/table.mjs +2 -0
  27. package/esm2020/table/lib/table.module.mjs +74 -0
  28. package/esm2020/table/lib/table.store.mjs +53 -0
  29. package/fesm2015/dereekb-dbx-web-table.mjs +746 -0
  30. package/fesm2015/dereekb-dbx-web-table.mjs.map +1 -0
  31. package/fesm2015/dereekb-dbx-web.mjs +58 -13
  32. package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
  33. package/fesm2020/dereekb-dbx-web-table.mjs +739 -0
  34. package/fesm2020/dereekb-dbx-web-table.mjs.map +1 -0
  35. package/fesm2020/dereekb-dbx-web.mjs +56 -13
  36. package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
  37. package/lib/extension/_extension.scss +19 -0
  38. package/lib/extension/table/_table.scss +60 -0
  39. package/lib/layout/content/_content.scss +14 -0
  40. package/lib/layout/content/content.layout.module.d.ts +3 -2
  41. package/lib/layout/content/content.pit.directive.d.ts +8 -0
  42. package/lib/layout/content/index.d.ts +1 -0
  43. package/lib/layout/list/list.wrapper.d.ts +2 -1
  44. package/lib/layout/style/_style.scss +4 -0
  45. package/lib/style/_config.scss +8 -2
  46. package/mapbox/package.json +3 -3
  47. package/package.json +14 -6
  48. package/table/README.md +6 -0
  49. package/table/esm2020/dereekb-dbx-web-table.mjs +5 -0
  50. package/table/esm2020/index.mjs +2 -0
  51. package/table/esm2020/lib/date/date.table.column.header.component.mjs +49 -0
  52. package/table/esm2020/lib/date/daterange.table.cell.input.component.mjs +166 -0
  53. package/table/esm2020/lib/date/index.mjs +4 -0
  54. package/table/esm2020/lib/date/table.date.module.mjs +68 -0
  55. package/table/esm2020/lib/index.mjs +18 -0
  56. package/table/esm2020/lib/table.cell.action.component.mjs +28 -0
  57. package/table/esm2020/lib/table.cell.input.component.mjs +31 -0
  58. package/table/esm2020/lib/table.cell.summaryend.component.mjs +28 -0
  59. package/table/esm2020/lib/table.cell.summarystart.component.mjs +31 -0
  60. package/table/esm2020/lib/table.column.directive.mjs +30 -0
  61. package/table/esm2020/lib/table.column.footer.component.mjs +35 -0
  62. package/table/esm2020/lib/table.column.header.component.mjs +35 -0
  63. package/table/esm2020/lib/table.component.mjs +59 -0
  64. package/table/esm2020/lib/table.directive.mjs +37 -0
  65. package/table/esm2020/lib/table.item.action.component.mjs +35 -0
  66. package/table/esm2020/lib/table.item.cell.component.mjs +39 -0
  67. package/table/esm2020/lib/table.item.directive.mjs +30 -0
  68. package/table/esm2020/lib/table.item.header.component.mjs +27 -0
  69. package/table/esm2020/lib/table.mjs +2 -0
  70. package/table/esm2020/lib/table.module.mjs +74 -0
  71. package/table/esm2020/lib/table.store.mjs +53 -0
  72. package/table/fesm2015/dereekb-dbx-web-table.mjs +746 -0
  73. package/table/fesm2015/dereekb-dbx-web-table.mjs.map +1 -0
  74. package/table/fesm2020/dereekb-dbx-web-table.mjs +739 -0
  75. package/table/fesm2020/dereekb-dbx-web-table.mjs.map +1 -0
  76. package/table/index.d.ts +1 -0
  77. package/table/lib/date/date.table.column.header.component.d.ts +18 -0
  78. package/table/lib/date/daterange.table.cell.input.component.d.ts +66 -0
  79. package/table/lib/date/index.d.ts +3 -0
  80. package/table/lib/date/table.date.module.d.ts +16 -0
  81. package/table/lib/index.d.ts +17 -0
  82. package/table/lib/table.cell.action.component.d.ts +9 -0
  83. package/table/lib/table.cell.input.component.d.ts +12 -0
  84. package/table/lib/table.cell.summaryend.component.d.ts +9 -0
  85. package/table/lib/table.cell.summarystart.component.d.ts +12 -0
  86. package/table/lib/table.column.directive.d.ts +18 -0
  87. package/table/lib/table.column.footer.component.d.ts +8 -0
  88. package/table/lib/table.column.header.component.d.ts +8 -0
  89. package/table/lib/table.component.d.ts +29 -0
  90. package/table/lib/table.d.ts +99 -0
  91. package/table/lib/table.directive.d.ts +16 -0
  92. package/table/lib/table.item.action.component.d.ts +8 -0
  93. package/table/lib/table.item.cell.component.d.ts +13 -0
  94. package/table/lib/table.item.directive.d.ts +17 -0
  95. package/table/lib/table.item.header.component.d.ts +8 -0
  96. package/table/lib/table.module.d.ts +22 -0
  97. package/table/lib/table.store.d.ts +38 -0
  98. package/table/package.json +35 -0
@@ -0,0 +1,746 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Injectable, NgModule, Directive, Input } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import { isSameDateDay } from '@dereekb/date';
6
+ import * as i4 from '@angular/material/datepicker';
7
+ import { DateRange, MAT_DATE_RANGE_SELECTION_STRATEGY, MatDatepickerModule } from '@angular/material/datepicker';
8
+ import * as i3 from '@angular/forms';
9
+ import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
10
+ import { filterMaybe, beginLoading, valueFromLoadingState, SubscriptionObject, loadingStateContext } from '@dereekb/rxjs';
11
+ import { format, addDays } from 'date-fns';
12
+ import { switchMap, first, tap, map, distinctUntilChanged, shareReplay, combineLatest, of, BehaviorSubject, startWith, filter, throttleTime } from 'rxjs';
13
+ import * as i1 from '@angular/material/core';
14
+ import { ComponentStore } from '@ngrx/component-store';
15
+ import * as i5 from '@angular/material/button';
16
+ import { MatButtonModule } from '@angular/material/button';
17
+ import { MatIconModule } from '@angular/material/icon';
18
+ import * as i3$1 from '@dereekb/dbx-web';
19
+ import { DbxLoadingModule } from '@dereekb/dbx-web';
20
+ import * as i4$1 from '@angular/material/table';
21
+ import { MatTableModule } from '@angular/material/table';
22
+ import * as i1$1 from '@dereekb/dbx-core';
23
+ import { DbxInjectionComponentModule } from '@dereekb/dbx-core';
24
+ import { shareReplay as shareReplay$1 } from 'rxjs/operators';
25
+ import * as i5$1 from 'ngx-infinite-scroll';
26
+ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
27
+
28
+ /**
29
+ * A table header component used for rendering date values on the header.
30
+ */
31
+ class DbxTableDateHeaderComponent {
32
+ constructor() {
33
+ this.left = 'E';
34
+ this.right = 'MMM d';
35
+ }
36
+ get date() {
37
+ return this._date;
38
+ }
39
+ set date(date) {
40
+ this._date = date;
41
+ }
42
+ }
43
+ DbxTableDateHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
44
+ DbxTableDateHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableDateHeaderComponent, selector: "ng-component", ngImport: i0, template: `
45
+ <div *ngIf="date" class="dbx-table-date-column-header">
46
+ <span class="dbx-table-date-column-header-left">{{ date | date: left }}</span>
47
+ <span>{{ date | date: right }}</span>
48
+ </div>
49
+ `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateHeaderComponent, decorators: [{
51
+ type: Component,
52
+ args: [{
53
+ template: `
54
+ <div *ngIf="date" class="dbx-table-date-column-header">
55
+ <span class="dbx-table-date-column-header-left">{{ date | date: left }}</span>
56
+ <span>{{ date | date: right }}</span>
57
+ </div>
58
+ `,
59
+ changeDetection: ChangeDetectionStrategy.OnPush
60
+ }]
61
+ }], ctorParameters: function () { return []; } });
62
+ function dbxTableDateHeaderInjectionFactory() {
63
+ return (column) => {
64
+ const config = {
65
+ componentClass: DbxTableDateHeaderComponent,
66
+ init: (x) => {
67
+ x.date = column.meta;
68
+ }
69
+ };
70
+ return config;
71
+ };
72
+ }
73
+
74
+ class DbxTableStore extends ComponentStore {
75
+ constructor() {
76
+ super({
77
+ input: null,
78
+ dataDelegate: null,
79
+ viewDelegate: null
80
+ });
81
+ // MARK: Effects
82
+ this.loadMore = this.effect((input) => {
83
+ return input.pipe(switchMap(() => this.data$.pipe(first(), tap((x) => {
84
+ if (x.loadMore) {
85
+ x.loadMore();
86
+ }
87
+ }))));
88
+ });
89
+ // MARK: Accessors
90
+ this.input$ = this.state$.pipe(map((x) => x.input), distinctUntilChanged(), shareReplay(1));
91
+ this.dataDelegate$ = this.state$.pipe(map((x) => x.dataDelegate), distinctUntilChanged(), shareReplay(1));
92
+ this.currentViewDelegate$ = this.state$.pipe(map((x) => x.viewDelegate), distinctUntilChanged(), shareReplay(1));
93
+ this.viewDelegate$ = this.currentViewDelegate$.pipe(filterMaybe());
94
+ this.dataState$ = combineLatest([this.input$, this.dataDelegate$]).pipe(switchMap(([input, dataDelegate]) => {
95
+ let obs;
96
+ if (input && dataDelegate) {
97
+ obs = dataDelegate.loadData(input);
98
+ }
99
+ else {
100
+ obs = of(beginLoading());
101
+ }
102
+ return obs;
103
+ }), shareReplay(1));
104
+ this.data$ = this.dataState$.pipe(
105
+ //
106
+ valueFromLoadingState(), distinctUntilChanged(), shareReplay(1));
107
+ this.columns$ = this.data$.pipe(map((x) => x.columns), shareReplay(1));
108
+ this.itemsState$ = this.data$.pipe(switchMap((x) => x.items$), shareReplay(1));
109
+ this.items$ = this.itemsState$.pipe(valueFromLoadingState(), shareReplay(1));
110
+ // MARK: State Changes
111
+ this.setInput = this.updater((state, input) => (Object.assign(Object.assign({}, state), { input })));
112
+ this.setDataDelegate = this.updater((state, dataDelegate) => (Object.assign(Object.assign({}, state), { dataDelegate })));
113
+ this.setViewDelegate = this.updater((state, viewDelegate) => (Object.assign(Object.assign({}, state), { viewDelegate })));
114
+ }
115
+ }
116
+ DbxTableStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
117
+ DbxTableStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableStore });
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableStore, decorators: [{
119
+ type: Injectable
120
+ }], ctorParameters: function () { return []; } });
121
+
122
+ class DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy {
123
+ constructor(_dateAdapter, dbxTableDateRangeDayDistanceInputCellInputComponent) {
124
+ this._dateAdapter = _dateAdapter;
125
+ this.dbxTableDateRangeDayDistanceInputCellInputComponent = dbxTableDateRangeDayDistanceInputCellInputComponent;
126
+ }
127
+ selectionFinished(date) {
128
+ return this._createFiveDayRange(date);
129
+ }
130
+ createPreview(activeDate) {
131
+ return this._createFiveDayRange(activeDate);
132
+ }
133
+ _createFiveDayRange(date) {
134
+ if (date) {
135
+ const start = date;
136
+ const end = this._dateAdapter.addCalendarDays(date, this.dbxTableDateRangeDayDistanceInputCellInputComponent.daysDistance);
137
+ return new DateRange(start, end);
138
+ }
139
+ return new DateRange(null, null);
140
+ }
141
+ }
142
+ DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy, deps: [{ token: i1.DateAdapter }, { token: DbxTableDateRangeDayDistanceInputCellInputComponent }], target: i0.ɵɵFactoryTarget.Injectable });
143
+ DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy });
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy, decorators: [{
145
+ type: Injectable
146
+ }], ctorParameters: function () { return [{ type: i1.DateAdapter }, { type: DbxTableDateRangeDayDistanceInputCellInputComponent }]; } });
147
+ const DEFAULT_DBX_TABLE_DATE_RANGE_DAY_DISTIANCE_INPUT_CELL_COMPONENT_CONFIG = { daysDistance: 6 };
148
+ const DEFAULT_DBX_TABLE_DATE_RANGE_DAY_BUTTON_FORMAT = 'MMM dd';
149
+ /**
150
+ * Cell input for a DateRangeDayDistanceInput value.
151
+ */
152
+ class DbxTableDateRangeDayDistanceInputCellInputComponent {
153
+ constructor(tableStore) {
154
+ this.tableStore = tableStore;
155
+ this._syncSub = new SubscriptionObject();
156
+ this._valueSub = new SubscriptionObject();
157
+ this._pickerOpened = new BehaviorSubject(false);
158
+ this._config = new BehaviorSubject(DEFAULT_DBX_TABLE_DATE_RANGE_DAY_DISTIANCE_INPUT_CELL_COMPONENT_CONFIG);
159
+ this.range = new FormGroup({
160
+ start: new FormControl(null),
161
+ end: new FormControl(null)
162
+ });
163
+ this.pickerOpened$ = this._pickerOpened.asObservable();
164
+ this.minDate$ = this._config.pipe(map((x) => x.minDate));
165
+ this.maxDate$ = this._config.pipe(map((x) => x.maxDate));
166
+ this.buttonFormat$ = this._config.pipe(map((x) => { var _a; return (_a = x.buttonFormat) !== null && _a !== void 0 ? _a : DEFAULT_DBX_TABLE_DATE_RANGE_DAY_BUTTON_FORMAT; }));
167
+ this.dateRangeString$ = combineLatest([this.buttonFormat$, this.range.valueChanges]).pipe(map(([buttonFormat, { start, end }]) => {
168
+ if (start && end) {
169
+ return `${format(start, buttonFormat)} - ${format(end, buttonFormat)}`;
170
+ }
171
+ else {
172
+ return `Select Date`;
173
+ }
174
+ }));
175
+ }
176
+ ngOnInit() {
177
+ this._syncSub.subscription = this.tableStore.input$.subscribe((x) => {
178
+ var _a;
179
+ const start = (_a = x === null || x === void 0 ? void 0 : x.date) !== null && _a !== void 0 ? _a : null;
180
+ const end = start ? addDays(start, this.daysDistance) : undefined;
181
+ this.range.setValue({
182
+ start,
183
+ end
184
+ });
185
+ });
186
+ this._valueSub.subscription = this._pickerOpened
187
+ .pipe(distinctUntilChanged(), switchMap((opened) => {
188
+ let obs;
189
+ if (opened) {
190
+ obs = of({});
191
+ }
192
+ else {
193
+ obs = this.range.valueChanges.pipe(startWith(this.range.value));
194
+ }
195
+ return obs;
196
+ }), filter((x) => Boolean(x.start)), distinctUntilChanged((a, b) => isSameDateDay(a.start, b.start)), throttleTime(100, undefined, { trailing: true }))
197
+ .subscribe((x) => {
198
+ if (x.start) {
199
+ this.tableStore.setInput({ date: x.start, distance: this.daysDistance });
200
+ }
201
+ });
202
+ }
203
+ ngOnDestroy() {
204
+ this._pickerOpened.complete();
205
+ this._config.complete();
206
+ this._syncSub.destroy();
207
+ this._valueSub.destroy();
208
+ }
209
+ get daysDistance() {
210
+ return this._config.value.daysDistance;
211
+ }
212
+ get config() {
213
+ return this._config.value;
214
+ }
215
+ set config(config) {
216
+ this._config.next(config || DEFAULT_DBX_TABLE_DATE_RANGE_DAY_DISTIANCE_INPUT_CELL_COMPONENT_CONFIG);
217
+ }
218
+ pickerOpened() {
219
+ this._pickerOpened.next(true);
220
+ }
221
+ pickerClosed() {
222
+ this._pickerOpened.next(false);
223
+ }
224
+ }
225
+ DbxTableDateRangeDayDistanceInputCellInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateRangeDayDistanceInputCellInputComponent, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Component });
226
+ DbxTableDateRangeDayDistanceInputCellInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableDateRangeDayDistanceInputCellInputComponent, selector: "ng-component", providers: [
227
+ {
228
+ provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
229
+ useClass: DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy
230
+ }
231
+ ], ngImport: i0, template: `
232
+ <div class="dbx-table-date-range-distance-input-cell">
233
+ <mat-date-range-input class="dbx-table-date-range-distance-input" [min]="minDate$ | async" [max]="maxDate$ | async" [formGroup]="range" [rangePicker]="picker">
234
+ <input matStartDate formControlName="start" placeholder="Start date" />
235
+ <input matEndDate formControlName="end" placeholder="End date" />
236
+ </mat-date-range-input>
237
+ <button mat-stroked-button color="primary" (click)="picker.open()">{{ dateRangeString$ | async }}</button>
238
+ <mat-date-range-picker #picker (opened)="pickerOpened()" (closed)="pickerClosed()"></mat-date-range-picker>
239
+ </div>
240
+ `, isInline: true, dependencies: [{ kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i4.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i4.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i4.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
241
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateRangeDayDistanceInputCellInputComponent, decorators: [{
242
+ type: Component,
243
+ args: [{
244
+ template: `
245
+ <div class="dbx-table-date-range-distance-input-cell">
246
+ <mat-date-range-input class="dbx-table-date-range-distance-input" [min]="minDate$ | async" [max]="maxDate$ | async" [formGroup]="range" [rangePicker]="picker">
247
+ <input matStartDate formControlName="start" placeholder="Start date" />
248
+ <input matEndDate formControlName="end" placeholder="End date" />
249
+ </mat-date-range-input>
250
+ <button mat-stroked-button color="primary" (click)="picker.open()">{{ dateRangeString$ | async }}</button>
251
+ <mat-date-range-picker #picker (opened)="pickerOpened()" (closed)="pickerClosed()"></mat-date-range-picker>
252
+ </div>
253
+ `,
254
+ providers: [
255
+ {
256
+ provide: MAT_DATE_RANGE_SELECTION_STRATEGY,
257
+ useClass: DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy
258
+ }
259
+ ],
260
+ changeDetection: ChangeDetectionStrategy.OnPush
261
+ }]
262
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; } });
263
+ function dbxTableDateRangeDayDistanceInputCellInput(componentConfig) {
264
+ const config = {
265
+ componentClass: DbxTableDateRangeDayDistanceInputCellInputComponent,
266
+ init: (x) => {
267
+ x.config = componentConfig;
268
+ }
269
+ };
270
+ return config;
271
+ }
272
+
273
+ const declarations = [
274
+ //
275
+ DbxTableDateHeaderComponent,
276
+ DbxTableDateRangeDayDistanceInputCellInputComponent
277
+ ];
278
+ class DbxTableDateModule {
279
+ }
280
+ DbxTableDateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
281
+ DbxTableDateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateModule, declarations: [
282
+ //
283
+ DbxTableDateHeaderComponent,
284
+ DbxTableDateRangeDayDistanceInputCellInputComponent
285
+ ], imports: [
286
+ //
287
+ CommonModule,
288
+ DbxLoadingModule,
289
+ DbxInjectionComponentModule,
290
+ FormsModule,
291
+ ReactiveFormsModule,
292
+ MatIconModule,
293
+ MatDatepickerModule,
294
+ MatButtonModule,
295
+ MatTableModule
296
+ ], exports: [
297
+ //
298
+ DbxTableDateHeaderComponent,
299
+ DbxTableDateRangeDayDistanceInputCellInputComponent
300
+ ] });
301
+ DbxTableDateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateModule, imports: [
302
+ //
303
+ CommonModule,
304
+ DbxLoadingModule,
305
+ DbxInjectionComponentModule,
306
+ FormsModule,
307
+ ReactiveFormsModule,
308
+ MatIconModule,
309
+ MatDatepickerModule,
310
+ MatButtonModule,
311
+ MatTableModule
312
+ ] });
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDateModule, decorators: [{
314
+ type: NgModule,
315
+ args: [{
316
+ imports: [
317
+ //
318
+ CommonModule,
319
+ DbxLoadingModule,
320
+ DbxInjectionComponentModule,
321
+ FormsModule,
322
+ ReactiveFormsModule,
323
+ MatIconModule,
324
+ MatDatepickerModule,
325
+ MatButtonModule,
326
+ MatTableModule
327
+ ],
328
+ declarations,
329
+ exports: declarations
330
+ }]
331
+ }] });
332
+
333
+ class DbxTableActionCellComponent {
334
+ constructor(tableStore) {
335
+ this.tableStore = tableStore;
336
+ this.config$ = this.tableStore.viewDelegate$.pipe(map((x) => x.summaryRowEnd), distinctUntilChanged());
337
+ }
338
+ }
339
+ DbxTableActionCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableActionCellComponent, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Component });
340
+ DbxTableActionCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableActionCellComponent, selector: "dbx-table-action-cell", ngImport: i0, template: `
341
+ <dbx-injection [config]="config$ | async"></dbx-injection>
342
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableActionCellComponent, decorators: [{
344
+ type: Component,
345
+ args: [{
346
+ selector: 'dbx-table-action-cell',
347
+ template: `
348
+ <dbx-injection [config]="config$ | async"></dbx-injection>
349
+ `,
350
+ changeDetection: ChangeDetectionStrategy.OnPush
351
+ }]
352
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; } });
353
+
354
+ /**
355
+ * A table header component used for injecting the input picker view.
356
+ */
357
+ class DbxTableInputCellComponent {
358
+ constructor(tableStore) {
359
+ this.tableStore = tableStore;
360
+ this.config$ = this.tableStore.viewDelegate$.pipe(map((x) => x.inputHeader), distinctUntilChanged());
361
+ }
362
+ }
363
+ DbxTableInputCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableInputCellComponent, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Component });
364
+ DbxTableInputCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableInputCellComponent, selector: "dbx-table-input-cell", ngImport: i0, template: `
365
+ <dbx-injection [config]="config$ | async"></dbx-injection>
366
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableInputCellComponent, decorators: [{
368
+ type: Component,
369
+ args: [{
370
+ selector: 'dbx-table-input-cell',
371
+ template: `
372
+ <dbx-injection [config]="config$ | async"></dbx-injection>
373
+ `,
374
+ changeDetection: ChangeDetectionStrategy.OnPush
375
+ }]
376
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; } });
377
+
378
+ class DbxTableSummaryEndCellComponent {
379
+ constructor(tableStore) {
380
+ this.tableStore = tableStore;
381
+ this.config$ = this.tableStore.viewDelegate$.pipe(map((x) => x.summaryRowEnd), distinctUntilChanged());
382
+ }
383
+ }
384
+ DbxTableSummaryEndCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableSummaryEndCellComponent, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Component });
385
+ DbxTableSummaryEndCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableSummaryEndCellComponent, selector: "dbx-table-summary-end-cell", ngImport: i0, template: `
386
+ <dbx-injection [config]="config$ | async"></dbx-injection>
387
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableSummaryEndCellComponent, decorators: [{
389
+ type: Component,
390
+ args: [{
391
+ selector: 'dbx-table-summary-end-cell',
392
+ template: `
393
+ <dbx-injection [config]="config$ | async"></dbx-injection>
394
+ `,
395
+ changeDetection: ChangeDetectionStrategy.OnPush
396
+ }]
397
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; } });
398
+
399
+ /**
400
+ * A table header component used for injecting the input picker view.
401
+ */
402
+ class DbxTableSummaryStartCellComponent {
403
+ constructor(tableStore) {
404
+ this.tableStore = tableStore;
405
+ this.config$ = this.tableStore.viewDelegate$.pipe(map((x) => x.summaryRowHeader), distinctUntilChanged());
406
+ }
407
+ }
408
+ DbxTableSummaryStartCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableSummaryStartCellComponent, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Component });
409
+ DbxTableSummaryStartCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableSummaryStartCellComponent, selector: "dbx-table-summary-start-cell", ngImport: i0, template: `
410
+ <dbx-injection [config]="config$ | async"></dbx-injection>
411
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableSummaryStartCellComponent, decorators: [{
413
+ type: Component,
414
+ args: [{
415
+ selector: 'dbx-table-summary-start-cell',
416
+ template: `
417
+ <dbx-injection [config]="config$ | async"></dbx-injection>
418
+ `,
419
+ changeDetection: ChangeDetectionStrategy.OnPush
420
+ }]
421
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; } });
422
+
423
+ /**
424
+ * Abstract directive that has a column input.
425
+ */
426
+ class AbstractDbxTableColumnDirective {
427
+ constructor(tableStore) {
428
+ this.tableStore = tableStore;
429
+ this._column = new BehaviorSubject(undefined);
430
+ this.column$ = this._column.pipe(filterMaybe(), distinctUntilChanged());
431
+ }
432
+ set column(column) {
433
+ this._column.next(column);
434
+ }
435
+ ngOnDestroy() {
436
+ this._column.complete();
437
+ }
438
+ }
439
+ AbstractDbxTableColumnDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractDbxTableColumnDirective, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Directive });
440
+ AbstractDbxTableColumnDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: AbstractDbxTableColumnDirective, inputs: { column: "column" }, ngImport: i0 });
441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractDbxTableColumnDirective, decorators: [{
442
+ type: Directive
443
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; }, propDecorators: { column: [{
444
+ type: Input
445
+ }] } });
446
+
447
+ class DbxTableColumnHeaderComponent extends AbstractDbxTableColumnDirective {
448
+ constructor() {
449
+ super(...arguments);
450
+ this.config$ = this.tableStore.viewDelegate$.pipe(switchMap((viewDelegate) => {
451
+ const columnHeader = viewDelegate.columnHeader;
452
+ if (columnHeader) {
453
+ return this.column$.pipe(map((x) => columnHeader(x)));
454
+ }
455
+ else {
456
+ return of(undefined);
457
+ }
458
+ }), distinctUntilChanged());
459
+ }
460
+ }
461
+ DbxTableColumnHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableColumnHeaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
462
+ DbxTableColumnHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableColumnHeaderComponent, selector: "dbx-table-column-header", usesInheritance: true, ngImport: i0, template: `
463
+ <dbx-injection [config]="config$ | async"></dbx-injection>
464
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableColumnHeaderComponent, decorators: [{
466
+ type: Component,
467
+ args: [{
468
+ selector: 'dbx-table-column-header',
469
+ template: `
470
+ <dbx-injection [config]="config$ | async"></dbx-injection>
471
+ `,
472
+ changeDetection: ChangeDetectionStrategy.OnPush
473
+ }]
474
+ }] });
475
+
476
+ class DbxTableColumnFooterComponent extends AbstractDbxTableColumnDirective {
477
+ constructor() {
478
+ super(...arguments);
479
+ this.config$ = this.tableStore.viewDelegate$.pipe(switchMap((viewDelegate) => {
480
+ const columnFooter = viewDelegate.columnFooter;
481
+ if (columnFooter) {
482
+ return this.column$.pipe(map((x) => columnFooter(x)));
483
+ }
484
+ else {
485
+ return of(undefined);
486
+ }
487
+ }), distinctUntilChanged());
488
+ }
489
+ }
490
+ DbxTableColumnFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableColumnFooterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
491
+ DbxTableColumnFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableColumnFooterComponent, selector: "dbx-table-column-footer", usesInheritance: true, ngImport: i0, template: `
492
+ <dbx-injection [config]="config$ | async"></dbx-injection>
493
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
494
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableColumnFooterComponent, decorators: [{
495
+ type: Component,
496
+ args: [{
497
+ selector: 'dbx-table-column-footer',
498
+ template: `
499
+ <dbx-injection [config]="config$ | async"></dbx-injection>
500
+ `,
501
+ changeDetection: ChangeDetectionStrategy.OnPush
502
+ }]
503
+ }] });
504
+
505
+ /**
506
+ * Abstract directive that has an element input.
507
+ */
508
+ class AbstractDbxTableElementDirective {
509
+ constructor(tableStore) {
510
+ this.tableStore = tableStore;
511
+ this._element = new BehaviorSubject(undefined);
512
+ this.element$ = this._element.pipe(filterMaybe(), distinctUntilChanged());
513
+ }
514
+ set element(element) {
515
+ this._element.next(element);
516
+ }
517
+ ngOnDestroy() {
518
+ this._element.complete();
519
+ }
520
+ }
521
+ AbstractDbxTableElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractDbxTableElementDirective, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Directive });
522
+ AbstractDbxTableElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: AbstractDbxTableElementDirective, inputs: { element: "element" }, ngImport: i0 });
523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractDbxTableElementDirective, decorators: [{
524
+ type: Directive
525
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; }, propDecorators: { element: [{
526
+ type: Input
527
+ }] } });
528
+
529
+ class DbxTableItemCellComponent extends AbstractDbxTableElementDirective {
530
+ constructor() {
531
+ super(...arguments);
532
+ this._column = new BehaviorSubject(undefined);
533
+ this.column$ = this._column.pipe(filterMaybe(), distinctUntilChanged());
534
+ this.config$ = this.tableStore.viewDelegate$.pipe(switchMap((viewDelegate) => combineLatest([this.column$, this.element$]).pipe(map(([column, element]) => viewDelegate.itemCell(column, element)))), distinctUntilChanged());
535
+ }
536
+ set column(column) {
537
+ this._column.next(column);
538
+ }
539
+ ngOnDestroy() {
540
+ super.ngOnDestroy();
541
+ this._column.complete();
542
+ }
543
+ }
544
+ DbxTableItemCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableItemCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
545
+ DbxTableItemCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableItemCellComponent, selector: "dbx-table-item-cell", inputs: { column: "column" }, usesInheritance: true, ngImport: i0, template: `
546
+ <dbx-injection [config]="config$ | async"></dbx-injection>
547
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
548
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableItemCellComponent, decorators: [{
549
+ type: Component,
550
+ args: [{
551
+ selector: 'dbx-table-item-cell',
552
+ template: `
553
+ <dbx-injection [config]="config$ | async"></dbx-injection>
554
+ `,
555
+ changeDetection: ChangeDetectionStrategy.OnPush
556
+ }]
557
+ }], propDecorators: { column: [{
558
+ type: Input
559
+ }] } });
560
+
561
+ class DbxTableItemHeaderComponent extends AbstractDbxTableElementDirective {
562
+ constructor() {
563
+ super(...arguments);
564
+ this.config$ = this.tableStore.viewDelegate$.pipe(switchMap((viewDelegate) => this.element$.pipe(map((x) => viewDelegate.itemHeader(x)))), distinctUntilChanged());
565
+ }
566
+ }
567
+ DbxTableItemHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableItemHeaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
568
+ DbxTableItemHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableItemHeaderComponent, selector: "dbx-table-item-header", usesInheritance: true, ngImport: i0, template: `
569
+ <dbx-injection [config]="config$ | async"></dbx-injection>
570
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableItemHeaderComponent, decorators: [{
572
+ type: Component,
573
+ args: [{
574
+ selector: 'dbx-table-item-header',
575
+ template: `
576
+ <dbx-injection [config]="config$ | async"></dbx-injection>
577
+ `,
578
+ changeDetection: ChangeDetectionStrategy.OnPush
579
+ }]
580
+ }] });
581
+
582
+ class DbxTableItemActionComponent extends AbstractDbxTableElementDirective {
583
+ constructor() {
584
+ super(...arguments);
585
+ this.config$ = this.tableStore.viewDelegate$.pipe(switchMap((viewDelegate) => {
586
+ const itemAction = viewDelegate.itemAction;
587
+ if (itemAction) {
588
+ return this.element$.pipe(map((x) => itemAction(x)));
589
+ }
590
+ else {
591
+ return of(undefined);
592
+ }
593
+ }), distinctUntilChanged());
594
+ }
595
+ }
596
+ DbxTableItemActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableItemActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
597
+ DbxTableItemActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableItemActionComponent, selector: "dbx-table-item-action", usesInheritance: true, ngImport: i0, template: `
598
+ <dbx-injection [config]="config$ | async"></dbx-injection>
599
+ `, isInline: true, dependencies: [{ kind: "component", type: i1$1.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableItemActionComponent, decorators: [{
601
+ type: Component,
602
+ args: [{
603
+ selector: 'dbx-table-item-action',
604
+ template: `
605
+ <dbx-injection [config]="config$ | async"></dbx-injection>
606
+ `,
607
+ changeDetection: ChangeDetectionStrategy.OnPush
608
+ }]
609
+ }] });
610
+
611
+ const DBX_TABLE_ITEMS_COLUMN_NAME = '_items';
612
+ const DBX_TABLE_ACTIONS_COLUMN_NAME = '_actions';
613
+ /**
614
+ * A table with fixed content
615
+ */
616
+ class DbxTableViewComponent {
617
+ constructor(tableStore) {
618
+ this.tableStore = tableStore;
619
+ this.DEFAULT_TRACK_BY_FUNCTION = (index) => {
620
+ return index;
621
+ };
622
+ this.scrollDistance = 0.5;
623
+ this.throttleScroll = 50;
624
+ this.itemsColumnName = DBX_TABLE_ITEMS_COLUMN_NAME;
625
+ this.actionsColumnName = DBX_TABLE_ACTIONS_COLUMN_NAME;
626
+ this.innerColumns$ = this.tableStore.columns$;
627
+ this.innerColumnNames$ = this.innerColumns$.pipe(map((x) => x.map((y) => y.columnName)), shareReplay$1(1));
628
+ this.elements$ = this.tableStore.items$;
629
+ this.displayedColumns$ = this.innerColumnNames$.pipe(map((columnNames) => {
630
+ return [this.itemsColumnName, ...columnNames, this.actionsColumnName];
631
+ }), shareReplay$1(1));
632
+ this.trackByFunction$ = this.tableStore.viewDelegate$.pipe(map((x) => { var _a; return (_a = x.trackBy) !== null && _a !== void 0 ? _a : this.DEFAULT_TRACK_BY_FUNCTION; }), shareReplay$1(1));
633
+ this.context = loadingStateContext({ obs: this.tableStore.dataState$ });
634
+ this.dataLoadingContext = loadingStateContext({ obs: this.tableStore.itemsState$ });
635
+ }
636
+ ngOnDestroy() {
637
+ this.context.destroy();
638
+ }
639
+ onScrollDown() {
640
+ this.tableStore.loadMore();
641
+ }
642
+ }
643
+ DbxTableViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableViewComponent, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Component });
644
+ DbxTableViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableViewComponent, selector: "dbx-table-view", ngImport: i0, template: "<dbx-loading [context]=\"context\">\n <dbx-loading class=\"dbx-table-view-loading\" [linear]=\"true\" [context]=\"dataLoadingContext\"></dbx-loading>\n <section class=\"dbx-table-view\" infinite-scroll [infiniteScrollDistance]=\"scrollDistance\" [infiniteScrollThrottle]=\"throttleScroll\" [scrollWindow]=\"false\" (scrolled)=\"onScrollDown()\">\n <table class=\"dbx-table-view-table\" mat-table [dataSource]=\"elements$\" [trackBy]=\"(trackByFunction$ | async) || DEFAULT_TRACK_BY_FUNCTION\">\n <!-- Header/Item column -->\n <ng-container [matColumnDef]=\"itemsColumnName\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef>\n <dbx-table-input-cell></dbx-table-input-cell>\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <dbx-table-item-header [element]=\"element\"></dbx-table-item-header>\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <dbx-table-summary-start-cell></dbx-table-summary-start-cell>\n </td>\n </ng-container>\n\n <!-- Column Definitions -->\n <ng-container [matColumnDef]=\"column.columnName\" [sticky]=\"false\" *ngFor=\"let column of innerColumns$ | async\">\n <th mat-header-cell *matHeaderCellDef>\n <dbx-table-column-header [column]=\"column\"></dbx-table-column-header>\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <dbx-table-item-cell [element]=\"element\" [column]=\"column\"></dbx-table-item-cell>\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <dbx-table-column-footer [column]=\"column\"></dbx-table-column-footer>\n </td>\n </ng-container>\n\n <!-- Tail/Action column -->\n <ng-container [matColumnDef]=\"actionsColumnName\" [stickyEnd]=\"true\">\n <th mat-header-cell *matHeaderCellDef>\n <dbx-table-action-cell></dbx-table-action-cell>\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <dbx-table-item-action [element]=\"element\"></dbx-table-item-action>\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <dbx-table-summary-end-cell></dbx-table-summary-end-cell>\n </td>\n </ng-container>\n\n <!-- Table View -->\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns$ | async; sticky: true\"></tr>\n\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns$ | async\"></tr>\n\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns$ | async; sticky: true\"></tr>\n </table>\n </section>\n</dbx-loading>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3$1.DbxLoadingComponent, selector: "dbx-loading", inputs: ["show", "text", "mode", "color", "diameter", "linear", "context", "loading", "error"] }, { kind: "component", type: i4$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i4$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i4$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i4$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i4$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i4$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i4$1.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i4$1.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i4$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i4$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i4$1.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i4$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i4$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i4$1.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i5$1.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "component", type: DbxTableColumnHeaderComponent, selector: "dbx-table-column-header" }, { kind: "component", type: DbxTableColumnFooterComponent, selector: "dbx-table-column-footer" }, { kind: "component", type: DbxTableInputCellComponent, selector: "dbx-table-input-cell" }, { kind: "component", type: DbxTableActionCellComponent, selector: "dbx-table-action-cell" }, { kind: "component", type: DbxTableItemCellComponent, selector: "dbx-table-item-cell", inputs: ["column"] }, { kind: "component", type: DbxTableItemHeaderComponent, selector: "dbx-table-item-header" }, { kind: "component", type: DbxTableItemActionComponent, selector: "dbx-table-item-action" }, { kind: "component", type: DbxTableSummaryStartCellComponent, selector: "dbx-table-summary-start-cell" }, { kind: "component", type: DbxTableSummaryEndCellComponent, selector: "dbx-table-summary-end-cell" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
645
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableViewComponent, decorators: [{
646
+ type: Component,
647
+ args: [{ selector: 'dbx-table-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<dbx-loading [context]=\"context\">\n <dbx-loading class=\"dbx-table-view-loading\" [linear]=\"true\" [context]=\"dataLoadingContext\"></dbx-loading>\n <section class=\"dbx-table-view\" infinite-scroll [infiniteScrollDistance]=\"scrollDistance\" [infiniteScrollThrottle]=\"throttleScroll\" [scrollWindow]=\"false\" (scrolled)=\"onScrollDown()\">\n <table class=\"dbx-table-view-table\" mat-table [dataSource]=\"elements$\" [trackBy]=\"(trackByFunction$ | async) || DEFAULT_TRACK_BY_FUNCTION\">\n <!-- Header/Item column -->\n <ng-container [matColumnDef]=\"itemsColumnName\" [sticky]=\"true\">\n <th mat-header-cell *matHeaderCellDef>\n <dbx-table-input-cell></dbx-table-input-cell>\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <dbx-table-item-header [element]=\"element\"></dbx-table-item-header>\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <dbx-table-summary-start-cell></dbx-table-summary-start-cell>\n </td>\n </ng-container>\n\n <!-- Column Definitions -->\n <ng-container [matColumnDef]=\"column.columnName\" [sticky]=\"false\" *ngFor=\"let column of innerColumns$ | async\">\n <th mat-header-cell *matHeaderCellDef>\n <dbx-table-column-header [column]=\"column\"></dbx-table-column-header>\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <dbx-table-item-cell [element]=\"element\" [column]=\"column\"></dbx-table-item-cell>\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <dbx-table-column-footer [column]=\"column\"></dbx-table-column-footer>\n </td>\n </ng-container>\n\n <!-- Tail/Action column -->\n <ng-container [matColumnDef]=\"actionsColumnName\" [stickyEnd]=\"true\">\n <th mat-header-cell *matHeaderCellDef>\n <dbx-table-action-cell></dbx-table-action-cell>\n </th>\n <td mat-cell *matCellDef=\"let element\">\n <dbx-table-item-action [element]=\"element\"></dbx-table-item-action>\n </td>\n <td mat-footer-cell *matFooterCellDef>\n <dbx-table-summary-end-cell></dbx-table-summary-end-cell>\n </td>\n </ng-container>\n\n <!-- Table View -->\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns$ | async; sticky: true\"></tr>\n\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns$ | async\"></tr>\n\n <tr mat-footer-row *matFooterRowDef=\"displayedColumns$ | async; sticky: true\"></tr>\n </table>\n </section>\n</dbx-loading>\n" }]
648
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; } });
649
+
650
+ /**
651
+ * Directive for providing and configuring a DbxTableStore
652
+ */
653
+ class DbxTableDirective {
654
+ constructor(tableStore) {
655
+ this.tableStore = tableStore;
656
+ }
657
+ set dbxTableInput(input) {
658
+ this.tableStore.setInput(input);
659
+ }
660
+ set dbxTableViewDelegate(dbxTableViewDelegate) {
661
+ this.tableStore.setViewDelegate(dbxTableViewDelegate);
662
+ }
663
+ set dbxTableDataDelegate(dbxTableDataDelegate) {
664
+ this.tableStore.setDataDelegate(dbxTableDataDelegate);
665
+ }
666
+ }
667
+ DbxTableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDirective, deps: [{ token: DbxTableStore }], target: i0.ɵɵFactoryTarget.Directive });
668
+ DbxTableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxTableDirective, selector: "[dbxTable]", inputs: { dbxTableInput: "dbxTableInput", dbxTableViewDelegate: "dbxTableViewDelegate", dbxTableDataDelegate: "dbxTableDataDelegate" }, providers: [DbxTableStore], ngImport: i0 });
669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableDirective, decorators: [{
670
+ type: Directive,
671
+ args: [{
672
+ selector: '[dbxTable]',
673
+ providers: [DbxTableStore]
674
+ }]
675
+ }], ctorParameters: function () { return [{ type: DbxTableStore }]; }, propDecorators: { dbxTableInput: [{
676
+ type: Input
677
+ }], dbxTableViewDelegate: [{
678
+ type: Input
679
+ }], dbxTableDataDelegate: [{
680
+ type: Input
681
+ }] } });
682
+
683
+ const exports = [DbxTableDirective, DbxTableViewComponent];
684
+ const internalDeclarations = [
685
+ //
686
+ DbxTableColumnHeaderComponent,
687
+ DbxTableColumnFooterComponent,
688
+ DbxTableInputCellComponent,
689
+ DbxTableActionCellComponent,
690
+ DbxTableItemCellComponent,
691
+ DbxTableItemHeaderComponent,
692
+ DbxTableItemActionComponent,
693
+ DbxTableSummaryStartCellComponent,
694
+ DbxTableSummaryEndCellComponent
695
+ ];
696
+ class DbxTableModule {
697
+ }
698
+ DbxTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
699
+ DbxTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxTableModule, declarations: [DbxTableDirective, DbxTableViewComponent,
700
+ //
701
+ DbxTableColumnHeaderComponent,
702
+ DbxTableColumnFooterComponent,
703
+ DbxTableInputCellComponent,
704
+ DbxTableActionCellComponent,
705
+ DbxTableItemCellComponent,
706
+ DbxTableItemHeaderComponent,
707
+ DbxTableItemActionComponent,
708
+ DbxTableSummaryStartCellComponent,
709
+ DbxTableSummaryEndCellComponent], imports: [
710
+ //
711
+ CommonModule,
712
+ DbxLoadingModule,
713
+ DbxInjectionComponentModule,
714
+ MatTableModule,
715
+ InfiniteScrollModule
716
+ ], exports: [DbxTableDirective, DbxTableViewComponent] });
717
+ DbxTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableModule, imports: [
718
+ //
719
+ CommonModule,
720
+ DbxLoadingModule,
721
+ DbxInjectionComponentModule,
722
+ MatTableModule,
723
+ InfiniteScrollModule
724
+ ] });
725
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxTableModule, decorators: [{
726
+ type: NgModule,
727
+ args: [{
728
+ imports: [
729
+ //
730
+ CommonModule,
731
+ DbxLoadingModule,
732
+ DbxInjectionComponentModule,
733
+ MatTableModule,
734
+ InfiniteScrollModule
735
+ ],
736
+ declarations: [...exports, ...internalDeclarations],
737
+ exports
738
+ }]
739
+ }] });
740
+
741
+ /**
742
+ * Generated bundle index. Do not edit.
743
+ */
744
+
745
+ export { AbstractDbxTableColumnDirective, AbstractDbxTableElementDirective, DBX_TABLE_ACTIONS_COLUMN_NAME, DBX_TABLE_ITEMS_COLUMN_NAME, DEFAULT_DBX_TABLE_DATE_RANGE_DAY_BUTTON_FORMAT, DEFAULT_DBX_TABLE_DATE_RANGE_DAY_DISTIANCE_INPUT_CELL_COMPONENT_CONFIG, DbxTableActionCellComponent, DbxTableColumnFooterComponent, DbxTableColumnHeaderComponent, DbxTableDateHeaderComponent, DbxTableDateModule, DbxTableDateRangeDayDistanceInputCellInputComponent, DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy, DbxTableDirective, DbxTableInputCellComponent, DbxTableItemActionComponent, DbxTableItemCellComponent, DbxTableItemHeaderComponent, DbxTableModule, DbxTableStore, DbxTableSummaryEndCellComponent, DbxTableSummaryStartCellComponent, DbxTableViewComponent, dbxTableDateHeaderInjectionFactory, dbxTableDateRangeDayDistanceInputCellInput };
746
+ //# sourceMappingURL=dereekb-dbx-web-table.mjs.map