@nanahoshi/mona-ui 0.27.2 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/docs/api/chart.md +2 -2
  2. package/docs/api/locales.md +8 -0
  3. package/docs/api/popup.md +1 -1
  4. package/docs/api/theme.md +2 -2
  5. package/docs/chart.md +14 -0
  6. package/docs/editor.md +2 -0
  7. package/docs/installation.md +147 -15
  8. package/docs/introduction.md +37 -15
  9. package/docs/theming-built-in-themes.md +67 -0
  10. package/docs/theming-custom-colors.md +274 -0
  11. package/docs/theming-custom-themes.md +168 -0
  12. package/docs/theming.md +164 -248
  13. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  14. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  15. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  16. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  17. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  18. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2071 -1573
  19. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  20. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  21. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  22. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  23. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  24. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
  25. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  26. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  27. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  28. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  29. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  30. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
  31. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  32. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
  33. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  34. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  35. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  36. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  37. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  38. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
  39. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  40. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  41. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  42. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  43. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  44. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  45. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  46. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  47. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  48. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  49. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  50. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  51. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
  52. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  53. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  54. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  55. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  56. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  57. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  58. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  59. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  60. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  61. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  62. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  63. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  64. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  65. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  66. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  67. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  68. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  69. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  70. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +599 -0
  71. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  72. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  73. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  74. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  75. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  76. package/fesm2022/nanahoshi-mona-ui-locales.mjs +61 -77
  77. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  78. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  79. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  80. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  81. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  82. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  83. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  84. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  85. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  86. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  87. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  88. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  89. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  90. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  91. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  92. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  93. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  94. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  95. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  96. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  97. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  98. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  99. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  100. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  101. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  102. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  103. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  104. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  105. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  106. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  107. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  108. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  109. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  110. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  111. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  112. package/llms.txt +7 -3
  113. package/locales/pl-pl/package.json +4 -0
  114. package/locales/pl-pl/pl-pl.messages.json +536 -0
  115. package/package.json +66 -23
  116. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  117. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  118. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  119. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  120. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  121. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  122. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  123. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  124. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  125. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  126. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  127. package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
  128. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  129. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  130. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  131. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  132. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  133. package/types/nanahoshi-mona-ui-common.d.ts +354 -385
  134. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  135. package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
  136. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  137. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  138. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  139. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  140. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  141. package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
  142. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  143. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  144. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  145. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  146. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  147. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  148. package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
  149. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  150. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  151. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  152. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  153. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  154. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  155. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  156. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  157. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  158. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  159. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  160. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  161. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  162. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  163. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  164. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  165. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  166. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  167. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +540 -0
  168. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  169. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  170. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  171. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  172. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  173. package/types/nanahoshi-mona-ui-locales.d.ts +18 -19
  174. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  175. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  176. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  177. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  178. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  179. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  180. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  181. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  182. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  183. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  184. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  185. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  186. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  187. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  188. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  189. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  190. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  191. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  192. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  193. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  194. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  195. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  196. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  197. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  198. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  199. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  200. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  201. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  202. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  203. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  204. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  205. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  206. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  207. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  208. package/types/nanahoshi-mona-ui.d.ts +1 -2
  209. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  210. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  211. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  212. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  213. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,144 +1,345 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, DestroyRef, ElementRef, signal, computed, input, output, effect, untracked, afterNextRender, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
