@mintplayer/ng-bootstrap 22.27.0 → 22.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/_bootstrap.scss +4 -101
  2. package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +62 -30
  3. package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
  4. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +71 -64
  5. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
  6. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +50 -46
  7. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
  8. package/fesm2022/mintplayer-ng-bootstrap-card.mjs +65 -94
  9. package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
  10. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +122 -97
  11. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
  12. package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs +80 -133
  13. package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs.map +1 -1
  14. package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs +31 -19
  15. package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs.map +1 -1
  16. package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs +41 -46
  17. package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs.map +1 -1
  18. package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs +76 -37
  19. package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs.map +1 -1
  20. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +37 -82
  21. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
  22. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +1 -1
  23. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
  24. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +150 -813
  25. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
  26. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +172 -118
  27. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
  28. package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs +180 -142
  29. package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs.map +1 -1
  30. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +66 -116
  31. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
  32. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +41 -46
  33. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
  34. package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs +80 -204
  35. package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs.map +1 -1
  36. package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +2 -2
  37. package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
  38. package/fesm2022/mintplayer-ng-bootstrap-form.mjs +2 -2
  39. package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
  40. package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +32 -17
  41. package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
  42. package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +220 -20
  43. package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -1
  44. package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs +98 -129
  45. package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs.map +1 -1
  46. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +144 -265
  47. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
  48. package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs +133 -217
  49. package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs.map +1 -1
  50. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +46 -25
  51. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
  52. package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs +166 -93
  53. package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs.map +1 -1
  54. package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs +148 -231
  55. package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs.map +1 -1
  56. package/fesm2022/mintplayer-ng-bootstrap-radio.mjs +133 -94
  57. package/fesm2022/mintplayer-ng-bootstrap-radio.mjs.map +1 -1
  58. package/fesm2022/mintplayer-ng-bootstrap-range.mjs +2 -2
  59. package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
  60. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +76 -7
  61. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
  62. package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs +766 -812
  63. package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs.map +1 -1
  64. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +206 -180
  65. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
  66. package/fesm2022/mintplayer-ng-bootstrap-select.mjs +202 -141
  67. package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
  68. package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +113 -59
  69. package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
  70. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +133 -76
  71. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
  72. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +60 -87
  73. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
  74. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +86 -83
  75. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
  76. package/fesm2022/mintplayer-ng-bootstrap-table.mjs +1 -2
  77. package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
  78. package/fesm2022/mintplayer-ng-bootstrap-theming.mjs +38 -34
  79. package/fesm2022/mintplayer-ng-bootstrap-theming.mjs.map +1 -1
  80. package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs +177 -147
  81. package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs.map +1 -1
  82. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +200 -94
  83. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
  84. package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs +186 -233
  85. package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs.map +1 -1
  86. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +58 -136
  87. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
  88. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +22 -16
  89. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
  90. package/package.json +11 -9
  91. package/types/mintplayer-ng-bootstrap-a11y.d.ts +40 -21
  92. package/types/mintplayer-ng-bootstrap-accordion.d.ts +36 -33
  93. package/types/mintplayer-ng-bootstrap-calendar.d.ts +39 -16
  94. package/types/mintplayer-ng-bootstrap-card.d.ts +25 -33
  95. package/types/mintplayer-ng-bootstrap-carousel.d.ts +70 -55
  96. package/types/mintplayer-ng-bootstrap-charts-hierarchy.d.ts +65 -45
  97. package/types/mintplayer-ng-bootstrap-charts-sparkline.d.ts +12 -3
  98. package/types/mintplayer-ng-bootstrap-charts-trend.d.ts +34 -19
  99. package/types/mintplayer-ng-bootstrap-checkbox.d.ts +34 -8
  100. package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +32 -59
  101. package/types/mintplayer-ng-bootstrap-datatable.d.ts +217 -416
  102. package/types/mintplayer-ng-bootstrap-datepicker.d.ts +77 -29
  103. package/types/mintplayer-ng-bootstrap-datetime-picker.d.ts +83 -51
  104. package/types/mintplayer-ng-bootstrap-dock.d.ts +57 -38
  105. package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +25 -30
  106. package/types/mintplayer-ng-bootstrap-file-manager.d.ts +61 -81
  107. package/types/mintplayer-ng-bootstrap-input-group.d.ts +17 -12
  108. package/types/mintplayer-ng-bootstrap-machine.d.ts +112 -4
  109. package/types/mintplayer-ng-bootstrap-multi-range.d.ts +53 -27
  110. package/types/mintplayer-ng-bootstrap-navbar.d.ts +88 -164
  111. package/types/mintplayer-ng-bootstrap-otp-input.d.ts +63 -30
  112. package/types/mintplayer-ng-bootstrap-pagination.d.ts +23 -7
  113. package/types/mintplayer-ng-bootstrap-phone-input.d.ts +77 -47
  114. package/types/mintplayer-ng-bootstrap-query-builder.d.ts +95 -98
  115. package/types/mintplayer-ng-bootstrap-radio.d.ts +68 -35
  116. package/types/mintplayer-ng-bootstrap-rating.d.ts +27 -2
  117. package/types/mintplayer-ng-bootstrap-ribbon.d.ts +546 -220
  118. package/types/mintplayer-ng-bootstrap-scheduler.d.ts +82 -197
  119. package/types/mintplayer-ng-bootstrap-select.d.ts +113 -53
  120. package/types/mintplayer-ng-bootstrap-shell.d.ts +59 -33
  121. package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +63 -27
  122. package/types/mintplayer-ng-bootstrap-splitter.d.ts +45 -56
  123. package/types/mintplayer-ng-bootstrap-tab-control.d.ts +47 -26
  124. package/types/mintplayer-ng-bootstrap-table.d.ts +1 -2
  125. package/types/mintplayer-ng-bootstrap-theming.d.ts +19 -18
  126. package/types/mintplayer-ng-bootstrap-timeline.d.ts +287 -117
  127. package/types/mintplayer-ng-bootstrap-timepicker.d.ts +100 -27
  128. package/types/mintplayer-ng-bootstrap-tree-select.d.ts +188 -94
  129. package/types/mintplayer-ng-bootstrap-treeview.d.ts +74 -59
  130. package/types/mintplayer-ng-bootstrap-typeahead.d.ts +3 -0
  131. package/src/styles/utilities/cursor.scss +0 -12
  132. package/src/styles/utilities/overflow.scss +0 -12
  133. package/src/styles/utilities/white-space.scss +0 -12
  134. package/src/styles/utilities/width.scss +0 -14
