@ng-nest/ui 20.0.6 → 20.1.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 (209) hide show
  1. package/auto-complete/index.d.ts +72 -9
  2. package/base-form/index.d.ts +3 -3
  3. package/calendar/index.d.ts +1 -2
  4. package/cascade/index.d.ts +48 -8
  5. package/checkbox/index.d.ts +4 -4
  6. package/color-picker/index.d.ts +49 -8
  7. package/core/index.d.ts +68 -6
  8. package/date-picker/index.d.ts +82 -12
  9. package/dropdown/index.d.ts +4 -4
  10. package/fesm2022/ng-nest-ui-affix.mjs +12 -12
  11. package/fesm2022/ng-nest-ui-affix.mjs.map +1 -1
  12. package/fesm2022/ng-nest-ui-alert.mjs +35 -35
  13. package/fesm2022/ng-nest-ui-alert.mjs.map +1 -1
  14. package/fesm2022/ng-nest-ui-anchor.mjs +31 -31
  15. package/fesm2022/ng-nest-ui-anchor.mjs.map +1 -1
  16. package/fesm2022/ng-nest-ui-api.mjs +7 -7
  17. package/fesm2022/ng-nest-ui-api.mjs.map +1 -1
  18. package/fesm2022/ng-nest-ui-auto-complete.mjs +108 -62
  19. package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
  20. package/fesm2022/ng-nest-ui-avatar.mjs +31 -31
  21. package/fesm2022/ng-nest-ui-avatar.mjs.map +1 -1
  22. package/fesm2022/ng-nest-ui-back-top.mjs +18 -18
  23. package/fesm2022/ng-nest-ui-back-top.mjs.map +1 -1
  24. package/fesm2022/ng-nest-ui-badge.mjs +23 -23
  25. package/fesm2022/ng-nest-ui-badge.mjs.map +1 -1
  26. package/fesm2022/ng-nest-ui-base-form.mjs +45 -45
  27. package/fesm2022/ng-nest-ui-base-form.mjs.map +1 -1
  28. package/fesm2022/ng-nest-ui-button.mjs +42 -42
  29. package/fesm2022/ng-nest-ui-button.mjs.map +1 -1
  30. package/fesm2022/ng-nest-ui-calendar.mjs +20 -20
  31. package/fesm2022/ng-nest-ui-calendar.mjs.map +1 -1
  32. package/fesm2022/ng-nest-ui-card.mjs +15 -15
  33. package/fesm2022/ng-nest-ui-card.mjs.map +1 -1
  34. package/fesm2022/ng-nest-ui-carousel.mjs +46 -46
  35. package/fesm2022/ng-nest-ui-carousel.mjs.map +1 -1
  36. package/fesm2022/ng-nest-ui-cascade.mjs +92 -76
  37. package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
  38. package/fesm2022/ng-nest-ui-checkbox.mjs +39 -39
  39. package/fesm2022/ng-nest-ui-checkbox.mjs.map +1 -1
  40. package/fesm2022/ng-nest-ui-collapse.mjs +31 -31
  41. package/fesm2022/ng-nest-ui-collapse.mjs.map +1 -1
  42. package/fesm2022/ng-nest-ui-color-picker.mjs +95 -71
  43. package/fesm2022/ng-nest-ui-color-picker.mjs.map +1 -1
  44. package/fesm2022/ng-nest-ui-color.mjs +16 -16
  45. package/fesm2022/ng-nest-ui-color.mjs.map +1 -1
  46. package/fesm2022/ng-nest-ui-comment.mjs +21 -21
  47. package/fesm2022/ng-nest-ui-comment.mjs.map +1 -1
  48. package/fesm2022/ng-nest-ui-container.mjs +37 -37
  49. package/fesm2022/ng-nest-ui-container.mjs.map +1 -1
  50. package/fesm2022/ng-nest-ui-core.mjs +38 -22
  51. package/fesm2022/ng-nest-ui-core.mjs.map +1 -1
  52. package/fesm2022/ng-nest-ui-crumb.mjs +13 -13
  53. package/fesm2022/ng-nest-ui-crumb.mjs.map +1 -1
  54. package/fesm2022/ng-nest-ui-date-picker.mjs +284 -254
  55. package/fesm2022/ng-nest-ui-date-picker.mjs.map +1 -1
  56. package/fesm2022/ng-nest-ui-description.mjs +31 -31
  57. package/fesm2022/ng-nest-ui-description.mjs.map +1 -1
  58. package/fesm2022/ng-nest-ui-dialog.mjs +81 -81
  59. package/fesm2022/ng-nest-ui-dialog.mjs.map +1 -1
  60. package/fesm2022/ng-nest-ui-doc.mjs +7 -7
  61. package/fesm2022/ng-nest-ui-doc.mjs.map +1 -1
  62. package/fesm2022/ng-nest-ui-drag.mjs +10 -10
  63. package/fesm2022/ng-nest-ui-drag.mjs.map +1 -1
  64. package/fesm2022/ng-nest-ui-drawer.mjs +42 -42
  65. package/fesm2022/ng-nest-ui-drawer.mjs.map +1 -1
  66. package/fesm2022/ng-nest-ui-dropdown.mjs +49 -49
  67. package/fesm2022/ng-nest-ui-dropdown.mjs.map +1 -1
  68. package/fesm2022/ng-nest-ui-empty.mjs +12 -12
  69. package/fesm2022/ng-nest-ui-empty.mjs.map +1 -1
  70. package/fesm2022/ng-nest-ui-examples.mjs +7 -7
  71. package/fesm2022/ng-nest-ui-examples.mjs.map +1 -1
  72. package/fesm2022/ng-nest-ui-find.mjs +79 -77
  73. package/fesm2022/ng-nest-ui-find.mjs.map +1 -1
  74. package/fesm2022/ng-nest-ui-form.mjs +33 -33
  75. package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
  76. package/fesm2022/ng-nest-ui-highlight.mjs +20 -20
  77. package/fesm2022/ng-nest-ui-highlight.mjs.map +1 -1
  78. package/fesm2022/ng-nest-ui-i18n.mjs +15 -15
  79. package/fesm2022/ng-nest-ui-i18n.mjs.map +1 -1
  80. package/fesm2022/ng-nest-ui-icon.mjs +21 -21
  81. package/fesm2022/ng-nest-ui-icon.mjs.map +1 -1
  82. package/fesm2022/ng-nest-ui-image.mjs +39 -39
  83. package/fesm2022/ng-nest-ui-image.mjs.map +1 -1
  84. package/fesm2022/ng-nest-ui-inner.mjs +11 -11
  85. package/fesm2022/ng-nest-ui-inner.mjs.map +1 -1
  86. package/fesm2022/ng-nest-ui-input-number.mjs +47 -42
  87. package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
  88. package/fesm2022/ng-nest-ui-input.mjs +106 -80
  89. package/fesm2022/ng-nest-ui-input.mjs.map +1 -1
  90. package/fesm2022/ng-nest-ui-keyword.mjs +15 -15
  91. package/fesm2022/ng-nest-ui-keyword.mjs.map +1 -1
  92. package/fesm2022/ng-nest-ui-layout.mjs +31 -31
  93. package/fesm2022/ng-nest-ui-layout.mjs.map +1 -1
  94. package/fesm2022/ng-nest-ui-link.mjs +18 -18
  95. package/fesm2022/ng-nest-ui-link.mjs.map +1 -1
  96. package/fesm2022/ng-nest-ui-list.mjs +80 -80
  97. package/fesm2022/ng-nest-ui-list.mjs.map +1 -1
  98. package/fesm2022/ng-nest-ui-loading.mjs +22 -22
  99. package/fesm2022/ng-nest-ui-loading.mjs.map +1 -1
  100. package/fesm2022/ng-nest-ui-menu.mjs +45 -45
  101. package/fesm2022/ng-nest-ui-menu.mjs.map +1 -1
  102. package/fesm2022/ng-nest-ui-message-box.mjs +10 -10
  103. package/fesm2022/ng-nest-ui-message-box.mjs.map +1 -1
  104. package/fesm2022/ng-nest-ui-message.mjs +10 -10
  105. package/fesm2022/ng-nest-ui-message.mjs.map +1 -1
  106. package/fesm2022/ng-nest-ui-notification.mjs +10 -10
  107. package/fesm2022/ng-nest-ui-notification.mjs.map +1 -1
  108. package/fesm2022/ng-nest-ui-outlet.mjs +9 -9
  109. package/fesm2022/ng-nest-ui-outlet.mjs.map +1 -1
  110. package/fesm2022/ng-nest-ui-page-header.mjs +15 -15
  111. package/fesm2022/ng-nest-ui-page-header.mjs.map +1 -1
  112. package/fesm2022/ng-nest-ui-pagination.mjs +53 -53
  113. package/fesm2022/ng-nest-ui-pagination.mjs.map +1 -1
  114. package/fesm2022/ng-nest-ui-pattern.mjs +7 -7
  115. package/fesm2022/ng-nest-ui-pattern.mjs.map +1 -1
  116. package/fesm2022/ng-nest-ui-popconfirm.mjs +27 -27
  117. package/fesm2022/ng-nest-ui-popconfirm.mjs.map +1 -1
  118. package/fesm2022/ng-nest-ui-popover.mjs +38 -38
  119. package/fesm2022/ng-nest-ui-popover.mjs.map +1 -1
  120. package/fesm2022/ng-nest-ui-portal.mjs +7 -7
  121. package/fesm2022/ng-nest-ui-portal.mjs.map +1 -1
  122. package/fesm2022/ng-nest-ui-progress.mjs +38 -38
  123. package/fesm2022/ng-nest-ui-progress.mjs.map +1 -1
  124. package/fesm2022/ng-nest-ui-radio.mjs +36 -36
  125. package/fesm2022/ng-nest-ui-radio.mjs.map +1 -1
  126. package/fesm2022/ng-nest-ui-rate.mjs +30 -30
  127. package/fesm2022/ng-nest-ui-rate.mjs.map +1 -1
  128. package/fesm2022/ng-nest-ui-resizable.mjs +16 -16
  129. package/fesm2022/ng-nest-ui-resizable.mjs.map +1 -1
  130. package/fesm2022/ng-nest-ui-result.mjs +16 -16
  131. package/fesm2022/ng-nest-ui-result.mjs.map +1 -1
  132. package/fesm2022/ng-nest-ui-ripple.mjs +13 -13
  133. package/fesm2022/ng-nest-ui-ripple.mjs.map +1 -1
  134. package/fesm2022/ng-nest-ui-scrollable.mjs +219 -0
  135. package/fesm2022/ng-nest-ui-scrollable.mjs.map +1 -0
  136. package/fesm2022/ng-nest-ui-select.mjs +125 -110
  137. package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
  138. package/fesm2022/ng-nest-ui-skeleton.mjs +15 -15
  139. package/fesm2022/ng-nest-ui-skeleton.mjs.map +1 -1
  140. package/fesm2022/ng-nest-ui-slider-select.mjs +54 -54
  141. package/fesm2022/ng-nest-ui-slider-select.mjs.map +1 -1
  142. package/fesm2022/ng-nest-ui-slider.mjs +39 -39
  143. package/fesm2022/ng-nest-ui-slider.mjs.map +1 -1
  144. package/fesm2022/ng-nest-ui-statistic.mjs +30 -30
  145. package/fesm2022/ng-nest-ui-statistic.mjs.map +1 -1
  146. package/fesm2022/ng-nest-ui-steps.mjs +19 -19
  147. package/fesm2022/ng-nest-ui-steps.mjs.map +1 -1
  148. package/fesm2022/ng-nest-ui-switch.mjs +26 -26
  149. package/fesm2022/ng-nest-ui-switch.mjs.map +1 -1
  150. package/fesm2022/ng-nest-ui-table-view.mjs +593 -0
  151. package/fesm2022/ng-nest-ui-table-view.mjs.map +1 -0
  152. package/fesm2022/ng-nest-ui-table.mjs +222 -222
  153. package/fesm2022/ng-nest-ui-table.mjs.map +1 -1
  154. package/fesm2022/ng-nest-ui-tabs.mjs +58 -58
  155. package/fesm2022/ng-nest-ui-tabs.mjs.map +1 -1
  156. package/fesm2022/ng-nest-ui-tag.mjs +22 -22
  157. package/fesm2022/ng-nest-ui-tag.mjs.map +1 -1
  158. package/fesm2022/ng-nest-ui-text-retract.mjs +15 -15
  159. package/fesm2022/ng-nest-ui-text-retract.mjs.map +1 -1
  160. package/fesm2022/ng-nest-ui-textarea.mjs +45 -40
  161. package/fesm2022/ng-nest-ui-textarea.mjs.map +1 -1
  162. package/fesm2022/ng-nest-ui-theme.mjs +23 -23
  163. package/fesm2022/ng-nest-ui-theme.mjs.map +1 -1
  164. package/fesm2022/ng-nest-ui-time-ago.mjs +7 -7
  165. package/fesm2022/ng-nest-ui-time-ago.mjs.map +1 -1
  166. package/fesm2022/ng-nest-ui-time-picker.mjs +113 -92
  167. package/fesm2022/ng-nest-ui-time-picker.mjs.map +1 -1
  168. package/fesm2022/ng-nest-ui-time-range.mjs +7 -7
  169. package/fesm2022/ng-nest-ui-time-range.mjs.map +1 -1
  170. package/fesm2022/ng-nest-ui-timeline.mjs +15 -15
  171. package/fesm2022/ng-nest-ui-timeline.mjs.map +1 -1
  172. package/fesm2022/ng-nest-ui-tooltip.mjs +38 -38
  173. package/fesm2022/ng-nest-ui-tooltip.mjs.map +1 -1
  174. package/fesm2022/ng-nest-ui-transfer.mjs +40 -40
  175. package/fesm2022/ng-nest-ui-transfer.mjs.map +1 -1
  176. package/fesm2022/ng-nest-ui-tree-file.mjs +28 -28
  177. package/fesm2022/ng-nest-ui-tree-file.mjs.map +1 -1
  178. package/fesm2022/ng-nest-ui-tree-select.mjs +147 -110
  179. package/fesm2022/ng-nest-ui-tree-select.mjs.map +1 -1
  180. package/fesm2022/ng-nest-ui-tree.mjs +107 -107
  181. package/fesm2022/ng-nest-ui-tree.mjs.map +1 -1
  182. package/fesm2022/ng-nest-ui-typography.mjs +13 -13
  183. package/fesm2022/ng-nest-ui-typography.mjs.map +1 -1
  184. package/fesm2022/ng-nest-ui-upload.mjs +37 -37
  185. package/fesm2022/ng-nest-ui-upload.mjs.map +1 -1
  186. package/fesm2022/ng-nest-ui.mjs +2 -0
  187. package/fesm2022/ng-nest-ui.mjs.map +1 -1
  188. package/find/index.d.ts +5 -5
  189. package/form/index.d.ts +1 -1
  190. package/index.d.ts +2 -0
  191. package/input/index.d.ts +47 -5
  192. package/input-number/index.d.ts +22 -7
  193. package/list/index.d.ts +2 -2
  194. package/message-box/index.d.ts +4 -5
  195. package/package.json +28 -20
  196. package/radio/index.d.ts +4 -4
  197. package/rate/index.d.ts +5 -5
  198. package/scrollable/index.d.ts +49 -0
  199. package/select/index.d.ts +53 -8
  200. package/slider-select/index.d.ts +3 -3
  201. package/steps/index.d.ts +1 -2
  202. package/switch/index.d.ts +3 -3
  203. package/table-view/index.d.ts +148 -0
  204. package/textarea/index.d.ts +20 -5
  205. package/theme/index.d.ts +1 -1
  206. package/time-picker/index.d.ts +53 -8
  207. package/transfer/index.d.ts +1 -1
  208. package/tree-select/index.d.ts +70 -9
  209. package/upload/index.d.ts +2 -2
