@tailng-ui/primitives 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/package.json +3 -2
  2. package/src/index.d.ts +1 -0
  3. package/src/index.d.ts.map +1 -1
  4. package/src/index.js +1 -0
  5. package/src/index.js.map +1 -1
  6. package/src/lib/feedback/empty/tng-empty.d.ts.map +1 -1
  7. package/src/lib/feedback/empty/tng-empty.js +0 -5
  8. package/src/lib/feedback/empty/tng-empty.js.map +1 -1
  9. package/src/lib/feedback/progress-bar/tng-progress-bar.d.ts.map +1 -1
  10. package/src/lib/feedback/progress-bar/tng-progress-bar.js +0 -2
  11. package/src/lib/feedback/progress-bar/tng-progress-bar.js.map +1 -1
  12. package/src/lib/feedback/progress-spinner/tng-progress-spinner.d.ts.map +1 -1
  13. package/src/lib/feedback/progress-spinner/tng-progress-spinner.js +0 -1
  14. package/src/lib/feedback/progress-spinner/tng-progress-spinner.js.map +1 -1
  15. package/src/lib/feedback/skeleton/tng-skeleton.d.ts.map +1 -1
  16. package/src/lib/feedback/skeleton/tng-skeleton.js +0 -1
  17. package/src/lib/feedback/skeleton/tng-skeleton.js.map +1 -1
  18. package/src/lib/feedback/toast/tng-toast.d.ts.map +1 -1
  19. package/src/lib/feedback/toast/tng-toast.js +0 -2
  20. package/src/lib/feedback/toast/tng-toast.js.map +1 -1
  21. package/src/lib/form/_shared/select/tng-select.overlay.shared.d.ts.map +1 -1
  22. package/src/lib/form/_shared/select/tng-select.overlay.shared.js +0 -1
  23. package/src/lib/form/_shared/select/tng-select.overlay.shared.js.map +1 -1
  24. package/src/lib/form/_shared/select/tng-select.parts.shared.d.ts.map +1 -1
  25. package/src/lib/form/_shared/select/tng-select.parts.shared.js +0 -4
  26. package/src/lib/form/_shared/select/tng-select.parts.shared.js.map +1 -1
  27. package/src/lib/form/autocomplete/tng-autocomplete.d.ts.map +1 -1
  28. package/src/lib/form/autocomplete/tng-autocomplete.js +0 -1
  29. package/src/lib/form/autocomplete/tng-autocomplete.js.map +1 -1
  30. package/src/lib/form/autocomplete/tng-autocomplete.listbox.d.ts.map +1 -1
  31. package/src/lib/form/autocomplete/tng-autocomplete.listbox.js +0 -2
  32. package/src/lib/form/autocomplete/tng-autocomplete.listbox.js.map +1 -1
  33. package/src/lib/form/autocomplete/tng-autocomplete.overlay.d.ts.map +1 -1
  34. package/src/lib/form/autocomplete/tng-autocomplete.overlay.js +0 -1
  35. package/src/lib/form/autocomplete/tng-autocomplete.overlay.js.map +1 -1
  36. package/src/lib/form/autocomplete/tng-autocomplete.parts.d.ts.map +1 -1
  37. package/src/lib/form/autocomplete/tng-autocomplete.parts.js +0 -4
  38. package/src/lib/form/autocomplete/tng-autocomplete.parts.js.map +1 -1
  39. package/src/lib/form/button-toggle/tng-button-toggle.d.ts.map +1 -1
  40. package/src/lib/form/button-toggle/tng-button-toggle.js +0 -2
  41. package/src/lib/form/button-toggle/tng-button-toggle.js.map +1 -1
  42. package/src/lib/form/checkbox/tng-checkbox.d.ts.map +1 -1
  43. package/src/lib/form/checkbox/tng-checkbox.js +0 -1
  44. package/src/lib/form/checkbox/tng-checkbox.js.map +1 -1
  45. package/src/lib/form/chips/tng-chips.d.ts.map +1 -1
  46. package/src/lib/form/chips/tng-chips.js +0 -3
  47. package/src/lib/form/chips/tng-chips.js.map +1 -1
  48. package/src/lib/form/combobox/tng-combobox.d.ts.map +1 -1
  49. package/src/lib/form/combobox/tng-combobox.js +0 -1
  50. package/src/lib/form/combobox/tng-combobox.js.map +1 -1
  51. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.d.ts +25 -0
  52. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.d.ts.map +1 -0
  53. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.js +105 -0
  54. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.js.map +1 -0
  55. package/src/lib/form/datepicker/datepicker.adapters.d.ts +5 -0
  56. package/src/lib/form/datepicker/datepicker.adapters.d.ts.map +1 -0
  57. package/src/lib/form/datepicker/datepicker.adapters.js +194 -0
  58. package/src/lib/form/datepicker/datepicker.adapters.js.map +1 -0
  59. package/src/lib/form/datepicker/datepicker.state.d.ts +10 -0
  60. package/src/lib/form/datepicker/datepicker.state.d.ts.map +1 -0
  61. package/src/lib/form/datepicker/datepicker.state.js +97 -0
  62. package/src/lib/form/datepicker/datepicker.state.js.map +1 -0
  63. package/src/lib/form/datepicker/datepicker.types.d.ts +269 -0
  64. package/src/lib/form/datepicker/datepicker.types.d.ts.map +1 -0
  65. package/src/lib/form/datepicker/datepicker.types.js +1 -0
  66. package/src/lib/form/datepicker/datepicker.types.js.map +1 -0
  67. package/src/lib/form/datepicker/datepicker.utils.d.ts +75 -0
  68. package/src/lib/form/datepicker/datepicker.utils.d.ts.map +1 -0
  69. package/src/lib/form/datepicker/datepicker.utils.js +238 -0
  70. package/src/lib/form/datepicker/datepicker.utils.js.map +1 -0
  71. package/src/lib/form/datepicker/index.d.ts +3 -0
  72. package/src/lib/form/datepicker/index.d.ts.map +1 -0
  73. package/src/lib/form/datepicker/index.js +3 -0
  74. package/src/lib/form/datepicker/index.js.map +1 -0
  75. package/src/lib/form/datepicker/tng-datepicker.d.ts +5 -0
  76. package/src/lib/form/datepicker/tng-datepicker.d.ts.map +1 -0
  77. package/src/lib/form/datepicker/tng-datepicker.js +1948 -0
  78. package/src/lib/form/datepicker/tng-datepicker.js.map +1 -0
  79. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts +60 -0
  80. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts.map +1 -0
  81. package/src/lib/form/datepicker/tng-datepicker.overlay.js +275 -0
  82. package/src/lib/form/datepicker/tng-datepicker.overlay.js.map +1 -0
  83. package/src/lib/form/input/tng-input.d.ts.map +1 -1
  84. package/src/lib/form/input/tng-input.js +0 -4
  85. package/src/lib/form/input/tng-input.js.map +1 -1
  86. package/src/lib/form/input-otp/tng-input-otp.d.ts.map +1 -1
  87. package/src/lib/form/input-otp/tng-input-otp.js +0 -1
  88. package/src/lib/form/input-otp/tng-input-otp.js.map +1 -1
  89. package/src/lib/form/label/tng-label.d.ts.map +1 -1
  90. package/src/lib/form/label/tng-label.js +0 -1
  91. package/src/lib/form/label/tng-label.js.map +1 -1
  92. package/src/lib/form/listbox/listbox.directive.d.ts.map +1 -1
  93. package/src/lib/form/listbox/listbox.directive.js +0 -1
  94. package/src/lib/form/listbox/listbox.directive.js.map +1 -1
  95. package/src/lib/form/listbox/option.directive.d.ts.map +1 -1
  96. package/src/lib/form/listbox/option.directive.js +0 -1
  97. package/src/lib/form/listbox/option.directive.js.map +1 -1
  98. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.chip.d.ts.map +1 -1
  99. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.chip.js +0 -1
  100. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.chip.js.map +1 -1
  101. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.content.d.ts.map +1 -1
  102. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.content.js +0 -1
  103. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.content.js.map +1 -1
  104. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.d.ts.map +1 -1
  105. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.js +0 -1
  106. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.js.map +1 -1
  107. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.d.ts.map +1 -1
  108. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.js +0 -2
  109. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.js.map +1 -1
  110. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.d.ts.map +1 -1
  111. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.js +0 -1
  112. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.js.map +1 -1
  113. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.trigger.d.ts.map +1 -1
  114. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.trigger.js +0 -1
  115. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.trigger.js.map +1 -1
  116. package/src/lib/form/multi-select/tng-multi-select.d.ts.map +1 -1
  117. package/src/lib/form/multi-select/tng-multi-select.js +0 -1
  118. package/src/lib/form/multi-select/tng-multi-select.js.map +1 -1
  119. package/src/lib/form/multi-select/tng-multi-select.listbox.d.ts.map +1 -1
  120. package/src/lib/form/multi-select/tng-multi-select.listbox.js +0 -2
  121. package/src/lib/form/multi-select/tng-multi-select.listbox.js.map +1 -1
  122. package/src/lib/form/multiselect/tng-multiselect.d.ts.map +1 -1
  123. package/src/lib/form/multiselect/tng-multiselect.js +0 -1
  124. package/src/lib/form/multiselect/tng-multiselect.js.map +1 -1
  125. package/src/lib/form/radio/tng-radio.d.ts.map +1 -1
  126. package/src/lib/form/radio/tng-radio.js +0 -1
  127. package/src/lib/form/radio/tng-radio.js.map +1 -1
  128. package/src/lib/form/select/tng-select.d.ts.map +1 -1
  129. package/src/lib/form/select/tng-select.js +0 -1
  130. package/src/lib/form/select/tng-select.js.map +1 -1
  131. package/src/lib/form/select/tng-select.listbox.d.ts.map +1 -1
  132. package/src/lib/form/select/tng-select.listbox.js +0 -2
  133. package/src/lib/form/select/tng-select.listbox.js.map +1 -1
  134. package/src/lib/form/slider/tng-slider.d.ts.map +1 -1
  135. package/src/lib/form/slider/tng-slider.js +0 -1
  136. package/src/lib/form/slider/tng-slider.js.map +1 -1
  137. package/src/lib/form/switch/tng-switch.d.ts.map +1 -1
  138. package/src/lib/form/switch/tng-switch.js +0 -1
  139. package/src/lib/form/switch/tng-switch.js.map +1 -1
  140. package/src/lib/form/textarea/tng-textarea.d.ts.map +1 -1
  141. package/src/lib/form/textarea/tng-textarea.js +0 -1
  142. package/src/lib/form/textarea/tng-textarea.js.map +1 -1
  143. package/src/lib/form/toggle/tng-toggle.d.ts.map +1 -1
  144. package/src/lib/form/toggle/tng-toggle.js +0 -1
  145. package/src/lib/form/toggle/tng-toggle.js.map +1 -1
  146. package/src/lib/form/toggle-group/tng-toggle-group.d.ts.map +1 -1
  147. package/src/lib/form/toggle-group/tng-toggle-group.js +0 -1
  148. package/src/lib/form/toggle-group/tng-toggle-group.js.map +1 -1
  149. package/src/lib/layout/accordion/tng-accordion.d.ts.map +1 -1
  150. package/src/lib/layout/accordion/tng-accordion.js +0 -4
  151. package/src/lib/layout/accordion/tng-accordion.js.map +1 -1
  152. package/src/lib/layout/bottom-sheet/tng-bottom-sheet.d.ts.map +1 -1
  153. package/src/lib/layout/bottom-sheet/tng-bottom-sheet.js +0 -1
  154. package/src/lib/layout/bottom-sheet/tng-bottom-sheet.js.map +1 -1
  155. package/src/lib/layout/card/tng-card.d.ts.map +1 -1
  156. package/src/lib/layout/card/tng-card.js +0 -10
  157. package/src/lib/layout/card/tng-card.js.map +1 -1
  158. package/src/lib/layout/collapsible/tng-collapsible.d.ts.map +1 -1
  159. package/src/lib/layout/collapsible/tng-collapsible.js +0 -3
  160. package/src/lib/layout/collapsible/tng-collapsible.js.map +1 -1
  161. package/src/lib/layout/drawer/tng-drawer.d.ts.map +1 -1
  162. package/src/lib/layout/drawer/tng-drawer.js +0 -6
  163. package/src/lib/layout/drawer/tng-drawer.js.map +1 -1
  164. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.d.ts +32 -0
  165. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.d.ts.map +1 -0
  166. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.js +312 -0
  167. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.js.map +1 -0
  168. package/src/lib/layout/grid/tng-grid.d.ts +144 -2
  169. package/src/lib/layout/grid/tng-grid.d.ts.map +1 -1
  170. package/src/lib/layout/grid/tng-grid.js +669 -3
  171. package/src/lib/layout/grid/tng-grid.js.map +1 -1
  172. package/src/lib/layout/separator/tng-separator.d.ts.map +1 -1
  173. package/src/lib/layout/separator/tng-separator.js +0 -1
  174. package/src/lib/layout/separator/tng-separator.js.map +1 -1
  175. package/src/lib/layout/stepper/tng-stepper.d.ts.map +1 -1
  176. package/src/lib/layout/stepper/tng-stepper.js +0 -1
  177. package/src/lib/layout/stepper/tng-stepper.js.map +1 -1
  178. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.d.ts.map +1 -1
  179. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.js +0 -1
  180. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.js.map +1 -1
  181. package/src/lib/layout/tree/tng-tree-group.d.ts.map +1 -1
  182. package/src/lib/layout/tree/tng-tree-group.js +0 -1
  183. package/src/lib/layout/tree/tng-tree-group.js.map +1 -1
  184. package/src/lib/layout/tree/tng-tree-indicator.d.ts.map +1 -1
  185. package/src/lib/layout/tree/tng-tree-indicator.js +0 -1
  186. package/src/lib/layout/tree/tng-tree-indicator.js.map +1 -1
  187. package/src/lib/layout/tree/tng-tree-item.d.ts.map +1 -1
  188. package/src/lib/layout/tree/tng-tree-item.js +0 -1
  189. package/src/lib/layout/tree/tng-tree-item.js.map +1 -1
  190. package/src/lib/layout/tree/tng-tree.d.ts.map +1 -1
  191. package/src/lib/layout/tree/tng-tree.js +0 -1
  192. package/src/lib/layout/tree/tng-tree.js.map +1 -1
  193. package/src/lib/navigation/breadcrumb/tng-breadcrumb.d.ts.map +1 -1
  194. package/src/lib/navigation/breadcrumb/tng-breadcrumb.js +0 -5
  195. package/src/lib/navigation/breadcrumb/tng-breadcrumb.js.map +1 -1
  196. package/src/lib/navigation/context-menu/tng-context-menu.d.ts.map +1 -1
  197. package/src/lib/navigation/context-menu/tng-context-menu.js +0 -2
  198. package/src/lib/navigation/context-menu/tng-context-menu.js.map +1 -1
  199. package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.d.ts.map +1 -1
  200. package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.js +0 -1
  201. package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.js.map +1 -1
  202. package/src/lib/navigation/menu/tng-menu.d.ts.map +1 -1
  203. package/src/lib/navigation/menu/tng-menu.js +0 -6
  204. package/src/lib/navigation/menu/tng-menu.js.map +1 -1
  205. package/src/lib/navigation/menubar/tng-menubar.d.ts.map +1 -1
  206. package/src/lib/navigation/menubar/tng-menubar.js +0 -2
  207. package/src/lib/navigation/menubar/tng-menubar.js.map +1 -1
  208. package/src/lib/navigation/navigation-menu/tng-navigation-menu.d.ts.map +1 -1
  209. package/src/lib/navigation/navigation-menu/tng-navigation-menu.js +0 -1
  210. package/src/lib/navigation/navigation-menu/tng-navigation-menu.js.map +1 -1
  211. package/src/lib/navigation/tabs/tng-tabs.d.ts +13 -6
  212. package/src/lib/navigation/tabs/tng-tabs.d.ts.map +1 -1
  213. package/src/lib/navigation/tabs/tng-tabs.js +77 -41
  214. package/src/lib/navigation/tabs/tng-tabs.js.map +1 -1
  215. package/src/lib/navigation/toolbar/tng-toolbar.d.ts.map +1 -1
  216. package/src/lib/navigation/toolbar/tng-toolbar.js +0 -1
  217. package/src/lib/navigation/toolbar/tng-toolbar.js.map +1 -1
  218. package/src/lib/overlay/dialog/tng-dialog.d.ts.map +1 -1
  219. package/src/lib/overlay/dialog/tng-dialog.js +0 -9
  220. package/src/lib/overlay/dialog/tng-dialog.js.map +1 -1
  221. package/src/lib/overlay/popover/tng-popover.d.ts.map +1 -1
  222. package/src/lib/overlay/popover/tng-popover.js +0 -4
  223. package/src/lib/overlay/popover/tng-popover.js.map +1 -1
  224. package/src/lib/overlay/tooltip/tng-tooltip.d.ts.map +1 -1
  225. package/src/lib/overlay/tooltip/tng-tooltip.js +0 -3
  226. package/src/lib/overlay/tooltip/tng-tooltip.js.map +1 -1
  227. package/src/lib/utility/avatar/tng-avatar.d.ts.map +1 -1
  228. package/src/lib/utility/avatar/tng-avatar.js +0 -3
  229. package/src/lib/utility/avatar/tng-avatar.js.map +1 -1
  230. package/src/lib/utility/badge/tng-badge.d.ts.map +1 -1
  231. package/src/lib/utility/badge/tng-badge.js +0 -1
  232. package/src/lib/utility/badge/tng-badge.js.map +1 -1
  233. package/src/lib/utility/code-block/tng-code-block.d.ts.map +1 -1
  234. package/src/lib/utility/code-block/tng-code-block.js +0 -5
  235. package/src/lib/utility/code-block/tng-code-block.js.map +1 -1
  236. package/src/lib/utility/copy/tng-copy.d.ts.map +1 -1
  237. package/src/lib/utility/copy/tng-copy.js +0 -1
  238. package/src/lib/utility/copy/tng-copy.js.map +1 -1
  239. package/src/lib/utility/press/tng-press.d.ts.map +1 -1
  240. package/src/lib/utility/press/tng-press.js +0 -1
  241. package/src/lib/utility/press/tng-press.js.map +1 -1
  242. package/src/lib/utility/tag/tng-tag.d.ts.map +1 -1
  243. package/src/lib/utility/tag/tng-tag.js +0 -3
  244. package/src/lib/utility/tag/tng-tag.js.map +1 -1
