@ng-nest/ui 20.0.7 → 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 (206) hide show
  1. package/auto-complete/index.d.ts +33 -8
  2. package/base-form/index.d.ts +3 -3
  3. package/calendar/index.d.ts +1 -2
  4. package/cascade/index.d.ts +33 -8
  5. package/checkbox/index.d.ts +3 -3
  6. package/color-picker/index.d.ts +34 -8
  7. package/core/index.d.ts +40 -8
  8. package/date-picker/index.d.ts +57 -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 +82 -72
  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 +86 -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 +91 -72
  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 +273 -253
  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 +42 -42
  87. package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
  88. package/fesm2022/ng-nest-ui-input.mjs +102 -81
  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 +102 -19
  135. package/fesm2022/ng-nest-ui-scrollable.mjs.map +1 -1
  136. package/fesm2022/ng-nest-ui-select.mjs +121 -111
  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 +490 -242
  151. package/fesm2022/ng-nest-ui-table-view.mjs.map +1 -1
  152. package/fesm2022/ng-nest-ui-table.mjs +221 -221
  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 +41 -41
  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 +104 -94
  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 +126 -116
  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/find/index.d.ts +5 -5
  187. package/form/index.d.ts +1 -1
  188. package/input/index.d.ts +32 -5
  189. package/input-number/index.d.ts +5 -5
  190. package/list/index.d.ts +2 -2
  191. package/message-box/index.d.ts +4 -5
  192. package/package.json +20 -20
  193. package/radio/index.d.ts +3 -3
  194. package/rate/index.d.ts +5 -5
  195. package/scrollable/index.d.ts +15 -7
  196. package/select/index.d.ts +38 -8
  197. package/slider-select/index.d.ts +3 -3
  198. package/steps/index.d.ts +1 -2
  199. package/switch/index.d.ts +3 -3
  200. package/table-view/index.d.ts +121 -79
  201. package/textarea/index.d.ts +3 -3
  202. package/theme/index.d.ts +1 -1
  203. package/time-picker/index.d.ts +33 -8
  204. package/transfer/index.d.ts +1 -1
  205. package/tree-select/index.d.ts +33 -8
  206. package/upload/index.d.ts +2 -2
@@ -1,149 +1,337 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, TemplateRef, Input, Directive, ElementRef, HostListener, HostBinding, ContentChild, input, Component, ViewChildren, ContentChildren, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import { XPropertyFunction } from '@ng-nest/ui/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';
5
6
 
6
7
  class XTableViewService {
7
8
  constructor() {
8
9
  this.selectedCells = [];
9
10
  this.activedRows = [];
10
11
  this.selectedHeaderCell = null;
11
- this.activedHeaderCell = null;
12
+ this.activedHeaderCells = [];
13
+ this.stickyHeaderRows = [];
12
14
  }
13
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
14
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewService }); }
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 }); }
15
17
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewService, decorators: [{
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewService, decorators: [{
17
19
  type: Injectable
18
20
  }] });
19
21
 