@@ -1,865 +1,202 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, TemplateRef, input, Directive, PLATFORM_ID, ViewContainerRef, DestroyRef, model, output, viewChild, contentChildren, contentChild, computed, signal, effect, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
3
- import { isPlatformServer } from '@angular/common';
4
- export { computeNextSort } from '@mintplayer/web-components/datatable';
5
- import { BsForwardAriaDirective } from '@mintplayer/ng-bootstrap/a11y';
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
- class DatatableSettings {
8
- constructor(data) {
9
- this.sortColumns = [];
10
- this.pageNumberOfBoxes = 11;
11
- Object.assign(this, data);
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
- toPagination() {
34
- const res = {
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
- * Declares a column in `<bs-datatable>`.
45
- *
46
- * - `bsDatatableColumn` (the directive value) is the **data property name** —
47
- * it must match the field key on each row in the fetched data and is what
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 { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
104
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: BsDatatableColumnDirective, isStandalone: true, selector: "[bsDatatableColumn]", inputs: { name: { classPropertyName: "name", publicName: "bsDatatableColumn", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "bsDatatableColumnSortable", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "bsDatatableColumnLabel", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "bsDatatableColumnResizable", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "bsDatatableColumnFilterable", isSignal: true, isRequired: false, transformFunction: null }, filterActive: { classPropertyName: "filterActive", publicName: "bsDatatableColumnFilterActive", isSignal: true, isRequired: false, transformFunction: null }, filterSummary: { classPropertyName: "filterSummary", publicName: "bsDatatableColumnFilterSummary", isSignal: true, isRequired: false, transformFunction: null }, filterSelection: { classPropertyName: "filterSelection", publicName: "bsDatatableColumnFilterSelection", isSignal: true, isRequired: false, transformFunction: null }, filterMode: { classPropertyName: "filterMode", publicName: "bsDatatableColumnFilterMode", isSignal: true, isRequired: false, transformFunction: null }, filterInputType: { classPropertyName: "filterInputType", publicName: "bsDatatableColumnFilterInputType", isSignal: true, isRequired: false, transformFunction: null }, filterOperators: { classPropertyName: "filterOperators", publicName: "bsDatatableColumnFilterOperators", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
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: BsDatatableColumnDirective, decorators: [{
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableCellDirective, decorators: [{
107
36
  type: Directive,
108
- args: [{ selector: '[bsDatatableColumn]' }]
109
- }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumn", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnSortable", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnLabel", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnResizable", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnFilterable", required: false }] }], filterActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnFilterActive", required: false }] }], filterSummary: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnFilterSummary", required: false }] }], filterSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnFilterSelection", required: false }] }], filterMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnFilterMode", required: false }] }], filterInputType: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnFilterInputType", required: false }] }], filterOperators: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsDatatableColumnFilterOperators", required: false }] }] } });
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: BsRowTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
142
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsRowTemplateDirective, isStandalone: true, selector: "[bsRowTemplate]", ngImport: i0 }); }
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: BsRowTemplateDirective, decorators: [{
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableRowDirective, decorators: [{
145
51
  type: Directive,
146
- args: [{ selector: '[bsRowTemplate]' }]
52
+ args: [{ selector: '[bsDatatableRow]' }]
147
53
  }] });
