dasar-ui 1.9.2 → 1.10.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 (413) hide show
  1. package/README.md +64 -65
  2. package/fesm2022/dasar-ui.mjs +37004 -0
  3. package/fesm2022/dasar-ui.mjs.map +1 -0
  4. package/package.json +39 -57
  5. package/{projects/dasar-ui/src/lib/styles → styles}/theme.scss +238 -238
  6. package/types/dasar-ui.d.ts +4075 -0
  7. package/.dockerignore +0 -31
  8. package/.editorconfig +0 -17
  9. package/.github/workflows/npm-publish-github-packages.yml +0 -36
  10. package/.prettierrc +0 -12
  11. package/.versionrc.json +0 -4
  12. package/.vscode/extensions.json +0 -4
  13. package/.vscode/launch.json +0 -20
  14. package/.vscode/settings.json +0 -4
  15. package/.vscode/tasks.json +0 -42
  16. package/CHANGELOG.md +0 -101
  17. package/Dockerfile +0 -26
  18. package/angular.json +0 -114
  19. package/docs/_config.yml +0 -3
  20. package/docs/getting-started.md +0 -89
  21. package/docs/index.md +0 -9
  22. package/docs/installation.md +0 -46
  23. package/projects/dasar-ui/README.md +0 -64
  24. package/projects/dasar-ui/ng-package.json +0 -10
  25. package/projects/dasar-ui/package.json +0 -27
  26. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.html +0 -9
  27. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.scss +0 -352
  28. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.spec.ts +0 -21
  29. package/projects/dasar-ui/src/lib/components/dasar-button/dasar-button.ts +0 -154
  30. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.html +0 -1
  31. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.scss +0 -69
  32. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.spec.ts +0 -21
  33. package/projects/dasar-ui/src/lib/components/dasar-button-group/dasar-button-group.ts +0 -26
  34. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.html +0 -158
  35. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.scss +0 -371
  36. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.spec.ts +0 -21
  37. package/projects/dasar-ui/src/lib/components/dasar-calendar/dasar-calendar.ts +0 -458
  38. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.html +0 -80
  39. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.scss +0 -184
  40. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.spec.ts +0 -21
  41. package/projects/dasar-ui/src/lib/components/dasar-card/dasar-card.ts +0 -294
  42. package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.html +0 -42
  43. package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.scss +0 -38
  44. package/projects/dasar-ui/src/lib/components/dasar-chip/dasar-chip.ts +0 -205
  45. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.html +0 -111
  46. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.scss +0 -331
  47. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.spec.ts +0 -93
  48. package/projects/dasar-ui/src/lib/components/dasar-datepicker/dasar-datepicker.ts +0 -527
  49. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.html +0 -1
  50. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.registry.ts +0 -5087
  51. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.scss +0 -24
  52. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.spec.ts +0 -21
  53. package/projects/dasar-ui/src/lib/components/dasar-icon/dasar-icon.ts +0 -97
  54. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.html +0 -54
  55. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.scss +0 -251
  56. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.spec.ts +0 -21
  57. package/projects/dasar-ui/src/lib/components/dasar-input/dasar-input.ts +0 -319
  58. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list-item.html +0 -17
  59. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.html +0 -25
  60. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.scss +0 -122
  61. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.spec.ts +0 -21
  62. package/projects/dasar-ui/src/lib/components/dasar-list/dasar-list.ts +0 -166
  63. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.html +0 -64
  64. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.scss +0 -229
  65. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.spec.ts +0 -93
  66. package/projects/dasar-ui/src/lib/components/dasar-menu/dasar-menu.ts +0 -278
  67. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.html +0 -72
  68. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.scss +0 -170
  69. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.spec.ts +0 -267
  70. package/projects/dasar-ui/src/lib/components/dasar-modal/dasar-modal.ts +0 -305
  71. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.html +0 -90
  72. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.scss +0 -353
  73. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.spec.ts +0 -21
  74. package/projects/dasar-ui/src/lib/components/dasar-number-input/dasar-number-input.ts +0 -337
  75. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.html +0 -11
  76. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.scss +0 -18
  77. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.spec.ts +0 -112
  78. package/projects/dasar-ui/src/lib/components/dasar-overlay/dasar-overlay.ts +0 -87
  79. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.html +0 -98
  80. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.scss +0 -51
  81. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.spec.ts +0 -21
  82. package/projects/dasar-ui/src/lib/components/dasar-pagination/dasar-pagination.ts +0 -99
  83. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.css +0 -0
  84. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.html +0 -1
  85. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.spec.ts +0 -21
  86. package/projects/dasar-ui/src/lib/components/dasar-pin/dasar-pin.ts +0 -9
  87. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.html +0 -150
  88. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.scss +0 -272
  89. package/projects/dasar-ui/src/lib/components/dasar-pivot-table/dasar-pivot-table.ts +0 -228
  90. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.css +0 -0
  91. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.html +0 -1
  92. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.spec.ts +0 -21
  93. package/projects/dasar-ui/src/lib/components/dasar-radio/dasar-radio.ts +0 -9
  94. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.html +0 -189
  95. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.scss +0 -387
  96. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.spec.ts +0 -97
  97. package/projects/dasar-ui/src/lib/components/dasar-select/dasar-select.ts +0 -540
  98. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.css +0 -0
  99. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.html +0 -1
  100. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.spec.ts +0 -21
  101. package/projects/dasar-ui/src/lib/components/dasar-slider/dasar-slider.ts +0 -9
  102. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.html +0 -162
  103. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.scss +0 -283
  104. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.spec.ts +0 -21
  105. package/projects/dasar-ui/src/lib/components/dasar-table/dasar-table.ts +0 -380
  106. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.html +0 -103
  107. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.scss +0 -238
  108. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.spec.ts +0 -570
  109. package/projects/dasar-ui/src/lib/components/dasar-tabs/dasar-tabs.ts +0 -349
  110. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.html +0 -43
  111. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.scss +0 -189
  112. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.spec.ts +0 -21
  113. package/projects/dasar-ui/src/lib/components/dasar-textarea/dasar-textarea.ts +0 -139
  114. package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.spec.ts +0 -89
  115. package/projects/dasar-ui/src/lib/components/dasar-theme-provider/dasar-theme-provider.ts +0 -294
  116. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.css +0 -0
  117. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.html +0 -1
  118. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.spec.ts +0 -21
  119. package/projects/dasar-ui/src/lib/components/dasar-toast/dasar-toast.ts +0 -9
  120. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.css +0 -0
  121. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.html +0 -1
  122. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.spec.ts +0 -21
  123. package/projects/dasar-ui/src/lib/components/dasar-toggle/dasar-toggle.ts +0 -9
  124. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.css +0 -0
  125. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.html +0 -1
  126. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.spec.ts +0 -21
  127. package/projects/dasar-ui/src/lib/components/dasar-tooltip/dasar-tooltip.ts +0 -9
  128. package/projects/dasar-ui/src/lib/models/theme.model.ts +0 -730
  129. package/projects/dasar-ui/src/lib/models/type.model.ts +0 -11
  130. package/projects/dasar-ui/src/lib/services/theme.service.spec.ts +0 -130
  131. package/projects/dasar-ui/src/lib/services/theme.service.ts +0 -777
  132. package/projects/dasar-ui/src/lib/styles/theme.ts +0 -70
  133. package/projects/dasar-ui/src/lib/utils/common.ts +0 -156
  134. package/projects/dasar-ui/src/lib/utils/icon-size.spec.ts +0 -23
  135. package/projects/dasar-ui/src/lib/utils/icon-size.ts +0 -16
  136. package/projects/dasar-ui/src/lib/utils/panel-placement.spec.ts +0 -90
  137. package/projects/dasar-ui/src/lib/utils/panel-placement.ts +0 -53
  138. package/projects/dasar-ui/src/public-api.ts +0 -24
  139. package/projects/dasar-ui/tsconfig.lib.json +0 -21
  140. package/projects/dasar-ui/tsconfig.lib.prod.json +0 -11
  141. package/projects/dasar-ui/tsconfig.spec.json +0 -18
  142. package/projects/documentation/public/favicon.ico +0 -0
  143. package/projects/documentation/src/app/app.html +0 -78
  144. package/projects/documentation/src/app/app.spec.ts +0 -23
  145. package/projects/documentation/src/app/app.ts +0 -57
  146. package/projects/documentation/src/app/components/doc-customize-modal.component.ts +0 -368
  147. package/projects/documentation/src/app/components/doc-example.component.ts +0 -195
  148. package/projects/documentation/src/app/components/doc-markdown.component.ts +0 -154
  149. package/projects/documentation/src/app/config/app.config.server.ts +0 -10
  150. package/projects/documentation/src/app/config/app.config.ts +0 -17
  151. package/projects/documentation/src/app/layouts/doc.layout.ts +0 -249
  152. package/projects/documentation/src/app/pages/button/button.page.html +0 -65
  153. package/projects/documentation/src/app/pages/button/button.page.ts +0 -139
  154. package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.html +0 -7
  155. package/projects/documentation/src/app/pages/button/examples/appearance/button-appearance.example.ts +0 -10
  156. package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.html +0 -19
  157. package/projects/documentation/src/app/pages/button/examples/icon/button-icon.example.ts +0 -10
  158. package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.html +0 -9
  159. package/projects/documentation/src/app/pages/button/examples/radius/button-radius.example.ts +0 -10
  160. package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.html +0 -7
  161. package/projects/documentation/src/app/pages/button/examples/sizes/button-sizes.example.ts +0 -10
  162. package/projects/documentation/src/app/pages/button/examples/state/button-state.example.html +0 -10
  163. package/projects/documentation/src/app/pages/button/examples/state/button-state.example.ts +0 -10
  164. package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.html +0 -9
  165. package/projects/documentation/src/app/pages/button/examples/variant/button-variant.example.ts +0 -10
  166. package/projects/documentation/src/app/pages/calendar/calendar.page.html +0 -75
  167. package/projects/documentation/src/app/pages/calendar/calendar.page.ts +0 -165
  168. package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.html +0 -21
  169. package/projects/documentation/src/app/pages/calendar/examples/actions/calendar-actions.example.ts +0 -10
  170. package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.html +0 -11
  171. package/projects/documentation/src/app/pages/calendar/examples/basic/calendar-basic.example.ts +0 -13
  172. package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.html +0 -36
  173. package/projects/documentation/src/app/pages/calendar/examples/custom-header/calendar-custom-header.example.ts +0 -11
  174. package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.html +0 -10
  175. package/projects/documentation/src/app/pages/calendar/examples/dropdown/calendar-dropdown.example.ts +0 -12
  176. package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.html +0 -15
  177. package/projects/documentation/src/app/pages/calendar/examples/format/calendar-format.example.ts +0 -12
  178. package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.html +0 -34
  179. package/projects/documentation/src/app/pages/calendar/examples/locale/calendar-locale.example.ts +0 -14
  180. package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.html +0 -20
  181. package/projects/documentation/src/app/pages/calendar/examples/more/calendar.more.example.ts +0 -37
  182. package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.html +0 -16
  183. package/projects/documentation/src/app/pages/calendar/examples/styles/calendar-styles.example.ts +0 -10
  184. package/projects/documentation/src/app/pages/card/card.page.html +0 -75
  185. package/projects/documentation/src/app/pages/card/card.page.ts +0 -182
  186. package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.html +0 -13
  187. package/projects/documentation/src/app/pages/card/examples/appearance/card-appearance.example.ts +0 -10
  188. package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.html +0 -30
  189. package/projects/documentation/src/app/pages/card/examples/closable/card-closable.example.ts +0 -19
  190. package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.html +0 -173
  191. package/projects/documentation/src/app/pages/card/examples/custom-style/card-custom-style.example.ts +0 -10
  192. package/projects/documentation/src/app/pages/card/examples/media/card-media.example.html +0 -27
  193. package/projects/documentation/src/app/pages/card/examples/media/card-media.example.ts +0 -10
  194. package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.html +0 -13
  195. package/projects/documentation/src/app/pages/card/examples/radius/card-radius.example.ts +0 -10
  196. package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.html +0 -20
  197. package/projects/documentation/src/app/pages/card/examples/slots/card-slots.example.ts +0 -10
  198. package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.html +0 -11
  199. package/projects/documentation/src/app/pages/card/examples/spacing/card-spacing.example.ts +0 -10
  200. package/projects/documentation/src/app/pages/chip/chip.page.html +0 -55
  201. package/projects/documentation/src/app/pages/chip/chip.page.ts +0 -158
  202. package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.html +0 -7
  203. package/projects/documentation/src/app/pages/chip/examples/appearance/chip-appearance.example.ts +0 -10
  204. package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.html +0 -13
  205. package/projects/documentation/src/app/pages/chip/examples/more/chip-more.example.ts +0 -17
  206. package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.html +0 -9
  207. package/projects/documentation/src/app/pages/chip/examples/radius/chip-radius.example.ts +0 -10
  208. package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.html +0 -6
  209. package/projects/documentation/src/app/pages/chip/examples/sizes/chip-sizes.example.ts +0 -10
  210. package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.html +0 -8
  211. package/projects/documentation/src/app/pages/chip/examples/variant/chip-variant.example.ts +0 -10
  212. package/projects/documentation/src/app/pages/datepicker/datepicker.page.html +0 -75
  213. package/projects/documentation/src/app/pages/datepicker/datepicker.page.ts +0 -181
  214. package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.html +0 -29
  215. package/projects/documentation/src/app/pages/datepicker/examples/appearance/datepicker-appearance.example.ts +0 -10
  216. package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.html +0 -12
  217. package/projects/documentation/src/app/pages/datepicker/examples/basic/datepicker-basic.example.ts +0 -12
  218. package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.html +0 -23
  219. package/projects/documentation/src/app/pages/datepicker/examples/footer/datepicker-footer.example.ts +0 -17
  220. package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.html +0 -30
  221. package/projects/documentation/src/app/pages/datepicker/examples/format/datepicker-format.example.ts +0 -13
  222. package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.html +0 -24
  223. package/projects/documentation/src/app/pages/datepicker/examples/placement/datepicker-placement.example.ts +0 -10
  224. package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.html +0 -19
  225. package/projects/documentation/src/app/pages/datepicker/examples/slots/datepicker-slots.example.ts +0 -10
  226. package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.html +0 -28
  227. package/projects/documentation/src/app/pages/datepicker/examples/states/datepicker-states.example.ts +0 -12
  228. package/projects/documentation/src/app/pages/getting-started/getting-started.page.ts +0 -21
  229. package/projects/documentation/src/app/pages/icon/icon.page.html +0 -15
  230. package/projects/documentation/src/app/pages/icon/icon.page.ts +0 -60
  231. package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.html +0 -27
  232. package/projects/documentation/src/app/pages/input/examples/appearance/input-appearance.example.ts +0 -10
  233. package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.html +0 -13
  234. package/projects/documentation/src/app/pages/input/examples/basic/input-basic.example.ts +0 -13
  235. package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.html +0 -31
  236. package/projects/documentation/src/app/pages/input/examples/mask/input-mask.example.ts +0 -19
  237. package/projects/documentation/src/app/pages/input/examples/more/input-more.example.html +0 -68
  238. package/projects/documentation/src/app/pages/input/examples/more/input-more.example.ts +0 -18
  239. package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.html +0 -52
  240. package/projects/documentation/src/app/pages/input/examples/slots/input-slots.example.ts +0 -10
  241. package/projects/documentation/src/app/pages/input/examples/states/input-states.example.html +0 -29
  242. package/projects/documentation/src/app/pages/input/examples/states/input-states.example.ts +0 -10
  243. package/projects/documentation/src/app/pages/input/input.page.html +0 -65
  244. package/projects/documentation/src/app/pages/input/input.page.ts +0 -170
  245. package/projects/documentation/src/app/pages/installation/installation.page.ts +0 -18
  246. package/projects/documentation/src/app/pages/introduction/introduction.page.ts +0 -18
  247. package/projects/documentation/src/app/pages/list/examples/advanced-dynamic/list-advanced-dynamic.example.html +0 -29
  248. package/projects/documentation/src/app/pages/list/examples/advanced-dynamic/list-advanced-dynamic.example.ts +0 -33
  249. package/projects/documentation/src/app/pages/list/examples/advanced-theme/list-advanced-theme.example.html +0 -13
  250. package/projects/documentation/src/app/pages/list/examples/advanced-theme/list-advanced-theme.example.ts +0 -30
  251. package/projects/documentation/src/app/pages/list/examples/basic/list-basic.example.html +0 -5
  252. package/projects/documentation/src/app/pages/list/examples/basic/list-basic.example.ts +0 -12
  253. package/projects/documentation/src/app/pages/list/examples/bordered-divider/list-bordered-divider.example.html +0 -20
  254. package/projects/documentation/src/app/pages/list/examples/bordered-divider/list-bordered-divider.example.ts +0 -12
  255. package/projects/documentation/src/app/pages/list/examples/custom-style/list-custom-style.example.html +0 -11
  256. package/projects/documentation/src/app/pages/list/examples/custom-style/list-custom-style.example.ts +0 -19
  257. package/projects/documentation/src/app/pages/list/examples/header-footer/list-header-footer.example.html +0 -7
  258. package/projects/documentation/src/app/pages/list/examples/header-footer/list-header-footer.example.ts +0 -12
  259. package/projects/documentation/src/app/pages/list/examples/interactive/list-interactive.example.html +0 -20
  260. package/projects/documentation/src/app/pages/list/examples/interactive/list-interactive.example.ts +0 -22
  261. package/projects/documentation/src/app/pages/list/examples/prefix-suffix/list-prefix-suffix.example.html +0 -9
  262. package/projects/documentation/src/app/pages/list/examples/prefix-suffix/list-prefix-suffix.example.ts +0 -16
  263. package/projects/documentation/src/app/pages/list/examples/size/list-size.example.html +0 -20
  264. package/projects/documentation/src/app/pages/list/examples/size/list-size.example.ts +0 -12
  265. package/projects/documentation/src/app/pages/list/list.page.html +0 -95
  266. package/projects/documentation/src/app/pages/list/list.page.ts +0 -238
  267. package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.html +0 -5
  268. package/projects/documentation/src/app/pages/menu/examples/basic/menu-basic.example.ts +0 -17
  269. package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.html +0 -35
  270. package/projects/documentation/src/app/pages/menu/examples/custom-template/menu-custom-template.example.ts +0 -57
  271. package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.html +0 -12
  272. package/projects/documentation/src/app/pages/menu/examples/placement/menu-placement.example.ts +0 -16
  273. package/projects/documentation/src/app/pages/menu/menu.page.html +0 -35
  274. package/projects/documentation/src/app/pages/menu/menu.page.ts +0 -149
  275. package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.html +0 -18
  276. package/projects/documentation/src/app/pages/modal/examples/appearance/modal-appearance.example.ts +0 -21
  277. package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.html +0 -8
  278. package/projects/documentation/src/app/pages/modal/examples/basic/modal-basic.example.ts +0 -12
  279. package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.html +0 -44
  280. package/projects/documentation/src/app/pages/modal/examples/close-behavior/modal-close-behavior.example.ts +0 -14
  281. package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.html +0 -36
  282. package/projects/documentation/src/app/pages/modal/examples/custom-style/modal-custom-style.example.ts +0 -12
  283. package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.html +0 -29
  284. package/projects/documentation/src/app/pages/modal/examples/overlay/modal-overlay.example.ts +0 -14
  285. package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.html +0 -27
  286. package/projects/documentation/src/app/pages/modal/examples/radius-spacing/modal-radius-spacing.example.ts +0 -27
  287. package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.html +0 -14
  288. package/projects/documentation/src/app/pages/modal/examples/scroll/modal-scroll.example.ts +0 -13
  289. package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.html +0 -17
  290. package/projects/documentation/src/app/pages/modal/examples/size/modal-size.example.ts +0 -21
  291. package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.html +0 -30
  292. package/projects/documentation/src/app/pages/modal/examples/slots/modal-slots.example.ts +0 -12
  293. package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.html +0 -23
  294. package/projects/documentation/src/app/pages/modal/examples/width/modal-width.example.ts +0 -13
  295. package/projects/documentation/src/app/pages/modal/modal.page.html +0 -105
  296. package/projects/documentation/src/app/pages/modal/modal.page.ts +0 -266
  297. package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.html +0 -30
  298. package/projects/documentation/src/app/pages/number-input/examples/appearance/number-input-appearance.example.ts +0 -10
  299. package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.html +0 -12
  300. package/projects/documentation/src/app/pages/number-input/examples/basic/number-input-basic.example.ts +0 -13
  301. package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.html +0 -30
  302. package/projects/documentation/src/app/pages/number-input/examples/limits/number-input-limits.example.ts +0 -14
  303. package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.html +0 -49
  304. package/projects/documentation/src/app/pages/number-input/examples/slots/number-input-slots.example.ts +0 -10
  305. package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.html +0 -21
  306. package/projects/documentation/src/app/pages/number-input/examples/states/number-input-states.example.ts +0 -10
  307. package/projects/documentation/src/app/pages/number-input/number-input.page.html +0 -55
  308. package/projects/documentation/src/app/pages/number-input/number-input.page.ts +0 -142
  309. package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.html +0 -32
  310. package/projects/documentation/src/app/pages/select/examples/appearance/select-appearance.example.ts +0 -15
  311. package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.html +0 -13
  312. package/projects/documentation/src/app/pages/select/examples/basic/select-basic.example.ts +0 -20
  313. package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.html +0 -24
  314. package/projects/documentation/src/app/pages/select/examples/multiple/select-multiple.example.ts +0 -59
  315. package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.html +0 -20
  316. package/projects/documentation/src/app/pages/select/examples/placement/select-placement.example.ts +0 -20
  317. package/projects/documentation/src/app/pages/select/examples/search/select-search.example.html +0 -13
  318. package/projects/documentation/src/app/pages/select/examples/search/select-search.example.ts +0 -22
  319. package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.html +0 -44
  320. package/projects/documentation/src/app/pages/select/examples/slots/select-slots.example.ts +0 -15
  321. package/projects/documentation/src/app/pages/select/examples/states/select-states.example.html +0 -31
  322. package/projects/documentation/src/app/pages/select/examples/states/select-states.example.ts +0 -12
  323. package/projects/documentation/src/app/pages/select/select.page.html +0 -75
  324. package/projects/documentation/src/app/pages/select/select.page.ts +0 -195
  325. package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.html +0 -14
  326. package/projects/documentation/src/app/pages/table/examples/cell-actions/table-cell-actions.example.ts +0 -25
  327. package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.html +0 -12
  328. package/projects/documentation/src/app/pages/table/examples/cell-badge/table-cell-badge.example.ts +0 -21
  329. package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.html +0 -29
  330. package/projects/documentation/src/app/pages/table/examples/cell-profile/table-cell-profile.example.ts +0 -20
  331. package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.html +0 -39
  332. package/projects/documentation/src/app/pages/table/examples/custom-body/table-custom-body.example.ts +0 -21
  333. package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.html +0 -7
  334. package/projects/documentation/src/app/pages/table/examples/custom-sizes/table-custom-sizes.example.ts +0 -21
  335. package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.html +0 -3
  336. package/projects/documentation/src/app/pages/table/examples/dynamic-style/table-dynamic-style.example.ts +0 -41
  337. package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.html +0 -43
  338. package/projects/documentation/src/app/pages/table/examples/empty/table-empty.example.ts +0 -21
  339. package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.html +0 -36
  340. package/projects/documentation/src/app/pages/table/examples/expanded/table-expanded.example.ts +0 -34
  341. package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.html +0 -8
  342. package/projects/documentation/src/app/pages/table/examples/heatmap/table-heatmap.example.ts +0 -52
  343. package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.html +0 -53
  344. package/projects/documentation/src/app/pages/table/examples/inline-edit/table-inline-edit.example.ts +0 -50
  345. package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.html +0 -23
  346. package/projects/documentation/src/app/pages/table/examples/nested/table-nested.example.ts +0 -42
  347. package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.html +0 -20
  348. package/projects/documentation/src/app/pages/table/examples/pagination/table-pagination.example.ts +0 -21
  349. package/projects/documentation/src/app/pages/table/table.page.html +0 -125
  350. package/projects/documentation/src/app/pages/table/table.page.ts +0 -261
  351. package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.html +0 -13
  352. package/projects/documentation/src/app/pages/tabs/examples/advanced-dynamic/tabs-advanced-dynamic.example.ts +0 -27
  353. package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.html +0 -27
  354. package/projects/documentation/src/app/pages/tabs/examples/advanced-form/tabs-advanced-form.example.ts +0 -36
  355. package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.html +0 -5
  356. package/projects/documentation/src/app/pages/tabs/examples/advanced-theme/tabs-advanced-theme.example.ts +0 -20
  357. package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.html +0 -6
  358. package/projects/documentation/src/app/pages/tabs/examples/appearance/tabs-appearance.example.ts +0 -13
  359. package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.html +0 -13
  360. package/projects/documentation/src/app/pages/tabs/examples/basic/tabs-basic.example.ts +0 -13
  361. package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.html +0 -19
  362. package/projects/documentation/src/app/pages/tabs/examples/custom-style/tabs-custom-style.example.ts +0 -12
  363. package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.html +0 -16
  364. package/projects/documentation/src/app/pages/tabs/examples/events/tabs-events.example.ts +0 -23
  365. package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.html +0 -5
  366. package/projects/documentation/src/app/pages/tabs/examples/fluid/tabs-fluid.example.ts +0 -12
  367. package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.html +0 -6
  368. package/projects/documentation/src/app/pages/tabs/examples/no-body/tabs-no-body.example.ts +0 -12
  369. package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.html +0 -6
  370. package/projects/documentation/src/app/pages/tabs/examples/radius/tabs-radius.example.ts +0 -13
  371. package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.html +0 -20
  372. package/projects/documentation/src/app/pages/tabs/examples/scroll/tabs-scroll.example.ts +0 -30
  373. package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.html +0 -16
  374. package/projects/documentation/src/app/pages/tabs/examples/scroll-icon/tabs-scroll-icon.example.ts +0 -26
  375. package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.html +0 -22
  376. package/projects/documentation/src/app/pages/tabs/examples/scroll-slot/tabs-scroll-slot.example.ts +0 -26
  377. package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.html +0 -6
  378. package/projects/documentation/src/app/pages/tabs/examples/size/tabs-size.example.ts +0 -13
  379. package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.html +0 -25
  380. package/projects/documentation/src/app/pages/tabs/examples/slots/tabs-slots.example.ts +0 -10
  381. package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.html +0 -6
  382. package/projects/documentation/src/app/pages/tabs/examples/spacing/tabs-spacing.example.ts +0 -13
  383. package/projects/documentation/src/app/pages/tabs/tabs.page.html +0 -165
  384. package/projects/documentation/src/app/pages/tabs/tabs.page.ts +0 -347
  385. package/projects/documentation/src/app/pages/theming/examples/component-config/theming-component-config.example.html +0 -13
  386. package/projects/documentation/src/app/pages/theming/examples/component-config/theming-component-config.example.ts +0 -20
  387. package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.html +0 -8
  388. package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.scss +0 -4
  389. package/projects/documentation/src/app/pages/theming/examples/css-override/theming-css-override.example.ts +0 -11
  390. package/projects/documentation/src/app/pages/theming/examples/custom-tokens/theming-custom-tokens.example.html +0 -13
  391. package/projects/documentation/src/app/pages/theming/examples/custom-tokens/theming-custom-tokens.example.ts +0 -33
  392. package/projects/documentation/src/app/pages/theming/examples/global-theme/theming-global-theme.example.html +0 -6
  393. package/projects/documentation/src/app/pages/theming/examples/global-theme/theming-global-theme.example.ts +0 -20
  394. package/projects/documentation/src/app/pages/theming/examples/light-dark/theming-light-dark.example.html +0 -15
  395. package/projects/documentation/src/app/pages/theming/examples/light-dark/theming-light-dark.example.ts +0 -31
  396. package/projects/documentation/src/app/pages/theming/theming-component-config.page.ts +0 -52
  397. package/projects/documentation/src/app/pages/theming/theming-css-variables.page.ts +0 -71
  398. package/projects/documentation/src/app/pages/theming/theming-tokens.page.ts +0 -56
  399. package/projects/documentation/src/app/pages/theming/theming.data.ts +0 -947
  400. package/projects/documentation/src/app/pages/theming/theming.page.html +0 -56
  401. package/projects/documentation/src/app/pages/theming/theming.page.ts +0 -144
  402. package/projects/documentation/src/app/routes/app.routes.server.ts +0 -8
  403. package/projects/documentation/src/app/routes/app.routes.ts +0 -135
  404. package/projects/documentation/src/app/services/doc-customize.service.ts +0 -119
  405. package/projects/documentation/src/app/utils/highlight.pipe.ts +0 -43
  406. package/projects/documentation/src/index.html +0 -13
  407. package/projects/documentation/src/main.server.ts +0 -7
  408. package/projects/documentation/src/main.ts +0 -5
  409. package/projects/documentation/src/server.ts +0 -47
  410. package/projects/documentation/src/styles.scss +0 -19
  411. package/projects/documentation/tsconfig.app.json +0 -11
  412. package/projects/documentation/tsconfig.spec.json +0 -10
  413. package/tsconfig.json +0 -40
