dasar-ui 1.1.0 → 1.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 (294) hide show
  1. package/.dockerignore +31 -0
  2. package/.github/workflows/npm-publish-github-packages.yml +36 -0
  3. package/.versionrc.json +4 -0
  4. package/CHANGELOG.md +30 -0
  5. package/Dockerfile +26 -0
  6. package/angular.json +77 -0
  7. package/package.json +38 -24
  8. package/projects/dasar-ui/package.json +1 -1
  9. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.ts +3 -7
  10. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.ts +1 -1
  11. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.ts +2 -2
  12. package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.ts +0 -2
  13. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.html +11 -2
  14. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.scss +30 -0
  15. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.spec.ts +78 -6
  16. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.ts +32 -32
  17. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.registry.ts +0 -2
  18. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.ts +1 -1
  19. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.scss +0 -30
  20. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.ts +0 -4
  21. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list-item.html +17 -0
  22. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.html +25 -0
  23. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.scss +122 -0
  24. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.spec.ts +21 -0
  25. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.ts +166 -0
  26. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.html +6 -5
  27. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.scss +39 -5
  28. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.spec.ts +78 -6
  29. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.ts +41 -3
  30. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.html +72 -0
  31. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.scss +170 -0
  32. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.spec.ts +267 -0
  33. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.ts +305 -0
  34. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.scss +2 -7
  35. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.html +11 -0
  36. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.scss +18 -0
  37. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.spec.ts +104 -0
  38. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.ts +87 -0
  39. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.ts +1 -1
  40. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.html +1 -14
  41. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.scss +0 -11
  42. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.ts +0 -2
  43. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.html +9 -5
  44. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.scss +62 -22
  45. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.spec.ts +82 -6
  46. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.ts +47 -4
  47. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.html +92 -30
  48. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.scss +137 -25
  49. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.spec.ts +554 -5
  50. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.ts +312 -35
  51. package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.ts +6 -21
  52. package/projects/dasar-ui/src/lib/models/theme.model.ts +35 -12
  53. package/projects/dasar-ui/src/lib/services/theme.service.spec.ts +65 -0
  54. package/projects/dasar-ui/src/lib/services/theme.service.ts +68 -4
  55. package/projects/dasar-ui/src/lib/styles/theme.scss +47 -48
  56. package/projects/dasar-ui/src/lib/utils/common.ts +5 -24
  57. package/projects/dasar-ui/src/lib/utils/icon-size.spec.ts +23 -0
  58. package/projects/dasar-ui/src/lib/utils/icon-size.ts +16 -0
  59. package/projects/dasar-ui/src/lib/utils/panel-placement.spec.ts +90 -0
  60. package/projects/dasar-ui/src/lib/utils/panel-placement.ts +53 -0
  61. package/projects/dasar-ui/src/public-api.ts +4 -4
  62. package/projects/dasar-ui/tsconfig.spec.json +8 -1
  63. package/projects/documentation/public/favicon.ico +0 -0
  64. package/projects/documentation/src/app/app.html +51 -0
  65. package/projects/documentation/src/app/app.spec.ts +23 -0
  66. package/projects/documentation/src/app/app.ts +23 -0
  67. package/projects/documentation/src/app/components/doc-customize-modal.component.ts +314 -0
  68. package/projects/documentation/src/app/components/doc-example.component.ts +195 -0
  69. package/projects/documentation/src/app/config/app.config.server.ts +10 -0
  70. package/projects/documentation/src/app/config/app.config.ts +17 -0
  71. package/projects/documentation/src/app/layouts/doc.layout.ts +229 -0
  72. package/projects/documentation/src/app/pages/button/button.page.html +65 -0
  73. package/projects/documentation/src/app/pages/button/button.page.ts +139 -0
  74. package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.html +7 -0
  75. package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.ts +10 -0
  76. package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.html +19 -0
  77. package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.ts +10 -0
  78. package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.html +9 -0
  79. package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.ts +10 -0
  80. package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.html +7 -0
  81. package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.ts +10 -0
  82. package/projects/documentation/src/app/pages/button/examples/state/button-state.example.html +10 -0
  83. package/projects/documentation/src/app/pages/button/examples/state/button-state.example.ts +10 -0
  84. package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.html +9 -0
  85. package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.ts +10 -0
  86. package/projects/documentation/src/app/pages/calendar/calendar.page.html +75 -0
  87. package/projects/documentation/src/app/pages/calendar/calendar.page.ts +165 -0
  88. package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.html +21 -0
  89. package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.ts +10 -0
  90. package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.html +11 -0
  91. package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.ts +13 -0
  92. package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.html +36 -0
  93. package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.ts +11 -0
  94. package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.html +10 -0
  95. package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.ts +12 -0
  96. package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.html +15 -0
  97. package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.ts +12 -0
  98. package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.html +34 -0
  99. package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.ts +14 -0
  100. package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.html +20 -0
  101. package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.ts +37 -0
  102. package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.html +16 -0
  103. package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.ts +10 -0
  104. package/projects/documentation/src/app/pages/card/card.page.html +75 -0
  105. package/projects/documentation/src/app/pages/card/card.page.ts +182 -0
  106. package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.html +13 -0
  107. package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.ts +10 -0
  108. package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.html +30 -0
  109. package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.ts +19 -0
  110. package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.html +173 -0
  111. package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.ts +10 -0
  112. package/projects/documentation/src/app/pages/card/examples/media/card-media.example.html +27 -0
  113. package/projects/documentation/src/app/pages/card/examples/media/card-media.example.ts +10 -0
  114. package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.html +13 -0
  115. package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.ts +10 -0
  116. package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.html +20 -0
  117. package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.ts +10 -0
  118. package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.html +11 -0
  119. package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.ts +10 -0
  120. package/projects/documentation/src/app/pages/chip/chip.page.html +55 -0
  121. package/projects/documentation/src/app/pages/chip/chip.page.ts +158 -0
  122. package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.html +7 -0
  123. package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.ts +10 -0
  124. package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.html +13 -0
  125. package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.ts +17 -0
  126. package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.html +9 -0
  127. package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.ts +10 -0
  128. package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.html +6 -0
  129. package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.ts +10 -0
  130. package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.html +8 -0
  131. package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.ts +10 -0
  132. package/projects/documentation/src/app/pages/datepicker/datepicker.page.html +75 -0
  133. package/projects/documentation/src/app/pages/datepicker/datepicker.page.ts +181 -0
  134. package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.html +29 -0
  135. package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.ts +10 -0
  136. package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.html +12 -0
  137. package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.ts +12 -0
  138. package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.html +23 -0
  139. package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.ts +17 -0
  140. package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.html +30 -0
  141. package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.ts +13 -0
  142. package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.html +24 -0
  143. package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.ts +10 -0
  144. package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.html +19 -0
  145. package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.ts +10 -0
  146. package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.html +28 -0
  147. package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.ts +12 -0
  148. package/projects/documentation/src/app/pages/icon/icon.page.html +15 -0
  149. package/projects/documentation/src/app/pages/icon/icon.page.ts +60 -0
  150. package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.html +27 -0
  151. package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.ts +10 -0
  152. package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.html +13 -0
  153. package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.ts +13 -0
  154. package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.html +31 -0
  155. package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.ts +19 -0
  156. package/projects/documentation/src/app/pages/input/examples/more/input-more.example.html +68 -0
  157. package/projects/documentation/src/app/pages/input/examples/more/input-more.example.ts +18 -0
  158. package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.html +52 -0
  159. package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.ts +10 -0
  160. package/projects/documentation/src/app/pages/input/examples/states/input-states.example.html +29 -0
  161. package/projects/documentation/src/app/pages/input/examples/states/input-states.example.ts +10 -0
  162. package/projects/documentation/src/app/pages/input/input.page.html +65 -0
  163. package/projects/documentation/src/app/pages/input/input.page.ts +170 -0
  164. package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.html +5 -0
  165. package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.ts +17 -0
  166. package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.html +35 -0
  167. package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.ts +57 -0
  168. package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.html +12 -0
  169. package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.ts +16 -0
  170. package/projects/documentation/src/app/pages/menu/menu.page.html +35 -0
  171. package/projects/documentation/src/app/pages/menu/menu.page.ts +149 -0
  172. package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.html +18 -0
  173. package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.ts +21 -0
  174. package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.html +8 -0
  175. package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.ts +12 -0
  176. package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.html +44 -0
  177. package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.ts +14 -0
  178. package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.html +36 -0
  179. package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.ts +12 -0
  180. package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.html +29 -0
  181. package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.ts +14 -0
  182. package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.html +27 -0
  183. package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.ts +27 -0
  184. package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.html +14 -0
  185. package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.ts +13 -0
  186. package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.html +17 -0
  187. package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.ts +21 -0
  188. package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.html +30 -0
  189. package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.ts +12 -0
  190. package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.html +23 -0
  191. package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.ts +13 -0
  192. package/projects/documentation/src/app/pages/modal/modal.page.html +105 -0
  193. package/projects/documentation/src/app/pages/modal/modal.page.ts +257 -0
  194. package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.html +30 -0
  195. package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.ts +10 -0
  196. package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.html +12 -0
  197. package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.ts +13 -0
  198. package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.html +30 -0
  199. package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.ts +14 -0
  200. package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.html +49 -0
  201. package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.ts +10 -0
  202. package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.html +21 -0
  203. package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.ts +10 -0
  204. package/projects/documentation/src/app/pages/number-input/number-input.page.html +55 -0
  205. package/projects/documentation/src/app/pages/number-input/number-input.page.ts +142 -0
  206. package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.html +32 -0
  207. package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.ts +15 -0
  208. package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.html +13 -0
  209. package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.ts +20 -0
  210. package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.html +24 -0
  211. package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.ts +59 -0
  212. package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.html +20 -0
  213. package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.ts +20 -0
  214. package/projects/documentation/src/app/pages/select/examples/search/select-search.example.html +13 -0
  215. package/projects/documentation/src/app/pages/select/examples/search/select-search.example.ts +22 -0
  216. package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.html +44 -0
  217. package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.ts +15 -0
  218. package/projects/documentation/src/app/pages/select/examples/states/select-states.example.html +31 -0
  219. package/projects/documentation/src/app/pages/select/examples/states/select-states.example.ts +12 -0
  220. package/projects/documentation/src/app/pages/select/select.page.html +75 -0
  221. package/projects/documentation/src/app/pages/select/select.page.ts +195 -0
  222. package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.html +14 -0
  223. package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.ts +25 -0
  224. package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.html +12 -0
  225. package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.ts +21 -0
  226. package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.html +29 -0
  227. package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.ts +20 -0
  228. package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.html +39 -0
  229. package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.ts +21 -0
  230. package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.html +7 -0
  231. package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.ts +21 -0
  232. package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.html +3 -0
  233. package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.ts +41 -0
  234. package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.html +43 -0
  235. package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.ts +21 -0
  236. package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.html +36 -0
  237. package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.ts +34 -0
  238. package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.html +8 -0
  239. package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.ts +52 -0
  240. package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.html +53 -0
  241. package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.ts +50 -0
  242. package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.html +23 -0
  243. package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.ts +42 -0
  244. package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.html +20 -0
  245. package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.ts +21 -0
  246. package/projects/documentation/src/app/pages/table/table.page.html +125 -0
  247. package/projects/documentation/src/app/pages/table/table.page.ts +261 -0
  248. package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.html +13 -0
  249. package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.ts +27 -0
  250. package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.html +27 -0
  251. package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.ts +36 -0
  252. package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.html +5 -0
  253. package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.ts +20 -0
  254. package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.html +6 -0
  255. package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.ts +13 -0
  256. package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.html +13 -0
  257. package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.ts +13 -0
  258. package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.html +19 -0
  259. package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.ts +12 -0
  260. package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.html +16 -0
  261. package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.ts +23 -0
  262. package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.html +5 -0
  263. package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.ts +12 -0
  264. package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.html +6 -0
  265. package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.ts +12 -0
  266. package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.html +6 -0
  267. package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.ts +13 -0
  268. package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.html +20 -0
  269. package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.ts +30 -0
  270. package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.html +16 -0
  271. package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.ts +26 -0
  272. package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.html +22 -0
  273. package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.ts +26 -0
  274. package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.html +6 -0
  275. package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.ts +13 -0
  276. package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.html +25 -0
  277. package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.ts +10 -0
  278. package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.html +6 -0
  279. package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.ts +13 -0
  280. package/projects/documentation/src/app/pages/tabs/tabs.page.html +165 -0
  281. package/projects/documentation/src/app/pages/tabs/tabs.page.ts +340 -0
  282. package/projects/documentation/src/app/routes/app.routes.server.ts +8 -0
  283. package/projects/documentation/src/app/routes/app.routes.ts +87 -0
  284. package/projects/documentation/src/app/services/doc-customize.service.ts +107 -0
  285. package/projects/documentation/src/app/utils/highlight.pipe.ts +43 -0
  286. package/projects/documentation/src/index.html +13 -0
  287. package/projects/documentation/src/main.server.ts +7 -0
  288. package/projects/documentation/src/main.ts +5 -0
  289. package/projects/documentation/src/server.ts +47 -0
  290. package/projects/documentation/src/styles.scss +7 -0
  291. package/projects/documentation/tsconfig.app.json +11 -0
  292. package/projects/documentation/tsconfig.spec.json +10 -0
  293. package/tsconfig.json +6 -3
  294. package/.nvmrc +0 -1
