@ojiepermana/angular-component 22.0.27

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 (244) hide show
  1. package/README.md +82 -0
  2. package/accordion/README.md +193 -0
  3. package/alert/README.md +180 -0
  4. package/alert-dialog/README.md +239 -0
  5. package/aspect-ratio/README.md +112 -0
  6. package/avatar/README.md +176 -0
  7. package/badge/README.md +133 -0
  8. package/breadcrumb/README.md +216 -0
  9. package/button/README.md +139 -0
  10. package/button-group/README.md +208 -0
  11. package/calendar/README.md +135 -0
  12. package/card/README.md +220 -0
  13. package/carousel/README.md +276 -0
  14. package/checkbox/README.md +149 -0
  15. package/collapsible/README.md +195 -0
  16. package/combobox/README.md +198 -0
  17. package/command/README.md +275 -0
  18. package/composer/README.md +235 -0
  19. package/context-menu/README.md +267 -0
  20. package/date-picker/README.md +179 -0
  21. package/dialog/README.md +235 -0
  22. package/drawer/README.md +145 -0
  23. package/dropdown-menu/README.md +311 -0
  24. package/editor/README.md +136 -0
  25. package/empty/README.md +183 -0
  26. package/fesm2022/ojiepermana-angular-component-accordion.mjs +186 -0
  27. package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +1 -0
  28. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +276 -0
  29. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +1 -0
  30. package/fesm2022/ojiepermana-angular-component-alert.mjs +99 -0
  31. package/fesm2022/ojiepermana-angular-component-alert.mjs.map +1 -0
  32. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +37 -0
  33. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +1 -0
  34. package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -0
  35. package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +1 -0
  36. package/fesm2022/ojiepermana-angular-component-badge.mjs +50 -0
  37. package/fesm2022/ojiepermana-angular-component-badge.mjs.map +1 -0
  38. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +200 -0
  39. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +1 -0
  40. package/fesm2022/ojiepermana-angular-component-button-group.mjs +103 -0
  41. package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +1 -0
  42. package/fesm2022/ojiepermana-angular-component-button.mjs +68 -0
  43. package/fesm2022/ojiepermana-angular-component-button.mjs.map +1 -0
  44. package/fesm2022/ojiepermana-angular-component-calendar.mjs +103 -0
  45. package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +1 -0
  46. package/fesm2022/ojiepermana-angular-component-card.mjs +152 -0
  47. package/fesm2022/ojiepermana-angular-component-card.mjs.map +1 -0
  48. package/fesm2022/ojiepermana-angular-component-carousel.mjs +334 -0
  49. package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +1 -0
  50. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +165 -0
  51. package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +1 -0
  52. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +121 -0
  53. package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +1 -0
  54. package/fesm2022/ojiepermana-angular-component-combobox.mjs +274 -0
  55. package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +1 -0
  56. package/fesm2022/ojiepermana-angular-component-command.mjs +297 -0
  57. package/fesm2022/ojiepermana-angular-component-command.mjs.map +1 -0
  58. package/fesm2022/ojiepermana-angular-component-composer.mjs +352 -0
  59. package/fesm2022/ojiepermana-angular-component-composer.mjs.map +1 -0
  60. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +108 -0
  61. package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +1 -0
  62. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +186 -0
  63. package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +1 -0
  64. package/fesm2022/ojiepermana-angular-component-dialog.mjs +283 -0
  65. package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +1 -0
  66. package/fesm2022/ojiepermana-angular-component-drawer.mjs +6 -0
  67. package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +1 -0
  68. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +494 -0
  69. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +1 -0
  70. package/fesm2022/ojiepermana-angular-component-editor.mjs +680 -0
  71. package/fesm2022/ojiepermana-angular-component-editor.mjs.map +1 -0
  72. package/fesm2022/ojiepermana-angular-component-empty.mjs +145 -0
  73. package/fesm2022/ojiepermana-angular-component-empty.mjs.map +1 -0
  74. package/fesm2022/ojiepermana-angular-component-form.mjs +364 -0
  75. package/fesm2022/ojiepermana-angular-component-form.mjs.map +1 -0
  76. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +275 -0
  77. package/fesm2022/ojiepermana-angular-component-hover-card.mjs.map +1 -0
  78. package/fesm2022/ojiepermana-angular-component-icon.mjs +86 -0
  79. package/fesm2022/ojiepermana-angular-component-icon.mjs.map +1 -0
  80. package/fesm2022/ojiepermana-angular-component-input-group.mjs +179 -0
  81. package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +1 -0
  82. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +517 -0
  83. package/fesm2022/ojiepermana-angular-component-input-otp.mjs.map +1 -0
  84. package/fesm2022/ojiepermana-angular-component-input.mjs +45 -0
  85. package/fesm2022/ojiepermana-angular-component-input.mjs.map +1 -0
  86. package/fesm2022/ojiepermana-angular-component-item.mjs +264 -0
  87. package/fesm2022/ojiepermana-angular-component-item.mjs.map +1 -0
  88. package/fesm2022/ojiepermana-angular-component-kanban.mjs +314 -0
  89. package/fesm2022/ojiepermana-angular-component-kanban.mjs.map +1 -0
  90. package/fesm2022/ojiepermana-angular-component-kbd.mjs +55 -0
  91. package/fesm2022/ojiepermana-angular-component-kbd.mjs.map +1 -0
  92. package/fesm2022/ojiepermana-angular-component-label.mjs +33 -0
  93. package/fesm2022/ojiepermana-angular-component-label.mjs.map +1 -0
  94. package/fesm2022/ojiepermana-angular-component-menubar.mjs +311 -0
  95. package/fesm2022/ojiepermana-angular-component-menubar.mjs.map +1 -0
  96. package/fesm2022/ojiepermana-angular-component-native-select.mjs +67 -0
  97. package/fesm2022/ojiepermana-angular-component-native-select.mjs.map +1 -0
  98. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +408 -0
  99. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs.map +1 -0
  100. package/fesm2022/ojiepermana-angular-component-pagination.mjs +226 -0
  101. package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +1 -0
  102. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +810 -0
  103. package/fesm2022/ojiepermana-angular-component-pillbox.mjs.map +1 -0
  104. package/fesm2022/ojiepermana-angular-component-popover.mjs +145 -0
  105. package/fesm2022/ojiepermana-angular-component-popover.mjs.map +1 -0
  106. package/fesm2022/ojiepermana-angular-component-progress.mjs +60 -0
  107. package/fesm2022/ojiepermana-angular-component-progress.mjs.map +1 -0
  108. package/fesm2022/ojiepermana-angular-component-radio.mjs +173 -0
  109. package/fesm2022/ojiepermana-angular-component-radio.mjs.map +1 -0
  110. package/fesm2022/ojiepermana-angular-component-resizable.mjs +478 -0
  111. package/fesm2022/ojiepermana-angular-component-resizable.mjs.map +1 -0
  112. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +54 -0
  113. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +1 -0
  114. package/fesm2022/ojiepermana-angular-component-select.mjs +297 -0
  115. package/fesm2022/ojiepermana-angular-component-select.mjs.map +1 -0
  116. package/fesm2022/ojiepermana-angular-component-separator.mjs +37 -0
  117. package/fesm2022/ojiepermana-angular-component-separator.mjs.map +1 -0
  118. package/fesm2022/ojiepermana-angular-component-sheet.mjs +297 -0
  119. package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +1 -0
  120. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +31 -0
  121. package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +1 -0
  122. package/fesm2022/ojiepermana-angular-component-slider.mjs +423 -0
  123. package/fesm2022/ojiepermana-angular-component-slider.mjs.map +1 -0
  124. package/fesm2022/ojiepermana-angular-component-spinner.mjs +60 -0
  125. package/fesm2022/ojiepermana-angular-component-spinner.mjs.map +1 -0
  126. package/fesm2022/ojiepermana-angular-component-switch.mjs +140 -0
  127. package/fesm2022/ojiepermana-angular-component-switch.mjs.map +1 -0
  128. package/fesm2022/ojiepermana-angular-component-table.mjs +155 -0
  129. package/fesm2022/ojiepermana-angular-component-table.mjs.map +1 -0
  130. package/fesm2022/ojiepermana-angular-component-tabs.mjs +271 -0
  131. package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +1 -0
  132. package/fesm2022/ojiepermana-angular-component-textarea.mjs +39 -0
  133. package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +1 -0
  134. package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -0
  135. package/fesm2022/ojiepermana-angular-component-timeline.mjs.map +1 -0
  136. package/fesm2022/ojiepermana-angular-component-toast.mjs +161 -0
  137. package/fesm2022/ojiepermana-angular-component-toast.mjs.map +1 -0
  138. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +289 -0
  139. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs.map +1 -0
  140. package/fesm2022/ojiepermana-angular-component-toggle.mjs +82 -0
  141. package/fesm2022/ojiepermana-angular-component-toggle.mjs.map +1 -0
  142. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +410 -0
  143. package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +1 -0
  144. package/fesm2022/ojiepermana-angular-component-utils.mjs +81 -0
  145. package/fesm2022/ojiepermana-angular-component-utils.mjs.map +1 -0
  146. package/fesm2022/ojiepermana-angular-component.mjs +11 -0
  147. package/fesm2022/ojiepermana-angular-component.mjs.map +1 -0
  148. package/form/README.md +210 -0
  149. package/hover-card/README.md +142 -0
  150. package/icon/README.md +25 -0
  151. package/input/README.md +159 -0
  152. package/input-group/README.md +237 -0
  153. package/input-otp/README.md +278 -0
  154. package/item/README.md +247 -0
  155. package/kanban/README.md +81 -0
  156. package/kbd/README.md +139 -0
  157. package/label/README.md +135 -0
  158. package/menubar/README.md +269 -0
  159. package/native-select/README.md +176 -0
  160. package/navigation-menu/README.md +160 -0
  161. package/package.json +291 -0
  162. package/pagination/README.md +144 -0
  163. package/pillbox/README.md +67 -0
  164. package/popover/README.md +43 -0
  165. package/progress/README.md +160 -0
  166. package/radio/README.md +209 -0
  167. package/resizable/README.md +168 -0
  168. package/scroll-area/README.md +143 -0
  169. package/select/README.md +174 -0
  170. package/separator/README.md +170 -0
  171. package/sheet/README.md +183 -0
  172. package/skeleton/README.md +158 -0
  173. package/slider/README.md +207 -0
  174. package/spinner/README.md +160 -0
  175. package/switch/README.md +166 -0
  176. package/table/README.md +291 -0
  177. package/tabs/README.md +214 -0
  178. package/textarea/README.md +153 -0
  179. package/timeline/README.md +94 -0
  180. package/toast/README.md +321 -0
  181. package/toggle/README.md +131 -0
  182. package/toggle-group/README.md +206 -0
  183. package/tooltip/README.md +207 -0
  184. package/types/ojiepermana-angular-component-accordion.d.ts +51 -0
  185. package/types/ojiepermana-angular-component-alert-dialog.d.ts +93 -0
  186. package/types/ojiepermana-angular-component-alert.d.ts +37 -0
  187. package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -0
  188. package/types/ojiepermana-angular-component-avatar.d.ts +51 -0
  189. package/types/ojiepermana-angular-component-badge.d.ts +19 -0
  190. package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -0
  191. package/types/ojiepermana-angular-component-button-group.d.ts +26 -0
  192. package/types/ojiepermana-angular-component-button.d.ts +22 -0
  193. package/types/ojiepermana-angular-component-calendar.d.ts +39 -0
  194. package/types/ojiepermana-angular-component-card.d.ts +60 -0
  195. package/types/ojiepermana-angular-component-carousel.d.ts +86 -0
  196. package/types/ojiepermana-angular-component-checkbox.d.ts +42 -0
  197. package/types/ojiepermana-angular-component-collapsible.d.ts +42 -0
  198. package/types/ojiepermana-angular-component-combobox.d.ts +53 -0
  199. package/types/ojiepermana-angular-component-command.d.ts +102 -0
  200. package/types/ojiepermana-angular-component-composer.d.ts +90 -0
  201. package/types/ojiepermana-angular-component-context-menu.d.ts +36 -0
  202. package/types/ojiepermana-angular-component-date-picker.d.ts +48 -0
  203. package/types/ojiepermana-angular-component-dialog.d.ts +87 -0
  204. package/types/ojiepermana-angular-component-drawer.d.ts +1 -0
  205. package/types/ojiepermana-angular-component-dropdown-menu.d.ts +140 -0
  206. package/types/ojiepermana-angular-component-editor.d.ts +126 -0
  207. package/types/ojiepermana-angular-component-empty.d.ts +50 -0
  208. package/types/ojiepermana-angular-component-form.d.ts +140 -0
  209. package/types/ojiepermana-angular-component-hover-card.d.ts +75 -0
  210. package/types/ojiepermana-angular-component-icon.d.ts +31 -0
  211. package/types/ojiepermana-angular-component-input-group.d.ts +51 -0
  212. package/types/ojiepermana-angular-component-input-otp.d.ts +142 -0
  213. package/types/ojiepermana-angular-component-input.d.ts +16 -0
  214. package/types/ojiepermana-angular-component-item.d.ts +88 -0
  215. package/types/ojiepermana-angular-component-kanban.d.ts +70 -0
  216. package/types/ojiepermana-angular-component-kbd.d.ts +16 -0
  217. package/types/ojiepermana-angular-component-label.d.ts +11 -0
  218. package/types/ojiepermana-angular-component-menubar.d.ts +69 -0
  219. package/types/ojiepermana-angular-component-native-select.d.ts +26 -0
  220. package/types/ojiepermana-angular-component-navigation-menu.d.ts +98 -0
  221. package/types/ojiepermana-angular-component-pagination.d.ts +33 -0
  222. package/types/ojiepermana-angular-component-pillbox.d.ts +156 -0
  223. package/types/ojiepermana-angular-component-popover.d.ts +50 -0
  224. package/types/ojiepermana-angular-component-progress.d.ts +17 -0
  225. package/types/ojiepermana-angular-component-radio.d.ts +57 -0
  226. package/types/ojiepermana-angular-component-resizable.d.ts +99 -0
  227. package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -0
  228. package/types/ojiepermana-angular-component-select.d.ts +56 -0
  229. package/types/ojiepermana-angular-component-separator.d.ts +14 -0
  230. package/types/ojiepermana-angular-component-sheet.d.ts +78 -0
  231. package/types/ojiepermana-angular-component-skeleton.d.ts +10 -0
  232. package/types/ojiepermana-angular-component-slider.d.ts +74 -0
  233. package/types/ojiepermana-angular-component-spinner.d.ts +13 -0
  234. package/types/ojiepermana-angular-component-switch.d.ts +44 -0
  235. package/types/ojiepermana-angular-component-table.d.ts +52 -0
  236. package/types/ojiepermana-angular-component-tabs.d.ts +92 -0
  237. package/types/ojiepermana-angular-component-textarea.d.ts +12 -0
  238. package/types/ojiepermana-angular-component-timeline.d.ts +63 -0
  239. package/types/ojiepermana-angular-component-toast.d.ts +51 -0
  240. package/types/ojiepermana-angular-component-toggle-group.d.ts +89 -0
  241. package/types/ojiepermana-angular-component-toggle.d.ts +25 -0
  242. package/types/ojiepermana-angular-component-tooltip.d.ts +101 -0
  243. package/types/ojiepermana-angular-component-utils.d.ts +30 -0
  244. package/types/ojiepermana-angular-component.d.ts +2 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ojiepermana-angular-component-input-group.mjs","sources":["../../../library/component/input-group/input-group.component.ts","../../../library/component/input-group/ojiepermana-angular-component-input-group.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, computed, inject, input } from '@angular/core';\nimport { cn } from '@ojiepermana/angular-component/utils';\nimport { buttonVariants, type ButtonSize, type ButtonVariant } from '@ojiepermana/angular-component/button';\n\nexport type InputGroupAddonAlign = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';\nexport type InputGroupButtonSize = Extract<ButtonSize, 'xs' | 'icon-xs' | 'sm' | 'icon-sm'>;\n\nconst GROUP_BASE = [\n 'relative flex min-w-0 flex-wrap overflow-hidden rounded-lg border border-input bg-transparent text-sm shadow-sm',\n 'transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-1 focus-within:ring-ring',\n '[&>[data-slot=input-group-control]]:min-w-0',\n '[&>[data-slot=input-group-control]]:flex-1',\n '[&>[data-slot=input-group-control]]:rounded-none',\n '[&>[data-slot=input-group-control]]:border-0',\n '[&>[data-slot=input-group-control]]:bg-transparent',\n '[&>[data-slot=input-group-control]]:shadow-none',\n '[&>[data-slot=input-group-control]]:outline-none',\n '[&>[data-slot=input-group-control]]:focus-visible:ring-0',\n '[&>[data-slot=input-group-control]]:focus-visible:outline-none',\n].join(' ');\n\nconst addonAlignClasses: Record<InputGroupAddonAlign, string> = {\n 'inline-start': ['order-10', '[border-inline-end-width:1px]', '[border-inline-end-color:hsl(var(--border))]'].join(\n ' ',\n ),\n 'inline-end': ['order-30', '[border-inline-start-width:1px]', '[border-inline-start-color:hsl(var(--border))]'].join(\n ' ',\n ),\n 'block-start': [\n 'order-0 basis-full py-2',\n '[border-block-end-width:1px]',\n '[border-block-end-color:hsl(var(--border))]',\n ].join(' '),\n 'block-end': [\n 'order-40 basis-full py-2',\n '[border-block-start-width:1px]',\n '[border-block-start-color:hsl(var(--border))]',\n ].join(' '),\n};\n\nconst ADDON_BASE = [\n 'flex min-h-9 shrink-0 items-center gap-1.5 bg-[hsl(var(--muted)/var(--opacity-30))] px-3 text-sm text-muted-foreground',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n].join(' ');\n\nconst CONTROL_BASE = [\n 'order-20 min-w-0 flex-1 bg-transparent text-sm text-foreground',\n 'placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'focus-visible:outline-none',\n 'aria-[invalid=true]:text-destructive',\n].join(' ');\n\n@Component({\n selector: 'InputGroup',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class InputGroupComponent {\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(GROUP_BASE, this.class()));\n}\n\n@Component({\n selector: 'InputGroupAddon',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.data-align]': 'align()',\n },\n template: `<ng-content />`,\n})\nexport class InputGroupAddonComponent {\n readonly align = input<InputGroupAddonAlign>('inline-start');\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(ADDON_BASE, addonAlignClasses[this.align()], this.class()));\n}\n\n@Component({\n selector: 'InputGroupText',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class]': 'classes()' },\n template: `<ng-content />`,\n})\nexport class InputGroupTextComponent {\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn('inline-flex items-center gap-1.5 whitespace-nowrap text-sm leading-none text-current', this.class()),\n );\n}\n\n@Component({\n selector: 'button[InputGroupButton], a[InputGroupButton]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[attr.data-size]': 'size()',\n '[attr.data-variant]': 'variant()',\n },\n template: `<ng-content />`,\n})\nexport class InputGroupButtonComponent {\n readonly variant = input<ButtonVariant>('ghost');\n readonly size = input<InputGroupButtonSize>('xs');\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn(buttonVariants({ variant: this.variant(), size: this.size() }), 'shrink-0 shadow-none', this.class()),\n );\n}\n\n@Component({\n selector: 'input[InputGroupInput]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n 'data-slot': 'input-group-control',\n },\n template: '',\n})\nexport class InputGroupInputComponent {\n private readonly el = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n readonly class = input<string>('');\n\n protected readonly classes = computed(() => cn(CONTROL_BASE, 'h-9 px-3 py-2', this.class()));\n\n focus(): void {\n this.el.nativeElement.focus();\n }\n}\n\n@Component({\n selector: 'textarea[InputGroupTextarea]',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n 'data-slot': 'input-group-control',\n },\n template: '',\n})\nexport class InputGroupTextareaComponent {\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n\n readonly class = input<string>('');\n\n protected readonly classes = computed(() =>\n cn(CONTROL_BASE, 'min-h-[120px] w-full resize-none px-3 py-2.5', this.class()),\n );\n\n focus(): void {\n this.el.nativeElement.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAOA,MAAM,UAAU,GAAG;IACjB,iHAAiH;IACjH,0GAA0G;IAC1G,6CAA6C;IAC7C,4CAA4C;IAC5C,kDAAkD;IAClD,8CAA8C;IAC9C,oDAAoD;IACpD,iDAAiD;IACjD,kDAAkD;IAClD,0DAA0D;IAC1D,gEAAgE;AACjE,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX,MAAM,iBAAiB,GAAyC;AAC9D,IAAA,cAAc,EAAE,CAAC,UAAU,EAAE,+BAA+B,EAAE,8CAA8C,CAAC,CAAC,IAAI,CAChH,GAAG,CACJ;AACD,IAAA,YAAY,EAAE,CAAC,UAAU,EAAE,iCAAiC,EAAE,gDAAgD,CAAC,CAAC,IAAI,CAClH,GAAG,CACJ;AACD,IAAA,aAAa,EAAE;QACb,yBAAyB;QACzB,8BAA8B;QAC9B,6CAA6C;KAC9C,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,IAAA,WAAW,EAAE;QACX,0BAA0B;QAC1B,gCAAgC;QAChC,+CAA+C;KAChD,CAAC,IAAI,CAAC,GAAG,CAAC;CACZ;AAED,MAAM,UAAU,GAAG;IACjB,wHAAwH;IACxH,6DAA6D;AAC9D,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AAEX,MAAM,YAAY,GAAG;IACnB,gEAAgE;IAChE,mCAAmC;IACnC,iDAAiD;IACjD,4BAA4B;IAC5B,sCAAsC;AACvC,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC;MAQE,mBAAmB,CAAA;IACrB,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;AAEf,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;g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2B,gUAF5B,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAED,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBATvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,8BAA8B;oBACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,WAAW,EAAE,qBAAqB;AACnC,qBAAA;AACD,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;AChJD;;AAEG;;;;"}
@@ -0,0 +1,517 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, input, computed, ChangeDetectionStrategy, Component, inject, numberAttribute, booleanAttribute, viewChild, ElementRef, Injector, output, linkedSignal, signal, contentChildren, forwardRef } from '@angular/core';
3
+ import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
4
+ import { FormFieldContext } from '@ojiepermana/angular-component/form';
5
+ import { cn, uniqueId } from '@ojiepermana/angular-component/utils';
6
+
7
+ const REGEXP_ONLY_DIGITS = /^[0-9]$/;
8
+ const REGEXP_ONLY_DIGITS_AND_CHARS = /^[A-Za-z0-9]$/;
9
+ class InputOtpContextBase {
10
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpContextBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: InputOtpContextBase, isStandalone: true, ngImport: i0 });
12
+ }
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpContextBase, decorators: [{
14
+ type: Directive
15
+ }] });
16
+ class InputOtpGroupComponent {
17
+ class = input('', /* @ts-ignore */
18
+ ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
19
+ classes = computed(() => cn('flex items-center overflow-hidden rounded-md border border-input bg-background shadow-sm', this.class()), /* @ts-ignore */
20
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: InputOtpGroupComponent, isStandalone: true, selector: "InputOtpGroup", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"input-otp-group\"" } }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
23
+ }
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpGroupComponent, decorators: [{
25
+ type: Component,
26
+ args: [{
27
+ selector: 'InputOtpGroup',
28
+ changeDetection: ChangeDetectionStrategy.OnPush,
29
+ host: {
30
+ '[class]': 'classes()',
31
+ '[attr.data-slot]': '"input-otp-group"',
32
+ },
33
+ template: `<ng-content />`,
34
+ }]
35
+ }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
36
+ class InputOtpSeparatorComponent {
37
+ class = input('', /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
39
+ classes = computed(() => cn('inline-flex h-10 w-6 items-center justify-center text-muted-foreground [&>svg]:h-4 [&>svg]:w-4', this.class()), /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
41
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
42
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: InputOtpSeparatorComponent, isStandalone: true, selector: "InputOtpSeparator", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "class": "classes()", "attr.data-slot": "\"input-otp-separator\"" } }, ngImport: i0, template: `
43
+ <svg
44
+ viewBox="0 0 24 24"
45
+ fill="none"
46
+ stroke="currentColor"
47
+ stroke-width="2"
48
+ stroke-linecap="round"
49
+ stroke-linejoin="round">
50
+ <path d="M5 12h14" />
51
+ </svg>
52
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
53
+ }
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpSeparatorComponent, decorators: [{
55
+ type: Component,
56
+ args: [{
57
+ selector: 'InputOtpSeparator',
58
+ changeDetection: ChangeDetectionStrategy.OnPush,
59
+ host: {
60
+ '[class]': 'classes()',
61
+ '[attr.data-slot]': '"input-otp-separator"',
62
+ 'aria-hidden': 'true',
63
+ },
64
+ template: `
65
+ <svg
66
+ viewBox="0 0 24 24"
67
+ fill="none"
68
+ stroke="currentColor"
69
+ stroke-width="2"
70
+ stroke-linecap="round"
71
+ stroke-linejoin="round">
72
+ <path d="M5 12h14" />
73
+ </svg>
74
+ `,
75
+ }]
76
+ }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
77
+ class InputOtpSlotComponent {
78
+ ctx = inject(InputOtpContextBase);
79
+ index = input(0, { ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), transform: numberAttribute });
80
+ class = input('', /* @ts-ignore */
81
+ ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
82
+ invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), alias: 'aria-invalid', transform: booleanAttribute });
83
+ inputRef = viewChild.required('inputRef');
84
+ maxLength = computed(() => this.ctx.maxLength(), /* @ts-ignore */
85
+ ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
86
+ character = computed(() => this.ctx.slotValue(this.index()), /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "character" }] : /* istanbul ignore next */ []));
88
+ active = computed(() => this.ctx.isActive(this.index()), /* @ts-ignore */
89
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
90
+ filled = computed(() => this.character() !== '', /* @ts-ignore */
91
+ ...(ngDevMode ? [{ debugName: "filled" }] : /* istanbul ignore next */ []));
92
+ disabled = computed(() => this.ctx.isDisabled(), /* @ts-ignore */
93
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
94
+ required = computed(() => this.ctx.isRequired(), /* @ts-ignore */
95
+ ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
96
+ inputId = computed(() => this.ctx.slotId(this.index()), /* @ts-ignore */
97
+ ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
98
+ inputMode = computed(() => this.ctx.slotInputMode(), /* @ts-ignore */
99
+ ...(ngDevMode ? [{ debugName: "inputMode" }] : /* istanbul ignore next */ []));
100
+ autocomplete = computed(() => this.ctx.slotAutocomplete(this.index()), /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
102
+ ariaLabel = computed(() => this.ctx.slotAriaLabel(this.index()), /* @ts-ignore */
103
+ ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
104
+ ariaLabelledBy = computed(() => this.ctx.slotAriaLabelledBy(this.index()), /* @ts-ignore */
105
+ ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
106
+ ariaDescribedBy = computed(() => this.ctx.slotAriaDescribedBy(), /* @ts-ignore */
107
+ ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
108
+ effectiveInvalid = computed(() => this.invalid() || this.ctx.isInvalid(), /* @ts-ignore */
109
+ ...(ngDevMode ? [{ debugName: "effectiveInvalid" }] : /* istanbul ignore next */ []));
110
+ classes = computed(() => cn('relative flex h-10 w-10 items-center justify-center border-r border-border text-sm font-medium transition-[background-color,box-shadow,opacity] last:border-r-0', this.active() && !this.effectiveInvalid() && 'z-10 ring-1 ring-inset ring-ring', this.effectiveInvalid() && 'bg-destructive/5 text-destructive ring-1 ring-inset ring-destructive/50', this.disabled() && 'opacity-50', this.class()), /* @ts-ignore */
111
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
112
+ focus(select = true) {
113
+ const input = this.inputRef().nativeElement;
114
+ input.focus();
115
+ if (select) {
116
+ input.select();
117
+ }
118
+ }
119
+ handleFocus() {
120
+ this.ctx.handleSlotFocus(this.index());
121
+ this.inputRef().nativeElement.select();
122
+ }
123
+ handleInput(event) {
124
+ const target = event.target;
125
+ this.ctx.handleSlotInput(this.index(), target.value);
126
+ }
127
+ handleKeydown(event) {
128
+ this.ctx.handleSlotKeydown(this.index(), event);
129
+ }
130
+ handlePaste(event) {
131
+ this.ctx.handleSlotPaste(this.index(), event);
132
+ }
133
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
134
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.2", type: InputOtpSlotComponent, isStandalone: true, selector: "InputOtpSlot", inputs: { index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.data-slot": "\"input-otp-slot\"", "attr.data-active": "active() ? \"\" : null", "attr.data-filled": "filled() ? \"\" : null", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-invalid": "effectiveInvalid() ? \"\" : null" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
135
+ <input
136
+ #inputRef
137
+ class="h-full w-full border-0 bg-transparent px-0 text-center text-inherit font-inherit outline-none disabled:cursor-not-allowed"
138
+ type="text"
139
+ spellcheck="false"
140
+ autocapitalize="none"
141
+ [value]="character()"
142
+ [attr.id]="inputId()"
143
+ [attr.maxlength]="maxLength()"
144
+ [attr.inputmode]="inputMode()"
145
+ [attr.autocomplete]="autocomplete()"
146
+ [attr.aria-label]="ariaLabel()"
147
+ [attr.aria-labelledby]="ariaLabelledBy()"
148
+ [attr.aria-describedby]="ariaDescribedBy()"
149
+ [attr.aria-invalid]="effectiveInvalid() ? 'true' : null"
150
+ [disabled]="disabled()"
151
+ [required]="required() || null"
152
+ (focus)="handleFocus()"
153
+ (input)="handleInput($event)"
154
+ (keydown)="handleKeydown($event)"
155
+ (paste)="handlePaste($event)" />
156
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
157
+ }
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpSlotComponent, decorators: [{
159
+ type: Component,
160
+ args: [{
161
+ selector: 'InputOtpSlot',
162
+ changeDetection: ChangeDetectionStrategy.OnPush,
163
+ host: {
164
+ '[class]': 'classes()',
165
+ '[attr.data-slot]': '"input-otp-slot"',
166
+ '[attr.data-active]': 'active() ? "" : null',
167
+ '[attr.data-filled]': 'filled() ? "" : null',
168
+ '[attr.data-disabled]': 'disabled() ? "" : null',
169
+ '[attr.data-invalid]': 'effectiveInvalid() ? "" : null',
170
+ },
171
+ template: `
172
+ <input
173
+ #inputRef
174
+ class="h-full w-full border-0 bg-transparent px-0 text-center text-inherit font-inherit outline-none disabled:cursor-not-allowed"
175
+ type="text"
176
+ spellcheck="false"
177
+ autocapitalize="none"
178
+ [value]="character()"
179
+ [attr.id]="inputId()"
180
+ [attr.maxlength]="maxLength()"
181
+ [attr.inputmode]="inputMode()"
182
+ [attr.autocomplete]="autocomplete()"
183
+ [attr.aria-label]="ariaLabel()"
184
+ [attr.aria-labelledby]="ariaLabelledBy()"
185
+ [attr.aria-describedby]="ariaDescribedBy()"
186
+ [attr.aria-invalid]="effectiveInvalid() ? 'true' : null"
187
+ [disabled]="disabled()"
188
+ [required]="required() || null"
189
+ (focus)="handleFocus()"
190
+ (input)="handleInput($event)"
191
+ (keydown)="handleKeydown($event)"
192
+ (paste)="handlePaste($event)" />
193
+ `,
194
+ }]
195
+ }], propDecorators: { index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], inputRef: [{ type: i0.ViewChild, args: ['inputRef', { isSignal: true }] }] } });
196
+ class InputOtpComponent extends InputOtpContextBase {
197
+ host = inject(ElementRef);
198
+ injector = inject(Injector);
199
+ formFieldContext = inject(FormFieldContext, { optional: true });
200
+ maxLengthInput = input(6, { ...(ngDevMode ? { debugName: "maxLengthInput" } : /* istanbul ignore next */ {}), alias: 'maxLength', transform: numberAttribute });
201
+ value = input(undefined, /* @ts-ignore */
202
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
203
+ pattern = input(null, /* @ts-ignore */
204
+ ...(ngDevMode ? [{ debugName: "pattern" }] : /* istanbul ignore next */ []));
205
+ id = input(null, { ...(ngDevMode ? { debugName: "id" } : /* istanbul ignore next */ {}), alias: 'id' });
206
+ ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
207
+ ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
208
+ ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
209
+ inputMode = input('numeric', { ...(ngDevMode ? { debugName: "inputMode" } : /* istanbul ignore next */ {}), alias: 'inputmode' });
210
+ autocomplete = input('one-time-code', { ...(ngDevMode ? { debugName: "autocomplete" } : /* istanbul ignore next */ {}), alias: 'autocomplete' });
211
+ required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
212
+ disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
213
+ invalidInput = input(false, { ...(ngDevMode ? { debugName: "invalidInput" } : /* istanbul ignore next */ {}), alias: 'aria-invalid', transform: booleanAttribute });
214
+ class = input('', /* @ts-ignore */
215
+ ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
216
+ valueChange = output();
217
+ generatedId = uniqueId('InputOtp');
218
+ /**
219
+ * Single source of truth for the rendered value. Re-seeds from the `value`
220
+ * binding when it changes, but writes from typing or the Forms API
221
+ * (writeValue) win until the binding changes again — so `form.reset()` is
222
+ * never shadowed by a stale `[value]` binding.
223
+ */
224
+ internalValue = linkedSignal(() => this.normalizeValue(this.value() ?? ''), /* @ts-ignore */
225
+ ...(ngDevMode ? [{ debugName: "internalValue" }] : /* istanbul ignore next */ []));
226
+ disabledState = signal(false, /* @ts-ignore */
227
+ ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
228
+ activeIndex = signal(0, /* @ts-ignore */
229
+ ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
230
+ slots = contentChildren(InputOtpSlotComponent, { ...(ngDevMode ? { debugName: "slots" } : /* istanbul ignore next */ {}), descendants: true });
231
+ compiledPattern = computed(() => {
232
+ const pattern = this.pattern();
233
+ if (!pattern) {
234
+ return null;
235
+ }
236
+ if (pattern instanceof RegExp) {
237
+ return pattern;
238
+ }
239
+ try {
240
+ return new RegExp(pattern);
241
+ }
242
+ catch {
243
+ return null;
244
+ }
245
+ }, /* @ts-ignore */
246
+ ...(ngDevMode ? [{ debugName: "compiledPattern" }] : /* istanbul ignore next */ []));
247
+ classes = computed(() => cn('inline-flex flex-wrap items-center gap-2', this.class()), /* @ts-ignore */
248
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
249
+ disabled = computed(() => this.disabledInput() || this.disabledState(), /* @ts-ignore */
250
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
251
+ displayValue = computed(() => this.internalValue(), /* @ts-ignore */
252
+ ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
253
+ ngControl = null;
254
+ onChange = () => { };
255
+ onTouched = () => { };
256
+ ngOnInit() {
257
+ this.ngControl = this.injector.get(NgControl, null, { optional: true, self: true });
258
+ if (this.formFieldContext) {
259
+ this.formFieldContext.control.set(this.ngControl?.control ?? null);
260
+ }
261
+ }
262
+ maxLength() {
263
+ return Math.max(1, this.maxLengthInput());
264
+ }
265
+ slotId(index) {
266
+ const baseId = this.id() ?? this.formFieldContext?.controlId ?? this.generatedId;
267
+ return index === 0 ? baseId : `${baseId}-${index + 1}`;
268
+ }
269
+ slotValue(index) {
270
+ return this.toCharArray()[index] ?? '';
271
+ }
272
+ slotAriaLabel(index) {
273
+ const baseLabel = this.ariaLabel() ?? 'One-time password';
274
+ return `${baseLabel} character ${index + 1} of ${this.maxLength()}`;
275
+ }
276
+ slotAriaLabelledBy(index) {
277
+ return index === 0 ? this.ariaLabelledby() : null;
278
+ }
279
+ slotAriaDescribedBy() {
280
+ return this.describedBy();
281
+ }
282
+ slotInputMode() {
283
+ return this.inputMode();
284
+ }
285
+ slotAutocomplete(index) {
286
+ return index === 0 ? this.autocomplete() : 'off';
287
+ }
288
+ isDisabled() {
289
+ return this.disabled();
290
+ }
291
+ isRequired() {
292
+ return this.required();
293
+ }
294
+ isInvalid() {
295
+ return this.invalidInput() || this.formFieldContext?.invalid() || false;
296
+ }
297
+ isActive(index) {
298
+ return this.activeIndex() === index;
299
+ }
300
+ handleSlotFocus(index) {
301
+ this.activeIndex.set(index);
302
+ }
303
+ handleSlotInput(index, value) {
304
+ if (this.disabled()) {
305
+ return;
306
+ }
307
+ const accepted = this.filterCharacters(value);
308
+ if (accepted.length === 0) {
309
+ return;
310
+ }
311
+ if (accepted.length > 1) {
312
+ this.applyFragment(index, accepted);
313
+ return;
314
+ }
315
+ const next = this.replaceAt(index, accepted[0]);
316
+ this.commitValue(next);
317
+ this.focusSlot(Math.min(index + 1, this.maxLength() - 1));
318
+ }
319
+ handleSlotKeydown(index, event) {
320
+ if (this.disabled()) {
321
+ return;
322
+ }
323
+ const isRtl = this.isRtl();
324
+ switch (event.key) {
325
+ case 'ArrowLeft':
326
+ event.preventDefault();
327
+ this.focusSlot(Math.max(0, index + (isRtl ? 1 : -1)));
328
+ return;
329
+ case 'ArrowRight':
330
+ event.preventDefault();
331
+ this.focusSlot(Math.min(this.maxLength() - 1, index + (isRtl ? -1 : 1)));
332
+ return;
333
+ case 'Home':
334
+ event.preventDefault();
335
+ this.focusSlot(0);
336
+ return;
337
+ case 'End':
338
+ event.preventDefault();
339
+ this.focusSlot(this.maxLength() - 1);
340
+ return;
341
+ case 'Backspace': {
342
+ event.preventDefault();
343
+ const current = this.slotValue(index);
344
+ const deleteIndex = current === '' ? index - 1 : index;
345
+ if (deleteIndex < 0) {
346
+ return;
347
+ }
348
+ this.commitValue(this.removeAt(deleteIndex));
349
+ this.focusSlot(Math.max(0, deleteIndex));
350
+ return;
351
+ }
352
+ case 'Delete':
353
+ event.preventDefault();
354
+ this.commitValue(this.removeAt(index));
355
+ this.focusSlot(index);
356
+ return;
357
+ default:
358
+ return;
359
+ }
360
+ }
361
+ handleSlotPaste(index, event) {
362
+ if (this.disabled()) {
363
+ return;
364
+ }
365
+ const pasted = event.clipboardData?.getData('text') ?? '';
366
+ const accepted = this.filterCharacters(pasted);
367
+ if (accepted.length === 0) {
368
+ return;
369
+ }
370
+ event.preventDefault();
371
+ this.applyFragment(index, accepted);
372
+ }
373
+ focus() {
374
+ const index = Math.min(this.displayValue().length, this.maxLength() - 1);
375
+ this.focusSlot(Math.max(index, 0));
376
+ }
377
+ writeValue(value) {
378
+ this.internalValue.set(this.normalizeValue(typeof value === 'string' ? value : ''));
379
+ }
380
+ registerOnChange(fn) {
381
+ this.onChange = fn;
382
+ }
383
+ registerOnTouched(fn) {
384
+ this.onTouched = fn;
385
+ }
386
+ setDisabledState(disabled) {
387
+ this.disabledState.set(disabled);
388
+ }
389
+ describedBy() {
390
+ const rawIds = [this.ariaDescribedby(), this.formFieldContext?.describedBy() ?? null].filter((value) => !!value);
391
+ const ids = [...new Set(rawIds.flatMap((value) => value.split(/\s+/)).filter(Boolean))];
392
+ return ids.length > 0 ? ids.join(' ') : null;
393
+ }
394
+ handleFocusOut(event) {
395
+ const nextTarget = event.relatedTarget;
396
+ if (!(nextTarget instanceof Node) || !this.host.nativeElement.contains(nextTarget)) {
397
+ this.onTouched();
398
+ }
399
+ }
400
+ commitValue(value) {
401
+ const nextValue = this.normalizeValue(value);
402
+ this.internalValue.set(nextValue);
403
+ this.onChange(nextValue);
404
+ this.valueChange.emit(nextValue);
405
+ }
406
+ replaceAt(index, character) {
407
+ const chars = this.toCharArray();
408
+ chars[index] = character;
409
+ return this.serialize(chars);
410
+ }
411
+ removeAt(index) {
412
+ const chars = this.toCharArray();
413
+ if (index < 0 || index >= chars.length) {
414
+ return this.displayValue();
415
+ }
416
+ chars.splice(index, 1);
417
+ chars.push('');
418
+ return this.serialize(chars);
419
+ }
420
+ applyFragment(index, characters) {
421
+ const chars = this.toCharArray();
422
+ let cursor = index;
423
+ for (const character of characters) {
424
+ if (cursor >= chars.length) {
425
+ break;
426
+ }
427
+ chars[cursor] = character;
428
+ cursor += 1;
429
+ }
430
+ this.commitValue(this.serialize(chars));
431
+ this.focusSlot(Math.min(cursor, this.maxLength() - 1));
432
+ }
433
+ focusSlot(index) {
434
+ const slot = this.slots().find((candidate) => candidate.index() === index);
435
+ if (!slot) {
436
+ return;
437
+ }
438
+ this.activeIndex.set(index);
439
+ slot.focus();
440
+ }
441
+ toCharArray() {
442
+ const chars = Array.from({ length: this.maxLength() }, () => '');
443
+ for (const [index, character] of Array.from(this.displayValue()).entries()) {
444
+ if (index >= chars.length) {
445
+ break;
446
+ }
447
+ chars[index] = character;
448
+ }
449
+ return chars;
450
+ }
451
+ serialize(chars) {
452
+ let lastFilledIndex = -1;
453
+ for (let index = chars.length - 1; index >= 0; index -= 1) {
454
+ if (chars[index] !== '') {
455
+ lastFilledIndex = index;
456
+ break;
457
+ }
458
+ }
459
+ return lastFilledIndex === -1 ? '' : chars.slice(0, lastFilledIndex + 1).join('');
460
+ }
461
+ normalizeValue(value) {
462
+ return this.filterCharacters(value).slice(0, this.maxLength()).join('');
463
+ }
464
+ filterCharacters(value) {
465
+ return Array.from(value).filter((character) => this.acceptsCharacter(character));
466
+ }
467
+ acceptsCharacter(character) {
468
+ const pattern = this.compiledPattern();
469
+ if (!pattern) {
470
+ return true;
471
+ }
472
+ pattern.lastIndex = 0;
473
+ return pattern.test(character);
474
+ }
475
+ isRtl() {
476
+ return getComputedStyle(this.host.nativeElement).direction === 'rtl';
477
+ }
478
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
479
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.2", type: InputOtpComponent, isStandalone: true, selector: "InputOtp", inputs: { maxLengthInput: { classPropertyName: "maxLengthInput", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, inputMode: { classPropertyName: "inputMode", publicName: "inputmode", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { listeners: { "focusout": "handleFocusOut($event)" }, properties: { "class": "classes()", "attr.id": "null", "attr.role": "\"group\"", "attr.data-slot": "\"input-otp\"", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-invalid": "isInvalid() ? \"\" : null", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledby()", "attr.aria-describedby": "describedBy()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.aria-invalid": "isInvalid() ? \"true\" : null" } }, providers: [
480
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => InputOtpComponent), multi: true },
481
+ { provide: InputOtpContextBase, useExisting: forwardRef(() => InputOtpComponent) },
482
+ ], queries: [{ propertyName: "slots", predicate: InputOtpSlotComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
483
+ }
484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: InputOtpComponent, decorators: [{
485
+ type: Component,
486
+ args: [{
487
+ selector: 'InputOtp',
488
+ changeDetection: ChangeDetectionStrategy.OnPush,
489
+ providers: [
490
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => InputOtpComponent), multi: true },
491
+ { provide: InputOtpContextBase, useExisting: forwardRef(() => InputOtpComponent) },
492
+ ],
493
+ host: {
494
+ '[class]': 'classes()',
495
+ '[attr.id]': 'null',
496
+ '[attr.role]': '"group"',
497
+ '[attr.data-slot]': '"input-otp"',
498
+ '[attr.data-disabled]': 'disabled() ? "" : null',
499
+ '[attr.data-invalid]': 'isInvalid() ? "" : null',
500
+ '[attr.aria-label]': 'ariaLabel()',
501
+ '[attr.aria-labelledby]': 'ariaLabelledby()',
502
+ '[attr.aria-describedby]': 'describedBy()',
503
+ '[attr.aria-disabled]': 'disabled() ? "true" : null',
504
+ '[attr.aria-invalid]': 'isInvalid() ? "true" : null',
505
+ '(focusout)': 'handleFocusOut($event)',
506
+ },
507
+ template: `<ng-content />`,
508
+ }]
509
+ }], propDecorators: { maxLengthInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], pattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "pattern", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], inputMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputmode", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalidInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], slots: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => InputOtpSlotComponent), { ...{ descendants: true }, isSignal: true }] }] } });
510
+ let _id = 0;
511
+
512
+ /**
513
+ * Generated bundle index. Do not edit.
514
+ */
515
+
516
+ export { InputOtpComponent, InputOtpGroupComponent, InputOtpSeparatorComponent, InputOtpSlotComponent, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS };
517
+ //# sourceMappingURL=ojiepermana-angular-component-input-otp.mjs.map