@4sh/ui-kit 0.16.0 → 0.17.1

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 (219) hide show
  1. package/README.fr.md +10 -10
  2. package/README.md +10 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -1000
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2048
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -138
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -257
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -312
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -199
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -137
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +721 -638
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +299 -2
  143. package/mcp/data/text-search-docs.json +149 -9
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  150. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  151. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  152. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  153. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  154. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  155. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
  156. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  157. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  158. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  159. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  160. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  161. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  162. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  163. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  164. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
  165. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
  166. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
  167. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  168. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
  169. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  170. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  171. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  172. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  173. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  174. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  175. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  176. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  177. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  178. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
  179. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  180. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  181. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  182. package/types/4sh-ui-kit-forms.d.ts +275 -194
  183. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  184. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  185. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  186. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  187. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  188. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  189. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  190. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  191. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  192. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  193. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  194. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  195. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  196. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  197. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  198. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  199. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  200. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  201. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  202. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  203. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  204. package/types/4sh-ui-kit-motion.d.ts +117 -67
  205. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  206. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  207. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  208. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  209. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  210. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  211. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  212. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  213. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  214. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  215. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  216. package/types/4sh-ui-kit-theming.d.ts +27 -29
  217. package/types/4sh-ui-kit-types.d.ts +6 -5
  218. package/types/4sh-ui-kit.d.ts +4 -3
  219. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,1069 +1,2009 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, model, numberAttribute, output, contentChild, viewChild, signal, inject, DestroyRef, linkedSignal, computed, isDevMode, effect, afterRenderEffect, afterNextRender, ViewEncapsulation, Component, Directive, ElementRef, Injector } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import * as i1 from '@angular/forms';
5
- import { FormsModule } from '@angular/forms';
6
- import { UiCheckbox } from '@4sh/ui-kit/forms/ui-checkbox';
7
- import { UiRadio } from '@4sh/ui-kit/forms/ui-radio';
8
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
9
- import { UiEmptyState } from '@4sh/ui-kit/informative/ui-empty-state';
10
- import { UiSpinner } from '@4sh/ui-kit/informative/ui-spinner';
11
- import { UiPaginator } from '@4sh/ui-kit/table/ui-paginator';
12
-
13
- /** Reads a (possibly dotted) field path on a row object. */
1
+ import * as i0 from "@angular/core";
2
+ import { Component, DestroyRef, Directive, ElementRef, Injector, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, linkedSignal, model, numberAttribute, output, signal, viewChild } from "@angular/core";
3
+ import { NgTemplateOutlet } from "@angular/common";
4
+ import * as i1 from "@angular/forms";
5
+ import { FormsModule } from "@angular/forms";
6
+ import { UiCheckbox } from "@4sh/ui-kit/forms/ui-checkbox";
7
+ import { UiRadio } from "@4sh/ui-kit/forms/ui-radio";
8
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
9
+ import { UiEmptyState } from "@4sh/ui-kit/informative/ui-empty-state";
10
+ import { UiSpinner } from "@4sh/ui-kit/informative/ui-spinner";
11
+ import { UiPaginator } from "@4sh/ui-kit/table/ui-paginator";
14
12
  function resolveFieldData(data, field) {
15
- if (data == null)
16
- return null;
17
- if (!field.includes('.'))
18
- return data[field];
19
- let value = data;
20
- for (const part of field.split('.')) {
21
- if (value == null)
22
- return null;
23
- value = value[part];
24
- }
25
- return value;
13
+ if (data == null) return null;
14
+ if (!field.includes(".")) return data[field];
15
+ let value = data;
16
+ for (const part of field.split(".")) {
17
+ if (value == null) return null;
18
+ value = value[part];
19
+ }
20
+ return value;
26
21
  }
27
- /** Null-safe, locale-aware comparison shared by the sort pipeline. */
28
22
  function compareValues(a, b) {
29
- if (a == null && b == null)
30
- return 0;
31
- if (a == null)
32
- return -1;
33
- if (b == null)
34
- return 1;
35
- if (typeof a === 'string' && typeof b === 'string')
36
- return a.localeCompare(b);
37
- const na = a;
38
- const nb = b;
39
- return na < nb ? -1 : na > nb ? 1 : 0;
23
+ if (a == null && b == null) return 0;
24
+ if (a == null) return -1;
25
+ if (b == null) return 1;
26
+ if (typeof a === "string" && typeof b === "string") return a.localeCompare(b);
27
+ const na = a;
28
+ const nb = b;
29
+ return na < nb ? -1 : na > nb ? 1 : 0;
40
30
  }
41
- /** Minimum width a column can be resized down to (px). */
42
31
  const COLUMN_MIN_WIDTH = 64;
43
32
  let nextUid = 0;
