@ojiepermana/angular 22.0.1 → 22.0.29

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 (513) hide show
  1. package/README.md +61 -311
  2. package/fesm2022/ojiepermana-angular-chart.mjs +10 -0
  3. package/fesm2022/ojiepermana-angular-component.mjs +10 -0
  4. package/fesm2022/ojiepermana-angular-navigation.mjs +10 -0
  5. package/fesm2022/ojiepermana-angular-sdk.mjs +10 -0
  6. package/fesm2022/ojiepermana-angular-theme.mjs +4 -384
  7. package/fesm2022/ojiepermana-angular.mjs +15 -16
  8. package/package.json +25 -425
  9. package/types/ojiepermana-angular-chart.d.ts +1 -0
  10. package/types/ojiepermana-angular-component.d.ts +1 -0
  11. package/types/ojiepermana-angular-navigation.d.ts +1 -0
  12. package/types/ojiepermana-angular-sdk.d.ts +1 -0
  13. package/types/ojiepermana-angular-theme.d.ts +1 -116
  14. package/types/ojiepermana-angular.d.ts +5 -3
  15. package/.npmignore +0 -2
  16. package/collection.json +0 -30
  17. package/component/accordion/README.md +0 -195
  18. package/component/accordion/package.json +0 -4
  19. package/component/alert/README.md +0 -182
  20. package/component/alert/package.json +0 -4
  21. package/component/alert-dialog/README.md +0 -239
  22. package/component/alert-dialog/package.json +0 -4
  23. package/component/aspect-ratio/README.md +0 -112
  24. package/component/aspect-ratio/package.json +0 -4
  25. package/component/avatar/README.md +0 -176
  26. package/component/avatar/package.json +0 -4
  27. package/component/badge/README.md +0 -133
  28. package/component/badge/package.json +0 -4
  29. package/component/breadcrumb/README.md +0 -216
  30. package/component/breadcrumb/package.json +0 -4
  31. package/component/button/README.md +0 -139
  32. package/component/button/package.json +0 -4
  33. package/component/button-group/README.md +0 -208
  34. package/component/button-group/package.json +0 -4
  35. package/component/calendar/README.md +0 -132
  36. package/component/calendar/package.json +0 -4
  37. package/component/card/README.md +0 -220
  38. package/component/card/package.json +0 -4
  39. package/component/carousel/README.md +0 -276
  40. package/component/carousel/package.json +0 -4
  41. package/component/chart/README.md +0 -249
  42. package/component/chart/area/package.json +0 -4
  43. package/component/chart/bar/package.json +0 -4
  44. package/component/chart/line/package.json +0 -4
  45. package/component/chart/package.json +0 -4
  46. package/component/chart/pie/package.json +0 -4
  47. package/component/chart/radar/package.json +0 -4
  48. package/component/chart/radial/package.json +0 -4
  49. package/component/chart/scatter/package.json +0 -4
  50. package/component/checkbox/README.md +0 -149
  51. package/component/checkbox/package.json +0 -4
  52. package/component/collapsible/README.md +0 -195
  53. package/component/collapsible/package.json +0 -4
  54. package/component/combobox/README.md +0 -198
  55. package/component/combobox/package.json +0 -4
  56. package/component/command/README.md +0 -275
  57. package/component/command/package.json +0 -4
  58. package/component/composer/README.md +0 -235
  59. package/component/composer/package.json +0 -4
  60. package/component/context-menu/README.md +0 -267
  61. package/component/context-menu/package.json +0 -4
  62. package/component/date-picker/README.md +0 -177
  63. package/component/date-picker/package.json +0 -4
  64. package/component/dialog/README.md +0 -237
  65. package/component/dialog/package.json +0 -4
  66. package/component/drawer/README.md +0 -145
  67. package/component/drawer/package.json +0 -4
  68. package/component/dropdown-menu/README.md +0 -311
  69. package/component/dropdown-menu/package.json +0 -4
  70. package/component/editor/README.md +0 -136
  71. package/component/editor/package.json +0 -4
  72. package/component/empty/README.md +0 -183
  73. package/component/empty/package.json +0 -4
  74. package/component/form/README.md +0 -210
  75. package/component/form/package.json +0 -4
  76. package/component/hover-card/README.md +0 -146
  77. package/component/hover-card/package.json +0 -4
  78. package/component/input/README.md +0 -159
  79. package/component/input/package.json +0 -4
  80. package/component/input-group/README.md +0 -239
  81. package/component/input-group/package.json +0 -4
  82. package/component/input-otp/README.md +0 -278
  83. package/component/input-otp/package.json +0 -4
  84. package/component/item/README.md +0 -247
  85. package/component/item/package.json +0 -4
  86. package/component/kanban/README.md +0 -81
  87. package/component/kanban/package.json +0 -4
  88. package/component/kbd/README.md +0 -139
  89. package/component/kbd/package.json +0 -4
  90. package/component/label/README.md +0 -136
  91. package/component/label/package.json +0 -4
  92. package/component/menubar/README.md +0 -269
  93. package/component/menubar/package.json +0 -4
  94. package/component/native-select/README.md +0 -176
  95. package/component/native-select/package.json +0 -4
  96. package/component/navigation-menu/README.md +0 -160
  97. package/component/navigation-menu/package.json +0 -4
  98. package/component/pagination/README.md +0 -144
  99. package/component/pagination/package.json +0 -4
  100. package/component/pillbox/README.md +0 -67
  101. package/component/pillbox/package.json +0 -4
  102. package/component/popover/README.md +0 -43
  103. package/component/popover/package.json +0 -4
  104. package/component/progress/README.md +0 -160
  105. package/component/progress/package.json +0 -4
  106. package/component/radio/README.md +0 -209
  107. package/component/radio/package.json +0 -4
  108. package/component/resizable/README.md +0 -168
  109. package/component/resizable/package.json +0 -4
  110. package/component/scroll-area/README.md +0 -143
  111. package/component/scroll-area/package.json +0 -4
  112. package/component/select/README.md +0 -174
  113. package/component/select/package.json +0 -4
  114. package/component/separator/README.md +0 -170
  115. package/component/separator/package.json +0 -4
  116. package/component/sheet/README.md +0 -183
  117. package/component/sheet/package.json +0 -4
  118. package/component/skeleton/README.md +0 -158
  119. package/component/skeleton/package.json +0 -4
  120. package/component/slider/README.md +0 -207
  121. package/component/slider/package.json +0 -4
  122. package/component/spinner/README.md +0 -160
  123. package/component/spinner/package.json +0 -4
  124. package/component/switch/README.md +0 -166
  125. package/component/switch/package.json +0 -4
  126. package/component/table/README.md +0 -291
  127. package/component/table/package.json +0 -4
  128. package/component/tabs/README.md +0 -219
  129. package/component/tabs/package.json +0 -4
  130. package/component/textarea/README.md +0 -154
  131. package/component/textarea/package.json +0 -4
  132. package/component/timeline/README.md +0 -94
  133. package/component/timeline/package.json +0 -4
  134. package/component/toast/README.md +0 -321
  135. package/component/toast/package.json +0 -4
  136. package/component/toggle/README.md +0 -131
  137. package/component/toggle/package.json +0 -4
  138. package/component/toggle-group/README.md +0 -206
  139. package/component/toggle-group/package.json +0 -4
  140. package/component/tooltip/README.md +0 -211
  141. package/component/tooltip/package.json +0 -4
  142. package/component/utils/package.json +0 -4
  143. package/fesm2022/ojiepermana-angular-component-accordion.mjs +0 -189
  144. package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +0 -1
  145. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +0 -276
  146. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +0 -1
  147. package/fesm2022/ojiepermana-angular-component-alert.mjs +0 -99
  148. package/fesm2022/ojiepermana-angular-component-alert.mjs.map +0 -1
  149. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +0 -37
  150. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +0 -1
  151. package/fesm2022/ojiepermana-angular-component-avatar.mjs +0 -139
  152. package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +0 -1
  153. package/fesm2022/ojiepermana-angular-component-badge.mjs +0 -50
  154. package/fesm2022/ojiepermana-angular-component-badge.mjs.map +0 -1
  155. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +0 -200
  156. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +0 -1
  157. package/fesm2022/ojiepermana-angular-component-button-group.mjs +0 -103
  158. package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +0 -1
  159. package/fesm2022/ojiepermana-angular-component-button.mjs +0 -68
  160. package/fesm2022/ojiepermana-angular-component-button.mjs.map +0 -1
  161. package/fesm2022/ojiepermana-angular-component-calendar.mjs +0 -88
  162. package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +0 -1
  163. package/fesm2022/ojiepermana-angular-component-card.mjs +0 -152
  164. package/fesm2022/ojiepermana-angular-component-card.mjs.map +0 -1
  165. package/fesm2022/ojiepermana-angular-component-carousel.mjs +0 -334
  166. package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +0 -1
  167. package/fesm2022/ojiepermana-angular-component-chart-area.mjs +0 -6
  168. package/fesm2022/ojiepermana-angular-component-chart-area.mjs.map +0 -1
  169. package/fesm2022/ojiepermana-angular-component-chart-bar.mjs +0 -6
  170. package/fesm2022/ojiepermana-angular-component-chart-bar.mjs.map +0 -1
  171. package/fesm2022/ojiepermana-angular-component-chart-line.mjs +0 -6
  172. package/fesm2022/ojiepermana-angular-component-chart-line.mjs.map +0 -1
  173. package/fesm2022/ojiepermana-angular-component-chart-pie.mjs +0 -6
  174. package/fesm2022/ojiepermana-angular-component-chart-pie.mjs.map +0 -1
  175. package/fesm2022/ojiepermana-angular-component-chart-radar.mjs +0 -6
  176. package/fesm2022/ojiepermana-angular-component-chart-radar.mjs.map +0 -1
  177. package/fesm2022/ojiepermana-angular-component-chart-radial.mjs +0 -6
  178. package/fesm2022/ojiepermana-angular-component-chart-radial.mjs.map +0 -1
  179. package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs +0 -6
  180. package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs.map +0 -1
  181. package/fesm2022/ojiepermana-angular-component-chart.mjs +0 -3925
  182. package/fesm2022/ojiepermana-angular-component-chart.mjs.map +0 -1
  183. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +0 -114
  184. package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +0 -1
  185. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +0 -124
  186. package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +0 -1
  187. package/fesm2022/ojiepermana-angular-component-combobox.mjs +0 -272
  188. package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +0 -1
  189. package/fesm2022/ojiepermana-angular-component-command.mjs +0 -293
  190. package/fesm2022/ojiepermana-angular-component-command.mjs.map +0 -1
  191. package/fesm2022/ojiepermana-angular-component-composer.mjs +0 -352
  192. package/fesm2022/ojiepermana-angular-component-composer.mjs.map +0 -1
  193. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +0 -103
  194. package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +0 -1
  195. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +0 -170
  196. package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +0 -1
  197. package/fesm2022/ojiepermana-angular-component-dialog.mjs +0 -279
  198. package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +0 -1
  199. package/fesm2022/ojiepermana-angular-component-drawer.mjs +0 -6
  200. package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +0 -1
  201. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +0 -492
  202. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +0 -1
  203. package/fesm2022/ojiepermana-angular-component-editor.mjs +0 -717
  204. package/fesm2022/ojiepermana-angular-component-editor.mjs.map +0 -1
  205. package/fesm2022/ojiepermana-angular-component-empty.mjs +0 -145
  206. package/fesm2022/ojiepermana-angular-component-empty.mjs.map +0 -1
  207. package/fesm2022/ojiepermana-angular-component-form.mjs +0 -366
  208. package/fesm2022/ojiepermana-angular-component-form.mjs.map +0 -1
  209. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +0 -297
  210. package/fesm2022/ojiepermana-angular-component-hover-card.mjs.map +0 -1
  211. package/fesm2022/ojiepermana-angular-component-input-group.mjs +0 -179
  212. package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +0 -1
  213. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +0 -514
  214. package/fesm2022/ojiepermana-angular-component-input-otp.mjs.map +0 -1
  215. package/fesm2022/ojiepermana-angular-component-input.mjs +0 -45
  216. package/fesm2022/ojiepermana-angular-component-input.mjs.map +0 -1
  217. package/fesm2022/ojiepermana-angular-component-item.mjs +0 -264
  218. package/fesm2022/ojiepermana-angular-component-item.mjs.map +0 -1
  219. package/fesm2022/ojiepermana-angular-component-kanban.mjs +0 -314
  220. package/fesm2022/ojiepermana-angular-component-kanban.mjs.map +0 -1
  221. package/fesm2022/ojiepermana-angular-component-kbd.mjs +0 -55
  222. package/fesm2022/ojiepermana-angular-component-kbd.mjs.map +0 -1
  223. package/fesm2022/ojiepermana-angular-component-label.mjs +0 -33
  224. package/fesm2022/ojiepermana-angular-component-label.mjs.map +0 -1
  225. package/fesm2022/ojiepermana-angular-component-menubar.mjs +0 -308
  226. package/fesm2022/ojiepermana-angular-component-menubar.mjs.map +0 -1
  227. package/fesm2022/ojiepermana-angular-component-native-select.mjs +0 -67
  228. package/fesm2022/ojiepermana-angular-component-native-select.mjs.map +0 -1
  229. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +0 -413
  230. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs.map +0 -1
  231. package/fesm2022/ojiepermana-angular-component-pagination.mjs +0 -226
  232. package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +0 -1
  233. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +0 -812
  234. package/fesm2022/ojiepermana-angular-component-pillbox.mjs.map +0 -1
  235. package/fesm2022/ojiepermana-angular-component-popover.mjs +0 -169
  236. package/fesm2022/ojiepermana-angular-component-popover.mjs.map +0 -1
  237. package/fesm2022/ojiepermana-angular-component-progress.mjs +0 -60
  238. package/fesm2022/ojiepermana-angular-component-progress.mjs.map +0 -1
  239. package/fesm2022/ojiepermana-angular-component-radio.mjs +0 -122
  240. package/fesm2022/ojiepermana-angular-component-radio.mjs.map +0 -1
  241. package/fesm2022/ojiepermana-angular-component-resizable.mjs +0 -481
  242. package/fesm2022/ojiepermana-angular-component-resizable.mjs.map +0 -1
  243. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +0 -54
  244. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +0 -1
  245. package/fesm2022/ojiepermana-angular-component-select.mjs +0 -176
  246. package/fesm2022/ojiepermana-angular-component-select.mjs.map +0 -1
  247. package/fesm2022/ojiepermana-angular-component-separator.mjs +0 -37
  248. package/fesm2022/ojiepermana-angular-component-separator.mjs.map +0 -1
  249. package/fesm2022/ojiepermana-angular-component-sheet.mjs +0 -284
  250. package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +0 -1
  251. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +0 -31
  252. package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +0 -1
  253. package/fesm2022/ojiepermana-angular-component-slider.mjs +0 -423
  254. package/fesm2022/ojiepermana-angular-component-slider.mjs.map +0 -1
  255. package/fesm2022/ojiepermana-angular-component-spinner.mjs +0 -60
  256. package/fesm2022/ojiepermana-angular-component-spinner.mjs.map +0 -1
  257. package/fesm2022/ojiepermana-angular-component-switch.mjs +0 -116
  258. package/fesm2022/ojiepermana-angular-component-switch.mjs.map +0 -1
  259. package/fesm2022/ojiepermana-angular-component-table.mjs +0 -155
  260. package/fesm2022/ojiepermana-angular-component-table.mjs.map +0 -1
  261. package/fesm2022/ojiepermana-angular-component-tabs.mjs +0 -272
  262. package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +0 -1
  263. package/fesm2022/ojiepermana-angular-component-textarea.mjs +0 -39
  264. package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +0 -1
  265. package/fesm2022/ojiepermana-angular-component-timeline.mjs +0 -237
  266. package/fesm2022/ojiepermana-angular-component-timeline.mjs.map +0 -1
  267. package/fesm2022/ojiepermana-angular-component-toast.mjs +0 -71
  268. package/fesm2022/ojiepermana-angular-component-toast.mjs.map +0 -1
  269. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +0 -289
  270. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs.map +0 -1
  271. package/fesm2022/ojiepermana-angular-component-toggle.mjs +0 -82
  272. package/fesm2022/ojiepermana-angular-component-toggle.mjs.map +0 -1
  273. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +0 -354
  274. package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +0 -1
  275. package/fesm2022/ojiepermana-angular-component-utils.mjs +0 -13
  276. package/fesm2022/ojiepermana-angular-component-utils.mjs.map +0 -1
  277. package/fesm2022/ojiepermana-angular-generator-api.mjs +0 -68
  278. package/fesm2022/ojiepermana-angular-generator-api.mjs.map +0 -1
  279. package/fesm2022/ojiepermana-angular-layout-component.mjs +0 -602
  280. package/fesm2022/ojiepermana-angular-layout-component.mjs.map +0 -1
  281. package/fesm2022/ojiepermana-angular-layout-provider.mjs +0 -21
  282. package/fesm2022/ojiepermana-angular-layout-provider.mjs.map +0 -1
  283. package/fesm2022/ojiepermana-angular-layout-services.mjs +0 -116
  284. package/fesm2022/ojiepermana-angular-layout-services.mjs.map +0 -1
  285. package/fesm2022/ojiepermana-angular-layout-shell.mjs +0 -48
  286. package/fesm2022/ojiepermana-angular-layout-shell.mjs.map +0 -1
  287. package/fesm2022/ojiepermana-angular-layout-token-directive.mjs +0 -30
  288. package/fesm2022/ojiepermana-angular-layout-token-directive.mjs.map +0 -1
  289. package/fesm2022/ojiepermana-angular-layout-token.mjs +0 -33
  290. package/fesm2022/ojiepermana-angular-layout-token.mjs.map +0 -1
  291. package/fesm2022/ojiepermana-angular-layout-type-empty.mjs +0 -49
  292. package/fesm2022/ojiepermana-angular-layout-type-empty.mjs.map +0 -1
  293. package/fesm2022/ojiepermana-angular-layout-type-horizontal.mjs +0 -128
  294. package/fesm2022/ojiepermana-angular-layout-type-horizontal.mjs.map +0 -1
  295. package/fesm2022/ojiepermana-angular-layout-type-vertical.mjs +0 -123
  296. package/fesm2022/ojiepermana-angular-layout-type-vertical.mjs.map +0 -1
  297. package/fesm2022/ojiepermana-angular-layout.mjs +0 -485
  298. package/fesm2022/ojiepermana-angular-layout.mjs.map +0 -1
  299. package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs +0 -334
  300. package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs.map +0 -1
  301. package/fesm2022/ojiepermana-angular-navigation-icon.mjs +0 -63
  302. package/fesm2022/ojiepermana-angular-navigation-icon.mjs.map +0 -1
  303. package/fesm2022/ojiepermana-angular-navigation-item.mjs +0 -559
  304. package/fesm2022/ojiepermana-angular-navigation-item.mjs.map +0 -1
  305. package/fesm2022/ojiepermana-angular-navigation-service.mjs +0 -213
  306. package/fesm2022/ojiepermana-angular-navigation-service.mjs.map +0 -1
  307. package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs +0 -401
  308. package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs.map +0 -1
  309. package/fesm2022/ojiepermana-angular-navigation-topbar.mjs +0 -670
  310. package/fesm2022/ojiepermana-angular-navigation-topbar.mjs.map +0 -1
  311. package/fesm2022/ojiepermana-angular-navigation-types.mjs +0 -4
  312. package/fesm2022/ojiepermana-angular-navigation-types.mjs.map +0 -1
  313. package/fesm2022/ojiepermana-angular-theme-provider.mjs +0 -35
  314. package/fesm2022/ojiepermana-angular-theme-provider.mjs.map +0 -1
  315. package/fesm2022/ojiepermana-angular-theme-services.mjs +0 -294
  316. package/fesm2022/ojiepermana-angular-theme-services.mjs.map +0 -1
  317. package/fesm2022/ojiepermana-angular-theme-token.mjs +0 -56
  318. package/fesm2022/ojiepermana-angular-theme-token.mjs.map +0 -1
  319. package/fesm2022/ojiepermana-angular-theme.mjs.map +0 -1
  320. package/fesm2022/ojiepermana-angular.mjs.map +0 -1
  321. package/generator/api/README.md +0 -252
  322. package/generator/api/bin/package.json +0 -3
  323. package/generator/api/bin/schematics/init/index.js +0 -90
  324. package/generator/api/bin/schematics/ng-add/index.js +0 -131
  325. package/generator/api/bin/schematics/sdk/index.js +0 -76
  326. package/generator/api/bin/src/config/loader.js +0 -41
  327. package/generator/api/bin/src/config/schema.js +0 -57
  328. package/generator/api/bin/src/emit/client.js +0 -248
  329. package/generator/api/bin/src/emit/metadata.js +0 -295
  330. package/generator/api/bin/src/emit/models.js +0 -106
  331. package/generator/api/bin/src/emit/navigation.js +0 -56
  332. package/generator/api/bin/src/emit/operations.js +0 -122
  333. package/generator/api/bin/src/emit/public-api.js +0 -54
  334. package/generator/api/bin/src/emit/services.js +0 -87
  335. package/generator/api/bin/src/engine.js +0 -65
  336. package/generator/api/bin/src/layout/per-domain.js +0 -359
  337. package/generator/api/bin/src/parser/bundle.js +0 -25
  338. package/generator/api/bin/src/parser/ir.js +0 -320
  339. package/generator/api/bin/src/parser/types.js +0 -7
  340. package/generator/api/bin/src/render/template.js +0 -58
  341. package/generator/api/bin/src/writer/index.js +0 -278
  342. package/generator/api/package.json +0 -4
  343. package/generator/api/schematics/init/schema.json +0 -19
  344. package/generator/api/schematics/ng-add/schema.json +0 -14
  345. package/generator/api/schematics/sdk/schema.json +0 -19
  346. package/generator/api/sdk.config.example.json +0 -24
  347. package/generator/guide/README.md +0 -84
  348. package/generator/guide/bin/package.json +0 -3
  349. package/generator/guide/bin/schematics/build/index.js +0 -36
  350. package/generator/guide/bin/schematics/init/index.js +0 -70
  351. package/generator/guide/bin/src/config/loader.js +0 -50
  352. package/generator/guide/bin/src/config/schema.js +0 -12
  353. package/generator/guide/bin/src/engine/component.js +0 -74
  354. package/generator/guide/bin/src/engine/frontmatter.js +0 -42
  355. package/generator/guide/bin/src/engine/index.js +0 -42
  356. package/generator/guide/bin/src/engine/naming.js +0 -39
  357. package/generator/guide/bin/src/engine/render.js +0 -36
  358. package/generator/guide/bin/src/engine/routes.js +0 -106
  359. package/generator/guide/bin/src/engine/walk.js +0 -35
  360. package/generator/guide/guide.config.example.json +0 -9
  361. package/generator/guide/schematics/build/schema.json +0 -14
  362. package/generator/guide/schematics/init/schema.json +0 -19
  363. package/layout/component/package.json +0 -4
  364. package/layout/package.json +0 -4
  365. package/layout/provider/package.json +0 -4
  366. package/layout/services/package.json +0 -4
  367. package/layout/shell/package.json +0 -4
  368. package/layout/token/directive/package.json +0 -4
  369. package/layout/token/package.json +0 -4
  370. package/layout/type/empty/package.json +0 -4
  371. package/layout/type/horizontal/package.json +0 -4
  372. package/layout/type/vertical/package.json +0 -4
  373. package/navigation/demo-data/package.json +0 -4
  374. package/navigation/icon/package.json +0 -4
  375. package/navigation/item/package.json +0 -4
  376. package/navigation/service/package.json +0 -4
  377. package/navigation/sidebar/package.json +0 -4
  378. package/navigation/topbar/README.md +0 -196
  379. package/navigation/topbar/package.json +0 -4
  380. package/navigation/types/package.json +0 -4
  381. package/theme/README.md +0 -174
  382. package/theme/package.json +0 -4
  383. package/theme/provider/package.json +0 -4
  384. package/theme/services/package.json +0 -4
  385. package/theme/styles/foundation/components.css +0 -81
  386. package/theme/styles/foundation/layers.css +0 -15
  387. package/theme/styles/foundation/tokens.css +0 -55
  388. package/theme/styles/index.css +0 -37
  389. package/theme/styles/integrations/material/autocomplete.css +0 -178
  390. package/theme/styles/integrations/material/button.css +0 -468
  391. package/theme/styles/integrations/material/dialog.css +0 -152
  392. package/theme/styles/integrations/material/select.css +0 -175
  393. package/theme/styles/integrations/material/slide-toggle.css +0 -234
  394. package/theme/styles/integrations/material/slider.css +0 -194
  395. package/theme/styles/integrations/material/tabs.css +0 -229
  396. package/theme/styles/integrations/material.css +0 -264
  397. package/theme/styles/integrations/tailwind.css +0 -114
  398. package/theme/styles/variants/color/amber.css +0 -31
  399. package/theme/styles/variants/color/base.css +0 -36
  400. package/theme/styles/variants/color/blue.css +0 -31
  401. package/theme/styles/variants/color/cyan.css +0 -31
  402. package/theme/styles/variants/color/emerald.css +0 -31
  403. package/theme/styles/variants/color/fuchsia.css +0 -31
  404. package/theme/styles/variants/color/green.css +0 -31
  405. package/theme/styles/variants/color/index.css +0 -22
  406. package/theme/styles/variants/color/indigo.css +0 -31
  407. package/theme/styles/variants/color/lime.css +0 -31
  408. package/theme/styles/variants/color/orange.css +0 -31
  409. package/theme/styles/variants/color/pink.css +0 -31
  410. package/theme/styles/variants/color/purple.css +0 -31
  411. package/theme/styles/variants/color/red.css +0 -31
  412. package/theme/styles/variants/color/rose.css +0 -31
  413. package/theme/styles/variants/color/sky.css +0 -31
  414. package/theme/styles/variants/color/teal.css +0 -31
  415. package/theme/styles/variants/color/violet.css +0 -31
  416. package/theme/styles/variants/color/yellow.css +0 -31
  417. package/theme/styles/variants/mode/dark.css +0 -20
  418. package/theme/styles/variants/mode/index.css +0 -6
  419. package/theme/styles/variants/mode/light.css +0 -24
  420. package/theme/styles/variants/style/brutal.css +0 -50
  421. package/theme/styles/variants/style/default.css +0 -54
  422. package/theme/styles/variants/style/index.css +0 -8
  423. package/theme/styles/variants/style/sharp.css +0 -50
  424. package/theme/styles/variants/style/soft.css +0 -50
  425. package/theme/token/package.json +0 -4
  426. package/types/ojiepermana-angular-component-accordion.d.ts +0 -51
  427. package/types/ojiepermana-angular-component-alert-dialog.d.ts +0 -93
  428. package/types/ojiepermana-angular-component-alert.d.ts +0 -37
  429. package/types/ojiepermana-angular-component-aspect-ratio.d.ts +0 -12
  430. package/types/ojiepermana-angular-component-avatar.d.ts +0 -51
  431. package/types/ojiepermana-angular-component-badge.d.ts +0 -19
  432. package/types/ojiepermana-angular-component-breadcrumb.d.ts +0 -46
  433. package/types/ojiepermana-angular-component-button-group.d.ts +0 -26
  434. package/types/ojiepermana-angular-component-button.d.ts +0 -22
  435. package/types/ojiepermana-angular-component-calendar.d.ts +0 -33
  436. package/types/ojiepermana-angular-component-card.d.ts +0 -60
  437. package/types/ojiepermana-angular-component-carousel.d.ts +0 -86
  438. package/types/ojiepermana-angular-component-chart-area.d.ts +0 -1
  439. package/types/ojiepermana-angular-component-chart-bar.d.ts +0 -1
  440. package/types/ojiepermana-angular-component-chart-line.d.ts +0 -1
  441. package/types/ojiepermana-angular-component-chart-pie.d.ts +0 -1
  442. package/types/ojiepermana-angular-component-chart-radar.d.ts +0 -1
  443. package/types/ojiepermana-angular-component-chart-radial.d.ts +0 -1
  444. package/types/ojiepermana-angular-component-chart-scatter.d.ts +0 -1
  445. package/types/ojiepermana-angular-component-chart.d.ts +0 -1094
  446. package/types/ojiepermana-angular-component-checkbox.d.ts +0 -35
  447. package/types/ojiepermana-angular-component-collapsible.d.ts +0 -42
  448. package/types/ojiepermana-angular-component-combobox.d.ts +0 -50
  449. package/types/ojiepermana-angular-component-command.d.ts +0 -99
  450. package/types/ojiepermana-angular-component-composer.d.ts +0 -90
  451. package/types/ojiepermana-angular-component-context-menu.d.ts +0 -35
  452. package/types/ojiepermana-angular-component-date-picker.d.ts +0 -41
  453. package/types/ojiepermana-angular-component-dialog.d.ts +0 -87
  454. package/types/ojiepermana-angular-component-drawer.d.ts +0 -1
  455. package/types/ojiepermana-angular-component-dropdown-menu.d.ts +0 -137
  456. package/types/ojiepermana-angular-component-editor.d.ts +0 -123
  457. package/types/ojiepermana-angular-component-empty.d.ts +0 -50
  458. package/types/ojiepermana-angular-component-form.d.ts +0 -141
  459. package/types/ojiepermana-angular-component-hover-card.d.ts +0 -74
  460. package/types/ojiepermana-angular-component-input-group.d.ts +0 -51
  461. package/types/ojiepermana-angular-component-input-otp.d.ts +0 -136
  462. package/types/ojiepermana-angular-component-input.d.ts +0 -16
  463. package/types/ojiepermana-angular-component-item.d.ts +0 -88
  464. package/types/ojiepermana-angular-component-kanban.d.ts +0 -70
  465. package/types/ojiepermana-angular-component-kbd.d.ts +0 -16
  466. package/types/ojiepermana-angular-component-label.d.ts +0 -11
  467. package/types/ojiepermana-angular-component-menubar.d.ts +0 -67
  468. package/types/ojiepermana-angular-component-native-select.d.ts +0 -26
  469. package/types/ojiepermana-angular-component-navigation-menu.d.ts +0 -96
  470. package/types/ojiepermana-angular-component-pagination.d.ts +0 -33
  471. package/types/ojiepermana-angular-component-pillbox.d.ts +0 -157
  472. package/types/ojiepermana-angular-component-popover.d.ts +0 -43
  473. package/types/ojiepermana-angular-component-progress.d.ts +0 -17
  474. package/types/ojiepermana-angular-component-radio.d.ts +0 -40
  475. package/types/ojiepermana-angular-component-resizable.d.ts +0 -99
  476. package/types/ojiepermana-angular-component-scroll-area.d.ts +0 -19
  477. package/types/ojiepermana-angular-component-select.d.ts +0 -57
  478. package/types/ojiepermana-angular-component-separator.d.ts +0 -14
  479. package/types/ojiepermana-angular-component-sheet.d.ts +0 -76
  480. package/types/ojiepermana-angular-component-skeleton.d.ts +0 -10
  481. package/types/ojiepermana-angular-component-slider.d.ts +0 -74
  482. package/types/ojiepermana-angular-component-spinner.d.ts +0 -13
  483. package/types/ojiepermana-angular-component-switch.d.ts +0 -40
  484. package/types/ojiepermana-angular-component-table.d.ts +0 -52
  485. package/types/ojiepermana-angular-component-tabs.d.ts +0 -92
  486. package/types/ojiepermana-angular-component-textarea.d.ts +0 -12
  487. package/types/ojiepermana-angular-component-timeline.d.ts +0 -63
  488. package/types/ojiepermana-angular-component-toast.d.ts +0 -38
  489. package/types/ojiepermana-angular-component-toggle-group.d.ts +0 -89
  490. package/types/ojiepermana-angular-component-toggle.d.ts +0 -25
  491. package/types/ojiepermana-angular-component-tooltip.d.ts +0 -89
  492. package/types/ojiepermana-angular-component-utils.d.ts +0 -5
  493. package/types/ojiepermana-angular-generator-api.d.ts +0 -86
  494. package/types/ojiepermana-angular-layout-component.d.ts +0 -205
  495. package/types/ojiepermana-angular-layout-provider.d.ts +0 -6
  496. package/types/ojiepermana-angular-layout-services.d.ts +0 -25
  497. package/types/ojiepermana-angular-layout-shell.d.ts +0 -8
  498. package/types/ojiepermana-angular-layout-token-directive.d.ts +0 -13
  499. package/types/ojiepermana-angular-layout-token.d.ts +0 -36
  500. package/types/ojiepermana-angular-layout-type-empty.d.ts +0 -22
  501. package/types/ojiepermana-angular-layout-type-horizontal.d.ts +0 -36
  502. package/types/ojiepermana-angular-layout-type-vertical.d.ts +0 -38
  503. package/types/ojiepermana-angular-layout.d.ts +0 -164
  504. package/types/ojiepermana-angular-navigation-demo-data.d.ts +0 -5
  505. package/types/ojiepermana-angular-navigation-icon.d.ts +0 -17
  506. package/types/ojiepermana-angular-navigation-item.d.ts +0 -54
  507. package/types/ojiepermana-angular-navigation-service.d.ts +0 -77
  508. package/types/ojiepermana-angular-navigation-sidebar.d.ts +0 -75
  509. package/types/ojiepermana-angular-navigation-topbar.d.ts +0 -74
  510. package/types/ojiepermana-angular-navigation-types.d.ts +0 -135
  511. package/types/ojiepermana-angular-theme-provider.d.ts +0 -11
  512. package/types/ojiepermana-angular-theme-services.d.ts +0 -55
  513. package/types/ojiepermana-angular-theme-token.d.ts +0 -57
