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