@mintplayer/ng-bootstrap 22.28.0 → 22.30.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.
- package/_bootstrap.scss +4 -101
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +62 -30
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +71 -64
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +50 -46
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs +65 -94
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +122 -97
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs +80 -133
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs +31 -19
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs +41 -46
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs +76 -37
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +37 -82
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +157 -824
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +172 -118
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs +180 -142
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +66 -116
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +41 -46
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs +80 -204
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +2 -2
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs +2 -2
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +32 -17
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +283 -20
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs +98 -129
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +144 -265
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs +133 -217
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +46 -25
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs +166 -93
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs +148 -231
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs +133 -94
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +2 -2
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +76 -7
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs +766 -812
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +206 -180
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +202 -141
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +113 -59
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +133 -76
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +60 -87
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +86 -83
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs +1 -2
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs +38 -34
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs +177 -147
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +200 -94
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs +186 -233
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +58 -136
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +22 -16
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/package.json +11 -9
- package/types/mintplayer-ng-bootstrap-a11y.d.ts +40 -21
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +36 -33
- package/types/mintplayer-ng-bootstrap-calendar.d.ts +39 -16
- package/types/mintplayer-ng-bootstrap-card.d.ts +25 -33
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +70 -55
- package/types/mintplayer-ng-bootstrap-charts-hierarchy.d.ts +65 -45
- package/types/mintplayer-ng-bootstrap-charts-sparkline.d.ts +12 -3
- package/types/mintplayer-ng-bootstrap-charts-trend.d.ts +34 -19
- package/types/mintplayer-ng-bootstrap-checkbox.d.ts +34 -8
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +32 -59
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +222 -422
- package/types/mintplayer-ng-bootstrap-datepicker.d.ts +77 -29
- package/types/mintplayer-ng-bootstrap-datetime-picker.d.ts +83 -51
- package/types/mintplayer-ng-bootstrap-dock.d.ts +57 -38
- package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +25 -30
- package/types/mintplayer-ng-bootstrap-file-manager.d.ts +61 -81
- package/types/mintplayer-ng-bootstrap-input-group.d.ts +17 -12
- package/types/mintplayer-ng-bootstrap-machine.d.ts +124 -4
- package/types/mintplayer-ng-bootstrap-multi-range.d.ts +53 -27
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +88 -164
- package/types/mintplayer-ng-bootstrap-otp-input.d.ts +63 -30
- package/types/mintplayer-ng-bootstrap-pagination.d.ts +23 -7
- package/types/mintplayer-ng-bootstrap-phone-input.d.ts +77 -47
- package/types/mintplayer-ng-bootstrap-query-builder.d.ts +95 -98
- package/types/mintplayer-ng-bootstrap-radio.d.ts +68 -35
- package/types/mintplayer-ng-bootstrap-rating.d.ts +27 -2
- package/types/mintplayer-ng-bootstrap-ribbon.d.ts +546 -220
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +82 -197
- package/types/mintplayer-ng-bootstrap-select.d.ts +113 -53
- package/types/mintplayer-ng-bootstrap-shell.d.ts +59 -33
- package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +63 -27
- package/types/mintplayer-ng-bootstrap-splitter.d.ts +45 -56
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +47 -26
- package/types/mintplayer-ng-bootstrap-table.d.ts +1 -2
- package/types/mintplayer-ng-bootstrap-theming.d.ts +19 -18
- package/types/mintplayer-ng-bootstrap-timeline.d.ts +287 -117
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +100 -27
- package/types/mintplayer-ng-bootstrap-tree-select.d.ts +188 -94
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +74 -59
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +3 -0
- package/src/styles/utilities/cursor.scss +0 -12
- package/src/styles/utilities/overflow.scss +0 -12
- package/src/styles/utilities/white-space.scss +0 -12
- package/src/styles/utilities/width.scss +0 -14
|
@@ -1,876 +1,209 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, TemplateRef,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
2
|
+
import { inject, TemplateRef, Directive, ElementRef, input, model, booleanAttribute, numberAttribute, output, contentChild, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { useCore, useScopedStyles, MpPropsDirective } from '@mintplayer/ng-bootstrap/machine';
|
|
5
|
+
import { datatableCore, datatableScopedStyles } from '@mintplayer/ui-core/datatable';
|
|
6
|
+
export { DEFAULT_DATATABLE_LABELS, cellText, computeNextSort, sortRows } from '@mintplayer/ui-core/datatable';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (data && data.perPage) {
|
|
13
|
-
this.perPage = data.perPage;
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
// Set default value
|
|
17
|
-
this.perPage = {
|
|
18
|
-
values: [10, 20, 50],
|
|
19
|
-
selected: 20
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
if (data && data.page) {
|
|
23
|
-
this.page = data.page;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
// Set default value
|
|
27
|
-
this.page = {
|
|
28
|
-
values: [1],
|
|
29
|
-
selected: 1
|
|
30
|
-
};
|
|
31
|
-
}
|
|
8
|
+
// GENERATED from the datatable manifest (datatable) by @mintplayer/nx-component-compiler. Do not edit.
|
|
9
|
+
/** The `header` slot of `<bs-datatable>`: `<ng-template bsDatatableHeader>` or `*bsDatatableHeader`. */
|
|
10
|
+
class BsDatatableHeaderDirective {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.templateRef = inject(TemplateRef);
|
|
32
13
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
sortColumns: this.sortColumns,
|
|
36
|
-
perPage: this.perPage.selected,
|
|
37
|
-
page: this.page.selected
|
|
38
|
-
};
|
|
39
|
-
return res;
|
|
14
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
15
|
+
return true;
|
|
40
16
|
}
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
18
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDatatableHeaderDirective, isStandalone: true, selector: "[bsDatatableHeader]", ngImport: i0 }); }
|
|
41
19
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* `SortColumn.property` references when the column is clicked.
|
|
49
|
-
* - The directive's **template content** is the header template — what gets
|
|
50
|
-
* rendered inside the `<th>`.
|
|
51
|
-
*
|
|
52
|
-
* Example:
|
|
53
|
-
* ```html
|
|
54
|
-
* <div *bsDatatableColumn="'YearStarted'; sortable: true">Year started</div>
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* Optional `bsDatatableColumnSortable` controls whether the header acts as a
|
|
58
|
-
* sort toggle (default `true`).
|
|
59
|
-
*/
|
|
60
|
-
class BsDatatableColumnDirective {
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableHeaderDirective, decorators: [{
|
|
21
|
+
type: Directive,
|
|
22
|
+
args: [{ selector: '[bsDatatableHeader]' }]
|
|
23
|
+
}] });
|
|
24
|
+
/** The `cell` slot of `<bs-datatable>`: `<ng-template bsDatatableCell>` or `*bsDatatableCell`. */
|
|
25
|
+
class BsDatatableCellDirective {
|
|
61
26
|
constructor() {
|
|
62
27
|
this.templateRef = inject(TemplateRef);
|
|
63
|
-
/** Data property name on each row; used as `SortColumn.property` on sort. */
|
|
64
|
-
this.name = input('', { ...(ngDevMode ? { debugName: "name" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumn' });
|
|
65
|
-
this.sortable = input(true, { ...(ngDevMode ? { debugName: "sortable" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnSortable' });
|
|
66
|
-
/**
|
|
67
|
-
* The column's name in generated accessible strings (resize handle, filter
|
|
68
|
-
* trigger and panel, announcements). Optional: without it the datatable uses
|
|
69
|
-
* the text the header template renders, so set it only for an icon-only
|
|
70
|
-
* header or when the spoken name should differ from the visible one.
|
|
71
|
-
*/
|
|
72
|
-
this.label = input(undefined, { ...(ngDevMode ? { debugName: "label" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnLabel' });
|
|
73
|
-
/**
|
|
74
|
-
* Whether this column offers a resize handle. Left unset it follows the
|
|
75
|
-
* table's `resizableColumns`; a set value wins over it in either direction.
|
|
76
|
-
* Deliberately no `true` default, which would override a table-wide `false`.
|
|
77
|
-
*/
|
|
78
|
-
this.resizable = input(undefined, { ...(ngDevMode ? { debugName: "resizable" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnResizable' });
|
|
79
|
-
/** Opt this column into the filter row. Default `false`, unlike `sortable`. */
|
|
80
|
-
this.filterable = input(false, { ...(ngDevMode ? { debugName: "filterable" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnFilterable' });
|
|
81
|
-
/**
|
|
82
|
-
* Purely visual: marks this column's trigger as "filtered". The component
|
|
83
|
-
* attaches no meaning to it — the consumer decides when it is true, because
|
|
84
|
-
* the component never filters the data itself.
|
|
85
|
-
*/
|
|
86
|
-
this.filterActive = input(false, { ...(ngDevMode ? { debugName: "filterActive" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnFilterActive' });
|
|
87
|
-
/** Short description of the active filter, shown on the trigger and in its name. */
|
|
88
|
-
this.filterSummary = input(undefined, { ...(ngDevMode ? { debugName: "filterSummary" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnFilterSummary' });
|
|
89
|
-
/** Initial or externally restored selection for this column's panel. */
|
|
90
|
-
this.filterSelection = input(undefined, { ...(ngDevMode ? { debugName: "filterSelection" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnFilterSelection' });
|
|
91
|
-
/**
|
|
92
|
-
* `'values'` (default) lists the column's distinct values as checkboxes;
|
|
93
|
-
* `'comparison'` offers an operator and one operand — the right shape for a
|
|
94
|
-
* quantity, where ticking forty individual years is a poor way to say
|
|
95
|
-
* "after 1990".
|
|
96
|
-
*/
|
|
97
|
-
this.filterMode = input('values', { ...(ngDevMode ? { debugName: "filterMode" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnFilterMode' });
|
|
98
|
-
/** `type` of the operand input in comparison mode. Default `'number'`. */
|
|
99
|
-
this.filterInputType = input(undefined, { ...(ngDevMode ? { debugName: "filterInputType" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnFilterInputType' });
|
|
100
|
-
/** Operators offered in comparison mode, in order. Defaults to all six. */
|
|
101
|
-
this.filterOperators = input(undefined, { ...(ngDevMode ? { debugName: "filterOperators" } : /* istanbul ignore next */ {}), alias: 'bsDatatableColumnFilterOperators' });
|
|
102
28
|
}
|
|
103
|
-
static
|
|
104
|
-
|
|
29
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
33
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDatatableCellDirective, isStandalone: true, selector: "[bsDatatableCell]", ngImport: i0 }); }
|
|
105
34
|
}
|
|
106
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type:
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableCellDirective, decorators: [{
|
|
107
36
|
type: Directive,
|
|
108
|
-
args: [{ selector: '[
|
|
109
|
-
}]
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* Marks an `<ng-template>` as the per-row body for `<bs-datatable>`. The
|
|
113
|
-
* template's `$implicit` is the row object. The template should render one
|
|
114
|
-
* `<td>` per data column (in column order).
|
|
115
|
-
*
|
|
116
|
-
* In tree mode (`[tree]="true"`) the context also carries `depth` (0 for
|
|
117
|
-
* roots, +1 per nesting level), `isExpanded`, and `isPlaceholder` (true when
|
|
118
|
-
* the row is a not-yet-loaded child slot — `$implicit` is undefined).
|
|
119
|
-
*
|
|
120
|
-
* Example:
|
|
121
|
-
* ```html
|
|
122
|
-
* <ng-container *bsRowTemplate="let artist">
|
|
123
|
-
* <td class="text-nowrap">{{ artist?.name }}</td>
|
|
124
|
-
* <td class="text-nowrap">{{ artist?.yearStarted }}</td>
|
|
125
|
-
* </ng-container>
|
|
126
|
-
*
|
|
127
|
-
* <!-- tree mode: render a spinner for placeholder rows -->
|
|
128
|
-
* <ng-container *bsRowTemplate="let item; let isPlaceholder = isPlaceholder">
|
|
129
|
-
* @if (isPlaceholder) { <td colspan="3"><i>Loading…</i></td> }
|
|
130
|
-
* @else { <td>{{ item.name }}</td><td>{{ item.headcount }}</td><td>{{ item.code }}</td> }
|
|
131
|
-
* </ng-container>
|
|
132
|
-
* ```
|
|
133
|
-
*/
|
|
134
|
-
class BsRowTemplateDirective {
|
|
37
|
+
args: [{ selector: '[bsDatatableCell]' }]
|
|
38
|
+
}] });
|
|
39
|
+
/** The `row` slot of `<bs-datatable>`: `<ng-template bsDatatableRow>` or `*bsDatatableRow`. */
|
|
40
|
+
class BsDatatableRowDirective {
|
|
135
41
|
constructor() {
|
|
136
42
|
this.templateRef = inject(TemplateRef);
|
|
137
43
|
}
|
|
138
44
|
static ngTemplateContextGuard(_dir, ctx) {
|
|
139
45
|
return true;
|
|
140
46
|
}
|
|
141
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type:
|
|
142
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type:
|
|
47
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableRowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
48
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDatatableRowDirective, isStandalone: true, selector: "[bsDatatableRow]", ngImport: i0 }); }
|
|
143
49
|
}
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type:
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableRowDirective, decorators: [{
|
|
145
51
|
type: Directive,
|
|
146
|
-
args: [{ selector: '[
|
|
52
|
+
args: [{ selector: '[bsDatatableRow]' }]
|
|
147
53
|
}] });
|
|
148
|
-
|
|
54
|
+
/** The `filter` slot of `<bs-datatable>`: `<ng-template bsDatatableFilter>` or `*bsDatatableFilter`. */
|
|
55
|
+
class BsDatatableFilterDirective {
|
|
149
56
|
constructor() {
|
|
150
|
-
this
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this.isExpanded = false;
|
|
155
|
-
/** True when the row is a not-yet-loaded child slot — `$implicit` is undefined. */
|
|
156
|
-
this.isPlaceholder = false;
|
|
57
|
+
this.templateRef = inject(TemplateRef);
|
|
58
|
+
}
|
|
59
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
60
|
+
return true;
|
|
157
61
|
}
|
|
62
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableFilterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
63
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDatatableFilterDirective, isStandalone: true, selector: "[bsDatatableFilter]", ngImport: i0 }); }
|
|
158
64
|
}
|
|
159
|
-
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableFilterDirective, decorators: [{
|
|
66
|
+
type: Directive,
|
|
67
|
+
args: [{ selector: '[bsDatatableFilter]' }]
|
|
68
|
+
}] });
|
|
69
|
+
/**
|
|
70
|
+
* A sortable, pageable, selectable table (#437), over local `data` or a server `fetch`;
|
|
71
|
+
* virtual scrolling, a lazy tree (`tree` + `idKey` + `childCountKey`) and resizable columns.
|
|
72
|
+
*
|
|
73
|
+
* Columns are data (`DatatableColumnDef`). Slots: `header {column}` (a header label),
|
|
74
|
+
* `cell {row, column, rowIndex}` (one cell) and `row {row, rowIndex, ctx}` (all of a
|
|
75
|
+
* row's data cells) and `filter {column, ctx}` (the panel of a column with `filterMode: 'custom'`). Two-way: `sortColumns`, `page`, `perPage`, `selectedIds`, `expandedIds`, `filters`.
|
|
76
|
+
* An `aria-label` names the table. With `fetch`, filters are applied server-side; `stateKey` prefetches
|
|
77
|
+
* the first page during SSR and hands it to the client (#448).
|
|
78
|
+
*/
|
|
160
79
|
class BsDatatableComponent {
|
|
161
|
-
|
|
162
|
-
* Hands the previous generation over for disposal — it does **not** destroy
|
|
163
|
-
* anything, and must not.
|
|
164
|
-
*
|
|
165
|
-
* This runs inside `effectiveColumns`, and destroying a view detaches it,
|
|
166
|
-
* which dirties Angular's query signals: a signal write inside a computed,
|
|
167
|
-
* i.e. NG0600, the moment the host declares any view query. It is the exact
|
|
168
|
-
* mirror of why views are not CREATED here either — attach and detach are
|
|
169
|
-
* both signal writes, so neither belongs in a computed.
|
|
170
|
-
*
|
|
171
|
-
* Handing over is a plain field write, and the effect that forwards the
|
|
172
|
-
* columns disposes the batch on the same tick, so the leak this replaced
|
|
173
|
-
* stays fixed: at most one dead generation exists, and only momentarily.
|
|
174
|
-
*/
|
|
175
|
-
retireTemplateViews() {
|
|
176
|
-
this.staleViews.push(...this.headerViews, ...this.filterViews);
|
|
177
|
-
this.headerViews = [];
|
|
178
|
-
this.filterViews = [];
|
|
179
|
-
this.releaseFilterSubscriptions();
|
|
180
|
-
}
|
|
181
|
-
/** Destroys the retired generation. Only ever called from an effect. */
|
|
182
|
-
disposeStaleViews() {
|
|
183
|
-
for (const v of this.staleViews)
|
|
184
|
-
v.destroy();
|
|
185
|
-
this.staleViews = [];
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Without this the web component keeps calling into a destroyed view's signal
|
|
189
|
-
* on every value change, for the life of the element.
|
|
190
|
-
*/
|
|
191
|
-
releaseFilterSubscriptions() {
|
|
192
|
-
for (const unsubscribe of this.filterUnsubscribes)
|
|
193
|
-
unsubscribe();
|
|
194
|
-
this.filterUnsubscribes = [];
|
|
195
|
-
}
|
|
80
|
+
#core;
|
|
196
81
|
constructor() {
|
|
197
|
-
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
* template directives — if provided, takes precedence.
|
|
203
|
-
*/
|
|
204
|
-
this.columnsInput = input(null, { ...(ngDevMode ? { debugName: "columnsInput" } : /* istanbul ignore next */ {}), alias: 'columns' });
|
|
205
|
-
/**
|
|
206
|
-
* The **complete** row set. Use `[fetch]` for server-side pagination.
|
|
207
|
-
*
|
|
208
|
-
* "Complete" matters to the filter panels: their value lists are computed from
|
|
209
|
-
* this array, so a consumer who pages `[data]` themselves is showing the
|
|
210
|
-
* component one page and will get a value list covering one page. That case
|
|
211
|
-
* needs `[distincts]`.
|
|
212
|
-
*/
|
|
213
|
-
this.data = input(null, /* @ts-ignore */
|
|
82
|
+
/** The host element. */
|
|
83
|
+
this.elementRef = inject(ElementRef);
|
|
84
|
+
this.columns = input([], /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
86
|
+
this.data = input([], /* @ts-ignore */
|
|
214
87
|
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
215
|
-
/** Async data loader (server-side pagination). Mutually exclusive with `[data]`. */
|
|
216
88
|
this.fetch = input(null, /* @ts-ignore */
|
|
217
89
|
...(ngDevMode ? [{ debugName: "fetch" }] : /* istanbul ignore next */ []));
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
*
|
|
221
|
-
* Required whenever the component does not hold every row — with `[fetch]`,
|
|
222
|
-
* with external paging, or with a tree whose children are loaded on demand, a
|
|
223
|
-
* locally computed list would silently omit values, so it is not computed at
|
|
224
|
-
* all. Resolve `null` for a column to hand that one column back to the local
|
|
225
|
-
* path.
|
|
226
|
-
*/
|
|
227
|
-
this.distincts = input(null, /* @ts-ignore */
|
|
228
|
-
...(ngDevMode ? [{ debugName: "distincts" }] : /* istanbul ignore next */ []));
|
|
229
|
-
/** Partial override of the component's user-visible strings. */
|
|
90
|
+
this.caption = input(null, /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
|
|
230
92
|
this.labels = input(null, /* @ts-ignore */
|
|
231
93
|
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
94
|
+
this.inputLabel = input(null, /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "inputLabel" }] : /* istanbul ignore next */ []));
|
|
96
|
+
this.sortColumns = model([], /* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [{ debugName: "sortColumns" }] : /* istanbul ignore next */ []));
|
|
98
|
+
this.page = model(1, /* @ts-ignore */
|
|
99
|
+
...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
100
|
+
this.perPage = model(20, /* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [{ debugName: "perPage" }] : /* istanbul ignore next */ []));
|
|
102
|
+
this.perPageOptions = input([10, 20, 50], /* @ts-ignore */
|
|
103
|
+
...(ngDevMode ? [{ debugName: "perPageOptions" }] : /* istanbul ignore next */ []));
|
|
104
|
+
this.pagination = input(false, { ...(ngDevMode ? { debugName: "pagination" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
105
|
+
this.autoSort = input(true, { ...(ngDevMode ? { debugName: "autoSort" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
242
106
|
this.selectionMode = input('none', /* @ts-ignore */
|
|
243
107
|
...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
*
|
|
251
|
-
* The selection survives paging, sorting and re-fetching: a selected row
|
|
252
|
-
* that leaves the loaded data stays in the model (the element remembers it).
|
|
253
|
-
* Rows written here are handed to the element, so a host may select rows
|
|
254
|
-
* that are not loaded at all. After a selection change the model holds the
|
|
255
|
-
* freshest row object the element knows for each key.
|
|
256
|
-
*/
|
|
257
|
-
this.selection = model([], /* @ts-ignore */
|
|
258
|
-
...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
259
|
-
/**
|
|
260
|
-
* The row's identity, used for selection and for keeping views across
|
|
261
|
-
* re-renders. Default: `String(row.id)`.
|
|
262
|
-
*
|
|
263
|
-
* **With `[fetch]` (or any selection that must survive paging) the key must
|
|
264
|
-
* be stable** — derived from the row itself, never from its position. The
|
|
265
|
-
* fallback for a row without an `id`, `row-${index}`, is positional and
|
|
266
|
-
* therefore unstable: the same row gets another key on another page or sort.
|
|
267
|
-
* Worse, a selected row that is not loaded has no index and is keyed
|
|
268
|
-
* `rowKey(row, -1)`, so every id-less off-page row collapses onto the one
|
|
269
|
-
* key `row--1` — in this wrapper's model and in the element alike — and the
|
|
270
|
-
* selection can no longer tell them apart. Supply a stable `rowKey`.
|
|
271
|
-
*/
|
|
272
|
-
this.rowKey = input((row, index) => {
|
|
273
|
-
const r = row;
|
|
274
|
-
return r && r.id != null ? String(r.id) : `row-${index}`;
|
|
275
|
-
}, /* @ts-ignore */
|
|
276
|
-
...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
|
|
277
|
-
/**
|
|
278
|
-
* Names a row for its selection checkbox ("Select {label}"). When unset, or
|
|
279
|
-
* when it returns an empty string, the trimmed text of the row's first cell
|
|
280
|
-
* is used, and failing that the row number.
|
|
281
|
-
*/
|
|
108
|
+
this.selectedIds = model([], /* @ts-ignore */
|
|
109
|
+
...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
|
|
110
|
+
this.cutIds = input([], /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "cutIds" }] : /* istanbul ignore next */ []));
|
|
112
|
+
this.focusedRowKey = input(null, /* @ts-ignore */
|
|
113
|
+
...(ngDevMode ? [{ debugName: "focusedRowKey" }] : /* istanbul ignore next */ []));
|
|
282
114
|
this.rowLabel = input(null, /* @ts-ignore */
|
|
283
115
|
...(ngDevMode ? [{ debugName: "rowLabel" }] : /* istanbul ignore next */ []));
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
...(ngDevMode ?
|
|
287
|
-
/** Built-in pagination footer. Ignored when `[fetch]` is provided (server-side paging owns the page state). */
|
|
288
|
-
this.pagination = input(true, /* @ts-ignore */
|
|
289
|
-
...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
290
|
-
/** Enable virtual scrolling for large datasets. */
|
|
291
|
-
this.virtualScroll = input(false, /* @ts-ignore */
|
|
292
|
-
...(ngDevMode ? [{ debugName: "virtualScroll" }] : /* istanbul ignore next */ []));
|
|
293
|
-
/** Approximate row height in px (drives virtual scroll). */
|
|
294
|
-
this.itemSize = input(40, /* @ts-ignore */
|
|
295
|
-
...(ngDevMode ? [{ debugName: "itemSize" }] : /* istanbul ignore next */ []));
|
|
296
|
-
/** Off-screen row buffer per side for virtual scrolling. */
|
|
297
|
-
this.virtualBuffer = input(10, /* @ts-ignore */
|
|
298
|
-
...(ngDevMode ? [{ debugName: "virtualBuffer" }] : /* istanbul ignore next */ []));
|
|
299
|
-
/**
|
|
300
|
-
* Fit a sized parent: the header sticks to its top, the footer to its
|
|
301
|
-
* bottom, and only the rows scroll in between (horizontally the whole table
|
|
302
|
-
* scrolls as one). The parent needs a definite height.
|
|
303
|
-
*/
|
|
304
|
-
this.fill = input(false, { ...(ngDevMode ? { debugName: "fill" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
305
|
-
/** Forwarded to the inner table (legacy responsive flag, currently a CSS hook). */
|
|
306
|
-
this.isResponsive = input(false, /* @ts-ignore */
|
|
307
|
-
...(ngDevMode ? [{ debugName: "isResponsive" }] : /* istanbul ignore next */ []));
|
|
308
|
-
/** Emitted on row single-click. */
|
|
309
|
-
this.rowClick = output();
|
|
310
|
-
/** Emitted on row double-click. */
|
|
311
|
-
this.rowDblClick = output();
|
|
312
|
-
/** Emitted on row context-menu. */
|
|
313
|
-
this.rowContextMenu = output();
|
|
314
|
-
// ─── Tree-mode inputs / models / outputs ─────────────────────────────────
|
|
315
|
-
/** Enable tree mode (chevron column, nested expansion, lazy children). */
|
|
316
|
-
this.tree = input(false, /* @ts-ignore */
|
|
317
|
-
...(ngDevMode ? [{ debugName: "tree" }] : /* istanbul ignore next */ []));
|
|
318
|
-
/**
|
|
319
|
-
* Property name (or function) that extracts the row's stable identity.
|
|
320
|
-
* Required when `tree=true`. Used as the expansion key and as the
|
|
321
|
-
* `parentId` value the WC sends in `mp-datatable-fetch-request`.
|
|
322
|
-
*/
|
|
116
|
+
this.rowKey = input(null, /* @ts-ignore */
|
|
117
|
+
...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
|
|
118
|
+
this.tree = input(false, { ...(ngDevMode ? { debugName: "tree" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
323
119
|
this.idKey = input(null, /* @ts-ignore */
|
|
324
120
|
...(ngDevMode ? [{ debugName: "idKey" }] : /* istanbul ignore next */ []));
|
|
325
|
-
/**
|
|
326
|
-
* Property name on the row holding the direct-child count. Drives chevron
|
|
327
|
-
* visibility AND placeholder reservation for lazy children. Required when
|
|
328
|
-
* `tree=true`.
|
|
329
|
-
*/
|
|
330
121
|
this.childCountKey = input(null, /* @ts-ignore */
|
|
331
122
|
...(ngDevMode ? [{ debugName: "childCountKey" }] : /* istanbul ignore next */ []));
|
|
332
|
-
|
|
333
|
-
this.
|
|
334
|
-
...(ngDevMode ? [{ debugName: "treeIndent" }] : /* istanbul ignore next */ []));
|
|
335
|
-
/** Two-way bound set of expanded-row ids (keyed by `idKey`). */
|
|
336
|
-
this.expandedIds = model(new Set(), /* @ts-ignore */
|
|
123
|
+
this.treeIndent = input(1.25, { ...(ngDevMode ? { debugName: "treeIndent" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
|
|
124
|
+
this.expandedIds = model([], /* @ts-ignore */
|
|
337
125
|
...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
|
|
338
|
-
/**
|
|
339
|
-
* `'flat'` (default) leaves selection to per-row toggles; `'cascading'`
|
|
340
|
-
* (recommended in tree mode) propagates a parent toggle to all loaded
|
|
341
|
-
* descendants and surfaces an indeterminate state on partially-selected
|
|
342
|
-
* parents.
|
|
343
|
-
*/
|
|
344
126
|
this.selectionStrategy = input('flat', /* @ts-ignore */
|
|
345
127
|
...(ngDevMode ? [{ debugName: "selectionStrategy" }] : /* istanbul ignore next */ []));
|
|
346
|
-
|
|
347
|
-
this.
|
|
348
|
-
|
|
349
|
-
this.
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
this.
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
this.
|
|
363
|
-
...(ngDevMode ? [{ debugName: "
|
|
364
|
-
/**
|
|
365
|
-
this.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
this.
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
return '';
|
|
410
|
-
if (nodes.length === 1)
|
|
411
|
-
return nodes[0];
|
|
412
|
-
const frag = document.createDocumentFragment();
|
|
413
|
-
for (const n of nodes)
|
|
414
|
-
frag.appendChild(n);
|
|
415
|
-
return frag;
|
|
416
|
-
},
|
|
417
|
-
// Installed UNCONDITIONALLY, and the nested template is resolved inside
|
|
418
|
-
// it rather than out here.
|
|
419
|
-
//
|
|
420
|
-
// `dir.filterPanelTemplate` is assigned by the nested directive's
|
|
421
|
-
// constructor, which does not run until the column's header view is
|
|
422
|
-
// created — too late for this computed's first evaluation. Reading it
|
|
423
|
-
// here would see `undefined` for every column and no override would ever
|
|
424
|
-
// appear. Creating the header view eagerly to force it is worse: the
|
|
425
|
-
// insertion dirties Angular's query signals inside a reactive read, and
|
|
426
|
-
// that throws NG0600 as soon as the host declares any `viewChild`.
|
|
427
|
-
//
|
|
428
|
-
// Returning `null` means "use the built-in panel", so a column with no
|
|
429
|
-
// override costs nothing.
|
|
430
|
-
filterRenderer: (_col, ctx) => {
|
|
431
|
-
const tpl = dir.filterPanelTemplate;
|
|
432
|
-
if (!tpl)
|
|
433
|
-
return null;
|
|
434
|
-
if (!filterView || !filterValues) {
|
|
435
|
-
// The context is a signal because the demos and specs are zoneless:
|
|
436
|
-
// mutating a context object notifies nothing, so the override would
|
|
437
|
-
// never repaint as values load.
|
|
438
|
-
filterValues = signal(ctx.values());
|
|
439
|
-
filterView = this.vcr.createEmbeddedView(tpl, { $implicit: filterValues, ctx });
|
|
440
|
-
this.filterViews.push(filterView);
|
|
441
|
-
const values = filterValues;
|
|
442
|
-
this.filterUnsubscribes.push(ctx.onChange(() => values.set(ctx.values())));
|
|
443
|
-
}
|
|
444
|
-
filterView.detectChanges();
|
|
445
|
-
const nodes = filterView.rootNodes.filter((n) => n instanceof Node);
|
|
446
|
-
if (nodes.length === 1)
|
|
447
|
-
return nodes[0];
|
|
448
|
-
const frag = document.createDocumentFragment();
|
|
449
|
-
for (const n of nodes)
|
|
450
|
-
frag.appendChild(n);
|
|
451
|
-
return frag;
|
|
452
|
-
},
|
|
453
|
-
};
|
|
454
|
-
});
|
|
455
|
-
}, /* @ts-ignore */
|
|
456
|
-
...(ngDevMode ? [{ debugName: "effectiveColumns" }] : /* istanbul ignore next */ []));
|
|
457
|
-
/** EmbeddedViews for header templates (one per column directive). */
|
|
458
|
-
this.headerViews = [];
|
|
459
|
-
/** EmbeddedViews for filter panel templates (one per overriding column). */
|
|
460
|
-
this.filterViews = [];
|
|
461
|
-
/** `FilterContext.onChange` unsubscribes, one per live filter view. */
|
|
462
|
-
this.filterUnsubscribes = [];
|
|
463
|
-
/** The previous generation, awaiting disposal by the columns effect. */
|
|
464
|
-
this.staleViews = [];
|
|
465
|
-
/** EmbeddedViews for row templates, keyed by rowKey for reuse. */
|
|
466
|
-
this.rowViews = new Map();
|
|
467
|
-
/** The selection model the wrapper last built from a WC event (echo guard). */
|
|
468
|
-
this.lastEmittedSelection = null;
|
|
469
|
-
this.destroyRef.onDestroy(() => {
|
|
470
|
-
// Deliberately does NOT destroy the views. Every one of them is attached
|
|
471
|
-
// to this component's ViewContainerRef, so Angular tears them down with
|
|
472
|
-
// the host view; destroying them again from a cleanup hook re-enters that
|
|
473
|
-
// teardown and desynchronises the container's view bookkeeping — a hard
|
|
474
|
-
// "attached view should be in the same position within its container"
|
|
475
|
-
// assertion in dev mode. It only surfaces once a header template contains
|
|
476
|
-
// a nested structural directive, which `*bsDatatableFilterPanel` is, so
|
|
477
|
-
// the previous code looked correct right up until it was not.
|
|
478
|
-
//
|
|
479
|
-
// The subscriptions are the only thing here Angular knows nothing about.
|
|
480
|
-
this.releaseFilterSubscriptions();
|
|
481
|
-
this.headerViews = [];
|
|
482
|
-
this.filterViews = [];
|
|
483
|
-
this.staleViews = [];
|
|
484
|
-
this.rowViews.clear();
|
|
485
|
-
});
|
|
486
|
-
// Same server guard as `fetch`: the source is a network call in every real
|
|
487
|
-
// consumer, and a panel cannot be opened during SSR anyway.
|
|
488
|
-
effect(() => {
|
|
489
|
-
const el = this.datatableRef().nativeElement;
|
|
490
|
-
if (isPlatformServer(this.platformId))
|
|
491
|
-
return;
|
|
492
|
-
el.distincts = this.distincts();
|
|
493
|
-
});
|
|
494
|
-
effect(() => {
|
|
495
|
-
const el = this.datatableRef().nativeElement;
|
|
496
|
-
el.labels = this.labels() ?? undefined;
|
|
497
|
-
});
|
|
498
|
-
// Forward columns to the WC, and dispose the generation the recompute
|
|
499
|
-
// retired. An effect may write signals; a computed may not, which is the
|
|
500
|
-
// whole reason the disposal happens out here.
|
|
501
|
-
effect(() => {
|
|
502
|
-
const columns = this.effectiveColumns();
|
|
503
|
-
this.disposeStaleViews();
|
|
504
|
-
const el = this.datatableRef().nativeElement;
|
|
505
|
-
el.columns = columns;
|
|
506
|
-
});
|
|
507
|
-
// Static `[data]` only. When `[fetch]` is set the WC owns the rows, so the
|
|
508
|
-
// wrapper must not also push `el.data` (it would clobber fetched pages).
|
|
509
|
-
effect(() => {
|
|
510
|
-
const el = this.datatableRef().nativeElement;
|
|
511
|
-
if (this.fetch())
|
|
512
|
-
return;
|
|
513
|
-
const d = this.data();
|
|
514
|
-
el.data = (d ?? []);
|
|
515
|
-
});
|
|
516
|
-
// Forward `[fetch]` and the paging/sort settings as ONE change (#407). The
|
|
517
|
-
// WC owns the entire server-paged loop (initial page, on-demand windows,
|
|
518
|
-
// tree children, pagination, sort/perPage reloads) and derives
|
|
519
|
-
// `totalRecords` from the response; the wrapper runs no fetch loop.
|
|
520
|
-
// Assigning fetch, sort, page and perPage through separate setters (they
|
|
521
|
-
// used to live in two effects) could split across ticks and cost two
|
|
522
|
-
// requests; `applyFetchState` schedules exactly one.
|
|
523
|
-
//
|
|
524
|
-
// This effect must never read `selection`: a selection change would then
|
|
525
|
-
// re-run it, and with an inline `[fetch]` closure that is a request.
|
|
526
|
-
effect(() => {
|
|
527
|
-
const el = this.datatableRef().nativeElement;
|
|
528
|
-
const settings = this.settings();
|
|
529
|
-
const fetch = this.fetch();
|
|
530
|
-
const virtual = this.virtualScroll();
|
|
531
|
-
const sortColumns = settings.sortColumns.map((c) => ({ property: c.property, direction: c.direction }));
|
|
532
|
-
if (isPlatformServer(this.platformId)) {
|
|
533
|
-
// No fetch on the server (SSR must not kick off a client request), and
|
|
534
|
-
// the element may not be upgraded there, so no method calls either.
|
|
535
|
-
el.sortColumns = sortColumns;
|
|
536
|
-
el.page = settings.page.selected;
|
|
537
|
-
el.perPage = settings.perPage.selected;
|
|
538
|
-
}
|
|
539
|
-
else {
|
|
540
|
-
el.applyFetchState({
|
|
541
|
-
fetch: fetch ?? null,
|
|
542
|
-
sortColumns,
|
|
543
|
-
perPage: settings.perPage.selected,
|
|
544
|
-
page: settings.page.selected,
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
|
-
el.autoSort = !fetch;
|
|
548
|
-
// Pagination renders in non-virtual mode; in fetch mode the wrapper
|
|
549
|
-
// owns page state and the WC just reports the change via event.
|
|
550
|
-
el.pagination = this.pagination() && !virtual;
|
|
551
|
-
el.perPageOptions = settings.perPage.values;
|
|
552
|
-
});
|
|
553
|
-
effect(() => {
|
|
554
|
-
const el = this.datatableRef().nativeElement;
|
|
555
|
-
const mode = this.selectable() ?? this.selectionMode();
|
|
556
|
-
el.selectionMode = mode;
|
|
557
|
-
});
|
|
558
|
-
effect(() => {
|
|
559
|
-
const el = this.datatableRef().nativeElement;
|
|
560
|
-
el.rowKey = (row, index) => this.rowKey()(row, index);
|
|
561
|
-
});
|
|
562
|
-
effect(() => {
|
|
563
|
-
const el = this.datatableRef().nativeElement;
|
|
564
|
-
const label = this.rowLabel();
|
|
565
|
-
el.rowLabel = label ? (row) => label(row) : null;
|
|
566
|
-
});
|
|
567
|
-
effect(() => {
|
|
568
|
-
const el = this.datatableRef().nativeElement;
|
|
569
|
-
el.resizableColumns = this.resizableColumns();
|
|
570
|
-
});
|
|
571
|
-
effect(() => {
|
|
572
|
-
const el = this.datatableRef().nativeElement;
|
|
573
|
-
el.virtualScroll = this.virtualScroll();
|
|
574
|
-
el.itemSize = this.itemSize();
|
|
575
|
-
el.virtualBuffer = this.virtualBuffer();
|
|
576
|
-
});
|
|
577
|
-
effect(() => {
|
|
578
|
-
this.datatableRef().nativeElement.fill = this.fill();
|
|
579
|
-
});
|
|
580
|
-
// Tree-mode prop sync to the WC.
|
|
581
|
-
effect(() => {
|
|
582
|
-
const el = this.datatableRef().nativeElement;
|
|
583
|
-
el.tree = this.tree();
|
|
584
|
-
el.idKey = this.idKey();
|
|
585
|
-
el.childCountKey = this.childCountKey();
|
|
586
|
-
el.treeIndent = this.treeIndent();
|
|
587
|
-
el.selectionStrategy = this.selectionStrategy();
|
|
588
|
-
});
|
|
589
|
-
// Two-way bind `expandedIds` to the WC. Skip-on-echo via structural equality
|
|
590
|
-
// — the WC's getter returns a fresh Set on every read.
|
|
591
|
-
effect(() => {
|
|
592
|
-
const desired = this.expandedIds();
|
|
593
|
-
const el = this.datatableRef().nativeElement;
|
|
594
|
-
const current = el.expandedIds;
|
|
595
|
-
if (setsEqual(current, desired))
|
|
596
|
-
return;
|
|
597
|
-
el.expandedIds = desired;
|
|
598
|
-
});
|
|
599
|
-
// Wire the row renderer when *bsRowTemplate is provided.
|
|
600
|
-
effect(() => {
|
|
601
|
-
const el = this.datatableRef().nativeElement;
|
|
602
|
-
const tpl = this.rowTemplate();
|
|
603
|
-
// Row views cached for a previous template would keep rendering ITS cells: drop them.
|
|
604
|
-
[...this.rowViews.values()].map((v) => v.destroy());
|
|
605
|
-
this.rowViews.clear();
|
|
606
|
-
el.rowRenderer = tpl ? this.buildRowRenderer(tpl) : undefined;
|
|
607
|
-
});
|
|
608
|
-
// Selection model → WC. Rows are pushed, not keys, so the element
|
|
609
|
-
// remembers host-supplied rows that are not loaded (and derives the keys
|
|
610
|
-
// itself, from the row's position in its data — not from the row's index
|
|
611
|
-
// in this array, which was K3).
|
|
612
|
-
//
|
|
613
|
-
// Echo guard (spike S2). The `selectedRows` setter REPLACES the selection.
|
|
614
|
-
// A model built from an event can legitimately lack a key the element
|
|
615
|
-
// still holds (a key that has never had a row, D3), so pushing that model
|
|
616
|
-
// back would silently DROP the key. Two checks keep that from happening:
|
|
617
|
-
// 1. The model the wrapper itself just built from an event is not pushed
|
|
618
|
-
// back — compared by reference. The guard covers that IMMEDIATE echo
|
|
619
|
-
// only: the first other value clears it, so a host that clears the
|
|
620
|
-
// selection and later restores the earlier array (cancel, error) is
|
|
621
|
-
// pushed like any other write.
|
|
622
|
-
// 2. Anything else with the element's key set is pushed only when some
|
|
623
|
-
// row differs (`!==`) from the row the element holds for its key: a
|
|
624
|
-
// host's fresher object (a new etag) must reach the element, or its
|
|
625
|
-
// next event would report the stale one. Equal key sets mean no
|
|
626
|
-
// row-less key can be lost by that push; an identical model is skipped.
|
|
627
|
-
// The setter emits no event and this effect writes no signal, so there is
|
|
628
|
-
// no loop either way.
|
|
629
|
-
effect(() => {
|
|
630
|
-
const el = this.datatableRef().nativeElement;
|
|
631
|
-
const rows = this.selection();
|
|
632
|
-
const keyFn = this.rowKey();
|
|
633
|
-
if (rows === this.lastEmittedSelection)
|
|
634
|
-
return;
|
|
635
|
-
this.lastEmittedSelection = null;
|
|
636
|
-
const current = el.selectedIds ?? [];
|
|
637
|
-
const currentRows = el.selectedRows ?? [];
|
|
638
|
-
const keyOf = this.selectionKeyLookup(keyFn, current, currentRows);
|
|
639
|
-
const keys = rows.map(keyOf);
|
|
640
|
-
const next = new Set(keys);
|
|
641
|
-
const sameKeys = next.size === current.length && current.every((k) => next.has(k));
|
|
642
|
-
if (sameKeys) {
|
|
643
|
-
const elementRow = new Map(current.map((k, i) => [k, currentRows[i]]));
|
|
644
|
-
if (rows.every((row, i) => elementRow.get(keys[i]) === row))
|
|
645
|
-
return;
|
|
646
|
-
}
|
|
647
|
-
el.selectedRows = rows;
|
|
648
|
-
});
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Keys a selection-model row the way the element would: a row the element
|
|
652
|
-
* currently reports keeps the key it reports it under; any other row gets
|
|
653
|
-
* `rowKey(row, -1)`, which is what the element uses for a row that is not
|
|
654
|
-
* in its loaded data.
|
|
655
|
-
*/
|
|
656
|
-
selectionKeyLookup(keyFn, ids, rows) {
|
|
657
|
-
const known = new Map(rows.flatMap((row, i) => (row === undefined ? [] : [[row, ids[i]]])));
|
|
658
|
-
return (row) => known.get(row) ?? keyFn(row, -1);
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Re-queries `[fetch]` for the current sort, page and page size, e.g. after
|
|
662
|
-
* the server data changed. The selection is kept. `resetPage: true` also
|
|
663
|
-
* returns to page 1. A no-op on the server and without `[fetch]`.
|
|
664
|
-
*/
|
|
665
|
-
reload(options) {
|
|
666
|
-
if (isPlatformServer(this.platformId))
|
|
667
|
-
return;
|
|
668
|
-
this.datatableRef().nativeElement.reload(options);
|
|
669
|
-
}
|
|
670
|
-
buildRowRenderer(tpl) {
|
|
671
|
-
return (row, rowIndex, ctx) => {
|
|
672
|
-
// Placeholder rows (tree-mode, children pending fetch) get a synthetic key
|
|
673
|
-
// so the view is reused per slot. Consumers detect them via `isPlaceholder`.
|
|
674
|
-
const isPlaceholder = ctx?.isPlaceholder ?? row === undefined;
|
|
675
|
-
const depth = ctx?.depth ?? 0;
|
|
676
|
-
const isExpanded = ctx?.isExpanded ?? false;
|
|
677
|
-
const key = isPlaceholder
|
|
678
|
-
? `__placeholder-${rowIndex}`
|
|
679
|
-
: this.rowKey()(row, rowIndex);
|
|
680
|
-
let viewRef = this.rowViews.get(key);
|
|
681
|
-
if (!viewRef) {
|
|
682
|
-
const context = new BsRowTemplateContext();
|
|
683
|
-
context.$implicit = row;
|
|
684
|
-
context.index = rowIndex;
|
|
685
|
-
context.depth = depth;
|
|
686
|
-
context.isExpanded = isExpanded;
|
|
687
|
-
context.isPlaceholder = isPlaceholder;
|
|
688
|
-
viewRef = this.vcr.createEmbeddedView(tpl.templateRef, context);
|
|
689
|
-
this.rowViews.set(key, viewRef);
|
|
690
|
-
}
|
|
691
|
-
else {
|
|
692
|
-
viewRef.context.$implicit = row;
|
|
693
|
-
viewRef.context.index = rowIndex;
|
|
694
|
-
viewRef.context.depth = depth;
|
|
695
|
-
viewRef.context.isExpanded = isExpanded;
|
|
696
|
-
viewRef.context.isPlaceholder = isPlaceholder;
|
|
697
|
-
}
|
|
698
|
-
viewRef.detectChanges();
|
|
699
|
-
const nodes = viewRef.rootNodes.filter((n) => n instanceof Node);
|
|
700
|
-
return nodes;
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
// ─── WC event handlers ───────────────────────────────────────────────────
|
|
704
|
-
onSortChange(event) {
|
|
705
|
-
const detail = event.detail;
|
|
706
|
-
const settings = this.settings();
|
|
707
|
-
this.settings.set(new DatatableSettings({
|
|
708
|
-
...settings,
|
|
709
|
-
sortColumns: detail.sortColumns,
|
|
710
|
-
page: { ...settings.page, selected: 1 },
|
|
711
|
-
}));
|
|
712
|
-
}
|
|
713
|
-
onSelectionChange(event) {
|
|
714
|
-
const detail = event.detail;
|
|
715
|
-
// `selectedIds` is authoritative; `selectedRows` is index-aligned with it,
|
|
716
|
-
// with `undefined` for a key whose row the element has never seen (D3/D5).
|
|
717
|
-
// Such a key falls back to the row the model already held for it, and is
|
|
718
|
-
// otherwise left out of the model — it stays selected in the element,
|
|
719
|
-
// which is why the selection effect's echo guard never pushes it back.
|
|
720
|
-
const keyFn = this.rowKey();
|
|
721
|
-
const previous = new Map(this.selection().map((row) => [keyFn(row, -1), row]));
|
|
722
|
-
const next = detail.selectedIds.flatMap((id, i) => {
|
|
723
|
-
const row = detail.selectedRows[i] ?? previous.get(id);
|
|
724
|
-
return row === undefined ? [] : [row];
|
|
725
|
-
});
|
|
726
|
-
this.lastEmittedSelection = next;
|
|
727
|
-
this.selection.set(next);
|
|
728
|
-
}
|
|
729
|
-
onPageChange(event) {
|
|
730
|
-
const detail = event.detail;
|
|
731
|
-
const settings = this.settings();
|
|
732
|
-
this.settings.set(new DatatableSettings({
|
|
733
|
-
...settings,
|
|
734
|
-
page: { ...settings.page, selected: detail.page },
|
|
735
|
-
}));
|
|
736
|
-
}
|
|
737
|
-
onPerPageChange(event) {
|
|
738
|
-
const detail = event.detail;
|
|
739
|
-
const settings = this.settings();
|
|
740
|
-
this.settings.set(new DatatableSettings({
|
|
741
|
-
...settings,
|
|
742
|
-
perPage: { ...settings.perPage, selected: detail.perPage },
|
|
743
|
-
page: { ...settings.page, selected: 1 },
|
|
744
|
-
}));
|
|
745
|
-
}
|
|
746
|
-
onRowClick(event) {
|
|
747
|
-
this.rowClick.emit(this.toBsEvent(event));
|
|
748
|
-
}
|
|
749
|
-
onRowDblClick(event) {
|
|
750
|
-
this.rowDblClick.emit(this.toBsEvent(event));
|
|
751
|
-
}
|
|
752
|
-
onRowContextMenu(event) {
|
|
753
|
-
this.rowContextMenu.emit(this.toBsEvent(event));
|
|
754
|
-
}
|
|
755
|
-
// ─── Tree-mode event handlers ────────────────────────────────────────────
|
|
756
|
-
onRowExpand(event) {
|
|
757
|
-
const detail = event.detail;
|
|
758
|
-
this.rowExpand.emit({ row: detail.row, depth: detail.depth, parentId: detail.parentId });
|
|
759
|
-
}
|
|
760
|
-
onRowCollapse(event) {
|
|
761
|
-
const detail = event.detail;
|
|
762
|
-
this.rowCollapse.emit({ row: detail.row, depth: detail.depth, parentId: detail.parentId });
|
|
763
|
-
}
|
|
764
|
-
onExpandedIdsChange(event) {
|
|
765
|
-
const detail = event.detail;
|
|
766
|
-
const next = new Set(detail.expandedIds);
|
|
767
|
-
if (setsEqual(this.expandedIds(), next))
|
|
768
|
-
return;
|
|
769
|
-
this.expandedIds.set(next);
|
|
770
|
-
}
|
|
771
|
-
onFilterChange(event) {
|
|
772
|
-
this.filterChange.emit(event.detail);
|
|
773
|
-
}
|
|
774
|
-
toBsEvent(event) {
|
|
775
|
-
const detail = event.detail;
|
|
776
|
-
return {
|
|
777
|
-
row: detail.row,
|
|
778
|
-
rowIndex: detail.rowIndex,
|
|
779
|
-
rowKey: detail.rowKey,
|
|
780
|
-
originalEvent: detail.originalEvent,
|
|
781
|
-
};
|
|
128
|
+
this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
129
|
+
this.emptyMessage = input('No data', /* @ts-ignore */
|
|
130
|
+
...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
|
|
131
|
+
this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
132
|
+
this.itemSize = input(40, { ...(ngDevMode ? { debugName: "itemSize" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
|
|
133
|
+
this.virtualBuffer = input(10, { ...(ngDevMode ? { debugName: "virtualBuffer" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
|
|
134
|
+
this.fill = input(false, { ...(ngDevMode ? { debugName: "fill" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
135
|
+
this.resizableColumns = input(true, { ...(ngDevMode ? { debugName: "resizableColumns" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
136
|
+
this.hrefFor = input(null, /* @ts-ignore */
|
|
137
|
+
...(ngDevMode ? [{ debugName: "hrefFor" }] : /* istanbul ignore next */ []));
|
|
138
|
+
this.distincts = input(null, /* @ts-ignore */
|
|
139
|
+
...(ngDevMode ? [{ debugName: "distincts" }] : /* istanbul ignore next */ []));
|
|
140
|
+
this.filters = model({}, /* @ts-ignore */
|
|
141
|
+
...(ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []));
|
|
142
|
+
this.fetchParams = input(null, /* @ts-ignore */
|
|
143
|
+
...(ngDevMode ? [{ debugName: "fetchParams" }] : /* istanbul ignore next */ []));
|
|
144
|
+
this.stateKey = input(null, /* @ts-ignore */
|
|
145
|
+
...(ngDevMode ? [{ debugName: "stateKey" }] : /* istanbul ignore next */ []));
|
|
146
|
+
/** The sort, after the user changed it. */
|
|
147
|
+
this.sortcolumnschange = output();
|
|
148
|
+
/** The page, after the user changed it. */
|
|
149
|
+
this.pagechange = output();
|
|
150
|
+
/** The page size, after the user changed it. */
|
|
151
|
+
this.perpagechange = output();
|
|
152
|
+
/** The selected row keys, after the user changed them. */
|
|
153
|
+
this.selectedidschange = output();
|
|
154
|
+
/** The expanded row ids, after the user changed them. */
|
|
155
|
+
this.expandedidschange = output();
|
|
156
|
+
/** A row was clicked, or opened with Enter. */
|
|
157
|
+
this.rowclick = output();
|
|
158
|
+
/** A row was double-clicked. */
|
|
159
|
+
this.rowdblclick = output();
|
|
160
|
+
/** A row's context menu; `originalEvent.preventDefault()` suppresses the browser's. */
|
|
161
|
+
this.rowcontextmenu = output();
|
|
162
|
+
/** The user changed the selection: the keys and their rows. */
|
|
163
|
+
this.selectionchanged = output();
|
|
164
|
+
/** A tree row expanded. */
|
|
165
|
+
this.rowexpand = output();
|
|
166
|
+
/** A tree row collapsed. */
|
|
167
|
+
this.rowcollapse = output();
|
|
168
|
+
/** A `fetch` call rejected. */
|
|
169
|
+
this.loaderror = output();
|
|
170
|
+
/** The column filters, after the user changed them; `fetch` (or the consumer, over `data`) applies them. */
|
|
171
|
+
this.filterschange = output();
|
|
172
|
+
this.headerSlot = contentChild(BsDatatableHeaderDirective, /* @ts-ignore */
|
|
173
|
+
...(ngDevMode ? [{ debugName: "headerSlot" }] : /* istanbul ignore next */ []));
|
|
174
|
+
this.cellSlot = contentChild(BsDatatableCellDirective, /* @ts-ignore */
|
|
175
|
+
...(ngDevMode ? [{ debugName: "cellSlot" }] : /* istanbul ignore next */ []));
|
|
176
|
+
this.rowSlot = contentChild(BsDatatableRowDirective, /* @ts-ignore */
|
|
177
|
+
...(ngDevMode ? [{ debugName: "rowSlot" }] : /* istanbul ignore next */ []));
|
|
178
|
+
this.filterSlot = contentChild(BsDatatableFilterDirective, /* @ts-ignore */
|
|
179
|
+
...(ngDevMode ? [{ debugName: "filterSlot" }] : /* istanbul ignore next */ []));
|
|
180
|
+
/** The template's named slots. */
|
|
181
|
+
this.slots = computed(() => ({ header: this.headerSlot()?.templateRef, cell: this.cellSlot()?.templateRef, row: this.rowSlot()?.templateRef, filter: this.filterSlot()?.templateRef }), /* @ts-ignore */
|
|
182
|
+
...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
|
|
183
|
+
this.#core = useCore(datatableCore, { inputs: () => ({ columns: this.columns(), data: this.data(), fetch: this.fetch(), caption: this.caption(), labels: this.labels(), inputLabel: this.inputLabel(), sortColumns: this.sortColumns(), page: this.page(), perPage: this.perPage(), perPageOptions: this.perPageOptions(), pagination: this.pagination(), autoSort: this.autoSort(), selectionMode: this.selectionMode(), selectedIds: this.selectedIds(), cutIds: this.cutIds(), focusedRowKey: this.focusedRowKey(), rowLabel: this.rowLabel(), rowKey: this.rowKey(), tree: this.tree(), idKey: this.idKey(), childCountKey: this.childCountKey(), treeIndent: this.treeIndent(), expandedIds: this.expandedIds(), selectionStrategy: this.selectionStrategy(), loading: this.loading(), emptyMessage: this.emptyMessage(), virtualScroll: this.virtualScroll(), itemSize: this.itemSize(), virtualBuffer: this.virtualBuffer(), fill: this.fill(), resizableColumns: this.resizableColumns(), hrefFor: this.hrefFor(), distincts: this.distincts(), filters: this.filters(), fetchParams: this.fetchParams(), stateKey: this.stateKey() }), idPrefix: 'bs-datatable', outputs: { sortColumnsChange: this.sortcolumnschange, pageChange: this.pagechange, perPageChange: this.perpagechange, selectedIdsChange: this.selectedidschange, expandedIdsChange: this.expandedidschange, rowClick: this.rowclick, rowDblClick: this.rowdblclick, rowContextMenu: this.rowcontextmenu, selectionChanged: this.selectionchanged, rowExpand: this.rowexpand, rowCollapse: this.rowcollapse, loadError: this.loaderror, filtersChange: this.filterschange }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'datatable' }), models: { sortColumns: this.sortColumns, page: this.page, perPage: this.perPage, selectedIds: this.selectedIds, expandedIds: this.expandedIds, filters: this.filters } });
|
|
184
|
+
/** The template's props. */
|
|
185
|
+
this.props = this.#core.props;
|
|
186
|
+
useScopedStyles('datatable', datatableScopedStyles);
|
|
187
|
+
}
|
|
188
|
+
/** Re-query `fetch` for the current sort, page and page size; `{ resetPage: true }` also returns to page 1. */
|
|
189
|
+
reload(...args) {
|
|
190
|
+
return this.#core.call('reload', args);
|
|
782
191
|
}
|
|
783
192
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
784
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: BsDatatableComponent, isStandalone: true, selector: "bs-datatable", inputs: { columnsInput: { classPropertyName: "columnsInput", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, fetch: { classPropertyName: "fetch", publicName: "fetch", isSignal: true, isRequired: false, transformFunction: null }, distincts: { classPropertyName: "distincts", publicName: "distincts", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: false, transformFunction: null }, rowLabel: { classPropertyName: "rowLabel", publicName: "rowLabel", isSignal: true, isRequired: false, transformFunction: null }, resizableColumns: { classPropertyName: "resizableColumns", publicName: "resizableColumns", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, virtualBuffer: { classPropertyName: "virtualBuffer", publicName: "virtualBuffer", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, isResponsive: { classPropertyName: "isResponsive", publicName: "isResponsive", isSignal: true, isRequired: false, transformFunction: null }, tree: { classPropertyName: "tree", publicName: "tree", isSignal: true, isRequired: false, transformFunction: null }, idKey: { classPropertyName: "idKey", publicName: "idKey", isSignal: true, isRequired: false, transformFunction: null }, childCountKey: { classPropertyName: "childCountKey", publicName: "childCountKey", isSignal: true, isRequired: false, transformFunction: null }, treeIndent: { classPropertyName: "treeIndent", publicName: "treeIndent", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, selectionStrategy: { classPropertyName: "selectionStrategy", publicName: "selectionStrategy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { settings: "settingsChange", selection: "selectionChange", rowClick: "rowClick", rowDblClick: "rowDblClick", rowContextMenu: "rowContextMenu", expandedIds: "expandedIdsChange", rowExpand: "rowExpand", rowCollapse: "rowCollapse", filterChange: "filterChange" }, host: { properties: { "class.bs-datatable-fill": "fill()" } }, queries: [{ propertyName: "columnDirectives", predicate: BsDatatableColumnDirective, isSignal: true }, { propertyName: "rowTemplate", first: true, predicate: (BsRowTemplateDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "datatableRef", first: true, predicate: ["datatable"], descendants: true, isSignal: true }], ngImport: i0, template: "<mp-datatable bsForwardAria\n #datatable\n class=\"bs-datatable\"\n (mp-datatable-sort-change)=\"onSortChange($event)\"\n (mp-datatable-selection-change)=\"onSelectionChange($event)\"\n (mp-datatable-page-change)=\"onPageChange($event)\"\n (mp-datatable-per-page-change)=\"onPerPageChange($event)\"\n (mp-datatable-row-click)=\"onRowClick($event)\"\n (mp-datatable-row-dblclick)=\"onRowDblClick($event)\"\n (mp-datatable-row-contextmenu)=\"onRowContextMenu($event)\"\n (mp-datatable-row-expand)=\"onRowExpand($event)\"\n (mp-datatable-row-collapse)=\"onRowCollapse($event)\"\n (mp-datatable-expanded-ids-change)=\"onExpandedIdsChange($event)\"\n (mp-datatable-filter-change)=\"onFilterChange($event)\"\n></mp-datatable>\n", styles: [":host{display:block;width:100%}:host(.bs-datatable-fill){height:100%}.bs-datatable{display:block;width:100%}\n"], dependencies: [{ kind: "directive", type: BsForwardAriaDirective, selector: "[bsForwardAria]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
193
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsDatatableComponent, isStandalone: true, selector: "bs-datatable", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, fetch: { classPropertyName: "fetch", publicName: "fetch", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, inputLabel: { classPropertyName: "inputLabel", publicName: "inputLabel", isSignal: true, isRequired: false, transformFunction: null }, sortColumns: { classPropertyName: "sortColumns", publicName: "sortColumns", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, perPage: { classPropertyName: "perPage", publicName: "perPage", isSignal: true, isRequired: false, transformFunction: null }, perPageOptions: { classPropertyName: "perPageOptions", publicName: "perPageOptions", isSignal: true, isRequired: false, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: false, transformFunction: null }, autoSort: { classPropertyName: "autoSort", publicName: "autoSort", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, cutIds: { classPropertyName: "cutIds", publicName: "cutIds", isSignal: true, isRequired: false, transformFunction: null }, focusedRowKey: { classPropertyName: "focusedRowKey", publicName: "focusedRowKey", isSignal: true, isRequired: false, transformFunction: null }, rowLabel: { classPropertyName: "rowLabel", publicName: "rowLabel", isSignal: true, isRequired: false, transformFunction: null }, rowKey: { classPropertyName: "rowKey", publicName: "rowKey", isSignal: true, isRequired: false, transformFunction: null }, tree: { classPropertyName: "tree", publicName: "tree", isSignal: true, isRequired: false, transformFunction: null }, idKey: { classPropertyName: "idKey", publicName: "idKey", isSignal: true, isRequired: false, transformFunction: null }, childCountKey: { classPropertyName: "childCountKey", publicName: "childCountKey", isSignal: true, isRequired: false, transformFunction: null }, treeIndent: { classPropertyName: "treeIndent", publicName: "treeIndent", isSignal: true, isRequired: false, transformFunction: null }, expandedIds: { classPropertyName: "expandedIds", publicName: "expandedIds", isSignal: true, isRequired: false, transformFunction: null }, selectionStrategy: { classPropertyName: "selectionStrategy", publicName: "selectionStrategy", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, virtualBuffer: { classPropertyName: "virtualBuffer", publicName: "virtualBuffer", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, resizableColumns: { classPropertyName: "resizableColumns", publicName: "resizableColumns", isSignal: true, isRequired: false, transformFunction: null }, hrefFor: { classPropertyName: "hrefFor", publicName: "hrefFor", isSignal: true, isRequired: false, transformFunction: null }, distincts: { classPropertyName: "distincts", publicName: "distincts", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, fetchParams: { classPropertyName: "fetchParams", publicName: "fetchParams", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sortColumns: "sortColumnsChange", page: "pageChange", perPage: "perPageChange", selectedIds: "selectedIdsChange", expandedIds: "expandedIdsChange", filters: "filtersChange", sortcolumnschange: "sortcolumnschange", pagechange: "pagechange", perpagechange: "perpagechange", selectedidschange: "selectedidschange", expandedidschange: "expandedidschange", rowclick: "rowclick", rowdblclick: "rowdblclick", rowcontextmenu: "rowcontextmenu", selectionchanged: "selectionchanged", rowexpand: "rowexpand", rowcollapse: "rowcollapse", loaderror: "loaderror", filterschange: "filterschange" }, queries: [{ propertyName: "headerSlot", first: true, predicate: BsDatatableHeaderDirective, descendants: true, isSignal: true }, { propertyName: "cellSlot", first: true, predicate: BsDatatableCellDirective, descendants: true, isSignal: true }, { propertyName: "rowSlot", first: true, predicate: BsDatatableRowDirective, descendants: true, isSignal: true }, { propertyName: "filterSlot", first: true, predicate: BsDatatableFilterDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- GENERATED from libs/mintplayer-ui-core/datatable/src/templates/datatable.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"datatable\" [mpProps]=\"p_view.live\">\n {{ p_view.announcement }}\n</div>\n<div data-mps=\"datatable\" [mpProps]=\"p_view.shell\">\n <div data-mps=\"datatable\" [mpProps]=\"p_view.scroll\">\n <table data-mps=\"datatable\" [mpProps]=\"p_view.table\" [style]=\"p_view.tableStyle\">\n @if (p_view.caption) {\n <caption data-mps=\"datatable\" [mpProps]=\"p_view.captionBag\">\n {{ p_view.caption }}\n </caption>\n }\n <thead data-mps=\"datatable\" [mpProps]=\"p_view.thead\">\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.headerRow\">\n @if (p_view.chevronHeader) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.chevronHeader\"></th>\n }\n @if (p_view.checkHeader) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.checkHeader\">\n <input data-mps=\"datatable\" [mpProps]=\"p_view.deselectAll\" [checked]=\"false\" [indeterminate]=\"p_view.anySelected\">\n </th>\n }\n @for (h of p_view.headers; track h.key) {\n <th data-mps=\"datatable\" [mpProps]=\"h.th\" [style]=\"h.style\">\n @if (h.sortHref) {\n <a data-mps=\"datatable\" [mpProps]=\"h.sort\" [attr.href]=\"h.sortHref\">\n <span data-mps=\"datatable\" [mpProps]=\"h.text\">\n @if (slots().header; as slot_header) {\n <ng-container [ngTemplateOutlet]=\"slot_header\" [ngTemplateOutletContext]=\"{ $implicit: { column: h.column }, column: h.column }\" />\n } @else {\n {{ h.label }}\n }\n </span>\n @if (h.sortIndex) {\n <span data-mps=\"datatable\" [mpProps]=\"h.sortIndex\">\n {{ h.sortIndexText }}\n </span>\n }\n </a>\n } @else if (h.sortable) {\n <button data-mps=\"datatable\" [mpProps]=\"h.sort\">\n <span data-mps=\"datatable\" [mpProps]=\"h.text\">\n @if (slots().header; as slot_header) {\n <ng-container [ngTemplateOutlet]=\"slot_header\" [ngTemplateOutletContext]=\"{ $implicit: { column: h.column }, column: h.column }\" />\n } @else {\n {{ h.label }}\n }\n </span>\n @if (h.sortIndex) {\n <span data-mps=\"datatable\" [mpProps]=\"h.sortIndex\">\n {{ h.sortIndexText }}\n </span>\n }\n </button>\n } @else {\n <span data-mps=\"datatable\" [mpProps]=\"h.plain\">\n <span data-mps=\"datatable\" [mpProps]=\"h.text\">\n @if (slots().header; as slot_header) {\n <ng-container [ngTemplateOutlet]=\"slot_header\" [ngTemplateOutletContext]=\"{ $implicit: { column: h.column }, column: h.column }\" />\n } @else {\n {{ h.label }}\n }\n </span>\n </span>\n }\n @if (h.resize) {\n <span data-mps=\"datatable\" [mpProps]=\"h.resize\"></span>\n }\n </th>\n }\n </tr>\n @if (p_view.filterRow) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.filterRow\">\n @if (p_view.filterChevronCell) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.filterChevronCell\"></th>\n }\n @if (p_view.filterCheckCell) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.filterCheckCell\"></th>\n }\n @for (fc of p_view.filterCells; track fc.key) {\n <th data-mps=\"datatable\" [mpProps]=\"fc.th\">\n @if (fc.trigger) {\n <button data-mps=\"datatable\" [mpProps]=\"fc.trigger\">\n <svg data-mps=\"datatable\" [mpProps]=\"fc.icon\">\n <path data-mps=\"datatable\" [mpProps]=\"fc.path\"></path>\n </svg>\n @if (fc.summary) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.summary\">\n {{ fc.summaryText }}\n </span>\n }\n </button>\n }\n @if (fc.panel) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.panel\">\n @if (fc.open && fc.open.custom) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.body\">\n @if (slots().filter; as slot_filter) {\n <ng-container [ngTemplateOutlet]=\"slot_filter\" [ngTemplateOutletContext]=\"{ $implicit: { column: fc.open.column, ctx: fc.open.ctx }, column: fc.open.column, ctx: fc.open.ctx }\" />\n }\n </div>\n } @else if (fc.open) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.body\">\n <button data-mps=\"datatable\" [mpProps]=\"fc.open.clear\">\n {{ fc.open.clearText }}\n </button>\n @if (fc.open.comparison) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.wrap\">\n <select data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.operator\">\n @for (op of fc.open.comparison.operators; track op.key) {\n <option data-mps=\"datatable\" [mpProps]=\"op.option\">\n {{ op.text }}\n </option>\n }\n </select>\n <input data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.operand\" [value]=\"fc.open.comparison.operandText\">\n </div>\n }\n @if (fc.open.comparison && fc.open.comparison.applied) {\n <small data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.applied\">\n {{ fc.open.comparison.appliedText }}\n </small>\n }\n @if (fc.open.list) {\n <input data-mps=\"datatable\" [mpProps]=\"fc.open.list.search\" [value]=\"fc.open.list.term\">\n }\n @if (fc.open.list) {\n <button data-mps=\"datatable\" [mpProps]=\"fc.open.list.invert\">\n {{ fc.open.list.invertText }}\n </button>\n }\n @if (fc.open.list) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.list.group\">\n @if (fc.open.list.loading) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.open.list.loading\">\n {{ fc.open.list.loadingText }}\n </span>\n }\n @for (opt of fc.open.list.options; track opt.key) {\n <label data-mps=\"datatable\" [mpProps]=\"opt.label\">\n <input data-mps=\"datatable\" [mpProps]=\"opt.input\" [checked]=\"opt.checked\">\n <span data-mps=\"datatable\">\n {{ opt.text }}\n </span>\n </label>\n }\n @if (fc.open.list.noValues) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.open.list.noValues\">\n {{ fc.open.list.noValuesText }}\n </span>\n }\n </div>\n }\n @if (fc.open.list && fc.open.list.hasMore) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.open.list.hasMore\">\n {{ fc.open.list.hasMoreText }}\n </span>\n }\n </div>\n }\n </div>\n }\n </th>\n }\n </tr>\n }\n </thead>\n <tbody data-mps=\"datatable\" [mpProps]=\"p_view.tbody\">\n @if (p_view.stateCell) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.stateRow\">\n <td data-mps=\"datatable\" [mpProps]=\"p_view.stateCell\">\n {{ p_view.stateText }}\n </td>\n </tr>\n }\n @if (p_view.spacerTop) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.spacerTop.tr\">\n <td data-mps=\"datatable\" [mpProps]=\"p_view.spacerTop.td\" [style]=\"p_view.spacerTop.style\"></td>\n </tr>\n }\n @for (r of p_view.rows; track r.key) {\n <tr data-mps=\"datatable\" [mpProps]=\"r.tr\">\n @if (r.chevronCell) {\n <td data-mps=\"datatable\" [mpProps]=\"r.chevronCell\" [style]=\"r.chevronStyle\">\n @if (r.chevron) {\n <button data-mps=\"datatable\" [mpProps]=\"r.chevron\">\n {{ r.chevronText }}\n </button>\n }\n </td>\n }\n @if (r.checkCell) {\n <td data-mps=\"datatable\" [mpProps]=\"r.checkCell\">\n @if (r.check) {\n <input data-mps=\"datatable\" [mpProps]=\"r.check\" [checked]=\"r.checked\" [indeterminate]=\"r.indeterminate\">\n }\n </td>\n }\n @if (r.placeholder) {\n <td data-mps=\"datatable\" [mpProps]=\"r.placeholder\">\n \u2026\n </td>\n } @else {\n @if (slots().row; as slot_row) {\n <ng-container [ngTemplateOutlet]=\"slot_row\" [ngTemplateOutletContext]=\"{ $implicit: { row: r.row, rowIndex: r.rowIndex, ctx: r.ctx }, row: r.row, rowIndex: r.rowIndex, ctx: r.ctx }\" />\n } @else {\n @for (c of r.cells; track c.key) {\n <td data-mps=\"datatable\" [mpProps]=\"c.td\">\n @if (slots().cell; as slot_cell) {\n <ng-container [ngTemplateOutlet]=\"slot_cell\" [ngTemplateOutletContext]=\"{ $implicit: { row: r.row, column: c.column, rowIndex: r.rowIndex }, row: r.row, column: c.column, rowIndex: r.rowIndex }\" />\n } @else {\n {{ c.text }}\n }\n </td>\n }\n }\n }\n </tr>\n }\n @if (p_view.spacerBottom) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.spacerBottom.tr\">\n <td data-mps=\"datatable\" [mpProps]=\"p_view.spacerBottom.td\" [style]=\"p_view.spacerBottom.style\"></td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n @if (p_view.footer) {\n <div data-mps=\"datatable\" [mpProps]=\"p_view.footer\">\n @for (p of p_view.pagers; track p.key) {\n <nav data-mps=\"datatable\" [mpProps]=\"p.nav\">\n <ul data-mps=\"datatable\" [mpProps]=\"p.list\">\n @for (e of p.entries; track e.key) {\n <li data-mps=\"datatable\" [mpProps]=\"e.item\">\n @if (e.gap) {\n <span data-mps=\"datatable\" [mpProps]=\"e.link\">\n {{ e.text }}\n </span>\n } @else if (e.anchor) {\n <a data-mps=\"datatable\" [mpProps]=\"e.link\" [attr.href]=\"e.href\">\n {{ e.text }}\n </a>\n } @else {\n <button data-mps=\"datatable\" [mpProps]=\"e.link\">\n {{ e.text }}\n </button>\n }\n </li>\n }\n </ul>\n </nav>\n }\n </div>\n }\n</div>\n<div data-mps=\"datatable\" [mpProps]=\"p_view.resizePanel\">\n <div data-mps=\"datatable\" [mpProps]=\"p_view.resizeSteps\">\n <button data-mps=\"datatable\" [mpProps]=\"p_view.narrower\">\n <span data-mps=\"datatable\" [mpProps]=\"p_view.stepGlyph\">\n \u2212\n </span>\n </button>\n <output data-mps=\"datatable\" [mpProps]=\"p_view.widthOutput\">\n {{ p_view.widthText }}\n </output>\n <button data-mps=\"datatable\" [mpProps]=\"p_view.wider\">\n <span data-mps=\"datatable\" [mpProps]=\"p_view.stepGlyph\">\n +\n </span>\n </button>\n </div>\n <button data-mps=\"datatable\" [mpProps]=\"p_view.fit\">\n {{ p_view.labels.fitColumn }}\n </button>\n <button data-mps=\"datatable\" [mpProps]=\"p_view.reset\">\n {{ p_view.labels.resetColumn }}\n </button>\n</div>\n", dependencies: [{ kind: "directive", type: MpPropsDirective, selector: "[mpProps]", inputs: ["mpProps"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
785
194
|
}
|
|
786
195
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableComponent, decorators: [{
|
|
787
196
|
type: Component,
|
|
788
|
-
args: [{ selector: 'bs-datatable', imports: [BsForwardAriaDirective], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
789
|
-
|
|
790
|
-
}, template: "<mp-datatable bsForwardAria\n #datatable\n class=\"bs-datatable\"\n (mp-datatable-sort-change)=\"onSortChange($event)\"\n (mp-datatable-selection-change)=\"onSelectionChange($event)\"\n (mp-datatable-page-change)=\"onPageChange($event)\"\n (mp-datatable-per-page-change)=\"onPerPageChange($event)\"\n (mp-datatable-row-click)=\"onRowClick($event)\"\n (mp-datatable-row-dblclick)=\"onRowDblClick($event)\"\n (mp-datatable-row-contextmenu)=\"onRowContextMenu($event)\"\n (mp-datatable-row-expand)=\"onRowExpand($event)\"\n (mp-datatable-row-collapse)=\"onRowCollapse($event)\"\n (mp-datatable-expanded-ids-change)=\"onExpandedIdsChange($event)\"\n (mp-datatable-filter-change)=\"onFilterChange($event)\"\n></mp-datatable>\n", styles: [":host{display:block;width:100%}:host(.bs-datatable-fill){height:100%}.bs-datatable{display:block;width:100%}\n"] }]
|
|
791
|
-
}], ctorParameters: () => [], propDecorators: { columnsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], fetch: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetch", required: false }] }], distincts: [{ type: i0.Input, args: [{ isSignal: true, alias: "distincts", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: false }] }, { type: i0.Output, args: ["settingsChange"] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], rowLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowLabel", required: false }] }], resizableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizableColumns", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], itemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSize", required: false }] }], virtualBuffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualBuffer", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], isResponsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isResponsive", required: false }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], rowDblClick: [{ type: i0.Output, args: ["rowDblClick"] }], rowContextMenu: [{ type: i0.Output, args: ["rowContextMenu"] }], tree: [{ type: i0.Input, args: [{ isSignal: true, alias: "tree", required: false }] }], idKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "idKey", required: false }] }], childCountKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "childCountKey", required: false }] }], treeIndent: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeIndent", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], selectionStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionStrategy", required: false }] }], rowExpand: [{ type: i0.Output, args: ["rowExpand"] }], rowCollapse: [{ type: i0.Output, args: ["rowCollapse"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], datatableRef: [{ type: i0.ViewChild, args: ['datatable', { isSignal: true }] }], columnDirectives: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BsDatatableColumnDirective), { isSignal: true }] }], rowTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsRowTemplateDirective), { isSignal: true }] }] } });
|
|
792
|
-
function setsEqual(a, b) {
|
|
793
|
-
// In SSR the WC isn't upgraded yet, so reading `el.expandedIds` returns
|
|
794
|
-
// `undefined` instead of the getter's `new Set()`. Treat both-missing as
|
|
795
|
-
// equal so the sync effect short-circuits cleanly during pre-hydration.
|
|
796
|
-
if (a == null && b == null)
|
|
797
|
-
return true;
|
|
798
|
-
if (a == null || b == null)
|
|
799
|
-
return false;
|
|
800
|
-
const aSize = a instanceof Set ? a.size : a.length;
|
|
801
|
-
const bSize = b instanceof Set ? b.size : b.length;
|
|
802
|
-
if (aSize !== bSize)
|
|
803
|
-
return false;
|
|
804
|
-
const bSet = b instanceof Set ? b : new Set(b);
|
|
805
|
-
for (const v of a)
|
|
806
|
-
if (!bSet.has(v))
|
|
807
|
-
return false;
|
|
808
|
-
return true;
|
|
809
|
-
}
|
|
197
|
+
args: [{ selector: 'bs-datatable', imports: [MpPropsDirective, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- GENERATED from libs/mintplayer-ui-core/datatable/src/templates/datatable.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"datatable\" [mpProps]=\"p_view.live\">\n {{ p_view.announcement }}\n</div>\n<div data-mps=\"datatable\" [mpProps]=\"p_view.shell\">\n <div data-mps=\"datatable\" [mpProps]=\"p_view.scroll\">\n <table data-mps=\"datatable\" [mpProps]=\"p_view.table\" [style]=\"p_view.tableStyle\">\n @if (p_view.caption) {\n <caption data-mps=\"datatable\" [mpProps]=\"p_view.captionBag\">\n {{ p_view.caption }}\n </caption>\n }\n <thead data-mps=\"datatable\" [mpProps]=\"p_view.thead\">\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.headerRow\">\n @if (p_view.chevronHeader) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.chevronHeader\"></th>\n }\n @if (p_view.checkHeader) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.checkHeader\">\n <input data-mps=\"datatable\" [mpProps]=\"p_view.deselectAll\" [checked]=\"false\" [indeterminate]=\"p_view.anySelected\">\n </th>\n }\n @for (h of p_view.headers; track h.key) {\n <th data-mps=\"datatable\" [mpProps]=\"h.th\" [style]=\"h.style\">\n @if (h.sortHref) {\n <a data-mps=\"datatable\" [mpProps]=\"h.sort\" [attr.href]=\"h.sortHref\">\n <span data-mps=\"datatable\" [mpProps]=\"h.text\">\n @if (slots().header; as slot_header) {\n <ng-container [ngTemplateOutlet]=\"slot_header\" [ngTemplateOutletContext]=\"{ $implicit: { column: h.column }, column: h.column }\" />\n } @else {\n {{ h.label }}\n }\n </span>\n @if (h.sortIndex) {\n <span data-mps=\"datatable\" [mpProps]=\"h.sortIndex\">\n {{ h.sortIndexText }}\n </span>\n }\n </a>\n } @else if (h.sortable) {\n <button data-mps=\"datatable\" [mpProps]=\"h.sort\">\n <span data-mps=\"datatable\" [mpProps]=\"h.text\">\n @if (slots().header; as slot_header) {\n <ng-container [ngTemplateOutlet]=\"slot_header\" [ngTemplateOutletContext]=\"{ $implicit: { column: h.column }, column: h.column }\" />\n } @else {\n {{ h.label }}\n }\n </span>\n @if (h.sortIndex) {\n <span data-mps=\"datatable\" [mpProps]=\"h.sortIndex\">\n {{ h.sortIndexText }}\n </span>\n }\n </button>\n } @else {\n <span data-mps=\"datatable\" [mpProps]=\"h.plain\">\n <span data-mps=\"datatable\" [mpProps]=\"h.text\">\n @if (slots().header; as slot_header) {\n <ng-container [ngTemplateOutlet]=\"slot_header\" [ngTemplateOutletContext]=\"{ $implicit: { column: h.column }, column: h.column }\" />\n } @else {\n {{ h.label }}\n }\n </span>\n </span>\n }\n @if (h.resize) {\n <span data-mps=\"datatable\" [mpProps]=\"h.resize\"></span>\n }\n </th>\n }\n </tr>\n @if (p_view.filterRow) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.filterRow\">\n @if (p_view.filterChevronCell) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.filterChevronCell\"></th>\n }\n @if (p_view.filterCheckCell) {\n <th data-mps=\"datatable\" [mpProps]=\"p_view.filterCheckCell\"></th>\n }\n @for (fc of p_view.filterCells; track fc.key) {\n <th data-mps=\"datatable\" [mpProps]=\"fc.th\">\n @if (fc.trigger) {\n <button data-mps=\"datatable\" [mpProps]=\"fc.trigger\">\n <svg data-mps=\"datatable\" [mpProps]=\"fc.icon\">\n <path data-mps=\"datatable\" [mpProps]=\"fc.path\"></path>\n </svg>\n @if (fc.summary) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.summary\">\n {{ fc.summaryText }}\n </span>\n }\n </button>\n }\n @if (fc.panel) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.panel\">\n @if (fc.open && fc.open.custom) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.body\">\n @if (slots().filter; as slot_filter) {\n <ng-container [ngTemplateOutlet]=\"slot_filter\" [ngTemplateOutletContext]=\"{ $implicit: { column: fc.open.column, ctx: fc.open.ctx }, column: fc.open.column, ctx: fc.open.ctx }\" />\n }\n </div>\n } @else if (fc.open) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.body\">\n <button data-mps=\"datatable\" [mpProps]=\"fc.open.clear\">\n {{ fc.open.clearText }}\n </button>\n @if (fc.open.comparison) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.wrap\">\n <select data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.operator\">\n @for (op of fc.open.comparison.operators; track op.key) {\n <option data-mps=\"datatable\" [mpProps]=\"op.option\">\n {{ op.text }}\n </option>\n }\n </select>\n <input data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.operand\" [value]=\"fc.open.comparison.operandText\">\n </div>\n }\n @if (fc.open.comparison && fc.open.comparison.applied) {\n <small data-mps=\"datatable\" [mpProps]=\"fc.open.comparison.applied\">\n {{ fc.open.comparison.appliedText }}\n </small>\n }\n @if (fc.open.list) {\n <input data-mps=\"datatable\" [mpProps]=\"fc.open.list.search\" [value]=\"fc.open.list.term\">\n }\n @if (fc.open.list) {\n <button data-mps=\"datatable\" [mpProps]=\"fc.open.list.invert\">\n {{ fc.open.list.invertText }}\n </button>\n }\n @if (fc.open.list) {\n <div data-mps=\"datatable\" [mpProps]=\"fc.open.list.group\">\n @if (fc.open.list.loading) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.open.list.loading\">\n {{ fc.open.list.loadingText }}\n </span>\n }\n @for (opt of fc.open.list.options; track opt.key) {\n <label data-mps=\"datatable\" [mpProps]=\"opt.label\">\n <input data-mps=\"datatable\" [mpProps]=\"opt.input\" [checked]=\"opt.checked\">\n <span data-mps=\"datatable\">\n {{ opt.text }}\n </span>\n </label>\n }\n @if (fc.open.list.noValues) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.open.list.noValues\">\n {{ fc.open.list.noValuesText }}\n </span>\n }\n </div>\n }\n @if (fc.open.list && fc.open.list.hasMore) {\n <span data-mps=\"datatable\" [mpProps]=\"fc.open.list.hasMore\">\n {{ fc.open.list.hasMoreText }}\n </span>\n }\n </div>\n }\n </div>\n }\n </th>\n }\n </tr>\n }\n </thead>\n <tbody data-mps=\"datatable\" [mpProps]=\"p_view.tbody\">\n @if (p_view.stateCell) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.stateRow\">\n <td data-mps=\"datatable\" [mpProps]=\"p_view.stateCell\">\n {{ p_view.stateText }}\n </td>\n </tr>\n }\n @if (p_view.spacerTop) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.spacerTop.tr\">\n <td data-mps=\"datatable\" [mpProps]=\"p_view.spacerTop.td\" [style]=\"p_view.spacerTop.style\"></td>\n </tr>\n }\n @for (r of p_view.rows; track r.key) {\n <tr data-mps=\"datatable\" [mpProps]=\"r.tr\">\n @if (r.chevronCell) {\n <td data-mps=\"datatable\" [mpProps]=\"r.chevronCell\" [style]=\"r.chevronStyle\">\n @if (r.chevron) {\n <button data-mps=\"datatable\" [mpProps]=\"r.chevron\">\n {{ r.chevronText }}\n </button>\n }\n </td>\n }\n @if (r.checkCell) {\n <td data-mps=\"datatable\" [mpProps]=\"r.checkCell\">\n @if (r.check) {\n <input data-mps=\"datatable\" [mpProps]=\"r.check\" [checked]=\"r.checked\" [indeterminate]=\"r.indeterminate\">\n }\n </td>\n }\n @if (r.placeholder) {\n <td data-mps=\"datatable\" [mpProps]=\"r.placeholder\">\n \u2026\n </td>\n } @else {\n @if (slots().row; as slot_row) {\n <ng-container [ngTemplateOutlet]=\"slot_row\" [ngTemplateOutletContext]=\"{ $implicit: { row: r.row, rowIndex: r.rowIndex, ctx: r.ctx }, row: r.row, rowIndex: r.rowIndex, ctx: r.ctx }\" />\n } @else {\n @for (c of r.cells; track c.key) {\n <td data-mps=\"datatable\" [mpProps]=\"c.td\">\n @if (slots().cell; as slot_cell) {\n <ng-container [ngTemplateOutlet]=\"slot_cell\" [ngTemplateOutletContext]=\"{ $implicit: { row: r.row, column: c.column, rowIndex: r.rowIndex }, row: r.row, column: c.column, rowIndex: r.rowIndex }\" />\n } @else {\n {{ c.text }}\n }\n </td>\n }\n }\n }\n </tr>\n }\n @if (p_view.spacerBottom) {\n <tr data-mps=\"datatable\" [mpProps]=\"p_view.spacerBottom.tr\">\n <td data-mps=\"datatable\" [mpProps]=\"p_view.spacerBottom.td\" [style]=\"p_view.spacerBottom.style\"></td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n @if (p_view.footer) {\n <div data-mps=\"datatable\" [mpProps]=\"p_view.footer\">\n @for (p of p_view.pagers; track p.key) {\n <nav data-mps=\"datatable\" [mpProps]=\"p.nav\">\n <ul data-mps=\"datatable\" [mpProps]=\"p.list\">\n @for (e of p.entries; track e.key) {\n <li data-mps=\"datatable\" [mpProps]=\"e.item\">\n @if (e.gap) {\n <span data-mps=\"datatable\" [mpProps]=\"e.link\">\n {{ e.text }}\n </span>\n } @else if (e.anchor) {\n <a data-mps=\"datatable\" [mpProps]=\"e.link\" [attr.href]=\"e.href\">\n {{ e.text }}\n </a>\n } @else {\n <button data-mps=\"datatable\" [mpProps]=\"e.link\">\n {{ e.text }}\n </button>\n }\n </li>\n }\n </ul>\n </nav>\n }\n </div>\n }\n</div>\n<div data-mps=\"datatable\" [mpProps]=\"p_view.resizePanel\">\n <div data-mps=\"datatable\" [mpProps]=\"p_view.resizeSteps\">\n <button data-mps=\"datatable\" [mpProps]=\"p_view.narrower\">\n <span data-mps=\"datatable\" [mpProps]=\"p_view.stepGlyph\">\n \u2212\n </span>\n </button>\n <output data-mps=\"datatable\" [mpProps]=\"p_view.widthOutput\">\n {{ p_view.widthText }}\n </output>\n <button data-mps=\"datatable\" [mpProps]=\"p_view.wider\">\n <span data-mps=\"datatable\" [mpProps]=\"p_view.stepGlyph\">\n +\n </span>\n </button>\n </div>\n <button data-mps=\"datatable\" [mpProps]=\"p_view.fit\">\n {{ p_view.labels.fitColumn }}\n </button>\n <button data-mps=\"datatable\" [mpProps]=\"p_view.reset\">\n {{ p_view.labels.resetColumn }}\n </button>\n</div>\n" }]
|
|
198
|
+
}], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], fetch: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetch", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], inputLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputLabel", required: false }] }], sortColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortColumns", required: false }] }, { type: i0.Output, args: ["sortColumnsChange"] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], perPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "perPage", required: false }] }, { type: i0.Output, args: ["perPageChange"] }], perPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "perPageOptions", required: false }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: false }] }], autoSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoSort", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }, { type: i0.Output, args: ["selectedIdsChange"] }], cutIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "cutIds", required: false }] }], focusedRowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusedRowKey", required: false }] }], rowLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowLabel", required: false }] }], rowKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKey", required: false }] }], tree: [{ type: i0.Input, args: [{ isSignal: true, alias: "tree", required: false }] }], idKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "idKey", required: false }] }], childCountKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "childCountKey", required: false }] }], treeIndent: [{ type: i0.Input, args: [{ isSignal: true, alias: "treeIndent", required: false }] }], expandedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedIds", required: false }] }, { type: i0.Output, args: ["expandedIdsChange"] }], selectionStrategy: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionStrategy", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], itemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSize", required: false }] }], virtualBuffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualBuffer", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], resizableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizableColumns", required: false }] }], hrefFor: [{ type: i0.Input, args: [{ isSignal: true, alias: "hrefFor", required: false }] }], distincts: [{ type: i0.Input, args: [{ isSignal: true, alias: "distincts", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }, { type: i0.Output, args: ["filtersChange"] }], fetchParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetchParams", required: false }] }], stateKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateKey", required: false }] }], sortcolumnschange: [{ type: i0.Output, args: ["sortcolumnschange"] }], pagechange: [{ type: i0.Output, args: ["pagechange"] }], perpagechange: [{ type: i0.Output, args: ["perpagechange"] }], selectedidschange: [{ type: i0.Output, args: ["selectedidschange"] }], expandedidschange: [{ type: i0.Output, args: ["expandedidschange"] }], rowclick: [{ type: i0.Output, args: ["rowclick"] }], rowdblclick: [{ type: i0.Output, args: ["rowdblclick"] }], rowcontextmenu: [{ type: i0.Output, args: ["rowcontextmenu"] }], selectionchanged: [{ type: i0.Output, args: ["selectionchanged"] }], rowexpand: [{ type: i0.Output, args: ["rowexpand"] }], rowcollapse: [{ type: i0.Output, args: ["rowcollapse"] }], loaderror: [{ type: i0.Output, args: ["loaderror"] }], filterschange: [{ type: i0.Output, args: ["filterschange"] }], headerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDatatableHeaderDirective), { isSignal: true }] }], cellSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDatatableCellDirective), { isSignal: true }] }], rowSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDatatableRowDirective), { isSignal: true }] }], filterSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsDatatableFilterDirective), { isSignal: true }] }] } });
|
|
810
199
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
* ```html
|
|
815
|
-
* <div *bsDatatableColumn="'country'; filterable: true">
|
|
816
|
-
* Country
|
|
817
|
-
* <ng-container *bsDatatableFilterPanel="let values">
|
|
818
|
-
* <my-panel [values]="values()"></my-panel>
|
|
819
|
-
* </ng-container>
|
|
820
|
-
* </div>
|
|
821
|
-
* ```
|
|
822
|
-
*
|
|
823
|
-
* Nested inside the column rather than a sibling keyed by name: the column is
|
|
824
|
-
* the thing being configured, and a name-keyed sibling has no way to fail loudly
|
|
825
|
-
* when the two names drift apart. It is also the pattern every other per-item
|
|
826
|
-
* override in this workspace uses.
|
|
827
|
-
*
|
|
828
|
-
* Omitting it is not a lesser option — the web component renders a built-in
|
|
829
|
-
* panel (search, include/exclude, checkbox list, clear) which React and Vue get
|
|
830
|
-
* for free. This directive is for the cases that need something else.
|
|
831
|
-
*
|
|
832
|
-
* ### Inputs on the column, not here
|
|
833
|
-
*
|
|
834
|
-
* `filterable`, `filterActive`, `filterSummary` and `filterSelection` are inputs
|
|
835
|
-
* on `*bsDatatableColumn`. They cannot live here: this directive's own inputs
|
|
836
|
-
* are not yet set when its constructor runs, and the constructor is the only
|
|
837
|
-
* point at which it can register itself with the column early enough.
|
|
838
|
-
*/
|
|
839
|
-
class BsDatatableFilterPanelDirective {
|
|
840
|
-
constructor() {
|
|
841
|
-
this.column = inject(BsDatatableColumnDirective);
|
|
842
|
-
this.templateRef = inject(TemplateRef);
|
|
843
|
-
// A plain field assignment, deliberately. See the field's own comment on
|
|
844
|
-
// `BsDatatableColumnDirective`: a signal write here is NG0600.
|
|
845
|
-
this.column.filterPanelTemplate = this.templateRef;
|
|
846
|
-
inject(DestroyRef).onDestroy(() => {
|
|
847
|
-
// Guarded: under `@if`, the incoming directive's constructor can run
|
|
848
|
-
// before the outgoing one's destroy hook, and an unguarded clear would
|
|
849
|
-
// erase the template that just replaced this one.
|
|
850
|
-
if (this.column.filterPanelTemplate === this.templateRef) {
|
|
851
|
-
this.column.filterPanelTemplate = undefined;
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
}
|
|
855
|
-
/**
|
|
856
|
-
* Lets `let values = $implicit` and `let ctx = ctx` type-check against the
|
|
857
|
-
* real context. Without it both are `any`, so `values().anything.deeper`
|
|
858
|
-
* compiles and fails at runtime.
|
|
859
|
-
*/
|
|
860
|
-
static ngTemplateContextGuard(_dir, _ctx) {
|
|
861
|
-
return true;
|
|
862
|
-
}
|
|
863
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableFilterPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
864
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDatatableFilterPanelDirective, isStandalone: true, selector: "[bsDatatableFilterPanel]", ngImport: i0 }); }
|
|
865
|
-
}
|
|
866
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableFilterPanelDirective, decorators: [{
|
|
867
|
-
type: Directive,
|
|
868
|
-
args: [{ selector: '[bsDatatableFilterPanel]' }]
|
|
869
|
-
}], ctorParameters: () => [] });
|
|
200
|
+
// GENERATED from the datatable manifest by @mintplayer/nx-component-compiler. Do not edit.
|
|
201
|
+
|
|
202
|
+
// The datatable is generated from @mintplayer/ui-core/datatable (PRD #437 D10).
|
|
870
203
|
|
|
871
204
|
/**
|
|
872
205
|
* Generated bundle index. Do not edit.
|
|
873
206
|
*/
|
|
874
207
|
|
|
875
|
-
export {
|
|
208
|
+
export { BsDatatableCellDirective, BsDatatableComponent, BsDatatableFilterDirective, BsDatatableHeaderDirective, BsDatatableRowDirective };
|
|
876
209
|
//# sourceMappingURL=mintplayer-ng-bootstrap-datatable.mjs.map
|