@seniorsistemas/scala-ng 2.4.0 → 2.5.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 (485) hide show
  1. package/README.md +9 -6
  2. package/autocomplete/README.md +5 -1
  3. package/autocomplete/public-api.d.ts +2 -2
  4. package/autocomplete/src/autocomplete/autocomplete.component.d.ts +6 -6
  5. package/autocomplete/src/autocomplete/autocomplete.models.d.ts +2 -2
  6. package/autocomplete/src/autocomplete/panel/autocomplete-panel.component.d.ts +1 -1
  7. package/avatar-summary/README.md +1 -1
  8. package/avatar-summary/public-api.d.ts +2 -2
  9. package/avatar-summary/src/avatar-summary/avatar-summary.component.d.ts +1 -1
  10. package/avatar-summary/src/avatar-summary/avatar-summary.models.d.ts +3 -3
  11. package/avatar-summary/src/avatar-summary/avatar-summary.tokens.d.ts +1 -1
  12. package/avatar-summary/src/avatar-summary/avatar-summary.utils.d.ts +1 -1
  13. package/badge/README.md +1 -1
  14. package/badge/public-api.d.ts +1 -1
  15. package/badge/src/badge/badge.component.d.ts +1 -1
  16. package/banner/README.md +1 -1
  17. package/banner/public-api.d.ts +3 -3
  18. package/banner/src/banner/banner.component.d.ts +2 -2
  19. package/banner/src/banner/banner.models.d.ts +1 -1
  20. package/banner/src/banner-trigger/banner-trigger.directive.d.ts +2 -2
  21. package/breadcrumb/README.md +7 -7
  22. package/breadcrumb/public-api.d.ts +5 -5
  23. package/breadcrumb/src/breadcrumb/breadcrumb.component.d.ts +2 -2
  24. package/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.d.ts +2 -2
  25. package/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.d.ts +3 -3
  26. package/button/README.md +5 -1
  27. package/button/public-api.d.ts +1 -1
  28. package/button/src/button/button.component.d.ts +1 -1
  29. package/card/README.md +1 -1
  30. package/card/public-api.d.ts +1 -1
  31. package/card/src/card/card.component.d.ts +4 -4
  32. package/checkbox/README.md +5 -5
  33. package/checkbox/public-api.d.ts +1 -1
  34. package/checkbox/src/checkbox/checkbox.component.d.ts +1 -1
  35. package/content-lifecycle/README.md +2 -2
  36. package/content-lifecycle/public-api.d.ts +2 -2
  37. package/content-lifecycle/src/content-lifecycle/content-lifecycle.component.d.ts +2 -2
  38. package/content-lifecycle/src/content-lifecycle/content-lifecycle.models.d.ts +2 -2
  39. package/date-picker/README.md +6 -6
  40. package/date-picker/public-api.d.ts +3 -3
  41. package/date-picker/src/date-picker/date-format.utils.d.ts +2 -2
  42. package/date-picker/src/date-picker/datepicker.component.d.ts +7 -7
  43. package/display-tag/README.md +2 -2
  44. package/display-tag/public-api.d.ts +2 -2
  45. package/display-tag/src/display-tag/display-tag.component.d.ts +5 -5
  46. package/drawer/README.md +9 -9
  47. package/drawer/public-api.d.ts +1 -1
  48. package/drawer/src/drawer/drawer.component.d.ts +4 -4
  49. package/empty-state/README.md +1 -1
  50. package/empty-state/public-api.d.ts +2 -2
  51. package/empty-state/src/empty-state/empty-state.component.d.ts +1 -1
  52. package/empty-state/src/empty-state/empty-state.models.d.ts +2 -2
  53. package/esm2022/autocomplete/public-api.mjs +2 -2
  54. package/esm2022/autocomplete/src/autocomplete/autocomplete.component.mjs +55 -55
  55. package/esm2022/autocomplete/src/autocomplete/autocomplete.models.mjs +1 -1
  56. package/esm2022/autocomplete/src/autocomplete/panel/autocomplete-panel.component.mjs +12 -12
  57. package/esm2022/avatar-summary/public-api.mjs +2 -2
  58. package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.component.mjs +24 -24
  59. package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.models.mjs +1 -1
  60. package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.tokens.mjs +46 -46
  61. package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.utils.mjs +4 -4
  62. package/esm2022/badge/public-api.mjs +2 -2
  63. package/esm2022/badge/src/badge/badge.component.mjs +25 -25
  64. package/esm2022/banner/public-api.mjs +3 -3
  65. package/esm2022/banner/src/banner/banner.component.mjs +33 -33
  66. package/esm2022/banner/src/banner/banner.models.mjs +1 -1
  67. package/esm2022/banner/src/banner-trigger/banner-trigger.directive.mjs +11 -11
  68. package/esm2022/breadcrumb/public-api.mjs +3 -3
  69. package/esm2022/breadcrumb/src/breadcrumb/breadcrumb.component.mjs +13 -13
  70. package/esm2022/breadcrumb/src/breadcrumb-item/breadcrumb-item.component.mjs +13 -13
  71. package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.mjs +11 -11
  72. package/esm2022/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.mjs +24 -24
  73. package/esm2022/button/public-api.mjs +2 -2
  74. package/esm2022/button/src/button/button.component.mjs +23 -23
  75. package/esm2022/card/public-api.mjs +2 -2
  76. package/esm2022/card/src/card/card.component.mjs +37 -37
  77. package/esm2022/checkbox/public-api.mjs +2 -2
  78. package/esm2022/checkbox/src/checkbox/checkbox.component.mjs +5 -5
  79. package/esm2022/content-lifecycle/public-api.mjs +2 -2
  80. package/esm2022/content-lifecycle/src/content-lifecycle/content-lifecycle.component.mjs +15 -15
  81. package/esm2022/content-lifecycle/src/content-lifecycle/content-lifecycle.models.mjs +1 -1
  82. package/esm2022/date-picker/public-api.mjs +3 -3
  83. package/esm2022/date-picker/src/date-picker/date-format.utils.mjs +39 -39
  84. package/esm2022/date-picker/src/date-picker/date.utils.mjs +15 -15
  85. package/esm2022/date-picker/src/date-picker/datepicker.component.mjs +122 -122
  86. package/esm2022/display-tag/public-api.mjs +2 -2
  87. package/esm2022/display-tag/src/display-tag/display-tag.component.mjs +36 -36
  88. package/esm2022/drawer/public-api.mjs +2 -2
  89. package/esm2022/drawer/src/drawer/drawer.component.mjs +37 -37
  90. package/esm2022/empty-state/public-api.mjs +2 -2
  91. package/esm2022/empty-state/src/empty-state/empty-state.component.mjs +26 -26
  92. package/esm2022/empty-state/src/empty-state/empty-state.models.mjs +1 -1
  93. package/esm2022/filter-tag/public-api.mjs +2 -2
  94. package/esm2022/filter-tag/src/filter-tag/filter-tag.component.mjs +12 -12
  95. package/esm2022/form-field/public-api.mjs +2 -2
  96. package/esm2022/form-field/src/form-field/form-field.component.mjs +26 -26
  97. package/esm2022/input/public-api.mjs +2 -2
  98. package/esm2022/input/src/input/input.component.mjs +55 -44
  99. package/esm2022/input-feedback/public-api.mjs +2 -2
  100. package/esm2022/input-feedback/src/input-feedback/input-feedback.component.mjs +12 -12
  101. package/esm2022/item-strip/public-api.mjs +2 -2
  102. package/esm2022/item-strip/src/item-strip/item-strip.component.mjs +14 -14
  103. package/esm2022/item-strip/src/item-strip-item/item-strip-item.component.mjs +37 -37
  104. package/esm2022/item-strip/src/item-strip-item/item-strip-item.mjs +1 -1
  105. package/esm2022/lib/a11y/focusable-item.utils.mjs +2 -2
  106. package/esm2022/lib/chip/chip.utils.mjs +15 -15
  107. package/esm2022/lib/combobox/combobox.utils.mjs +8 -8
  108. package/esm2022/lib/forms/control-state.utils.mjs +4 -4
  109. package/esm2022/lib/overlay/aria-hide.utils.mjs +10 -10
  110. package/esm2022/lib/overlay/exclusive-dialog.utils.mjs +22 -0
  111. package/esm2022/lib/overlay/scroll-lock.utils.mjs +5 -5
  112. package/esm2022/lib/overlay/scrollable-region.utils.mjs +34 -0
  113. package/esm2022/lib/theme/create-theme.mjs +7 -7
  114. package/esm2022/lib/theme/semantic-tokens.mjs +1 -1
  115. package/esm2022/lib/theme/theme.service.mjs +15 -15
  116. package/esm2022/list/public-api.mjs +2 -2
  117. package/esm2022/list/src/list/list-id-generator.mjs +4 -4
  118. package/esm2022/list/src/list/list.component.mjs +16 -16
  119. package/esm2022/list/src/list/list.models.mjs +2 -2
  120. package/esm2022/list/src/list/list.tokens.mjs +30 -30
  121. package/esm2022/list/src/list-group/list-group.component.mjs +7 -7
  122. package/esm2022/list/src/list-item/list-item-title.utils.mjs +3 -3
  123. package/esm2022/list/src/list-item/list-item.component.mjs +47 -47
  124. package/esm2022/loading-state/public-api.mjs +4 -0
  125. package/esm2022/loading-state/seniorsistemas-scala-ng-loading-state.mjs +5 -0
  126. package/esm2022/loading-state/src/loading-state/loading-state.directive.mjs +203 -0
  127. package/esm2022/loading-state/src/loading-state/loading-state.types.mjs +2 -0
  128. package/esm2022/loading-state/src/loading-state/loading-visibility.utils.mjs +60 -0
  129. package/esm2022/loading-state/src/pulse/pulse.component.mjs +71 -0
  130. package/esm2022/loading-state/src/pulse/senior-isotype.component.mjs +11 -0
  131. package/esm2022/loading-state/src/spinner/loading-spinner.component.mjs +13 -0
  132. package/esm2022/locale/fallback.mjs +135 -129
  133. package/esm2022/locale/public-api.mjs +2 -2
  134. package/esm2022/mask/public-api.mjs +5 -5
  135. package/esm2022/mask/src/mask/mask.directive.mjs +67 -67
  136. package/esm2022/mask/src/mask/mask.pipe.mjs +10 -10
  137. package/esm2022/mask/src/mask/mask.tokens.mjs +16 -16
  138. package/esm2022/mask/src/mask/mask.utils.mjs +25 -25
  139. package/esm2022/modal/public-api.mjs +4 -0
  140. package/esm2022/modal/seniorsistemas-scala-ng-modal.mjs +5 -0
  141. package/esm2022/modal/src/modal/modal-ref.mjs +84 -0
  142. package/esm2022/modal/src/modal/modal.component.mjs +262 -0
  143. package/esm2022/modal/src/modal/modal.service.mjs +119 -0
  144. package/esm2022/page-header/public-api.mjs +2 -2
  145. package/esm2022/page-header/src/page-header/page-header.component.mjs +14 -14
  146. package/esm2022/paginator/public-api.mjs +2 -2
  147. package/esm2022/paginator/src/paginator/paginator.component.mjs +29 -29
  148. package/esm2022/panel/public-api.mjs +2 -2
  149. package/esm2022/panel/src/panel/panel.component.mjs +21 -21
  150. package/esm2022/progress-bar/public-api.mjs +3 -3
  151. package/esm2022/progress-bar/src/progress-bar/progress-bar.component.mjs +33 -33
  152. package/esm2022/progress-bar/src/progress-bar/progress-bar.utils.mjs +5 -5
  153. package/esm2022/public-api.mjs +11 -9
  154. package/esm2022/radio-button/public-api.mjs +3 -3
  155. package/esm2022/radio-button/src/radio-button/radio-button.component.mjs +7 -7
  156. package/esm2022/radio-button/src/radio-button-group/radio-button-group-error.token.mjs +3 -3
  157. package/esm2022/radio-button/src/radio-button-group/radio-button-group.component.mjs +7 -7
  158. package/esm2022/radio-button/src/services/radio-button-registry.service.mjs +4 -4
  159. package/esm2022/select/public-api.mjs +2 -2
  160. package/esm2022/select/src/select/select.component.mjs +89 -89
  161. package/esm2022/select-button/public-api.mjs +2 -2
  162. package/esm2022/select-button/src/select-button/select-button.component.mjs +131 -131
  163. package/esm2022/selection-chip/public-api.mjs +2 -2
  164. package/esm2022/selection-chip/src/selection-chip/selection-chip.component.mjs +24 -24
  165. package/esm2022/slider/public-api.mjs +2 -2
  166. package/esm2022/slider/src/slider/slider.component.mjs +82 -82
  167. package/esm2022/slider/src/slider/slider.types.mjs +1 -1
  168. package/esm2022/spinner/public-api.mjs +2 -2
  169. package/esm2022/spinner/src/spinner/spinner.component.mjs +6 -3
  170. package/esm2022/split-button/public-api.mjs +2 -0
  171. package/esm2022/split-button/seniorsistemas-scala-ng-split-button.mjs +5 -0
  172. package/esm2022/split-button/src/split-button/split-button.component.mjs +71 -0
  173. package/esm2022/stats-card/public-api.mjs +2 -2
  174. package/esm2022/stats-card/src/stats-card/stats-card.component.mjs +63 -63
  175. package/esm2022/stats-card/src/stats-card/stats-card.models.mjs +1 -1
  176. package/esm2022/switch/public-api.mjs +2 -2
  177. package/esm2022/switch/src/switch/switch.component.mjs +8 -8
  178. package/esm2022/table/public-api.mjs +3 -3
  179. package/esm2022/table/src/components/actions-cell/table-actions-cell.component.mjs +7 -7
  180. package/esm2022/table/src/components/expand-cell/table-expand-cell.component.mjs +4 -4
  181. package/esm2022/table/src/components/fields/avatar-summary-field-table/avatar-summary-field-table.component.mjs +4 -4
  182. package/esm2022/table/src/components/fields/base-table-field-config.mjs +1 -1
  183. package/esm2022/table/src/components/fields/date-field-table/date-field-table.component.mjs +11 -11
  184. package/esm2022/table/src/components/fields/number-field-table/number-field-table.component.mjs +3 -3
  185. package/esm2022/table/src/components/fields/rich-field-table/rich-field-table.component.mjs +9 -9
  186. package/esm2022/table/src/components/fields/string-field-table/string-field-table.component.mjs +3 -3
  187. package/esm2022/table/src/components/filter-row/table-filter-row.component.mjs +10 -10
  188. package/esm2022/table/src/components/row-group-header/table-row-group-header.component.mjs +6 -6
  189. package/esm2022/table/src/components/selection-cell/table-selection-cell.component.mjs +10 -10
  190. package/esm2022/table/src/components/toolbar/table-toolbar.component.mjs +18 -18
  191. package/esm2022/table/src/directives/table-actions-column.directive.mjs +4 -4
  192. package/esm2022/table/src/directives/table-body.directive.mjs +3 -3
  193. package/esm2022/table/src/directives/table-cell.directive.mjs +9 -9
  194. package/esm2022/table/src/directives/table-container.directive.mjs +5 -5
  195. package/esm2022/table/src/directives/table-field.directive.mjs +10 -10
  196. package/esm2022/table/src/directives/table-grid.directive.mjs +4 -4
  197. package/esm2022/table/src/directives/table-header-cell.directive.mjs +17 -17
  198. package/esm2022/table/src/directives/table-header-row.directive.mjs +4 -4
  199. package/esm2022/table/src/directives/table-paginator-container.directive.mjs +4 -4
  200. package/esm2022/table/src/directives/table-row-detail-cell.directive.mjs +4 -4
  201. package/esm2022/table/src/directives/table-row.directive.mjs +10 -10
  202. package/esm2022/table/src/fields/avatar-summary-table-header.mjs +1 -1
  203. package/esm2022/table/src/fields/date-table-header.mjs +1 -1
  204. package/esm2022/table/src/fields/date-utc.utils.mjs +6 -6
  205. package/esm2022/table/src/fields/number-table-header.mjs +1 -1
  206. package/esm2022/table/src/fields/rich-table-header.mjs +1 -1
  207. package/esm2022/table/src/fields/string-table-header.mjs +1 -1
  208. package/esm2022/table/src/fields/table-header.mjs +1 -1
  209. package/esm2022/table/src/registry/built-in-field-types.mjs +11 -11
  210. package/esm2022/table/src/registry/table-field-registry.mjs +7 -7
  211. package/esm2022/table/src/table/table-toolbar.models.mjs +1 -1
  212. package/esm2022/table/src/table/table.component.mjs +58 -58
  213. package/esm2022/table/src/table/table.models.mjs +1 -1
  214. package/esm2022/table/src/utils/table-filter.utils.mjs +7 -7
  215. package/esm2022/table/src/utils/table-group.utils.mjs +6 -6
  216. package/esm2022/table/src/utils/table-lazy-event.utils.mjs +2 -2
  217. package/esm2022/table/src/utils/table-selection.utils.mjs +4 -4
  218. package/esm2022/table/src/utils/table-sort.utils.mjs +9 -9
  219. package/esm2022/tiered-menu/public-api.mjs +2 -2
  220. package/esm2022/tiered-menu/src/tiered-menu-item-row/tiered-menu-item-row.directive.mjs +8 -8
  221. package/esm2022/tiered-menu/src/tiered-menu-panel/tiered-menu-panel.component.mjs +16 -16
  222. package/esm2022/tiered-menu/src/tiered-menu-panel-host/tiered-menu-panel-host.component.mjs +10 -10
  223. package/esm2022/tiered-menu/src/tiered-menu-trigger/tiered-menu-trigger.directive.mjs +18 -18
  224. package/esm2022/toast/public-api.mjs +3 -3
  225. package/esm2022/toast/src/toast/toast.component.mjs +16 -16
  226. package/esm2022/toast/src/toast/toast.models.mjs +1 -1
  227. package/esm2022/toast/src/toast-container/toast-container.component.mjs +20 -20
  228. package/esm2022/toast/src/toast.service.mjs +31 -31
  229. package/esm2022/tooltip/public-api.mjs +2 -2
  230. package/esm2022/tooltip/src/tooltip/tooltip-collision-registry.service.mjs +4 -4
  231. package/esm2022/tooltip/src/tooltip/tooltip-focus-origin.service.mjs +5 -5
  232. package/esm2022/tooltip/src/tooltip/tooltip.types.mjs +1 -1
  233. package/esm2022/tooltip/src/tooltip-panel/tooltip-panel.component.mjs +23 -23
  234. package/esm2022/tooltip/src/tooltip-trigger/tooltip-trigger.directive.mjs +93 -93
  235. package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs +51 -51
  236. package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs.map +1 -1
  237. package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs +64 -64
  238. package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs.map +1 -1
  239. package/fesm2022/seniorsistemas-scala-ng-badge.mjs +22 -22
  240. package/fesm2022/seniorsistemas-scala-ng-badge.mjs.map +1 -1
  241. package/fesm2022/seniorsistemas-scala-ng-banner.mjs +32 -32
  242. package/fesm2022/seniorsistemas-scala-ng-banner.mjs.map +1 -1
  243. package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs +33 -33
  244. package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs.map +1 -1
  245. package/fesm2022/seniorsistemas-scala-ng-button.mjs +21 -21
  246. package/fesm2022/seniorsistemas-scala-ng-button.mjs.map +1 -1
  247. package/fesm2022/seniorsistemas-scala-ng-card.mjs +30 -30
  248. package/fesm2022/seniorsistemas-scala-ng-card.mjs.map +1 -1
  249. package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs +1 -1
  250. package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs.map +1 -1
  251. package/fesm2022/seniorsistemas-scala-ng-content-lifecycle.mjs +12 -12
  252. package/fesm2022/seniorsistemas-scala-ng-content-lifecycle.mjs.map +1 -1
  253. package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs +159 -159
  254. package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs.map +1 -1
  255. package/fesm2022/seniorsistemas-scala-ng-display-tag.mjs +33 -33
  256. package/fesm2022/seniorsistemas-scala-ng-display-tag.mjs.map +1 -1
  257. package/fesm2022/seniorsistemas-scala-ng-drawer.mjs +29 -29
  258. package/fesm2022/seniorsistemas-scala-ng-drawer.mjs.map +1 -1
  259. package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs +23 -23
  260. package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs.map +1 -1
  261. package/fesm2022/seniorsistemas-scala-ng-filter-tag.mjs +7 -7
  262. package/fesm2022/seniorsistemas-scala-ng-filter-tag.mjs.map +1 -1
  263. package/fesm2022/seniorsistemas-scala-ng-form-field.mjs +22 -22
  264. package/fesm2022/seniorsistemas-scala-ng-form-field.mjs.map +1 -1
  265. package/fesm2022/seniorsistemas-scala-ng-input-feedback.mjs +10 -10
  266. package/fesm2022/seniorsistemas-scala-ng-input-feedback.mjs.map +1 -1
  267. package/fesm2022/seniorsistemas-scala-ng-input.mjs +49 -38
  268. package/fesm2022/seniorsistemas-scala-ng-input.mjs.map +1 -1
  269. package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs +39 -39
  270. package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs.map +1 -1
  271. package/fesm2022/seniorsistemas-scala-ng-list.mjs +84 -84
  272. package/fesm2022/seniorsistemas-scala-ng-list.mjs.map +1 -1
  273. package/fesm2022/seniorsistemas-scala-ng-loading-state.mjs +354 -0
  274. package/fesm2022/seniorsistemas-scala-ng-loading-state.mjs.map +1 -0
  275. package/fesm2022/seniorsistemas-scala-ng-locale.mjs +134 -128
  276. package/fesm2022/seniorsistemas-scala-ng-locale.mjs.map +1 -1
  277. package/fesm2022/seniorsistemas-scala-ng-mask.mjs +106 -106
  278. package/fesm2022/seniorsistemas-scala-ng-mask.mjs.map +1 -1
  279. package/fesm2022/seniorsistemas-scala-ng-modal.mjs +466 -0
  280. package/fesm2022/seniorsistemas-scala-ng-modal.mjs.map +1 -0
  281. package/fesm2022/seniorsistemas-scala-ng-page-header.mjs +9 -9
  282. package/fesm2022/seniorsistemas-scala-ng-page-header.mjs.map +1 -1
  283. package/fesm2022/seniorsistemas-scala-ng-paginator.mjs +20 -20
  284. package/fesm2022/seniorsistemas-scala-ng-paginator.mjs.map +1 -1
  285. package/fesm2022/seniorsistemas-scala-ng-panel.mjs +14 -14
  286. package/fesm2022/seniorsistemas-scala-ng-panel.mjs.map +1 -1
  287. package/fesm2022/seniorsistemas-scala-ng-progress-bar.mjs +31 -31
  288. package/fesm2022/seniorsistemas-scala-ng-progress-bar.mjs.map +1 -1
  289. package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs +6 -6
  290. package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs.map +1 -1
  291. package/fesm2022/seniorsistemas-scala-ng-select-button.mjs +122 -122
  292. package/fesm2022/seniorsistemas-scala-ng-select-button.mjs.map +1 -1
  293. package/fesm2022/seniorsistemas-scala-ng-select.mjs +76 -76
  294. package/fesm2022/seniorsistemas-scala-ng-select.mjs.map +1 -1
  295. package/fesm2022/seniorsistemas-scala-ng-selection-chip.mjs +19 -19
  296. package/fesm2022/seniorsistemas-scala-ng-selection-chip.mjs.map +1 -1
  297. package/fesm2022/seniorsistemas-scala-ng-slider.mjs +72 -72
  298. package/fesm2022/seniorsistemas-scala-ng-slider.mjs.map +1 -1
  299. package/fesm2022/seniorsistemas-scala-ng-spinner.mjs +4 -1
  300. package/fesm2022/seniorsistemas-scala-ng-spinner.mjs.map +1 -1
  301. package/fesm2022/seniorsistemas-scala-ng-split-button.mjs +78 -0
  302. package/fesm2022/seniorsistemas-scala-ng-split-button.mjs.map +1 -0
  303. package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs +58 -58
  304. package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs.map +1 -1
  305. package/fesm2022/seniorsistemas-scala-ng-switch.mjs +4 -4
  306. package/fesm2022/seniorsistemas-scala-ng-switch.mjs.map +1 -1
  307. package/fesm2022/{seniorsistemas-scala-ng-table-table-actions-cell.component-DTzDhrMk.mjs → seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs} +2 -2
  308. package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs.map +1 -0
  309. package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-C0Y1KaWD.mjs +27 -0
  310. package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-C0Y1KaWD.mjs.map +1 -0
  311. package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-C9s1ObGb.mjs +68 -0
  312. package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-C9s1ObGb.mjs.map +1 -0
  313. package/fesm2022/seniorsistemas-scala-ng-table.mjs +138 -138
  314. package/fesm2022/seniorsistemas-scala-ng-table.mjs.map +1 -1
  315. package/fesm2022/seniorsistemas-scala-ng-tiered-menu.mjs +35 -35
  316. package/fesm2022/seniorsistemas-scala-ng-tiered-menu.mjs.map +1 -1
  317. package/fesm2022/seniorsistemas-scala-ng-toast.mjs +54 -54
  318. package/fesm2022/seniorsistemas-scala-ng-toast.mjs.map +1 -1
  319. package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs +110 -110
  320. package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs.map +1 -1
  321. package/fesm2022/seniorsistemas-scala-ng.mjs +110 -54
  322. package/fesm2022/seniorsistemas-scala-ng.mjs.map +1 -1
  323. package/filter-tag/README.md +1 -1
  324. package/filter-tag/public-api.d.ts +1 -1
  325. package/filter-tag/src/filter-tag/filter-tag.component.d.ts +1 -1
  326. package/form-field/public-api.d.ts +2 -2
  327. package/form-field/src/form-field/form-field.component.d.ts +14 -14
  328. package/input/README.md +13 -10
  329. package/input/public-api.d.ts +1 -1
  330. package/input/src/input/input.component.d.ts +8 -5
  331. package/input-feedback/README.md +7 -7
  332. package/input-feedback/public-api.d.ts +1 -1
  333. package/input-feedback/src/input-feedback/input-feedback.component.d.ts +2 -2
  334. package/item-strip/README.md +1 -1
  335. package/item-strip/public-api.d.ts +2 -2
  336. package/item-strip/src/item-strip/item-strip.component.d.ts +1 -1
  337. package/item-strip/src/item-strip-item/item-strip-item.component.d.ts +27 -27
  338. package/item-strip/src/item-strip-item/item-strip-item.d.ts +1 -1
  339. package/lib/a11y/focusable-item.utils.d.ts +1 -1
  340. package/lib/chip/chip.utils.d.ts +3 -3
  341. package/lib/combobox/combobox.utils.d.ts +2 -2
  342. package/lib/forms/control-state.utils.d.ts +2 -2
  343. package/lib/overlay/exclusive-dialog.utils.d.ts +7 -0
  344. package/lib/overlay/scrollable-region.utils.d.ts +5 -0
  345. package/lib/theme/create-theme.d.ts +2 -2
  346. package/lib/theme/semantic-tokens.d.ts +1 -1
  347. package/lib/theme/theme.service.d.ts +1 -1
  348. package/list/README.md +1 -1
  349. package/list/public-api.d.ts +2 -2
  350. package/list/src/list/list.component.d.ts +1 -1
  351. package/list/src/list/list.models.d.ts +5 -5
  352. package/list/src/list/list.tokens.d.ts +1 -1
  353. package/list/src/list-group/list-group.component.d.ts +1 -1
  354. package/list/src/list-item/list-item.component.d.ts +11 -11
  355. package/loading-state/README.md +60 -0
  356. package/loading-state/index.d.ts +5 -0
  357. package/loading-state/package.json +3 -0
  358. package/loading-state/public-api.d.ts +5 -0
  359. package/loading-state/src/loading-state/loading-state.directive.d.ts +37 -0
  360. package/loading-state/src/loading-state/loading-state.types.d.ts +3 -0
  361. package/loading-state/src/loading-state/loading-visibility.utils.d.ts +11 -0
  362. package/loading-state/src/pulse/pulse.component.d.ts +27 -0
  363. package/loading-state/src/pulse/senior-isotype.component.d.ts +5 -0
  364. package/loading-state/src/spinner/loading-spinner.component.d.ts +8 -0
  365. package/locale/public-api.d.ts +1 -1
  366. package/mask/README.md +1 -1
  367. package/mask/public-api.d.ts +4 -4
  368. package/mask/src/mask/mask.directive.d.ts +2 -2
  369. package/mask/src/mask/mask.pipe.d.ts +2 -2
  370. package/mask/src/mask/mask.utils.d.ts +1 -1
  371. package/modal/README.md +435 -0
  372. package/modal/index.d.ts +5 -0
  373. package/modal/package.json +3 -0
  374. package/modal/public-api.d.ts +3 -0
  375. package/modal/src/modal/modal-ref.d.ts +51 -0
  376. package/modal/src/modal/modal.component.d.ts +82 -0
  377. package/modal/src/modal/modal.service.d.ts +62 -0
  378. package/package.json +22 -1
  379. package/page-header/README.md +1 -1
  380. package/page-header/public-api.d.ts +1 -1
  381. package/page-header/src/page-header/page-header.component.d.ts +2 -2
  382. package/paginator/public-api.d.ts +2 -2
  383. package/paginator/src/paginator/paginator.component.d.ts +3 -3
  384. package/panel/README.md +1 -1
  385. package/panel/public-api.d.ts +1 -1
  386. package/panel/src/panel/panel.component.d.ts +3 -3
  387. package/progress-bar/README.md +4 -4
  388. package/progress-bar/public-api.d.ts +4 -4
  389. package/progress-bar/src/progress-bar/progress-bar.component.d.ts +3 -3
  390. package/progress-bar/src/progress-bar/progress-bar.utils.d.ts +1 -1
  391. package/public-api.d.ts +11 -9
  392. package/radio-button/README.md +1 -1
  393. package/radio-button/public-api.d.ts +3 -3
  394. package/radio-button/src/radio-button/radio-button.component.d.ts +2 -2
  395. package/radio-button/src/radio-button-group/radio-button-group-error.token.d.ts +1 -1
  396. package/radio-button/src/radio-button-group/radio-button-group.component.d.ts +3 -3
  397. package/radio-button/src/services/radio-button-registry.service.d.ts +1 -1
  398. package/schematics/migrate-spinner-to-loading-state/index.js +75 -0
  399. package/schematics/migrate-spinner-to-loading-state/index.js.map +1 -0
  400. package/schematics/migrations.json +10 -0
  401. package/schematics/ng-add/index.js +29 -29
  402. package/select/README.md +19 -15
  403. package/select/public-api.d.ts +2 -2
  404. package/select/src/select/select.component.d.ts +11 -11
  405. package/select-button/README.md +1 -1
  406. package/select-button/public-api.d.ts +2 -2
  407. package/select-button/src/select-button/select-button.component.d.ts +7 -7
  408. package/selection-chip/README.md +1 -1
  409. package/selection-chip/public-api.d.ts +1 -1
  410. package/selection-chip/src/selection-chip/selection-chip.component.d.ts +3 -3
  411. package/slider/README.md +6 -6
  412. package/slider/public-api.d.ts +2 -2
  413. package/slider/src/slider/slider.component.d.ts +3 -3
  414. package/slider/src/slider/slider.types.d.ts +3 -3
  415. package/spinner/README.md +9 -1
  416. package/spinner/public-api.d.ts +1 -1
  417. package/spinner/src/spinner/spinner.component.d.ts +3 -0
  418. package/split-button/README.md +208 -0
  419. package/split-button/index.d.ts +5 -0
  420. package/split-button/package.json +3 -0
  421. package/split-button/public-api.d.ts +1 -0
  422. package/split-button/src/split-button/split-button.component.d.ts +29 -0
  423. package/stats-card/README.md +1 -1
  424. package/stats-card/public-api.d.ts +2 -2
  425. package/stats-card/src/stats-card/stats-card.component.d.ts +415 -415
  426. package/stats-card/src/stats-card/stats-card.models.d.ts +3 -3
  427. package/styles/tailwind-preset.js +30 -13
  428. package/styles/tailwind-tokens.js +286 -286
  429. package/styles/tokens/index.scss +7 -7
  430. package/styles/tokens/semantic-colors.scss +4 -2
  431. package/styles.scss +7 -7
  432. package/switch/README.md +5 -5
  433. package/switch/public-api.d.ts +1 -1
  434. package/switch/src/switch/switch.component.d.ts +1 -1
  435. package/table/README.md +21 -21
  436. package/table/public-api.d.ts +12 -12
  437. package/table/src/components/actions-cell/table-actions-cell.component.d.ts +2 -2
  438. package/table/src/components/fields/avatar-summary-field-table/avatar-summary-field-table.component.d.ts +2 -2
  439. package/table/src/components/fields/base-table-field-config.d.ts +2 -2
  440. package/table/src/components/fields/date-field-table/date-field-table.component.d.ts +2 -2
  441. package/table/src/components/fields/number-field-table/number-field-table.component.d.ts +2 -2
  442. package/table/src/components/fields/rich-field-table/rich-field-table.component.d.ts +2 -2
  443. package/table/src/components/fields/string-field-table/string-field-table.component.d.ts +2 -2
  444. package/table/src/components/filter-row/table-filter-row.component.d.ts +1 -1
  445. package/table/src/components/selection-cell/table-selection-cell.component.d.ts +2 -2
  446. package/table/src/components/toolbar/table-toolbar.component.d.ts +3 -3
  447. package/table/src/directives/table-field.directive.d.ts +1 -1
  448. package/table/src/fields/avatar-summary-table-header.d.ts +4 -4
  449. package/table/src/fields/date-table-header.d.ts +3 -3
  450. package/table/src/fields/number-table-header.d.ts +3 -3
  451. package/table/src/fields/rich-table-header.d.ts +4 -4
  452. package/table/src/fields/string-table-header.d.ts +4 -4
  453. package/table/src/fields/table-header.d.ts +2 -2
  454. package/table/src/registry/built-in-field-types.d.ts +1 -1
  455. package/table/src/registry/table-field-registry.d.ts +4 -4
  456. package/table/src/table/table-toolbar.models.d.ts +1 -1
  457. package/table/src/table/table.component.d.ts +11 -11
  458. package/table/src/table/table.models.d.ts +2 -2
  459. package/table/src/utils/table-filter.utils.d.ts +1 -1
  460. package/table/src/utils/table-group.utils.d.ts +4 -4
  461. package/table/src/utils/table-lazy-event.utils.d.ts +3 -3
  462. package/table/src/utils/table-selection.utils.d.ts +2 -2
  463. package/table/src/utils/table-sort.utils.d.ts +2 -2
  464. package/tiered-menu/README.md +2 -2
  465. package/tiered-menu/public-api.d.ts +2 -2
  466. package/tiered-menu/src/tiered-menu-panel/tiered-menu-panel.component.d.ts +2 -2
  467. package/tiered-menu/src/tiered-menu-panel-host/tiered-menu-panel-host.component.d.ts +2 -2
  468. package/tiered-menu/src/tiered-menu-trigger/tiered-menu-trigger.directive.d.ts +2 -2
  469. package/toast/README.md +17 -17
  470. package/toast/public-api.d.ts +3 -3
  471. package/toast/src/toast/toast.component.d.ts +1 -1
  472. package/toast/src/toast/toast.models.d.ts +3 -3
  473. package/toast/src/toast-container/toast-container.component.d.ts +1 -1
  474. package/toast/src/toast.service.d.ts +5 -5
  475. package/tooltip/README.md +1 -1
  476. package/tooltip/public-api.d.ts +2 -2
  477. package/tooltip/src/tooltip/tooltip-focus-origin.service.d.ts +2 -2
  478. package/tooltip/src/tooltip/tooltip.types.d.ts +3 -3
  479. package/tooltip/src/tooltip-panel/tooltip-panel.component.d.ts +4 -4
  480. package/tooltip/src/tooltip-trigger/tooltip-trigger.directive.d.ts +2 -2
  481. package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-DTzDhrMk.mjs.map +0 -1
  482. package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs +0 -27
  483. package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs.map +0 -1
  484. package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs +0 -68
  485. package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs.map +0 -1