@@ -0,0 +1,267 @@
1
+ import { Component, signal } from '@angular/core';
2
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
3
+ import { By } from '@angular/platform-browser';
4
+ import { DasarModal, DasarModalComponent } from './dasar-modal';
5
+ import { DasarThemeService } from '../../services/theme.service';
6
+
7
+ @Component({
8
+ standalone: true,
9
+ imports: [DasarModalComponent],
10
+ template: `
11
+ <dasar-modal [open]="open()" [label]="'Title'" (onClose)="closed.set(closed() + 1)">
12
+ <p>Body</p>
13
+ <div action-slot><button class="action-btn">OK</button></div>
14
+ </dasar-modal>
15
+ `,
16
+ })
17
+ class ModalHost {
18
+ open = signal(false);
19
+ closed = signal(0);
20
+ }
21
+
22
+ @Component({
23
+ standalone: true,
24
+ imports: [DasarModalComponent],
25
+ template: `<dasar-modal [open]="true" label="Title"></dasar-modal>`,
26
+ })
27
+ class ThemeDefaultHost {}
28
+
29
+ describe('DasarModal', () => {
30
+ let fixture: ComponentFixture<ModalHost>;
31
+ let host: ModalHost;
32
+
33
+ const container = () => fixture.nativeElement.querySelector('.dasar-modal-container');
34
+ const modalElement = () => fixture.nativeElement.querySelector('dasar-modal') as HTMLElement;
35
+ const open = async (value = true) => {
36
+ host.open.set(value);
37
+ await fixture.whenStable();
38
+ };
39
+
40
+ beforeEach(async () => {
41
+ await TestBed.configureTestingModule({ imports: [ModalHost] }).compileComponents();
42
+
43
+ fixture = TestBed.createComponent(ModalHost);
44
+ host = fixture.componentInstance;
45
+ fixture.detectChanges();
46
+ });
47
+
48
+ afterEach(() => {
49
+ document.body.style.overflow = '';
50
+ });
51
+
52
+ it('should create', () => {
53
+ expect(fixture.debugElement.query(By.directive(DasarModal))).toBeTruthy();
54
+ });
55
+
56
+ it('always has the dasar-modal host class', () => {
57
+ expect(modalElement().classList).toContain('dasar-modal');
58
+ });
59
+
60
+ it('renders nothing while closed', () => {
61
+ expect(container()).toBeNull();
62
+ expect(modalElement().classList).not.toContain('open');
63
+ });
64
+
65
+ it('renders header, body and actions while open', async () => {
66
+ await open();
67
+
68
+ expect(container()).toBeTruthy();
69
+ expect(container().classList).toContain('size-md');
70
+ expect(container().classList).toContain('radius-lg');
71
+ expect(container().classList).toContain('appearance-elevated');
72
+ expect(fixture.nativeElement.querySelector('.dasar-modal-title').textContent).toContain(
73
+ 'Title',
74
+ );
75
+ expect(fixture.nativeElement.querySelector('.dasar-modal-body p').textContent).toContain(
76
+ 'Body',
77
+ );
78
+ expect(fixture.nativeElement.querySelector('.dasar-modal-actions .action-btn')).toBeTruthy();
79
+ expect(modalElement().classList).toContain('open');
80
+ });
81
+
82
+ it('emits onClose from the default close button', async () => {
83
+ await open();
84
+
85
+ (fixture.nativeElement.querySelector('.dasar-modal-close dasar-button') as HTMLElement).click();
86
+ await fixture.whenStable();
87
+
88
+ expect(host.closed()).toBe(1);
89
+ });
90
+
91
+ it('emits onClose on Escape', async () => {
92
+ await open();
93
+
94
+ document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
95
+ await fixture.whenStable();
96
+
97
+ expect(host.closed()).toBe(1);
98
+ });
99
+
100
+ it('emits onClose when the overlay backdrop is clicked, but not the panel', async () => {
101
+ await open();
102
+
103
+ (fixture.nativeElement.querySelector('.dasar-overlay-backdrop') as HTMLElement).click();
104
+ await fixture.whenStable();
105
+ expect(host.closed()).toBe(1);
106
+
107
+ (fixture.nativeElement.querySelector('.dasar-modal-body') as HTMLElement).click();
108
+ await fixture.whenStable();
109
+ expect(host.closed()).toBe(1);
110
+ });
111
+
112
+ it('does not emit onClose on Escape while closed', async () => {
113
+ document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
114
+ await fixture.whenStable();
115
+
116
+ expect(host.closed()).toBe(0);
117
+ });
118
+
119
+ it('honours close-on-escape=false', async () => {
120
+ const modal = fixture.debugElement.query(By.directive(DasarModal)).componentInstance;
121
+ modal.closeOnEscape = false;
122
+ await open();
123
+
124
+ document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' }));
125
+ await fixture.whenStable();
126
+
127
+ expect(host.closed()).toBe(0);
128
+ });
129
+
130
+ it('honours close-on-overlay=false', async () => {
131
+ const modal = fixture.debugElement.query(By.directive(DasarModal)).componentInstance;
132
+ modal.closeOnOverlay = false;
133
+ await open();
134
+
135
+ (fixture.nativeElement.querySelector('.dasar-overlay-backdrop') as HTMLElement).click();
136
+ await fixture.whenStable();
137
+
138
+ expect(host.closed()).toBe(0);
139
+ });
140
+
141
+ it('honours closable=false by hiding the close affordance', async () => {
142
+ await open();
143
+ expect(fixture.nativeElement.querySelector('.dasar-modal-close dasar-button')).toBeTruthy();
144
+
145
+ await open(false);
146
+ const modal = fixture.debugElement.query(By.directive(DasarModal)).componentInstance;
147
+ modal.closable = false;
148
+ await open();
149
+
150
+ expect(fixture.nativeElement.querySelector('.dasar-modal-close')).toBeNull();
151
+ });
152
+
153
+ it('sets an explicit width over the size default', async () => {
154
+ await open();
155
+ expect(container().style.width).toBe('');
156
+
157
+ await open(false);
158
+ const modal = fixture.debugElement.query(By.directive(DasarModal)).componentInstance;
159
+ modal.width = '320px';
160
+ await open();
161
+
162
+ expect(container().style.width).toBe('320px');
163
+ });
164
+
165
+ it('locks body scroll while open and restores it when closed', async () => {
166
+ await open();
167
+ expect(document.body.style.overflow).toBe('hidden');
168
+
169
+ await open(false);
170
+ expect(document.body.style.overflow).toBe('');
171
+ });
172
+
173
+ it('restores body scroll when destroyed while open', async () => {
174
+ await open();
175
+ expect(document.body.style.overflow).toBe('hidden');
176
+
177
+ fixture.destroy();
178
+ expect(document.body.style.overflow).toBe('');
179
+ });
180
+ });
181
+
182
+ describe('DasarModal slots and theme defaults', () => {
183
+ it('replaces the label with the header slot content', async () => {
184
+ @Component({
185
+ standalone: true,
186
+ imports: [DasarModalComponent],
187
+ template: `
188
+ <dasar-modal [open]="true" label="Title">
189
+ <div header-slot><span class="custom-header">Custom</span></div>
190
+ </dasar-modal>
191
+ `,
192
+ })
193
+ class HeaderSlotHost {}
194
+
195
+ await TestBed.configureTestingModule({ imports: [HeaderSlotHost] }).compileComponents();
196
+ const fixture = TestBed.createComponent(HeaderSlotHost);
197
+ fixture.detectChanges();
198
+
199
+ expect(fixture.nativeElement.querySelector('.custom-header')).toBeTruthy();
200
+ expect(fixture.nativeElement.querySelector('.dasar-modal-title')).toBeNull();
201
+ });
202
+
203
+ it('replaces the default close button with the close slot', async () => {
204
+ @Component({
205
+ standalone: true,
206
+ imports: [DasarModalComponent],
207
+ template: `
208
+ <dasar-modal [open]="true" label="Title">
209
+ <button class="custom-close" close-slot>X</button>
210
+ </dasar-modal>
211
+ `,
212
+ })
213
+ class CloseSlotHost {}
214
+
215
+ await TestBed.configureTestingModule({ imports: [CloseSlotHost] }).compileComponents();
216
+ const fixture = TestBed.createComponent(CloseSlotHost);
217
+ fixture.detectChanges();
218
+
219
+ expect(fixture.nativeElement.querySelector('.custom-close')).toBeTruthy();
220
+ expect(fixture.nativeElement.querySelector('.dasar-modal-close dasar-button')).toBeNull();
221
+ });
222
+
223
+ it('takes the default size from the theme service config', async () => {
224
+ await TestBed.configureTestingModule({
225
+ imports: [ThemeDefaultHost],
226
+ providers: [DasarThemeService],
227
+ }).compileComponents();
228
+
229
+ TestBed.inject(DasarThemeService).setGlobalTheme({
230
+ mode: 'light',
231
+ components: { modal: { size: 'lg' } },
232
+ });
233
+
234
+ const fixture = TestBed.createComponent(ThemeDefaultHost);
235
+ fixture.detectChanges();
236
+
237
+ expect(fixture.nativeElement.querySelector('.dasar-modal-container').classList).toContain(
238
+ 'size-lg',
239
+ );
240
+ });
241
+
242
+ it('takes the default appearance from the theme service config', async () => {
243
+ @Component({
244
+ standalone: true,
245
+ imports: [DasarModalComponent],
246
+ template: `<dasar-modal [open]="true" label="Title"></dasar-modal>`,
247
+ })
248
+ class AppearanceHost {}
249
+
250
+ await TestBed.configureTestingModule({
251
+ imports: [AppearanceHost],
252
+ providers: [DasarThemeService],
253
+ }).compileComponents();
254
+
255
+ TestBed.inject(DasarThemeService).setGlobalTheme({
256
+ mode: 'light',
257
+ components: { modal: { appearance: 'outline', closable: false } },
258
+ });
259
+
260
+ const fixture = TestBed.createComponent(AppearanceHost);
261
+ fixture.detectChanges();
262
+
263
+ const container = fixture.nativeElement.querySelector('.dasar-modal-container');
264
+ expect(container.classList).toContain('appearance-outline');
265
+ expect(container.classList).toContain('size-md');
266
+ });
267
+ });
@@ -0,0 +1,305 @@
1
+ import {
2
+ booleanAttribute,
3
+ ViewEncapsulation,
4
+ EventEmitter,
5
+ ContentChild,
6
+ HostBinding,
7
+ HostListener,
8
+ Component,
9
+ Directive,
10
+ Output,
11
+ OnChanges,
12
+ OnDestroy,
13
+ SimpleChanges,
14
+ inject,
15
+ Input,
16
+ PLATFORM_ID,
17
+ } from '@angular/core';
18
+ import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';
19
+
20
+ import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
21
+ import { ClassType, ScaleAttributeType, StyleType } from '../../models/type.model';
22
+ import { DasarThemeService } from '../../services/theme.service';
23
+ import { DasarButton } from '../dasar-button/dasar-button';
24
+ import { resolveThemeDefault } from '../../utils/common';
25
+ import { DasarIcon } from '../dasar-icon/dasar-icon';
26
+ import { DasarOverlay } from '../dasar-overlay/dasar-overlay';
27
+
28
+ export type DasarModalSize = Extract<ScaleAttributeType, 'sm' | 'md' | 'lg'>;
29
+ export type DasarModalAppearance = 'outline' | 'borderless' | 'elevated';
30
+ export type DasarModalSpacing = 'normal' | 'compact';
31
+ export type DasarModalRadius = ScaleAttributeType;
32
+
33
+ export interface DasarModalConfig {
34
+ appearance?: DasarModalAppearance;
35
+ spacing?: DasarModalSpacing;
36
+ radius?: DasarModalRadius;
37
+ size?: DasarModalSize;
38
+ label?: string;
39
+ width?: string;
40
+ containerStyle?: StyleType;
41
+ headerStyle?: StyleType;
42
+ closeStyle?: StyleType;
43
+ bodyStyle?: StyleType;
44
+ actionStyle?: StyleType;
45
+ containerClass?: ClassType;
46
+ headerClass?: ClassType;
47
+ closeClass?: ClassType;
48
+ bodyClass?: ClassType;
49
+ actionClass?: ClassType;
50
+ headerFluid?: boolean;
51
+ bodyFluid?: boolean;
52
+ actionFluid?: boolean;
53
+ fullWidth?: boolean;
54
+ closable?: boolean;
55
+ closeOnOverlay?: boolean;
56
+ closeOnEscape?: boolean;
57
+ overlayBlur?: string;
58
+ overlayBackground?: string;
59
+ }
60
+
61
+ @Directive({ selector: '[header-slot]', standalone: true })
62
+ export class DasarModalHeaderSlot {}
63
+ @Directive({ selector: '[close-slot]', standalone: true })
64
+ export class DasarModalCloseSlot {}
65
+ @Directive({ selector: '[action-slot]', standalone: true })
66
+ export class DasarModalActionSlot {}
67
+
68
+ @Component({
69
+ imports: [CommonModule, DasarButton, DasarIcon, DasarOverlay],
70
+ encapsulation: ViewEncapsulation.None,
71
+ templateUrl: './dasar-modal.html',
72
+ styleUrls: ['./dasar-modal.scss'],
73
+ selector: 'dasar-modal',
74
+ standalone: true,
75
+ })
76
+ export class DasarModal implements OnChanges, OnDestroy {
77
+ @ContentChild(DasarModalHeaderSlot) providedHeader?: DasarModalHeaderSlot;
78
+ @ContentChild(DasarModalCloseSlot) providedClose?: DasarModalCloseSlot;
79
+ @ContentChild(DasarModalActionSlot) providedAction?: DasarModalActionSlot;
80
+
81
+ private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
82
+ private themeService = inject(DasarThemeService, { optional: true });
83
+
84
+ private platformId = inject(PLATFORM_ID);
85
+ private document = inject(DOCUMENT);
86
+
87
+ @Input({ transform: booleanAttribute }) open = false;
88
+
89
+ @Input() appearance = resolveThemeDefault(
90
+ 'modal',
91
+ 'appearance',
92
+ 'elevated',
93
+ this.themeProvider,
94
+ this.themeService,
95
+ );
96
+ @Input() spacing = resolveThemeDefault(
97
+ 'modal',
98
+ 'spacing',
99
+ 'normal',
100
+ this.themeProvider,
101
+ this.themeService,
102
+ );
103
+ @Input() radius = resolveThemeDefault(
104
+ 'modal',
105
+ 'radius',
106
+ 'lg',
107
+ this.themeProvider,
108
+ this.themeService,
109
+ );
110
+ @Input() size = resolveThemeDefault('modal', 'size', 'md', this.themeProvider, this.themeService);
111
+ @Input() label = resolveThemeDefault(
112
+ 'modal',
113
+ 'label',
114
+ undefined,
115
+ this.themeProvider,
116
+ this.themeService,
117
+ );
118
+ @Input() width = resolveThemeDefault(
119
+ 'modal',
120
+ 'width',
121
+ undefined,
122
+ this.themeProvider,
123
+ this.themeService,
124
+ );
125
+ @Input({ alias: 'container-style' }) containerStyle = resolveThemeDefault(
126
+ 'modal',
127
+ 'containerStyle',
128
+ null,
129
+ this.themeProvider,
130
+ this.themeService,
131
+ );
132
+ @Input({ alias: 'header-style' }) headerStyle = resolveThemeDefault(
133
+ 'modal',
134
+ 'headerStyle',
135
+ null,
136
+ this.themeProvider,
137
+ this.themeService,
138
+ );
139
+ @Input({ alias: 'close-style' }) closeStyle = resolveThemeDefault(
140
+ 'modal',
141
+ 'closeStyle',
142
+ null,
143
+ this.themeProvider,
144
+ this.themeService,
145
+ );
146
+ @Input({ alias: 'body-style' }) bodyStyle = resolveThemeDefault(
147
+ 'modal',
148
+ 'bodyStyle',
149
+ null,
150
+ this.themeProvider,
151
+ this.themeService,
152
+ );
153
+ @Input({ alias: 'action-style' }) actionStyle = resolveThemeDefault(
154
+ 'modal',
155
+ 'actionStyle',
156
+ null,
157
+ this.themeProvider,
158
+ this.themeService,
159
+ );
160
+ @Input({ alias: 'container-class' }) containerClass = resolveThemeDefault(
161
+ 'modal',
162
+ 'containerClass',
163
+ null,
164
+ this.themeProvider,
165
+ this.themeService,
166
+ );
167
+ @Input({ alias: 'header-class' }) headerClass = resolveThemeDefault(
168
+ 'modal',
169
+ 'headerClass',
170
+ null,
171
+ this.themeProvider,
172
+ this.themeService,
173
+ );
174
+ @Input({ alias: 'close-class' }) closeClass = resolveThemeDefault(
175
+ 'modal',
176
+ 'closeClass',
177
+ null,
178
+ this.themeProvider,
179
+ this.themeService,
180
+ );
181
+ @Input({ alias: 'body-class' }) bodyClass = resolveThemeDefault(
182
+ 'modal',
183
+ 'bodyClass',
184
+ null,
185
+ this.themeProvider,
186
+ this.themeService,
187
+ );
188
+ @Input({ alias: 'action-class' }) actionClass = resolveThemeDefault(
189
+ 'modal',
190
+ 'actionClass',
191
+ null,
192
+ this.themeProvider,
193
+ this.themeService,
194
+ );
195
+ @Input({ alias: 'header-fluid', transform: booleanAttribute }) headerFluid = resolveThemeDefault(
196
+ 'modal',
197
+ 'headerFluid',
198
+ false,
199
+ this.themeProvider,
200
+ this.themeService,
201
+ );
202
+ @Input({ alias: 'body-fluid', transform: booleanAttribute }) bodyFluid = resolveThemeDefault(
203
+ 'modal',
204
+ 'bodyFluid',
205
+ false,
206
+ this.themeProvider,
207
+ this.themeService,
208
+ );
209
+ @Input({ alias: 'action-fluid', transform: booleanAttribute }) actionFluid = resolveThemeDefault(
210
+ 'modal',
211
+ 'actionFluid',
212
+ false,
213
+ this.themeProvider,
214
+ this.themeService,
215
+ );
216
+ @Input({ alias: 'full-width', transform: booleanAttribute }) fullWidth = resolveThemeDefault(
217
+ 'modal',
218
+ 'fullWidth',
219
+ false,
220
+ this.themeProvider,
221
+ this.themeService,
222
+ );
223
+ @Input({ transform: booleanAttribute }) closable = resolveThemeDefault(
224
+ 'modal',
225
+ 'closable',
226
+ true,
227
+ this.themeProvider,
228
+ this.themeService,
229
+ );
230
+ @Input({ alias: 'close-on-overlay', transform: booleanAttribute }) closeOnOverlay =
231
+ resolveThemeDefault('modal', 'closeOnOverlay', true, this.themeProvider, this.themeService);
232
+ @Input({ alias: 'close-on-escape', transform: booleanAttribute }) closeOnEscape =
233
+ resolveThemeDefault('modal', 'closeOnEscape', true, this.themeProvider, this.themeService);
234
+ @Input({ alias: 'overlay-blur' }) overlayBlur = resolveThemeDefault(
235
+ 'modal',
236
+ 'overlayBlur',
237
+ '4px',
238
+ this.themeProvider,
239
+ this.themeService,
240
+ );
241
+ @Input({ alias: 'overlay-background' }) overlayBackground = resolveThemeDefault(
242
+ 'modal',
243
+ 'overlayBackground',
244
+ 'rgba(0, 0, 0, 0.45)',
245
+ this.themeProvider,
246
+ this.themeService,
247
+ );
248
+
249
+ @Output() onClose = new EventEmitter<void>();
250
+
251
+ @HostBinding('class.dasar-modal') readonly baseClass = true;
252
+ @HostBinding('class.open') get isOpen(): boolean {
253
+ return this.open;
254
+ }
255
+
256
+ ngOnChanges(changes: SimpleChanges): void {
257
+ if (changes['open']) {
258
+ this.toggleScrollLock(this.open);
259
+ }
260
+ }
261
+
262
+ ngOnDestroy(): void {
263
+ this.toggleScrollLock(false);
264
+ }
265
+
266
+ get hasHeader(): boolean {
267
+ return !!this.providedHeader;
268
+ }
269
+ get hasClose(): boolean {
270
+ return !!this.providedClose;
271
+ }
272
+ get hasAction(): boolean {
273
+ return !!this.providedAction;
274
+ }
275
+
276
+ get resolvedWidth(): string | null {
277
+ if (this.fullWidth) return '100%';
278
+ return this.width ?? null;
279
+ }
280
+
281
+ close(): void {
282
+ this.onClose.emit();
283
+ }
284
+
285
+ handleOverlayClick(): void {
286
+ if (this.closeOnOverlay) this.close();
287
+ }
288
+
289
+ @HostListener('document:keydown.escape')
290
+ handleEscape(): void {
291
+ if (this.open && this.closeOnEscape) this.close();
292
+ }
293
+
294
+ private toggleScrollLock(lock: boolean): void {
295
+ if (!isPlatformBrowser(this.platformId)) return;
296
+ this.document.body.style.overflow = lock ? 'hidden' : '';
297
+ }
298
+ }
299
+
300
+ export const DasarModalComponent = [
301
+ DasarModalHeaderSlot,
302
+ DasarModalCloseSlot,
303
+ DasarModalActionSlot,
304
+ DasarModal,
305
+ ] as const;
@@ -26,7 +26,7 @@
26
26
  color: var(--number-input-label-color, var(--theme-text-primary-color));
