@aeris-ui/core 22.0.0-alpha.1 → 22.0.0-alpha.11

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 (318) hide show
  1. package/README.md +232 -191
  2. package/THIRD_PARTY_LICENSES.md +48 -0
  3. package/fesm2022/aeris-ui-core-accordion.mjs +666 -273
  4. package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -1
  5. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +284 -103
  6. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -1
  7. package/fesm2022/aeris-ui-core-auto-complete.mjs +1301 -450
  8. package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
  9. package/fesm2022/aeris-ui-core-auto-focus.mjs +111 -61
  10. package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -1
  11. package/fesm2022/aeris-ui-core-avatar.mjs +383 -101
  12. package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
  13. package/fesm2022/aeris-ui-core-badge.mjs +562 -115
  14. package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
  15. package/fesm2022/aeris-ui-core-block-ui.mjs +221 -101
  16. package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
  17. package/fesm2022/aeris-ui-core-breadcrumb.mjs +609 -199
  18. package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
  19. package/fesm2022/aeris-ui-core-button-forms.mjs +78 -0
  20. package/fesm2022/aeris-ui-core-button-forms.mjs.map +1 -0
  21. package/fesm2022/aeris-ui-core-button-group.mjs +554 -36
  22. package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
  23. package/fesm2022/aeris-ui-core-button.mjs +911 -137
  24. package/fesm2022/aeris-ui-core-button.mjs.map +1 -1
  25. package/fesm2022/aeris-ui-core-card.mjs +371 -101
  26. package/fesm2022/aeris-ui-core-card.mjs.map +1 -1
  27. package/fesm2022/aeris-ui-core-carousel.mjs +835 -369
  28. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
  29. package/fesm2022/aeris-ui-core-cascade-select.mjs +1294 -525
  30. package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
  31. package/fesm2022/aeris-ui-core-chart.mjs +594 -262
  32. package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
  33. package/fesm2022/aeris-ui-core-checkbox.mjs +619 -150
  34. package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -1
  35. package/fesm2022/aeris-ui-core-chip.mjs +1109 -121
  36. package/fesm2022/aeris-ui-core-chip.mjs.map +1 -1
  37. package/fesm2022/aeris-ui-core-class-names.mjs +87 -65
  38. package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -1
  39. package/fesm2022/aeris-ui-core-code-block.mjs +687 -0
  40. package/fesm2022/aeris-ui-core-code-block.mjs.map +1 -0
  41. package/fesm2022/aeris-ui-core-color-picker.mjs +2436 -1076
  42. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
  43. package/fesm2022/aeris-ui-core-command-palette.mjs +996 -0
  44. package/fesm2022/aeris-ui-core-command-palette.mjs.map +1 -0
  45. package/fesm2022/aeris-ui-core-compare.mjs +870 -338
  46. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
  47. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +1454 -575
  48. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
  49. package/fesm2022/aeris-ui-core-confirm-popup.mjs +1499 -760
  50. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
  51. package/fesm2022/aeris-ui-core-context-menu.mjs +975 -449
  52. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
  53. package/fesm2022/aeris-ui-core-date-picker-aeris-date-picker-input-jAhzMzLQ.mjs +946 -0
  54. package/fesm2022/aeris-ui-core-date-picker-aeris-date-picker-input-jAhzMzLQ.mjs.map +1 -0
  55. package/fesm2022/aeris-ui-core-date-picker.mjs +2538 -1183
  56. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
  57. package/fesm2022/aeris-ui-core-dialog.mjs +1187 -368
  58. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
  59. package/fesm2022/aeris-ui-core-divider.mjs +204 -43
  60. package/fesm2022/aeris-ui-core-divider.mjs.map +1 -1
  61. package/fesm2022/aeris-ui-core-drawer.mjs +1712 -345
  62. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
  63. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +418 -254
  64. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
  65. package/fesm2022/aeris-ui-core-editor.mjs +1808 -783
  66. package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
  67. package/fesm2022/aeris-ui-core-file-upload.mjs +1529 -536
  68. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
  69. package/fesm2022/aeris-ui-core-filter-service.mjs +258 -301
  70. package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -1
  71. package/fesm2022/aeris-ui-core-fluid.mjs +68 -21
  72. package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
  73. package/fesm2022/aeris-ui-core-focus-trap.mjs +206 -182
  74. package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -1
  75. package/fesm2022/aeris-ui-core-form-field.mjs +688 -0
  76. package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -0
  77. package/fesm2022/aeris-ui-core-galleria.mjs +2821 -1143
  78. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
  79. package/fesm2022/aeris-ui-core-glass.mjs +110 -33
  80. package/fesm2022/aeris-ui-core-glass.mjs.map +1 -1
  81. package/fesm2022/aeris-ui-core-icon-field.mjs +426 -98
  82. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
  83. package/fesm2022/aeris-ui-core-inplace.mjs +496 -132
  84. package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
  85. package/fesm2022/aeris-ui-core-input-group.mjs +413 -107
  86. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
  87. package/fesm2022/aeris-ui-core-input-mask.mjs +713 -257
  88. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
  89. package/fesm2022/aeris-ui-core-input-number.mjs +1095 -297
  90. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
  91. package/fesm2022/aeris-ui-core-input-otp.mjs +678 -264
  92. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
  93. package/fesm2022/aeris-ui-core-input-text.mjs +703 -160
  94. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
  95. package/fesm2022/aeris-ui-core-kbd.mjs +243 -0
  96. package/fesm2022/aeris-ui-core-kbd.mjs.map +1 -0
  97. package/fesm2022/aeris-ui-core-key-filter.mjs +263 -201
  98. package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -1
  99. package/fesm2022/aeris-ui-core-listbox.mjs +789 -0
  100. package/fesm2022/aeris-ui-core-listbox.mjs.map +1 -0
  101. package/fesm2022/aeris-ui-core-mega-menu.mjs +662 -388
  102. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
  103. package/fesm2022/aeris-ui-core-menu.mjs +1111 -478
  104. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
  105. package/fesm2022/aeris-ui-core-menubar.mjs +1081 -411
  106. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
  107. package/fesm2022/aeris-ui-core-message.mjs +513 -147
  108. package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
  109. package/fesm2022/aeris-ui-core-meter-group.mjs +641 -230
  110. package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
  111. package/fesm2022/aeris-ui-core-multi-select.mjs +1832 -577
  112. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
  113. package/fesm2022/aeris-ui-core-navbar.mjs +1407 -0
  114. package/fesm2022/aeris-ui-core-navbar.mjs.map +1 -0
  115. package/fesm2022/aeris-ui-core-order-list.mjs +748 -220
  116. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
  117. package/fesm2022/aeris-ui-core-organization-chart.mjs +521 -201
  118. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
  119. package/fesm2022/aeris-ui-core-paginator.mjs +671 -127
  120. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
  121. package/fesm2022/aeris-ui-core-panel.mjs +602 -210
  122. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
  123. package/fesm2022/aeris-ui-core-password.mjs +1046 -269
  124. package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
  125. package/fesm2022/aeris-ui-core-pick-list.mjs +1796 -703
  126. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
  127. package/fesm2022/aeris-ui-core-popover.mjs +1354 -385
  128. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
  129. package/fesm2022/aeris-ui-core-progress-bar.mjs +609 -182
  130. package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
  131. package/fesm2022/aeris-ui-core-progress-spinner.mjs +428 -133
  132. package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
  133. package/fesm2022/aeris-ui-core-radio-button.mjs +502 -132
  134. package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
  135. package/fesm2022/aeris-ui-core-rating.mjs +506 -231
  136. package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
  137. package/fesm2022/aeris-ui-core-scroll-panel.mjs +457 -154
  138. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
  139. package/fesm2022/aeris-ui-core-scroll-top.mjs +279 -69
  140. package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
  141. package/fesm2022/aeris-ui-core-select-native.mjs +145 -0
  142. package/fesm2022/aeris-ui-core-select-native.mjs.map +1 -0
  143. package/fesm2022/aeris-ui-core-select.mjs +1984 -668
  144. package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
  145. package/fesm2022/aeris-ui-core-sidebar.mjs +1293 -0
  146. package/fesm2022/aeris-ui-core-sidebar.mjs.map +1 -0
  147. package/fesm2022/aeris-ui-core-skeleton.mjs +149 -45
  148. package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -1
  149. package/fesm2022/aeris-ui-core-slider.mjs +884 -430
  150. package/fesm2022/aeris-ui-core-slider.mjs.map +1 -1
  151. package/fesm2022/aeris-ui-core-speed-dial.mjs +882 -337
  152. package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
  153. package/fesm2022/aeris-ui-core-split-button.mjs +972 -268
  154. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
  155. package/fesm2022/aeris-ui-core-splitter.mjs +831 -356
  156. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
  157. package/fesm2022/aeris-ui-core-stepper.mjs +705 -256
  158. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
  159. package/fesm2022/aeris-ui-core-style-class.mjs +587 -342
  160. package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -1
  161. package/fesm2022/aeris-ui-core-table.mjs +2927 -923
  162. package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
  163. package/fesm2022/aeris-ui-core-tabs.mjs +855 -283
  164. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
  165. package/fesm2022/aeris-ui-core-textarea.mjs +919 -221
  166. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
  167. package/fesm2022/aeris-ui-core-theme-builder.mjs +1368 -1407
  168. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
  169. package/fesm2022/aeris-ui-core-theming.mjs +132 -144
  170. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
  171. package/fesm2022/aeris-ui-core-tiered-menu.mjs +966 -447
  172. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
  173. package/fesm2022/aeris-ui-core-timeline.mjs +407 -131
  174. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
  175. package/fesm2022/aeris-ui-core-toast.mjs +1109 -384
  176. package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
  177. package/fesm2022/aeris-ui-core-toggle-switch.mjs +398 -132
  178. package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -1
  179. package/fesm2022/aeris-ui-core-toolbar.mjs +1340 -131
  180. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
  181. package/fesm2022/aeris-ui-core-tooltip.mjs +625 -330
  182. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
  183. package/fesm2022/aeris-ui-core-tree-select.mjs +1650 -627
  184. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
  185. package/fesm2022/aeris-ui-core-tree-table.mjs +2442 -994
  186. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
  187. package/fesm2022/aeris-ui-core-tree.mjs +1257 -670
  188. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
  189. package/fesm2022/aeris-ui-core.mjs +1601 -312
  190. package/fesm2022/aeris-ui-core.mjs.map +1 -1
  191. package/package.json +48 -8
  192. package/schematics/ng-add/schema.json +1 -1
  193. package/schematics/runtime/schematics/ng-add/options.js +4 -4
  194. package/schematics/runtime/schematics/ng-add/options.js.map +1 -1
  195. package/schematics/runtime/schematics/ng-add/workspace.js +1 -1
  196. package/schematics/runtime/schematics/ng-add/workspace.js.map +1 -1
  197. package/schematics/runtime/theme-builder/aeris-color-derivation.js +1 -1
  198. package/schematics/runtime/theme-builder/aeris-contrast.js +38 -17
  199. package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -1
  200. package/schematics/runtime/theme-builder/aeris-foundation.js +13 -8
  201. package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -1
  202. package/schematics/runtime/theme-builder/aeris-semantic-tones.js +33 -23
  203. package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -1
  204. package/schematics/runtime/theme-builder/aeris-theme-generator.js +8 -2
  205. package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -1
  206. package/schematics/runtime/theme-builder/aeris-theme-resolver.js +63 -76
  207. package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -1
  208. package/schematics/runtime/theme-builder/aeris-theme-tokens.js +15 -5
  209. package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -1
  210. package/schematics/runtime/theme-builder/aeris-theme-validation.js +18 -2
  211. package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -1
  212. package/schematics/runtime/theme-builder/aeris-theme.js +121 -34
  213. package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -1
  214. package/styles/_choice-card.scss +93 -0
  215. package/styles/_fallback-colors.scss +10 -0
  216. package/styles/_icon-artwork.scss +14 -0
  217. package/styles/_icon-template.scss +42 -0
  218. package/styles/_mobile.scss +16 -0
  219. package/styles/_selection-icons.scss +12 -0
  220. package/styles/_table-pinning.scss +119 -0
  221. package/styles/_tokens.scss +5 -5
  222. package/styles/aeris.css +447 -137
  223. package/styles/controls.css +205 -35
  224. package/tools/aeris-theme.mjs +4 -4
  225. package/tools/aeris-theme.schema.json +18 -13
  226. package/types/aeris-ui-core-accordion.d.ts +167 -93
  227. package/types/aeris-ui-core-animate-on-scroll.d.ts +72 -31
  228. package/types/aeris-ui-core-auto-complete.d.ts +339 -140
  229. package/types/aeris-ui-core-auto-focus.d.ts +24 -16
  230. package/types/aeris-ui-core-avatar.d.ts +112 -42
  231. package/types/aeris-ui-core-badge.d.ts +160 -46
  232. package/types/aeris-ui-core-block-ui.d.ts +48 -27
  233. package/types/aeris-ui-core-breadcrumb.d.ts +163 -92
  234. package/types/aeris-ui-core-button-forms.d.ts +18 -0
  235. package/types/aeris-ui-core-button-group.d.ts +150 -16
  236. package/types/aeris-ui-core-button.d.ts +274 -67
  237. package/types/aeris-ui-core-card.d.ts +74 -37
  238. package/types/aeris-ui-core-carousel.d.ts +213 -117
  239. package/types/aeris-ui-core-cascade-select.d.ts +275 -123
  240. package/types/aeris-ui-core-chart.d.ts +150 -84
  241. package/types/aeris-ui-core-checkbox.d.ts +173 -54
  242. package/types/aeris-ui-core-chip.d.ts +316 -56
  243. package/types/aeris-ui-core-class-names.d.ts +22 -20
  244. package/types/aeris-ui-core-code-block.d.ts +201 -0
  245. package/types/aeris-ui-core-color-picker.d.ts +450 -143
  246. package/types/aeris-ui-core-command-palette.d.ts +267 -0
  247. package/types/aeris-ui-core-compare.d.ts +230 -102
  248. package/types/aeris-ui-core-confirm-dialog.d.ts +450 -245
  249. package/types/aeris-ui-core-confirm-popup.d.ts +442 -263
  250. package/types/aeris-ui-core-context-menu.d.ts +270 -146
  251. package/types/aeris-ui-core-date-picker.d.ts +594 -219
  252. package/types/aeris-ui-core-dialog.d.ts +301 -117
  253. package/types/aeris-ui-core-divider.d.ts +58 -20
  254. package/types/aeris-ui-core-drawer.d.ts +380 -112
  255. package/types/aeris-ui-core-dynamic-dialog.d.ts +162 -137
  256. package/types/aeris-ui-core-editor.d.ts +257 -123
  257. package/types/aeris-ui-core-file-upload.d.ts +385 -197
  258. package/types/aeris-ui-core-filter-service.d.ts +48 -52
  259. package/types/aeris-ui-core-fluid.d.ts +12 -9
  260. package/types/aeris-ui-core-focus-trap.d.ts +39 -31
  261. package/types/aeris-ui-core-form-field.d.ts +163 -0
  262. package/types/aeris-ui-core-galleria.d.ts +636 -256
  263. package/types/aeris-ui-core-glass.d.ts +24 -11
  264. package/types/aeris-ui-core-icon-field.d.ts +94 -32
  265. package/types/aeris-ui-core-inplace.d.ts +129 -62
  266. package/types/aeris-ui-core-input-group.d.ts +84 -33
  267. package/types/aeris-ui-core-input-mask.d.ts +201 -69
  268. package/types/aeris-ui-core-input-number.d.ts +291 -87
  269. package/types/aeris-ui-core-input-otp.d.ts +191 -81
  270. package/types/aeris-ui-core-input-text.d.ts +195 -60
  271. package/types/aeris-ui-core-kbd.d.ts +74 -0
  272. package/types/aeris-ui-core-key-filter.d.ts +53 -39
  273. package/types/aeris-ui-core-listbox.d.ts +222 -0
  274. package/types/aeris-ui-core-mega-menu.d.ts +181 -121
  275. package/types/aeris-ui-core-menu.d.ts +283 -168
  276. package/types/aeris-ui-core-menubar.d.ts +289 -135
  277. package/types/aeris-ui-core-message.d.ts +138 -60
  278. package/types/aeris-ui-core-meter-group.d.ts +169 -90
  279. package/types/aeris-ui-core-multi-select.d.ts +469 -180
  280. package/types/aeris-ui-core-navbar.d.ts +208 -0
  281. package/types/aeris-ui-core-order-list.d.ts +168 -66
  282. package/types/aeris-ui-core-organization-chart.d.ts +139 -77
  283. package/types/aeris-ui-core-paginator.d.ts +129 -38
  284. package/types/aeris-ui-core-panel.d.ts +149 -78
  285. package/types/aeris-ui-core-password.d.ts +276 -102
  286. package/types/aeris-ui-core-pick-list.d.ts +428 -179
  287. package/types/aeris-ui-core-popover.d.ts +294 -105
  288. package/types/aeris-ui-core-progress-bar.d.ts +163 -73
  289. package/types/aeris-ui-core-progress-spinner.d.ts +116 -48
  290. package/types/aeris-ui-core-radio-button.d.ts +146 -50
  291. package/types/aeris-ui-core-rating.d.ts +149 -76
  292. package/types/aeris-ui-core-scroll-panel.d.ts +142 -64
  293. package/types/aeris-ui-core-scroll-top.d.ts +73 -29
  294. package/types/aeris-ui-core-select-native.d.ts +40 -0
  295. package/types/aeris-ui-core-select.d.ts +487 -217
  296. package/types/aeris-ui-core-sidebar.d.ts +220 -0
  297. package/types/aeris-ui-core-skeleton.d.ts +39 -17
  298. package/types/aeris-ui-core-slider.d.ts +270 -115
  299. package/types/aeris-ui-core-speed-dial.d.ts +241 -111
  300. package/types/aeris-ui-core-split-button.d.ts +267 -113
  301. package/types/aeris-ui-core-splitter.d.ts +224 -106
  302. package/types/aeris-ui-core-stepper.d.ts +184 -91
  303. package/types/aeris-ui-core-style-class.d.ts +141 -71
  304. package/types/aeris-ui-core-table.d.ts +729 -304
  305. package/types/aeris-ui-core-tabs.d.ts +193 -76
  306. package/types/aeris-ui-core-textarea.d.ts +271 -78
  307. package/types/aeris-ui-core-theme-builder.d.ts +220 -463
  308. package/types/aeris-ui-core-theming.d.ts +42 -45
  309. package/types/aeris-ui-core-tiered-menu.d.ts +257 -142
  310. package/types/aeris-ui-core-timeline.d.ts +109 -71
  311. package/types/aeris-ui-core-toast.d.ts +231 -115
  312. package/types/aeris-ui-core-toggle-switch.d.ts +125 -51
  313. package/types/aeris-ui-core-toolbar.d.ts +314 -47
  314. package/types/aeris-ui-core-tooltip.d.ts +157 -88
  315. package/types/aeris-ui-core-tree-select.d.ts +394 -171
  316. package/types/aeris-ui-core-tree-table.d.ts +629 -288
  317. package/types/aeris-ui-core-tree.d.ts +294 -165
  318. package/types/aeris-ui-core.d.ts +338 -74