20
- class XCellDef {
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 {
21
33
  constructor() {
22
- this.xCellDef = '';
23
- this.template = inject(TemplateRef);
34
+ super(...arguments);
35
+ this.config = inject(XConfigService).getConfigForComponent(X_TABLE_VIEW_CONFIG_NAME);
24
36
  }
25
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
26
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XCellDef, isStandalone: true, selector: "[xCellDef]", inputs: { xCellDef: "xCellDef" }, ngImport: i0 }); }
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 }); }
27
49
  }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XCellDef, decorators: [{
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderRowDef, decorators: [{
29
51
  type: Directive,
30
52
  args: [{
31
- selector: '[xCellDef]'
53
+ selector: '[xTableHeaderRowDef]',
54
+ providers: [{ provide: CdkHeaderRowDef, useExisting: XTableHeaderRowDef }],
55
+ inputs: [
56
+ { name: 'columns', alias: 'xTableHeaderRowDef' },
57
+ { name: 'sticky', alias: 'xTableHeaderRowDefSticky', transform: booleanAttribute }
58
+ ]
32
59
  }]
33
- }], propDecorators: { xCellDef: [{
34
- type: Input
35
- }] } });
36
- class XHeaderCellDef {
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 {
37
92
  constructor() {
38
- this.xHeaderCellDef = '';
39
- this.template = inject(TemplateRef);
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);
40
130
  }
41
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XHeaderCellDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
42
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XHeaderCellDef, isStandalone: true, selector: "[xHeaderCellDef]", inputs: { xHeaderCellDef: "xHeaderCellDef" }, ngImport: i0 }); }
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 }); }
43
133
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XHeaderCellDef, decorators: [{
45
- type: Directive,
134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderRow, decorators: [{
135
+ type: Component,
46
136
  args: [{
47
- selector: '[xHeaderCellDef]'
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]
48
148
  }]
49
- }], propDecorators: { xHeaderCellDef: [{
50
- type: Input
149
+ }], propDecorators: { isSticking: [{
150
+ type: HostBinding,
151
+ args: ['class.x-table-sticky-top']
51
152
  }] } });
