@nanahoshi/mona-ui 0.1.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 (134) hide show
  1. package/README.md +25 -0
  2. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +590 -0
  3. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +168 -0
  4. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +220 -0
  5. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +225 -0
  6. package/fesm2022/nanahoshi-mona-ui-button.mjs +497 -0
  7. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1569 -0
  8. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +339 -0
  9. package/fesm2022/nanahoshi-mona-ui-chip.mjs +453 -0
  10. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +200 -0
  11. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +853 -0
  12. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +923 -0
  13. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +495 -0
  14. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +686 -0
  15. package/fesm2022/nanahoshi-mona-ui-common.mjs +642 -0
  16. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +485 -0
  17. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +132 -0
  18. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +460 -0
  19. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +659 -0
  20. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +828 -0
  21. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +523 -0
  22. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +615 -0
  23. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +701 -0
  24. package/fesm2022/nanahoshi-mona-ui-editor.mjs +1400 -0
  25. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +245 -0
  26. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +170 -0
  27. package/fesm2022/nanahoshi-mona-ui-filter.mjs +680 -0
  28. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs +105 -0
  29. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs +42 -0
  30. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +130 -0
  31. package/fesm2022/nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs +773 -0
  32. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +240 -0
  33. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs +5374 -0
  34. package/fesm2022/nanahoshi-mona-ui-grid.mjs +2 -0
  35. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +87 -0
  36. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +154 -0
  37. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1356 -0
  38. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2263 -0
  39. package/fesm2022/nanahoshi-mona-ui-internal.mjs +379 -0
  40. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +630 -0
  41. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +527 -0
  42. package/fesm2022/nanahoshi-mona-ui-list.mjs +4 -0
  43. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +966 -0
  44. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +641 -0
  45. package/fesm2022/nanahoshi-mona-ui-notification.mjs +536 -0
  46. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +597 -0
  47. package/fesm2022/nanahoshi-mona-ui-pager.mjs +790 -0
  48. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +83 -0
  49. package/fesm2022/nanahoshi-mona-ui-popover.mjs +325 -0
  50. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1559 -0
  51. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1321 -0
  52. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +294 -0
  53. package/fesm2022/nanahoshi-mona-ui-query.mjs +175 -0
  54. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +339 -0
  55. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +565 -0
  56. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1049 -0
  57. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +636 -0
  58. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +843 -0
  59. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +537 -0
  60. package/fesm2022/nanahoshi-mona-ui-switch.mjs +308 -0
  61. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +664 -0
  62. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +111 -0
  63. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +369 -0
  64. package/fesm2022/nanahoshi-mona-ui-theme.mjs +314 -0
  65. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +450 -0
  66. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +723 -0
  67. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +716 -0
  68. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +733 -0
  69. package/fesm2022/nanahoshi-mona-ui-window.mjs +1329 -0
  70. package/fesm2022/nanahoshi-mona-ui.mjs +9 -0
  71. package/package.json +289 -0
  72. package/types/nanahoshi-mona-ui-auto-complete.d.ts +223 -0
  73. package/types/nanahoshi-mona-ui-avatar.d.ts +642 -0
  74. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +70 -0
  75. package/types/nanahoshi-mona-ui-button-group.d.ts +77 -0
  76. package/types/nanahoshi-mona-ui-button.d.ts +111 -0
  77. package/types/nanahoshi-mona-ui-calendar.d.ts +262 -0
  78. package/types/nanahoshi-mona-ui-check-box.d.ts +133 -0
  79. package/types/nanahoshi-mona-ui-chip.d.ts +130 -0
  80. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +113 -0
  81. package/types/nanahoshi-mona-ui-color-gradient.d.ts +201 -0
  82. package/types/nanahoshi-mona-ui-color-palette.d.ts +102 -0
  83. package/types/nanahoshi-mona-ui-color-picker.d.ts +156 -0
  84. package/types/nanahoshi-mona-ui-combo-box.d.ts +232 -0
  85. package/types/nanahoshi-mona-ui-common.d.ts +386 -0
  86. package/types/nanahoshi-mona-ui-contextmenu.d.ts +129 -0
  87. package/types/nanahoshi-mona-ui-date-input.d.ts +60 -0
  88. package/types/nanahoshi-mona-ui-date-picker.d.ts +177 -0
  89. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +199 -0
  90. package/types/nanahoshi-mona-ui-dialog.d.ts +261 -0
  91. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +159 -0
  92. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +219 -0
  93. package/types/nanahoshi-mona-ui-dropdowns.d.ts +176 -0
  94. package/types/nanahoshi-mona-ui-editor.d.ts +113 -0
  95. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +87 -0
  96. package/types/nanahoshi-mona-ui-fieldset.d.ts +68 -0
  97. package/types/nanahoshi-mona-ui-filter.d.ts +115 -0
  98. package/types/nanahoshi-mona-ui-grid.d.ts +1114 -0
  99. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +25 -0
  100. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +28 -0
  101. package/types/nanahoshi-mona-ui-internal-list.d.ts +269 -0
  102. package/types/nanahoshi-mona-ui-internal-tree.d.ts +391 -0
  103. package/types/nanahoshi-mona-ui-internal.d.ts +136 -0
  104. package/types/nanahoshi-mona-ui-list-box.d.ts +225 -0
  105. package/types/nanahoshi-mona-ui-list-view.d.ts +188 -0
  106. package/types/nanahoshi-mona-ui-list.d.ts +1 -0
  107. package/types/nanahoshi-mona-ui-menubar.d.ts +198 -0
  108. package/types/nanahoshi-mona-ui-multi-select.d.ts +247 -0
  109. package/types/nanahoshi-mona-ui-notification.d.ts +106 -0
  110. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +161 -0
  111. package/types/nanahoshi-mona-ui-pager.d.ts +238 -0
  112. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -0
  113. package/types/nanahoshi-mona-ui-popover.d.ts +130 -0
  114. package/types/nanahoshi-mona-ui-popup-menu.d.ts +412 -0
  115. package/types/nanahoshi-mona-ui-popup.d.ts +485 -0
  116. package/types/nanahoshi-mona-ui-progress-bar.d.ts +139 -0
  117. package/types/nanahoshi-mona-ui-query.d.ts +89 -0
  118. package/types/nanahoshi-mona-ui-radio-button.d.ts +128 -0
  119. package/types/nanahoshi-mona-ui-scroll-view.d.ts +166 -0
  120. package/types/nanahoshi-mona-ui-slider.d.ts +305 -0
  121. package/types/nanahoshi-mona-ui-split-button.d.ts +182 -0
  122. package/types/nanahoshi-mona-ui-splitter.d.ts +70 -0
  123. package/types/nanahoshi-mona-ui-stepper.d.ts +173 -0
  124. package/types/nanahoshi-mona-ui-switch.d.ts +125 -0
  125. package/types/nanahoshi-mona-ui-tabs.d.ts +158 -0
  126. package/types/nanahoshi-mona-ui-text-area.d.ts +42 -0
  127. package/types/nanahoshi-mona-ui-text-box.d.ts +164 -0
  128. package/types/nanahoshi-mona-ui-theme.d.ts +23 -0
  129. package/types/nanahoshi-mona-ui-time-picker.d.ts +184 -0
  130. package/types/nanahoshi-mona-ui-time-selector.d.ts +143 -0
  131. package/types/nanahoshi-mona-ui-tooltip.d.ts +130 -0
  132. package/types/nanahoshi-mona-ui-tree-view.d.ts +274 -0
  133. package/types/nanahoshi-mona-ui-window.d.ts +295 -0
  134. package/types/nanahoshi-mona-ui.d.ts +2 -0