- import * as i1 from '@angular/forms';
5
- import { FormsModule } from '@angular/forms';
6
- import { LucideSearch } from '@lucide/angular';
7
- import { FilterChangeEvent } from '@nanahoshi/mona-ui/common';
8
- import { TextBoxComponent, TextBoxPrefixTemplateDirective } from '@nanahoshi/mona-ui/text-box';
9
- import { Subject, fromEvent, debounce, timer } from 'rxjs';
10
-
11
- class FilterInputComponent {
12
- #destroyRef;
13
- #hostElementRef;
14
- constructor() {
15
- this.#destroyRef = inject(DestroyRef);
16
- this.#hostElementRef = inject((ElementRef));
17
- this.filter$ = new Subject();
18
- this.filterText = signal("", /* @ts-ignore */
19
- ...(ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []));
20
- /**
21
- * When the input controls a list, it acts as a combobox (WAI-ARIA APG): focus stays in the input
22
- * and the highlighted option is exposed through `aria-activedescendant`.
23
- */
24
- this.inputAttributes = computed(() => {
25
- const controls = this.controls();
26
- const ariaLabel = this.ariaLabel() || null;
27
- if (!controls) {
28
- return { "aria-label": ariaLabel, "aria-controls": this.ariaControls() || null };
29
- }
30
- return {
31
- role: "combobox",
32
- "aria-label": ariaLabel,
33
- "aria-activedescendant": this.activeDescendant() || null,
34
- "aria-autocomplete": "list",
35
- "aria-controls": controls,
36
- "aria-expanded": true
37
- };
38
- }, /* @ts-ignore */
39
- ...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
40
- /**
41
- * @description Id of the highlighted option in the controlled list, exposed as `aria-activedescendant`.
42
- * @default ""
43
- */
44
- this.activeDescendant = input("", /* @ts-ignore */
45
- ...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
46
- /**
47
- * @description Id of the element this input filters, exposed as `aria-controls`. Unlike `controls`, the input
48
- * stays a text box: focus moves to the filtered element to navigate it.
49
- * @default ""
50
- */
51
- this.ariaControls = input("", /* @ts-ignore */
52
- ...(ngDevMode ? [{ debugName: "ariaControls" }] : /* istanbul ignore next */ []));
53
- /**
54
- * @description Accessible name of the input. The placeholder is not a reliable label, so set this whenever possible.
55
- * @default ""
56
- */
57
- this.ariaLabel = input("", /* @ts-ignore */
58
- ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
59
- /**
60
- * @description Focuses the input when it renders, as a popup's filter does. Turn it off for an input that is part
61
- * of the page, so it doesn't take focus on load.
62
- * @default true
63
- */
64
- this.autoFocus = input(true, /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "autoFocus" }] : /* istanbul ignore next */ []));
66
- /**
67
- * @description Id of the list this input filters. When set, the input is exposed as a combobox controlling it.
68
- * @default ""
69
- */
70
- this.controls = input("", /* @ts-ignore */
71
- ...(ngDevMode ? [{ debugName: "controls" }] : /* istanbul ignore next */ []));
72
- this.debounce = input(0, /* @ts-ignore */
73
- ...(ngDevMode ? [{ debugName: "debounce" }] : /* istanbul ignore next */ []));
74
- this.filter = input("", /* @ts-ignore */
75
- ...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
76
- this.filterChange = output();
77
- this.inputBlur = output();
78
- this.inputFocus = output();
79
- this.placeholder = input("", /* @ts-ignore */
80
- ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
81
- this.size = input("medium", /* @ts-ignore */
82
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
83
- effect(() => {
84
- const filter = this.filter();
85
- untracked(() => this.filterText.set(filter));
86
- });
87
- afterNextRender({
88
- read: () => {
89
- const input = this.#hostElementRef.nativeElement.querySelector("input");
90
- if (this.autoFocus()) {
91
- input.focus();
92
- }
93
- fromEvent(input, "keydown")
94
- .pipe(takeUntilDestroyed(this.#destroyRef))
95
- .subscribe((event) => {
96
- if (event.key === "ArrowDown" || event.key === "ArrowUp") {
97
- event.preventDefault();
98
- const input = event.target;
99
- input.selectionStart = input.selectionEnd = input.value.length;
100
- }
101
- else if (event.key !== "Escape" && event.key !== "Enter") {
102
- event.stopPropagation();
103
- }
104
- });
105
- }
106
- });
107
- }
108
- focus() {
109
- const input = this.#hostElementRef.nativeElement.querySelector("input");
110
- input.focus();
111
- }
112
- ngOnInit() {
113
- this.setSubscriptions();
114
- }
115
- setSubscriptions() {
116
- this.filter$
117
- .pipe(debounce(() => timer(this.debounce())), takeUntilDestroyed(this.#destroyRef))
118
- .subscribe(value => {
119
- const event = new FilterChangeEvent(value);
120
- this.filterChange.emit(event);
121
- if (!event.isDefaultPrevented()) {
122
- this.filterText.set(value);
123
- }
124
- this.focus();
125
- });
126
- }
127
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
128
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: FilterInputComponent, isStandalone: true, selector: "mona-filter-input", inputs: { activeDescendant: { classPropertyName: "activeDescendant", publicName: "activeDescendant", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "ariaControls", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterChange: "filterChange", inputBlur: "inputBlur", inputFocus: "inputFocus" }, ngImport: i0, template: "<mona-text-box\n [ngModel]=\"filterText()\"\n [clearButton]=\"true\"\n [placeholder]=\"placeholder()\"\n (inputFocus)=\"inputFocus.emit($event)\"\n (inputBlur)=\"inputBlur.emit($event)\"\n [inputAttributes]=\"inputAttributes()\"\n [size]=\"size()\"\n class=\"outline-none focus-visible:outline-hidden shadow-none focus-within:ring-1 focus-within:ring-primary/40\"\n (ngModelChange)=\"filter$.next($event)\">\n <ng-template monaTextBoxPrefixTemplate>\n <div class=\"h-full flex items-center justify-center ps-2\">\n <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n", dependencies: [{ kind: "component", type: LucideSearch, selector: "svg[lucideSearch]" }, { kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["aria-describedby", "aria-label", "aria-labelledby", "clearButton", "disabled", "inputAttributes", "inputClass", "inputId", "inputStyle", "invalid", "maxLength", "minLength", "name", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "ng-template[monaTextBoxPrefixTemplate]" }] }); }
129
- }
130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterInputComponent, decorators: [{
131
- type: Component,
132
- args: [{ selector: "mona-filter-input", imports: [LucideSearch, TextBoxComponent, FormsModule, TextBoxPrefixTemplateDirective], template: "<mona-text-box\n [ngModel]=\"filterText()\"\n [clearButton]=\"true\"\n [placeholder]=\"placeholder()\"\n (inputFocus)=\"inputFocus.emit($event)\"\n (inputBlur)=\"inputBlur.emit($event)\"\n [inputAttributes]=\"inputAttributes()\"\n [size]=\"size()\"\n class=\"outline-none focus-visible:outline-hidden shadow-none focus-within:ring-1 focus-within:ring-primary/40\"\n (ngModelChange)=\"filter$.next($event)\">\n <ng-template monaTextBoxPrefixTemplate>\n <div class=\"h-full flex items-center justify-center ps-2\">\n <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n" }]
133
- }], ctorParameters: () => [], propDecorators: { activeDescendant: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeDescendant", required: false }] }], ariaControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaControls", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
134
-
135
- /*
136
- * Public API Surface of @nanahoshi/mona-ui/filter-input
137
- */
138
-
139
- /**
140
- * Generated bundle index. Do not edit.
141
- */
142
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, DestroyRef, ElementRef, afterNextRender, computed, effect, inject, input, output, signal, untracked } from "@angular/core";
3
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
4
+ import * as i1 from "@angular/forms";
5
+ import { FormsModule } from "@angular/forms";
6
+ import { LucideSearch } from "@lucide/angular";
7
+ import { FilterChangeEvent } from "@nanahoshi/mona-ui/common";
8
+ import { TextBoxComponent, TextBoxPrefixTemplateDirective } from "@nanahoshi/mona-ui/text-box";
9
+ import { Subject, debounce, fromEvent, timer } from "rxjs";
10
+ var FilterInputComponent = class FilterInputComponent {
11
+ #destroyRef;
12
+ #hostElementRef;
13
+ constructor() {
14
+ this.#destroyRef = inject(DestroyRef);
15
+ this.#hostElementRef = inject(ElementRef);
16
+ this.filter$ = new Subject();
17
+ this.filterText = signal("", ...ngDevMode ? [{ debugName: "filterText" }] : /* istanbul ignore next */ []);
18
+ this.inputAttributes = computed(() => {
19
+ const controls = this.controls();
20
+ const ariaLabel = this.ariaLabel() || null;
21
+ if (!controls) return {
22
+ "aria-label": ariaLabel,
23
+ "aria-controls": this.ariaControls() || null
24
+ };
25
+ return {
26
+ role: "combobox",
27
+ "aria-label": ariaLabel,
28
+ "aria-activedescendant": this.activeDescendant() || null,
29
+ "aria-autocomplete": "list",
30
+ "aria-controls": controls,
31
+ "aria-expanded": true
32
+ };
33
+ }, ...ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []);
34
+ this.activeDescendant = input("", ...ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []);
35
+ this.ariaControls = input("", ...ngDevMode ? [{ debugName: "ariaControls" }] : /* istanbul ignore next */ []);
36
+ this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
37
+ this.autoFocus = input(true, ...ngDevMode ? [{ debugName: "autoFocus" }] : /* istanbul ignore next */ []);
38
+ this.controls = input("", ...ngDevMode ? [{ debugName: "controls" }] : /* istanbul ignore next */ []);
39
+ this.debounce = input(0, ...ngDevMode ? [{ debugName: "debounce" }] : /* istanbul ignore next */ []);
40
+ this.filter = input("", ...ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []);
41
+ this.filterChange = output();
42
+ this.inputBlur = output();
43
+ this.inputFocus = output();
44
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
45
+ this.size = input("medium", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
46
+ effect(() => {
47
+ const filter = this.filter();
48
+ untracked(() => this.filterText.set(filter));
49
+ });
50
+ afterNextRender({ read: () => {
51
+ const input = this.#hostElementRef.nativeElement.querySelector("input");
52
+ if (this.autoFocus()) input.focus();
53
+ fromEvent(input, "keydown").pipe(takeUntilDestroyed(this.#destroyRef)).subscribe((event) => {
54
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
55
+ event.preventDefault();
56
+ const input = event.target;
57
+ input.selectionStart = input.selectionEnd = input.value.length;
58
+ } else if (event.key !== "Escape" && event.key !== "Enter") event.stopPropagation();
59
+ });
60
+ } });
61
+ }
62
+ focus() {
63
+ this.#hostElementRef.nativeElement.querySelector("input").focus();
64
+ }
65
+ ngOnInit() {
66
+ this.setSubscriptions();
67
+ }
68
+ setSubscriptions() {
69
+ this.filter$.pipe(debounce(() => timer(this.debounce())), takeUntilDestroyed(this.#destroyRef)).subscribe((value) => {
70
+ const event = new FilterChangeEvent(value);
71
+ this.filterChange.emit(event);
72
+ if (!event.isDefaultPrevented()) this.filterText.set(value);
73
+ this.focus();
74
+ });
75
+ }
76
+ static {
77
+ this.ɵfac = i0.ɵɵngDeclareFactory({
78
+ minVersion: "12.0.0",
79
+ version: "22.2.6",
80
+ ngImport: i0,
81
+ type: FilterInputComponent,
82
+ deps: [],
83
+ target: i0.ɵɵFactoryTarget.Component
84
+ });
85
+ }
86
+ static {
87
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
88
+ minVersion: "17.1.0",
89
+ version: "22.2.6",
90
+ type: FilterInputComponent,
91
+ isStandalone: true,
92
+ selector: "mona-filter-input",
93
+ inputs: {
94
+ activeDescendant: {
95
+ classPropertyName: "activeDescendant",
96
+ publicName: "activeDescendant",
97
+ isSignal: true,
98
+ isRequired: false,
99
+ transformFunction: null
100
+ },
101
+ ariaControls: {
102
+ classPropertyName: "ariaControls",
103
+ publicName: "ariaControls",
104
+ isSignal: true,
105
+ isRequired: false,
106
+ transformFunction: null
107
+ },
108
+ ariaLabel: {
109
+ classPropertyName: "ariaLabel",
110
+ publicName: "ariaLabel",
111
+ isSignal: true,
112
+ isRequired: false,
113
+ transformFunction: null
114
+ },
115
+ autoFocus: {
116
+ classPropertyName: "autoFocus",
117
+ publicName: "autoFocus",
118
+ isSignal: true,
119
+ isRequired: false,
120
+ transformFunction: null
121
+ },
122
+ controls: {
123
+ classPropertyName: "controls",
124
+ publicName: "controls",
125
+ isSignal: true,
126
+ isRequired: false,
127
+ transformFunction: null
128
+ },
129
+ debounce: {
130
+ classPropertyName: "debounce",
131
+ publicName: "debounce",
132
+ isSignal: true,
133
+ isRequired: false,
134
+ transformFunction: null
135
+ },
136
+ filter: {
137
+ classPropertyName: "filter",
138
+ publicName: "filter",
139
+ isSignal: true,
140
+ isRequired: false,
141
+ transformFunction: null
142
+ },
143
+ placeholder: {
144
+ classPropertyName: "placeholder",
145
+ publicName: "placeholder",
146
+ isSignal: true,
147
+ isRequired: false,
148
+ transformFunction: null
149
+ },
150
+ size: {
151
+ classPropertyName: "size",
152
+ publicName: "size",
153
+ isSignal: true,
154
+ isRequired: false,
155
+ transformFunction: null
156
+ }
157
+ },
158
+ outputs: {
159
+ filterChange: "filterChange",
160
+ inputBlur: "inputBlur",
161
+ inputFocus: "inputFocus"
162
+ },
163
+ ngImport: i0,
164
+ template: "<mona-text-box\n [ngModel]=\"filterText()\"\n [clearButton]=\"true\"\n [placeholder]=\"placeholder()\"\n (inputFocus)=\"inputFocus.emit($event)\"\n (inputBlur)=\"inputBlur.emit($event)\"\n [inputAttributes]=\"inputAttributes()\"\n [size]=\"size()\"\n class=\"outline-none focus-visible:outline-hidden shadow-none focus-within:ring-1 focus-within:ring-primary/40\"\n (ngModelChange)=\"filter$.next($event)\">\n <ng-template monaTextBoxPrefixTemplate>\n <div class=\"h-full flex items-center justify-center ps-2\">\n <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n",
165
+ dependencies: [
166
+ {
167
+ kind: "component",
168
+ type: LucideSearch,
169
+ selector: "svg[lucideSearch]"
170
+ },
171
+ {
172
+ kind: "component",
173
+ type: TextBoxComponent,
174
+ selector: "mona-text-box",
175
+ inputs: [
176
+ "aria-describedby",
177
+ "aria-label",
178
+ "aria-labelledby",
179
+ "clearButton",
180
+ "disabled",
181
+ "inputAttributes",
182
+ "inputClass",
183
+ "inputId",
184
+ "inputStyle",
185
+ "invalid",
186
+ "maxLength",
187
+ "minLength",
188
+ "name",
189
+ "placeholder",
190
+ "readonly",
191
+ "required",
192
+ "rounded",
193
+ "size",
194
+ "touched",
195
+ "type",
196
+ "class",
197
+ "value"
198
+ ],
199
+ outputs: [
200
+ "inputBlur",
201
+ "inputFocus",
202
+ "touch",
203
+ "valueChange"
204
+ ]
205
+ },
206
+ {
207
+ kind: "ngmodule",
208
+ type: FormsModule
209
+ },
210
+ {
211
+ kind: "directive",
212
+ type: i1.NgControlStatus,
213
+ selector: "[formControlName],[ngModel],[formControl]"
214
+ },
215
+ {
216
+ kind: "directive",
217
+ type: i1.NgModel,
218
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
219
+ inputs: [
220
+ "name",
221
+ "disabled",
222
+ "ngModel",
223
+ "ngModelOptions"
224
+ ],
225
+ outputs: ["ngModelChange"],
226
+ exportAs: ["ngModel"]
227
+ },
228
+ {
229
+ kind: "directive",
230
+ type: TextBoxPrefixTemplateDirective,
231
+ selector: "ng-template[monaTextBoxPrefixTemplate]"
232
+ }
233
+ ]
234
+ });
235
+ }
236
+ };
237
+ i0.ɵɵngDeclareClassMetadata({
238
+ minVersion: "12.0.0",
239
+ version: "22.2.6",
240
+ ngImport: i0,
241
+ type: FilterInputComponent,
242
+ decorators: [{
243
+ type: Component,
244
+ args: [{
245
+ selector: "mona-filter-input",
246
+ imports: [
247
+ LucideSearch,
248
+ TextBoxComponent,
249
+ FormsModule,
250
+ TextBoxPrefixTemplateDirective
251
+ ],
252
+ template: "<mona-text-box\n [ngModel]=\"filterText()\"\n [clearButton]=\"true\"\n [placeholder]=\"placeholder()\"\n (inputFocus)=\"inputFocus.emit($event)\"\n (inputBlur)=\"inputBlur.emit($event)\"\n [inputAttributes]=\"inputAttributes()\"\n [size]=\"size()\"\n class=\"outline-none focus-visible:outline-hidden shadow-none focus-within:ring-1 focus-within:ring-primary/40\"\n (ngModelChange)=\"filter$.next($event)\">\n <ng-template monaTextBoxPrefixTemplate>\n <div class=\"h-full flex items-center justify-center ps-2\">\n <svg lucideSearch [size]=\"16\" aria-hidden=\"true\"></svg>\n </div>\n </ng-template>\n</mona-text-box>\n"
253
+ }]
254
+ }],
255
+ ctorParameters: () => [],
256
+ propDecorators: {
257
+ activeDescendant: [{
258
+ type: i0.Input,
259
+ args: [{
260
+ isSignal: true,
261
+ alias: "activeDescendant",
262
+ required: false
263
+ }]
264
+ }],
265
+ ariaControls: [{
266
+ type: i0.Input,
267
+ args: [{
268
+ isSignal: true,
269
+ alias: "ariaControls",
270
+ required: false
271
+ }]
272
+ }],
273
+ ariaLabel: [{
274
+ type: i0.Input,
275
+ args: [{
276
+ isSignal: true,
277
+ alias: "ariaLabel",
278
+ required: false
279
+ }]
280
+ }],
281
+ autoFocus: [{
282
+ type: i0.Input,
283
+ args: [{
284
+ isSignal: true,
285
+ alias: "autoFocus",
286
+ required: false
287
+ }]
288
+ }],
289
+ controls: [{
290
+ type: i0.Input,
291
+ args: [{
292
+ isSignal: true,
293
+ alias: "controls",
294
+ required: false
295
+ }]
296
+ }],
297
+ debounce: [{
298
+ type: i0.Input,
299
+ args: [{
300
+ isSignal: true,
301
+ alias: "debounce",
302
+ required: false
303
+ }]
304
+ }],
305
+ filter: [{
306
+ type: i0.Input,
307
+ args: [{
308
+ isSignal: true,
309
+ alias: "filter",
310
+ required: false
311
+ }]
312
+ }],
313
+ filterChange: [{
314
+ type: i0.Output,
315
+ args: ["filterChange"]
316
+ }],
317
+ inputBlur: [{
318
+ type: i0.Output,
319
+ args: ["inputBlur"]
320
+ }],
321
+ inputFocus: [{
322
+ type: i0.Output,
323
+ args: ["inputFocus"]
324
+ }],
325
+ placeholder: [{
326
+ type: i0.Input,
327
+ args: [{
328
+ isSignal: true,
329
+ alias: "placeholder",
330
+ required: false
331
+ }]
332
+ }],
333
+ size: [{
334
+ type: i0.Input,
335
+ args: [{
336
+ isSignal: true,
337
+ alias: "size",
338
+ required: false
339
+ }]
340
+ }]
341
+ }
342
+ });
143
343
  export { FilterInputComponent };
144
- //# sourceMappingURL=nanahoshi-mona-ui-internal-filter-input.mjs.map
344
+
345
+ //# sourceMappingURL=nanahoshi-mona-ui-internal-filter-input.mjs.map