@@ -1,289 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, input, model, numberAttribute, inject, ElementRef, signal, computed, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { toggleVariants } from '@ojiepermana/angular/component/toggle';
4
- import { cn } from '@ojiepermana/angular/component/utils';
5
-
6
- const spacingClasses = {
7
- 0: '',
8
- 1: 'gap-1',
9
- 2: 'gap-2',
10
- 3: 'gap-3',
11
- 4: 'gap-4',
12
- };
13
- const connectedItemClasses = {
14
- horizontal: [
15
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-s-none',
16
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:[border-inline-start-width:0]',
17
- '[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-e-none',
18
- ].join(' '),
19
- vertical: [
20
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-t-none',
21
- '[&>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0',
22
- '[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-b-none',
23
- ].join(' '),
24
- };
25
- class ToggleGroupContextBase {
26
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleGroupContextBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
27
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.0", type: ToggleGroupContextBase, isStandalone: true, ngImport: i0 });
28
- }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleGroupContextBase, decorators: [{
30
- type: Directive
31
- }] });
32
- class ToggleGroupComponent extends ToggleGroupContextBase {
33
- type = input.required(/* @ts-ignore */
34
- ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
35
- value = model(null, /* @ts-ignore */
36
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
37
- values = model([], /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []));
39
- orientation = input('horizontal', /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
41
- variant = input('default', /* @ts-ignore */
42
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
43
- size = input('default', /* @ts-ignore */
44
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
45
- spacing = input(2, { ...(ngDevMode ? { debugName: "spacing" } : /* istanbul ignore next */ {}), transform: numberAttribute });
46
- loop = input(true, /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []));
48
- disabled = input(false, /* @ts-ignore */
49
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
50
- dir = input(null, /* @ts-ignore */
51
- ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
52
- class = input('', /* @ts-ignore */
53
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
54
- host = inject(ElementRef);
55
- focusedValue = signal(null, /* @ts-ignore */
56
- ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
57
- registrationVersion = signal(0, /* @ts-ignore */
58
- ...(ngDevMode ? [{ debugName: "registrationVersion" }] : /* istanbul ignore next */ []));
59
- items = new Map();
60
- resolvedSpacing = computed(() => normalizeSpacing(this.spacing()), /* @ts-ignore */
61
- ...(ngDevMode ? [{ debugName: "resolvedSpacing" }] : /* istanbul ignore next */ []));
62
- tabStopValue = computed(() => {
63
- this.registrationVersion();
64
- const enabledItems = this.enabledItems();
65
- if (enabledItems.length === 0)
66
- return null;
67
- const current = this.focusedValue();
68
- if (current && enabledItems.some((item) => item.value() === current)) {
69
- return current;
70
- }
71
- const selected = enabledItems.find((item) => this.isSelected(item.value()));
72
- return selected?.value() ?? enabledItems[0].value();
73
- }, /* @ts-ignore */
74
- ...(ngDevMode ? [{ debugName: "tabStopValue" }] : /* istanbul ignore next */ []));
75
- classes = computed(() => cn('inline-flex w-fit', this.orientation() === 'vertical' ? 'flex-col items-stretch' : 'items-center', spacingClasses[this.resolvedSpacing()], this.resolvedSpacing() === 0 && connectedItemClasses[this.orientation()], this.class()), /* @ts-ignore */
76
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
77
- groupType() {
78
- return this.type();
79
- }
80
- groupOrientation() {
81
- return this.orientation();
82
- }
83
- groupVariant() {
84
- return this.variant();
85
- }
86
- groupSize() {
87
- return this.size();
88
- }
89
- groupDisabled() {
90
- return this.disabled();
91
- }
92
- isRtl() {
93
- const explicitDir = this.dir();
94
- if (explicitDir)
95
- return explicitDir === 'rtl';
96
- const host = this.host.nativeElement;
97
- const nearestDir = host.closest('[dir]')?.getAttribute('dir');
98
- if (nearestDir === 'rtl' || nearestDir === 'ltr') {
99
- return nearestDir === 'rtl';
100
- }
101
- return getComputedStyle(host).direction === 'rtl';
102
- }
103
- register(element, value, disabled) {
104
- this.items.set(element, { element, value, disabled });
105
- this.bumpRegistrationVersion();
106
- }
107
- unregister(element) {
108
- this.items.delete(element);
109
- this.bumpRegistrationVersion();
110
- }
111
- isSelected(value) {
112
- return this.type() === 'multiple' ? this.values().includes(value) : this.value() === value;
113
- }
114
- toggle(value) {
115
- const item = this.itemForValue(value);
116
- if (!item || this.disabled() || item.disabled())
117
- return;
118
- this.focusedValue.set(value);
119
- if (this.type() === 'multiple') {
120
- this.values.update((current) => current.includes(value) ? current.filter((itemValue) => itemValue !== value) : [...current, value]);
121
- return;
122
- }
123
- this.value.set(this.value() === value ? null : value);
124
- }
125
- tabindexFor(value, disabled) {
126
- if (this.disabled() || disabled)
127
- return -1;
128
- return this.tabStopValue() === value ? 0 : -1;
129
- }
130
- markFocused(value) {
131
- const item = this.itemForValue(value);
132
- if (!item || this.disabled() || item.disabled())
133
- return;
134
- this.focusedValue.set(value);
135
- }
136
- focusNext(from, offset) {
137
- const enabledItems = this.enabledItems();
138
- const currentIndex = enabledItems.findIndex((item) => item.element === from);
139
- if (currentIndex < 0 || enabledItems.length === 0)
140
- return;
141
- let nextIndex = currentIndex + offset;
142
- if (this.loop()) {
143
- nextIndex = (nextIndex + enabledItems.length) % enabledItems.length;
144
- }
145
- else if (nextIndex < 0 || nextIndex >= enabledItems.length) {
146
- return;
147
- }
148
- const next = enabledItems[nextIndex];
149
- this.focusedValue.set(next.value());
150
- next.element.focus();
151
- }
152
- focusFirst() {
153
- const first = this.enabledItems()[0];
154
- if (!first)
155
- return;
156
- this.focusedValue.set(first.value());
157
- first.element.focus();
158
- }
159
- focusLast() {
160
- const enabledItems = this.enabledItems();
161
- const last = enabledItems[enabledItems.length - 1];
162
- if (!last)
163
- return;
164
- this.focusedValue.set(last.value());
165
- last.element.focus();
166
- }
167
- enabledItems() {
168
- return [...this.items.values()].filter((item) => !item.disabled());
169
- }
170
- itemForValue(value) {
171
- return [...this.items.values()].find((item) => item.value() === value);
172
- }
173
- bumpRegistrationVersion() {
174
- this.registrationVersion.update((version) => version + 1);
175
- }
176
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
177
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.0", type: ToggleGroupComponent, isStandalone: true, selector: "ui-toggle-group", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, spacing: { classPropertyName: "spacing", publicName: "spacing", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", values: "valuesChange" }, host: { properties: { "class": "classes()", "attr.role": "\"group\"", "attr.dir": "dir() ?? null", "attr.aria-orientation": "orientation()", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-orientation": "orientation()", "attr.data-slot": "\"toggle-group\"", "attr.data-type": "type()" } }, providers: [{ provide: ToggleGroupContextBase, useExisting: forwardRef(() => ToggleGroupComponent) }], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
178
- }
179
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleGroupComponent, decorators: [{
180
- type: Component,
181
- args: [{
182
- selector: 'ui-toggle-group',
183
- changeDetection: ChangeDetectionStrategy.OnPush,
184
- providers: [{ provide: ToggleGroupContextBase, useExisting: forwardRef(() => ToggleGroupComponent) }],
185
- host: {
186
- '[class]': 'classes()',
187
- '[attr.role]': '"group"',
188
- '[attr.dir]': 'dir() ?? null',
189
- '[attr.aria-orientation]': 'orientation()',
190
- '[attr.data-disabled]': 'disabled() ? "" : null',
191
- '[attr.data-orientation]': 'orientation()',
192
- '[attr.data-slot]': '"toggle-group"',
193
- '[attr.data-type]': 'type()',
194
- },
195
- template: `<ng-content />`,
196
- }]
197
- }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }, { type: i0.Output, args: ["valuesChange"] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], spacing: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacing", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
198
- class ToggleGroupItemDirective {
199
- ctx = inject(ToggleGroupContextBase);
200
- element = inject(ElementRef);
201
- value = input.required(/* @ts-ignore */
202
- ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
203
- disabled = input(false, /* @ts-ignore */
204
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
205
- class = input('', /* @ts-ignore */
206
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
207
- selected = computed(() => this.ctx.isSelected(this.value()), /* @ts-ignore */
208
- ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
209
- classes = computed(() => cn(toggleVariants({ variant: this.ctx.groupVariant(), size: this.ctx.groupSize() }), this.class()), /* @ts-ignore */
210
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
211
- ngOnInit() {
212
- this.ctx.register(this.element.nativeElement, this.value, this.disabled);
213
- }
214
- ngOnDestroy() {
215
- this.ctx.unregister(this.element.nativeElement);
216
- }
217
- isDisabled() {
218
- return this.ctx.groupDisabled() || this.disabled();
219
- }
220
- onClick() {
221
- if (this.isDisabled())
222
- return;
223
- this.ctx.toggle(this.value());
224
- }
225
- onFocus() {
226
- if (this.isDisabled())
227
- return;
228
- this.ctx.markFocused(this.value());
229
- }
230
- onArrow(event, offset) {
231
- event.preventDefault();
232
- this.ctx.focusNext(this.element.nativeElement, offset);
233
- }
234
- onHorizontalArrow(event, offset) {
235
- event.preventDefault();
236
- this.ctx.focusNext(this.element.nativeElement, this.ctx.isRtl() ? offset * -1 : offset);
237
- }
238
- onHome(event) {
239
- event.preventDefault();
240
- this.ctx.focusFirst();
241
- }
242
- onEnd(event) {
243
- event.preventDefault();
244
- this.ctx.focusLast();
245
- }
246
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleGroupItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
247
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.0", type: ToggleGroupItemDirective, isStandalone: true, selector: "button[ui-toggle-group-item]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "onClick()", "focus": "onFocus()", "keydown.arrowDown": "onArrow($any($event), 1)", "keydown.arrowLeft": "onHorizontalArrow($any($event), -1)", "keydown.arrowRight": "onHorizontalArrow($any($event), 1)", "keydown.arrowUp": "onArrow($any($event), -1)", "keydown.end": "onEnd($any($event))", "keydown.home": "onHome($any($event))" }, properties: { "class": "classes()", "attr.aria-disabled": "isDisabled() ? \"true\" : null", "attr.aria-pressed": "selected()", "attr.data-disabled": "isDisabled() ? \"\" : null", "attr.data-orientation": "ctx.groupOrientation()", "attr.data-size": "ctx.groupSize()", "attr.data-slot": "\"toggle-group-item\"", "attr.data-state": "selected() ? \"on\" : \"off\"", "attr.data-variant": "ctx.groupVariant()", "attr.tabindex": "ctx.tabindexFor(value(), isDisabled())", "disabled": "isDisabled() || null" } }, ngImport: i0 });
248
- }
249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleGroupItemDirective, decorators: [{
250
- type: Directive,
251
- args: [{
252
- selector: 'button[ui-toggle-group-item]',
253
- host: {
254
- '[class]': 'classes()',
255
- type: 'button',
256
- '[attr.aria-disabled]': 'isDisabled() ? "true" : null',
257
- '[attr.aria-pressed]': 'selected()',
258
- '[attr.data-disabled]': 'isDisabled() ? "" : null',
259
- '[attr.data-orientation]': 'ctx.groupOrientation()',
260
- '[attr.data-size]': 'ctx.groupSize()',
261
- '[attr.data-slot]': '"toggle-group-item"',
262
- '[attr.data-state]': 'selected() ? "on" : "off"',
263
- '[attr.data-variant]': 'ctx.groupVariant()',
264
- '[attr.tabindex]': 'ctx.tabindexFor(value(), isDisabled())',
265
- '[disabled]': 'isDisabled() || null',
266
- '(click)': 'onClick()',
267
- '(focus)': 'onFocus()',
268
- '(keydown.arrowDown)': 'onArrow($any($event), 1)',
269
- '(keydown.arrowLeft)': 'onHorizontalArrow($any($event), -1)',
270
- '(keydown.arrowRight)': 'onHorizontalArrow($any($event), 1)',
271
- '(keydown.arrowUp)': 'onArrow($any($event), -1)',
272
- '(keydown.end)': 'onEnd($any($event))',
273
- '(keydown.home)': 'onHome($any($event))',
274
- },
275
- }]
276
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
277
- function normalizeSpacing(value) {
278
- if (value in spacingClasses) {
279
- return value;
280
- }
281
- return 2;
282
- }
283
-
284
- /**
285
- * Generated bundle index. Do not edit.
286
- */
287
-
288
- export { ToggleGroupComponent, ToggleGroupContextBase, ToggleGroupItemDirective };
289
- //# sourceMappingURL=ojiepermana-angular-component-toggle-group.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ojiepermana-angular-component-toggle-group.mjs","sources":["../../../projects/angular/component/toggle-group/toggle-group.component.ts","../../../projects/angular/component/toggle-group/ojiepermana-angular-component-toggle-group.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ElementRef,\n computed,\n forwardRef,\n inject,\n input,\n model,\n numberAttribute,\n signal,\n} from '@angular/core';\nimport { type ToggleSize, toggleVariants, type ToggleVariant } from '@ojiepermana/angular/component/toggle';\nimport { cn } from '@ojiepermana/angular/component/utils';\n\nexport type ToggleGroupType = 'single' | 'multiple';\nexport type ToggleGroupOrientation = 'horizontal' | 'vertical';\nexport type ToggleGroupVariant = ToggleVariant;\nexport type ToggleGroupSize = ToggleSize;\n\ninterface ToggleGroupItemRegistration {\n readonly element: HTMLElement;\n readonly value: () => string;\n readonly disabled: () => boolean;\n}\n\nconst spacingClasses = {\n 0: '',\n 1: 'gap-1',\n 2: 'gap-2',\n 3: 'gap-3',\n 4: 'gap-4',\n} as const;\n\nconst connectedItemClasses: Record<ToggleGroupOrientation, string> = {\n horizontal: [\n '[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-s-none',\n '[&>[data-slot=toggle-group-item]:not(:first-child)]:[border-inline-start-width:0]',\n '[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-e-none',\n ].join(' '),\n vertical: [\n '[&>[data-slot=toggle-group-item]:not(:first-child)]:rounded-t-none',\n '[&>[data-slot=toggle-group-item]:not(:first-child)]:border-t-0',\n '[&>[data-slot=toggle-group-item]:not(:last-child)]:rounded-b-none',\n ].join(' '),\n};\n\n@Directive()\nexport abstract class ToggleGroupContextBase {\n abstract groupType(): ToggleGroupType;\n abstract groupOrientation(): ToggleGroupOrientation;\n abstract groupVariant(): ToggleGroupVariant;\n abstract groupSize(): ToggleGroupSize;\n abstract groupDisabled(): boolean;\n abstract isRtl(): boolean;\n\n abstract register(element: HTMLElement, value: () => string, disabled: () => boolean): void;\n abstract unregister(element: HTMLElement): void;\n abstract isSelected(value: string): boolean;\n abstract toggle(value: string): void;\n abstract tabindexFor(value: string, disabled: boolean): number;\n abstract markFocused(value: string): void;\n abstract focusNext(from: HTMLElement, offset: number): void;\n abstract focusFirst(): void;\n abstract focusLast(): void;\n}\n\n@Component({\n selector: 'ui-toggle-group',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: ToggleGroupContextBase, useExisting: forwardRef(() => ToggleGroupComponent) }],\n host: {\n '[class]': 'classes()',\n '[attr.role]': '\"group\"',\n '[attr.dir]': 'dir() ?? null',\n '[attr.aria-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-slot]': '\"toggle-group\"',\n '[attr.data-type]': 'type()',\n },\n template: `<ng-content />`,\n})\nexport class ToggleGroupComponent extends ToggleGroupContextBase {\n readonly type = input.required<ToggleGroupType>();\n readonly value = model<string | null>(null);\n readonly values = model<string[]>([]);\n readonly orientation = input<ToggleGroupOrientation>('horizontal');\n readonly variant = input<ToggleGroupVariant>('default');\n readonly size = input<ToggleGroupSize>('default');\n readonly spacing = input(2, { transform: numberAttribute });\n readonly loop = input<boolean>(true);\n readonly disabled = input<boolean>(false);\n readonly dir = input<'ltr' | 'rtl' | null>(null);\n readonly class = input<string>('');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly focusedValue = signal<string | null>(null);\n private readonly registrationVersion = signal(0);\n private readonly items = new Map<HTMLElement, ToggleGroupItemRegistration>();\n\n private readonly resolvedSpacing = computed(() => normalizeSpacing(this.spacing()));\n private readonly tabStopValue = computed(() => {\n this.registrationVersion();\n\n const enabledItems = this.enabledItems();\n if (enabledItems.length === 0) return null;\n\n const current = this.focusedValue();\n if (current && enabledItems.some((item) => item.value() === current)) {\n return current;\n }\n\n const selected = enabledItems.find((item) => this.isSelected(item.value()));\n return selected?.value() ?? enabledItems[0].value();\n });\n\n protected readonly classes = computed(() =>\n cn(\n 'inline-flex w-fit',\n this.orientation() === 'vertical' ? 'flex-col items-stretch' : 'items-center',\n spacingClasses[this.resolvedSpacing()],\n this.resolvedSpacing() === 0 && connectedItemClasses[this.orientation()],\n this.class(),\n ),\n );\n\n override groupType(): ToggleGroupType {\n return this.type();\n }\n\n override groupOrientation(): ToggleGroupOrientation {\n return this.orientation();\n }\n\n override groupVariant(): ToggleGroupVariant {\n return this.variant();\n }\n\n override groupSize(): ToggleGroupSize {\n return this.size();\n }\n\n override groupDisabled(): boolean {\n return this.disabled();\n }\n\n override isRtl(): boolean {\n const explicitDir = this.dir();\n if (explicitDir) return explicitDir === 'rtl';\n\n const host = this.host.nativeElement;\n const nearestDir = host.closest('[dir]')?.getAttribute('dir');\n if (nearestDir === 'rtl' || nearestDir === 'ltr') {\n return nearestDir === 'rtl';\n }\n\n return getComputedStyle(host).direction === 'rtl';\n }\n\n override register(element: HTMLElement, value: () => string, disabled: () => boolean): void {\n this.items.set(element, { element, value, disabled });\n this.bumpRegistrationVersion();\n }\n\n override unregister(element: HTMLElement): void {\n this.items.delete(element);\n this.bumpRegistrationVersion();\n }\n\n override isSelected(value: string): boolean {\n return this.type() === 'multiple' ? this.values().includes(value) : this.value() === value;\n }\n\n override toggle(value: string): void {\n const item = this.itemForValue(value);\n if (!item || this.disabled() || item.disabled()) return;\n\n this.focusedValue.set(value);\n\n if (this.type() === 'multiple') {\n this.values.update((current) =>\n current.includes(value) ? current.filter((itemValue) => itemValue !== value) : [...current, value],\n );\n return;\n }\n\n this.value.set(this.value() === value ? null : value);\n }\n\n override tabindexFor(value: string, disabled: boolean): number {\n if (this.disabled() || disabled) return -1;\n return this.tabStopValue() === value ? 0 : -1;\n }\n\n override markFocused(value: string): void {\n const item = this.itemForValue(value);\n if (!item || this.disabled() || item.disabled()) return;\n this.focusedValue.set(value);\n }\n\n override focusNext(from: HTMLElement, offset: number): void {\n const enabledItems = this.enabledItems();\n const currentIndex = enabledItems.findIndex((item) => item.element === from);\n if (currentIndex < 0 || enabledItems.length === 0) return;\n\n let nextIndex = currentIndex + offset;\n\n if (this.loop()) {\n nextIndex = (nextIndex + enabledItems.length) % enabledItems.length;\n } else if (nextIndex < 0 || nextIndex >= enabledItems.length) {\n return;\n }\n\n const next = enabledItems[nextIndex];\n this.focusedValue.set(next.value());\n next.element.focus();\n }\n\n override focusFirst(): void {\n const first = this.enabledItems()[0];\n if (!first) return;\n this.focusedValue.set(first.value());\n first.element.focus();\n }\n\n override focusLast(): void {\n const enabledItems = this.enabledItems();\n const last = enabledItems[enabledItems.length - 1];\n if (!last) return;\n this.focusedValue.set(last.value());\n last.element.focus();\n }\n\n private enabledItems(): ToggleGroupItemRegistration[] {\n return [...this.items.values()].filter((item) => !item.disabled());\n }\n\n private itemForValue(value: string): ToggleGroupItemRegistration | undefined {\n return [...this.items.values()].find((item) => item.value() === value);\n }\n\n private bumpRegistrationVersion(): void {\n this.registrationVersion.update((version) => version + 1);\n }\n}\n\n@Directive({\n selector: 'button[ui-toggle-group-item]',\n host: {\n '[class]': 'classes()',\n type: 'button',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : null',\n '[attr.aria-pressed]': 'selected()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null',\n '[attr.data-orientation]': 'ctx.groupOrientation()',\n '[attr.data-size]': 'ctx.groupSize()',\n '[attr.data-slot]': '\"toggle-group-item\"',\n '[attr.data-state]': 'selected() ? \"on\" : \"off\"',\n '[attr.data-variant]': 'ctx.groupVariant()',\n '[attr.tabindex]': 'ctx.tabindexFor(value(), isDisabled())',\n '[disabled]': 'isDisabled() || null',\n '(click)': 'onClick()',\n '(focus)': 'onFocus()',\n '(keydown.arrowDown)': 'onArrow($any($event), 1)',\n '(keydown.arrowLeft)': 'onHorizontalArrow($any($event), -1)',\n '(keydown.arrowRight)': 'onHorizontalArrow($any($event), 1)',\n '(keydown.arrowUp)': 'onArrow($any($event), -1)',\n '(keydown.end)': 'onEnd($any($event))',\n '(keydown.home)': 'onHome($any($event))',\n },\n})\nexport class ToggleGroupItemDirective {\n protected readonly ctx = inject(ToggleGroupContextBase);\n private readonly element = inject<ElementRef<HTMLButtonElement>>(ElementRef);\n\n readonly value = input.required<string>();\n readonly disabled = input<boolean>(false);\n readonly class = input<string>('');\n\n protected readonly selected = computed(() => this.ctx.isSelected(this.value()));\n protected readonly classes = computed(() =>\n cn(toggleVariants({ variant: this.ctx.groupVariant(), size: this.ctx.groupSize() }), this.class()),\n );\n\n ngOnInit(): void {\n this.ctx.register(this.element.nativeElement, this.value, this.disabled);\n }\n\n ngOnDestroy(): void {\n this.ctx.unregister(this.element.nativeElement);\n }\n\n protected isDisabled(): boolean {\n return this.ctx.groupDisabled() || this.disabled();\n }\n\n protected onClick(): void {\n if (this.isDisabled()) return;\n this.ctx.toggle(this.value());\n }\n\n protected onFocus(): void {\n if (this.isDisabled()) return;\n this.ctx.markFocused(this.value());\n }\n\n protected onArrow(event: KeyboardEvent, offset: number): void {\n event.preventDefault();\n this.ctx.focusNext(this.element.nativeElement, offset);\n }\n\n protected onHorizontalArrow(event: KeyboardEvent, offset: number): void {\n event.preventDefault();\n this.ctx.focusNext(this.element.nativeElement, this.ctx.isRtl() ? offset * -1 : offset);\n }\n\n protected onHome(event: KeyboardEvent): void {\n event.preventDefault();\n this.ctx.focusFirst();\n }\n\n protected onEnd(event: KeyboardEvent): void {\n event.preventDefault();\n this.ctx.focusLast();\n }\n}\n\nfunction normalizeSpacing(value: number): keyof typeof spacingClasses {\n if (value in spacingClasses) {\n return value as keyof typeof spacingClasses;\n }\n\n return 2;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AA2BA,MAAM,cAAc,GAAG;AACrB,IAAA,CAAC,EAAE,EAAE;AACL,IAAA,CAAC,EAAE,OAAO;AACV,IAAA,CAAC,EAAE,OAAO;AACV,IAAA,CAAC,EAAE,OAAO;AACV,IAAA,CAAC,EAAE,OAAO;CACF;AAEV,MAAM,oBAAoB,GAA2C;AACnE,IAAA,UAAU,EAAE;QACV,oEAAoE;QACpE,mFAAmF;QACnF,mEAAmE;KACpE,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,IAAA,QAAQ,EAAE;QACR,oEAAoE;QACpE,gEAAgE;QAChE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AqB,EAAE,oBAAoB;AAC3C,wBAAA,iBAAiB,EAAE,wCAAwC;AAC3D,wBAAA,YAAY,EAAE,sBAAsB;AACpC,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,qBAAqB,EAAE,0BAA0B;AACjD,wBAAA,qBAAqB,EAAE,qCAAqC;AAC5D,wBAAA,sBAAsB,EAAE,oCAAoC;AAC5D,wBAAA,mBAAmB,EAAE,2BAA2B;AAChD,wBAAA,eAAe,EAAE,qBAAqB;AACtC,wBAAA,gBAAgB,EAAE,sBAAsB;AACzC,qBAAA;AACF,iBAAA;;AAyDD,SAAS,gBAAgB,CAAC,KAAa,EAAA;AACrC,IAAA,IAAI,KAAK,IAAI,cAAc,EAAE;AAC3B,QAAA,OAAO,KAAoC;IAC7C;AAEA,IAAA,OAAO,CAAC;AACV;;AC/UA;;AAEG;;;;"}
@@ -1,82 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { model, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { cn } from '@ojiepermana/angular/component/utils';
4
- import { cva } from 'class-variance-authority';
5
-
6
- const toggleVariants = cva([
7
- 'group/toggle inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md',
8
- 'text-sm font-medium transition-colors',
9
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
10
- 'disabled:pointer-events-none disabled:opacity-50',
11
- '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
12
- ].join(' '), {
13
- variants: {
14
- variant: {
15
- default: [
16
- 'bg-transparent text-foreground',
17
- 'hover:bg-muted hover:text-muted-foreground',
18
- 'data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
19
- ].join(' '),
20
- outline: [
21
- 'border border-input bg-transparent text-foreground shadow-sm',
22
- 'hover:bg-accent hover:text-accent-foreground',
23
- 'data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',
24
- ].join(' '),
25
- },
26
- size: {
27
- sm: 'h-8 min-w-8 px-2.5 text-xs',
28
- default: 'h-9 min-w-9 px-3',
29
- lg: 'h-10 min-w-10 px-3.5',
30
- },
31
- },
32
- defaultVariants: { variant: 'default', size: 'default' },
33
- });
34
-
35
- class ToggleComponent {
36
- pressed = model(false, /* @ts-ignore */
37
- ...(ngDevMode ? [{ debugName: "pressed" }] : /* istanbul ignore next */ []));
38
- disabled = input(false, /* @ts-ignore */
39
- ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
40
- variant = input('default', /* @ts-ignore */
41
- ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
42
- size = input('default', /* @ts-ignore */
43
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
44
- class = input('', /* @ts-ignore */
45
- ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
46
- classes = computed(() => cn(toggleVariants({ variant: this.variant(), size: this.size() }), this.class()), /* @ts-ignore */
47
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
48
- toggle() {
49
- if (this.disabled()) {
50
- return;
51
- }
52
- this.pressed.update((pressed) => !pressed);
53
- }
54
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
55
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.0", type: ToggleComponent, isStandalone: true, selector: "button[ui-toggle]", inputs: { pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange" }, host: { attributes: { "type": "button" }, listeners: { "click": "toggle()" }, properties: { "class": "classes()", "attr.aria-pressed": "pressed()", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-size": "size()", "attr.data-state": "pressed() ? \"on\" : \"off\"", "attr.data-variant": "variant()", "disabled": "disabled() || null" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
56
- }
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: ToggleComponent, decorators: [{
58
- type: Component,
59
- args: [{
60
- selector: 'button[ui-toggle]',
61
- changeDetection: ChangeDetectionStrategy.OnPush,
62
- host: {
63
- '[class]': 'classes()',
64
- type: 'button',
65
- '[attr.aria-pressed]': 'pressed()',
66
- '[attr.data-disabled]': 'disabled() ? "" : null',
67
- '[attr.data-size]': 'size()',
68
- '[attr.data-state]': 'pressed() ? "on" : "off"',
69
- '[attr.data-variant]': 'variant()',
70
- '[disabled]': 'disabled() || null',
71
- '(click)': 'toggle()',
72
- },
73
- template: `<ng-content />`,
74
- }]
75
- }], propDecorators: { pressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressed", required: false }] }, { type: i0.Output, args: ["pressedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
76
-
77
- /**
78
- * Generated bundle index. Do not edit.
79
- */
80
-
81
- export { ToggleComponent, toggleVariants };
82
- //# sourceMappingURL=ojiepermana-angular-component-toggle.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ojiepermana-angular-component-toggle.mjs","sources":["../../../projects/angular/component/toggle/toggle.variants.ts","../../../projects/angular/component/toggle/toggle.component.ts","../../../projects/angular/component/toggle/ojiepermana-angular-component-toggle.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const toggleVariants = cva(\n [\n 'group/toggle inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md',\n 'text-sm font-medium transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n ].join(' '),\n {\n variants: {\n variant: {\n default: [\n 'bg-transparent text-foreground',\n 'hover:bg-muted hover:text-muted-foreground',\n 'data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',\n ].join(' '),\n outline: [\n 'border border-input bg-transparent text-foreground shadow-sm',\n 'hover:bg-accent hover:text-accent-foreground',\n 'data-[state=on]:bg-accent data-[state=on]:text-accent-foreground',\n ].join(' '),\n },\n size: {\n sm: 'h-8 min-w-8 px-2.5 text-xs',\n default: 'h-9 min-w-9 px-3',\n lg: 'h-10 min-w-10 px-3.5',\n },\n },\n defaultVariants: { variant: 'default', size: 'default' },\n },\n);\n\nexport type ToggleVariant = NonNullable<VariantProps<typeof toggleVariants>['variant']>;\nexport type ToggleSize = NonNullable<VariantProps<typeof toggleVariants>['size']>;\n","import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core';\nimport { cn } from '@ojiepermana/angular/component/utils';\nimport { type ToggleSize, toggleVariants, type ToggleVariant } from './toggle.variants';\n\n@Component({\n selector: 'button[ui-toggle]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n type: 'button',\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-size]': 'size()',\n '[attr.data-state]': 'pressed() ? \"on\" : \"off\"',\n '[attr.data-variant]': 'variant()',\n '[disabled]': 'disabled() || null',\n '(click)': 'toggle()',\n },\n template: `<ng-content />`,\n})\nexport class ToggleComponent {\n readonly pressed = model(false);\n readonly disabled = input(false);\n readonly variant = input<ToggleVariant>('default');\n readonly size = input<ToggleSize>('default');\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn(toggleVariants({ variant: this.variant(), size: this.size() }), this.class()),\n );\n\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n\n this.pressed.update((pressed) => !pressed);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAEO,MAAM,cAAc,GAAG,GAAG,CAC/B;IACE,wGAAwG;IACxG,uCAAuC;IACvC,yEAAyE;IACzE,kDAAkD;IAClD,6DAA6D;AAC9D,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EACX;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE;gBACP,gCAAgC;gBAChC,4CAA4C;gBAC5C,kEAAkE;aACnE,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,YAAA,OAAO,EAAE;gBACP,8DAA8D;gBAC9D,8CAA8C;gBAC9C,kEAAkE;aACnE,CAAC,IAAI,CAAC,GAAG,CAAC;AACZ,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,4BAA4B;AAChC,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,EAAE,EAAE,sBAAsB;AAC3B,SAAA;AACF,KAAA;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;AACzD,CAAA;;MCXU,eAAe,CAAA;IACjB,OAAO,GAAG,KAAK,CAAC,KAAK;gFAAC;IACtB,QAAQ,GAAG,KAAK,CAAC,KAAK;iFAAC;IACvB,OAAO,GAAG,KAAK,CAAgB,SAAS;gFAAC;IACzC,IAAI,GAAG,KAAK,CAAa,SAAS;6EAAC;IACnC,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;AAEf,IAAA,OAAO,GAAG,QAAQ,CAAC,MACp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