@@ -0,0 +1,593 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, inject, Component, booleanAttribute, Directive, signal, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, viewChild, contentChild, contentChildren, Input, HostListener, NgModule } from '@angular/core';
3
+ import { CdkTable, CdkHeaderRowDef, CdkFooterRowDef, CdkRowDef, CdkHeaderRow, CdkCellOutlet, CdkFooterRow, CdkRow, CdkNoDataRow, HeaderRowOutlet, DataRowOutlet, NoDataRowOutlet, FooterRowOutlet, CDK_TABLE, STICKY_POSITIONING_LISTENER, CdkCellDef, CdkHeaderCellDef, CdkFooterCellDef, CdkColumnDef, CdkHeaderCell, CdkFooterCell, CdkCell, CdkTextColumn, CdkTableModule } from '@angular/cdk/table';
4
+ import { _DisposeViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY } from '@angular/cdk/collections';
5
+ import { XConfigService } from '@ng-nest/ui/core';
6
+
7
+ class XTableViewService {
8
+ constructor() {
9
+ this.selectedCells = [];
10
+ this.activedRows = [];
11
+ this.selectedHeaderCell = null;
12
+ this.activedHeaderCells = [];
13
+ this.stickyHeaderRows = [];
14
+ }
15
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewService }); }
17
+ }
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewService, decorators: [{
19
+ type: Injectable
20
+ }] });
21
+
22
+ /**
23
+ * Table view
24
+ * @selector x-table-view
25
+ * @decorator component
26
+ */
27
+ const XTableViewPrefix = 'x-table-view';
28
+ const X_TABLE_VIEW_CONFIG_NAME = 'tableView';
29
+ /**
30
+ * Table view Property
31
+ */
32
+ class XTableViewProperty extends CdkTable {
33
+ constructor() {
34
+ super(...arguments);
35
+ this.config = inject(XConfigService).getConfigForComponent(X_TABLE_VIEW_CONFIG_NAME);
36
+ }
37
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
38
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: XTableViewProperty, isStandalone: true, selector: "x-table-view-property", usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
39
+ }
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewProperty, decorators: [{
41
+ type: Component,
42
+ args: [{ selector: `${XTableViewPrefix}-property`, template: '' }]
43
+ }] });
44
+
45
+ const ROW_TEMPLATE = `<ng-container cdkCellOutlet></ng-container>`;
46
+ class XTableHeaderRowDef extends CdkHeaderRowDef {
47
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderRowDef, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
48
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.2.4", type: XTableHeaderRowDef, isStandalone: true, selector: "[xTableHeaderRowDef]", inputs: { columns: ["xTableHeaderRowDef", "columns"], sticky: ["xTableHeaderRowDefSticky", "sticky", booleanAttribute] }, providers: [{ provide: CdkHeaderRowDef, useExisting: XTableHeaderRowDef }], usesInheritance: true, ngImport: i0 }); }
49
+ }
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderRowDef, decorators: [{
51
+ type: Directive,
52
+ args: [{
53
+ selector: '[xTableHeaderRowDef]',
54
+ providers: [{ provide: CdkHeaderRowDef, useExisting: XTableHeaderRowDef }],
55
+ inputs: [
56
+ { name: 'columns', alias: 'xTableHeaderRowDef' },
57
+ { name: 'sticky', alias: 'xTableHeaderRowDefSticky', transform: booleanAttribute }
58
+ ]
59
+ }]
60
+ }] });
61
+ class XTableFooterRowDef extends CdkFooterRowDef {
62
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterRowDef, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
63
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.2.4", type: XTableFooterRowDef, isStandalone: true, selector: "[xTableFooterRowDef]", inputs: { columns: ["xTableFooterRowDef", "columns"], sticky: ["xTableFooterRowDefSticky", "sticky", booleanAttribute] }, providers: [{ provide: CdkFooterRowDef, useExisting: XTableFooterRowDef }], usesInheritance: true, ngImport: i0 }); }
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterRowDef, decorators: [{
66
+ type: Directive,
67
+ args: [{
68
+ selector: '[xTableFooterRowDef]',
69
+ providers: [{ provide: CdkFooterRowDef, useExisting: XTableFooterRowDef }],
70
+ inputs: [
71
+ { name: 'columns', alias: 'xTableFooterRowDef' },
72
+ { name: 'sticky', alias: 'xTableFooterRowDefSticky', transform: booleanAttribute }
73
+ ]
74
+ }]
75
+ }] });
76
+ class XTableViewRowDef extends CdkRowDef {
77
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewRowDef, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
78
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableViewRowDef, isStandalone: true, selector: "[xTableRowDef]", inputs: { columns: ["xTableRowDefColumns", "columns"], when: ["xTableRowDefWhen", "when"] }, providers: [{ provide: CdkRowDef, useExisting: XTableViewRowDef }], usesInheritance: true, ngImport: i0 }); }
79
+ }
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewRowDef, decorators: [{
81
+ type: Directive,
82
+ args: [{
83
+ selector: '[xTableRowDef]',
84
+ providers: [{ provide: CdkRowDef, useExisting: XTableViewRowDef }],
85
+ inputs: [
86
+ { name: 'columns', alias: 'xTableRowDefColumns' },
87
+ { name: 'when', alias: 'xTableRowDefWhen' }
88
+ ]
89
+ }]
90
+ }] });
91
+ class XTableHeaderRow extends CdkHeaderRow {
92
+ constructor() {
93
+ super(...arguments);
94
+ this.tableView = inject(XTableView, { optional: true });
95
+ this.tableViewService = inject(XTableViewService, { optional: true });
96
+ this.sticking = signal(false, ...(ngDevMode ? [{ debugName: "sticking" }] : []));
97
+ }
98
+ get isSticking() {
99
+ return this.sticking();
100
+ }
101
+ ngAfterViewInit() {
102
+ this.listenerSticky();
103
+ }
104
+ listenerSticky() {
105
+ const index = this.tableView?.headerRows().findIndex((x) => x === this);
106
+ if (index === undefined || index < 0)
107
+ return;
108
+ const rowLen = this.tableView?.headerRowRefs()?.length ?? 0;
109
+ if (rowLen === 0 || rowLen < index)
110
+ return;
111
+ const sticky = this.tableView?.headerRowRefs()[index].sticky;
112
+ if (!sticky)
113
+ return;
114
+ const sentinel = this.tableView?.sentinelTop().nativeElement;
115
+ const observer = new IntersectionObserver(([entry]) => {
116
+ const sticking = !entry.isIntersecting;
117
+ if (sticking) {
118
+ if (!this.tableViewService.stickyHeaderRows.includes(this)) {
119
+ this.tableViewService.stickyHeaderRows.push(this);
120
+ }
121
+ }
122
+ else {
123
+ if (this.tableViewService.stickyHeaderRows.includes(this)) {
124
+ this.tableViewService.stickyHeaderRows = this.tableViewService.stickyHeaderRows.filter((item) => item !== this);
125
+ }
126
+ }
127
+ this.sticking.set(sticking);
128
+ }, { threshold: 0 });
129
+ observer.observe(sentinel);
130
+ }
131
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderRow, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
132
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: XTableHeaderRow, isStandalone: true, selector: "x-table-header-row, tr[x-table-header-row]", host: { attributes: { "role": "row" }, properties: { "class.x-table-sticky-top": "this.isSticking" }, classAttribute: "x-table-header-row" }, providers: [{ provide: CdkHeaderRow, useExisting: XTableHeaderRow }], exportAs: ["xTableHeaderRow"], usesInheritance: true, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
133
+ }
134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderRow, decorators: [{
135
+ type: Component,
136
+ args: [{
137
+ selector: 'x-table-header-row, tr[x-table-header-row]',
138
+ template: ROW_TEMPLATE,
139
+ host: {
140
+ class: 'x-table-header-row',
141
+ role: 'row'
142
+ },
143
+ changeDetection: ChangeDetectionStrategy.Default,
144
+ encapsulation: ViewEncapsulation.None,
145
+ exportAs: 'xTableHeaderRow',
146
+ providers: [{ provide: CdkHeaderRow, useExisting: XTableHeaderRow }],
147
+ imports: [CdkCellOutlet]
148
+ }]
149
+ }], propDecorators: { isSticking: [{
150
+ type: HostBinding,
151
+ args: ['class.x-table-sticky-top']
152
+ }] } });
153
+ class XTableFooterRow extends CdkFooterRow {
154
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterRow, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
155
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: XTableFooterRow, isStandalone: true, selector: "x-table-footer-row, tr[x-table-footer-row]", host: { attributes: { "role": "row" }, classAttribute: "x-table-footer-row" }, providers: [{ provide: CdkFooterRow, useExisting: XTableFooterRow }], exportAs: ["xTableFooterRow"], usesInheritance: true, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
156
+ }
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterRow, decorators: [{
158
+ type: Component,
159
+ args: [{
160
+ selector: 'x-table-footer-row, tr[x-table-footer-row]',
161
+ template: ROW_TEMPLATE,
162
+ host: {
163
+ class: 'x-table-footer-row',
164
+ role: 'row'
165
+ },
166
+ changeDetection: ChangeDetectionStrategy.Default,
167
+ encapsulation: ViewEncapsulation.None,
168
+ exportAs: 'xTableFooterRow',
169
+ providers: [{ provide: CdkFooterRow, useExisting: XTableFooterRow }],
170
+ imports: [CdkCellOutlet]
171
+ }]
172
+ }] });
173
+ class XTableViewRow extends CdkRow {
174
+ constructor() {
175
+ super(...arguments);
176
+ this.tableViewService = inject(XTableViewService, { optional: true });
177
+ }
178
+ get isActived() {
179
+ return this.tableViewService.activedRows.includes(this);
180
+ }
181
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewRow, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
182
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: XTableViewRow, isStandalone: true, selector: "x-table-row, tr[x-table-row]", host: { attributes: { "role": "row" }, properties: { "class.x-table-row-actived": "this.isActived" }, classAttribute: "x-table-row" }, providers: [{ provide: CdkRow, useExisting: XTableViewRow }], exportAs: ["xTableRow"], usesInheritance: true, ngImport: i0, template: "<ng-container cdkCellOutlet></ng-container>", isInline: true, dependencies: [{ kind: "directive", type: CdkCellOutlet, selector: "[cdkCellOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
183
+ }
184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewRow, decorators: [{
185
+ type: Component,
186
+ args: [{
187
+ selector: 'x-table-row, tr[x-table-row]',
188
+ template: ROW_TEMPLATE,
189
+ host: {
190
+ class: 'x-table-row',
191
+ role: 'row'
192
+ },
193
+ changeDetection: ChangeDetectionStrategy.Default,
194
+ encapsulation: ViewEncapsulation.None,
195
+ exportAs: 'xTableRow',
196
+ providers: [{ provide: CdkRow, useExisting: XTableViewRow }],
197
+ imports: [CdkCellOutlet]
198
+ }]
199
+ }], propDecorators: { isActived: [{
200
+ type: HostBinding,
201
+ args: ['class.x-table-row-actived']
202
+ }] } });
203
+ class XTableNoDataRow extends CdkNoDataRow {
204
+ constructor() {
205
+ super(...arguments);
206
+ this._contentClassName = 'x-table-no-data-row';
207
+ }
208
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableNoDataRow, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
209
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableNoDataRow, isStandalone: true, selector: "ng-template[xTableNoDataRow]", providers: [{ provide: CdkNoDataRow, useExisting: XTableNoDataRow }], usesInheritance: true, ngImport: i0 }); }
210
+ }
211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableNoDataRow, decorators: [{
212
+ type: Directive,
213
+ args: [{
214
+ selector: 'ng-template[xTableNoDataRow]',
215
+ providers: [{ provide: CdkNoDataRow, useExisting: XTableNoDataRow }]
216
+ }]
217
+ }] });
218
+
219
+ class XTableView extends XTableViewProperty {
220
+ constructor() {
221
+ super(...arguments);
222
+ this.elementRef = inject(ElementRef);
223
+ this.sentinelTop = viewChild('sentinelTop', ...(ngDevMode ? [{ debugName: "sentinelTop" }] : []));
224
+ this.headerRowRef = contentChild(XTableHeaderRowDef, ...(ngDevMode ? [{ debugName: "headerRowRef" }] : []));
225
+ this.headerRowRefs = contentChildren(XTableHeaderRowDef, ...(ngDevMode ? [{ debugName: "headerRowRefs" }] : []));
226
+ this.headerRows = contentChildren(XTableHeaderRow, ...(ngDevMode ? [{ debugName: "headerRows" }] : []));
227
+ this.columnDefs = contentChildren(XTableColumnDef, ...(ngDevMode ? [{ debugName: "columnDefs" }] : []));
228
+ this.headerCells = contentChildren(XTableHeaderCell, ...(ngDevMode ? [{ debugName: "headerCells" }] : []));
229
+ this.cells = contentChildren(XTableViewCell, ...(ngDevMode ? [{ debugName: "cells" }] : []));
230
+ this.rows = contentChildren(XTableViewRow, ...(ngDevMode ? [{ debugName: "rows" }] : []));
231
+ /** Overrides the sticky CSS class set by the `CdkTable`. */
232
+ this.stickyCssClass = 'x-table-sticky';
233
+ /** Overrides the need to add position: sticky on every sticky cell element in `CdkTable`. */
234
+ this.needsPositionStickyOnElement = false;
235
+ }
236
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableView, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
237
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: XTableView, isStandalone: true, selector: "x-table-view, table[x-table-view]", host: { properties: { "class.x-table-fixed-layout": "fixedLayout" }, classAttribute: "x-table-view" }, providers: [
238
+ { provide: CdkTable, useExisting: XTableView },
239
+ { provide: CDK_TABLE, useExisting: XTableView },
240
+ // Prevent nested tables from seeing this table's StickyPositioningListener.
241
+ { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
242
+ { provide: STICKY_POSITIONING_LISTENER, useValue: null },
243
+ XTableViewService
244
+ ], queries: [{ propertyName: "headerRowRef", first: true, predicate: XTableHeaderRowDef, descendants: true, isSignal: true }, { propertyName: "headerRowRefs", predicate: XTableHeaderRowDef, isSignal: true }, { propertyName: "headerRows", predicate: XTableHeaderRow, isSignal: true }, { propertyName: "columnDefs", predicate: XTableColumnDef, isSignal: true }, { propertyName: "headerCells", predicate: XTableHeaderCell, isSignal: true }, { propertyName: "cells", predicate: XTableViewCell, isSignal: true }, { propertyName: "rows", predicate: XTableViewRow, isSignal: true }], viewQueries: [{ propertyName: "sentinelTop", first: true, predicate: ["sentinelTop"], descendants: true, isSignal: true }], exportAs: ["xTableView"], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"caption\" />\r\n<ng-content select=\"colgroup, col\" />\r\n\r\n<!--\r\n Unprojected content throws a hydration error so we need this to capture it.\r\n It gets removed on the client so it doesn't affect the layout.\r\n -->\r\n@if (_isServer) {\r\n <ng-content />\r\n}\r\n<div class=\"x-table-sentinel-top\" #sentinelTop></div>\r\n@if (_isNativeHtmlTable) {\r\n <thead>\r\n <ng-container headerRowOutlet />\r\n </thead>\r\n <tbody>\r\n <ng-container rowOutlet />\r\n <ng-container noDataRowOutlet />\r\n </tbody>\r\n <tfoot>\r\n <ng-container footerRowOutlet />\r\n </tfoot>\r\n} @else {\r\n <ng-container headerRowOutlet />\r\n <ng-container rowOutlet />\r\n <ng-container noDataRowOutlet />\r\n <ng-container footerRowOutlet />\r\n}\r\n", styles: [".x-table-view{margin:0;padding:0}.x-table-view{position:relative;border-collapse:separate;border-spacing:0}.x-table-view .x-table-header-cell,.x-table-view .x-table-footer-cell{padding:0 .5rem;text-align:left;font-weight:500;color:var(--x-text);border-top:var(--x-border-width) var(--x-border-style) var(--x-border);border-bottom:var(--x-border-width) var(--x-border-style) var(--x-border);border-right:var(--x-border-width) var(--x-border-style) var(--x-border);cursor:default;background-color:var(--x-background);white-space:nowrap}.x-table-view .x-table-header-cell:first-child,.x-table-view .x-table-footer-cell:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view .x-table-header-cell.x-table-header-cell-actived,.x-table-view .x-table-footer-cell.x-table-header-cell-actived{background-color:var(--x-background-a100)}.x-table-view .x-table-sticky{position:sticky;background-color:var(--x-background-a200)}.x-table-view .x-table-sentinel-top{visibility:hidden;position:absolute;top:0}.x-table-view .x-table-row-actived .x-table-cell:not(.x-table-cell-selected){background-color:var(--x-background-a100)}.x-table-view .x-table-cell{padding:0 .5rem;text-align:left;font-weight:500;color:var(--x-text);border-bottom:var(--x-border-width) var(--x-border-style) var(--x-border);border-right:var(--x-border-width) var(--x-border-style) var(--x-border);cursor:default;white-space:nowrap;background-color:var(--x-background)}.x-table-view .x-table-cell:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view .x-table-cell.x-table-cell-selected{border-color:var(--x-border-a200);background-color:var(--x-primary-900)}.x-table-view .x-table-cell.x-table-sticky:not(.x-table-cell-selected){background-color:var(--x-background-a200)}.x-table-view .x-table-sticky-border-elem-top{border-bottom-style:solid;border-bottom-width:calc(2 * var(--x-border-width));border-bottom-color:var(--x-border-a900)}.x-table-view .x-table-sticky-border-elem-bottom{border-top-style:solid;border-top-width:calc(2 * var(--x-border-width));border-top-color:var(--x-border-a900)}.x-table-view .x-table-sticky-border-elem-left{border-right-style:solid;border-right-width:calc(2 * var(--x-border-width));border-right-color:var(--x-border-a900)}.x-table-view .x-table-sticky-border-elem-right{border-left-style:solid;border-left-width:calc(2 * var(--x-border-width));border-left-color:var(--x-border-a900)}\n"], dependencies: [{ kind: "directive", type: HeaderRowOutlet, selector: "[headerRowOutlet]" }, { kind: "directive", type: DataRowOutlet, selector: "[rowOutlet]" }, { kind: "directive", type: NoDataRowOutlet, selector: "[noDataRowOutlet]" }, { kind: "directive", type: FooterRowOutlet, selector: "[footerRowOutlet]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
245
+ }
246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableView, decorators: [{
247
+ type: Component,
248
+ args: [{ selector: 'x-table-view, table[x-table-view]', exportAs: 'xTableView', host: {
249
+ class: 'x-table-view',
250
+ '[class.x-table-fixed-layout]': 'fixedLayout'
251
+ }, providers: [
252
+ { provide: CdkTable, useExisting: XTableView },
253
+ { provide: CDK_TABLE, useExisting: XTableView },
254
+ // Prevent nested tables from seeing this table's StickyPositioningListener.
255
+ { provide: _VIEW_REPEATER_STRATEGY, useClass: _DisposeViewRepeaterStrategy },
256
+ { provide: STICKY_POSITIONING_LISTENER, useValue: null },
257
+ XTableViewService
258
+ ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, imports: [HeaderRowOutlet, DataRowOutlet, NoDataRowOutlet, FooterRowOutlet], template: "<ng-content select=\"caption\" />\r\n<ng-content select=\"colgroup, col\" />\r\n\r\n<!--\r\n Unprojected content throws a hydration error so we need this to capture it.\r\n It gets removed on the client so it doesn't affect the layout.\r\n -->\r\n@if (_isServer) {\r\n <ng-content />\r\n}\r\n<div class=\"x-table-sentinel-top\" #sentinelTop></div>\r\n@if (_isNativeHtmlTable) {\r\n <thead>\r\n <ng-container headerRowOutlet />\r\n </thead>\r\n <tbody>\r\n <ng-container rowOutlet />\r\n <ng-container noDataRowOutlet />\r\n </tbody>\r\n <tfoot>\r\n <ng-container footerRowOutlet />\r\n </tfoot>\r\n} @else {\r\n <ng-container headerRowOutlet />\r\n <ng-container rowOutlet />\r\n <ng-container noDataRowOutlet />\r\n <ng-container footerRowOutlet />\r\n}\r\n", styles: [".x-table-view{margin:0;padding:0}.x-table-view{position:relative;border-collapse:separate;border-spacing:0}.x-table-view .x-table-header-cell,.x-table-view .x-table-footer-cell{padding:0 .5rem;text-align:left;font-weight:500;color:var(--x-text);border-top:var(--x-border-width) var(--x-border-style) var(--x-border);border-bottom:var(--x-border-width) var(--x-border-style) var(--x-border);border-right:var(--x-border-width) var(--x-border-style) var(--x-border);cursor:default;background-color:var(--x-background);white-space:nowrap}.x-table-view .x-table-header-cell:first-child,.x-table-view .x-table-footer-cell:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view .x-table-header-cell.x-table-header-cell-actived,.x-table-view .x-table-footer-cell.x-table-header-cell-actived{background-color:var(--x-background-a100)}.x-table-view .x-table-sticky{position:sticky;background-color:var(--x-background-a200)}.x-table-view .x-table-sentinel-top{visibility:hidden;position:absolute;top:0}.x-table-view .x-table-row-actived .x-table-cell:not(.x-table-cell-selected){background-color:var(--x-background-a100)}.x-table-view .x-table-cell{padding:0 .5rem;text-align:left;font-weight:500;color:var(--x-text);border-bottom:var(--x-border-width) var(--x-border-style) var(--x-border);border-right:var(--x-border-width) var(--x-border-style) var(--x-border);cursor:default;white-space:nowrap;background-color:var(--x-background)}.x-table-view .x-table-cell:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view .x-table-cell.x-table-cell-selected{border-color:var(--x-border-a200);background-color:var(--x-primary-900)}.x-table-view .x-table-cell.x-table-sticky:not(.x-table-cell-selected){background-color:var(--x-background-a200)}.x-table-view .x-table-sticky-border-elem-top{border-bottom-style:solid;border-bottom-width:calc(2 * var(--x-border-width));border-bottom-color:var(--x-border-a900)}.x-table-view .x-table-sticky-border-elem-bottom{border-top-style:solid;border-top-width:calc(2 * var(--x-border-width));border-top-color:var(--x-border-a900)}.x-table-view .x-table-sticky-border-elem-left{border-right-style:solid;border-right-width:calc(2 * var(--x-border-width));border-right-color:var(--x-border-a900)}.x-table-view .x-table-sticky-border-elem-right{border-left-style:solid;border-left-width:calc(2 * var(--x-border-width));border-left-color:var(--x-border-a900)}\n"] }]
259
+ }] });
260
+
261
+ class XTableViewCellDef extends CdkCellDef {
262
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewCellDef, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
263
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableViewCellDef, isStandalone: true, selector: "[xTableCellDef]", providers: [{ provide: CdkCellDef, useExisting: XTableViewCellDef }], usesInheritance: true, ngImport: i0 }); }
264
+ }
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewCellDef, decorators: [{
266
+ type: Directive,
267
+ args: [{
268
+ selector: '[xTableCellDef]',
269
+ providers: [{ provide: CdkCellDef, useExisting: XTableViewCellDef }]
270
+ }]
271
+ }] });
272
+ class XTableHeaderCellDef extends CdkHeaderCellDef {
273
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderCellDef, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
274
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableHeaderCellDef, isStandalone: true, selector: "[xTableHeaderCellDef]", providers: [{ provide: CdkHeaderCellDef, useExisting: XTableHeaderCellDef }], usesInheritance: true, ngImport: i0 }); }
275
+ }
276
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderCellDef, decorators: [{
277
+ type: Directive,
278
+ args: [{
279
+ selector: '[xTableHeaderCellDef]',
280
+ providers: [{ provide: CdkHeaderCellDef, useExisting: XTableHeaderCellDef }]
281
+ }]
282
+ }] });
283
+ class XTableFooterCellDef extends CdkFooterCellDef {
284
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterCellDef, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
285
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableFooterCellDef, isStandalone: true, selector: "[xTableFooterCellDef]", providers: [{ provide: CdkFooterCellDef, useExisting: XTableFooterCellDef }], usesInheritance: true, ngImport: i0 }); }
286
+ }
287
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterCellDef, decorators: [{
288
+ type: Directive,
289
+ args: [{
290
+ selector: '[xTableFooterCellDef]',
291
+ providers: [{ provide: CdkFooterCellDef, useExisting: XTableFooterCellDef }]
292
+ }]
293
+ }] });
294
+ class XTableColumnDef extends CdkColumnDef {
295
+ get name() {
296
+ return this._name;
297
+ }
298
+ set name(name) {
299
+ this._setNameInput(name);
300
+ }
301
+ _updateColumnCssClassName() {
302
+ super._updateColumnCssClassName();
303
+ this._columnCssClassName.push(`x-table-column-${this.cssClassFriendlyName}`);
304
+ }
305
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableColumnDef, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
306
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableColumnDef, isStandalone: true, selector: "[xTableColumnDef]", inputs: { name: ["xTableColumnDef", "name"] }, providers: [{ provide: CdkColumnDef, useExisting: XTableColumnDef }], usesInheritance: true, ngImport: i0 }); }
307
+ }
308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableColumnDef, decorators: [{
309
+ type: Directive,
310
+ args: [{
311
+ selector: '[xTableColumnDef]',
312
+ providers: [{ provide: CdkColumnDef, useExisting: XTableColumnDef }]
313
+ }]
314
+ }], propDecorators: { name: [{
315
+ type: Input,
316
+ args: ['xTableColumnDef']
317
+ }] } });
318
+ class XTableHeaderCell extends CdkHeaderCell {
319
+ constructor() {
320
+ super(...arguments);
321
+ this.tableViewService = inject(XTableViewService, { optional: true });
322
+ this.tableView = inject(XTableView, { optional: true });
323
+ this.elementRef = inject(ElementRef);
324
+ }
325
+ get isActived() {
326
+ return this.tableViewService.activedHeaderCells.includes(this);
327
+ }
328
+ onClick() {
329
+ this.tableViewService.activedHeaderCells = [this];
330
+ const headerCells = this.tableView?.headerCells() ?? [];
331
+ const index = headerCells.indexOf(this);
332
+ const cells = this.tableView?.cells() ?? [];
333
+ const columnsCount = (this.tableView?.headerRowRef()?.columns).length ?? 0;
334
+ const rowsCount = this.tableView?.rows().length ?? 0;
335
+ if (columnsCount === 0 || rowsCount === 0) {
336
+ return;
337
+ }
338
+ const columnCells = [];
339
+ for (let i = 0; i < rowsCount; i++) {
340
+ const cellIndex = index * rowsCount + i;
341
+ if (cellIndex < cells.length) {
342
+ columnCells.push(cells[cellIndex]);
343
+ }
344
+ }
345
+ this.tableViewService.selectedCells = [];
346
+ for (let cell of columnCells) {
347
+ this.tableViewService.selectedCells.push(cell);
348
+ cell.setActivedRow(cell);
349
+ }
350
+ }
351
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderCell, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
352
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableHeaderCell, isStandalone: true, selector: "x-table-header-cell, th[x-table-header-cell]", host: { attributes: { "role": "columnheader" }, listeners: { "click": "onClick()" }, properties: { "class.x-table-header-cell-actived": "this.isActived" }, classAttribute: "x-table-header-cell" }, usesInheritance: true, ngImport: i0 }); }
353
+ }
354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderCell, decorators: [{
355
+ type: Directive,
356
+ args: [{
357
+ selector: 'x-table-header-cell, th[x-table-header-cell]',
358
+ host: {
359
+ class: 'x-table-header-cell',
360
+ role: 'columnheader'
361
+ }
362
+ }]
363
+ }], propDecorators: { isActived: [{
364
+ type: HostBinding,
365
+ args: ['class.x-table-header-cell-actived']
366
+ }], onClick: [{
367
+ type: HostListener,
368
+ args: ['click']
369
+ }] } });
370
+ class XTableFooterCell extends CdkFooterCell {
371
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterCell, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
372
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableFooterCell, isStandalone: true, selector: "x-table-footer-cell, td[x-table-footer-cell]", host: { classAttribute: "x-table-footer-cell" }, usesInheritance: true, ngImport: i0 }); }
373
+ }
374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterCell, decorators: [{
375
+ type: Directive,
376
+ args: [{
377
+ selector: 'x-table-footer-cell, td[x-table-footer-cell]',
378
+ host: {
379
+ class: 'x-table-footer-cell'
380
+ }
381
+ }]
382
+ }] });
383
+ class XTableViewCell extends CdkCell {
384
+ constructor() {
385
+ super(...arguments);
386
+ this.tableViewService = inject(XTableViewService, { optional: true });
387
+ this.tableView = inject(XTableView, { optional: true });
388
+ this.elementRef = inject(ElementRef);
389
+ }
390
+ get isSelected() {
391
+ return this.tableViewService.selectedCells.includes(this);
392
+ }
393
+ onClick() {
394
+ this.tableViewService.selectedCells = [this];
395
+ this.tableViewService.activedRows = [];
396
+ this.setActivedRow(this);
397
+ this.setActivedColumn(this);
398
+ }
399
+ setActivedRow(cell) {
400
+ const rows = this.tableView?.rows() ?? [];
401
+ if (rows.length > 0) {
402
+ const rowIndex = this.getRowIndex(cell);
403
+ if (rowIndex >= 0 && rowIndex < rows.length) {
404
+ const currentRow = rows[rowIndex];
405
+ this.tableViewService.activedRows.push(currentRow);
406
+ }
407
+ }
408
+ }
409
+ setActivedColumn(cell) {
410
+ const headerCells = (this.tableView?.headerCells() ?? []);
411
+ const headerRowRefs = this.tableView?.headerRowRefs() ?? [];
412
+ const headerCellsArray = this.convertToColumnBasedArray(headerCells, headerRowRefs.length);
413
+ const activedHeaderCells = [];
414
+ for (let cells of headerCellsArray) {
415
+ if (cells.length > 0) {
416
+ const columnIndex = this.getColumnIndex(cell);
417
+ if (columnIndex >= 0 && columnIndex < cells.length) {
418
+ activedHeaderCells.push(cells[columnIndex]);
419
+ }
420
+ }
421
+ }
422
+ this.tableViewService.activedHeaderCells = activedHeaderCells;
423
+ }
424
+ convertToColumnBasedArray(input, columnsPerRow) {
425
+ const result = [];
426
+ for (let i = 0; i < columnsPerRow; i++) {
427
+ result.push([]);
428
+ }
429
+ for (let i = 0; i < input.length; i++) {
430
+ const columnIndex = i % columnsPerRow;
431
+ result[columnIndex].push(input[i]);
432
+ }
433
+ return result;
434
+ }
435
+ getColumnIndex(cell) {
436
+ if (!this.tableView || !this.tableView.cells())
437
+ return -1;
438
+ const cellsArray = this.tableView.cells();
439
+ const selectedIndex = cellsArray.indexOf(cell);
440
+ if (selectedIndex === -1)
441
+ return -1;
442
+ const columnsPerRow = (this.tableView.headerRowRef()?.columns).length ?? 0;
443
+ const rowsCount = this.tableView.rows().length;
444
+ if (columnsPerRow === 0 || rowsCount === 0)
445
+ return -1;
446
+ return Math.floor(selectedIndex / rowsCount);
447
+ }
448
+ getRowIndex(cell) {
449
+ if (!this.tableView || !this.tableView.cells())
450
+ return -1;
451
+ const cellsArray = this.tableView.cells();
452
+ const selectedIndex = cellsArray.indexOf(cell);
453
+ if (selectedIndex === -1)
454
+ return -1;
455
+ const columnsPerRow = (this.tableView.headerRowRef()?.columns).length ?? 0;
456
+ const rowsCount = this.tableView.rows().length;
457
+ if (columnsPerRow === 0 || rowsCount === 0)
458
+ return -1;
459
+ return selectedIndex % rowsCount;
460
+ }
461
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewCell, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
462
+ /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: XTableViewCell, isStandalone: true, selector: "x-table-cell, td[x-table-cell]", host: { listeners: { "click": "onClick()" }, properties: { "class.x-table-cell-selected": "this.isSelected" }, classAttribute: "x-table-cell" }, usesInheritance: true, ngImport: i0 }); }
463
+ }
464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewCell, decorators: [{
465
+ type: Directive,
466
+ args: [{
467
+ selector: 'x-table-cell, td[x-table-cell]',
468
+ host: {
469
+ class: 'x-table-cell'
470
+ }
471
+ }]
472
+ }], propDecorators: { isSelected: [{
473
+ type: HostBinding,
474
+ args: ['class.x-table-cell-selected']
475
+ }], onClick: [{
476
+ type: HostListener,
477
+ args: ['click']
478
+ }] } });
479
+
480
+ class XTableTextColumn extends CdkTextColumn {
481
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableTextColumn, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
482
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.4", type: XTableTextColumn, isStandalone: true, selector: "x-table-text-column", usesInheritance: true, ngImport: i0, template: `
483
+ <ng-container xTableColumnDef>
484
+ <th x-table-header-cell *xTableHeaderCellDef [style.text-align]="justify">
485
+ {{ headerText }}
486
+ </th>
487
+ <td x-table-cell *xTableCellDef="let data" [style.text-align]="justify">
488
+ {{ dataAccessor(data, name) }}
489
+ </td>
490
+ </ng-container>
491
+ `, isInline: true, dependencies: [{ kind: "directive", type: XTableColumnDef, selector: "[xTableColumnDef]", inputs: ["xTableColumnDef"] }, { kind: "directive", type: XTableHeaderCellDef, selector: "[xTableHeaderCellDef]" }, { kind: "directive", type: XTableHeaderCell, selector: "x-table-header-cell, th[x-table-header-cell]" }, { kind: "directive", type: XTableViewCellDef, selector: "[xTableCellDef]" }, { kind: "directive", type: XTableViewCell, selector: "x-table-cell, td[x-table-cell]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
492
+ }
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableTextColumn, decorators: [{
494
+ type: Component,
495
+ args: [{
496
+ selector: 'x-table-text-column',
497
+ template: `
498
+ <ng-container xTableColumnDef>
499
+ <th x-table-header-cell *xTableHeaderCellDef [style.text-align]="justify">
500
+ {{ headerText }}
501
+ </th>
502
+ <td x-table-cell *xTableCellDef="let data" [style.text-align]="justify">
503
+ {{ dataAccessor(data, name) }}
504
+ </td>
505
+ </ng-container>
506
+ `,
507
+ encapsulation: ViewEncapsulation.None,
508
+ changeDetection: ChangeDetectionStrategy.Default,
509
+ imports: [XTableColumnDef, XTableHeaderCellDef, XTableHeaderCell, XTableViewCellDef, XTableViewCell]
510
+ }]
511
+ }] });
512
+
513
+ const EXPORTED_DECLARATIONS = [
514
+ // Table
515
+ XTableView,
516
+ // Template defs
517
+ XTableHeaderCellDef,
518
+ XTableHeaderRowDef,
519
+ XTableColumnDef,
520
+ XTableViewCellDef,
521
+ XTableViewRowDef,
522
+ XTableFooterCellDef,
523
+ XTableFooterRowDef,
524
+ // Cell directives
525
+ XTableHeaderCell,
526
+ XTableViewCell,
527
+ XTableFooterCell,
528
+ // Row directives
529
+ XTableHeaderRow,
530
+ XTableViewRow,
531
+ XTableFooterRow,
532
+ XTableNoDataRow,
533
+ XTableTextColumn
534
+ ];
535
+ class XTableViewModule {
536
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
537
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.4", ngImport: i0, type: XTableViewModule, imports: [CdkTableModule,
538
+ // Table
539
+ XTableView,
540
+ // Template defs
541
+ XTableHeaderCellDef,
542
+ XTableHeaderRowDef,
543
+ XTableColumnDef,
544
+ XTableViewCellDef,
545
+ XTableViewRowDef,
546
+ XTableFooterCellDef,
547
+ XTableFooterRowDef,
548
+ // Cell directives
549
+ XTableHeaderCell,
550
+ XTableViewCell,
551
+ XTableFooterCell,
552
+ // Row directives
553
+ XTableHeaderRow,
554
+ XTableViewRow,
555
+ XTableFooterRow,
556
+ XTableNoDataRow,
557
+ XTableTextColumn], exports: [
558
+ // Table
559
+ XTableView,
560
+ // Template defs
561
+ XTableHeaderCellDef,
562
+ XTableHeaderRowDef,
563
+ XTableColumnDef,
564
+ XTableViewCellDef,
565
+ XTableViewRowDef,
566
+ XTableFooterCellDef,
567
+ XTableFooterRowDef,
568
+ // Cell directives
569
+ XTableHeaderCell,
570
+ XTableViewCell,
571
+ XTableFooterCell,
572
+ // Row directives
573
+ XTableHeaderRow,
574
+ XTableViewRow,
575
+ XTableFooterRow,
576
+ XTableNoDataRow,
577
+ XTableTextColumn] }); }
578
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewModule, imports: [CdkTableModule] }); }
579
+ }
580
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewModule, decorators: [{
581
+ type: NgModule,
582
+ args: [{
583
+ exports: [...EXPORTED_DECLARATIONS],
584
+ imports: [CdkTableModule, ...EXPORTED_DECLARATIONS]
585
+ }]
586
+ }] });
587
+
588
+ /**
589
+ * Generated bundle index. Do not edit.
590
+ */
591
+
592
+ export { XTableColumnDef, XTableFooterCell, XTableFooterCellDef, XTableFooterRow, XTableFooterRowDef, XTableHeaderCell, XTableHeaderCellDef, XTableHeaderRow, XTableHeaderRowDef, XTableNoDataRow, XTableTextColumn, XTableView, XTableViewCell, XTableViewCellDef, XTableViewModule, XTableViewPrefix, XTableViewProperty, XTableViewRow, XTableViewRowDef };
593
+ //# sourceMappingURL=ng-nest-ui-table-view.mjs.map