@@ -1,19 +1,685 @@
1
- import { Directive, HostBinding } from '@angular/core';
1
+ import { Directive, ElementRef, HostBinding, HostListener, Input, booleanAttribute, inject, input, output, } from '@angular/core';
2
+ import { resolveGridNavigationKeyAction, resolveNavigableGridCell, } from '@tailng-ui/cdk';
2
3
  import * as i0 from "@angular/core";
4
+ function coerceFiniteNumber(value) {
5
+ if (typeof value === 'number' && Number.isFinite(value)) {
6
+ return value;
7
+ }
8
+ if (typeof value === 'string' && value.trim().length > 0) {
9
+ const parsed = Number(value);
10
+ if (Number.isFinite(parsed)) {
11
+ return parsed;
12
+ }
13
+ }
14
+ return null;
15
+ }
16
+ function normalizeIndex(value) {
17
+ return Math.max(0, Math.trunc(coerceFiniteNumber(value) ?? 0));
18
+ }
19
+ function normalizeOptionalIndex(value) {
20
+ if (value === undefined) {
21
+ return undefined;
22
+ }
23
+ if (value === null || value === '') {
24
+ return null;
25
+ }
26
+ const numberValue = coerceFiniteNumber(value);
27
+ if (numberValue === null) {
28
+ return null;
29
+ }
30
+ return Math.max(0, Math.trunc(numberValue));
31
+ }
32
+ function normalizeCount(value) {
33
+ if (value === undefined || value === null || value === '') {
34
+ return null;
35
+ }
36
+ const numberValue = coerceFiniteNumber(value);
37
+ if (numberValue === null) {
38
+ return null;
39
+ }
40
+ return Math.max(1, Math.trunc(numberValue));
41
+ }
42
+ function normalizeSpan(value) {
43
+ return Math.max(1, Math.trunc(coerceFiniteNumber(value) ?? 1));
44
+ }
45
+ function normalizeDirection(value) {
46
+ return value === 'rtl' ? 'rtl' : 'ltr';
47
+ }
48
+ function normalizeSelectionMode(value) {
49
+ return value === 'single' ? 'single' : 'none';
50
+ }
51
+ function normalizeCellRole(value) {
52
+ if (value === 'rowheader' || value === 'columnheader') {
53
+ return value;
54
+ }
55
+ return 'gridcell';
56
+ }
57
+ function normalizeGridValueInput(value) {
58
+ if (value === undefined) {
59
+ return undefined;
60
+ }
61
+ if (value === null) {
62
+ return null;
63
+ }
64
+ if (typeof value === 'object' && value !== null && 'row' in value && 'col' in value) {
65
+ const row = normalizeOptionalIndex(value.row);
66
+ const col = normalizeOptionalIndex(value.col);
67
+ if (row === undefined || row === null || col === undefined || col === null) {
68
+ return null;
69
+ }
70
+ return Object.freeze({ col, row });
71
+ }
72
+ return null;
73
+ }
74
+ function createCellKey(value) {
75
+ return `${value.row}:${value.col}`;
76
+ }
77
+ function compareCellValues(a, b) {
78
+ if (a.row !== b.row) {
79
+ return a.row - b.row;
80
+ }
81
+ return a.col - b.col;
82
+ }
83
+ function positionsEqual(a, b) {
84
+ if (a === null || b === null) {
85
+ return a === b;
86
+ }
87
+ return a.row === b.row && a.col === b.col;
88
+ }
89
+ function focusChangeEvent(current, previous, trigger) {
90
+ return Object.freeze({
91
+ col: current.col,
92
+ previousCol: previous?.col ?? null,
93
+ previousRow: previous?.row ?? null,
94
+ row: current.row,
95
+ trigger,
96
+ });
97
+ }
3
98
  export class TngGrid {
99
+ hostRef = inject(ElementRef);
100
+ cells = new Set();
101
+ cellByKey = new Map();
102
+ uncontrolledFocus = null;
103
+ uncontrolledSelection = null;
104
+ selectionInitialized = false;
105
+ ariaLabelValue = null;
106
+ ariaColcountValue = null;
107
+ ariaRowcountValue = null;
108
+ domFocusedKey = null;
109
+ focusVisibleKey = null;
110
+ lastActivatedKey = null;
111
+ pendingFocusTrigger = null;
112
+ dir = input('ltr', { ...(ngDevMode ? { debugName: "dir" } : {}), transform: normalizeDirection });
113
+ focusCol = input(undefined, { ...(ngDevMode ? { debugName: "focusCol" } : {}), transform: normalizeOptionalIndex });
114
+ focusRow = input(undefined, { ...(ngDevMode ? { debugName: "focusRow" } : {}), transform: normalizeOptionalIndex });
115
+ selectionMode = input('none', { ...(ngDevMode ? { debugName: "selectionMode" } : {}), transform: normalizeSelectionMode });
116
+ value = input(undefined, { ...(ngDevMode ? { debugName: "value" } : {}), transform: normalizeGridValueInput });
117
+ defaultValue = input(undefined, { ...(ngDevMode ? { debugName: "defaultValue" } : {}), transform: normalizeGridValueInput });
118
+ wrap = input(false, { ...(ngDevMode ? { debugName: "wrap" } : {}), transform: booleanAttribute });
119
+ focusRowChange = output();
120
+ focusColChange = output();
121
+ focusChange = output();
122
+ valueChange = output();
123
+ cellActivate = output();
124
+ set ariaLabel(value) {
125
+ this.ariaLabelValue = value;
126
+ }
127
+ set ariaColcount(value) {
128
+ this.ariaColcountValue = normalizeCount(value);
129
+ }
130
+ set ariaRowcount(value) {
131
+ this.ariaRowcountValue = normalizeCount(value);
132
+ }
4
133
  dataSlot = 'grid';
134
+ role = 'grid';
135
+ get ariaLabelAttr() {
136
+ return this.ariaLabelValue;
137
+ }
138
+ get ariaColcountAttr() {
139
+ const explicitCount = this.ariaColcountValue;
140
+ if (explicitCount !== null) {
141
+ return String(explicitCount);
142
+ }
143
+ const computedCount = this.getComputedBounds().colCount;
144
+ return this.cells.size > 0 ? String(computedCount) : null;
145
+ }
146
+ get ariaRowcountAttr() {
147
+ const explicitCount = this.ariaRowcountValue;
148
+ if (explicitCount !== null) {
149
+ return String(explicitCount);
150
+ }
151
+ const computedCount = this.getComputedBounds().rowCount;
152
+ return this.cells.size > 0 ? String(computedCount) : null;
153
+ }
154
+ ngOnDestroy() {
155
+ this.cells.clear();
156
+ this.cellByKey.clear();
157
+ }
158
+ registerCell(cell) {
159
+ this.cells.add(cell);
160
+ this.cellByKey.set(cell.cellKey(), cell);
161
+ this.ensureUncontrolledSelectionInitialized();
162
+ this.ensureFallbackFocus();
163
+ }
164
+ unregisterCell(cell) {
165
+ this.cells.delete(cell);
166
+ this.cellByKey.delete(cell.cellKey());
167
+ if (this.lastActivatedKey === cell.cellKey()) {
168
+ this.lastActivatedKey = null;
169
+ }
170
+ if (this.focusVisibleKey === cell.cellKey()) {
171
+ this.focusVisibleKey = null;
172
+ }
173
+ if (this.domFocusedKey === cell.cellKey()) {
174
+ this.domFocusedKey = null;
175
+ }
176
+ if (!this.isFocusControlled()
177
+ && this.uncontrolledFocus !== null
178
+ && createCellKey(this.uncontrolledFocus) === cell.cellKey()) {
179
+ this.uncontrolledFocus = null;
180
+ }
181
+ if (!this.isSelectionControlled()
182
+ && this.uncontrolledSelection !== null
183
+ && createCellKey(this.uncontrolledSelection) === cell.cellKey()) {
184
+ this.uncontrolledSelection = null;
185
+ }
186
+ this.ensureFallbackFocus();
187
+ }
188
+ isCellActivated(cell) {
189
+ return this.lastActivatedKey === cell.cellKey();
190
+ }
191
+ isCellDisabled(cell) {
192
+ return cell.disabled();
193
+ }
194
+ isCellFocusVisible(cell) {
195
+ return this.focusVisibleKey === cell.cellKey();
196
+ }
197
+ isCellFocused(cell) {
198
+ return this.domFocusedKey === cell.cellKey();
199
+ }
200
+ isCellTabStop(cell) {
201
+ const active = this.getActiveCell();
202
+ return active !== null && active.cellKey() === cell.cellKey();
203
+ }
204
+ isCellSelected(cell) {
205
+ const explicitSelected = cell.selected();
206
+ if (explicitSelected !== null) {
207
+ return explicitSelected;
208
+ }
209
+ const selectedValue = this.getSelectedValue();
210
+ return selectedValue !== null && cell.matchesValue(selectedValue);
211
+ }
212
+ getCellTabIndex(cell) {
213
+ if (this.isCellDisabled(cell)) {
214
+ return '-1';
215
+ }
216
+ return this.isCellTabStop(cell) ? '0' : '-1';
217
+ }
218
+ onCellClicked(cell) {
219
+ if (this.isCellDisabled(cell)) {
220
+ return;
221
+ }
222
+ if (this.selectionMode() === 'single') {
223
+ this.requestSelection(cell.getValue());
224
+ }
225
+ }
226
+ onCellFocused(cell) {
227
+ if (this.isCellDisabled(cell)) {
228
+ return;
229
+ }
230
+ const trigger = this.pendingFocusTrigger ?? 'programmatic';
231
+ this.pendingFocusTrigger = null;
232
+ this.domFocusedKey = cell.cellKey();
233
+ this.requestFocus(cell.getValue(), trigger);
234
+ this.focusVisibleKey = trigger === 'keyboard' || cell.isFocusVisible()
235
+ ? cell.cellKey()
236
+ : null;
237
+ }
238
+ onCellPointerDown(cell) {
239
+ if (this.isCellDisabled(cell)) {
240
+ return;
241
+ }
242
+ this.pendingFocusTrigger = 'pointer';
243
+ this.focusVisibleKey = null;
244
+ }
245
+ onCellSelectionRequest(cell, trigger) {
246
+ if (this.isCellDisabled(cell)) {
247
+ return;
248
+ }
249
+ this.lastActivatedKey = cell.cellKey();
250
+ if (this.selectionMode() === 'single') {
251
+ this.requestSelection(cell.getValue());
252
+ }
253
+ this.cellActivate.emit(Object.freeze({
254
+ col: cell.colIndex(),
255
+ row: cell.rowIndex(),
256
+ trigger,
257
+ }));
258
+ }
259
+ onFocusOut(event) {
260
+ const nextTarget = event.relatedTarget;
261
+ if (nextTarget instanceof Node && this.hostRef.nativeElement.contains(nextTarget)) {
262
+ return;
263
+ }
264
+ this.domFocusedKey = null;
265
+ this.focusVisibleKey = null;
266
+ this.pendingFocusTrigger = null;
267
+ }
268
+ onKeyDown(event) {
269
+ const activeCell = this.getActiveCell();
270
+ if (activeCell === null || this.isCellDisabled(activeCell)) {
271
+ return;
272
+ }
273
+ const action = resolveGridNavigationKeyAction(event, {
274
+ direction: this.dir(),
275
+ });
276
+ if (action === null) {
277
+ return;
278
+ }
279
+ if (action.preventDefault) {
280
+ event.preventDefault();
281
+ }
282
+ if (action.type === 'exit') {
283
+ return;
284
+ }
285
+ if (action.type === 'activate') {
286
+ this.onCellSelectionRequest(activeCell, 'keyboard');
287
+ return;
288
+ }
289
+ this.moveFocus(activeCell, action.type);
290
+ }
291
+ ensureFallbackFocus() {
292
+ if (this.isFocusControlled()) {
293
+ return;
294
+ }
295
+ const currentFocus = this.uncontrolledFocus;
296
+ if (currentFocus !== null) {
297
+ const currentCell = this.cellByKey.get(createCellKey(currentFocus));
298
+ if (currentCell !== undefined && !this.isCellDisabled(currentCell)) {
299
+ return;
300
+ }
301
+ }
302
+ const fallback = this.getFirstEnabledCell();
303
+ this.uncontrolledFocus = fallback?.getValue() ?? null;
304
+ }
305
+ ensureUncontrolledSelectionInitialized() {
306
+ if (this.selectionInitialized || this.isSelectionControlled()) {
307
+ return;
308
+ }
309
+ this.selectionInitialized = true;
310
+ this.uncontrolledSelection = this.defaultValue() ?? null;
311
+ }
312
+ getActiveCell() {
313
+ const focusValue = this.getFocusValue();
314
+ if (focusValue === null) {
315
+ return this.getFirstEnabledCell();
316
+ }
317
+ return this.cellByKey.get(createCellKey(focusValue)) ?? this.getFirstEnabledCell();
318
+ }
319
+ getComputedBounds() {
320
+ const explicitColcount = this.ariaColcountValue;
321
+ const explicitRowcount = this.ariaRowcountValue;
322
+ if (explicitColcount !== null && explicitRowcount !== null) {
323
+ return Object.freeze({
324
+ colCount: explicitColcount,
325
+ rowCount: explicitRowcount,
326
+ });
327
+ }
328
+ let maxCol = 0;
329
+ let maxRow = 0;
330
+ for (const cell of this.cells) {
331
+ maxCol = Math.max(maxCol, cell.colIndex());
332
+ maxRow = Math.max(maxRow, cell.rowIndex());
333
+ }
334
+ return Object.freeze({
335
+ colCount: explicitColcount ?? maxCol + 1,
336
+ rowCount: explicitRowcount ?? maxRow + 1,
337
+ });
338
+ }
339
+ getFirstEnabledCell() {
340
+ const enabledCells = this.getEnabledCells();
341
+ return enabledCells[0] ?? null;
342
+ }
343
+ getEnabledCells() {
344
+ return [...this.cells]
345
+ .filter((cell) => !this.isCellDisabled(cell))
346
+ .sort((a, b) => compareCellValues(a.getValue(), b.getValue()));
347
+ }
348
+ getFocusValue() {
349
+ if (this.isFocusControlled()) {
350
+ const row = this.focusRow();
351
+ const col = this.focusCol();
352
+ if (row === null || col === null || row === undefined || col === undefined) {
353
+ return this.getFirstEnabledCell()?.getValue() ?? null;
354
+ }
355
+ const controlled = Object.freeze({ col, row });
356
+ const controlledCell = this.cellByKey.get(createCellKey(controlled));
357
+ if (controlledCell !== undefined && !this.isCellDisabled(controlledCell)) {
358
+ return controlled;
359
+ }
360
+ return this.getFirstEnabledCell()?.getValue() ?? null;
361
+ }
362
+ if (this.uncontrolledFocus !== null) {
363
+ const activeCell = this.cellByKey.get(createCellKey(this.uncontrolledFocus));
364
+ if (activeCell !== undefined && !this.isCellDisabled(activeCell)) {
365
+ return this.uncontrolledFocus;
366
+ }
367
+ }
368
+ return this.getFirstEnabledCell()?.getValue() ?? null;
369
+ }
370
+ getNavigableCells() {
371
+ return [...this.cells].map((cell) => ({
372
+ col: cell.colIndex(),
373
+ disabled: this.isCellDisabled(cell),
374
+ row: cell.rowIndex(),
375
+ }));
376
+ }
377
+ getSelectedValue() {
378
+ if (this.selectionMode() === 'none') {
379
+ return null;
380
+ }
381
+ if (this.isSelectionControlled()) {
382
+ return this.value() ?? null;
383
+ }
384
+ return this.uncontrolledSelection;
385
+ }
386
+ isFocusControlled() {
387
+ return this.focusRow() !== undefined && this.focusCol() !== undefined;
388
+ }
389
+ isSelectionControlled() {
390
+ return this.value() !== undefined;
391
+ }
392
+ moveFocus(activeCell, actionType) {
393
+ const nextValue = resolveNavigableGridCell(activeCell.getValue(), actionType, {
394
+ bounds: this.getComputedBounds(),
395
+ cells: this.getNavigableCells(),
396
+ wrap: this.wrap(),
397
+ });
398
+ if (nextValue === null) {
399
+ return;
400
+ }
401
+ const nextCell = this.cellByKey.get(createCellKey(nextValue));
402
+ if (nextCell === undefined || this.isCellDisabled(nextCell)) {
403
+ return;
404
+ }
405
+ this.pendingFocusTrigger = 'keyboard';
406
+ this.requestFocus(nextValue, 'keyboard');
407
+ this.focusVisibleKey = nextCell.cellKey();
408
+ nextCell.focusHost();
409
+ }
410
+ requestFocus(value, trigger) {
411
+ const previous = this.getFocusValue();
412
+ if (positionsEqual(previous, value)) {
413
+ return;
414
+ }
415
+ if (!this.isFocusControlled()) {
416
+ this.uncontrolledFocus = value;
417
+ }
418
+ this.focusRowChange.emit(value.row);
419
+ this.focusColChange.emit(value.col);
420
+ this.focusChange.emit(focusChangeEvent(value, previous, trigger));
421
+ }
422
+ requestSelection(value) {
423
+ const previous = this.getSelectedValue();
424
+ if (positionsEqual(previous, value)) {
425
+ return;
426
+ }
427
+ if (!this.isSelectionControlled()) {
428
+ this.uncontrolledSelection = value;
429
+ }
430
+ this.valueChange.emit(value);
431
+ }
5
432
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngGrid, deps: [], target: i0.ɵɵFactoryTarget.Directive });
6
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TngGrid, isStandalone: true, selector: "[tngGrid]", host: { properties: { "attr.data-slot": "this.dataSlot" } }, exportAs: ["tngGrid"], ngImport: i0 });
433
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngGrid, isStandalone: true, selector: "[tngGrid]", inputs: { dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, focusCol: { classPropertyName: "focusCol", publicName: "focusCol", isSignal: true, isRequired: false, transformFunction: null }, focusRow: { classPropertyName: "focusRow", publicName: "focusRow", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, wrap: { classPropertyName: "wrap", publicName: "wrap", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, ariaColcount: { classPropertyName: "ariaColcount", publicName: "ariaColcount", isSignal: false, isRequired: false, transformFunction: null }, ariaRowcount: { classPropertyName: "ariaRowcount", publicName: "ariaRowcount", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { focusRowChange: "focusRowChange", focusColChange: "focusColChange", focusChange: "focusChange", valueChange: "valueChange", cellActivate: "cellActivate" }, host: { listeners: { "focusout": "onFocusOut($event)", "keydown": "onKeyDown($event)" }, properties: { "attr.data-slot": "this.dataSlot", "attr.role": "this.role", "attr.aria-label": "this.ariaLabelAttr", "attr.aria-colcount": "this.ariaColcountAttr", "attr.aria-rowcount": "this.ariaRowcountAttr" } }, exportAs: ["tngGrid"], ngImport: i0 });
7
434
  }
8
435
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngGrid, decorators: [{
9
436
  type: Directive,
10
437
  args: [{
11
438
  selector: '[tngGrid]',
12
439
  exportAs: 'tngGrid',
13
- standalone: true,
440
+ }]
441
+ }], propDecorators: { dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], focusCol: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusCol", required: false }] }], focusRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusRow", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], wrap: [{ type: i0.Input, args: [{ isSignal: true, alias: "wrap", required: false }] }], focusRowChange: [{ type: i0.Output, args: ["focusRowChange"] }], focusColChange: [{ type: i0.Output, args: ["focusColChange"] }], focusChange: [{ type: i0.Output, args: ["focusChange"] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], cellActivate: [{ type: i0.Output, args: ["cellActivate"] }], ariaLabel: [{
442
+ type: Input
443
+ }], ariaColcount: [{
444
+ type: Input
445
+ }], ariaRowcount: [{
446
+ type: Input
447
+ }], dataSlot: [{
448
+ type: HostBinding,
449
+ args: ['attr.data-slot']
450
+ }], role: [{
451
+ type: HostBinding,
452
+ args: ['attr.role']
453
+ }], ariaLabelAttr: [{
454
+ type: HostBinding,
455
+ args: ['attr.aria-label']
456
+ }], ariaColcountAttr: [{
457
+ type: HostBinding,
458
+ args: ['attr.aria-colcount']
459
+ }], ariaRowcountAttr: [{
460
+ type: HostBinding,
461
+ args: ['attr.aria-rowcount']
462
+ }], onFocusOut: [{
463
+ type: HostListener,
464
+ args: ['focusout', ['$event']]
465
+ }], onKeyDown: [{
466
+ type: HostListener,
467
+ args: ['keydown', ['$event']]
468
+ }] } });
469
+ export class TngGridRow {
470
+ dataSlot = 'grid-row';
471
+ role = 'row';
472
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngGridRow, deps: [], target: i0.ɵɵFactoryTarget.Directive });
473
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TngGridRow, isStandalone: true, selector: "[tngGridRow]", host: { properties: { "attr.data-slot": "this.dataSlot", "attr.role": "this.role" } }, exportAs: ["tngGridRow"], ngImport: i0 });
474
+ }
475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngGridRow, decorators: [{
476
+ type: Directive,
477
+ args: [{
478
+ selector: '[tngGridRow]',
479
+ exportAs: 'tngGridRow',
14
480
  }]
15
481
  }], propDecorators: { dataSlot: [{
16
482
  type: HostBinding,
17
483
  args: ['attr.data-slot']
484
+ }], role: [{
485
+ type: HostBinding,
486
+ args: ['attr.role']
487
+ }] } });
488
+ export class TngGridCell {
489
+ hostRef = inject(ElementRef);
490
+ grid = inject(TngGrid);
491
+ rowIndex = input.required({ ...(ngDevMode ? { debugName: "rowIndex" } : {}), transform: normalizeIndex });
492
+ colIndex = input.required({ ...(ngDevMode ? { debugName: "colIndex" } : {}), transform: normalizeIndex });
493
+ rowSpan = input(1, { ...(ngDevMode ? { debugName: "rowSpan" } : {}), transform: normalizeSpan });
494
+ colSpan = input(1, { ...(ngDevMode ? { debugName: "colSpan" } : {}), transform: normalizeSpan });
495
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
496
+ selected = input(null, { ...(ngDevMode ? { debugName: "selected" } : {}), transform: (value) => {
497
+ if (value === undefined || value === null) {
498
+ return null;
499
+ }
500
+ return booleanAttribute(value);
501
+ } });
502
+ cellRole = input('gridcell', { ...(ngDevMode ? { debugName: "cellRole" } : {}), transform: normalizeCellRole });
503
+ dataSlot = 'gridcell';
504
+ get roleAttr() {
505
+ return this.cellRole();
506
+ }
507
+ get tabIndexAttr() {
508
+ return this.grid.getCellTabIndex(this);
509
+ }
510
+ get ariaRowIndexAttr() {
511
+ return String(this.rowIndex() + 1);
512
+ }
513
+ get ariaColIndexAttr() {
514
+ return String(this.colIndex() + 1);
515
+ }
516
+ get ariaRowSpanAttr() {
517
+ return this.rowSpan() > 1 ? String(this.rowSpan()) : null;
518
+ }
519
+ get ariaColSpanAttr() {
520
+ return this.colSpan() > 1 ? String(this.colSpan()) : null;
521
+ }
522
+ get ariaDisabledAttr() {
523
+ return this.grid.isCellDisabled(this) ? 'true' : null;
524
+ }
525
+ get ariaSelectedAttr() {
526
+ if (this.cellRole() !== 'gridcell' && this.selected() === null) {
527
+ return null;
528
+ }
529
+ if (this.cellRole() !== 'gridcell' && this.selected() !== null) {
530
+ return this.selected() ? 'true' : 'false';
531
+ }
532
+ if (this.grid.selectionMode() === 'none' && this.selected() === null) {
533
+ return null;
534
+ }
535
+ return this.grid.isCellSelected(this) ? 'true' : 'false';
536
+ }
537
+ get dataRowIndexAttr() {
538
+ return String(this.rowIndex());
539
+ }
540
+ get dataColIndexAttr() {
541
+ return String(this.colIndex());
542
+ }
543
+ get dataRowSpanAttr() {
544
+ return this.rowSpan() > 1 ? String(this.rowSpan()) : null;
545
+ }
546
+ get dataColSpanAttr() {
547
+ return this.colSpan() > 1 ? String(this.colSpan()) : null;
548
+ }
549
+ get dataDisabledAttr() {
550
+ return this.grid.isCellDisabled(this) ? '' : null;
551
+ }
552
+ get dataSelectedAttr() {
553
+ return this.grid.isCellSelected(this) ? '' : null;
554
+ }
555
+ get dataFocusedAttr() {
556
+ return this.grid.isCellFocused(this) ? '' : null;
557
+ }
558
+ get dataFocusVisibleAttr() {
559
+ return this.grid.isCellFocusVisible(this) ? '' : null;
560
+ }
561
+ get dataActivatedAttr() {
562
+ return this.grid.isCellActivated(this) ? '' : null;
563
+ }
564
+ ngOnInit() {
565
+ this.grid.registerCell(this);
566
+ }
567
+ ngOnDestroy() {
568
+ this.grid.unregisterCell(this);
569
+ }
570
+ cellKey() {
571
+ return createCellKey(this.getValue());
572
+ }
573
+ focusHost() {
574
+ this.hostRef.nativeElement.focus();
575
+ }
576
+ getHostElement() {
577
+ return this.hostRef.nativeElement;
578
+ }
579
+ getValue() {
580
+ return Object.freeze({
581
+ col: this.colIndex(),
582
+ row: this.rowIndex(),
583
+ });
584
+ }
585
+ isFocusVisible() {
586
+ return this.hostRef.nativeElement.matches(':focus-visible');
587
+ }
588
+ matchesValue(value) {
589
+ return this.rowIndex() === value.row && this.colIndex() === value.col;
590
+ }
591
+ onClick() {
592
+ if (this.grid.isCellDisabled(this)) {
593
+ return;
594
+ }
595
+ this.grid.onCellClicked(this);
596
+ }
597
+ onDoubleClick() {
598
+ if (this.grid.isCellDisabled(this)) {
599
+ return;
600
+ }
601
+ this.grid.onCellSelectionRequest(this, 'pointer');
602
+ }
603
+ onFocus() {
604
+ this.grid.onCellFocused(this);
605
+ }
606
+ onPointerDown() {
607
+ this.grid.onCellPointerDown(this);
608
+ }
609
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngGridCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
610
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: TngGridCell, isStandalone: true, selector: "[tngGridCell]", inputs: { rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: true, isRequired: true, transformFunction: null }, colIndex: { classPropertyName: "colIndex", publicName: "colIndex", isSignal: true, isRequired: true, transformFunction: null }, rowSpan: { classPropertyName: "rowSpan", publicName: "rowSpan", isSignal: true, isRequired: false, transformFunction: null }, colSpan: { classPropertyName: "colSpan", publicName: "colSpan", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, cellRole: { classPropertyName: "cellRole", publicName: "cellRole", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()", "dblclick": "onDoubleClick()", "focus": "onFocus()", "pointerdown": "onPointerDown()" }, properties: { "attr.data-slot": "this.dataSlot", "attr.role": "this.roleAttr", "attr.tabindex": "this.tabIndexAttr", "attr.aria-rowindex": "this.ariaRowIndexAttr", "attr.aria-colindex": "this.ariaColIndexAttr", "attr.aria-rowspan": "this.ariaRowSpanAttr", "attr.aria-colspan": "this.ariaColSpanAttr", "attr.aria-disabled": "this.ariaDisabledAttr", "attr.aria-selected": "this.ariaSelectedAttr", "attr.data-row-index": "this.dataRowIndexAttr", "attr.data-col-index": "this.dataColIndexAttr", "attr.data-row-span": "this.dataRowSpanAttr", "attr.data-col-span": "this.dataColSpanAttr", "attr.data-disabled": "this.dataDisabledAttr", "attr.data-selected": "this.dataSelectedAttr", "attr.data-focused": "this.dataFocusedAttr", "attr.data-focus-visible": "this.dataFocusVisibleAttr", "attr.data-activated": "this.dataActivatedAttr" } }, exportAs: ["tngGridCell"], ngImport: i0 });
611
+ }
612
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TngGridCell, decorators: [{
613
+ type: Directive,
614
+ args: [{
615
+ selector: '[tngGridCell]',
616
+ exportAs: 'tngGridCell',
617
+ }]
618
+ }], propDecorators: { rowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowIndex", required: true }] }], colIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "colIndex", required: true }] }], rowSpan: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowSpan", required: false }] }], colSpan: [{ type: i0.Input, args: [{ isSignal: true, alias: "colSpan", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], cellRole: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellRole", required: false }] }], dataSlot: [{
619
+ type: HostBinding,
620
+ args: ['attr.data-slot']
621
+ }], roleAttr: [{
622
+ type: HostBinding,
623
+ args: ['attr.role']
624
+ }], tabIndexAttr: [{
625
+ type: HostBinding,
626
+ args: ['attr.tabindex']
627
+ }], ariaRowIndexAttr: [{
628
+ type: HostBinding,
629
+ args: ['attr.aria-rowindex']
630
+ }], ariaColIndexAttr: [{
631
+ type: HostBinding,
632
+ args: ['attr.aria-colindex']
633
+ }], ariaRowSpanAttr: [{
634
+ type: HostBinding,
635
+ args: ['attr.aria-rowspan']
636
+ }], ariaColSpanAttr: [{
637
+ type: HostBinding,
638
+ args: ['attr.aria-colspan']
639
+ }], ariaDisabledAttr: [{
640
+ type: HostBinding,
641
+ args: ['attr.aria-disabled']
642
+ }], ariaSelectedAttr: [{
643
+ type: HostBinding,
644
+ args: ['attr.aria-selected']
645
+ }], dataRowIndexAttr: [{
646
+ type: HostBinding,
647
+ args: ['attr.data-row-index']
648
+ }], dataColIndexAttr: [{
649
+ type: HostBinding,
650
+ args: ['attr.data-col-index']
651
+ }], dataRowSpanAttr: [{
652
+ type: HostBinding,
653
+ args: ['attr.data-row-span']
654
+ }], dataColSpanAttr: [{
655
+ type: HostBinding,
656
+ args: ['attr.data-col-span']
657
+ }], dataDisabledAttr: [{
658
+ type: HostBinding,
659
+ args: ['attr.data-disabled']
660
+ }], dataSelectedAttr: [{
661
+ type: HostBinding,
662
+ args: ['attr.data-selected']
663
+ }], dataFocusedAttr: [{
664
+ type: HostBinding,
665
+ args: ['attr.data-focused']
666
+ }], dataFocusVisibleAttr: [{
667
+ type: HostBinding,
668
+ args: ['attr.data-focus-visible']
669
+ }], dataActivatedAttr: [{
670
+ type: HostBinding,
671
+ args: ['attr.data-activated']
672
+ }], onClick: [{
673
+ type: HostListener,
674
+ args: ['click']
675
+ }], onDoubleClick: [{
676
+ type: HostListener,
677
+ args: ['dblclick']
678
+ }], onFocus: [{
679
+ type: HostListener,
680
+ args: ['focus']
681
+ }], onPointerDown: [{
682
+ type: HostListener,
683
+ args: ['pointerdown']
18
684
  }] } });
19
685
  //# sourceMappingURL=tng-grid.js.map