148
- class BsRowTemplateContext {
54
+ /** The `filter` slot of `<bs-datatable>`: `<ng-template bsDatatableFilter>` or `*bsDatatableFilter`. */
55
+ class BsDatatableFilterDirective {
149
56
  constructor() {
150
- this.$implicit = undefined;
151
- /** 0 for roots; +1 per nesting level. Always 0 in flat mode. */
152
- this.depth = 0;
153
- /** True when the row is currently expanded. Always false in flat mode. */
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);
157
58
  }
59
+ static ngTemplateContextGuard(_dir, ctx) {
60
+ return true;
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`.
76
+ * An `aria-label` names the table.
77
+ */
160
78
  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
- }
79
+ #core;
196
80
  constructor() {
197
- this.platformId = inject(PLATFORM_ID);
198
- this.vcr = inject(ViewContainerRef);
199
- this.destroyRef = inject(DestroyRef);
200
- /**
201
- * Programmatic column list. Mutually exclusive with the `*bsDatatableColumn`
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 */
81
+ /** The host element. */
82
+ this.elementRef = inject(ElementRef);
83
+ this.columns = input([], /* @ts-ignore */
84
+ ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
85
+ this.data = input([], /* @ts-ignore */
214
86
  ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
215
- /** Async data loader (server-side pagination). Mutually exclusive with `[data]`. */
216
87
  this.fetch = input(null, /* @ts-ignore */
217
88
  ...(ngDevMode ? [{ debugName: "fetch" }] : /* istanbul ignore next */ []));
218
- /**
219
- * Source of distinct values for the filter panels.
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. */
89
+ this.caption = input(null, /* @ts-ignore */
90
+ ...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
230
91
  this.labels = input(null, /* @ts-ignore */
231
92
  ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
232
- /** Two-way bound pagination / sort settings. */
233
- this.settings = model(new DatatableSettings(), /* @ts-ignore */
234
- ...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
235
- /**
236
- * - `'none'` (default): no selection, no checkbox column.
237
- * - `'single'`: a row click selects that one row.
238
- * - `'multiple'`: a row click selects (Ctrl/Shift extend it), plus a checkbox column.
239
- * - `'checkbox'`: multi-select through the checkbox column only; a row click
240
- * just opens the row (`rowClick`), it never changes the selection.
241
- */
93
+ this.inputLabel = input(null, /* @ts-ignore */
94
+ ...(ngDevMode ? [{ debugName: "inputLabel" }] : /* istanbul ignore next */ []));
95
+ this.sortColumns = model([], /* @ts-ignore */
96
+ ...(ngDevMode ? [{ debugName: "sortColumns" }] : /* istanbul ignore next */ []));
97
+ this.page = model(1, /* @ts-ignore */
98
+ ...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
99
+ this.perPage = model(20, /* @ts-ignore */
100
+ ...(ngDevMode ? [{ debugName: "perPage" }] : /* istanbul ignore next */ []));
101
+ this.perPageOptions = input([10, 20, 50], /* @ts-ignore */
102
+ ...(ngDevMode ? [{ debugName: "perPageOptions" }] : /* istanbul ignore next */ []));
103
+ this.pagination = input(false, { ...(ngDevMode ? { debugName: "pagination" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
104
+ this.autoSort = input(true, { ...(ngDevMode ? { debugName: "autoSort" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
242
105
  this.selectionMode = input('none', /* @ts-ignore */
243
106
  ...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
244
- /** @deprecated Use `selectionMode`. Kept for source-level compatibility. */
245
- this.selectable = input(undefined, /* @ts-ignore */
246
- ...(ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []));
247
- /**
248
- * Two-way bound array of selected rows. Identity is `rowKey`: two row
249
- * objects with the same key are the same selection entry.
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
- */
107
+ this.selectedIds = model([], /* @ts-ignore */
108
+ ...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
109
+ this.cutIds = input([], /* @ts-ignore */
110
+ ...(ngDevMode ? [{ debugName: "cutIds" }] : /* istanbul ignore next */ []));
111
+ this.focusedRowKey = input(null, /* @ts-ignore */
112
+ ...(ngDevMode ? [{ debugName: "focusedRowKey" }] : /* istanbul ignore next */ []));
282
113
  this.rowLabel = input(null, /* @ts-ignore */
283
114
  ...(ngDevMode ? [{ debugName: "rowLabel" }] : /* istanbul ignore next */ []));
284
- /** Drag-resize column widths. Default `true`. */
285
- this.resizableColumns = input(true, /* @ts-ignore */
286
- ...(ngDevMode ? [{ debugName: "resizableColumns" }] : /* istanbul ignore next */ []));
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
- /** Forwarded to the inner table (legacy responsive flag, currently a CSS hook). */
300
- this.isResponsive = input(false, /* @ts-ignore */
301
- ...(ngDevMode ? [{ debugName: "isResponsive" }] : /* istanbul ignore next */ []));
302
- /** Emitted on row single-click. */
303
- this.rowClick = output();
304
- /** Emitted on row double-click. */
305
- this.rowDblClick = output();
306
- /** Emitted on row context-menu. */
307
- this.rowContextMenu = output();
308
- // ─── Tree-mode inputs / models / outputs ─────────────────────────────────
309
- /** Enable tree mode (chevron column, nested expansion, lazy children). */
310
- this.tree = input(false, /* @ts-ignore */
311
- ...(ngDevMode ? [{ debugName: "tree" }] : /* istanbul ignore next */ []));
312
- /**
313
- * Property name (or function) that extracts the row's stable identity.
314
- * Required when `tree=true`. Used as the expansion key and as the
315
- * `parentId` value the WC sends in `mp-datatable-fetch-request`.
316
- */
115
+ this.rowKey = input(null, /* @ts-ignore */
116
+ ...(ngDevMode ? [{ debugName: "rowKey" }] : /* istanbul ignore next */ []));
117
+ this.tree = input(false, { ...(ngDevMode ? { debugName: "tree" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
317
118
  this.idKey = input(null, /* @ts-ignore */
318
119
  ...(ngDevMode ? [{ debugName: "idKey" }] : /* istanbul ignore next */ []));
319
- /**
320
- * Property name on the row holding the direct-child count. Drives chevron
321
- * visibility AND placeholder reservation for lazy children. Required when
322
- * `tree=true`.
323
- */
324
120
  this.childCountKey = input(null, /* @ts-ignore */
325
121
  ...(ngDevMode ? [{ debugName: "childCountKey" }] : /* istanbul ignore next */ []));
326
- /** Indent in rem per depth level on the chevron cell. Default `1.25`. */
327
- this.treeIndent = input(1.25, /* @ts-ignore */
328
- ...(ngDevMode ? [{ debugName: "treeIndent" }] : /* istanbul ignore next */ []));
329
- /** Two-way bound set of expanded-row ids (keyed by `idKey`). */
330
- this.expandedIds = model(new Set(), /* @ts-ignore */
122
+ this.treeIndent = input(1.25, { ...(ngDevMode ? { debugName: "treeIndent" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
123
+ this.expandedIds = model([], /* @ts-ignore */
331
124
  ...(ngDevMode ? [{ debugName: "expandedIds" }] : /* istanbul ignore next */ []));
332
- /**
333
- * `'flat'` (default) leaves selection to per-row toggles; `'cascading'`
334
- * (recommended in tree mode) propagates a parent toggle to all loaded
335
- * descendants and surfaces an indeterminate state on partially-selected
336
- * parents.
337
- */
338
125
  this.selectionStrategy = input('flat', /* @ts-ignore */
339
126
  ...(ngDevMode ? [{ debugName: "selectionStrategy" }] : /* istanbul ignore next */ []));
340
- /** Emitted after a row is expanded. */
341
- this.rowExpand = output();
342
- /** Emitted after a row is collapsed. */
343
- this.rowCollapse = output();
344
- /**
345
- * Emitted whenever a column's filter selection changes, including when it is
346
- * cleared (`selected: []`).
347
- *
348
- * The component does not filter `[data]`: acting on this — and setting
349
- * `filterActive` / `filterSummary` back on the column — is the consumer's job,
350
- * because only they know whether the filter is client-side or a new query.
351
- */
352
- this.filterChange = output();
353
- this.datatableRef = viewChild.required('datatable', /* @ts-ignore */
354
- ...(ngDevMode ? [{ debugName: "datatableRef" }] : /* istanbul ignore next */ []));
355
- /** Column directives (header template + sortable). Wrapper-level discovery. */
356
- this.columnDirectives = contentChildren(BsDatatableColumnDirective, /* @ts-ignore */
357
- ...(ngDevMode ? [{ debugName: "columnDirectives" }] : /* istanbul ignore next */ []));
358
- /** Optional row template. When present, drives a per-row EmbeddedView render path. */
359
- this.rowTemplate = contentChild((BsRowTemplateDirective), /* @ts-ignore */
360
- ...(ngDevMode ? [{ debugName: "rowTemplate" }] : /* istanbul ignore next */ []));
361
- /**
362
- * Merged column defs:
363
- * - `[columns]` if provided
364
- * - else the `*bsDatatableColumn` directives mapped onto column defs whose
365
- * `headerRenderer` returns a DOM node produced from the directive's template.
366
- */
367
- this.effectiveColumns = computed(() => {
368
- const programmatic = this.columnsInput();
369
- if (programmatic && programmatic.length)
370
- return programmatic;
371
- // Every recompute builds fresh closures with fresh views, so the previous
372
- // generation is dead the moment we return. Without retiring them they
373
- // accumulated until the component was destroyed — harmless-looking with one
374
- // view per column, twice as bad now that filters add a second.
375
- //
376
- // Retired, not destroyed: see `retireTemplateViews`. Destroying here is
377
- // NG0600.
378
- this.retireTemplateViews();
379
- return this.columnDirectives().map((dir) => {
380
- let headerView;
381
- let filterView;
382
- let filterValues;
383
- return {
384
- name: dir.name(),
385
- label: dir.label(),
386
- sortable: dir.sortable(),
387
- resizable: dir.resizable(),
388
- filterable: dir.filterable(),
389
- filterActive: dir.filterActive(),
390
- filterSummary: dir.filterSummary(),
391
- filterSelection: dir.filterSelection(),
392
- filterMode: dir.filterMode(),
393
- filterInputType: dir.filterInputType(),
394
- filterOperators: dir.filterOperators(),
395
- headerRenderer: () => {
396
- if (!headerView) {
397
- headerView = this.vcr.createEmbeddedView(dir.templateRef);
398
- this.headerViews.push(headerView);
399
- }
400
- headerView.detectChanges();
401
- const nodes = headerView.rootNodes.filter((n) => n instanceof Node);
402
- if (nodes.length === 0)
403
- return '';
404
- if (nodes.length === 1)
405
- return nodes[0];
406
- const frag = document.createDocumentFragment();
407
- for (const n of nodes)
408
- frag.appendChild(n);
409
- return frag;
410
- },
411
- // Installed UNCONDITIONALLY, and the nested template is resolved inside
412
- // it rather than out here.
413
- //
414
- // `dir.filterPanelTemplate` is assigned by the nested directive's
415
- // constructor, which does not run until the column's header view is
416
- // created — too late for this computed's first evaluation. Reading it
417
- // here would see `undefined` for every column and no override would ever
418
- // appear. Creating the header view eagerly to force it is worse: the
419
- // insertion dirties Angular's query signals inside a reactive read, and
420
- // that throws NG0600 as soon as the host declares any `viewChild`.
421
- //
422
- // Returning `null` means "use the built-in panel", so a column with no
423
- // override costs nothing.
424
- filterRenderer: (_col, ctx) => {
425
- const tpl = dir.filterPanelTemplate;
426
- if (!tpl)
427
- return null;
428
- if (!filterView || !filterValues) {
429
- // The context is a signal because the demos and specs are zoneless:
430
- // mutating a context object notifies nothing, so the override would
431
- // never repaint as values load.
432
- filterValues = signal(ctx.values());
433
- filterView = this.vcr.createEmbeddedView(tpl, { $implicit: filterValues, ctx });
434
- this.filterViews.push(filterView);
435
- const values = filterValues;
436
- this.filterUnsubscribes.push(ctx.onChange(() => values.set(ctx.values())));
437
- }
438
- filterView.detectChanges();
439
- const nodes = filterView.rootNodes.filter((n) => n instanceof Node);
440
- if (nodes.length === 1)
441
- return nodes[0];
442
- const frag = document.createDocumentFragment();
443
- for (const n of nodes)
444
- frag.appendChild(n);
445
- return frag;
446
- },
447
- };
448
- });
449
- }, /* @ts-ignore */
450
- ...(ngDevMode ? [{ debugName: "effectiveColumns" }] : /* istanbul ignore next */ []));
451
- /** EmbeddedViews for header templates (one per column directive). */
452
- this.headerViews = [];
453
- /** EmbeddedViews for filter panel templates (one per overriding column). */
454
- this.filterViews = [];
455
- /** `FilterContext.onChange` unsubscribes, one per live filter view. */
456
- this.filterUnsubscribes = [];
457
- /** The previous generation, awaiting disposal by the columns effect. */
458
- this.staleViews = [];
459
- /** EmbeddedViews for row templates, keyed by rowKey for reuse. */
460
- this.rowViews = new Map();
461
- /** The selection model the wrapper last built from a WC event (echo guard). */
462
- this.lastEmittedSelection = null;
463
- this.destroyRef.onDestroy(() => {
464
- // Deliberately does NOT destroy the views. Every one of them is attached
465
- // to this component's ViewContainerRef, so Angular tears them down with
466
- // the host view; destroying them again from a cleanup hook re-enters that
467
- // teardown and desynchronises the container's view bookkeeping — a hard
468
- // "attached view should be in the same position within its container"
469
- // assertion in dev mode. It only surfaces once a header template contains
470
- // a nested structural directive, which `*bsDatatableFilterPanel` is, so
471
- // the previous code looked correct right up until it was not.
472
- //
473
- // The subscriptions are the only thing here Angular knows nothing about.
474
- this.releaseFilterSubscriptions();
475
- this.headerViews = [];
476
- this.filterViews = [];
477
- this.staleViews = [];
478
- this.rowViews.clear();
479
- });
480
- // Same server guard as `fetch`: the source is a network call in every real
481
- // consumer, and a panel cannot be opened during SSR anyway.
482
- effect(() => {
483
- const el = this.datatableRef().nativeElement;
484
- if (isPlatformServer(this.platformId))
485
- return;
486
- el.distincts = this.distincts();
487
- });
488
- effect(() => {
489
- const el = this.datatableRef().nativeElement;
490
- el.labels = this.labels() ?? undefined;
491
- });
492
- // Forward columns to the WC, and dispose the generation the recompute
493
- // retired. An effect may write signals; a computed may not, which is the
494
- // whole reason the disposal happens out here.
495
- effect(() => {
496
- const columns = this.effectiveColumns();
497
- this.disposeStaleViews();
498
- const el = this.datatableRef().nativeElement;
499
- el.columns = columns;
500
- });
501
- // Static `[data]` only. When `[fetch]` is set the WC owns the rows, so the
502
- // wrapper must not also push `el.data` (it would clobber fetched pages).
503
- effect(() => {
504
- const el = this.datatableRef().nativeElement;
505
- if (this.fetch())
506
- return;
507
- const d = this.data();
508
- el.data = (d ?? []);
509
- });
510
- // Forward `[fetch]` and the paging/sort settings as ONE change (#407). The
511
- // WC owns the entire server-paged loop (initial page, on-demand windows,
512
- // tree children, pagination, sort/perPage reloads) and derives
513
- // `totalRecords` from the response; the wrapper runs no fetch loop.
514
- // Assigning fetch, sort, page and perPage through separate setters (they
515
- // used to live in two effects) could split across ticks and cost two
516
- // requests; `applyFetchState` schedules exactly one.
517
- //
518
- // This effect must never read `selection`: a selection change would then
519
- // re-run it, and with an inline `[fetch]` closure that is a request.
520
- effect(() => {
521
- const el = this.datatableRef().nativeElement;
522
- const settings = this.settings();
523
- const fetch = this.fetch();
524
- const virtual = this.virtualScroll();
525
- const sortColumns = settings.sortColumns.map((c) => ({ property: c.property, direction: c.direction }));
526
- if (isPlatformServer(this.platformId)) {
527
- // No fetch on the server (SSR must not kick off a client request), and
528
- // the element may not be upgraded there, so no method calls either.
529
- el.sortColumns = sortColumns;
530
- el.page = settings.page.selected;
531
- el.perPage = settings.perPage.selected;
532
- }
533
- else {
534
- el.applyFetchState({
535
- fetch: fetch ?? null,
536
- sortColumns,
537
- perPage: settings.perPage.selected,
538
- page: settings.page.selected,
539
- });
540
- }
541
- el.autoSort = !fetch;
542
- // Pagination renders in non-virtual mode; in fetch mode the wrapper
543
- // owns page state and the WC just reports the change via event.
544
- el.pagination = this.pagination() && !virtual;
545
- el.perPageOptions = settings.perPage.values;
546
- });
547
- effect(() => {
548
- const el = this.datatableRef().nativeElement;
549
- const mode = this.selectable() ?? this.selectionMode();
550
- el.selectionMode = mode;
551
- });
552
- effect(() => {
553
- const el = this.datatableRef().nativeElement;
554
- el.rowKey = (row, index) => this.rowKey()(row, index);
555
- });
556
- effect(() => {
557
- const el = this.datatableRef().nativeElement;
558
- const label = this.rowLabel();
559
- el.rowLabel = label ? (row) => label(row) : null;
560
- });
561
- effect(() => {
562
- const el = this.datatableRef().nativeElement;
563
- el.resizableColumns = this.resizableColumns();
564
- });
565
- effect(() => {
566
- const el = this.datatableRef().nativeElement;
567
- el.virtualScroll = this.virtualScroll();
568
- el.itemSize = this.itemSize();
569
- el.virtualBuffer = this.virtualBuffer();
570
- });
571
- // Tree-mode prop sync to the WC.
572
- effect(() => {
573
- const el = this.datatableRef().nativeElement;
574
- el.tree = this.tree();
575
- el.idKey = this.idKey();
576
- el.childCountKey = this.childCountKey();
577
- el.treeIndent = this.treeIndent();
578
- el.selectionStrategy = this.selectionStrategy();
579
- });
580
- // Two-way bind `expandedIds` to the WC. Skip-on-echo via structural equality
581
- // — the WC's getter returns a fresh Set on every read.
582
- effect(() => {
583
- const desired = this.expandedIds();
584
- const el = this.datatableRef().nativeElement;
585
- const current = el.expandedIds;
586
- if (setsEqual(current, desired))
587
- return;
588
- el.expandedIds = desired;
589
- });
590
- // Wire the row renderer when *bsRowTemplate is provided.
591
- effect(() => {
592
- const el = this.datatableRef().nativeElement;
593
- const tpl = this.rowTemplate();
594
- // Row views cached for a previous template would keep rendering ITS cells: drop them.
595
- [...this.rowViews.values()].map((v) => v.destroy());
596
- this.rowViews.clear();
597
- el.rowRenderer = tpl ? this.buildRowRenderer(tpl) : undefined;
598
- });
599
- // Selection model → WC. Rows are pushed, not keys, so the element
600
- // remembers host-supplied rows that are not loaded (and derives the keys
601
- // itself, from the row's position in its data — not from the row's index
602
- // in this array, which was K3).
603
- //
604
- // Echo guard (spike S2). The `selectedRows` setter REPLACES the selection.
605
- // A model built from an event can legitimately lack a key the element
606
- // still holds (a key that has never had a row, D3), so pushing that model
607
- // back would silently DROP the key. Two checks keep that from happening:
608
- // 1. The model the wrapper itself just built from an event is not pushed
609
- // back — compared by reference. The guard covers that IMMEDIATE echo
610
- // only: the first other value clears it, so a host that clears the
611
- // selection and later restores the earlier array (cancel, error) is
612
- // pushed like any other write.
613
- // 2. Anything else with the element's key set is pushed only when some
614
- // row differs (`!==`) from the row the element holds for its key: a
615
- // host's fresher object (a new etag) must reach the element, or its
616
- // next event would report the stale one. Equal key sets mean no
617
- // row-less key can be lost by that push; an identical model is skipped.
618
- // The setter emits no event and this effect writes no signal, so there is
619
- // no loop either way.
620
- effect(() => {
621
- const el = this.datatableRef().nativeElement;
622
- const rows = this.selection();
623
- const keyFn = this.rowKey();
624
- if (rows === this.lastEmittedSelection)
625
- return;
626
- this.lastEmittedSelection = null;
627
- const current = el.selectedIds ?? [];
628
- const currentRows = el.selectedRows ?? [];
629
- const keyOf = this.selectionKeyLookup(keyFn, current, currentRows);
630
- const keys = rows.map(keyOf);
631
- const next = new Set(keys);
632
- const sameKeys = next.size === current.length && current.every((k) => next.has(k));
633
- if (sameKeys) {
634
- const elementRow = new Map(current.map((k, i) => [k, currentRows[i]]));
635
- if (rows.every((row, i) => elementRow.get(keys[i]) === row))
636
- return;
637
- }
638
- el.selectedRows = rows;
639
- });
640
- }
641
- /**
642
- * Keys a selection-model row the way the element would: a row the element
643
- * currently reports keeps the key it reports it under; any other row gets
644
- * `rowKey(row, -1)`, which is what the element uses for a row that is not
645
- * in its loaded data.
646
- */
647
- selectionKeyLookup(keyFn, ids, rows) {
648
- const known = new Map(rows.flatMap((row, i) => (row === undefined ? [] : [[row, ids[i]]])));
649
- return (row) => known.get(row) ?? keyFn(row, -1);
650
- }
651
- /**
652
- * Re-queries `[fetch]` for the current sort, page and page size, e.g. after
653
- * the server data changed. The selection is kept. `resetPage: true` also
654
- * returns to page 1. A no-op on the server and without `[fetch]`.
655
- */
656
- reload(options) {
657
- if (isPlatformServer(this.platformId))
658
- return;
659
- this.datatableRef().nativeElement.reload(options);
660
- }
661
- buildRowRenderer(tpl) {
662
- return (row, rowIndex, ctx) => {
663
- // Placeholder rows (tree-mode, children pending fetch) get a synthetic key
664
- // so the view is reused per slot. Consumers detect them via `isPlaceholder`.
665
- const isPlaceholder = ctx?.isPlaceholder ?? row === undefined;
666
- const depth = ctx?.depth ?? 0;
667
- const isExpanded = ctx?.isExpanded ?? false;
668
- const key = isPlaceholder
669
- ? `__placeholder-${rowIndex}`
670
- : this.rowKey()(row, rowIndex);
671
- let viewRef = this.rowViews.get(key);
672
- if (!viewRef) {
673
- const context = new BsRowTemplateContext();
674
- context.$implicit = row;
675
- context.index = rowIndex;
676
- context.depth = depth;
677
- context.isExpanded = isExpanded;
678
- context.isPlaceholder = isPlaceholder;
679
- viewRef = this.vcr.createEmbeddedView(tpl.templateRef, context);
680
- this.rowViews.set(key, viewRef);
681
- }
682
- else {
683
- viewRef.context.$implicit = row;
684
- viewRef.context.index = rowIndex;
685
- viewRef.context.depth = depth;
686
- viewRef.context.isExpanded = isExpanded;
687
- viewRef.context.isPlaceholder = isPlaceholder;
688
- }
689
- viewRef.detectChanges();
690
- const nodes = viewRef.rootNodes.filter((n) => n instanceof Node);
691
- return nodes;
692
- };
693
- }
694
- // ─── WC event handlers ───────────────────────────────────────────────────
695
- onSortChange(event) {
696
- const detail = event.detail;
697
- const settings = this.settings();
698
- this.settings.set(new DatatableSettings({
699
- ...settings,
700
- sortColumns: detail.sortColumns,
701
- page: { ...settings.page, selected: 1 },
702
- }));
703
- }
704
- onSelectionChange(event) {
705
- const detail = event.detail;
706
- // `selectedIds` is authoritative; `selectedRows` is index-aligned with it,
707
- // with `undefined` for a key whose row the element has never seen (D3/D5).
708
- // Such a key falls back to the row the model already held for it, and is
709
- // otherwise left out of the model — it stays selected in the element,
710
- // which is why the selection effect's echo guard never pushes it back.
711
- const keyFn = this.rowKey();
712
- const previous = new Map(this.selection().map((row) => [keyFn(row, -1), row]));
713
- const next = detail.selectedIds.flatMap((id, i) => {
714
- const row = detail.selectedRows[i] ?? previous.get(id);
715
- return row === undefined ? [] : [row];
716
- });
717
- this.lastEmittedSelection = next;
718
- this.selection.set(next);
719
- }
720
- onPageChange(event) {
721
- const detail = event.detail;
722
- const settings = this.settings();
723
- this.settings.set(new DatatableSettings({
724
- ...settings,
725
- page: { ...settings.page, selected: detail.page },
726
- }));
727
- }
728
- onPerPageChange(event) {
729
- const detail = event.detail;
730
- const settings = this.settings();
731
- this.settings.set(new DatatableSettings({
732
- ...settings,
733
- perPage: { ...settings.perPage, selected: detail.perPage },
734
- page: { ...settings.page, selected: 1 },
735
- }));
736
- }
737
- onRowClick(event) {
738
- this.rowClick.emit(this.toBsEvent(event));
739
- }
740
- onRowDblClick(event) {
741
- this.rowDblClick.emit(this.toBsEvent(event));
742
- }
743
- onRowContextMenu(event) {
744
- this.rowContextMenu.emit(this.toBsEvent(event));
745
- }
746
- // ─── Tree-mode event handlers ────────────────────────────────────────────
747
- onRowExpand(event) {
748
- const detail = event.detail;
749
- this.rowExpand.emit({ row: detail.row, depth: detail.depth, parentId: detail.parentId });
750
- }
751
- onRowCollapse(event) {
752
- const detail = event.detail;
753
- this.rowCollapse.emit({ row: detail.row, depth: detail.depth, parentId: detail.parentId });
754
- }
755
- onExpandedIdsChange(event) {
756
- const detail = event.detail;
757
- const next = new Set(detail.expandedIds);
758
- if (setsEqual(this.expandedIds(), next))
759
- return;
760
- this.expandedIds.set(next);
761
- }
762
- onFilterChange(event) {
763
- this.filterChange.emit(event.detail);
764
- }
765
- toBsEvent(event) {
766
- const detail = event.detail;
767
- return {
768
- row: detail.row,
769
- rowIndex: detail.rowIndex,
770
- rowKey: detail.rowKey,
771
- originalEvent: detail.originalEvent,
772
- };
127
+ this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
128
+ this.emptyMessage = input('No data', /* @ts-ignore */
129
+ ...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
130
+ this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
131
+ this.itemSize = input(40, { ...(ngDevMode ? { debugName: "itemSize" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
132
+ this.virtualBuffer = input(10, { ...(ngDevMode ? { debugName: "virtualBuffer" } : /* istanbul ignore next */ {}), transform: (v) => numberAttribute(v) });
133
+ this.fill = input(false, { ...(ngDevMode ? { debugName: "fill" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
134
+ this.resizableColumns = input(true, { ...(ngDevMode ? { debugName: "resizableColumns" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
135
+ this.hrefFor = input(null, /* @ts-ignore */
136
+ ...(ngDevMode ? [{ debugName: "hrefFor" }] : /* istanbul ignore next */ []));
137
+ this.distincts = input(null, /* @ts-ignore */
138
+ ...(ngDevMode ? [{ debugName: "distincts" }] : /* istanbul ignore next */ []));
139
+ /** The sort, after the user changed it. */
140
+ this.sortcolumnschange = output();
141
+ /** The page, after the user changed it. */
142
+ this.pagechange = output();
143
+ /** The page size, after the user changed it. */
144
+ this.perpagechange = output();
145
+ /** The selected row keys, after the user changed them. */
146
+ this.selectedidschange = output();
147
+ /** The expanded row ids, after the user changed them. */
148
+ this.expandedidschange = output();
149
+ /** A row was clicked, or opened with Enter. */
150
+ this.rowclick = output();
151
+ /** A row was double-clicked. */
152
+ this.rowdblclick = output();
153
+ /** A row's context menu; `originalEvent.preventDefault()` suppresses the browser's. */
154
+ this.rowcontextmenu = output();
155
+ /** The user changed the selection: the keys and their rows. */
156
+ this.selectionchanged = output();
157
+ /** A tree row expanded. */
158
+ this.rowexpand = output();
159
+ /** A tree row collapsed. */
160
+ this.rowcollapse = output();
161
+ /** A `fetch` call rejected. */
162
+ this.loaderror = output();
163
+ /** A column's filter changed; the consumer decides which rows it removes. */
164
+ this.filterchange = output();
165
+ this.headerSlot = contentChild(BsDatatableHeaderDirective, /* @ts-ignore */
166
+ ...(ngDevMode ? [{ debugName: "headerSlot" }] : /* istanbul ignore next */ []));
167
+ this.cellSlot = contentChild(BsDatatableCellDirective, /* @ts-ignore */
168
+ ...(ngDevMode ? [{ debugName: "cellSlot" }] : /* istanbul ignore next */ []));
169
+ this.rowSlot = contentChild(BsDatatableRowDirective, /* @ts-ignore */
170
+ ...(ngDevMode ? [{ debugName: "rowSlot" }] : /* istanbul ignore next */ []));
171
+ this.filterSlot = contentChild(BsDatatableFilterDirective, /* @ts-ignore */
172
+ ...(ngDevMode ? [{ debugName: "filterSlot" }] : /* istanbul ignore next */ []));
173
+ /** The template's named slots. */
174
+ this.slots = computed(() => ({ header: this.headerSlot()?.templateRef, cell: this.cellSlot()?.templateRef, row: this.rowSlot()?.templateRef, filter: this.filterSlot()?.templateRef }), /* @ts-ignore */
175
+ ...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
176
+ 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() }), 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, filterChange: this.filterchange }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'datatable' }), models: { sortColumns: this.sortColumns, page: this.page, perPage: this.perPage, selectedIds: this.selectedIds, expandedIds: this.expandedIds } });
177
+ /** The template's props. */
178
+ this.props = this.#core.props;
179
+ useScopedStyles('datatable', datatableScopedStyles);
180
+ }
181
+ /** Re-query `fetch` for the current sort, page and page size; `{ resetPage: true }` also returns to page 1. */
182
+ reload(...args) {
183
+ return this.#core.call('reload', args);
773
184
  }
774
185
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
775
- 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 }, 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" }, 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%}.bs-datatable{display:block;width:100%}\n"], dependencies: [{ kind: "directive", type: BsForwardAriaDirective, selector: "[bsForwardAria]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
186
+ 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 } }, outputs: { sortColumns: "sortColumnsChange", page: "pageChange", perPage: "perPageChange", selectedIds: "selectedIdsChange", expandedIds: "expandedIdsChange", sortcolumnschange: "sortcolumnschange", pagechange: "pagechange", perpagechange: "perpagechange", selectedidschange: "selectedidschange", expandedidschange: "expandedidschange", rowclick: "rowclick", rowdblclick: "rowdblclick", rowcontextmenu: "rowcontextmenu", selectionchanged: "selectionchanged", rowexpand: "rowexpand", rowcollapse: "rowcollapse", loaderror: "loaderror", filterchange: "filterchange" }, 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.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 }); }
776
187
  }
777
188
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableComponent, decorators: [{
778
189
  type: Component,
779
- args: [{ selector: 'bs-datatable', imports: [BsForwardAriaDirective], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, 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%}.bs-datatable{display:block;width:100%}\n"] }]
780
- }], 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 }] }], 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 }] }] } });
781
- function setsEqual(a, b) {
782
- // In SSR the WC isn't upgraded yet, so reading `el.expandedIds` returns
783
- // `undefined` instead of the getter's `new Set()`. Treat both-missing as
784
- // equal so the sync effect short-circuits cleanly during pre-hydration.
785
- if (a == null && b == null)
786
- return true;
787
- if (a == null || b == null)
788
- return false;
789
- const aSize = a instanceof Set ? a.size : a.length;
790
- const bSize = b instanceof Set ? b.size : b.length;
791
- if (aSize !== bSize)
792
- return false;
793
- const bSet = b instanceof Set ? b : new Set(b);
794
- for (const v of a)
795
- if (!bSet.has(v))
796
- return false;
797
- return true;
798
- }
190
+ 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.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" }]
191
+ }], 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 }] }], 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"] }], filterchange: [{ type: i0.Output, args: ["filterchange"] }], 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 }] }] } });
799
192
 
800
- /**
801
- * Overrides the filter panel of the column it is nested in.
802
- *
803
- * ```html
804
- * <div *bsDatatableColumn="'country'; filterable: true">
805
- * Country
806
- * <ng-container *bsDatatableFilterPanel="let values">
807
- * <my-panel [values]="values()"></my-panel>
808
- * </ng-container>
809
- * </div>
810
- * ```
811
- *
812
- * Nested inside the column rather than a sibling keyed by name: the column is
813
- * the thing being configured, and a name-keyed sibling has no way to fail loudly
814
- * when the two names drift apart. It is also the pattern every other per-item
815
- * override in this workspace uses.
816
- *
817
- * Omitting it is not a lesser option — the web component renders a built-in
818
- * panel (search, include/exclude, checkbox list, clear) which React and Vue get
819
- * for free. This directive is for the cases that need something else.
820
- *
821
- * ### Inputs on the column, not here
822
- *
823
- * `filterable`, `filterActive`, `filterSummary` and `filterSelection` are inputs
824
- * on `*bsDatatableColumn`. They cannot live here: this directive's own inputs
825
- * are not yet set when its constructor runs, and the constructor is the only
826
- * point at which it can register itself with the column early enough.
827
- */
828
- class BsDatatableFilterPanelDirective {
829
- constructor() {
830
- this.column = inject(BsDatatableColumnDirective);
831
- this.templateRef = inject(TemplateRef);
832
- // A plain field assignment, deliberately. See the field's own comment on
833
- // `BsDatatableColumnDirective`: a signal write here is NG0600.
834
- this.column.filterPanelTemplate = this.templateRef;
835
- inject(DestroyRef).onDestroy(() => {
836
- // Guarded: under `@if`, the incoming directive's constructor can run
837
- // before the outgoing one's destroy hook, and an unguarded clear would
838
- // erase the template that just replaced this one.
839
- if (this.column.filterPanelTemplate === this.templateRef) {
840
- this.column.filterPanelTemplate = undefined;
841
- }
842
- });
843
- }
844
- /**
845
- * Lets `let values = $implicit` and `let ctx = ctx` type-check against the
846
- * real context. Without it both are `any`, so `values().anything.deeper`
847
- * compiles and fails at runtime.
848
- */
849
- static ngTemplateContextGuard(_dir, _ctx) {
850
- return true;
851
- }
852
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableFilterPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
853
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsDatatableFilterPanelDirective, isStandalone: true, selector: "[bsDatatableFilterPanel]", ngImport: i0 }); }
854
- }
855
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsDatatableFilterPanelDirective, decorators: [{
856
- type: Directive,
857
- args: [{ selector: '[bsDatatableFilterPanel]' }]
858
- }], ctorParameters: () => [] });
193
+ // GENERATED from the datatable manifest by @mintplayer/nx-component-compiler. Do not edit.
194
+
195
+ // The datatable is generated from @mintplayer/ui-core/datatable (PRD #437 D10).
859
196
 
860
197
  /**
861
198
  * Generated bundle index. Do not edit.
862
199
  */
863
200
 
864
- export { BsDatatableColumnDirective, BsDatatableComponent, BsDatatableFilterPanelDirective, BsRowTemplateContext, BsRowTemplateDirective, DatatableSettings };
201
+ export { BsDatatableCellDirective, BsDatatableComponent, BsDatatableFilterDirective, BsDatatableHeaderDirective, BsDatatableRowDirective };
865
202
  //# sourceMappingURL=mintplayer-ng-bootstrap-datatable.mjs.map