27
27
  justify-content: space-between;
28
28
  align-items: center;
29
- line-height: var(--line-height-tight); // Updated
29
+ line-height: var(--line-height-tight);
30
30
  display: flex;
31
31
 
32
32
  .dasar-number-input-label {
@@ -334,17 +334,12 @@
334
334
  background-color: var(--number-input-action-hover-background, rgba(0, 0, 0, 0.05));
335
335
  transition: all 0.2s ease;
336
336
  }
337
- // ::ng-deep dasar-button {
338
- // width: 100%;
339
- // height: 100%;
340
- // border-radius: var(--radius-none);
341
- // }
342
337
  }
343
338
 
344
339
  .dasar-number-input-hint {
345
340
  font-size: var(--number-input-hint-font-size, var(--font-size-xs));
346
341
  color: var(--number-input-hint-color, var(--theme-text-secondary-color));
347
- line-height: var(--line-height-normal); // Updated
342
+ line-height: var(--line-height-normal);
348
343
  margin-top: calc(var(--space-0-5) * -1);
349
344
 
350
345
  &.error {
@@ -0,0 +1,11 @@
1
+ <div
2
+ class="dasar-overlay-backdrop"
3
+ [style.--overlay-blur]="blur"
4
+ [style.--overlay-background]="background"
5
+ [style.z-index]="zIndex"
6
+ [ngClass]="overlayClass"
7
+ [ngStyle]="overlayStyle"
8
+ (click)="handleClick($event)"
9
+ >
10
+ <ng-content></ng-content>
11
+ </div>
@@ -0,0 +1,18 @@
1
+ @use '../../styles/theme.scss' as *;
2
+
3
+ .dasar-overlay {
4
+ display: contents;
5
+ }
6
+
7
+ .dasar-overlay-backdrop {
8
+ position: fixed;
9
+ inset: 0;
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ padding: var(--space-4, 16px);
14
+ box-sizing: border-box;
15
+ background: var(--overlay-background, rgba(0, 0, 0, 0.45));
16
+ backdrop-filter: blur(var(--overlay-blur, 4px));
17
+ -webkit-backdrop-filter: blur(var(--overlay-blur, 4px));
18
+ }