@@ -1,93 +0,0 @@
1
- import { Component, signal } from '@angular/core';
2
- import { ComponentFixture, TestBed } from '@angular/core/testing';
3
- import { DasarDatepicker, DasarDatepickerComponent } from './dasar-datepicker';
4
-
5
- @Component({
6
- standalone: true,
7
- imports: [DasarDatepickerComponent],
8
- template: `
9
- <dasar-datepicker
10
- [size]="size()"
11
- [radius]="radius()"
12
- [placement]="placement()"
13
- [value]="value()"
14
- clearable
15
- placeholder="Pick a date"
16
- />
17
- `,
18
- })
19
- class DatepickerHost {
20
- size = signal<'sm' | 'md' | 'lg'>('sm');
21
- radius = signal<'none' | 'md' | 'lg' | 'full'>('lg');
22
- placement = signal<'bottom-start' | 'top-start'>('bottom-start');
23
- value = signal<string | null>(null);
24
- }
25
-
26
- describe('DasarDatepicker', () => {
27
- let component: DasarDatepicker;
28
- let fixture: ComponentFixture<DatepickerHost>;
29
- let host: DatepickerHost;
30
-
31
- const trigger = () =>
32
- fixture.nativeElement.querySelector('.dasar-datepicker-trigger') as HTMLElement;
33
- const dropdown = () =>
34
- fixture.nativeElement.querySelector('.dasar-datepicker-dropdown') as HTMLElement;
35
- const open = async () => {
36
- trigger().click();
37
- await fixture.whenStable();
38
- };
39
-
40
- beforeEach(async () => {
41
- await TestBed.configureTestingModule({
42
- imports: [DatepickerHost],
43
- }).compileComponents();
44
-
45
- fixture = TestBed.createComponent(DatepickerHost);
46
- host = fixture.componentInstance;
47
- component = fixture.debugElement.children[0].componentInstance;
48
- fixture.detectChanges();
49
- });
50
-
51
- it('should create', () => {
52
- expect(component).toBeTruthy();
53
- });
54
-
55
- it('calendar icon fits the trigger size', () => {
56
- const svg = trigger().querySelector('.calendar-icon svg') as SVGElement;
57
- expect(svg.getAttribute('width')).toBe('14');
58
- });
59
-
60
- it('clear icon fits the trigger size when there is a value', () => {
61
- host.value.set('2026-01-05');
62
- fixture.detectChanges();
63
- const svg = trigger().querySelector('.clear-icon svg') as SVGElement;
64
- expect(svg.getAttribute('width')).toBe('14');
65
- });
66
-
67
- it('dropdown follows the trigger size and radius', async () => {
68
- await open();
69
-
70
- expect(dropdown()).toBeTruthy();
71
- expect(dropdown().classList).toContain('size-sm');
72
- expect(dropdown().classList).toContain('radius-lg');
73
- expect(dropdown().classList).toContain('placement-bottom-start');
74
- });
75
-
76
- it('dropdown starts at the requested placement', async () => {
77
- host.placement.set('top-start');
78
- await open();
79
-
80
- expect(dropdown().classList).toContain('placement-top-start');
81
- });
82
-
83
- it('never writes the flipped placement back to the placement input', async () => {
84
- await open();
85
-
86
- expect(component.placement).toBe('bottom-start');
87
- expect(component.currentPlacement).toBe('bottom-start');
88
- });
89
-
90
- it('renders no dropdown while closed', () => {
91
- expect(dropdown()).toBeNull();
92
- });
93
- });
@@ -1,527 +0,0 @@
1
- import {
2
- Component,
3
- Input,
4
- Output,
5
- EventEmitter,
6
- booleanAttribute,
7
- ElementRef,
8
- HostListener,
9
- OnInit,
10
- forwardRef,
11
- inject,
12
- ChangeDetectorRef,
13
- ViewEncapsulation,
14
- Directive,
15
- ContentChild,
16
- HostBinding,
17
- ViewChild,
18
- } from '@angular/core';
19
- import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
20
- import { DASAR_THEME_PROVIDER } from '../dasar-theme-provider/dasar-theme-provider';
21
- import { ClassType, StyleType, ScaleAttributeType } from '../../models/type.model';
22
- import { DasarCalendarComponent } from '../dasar-calendar/dasar-calendar';
23
- import { resolveThemeDefault, safeFormat } from '../../utils/common';
24
- import { computeSmartPlacement, DasarPanelPlacement } from '../../utils/panel-placement';
25
- import { fieldIconSize } from '../../utils/icon-size';
26
- import { DasarButtonComponent } from '../dasar-button/dasar-button';
27
- import { DasarThemeService } from '../../services/theme.service';
28
- import { DasarIconComponent } from '../dasar-icon/dasar-icon';
29
- import { CommonModule } from '@angular/common';
30
-
31
- export type DasarDatepickerPlacement = DasarPanelPlacement;
32
- export type DasarDatepickerSize = Extract<ScaleAttributeType, 'sm' | 'md' | 'lg'>;
33
- export type DasarDatepickerAppearance = 'outline' | 'filled' | 'subtle';
34
- export type DasarDatepickerRadius = ScaleAttributeType;
35
- export type DasarDatepickerType = 'date';
36
-
37
- export interface DasarDatepickerConfig {
38
- fullWidth?: boolean;
39
- clearable?: boolean;
40
- disabled?: boolean;
41
- fluid?: boolean;
42
- error?: boolean;
43
- displayFormat?: string;
44
- valueFormat?: string;
45
- placement?: DasarDatepickerPlacement;
46
- appearance?: DasarDatepickerAppearance;
47
- extraLabel?: string;
48
- placeholder?: string;
49
- radius?: DasarDatepickerRadius;
50
- type?: DasarDatepickerType;
51
- size?: DasarDatepickerSize;
52
- locale?: string;
53
- label?: string;
54
- hint?: string;
55
- containerClass?: ClassType;
56
- wrapperClass?: ClassType;
57
- triggerClass?: ClassType;
58
- dropdownClass?: ClassType;
59
- labelWrapperClass?: ClassType;
60
- hintWrapperClass?: ClassType;
61
- wrapperStyle?: StyleType;
62
- triggerStyle?: StyleType;
63
- labelWrapperStyle?: StyleType;
64
- hintWrapperStyle?: StyleType;
65
- containerStyle?: StyleType;
66
- dropdownStyle?: StyleType;
67
- }
68
-
69
- @Directive({ selector: '[prefix-slot]', standalone: true })
70
- export class DasarDatepickerPrefixSlot {}
71
- @Directive({ selector: '[label-slot]', standalone: true })
72
- export class DasarDatepickerLabelSlot {}
73
- @Directive({ selector: '[extra-label-slot]', standalone: true })
74
- export class DasarDatepickerExtraLabelSlot {}
75
- @Directive({ selector: '[extra-header-slot]', standalone: true })
76
- export class DasarDatepickerExtraHeaderSlot {}
77
- @Directive({ selector: '[extra-footer-slot]', standalone: true })
78
- export class DasarDatepickerExtraFooterSlot {}
79
- @Directive({ selector: '[hint-slot]', standalone: true })
80
- export class DasarDatepickerHintSlot {}
81
-
82
- @Component({
83
- selector: 'dasar-datepicker',
84
- standalone: true,
85
- imports: [
86
- CommonModule,
87
- FormsModule,
88
- DasarCalendarComponent,
89
- DasarIconComponent,
90
- DasarButtonComponent,
91
- ],
92
- templateUrl: './dasar-datepicker.html',
93
- styleUrls: ['./dasar-datepicker.scss'],
94
- encapsulation: ViewEncapsulation.None,
95
- providers: [
96
- {
97
- provide: NG_VALUE_ACCESSOR,
98
- useExisting: forwardRef(() => DasarDatepicker),
99
- multi: true,
100
- },
101
- ],
102
- })
103
- export class DasarDatepicker implements OnInit, ControlValueAccessor {
104
- private themeProvider = inject(DASAR_THEME_PROVIDER, { optional: true });
105
- private themeService = inject(DasarThemeService, { optional: true });
106
- private cdr = inject(ChangeDetectorRef);
107
- private elementRef = inject(ElementRef);
108
-
109
- @ContentChild(DasarDatepickerExtraHeaderSlot) extraHeaderSlot?: DasarDatepickerExtraHeaderSlot;
110
- @ContentChild(DasarDatepickerExtraFooterSlot) extraFooterSlot?: DasarDatepickerExtraFooterSlot;
111
- @ContentChild(DasarDatepickerExtraLabelSlot) extraLabelSlot?: DasarDatepickerExtraLabelSlot;
112
- @ContentChild(DasarDatepickerLabelSlot) labelSlot?: DasarDatepickerLabelSlot;
113
- @ContentChild(DasarDatepickerHintSlot) hintSlot?: DasarDatepickerHintSlot;
114
- @ContentChild(DasarDatepickerPrefixSlot) prefixSlot?: DasarDatepickerPrefixSlot;
115
-
116
- @ViewChild('triggerElement') triggerEl?: ElementRef<HTMLElement>;
117
- @ViewChild('dropdownElement') dropdownEl?: ElementRef<HTMLElement>;
118
-
119
- @Input({ alias: 'display-format' }) displayFormat = resolveThemeDefault(
120
- 'datepicker',
121
- 'displayFormat',
122
- 'DD-MM-YYYY',
123
- this.themeProvider,
124
- this.themeService,
125
- );
126
- @Input({ alias: 'value-format' }) valueFormat = resolveThemeDefault(
127
- 'datepicker',
128
- 'valueFormat',
129
- 'yyyy-MM-dd',
130
- this.themeProvider,
131
- this.themeService,
132
- );
133
- @Input() locale = resolveThemeDefault(
134
- 'datepicker',
135
- 'locale',
136
- 'en-US',
137
- this.themeProvider,
138
- this.themeService,
139
- );
140
- private _placement: DasarDatepickerPlacement = resolveThemeDefault(
141
- 'datepicker',
142
- 'placement',
143
- 'bottom-start',
144
- this.themeProvider,
145
- this.themeService,
146
- );
147
- @Input()
148
- set placement(value: DasarDatepickerPlacement) {
149
- this._placement = value;
150
- this.currentPlacement = value;
151
- }
152
- get placement(): DasarDatepickerPlacement {
153
- return this._placement;
154
- }
155
- currentPlacement: DasarDatepickerPlacement = this._placement;
156
- @Input() appearance = resolveThemeDefault(
157
- 'datepicker',
158
- 'appearance',
159
- 'outline',
160
- this.themeProvider,
161
- this.themeService,
162
- );
163
- @Input() radius = resolveThemeDefault(
164
- 'datepicker',
165
- 'radius',
166
- 'md',
167
- this.themeProvider,
168
- this.themeService,
169
- );
170
- @Input() type = resolveThemeDefault(
171
- 'datepicker',
172
- 'type',
173
- 'date',
174
- this.themeProvider,
175
- this.themeService,
176
- );
177
- @Input() size = resolveThemeDefault(
178
- 'datepicker',
179
- 'size',
180
- 'md',
181
- this.themeProvider,
182
- this.themeService,
183
- );
184
- @Input() placeholder = resolveThemeDefault(
185
- 'datepicker',
186
- 'placeholder',
187
- 'Select date',
188
- this.themeProvider,
189
- this.themeService,
190
- );
191
- @Input() label = resolveThemeDefault(
192
- 'datepicker',
193
- 'label',
194
- undefined,
195
- this.themeProvider,
196
- this.themeService,
197
- );
198
- @Input({ alias: 'extra-label' }) extraLabel = resolveThemeDefault(
199
- 'datepicker',
200
- 'extraLabel',
201
- undefined,
202
- this.themeProvider,
203
- this.themeService,
204
- );
205
- @Input() hint = resolveThemeDefault(
206
- 'datepicker',
207
- 'hint',
208
- undefined,
209
- this.themeProvider,
210
- this.themeService,
211
- );
212
- @Input({ alias: 'container-class' }) containerClass = resolveThemeDefault(
213
- 'datepicker',
214
- 'containerClass',
215
- null,
216
- this.themeProvider,
217
- this.themeService,
218
- );
219
- @Input({ alias: 'wrapper-class' }) wrapperClass = resolveThemeDefault(
220
- 'datepicker',
221
- 'wrapperClass',
222
- null,
223
- this.themeProvider,
224
- this.themeService,
225
- );
226
- @Input({ alias: 'trigger-class' }) triggerClass = resolveThemeDefault(
227
- 'datepicker',
228
- 'triggerClass',
229
- null,
230
- this.themeProvider,
231
- this.themeService,
232
- );
233
- @Input({ alias: 'dropdown-class' }) dropdownClass = resolveThemeDefault(
234
- 'datepicker',
235
- 'dropdownClass',
236
- null,
237
- this.themeProvider,
238
- this.themeService,
239
- );
240
- @Input({ alias: 'label-wrapper-class' }) labelWrapperClass = resolveThemeDefault(
241
- 'datepicker',
242
- 'labelWrapperClass',
243
- null,
244
- this.themeProvider,
245
- this.themeService,
246
- );
247
- @Input({ alias: 'hint-wrapper-class' }) hintWrapperClass = resolveThemeDefault(
248
- 'datepicker',
249
- 'hintWrapperClass',
250
- null,
251
- this.themeProvider,
252
- this.themeService,
253
- );
254
- @Input({ alias: 'container-style' }) containerStyle = resolveThemeDefault(
255
- 'datepicker',
256
- 'containerStyle',
257
- null,
258
- this.themeProvider,
259
- this.themeService,
260
- );
261
- @Input({ alias: 'wrapper-style' }) wrapperStyle = resolveThemeDefault(
262
- 'datepicker',
263
- 'wrapperStyle',
264
- null,
265
- this.themeProvider,
266
- this.themeService,
267
- );
268
- @Input({ alias: 'trigger-style' }) triggerStyle = resolveThemeDefault(
269
- 'datepicker',
270
- 'triggerStyle',
271
- null,
272
- this.themeProvider,
273
- this.themeService,
274
- );
275
- @Input({ alias: 'dropdown-style' }) dropdownStyle = resolveThemeDefault(
276
- 'datepicker',
277
- 'dropdownStyle',
278
- null,
279
- this.themeProvider,
280
- this.themeService,
281
- );
282
- @Input({ alias: 'label-wrapper-style' }) labelWrapperStyle = resolveThemeDefault(
283
- 'datepicker',
284
- 'labelWrapperStyle',
285
- null,
286
- this.themeProvider,
287
- this.themeService,
288
- );
289
- @Input({ alias: 'hint-wrapper-style' }) hintWrapperStyle = resolveThemeDefault(
290
- 'datepicker',
291
- 'hintWrapperStyle',
292
- null,
293
- this.themeProvider,
294
- this.themeService,
295
- );
296
- @Input({ alias: 'full-width', transform: booleanAttribute }) fullWidth = resolveThemeDefault(
297
- 'datepicker',
298
- 'fullWidth',
299
- false,
300
- this.themeProvider,
301
- this.themeService,
302
- );
303
- @Input({ transform: booleanAttribute }) clearable = resolveThemeDefault(
304
- 'datepicker',
305
- 'clearable',
306
- false,
307
- this.themeProvider,
308
- this.themeService,
309
- );
310
- @Input({ transform: booleanAttribute }) disabled = resolveThemeDefault(
311
- 'datepicker',
312
- 'disabled',
313
- false,
314
- this.themeProvider,
315
- this.themeService,
316
- );
317
- @Input({ transform: booleanAttribute }) fluid = resolveThemeDefault(
318
- 'datepicker',
319
- 'fluid',
320
- false,
321
- this.themeProvider,
322
- this.themeService,
323
- );
324
- @Input({ transform: booleanAttribute }) error = resolveThemeDefault(
325
- 'datepicker',
326
- 'error',
327
- false,
328
- this.themeProvider,
329
- this.themeService,
330
- );
331
-
332
- @Output() valueChange = new EventEmitter<any>();
333
- @Output() onDateSelected = new EventEmitter<any>();
334
- @Output() onInitialized = new EventEmitter<void>();
335
- @Output() onClickIn = new EventEmitter<Event>();
336
- @Output() onClickOut = new EventEmitter<Event>();
337
-
338
- @Output() onNextMonthClick = new EventEmitter<void>();
339
- @Output() onPrevMonthClick = new EventEmitter<void>();
340
- @Output() onNextYearClick = new EventEmitter<void>();
341
- @Output() onPrevYearClick = new EventEmitter<void>();
342
-
343
- @Output() onCleared = new EventEmitter<void>();
344
- @Output() onCouched = new EventEmitter<void>();
345
- @Output() onFocus = new EventEmitter<Event | void>();
346
- @Output() onBlur = new EventEmitter<Event | void>();
347
-
348
- @HostBinding('class.dasar-datepicker') readonly baseClass = true;
349
- @HostBinding('class.full-width') get hasFullWidth(): boolean {
350
- return this.fullWidth;
351
- }
352
- @HostBinding('class.disabled') get isDisabled(): boolean {
353
- return this.disabled;
354
- }
355
-
356
- private _value: any = null;
357
- internalDate: Date | null = null;
358
- isOpen: boolean = false;
359
- private isFocused: boolean = false;
360
-
361
- @Input()
362
- get value(): any {
363
- return this._value;
364
- }
365
- set value(val: any) {
366
- if (this._value !== val) {
367
- this._value = val ?? null;
368
- this.syncInternalDate();
369
- this.cdr.markForCheck();
370
- }
371
- }
372
-
373
- onTouched: any = () => {};
374
- onChange: any = () => {};
375
-
376
- ngOnInit() {
377
- this.syncInternalDate();
378
- this.onInitialized.emit();
379
- }
380
-
381
- get hasLabelRow(): boolean {
382
- return !!(this.label || this.labelSlot || this.extraLabel || this.extraLabelSlot);
383
- }
384
- get hasHintRow(): boolean {
385
- return !!(this.hint || this.hintSlot);
386
- }
387
- get formattedDisplay(): string {
388
- if (!this.internalDate || isNaN(this.internalDate.getTime())) return '';
389
- try {
390
- const formatToUse = () => {
391
- return this.displayFormat;
392
- };
393
- return safeFormat(this.internalDate, formatToUse(), this.locale);
394
- } catch {
395
- return this.internalDate.toDateString();
396
- }
397
- }
398
-
399
- writeValue(value: any): void {
400
- if (this._value === value) return;
401
- this._value = value ?? null;
402
- this.syncInternalDate();
403
- this.cdr.markForCheck();
404
- }
405
- registerOnChange(fn: any): void {
406
- this.onChange = fn;
407
- }
408
- registerOnTouched(fn: any): void {
409
- this.onTouched = fn;
410
- }
411
- setDisabledState(isDisabled: boolean): void {
412
- this.disabled = isDisabled;
413
- this.cdr.detectChanges();
414
- }
415
-
416
- @HostListener('document:click', ['$event'])
417
- onClickOutside(event: Event) {
418
- if (this.isOpen && !this.elementRef.nativeElement.contains(event.target)) {
419
- this.isOpen = false;
420
- this.onClickOut.emit(event);
421
- this.setFocus(false, event);
422
- }
423
- }
424
- private syncInternalDate() {
425
- if (!this._value) {
426
- this.internalDate = null;
427
- return;
428
- }
429
- this.internalDate = new Date(this._value);
430
- }
431
- private setFocus(state: boolean, event?: Event) {
432
- if (this.disabled) return;
433
- if (state !== this.isFocused) {
434
- this.isFocused = state;
435
- if (state) {
436
- this.onFocus.emit(event);
437
- } else {
438
- this.onBlur.emit(event);
439
- this.onTouched();
440
- this.onTouched.emit();
441
- }
442
- }
443
- }
444
- get iconSize(): number {
445
- return fieldIconSize(this.size);
446
- }
447
-
448
- toggleDropdown(event: Event) {
449
- if (this.disabled) return;
450
- this.isOpen = !this.isOpen;
451
-
452
- if (this.isOpen) {
453
- this.onClickIn.emit(event);
454
- this.setFocus(true, event);
455
- this.currentPlacement = this.placement;
456
- setTimeout(() => this.calculateSmartPlacement(), 0);
457
- } else {
458
- this.onClickOut.emit(event);
459
- this.setFocus(false, event);
460
- }
461
- }
462
- @HostListener('window:resize')
463
- @HostListener('window:scroll')
464
- onViewportChange() {
465
- if (this.isOpen) this.calculateSmartPlacement();
466
- }
467
- clearValue(event: Event) {
468
- event.stopPropagation();
469
- if (this.disabled) return;
470
- this._value = null;
471
- this.internalDate = null;
472
- this.onChange(null);
473
- this.valueChange.emit(null);
474
- this.onCleared.emit();
475
- this.setFocus(true, event);
476
- this.cdr.markForCheck();
477
- }
478
- onCalendarSelect(date: Date | null) {
479
- if (!date) return;
480
- this.internalDate = date;
481
-
482
- const returnValue = this.formatReturnValue(date);
483
- this._value = returnValue;
484
-
485
- this.onChange(returnValue);
486
- this.valueChange.emit(returnValue);
487
- this.onDateSelected.emit(returnValue);
488
-
489
- if (this.type === 'date') {
490
- this.isOpen = false;
491
- this.setFocus(false);
492
- }
493
- this.cdr.detectChanges();
494
- }
495
- private formatReturnValue(date: Date): any {
496
- if (!this.valueFormat) return date;
497
- if (this.valueFormat === 'timestamp') return date.getTime();
498
- if (this.valueFormat === 'iso') return date.toISOString();
499
- try {
500
- return safeFormat(date, this.valueFormat, this.locale);
501
- } catch {
502
- return date;
503
- }
504
- }
505
- private calculateSmartPlacement() {
506
- if (!this.triggerEl?.nativeElement || !this.dropdownEl?.nativeElement) return;
507
- const newPlacement = computeSmartPlacement(
508
- this.triggerEl.nativeElement,
509
- this.dropdownEl.nativeElement,
510
- this.placement,
511
- );
512
- if (this.currentPlacement !== newPlacement) {
513
- this.currentPlacement = newPlacement;
514
- this.cdr.detectChanges();
515
- }
516
- }
517
- }
518
-
519
- export const DasarDatepickerComponent = [
520
- DasarDatepicker,
521
- DasarDatepickerLabelSlot,
522
- DasarDatepickerExtraLabelSlot,
523
- DasarDatepickerExtraHeaderSlot,
524
- DasarDatepickerExtraFooterSlot,
525
- DasarDatepickerHintSlot,
526
- DasarDatepickerPrefixSlot,
527
- ] as const;
@@ -1 +0,0 @@
1
- <span class="dasar-icon" [class.fluid]="fluid" [innerHTML]="svgContent"></span>