52
- class XCell {
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 {
53
174
  constructor() {
175
+ super(...arguments);
54
176
  this.tableViewService = inject(XTableViewService, { optional: true });
55
- this.tableView = inject(XTableViewComponent, { optional: true });
56
- this.elementRef = inject(ElementRef);
57
- this.cellClass = true;
58
177
  }
59
- get isSelected() {
60
- return this.tableViewService.selectedCells.includes(this);
178
+ get isActived() {
179
+ return this.tableViewService.activedRows.includes(this);
61
180
  }
62
- onClick() {
63
- this.tableViewService.selectedCells = [this];
64
- this.tableViewService.activedRows = [];
65
- this.setActivedRow(this);
66
- this.setActivedHeaderCell(this);
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';
67
207
  }
68
- setActivedRow(cell) {
69
- const rows = this.tableView?.rows.toArray() ?? [];
70
- if (rows.length > 0) {
71
- const rowIndex = this.getRowIndex(cell);
72
- if (rowIndex >= 0 && rowIndex < rows.length) {
73
- const currentRow = rows[rowIndex];
74
- this.tableViewService.activedRows.push(currentRow);
75
- }
76
- }
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;
77
235
  }
78
- setActivedHeaderCell(cell) {
79
- const headerCells = this.tableView?.headerCells.toArray() ?? [];
80
- if (headerCells.length > 0) {
81
- const columnIndex = this.getColumnIndex(cell);
82
- if (columnIndex >= 0 && columnIndex < headerCells.length) {
83
- this.tableViewService.activedHeaderCell = headerCells[columnIndex];
84
- }
85
- }
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;
86
297
  }
87
- getColumnIndex(cell) {
88
- if (!this.tableView || !this.tableView.cells)
89
- return -1;
90
- const cellsArray = this.tableView.cells.toArray();
91
- const selectedIndex = cellsArray.indexOf(cell);
92
- if (selectedIndex === -1)
93
- return -1;
94
- const columnsPerRow = this.tableView.columns().length;
95
- const rowsCount = this.tableView.data().length;
96
- if (columnsPerRow === 0 || rowsCount === 0)
97
- return -1;
98
- return Math.floor(selectedIndex / rowsCount);
298
+ set name(name) {
299
+ this._setNameInput(name);
99
300
  }
100
- getRowIndex(cell) {
101
- if (!this.tableView || !this.tableView.cells)
102
- return -1;
103
- const cellsArray = this.tableView.cells.toArray();
104
- const selectedIndex = cellsArray.indexOf(cell);
105
- if (selectedIndex === -1)
106
- return -1;
107
- const columnsPerRow = this.tableView.columns().length;
108
- const rowsCount = this.tableView.data().length;
109
- if (columnsPerRow === 0 || rowsCount === 0)
110
- return -1;
111
- return selectedIndex % rowsCount;
301
+ _updateColumnCssClassName() {
302
+ super._updateColumnCssClassName();
303
+ this._columnCssClassName.push(`x-table-column-${this.cssClassFriendlyName}`);
112
304
  }
113
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XCell, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
114
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XCell, isStandalone: true, selector: "x-cell, td[x-cell]", host: { listeners: { "click": "onClick()" }, properties: { "class.x-cell": "this.cellClass", "class.x-cell-selected": "this.isSelected" } }, ngImport: i0 }); }
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 }); }
115
307
  }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XCell, decorators: [{
308
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableColumnDef, decorators: [{
117
309
  type: Directive,
118
310
  args: [{
119
- selector: 'x-cell, td[x-cell]'
311
+ selector: '[xTableColumnDef]',
312
+ providers: [{ provide: CdkColumnDef, useExisting: XTableColumnDef }]
120
313
  }]
121
- }], propDecorators: { cellClass: [{
122
- type: HostBinding,
123
- args: ['class.x-cell']
124
- }], isSelected: [{
125
- type: HostBinding,
126
- args: ['class.x-cell-selected']
127
- }], onClick: [{
128
- type: HostListener,
129
- args: ['click']
314
+ }], propDecorators: { name: [{
315
+ type: Input,
316
+ args: ['xTableColumnDef']
130
317
  }] } });
131
- class XHeaderCell {
318
+ class XTableHeaderCell extends CdkHeaderCell {
132
319
  constructor() {
320
+ super(...arguments);
133
321
  this.tableViewService = inject(XTableViewService, { optional: true });
134
- this.tableView = inject(XTableViewComponent, { optional: true });
135
- this.cellClass = true;
322
+ this.tableView = inject(XTableView, { optional: true });
323
+ this.elementRef = inject(ElementRef);
136
324
  }
137
325
  get isActived() {
138
- return this.tableViewService.activedHeaderCell === this;
326
+ return this.tableViewService.activedHeaderCells.includes(this);
139
327
  }
140
328
  onClick() {
141
- this.tableViewService.activedHeaderCell = this;
142
- const headerCells = this.tableView?.headerCells.toArray() ?? [];
329
+ this.tableViewService.activedHeaderCells = [this];
330
+ const headerCells = this.tableView?.headerCells() ?? [];
143
331
  const index = headerCells.indexOf(this);
144
- const cells = this.tableView?.cells.toArray() ?? [];
145
- const columnsCount = this.tableView?.columns().length ?? 0;
146
- const rowsCount = this.tableView?.data().length ?? 0;
332
+ const cells = this.tableView?.cells() ?? [];
333
+ const columnsCount = (this.tableView?.headerRowRef()?.columns).length ?? 0;
334
+ const rowsCount = this.tableView?.rows().length ?? 0;
147
335
  if (columnsCount === 0 || rowsCount === 0) {
148
336
  return;
149
337
  }
@@ -160,180 +348,240 @@ class XHeaderCell {
160
348
  cell.setActivedRow(cell);
161
349
  }
162
350
  }
163
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XHeaderCell, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
164
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XHeaderCell, isStandalone: true, selector: "x-header-cell, th[x-header-cell]", host: { listeners: { "click": "onClick()" }, properties: { "class.x-header-cell": "this.cellClass", "class.x-header-cell-actived": "this.isActived" } }, ngImport: i0 }); }
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 }); }
165
353
  }
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XHeaderCell, decorators: [{
354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableHeaderCell, decorators: [{
167
355
  type: Directive,
168
356
  args: [{
169
- selector: 'x-header-cell, th[x-header-cell]'
357
+ selector: 'x-table-header-cell, th[x-table-header-cell]',
358
+ host: {
359
+ class: 'x-table-header-cell',
360
+ role: 'columnheader'
361
+ }
170
362
  }]
171
- }], propDecorators: { cellClass: [{
172
- type: HostBinding,
173
- args: ['class.x-header-cell']
174
- }], isActived: [{
363
+ }], propDecorators: { isActived: [{
175
364
  type: HostBinding,
176
- args: ['class.x-header-cell-actived']
365
+ args: ['class.x-table-header-cell-actived']
177
366
  }], onClick: [{
178
367
  type: HostListener,
179
368
  args: ['click']
180
369
  }] } });
181
-
182
- class XColumnDef {
183
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XColumnDef, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
184
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XColumnDef, isStandalone: true, selector: "[xColumnDef]", inputs: { name: ["xColumnDef", "name"] }, queries: [{ propertyName: "cell", first: true, predicate: XCellDef, descendants: true, static: true }, { propertyName: "header", first: true, predicate: XHeaderCellDef, descendants: true, static: true }], ngImport: i0 }); }
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 }); }
185
373
  }
