@aeris-ui/core 22.0.0-alpha.8 → 22.0.0-alpha.9

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 (257) hide show
  1. package/README.md +2 -2
  2. package/fesm2022/aeris-ui-core-accordion.mjs +646 -255
  3. package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -1
  4. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +284 -103
  5. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -1
  6. package/fesm2022/aeris-ui-core-auto-complete.mjs +1171 -428
  7. package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
  8. package/fesm2022/aeris-ui-core-auto-focus.mjs +111 -61
  9. package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -1
  10. package/fesm2022/aeris-ui-core-avatar.mjs +383 -101
  11. package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
  12. package/fesm2022/aeris-ui-core-badge.mjs +562 -115
  13. package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
  14. package/fesm2022/aeris-ui-core-block-ui.mjs +205 -101
  15. package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
  16. package/fesm2022/aeris-ui-core-breadcrumb.mjs +547 -177
  17. package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
  18. package/fesm2022/aeris-ui-core-button-group.mjs +153 -38
  19. package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
  20. package/fesm2022/aeris-ui-core-button.mjs +730 -110
  21. package/fesm2022/aeris-ui-core-button.mjs.map +1 -1
  22. package/fesm2022/aeris-ui-core-card.mjs +371 -101
  23. package/fesm2022/aeris-ui-core-card.mjs.map +1 -1
  24. package/fesm2022/aeris-ui-core-carousel.mjs +690 -353
  25. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
  26. package/fesm2022/aeris-ui-core-cascade-select.mjs +915 -423
  27. package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
  28. package/fesm2022/aeris-ui-core-chart.mjs +455 -258
  29. package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
  30. package/fesm2022/aeris-ui-core-checkbox.mjs +432 -135
  31. package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -1
  32. package/fesm2022/aeris-ui-core-chip.mjs +430 -117
  33. package/fesm2022/aeris-ui-core-chip.mjs.map +1 -1
  34. package/fesm2022/aeris-ui-core-class-names.mjs +87 -65
  35. package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -1
  36. package/fesm2022/aeris-ui-core-color-picker.mjs +1313 -683
  37. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
  38. package/fesm2022/aeris-ui-core-compare.mjs +819 -310
  39. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
  40. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +1392 -551
  41. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
  42. package/fesm2022/aeris-ui-core-confirm-popup.mjs +1447 -744
  43. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
  44. package/fesm2022/aeris-ui-core-context-menu.mjs +900 -450
  45. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
  46. package/fesm2022/aeris-ui-core-date-picker.mjs +1656 -863
  47. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
  48. package/fesm2022/aeris-ui-core-dialog.mjs +1066 -355
  49. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
  50. package/fesm2022/aeris-ui-core-divider.mjs +204 -43
  51. package/fesm2022/aeris-ui-core-divider.mjs.map +1 -1
  52. package/fesm2022/aeris-ui-core-drawer.mjs +1002 -326
  53. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
  54. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +402 -249
  55. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
  56. package/fesm2022/aeris-ui-core-editor.mjs +934 -572
  57. package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
  58. package/fesm2022/aeris-ui-core-file-upload.mjs +1313 -511
  59. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
  60. package/fesm2022/aeris-ui-core-filter-service.mjs +258 -301
  61. package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -1
  62. package/fesm2022/aeris-ui-core-fluid.mjs +68 -21
  63. package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
  64. package/fesm2022/aeris-ui-core-focus-trap.mjs +206 -182
  65. package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -1
  66. package/fesm2022/aeris-ui-core-form-field.mjs +672 -170
  67. package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -1
  68. package/fesm2022/aeris-ui-core-galleria.mjs +1987 -797
  69. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
  70. package/fesm2022/aeris-ui-core-glass.mjs +110 -33
  71. package/fesm2022/aeris-ui-core-glass.mjs.map +1 -1
  72. package/fesm2022/aeris-ui-core-icon-field.mjs +426 -106
  73. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
  74. package/fesm2022/aeris-ui-core-inplace.mjs +452 -130
  75. package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
  76. package/fesm2022/aeris-ui-core-input-group.mjs +413 -114
  77. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
  78. package/fesm2022/aeris-ui-core-input-mask.mjs +650 -248
  79. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
  80. package/fesm2022/aeris-ui-core-input-number.mjs +902 -334
  81. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
  82. package/fesm2022/aeris-ui-core-input-otp.mjs +667 -253
  83. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
  84. package/fesm2022/aeris-ui-core-input-text.mjs +618 -152
  85. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
  86. package/fesm2022/aeris-ui-core-key-filter.mjs +263 -201
  87. package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -1
  88. package/fesm2022/aeris-ui-core-mega-menu.mjs +601 -388
  89. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
  90. package/fesm2022/aeris-ui-core-menu.mjs +1032 -495
  91. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
  92. package/fesm2022/aeris-ui-core-menubar.mjs +960 -491
  93. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
  94. package/fesm2022/aeris-ui-core-message.mjs +477 -145
  95. package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
  96. package/fesm2022/aeris-ui-core-meter-group.mjs +587 -196
  97. package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
  98. package/fesm2022/aeris-ui-core-multi-select.mjs +1550 -552
  99. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
  100. package/fesm2022/aeris-ui-core-order-list.mjs +518 -202
  101. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
  102. package/fesm2022/aeris-ui-core-organization-chart.mjs +455 -177
  103. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
  104. package/fesm2022/aeris-ui-core-paginator.mjs +329 -127
  105. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
  106. package/fesm2022/aeris-ui-core-panel.mjs +596 -196
  107. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
  108. package/fesm2022/aeris-ui-core-password.mjs +894 -247
  109. package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
  110. package/fesm2022/aeris-ui-core-pick-list.mjs +1280 -659
  111. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
  112. package/fesm2022/aeris-ui-core-popover.mjs +892 -386
  113. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
  114. package/fesm2022/aeris-ui-core-progress-bar.mjs +545 -177
  115. package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
  116. package/fesm2022/aeris-ui-core-progress-spinner.mjs +410 -133
  117. package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
  118. package/fesm2022/aeris-ui-core-radio-button.mjs +386 -119
  119. package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
  120. package/fesm2022/aeris-ui-core-rating.mjs +502 -225
  121. package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
  122. package/fesm2022/aeris-ui-core-scroll-panel.mjs +457 -154
  123. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
  124. package/fesm2022/aeris-ui-core-scroll-top.mjs +204 -63
  125. package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
  126. package/fesm2022/aeris-ui-core-select.mjs +1794 -643
  127. package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
  128. package/fesm2022/aeris-ui-core-skeleton.mjs +149 -45
  129. package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -1
  130. package/fesm2022/aeris-ui-core-slider.mjs +868 -404
  131. package/fesm2022/aeris-ui-core-slider.mjs.map +1 -1
  132. package/fesm2022/aeris-ui-core-speed-dial.mjs +800 -329
  133. package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
  134. package/fesm2022/aeris-ui-core-split-button.mjs +880 -270
  135. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
  136. package/fesm2022/aeris-ui-core-splitter.mjs +812 -352
  137. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
  138. package/fesm2022/aeris-ui-core-stepper.mjs +697 -254
  139. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
  140. package/fesm2022/aeris-ui-core-style-class.mjs +587 -342
  141. package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -1
  142. package/fesm2022/aeris-ui-core-table.mjs +1984 -865
  143. package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
  144. package/fesm2022/aeris-ui-core-tabs.mjs +686 -324
  145. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
  146. package/fesm2022/aeris-ui-core-textarea.mjs +846 -212
  147. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
  148. package/fesm2022/aeris-ui-core-theme-builder.mjs +1256 -1423
  149. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
  150. package/fesm2022/aeris-ui-core-theming.mjs +132 -147
  151. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
  152. package/fesm2022/aeris-ui-core-tiered-menu.mjs +885 -465
  153. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
  154. package/fesm2022/aeris-ui-core-timeline.mjs +407 -131
  155. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
  156. package/fesm2022/aeris-ui-core-toast.mjs +855 -615
  157. package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
  158. package/fesm2022/aeris-ui-core-toggle-switch.mjs +390 -127
  159. package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -1
  160. package/fesm2022/aeris-ui-core-toolbar.mjs +458 -121
  161. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
  162. package/fesm2022/aeris-ui-core-tooltip.mjs +623 -345
  163. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
  164. package/fesm2022/aeris-ui-core-tree-select.mjs +1356 -601
  165. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
  166. package/fesm2022/aeris-ui-core-tree-table.mjs +2001 -942
  167. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
  168. package/fesm2022/aeris-ui-core-tree.mjs +1103 -658
  169. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
  170. package/fesm2022/aeris-ui-core.mjs +861 -842
  171. package/fesm2022/aeris-ui-core.mjs.map +1 -1
  172. package/package.json +1 -1
  173. package/types/aeris-ui-core-accordion.d.ts +166 -93
  174. package/types/aeris-ui-core-animate-on-scroll.d.ts +71 -31
  175. package/types/aeris-ui-core-auto-complete.d.ts +326 -149
  176. package/types/aeris-ui-core-auto-focus.d.ts +24 -16
  177. package/types/aeris-ui-core-avatar.d.ts +112 -42
  178. package/types/aeris-ui-core-badge.d.ts +160 -47
  179. package/types/aeris-ui-core-block-ui.d.ts +47 -27
  180. package/types/aeris-ui-core-breadcrumb.d.ts +162 -92
  181. package/types/aeris-ui-core-button-group.d.ts +37 -16
  182. package/types/aeris-ui-core-button.d.ts +226 -64
  183. package/types/aeris-ui-core-card.d.ts +74 -37
  184. package/types/aeris-ui-core-carousel.d.ts +197 -117
  185. package/types/aeris-ui-core-cascade-select.d.ts +252 -131
  186. package/types/aeris-ui-core-chart.d.ts +134 -84
  187. package/types/aeris-ui-core-checkbox.d.ts +139 -55
  188. package/types/aeris-ui-core-chip.d.ts +116 -51
  189. package/types/aeris-ui-core-class-names.d.ts +22 -20
  190. package/types/aeris-ui-core-color-picker.d.ts +347 -150
  191. package/types/aeris-ui-core-compare.d.ts +224 -101
  192. package/types/aeris-ui-core-confirm-dialog.d.ts +441 -249
  193. package/types/aeris-ui-core-confirm-popup.d.ts +440 -268
  194. package/types/aeris-ui-core-context-menu.d.ts +262 -150
  195. package/types/aeris-ui-core-date-picker.d.ts +488 -226
  196. package/types/aeris-ui-core-dialog.d.ts +288 -121
  197. package/types/aeris-ui-core-divider.d.ts +58 -20
  198. package/types/aeris-ui-core-drawer.d.ts +273 -116
  199. package/types/aeris-ui-core-dynamic-dialog.d.ts +157 -140
  200. package/types/aeris-ui-core-editor.d.ts +243 -124
  201. package/types/aeris-ui-core-file-upload.d.ts +366 -197
  202. package/types/aeris-ui-core-filter-service.d.ts +48 -52
  203. package/types/aeris-ui-core-fluid.d.ts +12 -9
  204. package/types/aeris-ui-core-focus-trap.d.ts +39 -31
  205. package/types/aeris-ui-core-form-field.d.ts +158 -62
  206. package/types/aeris-ui-core-galleria.d.ts +589 -256
  207. package/types/aeris-ui-core-glass.d.ts +24 -11
  208. package/types/aeris-ui-core-icon-field.d.ts +94 -34
  209. package/types/aeris-ui-core-inplace.d.ts +123 -62
  210. package/types/aeris-ui-core-input-group.d.ts +84 -35
  211. package/types/aeris-ui-core-input-mask.d.ts +194 -71
  212. package/types/aeris-ui-core-input-number.d.ts +272 -90
  213. package/types/aeris-ui-core-input-otp.d.ts +190 -82
  214. package/types/aeris-ui-core-input-text.d.ts +185 -62
  215. package/types/aeris-ui-core-key-filter.d.ts +53 -39
  216. package/types/aeris-ui-core-mega-menu.d.ts +174 -123
  217. package/types/aeris-ui-core-menu.d.ts +275 -172
  218. package/types/aeris-ui-core-menubar.d.ts +272 -160
  219. package/types/aeris-ui-core-message.d.ts +132 -61
  220. package/types/aeris-ui-core-meter-group.d.ts +162 -90
  221. package/types/aeris-ui-core-multi-select.d.ts +435 -187
  222. package/types/aeris-ui-core-order-list.d.ts +143 -66
  223. package/types/aeris-ui-core-organization-chart.d.ts +132 -77
  224. package/types/aeris-ui-core-paginator.d.ts +92 -46
  225. package/types/aeris-ui-core-panel.d.ts +149 -78
  226. package/types/aeris-ui-core-password.d.ts +257 -108
  227. package/types/aeris-ui-core-pick-list.d.ts +373 -179
  228. package/types/aeris-ui-core-popover.d.ts +218 -107
  229. package/types/aeris-ui-core-progress-bar.d.ts +156 -74
  230. package/types/aeris-ui-core-progress-spinner.d.ts +110 -48
  231. package/types/aeris-ui-core-radio-button.d.ts +124 -51
  232. package/types/aeris-ui-core-rating.d.ts +149 -76
  233. package/types/aeris-ui-core-scroll-panel.d.ts +142 -64
  234. package/types/aeris-ui-core-scroll-top.d.ts +64 -29
  235. package/types/aeris-ui-core-select.d.ts +474 -226
  236. package/types/aeris-ui-core-skeleton.d.ts +39 -17
  237. package/types/aeris-ui-core-slider.d.ts +270 -116
  238. package/types/aeris-ui-core-speed-dial.d.ts +240 -112
  239. package/types/aeris-ui-core-split-button.d.ts +264 -121
  240. package/types/aeris-ui-core-splitter.d.ts +224 -106
  241. package/types/aeris-ui-core-stepper.d.ts +183 -91
  242. package/types/aeris-ui-core-style-class.d.ts +141 -71
  243. package/types/aeris-ui-core-table.d.ts +595 -308
  244. package/types/aeris-ui-core-tabs.d.ts +163 -90
  245. package/types/aeris-ui-core-textarea.d.ts +261 -81
  246. package/types/aeris-ui-core-theme-builder.d.ts +463 -475
  247. package/types/aeris-ui-core-theming.d.ts +42 -49
  248. package/types/aeris-ui-core-tiered-menu.d.ts +249 -147
  249. package/types/aeris-ui-core-timeline.d.ts +108 -71
  250. package/types/aeris-ui-core-toast.d.ts +219 -155
  251. package/types/aeris-ui-core-toggle-switch.d.ts +125 -52
  252. package/types/aeris-ui-core-toolbar.d.ts +98 -41
  253. package/types/aeris-ui-core-tooltip.d.ts +157 -92
  254. package/types/aeris-ui-core-tree-select.d.ts +359 -179
  255. package/types/aeris-ui-core-tree-table.d.ts +565 -290
  256. package/types/aeris-ui-core-tree.d.ts +269 -165
  257. package/types/aeris-ui-core.d.ts +161 -125