@@ -7,21 +7,21 @@ import { SdsTooltipDirective } from '@seniorsistemas/scala-ng/tooltip';
7
7
  const VALUE_MAX_LENGTH = 10;
8
8
  /** Cor do texto do percentual — mesma família usada pelo Badge (`text`). */
9
9
  const DELTA_TEXT_COLOR = {
10
- positive: "text-color-text-positive",
11
- negative: "text-color-text-destructive",
12
- neutral: "text-color-text-neutral-secondary",
10
+ positive: 'text-color-text-positive',
11
+ negative: 'text-color-text-destructive',
12
+ neutral: 'text-color-text-neutral-secondary',
13
13
  };
14
14
  /** Cor do glifo da seta (caret) — mesma família usada pelo Badge (`icon`), como classe de texto. */
15
15
  const DELTA_ICON_TEXT_COLOR = {
16
- positive: "text-color-icon-positive",
17
- negative: "text-color-icon-destructive",
18
- neutral: "text-[var(--sds-color-icon-neutral)]",
16
+ positive: 'text-color-icon-positive',
17
+ negative: 'text-color-icon-destructive',
18
+ neutral: 'text-[var(--sds-color-icon-neutral)]',
19
19
  };
20
20
  /** Cor de preenchimento do traço (Direction="flat") — mesma família de `icon`, como background. */