@@ -0,0 +1,527 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { Directive, inject, DestroyRef, ElementRef, computed, contentChild, TemplateRef, input, output, effect, untracked, afterRenderEffect, Optional, SkipSelf, Component, afterNextRender } from '@angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
+ import { ListService, ListComponent, ListHeaderTemplateDirective, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListItemTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
6
+ import { PagerComponent } from '@nanahoshi/mona-ui/pager';
7
+ import { ThemeService } from '@nanahoshi/mona-ui/theme';
8
+ import { ImmutableSet } from '@mirei/ts-collections';
9
+ import { fromEvent, filter } from 'rxjs';
10
+ import { twMerge } from 'tailwind-merge';
11
+ import { cva } from 'class-variance-authority';
12
+
13
+ class ListViewFooterTemplateDirective {
14
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewFooterTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
15
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ListViewFooterTemplateDirective, isStandalone: true, selector: "ng-template[monaListViewFooterTemplate]", ngImport: i0 }); }
16
+ }
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewFooterTemplateDirective, decorators: [{
18
+ type: Directive,
19
+ args: [{
20
+ selector: "ng-template[monaListViewFooterTemplate]"
21
+ }]
22
+ }] });
23
+
24
+ class ListViewGroupHeaderTemplateDirective {
25
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewGroupHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
26
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ListViewGroupHeaderTemplateDirective, isStandalone: true, selector: "ng-template[monaListViewGroupHeaderTemplate]", ngImport: i0 }); }
27
+ }
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewGroupHeaderTemplateDirective, decorators: [{
29
+ type: Directive,
30
+ args: [{
31
+ selector: "ng-template[monaListViewGroupHeaderTemplate]"
32
+ }]
33
+ }] });
34
+
35
+ class ListViewHeaderTemplateDirective {
36
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewHeaderTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
37
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ListViewHeaderTemplateDirective, isStandalone: true, selector: "ng-template[monaListViewHeaderTemplate]", ngImport: i0 }); }
38
+ }
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewHeaderTemplateDirective, decorators: [{
40
+ type: Directive,
41
+ args: [{
42
+ selector: "ng-template[monaListViewHeaderTemplate]"
43
+ }]
44
+ }] });
45
+
46
+ class ListViewItemTemplateDirective {
47
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewItemTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
48
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ListViewItemTemplateDirective, isStandalone: true, selector: "ng-template[monaListViewItemTemplate]", ngImport: i0 }); }
49
+ }
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewItemTemplateDirective, decorators: [{
51
+ type: Directive,
52
+ args: [{
53
+ selector: "ng-template[monaListViewItemTemplate]"
54
+ }]
55
+ }] });
56
+
57
+ class ListViewNoDataTemplateDirective {
58
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewNoDataTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
59
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: ListViewNoDataTemplateDirective, isStandalone: true, selector: "ng-template[monaListViewNoDataTemplate]", ngImport: i0 }); }
60
+ }
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewNoDataTemplateDirective, decorators: [{
62
+ type: Directive,
63
+ args: [{
64
+ selector: "ng-template[monaListViewNoDataTemplate]"
65
+ }]
66
+ }] });
67
+
68
+ const listViewBaseVariants = cva(`
69
+ flex flex-col h-full
70
+ outline-none overflow-hidden
71
+ bg-background text-foreground
72
+ border border-border
73
+ `, {
74
+ variants: {
75
+ rounded: {
76
+ small: "rounded-sm",
77
+ medium: "rounded-md",
78
+ large: "rounded-lg",
79
+ none: "rounded-none"
80
+ },
81
+ size: {
82
+ small: "text-sm",
83
+ medium: "text-base",
84
+ large: "text-lg"
85
+ }
86
+ }
87
+ });
88
+
89
+ const listViewBaseThemeVariants = (theme) => {
90
+ switch (theme) {
91
+ case "mona":
92
+ return listViewBaseVariants;
93
+ default:
94
+ return listViewBaseVariants;
95
+ }
96
+ };
97
+
98
+ class ListViewComponent {
99
+ #destroyRef;
100
+ #hostElementRef;
101
+ #scrollBottomEnabled;
102
+ #themeService;
103
+ #scrollSubscription;
104
+ constructor() {
105
+ this.#destroyRef = inject(DestroyRef);
106
+ this.#hostElementRef = inject((ElementRef));
107
+ this.#scrollBottomEnabled = computed(() => {
108
+ const pageableOptions = this.listService.pageableOptions();
109
+ return !pageableOptions.enabled;
110
+ }, /* @ts-ignore */
111
+ ...(ngDevMode ? [{ debugName: "#scrollBottomEnabled" }] : /* istanbul ignore next */ []));
112
+ this.#themeService = inject(ThemeService);
113
+ this.#scrollSubscription = null;
114
+ this.baseClasses = computed(() => {
115
+ const theme = this.#themeService.theme();
116
+ const rounded = this.rounded();
117
+ const size = this.size();
118
+ const variantClasses = listViewBaseThemeVariants(theme)({ rounded, size });
119
+ const userClass = this.userClass();
120
+ return twMerge(variantClasses, userClass);
121
+ }, /* @ts-ignore */
122
+ ...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
123
+ this.footerTemplate = contentChild(ListViewFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
124
+ this.groupHeaderTemplate = contentChild(ListViewGroupHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
125
+ this.headerTemplate = contentChild(ListViewHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
126
+ this.itemCount = computed(() => this.listItems().size(), /* @ts-ignore */
127
+ ...(ngDevMode ? [{ debugName: "itemCount" }] : /* istanbul ignore next */ []));
128
+ this.itemTemplate = contentChild(ListViewItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
129
+ this.listHeight = computed(() => {
130
+ const height = this.height();
131
+ return typeof height === "number" ? `${height}px` : height;
132
+ }, /* @ts-ignore */
133
+ ...(ngDevMode ? [{ debugName: "listHeight" }] : /* istanbul ignore next */ []));
134
+ this.listItems = computed(() => {
135
+ const items = this.items();
136
+ return ImmutableSet.create(items);
137
+ }, /* @ts-ignore */
138
+ ...(ngDevMode ? [{ debugName: "listItems" }] : /* istanbul ignore next */ []));
139
+ this.listMaxHeight = computed(() => {
140
+ const maxHeight = this.maxHeight();
141
+ return typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight;
142
+ }, /* @ts-ignore */
143
+ ...(ngDevMode ? [{ debugName: "listMaxHeight" }] : /* istanbul ignore next */ []));
144
+ this.listMaxWidth = computed(() => {
145
+ const maxWidth = this.maxWidth();
146
+ return typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth;
147
+ }, /* @ts-ignore */
148
+ ...(ngDevMode ? [{ debugName: "listMaxWidth" }] : /* istanbul ignore next */ []));
149
+ this.listService = inject(ListService);
150
+ this.listWidth = computed(() => {
151
+ const width = this.width();
152
+ return typeof width === "number" ? `${width}px` : width;
153
+ }, /* @ts-ignore */
154
+ ...(ngDevMode ? [{ debugName: "listWidth" }] : /* istanbul ignore next */ []));
155
+ this.noDataTemplate = contentChild(ListViewNoDataTemplateDirective, { ...(ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
156
+ this.viewItems = computed(() => this.listItems(), /* @ts-ignore */
157
+ ...(ngDevMode ? [{ debugName: "viewItems" }] : /* istanbul ignore next */ []));
158
+ /**
159
+ * @description Accessible name for the list view's `listbox` element. Describe what the list represents.
160
+ * @default ""
161
+ */
162
+ this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
163
+ /**
164
+ * @description Sets the height of the list view.
165
+ * @default 100%
166
+ */
167
+ this.height = input("100%", /* @ts-ignore */
168
+ ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
169
+ /**
170
+ * @description Sets the classes of the inner UL element.
171
+ * @default ""
172
+ */
173
+ this.listClass = input("", /* @ts-ignore */
174
+ ...(ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []));
175
+ /**
176
+ * @description Sets the classes of the list items.
177
+ * @default ""
178
+ */
179
+ this.listItemClass = input("", /* @ts-ignore */
180
+ ...(ngDevMode ? [{ debugName: "listItemClass" }] : /* istanbul ignore next */ []));
181
+ /**
182
+ * @description Sets the style of the list items.
183
+ * @default {}
184
+ */
185
+ this.listItemStyle = input({}, /* @ts-ignore */
186
+ ...(ngDevMode ? [{ debugName: "listItemStyle" }] : /* istanbul ignore next */ []));
187
+ /**
188
+ * @description Sets the style of the list.
189
+ * @default {}
190
+ */
191
+ this.listStyle = input({}, /* @ts-ignore */
192
+ ...(ngDevMode ? [{ debugName: "listStyle" }] : /* istanbul ignore next */ []));
193
+ /**
194
+ * @description Collection of items to render.
195
+ * @default []
196
+ */
197
+ this.items = input([], /* @ts-ignore */
198
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
199
+ /**
200
+ * @description Sets the maximum height of the list.
201
+ * @default ""
202
+ */
203
+ this.maxHeight = input("", /* @ts-ignore */
204
+ ...(ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []));
205
+ /**
206
+ * @description Sets the maximum width of the list.
207
+ * @default ""
208
+ */
209
+ this.maxWidth = input("", /* @ts-ignore */
210
+ ...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
211
+ /**
212
+ * @description Border-radius preset applied to the component.
213
+ * @default medium
214
+ */
215
+ this.rounded = input("medium", /* @ts-ignore */
216
+ ...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
217
+ /**
218
+ * @description Emitted when the list is scrolled to the bottom.
219
+ */
220
+ this.scrollBottom = output();
221
+ /**
222
+ * @description Size preset controlling the component's dimensions.
223
+ * @default medium
224
+ */
225
+ this.size = input("medium", /* @ts-ignore */
226
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
227
+ /**
228
+ * @description Property name or accessor used to derive the display text from a data item.
229
+ * @default ""
230
+ */
231
+ this.textField = input("", /* @ts-ignore */
232
+ ...(ngDevMode ? [{ debugName: "textField" }] : /* istanbul ignore next */ []));
233
+ /**
234
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`.
235
+ * @default ""
236
+ */
237
+ this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
238
+ /**
239
+ * @description Sets the width of the list view.
240
+ * @default 100%
241
+ */
242
+ this.width = input("100%", /* @ts-ignore */
243
+ ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
244
+ effect(() => {
245
+ const textField = this.textField();
246
+ untracked(() => this.listService.setTextField(textField ?? ""));
247
+ });
248
+ afterRenderEffect({
249
+ read: () => this.setScrollBottomEvent()
250
+ });
251
+ }
252
+ onPageChange(event) {
253
+ this.listService.pageState.update(s => ({ ...s, page: event.page, skip: event.skip }));
254
+ }
255
+ onPageSizeChange(event) {
256
+ this.listService.pageState.update(s => ({ ...s, page: 1, skip: 0, take: event.newPageSize }));
257
+ }
258
+ setScrollBottomEvent() {
259
+ let element;
260
+ const virtualScrollEnabled = this.listService.virtualScrollOptions().enabled;
261
+ if (virtualScrollEnabled) {
262
+ element = this.#hostElementRef.nativeElement.querySelector(".cdk-virtual-scroll-viewport");
263
+ }
264
+ else {
265
+ element = this.#hostElementRef.nativeElement.querySelector("mona-list > ul");
266
+ }
267
+ this.#scrollSubscription?.unsubscribe();
268
+ if (!element) {
269
+ return;
270
+ }
271
+ this.#scrollSubscription = fromEvent(element, "scroll")
272
+ .pipe(takeUntilDestroyed(this.#destroyRef), filter(event => {
273
+ if (!this.#scrollBottomEnabled()) {
274
+ return false;
275
+ }
276
+ const target = event.target;
277
+ return Math.abs(target.scrollHeight - target.scrollTop - target.clientHeight) < 3.0;
278
+ }))
279
+ .subscribe(event => this.scrollBottom.emit(event));
280
+ }
281
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
282
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ListViewComponent, isStandalone: true, selector: "mona-list-view", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, listClass: { classPropertyName: "listClass", publicName: "listClass", isSignal: true, isRequired: false, transformFunction: null }, listItemClass: { classPropertyName: "listItemClass", publicName: "listItemClass", isSignal: true, isRequired: false, transformFunction: null }, listItemStyle: { classPropertyName: "listItemStyle", publicName: "listItemStyle", isSignal: true, isRequired: false, transformFunction: null }, listStyle: { classPropertyName: "listStyle", publicName: "listStyle", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scrollBottom: "scrollBottom" }, host: { properties: { "class": "baseClasses()", "attr.tabindex": "-1" } }, providers: [
283
+ {
284
+ provide: ListService,
285
+ useFactory: (parentListService) => {
286
+ return parentListService ?? new ListService();
287
+ },
288
+ deps: [[new Optional(), new SkipSelf(), ListService]]
289
+ }
290
+ ], queries: [{ propertyName: "footerTemplate", first: true, predicate: ListViewFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ListViewGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ListViewHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: ListViewItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: ListViewNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<mona-list\r\n [ariaLabel]=\"ariaLabel()\"\r\n [data]=\"viewItems()\"\r\n [height]=\"listHeight()\"\r\n [width]=\"listWidth()\"\r\n [maxHeight]=\"listMaxHeight()\"\r\n [maxWidth]=\"listMaxWidth()\"\r\n [listItemClass]=\"listItemClass()\"\r\n [listItemStyle]=\"listItemStyle()\"\r\n [listClass]=\"listClass()\"\r\n [listStyle]=\"listStyle()\">\r\n @if (footerTemplate()) {\r\n <ng-template monaListFooterTemplate>\r\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (groupHeaderTemplate()) {\r\n <ng-template monaListGroupHeaderTemplate let-groupHeader>\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: groupHeader }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (headerTemplate()) {\r\n <ng-template monaListHeaderTemplate>\r\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (itemTemplate()) {\r\n <ng-template monaListItemTemplate let-dataItem>\r\n <ng-container\r\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (noDataTemplate()) {\r\n <ng-template monaListNoDataTemplate>\r\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n</mona-list>\r\n\r\n@let pageableOptions = listService.pageableOptions();\r\n@if (pageableOptions.enabled && !listService.virtualScrollOptions().enabled && viewItems().length > 0) {\r\n @let pageState = listService.pageState();\r\n <div class=\"mona-list-view-pager\">\r\n <mona-pager\r\n [firstLast]=\"pageableOptions.firstLast\"\r\n [pageSizeValues]=\"pageableOptions.pageSizeValues\"\r\n [visiblePages]=\"pageableOptions.visiblePages\"\r\n [total]=\"itemCount()\"\r\n [skip]=\"pageState.skip\"\r\n [responsive]=\"false\"\r\n [rounded]=\"rounded()\"\r\n [pageSize]=\"pageState.take\"\r\n [previousNext]=\"pageableOptions.previousNext\"\r\n [showInfo]=\"pageableOptions.showInfo\"\r\n (pageChange)=\"onPageChange($event)\"\r\n (pageSizeChange)=\"onPageSizeChange($event)\"\r\n class=\"border-b-0 border-l-0 border-r-0 rounded-t-none\"></mona-pager>\r\n </div>\r\n}\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PagerComponent, selector: "mona-pager", inputs: ["firstLast", "navigable", "pageInput", "pageSize", "pageSizeValues", "previousNext", "responsive", "rounded", "showInfo", "size", "skip", "total", "type", "class", "visiblePages"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }] }); }
291
+ }
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewComponent, decorators: [{
293
+ type: Component,
294
+ args: [{ selector: "mona-list-view", providers: [
295
+ {
296
+ provide: ListService,
297
+ useFactory: (parentListService) => {
298
+ return parentListService ?? new ListService();
299
+ },
300
+ deps: [[new Optional(), new SkipSelf(), ListService]]
301
+ }
302
+ ], imports: [
303
+ NgTemplateOutlet,
304
+ PagerComponent,
305
+ ListComponent,
306
+ ListHeaderTemplateDirective,
307
+ ListFooterTemplateDirective,
308
+ ListGroupHeaderTemplateDirective,
309
+ ListItemTemplateDirective,
310
+ ListNoDataTemplateDirective
311
+ ], host: {
312
+ "[class]": "baseClasses()",
313
+ "[attr.tabindex]": "-1"
314
+ }, template: "<mona-list\r\n [ariaLabel]=\"ariaLabel()\"\r\n [data]=\"viewItems()\"\r\n [height]=\"listHeight()\"\r\n [width]=\"listWidth()\"\r\n [maxHeight]=\"listMaxHeight()\"\r\n [maxWidth]=\"listMaxWidth()\"\r\n [listItemClass]=\"listItemClass()\"\r\n [listItemStyle]=\"listItemStyle()\"\r\n [listClass]=\"listClass()\"\r\n [listStyle]=\"listStyle()\">\r\n @if (footerTemplate()) {\r\n <ng-template monaListFooterTemplate>\r\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (groupHeaderTemplate()) {\r\n <ng-template monaListGroupHeaderTemplate let-groupHeader>\r\n <ng-container\r\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: groupHeader }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (headerTemplate()) {\r\n <ng-template monaListHeaderTemplate>\r\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (itemTemplate()) {\r\n <ng-template monaListItemTemplate let-dataItem>\r\n <ng-container\r\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\r\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\r\n </ng-template>\r\n }\r\n @if (noDataTemplate()) {\r\n <ng-template monaListNoDataTemplate>\r\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\r\n </ng-template>\r\n }\r\n</mona-list>\r\n\r\n@let pageableOptions = listService.pageableOptions();\r\n@if (pageableOptions.enabled && !listService.virtualScrollOptions().enabled && viewItems().length > 0) {\r\n @let pageState = listService.pageState();\r\n <div class=\"mona-list-view-pager\">\r\n <mona-pager\r\n [firstLast]=\"pageableOptions.firstLast\"\r\n [pageSizeValues]=\"pageableOptions.pageSizeValues\"\r\n [visiblePages]=\"pageableOptions.visiblePages\"\r\n [total]=\"itemCount()\"\r\n [skip]=\"pageState.skip\"\r\n [responsive]=\"false\"\r\n [rounded]=\"rounded()\"\r\n [pageSize]=\"pageState.take\"\r\n [previousNext]=\"pageableOptions.previousNext\"\r\n [showInfo]=\"pageableOptions.showInfo\"\r\n (pageChange)=\"onPageChange($event)\"\r\n (pageSizeChange)=\"onPageSizeChange($event)\"\r\n class=\"border-b-0 border-l-0 border-r-0 rounded-t-none\"></mona-pager>\r\n </div>\r\n}\r\n" }]
315
+ }], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewGroupHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], listClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "listClass", required: false }] }], listItemClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemClass", required: false }] }], listItemStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemStyle", required: false }] }], listStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "listStyle", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], scrollBottom: [{ type: i0.Output, args: ["scrollBottom"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
316
+
317
+ class ListViewGroupableDirective {
318
+ #defaultOptions;
319
+ #listService;
320
+ constructor() {
321
+ this.#defaultOptions = {
322
+ enabled: true
323
+ };
324
+ this.#listService = inject((ListService));
325
+ this.groupBy = input("", /* @ts-ignore */
326
+ ...(ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []));
327
+ this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaListViewGroupable" });
328
+ effect(() => {
329
+ const groupBy = this.groupBy();
330
+ untracked(() => {
331
+ this.#listService.setGroupBy(groupBy ?? "");
332
+ });
333
+ });
334
+ effect(() => {
335
+ const options = this.options();
336
+ untracked(() => {
337
+ if (options === "") {
338
+ this.#listService.setGroupableOptions(this.#defaultOptions);
339
+ }
340
+ else {
341
+ this.#listService.setGroupableOptions({
342
+ ...this.#defaultOptions,
343
+ ...options,
344
+ enabled: options.enabled ?? this.#defaultOptions.enabled
345
+ });
346
+ }
347
+ });
348
+ });
349
+ }
350
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewGroupableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
351
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ListViewGroupableDirective, isStandalone: true, selector: "mona-list-view[monaListViewGroupable]", inputs: { groupBy: { classPropertyName: "groupBy", publicName: "groupBy", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "monaListViewGroupable", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
352
+ }
353
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewGroupableDirective, decorators: [{
354
+ type: Directive,
355
+ args: [{
356
+ selector: "mona-list-view[monaListViewGroupable]"
357
+ }]
358
+ }], ctorParameters: () => [], propDecorators: { groupBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupBy", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaListViewGroupable", required: false }] }] } });
359
+
360
+ class ListViewNavigableDirective {
361
+ #defaultOptions;
362
+ #listService;
363
+ constructor() {
364
+ this.#defaultOptions = {
365
+ enabled: true,
366
+ mode: "select",
367
+ wrap: false
368
+ };
369
+ this.#listService = inject(ListService);
370
+ this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaListViewNavigable" });
371
+ effect(() => {
372
+ const options = this.options();
373
+ untracked(() => {
374
+ if (options === "") {
375
+ this.#listService.setNavigableOptions(this.#defaultOptions);
376
+ }
377
+ else {
378
+ this.#listService.setNavigableOptions({
379
+ ...this.#defaultOptions,
380
+ ...options
381
+ });
382
+ }
383
+ });
384
+ });
385
+ }
386
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewNavigableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
387
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ListViewNavigableDirective, isStandalone: true, selector: "mona-list-view[monaListViewNavigable]", inputs: { options: { classPropertyName: "options", publicName: "monaListViewNavigable", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
388
+ }
389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewNavigableDirective, decorators: [{
390
+ type: Directive,
391
+ args: [{
392
+ selector: "mona-list-view[monaListViewNavigable]"
393
+ }]
394
+ }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaListViewNavigable", required: false }] }] } });
395
+
396
+ class ListViewPageableDirective {
397
+ #defaultOptions;
398
+ #listService;
399
+ constructor() {
400
+ this.#defaultOptions = {
401
+ enabled: true,
402
+ showInfo: false,
403
+ firstLast: false,
404
+ type: "numeric",
405
+ previousNext: true,
406
+ pageSizeValues: [5, 10, 20, 25, 50, 100],
407
+ visiblePages: 5
408
+ };
409
+ this.#listService = inject(ListService);
410
+ this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaListViewPageable" });
411
+ effect(() => {
412
+ const options = this.options();
413
+ untracked(() => {
414
+ if (options === "") {
415
+ this.#listService.setPageableOptions(this.#defaultOptions);
416
+ }
417
+ else {
418
+ this.#listService.setPageableOptions({
419
+ ...this.#defaultOptions,
420
+ ...options
421
+ });
422
+ }
423
+ });
424
+ });
425
+ }
426
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewPageableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
427
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ListViewPageableDirective, isStandalone: true, selector: "mona-list-view[monaListViewPageable]", inputs: { options: { classPropertyName: "options", publicName: "monaListViewPageable", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
428
+ }
429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewPageableDirective, decorators: [{
430
+ type: Directive,
431
+ args: [{
432
+ selector: "mona-list-view[monaListViewPageable]"
433
+ }]
434
+ }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaListViewPageable", required: false }] }] } });
435
+
436
+ class ListViewSelectableDirective {
437
+ #defaultOptions;
438
+ #destroyRef;
439
+ #listService;
440
+ constructor() {
441
+ this.#defaultOptions = {
442
+ mode: "single",
443
+ enabled: true,
444
+ toggleable: false
445
+ };
446
+ this.#destroyRef = inject(DestroyRef);
447
+ this.#listService = inject(ListService);
448
+ this.selectedKeysChange = output();
449
+ this.options = input("", { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaListViewSelectable" });
450
+ this.selectBy = input("", /* @ts-ignore */
451
+ ...(ngDevMode ? [{ debugName: "selectBy" }] : /* istanbul ignore next */ []));
452
+ this.selectedKeys = input([], /* @ts-ignore */
453
+ ...(ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []));
454
+ effect(() => {
455
+ const selectBy = this.selectBy();
456
+ untracked(() => {
457
+ this.#listService.setValueField(selectBy ?? "");
458
+ });
459
+ });
460
+ effect(() => {
461
+ const selectedKeys = this.selectedKeys();
462
+ untracked(() => {
463
+ this.#listService.setSelectedKeys(selectedKeys ?? []);
464
+ });
465
+ });
466
+ effect(() => {
467
+ const options = this.options();
468
+ untracked(() => {
469
+ if (options === "") {
470
+ this.#listService.setSelectableOptions(this.#defaultOptions);
471
+ }
472
+ else {
473
+ this.#listService.setSelectableOptions({
474
+ ...this.#defaultOptions,
475
+ ...options
476
+ });
477
+ }
478
+ });
479
+ });
480
+ afterNextRender({
481
+ read: () => {
482
+ this.#listService.selectedKeysChange$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(keys => {
483
+ this.selectedKeysChange.emit(keys);
484
+ });
485
+ }
486
+ });
487
+ }
488
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewSelectableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
489
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ListViewSelectableDirective, isStandalone: true, selector: "mona-list-view[monaListViewSelectable]", inputs: { options: { classPropertyName: "options", publicName: "monaListViewSelectable", isSignal: true, isRequired: false, transformFunction: null }, selectBy: { classPropertyName: "selectBy", publicName: "selectBy", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedKeysChange: "selectedKeysChange" }, ngImport: i0 }); }
490
+ }
491
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewSelectableDirective, decorators: [{
492
+ type: Directive,
493
+ args: [{
494
+ selector: "mona-list-view[monaListViewSelectable]"
495
+ }]
496
+ }], ctorParameters: () => [], propDecorators: { selectedKeysChange: [{ type: i0.Output, args: ["selectedKeysChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaListViewSelectable", required: false }] }], selectBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectBy", required: false }] }], selectedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedKeys", required: false }] }] } });
497
+
498
+ class ListViewVirtualScrollDirective {
499
+ #listService;
500
+ constructor() {
501
+ this.#listService = inject((ListService));
502
+ this.options = input.required({ ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), alias: "monaListViewVirtualScroll" });
503
+ effect(() => {
504
+ const options = this.options();
505
+ untracked(() => this.#listService.setVirtualScrollOptions(options));
506
+ });
507
+ }
508
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewVirtualScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
509
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: ListViewVirtualScrollDirective, isStandalone: true, selector: "mona-list-view[monaListViewVirtualScroll]", inputs: { options: { classPropertyName: "options", publicName: "monaListViewVirtualScroll", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
510
+ }
511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewVirtualScrollDirective, decorators: [{
512
+ type: Directive,
513
+ args: [{
514
+ selector: "mona-list-view[monaListViewVirtualScroll]"
515
+ }]
516
+ }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "monaListViewVirtualScroll", required: true }] }] } });
517
+
518
+ /*
519
+ * Public API Surface of @nanahoshi/mona-ui/list-view
520
+ */
521
+
522
+ /**
523
+ * Generated bundle index. Do not edit.
524
+ */
525
+
526
+ export { ListViewComponent, ListViewFooterTemplateDirective, ListViewGroupHeaderTemplateDirective, ListViewGroupableDirective, ListViewHeaderTemplateDirective, ListViewItemTemplateDirective, ListViewNavigableDirective, ListViewNoDataTemplateDirective, ListViewPageableDirective, ListViewSelectableDirective, ListViewVirtualScrollDirective };
527
+ //# sourceMappingURL=nanahoshi-mona-ui-list-view.mjs.map
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ //# sourceMappingURL=nanahoshi-mona-ui-list.mjs.map