@tailng-ui/primitives 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/README.md +36 -0
  2. package/package.json +13 -0
  3. package/src/index.d.ts +55 -0
  4. package/src/index.d.ts.map +1 -0
  5. package/src/index.js +61 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/feedback/empty/tng-empty.d.ts +16 -0
  8. package/src/lib/feedback/empty/tng-empty.d.ts.map +1 -0
  9. package/src/lib/feedback/empty/tng-empty.js +68 -0
  10. package/src/lib/feedback/empty/tng-empty.js.map +1 -0
  11. package/src/lib/feedback/progress-bar/tng-progress-bar.d.ts +24 -0
  12. package/src/lib/feedback/progress-bar/tng-progress-bar.d.ts.map +1 -0
  13. package/src/lib/feedback/progress-bar/tng-progress-bar.js +100 -0
  14. package/src/lib/feedback/progress-bar/tng-progress-bar.js.map +1 -0
  15. package/src/lib/feedback/progress-spinner/tng-progress-spinner.d.ts +21 -0
  16. package/src/lib/feedback/progress-spinner/tng-progress-spinner.d.ts.map +1 -0
  17. package/src/lib/feedback/progress-spinner/tng-progress-spinner.js +87 -0
  18. package/src/lib/feedback/progress-spinner/tng-progress-spinner.js.map +1 -0
  19. package/src/lib/feedback/skeleton/tng-skeleton.d.ts +11 -0
  20. package/src/lib/feedback/skeleton/tng-skeleton.d.ts.map +1 -0
  21. package/src/lib/feedback/skeleton/tng-skeleton.js +44 -0
  22. package/src/lib/feedback/skeleton/tng-skeleton.js.map +1 -0
  23. package/src/lib/feedback/toast/tng-toast.d.ts +20 -0
  24. package/src/lib/feedback/toast/tng-toast.d.ts.map +1 -0
  25. package/src/lib/feedback/toast/tng-toast.js +79 -0
  26. package/src/lib/feedback/toast/tng-toast.js.map +1 -0
  27. package/src/lib/form/_shared/id/index.d.ts +4 -0
  28. package/src/lib/form/_shared/id/index.d.ts.map +1 -0
  29. package/src/lib/form/_shared/id/index.js +4 -0
  30. package/src/lib/form/_shared/id/index.js.map +1 -0
  31. package/src/lib/form/_shared/id/tng-unique-id.provider.d.ts +11 -0
  32. package/src/lib/form/_shared/id/tng-unique-id.provider.d.ts.map +1 -0
  33. package/src/lib/form/_shared/id/tng-unique-id.provider.js +15 -0
  34. package/src/lib/form/_shared/id/tng-unique-id.provider.js.map +1 -0
  35. package/src/lib/form/_shared/id/tng-unique-id.service.d.ts +9 -0
  36. package/src/lib/form/_shared/id/tng-unique-id.service.d.ts.map +1 -0
  37. package/src/lib/form/_shared/id/tng-unique-id.service.js +18 -0
  38. package/src/lib/form/_shared/id/tng-unique-id.service.js.map +1 -0
  39. package/src/lib/form/_shared/id/tng-unique-id.token.d.ts +8 -0
  40. package/src/lib/form/_shared/id/tng-unique-id.token.d.ts.map +1 -0
  41. package/src/lib/form/_shared/id/tng-unique-id.token.js +13 -0
  42. package/src/lib/form/_shared/id/tng-unique-id.token.js.map +1 -0
  43. package/src/lib/form/_shared/select/tng-select.host-api.d.ts +28 -0
  44. package/src/lib/form/_shared/select/tng-select.host-api.d.ts.map +1 -0
  45. package/src/lib/form/_shared/select/tng-select.host-api.js +1 -0
  46. package/src/lib/form/_shared/select/tng-select.host-api.js.map +1 -0
  47. package/src/lib/form/_shared/select/tng-select.overlay.shared.d.ts +38 -0
  48. package/src/lib/form/_shared/select/tng-select.overlay.shared.d.ts.map +1 -0
  49. package/src/lib/form/_shared/select/tng-select.overlay.shared.js +226 -0
  50. package/src/lib/form/_shared/select/tng-select.overlay.shared.js.map +1 -0
  51. package/src/lib/form/_shared/select/tng-select.parts.shared.d.ts +35 -0
  52. package/src/lib/form/_shared/select/tng-select.parts.shared.d.ts.map +1 -0
  53. package/src/lib/form/_shared/select/tng-select.parts.shared.js +199 -0
  54. package/src/lib/form/_shared/select/tng-select.parts.shared.js.map +1 -0
  55. package/src/lib/form/_shared/select/tng-select.tokens.shared.d.ts +8 -0
  56. package/src/lib/form/_shared/select/tng-select.tokens.shared.d.ts.map +1 -0
  57. package/src/lib/form/_shared/select/tng-select.tokens.shared.js +7 -0
  58. package/src/lib/form/_shared/select/tng-select.tokens.shared.js.map +1 -0
  59. package/src/lib/form/autocomplete/index.d.ts +7 -0
  60. package/src/lib/form/autocomplete/index.d.ts.map +1 -0
  61. package/src/lib/form/autocomplete/index.js +6 -0
  62. package/src/lib/form/autocomplete/index.js.map +1 -0
  63. package/src/lib/form/autocomplete/tng-autocomplete.d.ts +52 -0
  64. package/src/lib/form/autocomplete/tng-autocomplete.d.ts.map +1 -0
  65. package/src/lib/form/autocomplete/tng-autocomplete.js +95 -0
  66. package/src/lib/form/autocomplete/tng-autocomplete.js.map +1 -0
  67. package/src/lib/form/autocomplete/tng-autocomplete.listbox.d.ts +19 -0
  68. package/src/lib/form/autocomplete/tng-autocomplete.listbox.d.ts.map +1 -0
  69. package/src/lib/form/autocomplete/tng-autocomplete.listbox.js +123 -0
  70. package/src/lib/form/autocomplete/tng-autocomplete.listbox.js.map +1 -0
  71. package/src/lib/form/autocomplete/tng-autocomplete.listbox.tokens.d.ts +4 -0
  72. package/src/lib/form/autocomplete/tng-autocomplete.listbox.tokens.d.ts.map +1 -0
  73. package/src/lib/form/autocomplete/tng-autocomplete.listbox.tokens.js +3 -0
  74. package/src/lib/form/autocomplete/tng-autocomplete.listbox.tokens.js.map +1 -0
  75. package/src/lib/form/autocomplete/tng-autocomplete.listbox.types.d.ts +4 -0
  76. package/src/lib/form/autocomplete/tng-autocomplete.listbox.types.d.ts.map +1 -0
  77. package/src/lib/form/autocomplete/tng-autocomplete.listbox.types.js +1 -0
  78. package/src/lib/form/autocomplete/tng-autocomplete.listbox.types.js.map +1 -0
  79. package/src/lib/form/autocomplete/tng-autocomplete.overlay.d.ts +40 -0
  80. package/src/lib/form/autocomplete/tng-autocomplete.overlay.d.ts.map +1 -0
  81. package/src/lib/form/autocomplete/tng-autocomplete.overlay.js +236 -0
  82. package/src/lib/form/autocomplete/tng-autocomplete.overlay.js.map +1 -0
  83. package/src/lib/form/autocomplete/tng-autocomplete.parts.d.ts +38 -0
  84. package/src/lib/form/autocomplete/tng-autocomplete.parts.d.ts.map +1 -0
  85. package/src/lib/form/autocomplete/tng-autocomplete.parts.js +252 -0
  86. package/src/lib/form/autocomplete/tng-autocomplete.parts.js.map +1 -0
  87. package/src/lib/form/autocomplete/tng-autocomplete.tokens.d.ts +4 -0
  88. package/src/lib/form/autocomplete/tng-autocomplete.tokens.d.ts.map +1 -0
  89. package/src/lib/form/autocomplete/tng-autocomplete.tokens.js +3 -0
  90. package/src/lib/form/autocomplete/tng-autocomplete.tokens.js.map +1 -0
  91. package/src/lib/form/button-toggle/tng-button-toggle.d.ts +164 -0
  92. package/src/lib/form/button-toggle/tng-button-toggle.d.ts.map +1 -0
  93. package/src/lib/form/button-toggle/tng-button-toggle.js +1097 -0
  94. package/src/lib/form/button-toggle/tng-button-toggle.js.map +1 -0
  95. package/src/lib/form/checkbox/tng-checkbox.d.ts +48 -0
  96. package/src/lib/form/checkbox/tng-checkbox.d.ts.map +1 -0
  97. package/src/lib/form/checkbox/tng-checkbox.js +234 -0
  98. package/src/lib/form/checkbox/tng-checkbox.js.map +1 -0
  99. package/src/lib/form/chips/tng-chips.d.ts +4 -0
  100. package/src/lib/form/chips/tng-chips.d.ts.map +1 -0
  101. package/src/lib/form/chips/tng-chips.js +16 -0
  102. package/src/lib/form/chips/tng-chips.js.map +1 -0
  103. package/src/lib/form/combobox/tng-combobox.d.ts +4 -0
  104. package/src/lib/form/combobox/tng-combobox.d.ts.map +1 -0
  105. package/src/lib/form/combobox/tng-combobox.js +16 -0
  106. package/src/lib/form/combobox/tng-combobox.js.map +1 -0
  107. package/src/lib/form/input/tng-input.d.ts +87 -0
  108. package/src/lib/form/input/tng-input.d.ts.map +1 -0
  109. package/src/lib/form/input/tng-input.js +393 -0
  110. package/src/lib/form/input/tng-input.js.map +1 -0
  111. package/src/lib/form/input-otp/tng-input-otp.d.ts +7 -0
  112. package/src/lib/form/input-otp/tng-input-otp.d.ts.map +1 -0
  113. package/src/lib/form/input-otp/tng-input-otp.js +33 -0
  114. package/src/lib/form/input-otp/tng-input-otp.js.map +1 -0
  115. package/src/lib/form/label/tng-label.d.ts +6 -0
  116. package/src/lib/form/label/tng-label.d.ts.map +1 -0
  117. package/src/lib/form/label/tng-label.js +25 -0
  118. package/src/lib/form/label/tng-label.js.map +1 -0
  119. package/src/lib/form/listbox/listbox.directive.d.ts +51 -0
  120. package/src/lib/form/listbox/listbox.directive.d.ts.map +1 -0
  121. package/src/lib/form/listbox/listbox.directive.js +439 -0
  122. package/src/lib/form/listbox/listbox.directive.js.map +1 -0
  123. package/src/lib/form/listbox/option.directive.d.ts +22 -0
  124. package/src/lib/form/listbox/option.directive.d.ts.map +1 -0
  125. package/src/lib/form/listbox/option.directive.js +109 -0
  126. package/src/lib/form/listbox/option.directive.js.map +1 -0
  127. package/src/lib/form/listbox/tokens.d.ts +14 -0
  128. package/src/lib/form/listbox/tokens.d.ts.map +1 -0
  129. package/src/lib/form/listbox/tokens.js +13 -0
  130. package/src/lib/form/listbox/tokens.js.map +1 -0
  131. package/src/lib/form/multi-autocomplete/index.d.ts +10 -0
  132. package/src/lib/form/multi-autocomplete/index.d.ts.map +1 -0
  133. package/src/lib/form/multi-autocomplete/index.js +10 -0
  134. package/src/lib/form/multi-autocomplete/index.js.map +1 -0
  135. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.chip.d.ts +11 -0
  136. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.chip.d.ts.map +1 -0
  137. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.chip.js +98 -0
  138. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.chip.js.map +1 -0
  139. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.content.d.ts +10 -0
  140. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.content.d.ts.map +1 -0
  141. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.content.js +45 -0
  142. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.content.js.map +1 -0
  143. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.d.ts +43 -0
  144. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.d.ts.map +1 -0
  145. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.js +150 -0
  146. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.js.map +1 -0
  147. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.d.ts +20 -0
  148. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.d.ts.map +1 -0
  149. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.js +138 -0
  150. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.js.map +1 -0
  151. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.tokens.d.ts +4 -0
  152. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.tokens.d.ts.map +1 -0
  153. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.tokens.js +3 -0
  154. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.tokens.js.map +1 -0
  155. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.types.d.ts +18 -0
  156. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.types.d.ts.map +1 -0
  157. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.types.js +2 -0
  158. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.listbox.types.js.map +1 -0
  159. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.d.ts +4 -0
  160. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.d.ts.map +1 -0
  161. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.js +17 -0
  162. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.overlay.js.map +1 -0
  163. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.tokens.d.ts +4 -0
  164. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.tokens.d.ts.map +1 -0
  165. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.tokens.js +3 -0
  166. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.tokens.js.map +1 -0
  167. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.trigger.d.ts +21 -0
  168. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.trigger.d.ts.map +1 -0
  169. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.trigger.js +241 -0
  170. package/src/lib/form/multi-autocomplete/tng-multi-autocomplete.trigger.js.map +1 -0
  171. package/src/lib/form/multi-select/index.d.ts +7 -0
  172. package/src/lib/form/multi-select/index.d.ts.map +1 -0
  173. package/src/lib/form/multi-select/index.js +6 -0
  174. package/src/lib/form/multi-select/index.js.map +1 -0
  175. package/src/lib/form/multi-select/tng-multi-select.d.ts +45 -0
  176. package/src/lib/form/multi-select/tng-multi-select.d.ts.map +1 -0
  177. package/src/lib/form/multi-select/tng-multi-select.js +136 -0
  178. package/src/lib/form/multi-select/tng-multi-select.js.map +1 -0
  179. package/src/lib/form/multi-select/tng-multi-select.listbox.d.ts +21 -0
  180. package/src/lib/form/multi-select/tng-multi-select.listbox.d.ts.map +1 -0
  181. package/src/lib/form/multi-select/tng-multi-select.listbox.js +107 -0
  182. package/src/lib/form/multi-select/tng-multi-select.listbox.js.map +1 -0
  183. package/src/lib/form/multi-select/tng-multi-select.listbox.tokens.d.ts +3 -0
  184. package/src/lib/form/multi-select/tng-multi-select.listbox.tokens.d.ts.map +1 -0
  185. package/src/lib/form/multi-select/tng-multi-select.listbox.tokens.js +3 -0
  186. package/src/lib/form/multi-select/tng-multi-select.listbox.tokens.js.map +1 -0
  187. package/src/lib/form/multi-select/tng-multi-select.listbox.types.d.ts +3 -0
  188. package/src/lib/form/multi-select/tng-multi-select.listbox.types.d.ts.map +1 -0
  189. package/src/lib/form/multi-select/tng-multi-select.listbox.types.js +1 -0
  190. package/src/lib/form/multi-select/tng-multi-select.listbox.types.js.map +1 -0
  191. package/src/lib/form/multi-select/tng-multi-select.overlay.d.ts +5 -0
  192. package/src/lib/form/multi-select/tng-multi-select.overlay.d.ts.map +1 -0
  193. package/src/lib/form/multi-select/tng-multi-select.overlay.js +5 -0
  194. package/src/lib/form/multi-select/tng-multi-select.overlay.js.map +1 -0
  195. package/src/lib/form/multi-select/tng-multi-select.parts.d.ts +5 -0
  196. package/src/lib/form/multi-select/tng-multi-select.parts.d.ts.map +1 -0
  197. package/src/lib/form/multi-select/tng-multi-select.parts.js +5 -0
  198. package/src/lib/form/multi-select/tng-multi-select.parts.js.map +1 -0
  199. package/src/lib/form/multi-select/tng-multi-select.tokens.d.ts +4 -0
  200. package/src/lib/form/multi-select/tng-multi-select.tokens.d.ts.map +1 -0
  201. package/src/lib/form/multi-select/tng-multi-select.tokens.js +3 -0
  202. package/src/lib/form/multi-select/tng-multi-select.tokens.js.map +1 -0
  203. package/src/lib/form/multiselect/tng-multiselect.d.ts +4 -0
  204. package/src/lib/form/multiselect/tng-multiselect.d.ts.map +1 -0
  205. package/src/lib/form/multiselect/tng-multiselect.js +16 -0
  206. package/src/lib/form/multiselect/tng-multiselect.js.map +1 -0
  207. package/src/lib/form/radio/tng-radio.d.ts +20 -0
  208. package/src/lib/form/radio/tng-radio.d.ts.map +1 -0
  209. package/src/lib/form/radio/tng-radio.js +86 -0
  210. package/src/lib/form/radio/tng-radio.js.map +1 -0
  211. package/src/lib/form/select/tng-select.d.ts +38 -0
  212. package/src/lib/form/select/tng-select.d.ts.map +1 -0
  213. package/src/lib/form/select/tng-select.js +106 -0
  214. package/src/lib/form/select/tng-select.js.map +1 -0
  215. package/src/lib/form/select/tng-select.listbox.d.ts +20 -0
  216. package/src/lib/form/select/tng-select.listbox.d.ts.map +1 -0
  217. package/src/lib/form/select/tng-select.listbox.js +123 -0
  218. package/src/lib/form/select/tng-select.listbox.js.map +1 -0
  219. package/src/lib/form/select/tng-select.listbox.tokens.d.ts +3 -0
  220. package/src/lib/form/select/tng-select.listbox.tokens.d.ts.map +1 -0
  221. package/src/lib/form/select/tng-select.listbox.tokens.js +3 -0
  222. package/src/lib/form/select/tng-select.listbox.tokens.js.map +1 -0
  223. package/src/lib/form/select/tng-select.listbox.types.d.ts +4 -0
  224. package/src/lib/form/select/tng-select.listbox.types.d.ts.map +1 -0
  225. package/src/lib/form/select/tng-select.listbox.types.js +1 -0
  226. package/src/lib/form/select/tng-select.listbox.types.js.map +1 -0
  227. package/src/lib/form/select/tng-select.overlay.d.ts +5 -0
  228. package/src/lib/form/select/tng-select.overlay.d.ts.map +1 -0
  229. package/src/lib/form/select/tng-select.overlay.js +5 -0
  230. package/src/lib/form/select/tng-select.overlay.js.map +1 -0
  231. package/src/lib/form/select/tng-select.parts.d.ts +5 -0
  232. package/src/lib/form/select/tng-select.parts.d.ts.map +1 -0
  233. package/src/lib/form/select/tng-select.parts.js +5 -0
  234. package/src/lib/form/select/tng-select.parts.js.map +1 -0
  235. package/src/lib/form/select/tng-select.tokens.d.ts +4 -0
  236. package/src/lib/form/select/tng-select.tokens.d.ts.map +1 -0
  237. package/src/lib/form/select/tng-select.tokens.js +3 -0
  238. package/src/lib/form/select/tng-select.tokens.js.map +1 -0
  239. package/src/lib/form/slider/tng-slider.d.ts +19 -0
  240. package/src/lib/form/slider/tng-slider.d.ts.map +1 -0
  241. package/src/lib/form/slider/tng-slider.js +84 -0
  242. package/src/lib/form/slider/tng-slider.js.map +1 -0
  243. package/src/lib/form/switch/tng-switch.d.ts +19 -0
  244. package/src/lib/form/switch/tng-switch.d.ts.map +1 -0
  245. package/src/lib/form/switch/tng-switch.js +79 -0
  246. package/src/lib/form/switch/tng-switch.js.map +1 -0
  247. package/src/lib/form/textarea/tng-textarea.d.ts +23 -0
  248. package/src/lib/form/textarea/tng-textarea.d.ts.map +1 -0
  249. package/src/lib/form/textarea/tng-textarea.js +119 -0
  250. package/src/lib/form/textarea/tng-textarea.js.map +1 -0
  251. package/src/lib/form/toggle/tng-toggle.d.ts +44 -0
  252. package/src/lib/form/toggle/tng-toggle.d.ts.map +1 -0
  253. package/src/lib/form/toggle/tng-toggle.js +203 -0
  254. package/src/lib/form/toggle/tng-toggle.js.map +1 -0
  255. package/src/lib/form/toggle-group/tng-toggle-group.d.ts +35 -0
  256. package/src/lib/form/toggle-group/tng-toggle-group.d.ts.map +1 -0
  257. package/src/lib/form/toggle-group/tng-toggle-group.js +156 -0
  258. package/src/lib/form/toggle-group/tng-toggle-group.js.map +1 -0
  259. package/src/lib/internal/combobox/combobox.active.d.ts +17 -0
  260. package/src/lib/internal/combobox/combobox.active.d.ts.map +1 -0
  261. package/src/lib/internal/combobox/combobox.active.js +19 -0
  262. package/src/lib/internal/combobox/combobox.active.js.map +1 -0
  263. package/src/lib/internal/combobox/combobox.commit.d.ts +20 -0
  264. package/src/lib/internal/combobox/combobox.commit.d.ts.map +1 -0
  265. package/src/lib/internal/combobox/combobox.commit.js +34 -0
  266. package/src/lib/internal/combobox/combobox.commit.js.map +1 -0
  267. package/src/lib/internal/combobox/combobox.keyboard.d.ts +39 -0
  268. package/src/lib/internal/combobox/combobox.keyboard.d.ts.map +1 -0
  269. package/src/lib/internal/combobox/combobox.keyboard.js +88 -0
  270. package/src/lib/internal/combobox/combobox.keyboard.js.map +1 -0
  271. package/src/lib/internal/combobox/combobox.listbox-api.d.ts +19 -0
  272. package/src/lib/internal/combobox/combobox.listbox-api.d.ts.map +1 -0
  273. package/src/lib/internal/combobox/combobox.listbox-api.js +5 -0
  274. package/src/lib/internal/combobox/combobox.listbox-api.js.map +1 -0
  275. package/src/lib/internal/combobox/index.d.ts +5 -0
  276. package/src/lib/internal/combobox/index.d.ts.map +1 -0
  277. package/src/lib/internal/combobox/index.js +4 -0
  278. package/src/lib/internal/combobox/index.js.map +1 -0
  279. package/src/lib/layout/accordion/tng-accordion.d.ts +150 -0
  280. package/src/lib/layout/accordion/tng-accordion.d.ts.map +1 -0
  281. package/src/lib/layout/accordion/tng-accordion.js +852 -0
  282. package/src/lib/layout/accordion/tng-accordion.js.map +1 -0
  283. package/src/lib/layout/bottom-sheet/tng-bottom-sheet.d.ts +4 -0
  284. package/src/lib/layout/bottom-sheet/tng-bottom-sheet.d.ts.map +1 -0
  285. package/src/lib/layout/bottom-sheet/tng-bottom-sheet.js +16 -0
  286. package/src/lib/layout/bottom-sheet/tng-bottom-sheet.js.map +1 -0
  287. package/src/lib/layout/card/tng-card.d.ts +31 -0
  288. package/src/lib/layout/card/tng-card.d.ts.map +1 -0
  289. package/src/lib/layout/card/tng-card.js +133 -0
  290. package/src/lib/layout/card/tng-card.js.map +1 -0
  291. package/src/lib/layout/collapsible/tng-collapsible.d.ts +28 -0
  292. package/src/lib/layout/collapsible/tng-collapsible.d.ts.map +1 -0
  293. package/src/lib/layout/collapsible/tng-collapsible.js +123 -0
  294. package/src/lib/layout/collapsible/tng-collapsible.js.map +1 -0
  295. package/src/lib/layout/drawer/tng-drawer.d.ts +177 -0
  296. package/src/lib/layout/drawer/tng-drawer.d.ts.map +1 -0
  297. package/src/lib/layout/drawer/tng-drawer.js +1147 -0
  298. package/src/lib/layout/drawer/tng-drawer.js.map +1 -0
  299. package/src/lib/layout/grid/tng-grid.d.ts +4 -0
  300. package/src/lib/layout/grid/tng-grid.d.ts.map +1 -0
  301. package/src/lib/layout/grid/tng-grid.js +16 -0
  302. package/src/lib/layout/grid/tng-grid.js.map +1 -0
  303. package/src/lib/layout/separator/tng-separator.d.ts +11 -0
  304. package/src/lib/layout/separator/tng-separator.d.ts.map +1 -0
  305. package/src/lib/layout/separator/tng-separator.js +47 -0
  306. package/src/lib/layout/separator/tng-separator.js.map +1 -0
  307. package/src/lib/layout/stepper/tng-stepper.d.ts +4 -0
  308. package/src/lib/layout/stepper/tng-stepper.d.ts.map +1 -0
  309. package/src/lib/layout/stepper/tng-stepper.js +16 -0
  310. package/src/lib/layout/stepper/tng-stepper.js.map +1 -0
  311. package/src/lib/layout/tree/tng-tree.d.ts +4 -0
  312. package/src/lib/layout/tree/tng-tree.d.ts.map +1 -0
  313. package/src/lib/layout/tree/tng-tree.js +16 -0
  314. package/src/lib/layout/tree/tng-tree.js.map +1 -0
  315. package/src/lib/navigation/breadcrumb/tng-breadcrumb.d.ts +17 -0
  316. package/src/lib/navigation/breadcrumb/tng-breadcrumb.d.ts.map +1 -0
  317. package/src/lib/navigation/breadcrumb/tng-breadcrumb.js +72 -0
  318. package/src/lib/navigation/breadcrumb/tng-breadcrumb.js.map +1 -0
  319. package/src/lib/navigation/context-menu/tng-context-menu.d.ts +36 -0
  320. package/src/lib/navigation/context-menu/tng-context-menu.d.ts.map +1 -0
  321. package/src/lib/navigation/context-menu/tng-context-menu.js +159 -0
  322. package/src/lib/navigation/context-menu/tng-context-menu.js.map +1 -0
  323. package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.d.ts +4 -0
  324. package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.d.ts.map +1 -0
  325. package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.js +16 -0
  326. package/src/lib/navigation/dropdown-menu/tng-dropdown-menu.js.map +1 -0
  327. package/src/lib/navigation/menu/tng-menu.d.ts +173 -0
  328. package/src/lib/navigation/menu/tng-menu.d.ts.map +1 -0
  329. package/src/lib/navigation/menu/tng-menu.js +1026 -0
  330. package/src/lib/navigation/menu/tng-menu.js.map +1 -0
  331. package/src/lib/navigation/menubar/tng-menubar.d.ts +64 -0
  332. package/src/lib/navigation/menubar/tng-menubar.d.ts.map +1 -0
  333. package/src/lib/navigation/menubar/tng-menubar.js +478 -0
  334. package/src/lib/navigation/menubar/tng-menubar.js.map +1 -0
  335. package/src/lib/navigation/navigation-menu/tng-navigation-menu.d.ts +4 -0
  336. package/src/lib/navigation/navigation-menu/tng-navigation-menu.d.ts.map +1 -0
  337. package/src/lib/navigation/navigation-menu/tng-navigation-menu.js +16 -0
  338. package/src/lib/navigation/navigation-menu/tng-navigation-menu.js.map +1 -0
  339. package/src/lib/navigation/tabs/tng-tabs.d.ts +234 -0
  340. package/src/lib/navigation/tabs/tng-tabs.d.ts.map +1 -0
  341. package/src/lib/navigation/tabs/tng-tabs.js +1350 -0
  342. package/src/lib/navigation/tabs/tng-tabs.js.map +1 -0
  343. package/src/lib/navigation/toolbar/tng-toolbar.d.ts +4 -0
  344. package/src/lib/navigation/toolbar/tng-toolbar.d.ts.map +1 -0
  345. package/src/lib/navigation/toolbar/tng-toolbar.js +16 -0
  346. package/src/lib/navigation/toolbar/tng-toolbar.js.map +1 -0
  347. package/src/lib/overlay/tooltip/tng-tooltip.d.ts +25 -0
  348. package/src/lib/overlay/tooltip/tng-tooltip.d.ts.map +1 -0
  349. package/src/lib/overlay/tooltip/tng-tooltip.js +99 -0
  350. package/src/lib/overlay/tooltip/tng-tooltip.js.map +1 -0
  351. package/src/lib/utility/avatar/tng-avatar.d.ts +10 -0
  352. package/src/lib/utility/avatar/tng-avatar.d.ts.map +1 -0
  353. package/src/lib/utility/avatar/tng-avatar.js +42 -0
  354. package/src/lib/utility/avatar/tng-avatar.js.map +1 -0
  355. package/src/lib/utility/badge/tng-badge.d.ts +63 -0
  356. package/src/lib/utility/badge/tng-badge.d.ts.map +1 -0
  357. package/src/lib/utility/badge/tng-badge.js +345 -0
  358. package/src/lib/utility/badge/tng-badge.js.map +1 -0
  359. package/src/lib/utility/code-block/tng-code-block.d.ts +16 -0
  360. package/src/lib/utility/code-block/tng-code-block.d.ts.map +1 -0
  361. package/src/lib/utility/code-block/tng-code-block.js +68 -0
  362. package/src/lib/utility/code-block/tng-code-block.js.map +1 -0
  363. package/src/lib/utility/copy/tng-copy.d.ts +75 -0
  364. package/src/lib/utility/copy/tng-copy.d.ts.map +1 -0
  365. package/src/lib/utility/copy/tng-copy.js +544 -0
  366. package/src/lib/utility/copy/tng-copy.js.map +1 -0
  367. package/src/lib/utility/press/tng-press.d.ts +33 -0
  368. package/src/lib/utility/press/tng-press.d.ts.map +1 -0
  369. package/src/lib/utility/press/tng-press.js +207 -0
  370. package/src/lib/utility/press/tng-press.js.map +1 -0
  371. package/src/lib/utility/tag/tng-tag.d.ts +4 -0
  372. package/src/lib/utility/tag/tng-tag.d.ts.map +1 -0
  373. package/src/lib/utility/tag/tng-tag.js +16 -0
  374. package/src/lib/utility/tag/tng-tag.js.map +1 -0