186
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XColumnDef, decorators: [{
374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableFooterCell, decorators: [{
187
375
  type: Directive,
188
376
  args: [{
189
- selector: '[xColumnDef]'
377
+ selector: 'x-table-footer-cell, td[x-table-footer-cell]',
378
+ host: {
379
+ class: 'x-table-footer-cell'
380
+ }
190
381
  }]
191
- }], propDecorators: { name: [{
192
- type: Input,
193
- args: ['xColumnDef']
194
- }], cell: [{
195
- type: ContentChild,
196
- args: [XCellDef, { static: true }]
197
- }], header: [{
198
- type: ContentChild,
199
- args: [XHeaderCellDef, { static: true }]
200
- }] } });
201
-
202
- class XRowDef {
203
- constructor(vcr, tpl) {
204
- this.vcr = vcr;
205
- this.tpl = tpl;
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);
206
389
  }
207
- ngOnInit() {
208
- this.vcr.createEmbeddedView(this.tpl, { $implicit: this.rowData });
390
+ get isSelected() {
391
+ return this.tableViewService.selectedCells.includes(this);
209
392
  }
210
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XRowDef, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
211
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XRowDef, isStandalone: true, selector: "[xRowDef]", inputs: { rowData: ["xRowDef", "rowData"] }, ngImport: i0 }); }
212
- }
213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XRowDef, decorators: [{
214
- type: Directive,
215
- args: [{
216
- selector: '[xRowDef]'
217
- }]
218
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }], propDecorators: { rowData: [{
219
- type: Input,
220
- args: ['xRowDef']
221
- }] } });
222
- class XHeaderRowDef {
223
- constructor(vcr, tpl) {
224
- this.vcr = vcr;
225
- this.tpl = tpl;
393
+ onClick() {
394
+ this.tableViewService.selectedCells = [this];
395
+ this.tableViewService.activedRows = [];
396
+ this.setActivedRow(this);
397
+ this.setActivedColumn(this);
226
398
  }
227
- ngOnInit() {
228
- this.vcr.createEmbeddedView(this.tpl);
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
+ }
229
408
  }
230
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XHeaderRowDef, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
231
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XHeaderRowDef, isStandalone: true, selector: "[xHeaderRowDef]", ngImport: i0 }); }
232
- }
233
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XHeaderRowDef, decorators: [{
234
- type: Directive,
235
- args: [{
236
- selector: '[xHeaderRowDef]'
237
- }]
238
- }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }] });
239
- class XRow {
240
- constructor() {
241
- this.tableViewService = inject(XTableViewService, { optional: true });
242
- this.tableView = inject(XTableViewComponent, { optional: true });
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;
243
423
  }
244
- get isActived() {
245
- return this.tableViewService.activedRows.includes(this);
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;
246
460
  }
247
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XRow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
248
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: XRow, isStandalone: true, selector: "x-row, tr[x-row]", host: { properties: { "class.x-row-actived": "this.isActived" } }, ngImport: i0 }); }
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 }); }
249
463
  }