21
21
  const DELTA_DASH_BACKGROUND_COLOR = {
22
- positive: "bg-[var(--sds-color-icon-positive)]",
23
- negative: "bg-[var(--sds-color-icon-destructive)]",
24
- neutral: "bg-[var(--sds-color-icon-neutral)]",
22
+ positive: 'bg-[var(--sds-color-icon-positive)]',
23
+ negative: 'bg-[var(--sds-color-icon-destructive)]',
24
+ neutral: 'bg-[var(--sds-color-icon-neutral)]',
25
25
  };
26
26
  class SdsStatsCardComponent {
27
27
  /** Nome curto da métrica (2-3 palavras), sempre visível. */
@@ -31,7 +31,7 @@ class SdsStatsCardComponent {
31
31
  /** Classe do ícone FontAwesome exibido no leading do card (ex.: "fa-solid fa-arrow-trend-up"). Sem ícone quando omitido. */
32
32
  icon = input();
33
33
  /** "default" = bloco vertical (ícone+rótulo, valor, delta+período). "compact" = linha única (ícone+rótulo+valor+delta), sem período. */
34
- layout = input("default");
34
+ layout = input('default');
35
35
  /** Contexto temporal do delta (ex.: "vs. mês anterior"). Pode existir sem delta. Sem efeito em `layout="compact"`. */
36
36
  period = input();
37
37
  /** Indicador de tendência. Ausente = bloco de delta oculto. */
@@ -46,7 +46,7 @@ class SdsStatsCardComponent {
46
46
  cardClick = output();
47
47
  isHovered = signal(false);
48
48
  isFocused = signal(false);
49
- isCompact = computed(() => this.layout() === "compact");
49
+ isCompact = computed(() => this.layout() === 'compact');
50
50
  hasIcon = computed(() => !!this.icon());
51
51
  hasDelta = computed(() => !this.empty() && !!this.delta());
52
52
  showDeltaIcon = computed(() => this.delta()?.showIcon ?? true);
@@ -57,7 +57,7 @@ class SdsStatsCardComponent {
57
57
  const value = this.value();
58
58
  return this.isValueTruncated() ? `${value.slice(0, VALUE_MAX_LENGTH)}…` : value;
59
59
  });
60
- displayValue = computed(() => (this.empty() ? "—" : this.truncatedValue()));
60
+ displayValue = computed(() => (this.empty() ? '—' : this.truncatedValue()));
61
61
  containerTabIndex = computed(() => {
62
62
  if (this.disabled()) {
63
63
  return -1;
@@ -66,51 +66,51 @@ class SdsStatsCardComponent {
66
66
  });
67
67
  visualState = computed(() => {
68
68
  if (this.disabled()) {
69
- return "disabled";
69
+ return 'disabled';
70
70
  }
71
71
  if (this.isHovered() && this.isInteractive()) {
72
- return "hovered";
72
+ return 'hovered';
73
73
  }
74
- return "default";
74
+ return 'default';
75
75
  });
76
76
  containerClasses = computed(() => {
77
77
  const layoutClasses = this.isCompact()
78
78
  ? {
79
79
  flex: true,
80
- "w-fit": true,
81
- "max-w-full": true,
82
- "items-center": true,
83
- "gap-space-1": true,
84
- "px-space-1-5": true,
85
- "py-space-1": true,
80
+ 'w-fit': true,
81
+ 'max-w-full': true,
82
+ 'items-center': true,
83
+ 'gap-space-1': true,
84
+ 'px-space-1-5': true,
85
+ 'py-space-1': true,
86
86
  }
87
87
  : {
88
88
  flex: true,
89
- "w-full": true,
90
- "flex-col": true,
91
- "items-start": true,
92
- "gap-space-1-5": true,
93
- "p-space-2": true,
89
+ 'w-full': true,
90
+ 'flex-col': true,
91
+ 'items-start': true,
92
+ 'gap-space-1-5': true,
93
+ 'p-space-2': true,
94
94
  };
95
95
  const interactivityClasses = {
96
- "cursor-pointer": this.isInteractive(),
97
- "cursor-not-allowed": this.disabled(),
96
+ 'cursor-pointer': this.isInteractive(),
97
+ 'cursor-not-allowed': this.disabled(),
98
98
  };
99
99
  const stateClasses = (() => {
100
100
  switch (this.visualState()) {
101
- case "disabled": {
101
+ case 'disabled': {
102
102
  return {
103
- "bg-color-background-disable": true,
103
+ 'bg-color-background-disable': true,
104
104
  };
105
105
  }
106
- case "hovered": {
106
+ case 'hovered': {
107
107
  return {
108
- "bg-color-background-interactive-secondary-hovered": true,
108
+ 'bg-color-background-interactive-secondary-hovered': true,
109
109
  };
110
110
  }
111
111
  default: {
112
112
  return {
113
- "bg-surface-default": true,
113
+ 'bg-surface-default': true,
114
114
  };
115
115
  }
116
116
  }
@@ -119,18 +119,18 @@ class SdsStatsCardComponent {
119
119
  const isFocusRing = this.isFocused() && !this.disabled();
120
120
  const strokeClasses = {
121
121
  outline: true,
122
- "outline-1": !isFocusRing,
123
- "outline-offset-[-1px]": !isFocusRing,
124
- "outline-2": isFocusRing,
125
- "outline-offset-[-2px]": isFocusRing,
122
+ 'outline-1': !isFocusRing,
123
+ 'outline-offset-[-1px]': !isFocusRing,
124
+ 'outline-2': isFocusRing,
125
+ 'outline-offset-[-2px]': isFocusRing,
126
126
  };
127
127
  const outlineColorClasses = (() => {
128
128
  if (isFocusRing) {
129
- return { "outline-color-border-focused": true };
129
+ return { 'outline-color-border-focused': true };
130
130
  }
131
131
  return this.disabled()
132
- ? { "outline-color-border-disable": true }
133
- : { "outline-color-border": true };
132
+ ? { 'outline-color-border-disable': true }
133
+ : { 'outline-color-border': true };
134
134
  })();
135
135
  return {
136
136
  ...layoutClasses,
@@ -140,37 +140,37 @@ class SdsStatsCardComponent {
140
140
  ...outlineColorClasses,
141
141
  };
142
142
  });
143
- iconColorClass = computed(() => this.disabled() ? "text-color-icon-disable" : "text-[var(--sds-color-icon-neutral)]");
144
- labelTextClass = computed(() => this.disabled() ? "text-color-text-disable" : "text-color-text-neutral-secondary");
143
+ iconColorClass = computed(() => this.disabled() ? 'text-color-icon-disable' : 'text-[var(--sds-color-icon-neutral)]');
144
+ labelTextClass = computed(() => this.disabled() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary');
145
145
  valueTextClass = computed(() => {
146
146
  if (this.disabled()) {
147
- return "text-color-text-disable";
147
+ return 'text-color-text-disable';
148
148
  }
149
- return this.empty() ? "text-color-text-neutral-secondary" : "text-color-text-neutral-primary";
149
+ return this.empty() ? 'text-color-text-neutral-secondary' : 'text-color-text-neutral-primary';
150
150
  });
151
- periodTextClass = computed(() => this.disabled() ? "text-color-text-disable" : "text-color-text-neutral-secondary");
151
+ periodTextClass = computed(() => this.disabled() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary');
152
152
  /** Só chamado para "up"/"down" no template — "flat" renderiza o traço via `deltaDashBackgroundClass`, não um ícone. */
153
153
  deltaIconClass(direction) {
154
154
  switch (direction) {
155
- case "up": {
156
- return "fa-solid fa-caret-up";
155
+ case 'up': {
156
+ return 'fa-solid fa-caret-up';
157
157
  }
158
- case "down": {
159
- return "fa-solid fa-caret-down";
158
+ case 'down': {
159
+ return 'fa-solid fa-caret-down';
160
160
  }
161
- case "flat": {
162
- return "";
161
+ case 'flat': {
162
+ return '';
163
163
  }
164
164
  }
165
165
  }
166
166
  deltaTextColorClass(semantic) {
167
- return this.disabled() ? "text-color-text-disable" : DELTA_TEXT_COLOR[semantic];
167
+ return this.disabled() ? 'text-color-text-disable' : DELTA_TEXT_COLOR[semantic];
168
168
  }
169
169
  deltaIconTextColorClass(semantic) {
170
- return this.disabled() ? "text-color-icon-disable" : DELTA_ICON_TEXT_COLOR[semantic];
170
+ return this.disabled() ? 'text-color-icon-disable' : DELTA_ICON_TEXT_COLOR[semantic];
171
171
  }
172
172
  deltaDashBackgroundClass(semantic) {
173
- return this.disabled() ? "bg-color-icon-disable" : DELTA_DASH_BACKGROUND_COLOR[semantic];
173
+ return this.disabled() ? 'bg-color-icon-disable' : DELTA_DASH_BACKGROUND_COLOR[semantic];
174
174
  }
175
175
  handleClick() {
176
176
  if (!this.isInteractive()) {
@@ -183,8 +183,8 @@ class SdsStatsCardComponent {
183
183
  return;
184
184
  }
185
185
  switch (event.key) {
186
- case "Enter":
187
- case " ": {
186
+ case 'Enter':
187
+ case ' ': {
188
188
  event.preventDefault();
189
189
  this.cardClick.emit();
190
190
  break;
@@ -195,11 +195,11 @@ class SdsStatsCardComponent {
195
195
  }
196
196
  }
197
197
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsStatsCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
198
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsStatsCardComponent, isStandalone: true, selector: "sds-stats-card", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, period: { classPropertyName: "period", publicName: "period", isSignal: true, isRequired: false, transformFunction: null }, delta: { classPropertyName: "delta", publicName: "delta", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, empty: { classPropertyName: "empty", publicName: "empty", isSignal: true, isRequired: false, transformFunction: null }, emptyReason: { classPropertyName: "emptyReason", publicName: "emptyReason", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cardClick: "cardClick" }, ngImport: i0, template: "<ng-template #iconContainer>\n <i\n class=\"w-4 shrink-0 text-center text-[16px] leading-none\"\n [class]=\"icon() ?? ''\"\n [ngClass]=\"iconColorClass()\"\n aria-hidden=\"true\"\n ></i>\n</ng-template>\n\n<ng-template #deltaBlock>\n @let currentDelta = delta();\n @if (currentDelta) {\n <div class=\"flex shrink-0 items-center gap-space-0-50\">\n @if (showDeltaIcon()) {\n @switch (currentDelta.direction) {\n @case (\"flat\") {\n <span\n class=\"h-[2px] w-[8px] rounded-[1px]\"\n [ngClass]=\"deltaDashBackgroundClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></span>\n }\n @default {\n <i\n [class]=\"deltaIconClass(currentDelta.direction)\"\n [ngClass]=\"deltaIconTextColorClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></i>\n }\n }\n }\n <span\n class=\"whitespace-nowrap text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"deltaTextColorClass(currentDelta.semantic)\"\n >{{ currentDelta.value }}</span\n >\n </div>\n }\n</ng-template>\n\n@if (isCompact()) {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 shrink-[8] truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n <p\n class=\"min-w-0 truncate text-font-size-6 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n </div>\n} @else {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n <div class=\"flex w-full items-center gap-space-1 overflow-hidden\">\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n </div>\n\n <p\n class=\"w-full truncate text-font-size-7 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n\n @if (hasDelta() || showPeriod()) {\n <div class=\"flex w-full items-center gap-space-1\">\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n @if (showPeriod()) {\n @let periodText =\n empty()\n ? emptyReason() || (\"platform.scala-ng.stats_card_empty_reason\" | translate)\n : period();\n <p\n class=\"min-w-0 flex-1 truncate text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"periodTextClass()\"\n [sdsTooltip]=\"periodText\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n >\n {{ periodText }}\n </p>\n }\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SdsTooltipDirective, selector: "[sdsTooltip]", inputs: ["sdsTooltip", "sdsTooltipContext", "sdsTooltipTitle", "sdsTooltipPosition", "sdsTooltipShowArrow", "sdsTooltipOpenDelay", "sdsTooltipTouchDismiss", "sdsTooltipDisabled", "sdsTooltipCheckTruncatedText", "sdsTooltipFocusable", "sdsTooltipDescribeHost", "sdsTooltipAnchor", "sdsTooltipKeepOpenOnPress"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
198
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsStatsCardComponent, isStandalone: true, selector: "sds-stats-card", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, period: { classPropertyName: "period", publicName: "period", isSignal: true, isRequired: false, transformFunction: null }, delta: { classPropertyName: "delta", publicName: "delta", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, empty: { classPropertyName: "empty", publicName: "empty", isSignal: true, isRequired: false, transformFunction: null }, emptyReason: { classPropertyName: "emptyReason", publicName: "emptyReason", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cardClick: "cardClick" }, ngImport: i0, template: "<ng-template #iconContainer>\n <i\n class=\"w-4 shrink-0 text-center text-[16px] leading-none\"\n [class]=\"icon() ?? ''\"\n [ngClass]=\"iconColorClass()\"\n aria-hidden=\"true\"\n ></i>\n</ng-template>\n\n<ng-template #deltaBlock>\n @let currentDelta = delta();\n @if (currentDelta) {\n <div class=\"flex shrink-0 items-center gap-space-0-50\">\n @if (showDeltaIcon()) {\n @switch (currentDelta.direction) {\n @case ('flat') {\n <span\n class=\"h-[2px] w-[8px] rounded-[1px]\"\n [ngClass]=\"deltaDashBackgroundClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></span>\n }\n @default {\n <i\n [class]=\"deltaIconClass(currentDelta.direction)\"\n [ngClass]=\"deltaIconTextColorClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></i>\n }\n }\n }\n <span\n class=\"whitespace-nowrap text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"deltaTextColorClass(currentDelta.semantic)\"\n >{{ currentDelta.value }}</span\n >\n </div>\n }\n</ng-template>\n\n@if (isCompact()) {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 shrink-[8] truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n <p\n class=\"min-w-0 truncate text-font-size-6 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n </div>\n} @else {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n <div class=\"flex w-full items-center gap-space-1 overflow-hidden\">\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n </div>\n\n <p\n class=\"w-full truncate text-font-size-7 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n\n @if (hasDelta() || showPeriod()) {\n <div class=\"flex w-full items-center gap-space-1\">\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n @if (showPeriod()) {\n @let periodText =\n empty()\n ? emptyReason() || ('platform.scala-ng.stats_card_empty_reason' | translate)\n : period();\n <p\n class=\"min-w-0 flex-1 truncate text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"periodTextClass()\"\n [sdsTooltip]=\"periodText\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n >\n {{ periodText }}\n </p>\n }\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: SdsTooltipDirective, selector: "[sdsTooltip]", inputs: ["sdsTooltip", "sdsTooltipContext", "sdsTooltipTitle", "sdsTooltipPosition", "sdsTooltipShowArrow", "sdsTooltipOpenDelay", "sdsTooltipTouchDismiss", "sdsTooltipDisabled", "sdsTooltipCheckTruncatedText", "sdsTooltipFocusable", "sdsTooltipDescribeHost", "sdsTooltipAnchor", "sdsTooltipKeepOpenOnPress"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
199
199
  }
200
200
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsStatsCardComponent, decorators: [{
201
201
  type: Component,
202
- args: [{ selector: "sds-stats-card", standalone: true, imports: [NgClass, NgTemplateOutlet, SdsTooltipDirective, TranslatePipe], template: "<ng-template #iconContainer>\n <i\n class=\"w-4 shrink-0 text-center text-[16px] leading-none\"\n [class]=\"icon() ?? ''\"\n [ngClass]=\"iconColorClass()\"\n aria-hidden=\"true\"\n ></i>\n</ng-template>\n\n<ng-template #deltaBlock>\n @let currentDelta = delta();\n @if (currentDelta) {\n <div class=\"flex shrink-0 items-center gap-space-0-50\">\n @if (showDeltaIcon()) {\n @switch (currentDelta.direction) {\n @case (\"flat\") {\n <span\n class=\"h-[2px] w-[8px] rounded-[1px]\"\n [ngClass]=\"deltaDashBackgroundClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></span>\n }\n @default {\n <i\n [class]=\"deltaIconClass(currentDelta.direction)\"\n [ngClass]=\"deltaIconTextColorClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></i>\n }\n }\n }\n <span\n class=\"whitespace-nowrap text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"deltaTextColorClass(currentDelta.semantic)\"\n >{{ currentDelta.value }}</span\n >\n </div>\n }\n</ng-template>\n\n@if (isCompact()) {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 shrink-[8] truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n <p\n class=\"min-w-0 truncate text-font-size-6 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n </div>\n} @else {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n <div class=\"flex w-full items-center gap-space-1 overflow-hidden\">\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n </div>\n\n <p\n class=\"w-full truncate text-font-size-7 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n\n @if (hasDelta() || showPeriod()) {\n <div class=\"flex w-full items-center gap-space-1\">\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n @if (showPeriod()) {\n @let periodText =\n empty()\n ? emptyReason() || (\"platform.scala-ng.stats_card_empty_reason\" | translate)\n : period();\n <p\n class=\"min-w-0 flex-1 truncate text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"periodTextClass()\"\n [sdsTooltip]=\"periodText\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n >\n {{ periodText }}\n </p>\n }\n </div>\n }\n </div>\n}\n" }]
202
+ args: [{ selector: 'sds-stats-card', standalone: true, imports: [NgClass, NgTemplateOutlet, SdsTooltipDirective, TranslatePipe], template: "<ng-template #iconContainer>\n <i\n class=\"w-4 shrink-0 text-center text-[16px] leading-none\"\n [class]=\"icon() ?? ''\"\n [ngClass]=\"iconColorClass()\"\n aria-hidden=\"true\"\n ></i>\n</ng-template>\n\n<ng-template #deltaBlock>\n @let currentDelta = delta();\n @if (currentDelta) {\n <div class=\"flex shrink-0 items-center gap-space-0-50\">\n @if (showDeltaIcon()) {\n @switch (currentDelta.direction) {\n @case ('flat') {\n <span\n class=\"h-[2px] w-[8px] rounded-[1px]\"\n [ngClass]=\"deltaDashBackgroundClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></span>\n }\n @default {\n <i\n [class]=\"deltaIconClass(currentDelta.direction)\"\n [ngClass]=\"deltaIconTextColorClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></i>\n }\n }\n }\n <span\n class=\"whitespace-nowrap text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"deltaTextColorClass(currentDelta.semantic)\"\n >{{ currentDelta.value }}</span\n >\n </div>\n }\n</ng-template>\n\n@if (isCompact()) {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 shrink-[8] truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n <p\n class=\"min-w-0 truncate text-font-size-6 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n </div>\n} @else {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n <div class=\"flex w-full items-center gap-space-1 overflow-hidden\">\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n </div>\n\n <p\n class=\"w-full truncate text-font-size-7 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n\n @if (hasDelta() || showPeriod()) {\n <div class=\"flex w-full items-center gap-space-1\">\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n @if (showPeriod()) {\n @let periodText =\n empty()\n ? emptyReason() || ('platform.scala-ng.stats_card_empty_reason' | translate)\n : period();\n <p\n class=\"min-w-0 flex-1 truncate text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"periodTextClass()\"\n [sdsTooltip]=\"periodText\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n >\n {{ periodText }}\n </p>\n }\n </div>\n }\n </div>\n}\n" }]
203
203
  }] });
204
204
 
205
205
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"seniorsistemas-scala-ng-stats-card.mjs","sources":["../../projects/scala-ng/stats-card/src/stats-card/stats-card.component.ts","../../projects/scala-ng/stats-card/src/stats-card/stats-card.component.html","../../projects/scala-ng/stats-card/seniorsistemas-scala-ng-stats-card.ts"],"sourcesContent":["import { NgClass, NgTemplateOutlet } from \"@angular/common\";\nimport { Component, computed, input, output, signal } from \"@angular/core\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsTooltipDirective } from \"@seniorsistemas/scala-ng/tooltip\";\n\nimport type {\n SdsStatsCardDelta,\n SdsStatsCardDeltaDirection,\n SdsStatsCardDeltaSemantic,\n SdsStatsCardLayout,\n} from \"./stats-card.models\";\n\nconst VALUE_MAX_LENGTH = 10;\n\ntype StatsCardVisualState = \"disabled\" | \"hovered\" | \"default\";\n\n/** Cor do texto do percentual — mesma família usada pelo Badge (`text`). */\nconst DELTA_TEXT_COLOR: Record<SdsStatsCardDeltaSemantic, string> = {\n positive: \"text-color-text-positive\",\n negative: \"text-color-text-destructive\",\n neutral: \"text-color-text-neutral-secondary\",\n};\n\n/** Cor do glifo da seta (caret) — mesma família usada pelo Badge (`icon`), como classe de texto. */\nconst DELTA_ICON_TEXT_COLOR: Record<SdsStatsCardDeltaSemantic, string> = {\n positive: \"text-color-icon-positive\",\n negative: \"text-color-icon-destructive\",\n neutral: \"text-[var(--sds-color-icon-neutral)]\",\n};\n\n/** Cor de preenchimento do traço (Direction=\"flat\") — mesma família de `icon`, como background. */\nconst DELTA_DASH_BACKGROUND_COLOR: Record<SdsStatsCardDeltaSemantic, string> = {\n positive: \"bg-[var(--sds-color-icon-positive)]\",\n negative: \"bg-[var(--sds-color-icon-destructive)]\",\n neutral: \"bg-[var(--sds-color-icon-neutral)]\",\n};\n\n@Component({\n selector: \"sds-stats-card\",\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, SdsTooltipDirective, TranslatePipe],\n templateUrl: \"./stats-card.component.html\",\n})\nexport class SdsStatsCardComponent {\n /** Nome curto da métrica (2-3 palavras), sempre visível. */\n readonly label = input.required<string>();\n /** Valor principal. Trunca em 10 caracteres + reticências, com tooltip mostrando o valor completo. */\n readonly value = input.required<string>();\n /** Classe do ícone FontAwesome exibido no leading do card (ex.: \"fa-solid fa-arrow-trend-up\"). Sem ícone quando omitido. */\n readonly icon = input<string>();\n /** \"default\" = bloco vertical (ícone+rótulo, valor, delta+período). \"compact\" = linha única (ícone+rótulo+valor+delta), sem período. */\n readonly layout = input<SdsStatsCardLayout>(\"default\");\n /** Contexto temporal do delta (ex.: \"vs. mês anterior\"). Pode existir sem delta. Sem efeito em `layout=\"compact\"`. */\n readonly period = input<string>();\n /** Indicador de tendência. Ausente = bloco de delta oculto. */\n readonly delta = input<SdsStatsCardDelta>();\n /** Desabilita a interatividade do card inteiro. */\n readonly disabled = input<boolean>(false);\n /** Exibe o estado vazio (sem dados): \"—\" no lugar do valor e o motivo no lugar do período, mantendo o chassi do card. */\n readonly empty = input<boolean>(false);\n /** Motivo exibido no estado vazio do layout padrão. Padrão traduzido: \"sem histórico suficiente\". */\n readonly emptyReason = input<string>();\n\n /** Emitido ao ativar o card (clique, Enter ou Espaço) quando ele está interativo. */\n readonly cardClick = output<void>();\n\n protected readonly isHovered = signal(false);\n protected readonly isFocused = signal(false);\n\n protected readonly isCompact = computed(() => this.layout() === \"compact\");\n protected readonly hasIcon = computed(() => !!this.icon());\n protected readonly hasDelta = computed(() => !this.empty() && !!this.delta());\n protected readonly showDeltaIcon = computed(() => this.delta()?.showIcon ?? true);\n protected readonly showPeriod = computed(\n () => !this.isCompact() && (this.empty() || !!this.period()),\n );\n protected readonly isInteractive = computed(() => !this.disabled() && !this.empty());\n\n protected readonly isValueTruncated = computed(\n () => !this.empty() && this.value().length > VALUE_MAX_LENGTH,\n );\n protected readonly truncatedValue = computed(() => {\n const value = this.value();\n return this.isValueTruncated() ? `${value.slice(0, VALUE_MAX_LENGTH)}…` : value;\n });\n\n protected readonly displayValue = computed(() => (this.empty() ? \"—\" : this.truncatedValue()));\n\n protected readonly containerTabIndex = computed<number | null>(() => {\n if (this.disabled()) {\n return -1;\n }\n return this.empty() ? null : 0;\n });\n\n private readonly visualState = computed<StatsCardVisualState>(() => {\n if (this.disabled()) {\n return \"disabled\";\n }\n if (this.isHovered() && this.isInteractive()) {\n return \"hovered\";\n }\n return \"default\";\n });\n\n protected readonly containerClasses = computed(() => {\n const layoutClasses = this.isCompact()\n ? {\n flex: true,\n \"w-fit\": true,\n \"max-w-full\": true,\n \"items-center\": true,\n \"gap-space-1\": true,\n \"px-space-1-5\": true,\n \"py-space-1\": true,\n }\n : {\n flex: true,\n \"w-full\": true,\n \"flex-col\": true,\n \"items-start\": true,\n \"gap-space-1-5\": true,\n \"p-space-2\": true,\n };\n\n const interactivityClasses = {\n \"cursor-pointer\": this.isInteractive(),\n \"cursor-not-allowed\": this.disabled(),\n };\n\n const stateClasses = (() => {\n switch (this.visualState()) {\n case \"disabled\": {\n return {\n \"bg-color-background-disable\": true,\n };\n }\n case \"hovered\": {\n return {\n \"bg-color-background-interactive-secondary-hovered\": true,\n };\n }\n default: {\n return {\n \"bg-surface-default\": true,\n };\n }\n }\n })();\n\n // The stroke is an inset outline (as in Figma), so it never adds to the card's box size.\n const isFocusRing = this.isFocused() && !this.disabled();\n const strokeClasses = {\n outline: true,\n \"outline-1\": !isFocusRing,\n \"outline-offset-[-1px]\": !isFocusRing,\n \"outline-2\": isFocusRing,\n \"outline-offset-[-2px]\": isFocusRing,\n };\n\n const outlineColorClasses = (() => {\n if (isFocusRing) {\n return { \"outline-color-border-focused\": true };\n }\n return this.disabled()\n ? { \"outline-color-border-disable\": true }\n : { \"outline-color-border\": true };\n })();\n\n return {\n ...layoutClasses,\n ...interactivityClasses,\n ...stateClasses,\n ...strokeClasses,\n ...outlineColorClasses,\n };\n });\n\n protected readonly iconColorClass = computed(() =>\n this.disabled() ? \"text-color-icon-disable\" : \"text-[var(--sds-color-icon-neutral)]\",\n );\n\n protected readonly labelTextClass = computed(() =>\n this.disabled() ? \"text-color-text-disable\" : \"text-color-text-neutral-secondary\",\n );\n\n protected readonly valueTextClass = computed(() => {\n if (this.disabled()) {\n return \"text-color-text-disable\";\n }\n return this.empty() ? \"text-color-text-neutral-secondary\" : \"text-color-text-neutral-primary\";\n });\n\n protected readonly periodTextClass = computed(() =>\n this.disabled() ? \"text-color-text-disable\" : \"text-color-text-neutral-secondary\",\n );\n\n /** Só chamado para \"up\"/\"down\" no template — \"flat\" renderiza o traço via `deltaDashBackgroundClass`, não um ícone. */\n protected deltaIconClass(direction: SdsStatsCardDeltaDirection): string {\n switch (direction) {\n case \"up\": {\n return \"fa-solid fa-caret-up\";\n }\n case \"down\": {\n return \"fa-solid fa-caret-down\";\n }\n case \"flat\": {\n return \"\";\n }\n }\n }\n\n protected deltaTextColorClass(semantic: SdsStatsCardDeltaSemantic): string {\n return this.disabled() ? \"text-color-text-disable\" : DELTA_TEXT_COLOR[semantic];\n }\n\n protected deltaIconTextColorClass(semantic: SdsStatsCardDeltaSemantic): string {\n return this.disabled() ? \"text-color-icon-disable\" : DELTA_ICON_TEXT_COLOR[semantic];\n }\n\n protected deltaDashBackgroundClass(semantic: SdsStatsCardDeltaSemantic): string {\n return this.disabled() ? \"bg-color-icon-disable\" : DELTA_DASH_BACKGROUND_COLOR[semantic];\n }\n\n protected handleClick(): void {\n if (!this.isInteractive()) {\n return;\n }\n this.cardClick.emit();\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (!this.isInteractive()) {\n return;\n }\n switch (event.key) {\n case \"Enter\":\n case \" \": {\n event.preventDefault();\n this.cardClick.emit();\n break;\n }\n default: {\n break;\n }\n }\n }\n}\n","<ng-template #iconContainer>\n <i\n class=\"w-4 shrink-0 text-center text-[16px] leading-none\"\n [class]=\"icon() ?? ''\"\n [ngClass]=\"iconColorClass()\"\n aria-hidden=\"true\"\n ></i>\n</ng-template>\n\n<ng-template #deltaBlock>\n @let currentDelta = delta();\n @if (currentDelta) {\n <div class=\"flex shrink-0 items-center gap-space-0-50\">\n @if (showDeltaIcon()) {\n @switch (currentDelta.direction) {\n @case (\"flat\") {\n <span\n class=\"h-[2px] w-[8px] rounded-[1px]\"\n [ngClass]=\"deltaDashBackgroundClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></span>\n }\n @default {\n <i\n [class]=\"deltaIconClass(currentDelta.direction)\"\n [ngClass]=\"deltaIconTextColorClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></i>\n }\n }\n }\n <span\n class=\"whitespace-nowrap text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"deltaTextColorClass(currentDelta.semantic)\"\n >{{ currentDelta.value }}</span\n >\n </div>\n }\n</ng-template>\n\n@if (isCompact()) {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 shrink-[8] truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n <p\n class=\"min-w-0 truncate text-font-size-6 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n </div>\n} @else {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n <div class=\"flex w-full items-center gap-space-1 overflow-hidden\">\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n </div>\n\n <p\n class=\"w-full truncate text-font-size-7 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n\n @if (hasDelta() || showPeriod()) {\n <div class=\"flex w-full items-center gap-space-1\">\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n @if (showPeriod()) {\n @let periodText =\n empty()\n ? emptyReason() || (\"platform.scala-ng.stats_card_empty_reason\" | translate)\n : period();\n <p\n class=\"min-w-0 flex-1 truncate text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"periodTextClass()\"\n [sdsTooltip]=\"periodText\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n [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AAA,EAAA,IAAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAG5D,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,4mKAAA,EAAA,CAAA;;;AExC1E;;AAEG;;;;"}
1
+ {"version":3,"file":"seniorsistemas-scala-ng-stats-card.mjs","sources":["../../projects/scala-ng/stats-card/src/stats-card/stats-card.component.ts","../../projects/scala-ng/stats-card/src/stats-card/stats-card.component.html","../../projects/scala-ng/stats-card/seniorsistemas-scala-ng-stats-card.ts"],"sourcesContent":["import { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { Component, computed, input, output, signal } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { SdsTooltipDirective } from '@seniorsistemas/scala-ng/tooltip';\n\nimport type {\n SdsStatsCardDelta,\n SdsStatsCardDeltaDirection,\n SdsStatsCardDeltaSemantic,\n SdsStatsCardLayout,\n} from './stats-card.models';\n\nconst VALUE_MAX_LENGTH = 10;\n\ntype StatsCardVisualState = 'disabled' | 'hovered' | 'default';\n\n/** Cor do texto do percentual — mesma família usada pelo Badge (`text`). */\nconst DELTA_TEXT_COLOR: Record<SdsStatsCardDeltaSemantic, string> = {\n positive: 'text-color-text-positive',\n negative: 'text-color-text-destructive',\n neutral: 'text-color-text-neutral-secondary',\n};\n\n/** Cor do glifo da seta (caret) — mesma família usada pelo Badge (`icon`), como classe de texto. */\nconst DELTA_ICON_TEXT_COLOR: Record<SdsStatsCardDeltaSemantic, string> = {\n positive: 'text-color-icon-positive',\n negative: 'text-color-icon-destructive',\n neutral: 'text-[var(--sds-color-icon-neutral)]',\n};\n\n/** Cor de preenchimento do traço (Direction=\"flat\") — mesma família de `icon`, como background. */\nconst DELTA_DASH_BACKGROUND_COLOR: Record<SdsStatsCardDeltaSemantic, string> = {\n positive: 'bg-[var(--sds-color-icon-positive)]',\n negative: 'bg-[var(--sds-color-icon-destructive)]',\n neutral: 'bg-[var(--sds-color-icon-neutral)]',\n};\n\n@Component({\n selector: 'sds-stats-card',\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, SdsTooltipDirective, TranslatePipe],\n templateUrl: './stats-card.component.html',\n})\nexport class SdsStatsCardComponent {\n /** Nome curto da métrica (2-3 palavras), sempre visível. */\n readonly label = input.required<string>();\n /** Valor principal. Trunca em 10 caracteres + reticências, com tooltip mostrando o valor completo. */\n readonly value = input.required<string>();\n /** Classe do ícone FontAwesome exibido no leading do card (ex.: \"fa-solid fa-arrow-trend-up\"). Sem ícone quando omitido. */\n readonly icon = input<string>();\n /** \"default\" = bloco vertical (ícone+rótulo, valor, delta+período). \"compact\" = linha única (ícone+rótulo+valor+delta), sem período. */\n readonly layout = input<SdsStatsCardLayout>('default');\n /** Contexto temporal do delta (ex.: \"vs. mês anterior\"). Pode existir sem delta. Sem efeito em `layout=\"compact\"`. */\n readonly period = input<string>();\n /** Indicador de tendência. Ausente = bloco de delta oculto. */\n readonly delta = input<SdsStatsCardDelta>();\n /** Desabilita a interatividade do card inteiro. */\n readonly disabled = input<boolean>(false);\n /** Exibe o estado vazio (sem dados): \"—\" no lugar do valor e o motivo no lugar do período, mantendo o chassi do card. */\n readonly empty = input<boolean>(false);\n /** Motivo exibido no estado vazio do layout padrão. Padrão traduzido: \"sem histórico suficiente\". */\n readonly emptyReason = input<string>();\n\n /** Emitido ao ativar o card (clique, Enter ou Espaço) quando ele está interativo. */\n readonly cardClick = output<void>();\n\n protected readonly isHovered = signal(false);\n protected readonly isFocused = signal(false);\n\n protected readonly isCompact = computed(() => this.layout() === 'compact');\n protected readonly hasIcon = computed(() => !!this.icon());\n protected readonly hasDelta = computed(() => !this.empty() && !!this.delta());\n protected readonly showDeltaIcon = computed(() => this.delta()?.showIcon ?? true);\n protected readonly showPeriod = computed(\n () => !this.isCompact() && (this.empty() || !!this.period()),\n );\n protected readonly isInteractive = computed(() => !this.disabled() && !this.empty());\n\n protected readonly isValueTruncated = computed(\n () => !this.empty() && this.value().length > VALUE_MAX_LENGTH,\n );\n protected readonly truncatedValue = computed(() => {\n const value = this.value();\n return this.isValueTruncated() ? `${value.slice(0, VALUE_MAX_LENGTH)}…` : value;\n });\n\n protected readonly displayValue = computed(() => (this.empty() ? '—' : this.truncatedValue()));\n\n protected readonly containerTabIndex = computed<number | null>(() => {\n if (this.disabled()) {\n return -1;\n }\n return this.empty() ? null : 0;\n });\n\n private readonly visualState = computed<StatsCardVisualState>(() => {\n if (this.disabled()) {\n return 'disabled';\n }\n if (this.isHovered() && this.isInteractive()) {\n return 'hovered';\n }\n return 'default';\n });\n\n protected readonly containerClasses = computed(() => {\n const layoutClasses = this.isCompact()\n ? {\n flex: true,\n 'w-fit': true,\n 'max-w-full': true,\n 'items-center': true,\n 'gap-space-1': true,\n 'px-space-1-5': true,\n 'py-space-1': true,\n }\n : {\n flex: true,\n 'w-full': true,\n 'flex-col': true,\n 'items-start': true,\n 'gap-space-1-5': true,\n 'p-space-2': true,\n };\n\n const interactivityClasses = {\n 'cursor-pointer': this.isInteractive(),\n 'cursor-not-allowed': this.disabled(),\n };\n\n const stateClasses = (() => {\n switch (this.visualState()) {\n case 'disabled': {\n return {\n 'bg-color-background-disable': true,\n };\n }\n case 'hovered': {\n return {\n 'bg-color-background-interactive-secondary-hovered': true,\n };\n }\n default: {\n return {\n 'bg-surface-default': true,\n };\n }\n }\n })();\n\n // The stroke is an inset outline (as in Figma), so it never adds to the card's box size.\n const isFocusRing = this.isFocused() && !this.disabled();\n const strokeClasses = {\n outline: true,\n 'outline-1': !isFocusRing,\n 'outline-offset-[-1px]': !isFocusRing,\n 'outline-2': isFocusRing,\n 'outline-offset-[-2px]': isFocusRing,\n };\n\n const outlineColorClasses = (() => {\n if (isFocusRing) {\n return { 'outline-color-border-focused': true };\n }\n return this.disabled()\n ? { 'outline-color-border-disable': true }\n : { 'outline-color-border': true };\n })();\n\n return {\n ...layoutClasses,\n ...interactivityClasses,\n ...stateClasses,\n ...strokeClasses,\n ...outlineColorClasses,\n };\n });\n\n protected readonly iconColorClass = computed(() =>\n this.disabled() ? 'text-color-icon-disable' : 'text-[var(--sds-color-icon-neutral)]',\n );\n\n protected readonly labelTextClass = computed(() =>\n this.disabled() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary',\n );\n\n protected readonly valueTextClass = computed(() => {\n if (this.disabled()) {\n return 'text-color-text-disable';\n }\n return this.empty() ? 'text-color-text-neutral-secondary' : 'text-color-text-neutral-primary';\n });\n\n protected readonly periodTextClass = computed(() =>\n this.disabled() ? 'text-color-text-disable' : 'text-color-text-neutral-secondary',\n );\n\n /** Só chamado para \"up\"/\"down\" no template — \"flat\" renderiza o traço via `deltaDashBackgroundClass`, não um ícone. */\n protected deltaIconClass(direction: SdsStatsCardDeltaDirection): string {\n switch (direction) {\n case 'up': {\n return 'fa-solid fa-caret-up';\n }\n case 'down': {\n return 'fa-solid fa-caret-down';\n }\n case 'flat': {\n return '';\n }\n }\n }\n\n protected deltaTextColorClass(semantic: SdsStatsCardDeltaSemantic): string {\n return this.disabled() ? 'text-color-text-disable' : DELTA_TEXT_COLOR[semantic];\n }\n\n protected deltaIconTextColorClass(semantic: SdsStatsCardDeltaSemantic): string {\n return this.disabled() ? 'text-color-icon-disable' : DELTA_ICON_TEXT_COLOR[semantic];\n }\n\n protected deltaDashBackgroundClass(semantic: SdsStatsCardDeltaSemantic): string {\n return this.disabled() ? 'bg-color-icon-disable' : DELTA_DASH_BACKGROUND_COLOR[semantic];\n }\n\n protected handleClick(): void {\n if (!this.isInteractive()) {\n return;\n }\n this.cardClick.emit();\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n if (!this.isInteractive()) {\n return;\n }\n switch (event.key) {\n case 'Enter':\n case ' ': {\n event.preventDefault();\n this.cardClick.emit();\n break;\n }\n default: {\n break;\n }\n }\n }\n}\n","<ng-template #iconContainer>\n <i\n class=\"w-4 shrink-0 text-center text-[16px] leading-none\"\n [class]=\"icon() ?? ''\"\n [ngClass]=\"iconColorClass()\"\n aria-hidden=\"true\"\n ></i>\n</ng-template>\n\n<ng-template #deltaBlock>\n @let currentDelta = delta();\n @if (currentDelta) {\n <div class=\"flex shrink-0 items-center gap-space-0-50\">\n @if (showDeltaIcon()) {\n @switch (currentDelta.direction) {\n @case ('flat') {\n <span\n class=\"h-[2px] w-[8px] rounded-[1px]\"\n [ngClass]=\"deltaDashBackgroundClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></span>\n }\n @default {\n <i\n [class]=\"deltaIconClass(currentDelta.direction)\"\n [ngClass]=\"deltaIconTextColorClass(currentDelta.semantic)\"\n aria-hidden=\"true\"\n ></i>\n }\n }\n }\n <span\n class=\"whitespace-nowrap text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"deltaTextColorClass(currentDelta.semantic)\"\n >{{ currentDelta.value }}</span\n >\n </div>\n }\n</ng-template>\n\n@if (isCompact()) {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 shrink-[8] truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n <p\n class=\"min-w-0 truncate text-font-size-6 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n </div>\n} @else {\n <div\n class=\"rounded-radius-xlarge transition-colors duration-150\"\n [ngClass]=\"containerClasses()\"\n [attr.role]=\"empty() ? null : 'button'\"\n [attr.tabindex]=\"containerTabIndex()\"\n [attr.aria-disabled]=\"disabled() ? 'true' : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n >\n <div class=\"flex w-full items-center gap-space-1 overflow-hidden\">\n @if (hasIcon()) {\n <ng-container *ngTemplateOutlet=\"iconContainer\" />\n }\n <p\n class=\"min-w-0 truncate text-font-size-2 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"labelTextClass()\"\n [sdsTooltip]=\"label()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n >\n {{ label() }}\n </p>\n </div>\n\n <p\n class=\"w-full truncate text-font-size-7 font-font-weight-medium leading-line-height-125\"\n [ngClass]=\"valueTextClass()\"\n [sdsTooltip]=\"value()\"\n [sdsTooltipDisabled]=\"empty()\"\n [sdsTooltipCheckTruncatedText]=\"!isValueTruncated()\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n [attr.aria-hidden]=\"empty() || isValueTruncated() ? 'true' : null\"\n >\n {{ displayValue() }}\n </p>\n @if (isValueTruncated()) {\n <span class=\"sr-only\">{{ value() }}</span>\n }\n\n @if (hasDelta() || showPeriod()) {\n <div class=\"flex w-full items-center gap-space-1\">\n @if (hasDelta()) {\n <ng-container *ngTemplateOutlet=\"deltaBlock\" />\n }\n @if (showPeriod()) {\n @let periodText =\n empty()\n ? emptyReason() || ('platform.scala-ng.stats_card_empty_reason' | translate)\n : period();\n <p\n class=\"min-w-0 flex-1 truncate text-font-size-2 font-font-weight-regular leading-line-height-150\"\n [ngClass]=\"periodTextClass()\"\n [sdsTooltip]=\"periodText\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n [sdsTooltipFocusable]=\"false\"\n [sdsTooltipPosition]=\"'bottom'\"\n >\n {{ periodText }}\n </p>\n }\n </div>\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAYA,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAI5B;AACA,MAAM,gBAAgB,GAA8C;AAClE,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,QAAQ,EAAE,6BAA6B;AACvC,IAAA,OAAO,EAAE,mCAAmC;CAC7C,CAAC;AAEF;AACA,MAAM,qBAAqB,GAA8C;AACvE,IAAA,QAAQ,EAAE,0BAA0B;AACpC,IAAA,QAAQ,EAAE,6BAA6B;AACvC,IAAA,OAAO,EAAE,sCAAsC;CAChD,CAAC;AAEF;AACA,MAAM,2BAA2B,GAA8C;AAC7E,IAAA,QAAQ,EAAE,qCAAqC;AAC/C,IAAA,QAAQ,EAAE,wCAAwC;AAClD,IAAA,OAAO,EAAE,oCAAoC;CAC9C,CAAC;MAQW,qBAAqB,CAAA;;AAEvB,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;;AAEjC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;;IAEjC,IAAI,GAAG,KAAK,EAAU,CAAC;;AAEvB,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A,EAAA,OAAO,oFAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,mBAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,qBAAA,EAAA,qBAAA,EAAA,wBAAA,EAAA,oBAAA,EAAA,8BAAA,EAAA,qBAAA,EAAA,wBAAA,EAAA,kBAAA,EAAA,2BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAG5D,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;+BACE,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,OAAA,EACP,CAAC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,wmKAAA,EAAA,CAAA;;;AExC1E;;AAEG;;;;"}
@@ -12,13 +12,13 @@ class SdsSwitchComponent {
12
12
  /** Text shown next to the control; used as `aria-label` when `showLabel` is `false`. */
13
13
  label = input.required();
14
14
  /** Secondary text shown below the label. */
15
- description = input("");
15
+ description = input('');
16
16
  /** Shows the label text; when `false`, the label becomes the native input's `aria-label`. */
17
17
  showLabel = input(true);
18
18
  /** Shows the description when `description` is non-empty. */
19
19
  showDescription = input(true);
20
20
  /** `"inline"`: control before the text. `"row"`: text on the left, control on the right, full width. */
21
- layout = input("inline");
21
+ layout = input('inline');
22
22
  /** Disables the switch; combined with the form's disabled state. */
23
23
  disabled = input(false);
24
24
  /** Keeps the switch focusable but ignores clicks and keyboard input. */
@@ -80,11 +80,11 @@ class SdsSwitchComponent {
80
80
  return false;
81
81
  }
82
82
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
83
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsSwitchComponent, isStandalone: true, selector: "sds-switch", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, showDescription: { classPropertyName: "showDescription", publicName: "showDescription", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed", focused: "focused", blurred: "blurred" }, ngImport: i0, template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly() && !disabled;\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n@let isRow = layout() === \"row\";\n@let trackHasBorder = disabled || isReadonly || !checked;\n@let hasDescription = showDescription() && description();\n\n<label\n class=\"inline-flex min-h-6 gap-space-1\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [class.w-full]=\"isRow\"\n [class.items-start]=\"isRow\"\n [class.justify-between]=\"isRow\"\n [class.gap-space-4]=\"isRow\"\n [class.items-center]=\"!isRow\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-checked]=\"checked ? 'true' : 'false'\"\n [attr.aria-label]=\"!showLabel() ? label() : null\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n (change)=\"toggle()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex h-5 w-9 shrink-0 items-center rounded-radius-full p-space-0-25 transition-colors duration-150 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-color-border-focused\"\n aria-hidden=\"true\"\n [class.order-1]=\"!isRow\"\n [class.order-2]=\"isRow\"\n [class.border]=\"trackHasBorder\"\n [class.border-solid]=\"trackHasBorder\"\n [class.justify-end]=\"checked\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold': normal && checked && !hovered,\n 'bg-color-background-selected-bold-hovered': normal && checked && hovered,\n 'bg-color-background-interactive-secondary-bold': normal && !checked && !hovered,\n 'bg-color-background-interactive-secondary-bold-hovered': normal && !checked && hovered,\n 'bg-color-background-disable': disabled,\n 'border-color-border-disable': trackHasBorder && (disabled || isReadonly),\n 'border-color-border-interactive-secondary': trackHasBorder && normal && !checked,\n }\"\n >\n <div\n class=\"relative size-4 shrink-0 rounded-radius-full\"\n [ngClass]=\"{\n 'bg-color-icon-interactive-primary': normal,\n 'bg-color-icon-disable': disabled,\n 'bg-color-icon-interactive-secondary': isReadonly,\n }\"\n ></div>\n\n @if (error) {\n <div\n class=\"sds-switch__error-ring absolute h-5 w-9 rounded-radius-full border border-solid border-color-border-destructive\"\n [ngClass]=\"trackHasBorder ? '-left-px -top-px' : 'left-0 top-0'\"\n ></div>\n }\n </div>\n\n @if (showLabel() || hasDescription) {\n <div\n class=\"flex flex-col gap-space-1\"\n [class.order-1]=\"isRow\"\n [class.order-2]=\"!isRow\"\n [class.w-full]=\"isRow\"\n >\n @if (showLabel()) {\n <span\n class=\"sds-switch__label select-none text-font-size-2 leading-line-height-150\"\n [ngClass]=\"{\n 'font-font-weight-regular': !isRow,\n 'font-font-weight-medium': isRow,\n 'leading-line-height-125': isRow,\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ label() }}</span\n >\n }\n @if (hasDescription) {\n <span\n class=\"sds-switch__description select-none leading-line-height-150\"\n [ngClass]=\"{\n 'text-font-size-1': !isRow,\n 'text-font-size-2': isRow,\n 'text-color-text-neutral-secondary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ description() }}</span\n >\n }\n </div>\n }\n</label>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
83
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsSwitchComponent, isStandalone: true, selector: "sds-switch", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, showDescription: { classPropertyName: "showDescription", publicName: "showDescription", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed", focused: "focused", blurred: "blurred" }, ngImport: i0, template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly() && !disabled;\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n@let isRow = layout() === 'row';\n@let trackHasBorder = disabled || isReadonly || !checked;\n@let hasDescription = showDescription() && description();\n\n<label\n class=\"inline-flex min-h-6 gap-space-1\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [class.w-full]=\"isRow\"\n [class.items-start]=\"isRow\"\n [class.justify-between]=\"isRow\"\n [class.gap-space-4]=\"isRow\"\n [class.items-center]=\"!isRow\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-checked]=\"checked ? 'true' : 'false'\"\n [attr.aria-label]=\"!showLabel() ? label() : null\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n (change)=\"toggle()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex h-5 w-9 shrink-0 items-center rounded-radius-full p-space-0-25 transition-colors duration-150 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-color-border-focused\"\n aria-hidden=\"true\"\n [class.order-1]=\"!isRow\"\n [class.order-2]=\"isRow\"\n [class.border]=\"trackHasBorder\"\n [class.border-solid]=\"trackHasBorder\"\n [class.justify-end]=\"checked\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold': normal && checked && !hovered,\n 'bg-color-background-selected-bold-hovered': normal && checked && hovered,\n 'bg-color-background-interactive-secondary-bold': normal && !checked && !hovered,\n 'bg-color-background-interactive-secondary-bold-hovered': normal && !checked && hovered,\n 'bg-color-background-disable': disabled,\n 'border-color-border-disable': trackHasBorder && (disabled || isReadonly),\n 'border-color-border-interactive-secondary': trackHasBorder && normal && !checked,\n }\"\n >\n <div\n class=\"relative size-4 shrink-0 rounded-radius-full\"\n [ngClass]=\"{\n 'bg-color-icon-interactive-primary': normal,\n 'bg-color-icon-disable': disabled,\n 'bg-color-icon-interactive-secondary': isReadonly,\n }\"\n ></div>\n\n @if (error) {\n <div\n class=\"sds-switch__error-ring absolute h-5 w-9 rounded-radius-full border border-solid border-color-border-destructive\"\n [ngClass]=\"trackHasBorder ? '-left-px -top-px' : 'left-0 top-0'\"\n ></div>\n }\n </div>\n\n @if (showLabel() || hasDescription) {\n <div\n class=\"flex flex-col gap-space-1\"\n [class.order-1]=\"isRow\"\n [class.order-2]=\"!isRow\"\n [class.w-full]=\"isRow\"\n >\n @if (showLabel()) {\n <span\n class=\"sds-switch__label select-none text-font-size-2 leading-line-height-150\"\n [ngClass]=\"{\n 'font-font-weight-regular': !isRow,\n 'font-font-weight-medium': isRow,\n 'leading-line-height-125': isRow,\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ label() }}</span\n >\n }\n @if (hasDescription) {\n <span\n class=\"sds-switch__description select-none leading-line-height-150\"\n [ngClass]=\"{\n 'text-font-size-1': !isRow,\n 'text-font-size-2': isRow,\n 'text-color-text-neutral-secondary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ description() }}</span\n >\n }\n </div>\n }\n</label>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
84
84
  }
85
85
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsSwitchComponent, decorators: [{
86
86
  type: Component,
87
- args: [{ selector: "sds-switch", standalone: true, imports: [NgClass], template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly() && !disabled;\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n@let isRow = layout() === \"row\";\n@let trackHasBorder = disabled || isReadonly || !checked;\n@let hasDescription = showDescription() && description();\n\n<label\n class=\"inline-flex min-h-6 gap-space-1\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [class.w-full]=\"isRow\"\n [class.items-start]=\"isRow\"\n [class.justify-between]=\"isRow\"\n [class.gap-space-4]=\"isRow\"\n [class.items-center]=\"!isRow\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-checked]=\"checked ? 'true' : 'false'\"\n [attr.aria-label]=\"!showLabel() ? label() : null\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n (change)=\"toggle()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex h-5 w-9 shrink-0 items-center rounded-radius-full p-space-0-25 transition-colors duration-150 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-color-border-focused\"\n aria-hidden=\"true\"\n [class.order-1]=\"!isRow\"\n [class.order-2]=\"isRow\"\n [class.border]=\"trackHasBorder\"\n [class.border-solid]=\"trackHasBorder\"\n [class.justify-end]=\"checked\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold': normal && checked && !hovered,\n 'bg-color-background-selected-bold-hovered': normal && checked && hovered,\n 'bg-color-background-interactive-secondary-bold': normal && !checked && !hovered,\n 'bg-color-background-interactive-secondary-bold-hovered': normal && !checked && hovered,\n 'bg-color-background-disable': disabled,\n 'border-color-border-disable': trackHasBorder && (disabled || isReadonly),\n 'border-color-border-interactive-secondary': trackHasBorder && normal && !checked,\n }\"\n >\n <div\n class=\"relative size-4 shrink-0 rounded-radius-full\"\n [ngClass]=\"{\n 'bg-color-icon-interactive-primary': normal,\n 'bg-color-icon-disable': disabled,\n 'bg-color-icon-interactive-secondary': isReadonly,\n }\"\n ></div>\n\n @if (error) {\n <div\n class=\"sds-switch__error-ring absolute h-5 w-9 rounded-radius-full border border-solid border-color-border-destructive\"\n [ngClass]=\"trackHasBorder ? '-left-px -top-px' : 'left-0 top-0'\"\n ></div>\n }\n </div>\n\n @if (showLabel() || hasDescription) {\n <div\n class=\"flex flex-col gap-space-1\"\n [class.order-1]=\"isRow\"\n [class.order-2]=\"!isRow\"\n [class.w-full]=\"isRow\"\n >\n @if (showLabel()) {\n <span\n class=\"sds-switch__label select-none text-font-size-2 leading-line-height-150\"\n [ngClass]=\"{\n 'font-font-weight-regular': !isRow,\n 'font-font-weight-medium': isRow,\n 'leading-line-height-125': isRow,\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ label() }}</span\n >\n }\n @if (hasDescription) {\n <span\n class=\"sds-switch__description select-none leading-line-height-150\"\n [ngClass]=\"{\n 'text-font-size-1': !isRow,\n 'text-font-size-2': isRow,\n 'text-color-text-neutral-secondary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ description() }}</span\n >\n }\n </div>\n }\n</label>\n" }]
87
+ args: [{ selector: 'sds-switch', standalone: true, imports: [NgClass], template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly() && !disabled;\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n@let isRow = layout() === 'row';\n@let trackHasBorder = disabled || isReadonly || !checked;\n@let hasDescription = showDescription() && description();\n\n<label\n class=\"inline-flex min-h-6 gap-space-1\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [class.w-full]=\"isRow\"\n [class.items-start]=\"isRow\"\n [class.justify-between]=\"isRow\"\n [class.gap-space-4]=\"isRow\"\n [class.items-center]=\"!isRow\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-checked]=\"checked ? 'true' : 'false'\"\n [attr.aria-label]=\"!showLabel() ? label() : null\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n (change)=\"toggle()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex h-5 w-9 shrink-0 items-center rounded-radius-full p-space-0-25 transition-colors duration-150 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-color-border-focused\"\n aria-hidden=\"true\"\n [class.order-1]=\"!isRow\"\n [class.order-2]=\"isRow\"\n [class.border]=\"trackHasBorder\"\n [class.border-solid]=\"trackHasBorder\"\n [class.justify-end]=\"checked\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold': normal && checked && !hovered,\n 'bg-color-background-selected-bold-hovered': normal && checked && hovered,\n 'bg-color-background-interactive-secondary-bold': normal && !checked && !hovered,\n 'bg-color-background-interactive-secondary-bold-hovered': normal && !checked && hovered,\n 'bg-color-background-disable': disabled,\n 'border-color-border-disable': trackHasBorder && (disabled || isReadonly),\n 'border-color-border-interactive-secondary': trackHasBorder && normal && !checked,\n }\"\n >\n <div\n class=\"relative size-4 shrink-0 rounded-radius-full\"\n [ngClass]=\"{\n 'bg-color-icon-interactive-primary': normal,\n 'bg-color-icon-disable': disabled,\n 'bg-color-icon-interactive-secondary': isReadonly,\n }\"\n ></div>\n\n @if (error) {\n <div\n class=\"sds-switch__error-ring absolute h-5 w-9 rounded-radius-full border border-solid border-color-border-destructive\"\n [ngClass]=\"trackHasBorder ? '-left-px -top-px' : 'left-0 top-0'\"\n ></div>\n }\n </div>\n\n @if (showLabel() || hasDescription) {\n <div\n class=\"flex flex-col gap-space-1\"\n [class.order-1]=\"isRow\"\n [class.order-2]=\"!isRow\"\n [class.w-full]=\"isRow\"\n >\n @if (showLabel()) {\n <span\n class=\"sds-switch__label select-none text-font-size-2 leading-line-height-150\"\n [ngClass]=\"{\n 'font-font-weight-regular': !isRow,\n 'font-font-weight-medium': isRow,\n 'leading-line-height-125': isRow,\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ label() }}</span\n >\n }\n @if (hasDescription) {\n <span\n class=\"sds-switch__description select-none leading-line-height-150\"\n [ngClass]=\"{\n 'text-font-size-1': !isRow,\n 'text-font-size-2': isRow,\n 'text-color-text-neutral-secondary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ description() }}</span\n >\n }\n </div>\n }\n</label>\n" }]
88
88
  }], ctorParameters: () => [] });
89
89
 
90
90
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"seniorsistemas-scala-ng-switch.mjs","sources":["../../projects/scala-ng/switch/src/switch/switch.component.ts","../../projects/scala-ng/switch/src/switch/switch.component.html","../../projects/scala-ng/switch/seniorsistemas-scala-ng-switch.ts"],"sourcesContent":["import { NgClass } from \"@angular/common\";\nimport { Component, computed, inject, input, output, signal } from \"@angular/core\";\nimport {\n ControlValueAccessor,\n FormControlDirective,\n FormControlName,\n NgControl,\n NgModel,\n} from \"@angular/forms\";\n\n@Component({\n selector: \"sds-switch\",\n standalone: true,\n imports: [NgClass],\n templateUrl: \"./switch.component.html\",\n})\nexport class SdsSwitchComponent implements ControlValueAccessor {\n private static idCounter = 0;\n\n private static nextId(): string {\n SdsSwitchComponent.idCounter++;\n return `sds-switch-${SdsSwitchComponent.idCounter}`;\n }\n\n /** Text shown next to the control; used as `aria-label` when `showLabel` is `false`. */\n readonly label = input.required<string>();\n\n /** Secondary text shown below the label. */\n readonly description = input(\"\");\n\n /** Shows the label text; when `false`, the label becomes the native input's `aria-label`. */\n readonly showLabel = input(true);\n\n /** Shows the description when `description` is non-empty. */\n readonly showDescription = input(true);\n\n /** `\"inline\"`: control before the text. `\"row\"`: text on the left, control on the right, full width. */\n readonly layout = input<\"inline\" | \"row\">(\"inline\");\n\n /** Disables the switch; combined with the form's disabled state. */\n readonly disabled = input(false);\n\n /** Keeps the switch focusable but ignores clicks and keyboard input. */\n readonly readonly = input(false);\n\n /** ID of the native `<input>`. Auto-generated by default. */\n readonly inputId = input(SdsSwitchComponent.nextId());\n\n /** ID of an external element that describes the switch (e.g. help text). */\n readonly ariaDescribedBy = input<string>();\n\n /** Emits the new value after the switch toggles. */\n readonly changed = output<boolean>();\n\n /** Emits when the native `<input>` gains focus. */\n readonly focused = output<FocusEvent>();\n\n /** Emits when the native `<input>` loses focus. */\n readonly blurred = output<FocusEvent>();\n\n protected readonly formDisabled = signal(false);\n protected readonly isChecked = signal(false);\n protected readonly isHovered = signal(false);\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled());\n\n private readonly ngControl: NgControl | null;\n private onChange: (value: boolean) => void = () => {};\n private onTouched: () => void = () => {};\n\n constructor() {\n const ngControl = inject(NgControl, { self: true, optional: true });\n\n if (ngControl) {\n ngControl.valueAccessor = this;\n }\n\n this.ngControl = ngControl;\n }\n\n writeValue(value: unknown): void {\n this.isChecked.set(Boolean(value));\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n\n protected toggle(): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n const nextValue = !this.isChecked();\n this.isChecked.set(nextValue);\n this.onChange(nextValue);\n this.onTouched();\n this.changed.emit(nextValue);\n }\n\n protected get isError(): boolean {\n const ctrl = this.ngControl;\n if (ctrl instanceof FormControlName || ctrl instanceof FormControlDirective) {\n return !!ctrl.control?.invalid && !!ctrl.control?.touched;\n }\n if (ctrl instanceof NgModel && (ctrl.control.validator || ctrl.control.asyncValidator)) {\n return ctrl.control.invalid && ctrl.control.touched;\n }\n return false;\n }\n}\n","@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly() && !disabled;\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n@let isRow = layout() === \"row\";\n@let trackHasBorder = disabled || isReadonly || !checked;\n@let hasDescription = showDescription() && description();\n\n<label\n class=\"inline-flex min-h-6 gap-space-1\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [class.w-full]=\"isRow\"\n [class.items-start]=\"isRow\"\n [class.justify-between]=\"isRow\"\n [class.gap-space-4]=\"isRow\"\n [class.items-center]=\"!isRow\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-checked]=\"checked ? 'true' : 'false'\"\n [attr.aria-label]=\"!showLabel() ? label() : null\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n (change)=\"toggle()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex h-5 w-9 shrink-0 items-center rounded-radius-full p-space-0-25 transition-colors duration-150 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-color-border-focused\"\n aria-hidden=\"true\"\n [class.order-1]=\"!isRow\"\n [class.order-2]=\"isRow\"\n [class.border]=\"trackHasBorder\"\n [class.border-solid]=\"trackHasBorder\"\n [class.justify-end]=\"checked\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold': normal && checked && !hovered,\n 'bg-color-background-selected-bold-hovered': normal && checked && hovered,\n 'bg-color-background-interactive-secondary-bold': normal && !checked && !hovered,\n 'bg-color-background-interactive-secondary-bold-hovered': normal && !checked && hovered,\n 'bg-color-background-disable': disabled,\n 'border-color-border-disable': trackHasBorder && (disabled || isReadonly),\n 'border-color-border-interactive-secondary': trackHasBorder && normal && !checked,\n }\"\n >\n <div\n class=\"relative size-4 shrink-0 rounded-radius-full\"\n [ngClass]=\"{\n 'bg-color-icon-interactive-primary': normal,\n 'bg-color-icon-disable': disabled,\n 'bg-color-icon-interactive-secondary': isReadonly,\n }\"\n ></div>\n\n @if (error) {\n <div\n class=\"sds-switch__error-ring absolute h-5 w-9 rounded-radius-full border border-solid border-color-border-destructive\"\n [ngClass]=\"trackHasBorder ? '-left-px -top-px' : 'left-0 top-0'\"\n ></div>\n }\n </div>\n\n @if (showLabel() || hasDescription) {\n <div\n class=\"flex flex-col gap-space-1\"\n [class.order-1]=\"isRow\"\n [class.order-2]=\"!isRow\"\n [class.w-full]=\"isRow\"\n >\n @if (showLabel()) {\n <span\n class=\"sds-switch__label select-none text-font-size-2 leading-line-height-150\"\n [ngClass]=\"{\n 'font-font-weight-regular': !isRow,\n 'font-font-weight-medium': isRow,\n 'leading-line-height-125': isRow,\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ label() }}</span\n >\n }\n @if (hasDescription) {\n <span\n class=\"sds-switch__description select-none leading-line-height-150\"\n [ngClass]=\"{\n 'text-font-size-1': !isRow,\n 'text-font-size-2': isRow,\n 'text-color-text-neutral-secondary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ description() }}</span\n >\n }\n </div>\n }\n</label>\n","/**\n * Generated bundle index.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A,CAAA;;;AEbpB;;AAEG;;;;"}
1
+ {"version":3,"file":"seniorsistemas-scala-ng-switch.mjs","sources":["../../projects/scala-ng/switch/src/switch/switch.component.ts","../../projects/scala-ng/switch/src/switch/switch.component.html","../../projects/scala-ng/switch/seniorsistemas-scala-ng-switch.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport { Component, computed, inject, input, output, signal } from '@angular/core';\nimport {\n ControlValueAccessor,\n FormControlDirective,\n FormControlName,\n NgControl,\n NgModel,\n} from '@angular/forms';\n\n@Component({\n selector: 'sds-switch',\n standalone: true,\n imports: [NgClass],\n templateUrl: './switch.component.html',\n})\nexport class SdsSwitchComponent implements ControlValueAccessor {\n private static idCounter = 0;\n\n private static nextId(): string {\n SdsSwitchComponent.idCounter++;\n return `sds-switch-${SdsSwitchComponent.idCounter}`;\n }\n\n /** Text shown next to the control; used as `aria-label` when `showLabel` is `false`. */\n readonly label = input.required<string>();\n\n /** Secondary text shown below the label. */\n readonly description = input('');\n\n /** Shows the label text; when `false`, the label becomes the native input's `aria-label`. */\n readonly showLabel = input(true);\n\n /** Shows the description when `description` is non-empty. */\n readonly showDescription = input(true);\n\n /** `\"inline\"`: control before the text. `\"row\"`: text on the left, control on the right, full width. */\n readonly layout = input<'inline' | 'row'>('inline');\n\n /** Disables the switch; combined with the form's disabled state. */\n readonly disabled = input(false);\n\n /** Keeps the switch focusable but ignores clicks and keyboard input. */\n readonly readonly = input(false);\n\n /** ID of the native `<input>`. Auto-generated by default. */\n readonly inputId = input(SdsSwitchComponent.nextId());\n\n /** ID of an external element that describes the switch (e.g. help text). */\n readonly ariaDescribedBy = input<string>();\n\n /** Emits the new value after the switch toggles. */\n readonly changed = output<boolean>();\n\n /** Emits when the native `<input>` gains focus. */\n readonly focused = output<FocusEvent>();\n\n /** Emits when the native `<input>` loses focus. */\n readonly blurred = output<FocusEvent>();\n\n protected readonly formDisabled = signal(false);\n protected readonly isChecked = signal(false);\n protected readonly isHovered = signal(false);\n protected readonly isDisabled = computed(() => this.disabled() || this.formDisabled());\n\n private readonly ngControl: NgControl | null;\n private onChange: (value: boolean) => void = () => {};\n private onTouched: () => void = () => {};\n\n constructor() {\n const ngControl = inject(NgControl, { self: true, optional: true });\n\n if (ngControl) {\n ngControl.valueAccessor = this;\n }\n\n this.ngControl = ngControl;\n }\n\n writeValue(value: unknown): void {\n this.isChecked.set(Boolean(value));\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n\n protected toggle(): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n const nextValue = !this.isChecked();\n this.isChecked.set(nextValue);\n this.onChange(nextValue);\n this.onTouched();\n this.changed.emit(nextValue);\n }\n\n protected get isError(): boolean {\n const ctrl = this.ngControl;\n if (ctrl instanceof FormControlName || ctrl instanceof FormControlDirective) {\n return !!ctrl.control?.invalid && !!ctrl.control?.touched;\n }\n if (ctrl instanceof NgModel && (ctrl.control.validator || ctrl.control.asyncValidator)) {\n return ctrl.control.invalid && ctrl.control.touched;\n }\n return false;\n }\n}\n","@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly() && !disabled;\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n@let isRow = layout() === 'row';\n@let trackHasBorder = disabled || isReadonly || !checked;\n@let hasDescription = showDescription() && description();\n\n<label\n class=\"inline-flex min-h-6 gap-space-1\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [class.w-full]=\"isRow\"\n [class.items-start]=\"isRow\"\n [class.justify-between]=\"isRow\"\n [class.gap-space-4]=\"isRow\"\n [class.items-center]=\"!isRow\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-checked]=\"checked ? 'true' : 'false'\"\n [attr.aria-label]=\"!showLabel() ? label() : null\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly ? 'true' : null\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n (change)=\"toggle()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex h-5 w-9 shrink-0 items-center rounded-radius-full p-space-0-25 transition-colors duration-150 peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-color-border-focused\"\n aria-hidden=\"true\"\n [class.order-1]=\"!isRow\"\n [class.order-2]=\"isRow\"\n [class.border]=\"trackHasBorder\"\n [class.border-solid]=\"trackHasBorder\"\n [class.justify-end]=\"checked\"\n [ngClass]=\"{\n 'bg-color-background-selected-bold': normal && checked && !hovered,\n 'bg-color-background-selected-bold-hovered': normal && checked && hovered,\n 'bg-color-background-interactive-secondary-bold': normal && !checked && !hovered,\n 'bg-color-background-interactive-secondary-bold-hovered': normal && !checked && hovered,\n 'bg-color-background-disable': disabled,\n 'border-color-border-disable': trackHasBorder && (disabled || isReadonly),\n 'border-color-border-interactive-secondary': trackHasBorder && normal && !checked,\n }\"\n >\n <div\n class=\"relative size-4 shrink-0 rounded-radius-full\"\n [ngClass]=\"{\n 'bg-color-icon-interactive-primary': normal,\n 'bg-color-icon-disable': disabled,\n 'bg-color-icon-interactive-secondary': isReadonly,\n }\"\n ></div>\n\n @if (error) {\n <div\n class=\"sds-switch__error-ring absolute h-5 w-9 rounded-radius-full border border-solid border-color-border-destructive\"\n [ngClass]=\"trackHasBorder ? '-left-px -top-px' : 'left-0 top-0'\"\n ></div>\n }\n </div>\n\n @if (showLabel() || hasDescription) {\n <div\n class=\"flex flex-col gap-space-1\"\n [class.order-1]=\"isRow\"\n [class.order-2]=\"!isRow\"\n [class.w-full]=\"isRow\"\n >\n @if (showLabel()) {\n <span\n class=\"sds-switch__label select-none text-font-size-2 leading-line-height-150\"\n [ngClass]=\"{\n 'font-font-weight-regular': !isRow,\n 'font-font-weight-medium': isRow,\n 'leading-line-height-125': isRow,\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ label() }}</span\n >\n }\n @if (hasDescription) {\n <span\n class=\"sds-switch__description select-none leading-line-height-150\"\n [ngClass]=\"{\n 'text-font-size-1': !isRow,\n 'text-font-size-2': isRow,\n 'text-color-text-neutral-secondary': !disabled,\n 'text-color-text-disable': disabled,\n 'w-full': isRow,\n }\"\n >{{ description() }}</span\n >\n }\n </div>\n }\n</label>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAgBa,kBAAkB,CAAA;AACrB,IAAA,OAAO,SAAS,GAAG,CAAC,CAAC;AAErB,IAAA,OAAO,MAAM,GAAA;QACnB,kBAAkB,CAAC,SAAS,EAAE,CAAC;AAC/B,QAAA,OAAO,CAAc,WAAA,EAAA,kBAAkB,CAAC,SAAS,EAAE,CAAC;KACrD;;AAGQ,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;;AAGjC,IAAA,WAAW,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;;AAGxB,IAAA,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;;AAGxB,IAAA,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;;AAG9B,IAAA,MAAM,GAAG,KAAK,CAAmB,QAAQ,CAAC,CAAC;;AAG3C,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;;AAGxB,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;;IAGxB,OAAO,GAAG,KAAK,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;;IAG7C,eAAe,GAAG,KA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,EAAA,OAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChB/B,4/HA+GA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDlGY,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAGN,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAN9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EACV,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,OAAO,CAAC,EAAA,QAAA,EAAA,4/HAAA,EAAA,CAAA;;;AEbpB;;AAEG;;;;"}
@@ -38,8 +38,8 @@ class SdsTableActionsCellComponent {
38
38
  }
39
39
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsTableActionsCellComponent, decorators: [{
40
40
  type: Component,
41
- args: [{ selector: "sds-table-actions-cell", standalone: true, imports: [SdsButtonComponent, SdsTieredMenuDirective, SdsTooltipDirective, TranslatePipe], host: { class: "flex items-center justify-end gap-space-0-50" }, template: "@if (isInline()) {\n @for (action of visibleActions(); track action.label) {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [destructive]=\"!!action.destructive\"\n [disabled]=\"isDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n [sdsTooltip]=\"action.label\"\n (click)=\"action.onClick(row())\"\n >\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n} @else {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [sdsTieredMenu]=\"menuItems()\"\n [attr.aria-label]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n [sdsTooltip]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis\"\n aria-hidden=\"true\"\n ></i>\n </button>\n}\n" }]
41
+ args: [{ selector: 'sds-table-actions-cell', standalone: true, imports: [SdsButtonComponent, SdsTieredMenuDirective, SdsTooltipDirective, TranslatePipe], host: { class: 'flex items-center justify-end gap-space-0-50' }, template: "@if (isInline()) {\n @for (action of visibleActions(); track action.label) {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [destructive]=\"!!action.destructive\"\n [disabled]=\"isDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n [sdsTooltip]=\"action.label\"\n (click)=\"action.onClick(row())\"\n >\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n} @else {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [sdsTieredMenu]=\"menuItems()\"\n [attr.aria-label]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n [sdsTooltip]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis\"\n aria-hidden=\"true\"\n ></i>\n </button>\n}\n" }]
42
42
  }] });
43
43
 
44
44
  export { SdsTableActionsCellComponent, TABLE_ACTIONS_MAX_INLINE };
45
- //# sourceMappingURL=seniorsistemas-scala-ng-table-table-actions-cell.component-DTzDhrMk.mjs.map
45
+ //# sourceMappingURL=seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs","sources":["../../projects/scala-ng/table/src/components/actions-cell/table-actions-cell.component.ts","../../projects/scala-ng/table/src/components/actions-cell/table-actions-cell.component.html"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { SdsButtonComponent } from '@seniorsistemas/scala-ng/button';\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from '@seniorsistemas/scala-ng/tiered-menu';\nimport { SdsTooltipDirective } from '@seniorsistemas/scala-ng/tooltip';\nimport type { ActionButton } from '../../table/table.models';\n\nexport const TABLE_ACTIONS_MAX_INLINE = 3;\n\n@Component({\n selector: 'sds-table-actions-cell',\n standalone: true,\n imports: [SdsButtonComponent, SdsTieredMenuDirective, SdsTooltipDirective, TranslatePipe],\n templateUrl: './table-actions-cell.component.html',\n host: { class: 'flex items-center justify-end gap-space-0-50' },\n})\nexport class SdsTableActionsCellComponent<T> {\n readonly actions = input.required<ActionButton<T>[]>();\n readonly row = input.required<T>();\n\n // Destructive actions go last, preserving the declared order otherwise.\n protected readonly visibleActions = computed<ActionButton<T>[]>(() => {\n const visible = this.actions().filter((action) => action.visible?.(this.row()) ?? true);\n return [\n ...visible.filter((action) => !action.destructive),\n ...visible.filter((action) => action.destructive),\n ];\n });\n\n // Inline buttons show only the icon, so an action without one would render as an empty button.\n protected readonly isInline = computed(() => {\n const visibleActions = this.visibleActions();\n return (\n visibleActions.length <= TABLE_ACTIONS_MAX_INLINE &&\n visibleActions.every((action) => !!action.icon)\n );\n });\n\n protected readonly menuItems = computed<SdsTieredMenuItem[]>(() =>\n this.visibleActions().map((action) => ({\n label: action.label,\n icon: action.icon,\n destructive: action.destructive ?? false,\n disabled: action.disabled?.(this.row()) ?? false,\n command: () => action.onClick(this.row()),\n })),\n );\n\n protected isDisabled(action: ActionButton<T>): boolean {\n return action.disabled?.(this.row()) ?? false;\n }\n}\n","@if (isInline()) {\n @for (action of visibleActions(); track action.label) {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [destructive]=\"!!action.destructive\"\n [disabled]=\"isDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n [sdsTooltip]=\"action.label\"\n (click)=\"action.onClick(row())\"\n >\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n} @else {\n <button\n sdsButton\n type=\"ghost\"\n size=\"small\"\n class=\"!w-8 !p-0\"\n [sdsTieredMenu]=\"menuItems()\"\n [attr.aria-label]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n [sdsTooltip]=\"'platform.scala-ng.table_actions_trigger_label' | translate\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis\"\n aria-hidden=\"true\"\n ></i>\n </button>\n}\n"],"names":[],"mappings":";;;;;;;AAUO,MAAM,wBAAwB,GAAG,EAAE;MAS7B,4BAA4B,CAAA;AAC9B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAqB,CAAC;AAC9C,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAK,CAAC;;AAGhB,IAAA,cAAc,GAAG,QAAQ,CAAoB,MAAK;QACnE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC;QACxF,OAAO;AACL,YAAA,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;AAClD,YAAA,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,WAAW,CAAC;SAClD,CAAC;AACJ,KAAC,CAAC,CAAC;;AAGgB,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAK;AAC1C,QAAA,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;AAC7C,QAAA,QACE,cAAc,CAAC,MAAM,IAAI,wBAAwB;AACjD,YAAA,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAC/C;AACJ,KAAC,C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