@@ -0,0 +1,1350 @@
1
+ import { __decorate } from "tslib";
2
+ import { Directive, ElementRef, HostBinding, HostListener, inject, input, output, } from '@angular/core';
3
+ import { createTngIdFactory } from '@tailng-ui/cdk';
4
+ const createTabId = createTngIdFactory('tng-tab');
5
+ const createPanelId = createTngIdFactory('tng-tab-panel');
6
+ let nextRegistrationOrder = 0;
7
+ function normalizeBooleanInput(value) {
8
+ if (typeof value === 'boolean') {
9
+ return value;
10
+ }
11
+ if (typeof value === 'string') {
12
+ const normalized = value.trim().toLowerCase();
13
+ if (normalized === '' || normalized === 'true') {
14
+ return true;
15
+ }
16
+ if (normalized === 'false') {
17
+ return false;
18
+ }
19
+ }
20
+ return false;
21
+ }
22
+ function normalizeOptionalBooleanInput(value) {
23
+ if (value === undefined || value === null) {
24
+ return undefined;
25
+ }
26
+ return normalizeBooleanInput(value);
27
+ }
28
+ function normalizeDirectionInput(value) {
29
+ if (value === 'ltr' || value === 'rtl' || value === 'auto') {
30
+ return value;
31
+ }
32
+ return 'auto';
33
+ }
34
+ function normalizeOrientationInput(value) {
35
+ return value === 'vertical' ? 'vertical' : 'horizontal';
36
+ }
37
+ function normalizeActivationInput(value) {
38
+ return value === 'manual' ? 'manual' : 'auto';
39
+ }
40
+ function normalizeScrollButtonsInput(value) {
41
+ if (value === 'auto' || value === 'on' || value === 'off') {
42
+ return value;
43
+ }
44
+ if (value === '' || value === true || value === 'true') {
45
+ return 'auto';
46
+ }
47
+ return 'off';
48
+ }
49
+ function normalizeOptionalValueInput(value) {
50
+ if (value === undefined) {
51
+ return undefined;
52
+ }
53
+ if (value === null) {
54
+ return null;
55
+ }
56
+ if (typeof value === 'number' || typeof value === 'string') {
57
+ return value;
58
+ }
59
+ return String(value);
60
+ }
61
+ function normalizeOptionalStringInput(value) {
62
+ if (value === undefined) {
63
+ return undefined;
64
+ }
65
+ if (value === null) {
66
+ return null;
67
+ }
68
+ return String(value);
69
+ }
70
+ function valuesEqual(a, b) {
71
+ return a === b;
72
+ }
73
+ function compareByDomPosition(aElement, bElement, aOrder, bOrder) {
74
+ if (aElement === bElement) {
75
+ return 0;
76
+ }
77
+ const relativePosition = aElement.compareDocumentPosition(bElement);
78
+ if (relativePosition & Node.DOCUMENT_POSITION_FOLLOWING) {
79
+ return -1;
80
+ }
81
+ if (relativePosition & Node.DOCUMENT_POSITION_PRECEDING) {
82
+ return 1;
83
+ }
84
+ return aOrder - bOrder;
85
+ }
86
+ function isFocusableInteractiveElement(element) {
87
+ return (element.matches('a[href]') ||
88
+ element.matches('button') ||
89
+ element.matches('input') ||
90
+ element.matches('select') ||
91
+ element.matches('textarea') ||
92
+ element.matches('[tabindex]') ||
93
+ element.matches('[contenteditable="true"]'));
94
+ }
95
+ let TngTabs = class TngTabs {
96
+ hostRef = inject(ElementRef);
97
+ tabs = new Set();
98
+ panels = new Set();
99
+ tabList = null;
100
+ scrollPrevControl = null;
101
+ scrollNextControl = null;
102
+ uncontrolledValue = null;
103
+ focusedValue = null;
104
+ hasUserSelection = false;
105
+ initialized = false;
106
+ value = input(undefined, {
107
+ transform: normalizeOptionalValueInput,
108
+ });
109
+ defaultValue = input(undefined, {
110
+ transform: normalizeOptionalValueInput,
111
+ });
112
+ activation = input('auto', {
113
+ transform: normalizeActivationInput,
114
+ });
115
+ orientation = input('horizontal', {
116
+ transform: normalizeOrientationInput,
117
+ });
118
+ scrollButtons = input('off', {
119
+ transform: normalizeScrollButtonsInput,
120
+ });
121
+ loop = input(true, {
122
+ transform: normalizeBooleanInput,
123
+ });
124
+ dir = input('auto', {
125
+ transform: normalizeDirectionInput,
126
+ });
127
+ disabled = input(false, {
128
+ transform: normalizeBooleanInput,
129
+ });
130
+ lazy = input(undefined, {
131
+ transform: normalizeOptionalBooleanInput,
132
+ });
133
+ keepAlive = input(undefined, {
134
+ transform: normalizeOptionalBooleanInput,
135
+ });
136
+ valueChange = output();
137
+ tabChange = output();
138
+ focusChange = output();
139
+ dataSlot = 'tabs';
140
+ get dataOrientation() {
141
+ return this.orientation();
142
+ }
143
+ get dataActivation() {
144
+ return this.activation();
145
+ }
146
+ get dataDisabled() {
147
+ return this.disabled() ? 'true' : 'false';
148
+ }
149
+ ngDoCheck() {
150
+ this.syncStateFromRegistry();
151
+ }
152
+ isDisabled() {
153
+ return this.disabled();
154
+ }
155
+ isKeepAliveEnabled() {
156
+ return this.keepAlive() ?? true;
157
+ }
158
+ isLazyEnabled() {
159
+ return this.lazy() ?? false;
160
+ }
161
+ select(value) {
162
+ const targetTab = this.findEnabledTabByValue(value);
163
+ if (targetTab === null) {
164
+ return;
165
+ }
166
+ this.requestSelection(targetTab, 'programmatic');
167
+ }
168
+ focus(value) {
169
+ const targetTab = this.findEnabledTabByValue(value);
170
+ if (targetTab === null) {
171
+ return;
172
+ }
173
+ this.moveFocusToTab(targetTab, 'programmatic');
174
+ if (this.activation() === 'auto') {
175
+ this.requestSelection(targetTab, 'programmatic');
176
+ }
177
+ }
178
+ next() {
179
+ this.moveFocusFromCurrentTab('next', 'programmatic');
180
+ }
181
+ prev() {
182
+ this.moveFocusFromCurrentTab('prev', 'programmatic');
183
+ }
184
+ registerTab(tab) {
185
+ this.tabs.add(tab);
186
+ }
187
+ unregisterTab(tab) {
188
+ const orderedTabs = this.getOrderedTabs();
189
+ const removedIndex = orderedTabs.indexOf(tab);
190
+ const removedValue = tab.getValue();
191
+ const selectedValue = this.getEffectiveSelectedValue();
192
+ const focusedValue = this.resolveCurrentTabStopValue();
193
+ this.tabs.delete(tab);
194
+ if (selectedValue !== null && valuesEqual(selectedValue, removedValue)) {
195
+ const nextSelectedValue = this.resolveNeighborValueOnRemoval(orderedTabs, removedIndex);
196
+ this.applyLifecycleSelection(nextSelectedValue);
197
+ }
198
+ if (focusedValue !== null && valuesEqual(focusedValue, removedValue)) {
199
+ const nextFocusedValue = this.resolveNeighborValueOnRemoval(orderedTabs, removedIndex);
200
+ this.focusedValue = nextFocusedValue;
201
+ }
202
+ this.syncStateFromRegistry();
203
+ }
204
+ notifyTabMutated(tab) {
205
+ const selectedValue = this.getEffectiveSelectedValue();
206
+ if (selectedValue !== null && valuesEqual(selectedValue, tab.getValue()) && tab.isDisabledInContext()) {
207
+ const replacement = this.resolveNeighborForDisabledTab(tab);
208
+ this.applyLifecycleSelection(replacement);
209
+ }
210
+ const focusedValue = this.resolveCurrentTabStopValue();
211
+ if (focusedValue !== null && valuesEqual(focusedValue, tab.getValue()) && tab.isDisabledInContext()) {
212
+ this.focusedValue = this.resolveNeighborForDisabledTab(tab);
213
+ }
214
+ this.syncStateFromRegistry();
215
+ }
216
+ registerPanel(panel) {
217
+ this.panels.add(panel);
218
+ }
219
+ unregisterPanel(panel) {
220
+ this.panels.delete(panel);
221
+ this.syncStateFromRegistry();
222
+ }
223
+ notifyPanelMutated() {
224
+ this.syncStateFromRegistry();
225
+ }
226
+ registerScrollPrevControl(control) {
227
+ this.scrollPrevControl = control;
228
+ }
229
+ unregisterScrollPrevControl(control) {
230
+ if (this.scrollPrevControl === control) {
231
+ this.scrollPrevControl = null;
232
+ }
233
+ }
234
+ registerScrollNextControl(control) {
235
+ this.scrollNextControl = control;
236
+ }
237
+ unregisterScrollNextControl(control) {
238
+ if (this.scrollNextControl === control) {
239
+ this.scrollNextControl = null;
240
+ }
241
+ }
242
+ registerTabList(tabList) {
243
+ this.tabList = tabList;
244
+ }
245
+ unregisterTabList(tabList) {
246
+ if (this.tabList !== tabList) {
247
+ return;
248
+ }
249
+ this.tabList = null;
250
+ }
251
+ onTabListScrolled() { }
252
+ onTabListFocused() {
253
+ if (this.disabled()) {
254
+ return;
255
+ }
256
+ const enabledTabs = this.getEnabledTabs();
257
+ if (enabledTabs.length === 0) {
258
+ return;
259
+ }
260
+ const currentTabStopValue = this.resolveCurrentTabStopValue(enabledTabs);
261
+ const currentTab = this.findEnabledTabByValue(currentTabStopValue, enabledTabs) ??
262
+ enabledTabs[0] ??
263
+ null;
264
+ if (currentTab === null) {
265
+ return;
266
+ }
267
+ currentTab.focusSelf();
268
+ }
269
+ handleTabListWheel(event) {
270
+ if (this.orientation() !== 'horizontal') {
271
+ return;
272
+ }
273
+ if (!this.isTabListOverflowing()) {
274
+ return;
275
+ }
276
+ const dominantDelta = Math.abs(event.deltaX) > Math.abs(event.deltaY) ? event.deltaX : event.deltaY;
277
+ if (dominantDelta === 0) {
278
+ return;
279
+ }
280
+ event.preventDefault();
281
+ this.scrollTabListBy(dominantDelta);
282
+ }
283
+ isScrollButtonHidden() {
284
+ return !this.shouldShowScrollButtons();
285
+ }
286
+ isScrollButtonDisabled(direction) {
287
+ if (this.isScrollButtonHidden()) {
288
+ return true;
289
+ }
290
+ const tabListElement = this.getTabListElement();
291
+ if (tabListElement === null) {
292
+ return true;
293
+ }
294
+ const maxScrollLeft = Math.max(0, tabListElement.scrollWidth - tabListElement.clientWidth);
295
+ if (direction === 'prev') {
296
+ return tabListElement.scrollLeft <= 0;
297
+ }
298
+ return tabListElement.scrollLeft >= maxScrollLeft;
299
+ }
300
+ onScrollButtonClick(direction, event) {
301
+ if (this.isScrollButtonDisabled(direction)) {
302
+ event.preventDefault();
303
+ return;
304
+ }
305
+ const delta = direction === 'prev' ? -this.resolveTabListScrollStep() : this.resolveTabListScrollStep();
306
+ this.scrollTabListBy(delta);
307
+ event.preventDefault();
308
+ }
309
+ getTabIndex(tab) {
310
+ if (this.disabled() || tab.isDisabledInContext()) {
311
+ return '-1';
312
+ }
313
+ const tabStop = this.resolveCurrentTabStopValue();
314
+ if (tabStop === null) {
315
+ return '-1';
316
+ }
317
+ return valuesEqual(tabStop, tab.getValue()) ? '0' : '-1';
318
+ }
319
+ isTabSelected(tab) {
320
+ const selectedValue = this.getEffectiveSelectedValue();
321
+ if (selectedValue === null) {
322
+ return false;
323
+ }
324
+ return valuesEqual(selectedValue, tab.getValue());
325
+ }
326
+ isTabFocused(tab) {
327
+ const tabStop = this.resolveCurrentTabStopValue();
328
+ return tabStop !== null && valuesEqual(tabStop, tab.getValue());
329
+ }
330
+ getPanelIdForTab(tab) {
331
+ const explicitPanelId = tab.getExplicitPanelId();
332
+ if (explicitPanelId !== null) {
333
+ return explicitPanelId;
334
+ }
335
+ const matchedPanel = this.findPanelByValue(tab.getValue());
336
+ if (matchedPanel !== null) {
337
+ return matchedPanel.getPanelId();
338
+ }
339
+ const tabs = this.getOrderedTabs();
340
+ const panels = this.getOrderedPanels();
341
+ const tabIndex = tabs.indexOf(tab);
342
+ if (tabIndex < 0) {
343
+ return null;
344
+ }
345
+ return panels[tabIndex]?.getPanelId() ?? null;
346
+ }
347
+ getTabIdForPanel(panel) {
348
+ const explicitLabelledById = panel.getExplicitLabelledById();
349
+ if (explicitLabelledById !== null) {
350
+ return explicitLabelledById;
351
+ }
352
+ const matchedTab = this.findTabByValue(panel.getValue());
353
+ if (matchedTab !== null) {
354
+ return matchedTab.getItemId();
355
+ }
356
+ const tabs = this.getOrderedTabs();
357
+ const panels = this.getOrderedPanels();
358
+ const panelIndex = panels.indexOf(panel);
359
+ if (panelIndex < 0) {
360
+ return null;
361
+ }
362
+ return tabs[panelIndex]?.getItemId() ?? null;
363
+ }
364
+ isPanelActive(panel) {
365
+ const selectedValue = this.getEffectiveSelectedValue();
366
+ if (selectedValue === null) {
367
+ return false;
368
+ }
369
+ return valuesEqual(selectedValue, panel.getValue());
370
+ }
371
+ isPanelMounted(panel) {
372
+ if (this.isPanelActive(panel)) {
373
+ panel.markActivated();
374
+ return true;
375
+ }
376
+ const keepAlive = panel.unmountOnExit() ? false : this.isKeepAliveEnabled();
377
+ if (!keepAlive) {
378
+ return false;
379
+ }
380
+ if (!this.isLazyEnabled()) {
381
+ return true;
382
+ }
383
+ return panel.hasActivated();
384
+ }
385
+ onTabFocused(tab, trigger) {
386
+ if (this.disabled() || tab.isDisabledInContext()) {
387
+ return;
388
+ }
389
+ this.setFocusedValue(tab.getValue(), trigger);
390
+ this.scrollTabIntoView(tab);
391
+ }
392
+ requestSelection(tab, trigger) {
393
+ if (this.disabled() || tab.isDisabledInContext()) {
394
+ return;
395
+ }
396
+ const nextValue = tab.getValue();
397
+ const previousValue = this.getEffectiveSelectedValue();
398
+ if (previousValue !== null && valuesEqual(previousValue, nextValue)) {
399
+ return;
400
+ }
401
+ if (!this.isControlled()) {
402
+ this.uncontrolledValue = nextValue;
403
+ this.hasUserSelection = true;
404
+ }
405
+ this.focusedValue = nextValue;
406
+ this.valueChange.emit(nextValue);
407
+ this.tabChange.emit({
408
+ value: nextValue,
409
+ previousValue,
410
+ trigger,
411
+ });
412
+ this.scrollTabIntoView(tab);
413
+ this.syncStateFromRegistry();
414
+ }
415
+ handleTabKeydown(tab, event) {
416
+ if (this.disabled() || tab.isDisabledInContext()) {
417
+ return;
418
+ }
419
+ const focusMove = this.resolveFocusMove(event.key);
420
+ if (focusMove !== null) {
421
+ event.preventDefault();
422
+ this.moveFocusByAction(tab, focusMove, 'keyboard');
423
+ return;
424
+ }
425
+ if (event.key !== 'Enter' && event.key !== ' ' && event.key !== 'Spacebar') {
426
+ return;
427
+ }
428
+ if (this.activation() === 'manual' || this.activation() === 'auto') {
429
+ event.preventDefault();
430
+ this.requestSelection(tab, 'keyboard');
431
+ }
432
+ }
433
+ resolveFocusMove(key) {
434
+ if (key === 'Home') {
435
+ return 'first';
436
+ }
437
+ if (key === 'End') {
438
+ return 'last';
439
+ }
440
+ if (this.orientation() === 'vertical') {
441
+ if (key === 'ArrowDown') {
442
+ return 'next';
443
+ }
444
+ if (key === 'ArrowUp') {
445
+ return 'prev';
446
+ }
447
+ return null;
448
+ }
449
+ if (key !== 'ArrowLeft' && key !== 'ArrowRight') {
450
+ return null;
451
+ }
452
+ const isRtl = this.resolveDirection() === 'rtl';
453
+ const moveToNext = key === (isRtl ? 'ArrowLeft' : 'ArrowRight');
454
+ return moveToNext ? 'next' : 'prev';
455
+ }
456
+ moveFocusByAction(sourceTab, action, trigger) {
457
+ const enabledTabs = this.getEnabledTabs();
458
+ if (enabledTabs.length === 0) {
459
+ return;
460
+ }
461
+ const currentIndex = enabledTabs.indexOf(sourceTab);
462
+ if (currentIndex < 0) {
463
+ return;
464
+ }
465
+ const nextTab = this.resolveFocusTarget(enabledTabs, currentIndex, action);
466
+ if (nextTab === null) {
467
+ return;
468
+ }
469
+ this.moveFocusToTab(nextTab, trigger);
470
+ if (this.activation() === 'auto') {
471
+ this.requestSelection(nextTab, trigger === 'programmatic' ? 'programmatic' : 'keyboard');
472
+ }
473
+ }
474
+ moveFocusToTab(tab, trigger) {
475
+ if (this.disabled() || tab.isDisabledInContext()) {
476
+ return;
477
+ }
478
+ this.setFocusedValue(tab.getValue(), trigger);
479
+ tab.focusSelf();
480
+ }
481
+ moveFocusFromCurrentTab(direction, trigger) {
482
+ const enabledTabs = this.getEnabledTabs();
483
+ if (enabledTabs.length === 0) {
484
+ return;
485
+ }
486
+ const activeElement = this.hostRef.nativeElement.ownerDocument?.activeElement ?? null;
487
+ const activeTab = this.findTabContainingElement(activeElement);
488
+ const currentTab = activeTab ?? this.findEnabledTabByValue(this.resolveCurrentTabStopValue(), enabledTabs);
489
+ if (currentTab === null) {
490
+ return;
491
+ }
492
+ const currentIndex = enabledTabs.indexOf(currentTab);
493
+ if (currentIndex < 0) {
494
+ return;
495
+ }
496
+ const nextTab = this.resolveFocusTarget(enabledTabs, currentIndex, direction);
497
+ if (nextTab === null) {
498
+ return;
499
+ }
500
+ this.moveFocusToTab(nextTab, trigger);
501
+ if (this.activation() === 'auto') {
502
+ this.requestSelection(nextTab, trigger === 'programmatic' ? 'programmatic' : 'keyboard');
503
+ }
504
+ }
505
+ resolveFocusTarget(enabledTabs, currentIndex, action) {
506
+ if (enabledTabs.length === 0 || currentIndex < 0) {
507
+ return null;
508
+ }
509
+ if (action === 'first') {
510
+ return enabledTabs[0] ?? null;
511
+ }
512
+ if (action === 'last') {
513
+ return enabledTabs[enabledTabs.length - 1] ?? null;
514
+ }
515
+ if (action === 'next') {
516
+ if (currentIndex + 1 < enabledTabs.length) {
517
+ return enabledTabs[currentIndex + 1] ?? null;
518
+ }
519
+ return this.loop() ? (enabledTabs[0] ?? null) : (enabledTabs[currentIndex] ?? null);
520
+ }
521
+ if (currentIndex - 1 >= 0) {
522
+ return enabledTabs[currentIndex - 1] ?? null;
523
+ }
524
+ return this.loop()
525
+ ? (enabledTabs[enabledTabs.length - 1] ?? null)
526
+ : (enabledTabs[currentIndex] ?? null);
527
+ }
528
+ setFocusedValue(value, trigger) {
529
+ const previousValue = this.focusedValue;
530
+ if (previousValue !== null && valuesEqual(previousValue, value)) {
531
+ return;
532
+ }
533
+ this.focusedValue = value;
534
+ this.focusChange.emit({
535
+ value,
536
+ previousValue,
537
+ trigger,
538
+ });
539
+ }
540
+ applyLifecycleSelection(nextValue) {
541
+ if (this.isControlled()) {
542
+ return;
543
+ }
544
+ this.uncontrolledValue = nextValue;
545
+ if (nextValue !== null) {
546
+ this.focusedValue = nextValue;
547
+ }
548
+ }
549
+ resolveDirection() {
550
+ const configuredDirection = this.dir();
551
+ if (configuredDirection !== 'auto') {
552
+ return configuredDirection;
553
+ }
554
+ const host = this.hostRef.nativeElement;
555
+ const nearestDirection = host.closest('[dir]')?.getAttribute('dir') ??
556
+ host.ownerDocument?.documentElement.getAttribute('dir');
557
+ return nearestDirection?.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
558
+ }
559
+ getSelectedValue() {
560
+ if (this.isControlled()) {
561
+ return this.value();
562
+ }
563
+ return this.uncontrolledValue;
564
+ }
565
+ getEffectiveSelectedValue(enabledTabs = this.getEnabledTabs()) {
566
+ if (enabledTabs.length === 0) {
567
+ return null;
568
+ }
569
+ const selectedValue = this.getSelectedValue();
570
+ if (selectedValue !== null && this.findEnabledTabByValue(selectedValue, enabledTabs) !== null) {
571
+ return selectedValue;
572
+ }
573
+ return enabledTabs[0]?.getValue() ?? null;
574
+ }
575
+ resolveCurrentTabStopValue(enabledTabs = this.getEnabledTabs()) {
576
+ if (enabledTabs.length === 0) {
577
+ return null;
578
+ }
579
+ if (this.focusedValue !== null && this.findEnabledTabByValue(this.focusedValue, enabledTabs) !== null) {
580
+ return this.focusedValue;
581
+ }
582
+ const selectedValue = this.getEffectiveSelectedValue(enabledTabs);
583
+ if (selectedValue !== null) {
584
+ return selectedValue;
585
+ }
586
+ return enabledTabs[0]?.getValue() ?? null;
587
+ }
588
+ syncStateFromRegistry() {
589
+ const enabledTabs = this.getEnabledTabs();
590
+ if (!this.initialized) {
591
+ this.initialized = true;
592
+ if (!this.isControlled()) {
593
+ const defaultValue = this.defaultValue();
594
+ if (defaultValue !== undefined && defaultValue !== null) {
595
+ this.uncontrolledValue = this.findEnabledTabByValue(defaultValue, enabledTabs)?.getValue() ?? null;
596
+ }
597
+ else {
598
+ this.uncontrolledValue = enabledTabs[0]?.getValue() ?? null;
599
+ }
600
+ }
601
+ }
602
+ if (enabledTabs.length === 0) {
603
+ if (!this.isControlled()) {
604
+ this.uncontrolledValue = null;
605
+ }
606
+ this.focusedValue = null;
607
+ return;
608
+ }
609
+ if (!this.isControlled()) {
610
+ const defaultValue = this.defaultValue();
611
+ if (!this.hasUserSelection && defaultValue !== undefined && defaultValue !== null) {
612
+ const defaultTab = this.findEnabledTabByValue(defaultValue, enabledTabs);
613
+ if (defaultTab !== null) {
614
+ this.uncontrolledValue = defaultTab.getValue();
615
+ }
616
+ else if (this.uncontrolledValue === null) {
617
+ this.uncontrolledValue = enabledTabs[0]?.getValue() ?? null;
618
+ }
619
+ }
620
+ else {
621
+ const current = this.uncontrolledValue;
622
+ if (current === null || this.findEnabledTabByValue(current, enabledTabs) === null) {
623
+ this.uncontrolledValue = enabledTabs[0]?.getValue() ?? null;
624
+ }
625
+ }
626
+ }
627
+ const selectedValue = this.getEffectiveSelectedValue(enabledTabs);
628
+ if (selectedValue !== null) {
629
+ this.findPanelByValue(selectedValue)?.markActivated();
630
+ }
631
+ this.focusedValue = this.resolveCurrentTabStopValue(enabledTabs);
632
+ }
633
+ resolveNeighborValueOnRemoval(orderedTabs, removedIndex) {
634
+ if (removedIndex < 0) {
635
+ return this.getEnabledTabs()[0]?.getValue() ?? null;
636
+ }
637
+ for (let index = removedIndex + 1; index < orderedTabs.length; index += 1) {
638
+ const candidate = orderedTabs[index];
639
+ if (candidate !== undefined && !candidate.isDisabledInContext()) {
640
+ return candidate.getValue();
641
+ }
642
+ }
643
+ for (let index = removedIndex - 1; index >= 0; index -= 1) {
644
+ const candidate = orderedTabs[index];
645
+ if (candidate !== undefined && !candidate.isDisabledInContext()) {
646
+ return candidate.getValue();
647
+ }
648
+ }
649
+ return null;
650
+ }
651
+ resolveNeighborForDisabledTab(tab) {
652
+ const orderedTabs = this.getOrderedTabs();
653
+ const currentIndex = orderedTabs.indexOf(tab);
654
+ if (currentIndex < 0) {
655
+ return this.getEnabledTabs()[0]?.getValue() ?? null;
656
+ }
657
+ for (let index = currentIndex - 1; index >= 0; index -= 1) {
658
+ const candidate = orderedTabs[index];
659
+ if (candidate !== undefined && !candidate.isDisabledInContext()) {
660
+ return candidate.getValue();
661
+ }
662
+ }
663
+ for (let index = currentIndex + 1; index < orderedTabs.length; index += 1) {
664
+ const candidate = orderedTabs[index];
665
+ if (candidate !== undefined && !candidate.isDisabledInContext()) {
666
+ return candidate.getValue();
667
+ }
668
+ }
669
+ return null;
670
+ }
671
+ isControlled() {
672
+ const value = this.value();
673
+ return value !== undefined && value !== null;
674
+ }
675
+ getOrderedTabs() {
676
+ const tabs = Array.from(this.tabs);
677
+ tabs.sort((a, b) => compareByDomPosition(a.getHostElement(), b.getHostElement(), a.getRegistrationOrder(), b.getRegistrationOrder()));
678
+ return tabs;
679
+ }
680
+ getEnabledTabs() {
681
+ return this.getOrderedTabs().filter((tab) => !tab.isDisabledInContext());
682
+ }
683
+ getOrderedPanels() {
684
+ const panels = Array.from(this.panels);
685
+ panels.sort((a, b) => compareByDomPosition(a.getHostElement(), b.getHostElement(), a.getRegistrationOrder(), b.getRegistrationOrder()));
686
+ return panels;
687
+ }
688
+ findTabByValue(value) {
689
+ if (value === null) {
690
+ return null;
691
+ }
692
+ const tabs = this.getOrderedTabs();
693
+ return tabs.find((tab) => valuesEqual(tab.getValue(), value)) ?? null;
694
+ }
695
+ findEnabledTabByValue(value, enabledTabs = this.getEnabledTabs()) {
696
+ if (value === null) {
697
+ return null;
698
+ }
699
+ return enabledTabs.find((tab) => valuesEqual(tab.getValue(), value)) ?? null;
700
+ }
701
+ findPanelByValue(value) {
702
+ if (value === null) {
703
+ return null;
704
+ }
705
+ const panels = this.getOrderedPanels();
706
+ return panels.find((panel) => valuesEqual(panel.getValue(), value)) ?? null;
707
+ }
708
+ findTabContainingElement(element) {
709
+ if (element === null) {
710
+ return null;
711
+ }
712
+ const tabs = this.getOrderedTabs();
713
+ return (tabs.find((tab) => {
714
+ const host = tab.getHostElement();
715
+ return host === element || host.contains(element);
716
+ }) ?? null);
717
+ }
718
+ getTabListElement() {
719
+ return this.tabList?.getHostElement() ?? null;
720
+ }
721
+ isTabListOverflowing() {
722
+ const tabListElement = this.getTabListElement();
723
+ if (tabListElement === null) {
724
+ return false;
725
+ }
726
+ return tabListElement.scrollWidth > tabListElement.clientWidth;
727
+ }
728
+ shouldShowScrollButtons() {
729
+ if (this.scrollPrevControl === null && this.scrollNextControl === null) {
730
+ return false;
731
+ }
732
+ const mode = this.scrollButtons();
733
+ if (mode === 'on') {
734
+ return true;
735
+ }
736
+ if (mode !== 'auto') {
737
+ return false;
738
+ }
739
+ return this.isTabListOverflowing();
740
+ }
741
+ resolveTabListScrollStep() {
742
+ const tabListElement = this.getTabListElement();
743
+ if (tabListElement === null) {
744
+ return 120;
745
+ }
746
+ return Math.max(80, Math.round(tabListElement.clientWidth * 0.7));
747
+ }
748
+ scrollTabListBy(delta) {
749
+ const tabListElement = this.getTabListElement();
750
+ if (tabListElement === null || delta === 0) {
751
+ return;
752
+ }
753
+ tabListElement.scrollLeft += delta;
754
+ }
755
+ scrollTabIntoView(tab) {
756
+ if (!this.isTabListOverflowing()) {
757
+ return;
758
+ }
759
+ const host = tab.getHostElement();
760
+ const scrollIntoView = host.scrollIntoView;
761
+ if (typeof scrollIntoView !== 'function') {
762
+ return;
763
+ }
764
+ scrollIntoView.call(host, {
765
+ block: 'nearest',
766
+ inline: 'nearest',
767
+ });
768
+ }
769
+ };
770
+ __decorate([
771
+ HostBinding('attr.data-slot')
772
+ ], TngTabs.prototype, "dataSlot", void 0);
773
+ __decorate([
774
+ HostBinding('attr.data-orientation')
775
+ ], TngTabs.prototype, "dataOrientation", null);
776
+ __decorate([
777
+ HostBinding('attr.data-activation')
778
+ ], TngTabs.prototype, "dataActivation", null);
779
+ __decorate([
780
+ HostBinding('attr.data-disabled')
781
+ ], TngTabs.prototype, "dataDisabled", null);
782
+ TngTabs = __decorate([
783
+ Directive({
784
+ selector: '[tngTabs]',
785
+ exportAs: 'tngTabs',
786
+ standalone: true,
787
+ })
788
+ ], TngTabs);
789
+ export { TngTabs };
790
+ let TngTabList = class TngTabList {
791
+ hostRef = inject(ElementRef);
792
+ tabs = inject(TngTabs, { host: true });
793
+ ariaLabel = input(undefined, {
794
+ alias: 'ariaLabel',
795
+ transform: normalizeOptionalStringInput,
796
+ });
797
+ ariaLabelledby = input(undefined, {
798
+ alias: 'ariaLabelledby',
799
+ transform: normalizeOptionalStringInput,
800
+ });
801
+ dataSlot = 'tab-list';
802
+ role = 'tablist';
803
+ tabIndex = '-1';
804
+ get ariaOrientation() {
805
+ return this.tabs.orientation();
806
+ }
807
+ get hostAriaLabel() {
808
+ return this.ariaLabel() ?? null;
809
+ }
810
+ get hostAriaLabelledby() {
811
+ return this.ariaLabelledby() ?? null;
812
+ }
813
+ constructor() {
814
+ this.tabs.registerTabList(this);
815
+ }
816
+ ngOnDestroy() {
817
+ this.tabs.unregisterTabList(this);
818
+ }
819
+ onWheel(event) {
820
+ this.tabs.handleTabListWheel(event);
821
+ }
822
+ onScroll() {
823
+ this.tabs.onTabListScrolled();
824
+ }
825
+ onFocus() {
826
+ this.tabs.onTabListFocused();
827
+ }
828
+ getHostElement() {
829
+ return this.hostRef.nativeElement;
830
+ }
831
+ };
832
+ __decorate([
833
+ HostBinding('attr.data-slot')
834
+ ], TngTabList.prototype, "dataSlot", void 0);
835
+ __decorate([
836
+ HostBinding('attr.role')
837
+ ], TngTabList.prototype, "role", void 0);
838
+ __decorate([
839
+ HostBinding('attr.tabindex')
840
+ ], TngTabList.prototype, "tabIndex", void 0);
841
+ __decorate([
842
+ HostBinding('attr.aria-orientation')
843
+ ], TngTabList.prototype, "ariaOrientation", null);
844
+ __decorate([
845
+ HostBinding('attr.aria-label')
846
+ ], TngTabList.prototype, "hostAriaLabel", null);
847
+ __decorate([
848
+ HostBinding('attr.aria-labelledby')
849
+ ], TngTabList.prototype, "hostAriaLabelledby", null);
850
+ __decorate([
851
+ HostListener('wheel', ['$event'])
852
+ ], TngTabList.prototype, "onWheel", null);
853
+ __decorate([
854
+ HostListener('scroll')
855
+ ], TngTabList.prototype, "onScroll", null);
856
+ __decorate([
857
+ HostListener('focus')
858
+ ], TngTabList.prototype, "onFocus", null);
859
+ TngTabList = __decorate([
860
+ Directive({
861
+ selector: '[tngTabList]',
862
+ exportAs: 'tngTabList',
863
+ standalone: true,
864
+ })
865
+ ], TngTabList);
866
+ export { TngTabList };
867
+ let TngTabsScrollButtonPrev = class TngTabsScrollButtonPrev {
868
+ tabs = inject(TngTabs, { host: true });
869
+ dataSlot = 'tabs-scroll-button-prev';
870
+ get hidden() {
871
+ return this.tabs.isScrollButtonHidden() ? '' : null;
872
+ }
873
+ get disabled() {
874
+ return this.tabs.isScrollButtonDisabled('prev') ? '' : null;
875
+ }
876
+ get ariaDisabled() {
877
+ return this.tabs.isScrollButtonDisabled('prev') ? 'true' : null;
878
+ }
879
+ get dataDisabled() {
880
+ return this.tabs.isScrollButtonDisabled('prev') ? 'true' : 'false';
881
+ }
882
+ constructor() {
883
+ this.tabs.registerScrollPrevControl(this);
884
+ }
885
+ ngOnDestroy() {
886
+ this.tabs.unregisterScrollPrevControl(this);
887
+ }
888
+ onClick(event) {
889
+ this.tabs.onScrollButtonClick('prev', event);
890
+ }
891
+ };
892
+ __decorate([
893
+ HostBinding('attr.data-slot')
894
+ ], TngTabsScrollButtonPrev.prototype, "dataSlot", void 0);
895
+ __decorate([
896
+ HostBinding('attr.hidden')
897
+ ], TngTabsScrollButtonPrev.prototype, "hidden", null);
898
+ __decorate([
899
+ HostBinding('attr.disabled')
900
+ ], TngTabsScrollButtonPrev.prototype, "disabled", null);
901
+ __decorate([
902
+ HostBinding('attr.aria-disabled')
903
+ ], TngTabsScrollButtonPrev.prototype, "ariaDisabled", null);
904
+ __decorate([
905
+ HostBinding('attr.data-disabled')
906
+ ], TngTabsScrollButtonPrev.prototype, "dataDisabled", null);
907
+ __decorate([
908
+ HostListener('click', ['$event'])
909
+ ], TngTabsScrollButtonPrev.prototype, "onClick", null);
910
+ TngTabsScrollButtonPrev = __decorate([
911
+ Directive({
912
+ selector: '[tngTabsScrollButtonPrev]',
913
+ exportAs: 'tngTabsScrollButtonPrev',
914
+ standalone: true,
915
+ })
916
+ ], TngTabsScrollButtonPrev);
917
+ export { TngTabsScrollButtonPrev };
918
+ let TngTabsScrollButtonNext = class TngTabsScrollButtonNext {
919
+ tabs = inject(TngTabs, { host: true });
920
+ dataSlot = 'tabs-scroll-button-next';
921
+ get hidden() {
922
+ return this.tabs.isScrollButtonHidden() ? '' : null;
923
+ }
924
+ get disabled() {
925
+ return this.tabs.isScrollButtonDisabled('next') ? '' : null;
926
+ }
927
+ get ariaDisabled() {
928
+ return this.tabs.isScrollButtonDisabled('next') ? 'true' : null;
929
+ }
930
+ get dataDisabled() {
931
+ return this.tabs.isScrollButtonDisabled('next') ? 'true' : 'false';
932
+ }
933
+ constructor() {
934
+ this.tabs.registerScrollNextControl(this);
935
+ }
936
+ ngOnDestroy() {
937
+ this.tabs.unregisterScrollNextControl(this);
938
+ }
939
+ onClick(event) {
940
+ this.tabs.onScrollButtonClick('next', event);
941
+ }
942
+ };
943
+ __decorate([
944
+ HostBinding('attr.data-slot')
945
+ ], TngTabsScrollButtonNext.prototype, "dataSlot", void 0);
946
+ __decorate([
947
+ HostBinding('attr.hidden')
948
+ ], TngTabsScrollButtonNext.prototype, "hidden", null);
949
+ __decorate([
950
+ HostBinding('attr.disabled')
951
+ ], TngTabsScrollButtonNext.prototype, "disabled", null);
952
+ __decorate([
953
+ HostBinding('attr.aria-disabled')
954
+ ], TngTabsScrollButtonNext.prototype, "ariaDisabled", null);
955
+ __decorate([
956
+ HostBinding('attr.data-disabled')
957
+ ], TngTabsScrollButtonNext.prototype, "dataDisabled", null);
958
+ __decorate([
959
+ HostListener('click', ['$event'])
960
+ ], TngTabsScrollButtonNext.prototype, "onClick", null);
961
+ TngTabsScrollButtonNext = __decorate([
962
+ Directive({
963
+ selector: '[tngTabsScrollButtonNext]',
964
+ exportAs: 'tngTabsScrollButtonNext',
965
+ standalone: true,
966
+ })
967
+ ], TngTabsScrollButtonNext);
968
+ export { TngTabsScrollButtonNext };
969
+ let TngTab = class TngTab {
970
+ hostRef = inject(ElementRef);
971
+ tabs = inject(TngTabs, { host: true });
972
+ resolvedId = createTabId();
973
+ registrationOrder = nextRegistrationOrder++;
974
+ lastKnownValue = null;
975
+ lastKnownDisabled = false;
976
+ valueInput = input(undefined, {
977
+ alias: 'value',
978
+ transform: normalizeOptionalValueInput,
979
+ });
980
+ disabledInput = input(false, {
981
+ alias: 'disabled',
982
+ transform: normalizeBooleanInput,
983
+ });
984
+ panelId = input(undefined, {
985
+ alias: 'panelId',
986
+ transform: normalizeOptionalStringInput,
987
+ });
988
+ dataSlot = 'tab';
989
+ role = 'tab';
990
+ get id() {
991
+ return this.resolvedId;
992
+ }
993
+ get tabIndex() {
994
+ return this.tabs.getTabIndex(this);
995
+ }
996
+ get ariaSelected() {
997
+ return this.tabs.isTabSelected(this) ? 'true' : 'false';
998
+ }
999
+ get ariaControls() {
1000
+ return this.tabs.getPanelIdForTab(this);
1001
+ }
1002
+ get ariaDisabled() {
1003
+ return this.isDisabledInContext() ? 'true' : null;
1004
+ }
1005
+ get hostDisabled() {
1006
+ return this.isDisabledInContext() ? '' : null;
1007
+ }
1008
+ get dataSelected() {
1009
+ return this.tabs.isTabSelected(this) ? 'true' : 'false';
1010
+ }
1011
+ get dataFocused() {
1012
+ return this.tabs.isTabFocused(this) ? 'true' : 'false';
1013
+ }
1014
+ get dataDisabled() {
1015
+ return this.isDisabledInContext() ? 'true' : 'false';
1016
+ }
1017
+ constructor() {
1018
+ this.tabs.registerTab(this);
1019
+ }
1020
+ ngOnInit() {
1021
+ this.syncResolvedIdFromHost();
1022
+ this.lastKnownValue = this.getValue();
1023
+ this.lastKnownDisabled = this.isDisabledInContext();
1024
+ }
1025
+ ngDoCheck() {
1026
+ const idChanged = this.syncResolvedIdFromHost();
1027
+ const currentValue = this.getValue();
1028
+ const currentDisabled = this.isDisabledInContext();
1029
+ if (idChanged ||
1030
+ !valuesEqual(this.lastKnownValue, currentValue) ||
1031
+ this.lastKnownDisabled !== currentDisabled) {
1032
+ this.lastKnownValue = currentValue;
1033
+ this.lastKnownDisabled = currentDisabled;
1034
+ this.tabs.notifyTabMutated(this);
1035
+ }
1036
+ }
1037
+ ngOnDestroy() {
1038
+ this.tabs.unregisterTab(this);
1039
+ }
1040
+ onClick(event) {
1041
+ if (this.isDisabledInContext()) {
1042
+ event.preventDefault();
1043
+ return;
1044
+ }
1045
+ const target = event.target;
1046
+ if (target instanceof Element && target !== this.hostRef.nativeElement) {
1047
+ if (isFocusableInteractiveElement(target) && this.hostRef.nativeElement.contains(target)) {
1048
+ return;
1049
+ }
1050
+ }
1051
+ this.focusSelf();
1052
+ this.tabs.requestSelection(this, 'pointer');
1053
+ }
1054
+ onFocus() {
1055
+ if (this.isDisabledInContext()) {
1056
+ return;
1057
+ }
1058
+ this.tabs.onTabFocused(this, 'pointer');
1059
+ }
1060
+ onKeydown(event) {
1061
+ this.tabs.handleTabKeydown(this, event);
1062
+ }
1063
+ getRegistrationOrder() {
1064
+ return this.registrationOrder;
1065
+ }
1066
+ getHostElement() {
1067
+ return this.hostRef.nativeElement;
1068
+ }
1069
+ getItemId() {
1070
+ return this.resolvedId;
1071
+ }
1072
+ getValue() {
1073
+ const explicitValue = this.valueInput();
1074
+ if (explicitValue !== undefined && explicitValue !== null) {
1075
+ return explicitValue;
1076
+ }
1077
+ const hostValue = this.hostRef.nativeElement.getAttribute('value');
1078
+ if (hostValue !== null && hostValue.length > 0) {
1079
+ return hostValue;
1080
+ }
1081
+ return this.resolvedId;
1082
+ }
1083
+ getExplicitPanelId() {
1084
+ return this.panelId() ?? null;
1085
+ }
1086
+ isDisabledInContext() {
1087
+ if (this.tabs.isDisabled()) {
1088
+ return true;
1089
+ }
1090
+ return this.disabledInput();
1091
+ }
1092
+ focusSelf() {
1093
+ this.hostRef.nativeElement.focus();
1094
+ }
1095
+ syncResolvedIdFromHost() {
1096
+ const hostId = this.hostRef.nativeElement.getAttribute('id');
1097
+ if (hostId === null || hostId.length === 0 || hostId === this.resolvedId) {
1098
+ return false;
1099
+ }
1100
+ this.resolvedId = hostId;
1101
+ return true;
1102
+ }
1103
+ };
1104
+ __decorate([
1105
+ HostBinding('attr.data-slot')
1106
+ ], TngTab.prototype, "dataSlot", void 0);
1107
+ __decorate([
1108
+ HostBinding('attr.role')
1109
+ ], TngTab.prototype, "role", void 0);
1110
+ __decorate([
1111
+ HostBinding('attr.id')
1112
+ ], TngTab.prototype, "id", null);
1113
+ __decorate([
1114
+ HostBinding('attr.tabindex')
1115
+ ], TngTab.prototype, "tabIndex", null);
1116
+ __decorate([
1117
+ HostBinding('attr.aria-selected')
1118
+ ], TngTab.prototype, "ariaSelected", null);
1119
+ __decorate([
1120
+ HostBinding('attr.aria-controls')
1121
+ ], TngTab.prototype, "ariaControls", null);
1122
+ __decorate([
1123
+ HostBinding('attr.aria-disabled')
1124
+ ], TngTab.prototype, "ariaDisabled", null);
1125
+ __decorate([
1126
+ HostBinding('attr.disabled')
1127
+ ], TngTab.prototype, "hostDisabled", null);
1128
+ __decorate([
1129
+ HostBinding('attr.data-selected')
1130
+ ], TngTab.prototype, "dataSelected", null);
1131
+ __decorate([
1132
+ HostBinding('attr.data-focused')
1133
+ ], TngTab.prototype, "dataFocused", null);
1134
+ __decorate([
1135
+ HostBinding('attr.data-disabled')
1136
+ ], TngTab.prototype, "dataDisabled", null);
1137
+ __decorate([
1138
+ HostListener('click', ['$event'])
1139
+ ], TngTab.prototype, "onClick", null);
1140
+ __decorate([
1141
+ HostListener('focus')
1142
+ ], TngTab.prototype, "onFocus", null);
1143
+ __decorate([
1144
+ HostListener('keydown', ['$event'])
1145
+ ], TngTab.prototype, "onKeydown", null);
1146
+ TngTab = __decorate([
1147
+ Directive({
1148
+ selector: '[tngTab]',
1149
+ exportAs: 'tngTab',
1150
+ standalone: true,
1151
+ })
1152
+ ], TngTab);
1153
+ export { TngTab };
1154
+ let TngTabPanel = class TngTabPanel {
1155
+ hostRef = inject(ElementRef);
1156
+ tabs = inject(TngTabs, { host: true });
1157
+ resolvedId = createPanelId();
1158
+ registrationOrder = nextRegistrationOrder++;
1159
+ mounted = true;
1160
+ activated = false;
1161
+ anchor = null;
1162
+ lastKnownValue = null;
1163
+ valueInput = input(undefined, {
1164
+ alias: 'value',
1165
+ transform: normalizeOptionalValueInput,
1166
+ });
1167
+ labelledById = input(undefined, {
1168
+ alias: 'labelledById',
1169
+ transform: normalizeOptionalStringInput,
1170
+ });
1171
+ unmountOnExit = input(false, {
1172
+ alias: 'unmountOnExit',
1173
+ transform: normalizeBooleanInput,
1174
+ });
1175
+ dataSlot = 'tab-panel';
1176
+ role = 'tabpanel';
1177
+ get id() {
1178
+ return this.resolvedId;
1179
+ }
1180
+ get ariaLabelledby() {
1181
+ return this.getExplicitLabelledById() ?? this.tabs.getTabIdForPanel(this);
1182
+ }
1183
+ get hidden() {
1184
+ if (this.tabs.isPanelActive(this)) {
1185
+ this.markActivated();
1186
+ return null;
1187
+ }
1188
+ return '';
1189
+ }
1190
+ get dataActive() {
1191
+ return this.tabs.isPanelActive(this) ? 'true' : 'false';
1192
+ }
1193
+ constructor() {
1194
+ this.tabs.registerPanel(this);
1195
+ }
1196
+ ngOnInit() {
1197
+ this.syncResolvedIdFromHost();
1198
+ this.lastKnownValue = this.getValue();
1199
+ this.syncMountState();
1200
+ }
1201
+ ngDoCheck() {
1202
+ const idChanged = this.syncResolvedIdFromHost();
1203
+ const currentValue = this.getValue();
1204
+ if (idChanged || !valuesEqual(this.lastKnownValue, currentValue)) {
1205
+ this.lastKnownValue = currentValue;
1206
+ this.tabs.notifyPanelMutated();
1207
+ }
1208
+ this.syncMountState();
1209
+ }
1210
+ ngOnDestroy() {
1211
+ this.tabs.unregisterPanel(this);
1212
+ this.removeAnchor();
1213
+ }
1214
+ getRegistrationOrder() {
1215
+ return this.registrationOrder;
1216
+ }
1217
+ getHostElement() {
1218
+ return this.hostRef.nativeElement;
1219
+ }
1220
+ getPanelId() {
1221
+ return this.resolvedId;
1222
+ }
1223
+ getValue() {
1224
+ const explicitValue = this.valueInput();
1225
+ if (explicitValue !== undefined && explicitValue !== null) {
1226
+ return explicitValue;
1227
+ }
1228
+ const hostValue = this.hostRef.nativeElement.getAttribute('value');
1229
+ if (hostValue !== null && hostValue.length > 0) {
1230
+ return hostValue;
1231
+ }
1232
+ return this.resolvedId;
1233
+ }
1234
+ getExplicitLabelledById() {
1235
+ return this.labelledById() ?? null;
1236
+ }
1237
+ hasActivated() {
1238
+ return this.activated;
1239
+ }
1240
+ markActivated() {
1241
+ this.activated = true;
1242
+ }
1243
+ syncMountState() {
1244
+ const shouldMount = this.tabs.isPanelMounted(this);
1245
+ if (shouldMount) {
1246
+ this.mountHost();
1247
+ return;
1248
+ }
1249
+ this.unmountHost();
1250
+ }
1251
+ mountHost() {
1252
+ if (this.mounted) {
1253
+ return;
1254
+ }
1255
+ const anchor = this.ensureAnchor();
1256
+ const parent = anchor.parentNode;
1257
+ if (parent === null) {
1258
+ return;
1259
+ }
1260
+ parent.insertBefore(this.hostRef.nativeElement, anchor);
1261
+ this.mounted = true;
1262
+ }
1263
+ unmountHost() {
1264
+ if (!this.mounted) {
1265
+ return;
1266
+ }
1267
+ const host = this.hostRef.nativeElement;
1268
+ const parent = host.parentNode;
1269
+ if (parent === null) {
1270
+ return;
1271
+ }
1272
+ const anchor = this.ensureAnchor();
1273
+ if (anchor.parentNode !== parent) {
1274
+ parent.insertBefore(anchor, host);
1275
+ }
1276
+ parent.removeChild(host);
1277
+ this.mounted = false;
1278
+ if (!this.tabs.isKeepAliveEnabled() || this.unmountOnExit()) {
1279
+ this.resetTransientFormState();
1280
+ }
1281
+ }
1282
+ ensureAnchor() {
1283
+ if (this.anchor !== null) {
1284
+ return this.anchor;
1285
+ }
1286
+ this.anchor = this.hostRef.nativeElement.ownerDocument.createComment('tng-tab-panel');
1287
+ return this.anchor;
1288
+ }
1289
+ removeAnchor() {
1290
+ if (this.anchor === null) {
1291
+ return;
1292
+ }
1293
+ this.anchor.parentNode?.removeChild(this.anchor);
1294
+ this.anchor = null;
1295
+ }
1296
+ resetTransientFormState() {
1297
+ const controls = this.hostRef.nativeElement.querySelectorAll('input, textarea, select');
1298
+ controls.forEach((control) => {
1299
+ if (control instanceof HTMLInputElement) {
1300
+ if (control.type === 'checkbox' || control.type === 'radio') {
1301
+ control.checked = control.defaultChecked;
1302
+ }
1303
+ else {
1304
+ control.value = '';
1305
+ }
1306
+ return;
1307
+ }
1308
+ if (control instanceof HTMLTextAreaElement) {
1309
+ control.value = '';
1310
+ return;
1311
+ }
1312
+ control.selectedIndex = -1;
1313
+ });
1314
+ }
1315
+ syncResolvedIdFromHost() {
1316
+ const hostId = this.hostRef.nativeElement.getAttribute('id');
1317
+ if (hostId === null || hostId.length === 0 || hostId === this.resolvedId) {
1318
+ return false;
1319
+ }
1320
+ this.resolvedId = hostId;
1321
+ return true;
1322
+ }
1323
+ };
1324
+ __decorate([
1325
+ HostBinding('attr.data-slot')
1326
+ ], TngTabPanel.prototype, "dataSlot", void 0);
1327
+ __decorate([
1328
+ HostBinding('attr.role')
1329
+ ], TngTabPanel.prototype, "role", void 0);
1330
+ __decorate([
1331
+ HostBinding('attr.id')
1332
+ ], TngTabPanel.prototype, "id", null);
1333
+ __decorate([
1334
+ HostBinding('attr.aria-labelledby')
1335
+ ], TngTabPanel.prototype, "ariaLabelledby", null);
1336
+ __decorate([
1337
+ HostBinding('attr.hidden')
1338
+ ], TngTabPanel.prototype, "hidden", null);
1339
+ __decorate([
1340
+ HostBinding('attr.data-active')
1341
+ ], TngTabPanel.prototype, "dataActive", null);
1342
+ TngTabPanel = __decorate([
1343
+ Directive({
1344
+ selector: '[tngTabPanel]',
1345
+ exportAs: 'tngTabPanel',
1346
+ standalone: true,
1347
+ })
1348
+ ], TngTabPanel);
1349
+ export { TngTabPanel };
1350
+ //# sourceMappingURL=tng-tabs.js.map