250
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XRow, decorators: [{
464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewCell, decorators: [{
251
465
  type: Directive,
252
466
  args: [{
253
- selector: 'x-row, tr[x-row]'
467
+ selector: 'x-table-cell, td[x-table-cell]',
468
+ host: {
469
+ class: 'x-table-cell'
470
+ }
254
471
  }]
255
- }], propDecorators: { isActived: [{
472
+ }], propDecorators: { isSelected: [{
256
473
  type: HostBinding,
257
- args: ['class.x-row-actived']
474
+ args: ['class.x-table-cell-selected']
475
+ }], onClick: [{
476
+ type: HostListener,
477
+ args: ['click']
258
478
  }] } });
259
479
 
260
- /**
261
- * Table view
262
- * @selector x-table-view
263
- * @decorator component
264
- */
265
- const XTableViewPrefix = 'x-table-view';
266
- const X_TABLE_VIEW_CONFIG_NAME = 'tableView';
267
- /**
268
- * Table view Property
269
- */
270
- class XTableViewProperty extends XPropertyFunction(X_TABLE_VIEW_CONFIG_NAME) {
271
- constructor() {
272
- super(...arguments);
273
- /**
274
- * @zh_CN 数据
275
- * @en_US Row data
276
- */
277
- this.data = input([]);
278
- /**
279
- * @zh_CN 列数据
280
- * @en_US Columns data
281
- */
282
- this.columns = input([]);
283
- }
284
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
285
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.0", type: XTableViewProperty, isStandalone: true, selector: "x-table-view-property", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
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 }); }
286
492
  }
287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewProperty, decorators: [{
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableTextColumn, decorators: [{
288
494
  type: Component,
289
- args: [{ selector: `${XTableViewPrefix}-property`, template: '' }]
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
+ }]
290
511
  }] });
291
512
 