44
- /**
45
- * ui-table — headless data table.
46
- *
47
- * The consumer owns the markup of the rows (`#header` / `#body` / `#footer`
48
- * templates rendering real `<tr>/<th>/<td>`); the component owns the data
49
- * pipeline (sort → pagination — unless `lazy`, where the consumer owns it and
50
- * refetches on `pageChange`/`sortChange`), the selection / expansion state,
51
- * the scroll shell and the paginator. Column-level behaviors are opt-in via the
52
- * companion directives (`uiSortableColumn`, `uiSelectableRow`,
53
- * `uiFrozenColumn`, `uiResizableColumn`, `uiRowToggler`) and sub-components
54
- * (`ui-table-sort-icon`, `ui-table-checkbox`, `ui-table-header-checkbox`,
55
- * `ui-table-radio`).
56
- *
57
- * Styles are global (`ViewEncapsulation.None`, everything nested under
58
- * `.ui-table`) because the row markup is projected from the consumer and
59
- * would not match emulated-encapsulation selectors.
60
- */
61
- class UiTable {
62
- constructor() {
63
- /** Rows to display. */
64
- this.value = input([], /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
66
- /** Property (dotted path allowed) uniquely identifying a row — required for expansion, recommended for selection. */
67
- this.dataKey = input(/* @ts-ignore */
68
- ...(ngDevMode ? [undefined, { debugName: "dataKey" }] : /* istanbul ignore next */ []));
69
- /** Cell padding density. */
70
- this.size = input('default', /* @ts-ignore */
71
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
72
- /** Displays borders between cells. */
73
- this.showGridlines = input(false, { ...(ngDevMode ? { debugName: "showGridlines" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
74
- /** Alternates the background of even rows. */
75
- this.stripedRows = input(false, { ...(ngDevMode ? { debugName: "stripedRows" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
76
- /** Highlights the hovered row (implicit when a selection mode is active). */
77
- this.rowHover = input(false, { ...(ngDevMode ? { debugName: "rowHover" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
78
- /** Inline styles applied to the inner `<table>` (e.g. `{'min-width': '60rem'}` for horizontal scroll). */
79
- this.tableStyle = input(/* @ts-ignore */
80
- ...(ngDevMode ? [undefined, { debugName: "tableStyle" }] : /* istanbul ignore next */ []));
81
- // --- Selection --------------------------------------------------------
82
- /** Row selection behavior. `single` keeps one row, `multiple` an array. */
83
- this.selectionMode = input(null, /* @ts-ignore */
84
- ...(ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []));
85
- /** Selected row (single) or rows (multiple). Two-way bindable. */
86
- this.selection = model(null, /* @ts-ignore */
87
- ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
88
- /** Desktop-like selection: plain click replaces, Ctrl/Cmd+click toggles, Shift+click ranges. */
89
- this.metaKeySelection = input(false, { ...(ngDevMode ? { debugName: "metaKeySelection" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
90
- // --- Sort ---------------------------------------------------------------
91
- /** One column at a time, or several with Ctrl/Cmd + click. */
92
- this.sortMode = input('single', /* @ts-ignore */
93
- ...(ngDevMode ? [{ debugName: "sortMode" }] : /* istanbul ignore next */ []));
94
- /** Initial sorted field (presort). */
95
- this.sortField = input(/* @ts-ignore */
96
- ...(ngDevMode ? [undefined, { debugName: "sortField" }] : /* istanbul ignore next */ []));
97
- /** Initial sort direction (1 asc, -1 desc). */
98
- this.sortOrder = input(1, { ...(ngDevMode ? { debugName: "sortOrder" } : /* istanbul ignore next */ {}), transform: numberAttribute });
99
- /** Initial multiple-sort state (presort, `sortMode="multiple"`). */
100
- this.multiSortMeta = input(/* @ts-ignore */
101
- ...(ngDevMode ? [undefined, { debugName: "multiSortMeta" }] : /* istanbul ignore next */ []));
102
- /** Direction applied when a column becomes sorted. */
103
- this.defaultSortOrder = input(1, { ...(ngDevMode ? { debugName: "defaultSortOrder" } : /* istanbul ignore next */ {}), transform: numberAttribute });
104
- /** Delegates sorting: the table stops sorting itself and emits `sortFunction`. */
105
- this.customSort = input(false, { ...(ngDevMode ? { debugName: "customSort" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
106
- // --- Pagination ---------------------------------------------------------
107
- /** Splits rows into pages and renders the paginator bar. */
108
- this.paginator = input(false, { ...(ngDevMode ? { debugName: "paginator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
109
- /** Rows per page. */
110
- this.rows = input(10, { ...(ngDevMode ? { debugName: "rows" } : /* istanbul ignore next */ {}), transform: numberAttribute });
111
- /** Index of the first displayed row. Two-way bindable (programmatic pagination). */
112
- this.first = model(0, /* @ts-ignore */
113
- ...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
114
- /** Choices offered in the rows-per-page select (omit to hide it). */
115
- this.rowsPerPageOptions = input(/* @ts-ignore */
116
- ...(ngDevMode ? [undefined, { debugName: "rowsPerPageOptions" }] : /* istanbul ignore next */ []));
117
- /** Maximum number of page-number buttons. */
118
- this.pageLinks = input(5, { ...(ngDevMode ? { debugName: "pageLinks" } : /* istanbul ignore next */ {}), transform: numberAttribute });
119
- /** Total row count on the server (lazy mode) — drives the paginator; ignored otherwise. */
120
- this.totalRecords = input(/* @ts-ignore */
121
- ...(ngDevMode ? [undefined, { debugName: "totalRecords" }] : /* istanbul ignore next */ []));
122
- // --- Scroll -------------------------------------------------------------
123
- /** Enables the scroll shell (sticky header inside the scrollable viewport). */
124
- this.scrollable = input(false, { ...(ngDevMode ? { debugName: "scrollable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
125
- /** Viewport height: a CSS size (e.g. `'400px'`) or `'flex'` to fill the flex parent. */
126
- this.scrollHeight = input(/* @ts-ignore */
127
- ...(ngDevMode ? [undefined, { debugName: "scrollHeight" }] : /* istanbul ignore next */ []));
128
- // --- Frozen rows ----------------------------------------------------------
129
- /** Rows pinned above the body while scrolling. */
130
- this.frozenValue = input(/* @ts-ignore */
131
- ...(ngDevMode ? [undefined, { debugName: "frozenValue" }] : /* istanbul ignore next */ []));
132
- // --- Expansion ------------------------------------------------------------
133
- /** Expanded rows, keyed by `dataKey` value. Two-way bindable. */
134
- this.expandedRowKeys = model({}, /* @ts-ignore */
135
- ...(ngDevMode ? [{ debugName: "expandedRowKeys" }] : /* istanbul ignore next */ []));
136
- // --- Column resize ----------------------------------------------------------
137
- /** Enables column resizing (fit mode: the next column absorbs the delta). */
138
- this.resizableColumns = input(false, { ...(ngDevMode ? { debugName: "resizableColumns" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
139
- // --- Loading -------------------------------------------------------------------
140
- /** Displays a mask + spinner over the table while data is being fetched. */
141
- this.loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
142
- /** Accessible name of the loading indicator. */
143
- this.loadingAriaLabel = input('Chargement des données', /* @ts-ignore */
144
- ...(ngDevMode ? [{ debugName: "loadingAriaLabel" }] : /* istanbul ignore next */ []));
145
- // --- Empty state ------------------------------------------------------------------
146
- /** Title of the default empty state (rendered with `ui-empty-state`; `#emptymessage` overrides it). */
147
- this.emptyMessage = input('Aucune donnée à afficher', /* @ts-ignore */
148
- ...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
149
- /** Icon of the default empty state. */
150
- this.emptyIcon = input('inbox', /* @ts-ignore */
151
- ...(ngDevMode ? [{ debugName: "emptyIcon" }] : /* istanbul ignore next */ []));
152
- // --- Virtual scroll ------------------------------------------------------------------
153
- /** Windows the rendered rows to the visible viewport (requires `scrollable` + a fixed `scrollHeight`). */
154
- this.virtualScroll = input(false, { ...(ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
155
- /** Fixed row height in px (also apply it to the `<tr>` of the body template). */
156
- this.virtualScrollItemSize = input(50, { ...(ngDevMode ? { debugName: "virtualScrollItemSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
157
- /**
158
- * Lazy/server mode: the consumer owns sorting and pagination — `value` is the
159
- * currently loaded page (with `paginator` + `totalRecords`, listen to
160
- * `pageChange`/`sortChange` to refetch) or the loaded window (with
161
- * `virtualScroll`, `lazyLoad` emits the rendered range). No client-side
162
- * sorting or page slicing is applied.
163
- */
164
- this.lazy = input(false, { ...(ngDevMode ? { debugName: "lazy" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
165
- /** Emitted when a row becomes selected. */
166
- this.rowSelect = output();
167
- /** Emitted when a row becomes unselected. */
168
- this.rowUnselect = output();
169
- /** Emitted when the header select-all checkbox is toggled. */
170
- this.headerCheckboxToggle = output();
171
- /** Emitted instead of sorting internally when `customSort` is enabled. */
172
- this.sortFunction = output();
173
- /** Emitted whenever the sort state changes from a header interaction (lazy mode: refetch with it). */
174
- this.sortChange = output();
175
- /** Emitted on any pagination change (navigation or rows-per-page). */
176
- this.pageChange = output();
177
- /** Emitted when a row expands. */
178
- this.rowExpand = output();
179
- /** Emitted when a row collapses. */
180
- this.rowCollapse = output();
181
- /** Emitted after a column resize. */
182
- this.colResize = output();
183
- /** Emitted after a row drag & drop, with the reordered copy of `value`. */
184
- this.rowReorder = output();
185
- /** Emitted when the virtual-scroll window changes (lazy mode). */
186
- this.lazyLoad = output();
187
- // --- Templates (projected) -------------------------------------------------
188
- /** @ignore Free content rendered above the table. */
189
- this.captionTemplate = contentChild('caption', /* @ts-ignore */
190
- ...(ngDevMode ? [{ debugName: "captionTemplate" }] : /* istanbul ignore next */ []));
191
- /** @ignore `<tr>` of header cells. */
192
- this.headerTemplate = contentChild('header', /* @ts-ignore */
193
- ...(ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []));
194
- /** @ignore Row template (context: row, rowIndex, even, selected, expanded, frozen). */
195
- this.bodyTemplate = contentChild('body', /* @ts-ignore */
196
- ...(ngDevMode ? [{ debugName: "bodyTemplate" }] : /* istanbul ignore next */ []));
197
- /** @ignore `<tr>` of footer cells. */
198
- this.footerTemplate = contentChild('footer', /* @ts-ignore */
199
- ...(ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []));
200
- /** @ignore Extra `<tr>` rendered under an expanded row. */
201
- this.expandedRowTemplate = contentChild('expandedrow', /* @ts-ignore */
202
- ...(ngDevMode ? [{ debugName: "expandedRowTemplate" }] : /* istanbul ignore next */ []));
203
- /** @ignore Content of the "no rows" cell. */
204
- this.emptyMessageTemplate = contentChild('emptymessage', /* @ts-ignore */
205
- ...(ngDevMode ? [{ debugName: "emptyMessageTemplate" }] : /* istanbul ignore next */ []));
206
- /** @ignore */
207
- this.tableEl = viewChild('tableEl', /* @ts-ignore */
208
- ...(ngDevMode ? [{ debugName: "tableEl" }] : /* istanbul ignore next */ []));
209
- /** @ignore */
210
- this.theadEl = viewChild('theadEl', /* @ts-ignore */
211
- ...(ngDevMode ? [{ debugName: "theadEl" }] : /* istanbul ignore next */ []));
212
- /** @ignore */
213
- this.wrapperEl = viewChild('wrapperEl', /* @ts-ignore */
214
- ...(ngDevMode ? [{ debugName: "wrapperEl" }] : /* istanbul ignore next */ []));
215
- /** @ignore Scroll position of the wrapper (drives the virtual window). */
216
- this.wrapperScrollTop = signal(0, /* @ts-ignore */
217
- ...(ngDevMode ? [{ debugName: "wrapperScrollTop" }] : /* istanbul ignore next */ []));
218
- /** @ignore Measured height of the scroll viewport. */
219
- this.wrapperHeight = signal(0, /* @ts-ignore */
220
- ...(ngDevMode ? [{ debugName: "wrapperHeight" }] : /* istanbul ignore next */ []));
221
- /** @ignore Row index currently dragged (row reorder). */
222
- this.draggedRowIndex = null;
223
- /** @ignore Selectable-row directives currently rendered, by host element (keyboard range selection). */
224
- this.selectableRowRefs = new Map();
225
- /** @ignore Shift-selection anchor (absolute row index). */
226
- this.anchorRowIndex = null;
227
- /** @ignore */
228
- this.uid = `ui-table-${nextUid++}`;
229
- /** @ignore */
230
- this.destroyRef = inject(DestroyRef);
231
- // --- Internal state (linked to the presort / pagination inputs) -----------
232
- /** @ignore Active single sort; reset when the `sortField`/`sortOrder` inputs change. */
233
- this.sortState = linkedSignal(() => {
234
- const field = this.sortField();
235
- return field ? { field, order: this.sortOrder() } : null;
236
- }, /* @ts-ignore */
237
- ...(ngDevMode ? [{ debugName: "sortState" }] : /* istanbul ignore next */ []));
238
- /** @ignore Active multiple sort. */
239
- this.multiSortState = linkedSignal(() => this.multiSortMeta() ?? [], /* @ts-ignore */
240
- ...(ngDevMode ? [{ debugName: "multiSortState" }] : /* istanbul ignore next */ []));
241
- /** @ignore Effective rows-per-page (user can change it via the paginator select). */
242
- this.rowsState = linkedSignal(() => this.rows(), /* @ts-ignore */
243
- ...(ngDevMode ? [{ debugName: "rowsState" }] : /* istanbul ignore next */ []));
244
- /** @ignore Number of header cells (drives the colspan of the empty row). */
245
- this.columnCount = signal(1, /* @ts-ignore */
246
- ...(ngDevMode ? [{ debugName: "columnCount" }] : /* istanbul ignore next */ []));
247
- /** @ignore Measured header height (sticky offset of frozen rows). */
248
- this.frozenRowsTop = signal(0, /* @ts-ignore */
249
- ...(ngDevMode ? [{ debugName: "frozenRowsTop" }] : /* istanbul ignore next */ []));
250
- // --- Data pipeline ---------------------------------------------------------
251
- /** @ignore Sorted dataset (identity when `customSort` delegates sorting). */
252
- this.processedData = computed(() => {
253
- const data = this.value() ?? [];
254
- // Lazy mode: the consumer owns the ordering (sortChange → server round-trip).
255
- if (!data.length || this.customSort() || this.lazy())
256
- return data;
257
- if (this.sortMode() === 'single') {
258
- const sort = this.sortState();
259
- if (!sort)
260
- return data;
261
- return [...data].sort((a, b) => sort.order *
262
- compareValues(resolveFieldData(a, sort.field), resolveFieldData(b, sort.field)));
263
- }
264
- const metas = this.multiSortState();
265
- if (!metas.length)
266
- return data;
267
- return [...data].sort((a, b) => {
268
- for (const meta of metas) {
269
- const result = meta.order *
270
- compareValues(resolveFieldData(a, meta.field), resolveFieldData(b, meta.field));
271
- if (result !== 0)
272
- return result;
273
- }
274
- return 0;
275
- });
276
- }, /* @ts-ignore */
277
- ...(ngDevMode ? [{ debugName: "processedData" }] : /* istanbul ignore next */ []));
278
- /** @ignore Paginator total: server-provided in lazy mode, client count otherwise. */
279
- this.effectiveTotalRecords = computed(() => this.lazy()
280
- ? (this.totalRecords() ?? this.processedData().length)
281
- : this.processedData().length, /* @ts-ignore */
282
- ...(ngDevMode ? [{ debugName: "effectiveTotalRecords" }] : /* istanbul ignore next */ []));
283
- /** @ignore */
284
- this.pageCount = computed(() => Math.max(1, Math.ceil(this.effectiveTotalRecords() / Math.max(1, this.rowsState()))), /* @ts-ignore */
285
- ...(ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []));
286
- /** @ignore `first` clamped to the dataset (data may shrink under the cursor). */
287
- this.clampedFirst = computed(() => {
288
- const rows = Math.max(1, this.rowsState());
289
- const maxFirst = (this.pageCount() - 1) * rows;
290
- return Math.min(Math.max(0, this.first()), maxFirst);
291
- }, /* @ts-ignore */
292
- ...(ngDevMode ? [{ debugName: "clampedFirst" }] : /* istanbul ignore next */ []));
293
- /** @ignore Rendered window of the virtual scroll (with a small buffer). */
294
- this.virtualRange = computed(() => {
295
- const total = this.processedData().length;
296
- if (!this.virtualScroll())
297
- return { start: 0, end: total };
298
- const itemSize = Math.max(1, this.virtualScrollItemSize());
299
- const buffer = 5;
300
- const start = Math.max(0, Math.floor(this.wrapperScrollTop() / itemSize) - buffer);
301
- const visible = Math.ceil(Math.max(0, this.wrapperHeight()) / itemSize) + 2 * buffer;
302
- return { start, end: Math.min(total, start + visible) };
303
- }, /* @ts-ignore */
304
- ...(ngDevMode ? [{ debugName: "virtualRange" }] : /* istanbul ignore next */ []));
305
- /** @ignore Heights of the spacer rows keeping the scrollbar honest (virtual scroll). */
306
- this.virtualPadding = computed(() => {
307
- if (!this.virtualScroll())
308
- return { top: 0, bottom: 0 };
309
- const itemSize = Math.max(1, this.virtualScrollItemSize());
310
- const { start, end } = this.virtualRange();
311
- return { top: start * itemSize, bottom: (this.processedData().length - end) * itemSize };
312
- }, /* @ts-ignore */
313
- ...(ngDevMode ? [{ debugName: "virtualPadding" }] : /* istanbul ignore next */ []));
314
- /** @ignore Absolute index of the first rendered row. */
315
- this.pageOffset = computed(() => {
316
- if (this.virtualScroll())
317
- return this.virtualRange().start;
318
- return this.paginator() ? this.clampedFirst() : 0;
319
- }, /* @ts-ignore */
320
- ...(ngDevMode ? [{ debugName: "pageOffset" }] : /* istanbul ignore next */ []));
321
- /** @ignore Rows actually rendered (page, virtual window, or whole dataset). */
322
- this.pageData = computed(() => {
323
- const data = this.processedData();
324
- if (this.virtualScroll()) {
325
- const { start, end } = this.virtualRange();
326
- return data.slice(start, end);
327
- }
328
- // Lazy pagination: `value` IS the current server page — never slice it.
329
- if (!this.paginator() || this.lazy())
330
- return data;
331
- const start = this.clampedFirst();
332
- return data.slice(start, start + this.rowsState());
333
- }, /* @ts-ignore */
334
- ...(ngDevMode ? [{ debugName: "pageData" }] : /* istanbul ignore next */ []));
335
- /** @ignore */
336
- this.isFlexScroll = computed(() => this.scrollable() && this.scrollHeight() === 'flex', /* @ts-ignore */
337
- ...(ngDevMode ? [{ debugName: "isFlexScroll" }] : /* istanbul ignore next */ []));
338
- /** @ignore Viewport max-height (fixed scrollHeight mode only). */
339
- this.scrollMaxHeight = computed(() => {
340
- const height = this.scrollHeight();
341
- return this.scrollable() && height && height !== 'flex' ? height : null;
342
- }, /* @ts-ignore */
343
- ...(ngDevMode ? [{ debugName: "scrollMaxHeight" }] : /* istanbul ignore next */ []));
344
- /** @ignore */
345
- this.classes = computed(() => {
346
- const c = ['ui-table'];
347
- if (this.size() !== 'default')
348
- c.push(`_${this.size()}`);
349
- if (this.showGridlines())
350
- c.push('_gridlines');
351
- if (this.stripedRows())
352
- c.push('_striped');
353
- if (this.rowHover() || this.selectionMode())
354
- c.push('_hoverable');
355
- if (this.scrollable())
356
- c.push('_scrollable');
357
- if (this.isFlexScroll())
358
- c.push('_flex-scroll');
359
- if (this.resizableColumns())
360
- c.push('_resizable');
361
- if (this.virtualScroll())
362
- c.push('_virtual');
363
- return c.join(' ');
364
- }, /* @ts-ignore */
365
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
366
- /** @ignore Selection normalized as an array. */
367
- this.selectionArray = computed(() => {
368
- const sel = this.selection();
369
- if (sel == null)
370
- return [];
371
- return Array.isArray(sel) ? sel : [sel];
372
- }, /* @ts-ignore */
373
- ...(ngDevMode ? [{ debugName: "selectionArray" }] : /* istanbul ignore next */ []));
374
- /** @ignore Every processed row is selected (header checkbox state). */
375
- this.allSelected = computed(() => {
376
- const data = this.processedData();
377
- if (!data.length)
378
- return false;
379
- const selection = this.selectionArray();
380
- return data.every((row) => selection.some((s) => this.rowEquals(s, row)));
381
- }, /* @ts-ignore */
382
- ...(ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []));
383
- /** @ignore Partial selection (header checkbox indeterminate state). */
384
- this.partiallySelected = computed(() => !this.allSelected() && this.selectionArray().length > 0, /* @ts-ignore */
385
- ...(ngDevMode ? [{ debugName: "partiallySelected" }] : /* istanbul ignore next */ []));
386
- // --- Keyboard selection helpers ---------------------------------------------------------------
387
- /** @ignore Row receiving the tab stop (first selected row on the page, else the first row). */
388
- this.tabbableRow = computed(() => {
389
- const page = this.pageData();
390
- return page.find((row) => this.isSelected(row)) ?? page[0];
391
- }, /* @ts-ignore */
392
- ...(ngDevMode ? [{ debugName: "tabbableRow" }] : /* istanbul ignore next */ []));
393
- /** @ignore Stable id base for internal controls. */
394
- this.idBase = this.uid;
395
- if (isDevMode()) {
396
- effect(() => {
397
- if (Object.keys(this.expandedRowKeys()).length && !this.dataKey()) {
398
- console.warn('[ui-table] `expandedRowKeys` requires `dataKey` to identify rows.');
399
- }
400
- if (this.virtualScroll() &&
401
- (!this.scrollable() || !this.scrollHeight() || this.scrollHeight() === 'flex')) {
402
- console.warn('[ui-table] `virtualScroll` requires `scrollable` and a fixed `scrollHeight`.');
403
- }
404
- if (this.totalRecords() !== undefined && !this.lazy()) {
405
- console.warn('[ui-table] `totalRecords` is ignored without `lazy`.');
406
- }
407
- if (this.lazy() && this.paginator() && this.totalRecords() === undefined) {
408
- console.warn('[ui-table] `lazy` + `paginator` requires `totalRecords` (server total) for the paginator.');
409
- }
410
- });
411
- }
412
- // Lazy virtual scroll: notify the consumer whenever the window moves.
413
- let lastLazyRange = null;
414
- effect(() => {
415
- if (!this.virtualScroll() || !this.lazy())
416
- return;
417
- const { start, end } = this.virtualRange();
418
- if (lastLazyRange?.first === start && lastLazyRange?.last === end)
419
- return;
420
- lastLazyRange = { first: start, last: end };
421
- this.lazyLoad.emit(lastLazyRange);
422
- });
423
- // Measured DOM facts: column count (empty-row colspan) + header height
424
- // (sticky offset of the frozen rows). Reads happen after each render so
425
- // template-driven changes (columns, size…) are picked up.
426
- afterRenderEffect(() => {
427
- this.value();
428
- this.size();
429
- this.headerTemplate();
430
- this.frozenValue();
431
- this.measureStickyMetrics();
432
- const wrapper = this.wrapperEl()?.nativeElement;
433
- if (wrapper)
434
- this.wrapperHeight.set(wrapper.clientHeight);
435
- });
436
- // Late layout shifts (font loading, column resize…) move the sticky
437
- // offsets without any signal change: re-measure when the table resizes.
438
- afterNextRender(() => {
439
- if (typeof ResizeObserver === 'undefined')
440
- return;
441
- const table = this.tableEl()?.nativeElement;
442
- const wrapper = this.wrapperEl()?.nativeElement;
443
- const observer = new ResizeObserver(() => {
444
- this.measureStickyMetrics();
445
- if (wrapper)
446
- this.wrapperHeight.set(wrapper.clientHeight);
447
- });
448
- if (table)
449
- observer.observe(table);
450
- if (wrapper)
451
- observer.observe(wrapper);
452
- this.destroyRef.onDestroy(() => observer.disconnect());
453
- });
454
- }
455
- /** @ignore Measures the header height + stacks the frozen-row sticky offsets. */
456
- measureStickyMetrics() {
457
- const thead = this.theadEl()?.nativeElement;
458
- if (!thead)
459
- return;
460
- const cells = thead.querySelectorAll('th').length;
461
- if (cells > 0)
462
- this.columnCount.set(cells);
463
- const headerHeight = thead.getBoundingClientRect().height;
464
- this.frozenRowsTop.set(Math.floor(headerHeight));
465
- const frozenBody = thead.parentElement?.querySelector('tbody._frozen-rows');
466
- if (!frozenBody)
467
- return;
468
- // Each frozen row sticks below the previous one (heights are unaffected
469
- // by the sticky shift, unlike offsetTop). Offsets accumulate fractional
470
- // heights and are FLOORED: rounding up would open a sub-pixel gap where
471
- // the scrolled content shows through between two stuck rows — flooring
472
- // makes rows overlap the previous one by <1px instead (invisible).
473
- let offset = headerHeight;
474
- for (const row of Array.from(frozenBody.rows)) {
475
- for (const cell of Array.from(row.cells))
476
- cell.style.top = `${Math.floor(offset)}px`;
477
- offset += row.getBoundingClientRect().height;
478
- }
479
- }
480
- /** @ignore Template context of a body row. */
481
- rowContext(row, pageIndex, frozen = false) {
482
- return {
483
- $implicit: row,
484
- rowIndex: frozen ? pageIndex : this.pageOffset() + pageIndex,
485
- even: pageIndex % 2 === 1,
486
- selected: this.isSelected(row),
487
- expanded: this.isRowExpanded(row),
488
- frozen,
489
- };
490
- }
491
- // --- Sort --------------------------------------------------------------------
492
- /** Current direction of a column: 1, -1, or 0 when unsorted. */
493
- getSortOrder(field) {
494
- if (this.sortMode() === 'single') {
495
- const sort = this.sortState();
496
- return sort?.field === field ? sort.order : 0;
497
- }
498
- return this.multiSortState().find((m) => m.field === field)?.order ?? 0;
499
- }
500
- /** @ignore Cycles the sort of a column (called by `uiSortableColumn`). */
501
- toggleColumnSort(field, originalEvent) {
502
- const defaultOrder = this.defaultSortOrder() || 1;
503
- if (this.sortMode() === 'single') {
504
- const current = this.sortState();
505
- if (current?.field === field) {
506
- // asc → desc → unsorted cycle.
507
- this.sortState.set(current.order === defaultOrder ? { field, order: -defaultOrder } : null);
508
- }
509
- else {
510
- this.sortState.set({ field, order: defaultOrder });
511
- }
512
- }
513
- else {
514
- const metas = [...this.multiSortState()];
515
- const index = metas.findIndex((m) => m.field === field);
516
- const metaKey = originalEvent instanceof MouseEvent && (originalEvent.metaKey || originalEvent.ctrlKey);
517
- if (!metaKey) {
518
- // Plain click: restart a fresh sort on this column alone.
519
- const existing = index >= 0 ? metas[index] : undefined;
520
- this.multiSortState.set([{ field, order: existing ? -existing.order : defaultOrder }]);
521
- }
522
- else if (index >= 0) {
523
- metas[index] = { field, order: -metas[index].order };
524
- this.multiSortState.set(metas);
525
- }
526
- else {
527
- this.multiSortState.set([...metas, { field, order: defaultOrder }]);
528
- }
529
- }
530
- const single = this.sortState();
531
- if (this.customSort()) {
532
- this.sortFunction.emit({
533
- data: this.value() ?? [],
534
- mode: this.sortMode(),
535
- field: this.sortMode() === 'single' ? single?.field : undefined,
536
- order: this.sortMode() === 'single' ? (single?.order ?? 0) : undefined,
537
- multiSortMeta: this.sortMode() === 'multiple' ? this.multiSortState() : undefined,
538
- });
539
- }
540
- this.sortChange.emit({
541
- mode: this.sortMode(),
542
- field: this.sortMode() === 'single' ? single?.field : undefined,
543
- order: this.sortMode() === 'single' ? (single?.order ?? 0) : undefined,
544
- multiSortMeta: this.sortMode() === 'multiple' ? this.multiSortState() : undefined,
545
- });
546
- if (this.paginator())
547
- this.first.set(0);
548
- }
549
- // --- Selection ------------------------------------------------------------------
550
- /** @ignore Row equality: by `dataKey` when provided, by reference otherwise. */
551
- rowEquals(a, b) {
552
- const key = this.dataKey();
553
- return key ? resolveFieldData(a, key) === resolveFieldData(b, key) : a === b;
554
- }
555
- /** True when the row is part of the current selection. */
556
- isSelected(row) {
557
- return this.selectionArray().some((s) => this.rowEquals(s, row));
558
- }
559
- /** @ignore Row click / Enter / Space (called by `uiSelectableRow`). */
560
- handleRowClick(originalEvent, data, index) {
561
- const mode = this.selectionMode();
562
- if (!mode)
563
- return;
564
- // Clicks on interactive descendants (buttons, links, form controls…)
565
- // belong to those controls, not to the row selection.
566
- const target = originalEvent.target;
567
- if (target?.closest('button, a, input, label, select, textarea'))
568
- return;
569
- const pointer = originalEvent instanceof MouseEvent ? originalEvent : null;
570
- if (mode === 'multiple' && pointer?.shiftKey && this.anchorRowIndex != null) {
571
- this.selectRange(originalEvent, index);
572
- return;
573
- }
574
- const selected = this.isSelected(data);
575
- const metaKey = !!pointer && (pointer.metaKey || pointer.ctrlKey);
576
- if (this.metaKeySelection()) {
577
- if (selected && metaKey) {
578
- this.unselectRow(originalEvent, data, index, 'row');
579
- }
580
- else if (mode === 'single') {
581
- this.selection.set(data);
582
- this.rowSelect.emit({ originalEvent, data, index, type: 'row' });
583
- }
584
- else {
585
- this.selection.set(metaKey ? [...this.selectionArray(), data] : [data]);
586
- this.rowSelect.emit({ originalEvent, data, index, type: 'row' });
587
- }
588
- }
589
- else if (selected) {
590
- this.unselectRow(originalEvent, data, index, 'row');
591
- }
592
- else if (mode === 'single') {
593
- this.selection.set(data);
594
- this.rowSelect.emit({ originalEvent, data, index, type: 'row' });
595
- }
596
- else {
597
- this.selection.set([...this.selectionArray(), data]);
598
- this.rowSelect.emit({ originalEvent, data, index, type: 'row' });
599
- }
600
- this.anchorRowIndex = index;
601
- }
602
- /** @ignore Maps an absolute row index onto `processedData` (page-local in lazy pagination). */
603
- dataIndex(index) {
604
- return this.lazy() && this.paginator() && !this.virtualScroll()
605
- ? index - this.clampedFirst()
606
- : index;
607
- }
608
- /** @ignore Shift+click / Shift+Arrow range selection (replaces the selection). */
609
- selectRange(originalEvent, index) {
610
- const anchorLocal = this.anchorRowIndex == null ? null : this.dataIndex(this.anchorRowIndex);
611
- // Lazy pagination: an anchor from a page no longer loaded can't seed a range — restart from this click.
612
- const anchor = anchorLocal == null || anchorLocal < 0 || anchorLocal >= this.processedData().length
613
- ? index
614
- : this.anchorRowIndex;
615
- this.anchorRowIndex = anchor;
616
- const start = Math.min(anchor, index);
617
- const end = Math.max(anchor, index);
618
- const range = this.processedData().slice(this.dataIndex(start), this.dataIndex(end) + 1);
619
- this.selection.set([...range]);
620
- for (const [offset, data] of range.entries()) {
621
- this.rowSelect.emit({ originalEvent, data, index: start + offset, type: 'row' });
622
- }
623
- }
624
- /** @ignore Checkbox-column toggle (called by `ui-table-checkbox`). */
625
- toggleRowWithCheckbox(originalEvent, data, index) {
626
- if (this.isSelected(data)) {
627
- this.selection.set(this.selectionArray().filter((s) => !this.rowEquals(s, data)));
628
- this.rowUnselect.emit({ originalEvent, data, index, type: 'checkbox' });
629
- }
630
- else {
631
- this.selection.set([...this.selectionArray(), data]);
632
- this.rowSelect.emit({ originalEvent, data, index, type: 'checkbox' });
633
- }
634
- this.anchorRowIndex = index ?? null;
635
- }
636
- /** @ignore Header checkbox toggle: selects / clears every processed row. */
637
- toggleAllRows(originalEvent, checked) {
638
- this.selection.set(checked ? [...this.processedData()] : []);
639
- this.headerCheckboxToggle.emit({ originalEvent, checked });
640
- }
641
- /** @ignore Radio-column selection (called by `ui-table-radio`). */
642
- selectRowWithRadio(originalEvent, data, index) {
643
- if (this.isSelected(data))
644
- return;
645
- this.selection.set(data);
646
- this.rowSelect.emit({ originalEvent, data, index, type: 'radio' });
647
- this.anchorRowIndex = index ?? null;
648
- }
649
- /** @ignore */
650
- unselectRow(originalEvent, data, index, type) {
651
- const mode = this.selectionMode();
652
- if (mode === 'single')
653
- this.selection.set(null);
654
- else
655
- this.selection.set(this.selectionArray().filter((s) => !this.rowEquals(s, data)));
656
- this.rowUnselect.emit({ originalEvent, data, index, type });
657
- }
658
- // --- Expansion ----------------------------------------------------------------------
659
- /** @ignore Key of a row for the expansion map. */
660
- rowKey(data) {
661
- const key = this.dataKey();
662
- if (!key) {
663
- if (isDevMode())
664
- console.warn('[ui-table] Row expansion requires `dataKey`.');
665
- return undefined;
666
- }
667
- return String(resolveFieldData(data, key));
668
- }
669
- /** True when the row is expanded. */
670
- isRowExpanded(data) {
671
- const key = this.dataKey();
672
- if (!key)
673
- return false;
674
- return !!this.expandedRowKeys()[String(resolveFieldData(data, key))];
675
- }
676
- /** Toggles the expansion of a row (used by `uiRowToggler`). */
677
- toggleRow(data, originalEvent) {
678
- const key = this.rowKey(data);
679
- if (key === undefined)
680
- return;
681
- const keys = { ...this.expandedRowKeys() };
682
- if (keys[key]) {
683
- delete keys[key];
684
- this.expandedRowKeys.set(keys);
685
- this.rowCollapse.emit({ originalEvent, data });
686
- }
687
- else {
688
- keys[key] = true;
689
- this.expandedRowKeys.set(keys);
690
- this.rowExpand.emit({ originalEvent, data });
691
- }
692
- }
693
- // --- Pagination (delegated to the standalone ui-paginator) ------------------------------
694
- /** @ignore Rows-per-page picked in the paginator select. */
695
- onPaginatorRows(rows) {
696
- this.rowsState.set(rows);
697
- }
698
- // --- Row reorder (drag & drop) -----------------------------------------------------------
699
- /** @ignore Drop of a dragged row: emits the reordered copy of `value`. */
700
- dropRow(dropIndex) {
701
- const dragIndex = this.draggedRowIndex;
702
- this.draggedRowIndex = null;
703
- if (dragIndex == null || dragIndex === dropIndex)
704
- return;
705
- const value = [...(this.value() ?? [])];
706
- if (dragIndex < 0 || dragIndex >= value.length || dropIndex < 0 || dropIndex >= value.length)
707
- return;
708
- const [moved] = value.splice(dragIndex, 1);
709
- value.splice(dropIndex, 0, moved);
710
- this.rowReorder.emit({ dragIndex, dropIndex, value });
711
- }
712
- // --- Virtual scroll -------------------------------------------------------------------------
713
- /** @ignore */
714
- onWrapperScroll() {
715
- if (!this.virtualScroll())
716
- return;
717
- const wrapper = this.wrapperEl()?.nativeElement;
718
- if (wrapper)
719
- this.wrapperScrollTop.set(wrapper.scrollTop);
720
- }
721
- /** @ignore Roving tabindex: only one row is tabbable (WAI-ARIA grid-like navigation). */
722
- isRowTabbable(data) {
723
- const tabbable = this.tabbableRow();
724
- return tabbable !== undefined && this.rowEquals(tabbable, data);
725
- }
726
- /** @ignore Selects every processed row (Ctrl+A). */
727
- selectAllRows(originalEvent) {
728
- if (this.selectionMode() !== 'multiple')
729
- return;
730
- this.selection.set([...this.processedData()]);
731
- this.headerCheckboxToggle.emit({ originalEvent, checked: true });
732
- }
733
- /** @ignore Selects from a row to the first / last processed row (Ctrl+Shift+Home / End). */
734
- selectRangeToEdge(index, edge) {
735
- if (this.selectionMode() !== 'multiple')
736
- return;
737
- const data = this.processedData();
738
- const localIndex = this.dataIndex(index);
739
- const range = edge === 'start' ? data.slice(0, localIndex + 1) : data.slice(localIndex);
740
- this.selection.set([...range]);
741
- this.anchorRowIndex = index;
742
- }
743
- // --- Column resize (fit mode) -------------------------------------------------------------
744
- /** @ignore Freezes every column width in px so the drag only moves the shared edge. */
745
- lockColumnWidths() {
746
- const table = this.tableEl()?.nativeElement;
747
- if (!table)
748
- return;
749
- const headerRow = table.querySelector('thead tr');
750
- if (!headerRow)
751
- return;
752
- // Measure everything BEFORE mutating: setting a width relayouts the table.
753
- const tableWidth = table.getBoundingClientRect().width;
754
- const cells = Array.from(headerRow.children);
755
- const widths = cells.map((cell) => cell.getBoundingClientRect().width);
756
- cells.forEach((cell, i) => (cell.style.width = `${widths[i]}px`));
757
- table.style.tableLayout = 'fixed';
758
- table.style.width = `${tableWidth}px`;
759
- }
760
- /** @ignore Fit-mode resize: the delta moves the edge between `cell` and its next sibling. */
761
- resizeColumnFit(cell, startWidth, nextStartWidth, delta) {
762
- const next = cell.nextElementSibling;
763
- if (!next)
764
- return false;
765
- const width = startWidth + delta;
766
- const nextWidth = nextStartWidth - delta;
767
- if (width < COLUMN_MIN_WIDTH || nextWidth < COLUMN_MIN_WIDTH)
768
- return false;
769
- cell.style.width = `${width}px`;
770
- next.style.width = `${nextWidth}px`;
771
- return true;
772
- }
773
- /** @ignore Forwarded from the resize directive once the drag ends. */
774
- notifyColResize(element, delta) {
775
- this.colResize.emit({ element, delta });
776
- }
777
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
778
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiTable, isStandalone: true, selector: "ui-table", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, stripedRows: { classPropertyName: "stripedRows", publicName: "stripedRows", isSignal: true, isRequired: false, transformFunction: null }, rowHover: { classPropertyName: "rowHover", publicName: "rowHover", isSignal: true, isRequired: false, transformFunction: null }, tableStyle: { classPropertyName: "tableStyle", publicName: "tableStyle", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, metaKeySelection: { classPropertyName: "metaKeySelection", publicName: "metaKeySelection", isSignal: true, isRequired: false, transformFunction: null }, sortMode: { classPropertyName: "sortMode", publicName: "sortMode", isSignal: true, isRequired: false, transformFunction: null }, sortField: { classPropertyName: "sortField", publicName: "sortField", isSignal: true, isRequired: false, transformFunction: null }, sortOrder: { classPropertyName: "sortOrder", publicName: "sortOrder", isSignal: true, isRequired: false, transformFunction: null }, multiSortMeta: { classPropertyName: "multiSortMeta", publicName: "multiSortMeta", isSignal: true, isRequired: false, transformFunction: null }, defaultSortOrder: { classPropertyName: "defaultSortOrder", publicName: "defaultSortOrder", isSignal: true, isRequired: false, transformFunction: null }, customSort: { classPropertyName: "customSort", publicName: "customSort", isSignal: true, isRequired: false, transformFunction: null }, paginator: { classPropertyName: "paginator", publicName: "paginator", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, first: { classPropertyName: "first", publicName: "first", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, pageLinks: { classPropertyName: "pageLinks", publicName: "pageLinks", isSignal: true, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, frozenValue: { classPropertyName: "frozenValue", publicName: "frozenValue", isSignal: true, isRequired: false, transformFunction: null }, expandedRowKeys: { classPropertyName: "expandedRowKeys", publicName: "expandedRowKeys", isSignal: true, isRequired: false, transformFunction: null }, resizableColumns: { classPropertyName: "resizableColumns", publicName: "resizableColumns", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingAriaLabel: { classPropertyName: "loadingAriaLabel", publicName: "loadingAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, emptyIcon: { classPropertyName: "emptyIcon", publicName: "emptyIcon", isSignal: true, isRequired: false, transformFunction: null }, virtualScroll: { classPropertyName: "virtualScroll", publicName: "virtualScroll", isSignal: true, isRequired: false, transformFunction: null }, virtualScrollItemSize: { classPropertyName: "virtualScrollItemSize", publicName: "virtualScrollItemSize", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", first: "firstChange", expandedRowKeys: "expandedRowKeysChange", rowSelect: "rowSelect", rowUnselect: "rowUnselect", headerCheckboxToggle: "headerCheckboxToggle", sortFunction: "sortFunction", sortChange: "sortChange", pageChange: "pageChange", rowExpand: "rowExpand", rowCollapse: "rowCollapse", colResize: "colResize", rowReorder: "rowReorder", lazyLoad: "lazyLoad" }, queries: [{ propertyName: "captionTemplate", first: true, predicate: ["caption"], descendants: true, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "bodyTemplate", first: true, predicate: ["body"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }, { propertyName: "expandedRowTemplate", first: true, predicate: ["expandedrow"], descendants: true, isSignal: true }, { propertyName: "emptyMessageTemplate", first: true, predicate: ["emptymessage"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "tableEl", first: true, predicate: ["tableEl"], descendants: true, isSignal: true }, { propertyName: "theadEl", first: true, predicate: ["theadEl"], descendants: true, isSignal: true }, { propertyName: "wrapperEl", first: true, predicate: ["wrapperEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"classes()\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n @if (captionTemplate(); as caption) {\n <div class=\"ui-table-caption\">\n <ng-container [ngTemplateOutlet]=\"caption\" />\n </div>\n }\n\n <div class=\"ui-table-container\">\n <div\n #wrapperEl\n class=\"ui-table-wrapper\"\n [attr.tabindex]=\"scrollable() ? 0 : null\"\n [style.max-height]=\"scrollMaxHeight()\"\n [style.--ui-table-frozen-top.px]=\"frozenRowsTop()\"\n (scroll)=\"onWrapperScroll()\"\n >\n <table #tableEl class=\"ui-table-table\" [style]=\"tableStyle() ?? null\">\n @if (headerTemplate(); as header) {\n <thead #theadEl class=\"ui-table-thead\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n </thead>\n }\n\n @if (!loading() && frozenValue()?.length) {\n <tbody class=\"ui-table-tbody _frozen-rows\">\n @for (row of frozenValue(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index, true)\"\n />\n }\n }\n </tbody>\n }\n\n <tbody class=\"ui-table-tbody\">\n @if (loading()) {\n <tr class=\"ui-table-loading-row\">\n <td class=\"ui-table-loading-cell\" [attr.colspan]=\"columnCount()\">\n <ui-spinner [ariaLabel]=\"loadingAriaLabel()\" />\n </td>\n </tr>\n } @else {\n @if (virtualScroll() && virtualPadding().top > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().top\"></td>\n </tr>\n }\n\n @for (row of pageData(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n @if (expandedRowTemplate(); as expansion) {\n @if (isRowExpanded(row)) {\n <ng-container\n [ngTemplateOutlet]=\"expansion\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n }\n } @empty {\n <tr class=\"ui-table-empty-row\">\n <td class=\"ui-table-empty-cell\" [attr.colspan]=\"columnCount()\">\n @if (emptyMessageTemplate(); as empty) {\n <ng-container [ngTemplateOutlet]=\"empty\" />\n } @else {\n <ui-empty-state size=\"small\" [icon]=\"emptyIcon()\" [title]=\"emptyMessage()\" />\n }\n </td>\n </tr>\n }\n\n @if (virtualScroll() && virtualPadding().bottom > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().bottom\"></td>\n </tr>\n }\n }\n </tbody>\n\n @if (footerTemplate(); as footer) {\n <tfoot class=\"ui-table-tfoot\">\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </tfoot>\n }\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <ui-paginator\n [totalRecords]=\"effectiveTotalRecords()\"\n [rows]=\"rowsState()\"\n (rowsChange)=\"onPaginatorRows($event)\"\n [first]=\"first()\"\n (firstChange)=\"first.set($event)\"\n [pageLinks]=\"pageLinks()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n ariaLabel=\"Pagination du tableau\"\n (pageChange)=\"pageChange.emit($event)\"\n />\n }\n</div>\n", styles: ["ui-table{display:block;min-width:0}ui-table:has(>.ui-table._flex-scroll){display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table{font-family:var(--ui-table-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-table-body-color, var(--table-body-content-odd))}.ui-table-container{min-width:0}.ui-table-wrapper{min-width:0;overflow-x:auto}.ui-table-loading-cell{text-align:center}.ui-table-loading-cell ui-spinner{display:flex;justify-content:center;padding:var(--ui-table-loading-padding-y, var(--units-3xl)) 0}.ui-table-table{width:100%;border-collapse:separate;border-spacing:0}.ui-table-table th,.ui-table-table td{box-sizing:border-box}.ui-table-caption{padding:var(--units-md) var(--units-default);font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table-thead th{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-head-surface, var(--table-head-surface-default));color:var(--ui-table-head-color, var(--table-head-content-default));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-head-stroke, var(--table-head-stroke-default));font-size:var(--size-typography-text-md);font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left;white-space:nowrap}.ui-table-tbody td{padding:var(--ui-table-cell-padding, var(--units-default));background-color:var(--ui-table-body-surface, var(--table-body-surface-odd));color:var(--ui-table-body-color, var(--table-body-content-odd));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-body-stroke, var(--table-body-stroke-odd));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-tbody tr:last-child td{border-bottom-color:transparent}.ui-table._striped .ui-table-tbody tr:nth-child(2n) td{background-color:var(--ui-table-body-surface-even, var(--table-body-surface-even));color:var(--ui-table-body-color-even, var(--table-body-content-even));border-bottom-color:var(--ui-table-body-stroke-even, var(--table-body-stroke-even))}.ui-table._hoverable .ui-table-tbody tr:hover td{background-color:var(--ui-table-body-surface-hover, var(--table-body-surface-hover));color:var(--ui-table-body-color-hover, var(--table-body-content-hover))}.ui-table-tbody tr._selected td,.ui-table._striped .ui-table-tbody tr._selected td{background-color:var(--ui-table-body-surface-selected, var(--informative-highlightlow-surface-default));color:var(--ui-table-body-color-selected, var(--informative-highlightlow-content-default));border-bottom-color:var(--ui-table-body-stroke-selected, var(--informative-highlightlow-stroke-default))}.ui-table._hoverable .ui-table-tbody tr._selected:hover td{background-color:var(--ui-table-body-surface-selected-hover, var(--informative-highlightlow-surface-hover));color:var(--ui-table-body-color-selected-hover, var(--informative-highlightlow-content-hover))}.ui-table-selectable-row{cursor:pointer}.ui-table-selectable-row:focus-visible{outline:var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid var(--ui-table-focus-ring-color, var(--global-border-focus));outline-offset:calc(-1 * var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))))}.ui-table-reorderable-row{cursor:grab}.ui-table-reorderable-row._drop-above td{box-shadow:inset 0 var(--ui-table-drop-indicator-width, var(--stroke-lg)) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-reorderable-row._drop-below td{box-shadow:inset 0 calc(-1 * var(--ui-table-drop-indicator-width, var(--stroke-lg))) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-empty-cell{text-align:center}.ui-table-empty-cell ui-empty-state{display:flex;justify-content:center;padding:var(--units-xl) 0}.ui-table-virtual-spacer td{padding:0;border:none;background:none}.ui-table-tfoot td{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-footer-surface, var(--table-footer-surface-default));color:var(--ui-table-footer-color, var(--table-footer-content-default));border-top:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-footer-stroke, var(--table-footer-stroke-default));font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left}.ui-table._small .ui-table-tbody td{padding:var(--ui-table-cell-padding-small, var(--units-sm) var(--units-md))}.ui-table._small .ui-table-thead th,.ui-table._small .ui-table-tfoot td{padding:var(--ui-table-head-padding-small, var(--units-sm) var(--units-md))}.ui-table._large .ui-table-tbody td{padding:var(--ui-table-cell-padding-large, var(--units-xl) var(--units-default))}.ui-table._large .ui-table-thead th,.ui-table._large .ui-table-tfoot td{padding:var(--ui-table-head-padding-large, var(--units-default))}.ui-table._gridlines .ui-table-table{border:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th,.ui-table._gridlines .ui-table-tbody td,.ui-table._gridlines .ui-table-tfoot td{border-right:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th:last-child,.ui-table._gridlines .ui-table-tbody td:last-child,.ui-table._gridlines .ui-table-tfoot td:last-child{border-right:none}.ui-table-sortable-column{cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-sortable-column:hover{background-color:var(--ui-table-head-surface-hover, var(--table-head-surface-hover));color:var(--ui-table-head-color-hover, var(--table-head-content-hover))}.ui-table-sortable-column:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-table-focus-ring-color, var(--global-border-focus))}.ui-table-sortable-column .ui-table-sort-icon{margin-left:var(--units-xs);vertical-align:middle}.ui-table._scrollable .ui-table-wrapper{overflow:auto}.ui-table._scrollable .ui-table-thead th{position:sticky;top:0;z-index:2}.ui-table._scrollable .ui-table-thead th._frozen-left,.ui-table._scrollable .ui-table-thead th._frozen-right{z-index:3}.ui-table._scrollable .ui-table-tfoot td{position:sticky;bottom:0;z-index:2}.ui-table._scrollable .ui-table-tbody._frozen-rows td{position:sticky;top:var(--ui-table-frozen-top, 0);z-index:1;font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table._flex-scroll{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table._flex-scroll .ui-table-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0}.ui-table._flex-scroll .ui-table-wrapper{flex:1 1 0;min-height:0}.ui-table._virtual .ui-table-wrapper{overflow-anchor:none}.ui-table .ui-table-table th._frozen-left,.ui-table .ui-table-table th._frozen-right,.ui-table .ui-table-table td._frozen-left,.ui-table .ui-table-table td._frozen-right{position:sticky;z-index:1}.ui-table-thead th._frozen-left,.ui-table-thead th._frozen-right{z-index:3}.ui-table._resizable .ui-table-thead th{position:relative;overflow:hidden}.ui-table-column-resizer{position:absolute;top:0;right:0;width:var(--ui-table-resizer-hit-width, var(--units-sm));height:100%;cursor:col-resize;touch-action:none}.ui-table-column-resizer:hover{border-right:var(--stroke-default) solid var(--ui-table-resizer-stroke-hover, var(--global-border-default-hover))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: UiPaginator, selector: "ui-paginator", inputs: ["totalRecords", "rows", "first", "pageLinks", "ellipsis", "boundaryCount", "rowsPerPageOptions", "showFirstLastIcon", "showPageLinks", "showCurrentPageReport", "currentPageReportTemplate", "disabled", "ripple", "ariaLabel", "pageAriaLabel", "firstPageAriaLabel", "prevPageAriaLabel", "nextPageAriaLabel", "lastPageAriaLabel", "rowsPerPageAriaLabel"], outputs: ["rowsChange", "firstChange", "pageChange"] }, { kind: "component", type: UiEmptyState, selector: "ui-empty-state", inputs: ["title", "description", "icon", "iconType", "size", "showMedia", "ariaLabel", "ariaLabelledBy"] }, { kind: "component", type: UiSpinner, selector: "ui-spinner", inputs: ["size", "orientation", "label", "ariaLabel", "spinnerTemplate", "image", "imageAlt", "icon", "strokeWidth", "fill", "animationDuration", "delay"] }], encapsulation: i0.ViewEncapsulation.None }); }
779
- }
780
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTable, decorators: [{
781
- type: Component,
782
- args: [{ selector: 'ui-table', imports: [NgTemplateOutlet, UiPaginator, UiEmptyState, UiSpinner], encapsulation: ViewEncapsulation.None, template: "<div [class]=\"classes()\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n @if (captionTemplate(); as caption) {\n <div class=\"ui-table-caption\">\n <ng-container [ngTemplateOutlet]=\"caption\" />\n </div>\n }\n\n <div class=\"ui-table-container\">\n <div\n #wrapperEl\n class=\"ui-table-wrapper\"\n [attr.tabindex]=\"scrollable() ? 0 : null\"\n [style.max-height]=\"scrollMaxHeight()\"\n [style.--ui-table-frozen-top.px]=\"frozenRowsTop()\"\n (scroll)=\"onWrapperScroll()\"\n >\n <table #tableEl class=\"ui-table-table\" [style]=\"tableStyle() ?? null\">\n @if (headerTemplate(); as header) {\n <thead #theadEl class=\"ui-table-thead\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n </thead>\n }\n\n @if (!loading() && frozenValue()?.length) {\n <tbody class=\"ui-table-tbody _frozen-rows\">\n @for (row of frozenValue(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index, true)\"\n />\n }\n }\n </tbody>\n }\n\n <tbody class=\"ui-table-tbody\">\n @if (loading()) {\n <tr class=\"ui-table-loading-row\">\n <td class=\"ui-table-loading-cell\" [attr.colspan]=\"columnCount()\">\n <ui-spinner [ariaLabel]=\"loadingAriaLabel()\" />\n </td>\n </tr>\n } @else {\n @if (virtualScroll() && virtualPadding().top > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().top\"></td>\n </tr>\n }\n\n @for (row of pageData(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n @if (expandedRowTemplate(); as expansion) {\n @if (isRowExpanded(row)) {\n <ng-container\n [ngTemplateOutlet]=\"expansion\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n }\n } @empty {\n <tr class=\"ui-table-empty-row\">\n <td class=\"ui-table-empty-cell\" [attr.colspan]=\"columnCount()\">\n @if (emptyMessageTemplate(); as empty) {\n <ng-container [ngTemplateOutlet]=\"empty\" />\n } @else {\n <ui-empty-state size=\"small\" [icon]=\"emptyIcon()\" [title]=\"emptyMessage()\" />\n }\n </td>\n </tr>\n }\n\n @if (virtualScroll() && virtualPadding().bottom > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().bottom\"></td>\n </tr>\n }\n }\n </tbody>\n\n @if (footerTemplate(); as footer) {\n <tfoot class=\"ui-table-tfoot\">\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </tfoot>\n }\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <ui-paginator\n [totalRecords]=\"effectiveTotalRecords()\"\n [rows]=\"rowsState()\"\n (rowsChange)=\"onPaginatorRows($event)\"\n [first]=\"first()\"\n (firstChange)=\"first.set($event)\"\n [pageLinks]=\"pageLinks()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n ariaLabel=\"Pagination du tableau\"\n (pageChange)=\"pageChange.emit($event)\"\n />\n }\n</div>\n", styles: ["ui-table{display:block;min-width:0}ui-table:has(>.ui-table._flex-scroll){display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table{font-family:var(--ui-table-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-table-body-color, var(--table-body-content-odd))}.ui-table-container{min-width:0}.ui-table-wrapper{min-width:0;overflow-x:auto}.ui-table-loading-cell{text-align:center}.ui-table-loading-cell ui-spinner{display:flex;justify-content:center;padding:var(--ui-table-loading-padding-y, var(--units-3xl)) 0}.ui-table-table{width:100%;border-collapse:separate;border-spacing:0}.ui-table-table th,.ui-table-table td{box-sizing:border-box}.ui-table-caption{padding:var(--units-md) var(--units-default);font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table-thead th{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-head-surface, var(--table-head-surface-default));color:var(--ui-table-head-color, var(--table-head-content-default));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-head-stroke, var(--table-head-stroke-default));font-size:var(--size-typography-text-md);font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left;white-space:nowrap}.ui-table-tbody td{padding:var(--ui-table-cell-padding, var(--units-default));background-color:var(--ui-table-body-surface, var(--table-body-surface-odd));color:var(--ui-table-body-color, var(--table-body-content-odd));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-body-stroke, var(--table-body-stroke-odd));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-tbody tr:last-child td{border-bottom-color:transparent}.ui-table._striped .ui-table-tbody tr:nth-child(2n) td{background-color:var(--ui-table-body-surface-even, var(--table-body-surface-even));color:var(--ui-table-body-color-even, var(--table-body-content-even));border-bottom-color:var(--ui-table-body-stroke-even, var(--table-body-stroke-even))}.ui-table._hoverable .ui-table-tbody tr:hover td{background-color:var(--ui-table-body-surface-hover, var(--table-body-surface-hover));color:var(--ui-table-body-color-hover, var(--table-body-content-hover))}.ui-table-tbody tr._selected td,.ui-table._striped .ui-table-tbody tr._selected td{background-color:var(--ui-table-body-surface-selected, var(--informative-highlightlow-surface-default));color:var(--ui-table-body-color-selected, var(--informative-highlightlow-content-default));border-bottom-color:var(--ui-table-body-stroke-selected, var(--informative-highlightlow-stroke-default))}.ui-table._hoverable .ui-table-tbody tr._selected:hover td{background-color:var(--ui-table-body-surface-selected-hover, var(--informative-highlightlow-surface-hover));color:var(--ui-table-body-color-selected-hover, var(--informative-highlightlow-content-hover))}.ui-table-selectable-row{cursor:pointer}.ui-table-selectable-row:focus-visible{outline:var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid var(--ui-table-focus-ring-color, var(--global-border-focus));outline-offset:calc(-1 * var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))))}.ui-table-reorderable-row{cursor:grab}.ui-table-reorderable-row._drop-above td{box-shadow:inset 0 var(--ui-table-drop-indicator-width, var(--stroke-lg)) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-reorderable-row._drop-below td{box-shadow:inset 0 calc(-1 * var(--ui-table-drop-indicator-width, var(--stroke-lg))) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-empty-cell{text-align:center}.ui-table-empty-cell ui-empty-state{display:flex;justify-content:center;padding:var(--units-xl) 0}.ui-table-virtual-spacer td{padding:0;border:none;background:none}.ui-table-tfoot td{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-footer-surface, var(--table-footer-surface-default));color:var(--ui-table-footer-color, var(--table-footer-content-default));border-top:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-footer-stroke, var(--table-footer-stroke-default));font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left}.ui-table._small .ui-table-tbody td{padding:var(--ui-table-cell-padding-small, var(--units-sm) var(--units-md))}.ui-table._small .ui-table-thead th,.ui-table._small .ui-table-tfoot td{padding:var(--ui-table-head-padding-small, var(--units-sm) var(--units-md))}.ui-table._large .ui-table-tbody td{padding:var(--ui-table-cell-padding-large, var(--units-xl) var(--units-default))}.ui-table._large .ui-table-thead th,.ui-table._large .ui-table-tfoot td{padding:var(--ui-table-head-padding-large, var(--units-default))}.ui-table._gridlines .ui-table-table{border:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th,.ui-table._gridlines .ui-table-tbody td,.ui-table._gridlines .ui-table-tfoot td{border-right:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th:last-child,.ui-table._gridlines .ui-table-tbody td:last-child,.ui-table._gridlines .ui-table-tfoot td:last-child{border-right:none}.ui-table-sortable-column{cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-sortable-column:hover{background-color:var(--ui-table-head-surface-hover, var(--table-head-surface-hover));color:var(--ui-table-head-color-hover, var(--table-head-content-hover))}.ui-table-sortable-column:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-table-focus-ring-color, var(--global-border-focus))}.ui-table-sortable-column .ui-table-sort-icon{margin-left:var(--units-xs);vertical-align:middle}.ui-table._scrollable .ui-table-wrapper{overflow:auto}.ui-table._scrollable .ui-table-thead th{position:sticky;top:0;z-index:2}.ui-table._scrollable .ui-table-thead th._frozen-left,.ui-table._scrollable .ui-table-thead th._frozen-right{z-index:3}.ui-table._scrollable .ui-table-tfoot td{position:sticky;bottom:0;z-index:2}.ui-table._scrollable .ui-table-tbody._frozen-rows td{position:sticky;top:var(--ui-table-frozen-top, 0);z-index:1;font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table._flex-scroll{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table._flex-scroll .ui-table-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0}.ui-table._flex-scroll .ui-table-wrapper{flex:1 1 0;min-height:0}.ui-table._virtual .ui-table-wrapper{overflow-anchor:none}.ui-table .ui-table-table th._frozen-left,.ui-table .ui-table-table th._frozen-right,.ui-table .ui-table-table td._frozen-left,.ui-table .ui-table-table td._frozen-right{position:sticky;z-index:1}.ui-table-thead th._frozen-left,.ui-table-thead th._frozen-right{z-index:3}.ui-table._resizable .ui-table-thead th{position:relative;overflow:hidden}.ui-table-column-resizer{position:absolute;top:0;right:0;width:var(--ui-table-resizer-hit-width, var(--units-sm));height:100%;cursor:col-resize;touch-action:none}.ui-table-column-resizer:hover{border-right:var(--stroke-default) solid var(--ui-table-resizer-stroke-hover, var(--global-border-default-hover))}\n"] }]
783
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showGridlines: [{ type: i0.Input, args: [{ isSignal: true, alias: "showGridlines", required: false }] }], stripedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "stripedRows", required: false }] }], rowHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHover", required: false }] }], tableStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableStyle", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], metaKeySelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "metaKeySelection", required: false }] }], sortMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortMode", required: false }] }], sortField: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortField", required: false }] }], sortOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortOrder", required: false }] }], multiSortMeta: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiSortMeta", required: false }] }], defaultSortOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSortOrder", required: false }] }], customSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "customSort", required: false }] }], paginator: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginator", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], first: [{ type: i0.Input, args: [{ isSignal: true, alias: "first", required: false }] }, { type: i0.Output, args: ["firstChange"] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], pageLinks: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageLinks", required: false }] }], totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], scrollable: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollable", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], frozenValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "frozenValue", required: false }] }], expandedRowKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedRowKeys", required: false }] }, { type: i0.Output, args: ["expandedRowKeysChange"] }], resizableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizableColumns", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingAriaLabel", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], emptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyIcon", required: false }] }], virtualScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScroll", required: false }] }], virtualScrollItemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualScrollItemSize", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], rowSelect: [{ type: i0.Output, args: ["rowSelect"] }], rowUnselect: [{ type: i0.Output, args: ["rowUnselect"] }], headerCheckboxToggle: [{ type: i0.Output, args: ["headerCheckboxToggle"] }], sortFunction: [{ type: i0.Output, args: ["sortFunction"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], rowExpand: [{ type: i0.Output, args: ["rowExpand"] }], rowCollapse: [{ type: i0.Output, args: ["rowCollapse"] }], colResize: [{ type: i0.Output, args: ["colResize"] }], rowReorder: [{ type: i0.Output, args: ["rowReorder"] }], lazyLoad: [{ type: i0.Output, args: ["lazyLoad"] }], captionTemplate: [{ type: i0.ContentChild, args: ['caption', { isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { isSignal: true }] }], bodyTemplate: [{ type: i0.ContentChild, args: ['body', { isSignal: true }] }], footerTemplate: [{ type: i0.ContentChild, args: ['footer', { isSignal: true }] }], expandedRowTemplate: [{ type: i0.ContentChild, args: ['expandedrow', { isSignal: true }] }], emptyMessageTemplate: [{ type: i0.ContentChild, args: ['emptymessage', { isSignal: true }] }], tableEl: [{ type: i0.ViewChild, args: ['tableEl', { isSignal: true }] }], theadEl: [{ type: i0.ViewChild, args: ['theadEl', { isSignal: true }] }], wrapperEl: [{ type: i0.ViewChild, args: ['wrapperEl', { isSignal: true }] }] } });
784
- /**
785
- * uiSortableColumn — makes a `<th>` sortable.
786
- *
787
- * Click / Enter / Space cycles ascending → descending → unsorted (single
788
- * mode) or composes with Ctrl/Cmd in multiple mode. Exposes `aria-sort`.
789
- */
790
- class UiTableSortableColumn {
791
- constructor() {
792
- /** @ignore */
793
- this.table = inject(UiTable);
794
- /** Field (dotted path allowed) this column sorts on. */
795
- this.field = input.required({ ...(ngDevMode ? { debugName: "field" } : /* istanbul ignore next */ {}), alias: 'uiSortableColumn' });
796
- /** Disables the sort interaction. */
797
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'uiSortableColumnDisabled' });
798
- /** @ignore */
799
- this.sorted = computed(() => this.table.getSortOrder(this.field()) !== 0, /* @ts-ignore */
800
- ...(ngDevMode ? [{ debugName: "sorted" }] : /* istanbul ignore next */ []));
801
- /** @ignore */
802
- this.ariaSort = computed(() => {
803
- const order = this.table.getSortOrder(this.field());
804
- return order === 0 ? 'none' : order > 0 ? 'ascending' : 'descending';
805
- }, /* @ts-ignore */
806
- ...(ngDevMode ? [{ debugName: "ariaSort" }] : /* istanbul ignore next */ []));
807
- }
808
- /** @ignore */
809
- onTrigger(event) {
810
- if (this.disabled())
811
- return;
812
- event.preventDefault();
813
- this.table.toggleColumnSort(this.field(), event);
814
- }
815
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableSortableColumn, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
816
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiTableSortableColumn, isStandalone: true, selector: "[uiSortableColumn]", inputs: { field: { classPropertyName: "field", publicName: "uiSortableColumn", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "uiSortableColumnDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onTrigger($event)", "keydown.enter": "onTrigger($event)", "keydown.space": "onTrigger($event)" }, properties: { "class._sorted": "sorted()", "attr.tabindex": "disabled() ? null : 0", "attr.role": "\"columnheader\"", "attr.aria-sort": "ariaSort()" }, classAttribute: "ui-table-sortable-column" }, ngImport: i0 }); }
817
- }
818
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableSortableColumn, decorators: [{
819
- type: Directive,
820
- args: [{
821
- selector: '[uiSortableColumn]',
822
- host: {
823
- class: 'ui-table-sortable-column',
824
- '[class._sorted]': 'sorted()',
825
- '[attr.tabindex]': 'disabled() ? null : 0',
826
- '[attr.role]': '"columnheader"',
827
- '[attr.aria-sort]': 'ariaSort()',
828
- '(click)': 'onTrigger($event)',
829
- '(keydown.enter)': 'onTrigger($event)',
830
- '(keydown.space)': 'onTrigger($event)',
831
- },
832
- }]
833
- }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiSortableColumn", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiSortableColumnDisabled", required: false }] }] } });
834
- /**
835
- * ui-table-sort-icon — direction indicator of a sortable column.
836
- * Decorative: the accessible state lives on the `<th>` (`aria-sort`).
837
- */
838
- class UiTableSortIcon {
839
- constructor() {
840
- /** @ignore */
841
- this.table = inject(UiTable);
842
- /** Field of the column this icon reflects. */
843
- this.field = input.required(/* @ts-ignore */
844
- ...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
845
- /** @ignore */
846
- this.iconName = computed(() => {
847
- const order = this.table.getSortOrder(this.field());
848
- return order === 0 ? 'sort' : order > 0 ? 'sort-up' : 'sort-down';
849
- }, /* @ts-ignore */
850
- ...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
851
- }
852
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableSortIcon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
853
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiTableSortIcon, isStandalone: true, selector: "ui-table-sort-icon", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `<ui-icon class="ui-table-sort-icon" [name]="iconName()" size="sm" />`, isInline: true, dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
854
- }
855
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableSortIcon, decorators: [{
856
- type: Component,
857
- args: [{
858
- selector: 'ui-table-sort-icon',
859
- imports: [UiIcon],
860
- template: `<ui-icon class="ui-table-sort-icon" [name]="iconName()" size="sm" />`,
861
- }]
862
- }], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }] } });
863
- /**
864
- * uiSelectableRow — makes a `<tr>` selectable.
865
- *
866
- * Click selects (composing with Ctrl/Cmd / Shift according to
867
- * `metaKeySelection`); Arrow Up/Down moves the focus between rows, Space /
868
- * Enter toggles, Shift+Arrow extends the range.
869
- */
870
- class UiTableSelectableRow {
871
- constructor() {
872
- /** @ignore */
873
- this.table = inject(UiTable);
874
- /** @ignore */
875
- this.el = inject(ElementRef);
876
- /** Row data carried by this `<tr>`. */
877
- this.data = input.required({ ...(ngDevMode ? { debugName: "data" } : /* istanbul ignore next */ {}), alias: 'uiSelectableRow' });
878
- /** Absolute row index (from the body template context). */
879
- this.index = input(0, { ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), transform: numberAttribute, alias: 'uiSelectableRowIndex' });
880
- /** Disables the selection interaction. */
881
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'uiSelectableRowDisabled' });
882
- /** @ignore */
883
- this.selected = computed(() => this.table.isSelected(this.data()), /* @ts-ignore */
884
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
885
- /** @ignore Roving tabindex: a single row carries the tab stop. */
886
- this.tabindex = computed(() => {
887
- if (this.disabled())
888
- return null;
889
- return this.table.isRowTabbable(this.data()) ? 0 : -1;
890
- }, /* @ts-ignore */
891
- ...(ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []));
892
- // Registry lookup used by Shift+Arrow (the moving row must resolve the
893
- // data/index of its target sibling).
894
- effect(() => {
895
- this.table.selectableRowRefs.set(this.el.nativeElement, {
896
- data: this.data(),
897
- index: this.index(),
898
- });
899
- });
900
- inject(DestroyRef).onDestroy(() => this.table.selectableRowRefs.delete(this.el.nativeElement));
901
- }
902
- /** @ignore */
903
- onClick(event) {
904
- if (this.disabled())
905
- return;
906
- this.table.handleRowClick(event, this.data(), this.index());
907
- }
908
- /** @ignore */
909
- onKeydown(event) {
910
- if (this.disabled())
911
- return;
912
- const meta = event.metaKey || event.ctrlKey;
913
- switch (event.key) {
914
- case 'ArrowDown':
915
- case 'ArrowUp': {
916
- event.preventDefault();
917
- const target = this.findSiblingRow(event.key === 'ArrowDown' ? 'next' : 'previous');
918
- if (!target)
919
- return;
920
- target.focus();
921
- if (event.shiftKey) {
922
- const ref = this.table.selectableRowRefs.get(target);
923
- if (ref)
924
- this.table.selectRange(event, ref.index);
925
- }
926
- break;
927
- }
928
- case 'Home':
929
- case 'End': {
930
- event.preventDefault();
931
- const edge = event.key === 'Home' ? 'start' : 'end';
932
- this.findEdgeRow(edge)?.focus();
933
- if (meta && event.shiftKey)
934
- this.table.selectRangeToEdge(this.index(), edge);
935
- break;
936
- }
937
- case 'Enter': {
938
- event.preventDefault();
939
- this.table.handleRowClick(event, this.data(), this.index());
940
- break;
941
- }
942
- case ' ': {
943
- event.preventDefault();
944
- // Shift+Space selects the range from the last anchor to this row.
945
- if (event.shiftKey)
946
- this.table.selectRange(event, this.index());
947
- else
948
- this.table.handleRowClick(event, this.data(), this.index());
949
- break;
950
- }
951
- case 'a':
952
- case 'A': {
953
- if (!meta)
954
- return;
955
- event.preventDefault();
956
- this.table.selectAllRows(event);
957
- break;
958
- }
959
- }
960
- }
961
- /** @ignore Nearest selectable `<tr>` sibling (skips expansion rows). */
962
- findSiblingRow(direction) {
963
- let el = this.el.nativeElement;
964
- while ((el = direction === 'next' ? el.nextElementSibling : el.previousElementSibling)) {
965
- if (el.classList.contains('ui-table-selectable-row'))
966
- return el;
967
- }
968
- return null;
969
- }
970
- /** @ignore First / last selectable row of the table. */
971
- findEdgeRow(edge) {
972
- const rows = this.el.nativeElement
973
- .closest('table')
974
- ?.querySelectorAll('.ui-table-selectable-row');
975
- if (!rows?.length)
976
- return null;
977
- return edge === 'start' ? rows[0] : rows[rows.length - 1];
978
- }
979
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableSelectableRow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
980
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiTableSelectableRow, isStandalone: true, selector: "[uiSelectableRow]", inputs: { data: { classPropertyName: "data", publicName: "uiSelectableRow", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "uiSelectableRowIndex", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "uiSelectableRowDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeydown($event)" }, properties: { "class._selected": "selected()", "attr.tabindex": "tabindex()", "attr.aria-selected": "selected()" }, classAttribute: "ui-table-selectable-row" }, ngImport: i0 }); }
981
- }
982
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableSelectableRow, decorators: [{
983
- type: Directive,
984
- args: [{
985
- selector: '[uiSelectableRow]',
986
- host: {
987
- class: 'ui-table-selectable-row',
988
- '[class._selected]': 'selected()',
989
- '[attr.tabindex]': 'tabindex()',
990
- '[attr.aria-selected]': 'selected()',
991
- '(click)': 'onClick($event)',
992
- '(keydown)': 'onKeydown($event)',
993
- },
994
- }]
995
- }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiSelectableRow", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiSelectableRowIndex", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiSelectableRowDisabled", required: false }] }] } });
996
- /**
997
- * ui-table-checkbox — row checkbox of a checkbox-based multiple selection.
998
- * Instantiates `ui-checkbox` bound to the table selection.
999
- */
1000
- class UiTableCheckbox {
1001
- constructor() {
1002
- /** @ignore */
1003
- this.table = inject(UiTable);
1004
- /** Row this checkbox (un)selects. */
1005
- this.value = input.required(/* @ts-ignore */
1006
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1007
- /** Absolute row index (forwarded to the selection events). */
1008
- this.index = input(undefined, { ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), transform: (v) => (v == null ? undefined : Number(v)) });
1009
- /** Disables the checkbox. */
1010
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1011
- /** Accessible name of the checkbox. */
1012
- this.ariaLabel = input('Sélectionner la ligne', /* @ts-ignore */
1013
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
1014
- /** @ignore */
1015
- this.checked = computed(() => this.table.isSelected(this.value()), /* @ts-ignore */
1016
- ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
1017
- }
1018
- /** @ignore */
1019
- onToggle(_checked) {
1020
- this.table.toggleRowWithCheckbox(undefined, this.value(), this.index());
1021
- }
1022
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1023
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiTableCheckbox, isStandalone: true, selector: "ui-table-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
33
+ var UiTable = class UiTable {
34
+ constructor() {
35
+ this.value = input([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
36
+ this.dataKey = input(...ngDevMode ? [void 0, { debugName: "dataKey" }] : /* istanbul ignore next */ []);
37
+ this.size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
38
+ this.showGridlines = input(false, {
39
+ ...ngDevMode ? { debugName: "showGridlines" } : /* istanbul ignore next */ {},
40
+ transform: booleanAttribute
41
+ });
42
+ this.stripedRows = input(false, {
43
+ ...ngDevMode ? { debugName: "stripedRows" } : /* istanbul ignore next */ {},
44
+ transform: booleanAttribute
45
+ });
46
+ this.rowHover = input(false, {
47
+ ...ngDevMode ? { debugName: "rowHover" } : /* istanbul ignore next */ {},
48
+ transform: booleanAttribute
49
+ });
50
+ this.tableStyle = input(...ngDevMode ? [void 0, { debugName: "tableStyle" }] : /* istanbul ignore next */ []);
51
+ this.selectionMode = input(null, ...ngDevMode ? [{ debugName: "selectionMode" }] : /* istanbul ignore next */ []);
52
+ this.selection = model(null, ...ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []);
53
+ this.metaKeySelection = input(false, {
54
+ ...ngDevMode ? { debugName: "metaKeySelection" } : /* istanbul ignore next */ {},
55
+ transform: booleanAttribute
56
+ });
57
+ this.sortMode = input("single", ...ngDevMode ? [{ debugName: "sortMode" }] : /* istanbul ignore next */ []);
58
+ this.sortField = input(...ngDevMode ? [void 0, { debugName: "sortField" }] : /* istanbul ignore next */ []);
59
+ this.sortOrder = input(1, {
60
+ ...ngDevMode ? { debugName: "sortOrder" } : /* istanbul ignore next */ {},
61
+ transform: numberAttribute
62
+ });
63
+ this.multiSortMeta = input(...ngDevMode ? [void 0, { debugName: "multiSortMeta" }] : /* istanbul ignore next */ []);
64
+ this.defaultSortOrder = input(1, {
65
+ ...ngDevMode ? { debugName: "defaultSortOrder" } : /* istanbul ignore next */ {},
66
+ transform: numberAttribute
67
+ });
68
+ this.customSort = input(false, {
69
+ ...ngDevMode ? { debugName: "customSort" } : /* istanbul ignore next */ {},
70
+ transform: booleanAttribute
71
+ });
72
+ this.paginator = input(false, {
73
+ ...ngDevMode ? { debugName: "paginator" } : /* istanbul ignore next */ {},
74
+ transform: booleanAttribute
75
+ });
76
+ this.rows = input(10, {
77
+ ...ngDevMode ? { debugName: "rows" } : /* istanbul ignore next */ {},
78
+ transform: numberAttribute
79
+ });
80
+ this.first = model(0, ...ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []);
81
+ this.rowsPerPageOptions = input(...ngDevMode ? [void 0, { debugName: "rowsPerPageOptions" }] : /* istanbul ignore next */ []);
82
+ this.pageLinks = input(5, {
83
+ ...ngDevMode ? { debugName: "pageLinks" } : /* istanbul ignore next */ {},
84
+ transform: numberAttribute
85
+ });
86
+ this.totalRecords = input(...ngDevMode ? [void 0, { debugName: "totalRecords" }] : /* istanbul ignore next */ []);
87
+ this.scrollable = input(false, {
88
+ ...ngDevMode ? { debugName: "scrollable" } : /* istanbul ignore next */ {},
89
+ transform: booleanAttribute
90
+ });
91
+ this.scrollHeight = input(...ngDevMode ? [void 0, { debugName: "scrollHeight" }] : /* istanbul ignore next */ []);
92
+ this.frozenValue = input(...ngDevMode ? [void 0, { debugName: "frozenValue" }] : /* istanbul ignore next */ []);
93
+ this.expandedRowKeys = model({}, ...ngDevMode ? [{ debugName: "expandedRowKeys" }] : /* istanbul ignore next */ []);
94
+ this.resizableColumns = input(false, {
95
+ ...ngDevMode ? { debugName: "resizableColumns" } : /* istanbul ignore next */ {},
96
+ transform: booleanAttribute
97
+ });
98
+ this.loading = input(false, {
99
+ ...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
100
+ transform: booleanAttribute
101
+ });
102
+ this.loadingAriaLabel = input("Chargement des données", ...ngDevMode ? [{ debugName: "loadingAriaLabel" }] : /* istanbul ignore next */ []);
103
+ this.emptyMessage = input("Aucune donnée à afficher", ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
104
+ this.emptyIcon = input("inbox", ...ngDevMode ? [{ debugName: "emptyIcon" }] : /* istanbul ignore next */ []);
105
+ this.virtualScroll = input(false, {
106
+ ...ngDevMode ? { debugName: "virtualScroll" } : /* istanbul ignore next */ {},
107
+ transform: booleanAttribute
108
+ });
109
+ this.virtualScrollItemSize = input(50, {
110
+ ...ngDevMode ? { debugName: "virtualScrollItemSize" } : /* istanbul ignore next */ {},
111
+ transform: numberAttribute
112
+ });
113
+ this.lazy = input(false, {
114
+ ...ngDevMode ? { debugName: "lazy" } : /* istanbul ignore next */ {},
115
+ transform: booleanAttribute
116
+ });
117
+ this.rowSelect = output();
118
+ this.rowUnselect = output();
119
+ this.headerCheckboxToggle = output();
120
+ this.sortFunction = output();
121
+ this.sortChange = output();
122
+ this.pageChange = output();
123
+ this.rowExpand = output();
124
+ this.rowCollapse = output();
125
+ this.colResize = output();
126
+ this.rowReorder = output();
127
+ this.lazyLoad = output();
128
+ this.captionTemplate = contentChild("caption", ...ngDevMode ? [{ debugName: "captionTemplate" }] : /* istanbul ignore next */ []);
129
+ this.headerTemplate = contentChild("header", ...ngDevMode ? [{ debugName: "headerTemplate" }] : /* istanbul ignore next */ []);
130
+ this.bodyTemplate = contentChild("body", ...ngDevMode ? [{ debugName: "bodyTemplate" }] : /* istanbul ignore next */ []);
131
+ this.footerTemplate = contentChild("footer", ...ngDevMode ? [{ debugName: "footerTemplate" }] : /* istanbul ignore next */ []);
132
+ this.expandedRowTemplate = contentChild("expandedrow", ...ngDevMode ? [{ debugName: "expandedRowTemplate" }] : /* istanbul ignore next */ []);
133
+ this.emptyMessageTemplate = contentChild("emptymessage", ...ngDevMode ? [{ debugName: "emptyMessageTemplate" }] : /* istanbul ignore next */ []);
134
+ this.tableEl = viewChild("tableEl", ...ngDevMode ? [{ debugName: "tableEl" }] : /* istanbul ignore next */ []);
135
+ this.theadEl = viewChild("theadEl", ...ngDevMode ? [{ debugName: "theadEl" }] : /* istanbul ignore next */ []);
136
+ this.wrapperEl = viewChild("wrapperEl", ...ngDevMode ? [{ debugName: "wrapperEl" }] : /* istanbul ignore next */ []);
137
+ this.wrapperScrollTop = signal(0, ...ngDevMode ? [{ debugName: "wrapperScrollTop" }] : /* istanbul ignore next */ []);
138
+ this.wrapperHeight = signal(0, ...ngDevMode ? [{ debugName: "wrapperHeight" }] : /* istanbul ignore next */ []);
139
+ this.draggedRowIndex = null;
140
+ this.selectableRowRefs = /* @__PURE__ */ new Map();
141
+ this.anchorRowIndex = null;
142
+ this.uid = `ui-table-${nextUid++}`;
143
+ this.destroyRef = inject(DestroyRef);
144
+ this.sortState = linkedSignal(() => {
145
+ const field = this.sortField();
146
+ return field ? {
147
+ field,
148
+ order: this.sortOrder()
149
+ } : null;
150
+ }, ...ngDevMode ? [{ debugName: "sortState" }] : /* istanbul ignore next */ []);
151
+ this.multiSortState = linkedSignal(() => this.multiSortMeta() ?? [], ...ngDevMode ? [{ debugName: "multiSortState" }] : /* istanbul ignore next */ []);
152
+ this.rowsState = linkedSignal(() => this.rows(), ...ngDevMode ? [{ debugName: "rowsState" }] : /* istanbul ignore next */ []);
153
+ this.columnCount = signal(1, ...ngDevMode ? [{ debugName: "columnCount" }] : /* istanbul ignore next */ []);
154
+ this.frozenRowsTop = signal(0, ...ngDevMode ? [{ debugName: "frozenRowsTop" }] : /* istanbul ignore next */ []);
155
+ this.processedData = computed(() => {
156
+ const data = this.value() ?? [];
157
+ if (!data.length || this.customSort() || this.lazy()) return data;
158
+ if (this.sortMode() === "single") {
159
+ const sort = this.sortState();
160
+ if (!sort) return data;
161
+ return [...data].sort((a, b) => sort.order * compareValues(resolveFieldData(a, sort.field), resolveFieldData(b, sort.field)));
162
+ }
163
+ const metas = this.multiSortState();
164
+ if (!metas.length) return data;
165
+ return [...data].sort((a, b) => {
166
+ for (const meta of metas) {
167
+ const result = meta.order * compareValues(resolveFieldData(a, meta.field), resolveFieldData(b, meta.field));
168
+ if (result !== 0) return result;
169
+ }
170
+ return 0;
171
+ });
172
+ }, ...ngDevMode ? [{ debugName: "processedData" }] : /* istanbul ignore next */ []);
173
+ this.effectiveTotalRecords = computed(() => this.lazy() ? this.totalRecords() ?? this.processedData().length : this.processedData().length, ...ngDevMode ? [{ debugName: "effectiveTotalRecords" }] : /* istanbul ignore next */ []);
174
+ this.pageCount = computed(() => Math.max(1, Math.ceil(this.effectiveTotalRecords() / Math.max(1, this.rowsState()))), ...ngDevMode ? [{ debugName: "pageCount" }] : /* istanbul ignore next */ []);
175
+ this.clampedFirst = computed(() => {
176
+ const rows = Math.max(1, this.rowsState());
177
+ const maxFirst = (this.pageCount() - 1) * rows;
178
+ return Math.min(Math.max(0, this.first()), maxFirst);
179
+ }, ...ngDevMode ? [{ debugName: "clampedFirst" }] : /* istanbul ignore next */ []);
180
+ this.virtualRange = computed(() => {
181
+ const total = this.processedData().length;
182
+ if (!this.virtualScroll()) return {
183
+ start: 0,
184
+ end: total
185
+ };
186
+ const itemSize = Math.max(1, this.virtualScrollItemSize());
187
+ const start = Math.max(0, Math.floor(this.wrapperScrollTop() / itemSize) - 5);
188
+ const visible = Math.ceil(Math.max(0, this.wrapperHeight()) / itemSize) + 10;
189
+ return {
190
+ start,
191
+ end: Math.min(total, start + visible)
192
+ };
193
+ }, ...ngDevMode ? [{ debugName: "virtualRange" }] : /* istanbul ignore next */ []);
194
+ this.virtualPadding = computed(() => {
195
+ if (!this.virtualScroll()) return {
196
+ top: 0,
197
+ bottom: 0
198
+ };
199
+ const itemSize = Math.max(1, this.virtualScrollItemSize());
200
+ const { start, end } = this.virtualRange();
201
+ return {
202
+ top: start * itemSize,
203
+ bottom: (this.processedData().length - end) * itemSize
204
+ };
205
+ }, ...ngDevMode ? [{ debugName: "virtualPadding" }] : /* istanbul ignore next */ []);
206
+ this.pageOffset = computed(() => {
207
+ if (this.virtualScroll()) return this.virtualRange().start;
208
+ return this.paginator() ? this.clampedFirst() : 0;
209
+ }, ...ngDevMode ? [{ debugName: "pageOffset" }] : /* istanbul ignore next */ []);
210
+ this.pageData = computed(() => {
211
+ const data = this.processedData();
212
+ if (this.virtualScroll()) {
213
+ const { start, end } = this.virtualRange();
214
+ return data.slice(start, end);
215
+ }
216
+ if (!this.paginator() || this.lazy()) return data;
217
+ const start = this.clampedFirst();
218
+ return data.slice(start, start + this.rowsState());
219
+ }, ...ngDevMode ? [{ debugName: "pageData" }] : /* istanbul ignore next */ []);
220
+ this.isFlexScroll = computed(() => this.scrollable() && this.scrollHeight() === "flex", ...ngDevMode ? [{ debugName: "isFlexScroll" }] : /* istanbul ignore next */ []);
221
+ this.scrollMaxHeight = computed(() => {
222
+ const height = this.scrollHeight();
223
+ return this.scrollable() && height && height !== "flex" ? height : null;
224
+ }, ...ngDevMode ? [{ debugName: "scrollMaxHeight" }] : /* istanbul ignore next */ []);
225
+ this.classes = computed(() => {
226
+ const c = ["ui-table"];
227
+ if (this.size() !== "default") c.push(`_${this.size()}`);
228
+ if (this.showGridlines()) c.push("_gridlines");
229
+ if (this.stripedRows()) c.push("_striped");
230
+ if (this.rowHover() || this.selectionMode()) c.push("_hoverable");
231
+ if (this.scrollable()) c.push("_scrollable");
232
+ if (this.isFlexScroll()) c.push("_flex-scroll");
233
+ if (this.resizableColumns()) c.push("_resizable");
234
+ if (this.virtualScroll()) c.push("_virtual");
235
+ return c.join(" ");
236
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
237
+ this.selectionArray = computed(() => {
238
+ const sel = this.selection();
239
+ if (sel == null) return [];
240
+ return Array.isArray(sel) ? sel : [sel];
241
+ }, ...ngDevMode ? [{ debugName: "selectionArray" }] : /* istanbul ignore next */ []);
242
+ this.allSelected = computed(() => {
243
+ const data = this.processedData();
244
+ if (!data.length) return false;
245
+ const selection = this.selectionArray();
246
+ return data.every((row) => selection.some((s) => this.rowEquals(s, row)));
247
+ }, ...ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []);
248
+ this.partiallySelected = computed(() => !this.allSelected() && this.selectionArray().length > 0, ...ngDevMode ? [{ debugName: "partiallySelected" }] : /* istanbul ignore next */ []);
249
+ this.tabbableRow = computed(() => {
250
+ const page = this.pageData();
251
+ return page.find((row) => this.isSelected(row)) ?? page[0];
252
+ }, ...ngDevMode ? [{ debugName: "tabbableRow" }] : /* istanbul ignore next */ []);
253
+ this.idBase = this.uid;
254
+ if (isDevMode()) effect(() => {
255
+ if (Object.keys(this.expandedRowKeys()).length && !this.dataKey()) console.warn("[ui-table] `expandedRowKeys` requires `dataKey` to identify rows.");
256
+ if (this.virtualScroll() && (!this.scrollable() || !this.scrollHeight() || this.scrollHeight() === "flex")) console.warn("[ui-table] `virtualScroll` requires `scrollable` and a fixed `scrollHeight`.");
257
+ if (this.totalRecords() !== void 0 && !this.lazy()) console.warn("[ui-table] `totalRecords` is ignored without `lazy`.");
258
+ if (this.lazy() && this.paginator() && this.totalRecords() === void 0) console.warn("[ui-table] `lazy` + `paginator` requires `totalRecords` (server total) for the paginator.");
259
+ });
260
+ let lastLazyRange = null;
261
+ effect(() => {
262
+ if (!this.virtualScroll() || !this.lazy()) return;
263
+ const { start, end } = this.virtualRange();
264
+ if (lastLazyRange?.first === start && lastLazyRange?.last === end) return;
265
+ lastLazyRange = {
266
+ first: start,
267
+ last: end
268
+ };
269
+ this.lazyLoad.emit(lastLazyRange);
270
+ });
271
+ afterRenderEffect(() => {
272
+ this.value();
273
+ this.size();
274
+ this.headerTemplate();
275
+ this.frozenValue();
276
+ this.measureStickyMetrics();
277
+ const wrapper = this.wrapperEl()?.nativeElement;
278
+ if (wrapper) this.wrapperHeight.set(wrapper.clientHeight);
279
+ });
280
+ afterNextRender(() => {
281
+ if (typeof ResizeObserver === "undefined") return;
282
+ const table = this.tableEl()?.nativeElement;
283
+ const wrapper = this.wrapperEl()?.nativeElement;
284
+ const observer = new ResizeObserver(() => {
285
+ this.measureStickyMetrics();
286
+ if (wrapper) this.wrapperHeight.set(wrapper.clientHeight);
287
+ });
288
+ if (table) observer.observe(table);
289
+ if (wrapper) observer.observe(wrapper);
290
+ this.destroyRef.onDestroy(() => observer.disconnect());
291
+ });
292
+ }
293
+ measureStickyMetrics() {
294
+ const thead = this.theadEl()?.nativeElement;
295
+ if (!thead) return;
296
+ const cells = thead.querySelectorAll("th").length;
297
+ if (cells > 0) this.columnCount.set(cells);
298
+ const headerHeight = thead.getBoundingClientRect().height;
299
+ this.frozenRowsTop.set(Math.floor(headerHeight));
300
+ const frozenBody = thead.parentElement?.querySelector("tbody._frozen-rows");
301
+ if (!frozenBody) return;
302
+ let offset = headerHeight;
303
+ for (const row of Array.from(frozenBody.rows)) {
304
+ for (const cell of Array.from(row.cells)) cell.style.top = `${Math.floor(offset)}px`;
305
+ offset += row.getBoundingClientRect().height;
306
+ }
307
+ }
308
+ rowContext(row, pageIndex, frozen = false) {
309
+ return {
310
+ $implicit: row,
311
+ rowIndex: frozen ? pageIndex : this.pageOffset() + pageIndex,
312
+ even: pageIndex % 2 === 1,
313
+ selected: this.isSelected(row),
314
+ expanded: this.isRowExpanded(row),
315
+ frozen
316
+ };
317
+ }
318
+ getSortOrder(field) {
319
+ if (this.sortMode() === "single") {
320
+ const sort = this.sortState();
321
+ return sort?.field === field ? sort.order : 0;
322
+ }
323
+ return this.multiSortState().find((m) => m.field === field)?.order ?? 0;
324
+ }
325
+ toggleColumnSort(field, originalEvent) {
326
+ const defaultOrder = this.defaultSortOrder() || 1;
327
+ if (this.sortMode() === "single") {
328
+ const current = this.sortState();
329
+ if (current?.field === field) this.sortState.set(current.order === defaultOrder ? {
330
+ field,
331
+ order: -defaultOrder
332
+ } : null);
333
+ else this.sortState.set({
334
+ field,
335
+ order: defaultOrder
336
+ });
337
+ } else {
338
+ const metas = [...this.multiSortState()];
339
+ const index = metas.findIndex((m) => m.field === field);
340
+ if (!(originalEvent instanceof MouseEvent && (originalEvent.metaKey || originalEvent.ctrlKey))) {
341
+ const existing = index >= 0 ? metas[index] : void 0;
342
+ this.multiSortState.set([{
343
+ field,
344
+ order: existing ? -existing.order : defaultOrder
345
+ }]);
346
+ } else if (index >= 0) {
347
+ metas[index] = {
348
+ field,
349
+ order: -metas[index].order
350
+ };
351
+ this.multiSortState.set(metas);
352
+ } else this.multiSortState.set([...metas, {
353
+ field,
354
+ order: defaultOrder
355
+ }]);
356
+ }
357
+ const single = this.sortState();
358
+ if (this.customSort()) this.sortFunction.emit({
359
+ data: this.value() ?? [],
360
+ mode: this.sortMode(),
361
+ field: this.sortMode() === "single" ? single?.field : void 0,
362
+ order: this.sortMode() === "single" ? single?.order ?? 0 : void 0,
363
+ multiSortMeta: this.sortMode() === "multiple" ? this.multiSortState() : void 0
364
+ });
365
+ this.sortChange.emit({
366
+ mode: this.sortMode(),
367
+ field: this.sortMode() === "single" ? single?.field : void 0,
368
+ order: this.sortMode() === "single" ? single?.order ?? 0 : void 0,
369
+ multiSortMeta: this.sortMode() === "multiple" ? this.multiSortState() : void 0
370
+ });
371
+ if (this.paginator()) this.first.set(0);
372
+ }
373
+ rowEquals(a, b) {
374
+ const key = this.dataKey();
375
+ return key ? resolveFieldData(a, key) === resolveFieldData(b, key) : a === b;
376
+ }
377
+ isSelected(row) {
378
+ return this.selectionArray().some((s) => this.rowEquals(s, row));
379
+ }
380
+ handleRowClick(originalEvent, data, index) {
381
+ const mode = this.selectionMode();
382
+ if (!mode) return;
383
+ if (originalEvent.target?.closest("button, a, input, label, select, textarea")) return;
384
+ const pointer = originalEvent instanceof MouseEvent ? originalEvent : null;
385
+ if (mode === "multiple" && pointer?.shiftKey && this.anchorRowIndex != null) {
386
+ this.selectRange(originalEvent, index);
387
+ return;
388
+ }
389
+ const selected = this.isSelected(data);
390
+ const metaKey = !!pointer && (pointer.metaKey || pointer.ctrlKey);
391
+ if (this.metaKeySelection()) {
392
+ if (selected && metaKey) this.unselectRow(originalEvent, data, index, "row");
393
+ else if (mode === "single") {
394
+ this.selection.set(data);
395
+ this.rowSelect.emit({
396
+ originalEvent,
397
+ data,
398
+ index,
399
+ type: "row"
400
+ });
401
+ } else {
402
+ this.selection.set(metaKey ? [...this.selectionArray(), data] : [data]);
403
+ this.rowSelect.emit({
404
+ originalEvent,
405
+ data,
406
+ index,
407
+ type: "row"
408
+ });
409
+ }
410
+ } else if (selected) this.unselectRow(originalEvent, data, index, "row");
411
+ else if (mode === "single") {
412
+ this.selection.set(data);
413
+ this.rowSelect.emit({
414
+ originalEvent,
415
+ data,
416
+ index,
417
+ type: "row"
418
+ });
419
+ } else {
420
+ this.selection.set([...this.selectionArray(), data]);
421
+ this.rowSelect.emit({
422
+ originalEvent,
423
+ data,
424
+ index,
425
+ type: "row"
426
+ });
427
+ }
428
+ this.anchorRowIndex = index;
429
+ }
430
+ dataIndex(index) {
431
+ return this.lazy() && this.paginator() && !this.virtualScroll() ? index - this.clampedFirst() : index;
432
+ }
433
+ selectRange(originalEvent, index) {
434
+ const anchorLocal = this.anchorRowIndex == null ? null : this.dataIndex(this.anchorRowIndex);
435
+ const anchor = anchorLocal == null || anchorLocal < 0 || anchorLocal >= this.processedData().length ? index : this.anchorRowIndex;
436
+ this.anchorRowIndex = anchor;
437
+ const start = Math.min(anchor, index);
438
+ const end = Math.max(anchor, index);
439
+ const range = this.processedData().slice(this.dataIndex(start), this.dataIndex(end) + 1);
440
+ this.selection.set([...range]);
441
+ for (const [offset, data] of range.entries()) this.rowSelect.emit({
442
+ originalEvent,
443
+ data,
444
+ index: start + offset,
445
+ type: "row"
446
+ });
447
+ }
448
+ toggleRowWithCheckbox(originalEvent, data, index) {
449
+ if (this.isSelected(data)) {
450
+ this.selection.set(this.selectionArray().filter((s) => !this.rowEquals(s, data)));
451
+ this.rowUnselect.emit({
452
+ originalEvent,
453
+ data,
454
+ index,
455
+ type: "checkbox"
456
+ });
457
+ } else {
458
+ this.selection.set([...this.selectionArray(), data]);
459
+ this.rowSelect.emit({
460
+ originalEvent,
461
+ data,
462
+ index,
463
+ type: "checkbox"
464
+ });
465
+ }
466
+ this.anchorRowIndex = index ?? null;
467
+ }
468
+ toggleAllRows(originalEvent, checked) {
469
+ this.selection.set(checked ? [...this.processedData()] : []);
470
+ this.headerCheckboxToggle.emit({
471
+ originalEvent,
472
+ checked
473
+ });
474
+ }
475
+ selectRowWithRadio(originalEvent, data, index) {
476
+ if (this.isSelected(data)) return;
477
+ this.selection.set(data);
478
+ this.rowSelect.emit({
479
+ originalEvent,
480
+ data,
481
+ index,
482
+ type: "radio"
483
+ });
484
+ this.anchorRowIndex = index ?? null;
485
+ }
486
+ unselectRow(originalEvent, data, index, type) {
487
+ if (this.selectionMode() === "single") this.selection.set(null);
488
+ else this.selection.set(this.selectionArray().filter((s) => !this.rowEquals(s, data)));
489
+ this.rowUnselect.emit({
490
+ originalEvent,
491
+ data,
492
+ index,
493
+ type
494
+ });
495
+ }
496
+ rowKey(data) {
497
+ const key = this.dataKey();
498
+ if (!key) {
499
+ if (isDevMode()) console.warn("[ui-table] Row expansion requires `dataKey`.");
500
+ return;
501
+ }
502
+ return String(resolveFieldData(data, key));
503
+ }
504
+ isRowExpanded(data) {
505
+ const key = this.dataKey();
506
+ if (!key) return false;
507
+ return !!this.expandedRowKeys()[String(resolveFieldData(data, key))];
508
+ }
509
+ toggleRow(data, originalEvent) {
510
+ const key = this.rowKey(data);
511
+ if (key === void 0) return;
512
+ const keys = { ...this.expandedRowKeys() };
513
+ if (keys[key]) {
514
+ delete keys[key];
515
+ this.expandedRowKeys.set(keys);
516
+ this.rowCollapse.emit({
517
+ originalEvent,
518
+ data
519
+ });
520
+ } else {
521
+ keys[key] = true;
522
+ this.expandedRowKeys.set(keys);
523
+ this.rowExpand.emit({
524
+ originalEvent,
525
+ data
526
+ });
527
+ }
528
+ }
529
+ onPaginatorRows(rows) {
530
+ this.rowsState.set(rows);
531
+ }
532
+ dropRow(dropIndex) {
533
+ const dragIndex = this.draggedRowIndex;
534
+ this.draggedRowIndex = null;
535
+ if (dragIndex == null || dragIndex === dropIndex) return;
536
+ const value = [...this.value() ?? []];
537
+ if (dragIndex < 0 || dragIndex >= value.length || dropIndex < 0 || dropIndex >= value.length) return;
538
+ const [moved] = value.splice(dragIndex, 1);
539
+ value.splice(dropIndex, 0, moved);
540
+ this.rowReorder.emit({
541
+ dragIndex,
542
+ dropIndex,
543
+ value
544
+ });
545
+ }
546
+ onWrapperScroll() {
547
+ if (!this.virtualScroll()) return;
548
+ const wrapper = this.wrapperEl()?.nativeElement;
549
+ if (wrapper) this.wrapperScrollTop.set(wrapper.scrollTop);
550
+ }
551
+ isRowTabbable(data) {
552
+ const tabbable = this.tabbableRow();
553
+ return tabbable !== void 0 && this.rowEquals(tabbable, data);
554
+ }
555
+ selectAllRows(originalEvent) {
556
+ if (this.selectionMode() !== "multiple") return;
557
+ this.selection.set([...this.processedData()]);
558
+ this.headerCheckboxToggle.emit({
559
+ originalEvent,
560
+ checked: true
561
+ });
562
+ }
563
+ selectRangeToEdge(index, edge) {
564
+ if (this.selectionMode() !== "multiple") return;
565
+ const data = this.processedData();
566
+ const localIndex = this.dataIndex(index);
567
+ const range = edge === "start" ? data.slice(0, localIndex + 1) : data.slice(localIndex);
568
+ this.selection.set([...range]);
569
+ this.anchorRowIndex = index;
570
+ }
571
+ lockColumnWidths() {
572
+ const table = this.tableEl()?.nativeElement;
573
+ if (!table) return;
574
+ const headerRow = table.querySelector("thead tr");
575
+ if (!headerRow) return;
576
+ const tableWidth = table.getBoundingClientRect().width;
577
+ const cells = Array.from(headerRow.children);
578
+ const widths = cells.map((cell) => cell.getBoundingClientRect().width);
579
+ cells.forEach((cell, i) => cell.style.width = `${widths[i]}px`);
580
+ table.style.tableLayout = "fixed";
581
+ table.style.width = `${tableWidth}px`;
582
+ }
583
+ resizeColumnFit(cell, startWidth, nextStartWidth, delta) {
584
+ const next = cell.nextElementSibling;
585
+ if (!next) return false;
586
+ const width = startWidth + delta;
587
+ const nextWidth = nextStartWidth - delta;
588
+ if (width < COLUMN_MIN_WIDTH || nextWidth < COLUMN_MIN_WIDTH) return false;
589
+ cell.style.width = `${width}px`;
590
+ next.style.width = `${nextWidth}px`;
591
+ return true;
592
+ }
593
+ notifyColResize(element, delta) {
594
+ this.colResize.emit({
595
+ element,
596
+ delta
597
+ });
598
+ }
599
+ static {
600
+ this.ɵfac = i0.ɵɵngDeclareFactory({
601
+ minVersion: "12.0.0",
602
+ version: "22.3.0",
603
+ ngImport: i0,
604
+ type: UiTable,
605
+ deps: [],
606
+ target: i0.ɵɵFactoryTarget.Component
607
+ });
608
+ }
609
+ static {
610
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
611
+ minVersion: "17.0.0",
612
+ version: "22.3.0",
613
+ type: UiTable,
614
+ isStandalone: true,
615
+ selector: "ui-table",
616
+ inputs: {
617
+ value: {
618
+ classPropertyName: "value",
619
+ publicName: "value",
620
+ isSignal: true,
621
+ isRequired: false,
622
+ transformFunction: null
623
+ },
624
+ dataKey: {
625
+ classPropertyName: "dataKey",
626
+ publicName: "dataKey",
627
+ isSignal: true,
628
+ isRequired: false,
629
+ transformFunction: null
630
+ },
631
+ size: {
632
+ classPropertyName: "size",
633
+ publicName: "size",
634
+ isSignal: true,
635
+ isRequired: false,
636
+ transformFunction: null
637
+ },
638
+ showGridlines: {
639
+ classPropertyName: "showGridlines",
640
+ publicName: "showGridlines",
641
+ isSignal: true,
642
+ isRequired: false,
643
+ transformFunction: null
644
+ },
645
+ stripedRows: {
646
+ classPropertyName: "stripedRows",
647
+ publicName: "stripedRows",
648
+ isSignal: true,
649
+ isRequired: false,
650
+ transformFunction: null
651
+ },
652
+ rowHover: {
653
+ classPropertyName: "rowHover",
654
+ publicName: "rowHover",
655
+ isSignal: true,
656
+ isRequired: false,
657
+ transformFunction: null
658
+ },
659
+ tableStyle: {
660
+ classPropertyName: "tableStyle",
661
+ publicName: "tableStyle",
662
+ isSignal: true,
663
+ isRequired: false,
664
+ transformFunction: null
665
+ },
666
+ selectionMode: {
667
+ classPropertyName: "selectionMode",
668
+ publicName: "selectionMode",
669
+ isSignal: true,
670
+ isRequired: false,
671
+ transformFunction: null
672
+ },
673
+ selection: {
674
+ classPropertyName: "selection",
675
+ publicName: "selection",
676
+ isSignal: true,
677
+ isRequired: false,
678
+ transformFunction: null
679
+ },
680
+ metaKeySelection: {
681
+ classPropertyName: "metaKeySelection",
682
+ publicName: "metaKeySelection",
683
+ isSignal: true,
684
+ isRequired: false,
685
+ transformFunction: null
686
+ },
687
+ sortMode: {
688
+ classPropertyName: "sortMode",
689
+ publicName: "sortMode",
690
+ isSignal: true,
691
+ isRequired: false,
692
+ transformFunction: null
693
+ },
694
+ sortField: {
695
+ classPropertyName: "sortField",
696
+ publicName: "sortField",
697
+ isSignal: true,
698
+ isRequired: false,
699
+ transformFunction: null
700
+ },
701
+ sortOrder: {
702
+ classPropertyName: "sortOrder",
703
+ publicName: "sortOrder",
704
+ isSignal: true,
705
+ isRequired: false,
706
+ transformFunction: null
707
+ },
708
+ multiSortMeta: {
709
+ classPropertyName: "multiSortMeta",
710
+ publicName: "multiSortMeta",
711
+ isSignal: true,
712
+ isRequired: false,
713
+ transformFunction: null
714
+ },
715
+ defaultSortOrder: {
716
+ classPropertyName: "defaultSortOrder",
717
+ publicName: "defaultSortOrder",
718
+ isSignal: true,
719
+ isRequired: false,
720
+ transformFunction: null
721
+ },
722
+ customSort: {
723
+ classPropertyName: "customSort",
724
+ publicName: "customSort",
725
+ isSignal: true,
726
+ isRequired: false,
727
+ transformFunction: null
728
+ },
729
+ paginator: {
730
+ classPropertyName: "paginator",
731
+ publicName: "paginator",
732
+ isSignal: true,
733
+ isRequired: false,
734
+ transformFunction: null
735
+ },
736
+ rows: {
737
+ classPropertyName: "rows",
738
+ publicName: "rows",
739
+ isSignal: true,
740
+ isRequired: false,
741
+ transformFunction: null
742
+ },
743
+ first: {
744
+ classPropertyName: "first",
745
+ publicName: "first",
746
+ isSignal: true,
747
+ isRequired: false,
748
+ transformFunction: null
749
+ },
750
+ rowsPerPageOptions: {
751
+ classPropertyName: "rowsPerPageOptions",
752
+ publicName: "rowsPerPageOptions",
753
+ isSignal: true,
754
+ isRequired: false,
755
+ transformFunction: null
756
+ },
757
+ pageLinks: {
758
+ classPropertyName: "pageLinks",
759
+ publicName: "pageLinks",
760
+ isSignal: true,
761
+ isRequired: false,
762
+ transformFunction: null
763
+ },
764
+ totalRecords: {
765
+ classPropertyName: "totalRecords",
766
+ publicName: "totalRecords",
767
+ isSignal: true,
768
+ isRequired: false,
769
+ transformFunction: null
770
+ },
771
+ scrollable: {
772
+ classPropertyName: "scrollable",
773
+ publicName: "scrollable",
774
+ isSignal: true,
775
+ isRequired: false,
776
+ transformFunction: null
777
+ },
778
+ scrollHeight: {
779
+ classPropertyName: "scrollHeight",
780
+ publicName: "scrollHeight",
781
+ isSignal: true,
782
+ isRequired: false,
783
+ transformFunction: null
784
+ },
785
+ frozenValue: {
786
+ classPropertyName: "frozenValue",
787
+ publicName: "frozenValue",
788
+ isSignal: true,
789
+ isRequired: false,
790
+ transformFunction: null
791
+ },
792
+ expandedRowKeys: {
793
+ classPropertyName: "expandedRowKeys",
794
+ publicName: "expandedRowKeys",
795
+ isSignal: true,
796
+ isRequired: false,
797
+ transformFunction: null
798
+ },
799
+ resizableColumns: {
800
+ classPropertyName: "resizableColumns",
801
+ publicName: "resizableColumns",
802
+ isSignal: true,
803
+ isRequired: false,
804
+ transformFunction: null
805
+ },
806
+ loading: {
807
+ classPropertyName: "loading",
808
+ publicName: "loading",
809
+ isSignal: true,
810
+ isRequired: false,
811
+ transformFunction: null
812
+ },
813
+ loadingAriaLabel: {
814
+ classPropertyName: "loadingAriaLabel",
815
+ publicName: "loadingAriaLabel",
816
+ isSignal: true,
817
+ isRequired: false,
818
+ transformFunction: null
819
+ },
820
+ emptyMessage: {
821
+ classPropertyName: "emptyMessage",
822
+ publicName: "emptyMessage",
823
+ isSignal: true,
824
+ isRequired: false,
825
+ transformFunction: null
826
+ },
827
+ emptyIcon: {
828
+ classPropertyName: "emptyIcon",
829
+ publicName: "emptyIcon",
830
+ isSignal: true,
831
+ isRequired: false,
832
+ transformFunction: null
833
+ },
834
+ virtualScroll: {
835
+ classPropertyName: "virtualScroll",
836
+ publicName: "virtualScroll",
837
+ isSignal: true,
838
+ isRequired: false,
839
+ transformFunction: null
840
+ },
841
+ virtualScrollItemSize: {
842
+ classPropertyName: "virtualScrollItemSize",
843
+ publicName: "virtualScrollItemSize",
844
+ isSignal: true,
845
+ isRequired: false,
846
+ transformFunction: null
847
+ },
848
+ lazy: {
849
+ classPropertyName: "lazy",
850
+ publicName: "lazy",
851
+ isSignal: true,
852
+ isRequired: false,
853
+ transformFunction: null
854
+ }
855
+ },
856
+ outputs: {
857
+ selection: "selectionChange",
858
+ first: "firstChange",
859
+ expandedRowKeys: "expandedRowKeysChange",
860
+ rowSelect: "rowSelect",
861
+ rowUnselect: "rowUnselect",
862
+ headerCheckboxToggle: "headerCheckboxToggle",
863
+ sortFunction: "sortFunction",
864
+ sortChange: "sortChange",
865
+ pageChange: "pageChange",
866
+ rowExpand: "rowExpand",
867
+ rowCollapse: "rowCollapse",
868
+ colResize: "colResize",
869
+ rowReorder: "rowReorder",
870
+ lazyLoad: "lazyLoad"
871
+ },
872
+ queries: [
873
+ {
874
+ propertyName: "captionTemplate",
875
+ first: true,
876
+ predicate: ["caption"],
877
+ descendants: true,
878
+ isSignal: true
879
+ },
880
+ {
881
+ propertyName: "headerTemplate",
882
+ first: true,
883
+ predicate: ["header"],
884
+ descendants: true,
885
+ isSignal: true
886
+ },
887
+ {
888
+ propertyName: "bodyTemplate",
889
+ first: true,
890
+ predicate: ["body"],
891
+ descendants: true,
892
+ isSignal: true
893
+ },
894
+ {
895
+ propertyName: "footerTemplate",
896
+ first: true,
897
+ predicate: ["footer"],
898
+ descendants: true,
899
+ isSignal: true
900
+ },
901
+ {
902
+ propertyName: "expandedRowTemplate",
903
+ first: true,
904
+ predicate: ["expandedrow"],
905
+ descendants: true,
906
+ isSignal: true
907
+ },
908
+ {
909
+ propertyName: "emptyMessageTemplate",
910
+ first: true,
911
+ predicate: ["emptymessage"],
912
+ descendants: true,
913
+ isSignal: true
914
+ }
915
+ ],
916
+ viewQueries: [
917
+ {
918
+ propertyName: "tableEl",
919
+ first: true,
920
+ predicate: ["tableEl"],
921
+ descendants: true,
922
+ isSignal: true
923
+ },
924
+ {
925
+ propertyName: "theadEl",
926
+ first: true,
927
+ predicate: ["theadEl"],
928
+ descendants: true,
929
+ isSignal: true
930
+ },
931
+ {
932
+ propertyName: "wrapperEl",
933
+ first: true,
934
+ predicate: ["wrapperEl"],
935
+ descendants: true,
936
+ isSignal: true
937
+ }
938
+ ],
939
+ ngImport: i0,
940
+ template: "<div [class]=\"classes()\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n @if (captionTemplate(); as caption) {\n <div class=\"ui-table-caption\">\n <ng-container [ngTemplateOutlet]=\"caption\" />\n </div>\n }\n\n <div class=\"ui-table-container\">\n <div\n #wrapperEl\n class=\"ui-table-wrapper\"\n [attr.tabindex]=\"scrollable() ? 0 : null\"\n [style.max-height]=\"scrollMaxHeight()\"\n [style.--ui-table-frozen-top.px]=\"frozenRowsTop()\"\n (scroll)=\"onWrapperScroll()\"\n >\n <table #tableEl class=\"ui-table-table\" [style]=\"tableStyle() ?? null\">\n @if (headerTemplate(); as header) {\n <thead #theadEl class=\"ui-table-thead\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n </thead>\n }\n\n @if (!loading() && frozenValue()?.length) {\n <tbody class=\"ui-table-tbody _frozen-rows\">\n @for (row of frozenValue(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index, true)\"\n />\n }\n }\n </tbody>\n }\n\n <tbody class=\"ui-table-tbody\">\n @if (loading()) {\n <tr class=\"ui-table-loading-row\">\n <td class=\"ui-table-loading-cell\" [attr.colspan]=\"columnCount()\">\n <ui-spinner [ariaLabel]=\"loadingAriaLabel()\" />\n </td>\n </tr>\n } @else {\n @if (virtualScroll() && virtualPadding().top > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().top\"></td>\n </tr>\n }\n\n @for (row of pageData(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n @if (expandedRowTemplate(); as expansion) {\n @if (isRowExpanded(row)) {\n <ng-container\n [ngTemplateOutlet]=\"expansion\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n }\n } @empty {\n <tr class=\"ui-table-empty-row\">\n <td class=\"ui-table-empty-cell\" [attr.colspan]=\"columnCount()\">\n @if (emptyMessageTemplate(); as empty) {\n <ng-container [ngTemplateOutlet]=\"empty\" />\n } @else {\n <ui-empty-state size=\"small\" [icon]=\"emptyIcon()\" [title]=\"emptyMessage()\" />\n }\n </td>\n </tr>\n }\n\n @if (virtualScroll() && virtualPadding().bottom > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().bottom\"></td>\n </tr>\n }\n }\n </tbody>\n\n @if (footerTemplate(); as footer) {\n <tfoot class=\"ui-table-tfoot\">\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </tfoot>\n }\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <ui-paginator\n [totalRecords]=\"effectiveTotalRecords()\"\n [rows]=\"rowsState()\"\n (rowsChange)=\"onPaginatorRows($event)\"\n [first]=\"first()\"\n (firstChange)=\"first.set($event)\"\n [pageLinks]=\"pageLinks()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n ariaLabel=\"Pagination du tableau\"\n (pageChange)=\"pageChange.emit($event)\"\n />\n }\n</div>\n",
941
+ styles: ["ui-table{display:block;min-width:0}ui-table:has(>.ui-table._flex-scroll){display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table{font-family:var(--ui-table-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-table-body-color, var(--table-body-content-odd))}.ui-table-container{min-width:0}.ui-table-wrapper{min-width:0;overflow-x:auto}.ui-table-loading-cell{text-align:center}.ui-table-loading-cell ui-spinner{display:flex;justify-content:center;padding:var(--ui-table-loading-padding-y, var(--units-3xl)) 0}.ui-table-table{width:100%;border-collapse:separate;border-spacing:0}.ui-table-table th,.ui-table-table td{box-sizing:border-box}.ui-table-caption{padding:var(--units-md) var(--units-default);font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table-thead th{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-head-surface, var(--table-head-surface-default));color:var(--ui-table-head-color, var(--table-head-content-default));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-head-stroke, var(--table-head-stroke-default));font-size:var(--size-typography-text-md);font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left;white-space:nowrap}.ui-table-tbody td{padding:var(--ui-table-cell-padding, var(--units-default));background-color:var(--ui-table-body-surface, var(--table-body-surface-odd));color:var(--ui-table-body-color, var(--table-body-content-odd));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-body-stroke, var(--table-body-stroke-odd));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-tbody tr:last-child td{border-bottom-color:transparent}.ui-table._striped .ui-table-tbody tr:nth-child(2n) td{background-color:var(--ui-table-body-surface-even, var(--table-body-surface-even));color:var(--ui-table-body-color-even, var(--table-body-content-even));border-bottom-color:var(--ui-table-body-stroke-even, var(--table-body-stroke-even))}.ui-table._hoverable .ui-table-tbody tr:hover td{background-color:var(--ui-table-body-surface-hover, var(--table-body-surface-hover));color:var(--ui-table-body-color-hover, var(--table-body-content-hover))}.ui-table-tbody tr._selected td,.ui-table._striped .ui-table-tbody tr._selected td{background-color:var(--ui-table-body-surface-selected, var(--informative-highlightlow-surface-default));color:var(--ui-table-body-color-selected, var(--informative-highlightlow-content-default));border-bottom-color:var(--ui-table-body-stroke-selected, var(--informative-highlightlow-stroke-default))}.ui-table._hoverable .ui-table-tbody tr._selected:hover td{background-color:var(--ui-table-body-surface-selected-hover, var(--informative-highlightlow-surface-hover));color:var(--ui-table-body-color-selected-hover, var(--informative-highlightlow-content-hover))}.ui-table-selectable-row{cursor:pointer}.ui-table-selectable-row:focus-visible{outline:var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid var(--ui-table-focus-ring-color, var(--global-border-focus));outline-offset:calc(-1 * var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))))}.ui-table-reorderable-row{cursor:grab}.ui-table-reorderable-row._drop-above td{box-shadow:inset 0 var(--ui-table-drop-indicator-width, var(--stroke-lg)) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-reorderable-row._drop-below td{box-shadow:inset 0 calc(-1 * var(--ui-table-drop-indicator-width, var(--stroke-lg))) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-empty-cell{text-align:center}.ui-table-empty-cell ui-empty-state{display:flex;justify-content:center;padding:var(--units-xl) 0}.ui-table-virtual-spacer td{padding:0;border:none;background:none}.ui-table-tfoot td{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-footer-surface, var(--table-footer-surface-default));color:var(--ui-table-footer-color, var(--table-footer-content-default));border-top:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-footer-stroke, var(--table-footer-stroke-default));font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left}.ui-table._small .ui-table-tbody td{padding:var(--ui-table-cell-padding-small, var(--units-sm) var(--units-md))}.ui-table._small .ui-table-thead th,.ui-table._small .ui-table-tfoot td{padding:var(--ui-table-head-padding-small, var(--units-sm) var(--units-md))}.ui-table._large .ui-table-tbody td{padding:var(--ui-table-cell-padding-large, var(--units-xl) var(--units-default))}.ui-table._large .ui-table-thead th,.ui-table._large .ui-table-tfoot td{padding:var(--ui-table-head-padding-large, var(--units-default))}.ui-table._gridlines .ui-table-table{border:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th,.ui-table._gridlines .ui-table-tbody td,.ui-table._gridlines .ui-table-tfoot td{border-right:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th:last-child,.ui-table._gridlines .ui-table-tbody td:last-child,.ui-table._gridlines .ui-table-tfoot td:last-child{border-right:none}.ui-table-sortable-column{cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-sortable-column:hover{background-color:var(--ui-table-head-surface-hover, var(--table-head-surface-hover));color:var(--ui-table-head-color-hover, var(--table-head-content-hover))}.ui-table-sortable-column:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-table-focus-ring-color, var(--global-border-focus))}.ui-table-sortable-column .ui-table-sort-icon{margin-left:var(--units-xs);vertical-align:middle}.ui-table._scrollable .ui-table-wrapper{overflow:auto}.ui-table._scrollable .ui-table-thead th{position:sticky;top:0;z-index:2}.ui-table._scrollable .ui-table-thead th._frozen-left,.ui-table._scrollable .ui-table-thead th._frozen-right{z-index:3}.ui-table._scrollable .ui-table-tfoot td{position:sticky;bottom:0;z-index:2}.ui-table._scrollable .ui-table-tbody._frozen-rows td{position:sticky;top:var(--ui-table-frozen-top, 0);z-index:1;font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table._flex-scroll{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table._flex-scroll .ui-table-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0}.ui-table._flex-scroll .ui-table-wrapper{flex:1 1 0;min-height:0}.ui-table._virtual .ui-table-wrapper{overflow-anchor:none}.ui-table .ui-table-table th._frozen-left,.ui-table .ui-table-table th._frozen-right,.ui-table .ui-table-table td._frozen-left,.ui-table .ui-table-table td._frozen-right{position:sticky;z-index:1}.ui-table-thead th._frozen-left,.ui-table-thead th._frozen-right{z-index:3}.ui-table._resizable .ui-table-thead th{position:relative;overflow:hidden}.ui-table-column-resizer{position:absolute;top:0;right:0;width:var(--ui-table-resizer-hit-width, var(--units-sm));height:100%;cursor:col-resize;touch-action:none}.ui-table-column-resizer:hover{border-right:var(--stroke-default) solid var(--ui-table-resizer-stroke-hover, var(--global-border-default-hover))}\n"],
942
+ dependencies: [
943
+ {
944
+ kind: "directive",
945
+ type: NgTemplateOutlet,
946
+ selector: "[ngTemplateOutlet]",
947
+ inputs: [
948
+ "ngTemplateOutletContext",
949
+ "ngTemplateOutlet",
950
+ "ngTemplateOutletInjector"
951
+ ]
952
+ },
953
+ {
954
+ kind: "component",
955
+ type: UiPaginator,
956
+ selector: "ui-paginator",
957
+ inputs: [
958
+ "totalRecords",
959
+ "rows",
960
+ "first",
961
+ "pageLinks",
962
+ "ellipsis",
963
+ "boundaryCount",
964
+ "rowsPerPageOptions",
965
+ "showFirstLastIcon",
966
+ "showPageLinks",
967
+ "showCurrentPageReport",
968
+ "currentPageReportTemplate",
969
+ "disabled",
970
+ "ripple",
971
+ "ariaLabel",
972
+ "pageAriaLabel",
973
+ "firstPageAriaLabel",
974
+ "prevPageAriaLabel",
975
+ "nextPageAriaLabel",
976
+ "lastPageAriaLabel",
977
+ "rowsPerPageAriaLabel"
978
+ ],
979
+ outputs: [
980
+ "rowsChange",
981
+ "firstChange",
982
+ "pageChange"
983
+ ]
984
+ },
985
+ {
986
+ kind: "component",
987
+ type: UiEmptyState,
988
+ selector: "ui-empty-state",
989
+ inputs: [
990
+ "title",
991
+ "description",
992
+ "icon",
993
+ "iconType",
994
+ "size",
995
+ "showMedia",
996
+ "ariaLabel",
997
+ "ariaLabelledBy"
998
+ ]
999
+ },
1000
+ {
1001
+ kind: "component",
1002
+ type: UiSpinner,
1003
+ selector: "ui-spinner",
1004
+ inputs: [
1005
+ "size",
1006
+ "orientation",
1007
+ "label",
1008
+ "ariaLabel",
1009
+ "spinnerTemplate",
1010
+ "image",
1011
+ "imageAlt",
1012
+ "icon",
1013
+ "strokeWidth",
1014
+ "fill",
1015
+ "animationDuration",
1016
+ "delay"
1017
+ ]
1018
+ }
1019
+ ],
1020
+ encapsulation: i0.ViewEncapsulation.None
1021
+ });
1022
+ }
1023
+ };
1024
+ i0.ɵɵngDeclareClassMetadata({
1025
+ minVersion: "12.0.0",
1026
+ version: "22.3.0",
1027
+ ngImport: i0,
1028
+ type: UiTable,
1029
+ decorators: [{
1030
+ type: Component,
1031
+ args: [{
1032
+ selector: "ui-table",
1033
+ imports: [
1034
+ NgTemplateOutlet,
1035
+ UiPaginator,
1036
+ UiEmptyState,
1037
+ UiSpinner
1038
+ ],
1039
+ encapsulation: ViewEncapsulation.None,
1040
+ template: "<div [class]=\"classes()\" [attr.aria-busy]=\"loading() ? 'true' : null\">\n @if (captionTemplate(); as caption) {\n <div class=\"ui-table-caption\">\n <ng-container [ngTemplateOutlet]=\"caption\" />\n </div>\n }\n\n <div class=\"ui-table-container\">\n <div\n #wrapperEl\n class=\"ui-table-wrapper\"\n [attr.tabindex]=\"scrollable() ? 0 : null\"\n [style.max-height]=\"scrollMaxHeight()\"\n [style.--ui-table-frozen-top.px]=\"frozenRowsTop()\"\n (scroll)=\"onWrapperScroll()\"\n >\n <table #tableEl class=\"ui-table-table\" [style]=\"tableStyle() ?? null\">\n @if (headerTemplate(); as header) {\n <thead #theadEl class=\"ui-table-thead\">\n <ng-container [ngTemplateOutlet]=\"header\" />\n </thead>\n }\n\n @if (!loading() && frozenValue()?.length) {\n <tbody class=\"ui-table-tbody _frozen-rows\">\n @for (row of frozenValue(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index, true)\"\n />\n }\n }\n </tbody>\n }\n\n <tbody class=\"ui-table-tbody\">\n @if (loading()) {\n <tr class=\"ui-table-loading-row\">\n <td class=\"ui-table-loading-cell\" [attr.colspan]=\"columnCount()\">\n <ui-spinner [ariaLabel]=\"loadingAriaLabel()\" />\n </td>\n </tr>\n } @else {\n @if (virtualScroll() && virtualPadding().top > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().top\"></td>\n </tr>\n }\n\n @for (row of pageData(); track $index) {\n @if (bodyTemplate(); as body) {\n <ng-container\n [ngTemplateOutlet]=\"body\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n @if (expandedRowTemplate(); as expansion) {\n @if (isRowExpanded(row)) {\n <ng-container\n [ngTemplateOutlet]=\"expansion\"\n [ngTemplateOutletContext]=\"rowContext(row, $index)\"\n />\n }\n }\n } @empty {\n <tr class=\"ui-table-empty-row\">\n <td class=\"ui-table-empty-cell\" [attr.colspan]=\"columnCount()\">\n @if (emptyMessageTemplate(); as empty) {\n <ng-container [ngTemplateOutlet]=\"empty\" />\n } @else {\n <ui-empty-state size=\"small\" [icon]=\"emptyIcon()\" [title]=\"emptyMessage()\" />\n }\n </td>\n </tr>\n }\n\n @if (virtualScroll() && virtualPadding().bottom > 0) {\n <tr class=\"ui-table-virtual-spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"columnCount()\" [style.height.px]=\"virtualPadding().bottom\"></td>\n </tr>\n }\n }\n </tbody>\n\n @if (footerTemplate(); as footer) {\n <tfoot class=\"ui-table-tfoot\">\n <ng-container [ngTemplateOutlet]=\"footer\" />\n </tfoot>\n }\n </table>\n </div>\n </div>\n\n @if (paginator()) {\n <ui-paginator\n [totalRecords]=\"effectiveTotalRecords()\"\n [rows]=\"rowsState()\"\n (rowsChange)=\"onPaginatorRows($event)\"\n [first]=\"first()\"\n (firstChange)=\"first.set($event)\"\n [pageLinks]=\"pageLinks()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n ariaLabel=\"Pagination du tableau\"\n (pageChange)=\"pageChange.emit($event)\"\n />\n }\n</div>\n",
1041
+ styles: ["ui-table{display:block;min-width:0}ui-table:has(>.ui-table._flex-scroll){display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table{font-family:var(--ui-table-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-table-body-color, var(--table-body-content-odd))}.ui-table-container{min-width:0}.ui-table-wrapper{min-width:0;overflow-x:auto}.ui-table-loading-cell{text-align:center}.ui-table-loading-cell ui-spinner{display:flex;justify-content:center;padding:var(--ui-table-loading-padding-y, var(--units-3xl)) 0}.ui-table-table{width:100%;border-collapse:separate;border-spacing:0}.ui-table-table th,.ui-table-table td{box-sizing:border-box}.ui-table-caption{padding:var(--units-md) var(--units-default);font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table-thead th{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-head-surface, var(--table-head-surface-default));color:var(--ui-table-head-color, var(--table-head-content-default));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-head-stroke, var(--table-head-stroke-default));font-size:var(--size-typography-text-md);font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left;white-space:nowrap}.ui-table-tbody td{padding:var(--ui-table-cell-padding, var(--units-default));background-color:var(--ui-table-body-surface, var(--table-body-surface-odd));color:var(--ui-table-body-color, var(--table-body-content-odd));border-bottom:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-body-stroke, var(--table-body-stroke-odd));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-tbody tr:last-child td{border-bottom-color:transparent}.ui-table._striped .ui-table-tbody tr:nth-child(2n) td{background-color:var(--ui-table-body-surface-even, var(--table-body-surface-even));color:var(--ui-table-body-color-even, var(--table-body-content-even));border-bottom-color:var(--ui-table-body-stroke-even, var(--table-body-stroke-even))}.ui-table._hoverable .ui-table-tbody tr:hover td{background-color:var(--ui-table-body-surface-hover, var(--table-body-surface-hover));color:var(--ui-table-body-color-hover, var(--table-body-content-hover))}.ui-table-tbody tr._selected td,.ui-table._striped .ui-table-tbody tr._selected td{background-color:var(--ui-table-body-surface-selected, var(--informative-highlightlow-surface-default));color:var(--ui-table-body-color-selected, var(--informative-highlightlow-content-default));border-bottom-color:var(--ui-table-body-stroke-selected, var(--informative-highlightlow-stroke-default))}.ui-table._hoverable .ui-table-tbody tr._selected:hover td{background-color:var(--ui-table-body-surface-selected-hover, var(--informative-highlightlow-surface-hover));color:var(--ui-table-body-color-selected-hover, var(--informative-highlightlow-content-hover))}.ui-table-selectable-row{cursor:pointer}.ui-table-selectable-row:focus-visible{outline:var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid var(--ui-table-focus-ring-color, var(--global-border-focus));outline-offset:calc(-1 * var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))))}.ui-table-reorderable-row{cursor:grab}.ui-table-reorderable-row._drop-above td{box-shadow:inset 0 var(--ui-table-drop-indicator-width, var(--stroke-lg)) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-reorderable-row._drop-below td{box-shadow:inset 0 calc(-1 * var(--ui-table-drop-indicator-width, var(--stroke-lg))) 0 0 var(--ui-table-drop-indicator-color, var(--global-border-focus))}.ui-table-empty-cell{text-align:center}.ui-table-empty-cell ui-empty-state{display:flex;justify-content:center;padding:var(--units-xl) 0}.ui-table-virtual-spacer td{padding:0;border:none;background:none}.ui-table-tfoot td{padding:var(--ui-table-head-padding, var(--units-md) var(--units-default));background-color:var(--ui-table-footer-surface, var(--table-footer-surface-default));color:var(--ui-table-footer-color, var(--table-footer-content-default));border-top:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-footer-stroke, var(--table-footer-stroke-default));font-weight:var(--ui-table-weight, var(--weight-bold));text-align:left}.ui-table._small .ui-table-tbody td{padding:var(--ui-table-cell-padding-small, var(--units-sm) var(--units-md))}.ui-table._small .ui-table-thead th,.ui-table._small .ui-table-tfoot td{padding:var(--ui-table-head-padding-small, var(--units-sm) var(--units-md))}.ui-table._large .ui-table-tbody td{padding:var(--ui-table-cell-padding-large, var(--units-xl) var(--units-default))}.ui-table._large .ui-table-thead th,.ui-table._large .ui-table-tfoot td{padding:var(--ui-table-head-padding-large, var(--units-default))}.ui-table._gridlines .ui-table-table{border:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th,.ui-table._gridlines .ui-table-tbody td,.ui-table._gridlines .ui-table-tfoot td{border-right:var(--ui-table-stroke-width, var(--stroke-sm)) solid var(--ui-table-gridline-stroke, var(--table-body-stroke-odd))}.ui-table._gridlines .ui-table-thead th:last-child,.ui-table._gridlines .ui-table-tbody td:last-child,.ui-table._gridlines .ui-table-tfoot td:last-child{border-right:none}.ui-table-sortable-column{cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-table-sortable-column:hover{background-color:var(--ui-table-head-surface-hover, var(--table-head-surface-hover));color:var(--ui-table-head-color-hover, var(--table-head-content-hover))}.ui-table-sortable-column:focus-visible{outline:none;box-shadow:inset 0 0 0 var(--ui-table-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-table-focus-ring-color, var(--global-border-focus))}.ui-table-sortable-column .ui-table-sort-icon{margin-left:var(--units-xs);vertical-align:middle}.ui-table._scrollable .ui-table-wrapper{overflow:auto}.ui-table._scrollable .ui-table-thead th{position:sticky;top:0;z-index:2}.ui-table._scrollable .ui-table-thead th._frozen-left,.ui-table._scrollable .ui-table-thead th._frozen-right{z-index:3}.ui-table._scrollable .ui-table-tfoot td{position:sticky;bottom:0;z-index:2}.ui-table._scrollable .ui-table-tbody._frozen-rows td{position:sticky;top:var(--ui-table-frozen-top, 0);z-index:1;font-weight:var(--ui-table-weight, var(--weight-bold))}.ui-table._flex-scroll{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.ui-table._flex-scroll .ui-table-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0}.ui-table._flex-scroll .ui-table-wrapper{flex:1 1 0;min-height:0}.ui-table._virtual .ui-table-wrapper{overflow-anchor:none}.ui-table .ui-table-table th._frozen-left,.ui-table .ui-table-table th._frozen-right,.ui-table .ui-table-table td._frozen-left,.ui-table .ui-table-table td._frozen-right{position:sticky;z-index:1}.ui-table-thead th._frozen-left,.ui-table-thead th._frozen-right{z-index:3}.ui-table._resizable .ui-table-thead th{position:relative;overflow:hidden}.ui-table-column-resizer{position:absolute;top:0;right:0;width:var(--ui-table-resizer-hit-width, var(--units-sm));height:100%;cursor:col-resize;touch-action:none}.ui-table-column-resizer:hover{border-right:var(--stroke-default) solid var(--ui-table-resizer-stroke-hover, var(--global-border-default-hover))}\n"]
1042
+ }]
1043
+ }],
1044
+ ctorParameters: () => [],
1045
+ propDecorators: {
1046
+ value: [{
1047
+ type: i0.Input,
1048
+ args: [{
1049
+ isSignal: true,
1050
+ alias: "value",
1051
+ required: false
1052
+ }]
1053
+ }],
1054
+ dataKey: [{
1055
+ type: i0.Input,
1056
+ args: [{
1057
+ isSignal: true,
1058
+ alias: "dataKey",
1059
+ required: false
1060
+ }]
1061
+ }],
1062
+ size: [{
1063
+ type: i0.Input,
1064
+ args: [{
1065
+ isSignal: true,
1066
+ alias: "size",
1067
+ required: false
1068
+ }]
1069
+ }],
1070
+ showGridlines: [{
1071
+ type: i0.Input,
1072
+ args: [{
1073
+ isSignal: true,
1074
+ alias: "showGridlines",
1075
+ required: false
1076
+ }]
1077
+ }],
1078
+ stripedRows: [{
1079
+ type: i0.Input,
1080
+ args: [{
1081
+ isSignal: true,
1082
+ alias: "stripedRows",
1083
+ required: false
1084
+ }]
1085
+ }],
1086
+ rowHover: [{
1087
+ type: i0.Input,
1088
+ args: [{
1089
+ isSignal: true,
1090
+ alias: "rowHover",
1091
+ required: false
1092
+ }]
1093
+ }],
1094
+ tableStyle: [{
1095
+ type: i0.Input,
1096
+ args: [{
1097
+ isSignal: true,
1098
+ alias: "tableStyle",
1099
+ required: false
1100
+ }]
1101
+ }],
1102
+ selectionMode: [{
1103
+ type: i0.Input,
1104
+ args: [{
1105
+ isSignal: true,
1106
+ alias: "selectionMode",
1107
+ required: false
1108
+ }]
1109
+ }],
1110
+ selection: [{
1111
+ type: i0.Input,
1112
+ args: [{
1113
+ isSignal: true,
1114
+ alias: "selection",
1115
+ required: false
1116
+ }]
1117
+ }, {
1118
+ type: i0.Output,
1119
+ args: ["selectionChange"]
1120
+ }],
1121
+ metaKeySelection: [{
1122
+ type: i0.Input,
1123
+ args: [{
1124
+ isSignal: true,
1125
+ alias: "metaKeySelection",
1126
+ required: false
1127
+ }]
1128
+ }],
1129
+ sortMode: [{
1130
+ type: i0.Input,
1131
+ args: [{
1132
+ isSignal: true,
1133
+ alias: "sortMode",
1134
+ required: false
1135
+ }]
1136
+ }],
1137
+ sortField: [{
1138
+ type: i0.Input,
1139
+ args: [{
1140
+ isSignal: true,
1141
+ alias: "sortField",
1142
+ required: false
1143
+ }]
1144
+ }],
1145
+ sortOrder: [{
1146
+ type: i0.Input,
1147
+ args: [{
1148
+ isSignal: true,
1149
+ alias: "sortOrder",
1150
+ required: false
1151
+ }]
1152
+ }],
1153
+ multiSortMeta: [{
1154
+ type: i0.Input,
1155
+ args: [{
1156
+ isSignal: true,
1157
+ alias: "multiSortMeta",
1158
+ required: false
1159
+ }]
1160
+ }],
1161
+ defaultSortOrder: [{
1162
+ type: i0.Input,
1163
+ args: [{
1164
+ isSignal: true,
1165
+ alias: "defaultSortOrder",
1166
+ required: false
1167
+ }]
1168
+ }],
1169
+ customSort: [{
1170
+ type: i0.Input,
1171
+ args: [{
1172
+ isSignal: true,
1173
+ alias: "customSort",
1174
+ required: false
1175
+ }]
1176
+ }],
1177
+ paginator: [{
1178
+ type: i0.Input,
1179
+ args: [{
1180
+ isSignal: true,
1181
+ alias: "paginator",
1182
+ required: false
1183
+ }]
1184
+ }],
1185
+ rows: [{
1186
+ type: i0.Input,
1187
+ args: [{
1188
+ isSignal: true,
1189
+ alias: "rows",
1190
+ required: false
1191
+ }]
1192
+ }],
1193
+ first: [{
1194
+ type: i0.Input,
1195
+ args: [{
1196
+ isSignal: true,
1197
+ alias: "first",
1198
+ required: false
1199
+ }]
1200
+ }, {
1201
+ type: i0.Output,
1202
+ args: ["firstChange"]
1203
+ }],
1204
+ rowsPerPageOptions: [{
1205
+ type: i0.Input,
1206
+ args: [{
1207
+ isSignal: true,
1208
+ alias: "rowsPerPageOptions",
1209
+ required: false
1210
+ }]
1211
+ }],
1212
+ pageLinks: [{
1213
+ type: i0.Input,
1214
+ args: [{
1215
+ isSignal: true,
1216
+ alias: "pageLinks",
1217
+ required: false
1218
+ }]
1219
+ }],
1220
+ totalRecords: [{
1221
+ type: i0.Input,
1222
+ args: [{
1223
+ isSignal: true,
1224
+ alias: "totalRecords",
1225
+ required: false
1226
+ }]
1227
+ }],
1228
+ scrollable: [{
1229
+ type: i0.Input,
1230
+ args: [{
1231
+ isSignal: true,
1232
+ alias: "scrollable",
1233
+ required: false
1234
+ }]
1235
+ }],
1236
+ scrollHeight: [{
1237
+ type: i0.Input,
1238
+ args: [{
1239
+ isSignal: true,
1240
+ alias: "scrollHeight",
1241
+ required: false
1242
+ }]
1243
+ }],
1244
+ frozenValue: [{
1245
+ type: i0.Input,
1246
+ args: [{
1247
+ isSignal: true,
1248
+ alias: "frozenValue",
1249
+ required: false
1250
+ }]
1251
+ }],
1252
+ expandedRowKeys: [{
1253
+ type: i0.Input,
1254
+ args: [{
1255
+ isSignal: true,
1256
+ alias: "expandedRowKeys",
1257
+ required: false
1258
+ }]
1259
+ }, {
1260
+ type: i0.Output,
1261
+ args: ["expandedRowKeysChange"]
1262
+ }],
1263
+ resizableColumns: [{
1264
+ type: i0.Input,
1265
+ args: [{
1266
+ isSignal: true,
1267
+ alias: "resizableColumns",
1268
+ required: false
1269
+ }]
1270
+ }],
1271
+ loading: [{
1272
+ type: i0.Input,
1273
+ args: [{
1274
+ isSignal: true,
1275
+ alias: "loading",
1276
+ required: false
1277
+ }]
1278
+ }],
1279
+ loadingAriaLabel: [{
1280
+ type: i0.Input,
1281
+ args: [{
1282
+ isSignal: true,
1283
+ alias: "loadingAriaLabel",
1284
+ required: false
1285
+ }]
1286
+ }],
1287
+ emptyMessage: [{
1288
+ type: i0.Input,
1289
+ args: [{
1290
+ isSignal: true,
1291
+ alias: "emptyMessage",
1292
+ required: false
1293
+ }]
1294
+ }],
1295
+ emptyIcon: [{
1296
+ type: i0.Input,
1297
+ args: [{
1298
+ isSignal: true,
1299
+ alias: "emptyIcon",
1300
+ required: false
1301
+ }]
1302
+ }],
1303
+ virtualScroll: [{
1304
+ type: i0.Input,
1305
+ args: [{
1306
+ isSignal: true,
1307
+ alias: "virtualScroll",
1308
+ required: false
1309
+ }]
1310
+ }],
1311
+ virtualScrollItemSize: [{
1312
+ type: i0.Input,
1313
+ args: [{
1314
+ isSignal: true,
1315
+ alias: "virtualScrollItemSize",
1316
+ required: false
1317
+ }]
1318
+ }],
1319
+ lazy: [{
1320
+ type: i0.Input,
1321
+ args: [{
1322
+ isSignal: true,
1323
+ alias: "lazy",
1324
+ required: false
1325
+ }]
1326
+ }],
1327
+ rowSelect: [{
1328
+ type: i0.Output,
1329
+ args: ["rowSelect"]
1330
+ }],
1331
+ rowUnselect: [{
1332
+ type: i0.Output,
1333
+ args: ["rowUnselect"]
1334
+ }],
1335
+ headerCheckboxToggle: [{
1336
+ type: i0.Output,
1337
+ args: ["headerCheckboxToggle"]
1338
+ }],
1339
+ sortFunction: [{
1340
+ type: i0.Output,
1341
+ args: ["sortFunction"]
1342
+ }],
1343
+ sortChange: [{
1344
+ type: i0.Output,
1345
+ args: ["sortChange"]
1346
+ }],
1347
+ pageChange: [{
1348
+ type: i0.Output,
1349
+ args: ["pageChange"]
1350
+ }],
1351
+ rowExpand: [{
1352
+ type: i0.Output,
1353
+ args: ["rowExpand"]
1354
+ }],
1355
+ rowCollapse: [{
1356
+ type: i0.Output,
1357
+ args: ["rowCollapse"]
1358
+ }],
1359
+ colResize: [{
1360
+ type: i0.Output,
1361
+ args: ["colResize"]
1362
+ }],
1363
+ rowReorder: [{
1364
+ type: i0.Output,
1365
+ args: ["rowReorder"]
1366
+ }],
1367
+ lazyLoad: [{
1368
+ type: i0.Output,
1369
+ args: ["lazyLoad"]
1370
+ }],
1371
+ captionTemplate: [{
1372
+ type: i0.ContentChild,
1373
+ args: ["caption", { isSignal: true }]
1374
+ }],
1375
+ headerTemplate: [{
1376
+ type: i0.ContentChild,
1377
+ args: ["header", { isSignal: true }]
1378
+ }],
1379
+ bodyTemplate: [{
1380
+ type: i0.ContentChild,
1381
+ args: ["body", { isSignal: true }]
1382
+ }],
1383
+ footerTemplate: [{
1384
+ type: i0.ContentChild,
1385
+ args: ["footer", { isSignal: true }]
1386
+ }],
1387
+ expandedRowTemplate: [{
1388
+ type: i0.ContentChild,
1389
+ args: ["expandedrow", { isSignal: true }]
1390
+ }],
1391
+ emptyMessageTemplate: [{
1392
+ type: i0.ContentChild,
1393
+ args: ["emptymessage", { isSignal: true }]
1394
+ }],
1395
+ tableEl: [{
1396
+ type: i0.ViewChild,
1397
+ args: ["tableEl", { isSignal: true }]
1398
+ }],
1399
+ theadEl: [{
1400
+ type: i0.ViewChild,
1401
+ args: ["theadEl", { isSignal: true }]
1402
+ }],
1403
+ wrapperEl: [{
1404
+ type: i0.ViewChild,
1405
+ args: ["wrapperEl", { isSignal: true }]
1406
+ }]
1407
+ }
1408
+ });
1409
+ var UiTableSortableColumn = class UiTableSortableColumn {
1410
+ constructor() {
1411
+ this.table = inject(UiTable);
1412
+ this.field = input.required({
1413
+ ...ngDevMode ? { debugName: "field" } : /* istanbul ignore next */ {},
1414
+ alias: "uiSortableColumn"
1415
+ });
1416
+ this.disabled = input(false, {
1417
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
1418
+ transform: booleanAttribute,
1419
+ alias: "uiSortableColumnDisabled"
1420
+ });
1421
+ this.sorted = computed(() => this.table.getSortOrder(this.field()) !== 0, ...ngDevMode ? [{ debugName: "sorted" }] : /* istanbul ignore next */ []);
1422
+ this.ariaSort = computed(() => {
1423
+ const order = this.table.getSortOrder(this.field());
1424
+ return order === 0 ? "none" : order > 0 ? "ascending" : "descending";
1425
+ }, ...ngDevMode ? [{ debugName: "ariaSort" }] : /* istanbul ignore next */ []);
1426
+ }
1427
+ onTrigger(event) {
1428
+ if (this.disabled()) return;
1429
+ event.preventDefault();
1430
+ this.table.toggleColumnSort(this.field(), event);
1431
+ }
1432
+ static {
1433
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1434
+ minVersion: "12.0.0",
1435
+ version: "22.3.0",
1436
+ ngImport: i0,
1437
+ type: UiTableSortableColumn,
1438
+ deps: [],
1439
+ target: i0.ɵɵFactoryTarget.Directive
1440
+ });
1441
+ }
1442
+ static {
1443
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1444
+ minVersion: "17.1.0",
1445
+ version: "22.3.0",
1446
+ type: UiTableSortableColumn,
1447
+ isStandalone: true,
1448
+ selector: "[uiSortableColumn]",
1449
+ inputs: {
1450
+ field: {
1451
+ classPropertyName: "field",
1452
+ publicName: "uiSortableColumn",
1453
+ isSignal: true,
1454
+ isRequired: true,
1455
+ transformFunction: null
1456
+ },
1457
+ disabled: {
1458
+ classPropertyName: "disabled",
1459
+ publicName: "uiSortableColumnDisabled",
1460
+ isSignal: true,
1461
+ isRequired: false,
1462
+ transformFunction: null
1463
+ }
1464
+ },
1465
+ host: {
1466
+ listeners: {
1467
+ "click": "onTrigger($event)",
1468
+ "keydown.enter": "onTrigger($event)",
1469
+ "keydown.space": "onTrigger($event)"
1470
+ },
1471
+ properties: {
1472
+ "class._sorted": "sorted()",
1473
+ "attr.tabindex": "disabled() ? null : 0",
1474
+ "attr.role": "\"columnheader\"",
1475
+ "attr.aria-sort": "ariaSort()"
1476
+ },
1477
+ classAttribute: "ui-table-sortable-column"
1478
+ },
1479
+ ngImport: i0
1480
+ });
1481
+ }
1482
+ };
1483
+ i0.ɵɵngDeclareClassMetadata({
1484
+ minVersion: "12.0.0",
1485
+ version: "22.3.0",
1486
+ ngImport: i0,
1487
+ type: UiTableSortableColumn,
1488
+ decorators: [{
1489
+ type: Directive,
1490
+ args: [{
1491
+ selector: "[uiSortableColumn]",
1492
+ host: {
1493
+ class: "ui-table-sortable-column",
1494
+ "[class._sorted]": "sorted()",
1495
+ "[attr.tabindex]": "disabled() ? null : 0",
1496
+ "[attr.role]": "\"columnheader\"",
1497
+ "[attr.aria-sort]": "ariaSort()",
1498
+ "(click)": "onTrigger($event)",
1499
+ "(keydown.enter)": "onTrigger($event)",
1500
+ "(keydown.space)": "onTrigger($event)"
1501
+ }
1502
+ }]
1503
+ }],
1504
+ propDecorators: {
1505
+ field: [{
1506
+ type: i0.Input,
1507
+ args: [{
1508
+ isSignal: true,
1509
+ alias: "uiSortableColumn",
1510
+ required: true
1511
+ }]
1512
+ }],
1513
+ disabled: [{
1514
+ type: i0.Input,
1515
+ args: [{
1516
+ isSignal: true,
1517
+ alias: "uiSortableColumnDisabled",
1518
+ required: false
1519
+ }]
1520
+ }]
1521
+ }
1522
+ });
1523
+ var UiTableSortIcon = class UiTableSortIcon {
1524
+ constructor() {
1525
+ this.table = inject(UiTable);
1526
+ this.field = input.required(...ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []);
1527
+ this.iconName = computed(() => {
1528
+ const order = this.table.getSortOrder(this.field());
1529
+ return order === 0 ? "sort" : order > 0 ? "sort-up" : "sort-down";
1530
+ }, ...ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []);
1531
+ }
1532
+ static {
1533
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1534
+ minVersion: "12.0.0",
1535
+ version: "22.3.0",
1536
+ ngImport: i0,
1537
+ type: UiTableSortIcon,
1538
+ deps: [],
1539
+ target: i0.ɵɵFactoryTarget.Component
1540
+ });
1541
+ }
1542
+ static {
1543
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1544
+ minVersion: "17.1.0",
1545
+ version: "22.3.0",
1546
+ type: UiTableSortIcon,
1547
+ isStandalone: true,
1548
+ selector: "ui-table-sort-icon",
1549
+ inputs: { field: {
1550
+ classPropertyName: "field",
1551
+ publicName: "field",
1552
+ isSignal: true,
1553
+ isRequired: true,
1554
+ transformFunction: null
1555
+ } },
1556
+ ngImport: i0,
1557
+ template: `<ui-icon class="ui-table-sort-icon" [name]="iconName()" size="sm" />`,
1558
+ isInline: true,
1559
+ dependencies: [{
1560
+ kind: "component",
1561
+ type: UiIcon,
1562
+ selector: "ui-icon",
1563
+ inputs: [
1564
+ "name",
1565
+ "size",
1566
+ "type",
1567
+ "family",
1568
+ "decorative",
1569
+ "ariaLabel"
1570
+ ]
1571
+ }]
1572
+ });
1573
+ }
1574
+ };
1575
+ i0.ɵɵngDeclareClassMetadata({
1576
+ minVersion: "12.0.0",
1577
+ version: "22.3.0",
1578
+ ngImport: i0,
1579
+ type: UiTableSortIcon,
1580
+ decorators: [{
1581
+ type: Component,
1582
+ args: [{
1583
+ selector: "ui-table-sort-icon",
1584
+ imports: [UiIcon],
1585
+ template: `<ui-icon class="ui-table-sort-icon" [name]="iconName()" size="sm" />`
1586
+ }]
1587
+ }],
1588
+ propDecorators: { field: [{
1589
+ type: i0.Input,
1590
+ args: [{
1591
+ isSignal: true,
1592
+ alias: "field",
1593
+ required: true
1594
+ }]
1595
+ }] }
1596
+ });
1597
+ var UiTableSelectableRow = class UiTableSelectableRow {
1598
+ constructor() {
1599
+ this.table = inject(UiTable);
1600
+ this.el = inject(ElementRef);
1601
+ this.data = input.required({
1602
+ ...ngDevMode ? { debugName: "data" } : /* istanbul ignore next */ {},
1603
+ alias: "uiSelectableRow"
1604
+ });
1605
+ this.index = input(0, {
1606
+ ...ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {},
1607
+ transform: numberAttribute,
1608
+ alias: "uiSelectableRowIndex"
1609
+ });
1610
+ this.disabled = input(false, {
1611
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
1612
+ transform: booleanAttribute,
1613
+ alias: "uiSelectableRowDisabled"
1614
+ });
1615
+ this.selected = computed(() => this.table.isSelected(this.data()), ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
1616
+ this.tabindex = computed(() => {
1617
+ if (this.disabled()) return null;
1618
+ return this.table.isRowTabbable(this.data()) ? 0 : -1;
1619
+ }, ...ngDevMode ? [{ debugName: "tabindex" }] : /* istanbul ignore next */ []);
1620
+ effect(() => {
1621
+ this.table.selectableRowRefs.set(this.el.nativeElement, {
1622
+ data: this.data(),
1623
+ index: this.index()
1624
+ });
1625
+ });
1626
+ inject(DestroyRef).onDestroy(() => this.table.selectableRowRefs.delete(this.el.nativeElement));
1627
+ }
1628
+ onClick(event) {
1629
+ if (this.disabled()) return;
1630
+ this.table.handleRowClick(event, this.data(), this.index());
1631
+ }
1632
+ onKeydown(event) {
1633
+ if (this.disabled()) return;
1634
+ const meta = event.metaKey || event.ctrlKey;
1635
+ switch (event.key) {
1636
+ case "ArrowDown":
1637
+ case "ArrowUp": {
1638
+ event.preventDefault();
1639
+ const target = this.findSiblingRow(event.key === "ArrowDown" ? "next" : "previous");
1640
+ if (!target) return;
1641
+ target.focus();
1642
+ if (event.shiftKey) {
1643
+ const ref = this.table.selectableRowRefs.get(target);
1644
+ if (ref) this.table.selectRange(event, ref.index);
1645
+ }
1646
+ break;
1647
+ }
1648
+ case "Home":
1649
+ case "End": {
1650
+ event.preventDefault();
1651
+ const edge = event.key === "Home" ? "start" : "end";
1652
+ this.findEdgeRow(edge)?.focus();
1653
+ if (meta && event.shiftKey) this.table.selectRangeToEdge(this.index(), edge);
1654
+ break;
1655
+ }
1656
+ case "Enter":
1657
+ event.preventDefault();
1658
+ this.table.handleRowClick(event, this.data(), this.index());
1659
+ break;
1660
+ case " ":
1661
+ event.preventDefault();
1662
+ if (event.shiftKey) this.table.selectRange(event, this.index());
1663
+ else this.table.handleRowClick(event, this.data(), this.index());
1664
+ break;
1665
+ case "a":
1666
+ case "A":
1667
+ if (!meta) return;
1668
+ event.preventDefault();
1669
+ this.table.selectAllRows(event);
1670
+ }
1671
+ }
1672
+ findSiblingRow(direction) {
1673
+ let el = this.el.nativeElement;
1674
+ while (el = direction === "next" ? el.nextElementSibling : el.previousElementSibling) if (el.classList.contains("ui-table-selectable-row")) return el;
1675
+ return null;
1676
+ }
1677
+ findEdgeRow(edge) {
1678
+ const rows = this.el.nativeElement.closest("table")?.querySelectorAll(".ui-table-selectable-row");
1679
+ if (!rows?.length) return null;
1680
+ return edge === "start" ? rows[0] : rows[rows.length - 1];
1681
+ }
1682
+ static {
1683
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1684
+ minVersion: "12.0.0",
1685
+ version: "22.3.0",
1686
+ ngImport: i0,
1687
+ type: UiTableSelectableRow,
1688
+ deps: [],
1689
+ target: i0.ɵɵFactoryTarget.Directive
1690
+ });
1691
+ }
1692
+ static {
1693
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1694
+ minVersion: "17.1.0",
1695
+ version: "22.3.0",
1696
+ type: UiTableSelectableRow,
1697
+ isStandalone: true,
1698
+ selector: "[uiSelectableRow]",
1699
+ inputs: {
1700
+ data: {
1701
+ classPropertyName: "data",
1702
+ publicName: "uiSelectableRow",
1703
+ isSignal: true,
1704
+ isRequired: true,
1705
+ transformFunction: null
1706
+ },
1707
+ index: {
1708
+ classPropertyName: "index",
1709
+ publicName: "uiSelectableRowIndex",
1710
+ isSignal: true,
1711
+ isRequired: false,
1712
+ transformFunction: null
1713
+ },
1714
+ disabled: {
1715
+ classPropertyName: "disabled",
1716
+ publicName: "uiSelectableRowDisabled",
1717
+ isSignal: true,
1718
+ isRequired: false,
1719
+ transformFunction: null
1720
+ }
1721
+ },
1722
+ host: {
1723
+ listeners: {
1724
+ "click": "onClick($event)",
1725
+ "keydown": "onKeydown($event)"
1726
+ },
1727
+ properties: {
1728
+ "class._selected": "selected()",
1729
+ "attr.tabindex": "tabindex()",
1730
+ "attr.aria-selected": "selected()"
1731
+ },
1732
+ classAttribute: "ui-table-selectable-row"
1733
+ },
1734
+ ngImport: i0
1735
+ });
1736
+ }
1737
+ };
1738
+ i0.ɵɵngDeclareClassMetadata({
1739
+ minVersion: "12.0.0",
1740
+ version: "22.3.0",
1741
+ ngImport: i0,
1742
+ type: UiTableSelectableRow,
1743
+ decorators: [{
1744
+ type: Directive,
1745
+ args: [{
1746
+ selector: "[uiSelectableRow]",
1747
+ host: {
1748
+ class: "ui-table-selectable-row",
1749
+ "[class._selected]": "selected()",
1750
+ "[attr.tabindex]": "tabindex()",
1751
+ "[attr.aria-selected]": "selected()",
1752
+ "(click)": "onClick($event)",
1753
+ "(keydown)": "onKeydown($event)"
1754
+ }
1755
+ }]
1756
+ }],
1757
+ ctorParameters: () => [],
1758
+ propDecorators: {
1759
+ data: [{
1760
+ type: i0.Input,
1761
+ args: [{
1762
+ isSignal: true,
1763
+ alias: "uiSelectableRow",
1764
+ required: true
1765
+ }]
1766
+ }],
1767
+ index: [{
1768
+ type: i0.Input,
1769
+ args: [{
1770
+ isSignal: true,
1771
+ alias: "uiSelectableRowIndex",
1772
+ required: false
1773
+ }]
1774
+ }],
1775
+ disabled: [{
1776
+ type: i0.Input,
1777
+ args: [{
1778
+ isSignal: true,
1779
+ alias: "uiSelectableRowDisabled",
1780
+ required: false
1781
+ }]
1782
+ }]
1783
+ }
1784
+ });
1785
+ var UiTableCheckbox = class UiTableCheckbox {
1786
+ constructor() {
1787
+ this.table = inject(UiTable);
1788
+ this.value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
1789
+ this.index = input(void 0, {
1790
+ ...ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {},
1791
+ transform: (v) => v == null ? void 0 : Number(v)
1792
+ });
1793
+ this.disabled = input(false, {
1794
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
1795
+ transform: booleanAttribute
1796
+ });
1797
+ this.ariaLabel = input("Sélectionner la ligne", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1798
+ this.checked = computed(() => this.table.isSelected(this.value()), ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
1799
+ }
1800
+ onToggle(_checked) {
1801
+ this.table.toggleRowWithCheckbox(void 0, this.value(), this.index());
1802
+ }
1803
+ static {
1804
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1805
+ minVersion: "12.0.0",
1806
+ version: "22.3.0",
1807
+ ngImport: i0,
1808
+ type: UiTableCheckbox,
1809
+ deps: [],
1810
+ target: i0.ɵɵFactoryTarget.Component
1811
+ });
1812
+ }
1813
+ static {
1814
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1815
+ minVersion: "17.1.0",
1816
+ version: "22.3.0",
1817
+ type: UiTableCheckbox,
1818
+ isStandalone: true,
1819
+ selector: "ui-table-checkbox",
1820
+ inputs: {
1821
+ value: {
1822
+ classPropertyName: "value",
1823
+ publicName: "value",
1824
+ isSignal: true,
1825
+ isRequired: true,
1826
+ transformFunction: null
1827
+ },
1828
+ index: {
1829
+ classPropertyName: "index",
1830
+ publicName: "index",
1831
+ isSignal: true,
1832
+ isRequired: false,
1833
+ transformFunction: null
1834
+ },
1835
+ disabled: {
1836
+ classPropertyName: "disabled",
1837
+ publicName: "disabled",
1838
+ isSignal: true,
1839
+ isRequired: false,
1840
+ transformFunction: null
1841
+ },
1842
+ ariaLabel: {
1843
+ classPropertyName: "ariaLabel",
1844
+ publicName: "ariaLabel",
1845
+ isSignal: true,
1846
+ isRequired: false,
1847
+ transformFunction: null
1848
+ }
1849
+ },
1850
+ ngImport: i0,
1851
+ template: `
1024
1852
  <ui-checkbox
1025
1853
  [ngModel]="checked()"
1026
1854
  [disabled]="disabled()"
1027
1855
  [ariaLabel]="ariaLabel()"
1028
1856
  (checkboxChange)="onToggle($event)"
1029
1857
  />
1030
- `, isInline: true, dependencies: [{ kind: "component", type: UiCheckbox, selector: "ui-checkbox", inputs: ["label", "trueValue", "falseValue", "indeterminate", "checkIcon", "indeterminateIcon"], outputs: ["checkboxChange", "checkboxFocus", "checkboxBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1031
- }
1032
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableCheckbox, decorators: [{
1033
- type: Component,
1034
- args: [{
1035
- selector: 'ui-table-checkbox',
1036
- imports: [UiCheckbox, FormsModule],
1037
- template: `
1858
+ `,
1859
+ isInline: true,
1860
+ dependencies: [
1861
+ {
1862
+ kind: "component",
1863
+ type: UiCheckbox,
1864
+ selector: "ui-checkbox",
1865
+ inputs: [
1866
+ "label",
1867
+ "trueValue",
1868
+ "falseValue",
1869
+ "indeterminate",
1870
+ "checkIcon",
1871
+ "indeterminateIcon"
1872
+ ],
1873
+ outputs: [
1874
+ "checkboxChange",
1875
+ "checkboxFocus",
1876
+ "checkboxBlur"
1877
+ ]
1878
+ },
1879
+ {
1880
+ kind: "ngmodule",
1881
+ type: FormsModule
1882
+ },
1883
+ {
1884
+ kind: "directive",
1885
+ type: i1.NgControlStatus,
1886
+ selector: "[formControlName],[ngModel],[formControl]"
1887
+ },
1888
+ {
1889
+ kind: "directive",
1890
+ type: i1.NgModel,
1891
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
1892
+ inputs: [
1893
+ "name",
1894
+ "disabled",
1895
+ "ngModel",
1896
+ "ngModelOptions"
1897
+ ],
1898
+ outputs: ["ngModelChange"],
1899
+ exportAs: ["ngModel"]
1900
+ }
1901
+ ]
1902
+ });
1903
+ }
1904
+ };
1905
+ i0.ɵɵngDeclareClassMetadata({
1906
+ minVersion: "12.0.0",
1907
+ version: "22.3.0",
1908
+ ngImport: i0,
1909
+ type: UiTableCheckbox,
1910
+ decorators: [{
1911
+ type: Component,
1912
+ args: [{
1913
+ selector: "ui-table-checkbox",
1914
+ imports: [UiCheckbox, FormsModule],
1915
+ template: `
1038
1916
  <ui-checkbox
1039
1917
  [ngModel]="checked()"
1040
1918
  [disabled]="disabled()"
1041
1919
  [ariaLabel]="ariaLabel()"
1042
1920
  (checkboxChange)="onToggle($event)"
1043
1921
  />
1044
- `,
1045
- }]
1046
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
1047
- /**
1048
- * ui-table-header-checkbox — header select-all checkbox (checkbox selection).
1049
- * Checked when every row is selected, indeterminate on partial selection.
1050
- */
1051
- class UiTableHeaderCheckbox {
1052
- constructor() {
1053
- /** @ignore */
1054
- this.table = inject(UiTable);
1055
- /** Disables the checkbox. */
1056
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1057
- /** Accessible name of the checkbox. */
1058
- this.ariaLabel = input('Tout sélectionner', /* @ts-ignore */
1059
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
1060
- }
1061
- /** @ignore */
1062
- onToggle(checked) {
1063
- this.table.toggleAllRows(undefined, checked === true);
1064
- }
1065
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableHeaderCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1066
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiTableHeaderCheckbox, isStandalone: true, selector: "ui-table-header-checkbox", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
1922
+ `
1923
+ }]
1924
+ }],
1925
+ propDecorators: {
1926
+ value: [{
1927
+ type: i0.Input,
1928
+ args: [{
1929
+ isSignal: true,
1930
+ alias: "value",
1931
+ required: true
1932
+ }]
1933
+ }],
1934
+ index: [{
1935
+ type: i0.Input,
1936
+ args: [{
1937
+ isSignal: true,
1938
+ alias: "index",
1939
+ required: false
1940
+ }]
1941
+ }],
1942
+ disabled: [{
1943
+ type: i0.Input,
1944
+ args: [{
1945
+ isSignal: true,
1946
+ alias: "disabled",
1947
+ required: false
1948
+ }]
1949
+ }],
1950
+ ariaLabel: [{
1951
+ type: i0.Input,
1952
+ args: [{
1953
+ isSignal: true,
1954
+ alias: "ariaLabel",
1955
+ required: false
1956
+ }]
1957
+ }]
1958
+ }
1959
+ });
1960
+ var UiTableHeaderCheckbox = class UiTableHeaderCheckbox {
1961
+ constructor() {
1962
+ this.table = inject(UiTable);
1963
+ this.disabled = input(false, {
1964
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
1965
+ transform: booleanAttribute
1966
+ });
1967
+ this.ariaLabel = input("Tout sélectionner", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
1968
+ }
1969
+ onToggle(checked) {
1970
+ this.table.toggleAllRows(void 0, checked === true);
1971
+ }
1972
+ static {
1973
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1974
+ minVersion: "12.0.0",
1975
+ version: "22.3.0",
1976
+ ngImport: i0,
1977
+ type: UiTableHeaderCheckbox,
1978
+ deps: [],
1979
+ target: i0.ɵɵFactoryTarget.Component
1980
+ });
1981
+ }
1982
+ static {
1983
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1984
+ minVersion: "17.1.0",
1985
+ version: "22.3.0",
1986
+ type: UiTableHeaderCheckbox,
1987
+ isStandalone: true,
1988
+ selector: "ui-table-header-checkbox",
1989
+ inputs: {
1990
+ disabled: {
1991
+ classPropertyName: "disabled",
1992
+ publicName: "disabled",
1993
+ isSignal: true,
1994
+ isRequired: false,
1995
+ transformFunction: null
1996
+ },
1997
+ ariaLabel: {
1998
+ classPropertyName: "ariaLabel",
1999
+ publicName: "ariaLabel",
2000
+ isSignal: true,
2001
+ isRequired: false,
2002
+ transformFunction: null
2003
+ }
2004
+ },
2005
+ ngImport: i0,
2006
+ template: `
1067
2007
  <ui-checkbox
1068
2008
  [ngModel]="table.allSelected()"
1069
2009
  [indeterminate]="table.partiallySelected()"
@@ -1071,14 +2011,64 @@ class UiTableHeaderCheckbox {
1071
2011
  [ariaLabel]="ariaLabel()"
1072
2012
  (checkboxChange)="onToggle($event)"
1073
2013
  />
1074
- `, isInline: true, dependencies: [{ kind: "component", type: UiCheckbox, selector: "ui-checkbox", inputs: ["label", "trueValue", "falseValue", "indeterminate", "checkIcon", "indeterminateIcon"], outputs: ["checkboxChange", "checkboxFocus", "checkboxBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1075
- }
1076
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableHeaderCheckbox, decorators: [{
1077
- type: Component,
1078
- args: [{
1079
- selector: 'ui-table-header-checkbox',
1080
- imports: [UiCheckbox, FormsModule],
1081
- template: `
2014
+ `,
2015
+ isInline: true,
2016
+ dependencies: [
2017
+ {
2018
+ kind: "component",
2019
+ type: UiCheckbox,
2020
+ selector: "ui-checkbox",
2021
+ inputs: [
2022
+ "label",
2023
+ "trueValue",
2024
+ "falseValue",
2025
+ "indeterminate",
2026
+ "checkIcon",
2027
+ "indeterminateIcon"
2028
+ ],
2029
+ outputs: [
2030
+ "checkboxChange",
2031
+ "checkboxFocus",
2032
+ "checkboxBlur"
2033
+ ]
2034
+ },
2035
+ {
2036
+ kind: "ngmodule",
2037
+ type: FormsModule
2038
+ },
2039
+ {
2040
+ kind: "directive",
2041
+ type: i1.NgControlStatus,
2042
+ selector: "[formControlName],[ngModel],[formControl]"
2043
+ },
2044
+ {
2045
+ kind: "directive",
2046
+ type: i1.NgModel,
2047
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
2048
+ inputs: [
2049
+ "name",
2050
+ "disabled",
2051
+ "ngModel",
2052
+ "ngModelOptions"
2053
+ ],
2054
+ outputs: ["ngModelChange"],
2055
+ exportAs: ["ngModel"]
2056
+ }
2057
+ ]
2058
+ });
2059
+ }
2060
+ };
2061
+ i0.ɵɵngDeclareClassMetadata({
2062
+ minVersion: "12.0.0",
2063
+ version: "22.3.0",
2064
+ ngImport: i0,
2065
+ type: UiTableHeaderCheckbox,
2066
+ decorators: [{
2067
+ type: Component,
2068
+ args: [{
2069
+ selector: "ui-table-header-checkbox",
2070
+ imports: [UiCheckbox, FormsModule],
2071
+ template: `
1082
2072
  <ui-checkbox
1083
2073
  [ngModel]="table.allSelected()"
1084
2074
  [indeterminate]="table.partiallySelected()"
@@ -1086,37 +2076,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
1086
2076
  [ariaLabel]="ariaLabel()"
1087
2077
  (checkboxChange)="onToggle($event)"
1088
2078
  />
1089
- `,
1090
- }]
1091
- }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
1092
- /**
1093
- * ui-table-radio — row radio button of a radio-based single selection.
1094
- * Instantiates `ui-radio` bound to the table selection.
1095
- */
1096
- class UiTableRadio {
1097
- constructor() {
1098
- /** @ignore */
1099
- this.table = inject(UiTable);
1100
- /** Row this radio selects. */
1101
- this.value = input.required(/* @ts-ignore */
1102
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1103
- /** Absolute row index (forwarded to the selection events). */
1104
- this.index = input(undefined, { ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), transform: (v) => (v == null ? undefined : Number(v)) });
1105
- /** Native group name (defaults to a per-table group). */
1106
- this.name = input('ui-table-radio', /* @ts-ignore */
1107
- ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
1108
- /** Disables the radio. */
1109
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
1110
- /** Accessible name of the radio. */
1111
- this.ariaLabel = input('Sélectionner la ligne', /* @ts-ignore */
1112
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
1113
- }
1114
- /** @ignore */
1115
- onSelect() {
1116
- this.table.selectRowWithRadio(undefined, this.value(), this.index());
1117
- }
1118
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableRadio, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1119
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiTableRadio, isStandalone: true, selector: "ui-table-radio", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
2079
+ `
2080
+ }]
2081
+ }],
2082
+ propDecorators: {
2083
+ disabled: [{
2084
+ type: i0.Input,
2085
+ args: [{
2086
+ isSignal: true,
2087
+ alias: "disabled",
2088
+ required: false
2089
+ }]
2090
+ }],
2091
+ ariaLabel: [{
2092
+ type: i0.Input,
2093
+ args: [{
2094
+ isSignal: true,
2095
+ alias: "ariaLabel",
2096
+ required: false
2097
+ }]
2098
+ }]
2099
+ }
2100
+ });
2101
+ var UiTableRadio = class UiTableRadio {
2102
+ constructor() {
2103
+ this.table = inject(UiTable);
2104
+ this.value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
2105
+ this.index = input(void 0, {
2106
+ ...ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {},
2107
+ transform: (v) => v == null ? void 0 : Number(v)
2108
+ });
2109
+ this.name = input("ui-table-radio", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
2110
+ this.disabled = input(false, {
2111
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
2112
+ transform: booleanAttribute
2113
+ });
2114
+ this.ariaLabel = input("Sélectionner la ligne", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
2115
+ }
2116
+ onSelect() {
2117
+ this.table.selectRowWithRadio(void 0, this.value(), this.index());
2118
+ }
2119
+ static {
2120
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2121
+ minVersion: "12.0.0",
2122
+ version: "22.3.0",
2123
+ ngImport: i0,
2124
+ type: UiTableRadio,
2125
+ deps: [],
2126
+ target: i0.ɵɵFactoryTarget.Component
2127
+ });
2128
+ }
2129
+ static {
2130
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2131
+ minVersion: "17.1.0",
2132
+ version: "22.3.0",
2133
+ type: UiTableRadio,
2134
+ isStandalone: true,
2135
+ selector: "ui-table-radio",
2136
+ inputs: {
2137
+ value: {
2138
+ classPropertyName: "value",
2139
+ publicName: "value",
2140
+ isSignal: true,
2141
+ isRequired: true,
2142
+ transformFunction: null
2143
+ },
2144
+ index: {
2145
+ classPropertyName: "index",
2146
+ publicName: "index",
2147
+ isSignal: true,
2148
+ isRequired: false,
2149
+ transformFunction: null
2150
+ },
2151
+ name: {
2152
+ classPropertyName: "name",
2153
+ publicName: "name",
2154
+ isSignal: true,
2155
+ isRequired: false,
2156
+ transformFunction: null
2157
+ },
2158
+ disabled: {
2159
+ classPropertyName: "disabled",
2160
+ publicName: "disabled",
2161
+ isSignal: true,
2162
+ isRequired: false,
2163
+ transformFunction: null
2164
+ },
2165
+ ariaLabel: {
2166
+ classPropertyName: "ariaLabel",
2167
+ publicName: "ariaLabel",
2168
+ isSignal: true,
2169
+ isRequired: false,
2170
+ transformFunction: null
2171
+ }
2172
+ },
2173
+ ngImport: i0,
2174
+ template: `
1120
2175
  <ui-radio
1121
2176
  [value]="value()"
1122
2177
  [ngModel]="table.isSelected(value()) ? value() : undefined"
@@ -1125,14 +2180,57 @@ class UiTableRadio {
1125
2180
  [ariaLabel]="ariaLabel()"
1126
2181
  (radioChange)="onSelect()"
1127
2182
  />
1128
- `, isInline: true, dependencies: [{ kind: "component", type: UiRadio, selector: "ui-radio", inputs: ["value", "label"], outputs: ["radioChange", "radioFocus", "radioBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1129
- }
1130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableRadio, decorators: [{
1131
- type: Component,
1132
- args: [{
1133
- selector: 'ui-table-radio',
1134
- imports: [UiRadio, FormsModule],
1135
- template: `
2183
+ `,
2184
+ isInline: true,
2185
+ dependencies: [
2186
+ {
2187
+ kind: "component",
2188
+ type: UiRadio,
2189
+ selector: "ui-radio",
2190
+ inputs: ["value", "label"],
2191
+ outputs: [
2192
+ "radioChange",
2193
+ "radioFocus",
2194
+ "radioBlur"
2195
+ ]
2196
+ },
2197
+ {
2198
+ kind: "ngmodule",
2199
+ type: FormsModule
2200
+ },
2201
+ {
2202
+ kind: "directive",
2203
+ type: i1.NgControlStatus,
2204
+ selector: "[formControlName],[ngModel],[formControl]"
2205
+ },
2206
+ {
2207
+ kind: "directive",
2208
+ type: i1.NgModel,
2209
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
2210
+ inputs: [
2211
+ "name",
2212
+ "disabled",
2213
+ "ngModel",
2214
+ "ngModelOptions"
2215
+ ],
2216
+ outputs: ["ngModelChange"],
2217
+ exportAs: ["ngModel"]
2218
+ }
2219
+ ]
2220
+ });
2221
+ }
2222
+ };
2223
+ i0.ɵɵngDeclareClassMetadata({
2224
+ minVersion: "12.0.0",
2225
+ version: "22.3.0",
2226
+ ngImport: i0,
2227
+ type: UiTableRadio,
2228
+ decorators: [{
2229
+ type: Component,
2230
+ args: [{
2231
+ selector: "ui-table-radio",
2232
+ imports: [UiRadio, FormsModule],
2233
+ template: `
1136
2234
  <ui-radio
1137
2235
  [value]="value()"
1138
2236
  [ngModel]="table.isSelected(value()) ? value() : undefined"
@@ -1141,279 +2239,444 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
1141
2239
  [ariaLabel]="ariaLabel()"
1142
2240
  (radioChange)="onSelect()"
1143
2241
  />
1144
- `,
1145
- }]
1146
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
1147
- /**
1148
- * uiRowToggler — toggles the expansion of a row. Place it on the expand
1149
- * button (native `<button>` or `ui-button`); `aria-expanded` is reflected.
1150
- */
1151
- class UiTableRowToggler {
1152
- constructor() {
1153
- /** @ignore */
1154
- this.table = inject(UiTable);
1155
- /** Row whose expansion this button toggles. */
1156
- this.data = input.required({ ...(ngDevMode ? { debugName: "data" } : /* istanbul ignore next */ {}), alias: 'uiRowToggler' });
1157
- /** @ignore */
1158
- this.expanded = computed(() => this.table.isRowExpanded(this.data()), /* @ts-ignore */
1159
- ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
1160
- }
1161
- /** @ignore */
1162
- onToggle(event) {
1163
- this.table.toggleRow(this.data(), event);
1164
- event.stopPropagation();
1165
- }
1166
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableRowToggler, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1167
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiTableRowToggler, isStandalone: true, selector: "[uiRowToggler]", inputs: { data: { classPropertyName: "data", publicName: "uiRowToggler", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onToggle($event)" }, properties: { "attr.aria-expanded": "expanded()" } }, ngImport: i0 }); }
1168
- }
1169
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableRowToggler, decorators: [{
1170
- type: Directive,
1171
- args: [{
1172
- selector: '[uiRowToggler]',
1173
- host: {
1174
- '[attr.aria-expanded]': 'expanded()',
1175
- '(click)': 'onToggle($event)',
1176
- },
1177
- }]
1178
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiRowToggler", required: true }] }] } });
1179
- /**
1180
- * uiFrozenColumn — pins a column while scrolling horizontally.
1181
- * Apply to every `<th>`/`<td>` of the column; `alignFrozen` picks the edge.
1182
- */
1183
- class UiTableFrozenColumn {
1184
- constructor() {
1185
- /** @ignore */
1186
- this.el = inject(ElementRef);
1187
- /** @ignore */
1188
- this.injector = inject(Injector);
1189
- /** Enables the pinning (attribute presence defaults to true). */
1190
- this.frozen = input(true, { ...(ngDevMode ? { debugName: "frozen" } : /* istanbul ignore next */ {}), alias: 'uiFrozenColumn',
1191
- transform: (value) => value === '' || value == null || booleanAttribute(value) });
1192
- /** Edge the column sticks to. */
1193
- this.alignFrozen = input('left', /* @ts-ignore */
1194
- ...(ngDevMode ? [{ debugName: "alignFrozen" }] : /* istanbul ignore next */ []));
1195
- /** @ignore */
1196
- this.isFrozen = computed(() => this.frozen(), /* @ts-ignore */
1197
- ...(ngDevMode ? [{ debugName: "isFrozen" }] : /* istanbul ignore next */ []));
1198
- // Offset = accumulated width of the previously pinned columns on the same
1199
- // edge. Re-measured whenever the row resizes (column resize, data change).
1200
- afterNextRender(() => {
1201
- this.updatePosition();
1202
- const row = this.el.nativeElement.parentElement;
1203
- if (row && typeof ResizeObserver !== 'undefined') {
1204
- const observer = new ResizeObserver(() => this.updatePosition());
1205
- observer.observe(row);
1206
- this.injector.get(DestroyRef).onDestroy(() => observer.disconnect());
1207
- }
1208
- });
1209
- effect(() => {
1210
- this.frozen();
1211
- this.alignFrozen();
1212
- this.updatePosition();
1213
- });
1214
- }
1215
- /** @ignore */
1216
- updatePosition() {
1217
- const cell = this.el.nativeElement;
1218
- if (!this.frozen()) {
1219
- cell.style.left = '';
1220
- cell.style.right = '';
1221
- return;
1222
- }
1223
- if (this.alignFrozen() === 'left') {
1224
- let offset = 0;
1225
- let sibling = cell.previousElementSibling;
1226
- while (sibling) {
1227
- if (sibling.classList.contains('_frozen-left'))
1228
- offset += sibling.getBoundingClientRect().width;
1229
- sibling = sibling.previousElementSibling;
1230
- }
1231
- cell.style.left = `${offset}px`;
1232
- cell.style.right = '';
1233
- }
1234
- else {
1235
- let offset = 0;
1236
- let sibling = cell.nextElementSibling;
1237
- while (sibling) {
1238
- if (sibling.classList.contains('_frozen-right'))
1239
- offset += sibling.getBoundingClientRect().width;
1240
- sibling = sibling.nextElementSibling;
1241
- }
1242
- cell.style.right = `${offset}px`;
1243
- cell.style.left = '';
1244
- }
1245
- }
1246
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableFrozenColumn, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1247
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiTableFrozenColumn, isStandalone: true, selector: "[uiFrozenColumn]", inputs: { frozen: { classPropertyName: "frozen", publicName: "uiFrozenColumn", isSignal: true, isRequired: false, transformFunction: null }, alignFrozen: { classPropertyName: "alignFrozen", publicName: "alignFrozen", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class._frozen-left": "isFrozen() && alignFrozen() === \"left\"", "class._frozen-right": "isFrozen() && alignFrozen() === \"right\"" } }, ngImport: i0 }); }
1248
- }
1249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableFrozenColumn, decorators: [{
1250
- type: Directive,
1251
- args: [{
1252
- selector: '[uiFrozenColumn]',
1253
- host: {
1254
- '[class._frozen-left]': 'isFrozen() && alignFrozen() === "left"',
1255
- '[class._frozen-right]': 'isFrozen() && alignFrozen() === "right"',
1256
- },
1257
- }]
1258
- }], ctorParameters: () => [], propDecorators: { frozen: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiFrozenColumn", required: false }] }], alignFrozen: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignFrozen", required: false }] }] } });
1259
- /**
1260
- * uiResizableColumn — drag handle on a `<th>` to resize the column.
1261
- * Fit mode: the next column absorbs the delta, the table width is preserved.
1262
- */
1263
- class UiTableResizableColumn {
1264
- constructor() {
1265
- /** @ignore */
1266
- this.table = inject(UiTable);
1267
- /** @ignore */
1268
- this.el = inject(ElementRef);
1269
- /** @ignore */
1270
- this.destroyRef = inject(DestroyRef);
1271
- /** @ignore */
1272
- this.startX = 0;
1273
- /** @ignore */
1274
- this.startWidth = 0;
1275
- /** @ignore */
1276
- this.nextStartWidth = 0;
1277
- /** @ignore */
1278
- this.appliedDelta = 0;
1279
- /** @ignore */
1280
- this.cleanupDrag = null;
1281
- /** @ignore */
1282
- this.onPointerDown = (event) => {
1283
- const cell = this.el.nativeElement;
1284
- const next = cell.nextElementSibling;
1285
- if (!next)
1286
- return;
1287
- event.preventDefault();
1288
- this.table.lockColumnWidths();
1289
- this.startX = event.clientX;
1290
- this.startWidth = cell.getBoundingClientRect().width;
1291
- this.nextStartWidth = next.getBoundingClientRect().width;
1292
- this.appliedDelta = 0;
1293
- const onMove = (moveEvent) => {
1294
- const delta = moveEvent.clientX - this.startX;
1295
- if (this.table.resizeColumnFit(cell, this.startWidth, this.nextStartWidth, delta)) {
1296
- this.appliedDelta = delta;
1297
- }
1298
- };
1299
- const onUp = () => {
1300
- this.cleanupDrag?.();
1301
- if (this.appliedDelta !== 0)
1302
- this.table.notifyColResize(cell, this.appliedDelta);
1303
- };
1304
- document.addEventListener('pointermove', onMove);
1305
- document.addEventListener('pointerup', onUp);
1306
- this.cleanupDrag = () => {
1307
- document.removeEventListener('pointermove', onMove);
1308
- document.removeEventListener('pointerup', onUp);
1309
- this.cleanupDrag = null;
1310
- };
1311
- };
1312
- afterNextRender(() => {
1313
- const handle = document.createElement('span');
1314
- handle.className = 'ui-table-column-resizer';
1315
- handle.setAttribute('aria-hidden', 'true');
1316
- handle.addEventListener('pointerdown', this.onPointerDown);
1317
- this.el.nativeElement.appendChild(handle);
1318
- });
1319
- this.destroyRef.onDestroy(() => this.cleanupDrag?.());
1320
- }
1321
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableResizableColumn, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1322
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: UiTableResizableColumn, isStandalone: true, selector: "[uiResizableColumn]", host: { classAttribute: "ui-table-resizable-column" }, ngImport: i0 }); }
1323
- }
1324
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableResizableColumn, decorators: [{
1325
- type: Directive,
1326
- args: [{
1327
- selector: '[uiResizableColumn]',
1328
- host: { class: 'ui-table-resizable-column' },
1329
- }]
1330
- }], ctorParameters: () => [] });
1331
- /**
1332
- * uiReorderableRow — drag & drop a `<tr>` to reorder rows.
1333
- *
1334
- * Pass the absolute `rowIndex` from the body template context. On drop the
1335
- * table emits `rowReorder` with a reordered copy of `value` (rebind it).
1336
- * Intended for unsorted data (reordering a sorted view is ambiguous).
1337
- */
1338
- class UiTableReorderableRow {
1339
- constructor() {
1340
- /** @ignore */
1341
- this.table = inject(UiTable);
1342
- /** @ignore */
1343
- this.el = inject(ElementRef);
1344
- /** Absolute row index (from the body template context). */
1345
- this.index = input.required({ ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), alias: 'uiReorderableRow',
1346
- transform: numberAttribute });
1347
- /** @ignore Visual drop indicator (edge of the hovered row). */
1348
- this.dropPosition = signal(null, /* @ts-ignore */
1349
- ...(ngDevMode ? [{ debugName: "dropPosition" }] : /* istanbul ignore next */ []));
1350
- }
1351
- /** @ignore */
1352
- onDragStart(event) {
1353
- this.table.draggedRowIndex = this.index();
1354
- // Firefox requires data for the drag to start.
1355
- event.dataTransfer?.setData('text/plain', String(this.index()));
1356
- if (event.dataTransfer)
1357
- event.dataTransfer.effectAllowed = 'move';
1358
- }
1359
- /** @ignore */
1360
- onDragOver(event) {
1361
- if (this.table.draggedRowIndex == null)
1362
- return;
1363
- event.preventDefault();
1364
- const rect = this.el.nativeElement.getBoundingClientRect();
1365
- this.dropPosition.set(event.clientY < rect.top + rect.height / 2 ? 'above' : 'below');
1366
- }
1367
- /** @ignore */
1368
- onDragLeave() {
1369
- this.dropPosition.set(null);
1370
- }
1371
- /** @ignore */
1372
- onDrop(event) {
1373
- event.preventDefault();
1374
- const position = this.dropPosition();
1375
- this.dropPosition.set(null);
1376
- if (position == null)
1377
- return;
1378
- const drag = this.table.draggedRowIndex;
1379
- let drop = position === 'above' ? this.index() : this.index() + 1;
1380
- if (drag != null && drag < drop)
1381
- drop--;
1382
- this.table.dropRow(drop);
1383
- }
1384
- /** @ignore */
1385
- onDragEnd() {
1386
- this.dropPosition.set(null);
1387
- this.table.draggedRowIndex = null;
1388
- }
1389
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableReorderableRow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1390
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiTableReorderableRow, isStandalone: true, selector: "[uiReorderableRow]", inputs: { index: { classPropertyName: "index", publicName: "uiReorderableRow", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "dragstart": "onDragStart($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave()", "drop": "onDrop($event)", "dragend": "onDragEnd()" }, properties: { "attr.draggable": "true", "class._drop-above": "dropPosition() === \"above\"", "class._drop-below": "dropPosition() === \"below\"" }, classAttribute: "ui-table-reorderable-row" }, ngImport: i0 }); }
1391
- }
1392
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiTableReorderableRow, decorators: [{
1393
- type: Directive,
1394
- args: [{
1395
- selector: '[uiReorderableRow]',
1396
- host: {
1397
- class: 'ui-table-reorderable-row',
1398
- '[attr.draggable]': 'true',
1399
- '[class._drop-above]': 'dropPosition() === "above"',
1400
- '[class._drop-below]': 'dropPosition() === "below"',
1401
- '(dragstart)': 'onDragStart($event)',
1402
- '(dragover)': 'onDragOver($event)',
1403
- '(dragleave)': 'onDragLeave()',
1404
- '(drop)': 'onDrop($event)',
1405
- '(dragend)': 'onDragEnd()',
1406
- },
1407
- }]
1408
- }], propDecorators: { index: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiReorderableRow", required: true }] }] } });
1409
-
1410
- /*
1411
- * Public API Surface of ui-kit/ui-table
1412
- */
1413
-
1414
- /**
1415
- * Generated bundle index. Do not edit.
1416
- */
1417
-
2242
+ `
2243
+ }]
2244
+ }],
2245
+ propDecorators: {
2246
+ value: [{
2247
+ type: i0.Input,
2248
+ args: [{
2249
+ isSignal: true,
2250
+ alias: "value",
2251
+ required: true
2252
+ }]
2253
+ }],
2254
+ index: [{
2255
+ type: i0.Input,
2256
+ args: [{
2257
+ isSignal: true,
2258
+ alias: "index",
2259
+ required: false
2260
+ }]
2261
+ }],
2262
+ name: [{
2263
+ type: i0.Input,
2264
+ args: [{
2265
+ isSignal: true,
2266
+ alias: "name",
2267
+ required: false
2268
+ }]
2269
+ }],
2270
+ disabled: [{
2271
+ type: i0.Input,
2272
+ args: [{
2273
+ isSignal: true,
2274
+ alias: "disabled",
2275
+ required: false
2276
+ }]
2277
+ }],
2278
+ ariaLabel: [{
2279
+ type: i0.Input,
2280
+ args: [{
2281
+ isSignal: true,
2282
+ alias: "ariaLabel",
2283
+ required: false
2284
+ }]
2285
+ }]
2286
+ }
2287
+ });
2288
+ var UiTableRowToggler = class UiTableRowToggler {
2289
+ constructor() {
2290
+ this.table = inject(UiTable);
2291
+ this.data = input.required({
2292
+ ...ngDevMode ? { debugName: "data" } : /* istanbul ignore next */ {},
2293
+ alias: "uiRowToggler"
2294
+ });
2295
+ this.expanded = computed(() => this.table.isRowExpanded(this.data()), ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
2296
+ }
2297
+ onToggle(event) {
2298
+ this.table.toggleRow(this.data(), event);
2299
+ event.stopPropagation();
2300
+ }
2301
+ static {
2302
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2303
+ minVersion: "12.0.0",
2304
+ version: "22.3.0",
2305
+ ngImport: i0,
2306
+ type: UiTableRowToggler,
2307
+ deps: [],
2308
+ target: i0.ɵɵFactoryTarget.Directive
2309
+ });
2310
+ }
2311
+ static {
2312
+ this.ɵdir = i0.ɵɵngDeclareDirective({
2313
+ minVersion: "17.1.0",
2314
+ version: "22.3.0",
2315
+ type: UiTableRowToggler,
2316
+ isStandalone: true,
2317
+ selector: "[uiRowToggler]",
2318
+ inputs: { data: {
2319
+ classPropertyName: "data",
2320
+ publicName: "uiRowToggler",
2321
+ isSignal: true,
2322
+ isRequired: true,
2323
+ transformFunction: null
2324
+ } },
2325
+ host: {
2326
+ listeners: { "click": "onToggle($event)" },
2327
+ properties: { "attr.aria-expanded": "expanded()" }
2328
+ },
2329
+ ngImport: i0
2330
+ });
2331
+ }
2332
+ };
2333
+ i0.ɵɵngDeclareClassMetadata({
2334
+ minVersion: "12.0.0",
2335
+ version: "22.3.0",
2336
+ ngImport: i0,
2337
+ type: UiTableRowToggler,
2338
+ decorators: [{
2339
+ type: Directive,
2340
+ args: [{
2341
+ selector: "[uiRowToggler]",
2342
+ host: {
2343
+ "[attr.aria-expanded]": "expanded()",
2344
+ "(click)": "onToggle($event)"
2345
+ }
2346
+ }]
2347
+ }],
2348
+ propDecorators: { data: [{
2349
+ type: i0.Input,
2350
+ args: [{
2351
+ isSignal: true,
2352
+ alias: "uiRowToggler",
2353
+ required: true
2354
+ }]
2355
+ }] }
2356
+ });
2357
+ var UiTableFrozenColumn = class UiTableFrozenColumn {
2358
+ constructor() {
2359
+ this.el = inject(ElementRef);
2360
+ this.injector = inject(Injector);
2361
+ this.frozen = input(true, {
2362
+ ...ngDevMode ? { debugName: "frozen" } : /* istanbul ignore next */ {},
2363
+ alias: "uiFrozenColumn",
2364
+ transform: (value) => value === "" || value == null || booleanAttribute(value)
2365
+ });
2366
+ this.alignFrozen = input("left", ...ngDevMode ? [{ debugName: "alignFrozen" }] : /* istanbul ignore next */ []);
2367
+ this.isFrozen = computed(() => this.frozen(), ...ngDevMode ? [{ debugName: "isFrozen" }] : /* istanbul ignore next */ []);
2368
+ afterNextRender(() => {
2369
+ this.updatePosition();
2370
+ const row = this.el.nativeElement.parentElement;
2371
+ if (row && typeof ResizeObserver !== "undefined") {
2372
+ const observer = new ResizeObserver(() => this.updatePosition());
2373
+ observer.observe(row);
2374
+ this.injector.get(DestroyRef).onDestroy(() => observer.disconnect());
2375
+ }
2376
+ });
2377
+ effect(() => {
2378
+ this.frozen();
2379
+ this.alignFrozen();
2380
+ this.updatePosition();
2381
+ });
2382
+ }
2383
+ updatePosition() {
2384
+ const cell = this.el.nativeElement;
2385
+ if (!this.frozen()) {
2386
+ cell.style.left = "";
2387
+ cell.style.right = "";
2388
+ return;
2389
+ }
2390
+ if (this.alignFrozen() === "left") {
2391
+ let offset = 0;
2392
+ let sibling = cell.previousElementSibling;
2393
+ while (sibling) {
2394
+ if (sibling.classList.contains("_frozen-left")) offset += sibling.getBoundingClientRect().width;
2395
+ sibling = sibling.previousElementSibling;
2396
+ }
2397
+ cell.style.left = `${offset}px`;
2398
+ cell.style.right = "";
2399
+ } else {
2400
+ let offset = 0;
2401
+ let sibling = cell.nextElementSibling;
2402
+ while (sibling) {
2403
+ if (sibling.classList.contains("_frozen-right")) offset += sibling.getBoundingClientRect().width;
2404
+ sibling = sibling.nextElementSibling;
2405
+ }
2406
+ cell.style.right = `${offset}px`;
2407
+ cell.style.left = "";
2408
+ }
2409
+ }
2410
+ static {
2411
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2412
+ minVersion: "12.0.0",
2413
+ version: "22.3.0",
2414
+ ngImport: i0,
2415
+ type: UiTableFrozenColumn,
2416
+ deps: [],
2417
+ target: i0.ɵɵFactoryTarget.Directive
2418
+ });
2419
+ }
2420
+ static {
2421
+ this.ɵdir = i0.ɵɵngDeclareDirective({
2422
+ minVersion: "17.1.0",
2423
+ version: "22.3.0",
2424
+ type: UiTableFrozenColumn,
2425
+ isStandalone: true,
2426
+ selector: "[uiFrozenColumn]",
2427
+ inputs: {
2428
+ frozen: {
2429
+ classPropertyName: "frozen",
2430
+ publicName: "uiFrozenColumn",
2431
+ isSignal: true,
2432
+ isRequired: false,
2433
+ transformFunction: null
2434
+ },
2435
+ alignFrozen: {
2436
+ classPropertyName: "alignFrozen",
2437
+ publicName: "alignFrozen",
2438
+ isSignal: true,
2439
+ isRequired: false,
2440
+ transformFunction: null
2441
+ }
2442
+ },
2443
+ host: { properties: {
2444
+ "class._frozen-left": "isFrozen() && alignFrozen() === \"left\"",
2445
+ "class._frozen-right": "isFrozen() && alignFrozen() === \"right\""
2446
+ } },
2447
+ ngImport: i0
2448
+ });
2449
+ }
2450
+ };
2451
+ i0.ɵɵngDeclareClassMetadata({
2452
+ minVersion: "12.0.0",
2453
+ version: "22.3.0",
2454
+ ngImport: i0,
2455
+ type: UiTableFrozenColumn,
2456
+ decorators: [{
2457
+ type: Directive,
2458
+ args: [{
2459
+ selector: "[uiFrozenColumn]",
2460
+ host: {
2461
+ "[class._frozen-left]": "isFrozen() && alignFrozen() === \"left\"",
2462
+ "[class._frozen-right]": "isFrozen() && alignFrozen() === \"right\""
2463
+ }
2464
+ }]
2465
+ }],
2466
+ ctorParameters: () => [],
2467
+ propDecorators: {
2468
+ frozen: [{
2469
+ type: i0.Input,
2470
+ args: [{
2471
+ isSignal: true,
2472
+ alias: "uiFrozenColumn",
2473
+ required: false
2474
+ }]
2475
+ }],
2476
+ alignFrozen: [{
2477
+ type: i0.Input,
2478
+ args: [{
2479
+ isSignal: true,
2480
+ alias: "alignFrozen",
2481
+ required: false
2482
+ }]
2483
+ }]
2484
+ }
2485
+ });
2486
+ var UiTableResizableColumn = class UiTableResizableColumn {
2487
+ constructor() {
2488
+ this.table = inject(UiTable);
2489
+ this.el = inject(ElementRef);
2490
+ this.destroyRef = inject(DestroyRef);
2491
+ this.startX = 0;
2492
+ this.startWidth = 0;
2493
+ this.nextStartWidth = 0;
2494
+ this.appliedDelta = 0;
2495
+ this.cleanupDrag = null;
2496
+ this.onPointerDown = (event) => {
2497
+ const cell = this.el.nativeElement;
2498
+ const next = cell.nextElementSibling;
2499
+ if (!next) return;
2500
+ event.preventDefault();
2501
+ this.table.lockColumnWidths();
2502
+ this.startX = event.clientX;
2503
+ this.startWidth = cell.getBoundingClientRect().width;
2504
+ this.nextStartWidth = next.getBoundingClientRect().width;
2505
+ this.appliedDelta = 0;
2506
+ const onMove = (moveEvent) => {
2507
+ const delta = moveEvent.clientX - this.startX;
2508
+ if (this.table.resizeColumnFit(cell, this.startWidth, this.nextStartWidth, delta)) this.appliedDelta = delta;
2509
+ };
2510
+ const onUp = () => {
2511
+ this.cleanupDrag?.();
2512
+ if (this.appliedDelta !== 0) this.table.notifyColResize(cell, this.appliedDelta);
2513
+ };
2514
+ document.addEventListener("pointermove", onMove);
2515
+ document.addEventListener("pointerup", onUp);
2516
+ this.cleanupDrag = () => {
2517
+ document.removeEventListener("pointermove", onMove);
2518
+ document.removeEventListener("pointerup", onUp);
2519
+ this.cleanupDrag = null;
2520
+ };
2521
+ };
2522
+ afterNextRender(() => {
2523
+ const handle = document.createElement("span");
2524
+ handle.className = "ui-table-column-resizer";
2525
+ handle.setAttribute("aria-hidden", "true");
2526
+ handle.addEventListener("pointerdown", this.onPointerDown);
2527
+ this.el.nativeElement.appendChild(handle);
2528
+ });
2529
+ this.destroyRef.onDestroy(() => this.cleanupDrag?.());
2530
+ }
2531
+ static {
2532
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2533
+ minVersion: "12.0.0",
2534
+ version: "22.3.0",
2535
+ ngImport: i0,
2536
+ type: UiTableResizableColumn,
2537
+ deps: [],
2538
+ target: i0.ɵɵFactoryTarget.Directive
2539
+ });
2540
+ }
2541
+ static {
2542
+ this.ɵdir = i0.ɵɵngDeclareDirective({
2543
+ minVersion: "14.0.0",
2544
+ version: "22.3.0",
2545
+ type: UiTableResizableColumn,
2546
+ isStandalone: true,
2547
+ selector: "[uiResizableColumn]",
2548
+ host: { classAttribute: "ui-table-resizable-column" },
2549
+ ngImport: i0
2550
+ });
2551
+ }
2552
+ };
2553
+ i0.ɵɵngDeclareClassMetadata({
2554
+ minVersion: "12.0.0",
2555
+ version: "22.3.0",
2556
+ ngImport: i0,
2557
+ type: UiTableResizableColumn,
2558
+ decorators: [{
2559
+ type: Directive,
2560
+ args: [{
2561
+ selector: "[uiResizableColumn]",
2562
+ host: { class: "ui-table-resizable-column" }
2563
+ }]
2564
+ }],
2565
+ ctorParameters: () => []
2566
+ });
2567
+ var UiTableReorderableRow = class UiTableReorderableRow {
2568
+ constructor() {
2569
+ this.table = inject(UiTable);
2570
+ this.el = inject(ElementRef);
2571
+ this.index = input.required({
2572
+ ...ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {},
2573
+ alias: "uiReorderableRow",
2574
+ transform: numberAttribute
2575
+ });
2576
+ this.dropPosition = signal(null, ...ngDevMode ? [{ debugName: "dropPosition" }] : /* istanbul ignore next */ []);
2577
+ }
2578
+ onDragStart(event) {
2579
+ this.table.draggedRowIndex = this.index();
2580
+ event.dataTransfer?.setData("text/plain", String(this.index()));
2581
+ if (event.dataTransfer) event.dataTransfer.effectAllowed = "move";
2582
+ }
2583
+ onDragOver(event) {
2584
+ if (this.table.draggedRowIndex == null) return;
2585
+ event.preventDefault();
2586
+ const rect = this.el.nativeElement.getBoundingClientRect();
2587
+ this.dropPosition.set(event.clientY < rect.top + rect.height / 2 ? "above" : "below");
2588
+ }
2589
+ onDragLeave() {
2590
+ this.dropPosition.set(null);
2591
+ }
2592
+ onDrop(event) {
2593
+ event.preventDefault();
2594
+ const position = this.dropPosition();
2595
+ this.dropPosition.set(null);
2596
+ if (position == null) return;
2597
+ const drag = this.table.draggedRowIndex;
2598
+ let drop = position === "above" ? this.index() : this.index() + 1;
2599
+ if (drag != null && drag < drop) drop--;
2600
+ this.table.dropRow(drop);
2601
+ }
2602
+ onDragEnd() {
2603
+ this.dropPosition.set(null);
2604
+ this.table.draggedRowIndex = null;
2605
+ }
2606
+ static {
2607
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2608
+ minVersion: "12.0.0",
2609
+ version: "22.3.0",
2610
+ ngImport: i0,
2611
+ type: UiTableReorderableRow,
2612
+ deps: [],
2613
+ target: i0.ɵɵFactoryTarget.Directive
2614
+ });
2615
+ }
2616
+ static {
2617
+ this.ɵdir = i0.ɵɵngDeclareDirective({
2618
+ minVersion: "17.1.0",
2619
+ version: "22.3.0",
2620
+ type: UiTableReorderableRow,
2621
+ isStandalone: true,
2622
+ selector: "[uiReorderableRow]",
2623
+ inputs: { index: {
2624
+ classPropertyName: "index",
2625
+ publicName: "uiReorderableRow",
2626
+ isSignal: true,
2627
+ isRequired: true,
2628
+ transformFunction: null
2629
+ } },
2630
+ host: {
2631
+ listeners: {
2632
+ "dragstart": "onDragStart($event)",
2633
+ "dragover": "onDragOver($event)",
2634
+ "dragleave": "onDragLeave()",
2635
+ "drop": "onDrop($event)",
2636
+ "dragend": "onDragEnd()"
2637
+ },
2638
+ properties: {
2639
+ "attr.draggable": "true",
2640
+ "class._drop-above": "dropPosition() === \"above\"",
2641
+ "class._drop-below": "dropPosition() === \"below\""
2642
+ },
2643
+ classAttribute: "ui-table-reorderable-row"
2644
+ },
2645
+ ngImport: i0
2646
+ });
2647
+ }
2648
+ };
2649
+ i0.ɵɵngDeclareClassMetadata({
2650
+ minVersion: "12.0.0",
2651
+ version: "22.3.0",
2652
+ ngImport: i0,
2653
+ type: UiTableReorderableRow,
2654
+ decorators: [{
2655
+ type: Directive,
2656
+ args: [{
2657
+ selector: "[uiReorderableRow]",
2658
+ host: {
2659
+ class: "ui-table-reorderable-row",
2660
+ "[attr.draggable]": "true",
2661
+ "[class._drop-above]": "dropPosition() === \"above\"",
2662
+ "[class._drop-below]": "dropPosition() === \"below\"",
2663
+ "(dragstart)": "onDragStart($event)",
2664
+ "(dragover)": "onDragOver($event)",
2665
+ "(dragleave)": "onDragLeave()",
2666
+ "(drop)": "onDrop($event)",
2667
+ "(dragend)": "onDragEnd()"
2668
+ }
2669
+ }]
2670
+ }],
2671
+ propDecorators: { index: [{
2672
+ type: i0.Input,
2673
+ args: [{
2674
+ isSignal: true,
2675
+ alias: "uiReorderableRow",
2676
+ required: true
2677
+ }]
2678
+ }] }
2679
+ });
1418
2680
  export { UiTable, UiTableCheckbox, UiTableFrozenColumn, UiTableHeaderCheckbox, UiTableRadio, UiTableReorderableRow, UiTableResizableColumn, UiTableRowToggler, UiTableSelectableRow, UiTableSortIcon, UiTableSortableColumn };
1419
- //# sourceMappingURL=4sh-ui-kit-table-ui-table.mjs.map
2681
+
2682
+ //# sourceMappingURL=4sh-ui-kit-table-ui-table.mjs.map