@@ -1,208 +1,270 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, output, signal, computed, Directive } from '@angular/core';
3
-
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, booleanAttribute, computed, input, output, signal } from "@angular/core";
4
3
  const presetPatterns = {
5
- int: /^-?\d*$/,
6
- pint: /^\d*$/,
7
- num: /^-?(?:\d+)?(?:[.,]\d*)?$/,
8
- pnum: /^(?:\d+)?(?:[.,]\d*)?$/,
9
- hex: /^[\da-f]*$/i,
10
- alpha: /^\p{L}*$/u,
11
- alphanum: /^[\p{L}\p{N}]*$/u,
12
- email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~@-]*$/,
4
+ int: /^-?\d*$/,
5
+ pint: /^\d*$/,
6
+ num: /^-?(?:\d+)?(?:[.,]\d*)?$/,
7
+ pnum: /^(?:\d+)?(?:[.,]\d*)?$/,
8
+ hex: /^[\da-f]*$/i,
9
+ alpha: /^\p{L}*$/u,
10
+ alphanum: /^[\p{L}\p{N}]*$/u,
11
+ email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~@-]*$/
13
12
  };
14
- const editingKeys = new Set([
15
- 'Backspace',
16
- 'Delete',
17
- 'Tab',
18
- 'Enter',
19
- 'Escape',
20
- 'ArrowLeft',
21
- 'ArrowRight',
22
- 'ArrowUp',
23
- 'ArrowDown',
24
- 'Home',
25
- 'End',
26
- 'PageUp',
27
- 'PageDown',
13
+ const editingKeys = /* @__PURE__ */ new Set([
14
+ "Backspace",
15
+ "Delete",
16
+ "Tab",
17
+ "Enter",
18
+ "Escape",
19
+ "ArrowLeft",
20
+ "ArrowRight",
21
+ "ArrowUp",
22
+ "ArrowDown",
23
+ "Home",
24
+ "End",
25
+ "PageUp",
26
+ "PageDown"
28
27
  ]);
29
28
  const INVALID_PATTERN = /(?!)/;
30
29
  const MAX_PATTERN_LENGTH = 2048;
31
- class AerisKeyFilterDirective {
32
- aerisKeyFilter = input('alphanum', /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "aerisKeyFilter" }] : /* istanbul ignore next */ []));
34
- validateOnly = input(false, { ...(ngDevMode ? { debugName: "validateOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
35
- allowPaste = input(true, { ...(ngDevMode ? { debugName: "allowPaste" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
36
- rejected = output();
37
- lastAcceptedValue = signal('', /* @ts-ignore */
38
- ...(ngDevMode ? [{ debugName: "lastAcceptedValue" }] : /* istanbul ignore next */ []));
39
- isComposing = signal(false, /* @ts-ignore */
40
- ...(ngDevMode ? [{ debugName: "isComposing" }] : /* istanbul ignore next */ []));
41
- resolvedPattern = computed(() => this.compilePattern(this.aerisKeyFilter()), /* @ts-ignore */
42
- ...(ngDevMode ? [{ debugName: "resolvedPattern" }] : /* istanbul ignore next */ []));
43
- filterName() {
44
- const filter = this.aerisKeyFilter();
45
- return typeof filter === 'string' ? filter : 'custom';
46
- }
47
- handleCompositionStart() {
48
- this.isComposing.set(true);
49
- }
50
- handleCompositionEnd(event) {
51
- this.isComposing.set(false);
52
- this.handleInput(event);
53
- }
54
- rememberValue(event) {
55
- const control = this.getControl(event);
56
- if (!control)
57
- return;
58
- this.lastAcceptedValue.set(control.value);
59
- }
60
- handleBeforeInput(event) {
61
- const inputEvent = event;
62
- if (this.validateOnly() || this.isComposing())
63
- return;
64
- if (!this.isInsertInput(inputEvent.inputType))
65
- return;
66
- const control = this.getControl(inputEvent);
67
- if (!control)
68
- return;
69
- const data = inputEvent.data ?? '';
70
- if (!data)
71
- return;
72
- const attemptedValue = this.getAttemptedValue(control, data);
73
- if (this.accepts(attemptedValue))
74
- return;
75
- inputEvent.preventDefault();
76
- this.emitRejected(inputEvent, 'input', control.value, attemptedValue);
77
- }
78
- handleKeydown(event) {
79
- const keyboardEvent = event;
80
- if (this.validateOnly() || this.isComposing())
81
- return;
82
- if (keyboardEvent.ctrlKey || keyboardEvent.metaKey || keyboardEvent.altKey)
83
- return;
84
- if (editingKeys.has(keyboardEvent.key))
85
- return;
86
- if (keyboardEvent.key.length !== 1)
87
- return;
88
- const control = this.getControl(keyboardEvent);
89
- if (!control)
90
- return;
91
- const attemptedValue = this.getAttemptedValue(control, keyboardEvent.key);
92
- if (this.accepts(attemptedValue))
93
- return;
94
- keyboardEvent.preventDefault();
95
- this.emitRejected(keyboardEvent, 'key', control.value, attemptedValue);
96
- }
97
- handlePaste(event) {
98
- const clipboardEvent = event;
99
- const control = this.getControl(clipboardEvent);
100
- if (!control)
101
- return;
102
- const pastedText = clipboardEvent.clipboardData?.getData('text') ?? '';
103
- const attemptedValue = this.getAttemptedValue(control, pastedText);
104
- const accepted = this.accepts(attemptedValue);
105
- if (!this.allowPaste()) {
106
- clipboardEvent.preventDefault();
107
- this.emitRejected(clipboardEvent, 'paste', control.value, attemptedValue);
108
- return;
109
- }
110
- if (!accepted) {
111
- this.emitRejected(clipboardEvent, 'paste', control.value, attemptedValue);
112
- if (!this.validateOnly()) {
113
- clipboardEvent.preventDefault();
114
- }
115
- }
116
- }
117
- handleInput(event) {
118
- const control = this.getControl(event);
119
- if (!control || this.isComposing())
120
- return;
121
- if (this.accepts(control.value)) {
122
- this.lastAcceptedValue.set(control.value);
123
- return;
124
- }
125
- this.emitRejected(event, 'input', control.value, control.value);
126
- if (this.validateOnly())
127
- return;
128
- const previousValue = this.lastAcceptedValue();
129
- control.value = previousValue;
130
- control.dispatchEvent(new Event('input', { bubbles: true }));
131
- }
132
- accepts(value) {
133
- const pattern = this.resolvedPattern();
134
- pattern.lastIndex = 0;
135
- return pattern.test(value);
136
- }
137
- compilePattern(filter) {
138
- if (filter instanceof RegExp) {
139
- if (filter.source.length > MAX_PATTERN_LENGTH)
140
- return INVALID_PATTERN;
141
- try {
142
- return new RegExp(filter.source, filter.flags.replace(/[gy]/gu, ''));
143
- }
144
- catch {
145
- return INVALID_PATTERN;
146
- }
147
- }
148
- if (this.isPreset(filter)) {
149
- return presetPatterns[filter];
150
- }
151
- if (filter.length > MAX_PATTERN_LENGTH)
152
- return INVALID_PATTERN;
153
- try {
154
- return new RegExp(filter);
155
- }
156
- catch {
157
- return INVALID_PATTERN;
158
- }
159
- }
160
- isPreset(value) {
161
- return Object.prototype.hasOwnProperty.call(presetPatterns, value);
162
- }
163
- isInsertInput(inputType) {
164
- return inputType === 'insertText' || inputType === 'insertCompositionText';
165
- }
166
- getAttemptedValue(control, text) {
167
- const value = control.value;
168
- const selectionStart = control.selectionStart ?? value.length;
169
- const selectionEnd = control.selectionEnd ?? selectionStart;
170
- return `${value.slice(0, selectionStart)}${text}${value.slice(selectionEnd)}`;
171
- }
172
- getControl(event) {
173
- const target = event.target;
174
- if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {
175
- return target;
176
- }
177
- return null;
178
- }
179
- emitRejected(originalEvent, reason, value, attemptedValue) {
180
- this.rejected.emit({ originalEvent, reason, value, attemptedValue });
181
- }
182
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisKeyFilterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
183
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: AerisKeyFilterDirective, isStandalone: true, selector: "input[aerisKeyFilter], textarea[aerisKeyFilter]", inputs: { aerisKeyFilter: { classPropertyName: "aerisKeyFilter", publicName: "aerisKeyFilter", isSignal: true, isRequired: false, transformFunction: null }, validateOnly: { classPropertyName: "validateOnly", publicName: "validateOnly", isSignal: true, isRequired: false, transformFunction: null }, allowPaste: { classPropertyName: "allowPaste", publicName: "allowPaste", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rejected: "rejected" }, host: { listeners: { "beforeinput": "handleBeforeInput($event)", "keydown": "handleKeydown($event)", "paste": "handlePaste($event)", "input": "handleInput($event)", "compositionstart": "handleCompositionStart()", "compositionend": "handleCompositionEnd($event)", "focus": "rememberValue($event)" }, properties: { "attr.data-aeris-key-filter": "filterName()" } }, ngImport: i0 });
184
- }
185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisKeyFilterDirective, decorators: [{
186
- type: Directive,
187
- args: [{
188
- selector: 'input[aerisKeyFilter], textarea[aerisKeyFilter]',
189
- host: {
190
- '[attr.data-aeris-key-filter]': 'filterName()',
191
- '(beforeinput)': 'handleBeforeInput($event)',
192
- '(keydown)': 'handleKeydown($event)',
193
- '(paste)': 'handlePaste($event)',
194
- '(input)': 'handleInput($event)',
195
- '(compositionstart)': 'handleCompositionStart()',
196
- '(compositionend)': 'handleCompositionEnd($event)',
197
- '(focus)': 'rememberValue($event)',
198
- },
199
- }]
200
- }], propDecorators: { aerisKeyFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "aerisKeyFilter", required: false }] }], validateOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "validateOnly", required: false }] }], allowPaste: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowPaste", required: false }] }], rejected: [{ type: i0.Output, args: ["rejected"] }] } });
30
+ var AerisKeyFilterDirective = class AerisKeyFilterDirective {
31
+ aerisKeyFilter = input("alphanum", ...ngDevMode ? [{ debugName: "aerisKeyFilter" }] : /* istanbul ignore next */ []);
32
+ validateOnly = input(false, {
33
+ ...ngDevMode ? { debugName: "validateOnly" } : /* istanbul ignore next */ {},
34
+ transform: booleanAttribute
35
+ });
36
+ allowPaste = input(true, {
37
+ ...ngDevMode ? { debugName: "allowPaste" } : /* istanbul ignore next */ {},
38
+ transform: booleanAttribute
39
+ });
40
+ rejected = output();
41
+ lastAcceptedValue = signal("", ...ngDevMode ? [{ debugName: "lastAcceptedValue" }] : /* istanbul ignore next */ []);
42
+ isComposing = signal(false, ...ngDevMode ? [{ debugName: "isComposing" }] : /* istanbul ignore next */ []);
43
+ resolvedPattern = computed(() => this.compilePattern(this.aerisKeyFilter()), ...ngDevMode ? [{ debugName: "resolvedPattern" }] : /* istanbul ignore next */ []);
44
+ filterName() {
45
+ const filter = this.aerisKeyFilter();
46
+ return typeof filter === "string" ? filter : "custom";
47
+ }
48
+ handleCompositionStart() {
49
+ this.isComposing.set(true);
50
+ }
51
+ handleCompositionEnd(event) {
52
+ this.isComposing.set(false);
53
+ this.handleInput(event);
54
+ }
55
+ rememberValue(event) {
56
+ const control = this.getControl(event);
57
+ if (!control) return;
58
+ this.lastAcceptedValue.set(control.value);
59
+ }
60
+ handleBeforeInput(event) {
61
+ const inputEvent = event;
62
+ if (this.validateOnly() || this.isComposing()) return;
63
+ if (!this.isInsertInput(inputEvent.inputType)) return;
64
+ const control = this.getControl(inputEvent);
65
+ if (!control) return;
66
+ const data = inputEvent.data ?? "";
67
+ if (!data) return;
68
+ const attemptedValue = this.getAttemptedValue(control, data);
69
+ if (this.accepts(attemptedValue)) return;
70
+ inputEvent.preventDefault();
71
+ this.emitRejected(inputEvent, "input", control.value, attemptedValue);
72
+ }
73
+ handleKeydown(event) {
74
+ const keyboardEvent = event;
75
+ if (this.validateOnly() || this.isComposing()) return;
76
+ if (keyboardEvent.ctrlKey || keyboardEvent.metaKey || keyboardEvent.altKey) return;
77
+ if (editingKeys.has(keyboardEvent.key)) return;
78
+ if (keyboardEvent.key.length !== 1) return;
79
+ const control = this.getControl(keyboardEvent);
80
+ if (!control) return;
81
+ const attemptedValue = this.getAttemptedValue(control, keyboardEvent.key);
82
+ if (this.accepts(attemptedValue)) return;
83
+ keyboardEvent.preventDefault();
84
+ this.emitRejected(keyboardEvent, "key", control.value, attemptedValue);
85
+ }
86
+ handlePaste(event) {
87
+ const clipboardEvent = event;
88
+ const control = this.getControl(clipboardEvent);
89
+ if (!control) return;
90
+ const pastedText = clipboardEvent.clipboardData?.getData("text") ?? "";
91
+ const attemptedValue = this.getAttemptedValue(control, pastedText);
92
+ const accepted = this.accepts(attemptedValue);
93
+ if (!this.allowPaste()) {
94
+ clipboardEvent.preventDefault();
95
+ this.emitRejected(clipboardEvent, "paste", control.value, attemptedValue);
96
+ return;
97
+ }
98
+ if (!accepted) {
99
+ this.emitRejected(clipboardEvent, "paste", control.value, attemptedValue);
100
+ if (!this.validateOnly()) clipboardEvent.preventDefault();
101
+ }
102
+ }
103
+ handleInput(event) {
104
+ const control = this.getControl(event);
105
+ if (!control || this.isComposing()) return;
106
+ if (this.accepts(control.value)) {
107
+ this.lastAcceptedValue.set(control.value);
108
+ return;
109
+ }
110
+ this.emitRejected(event, "input", control.value, control.value);
111
+ if (this.validateOnly()) return;
112
+ control.value = this.lastAcceptedValue();
113
+ control.dispatchEvent(new Event("input", { bubbles: true }));
114
+ }
115
+ accepts(value) {
116
+ const pattern = this.resolvedPattern();
117
+ pattern.lastIndex = 0;
118
+ return pattern.test(value);
119
+ }
120
+ compilePattern(filter) {
121
+ if (filter instanceof RegExp) {
122
+ if (filter.source.length > MAX_PATTERN_LENGTH) return INVALID_PATTERN;
123
+ try {
124
+ return new RegExp(filter.source, filter.flags.replace(/[gy]/gu, ""));
125
+ } catch {
126
+ return INVALID_PATTERN;
127
+ }
128
+ }
129
+ if (this.isPreset(filter)) return presetPatterns[filter];
130
+ if (filter.length > MAX_PATTERN_LENGTH) return INVALID_PATTERN;
131
+ try {
132
+ return new RegExp(filter);
133
+ } catch {
134
+ return INVALID_PATTERN;
135
+ }
136
+ }
137
+ isPreset(value) {
138
+ return Object.prototype.hasOwnProperty.call(presetPatterns, value);
139
+ }
140
+ isInsertInput(inputType) {
141
+ return inputType === "insertText" || inputType === "insertCompositionText";
142
+ }
143
+ getAttemptedValue(control, text) {
144
+ const value = control.value;
145
+ const selectionStart = control.selectionStart ?? value.length;
146
+ const selectionEnd = control.selectionEnd ?? selectionStart;
147
+ return `${value.slice(0, selectionStart)}${text}${value.slice(selectionEnd)}`;
148
+ }
149
+ getControl(event) {
150
+ const target = event.target;
151
+ if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return target;
152
+ return null;
153
+ }
154
+ emitRejected(originalEvent, reason, value, attemptedValue) {
155
+ this.rejected.emit({
156
+ originalEvent,
157
+ reason,
158
+ value,
159
+ attemptedValue
160
+ });
161
+ }
162
+ static ɵfac = i0.ɵɵngDeclareFactory({
163
+ minVersion: "12.0.0",
164
+ version: "22.2.3",
165
+ ngImport: i0,
166
+ type: AerisKeyFilterDirective,
167
+ deps: [],
168
+ target: i0.ɵɵFactoryTarget.Directive
169
+ });
170
+ static ɵdir = i0.ɵɵngDeclareDirective({
171
+ minVersion: "17.1.0",
172
+ version: "22.2.3",
173
+ type: AerisKeyFilterDirective,
174
+ isStandalone: true,
175
+ selector: "input[aerisKeyFilter], textarea[aerisKeyFilter]",
176
+ inputs: {
177
+ aerisKeyFilter: {
178
+ classPropertyName: "aerisKeyFilter",
179
+ publicName: "aerisKeyFilter",
180
+ isSignal: true,
181
+ isRequired: false,
182
+ transformFunction: null
183
+ },
184
+ validateOnly: {
185
+ classPropertyName: "validateOnly",
186
+ publicName: "validateOnly",
187
+ isSignal: true,
188
+ isRequired: false,
189
+ transformFunction: null
190
+ },
191
+ allowPaste: {
192
+ classPropertyName: "allowPaste",
193
+ publicName: "allowPaste",
194
+ isSignal: true,
195
+ isRequired: false,
196
+ transformFunction: null
197
+ }
198
+ },
199
+ outputs: { rejected: "rejected" },
200
+ host: {
201
+ listeners: {
202
+ "beforeinput": "handleBeforeInput($event)",
203
+ "keydown": "handleKeydown($event)",
204
+ "paste": "handlePaste($event)",
205
+ "input": "handleInput($event)",
206
+ "compositionstart": "handleCompositionStart()",
207
+ "compositionend": "handleCompositionEnd($event)",
208
+ "focus": "rememberValue($event)"
209
+ },
210
+ properties: { "attr.data-aeris-key-filter": "filterName()" }
211
+ },
212
+ ngImport: i0
213
+ });
214
+ };
215
+ i0.ɵɵngDeclareClassMetadata({
216
+ minVersion: "12.0.0",
217
+ version: "22.2.3",
218
+ ngImport: i0,
219
+ type: AerisKeyFilterDirective,
220
+ decorators: [{
221
+ type: Directive,
222
+ args: [{
223
+ selector: "input[aerisKeyFilter], textarea[aerisKeyFilter]",
224
+ host: {
225
+ "[attr.data-aeris-key-filter]": "filterName()",
226
+ "(beforeinput)": "handleBeforeInput($event)",
227
+ "(keydown)": "handleKeydown($event)",
228
+ "(paste)": "handlePaste($event)",
229
+ "(input)": "handleInput($event)",
230
+ "(compositionstart)": "handleCompositionStart()",
231
+ "(compositionend)": "handleCompositionEnd($event)",
232
+ "(focus)": "rememberValue($event)"
233
+ }
234
+ }]
235
+ }],
236
+ propDecorators: {
237
+ aerisKeyFilter: [{
238
+ type: i0.Input,
239
+ args: [{
240
+ isSignal: true,
241
+ alias: "aerisKeyFilter",
242
+ required: false
243
+ }]
244
+ }],
245
+ validateOnly: [{
246
+ type: i0.Input,
247
+ args: [{
248
+ isSignal: true,
249
+ alias: "validateOnly",
250
+ required: false
251
+ }]
252
+ }],
253
+ allowPaste: [{
254
+ type: i0.Input,
255
+ args: [{
256
+ isSignal: true,
257
+ alias: "allowPaste",
258
+ required: false
259
+ }]
260
+ }],
261
+ rejected: [{
262
+ type: i0.Output,
263
+ args: ["rejected"]
264
+ }]
265
+ }
266
+ });
201
267
  const AerisKeyFilter = [AerisKeyFilterDirective];