292
- class XTableViewComponent extends XTableViewProperty {
293
- constructor() {
294
- super(...arguments);
295
- this.hostClass = true;
296
- this.columnMap = {};
297
- this.tableViewService = inject(XTableViewService);
298
- }
299
- ngAfterContentInit() {
300
- for (const def of this.columnDefs.toArray()) {
301
- this.columnMap[def.name] = def;
302
- }
303
- }
304
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
305
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: XTableViewComponent, isStandalone: true, selector: "table[x-table-view]", host: { properties: { "class.x-table-view": "this.hostClass" } }, providers: [XTableViewService], queries: [{ propertyName: "columnDefs", predicate: XColumnDef }, { propertyName: "headerCells", predicate: XHeaderCell }, { propertyName: "cells", predicate: XCell }], viewQueries: [{ propertyName: "rows", predicate: XRow, descendants: true }], usesInheritance: true, ngImport: i0, template: "<thead>\r\n <tr *xHeaderRowDef>\r\n @for (columnName of columns(); track columnName) {\r\n <ng-container *ngTemplateOutlet=\"columnMap[columnName]?.header?.template\"></ng-container>\r\n }\r\n </tr>\r\n</thead>\r\n<tbody>\r\n @for (row of data(); track row) {\r\n <tr x-row *xRowDef=\"row\">\r\n @for (columnName of columns(); track columnName) {\r\n <ng-container\r\n *ngTemplateOutlet=\"columnMap[columnName]?.cell?.template; context: { $implicit: row }\"\r\n ></ng-container>\r\n }\r\n </tr>\r\n }\r\n</tbody>\r\n", styles: [".x-table-view{margin:0;padding:0}.x-table-view{border-collapse:separate;border-spacing:0}.x-table-view thead{position:sticky;top:0}.x-table-view thead th{padding:0 .5rem;text-align:left;font-weight:600;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)}.x-table-view thead th:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view thead th.x-header-cell-actived,.x-table-view tbody tr.x-row-actived{background-color:var(--x-background-a100)}.x-table-view tbody td{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}.x-table-view tbody td:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view tbody td.x-cell-selected{border-color:var(--x-border-a200);background-color:var(--x-primary-900)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: XRow, selector: "x-row, tr[x-row]" }, { kind: "directive", type: XRowDef, selector: "[xRowDef]", inputs: ["xRowDef"] }, { kind: "directive", type: XHeaderRowDef, selector: "[xHeaderRowDef]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
306
- }
307
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewComponent, decorators: [{
308
- type: Component,
309
- args: [{ selector: 'table[x-table-view]', imports: [NgTemplateOutlet, XRow, XRowDef, XHeaderRowDef], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XTableViewService], template: "<thead>\r\n <tr *xHeaderRowDef>\r\n @for (columnName of columns(); track columnName) {\r\n <ng-container *ngTemplateOutlet=\"columnMap[columnName]?.header?.template\"></ng-container>\r\n }\r\n </tr>\r\n</thead>\r\n<tbody>\r\n @for (row of data(); track row) {\r\n <tr x-row *xRowDef=\"row\">\r\n @for (columnName of columns(); track columnName) {\r\n <ng-container\r\n *ngTemplateOutlet=\"columnMap[columnName]?.cell?.template; context: { $implicit: row }\"\r\n ></ng-container>\r\n }\r\n </tr>\r\n }\r\n</tbody>\r\n", styles: [".x-table-view{margin:0;padding:0}.x-table-view{border-collapse:separate;border-spacing:0}.x-table-view thead{position:sticky;top:0}.x-table-view thead th{padding:0 .5rem;text-align:left;font-weight:600;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)}.x-table-view thead th:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view thead th.x-header-cell-actived,.x-table-view tbody tr.x-row-actived{background-color:var(--x-background-a100)}.x-table-view tbody td{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}.x-table-view tbody td:first-child{border-left:var(--x-border-width) var(--x-border-style) var(--x-border)}.x-table-view tbody td.x-cell-selected{border-color:var(--x-border-a200);background-color:var(--x-primary-900)}\n"] }]
310
- }], propDecorators: { hostClass: [{
311
- type: HostBinding,
312
- args: ['class.x-table-view']
313
- }], columnDefs: [{
314
- type: ContentChildren,
315
- args: [XColumnDef]
316
- }], headerCells: [{
317
- type: ContentChildren,
318
- args: [XHeaderCell]
319
- }], cells: [{
320
- type: ContentChildren,
321
- args: [XCell]
322
- }], rows: [{
323
- type: ViewChildren,
324
- args: [XRow]
325
- }] } });
326
-
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
+ ];
327
535
  class XTableViewModule {
328
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
329
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: XTableViewModule, imports: [XTableViewComponent, XCell, XHeaderCell, XCellDef, XHeaderCellDef, XColumnDef], exports: [XTableViewComponent, XCell, XHeaderCell, XCellDef, XHeaderCellDef, XColumnDef] }); }
330
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: 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] }); }
331
579
  }
332
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: XTableViewModule, decorators: [{
580
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: XTableViewModule, decorators: [{
333
581
  type: NgModule,
334
582
  args: [{
335
- exports: [XTableViewComponent, XCell, XHeaderCell, XCellDef, XHeaderCellDef, XColumnDef],
336
- imports: [XTableViewComponent, XCell, XHeaderCell, XCellDef, XHeaderCellDef, XColumnDef]
583
+ exports: [...EXPORTED_DECLARATIONS],
584
+ imports: [CdkTableModule, ...EXPORTED_DECLARATIONS]
337
585
  }]
338
586
  }] });
339
587
 
@@ -341,5 +589,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
341
589
  * Generated bundle index. Do not edit.
342
590
  */
343
591
 
344
- export { XCell, XCellDef, XColumnDef, XHeaderCell, XHeaderCellDef, XTableViewComponent, XTableViewModule };
592
+ export { XTableColumnDef, XTableFooterCell, XTableFooterCellDef, XTableFooterRow, XTableFooterRowDef, XTableHeaderCell, XTableHeaderCellDef, XTableHeaderRow, XTableHeaderRowDef, XTableNoDataRow, XTableTextColumn, XTableView, XTableViewCell, XTableViewCellDef, XTableViewModule, XTableViewPrefix, XTableViewProperty, XTableViewRow, XTableViewRowDef };
345
593
  //# sourceMappingURL=ng-nest-ui-table-view.mjs.map