@tectra-ng/ui 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -2
  3. package/amount/README.md +28 -0
  4. package/autocomplete/README.md +82 -0
  5. package/avatar/README.md +43 -0
  6. package/badge/README.md +19 -0
  7. package/button/README.md +46 -0
  8. package/button-group/README.md +8 -0
  9. package/card/README.md +30 -0
  10. package/cascade-select/README.md +49 -0
  11. package/checkbox/README.md +64 -0
  12. package/chip/README.md +38 -0
  13. package/chips-input/README.md +47 -0
  14. package/color-picker/README.md +43 -0
  15. package/confirm/README.md +46 -0
  16. package/country/README.md +23 -0
  17. package/country-select/README.md +39 -0
  18. package/dialog/README.md +84 -0
  19. package/divider/README.md +24 -0
  20. package/drawer/README.md +54 -0
  21. package/email-suggestion/README.md +20 -0
  22. package/fesm2022/tectra-ng-ui-amount.mjs +415 -0
  23. package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -0
  24. package/fesm2022/tectra-ng-ui-autocomplete.mjs +730 -0
  25. package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -0
  26. package/fesm2022/tectra-ng-ui-avatar.mjs +670 -0
  27. package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -0
  28. package/fesm2022/tectra-ng-ui-badge.mjs +191 -0
  29. package/fesm2022/tectra-ng-ui-badge.mjs.map +1 -0
  30. package/fesm2022/tectra-ng-ui-button-group.mjs +50 -0
  31. package/fesm2022/tectra-ng-ui-button-group.mjs.map +1 -0
  32. package/fesm2022/tectra-ng-ui-button.mjs +725 -0
  33. package/fesm2022/tectra-ng-ui-button.mjs.map +1 -0
  34. package/fesm2022/tectra-ng-ui-card.mjs +210 -0
  35. package/fesm2022/tectra-ng-ui-card.mjs.map +1 -0
  36. package/fesm2022/tectra-ng-ui-cascade-select.mjs +887 -0
  37. package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -0
  38. package/fesm2022/tectra-ng-ui-checkbox.mjs +1150 -0
  39. package/fesm2022/tectra-ng-ui-checkbox.mjs.map +1 -0
  40. package/fesm2022/tectra-ng-ui-chip.mjs +344 -0
  41. package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -0
  42. package/fesm2022/tectra-ng-ui-chips-input.mjs +649 -0
  43. package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -0
  44. package/fesm2022/tectra-ng-ui-color-picker.mjs +828 -0
  45. package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -0
  46. package/fesm2022/tectra-ng-ui-confirm.mjs +489 -0
  47. package/fesm2022/tectra-ng-ui-confirm.mjs.map +1 -0
  48. package/fesm2022/tectra-ng-ui-country-select.mjs +545 -0
  49. package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -0
  50. package/fesm2022/tectra-ng-ui-country.mjs +313 -0
  51. package/fesm2022/tectra-ng-ui-country.mjs.map +1 -0
  52. package/fesm2022/tectra-ng-ui-dialog.mjs +1539 -0
  53. package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -0
  54. package/fesm2022/tectra-ng-ui-divider.mjs +194 -0
  55. package/fesm2022/tectra-ng-ui-divider.mjs.map +1 -0
  56. package/fesm2022/tectra-ng-ui-drawer.mjs +540 -0
  57. package/fesm2022/tectra-ng-ui-drawer.mjs.map +1 -0
  58. package/fesm2022/tectra-ng-ui-email-suggestion.mjs +341 -0
  59. package/fesm2022/tectra-ng-ui-email-suggestion.mjs.map +1 -0
  60. package/fesm2022/tectra-ng-ui-field.mjs +492 -0
  61. package/fesm2022/tectra-ng-ui-field.mjs.map +1 -0
  62. package/fesm2022/tectra-ng-ui-fieldset.mjs +258 -0
  63. package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -0
  64. package/fesm2022/tectra-ng-ui-highlight-text.mjs +246 -0
  65. package/fesm2022/tectra-ng-ui-highlight-text.mjs.map +1 -0
  66. package/fesm2022/tectra-ng-ui-icon-field.mjs +478 -0
  67. package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -0
  68. package/fesm2022/tectra-ng-ui-input-group.mjs +113 -0
  69. package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -0
  70. package/fesm2022/tectra-ng-ui-input-mask.mjs +413 -0
  71. package/fesm2022/tectra-ng-ui-input-mask.mjs.map +1 -0
  72. package/fesm2022/tectra-ng-ui-input-number.mjs +1045 -0
  73. package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -0
  74. package/fesm2022/tectra-ng-ui-input-otp.mjs +553 -0
  75. package/fesm2022/tectra-ng-ui-input-otp.mjs.map +1 -0
  76. package/fesm2022/tectra-ng-ui-input.mjs +260 -0
  77. package/fesm2022/tectra-ng-ui-input.mjs.map +1 -0
  78. package/fesm2022/tectra-ng-ui-key-filter.mjs +185 -0
  79. package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -0
  80. package/fesm2022/tectra-ng-ui-knob.mjs +630 -0
  81. package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -0
  82. package/fesm2022/tectra-ng-ui-label.mjs +271 -0
  83. package/fesm2022/tectra-ng-ui-label.mjs.map +1 -0
  84. package/fesm2022/tectra-ng-ui-link.mjs +699 -0
  85. package/fesm2022/tectra-ng-ui-link.mjs.map +1 -0
  86. package/fesm2022/tectra-ng-ui-listbox.mjs +484 -0
  87. package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -0
  88. package/fesm2022/tectra-ng-ui-mention-textarea.mjs +717 -0
  89. package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -0
  90. package/fesm2022/tectra-ng-ui-menu.mjs +1484 -0
  91. package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -0
  92. package/fesm2022/tectra-ng-ui-message.mjs +975 -0
  93. package/fesm2022/tectra-ng-ui-message.mjs.map +1 -0
  94. package/fesm2022/tectra-ng-ui-multiselect.mjs +569 -0
  95. package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -0
  96. package/fesm2022/tectra-ng-ui-overlay-badge.mjs +345 -0
  97. package/fesm2022/tectra-ng-ui-overlay-badge.mjs.map +1 -0
  98. package/fesm2022/tectra-ng-ui-paginator.mjs +849 -0
  99. package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -0
  100. package/fesm2022/tectra-ng-ui-panel.mjs +317 -0
  101. package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -0
  102. package/fesm2022/tectra-ng-ui-password-generator.mjs +292 -0
  103. package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -0
  104. package/fesm2022/tectra-ng-ui-password.mjs +871 -0
  105. package/fesm2022/tectra-ng-ui-password.mjs.map +1 -0
  106. package/fesm2022/tectra-ng-ui-pill.mjs +361 -0
  107. package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -0
  108. package/fesm2022/tectra-ng-ui-popover.mjs +742 -0
  109. package/fesm2022/tectra-ng-ui-popover.mjs.map +1 -0
  110. package/fesm2022/tectra-ng-ui-progress-bar.mjs +440 -0
  111. package/fesm2022/tectra-ng-ui-progress-bar.mjs.map +1 -0
  112. package/fesm2022/tectra-ng-ui-progress-spinner.mjs +265 -0
  113. package/fesm2022/tectra-ng-ui-progress-spinner.mjs.map +1 -0
  114. package/fesm2022/tectra-ng-ui-radio-button.mjs +817 -0
  115. package/fesm2022/tectra-ng-ui-radio-button.mjs.map +1 -0
  116. package/fesm2022/tectra-ng-ui-rating.mjs +584 -0
  117. package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -0
  118. package/fesm2022/tectra-ng-ui-select.mjs +2478 -0
  119. package/fesm2022/tectra-ng-ui-select.mjs.map +1 -0
  120. package/fesm2022/tectra-ng-ui-skeleton.mjs +548 -0
  121. package/fesm2022/tectra-ng-ui-skeleton.mjs.map +1 -0
  122. package/fesm2022/tectra-ng-ui-slider.mjs +630 -0
  123. package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -0
  124. package/fesm2022/tectra-ng-ui-speed-dial.mjs +669 -0
  125. package/fesm2022/tectra-ng-ui-speed-dial.mjs.map +1 -0
  126. package/fesm2022/tectra-ng-ui-split-button.mjs +614 -0
  127. package/fesm2022/tectra-ng-ui-split-button.mjs.map +1 -0
  128. package/fesm2022/tectra-ng-ui-status-icon.mjs +295 -0
  129. package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -0
  130. package/fesm2022/tectra-ng-ui-table.mjs +5997 -0
  131. package/fesm2022/tectra-ng-ui-table.mjs.map +1 -0
  132. package/fesm2022/tectra-ng-ui-tag.mjs +422 -0
  133. package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -0
  134. package/fesm2022/tectra-ng-ui-textarea.mjs +482 -0
  135. package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -0
  136. package/fesm2022/tectra-ng-ui-toast.mjs +668 -0
  137. package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -0
  138. package/fesm2022/tectra-ng-ui-toggle-button.mjs +416 -0
  139. package/fesm2022/tectra-ng-ui-toggle-button.mjs.map +1 -0
  140. package/fesm2022/tectra-ng-ui-toggle-switch.mjs +560 -0
  141. package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -0
  142. package/fesm2022/tectra-ng-ui-tooltip.mjs +835 -0
  143. package/fesm2022/tectra-ng-ui-tooltip.mjs.map +1 -0
  144. package/fesm2022/tectra-ng-ui-tree-select.mjs +986 -0
  145. package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -0
  146. package/fesm2022/tectra-ng-ui.mjs +4 -0
  147. package/fesm2022/tectra-ng-ui.mjs.map +1 -0
  148. package/field/README.md +43 -0
  149. package/fieldset/README.md +36 -0
  150. package/highlight-text/README.md +20 -0
  151. package/icon-field/README.md +30 -0
  152. package/input/README.md +22 -0
  153. package/input-group/README.md +21 -0
  154. package/input-mask/README.md +30 -0
  155. package/input-number/README.md +61 -0
  156. package/input-otp/README.md +44 -0
  157. package/key-filter/README.md +31 -0
  158. package/knob/README.md +50 -0
  159. package/label/README.md +29 -0
  160. package/link/README.md +47 -0
  161. package/listbox/README.md +68 -0
  162. package/mention-textarea/README.md +47 -0
  163. package/menu/README.md +65 -0
  164. package/message/README.md +58 -0
  165. package/multiselect/README.md +85 -0
  166. package/overlay-badge/README.md +30 -0
  167. package/package.json +301 -3
  168. package/paginator/README.md +60 -0
  169. package/panel/README.md +45 -0
  170. package/password/README.md +60 -0
  171. package/password-generator/README.md +34 -0
  172. package/pill/README.md +42 -0
  173. package/popover/README.md +67 -0
  174. package/progress-bar/README.md +32 -0
  175. package/progress-spinner/README.md +22 -0
  176. package/radio-button/README.md +54 -0
  177. package/rating/README.md +49 -0
  178. package/select/README.md +78 -0
  179. package/skeleton/README.md +27 -0
  180. package/slider/README.md +48 -0
  181. package/speed-dial/README.md +49 -0
  182. package/split-button/README.md +45 -0
  183. package/status-icon/README.md +22 -0
  184. package/table/README.md +178 -0
  185. package/tag/README.md +42 -0
  186. package/textarea/README.md +37 -0
  187. package/toast/README.md +52 -0
  188. package/toggle-button/README.md +34 -0
  189. package/toggle-switch/README.md +49 -0
  190. package/tooltip/README.md +60 -0
  191. package/tree-select/README.md +49 -0
  192. package/types/tectra-ng-ui-amount.d.ts +135 -0
  193. package/types/tectra-ng-ui-amount.d.ts.map +1 -0
  194. package/types/tectra-ng-ui-autocomplete.d.ts +250 -0
  195. package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -0
  196. package/types/tectra-ng-ui-avatar.d.ts +289 -0
  197. package/types/tectra-ng-ui-avatar.d.ts.map +1 -0
  198. package/types/tectra-ng-ui-badge.d.ts +119 -0
  199. package/types/tectra-ng-ui-badge.d.ts.map +1 -0
  200. package/types/tectra-ng-ui-button-group.d.ts +6 -0
  201. package/types/tectra-ng-ui-button-group.d.ts.map +1 -0
  202. package/types/tectra-ng-ui-button.d.ts +466 -0
  203. package/types/tectra-ng-ui-button.d.ts.map +1 -0
  204. package/types/tectra-ng-ui-card.d.ts +71 -0
  205. package/types/tectra-ng-ui-card.d.ts.map +1 -0
  206. package/types/tectra-ng-ui-cascade-select.d.ts +244 -0
  207. package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -0
  208. package/types/tectra-ng-ui-checkbox.d.ts +450 -0
  209. package/types/tectra-ng-ui-checkbox.d.ts.map +1 -0
  210. package/types/tectra-ng-ui-chip.d.ts +106 -0
  211. package/types/tectra-ng-ui-chip.d.ts.map +1 -0
  212. package/types/tectra-ng-ui-chips-input.d.ts +187 -0
  213. package/types/tectra-ng-ui-chips-input.d.ts.map +1 -0
  214. package/types/tectra-ng-ui-color-picker.d.ts +237 -0
  215. package/types/tectra-ng-ui-color-picker.d.ts.map +1 -0
  216. package/types/tectra-ng-ui-confirm.d.ts +80 -0
  217. package/types/tectra-ng-ui-confirm.d.ts.map +1 -0
  218. package/types/tectra-ng-ui-country-select.d.ts +235 -0
  219. package/types/tectra-ng-ui-country-select.d.ts.map +1 -0
  220. package/types/tectra-ng-ui-country.d.ts +105 -0
  221. package/types/tectra-ng-ui-country.d.ts.map +1 -0
  222. package/types/tectra-ng-ui-dialog.d.ts +453 -0
  223. package/types/tectra-ng-ui-dialog.d.ts.map +1 -0
  224. package/types/tectra-ng-ui-divider.d.ts +70 -0
  225. package/types/tectra-ng-ui-divider.d.ts.map +1 -0
  226. package/types/tectra-ng-ui-drawer.d.ts +188 -0
  227. package/types/tectra-ng-ui-drawer.d.ts.map +1 -0
  228. package/types/tectra-ng-ui-email-suggestion.d.ts +84 -0
  229. package/types/tectra-ng-ui-email-suggestion.d.ts.map +1 -0
  230. package/types/tectra-ng-ui-field.d.ts +139 -0
  231. package/types/tectra-ng-ui-field.d.ts.map +1 -0
  232. package/types/tectra-ng-ui-fieldset.d.ts +74 -0
  233. package/types/tectra-ng-ui-fieldset.d.ts.map +1 -0
  234. package/types/tectra-ng-ui-highlight-text.d.ts +75 -0
  235. package/types/tectra-ng-ui-highlight-text.d.ts.map +1 -0
  236. package/types/tectra-ng-ui-icon-field.d.ts +77 -0
  237. package/types/tectra-ng-ui-icon-field.d.ts.map +1 -0
  238. package/types/tectra-ng-ui-input-group.d.ts +18 -0
  239. package/types/tectra-ng-ui-input-group.d.ts.map +1 -0
  240. package/types/tectra-ng-ui-input-mask.d.ts +91 -0
  241. package/types/tectra-ng-ui-input-mask.d.ts.map +1 -0
  242. package/types/tectra-ng-ui-input-number.d.ts +326 -0
  243. package/types/tectra-ng-ui-input-number.d.ts.map +1 -0
  244. package/types/tectra-ng-ui-input-otp.d.ts +173 -0
  245. package/types/tectra-ng-ui-input-otp.d.ts.map +1 -0
  246. package/types/tectra-ng-ui-input.d.ts +113 -0
  247. package/types/tectra-ng-ui-input.d.ts.map +1 -0
  248. package/types/tectra-ng-ui-key-filter.d.ts +43 -0
  249. package/types/tectra-ng-ui-key-filter.d.ts.map +1 -0
  250. package/types/tectra-ng-ui-knob.d.ts +207 -0
  251. package/types/tectra-ng-ui-knob.d.ts.map +1 -0
  252. package/types/tectra-ng-ui-label.d.ts +53 -0
  253. package/types/tectra-ng-ui-label.d.ts.map +1 -0
  254. package/types/tectra-ng-ui-link.d.ts +223 -0
  255. package/types/tectra-ng-ui-link.d.ts.map +1 -0
  256. package/types/tectra-ng-ui-listbox.d.ts +131 -0
  257. package/types/tectra-ng-ui-listbox.d.ts.map +1 -0
  258. package/types/tectra-ng-ui-mention-textarea.d.ts +169 -0
  259. package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -0
  260. package/types/tectra-ng-ui-menu.d.ts +512 -0
  261. package/types/tectra-ng-ui-menu.d.ts.map +1 -0
  262. package/types/tectra-ng-ui-message.d.ts +390 -0
  263. package/types/tectra-ng-ui-message.d.ts.map +1 -0
  264. package/types/tectra-ng-ui-multiselect.d.ts +216 -0
  265. package/types/tectra-ng-ui-multiselect.d.ts.map +1 -0
  266. package/types/tectra-ng-ui-overlay-badge.d.ts +104 -0
  267. package/types/tectra-ng-ui-overlay-badge.d.ts.map +1 -0
  268. package/types/tectra-ng-ui-paginator.d.ts +293 -0
  269. package/types/tectra-ng-ui-paginator.d.ts.map +1 -0
  270. package/types/tectra-ng-ui-panel.d.ts +133 -0
  271. package/types/tectra-ng-ui-panel.d.ts.map +1 -0
  272. package/types/tectra-ng-ui-password-generator.d.ts +80 -0
  273. package/types/tectra-ng-ui-password-generator.d.ts.map +1 -0
  274. package/types/tectra-ng-ui-password.d.ts +271 -0
  275. package/types/tectra-ng-ui-password.d.ts.map +1 -0
  276. package/types/tectra-ng-ui-pill.d.ts +167 -0
  277. package/types/tectra-ng-ui-pill.d.ts.map +1 -0
  278. package/types/tectra-ng-ui-popover.d.ts +244 -0
  279. package/types/tectra-ng-ui-popover.d.ts.map +1 -0
  280. package/types/tectra-ng-ui-progress-bar.d.ts +151 -0
  281. package/types/tectra-ng-ui-progress-bar.d.ts.map +1 -0
  282. package/types/tectra-ng-ui-progress-spinner.d.ts +95 -0
  283. package/types/tectra-ng-ui-progress-spinner.d.ts.map +1 -0
  284. package/types/tectra-ng-ui-radio-button.d.ts +380 -0
  285. package/types/tectra-ng-ui-radio-button.d.ts.map +1 -0
  286. package/types/tectra-ng-ui-rating.d.ts +195 -0
  287. package/types/tectra-ng-ui-rating.d.ts.map +1 -0
  288. package/types/tectra-ng-ui-select.d.ts +761 -0
  289. package/types/tectra-ng-ui-select.d.ts.map +1 -0
  290. package/types/tectra-ng-ui-skeleton.d.ts +182 -0
  291. package/types/tectra-ng-ui-skeleton.d.ts.map +1 -0
  292. package/types/tectra-ng-ui-slider.d.ts +220 -0
  293. package/types/tectra-ng-ui-slider.d.ts.map +1 -0
  294. package/types/tectra-ng-ui-speed-dial.d.ts +175 -0
  295. package/types/tectra-ng-ui-speed-dial.d.ts.map +1 -0
  296. package/types/tectra-ng-ui-split-button.d.ts +139 -0
  297. package/types/tectra-ng-ui-split-button.d.ts.map +1 -0
  298. package/types/tectra-ng-ui-status-icon.d.ts +105 -0
  299. package/types/tectra-ng-ui-status-icon.d.ts.map +1 -0
  300. package/types/tectra-ng-ui-table.d.ts +1301 -0
  301. package/types/tectra-ng-ui-table.d.ts.map +1 -0
  302. package/types/tectra-ng-ui-tag.d.ts +157 -0
  303. package/types/tectra-ng-ui-tag.d.ts.map +1 -0
  304. package/types/tectra-ng-ui-textarea.d.ts +146 -0
  305. package/types/tectra-ng-ui-textarea.d.ts.map +1 -0
  306. package/types/tectra-ng-ui-toast.d.ts +268 -0
  307. package/types/tectra-ng-ui-toast.d.ts.map +1 -0
  308. package/types/tectra-ng-ui-toggle-button.d.ts +184 -0
  309. package/types/tectra-ng-ui-toggle-button.d.ts.map +1 -0
  310. package/types/tectra-ng-ui-toggle-switch.d.ts +226 -0
  311. package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -0
  312. package/types/tectra-ng-ui-tooltip.d.ts +275 -0
  313. package/types/tectra-ng-ui-tooltip.d.ts.map +1 -0
  314. package/types/tectra-ng-ui-tree-select.d.ts +339 -0
  315. package/types/tectra-ng-ui-tree-select.d.ts.map +1 -0
  316. package/types/tectra-ng-ui.d.ts +2 -0
  317. package/types/tectra-ng-ui.d.ts.map +1 -0