202
-
203
- /**
204
- * Generated bundle index. Do not edit.
205
- */
206
-
207
268
  export { AerisKeyFilter, AerisKeyFilterDirective };
208
- //# sourceMappingURL=aeris-ui-core-key-filter.mjs.map
269
+
270
+ //# sourceMappingURL=aeris-ui-core-key-filter.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"aeris-ui-core-key-filter.mjs","sources":["../../../projects/aeris-ui/key-filter/aeris-key-filter.ts","../../../projects/aeris-ui/key-filter/aeris-ui-core-key-filter.ts"],"sourcesContent":["import {\n Directive,\n booleanAttribute,\n computed,\n input,\n output,\n signal,\n} from '@angular/core';\n\nexport type AerisKeyFilterPreset =\n | 'int'\n | 'pint'\n | 'num'\n | 'pnum'\n | 'hex'\n | 'alpha'\n | 'alphanum'\n | 'email';\n\nexport type AerisKeyFilterPattern = AerisKeyFilterPreset | RegExp | string;\nexport type AerisKeyFilterRejectReason = 'key' | 'paste' | 'input';\n\nexport interface AerisKeyFilterRejectEvent {\n readonly originalEvent: KeyboardEvent | ClipboardEvent | InputEvent | CompositionEvent;\n readonly reason: AerisKeyFilterRejectReason;\n readonly value: string;\n readonly attemptedValue: string;\n}\n\nconst presetPatterns: Readonly<Record<AerisKeyFilterPreset, RegExp>> = {\n int: /^-?\\d*$/,\n pint: /^\\d*$/,\n num: /^-?(?:\\d+)?(?:[.,]\\d*)?$/,\n pnum: /^(?:\\d+)?(?:[.,]\\d*)?$/,\n hex: /^[\\da-f]*$/i,\n alpha: /^\\p{L}*$/u,\n alphanum: /^[\\p{L}\\p{N}]*$/u,\n email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~@-]*$/,\n};\n\nconst editingKeys = new Set([\n 'Backspace',\n 'Delete',\n 'Tab',\n 'Enter',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n 'PageUp',\n 'PageDown',\n]);\nconst INVALID_PATTERN = /(?!)/;\nconst MAX_PATTERN_LENGTH = 2048;\n\n@Directive({\n selector: 'input[aerisKeyFilter], textarea[aerisKeyFilter]',\n host: {\n '[attr.data-aeris-key-filter]': 'filterName()',\n '(beforeinput)': 'handleBeforeInput($event)',\n '(keydown)': 'handleKeydown($event)',\n '(paste)': 'handlePaste($event)',\n '(input)': 'handleInput($event)',\n '(compositionstart)': 'handleCompositionStart()',\n '(compositionend)': 'handleCompositionEnd($event)',\n '(focus)': 'rememberValue($event)',\n },\n})\nexport class AerisKeyFilterDirective {\n readonly aerisKeyFilter = input<AerisKeyFilterPattern>('alphanum');\n readonly validateOnly = input(false, { transform: booleanAttribute });\n readonly allowPaste = input(true, { transform: booleanAttribute });\n\n readonly rejected = output<AerisKeyFilterRejectEvent>();\n\n private readonly lastAcceptedValue = signal('');\n private readonly isComposing = signal(false);\n private readonly resolvedPattern = computed(() => this.compilePattern(this.aerisKeyFilter()));\n\n protected filterName(): string {\n const filter = this.aerisKeyFilter();\n return typeof filter === 'string' ? filter : 'custom';\n }\n\n protected handleCompositionStart(): void {\n this.isComposing.set(true);\n }\n\n protected handleCompositionEnd(event: Event): void {\n this.isComposing.set(false);\n this.handleInput(event);\n }\n\n protected rememberValue(event: Event): void {\n const control = this.getControl(event);\n if (!control) return;\n this.lastAcceptedValue.set(control.value);\n }\n\n protected handleBeforeInput(event: Event): void {\n const inputEvent = event as InputEvent;\n if (this.validateOnly() || this.isComposing()) return;\n if (!this.isInsertInput(inputEvent.inputType)) return;\n\n const control = this.getControl(inputEvent);\n if (!control) return;\n\n const data = inputEvent.data ?? '';\n if (!data) return;\n\n const attemptedValue = this.getAttemptedValue(control, data);\n if (this.accepts(attemptedValue)) return;\n\n inputEvent.preventDefault();\n this.emitRejected(inputEvent, 'input', control.value, attemptedValue);\n }\n\n protected handleKeydown(event: Event): void {\n const keyboardEvent = event as KeyboardEvent;\n if (this.validateOnly() || this.isComposing()) return;\n if (keyboardEvent.ctrlKey || keyboardEvent.metaKey || keyboardEvent.altKey) return;\n if (editingKeys.has(keyboardEvent.key)) return;\n if (keyboardEvent.key.length !== 1) return;\n\n const control = this.getControl(keyboardEvent);\n if (!control) return;\n\n const attemptedValue = this.getAttemptedValue(control, keyboardEvent.key);\n if (this.accepts(attemptedValue)) return;\n\n keyboardEvent.preventDefault();\n this.emitRejected(keyboardEvent, 'key', control.value, attemptedValue);\n }\n\n protected handlePaste(event: Event): void {\n const clipboardEvent = event as ClipboardEvent;\n const control = this.getControl(clipboardEvent);\n if (!control) return;\n\n const pastedText = clipboardEvent.clipboardData?.getData('text') ?? '';\n const attemptedValue = this.getAttemptedValue(control, pastedText);\n\n const accepted = this.accepts(attemptedValue);\n\n if (!this.allowPaste()) {\n clipboardEvent.preventDefault();\n this.emitRejected(clipboardEvent, 'paste', control.value, attemptedValue);\n return;\n }\n\n if (!accepted) {\n this.emitRejected(clipboardEvent, 'paste', control.value, attemptedValue);\n\n if (!this.validateOnly()) {\n clipboardEvent.preventDefault();\n }\n }\n }\n\n protected handleInput(event: Event): void {\n const control = this.getControl(event);\n if (!control || this.isComposing()) return;\n\n if (this.accepts(control.value)) {\n this.lastAcceptedValue.set(control.value);\n return;\n }\n\n this.emitRejected(event as InputEvent | CompositionEvent, 'input', control.value, control.value);\n\n if (this.validateOnly()) return;\n\n const previousValue = this.lastAcceptedValue();\n control.value = previousValue;\n control.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n private accepts(value: string): boolean {\n const pattern = this.resolvedPattern();\n pattern.lastIndex = 0;\n return pattern.test(value);\n }\n\n private compilePattern(filter: AerisKeyFilterPattern): RegExp {\n if (filter instanceof RegExp) {\n if (filter.source.length > MAX_PATTERN_LENGTH) return INVALID_PATTERN;\n try {\n return new RegExp(filter.source, filter.flags.replace(/[gy]/gu, ''));\n } catch {\n return INVALID_PATTERN;\n }\n }\n\n if (this.isPreset(filter)) {\n return presetPatterns[filter];\n }\n\n if (filter.length > MAX_PATTERN_LENGTH) return INVALID_PATTERN;\n try {\n return new RegExp(filter);\n } catch {\n return INVALID_PATTERN;\n }\n }\n\n private isPreset(value: string): value is AerisKeyFilterPreset {\n return Object.prototype.hasOwnProperty.call(presetPatterns, value);\n }\n\n private isInsertInput(inputType: string): boolean {\n return inputType === 'insertText' || inputType === 'insertCompositionText';\n }\n\n private getAttemptedValue(\n control: HTMLInputElement | HTMLTextAreaElement,\n text: string,\n ): string {\n const value = control.value;\n const selectionStart = control.selectionStart ?? value.length;\n const selectionEnd = control.selectionEnd ?? selectionStart;\n return `${value.slice(0, selectionStart)}${text}${value.slice(selectionEnd)}`;\n }\n\n private getControl(event: Event): HTMLInputElement | HTMLTextAreaElement | null {\n const target = event.target;\n\n if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {\n return target;\n }\n\n return null;\n }\n\n private emitRejected(\n originalEvent: KeyboardEvent | ClipboardEvent | InputEvent | CompositionEvent,\n reason: AerisKeyFilterRejectReason,\n value: string,\n attemptedValue: string,\n ): void {\n this.rejected.emit({ originalEvent, reason, value, attemptedValue });\n }\n}\n\nexport const AerisKeyFilter = [AerisKeyFilterDirective] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AA6BA,MAAM,cAAc,GAAmD;AACrE,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,IAAI,EAAE,OAAO;AACb,IAAA,GAAG,EAAE,0BAA0B;AAC/B,IAAA,IAAI,EAAE,wBAAwB;AAC9B,IAAA,GAAG,EAAE,aAAa;AAClB,IAAA,KAAK,EAAE,WAAW;AAClB,IAAA,QAAQ,EAAE,kBAAkB;AAC5B,IAAA,KAAK,EAAE,qCAAqC;CAC7C;AAED,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,WAAW;IACX,QAAQ;IACR,KAAK;IACL,OAAO;IACP,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,SAAS;IACT,WAAW;IACX,MAAM;IACN,KAAK;IACL,QAAQ;IACR,UAAU;AACX,CAAA,CAAC;AACF,MAAM,eAAe,GAAG,MAAM;AAC9B,MAAM,kBAAkB,GAAG,IAAI;MAelB,uBAAuB,CAAA;IACzB,cAAc,GAAG,KAAK,CAAwB,UAAU;uFAAC;IACzD,YAAY,GAAG,KAAK,CAAC,KAAK,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n booleanAttribute,\n computed,\n input,\n output,\n signal,\n} from '@angular/core';\n\nexport type AerisKeyFilterPreset =\n | 'int'\n | 'pint'\n | 'num'\n | 'pnum'\n | 'hex'\n | 'alpha'\n | 'alphanum'\n | 'email';\n\nexport type AerisKeyFilterPattern = AerisKeyFilterPreset | RegExp | string;\nexport type AerisKeyFilterRejectReason = 'key' | 'paste' | 'input';\n\nexport interface AerisKeyFilterRejectEvent {\n readonly originalEvent: KeyboardEvent | ClipboardEvent | InputEvent | CompositionEvent;\n readonly reason: AerisKeyFilterRejectReason;\n readonly value: string;\n readonly attemptedValue: string;\n}\n\nconst presetPatterns: Readonly<Record<AerisKeyFilterPreset, RegExp>> = {\n int: /^-?\\d*$/,\n pint: /^\\d*$/,\n num: /^-?(?:\\d+)?(?:[.,]\\d*)?$/,\n pnum: /^(?:\\d+)?(?:[.,]\\d*)?$/,\n hex: /^[\\da-f]*$/i,\n alpha: /^\\p{L}*$/u,\n alphanum: /^[\\p{L}\\p{N}]*$/u,\n email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~@-]*$/,\n};\n\nconst editingKeys = new Set([\n 'Backspace',\n 'Delete',\n 'Tab',\n 'Enter',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Home',\n 'End',\n 'PageUp',\n 'PageDown',\n]);\nconst INVALID_PATTERN = /(?!)/;\nconst MAX_PATTERN_LENGTH = 2048;\n\n@Directive({\n selector: 'input[aerisKeyFilter], textarea[aerisKeyFilter]',\n host: {\n '[attr.data-aeris-key-filter]': 'filterName()',\n '(beforeinput)': 'handleBeforeInput($event)',\n '(keydown)': 'handleKeydown($event)',\n '(paste)': 'handlePaste($event)',\n '(input)': 'handleInput($event)',\n '(compositionstart)': 'handleCompositionStart()',\n '(compositionend)': 'handleCompositionEnd($event)',\n '(focus)': 'rememberValue($event)',\n },\n})\nexport class AerisKeyFilterDirective {\n readonly aerisKeyFilter = input<AerisKeyFilterPattern>('alphanum');\n readonly validateOnly = input(false, { transform: booleanAttribute });\n readonly allowPaste = input(true, { transform: booleanAttribute });\n\n readonly rejected = output<AerisKeyFilterRejectEvent>();\n\n private readonly lastAcceptedValue = signal('');\n private readonly isComposing = signal(false);\n private readonly resolvedPattern = computed(() => this.compilePattern(this.aerisKeyFilter()));\n\n protected filterName(): string {\n const filter = this.aerisKeyFilter();\n return typeof filter === 'string' ? filter : 'custom';\n }\n\n protected handleCompositionStart(): void {\n this.isComposing.set(true);\n }\n\n protected handleCompositionEnd(event: Event): void {\n this.isComposing.set(false);\n this.handleInput(event);\n }\n\n protected rememberValue(event: Event): void {\n const control = this.getControl(event);\n if (!control) return;\n this.lastAcceptedValue.set(control.value);\n }\n\n protected handleBeforeInput(event: Event): void {\n const inputEvent = event as InputEvent;\n if (this.validateOnly() || this.isComposing()) return;\n if (!this.isInsertInput(inputEvent.inputType)) return;\n\n const control = this.getControl(inputEvent);\n if (!control) return;\n\n const data = inputEvent.data ?? '';\n if (!data) return;\n\n const attemptedValue = this.getAttemptedValue(control, data);\n if (this.accepts(attemptedValue)) return;\n\n inputEvent.preventDefault();\n this.emitRejected(inputEvent, 'input', control.value, attemptedValue);\n }\n\n protected handleKeydown(event: Event): void {\n const keyboardEvent = event as KeyboardEvent;\n if (this.validateOnly() || this.isComposing()) return;\n if (keyboardEvent.ctrlKey || keyboardEvent.metaKey || keyboardEvent.altKey) return;\n if (editingKeys.has(keyboardEvent.key)) return;\n if (keyboardEvent.key.length !== 1) return;\n\n const control = this.getControl(keyboardEvent);\n if (!control) return;\n\n const attemptedValue = this.getAttemptedValue(control, keyboardEvent.key);\n if (this.accepts(attemptedValue)) return;\n\n keyboardEvent.preventDefault();\n this.emitRejected(keyboardEvent, 'key', control.value, attemptedValue);\n }\n\n protected handlePaste(event: Event): void {\n const clipboardEvent = event as ClipboardEvent;\n const control = this.getControl(clipboardEvent);\n if (!control) return;\n\n const pastedText = clipboardEvent.clipboardData?.getData('text') ?? '';\n const attemptedValue = this.getAttemptedValue(control, pastedText);\n\n const accepted = this.accepts(attemptedValue);\n\n if (!this.allowPaste()) {\n clipboardEvent.preventDefault();\n this.emitRejected(clipboardEvent, 'paste', control.value, attemptedValue);\n return;\n }\n\n if (!accepted) {\n this.emitRejected(clipboardEvent, 'paste', control.value, attemptedValue);\n\n if (!this.validateOnly()) {\n clipboardEvent.preventDefault();\n }\n }\n }\n\n protected handleInput(event: Event): void {\n const control = this.getControl(event);\n if (!control || this.isComposing()) return;\n\n if (this.accepts(control.value)) {\n this.lastAcceptedValue.set(control.value);\n return;\n }\n\n this.emitRejected(event as InputEvent | CompositionEvent, 'input', control.value, control.value);\n\n if (this.validateOnly()) return;\n\n const previousValue = this.lastAcceptedValue();\n control.value = previousValue;\n control.dispatchEvent(new Event('input', { bubbles: true }));\n }\n\n private accepts(value: string): boolean {\n const pattern = this.resolvedPattern();\n pattern.lastIndex = 0;\n return pattern.test(value);\n }\n\n private compilePattern(filter: AerisKeyFilterPattern): RegExp {\n if (filter instanceof RegExp) {\n if (filter.source.length > MAX_PATTERN_LENGTH) return INVALID_PATTERN;\n try {\n return new RegExp(filter.source, filter.flags.replace(/[gy]/gu, ''));\n } catch {\n return INVALID_PATTERN;\n }\n }\n\n if (this.isPreset(filter)) {\n return presetPatterns[filter];\n }\n\n if (filter.length > MAX_PATTERN_LENGTH) return INVALID_PATTERN;\n try {\n return new RegExp(filter);\n } catch {\n return INVALID_PATTERN;\n }\n }\n\n private isPreset(value: string): value is AerisKeyFilterPreset {\n return Object.prototype.hasOwnProperty.call(presetPatterns, value);\n }\n\n private isInsertInput(inputType: string): boolean {\n return inputType === 'insertText' || inputType === 'insertCompositionText';\n }\n\n private getAttemptedValue(\n control: HTMLInputElement | HTMLTextAreaElement,\n text: string,\n ): string {\n const value = control.value;\n const selectionStart = control.selectionStart ?? value.length;\n const selectionEnd = control.selectionEnd ?? selectionStart;\n return `${value.slice(0, selectionStart)}${text}${value.slice(selectionEnd)}`;\n }\n\n private getControl(event: Event): HTMLInputElement | HTMLTextAreaElement | null {\n const target = event.target;\n\n if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {\n return target;\n }\n\n return null;\n }\n\n private emitRejected(\n originalEvent: KeyboardEvent | ClipboardEvent | InputEvent | CompositionEvent,\n reason: AerisKeyFilterRejectReason,\n value: string,\n attemptedValue: string,\n ): void {\n this.rejected.emit({ originalEvent, reason, value, attemptedValue });\n }\n}\n\nexport const AerisKeyFilter = [AerisKeyFilterDirective] as const;\n"],"mappings":";;AA6BA,MAAM,iBAAiE;CACrE,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACN,KAAK;CACL,OAAO;CACP,UAAU;CACV,OAAO;AACR;AAED,MAAM,8BAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAA;AACD,MAAM,kBAAkB;AACxB,MAAM,qBAAqB;AAe3B,IAAa,0BAAb,MAAa,wBAAuB;CACzB,iBAAiB,MAA6B,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;CACzD,eAAe,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,eAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CACzD,aAAa,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,aAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAEtD,WAAW,OAAM;CAET,oBAAoB,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;CAC9B,cAAc,OAAO,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,kBAAkB,eAAe,KAAK,eAAe,KAAK,eAAc,CAAE,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;CAEnF,aAAU;EACl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