@@ -1,304 +1,261 @@
1
- import * as i0 from '@angular/core';
2
- import { signal, Service } from '@angular/core';
3
-
1
+ import * as i0 from "@angular/core";
2
+ import { Service, signal } from "@angular/core";
4
3
  const AERIS_FILTER_MODES = [
5
- 'starts-with',
6
- 'contains',
7
- 'not-contains',
8
- 'ends-with',
9
- 'equals',
10
- 'not-equals',
11
- 'is',
12
- 'is-not',
13
- 'one-of',
14
- 'less-than',
15
- 'less-than-or-equal',
16
- 'greater-than',
17
- 'greater-than-or-equal',
18
- 'before',
19
- 'after',
4
+ "starts-with",
5
+ "contains",
6
+ "not-contains",
7
+ "ends-with",
8
+ "equals",
9
+ "not-equals",
10
+ "is",
11
+ "is-not",
12
+ "one-of",
13
+ "less-than",
14
+ "less-than-or-equal",
15
+ "greater-than",
16
+ "greater-than-or-equal",
17
+ "before",
18
+ "after"
20
19
  ];
21
- const BLOCKED_PATH_SEGMENTS = new Set(['__proto__', 'prototype', 'constructor']);
22
- class AerisFilterService {
23
- builtIns = new Map([
24
- ['starts-with', (value, filter, context) => this.textMatch(value, filter, context, 'start')],
25
- ['contains', (value, filter, context) => this.textMatch(value, filter, context, 'anywhere')],
26
- [
27
- 'not-contains',
28
- (value, filter, context) => this.isEmptyFilter(filter) ||
29
- (value !== null &&
30
- value !== undefined &&
31
- !this.textMatch(value, filter, context, 'anywhere')),
32
- ],
33
- ['ends-with', (value, filter, context) => this.textMatch(value, filter, context, 'end')],
34
- ['equals', (value, filter, context) => this.equals(value, filter, context)],
35
- ['not-equals', (value, filter, context) => this.notEquals(value, filter, context)],
36
- ['is', (value, filter, context) => this.equals(value, filter, context)],
37
- ['is-not', (value, filter, context) => this.notEquals(value, filter, context)],
38
- ['one-of', (value, filter, context) => this.oneOf(value, filter, context)],
39
- ['less-than', (value, filter, context) => this.comparison(value, filter, context, 'lt')],
40
- [
41
- 'less-than-or-equal',
42
- (value, filter, context) => this.comparison(value, filter, context, 'lte'),
43
- ],
44
- ['greater-than', (value, filter, context) => this.comparison(value, filter, context, 'gt')],
45
- [
46
- 'greater-than-or-equal',
47
- (value, filter, context) => this.comparison(value, filter, context, 'gte'),
48
- ],
49
- ['before', (value, filter) => this.dateComparison(value, filter, 'before')],
50
- ['after', (value, filter) => this.dateComparison(value, filter, 'after')],
51
- ]);
52
- registry = signal(new Map(this.builtIns), /* @ts-ignore */
53
- ...(ngDevMode ? [{ debugName: "registry" }] : /* istanbul ignore next */ []));
54
- customRegistrations = new Map();
55
- constraints = this.registry.asReadonly();
56
- filter(values, options) {
57
- if (this.isEmptyFilter(options.query))
58
- return [...values];
59
- const mode = this.normalizeName(options.mode ?? 'contains');
60
- const constraint = this.registry().get(mode);
61
- if (!constraint)
62
- return [];
63
- const context = { mode, locale: options.locale };
64
- const fields = options.fields?.filter((field) => typeof field === 'function' ? true : field.trim().length > 0);
65
- const operator = options.fieldOperator ?? 'or';
66
- return values.filter((item) => {
67
- if (!fields?.length)
68
- return this.applyConstraint(constraint, item, options.query, context);
69
- const results = fields.map((field) => this.applyConstraint(constraint, this.resolveField(item, field), options.query, context));
70
- return operator === 'and' ? results.every(Boolean) : results.some(Boolean);
71
- });
72
- }
73
- matches(value, filter, mode = 'contains', locale) {
74
- const normalizedMode = this.normalizeName(mode);
75
- const constraint = this.registry().get(normalizedMode);
76
- if (!constraint)
77
- return false;
78
- return this.applyConstraint(constraint, value, filter, {
79
- mode: normalizedMode,
80
- locale,
81
- });
82
- }
83
- register(name, constraint) {
84
- const normalizedName = this.normalizeName(name);
85
- if (!normalizedName)
86
- throw new TypeError('Filter constraint names must not be empty.');
87
- const token = Symbol(normalizedName);
88
- const registrations = this.customRegistrations.get(normalizedName) ?? [];
89
- registrations.push({ token, constraint });
90
- this.customRegistrations.set(normalizedName, registrations);
91
- this.syncConstraint(normalizedName);
92
- let registered = true;
93
- return () => {
94
- if (!registered)
95
- return;
96
- registered = false;
97
- const current = this.customRegistrations.get(normalizedName);
98
- if (!current)
99
- return;
100
- const next = current.filter((registration) => registration.token !== token);
101
- if (next.length)
102
- this.customRegistrations.set(normalizedName, next);
103
- else
104
- this.customRegistrations.delete(normalizedName);
105
- this.syncConstraint(normalizedName);
106
- };
107
- }
108
- unregister(name) {
109
- const normalizedName = this.normalizeName(name);
110
- if (!this.customRegistrations.has(normalizedName))
111
- return false;
112
- this.customRegistrations.delete(normalizedName);
113
- this.syncConstraint(normalizedName);
114
- return true;
115
- }
116
- has(name) {
117
- return this.registry().has(this.normalizeName(name));
118
- }
119
- constraintNames() {
120
- return [...this.registry().keys()].sort((left, right) => left.localeCompare(right));
121
- }
122
- textMatch(value, filter, context, position) {
123
- if (this.isEmptyFilter(filter))
124
- return true;
125
- if (value === null || value === undefined)
126
- return false;
127
- const candidate = this.normalizeText(value, context.locale);
128
- const query = this.normalizeText(filter, context.locale);
129
- if (candidate === null || query === null)
130
- return false;
131
- if (position === 'start')
132
- return candidate.startsWith(query);
133
- if (position === 'end')
134
- return candidate.endsWith(query);
135
- return candidate.includes(query);
136
- }
137
- equals(value, filter, context) {
138
- if (this.isEmptyFilter(filter))
139
- return true;
140
- return this.equalValues(value, filter, context.locale);
141
- }
142
- notEquals(value, filter, context) {
143
- if (this.isEmptyFilter(filter))
144
- return true;
145
- return !this.equalValues(value, filter, context.locale);
146
- }
147
- oneOf(value, filter, context) {
148
- if (!Array.isArray(filter))
149
- return false;
150
- if (filter.length === 0)
151
- return true;
152
- return filter.some((candidate) => this.equalValues(value, candidate, context.locale));
153
- }
154
- equalValues(value, filter, locale) {
155
- if (value instanceof Date || filter instanceof Date) {
156
- const valueTime = this.dateValue(value);
157
- const filterTime = this.dateValue(filter);
158
- return valueTime !== null && filterTime !== null && valueTime === filterTime;
159
- }
160
- if (typeof value === 'string' && typeof filter === 'string') {
161
- return this.normalizeText(value, locale) === this.normalizeText(filter, locale);
162
- }
163
- return Object.is(value, filter);
164
- }
165
- comparison(value, filter, context, operator) {
166
- if (this.isEmptyFilter(filter))
167
- return true;
168
- const comparison = this.compareValues(value, filter, context.locale);
169
- if (comparison === null)
170
- return false;
171
- if (operator === 'lt')
172
- return comparison < 0;
173
- if (operator === 'lte')
174
- return comparison <= 0;
175
- if (operator === 'gt')
176
- return comparison > 0;
177
- return comparison >= 0;
178
- }
179
- compareValues(value, filter, locale) {
180
- if (value instanceof Date || filter instanceof Date) {
181
- const left = this.dateValue(value);
182
- const right = this.dateValue(filter);
183
- return left === null || right === null ? null : Math.sign(left - right);
184
- }
185
- if (typeof value === 'number' && typeof filter === 'number') {
186
- return Number.isFinite(value) && Number.isFinite(filter) ? Math.sign(value - filter) : null;
187
- }
188
- if (typeof value === 'bigint' && typeof filter === 'bigint') {
189
- return value === filter ? 0 : value < filter ? -1 : 1;
190
- }
191
- if (typeof value === 'string' && typeof filter === 'string') {
192
- try {
193
- return new Intl.Collator(this.localeArgument(locale), {
194
- numeric: true,
195
- sensitivity: 'base',
196
- }).compare(value, filter);
197
- }
198
- catch {
199
- return value.localeCompare(filter);
200
- }
201
- }
202
- return null;
203
- }
204
- dateComparison(value, filter, operator) {
205
- if (this.isEmptyFilter(filter))
206
- return true;
207
- const valueTime = this.dateValue(value);
208
- const filterTime = this.dateValue(filter);
209
- if (valueTime === null || filterTime === null)
210
- return false;
211
- return operator === 'before' ? valueTime < filterTime : valueTime > filterTime;
212
- }
213
- dateValue(value) {
214
- if (!(value instanceof Date) && typeof value !== 'string' && typeof value !== 'number') {
215
- return null;
216
- }
217
- const time = value instanceof Date ? value.getTime() : new Date(value).getTime();
218
- return Number.isFinite(time) ? time : null;
219
- }
220
- normalizeText(value, locale) {
221
- try {
222
- const text = String(value).normalize('NFKD').replace(/\p{M}/gu, '');
223
- try {
224
- return text.toLocaleLowerCase(this.localeArgument(locale));
225
- }
226
- catch {
227
- return text.toLowerCase();
228
- }
229
- }
230
- catch {
231
- return null;
232
- }
233
- }
234
- localeArgument(locale) {
235
- return Array.isArray(locale) ? [...locale] : locale;
236
- }
237
- resolveField(item, field) {
238
- if (typeof field === 'function') {
239
- try {
240
- return field(item);
241
- }
242
- catch {
243
- return undefined;
244
- }
245
- }
246
- let current = item;
247
- for (const segment of field.split('.')) {
248
- if (!segment || BLOCKED_PATH_SEGMENTS.has(segment))
249
- return undefined;
250
- if ((typeof current !== 'object' && typeof current !== 'function') || current === null) {
251
- return undefined;
252
- }
253
- if (!Object.prototype.hasOwnProperty.call(current, segment))
254
- return undefined;
255
- try {
256
- current = current[segment];
257
- }
258
- catch {
259
- return undefined;
260
- }
261
- }
262
- return current;
263
- }
264
- applyConstraint(constraint, value, filter, context) {
265
- try {
266
- return Boolean(constraint(value, filter, context));
267
- }
268
- catch {
269
- return false;
270
- }
271
- }
272
- updateRegistry(update) {
273
- this.registry.update((current) => new Map(update(new Map(current))));
274
- }
275
- syncConstraint(name) {
276
- const registrations = this.customRegistrations.get(name);
277
- const constraint = registrations?.at(-1)?.constraint ?? this.builtIns.get(name);
278
- this.updateRegistry((registry) => {
279
- if (constraint)
280
- registry.set(name, constraint);
281
- else
282
- registry.delete(name);
283
- return registry;
284
- });
285
- }
286
- isEmptyFilter(value) {
287
- return value === null || value === undefined || (typeof value === 'string' && !value.trim());
288
- }
289
- normalizeName(value) {
290
- return value.trim().toLocaleLowerCase();
291
- }
292
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AerisFilterService, deps: [], target: i0.ɵɵFactoryTarget.Service });
293
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.6", ngImport: i0, type: AerisFilterService });
294
- }
295
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AerisFilterService, decorators: [{
296
- type: Service
297
- }] });
298
-
299
- /**
300
- * Generated bundle index. Do not edit.
301
- */
302
-
20
+ const BLOCKED_PATH_SEGMENTS = /* @__PURE__ */ new Set([
21
+ "__proto__",
22
+ "prototype",
23
+ "constructor"
24
+ ]);
25
+ var AerisFilterService = class AerisFilterService {
26
+ builtIns = /* @__PURE__ */ new Map([
27
+ ["starts-with", (value, filter, context) => this.textMatch(value, filter, context, "start")],
28
+ ["contains", (value, filter, context) => this.textMatch(value, filter, context, "anywhere")],
29
+ ["not-contains", (value, filter, context) => this.isEmptyFilter(filter) || value !== null && value !== void 0 && !this.textMatch(value, filter, context, "anywhere")],
30
+ ["ends-with", (value, filter, context) => this.textMatch(value, filter, context, "end")],
31
+ ["equals", (value, filter, context) => this.equals(value, filter, context)],
32
+ ["not-equals", (value, filter, context) => this.notEquals(value, filter, context)],
33
+ ["is", (value, filter, context) => this.equals(value, filter, context)],
34
+ ["is-not", (value, filter, context) => this.notEquals(value, filter, context)],
35
+ ["one-of", (value, filter, context) => this.oneOf(value, filter, context)],
36
+ ["less-than", (value, filter, context) => this.comparison(value, filter, context, "lt")],
37
+ ["less-than-or-equal", (value, filter, context) => this.comparison(value, filter, context, "lte")],
38
+ ["greater-than", (value, filter, context) => this.comparison(value, filter, context, "gt")],
39
+ ["greater-than-or-equal", (value, filter, context) => this.comparison(value, filter, context, "gte")],
40
+ ["before", (value, filter) => this.dateComparison(value, filter, "before")],
41
+ ["after", (value, filter) => this.dateComparison(value, filter, "after")]
42
+ ]);
43
+ registry = signal(new Map(this.builtIns), ...ngDevMode ? [{ debugName: "registry" }] : /* istanbul ignore next */ []);
44
+ customRegistrations = /* @__PURE__ */ new Map();
45
+ constraints = this.registry.asReadonly();
46
+ filter(values, options) {
47
+ if (this.isEmptyFilter(options.query)) return [...values];
48
+ const mode = this.normalizeName(options.mode ?? "contains");
49
+ const constraint = this.registry().get(mode);
50
+ if (!constraint) return [];
51
+ const context = {
52
+ mode,
53
+ locale: options.locale
54
+ };
55
+ const fields = options.fields?.filter((field) => typeof field === "function" ? true : field.trim().length > 0);
56
+ const operator = options.fieldOperator ?? "or";
57
+ return values.filter((item) => {
58
+ if (!fields?.length) return this.applyConstraint(constraint, item, options.query, context);
59
+ const results = fields.map((field) => this.applyConstraint(constraint, this.resolveField(item, field), options.query, context));
60
+ return operator === "and" ? results.every(Boolean) : results.some(Boolean);
61
+ });
62
+ }
63
+ matches(value, filter, mode = "contains", locale) {
64
+ const normalizedMode = this.normalizeName(mode);
65
+ const constraint = this.registry().get(normalizedMode);
66
+ if (!constraint) return false;
67
+ return this.applyConstraint(constraint, value, filter, {
68
+ mode: normalizedMode,
69
+ locale
70
+ });
71
+ }
72
+ register(name, constraint) {
73
+ const normalizedName = this.normalizeName(name);
74
+ if (!normalizedName) throw new TypeError("Filter constraint names must not be empty.");
75
+ const token = Symbol(normalizedName);
76
+ const registrations = this.customRegistrations.get(normalizedName) ?? [];
77
+ registrations.push({
78
+ token,
79
+ constraint
80
+ });
81
+ this.customRegistrations.set(normalizedName, registrations);
82
+ this.syncConstraint(normalizedName);
83
+ let registered = true;
84
+ return () => {
85
+ if (!registered) return;
86
+ registered = false;
87
+ const current = this.customRegistrations.get(normalizedName);
88
+ if (!current) return;
89
+ const next = current.filter((registration) => registration.token !== token);
90
+ if (next.length) this.customRegistrations.set(normalizedName, next);
91
+ else this.customRegistrations.delete(normalizedName);
92
+ this.syncConstraint(normalizedName);
93
+ };
94
+ }
95
+ unregister(name) {
96
+ const normalizedName = this.normalizeName(name);
97
+ if (!this.customRegistrations.has(normalizedName)) return false;
98
+ this.customRegistrations.delete(normalizedName);
99
+ this.syncConstraint(normalizedName);
100
+ return true;
101
+ }
102
+ has(name) {
103
+ return this.registry().has(this.normalizeName(name));
104
+ }
105
+ constraintNames() {
106
+ return [...this.registry().keys()].sort((left, right) => left.localeCompare(right));
107
+ }
108
+ textMatch(value, filter, context, position) {
109
+ if (this.isEmptyFilter(filter)) return true;
110
+ if (value === null || value === void 0) return false;
111
+ const candidate = this.normalizeText(value, context.locale);
112
+ const query = this.normalizeText(filter, context.locale);
113
+ if (candidate === null || query === null) return false;
114
+ if (position === "start") return candidate.startsWith(query);
115
+ if (position === "end") return candidate.endsWith(query);
116
+ return candidate.includes(query);
117
+ }
118
+ equals(value, filter, context) {
119
+ if (this.isEmptyFilter(filter)) return true;
120
+ return this.equalValues(value, filter, context.locale);
121
+ }
122
+ notEquals(value, filter, context) {
123
+ if (this.isEmptyFilter(filter)) return true;
124
+ return !this.equalValues(value, filter, context.locale);
125
+ }
126
+ oneOf(value, filter, context) {
127
+ if (!Array.isArray(filter)) return false;
128
+ if (filter.length === 0) return true;
129
+ return filter.some((candidate) => this.equalValues(value, candidate, context.locale));
130
+ }
131
+ equalValues(value, filter, locale) {
132
+ if (value instanceof Date || filter instanceof Date) {
133
+ const valueTime = this.dateValue(value);
134
+ const filterTime = this.dateValue(filter);
135
+ return valueTime !== null && filterTime !== null && valueTime === filterTime;
136
+ }
137
+ if (typeof value === "string" && typeof filter === "string") return this.normalizeText(value, locale) === this.normalizeText(filter, locale);
138
+ return Object.is(value, filter);
139
+ }
140
+ comparison(value, filter, context, operator) {
141
+ if (this.isEmptyFilter(filter)) return true;
142
+ const comparison = this.compareValues(value, filter, context.locale);
143
+ if (comparison === null) return false;
144
+ if (operator === "lt") return comparison < 0;
145
+ if (operator === "lte") return comparison <= 0;
146
+ if (operator === "gt") return comparison > 0;
147
+ return comparison >= 0;
148
+ }
149
+ compareValues(value, filter, locale) {
150
+ if (value instanceof Date || filter instanceof Date) {
151
+ const left = this.dateValue(value);
152
+ const right = this.dateValue(filter);
153
+ return left === null || right === null ? null : Math.sign(left - right);
154
+ }
155
+ if (typeof value === "number" && typeof filter === "number") return Number.isFinite(value) && Number.isFinite(filter) ? Math.sign(value - filter) : null;
156
+ if (typeof value === "bigint" && typeof filter === "bigint") return value === filter ? 0 : value < filter ? -1 : 1;
157
+ if (typeof value === "string" && typeof filter === "string") try {
158
+ return new Intl.Collator(this.localeArgument(locale), {
159
+ numeric: true,
160
+ sensitivity: "base"
161
+ }).compare(value, filter);
162
+ } catch {
163
+ return value.localeCompare(filter);
164
+ }
165
+ return null;
166
+ }
167
+ dateComparison(value, filter, operator) {
168
+ if (this.isEmptyFilter(filter)) return true;
169
+ const valueTime = this.dateValue(value);
170
+ const filterTime = this.dateValue(filter);
171
+ if (valueTime === null || filterTime === null) return false;
172
+ return operator === "before" ? valueTime < filterTime : valueTime > filterTime;
173
+ }
174
+ dateValue(value) {
175
+ if (!(value instanceof Date) && typeof value !== "string" && typeof value !== "number") return null;
176
+ const time = value instanceof Date ? value.getTime() : new Date(value).getTime();
177
+ return Number.isFinite(time) ? time : null;
178
+ }
179
+ normalizeText(value, locale) {
180
+ try {
181
+ const text = String(value).normalize("NFKD").replace(/\p{M}/gu, "");
182
+ try {
183
+ return text.toLocaleLowerCase(this.localeArgument(locale));
184
+ } catch {
185
+ return text.toLowerCase();
186
+ }
187
+ } catch {
188
+ return null;
189
+ }
190
+ }
191
+ localeArgument(locale) {
192
+ return Array.isArray(locale) ? [...locale] : locale;
193
+ }
194
+ resolveField(item, field) {
195
+ if (typeof field === "function") try {
196
+ return field(item);
197
+ } catch {
198
+ return;
199
+ }
200
+ let current = item;
201
+ for (const segment of field.split(".")) {
202
+ if (!segment || BLOCKED_PATH_SEGMENTS.has(segment)) return void 0;
203
+ if (typeof current !== "object" && typeof current !== "function" || current === null) return;
204
+ if (!Object.prototype.hasOwnProperty.call(current, segment)) return void 0;
205
+ try {
206
+ current = current[segment];
207
+ } catch {
208
+ return;
209
+ }
210
+ }
211
+ return current;
212
+ }
213
+ applyConstraint(constraint, value, filter, context) {
214
+ try {
215
+ return Boolean(constraint(value, filter, context));
216
+ } catch {
217
+ return false;
218
+ }
219
+ }
220
+ updateRegistry(update) {
221
+ this.registry.update((current) => new Map(update(new Map(current))));
222
+ }
223
+ syncConstraint(name) {
224
+ const constraint = this.customRegistrations.get(name)?.at(-1)?.constraint ?? this.builtIns.get(name);
225
+ this.updateRegistry((registry) => {
226
+ if (constraint) registry.set(name, constraint);
227
+ else registry.delete(name);
228
+ return registry;
229
+ });
230
+ }
231
+ isEmptyFilter(value) {
232
+ return value === null || value === void 0 || typeof value === "string" && !value.trim();
233
+ }
234
+ normalizeName(value) {
235
+ return value.trim().toLocaleLowerCase();
236
+ }
237
+ static ɵfac = i0.ɵɵngDeclareFactory({
238
+ minVersion: "12.0.0",
239
+ version: "22.2.1",
240
+ ngImport: i0,
241
+ type: AerisFilterService,
242
+ deps: [],
243
+ target: i0.ɵɵFactoryTarget.Service
244
+ });
245
+ static ɵprov = i0.ɵɵngDeclareService({
246
+ minVersion: "22.0.0",
247
+ version: "22.2.1",
248
+ ngImport: i0,
249
+ type: AerisFilterService
250
+ });
251
+ };
252
+ i0.ɵɵngDeclareClassMetadata({
253
+ minVersion: "12.0.0",
254
+ version: "22.2.1",
255
+ ngImport: i0,
256
+ type: AerisFilterService,
257
+ decorators: [{ type: Service }]
258
+ });
303
259
  export { AERIS_FILTER_MODES, AerisFilterService };
304
- //# sourceMappingURL=aeris-ui-core-filter-service.mjs.map
260
+
261
+ //# sourceMappingURL=aeris-ui-core-filter-service.mjs.map