@@ -0,0 +1,39 @@
1
+ # Country select
2
+
3
+ Pick one country or several. Built on `tx-select` and `tx-multiselect`: every ISO country by default (or your own list), names in the current tectra locale sorted for that language, flags, search by name or code, counts and hints, a virtual list for long lists. With several countries the field shows a few flags and "+N". The value is the code (or your `value`), an array with `multiple`.
4
+
5
+ ## Inputs
6
+ | Name | Description |
7
+ |---|---|
8
+ | options | Countries to offer: codes, or `{ code, value?, label?, count?, hint?, disabled? }`; all countries by default |
9
+ | multiple | Several countries; the value is an array |
10
+ | filter | Search by name or code (on by default) |
11
+ | sort | `name` (localized, by default) or `none` (keep the order of `options`) |
12
+ | shape | Flag shape: `rectangle` or `circle` |
13
+ | maxFlags | With `multiple`: flags shown in the field before "+N" |
14
+ | virtualScrollThreshold | Above this many countries the list is virtual |
15
+ | placeholder | Text shown while nothing is selected |
16
+ | showClear | Shows a button that clears the value |
17
+ | loading | Spinner instead of the dropdown icon |
18
+ | inputId | Id of the field for a `<label for>` |
19
+ | ariaLabel | Accessible name of the field |
20
+ | ariaLabelledBy | Id of the element that labels the field |
21
+ | size | `small`, `medium`, `large` |
22
+ | variant | `outlined` or `filled` |
23
+ | invalid | Red border and `aria-invalid`; follows the form control by default |
24
+ | readonly | Shows the value, does not open |
25
+ | dt | Design tokens of this instance (`select`) |
26
+ | unstyled | Removes the tectra styles |
27
+
28
+ ## Outputs
29
+ | Name | Description |
30
+ |---|---|
31
+ | changed | The user changed the value |
32
+
33
+ ## Keyboard
34
+ | Key | Action |
35
+ |---|---|
36
+ | Enter / Space | Opens the panel, picks (or toggles with `multiple`) the active country |
37
+ | ArrowDown / ArrowUp | Opens the panel, moves the active country |
38
+ | Letters | Typed in the search field: finds by name or code |
39
+ | Escape | Closes the panel |
@@ -0,0 +1,84 @@
1
+ # Dialog
2
+
3
+ A window over the page for a task that needs full attention — a form, a confirmation, details. Open a component from code with `TxDialogService`, or write the dialog in a template with `<tx-dialog [(visible)]>`.
4
+
5
+ ```ts
6
+ const ref = this.dialogs.open(RenameDialog, { data: { name: project.name }, size: 'small' });
7
+ ref.closed.subscribe((name) => name && this.rename(project, name));
8
+ ```
9
+
10
+ ```ts
11
+ @Component({
12
+ imports: [TxDialogHeader, TxDialogContent, TxDialogFooter, TxDialogClose, TxButton, TxInput, FormsModule],
13
+ template: `
14
+ <tx-dialog-header title="Rename project" />
15
+ <tx-dialog-content><input txInput aria-label="Name" [(ngModel)]="name" /></tx-dialog-content>
16
+ <tx-dialog-footer>
17
+ <button txButton severity="secondary" txDialogClose>Cancel</button>
18
+ <button txButton [txDialogClose]="name">Save</button>
19
+ </tx-dialog-footer>
20
+ `,
21
+ })
22
+ export class RenameDialog {
23
+ name = injectDialogData<{ name: string }>().name;
24
+ }
25
+ ```
26
+
27
+ `TxDialogService.open(component | template, config)` returns a `TxDialogRef`: `close(result?)` (asks `canClose` first), `closed` (the result, `undefined` when dismissed), `afterOpened`, `componentInstance`, `maximized()`, `toggleMaximize()`, `updateSize(width, height)`. Inside the dialog `injectDialogData<T>()` reads `data` and `injectDialogRef<R>()` gives the ref; `config.inputs` sets component inputs. `closeAll()` and `openDialogs()` cover every open dialog. Config: `data`, `inputs`, `size`, `width`, `minWidth`, `maxWidth`, `height`, `maxHeight`, `breakpoints` (`{ '960px': '90vw' }` — width below a viewport width), `position`, `drawer` / `drawerSize` (see Drawer), `modal`, `closable`, `closeOnEscape`, `dismissableMask`, `blockScroll`, `draggable`, `maximizable`, `autoFocus`, `restoreFocus`, `role`, `ariaLabel`, `ariaLabelledBy`, `ariaDescribedBy`, `panelClass`, `canClose`, `dt`, `unstyled`, `injector`, `viewContainerRef`.
28
+
29
+ Layout parts: `<tx-dialog-header title subtitle>` (names the dialog, close and maximize buttons, drag handle), `<tx-dialog-content>` (scrolls), `<tx-dialog-footer>` (actions side by side in equal widths), `[txDialogTitle]` for an own title element, `[txDialogClose]="result"` on any button.
30
+
31
+ ## Inputs
32
+ | Name | Description |
33
+ |---|---|
34
+ | visible | Two-way open state (`[(visible)]`) |
35
+ | header | Title; also names the dialog |
36
+ | subtitle | Second line under the title |
37
+ | size | `small` (500px), `medium` (700px, default), `large` (900px), `xlarge` (1100px), `fullscreen` |
38
+ | width | Own width (any CSS length), wins over `size` |
39
+ | height | Own height |
40
+ | breakpoints | Width per viewport width; by default `{ '960px': '500px', '640px': '90vw' }` |
41
+ | position | `center` (default), `top`, `bottom`, `left`, `right`, `top-left`, `top-right`, `bottom-left`, `bottom-right` |
42
+ | drawer | Slides in from `left`, `right`, `top` or `bottom` instead (see Drawer) |
43
+ | drawerSize | Drawer size: `small`, `medium`, `large`, `full` or a CSS length |
44
+ | modal | Dims the page and keeps focus inside (default on) |
45
+ | closable | Close button, Escape and a click on the mask close it (default on) |
46
+ | closeOnEscape | Overrides `closable` for Escape |
47
+ | dismissableMask | Overrides `closable` for a click on the mask |
48
+ | blockScroll | Stops the page from scrolling while open (default on, modal only) |
49
+ | draggable | The header moves the dialog |
50
+ | maximizable | Shows a maximize / restore button |
51
+ | autoFocus | `first` focusable field (default; content, then footer, then header), `dialog`, `none` or a CSS selector |
52
+ | restoreFocus | Focus goes back to the element that opened it (default on) |
53
+ | role | `dialog` or `alertdialog` |
54
+ | ariaLabel | Name when there is no header |
55
+ | panelClass | Class on the dialog panel |
56
+ | canClose | Asked before closing; return `false` (or a promise of it) to keep the dialog open |
57
+ | dt | Design tokens of this dialog (`dialog`) |
58
+ | unstyled | Removes the tectra styles |
59
+ | title | `tx-dialog-header`: title text |
60
+ | closeButton | `tx-dialog-header`: shows the close button (default from `closable`) |
61
+ | maximizeButton | `tx-dialog-header`: shows the maximize button (default from `maximizable`) |
62
+ | txDialogClose | Value the dialog closes with when the element is clicked |
63
+
64
+ ## Outputs
65
+ | Name | Description |
66
+ |---|---|
67
+ | opened | The dialog opened |
68
+ | closed | The dialog closed |
69
+ | visibleChange | `visible` changed |
70
+
71
+ ## Slots
72
+ | Name | Description |
73
+ |---|---|
74
+ | default | Content of `<tx-dialog>`, placed in a scrolling `tx-dialog-content` |
75
+ | tx-dialog-header | Own header instead of `header` |
76
+ | tx-dialog-footer | Actions at the bottom |
77
+ | txDialogTitle | `<h2 txDialogTitle>` inside `tx-dialog-header` — own title element that names the dialog |
78
+
79
+ ## Keyboard
80
+ | Key | Action |
81
+ |---|---|
82
+ | Tab / Shift + Tab | Moves focus inside the dialog only; it wraps around |
83
+ | Escape | Closes the top dialog (when `closable`) |
84
+ | Enter / Space | Runs the focused button, e.g. a `txDialogClose` action |
@@ -0,0 +1,24 @@
1
+ # Divider
2
+
3
+ A line between groups of content — horizontal or vertical, solid, dashed or dotted, with an optional label in it.
4
+
5
+ ```html
6
+ <tx-divider>or continue with</tx-divider>
7
+ <tx-divider layout="vertical" />
8
+ ```
9
+
10
+ ## Inputs
11
+ | Name | Description |
12
+ |---|---|
13
+ | layout | `horizontal` or `vertical` |
14
+ | type | `solid`, `dashed` or `dotted` |
15
+ | align | Position of the content: `start`, `center`, `end` |
16
+ | dt | Design tokens of this instance (`divider`) |
17
+ | pt | Classes and styles of the parts: `root`, `content` |
18
+ | ptOptions | How `pt` merges with the global pass-through |
19
+ | unstyled | Removes the tectra styles |
20
+
21
+ ## Slots
22
+ | Name | Description |
23
+ |---|---|
24
+ | default | Text or an icon inside the line |
@@ -0,0 +1,54 @@
1
+ # Drawer
2
+
3
+ A panel that slides in from an edge of the screen — filters, details of a row, settings, navigation on small screens. It works like a dialog: focus stays inside, Escape and a click on the mask close it, focus goes back to the button.
4
+
5
+ ```html
6
+ <button txButton icon="filter" (click)="filters.set(true)">Filters</button>
7
+ <tx-drawer header="Filters" [(visible)]="filters">
8
+ …
9
+ <div txDrawerFooter>
10
+ <button txButton txDialogClose>Apply</button>
11
+ </div>
12
+ </tx-drawer>
13
+ ```
14
+
15
+ Open a component as a drawer from code with `TxDialogService.open(Component, { drawer: 'right', drawerSize: 'large', data })` — everything from the Dialog page applies (`TxDialogRef`, `injectDialogData`, `tx-dialog-header`, `txDialogClose`).
16
+
17
+ ## Inputs
18
+ | Name | Description |
19
+ |---|---|
20
+ | visible | Two-way open state (`[(visible)]`) |
21
+ | header | Title; also names the drawer |
22
+ | position | Edge it slides from: `left`, `right` (default), `top`, `bottom` |
23
+ | size | `small` (320px), `medium` (440px, default), `large` (640px), `full` or a CSS length — width for left / right (the whole screen below 640px), height for top / bottom |
24
+ | modal | Dims the page and keeps focus inside (default on) |
25
+ | closable | Close button, Escape and a click on the mask close it (default on) |
26
+ | dismissable | Overrides `closable` for a click on the mask |
27
+ | closeOnEscape | Overrides `closable` for Escape |
28
+ | blockScroll | Stops the page from scrolling while open (default on, modal only) |
29
+ | autoFocus | `first` focusable field (default), `dialog`, `none` or a CSS selector |
30
+ | restoreFocus | Focus goes back to the element that opened it (default on) |
31
+ | ariaLabel | Name when there is no header |
32
+ | panelClass | Class on the drawer panel |
33
+ | dt | Design tokens of this drawer (`dialog`, drawer sizes under `drawer`) |
34
+ | unstyled | Removes the tectra styles |
35
+
36
+ ## Outputs
37
+ | Name | Description |
38
+ |---|---|
39
+ | opened | The drawer opened |
40
+ | closed | The drawer closed |
41
+ | visibleChange | `visible` changed |
42
+
43
+ ## Slots
44
+ | Name | Description |
45
+ |---|---|
46
+ | default | Content; it scrolls between the header and the footer |
47
+ | txDrawerHeader | `<div txDrawerHeader>` — more header content after the title |
48
+ | txDrawerFooter | `<div txDrawerFooter>` — actions at the bottom |
49
+
50
+ ## Keyboard
51
+ | Key | Action |
52
+ |---|---|
53
+ | Tab / Shift + Tab | Moves focus inside the drawer only (modal) |
54
+ | Escape | Closes the drawer (when `closable`) |
@@ -0,0 +1,20 @@
1
+ # Email suggestion
2
+
3
+ A hint under an email field: completes your own domain (`olena` → `olena@example.com`) and catches typos in common domains (`gmial.com` → `gmail.com`). It is a polite live region, so screen readers hear the hint; a click on it emits the fixed address. The logic is also exported as `suggestEmail(value, domains, known)` and `editDistance`. The hint is a small text button that slides in under the field; spacing and motion come from the `emailSuggestion` tokens.
4
+
5
+ ## Inputs
6
+ | Name | Description |
7
+ |---|---|
8
+ | value | The typed email |
9
+ | domain | Your domain or domains to complete, with or without `@` |
10
+ | knownDomains | Domains checked for typos (common mail providers by default) |
11
+ | icon | Icon of the hint button |
12
+ | dt | Design tokens of this instance (`emailSuggestion`: offset from the field, enter motion) |
13
+ | pt | Classes and styles of the parts: `root`, `button` |
14
+ | ptOptions | How `pt` merges with the global pass-through |
15
+ | unstyled | Removes the tectra styles |
16
+
17
+ ## Outputs
18
+ | Name | Description |
19
+ |---|---|
20
+ | applied | The hint was used: the suggested address |
@@ -0,0 +1,415 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from "@angular/core";
3
+ import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
4
+ import { TxLocaleService } from "@tectra-ng/core/i18n";
5
+ import { optionalBoolean } from "@tectra-ng/core/utils";
6
+ import { toStyleObject } from "@tectra-ng/themes";
7
+ const DIGITS_INFO = /^(\d+)?(?:\.(\d+))?(?:-(\d+))?$/;
8
+ function parseDigitsInfo(format) {
9
+ const match = DIGITS_INFO.exec((format ?? "").trim());
10
+ if (!match) return {};
11
+ const [, integer, minFraction, maxFraction] = match;
12
+ const minimumFractionDigits = minFraction === void 0 ? void 0 : Number(minFraction);
13
+ const maximumFractionDigits = maxFraction === void 0 ? minimumFractionDigits : Math.max(Number(maxFraction), minimumFractionDigits ?? 0);
14
+ return {
15
+ ...integer === void 0 ? {} : { minimumIntegerDigits: Math.max(1, Number(integer)) },
16
+ ...minimumFractionDigits === void 0 ? {} : { minimumFractionDigits },
17
+ ...maximumFractionDigits === void 0 ? {} : { maximumFractionDigits }
18
+ };
19
+ }
20
+ function toSegments(parts) {
21
+ const segments = [];
22
+ for (const part of parts) {
23
+ const currency = part.type === "currency";
24
+ const last = segments[segments.length - 1];
25
+ if (last && last.currency === currency) last.text += part.value;
26
+ else segments.push({
27
+ text: part.value,
28
+ currency
29
+ });
30
+ }
31
+ return segments;
32
+ }
33
+ function formatAmount(amount, options) {
34
+ const base = {
35
+ ...parseDigitsInfo(options.format),
36
+ notation: options.notation ?? "standard",
37
+ signDisplay: options.showSign ? "exceptZero" : "auto"
38
+ };
39
+ const currency = options.currency?.trim();
40
+ if (currency) try {
41
+ return toSegments(new Intl.NumberFormat(options.locale, {
42
+ ...base,
43
+ style: "currency",
44
+ currency,
45
+ currencyDisplay: options.currencyDisplay ?? "narrowSymbol"
46
+ }).formatToParts(amount));
47
+ } catch {
48
+ return [
49
+ ...toSegments(new Intl.NumberFormat(options.locale, base).formatToParts(amount)),
50
+ {
51
+ text: "\xA0",
52
+ currency: false
53
+ },
54
+ {
55
+ text: currency,
56
+ currency: true
57
+ }
58
+ ];
59
+ }
60
+ return toSegments(new Intl.NumberFormat(options.locale, base).formatToParts(amount));
61
+ }
62
+ var TxAmount = class TxAmount {
63
+ localeService = inject(TxLocaleService);
64
+ amount = input(null, ...ngDevMode ? [{ debugName: "amount" }] : /* istanbul ignore next */ []);
65
+ currency = input(void 0, ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
66
+ format = input("1.0-2", ...ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []);
67
+ notation = input("standard", ...ngDevMode ? [{ debugName: "notation" }] : /* istanbul ignore next */ []);
68
+ currencyDisplay = input("narrowSymbol", ...ngDevMode ? [{ debugName: "currencyDisplay" }] : /* istanbul ignore next */ []);
69
+ showSign = input(false, {
70
+ ...ngDevMode ? { debugName: "showSign" } : /* istanbul ignore next */ {},
71
+ transform: booleanAttribute
72
+ });
73
+ signColor = input(false, {
74
+ ...ngDevMode ? { debugName: "signColor" } : /* istanbul ignore next */ {},
75
+ transform: booleanAttribute
76
+ });
77
+ strong = input(false, {
78
+ ...ngDevMode ? { debugName: "strong" } : /* istanbul ignore next */ {},
79
+ transform: booleanAttribute
80
+ });
81
+ locale = input(void 0, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
82
+ emptyText = input("—", ...ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []);
83
+ dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
84
+ pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
85
+ ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
86
+ unstyled = input(void 0, {
87
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
88
+ transform: optionalBoolean
89
+ });
90
+ isUnstyled = injectUnstyled(this.unstyled);
91
+ passThrough = injectPassThrough("amount", this, this.pt, this.ptOptions);
92
+ isEmpty = computed(() => {
93
+ const amount = this.amount();
94
+ return amount === null || amount === void 0 || Number.isNaN(amount);
95
+ }, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
96
+ sign = computed(() => {
97
+ const amount = this.amount();
98
+ if (this.isEmpty() || amount === null || amount === void 0) return null;
99
+ return amount > 0 ? "positive" : amount < 0 ? "negative" : "zero";
100
+ }, ...ngDevMode ? [{ debugName: "sign" }] : /* istanbul ignore next */ []);
101
+ segments = computed(() => {
102
+ const amount = this.amount();
103
+ if (this.isEmpty() || amount === null || amount === void 0) return [];
104
+ return formatAmount(amount, {
105
+ locale: this.locale() ?? this.localeService.locale().intl,
106
+ currency: this.currency(),
107
+ format: this.format(),
108
+ notation: this.notation(),
109
+ currencyDisplay: this.currencyDisplay(),
110
+ showSign: this.showSign()
111
+ });
112
+ }, ...ngDevMode ? [{ debugName: "segments" }] : /* istanbul ignore next */ []);
113
+ hostStyle = computed(() => ({
114
+ ...toStyleObject(this.dt(), "--tx-amount"),
115
+ ...this.passThrough().root?.style
116
+ }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
117
+ static ɵfac = i0.ɵɵngDeclareFactory({
118
+ minVersion: "12.0.0",
119
+ version: "22.2.3",
120
+ ngImport: i0,
121
+ type: TxAmount,
122
+ deps: [],
123
+ target: i0.ɵɵFactoryTarget.Component
124
+ });
125
+ static ɵcmp = i0.ɵɵngDeclareComponent({
126
+ minVersion: "17.0.0",
127
+ version: "22.2.3",
128
+ type: TxAmount,
129
+ isStandalone: true,
130
+ selector: "tx-amount",
131
+ inputs: {
132
+ amount: {
133
+ classPropertyName: "amount",
134
+ publicName: "amount",
135
+ isSignal: true,
136
+ isRequired: false,
137
+ transformFunction: null
138
+ },
139
+ currency: {
140
+ classPropertyName: "currency",
141
+ publicName: "currency",
142
+ isSignal: true,
143
+ isRequired: false,
144
+ transformFunction: null
145
+ },
146
+ format: {
147
+ classPropertyName: "format",
148
+ publicName: "format",
149
+ isSignal: true,
150
+ isRequired: false,
151
+ transformFunction: null
152
+ },
153
+ notation: {
154
+ classPropertyName: "notation",
155
+ publicName: "notation",
156
+ isSignal: true,
157
+ isRequired: false,
158
+ transformFunction: null
159
+ },
160
+ currencyDisplay: {
161
+ classPropertyName: "currencyDisplay",
162
+ publicName: "currencyDisplay",
163
+ isSignal: true,
164
+ isRequired: false,
165
+ transformFunction: null
166
+ },
167
+ showSign: {
168
+ classPropertyName: "showSign",
169
+ publicName: "showSign",
170
+ isSignal: true,
171
+ isRequired: false,
172
+ transformFunction: null
173
+ },
174
+ signColor: {
175
+ classPropertyName: "signColor",
176
+ publicName: "signColor",
177
+ isSignal: true,
178
+ isRequired: false,
179
+ transformFunction: null
180
+ },
181
+ strong: {
182
+ classPropertyName: "strong",
183
+ publicName: "strong",
184
+ isSignal: true,
185
+ isRequired: false,
186
+ transformFunction: null
187
+ },
188
+ locale: {
189
+ classPropertyName: "locale",
190
+ publicName: "locale",
191
+ isSignal: true,
192
+ isRequired: false,
193
+ transformFunction: null
194
+ },
195
+ emptyText: {
196
+ classPropertyName: "emptyText",
197
+ publicName: "emptyText",
198
+ isSignal: true,
199
+ isRequired: false,
200
+ transformFunction: null
201
+ },
202
+ dt: {
203
+ classPropertyName: "dt",
204
+ publicName: "dt",
205
+ isSignal: true,
206
+ isRequired: false,
207
+ transformFunction: null
208
+ },
209
+ pt: {
210
+ classPropertyName: "pt",
211
+ publicName: "pt",
212
+ isSignal: true,
213
+ isRequired: false,
214
+ transformFunction: null
215
+ },
216
+ ptOptions: {
217
+ classPropertyName: "ptOptions",
218
+ publicName: "ptOptions",
219
+ isSignal: true,
220
+ isRequired: false,
221
+ transformFunction: null
222
+ },
223
+ unstyled: {
224
+ classPropertyName: "unstyled",
225
+ publicName: "unstyled",
226
+ isSignal: true,
227
+ isRequired: false,
228
+ transformFunction: null
229
+ }
230
+ },
231
+ host: {
232
+ properties: {
233
+ "class": "passThrough().root?.class",
234
+ "style": "hostStyle()",
235
+ "attr.data-styled": "!isUnstyled() || null",
236
+ "attr.data-sign": "signColor() ? sign() : null",
237
+ "class.tx-amount--strong": "strong()",
238
+ "class.tx-amount--zero": "sign() === \"zero\"",
239
+ "class.tx-amount--empty": "isEmpty()"
240
+ },
241
+ classAttribute: "tx-amount"
242
+ },
243
+ ngImport: i0,
244
+ template: `
245
+ @if (isEmpty()) {
246
+ <span class="tx-amount__empty">{{ emptyText() }}</span>
247
+ } @else {
248
+ @for (segment of segments(); track $index) {
249
+ @if (segment.currency) {
250
+ <span class="tx-amount__currency" [class]="passThrough().currency?.class" [style]="passThrough().currency?.style">{{ segment.text }}</span>
251
+ } @else {
252
+ <span class="tx-amount__value" [class]="passThrough().value?.class" [style]="passThrough().value?.style">{{ segment.text }}</span>
253
+ }
254
+ }
255
+ }
256
+ `,
257
+ isInline: true,
258
+ styles: [":host{display:inline;white-space:nowrap;font-variant-numeric:tabular-nums}:host([data-styled]){color:var(--tx-amount-color);font-weight:var(--tx-amount-font-weight)}:host([data-styled].tx-amount--strong){font-weight:var(--tx-amount-strong-font-weight)}:host([data-styled].tx-amount--zero),:host([data-styled].tx-amount--empty){color:var(--tx-amount-muted-color);font-weight:var(--tx-amount-muted-font-weight)}:host([data-styled][data-sign=positive]){color:var(--tx-amount-positive-color)}:host([data-styled][data-sign=negative]){color:var(--tx-amount-negative-color)}:host([data-styled]) .tx-amount__currency{color:var(--tx-amount-currency-color);font-size:var(--tx-amount-currency-font-size);font-weight:var(--tx-amount-currency-font-weight)}:host([data-styled][data-sign=positive]) .tx-amount__currency,:host([data-styled][data-sign=negative]) .tx-amount__currency{color:inherit}\n"],
259
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
260
+ });
261
+ };
262
+ i0.ɵɵngDeclareClassMetadata({
263
+ minVersion: "12.0.0",
264
+ version: "22.2.3",
265
+ ngImport: i0,
266
+ type: TxAmount,
267
+ decorators: [{
268
+ type: Component,
269
+ args: [{
270
+ selector: "tx-amount",
271
+ template: `
272
+ @if (isEmpty()) {
273
+ <span class="tx-amount__empty">{{ emptyText() }}</span>
274
+ } @else {
275
+ @for (segment of segments(); track $index) {
276
+ @if (segment.currency) {
277
+ <span class="tx-amount__currency" [class]="passThrough().currency?.class" [style]="passThrough().currency?.style">{{ segment.text }}</span>
278
+ } @else {
279
+ <span class="tx-amount__value" [class]="passThrough().value?.class" [style]="passThrough().value?.style">{{ segment.text }}</span>
280
+ }
281
+ }
282
+ }
283
+ `,
284
+ changeDetection: ChangeDetectionStrategy.OnPush,
285
+ host: {
286
+ class: "tx-amount",
287
+ "[class]": "passThrough().root?.class",
288
+ "[style]": "hostStyle()",
289
+ "[attr.data-styled]": "!isUnstyled() || null",
290
+ "[attr.data-sign]": "signColor() ? sign() : null",
291
+ "[class.tx-amount--strong]": "strong()",
292
+ "[class.tx-amount--zero]": "sign() === \"zero\"",
293
+ "[class.tx-amount--empty]": "isEmpty()"
294
+ },
295
+ styles: [":host{display:inline;white-space:nowrap;font-variant-numeric:tabular-nums}:host([data-styled]){color:var(--tx-amount-color);font-weight:var(--tx-amount-font-weight)}:host([data-styled].tx-amount--strong){font-weight:var(--tx-amount-strong-font-weight)}:host([data-styled].tx-amount--zero),:host([data-styled].tx-amount--empty){color:var(--tx-amount-muted-color);font-weight:var(--tx-amount-muted-font-weight)}:host([data-styled][data-sign=positive]){color:var(--tx-amount-positive-color)}:host([data-styled][data-sign=negative]){color:var(--tx-amount-negative-color)}:host([data-styled]) .tx-amount__currency{color:var(--tx-amount-currency-color);font-size:var(--tx-amount-currency-font-size);font-weight:var(--tx-amount-currency-font-weight)}:host([data-styled][data-sign=positive]) .tx-amount__currency,:host([data-styled][data-sign=negative]) .tx-amount__currency{color:inherit}\n"]
296
+ }]
297
+ }],
298
+ propDecorators: {
299
+ amount: [{
300
+ type: i0.Input,
301
+ args: [{
302
+ isSignal: true,
303
+ alias: "amount",
304
+ required: false
305
+ }]
306
+ }],
307
+ currency: [{
308
+ type: i0.Input,
309
+ args: [{
310
+ isSignal: true,
311
+ alias: "currency",
312
+ required: false
313
+ }]
314
+ }],
315
+ format: [{
316
+ type: i0.Input,
317
+ args: [{
318
+ isSignal: true,
319
+ alias: "format",
320
+ required: false
321
+ }]
322
+ }],
323
+ notation: [{
324
+ type: i0.Input,
325
+ args: [{
326
+ isSignal: true,
327
+ alias: "notation",
328
+ required: false
329
+ }]
330
+ }],
331
+ currencyDisplay: [{
332
+ type: i0.Input,
333
+ args: [{
334
+ isSignal: true,
335
+ alias: "currencyDisplay",
336
+ required: false
337
+ }]
338
+ }],
339
+ showSign: [{
340
+ type: i0.Input,
341
+ args: [{
342
+ isSignal: true,
343
+ alias: "showSign",
344
+ required: false
345
+ }]
346
+ }],
347
+ signColor: [{
348
+ type: i0.Input,
349
+ args: [{
350
+ isSignal: true,
351
+ alias: "signColor",
352
+ required: false
353
+ }]
354
+ }],
355
+ strong: [{
356
+ type: i0.Input,
357
+ args: [{
358
+ isSignal: true,
359
+ alias: "strong",
360
+ required: false
361
+ }]
362
+ }],
363
+ locale: [{
364
+ type: i0.Input,
365
+ args: [{
366
+ isSignal: true,
367
+ alias: "locale",
368
+ required: false
369
+ }]
370
+ }],
371
+ emptyText: [{
372
+ type: i0.Input,
373
+ args: [{
374
+ isSignal: true,
375
+ alias: "emptyText",
376
+ required: false
377
+ }]
378
+ }],
379
+ dt: [{
380
+ type: i0.Input,
381
+ args: [{
382
+ isSignal: true,
383
+ alias: "dt",
384
+ required: false
385
+ }]
386
+ }],
387
+ pt: [{
388
+ type: i0.Input,
389
+ args: [{
390
+ isSignal: true,
391
+ alias: "pt",
392
+ required: false
393
+ }]
394
+ }],
395
+ ptOptions: [{
396
+ type: i0.Input,
397
+ args: [{
398
+ isSignal: true,
399
+ alias: "ptOptions",
400
+ required: false
401
+ }]
402
+ }],
403
+ unstyled: [{
404
+ type: i0.Input,
405
+ args: [{
406
+ isSignal: true,
407
+ alias: "unstyled",
408
+ required: false
409
+ }]
410
+ }]
411
+ }
412
+ });
413
+ export { TxAmount, formatAmount, parseDigitsInfo };
414
+
415
+ //# sourceMappingURL=tectra-ng-ui-amount.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectra-ng-ui-amount.mjs","names":[],"sources":["../../../../packages/ui/amount/src/format-amount.ts","../../../../packages/ui/amount/src/amount.component.ts"],"sourcesContent":["import { TxAmountFormatOptions, TxAmountSegment } from './amount.types';\n\nconst DIGITS_INFO = /^(\\d+)?(?:\\.(\\d+))?(?:-(\\d+))?$/;\n\nexport function parseDigitsInfo(format: string | undefined): Pick<Intl.NumberFormatOptions, 'minimumIntegerDigits' | 'minimumFractionDigits' | 'maximumFractionDigits'> {\n const match = DIGITS_INFO.exec((format ?? '').trim());\n if (!match) {\n return {};\n }\n const [, integer, minFraction, maxFraction] = match;\n const minimumFractionDigits = minFraction === undefined ? undefined : Number(minFraction);\n const maximumFractionDigits = maxFraction === undefined ? minimumFractionDigits : Math.max(Number(maxFraction), minimumFractionDigits ?? 0);\n return {\n ...(integer === undefined ? {} : { minimumIntegerDigits: Math.max(1, Number(integer)) }),\n ...(minimumFractionDigits === undefined ? {} : { minimumFractionDigits }),\n ...(maximumFractionDigits === undefined ? {} : { maximumFractionDigits }),\n };\n}\n\nfunction toSegments(parts: Intl.NumberFormatPart[]): TxAmountSegment[] {\n const segments: TxAmountSegment[] = [];\n for (const part of parts) {\n const currency = part.type === 'currency';\n const last = segments[segments.length - 1];\n if (last && last.currency === currency) {\n last.text += part.value;\n } else {\n segments.push({ text: part.value, currency });\n }\n }\n return segments;\n}\n\nexport function formatAmount(amount: number, options: TxAmountFormatOptions): TxAmountSegment[] {\n const base: Intl.NumberFormatOptions = {\n ...parseDigitsInfo(options.format),\n notation: options.notation ?? 'standard',\n signDisplay: options.showSign ? 'exceptZero' : 'auto',\n };\n const currency = options.currency?.trim();\n if (currency) {\n try {\n return toSegments(\n new Intl.NumberFormat(options.locale, { ...base, style: 'currency', currency, currencyDisplay: options.currencyDisplay ?? 'narrowSymbol' }).formatToParts(amount),\n );\n } catch {\n return [...toSegments(new Intl.NumberFormat(options.locale, base).formatToParts(amount)), { text: ' ', currency: false }, { text: currency, currency: true }];\n }\n }\n return toSegments(new Intl.NumberFormat(options.locale, base).formatToParts(amount));\n}\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input } from '@angular/core';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { TxLocaleService } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraAmountTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxAmountCurrencyDisplay, TxAmountNotation, TxAmountPart, TxAmountSign } from './amount.types';\nimport { formatAmount } from './format-amount';\n\n@Component({\n selector: 'tx-amount',\n template: `\n @if (isEmpty()) {\n <span class=\"tx-amount__empty\">{{ emptyText() }}</span>\n } @else {\n @for (segment of segments(); track $index) {\n @if (segment.currency) {\n <span class=\"tx-amount__currency\" [class]=\"passThrough().currency?.class\" [style]=\"passThrough().currency?.style\">{{ segment.text }}</span>\n } @else {\n <span class=\"tx-amount__value\" [class]=\"passThrough().value?.class\" [style]=\"passThrough().value?.style\">{{ segment.text }}</span>\n }\n }\n }\n `,\n styleUrl: './amount.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-amount',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-sign]': 'signColor() ? sign() : null',\n '[class.tx-amount--strong]': 'strong()',\n '[class.tx-amount--zero]': 'sign() === \"zero\"',\n '[class.tx-amount--empty]': 'isEmpty()',\n },\n})\nexport class TxAmount {\n private localeService = inject(TxLocaleService);\n\n readonly amount = input<number | null | undefined>(null);\n readonly currency = input<string | null | undefined>(undefined);\n readonly format = input<string>('1.0-2');\n readonly notation = input<TxAmountNotation>('standard');\n readonly currencyDisplay = input<TxAmountCurrencyDisplay>('narrowSymbol');\n readonly showSign = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly signColor = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly strong = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly locale = input<string | undefined>(undefined);\n readonly emptyText = input<string>('—');\n readonly dt = input<TectraDeepPartial<TectraAmountTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxAmountPart, TxAmount> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('amount', this, this.pt, this.ptOptions);\n readonly isEmpty = computed(() => {\n const amount = this.amount();\n return amount === null || amount === undefined || Number.isNaN(amount);\n });\n readonly sign = computed<TxAmountSign | null>(() => {\n const amount = this.amount();\n if (this.isEmpty() || amount === null || amount === undefined) {\n return null;\n }\n return amount > 0 ? 'positive' : amount < 0 ? 'negative' : 'zero';\n });\n readonly segments = computed(() => {\n const amount = this.amount();\n if (this.isEmpty() || amount === null || amount === undefined) {\n return [];\n }\n return formatAmount(amount, {\n locale: this.locale() ?? this.localeService.locale().intl,\n currency: this.currency(),\n format: this.format(),\n notation: this.notation(),\n currencyDisplay: this.currencyDisplay(),\n showSign: this.showSign(),\n });\n });\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-amount'), ...this.passThrough().root?.style }));\n}\n"],"mappings":";;;;;;AAEA,MAAM,cAAc;AAEpB,SAAgB,gBAAgB,QAA0B;CACxD,MAAM,QAAQ,YAAY,MAAM,UAAU,GAAA,CAAI,KAAI,CAAE;CACpD,IAAI,CAAC,OACH,OAAO,CAAA;CAET,MAAM,GAAG,SAAS,aAAa,eAAe;CAC9C,MAAM,wBAAwB,gBAAgB,SAAY,SAAY,OAAO,WAAW;CACxF,MAAM,wBAAwB,gBAAgB,SAAY,wBAAwB,KAAK,IAAI,OAAO,WAAW,GAAG,yBAAyB,CAAC;CAC1I,OAAO;EACL,GAAI,YAAY,SAAY,CAAA,IAAK,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,OAAO,CAAC,EAAC;EACrF,GAAI,0BAA0B,SAAY,CAAA,IAAK,EAAE,sBAAqB;EACtE,GAAI,0BAA0B,SAAY,CAAA,IAAK,EAAE,sBAAq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