@nanahoshi/mona-ui 0.1.0 → 0.2.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.
- package/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +24 -58
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -48
- package/fesm2022/nanahoshi-mona-ui-button.mjs +130 -129
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +69 -165
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +81 -128
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +102 -112
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +11 -25
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +41 -92
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +27 -49
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +64 -65
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +39 -61
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +12 -15
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +44 -33
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +58 -60
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +52 -165
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +36 -59
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +56 -61
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +302 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +33 -84
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +12 -45
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +18 -48
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs +121 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +26 -55
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs +231 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +167 -451
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +57 -87
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -139
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +10 -32
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +8 -21
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -156
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +40 -69
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +32 -116
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +81 -107
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +33 -85
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +12 -34
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +31 -52
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +38 -110
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +21 -62
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +66 -111
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +60 -151
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +117 -173
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +32 -45
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +29 -64
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +38 -101
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +58 -79
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +42 -118
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +29 -37
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -81
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +45 -39
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +45 -109
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +54 -82
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +35 -115
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +31 -5
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +6 -6
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +6 -9
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -8
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +7 -8
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +3 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +16 -17
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +7 -8
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +8 -11
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +13 -14
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +15 -17
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +4 -6
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +10 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
|
@@ -4,14 +4,13 @@ import { Directive, inject, TemplateRef, input, ElementRef, signal, linkedSignal
|
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule } from '@angular/forms';
|
|
6
6
|
import { LucideEllipsis, LucideChevronsLeft, LucideChevronLeft, LucideChevronRight, LucideChevronsRight } from '@lucide/angular';
|
|
7
|
+
import { range } from '@mirei/ts-collections';
|
|
7
8
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
8
9
|
import { PreventableEvent, SlicePipe } from '@nanahoshi/mona-ui/common';
|
|
9
10
|
import { DropdownListComponent, DropdownListValueTemplateDirective } from '@nanahoshi/mona-ui/dropdown-list';
|
|
10
11
|
import { DropdownVirtualScrollDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
11
|
-
import { NavigationKeys } from '@nanahoshi/mona-ui/internal';
|
|
12
|
+
import { themeRaisedBackdropClasses, NavigationKeys } from '@nanahoshi/mona-ui/internal';
|
|
12
13
|
import { NumericTextBoxComponent } from '@nanahoshi/mona-ui/numeric-text-box';
|
|
13
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
14
|
-
import { range } from '@mirei/ts-collections';
|
|
15
14
|
import { twMerge } from 'tailwind-merge';
|
|
16
15
|
import { cva } from 'class-variance-authority';
|
|
17
16
|
|
|
@@ -92,18 +91,17 @@ class PageSizeChangeEvent extends PreventableEvent {
|
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
const
|
|
96
|
-
flex py-1
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
[&_mona-numeric-text-box]:ml-4
|
|
101
|
-
[&_mona-numeric-text-box]:w-12
|
|
102
|
-
[&_mona-numeric-text-box_input]:
|
|
103
|
-
[&_mona-numeric-text-box_input]:
|
|
104
|
-
|
|
105
|
-
[&_mona-dropdown-list]:
|
|
106
|
-
[&_mona-dropdown-list]:my-0
|
|
94
|
+
const pagerBaseThemeVariants = cva(`
|
|
95
|
+
flex px-2 py-1
|
|
96
|
+
text-sm
|
|
97
|
+
bg-(--mona-pager-background) ${themeRaisedBackdropClasses} text-foreground
|
|
98
|
+
border border-border-subtle
|
|
99
|
+
[&_mona-numeric-text-box]:ml-4
|
|
100
|
+
[&_mona-numeric-text-box]:w-12
|
|
101
|
+
[&_mona-numeric-text-box_input]:bg-input-background
|
|
102
|
+
[&_mona-numeric-text-box_input]:text-center
|
|
103
|
+
[&_mona-dropdown-list]:mx-1
|
|
104
|
+
[&_mona-dropdown-list]:my-0
|
|
107
105
|
`, {
|
|
108
106
|
variants: {
|
|
109
107
|
rounded: {
|
|
@@ -120,27 +118,24 @@ const pagerBaseVariants = cva(`
|
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
120
|
});
|
|
123
|
-
const
|
|
124
|
-
flex items-center justify-end
|
|
125
|
-
|
|
121
|
+
const pagerInfoThemeVariants = cva(`
|
|
122
|
+
flex flex-1 items-center justify-end pl-2
|
|
123
|
+
whitespace-nowrap text-muted-foreground
|
|
126
124
|
`);
|
|
127
|
-
const
|
|
128
|
-
flex items-center
|
|
129
|
-
[&_mona-numeric-text-box]:
|
|
130
|
-
[&_mona-numeric-text-box]:
|
|
131
|
-
|
|
125
|
+
const pagerInputThemeVariants = cva(`
|
|
126
|
+
flex items-center
|
|
127
|
+
[&_mona-numeric-text-box]:mx-1
|
|
128
|
+
[&_mona-numeric-text-box]:w-12
|
|
132
129
|
`);
|
|
133
|
-
const
|
|
134
|
-
flex flex-wrap
|
|
135
|
-
[&_li]:list-none
|
|
136
|
-
[&_li]:
|
|
137
|
-
[&_li]:items-center
|
|
138
|
-
[&_li]:justify-center
|
|
130
|
+
const pagerListThemeVariants = cva(`
|
|
131
|
+
flex flex-wrap
|
|
132
|
+
[&_li]:flex [&_li]:list-none
|
|
133
|
+
[&_li]:items-center [&_li]:justify-center
|
|
139
134
|
`);
|
|
140
|
-
const
|
|
135
|
+
const pagerListItemThemeVariants = cva("", {
|
|
141
136
|
variants: {
|
|
142
137
|
active: {
|
|
143
|
-
true: "font-semibold",
|
|
138
|
+
true: "font-semibold text-foreground",
|
|
144
139
|
false: ""
|
|
145
140
|
}
|
|
146
141
|
},
|
|
@@ -149,47 +144,6 @@ const pagerListItemVariants = cva("", {
|
|
|
149
144
|
}
|
|
150
145
|
});
|
|
151
146
|
|
|
152
|
-
const pagerBaseThemeVariants = (theme) => {
|
|
153
|
-
switch (theme) {
|
|
154
|
-
case "mona":
|
|
155
|
-
return pagerBaseVariants;
|
|
156
|
-
default:
|
|
157
|
-
return pagerBaseVariants;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
const pagerInfoThemeVariants = (theme) => {
|
|
161
|
-
switch (theme) {
|
|
162
|
-
case "mona":
|
|
163
|
-
return pagerInfoVariants;
|
|
164
|
-
default:
|
|
165
|
-
return pagerInfoVariants;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const pagerInputThemeVariants = (theme) => {
|
|
169
|
-
switch (theme) {
|
|
170
|
-
case "mona":
|
|
171
|
-
return pagerInputVariants;
|
|
172
|
-
default:
|
|
173
|
-
return pagerInputVariants;
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
const pagerListThemeVariants = (theme) => {
|
|
177
|
-
switch (theme) {
|
|
178
|
-
case "mona":
|
|
179
|
-
return pagerListVariants;
|
|
180
|
-
default:
|
|
181
|
-
return pagerListVariants;
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
const pagerListItemThemeVariants = (theme) => {
|
|
185
|
-
switch (theme) {
|
|
186
|
-
case "mona":
|
|
187
|
-
return pagerListItemVariants;
|
|
188
|
-
default:
|
|
189
|
-
return pagerListItemVariants;
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
147
|
const PAGER_FOCUSABLE_ATTRIBUTE = "data-mona-pager-focusable";
|
|
194
148
|
const FOCUSABLE_TARGET_SELECTOR = "button, input, select, textarea, a[href], [tabindex]";
|
|
195
149
|
class PagerComponent {
|
|
@@ -200,7 +154,6 @@ class PagerComponent {
|
|
|
200
154
|
#managedFocusTargets;
|
|
201
155
|
#originalTabIndices;
|
|
202
156
|
#skip;
|
|
203
|
-
#themeService;
|
|
204
157
|
#widthObserver;
|
|
205
158
|
#previousPageSize;
|
|
206
159
|
constructor() {
|
|
@@ -214,16 +167,14 @@ class PagerComponent {
|
|
|
214
167
|
this.#originalTabIndices = new WeakMap();
|
|
215
168
|
this.#skip = linkedSignal(() => this.skip(), /* @ts-ignore */
|
|
216
169
|
...(ngDevMode ? [{ debugName: "#skip" }] : /* istanbul ignore next */ []));
|
|
217
|
-
this.#themeService = inject(ThemeService);
|
|
218
170
|
this.#widthObserver = null;
|
|
219
171
|
this.#previousPageSize = 10;
|
|
220
172
|
this.navigationButtonsTemplateList = contentChildren(PagerNavigationButtonsTemplateDirective, /* @ts-ignore */
|
|
221
173
|
...(ngDevMode ? [{ debugName: "navigationButtonsTemplateList" }] : /* istanbul ignore next */ []));
|
|
222
174
|
this.baseClasses = computed(() => {
|
|
223
|
-
const theme = this.#themeService.theme();
|
|
224
175
|
const rounded = this.rounded();
|
|
225
176
|
const userClasses = this.userClasses();
|
|
226
|
-
const classes = pagerBaseThemeVariants(
|
|
177
|
+
const classes = pagerBaseThemeVariants({ rounded });
|
|
227
178
|
return twMerge(classes, userClasses);
|
|
228
179
|
}, /* @ts-ignore */
|
|
229
180
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -248,8 +199,7 @@ class PagerComponent {
|
|
|
248
199
|
}, /* @ts-ignore */
|
|
249
200
|
...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
250
201
|
this.infoClasses = computed(() => {
|
|
251
|
-
|
|
252
|
-
return pagerInfoThemeVariants(theme)();
|
|
202
|
+
return pagerInfoThemeVariants();
|
|
253
203
|
}, /* @ts-ignore */
|
|
254
204
|
...(ngDevMode ? [{ debugName: "infoClasses" }] : /* istanbul ignore next */ []));
|
|
255
205
|
this.infoVisible = computed(() => {
|
|
@@ -259,8 +209,7 @@ class PagerComponent {
|
|
|
259
209
|
}, /* @ts-ignore */
|
|
260
210
|
...(ngDevMode ? [{ debugName: "infoVisible" }] : /* istanbul ignore next */ []));
|
|
261
211
|
this.inputClasses = computed(() => {
|
|
262
|
-
|
|
263
|
-
return pagerInputThemeVariants(theme)();
|
|
212
|
+
return pagerInputThemeVariants();
|
|
264
213
|
}, /* @ts-ignore */
|
|
265
214
|
...(ngDevMode ? [{ debugName: "inputClasses" }] : /* istanbul ignore next */ []));
|
|
266
215
|
this.inputValue = linkedSignal(() => this.page(), /* @ts-ignore */
|
|
@@ -276,8 +225,7 @@ class PagerComponent {
|
|
|
276
225
|
}, /* @ts-ignore */
|
|
277
226
|
...(ngDevMode ? [{ debugName: "lastPageNavigationTemplate" }] : /* istanbul ignore next */ []));
|
|
278
227
|
this.listClasses = computed(() => {
|
|
279
|
-
|
|
280
|
-
return pagerListThemeVariants(theme)();
|
|
228
|
+
return pagerListThemeVariants();
|
|
281
229
|
}, /* @ts-ignore */
|
|
282
230
|
...(ngDevMode ? [{ debugName: "listClasses" }] : /* istanbul ignore next */ []));
|
|
283
231
|
this.nextJumperVisible = computed(() => {
|
|
@@ -599,7 +547,7 @@ class PagerComponent {
|
|
|
599
547
|
this.setPage(page);
|
|
600
548
|
}
|
|
601
549
|
pageItemClasses(active) {
|
|
602
|
-
return pagerListItemThemeVariants(
|
|
550
|
+
return pagerListItemThemeVariants({ active });
|
|
603
551
|
}
|
|
604
552
|
activateInnerNavigation() {
|
|
605
553
|
const targets = this.getFocusableTargets();
|
|
@@ -752,7 +700,7 @@ class PagerComponent {
|
|
|
752
700
|
}
|
|
753
701
|
}
|
|
754
702
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
755
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PagerComponent, isStandalone: true, selector: "mona-pager", inputs: { firstLast: { classPropertyName: "firstLast", publicName: "firstLast", isSignal: true, isRequired: false, transformFunction: null }, navigable: { classPropertyName: "navigable", publicName: "navigable", isSignal: true, isRequired: false, transformFunction: null }, pageInput: { classPropertyName: "pageInput", publicName: "pageInput", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeValues: { classPropertyName: "pageSizeValues", publicName: "pageSizeValues", isSignal: true, isRequired: false, transformFunction: null }, previousNext: { classPropertyName: "previousNext", publicName: "previousNext", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showInfo: { classPropertyName: "showInfo", publicName: "showInfo", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, skip: { classPropertyName: "skip", publicName: "skip", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, userClasses: { classPropertyName: "userClasses", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, visiblePages: { classPropertyName: "visiblePages", publicName: "visiblePages", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", pageSizeChange: "pageSizeChange" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.tabindex": "navigable() ? 0 : null", "class": "baseClasses()" } }, queries: [{ propertyName: "navigationButtonsTemplateList", predicate: PagerNavigationButtonsTemplateDirective, isSignal: true }, { propertyName: "numericButtonsTemplate", first: true, predicate: PagerNumericButtonsTemplateDirective, descendants: true, isSignal: true }, { propertyName: "pageSizeTemplate", first: true, predicate: PagerPageSizeTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pagerInfoTemplate", first: true, predicate: PagerInfoTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "pageSizeDropdownList", first: true, predicate: ["pageSizeDropdownList"], descendants: true, isSignal: true }], ngImport: i0, template: "@let numericButtonsTemplateRef = numericButtonsTemplate()?.templateRef;\r\n@let pageSizeTemplateRef = pageSizeTemplate();\r\n@let pagerInfoTemplateRef = pagerInfoTemplate()?.templateRef;\r\n\r\n@if (type() === \"numeric\") {\r\n @if (pageListVisible()) {\r\n <ol [class]=\"listClasses()\">\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\r\n }\r\n\r\n @if (numericButtonsTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"numericButtonsTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ totalPages: pageCount() }\"></ng-container>\r\n } @else {\r\n @if (pages().length !== 0) {\r\n <li [class]=\"pageItemClasses(page() === 1)\">\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [selected]=\"page() === 1\"\r\n [attr.aria-label]=\"'Page 1'\"\r\n [attr.aria-current]=\"page() === 1 ? 'page' : null\"\r\n (click)=\"onPageClick(1)\">\r\n 1\r\n </button>\r\n </li>\r\n }\r\n @if (previousJumperVisible()) {\r\n <li>\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"jumpPreviousLabel()\"\r\n (click)=\"onJumpPreviousClick()\">\r\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\r\n </button>\r\n </li>\r\n }\r\n\r\n @for (pageItem of pages() | monaSlice: 1 : pages().length - 1; track $index) {\r\n <li [attr.data-page]=\"pageItem.page\" [class]=\"pageItemClasses(page() === pageItem.page)\">\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [selected]=\"page() === pageItem.page\"\r\n [attr.aria-label]=\"'Page ' + pageItem.text\"\r\n [attr.aria-current]=\"page() === pageItem.page ? 'page' : null\"\r\n (click)=\"onPageClick(pageItem.page)\">\r\n {{ pageItem.text }}\r\n </button>\r\n </li>\r\n }\r\n\r\n @if (nextJumperVisible()) {\r\n <li>\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"jumpNextLabel()\"\r\n (click)=\"onJumpNextClick()\">\r\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\r\n </button>\r\n </li>\r\n }\r\n\r\n @if (pages().length > 1) {\r\n <li [class]=\"pageItemClasses(page() === pageCount())\">\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [selected]=\"page() === pageCount()\"\r\n [attr.aria-label]=\"'Page ' + pageCount()\"\r\n [attr.aria-current]=\"page() === pageCount() ? 'page' : null\"\r\n (click)=\"onPageClick(pageCount())\">\r\n {{ pageCount() }}\r\n </button>\r\n </li>\r\n }\r\n }\r\n\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\r\n }\r\n\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\r\n }\r\n\r\n @if (pageInputVisible() && pageInput()) {\r\n <li>\r\n <mona-numeric-text-box\r\n monaPagerFocusable\r\n [spinners]=\"false\"\r\n [minValue]=\"1\"\r\n [maxValue]=\"pageCount()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [ngModel]=\"inputValue()\"\r\n (ngModelChange)=\"inputValue.set($event)\"\r\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\r\n </li>\r\n }\r\n\r\n @if (pageInputVisible() && pageSizeDropdownData().length > 0) {\r\n <li>\r\n @if (pageSizeTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"pageSizeTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ $implicit: pageSizeDropdownData() }\">\r\n </ng-container>\r\n } @else {\r\n <mona-dropdown-list\r\n monaPagerFocusable\r\n [data]=\"pageSizeDropdownData()\"\r\n [ngModel]=\"pageSize()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n (ngModelChange)=\"onPageSizeValueChange($event)\"\r\n #pageSizeDropdownList>\r\n <ng-template monaDropDownListValueTemplate let-item>\r\n <span>{{ item }} / page</span>\r\n </ng-template>\r\n </mona-dropdown-list>\r\n }\r\n </li>\r\n }\r\n </ol>\r\n }\r\n @if (infoVisible()) {\r\n @if (pagerInfoTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\r\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\r\n } @else {\r\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\r\n }\r\n }\r\n}\r\n@if (type() === \"input\") {\r\n <div [class]=\"inputClasses()\">\r\n @if (pageListVisible()) {\r\n <ol [class]=\"listClasses()\">\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\r\n }\r\n <li class=\"flex items-center gap-2 mx-2\">\r\n <span>Page</span>\r\n <mona-numeric-text-box\r\n monaPagerFocusable\r\n [spinners]=\"false\"\r\n [minValue]=\"1\"\r\n [maxValue]=\"pageCount()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [ngModel]=\"inputValue()\"\r\n (ngModelChange)=\"inputValue.set($event)\"\r\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\r\n <span>of</span>\r\n <span>{{ pageCount() }}</span>\r\n </li>\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\r\n }\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\r\n }\r\n </ol>\r\n }\r\n </div>\r\n @if (infoVisible()) {\r\n @if (pagerInfoTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\r\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\r\n } @else {\r\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\r\n }\r\n }\r\n}\r\n@if (!pageListVisible()) {\r\n <ol [class]=\"listClasses()\">\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\r\n }\r\n @if (pageCount() !== 0) {\r\n <li>\r\n <mona-dropdown-list\r\n monaPagerFocusable\r\n [data]=\"pageList()\"\r\n [ngModel]=\"page()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n monaDropDownVirtualScroll\r\n (ngModelChange)=\"onPageClick($event)\"\r\n style=\"width: 75px\"></mona-dropdown-list>\r\n </li>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\r\n }\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\r\n }\r\n </ol>\r\n}\r\n\r\n<ng-template #firstPageButton>\r\n <li>\r\n @let firstPageTemplate = firstPageNavigationTemplate();\r\n @if (firstPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"firstPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() === 1\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"firstPageLabel\"\r\n (click)=\"onPageClick(1)\"\r\n [disabled]=\"page() === 1\">\r\n <svg lucideChevronsLeft [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #previousPageButton>\r\n <li>\r\n @let previousPageTemplate = previousPageNavigationTemplate();\r\n @if (previousPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"previousPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() <= 1\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [disabled]=\"page() <= 1\"\r\n [attr.aria-label]=\"previousPageLabel\"\r\n (click)=\"onPreviousPageClick()\">\r\n <svg lucideChevronLeft [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #nextPageButton>\r\n <li>\r\n @let nextPageTemplate = nextPageNavigationTemplate();\r\n @if (nextPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"nextPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() < 1 || page() === pageCount()\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [disabled]=\"page() < 1 || page() === pageCount()\"\r\n [attr.aria-label]=\"nextPageLabel\"\r\n (click)=\"onNextPageClick()\">\r\n <svg lucideChevronRight [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #lastPageButton>\r\n <li>\r\n @let lastPageTemplate = lastPageNavigationTemplate();\r\n @if (lastPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"lastPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() === pageCount()\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"lastPageLabel\"\r\n (click)=\"onPageClick(pageCount())\"\r\n [disabled]=\"page() === pageCount()\">\r\n <svg lucideChevronsRight [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "maxValue", "minValue", "nullable", "readonly", "required", "invalid", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "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: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "itemDisabled", "invalid", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "valueField", "value"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "directive", type: PagerFocusableDirective, selector: "[monaPagerFocusable]" }, { kind: "directive", type: DropdownVirtualScrollDirective, selector: " mona-auto-complete[monaDropDownVirtualScroll], mona-dropdown-list[monaDropDownVirtualScroll], mona-combo-box[monaDropDownVirtualScroll], mona-multi-select[monaDropDownVirtualScroll] ", inputs: ["monaDropDownVirtualScroll"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DropdownListValueTemplateDirective, selector: "ng-template[monaDropDownListValueTemplate]" }, { kind: "component", type: LucideEllipsis, selector: "svg[lucideEllipsis], svg[lucideMoreHorizontal]" }, { kind: "component", type: LucideChevronsLeft, selector: "svg[lucideChevronsLeft]" }, { kind: "component", type: LucideChevronLeft, selector: "svg[lucideChevronLeft]" }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }, { kind: "component", type: LucideChevronsRight, selector: "svg[lucideChevronsRight]" }, { kind: "pipe", type: SlicePipe, name: "monaSlice" }] }); }
|
|
703
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PagerComponent, isStandalone: true, selector: "mona-pager", inputs: { firstLast: { classPropertyName: "firstLast", publicName: "firstLast", isSignal: true, isRequired: false, transformFunction: null }, navigable: { classPropertyName: "navigable", publicName: "navigable", isSignal: true, isRequired: false, transformFunction: null }, pageInput: { classPropertyName: "pageInput", publicName: "pageInput", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeValues: { classPropertyName: "pageSizeValues", publicName: "pageSizeValues", isSignal: true, isRequired: false, transformFunction: null }, previousNext: { classPropertyName: "previousNext", publicName: "previousNext", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showInfo: { classPropertyName: "showInfo", publicName: "showInfo", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, skip: { classPropertyName: "skip", publicName: "skip", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, userClasses: { classPropertyName: "userClasses", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, visiblePages: { classPropertyName: "visiblePages", publicName: "visiblePages", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageChange: "pageChange", pageSizeChange: "pageSizeChange" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.tabindex": "navigable() ? 0 : null", "class": "baseClasses()" } }, queries: [{ propertyName: "navigationButtonsTemplateList", predicate: PagerNavigationButtonsTemplateDirective, isSignal: true }, { propertyName: "numericButtonsTemplate", first: true, predicate: PagerNumericButtonsTemplateDirective, descendants: true, isSignal: true }, { propertyName: "pageSizeTemplate", first: true, predicate: PagerPageSizeTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "pagerInfoTemplate", first: true, predicate: PagerInfoTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "pageSizeDropdownList", first: true, predicate: ["pageSizeDropdownList"], descendants: true, isSignal: true }], ngImport: i0, template: "@let numericButtonsTemplateRef = numericButtonsTemplate()?.templateRef;\n@let pageSizeTemplateRef = pageSizeTemplate();\n@let pagerInfoTemplateRef = pagerInfoTemplate()?.templateRef;\n\n@if (type() === \"numeric\") {\n @if (pageListVisible()) {\n <ol [class]=\"listClasses()\">\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\n }\n\n @if (numericButtonsTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"numericButtonsTemplateRef\"\n [ngTemplateOutletContext]=\"{ totalPages: pageCount() }\"></ng-container>\n } @else {\n @if (pages().length !== 0) {\n <li [class]=\"pageItemClasses(page() === 1)\">\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [selected]=\"page() === 1\"\n [attr.aria-label]=\"'Page 1'\"\n [attr.aria-current]=\"page() === 1 ? 'page' : null\"\n (click)=\"onPageClick(1)\">\n 1\n </button>\n </li>\n }\n @if (previousJumperVisible()) {\n <li>\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"jumpPreviousLabel()\"\n (click)=\"onJumpPreviousClick()\">\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\n </button>\n </li>\n }\n\n @for (pageItem of pages() | monaSlice: 1 : pages().length - 1; track $index) {\n <li [attr.data-page]=\"pageItem.page\" [class]=\"pageItemClasses(page() === pageItem.page)\">\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [selected]=\"page() === pageItem.page\"\n [attr.aria-label]=\"'Page ' + pageItem.text\"\n [attr.aria-current]=\"page() === pageItem.page ? 'page' : null\"\n (click)=\"onPageClick(pageItem.page)\">\n {{ pageItem.text }}\n </button>\n </li>\n }\n\n @if (nextJumperVisible()) {\n <li>\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"jumpNextLabel()\"\n (click)=\"onJumpNextClick()\">\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\n </button>\n </li>\n }\n\n @if (pages().length > 1) {\n <li [class]=\"pageItemClasses(page() === pageCount())\">\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [selected]=\"page() === pageCount()\"\n [attr.aria-label]=\"'Page ' + pageCount()\"\n [attr.aria-current]=\"page() === pageCount() ? 'page' : null\"\n (click)=\"onPageClick(pageCount())\">\n {{ pageCount() }}\n </button>\n </li>\n }\n }\n\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\n }\n\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\n }\n\n @if (pageInputVisible() && pageInput()) {\n <li>\n <mona-numeric-text-box\n monaPagerFocusable\n [spinners]=\"false\"\n [minValue]=\"1\"\n [maxValue]=\"pageCount()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"inputValue.set($event)\"\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\n </li>\n }\n\n @if (pageInputVisible() && pageSizeDropdownData().length > 0) {\n <li>\n @if (pageSizeTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"pageSizeTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: pageSizeDropdownData() }\">\n </ng-container>\n } @else {\n <mona-dropdown-list\n monaPagerFocusable\n [data]=\"pageSizeDropdownData()\"\n [ngModel]=\"pageSize()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (ngModelChange)=\"onPageSizeValueChange($event)\"\n #pageSizeDropdownList>\n <ng-template monaDropDownListValueTemplate let-item>\n <span>{{ item }} / page</span>\n </ng-template>\n </mona-dropdown-list>\n }\n </li>\n }\n </ol>\n }\n @if (infoVisible()) {\n @if (pagerInfoTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\n } @else {\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\n }\n }\n}\n@if (type() === \"input\") {\n <div [class]=\"inputClasses()\">\n @if (pageListVisible()) {\n <ol [class]=\"listClasses()\">\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\n }\n <li class=\"flex items-center gap-2 mx-2\">\n <span>Page</span>\n <mona-numeric-text-box\n monaPagerFocusable\n [spinners]=\"false\"\n [minValue]=\"1\"\n [maxValue]=\"pageCount()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"inputValue.set($event)\"\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\n <span>of</span>\n <span>{{ pageCount() }}</span>\n </li>\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\n }\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\n }\n </ol>\n }\n </div>\n @if (infoVisible()) {\n @if (pagerInfoTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\n } @else {\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\n }\n }\n}\n@if (!pageListVisible()) {\n <ol [class]=\"listClasses()\">\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\n }\n @if (pageCount() !== 0) {\n <li>\n <mona-dropdown-list\n monaPagerFocusable\n [data]=\"pageList()\"\n [ngModel]=\"page()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n monaDropDownVirtualScroll\n (ngModelChange)=\"onPageClick($event)\"\n style=\"width: 75px\"></mona-dropdown-list>\n </li>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\n }\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\n }\n </ol>\n}\n\n<ng-template #firstPageButton>\n <li>\n @let firstPageTemplate = firstPageNavigationTemplate();\n @if (firstPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"firstPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() === 1\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"firstPageLabel\"\n (click)=\"onPageClick(1)\"\n [disabled]=\"page() === 1\">\n <svg lucideChevronsLeft [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n\n<ng-template #previousPageButton>\n <li>\n @let previousPageTemplate = previousPageNavigationTemplate();\n @if (previousPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"previousPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() <= 1\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [disabled]=\"page() <= 1\"\n [attr.aria-label]=\"previousPageLabel\"\n (click)=\"onPreviousPageClick()\">\n <svg lucideChevronLeft [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n\n<ng-template #nextPageButton>\n <li>\n @let nextPageTemplate = nextPageNavigationTemplate();\n @if (nextPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"nextPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() < 1 || page() === pageCount()\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [disabled]=\"page() < 1 || page() === pageCount()\"\n [attr.aria-label]=\"nextPageLabel\"\n (click)=\"onNextPageClick()\">\n <svg lucideChevronRight [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n\n<ng-template #lastPageButton>\n <li>\n @let lastPageTemplate = lastPageNavigationTemplate();\n @if (lastPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"lastPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() === pageCount()\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"lastPageLabel\"\n (click)=\"onPageClick(pageCount())\"\n [disabled]=\"page() === pageCount()\">\n <svg lucideChevronsRight [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "maxValue", "minValue", "nullable", "readonly", "required", "invalid", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "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: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "itemDisabled", "invalid", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "valueField", "value"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "directive", type: PagerFocusableDirective, selector: "[monaPagerFocusable]" }, { kind: "directive", type: DropdownVirtualScrollDirective, selector: " mona-auto-complete[monaDropDownVirtualScroll], mona-dropdown-list[monaDropDownVirtualScroll], mona-combo-box[monaDropDownVirtualScroll], mona-multi-select[monaDropDownVirtualScroll] ", inputs: ["monaDropDownVirtualScroll"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: DropdownListValueTemplateDirective, selector: "ng-template[monaDropDownListValueTemplate]" }, { kind: "component", type: LucideEllipsis, selector: "svg[lucideEllipsis], svg[lucideMoreHorizontal]" }, { kind: "component", type: LucideChevronsLeft, selector: "svg[lucideChevronsLeft]" }, { kind: "component", type: LucideChevronLeft, selector: "svg[lucideChevronLeft]" }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }, { kind: "component", type: LucideChevronsRight, selector: "svg[lucideChevronsRight]" }, { kind: "pipe", type: SlicePipe, name: "monaSlice" }] }); }
|
|
756
704
|
}
|
|
757
705
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PagerComponent, decorators: [{
|
|
758
706
|
type: Component,
|
|
@@ -775,7 +723,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
775
723
|
"[attr.tabindex]": "navigable() ? 0 : null",
|
|
776
724
|
"[class]": "baseClasses()",
|
|
777
725
|
"(keydown)": "onKeydown($event)"
|
|
778
|
-
}, template: "@let numericButtonsTemplateRef = numericButtonsTemplate()?.templateRef;\r\n@let pageSizeTemplateRef = pageSizeTemplate();\r\n@let pagerInfoTemplateRef = pagerInfoTemplate()?.templateRef;\r\n\r\n@if (type() === \"numeric\") {\r\n @if (pageListVisible()) {\r\n <ol [class]=\"listClasses()\">\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\r\n }\r\n\r\n @if (numericButtonsTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"numericButtonsTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ totalPages: pageCount() }\"></ng-container>\r\n } @else {\r\n @if (pages().length !== 0) {\r\n <li [class]=\"pageItemClasses(page() === 1)\">\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [selected]=\"page() === 1\"\r\n [attr.aria-label]=\"'Page 1'\"\r\n [attr.aria-current]=\"page() === 1 ? 'page' : null\"\r\n (click)=\"onPageClick(1)\">\r\n 1\r\n </button>\r\n </li>\r\n }\r\n @if (previousJumperVisible()) {\r\n <li>\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"jumpPreviousLabel()\"\r\n (click)=\"onJumpPreviousClick()\">\r\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\r\n </button>\r\n </li>\r\n }\r\n\r\n @for (pageItem of pages() | monaSlice: 1 : pages().length - 1; track $index) {\r\n <li [attr.data-page]=\"pageItem.page\" [class]=\"pageItemClasses(page() === pageItem.page)\">\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [selected]=\"page() === pageItem.page\"\r\n [attr.aria-label]=\"'Page ' + pageItem.text\"\r\n [attr.aria-current]=\"page() === pageItem.page ? 'page' : null\"\r\n (click)=\"onPageClick(pageItem.page)\">\r\n {{ pageItem.text }}\r\n </button>\r\n </li>\r\n }\r\n\r\n @if (nextJumperVisible()) {\r\n <li>\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"jumpNextLabel()\"\r\n (click)=\"onJumpNextClick()\">\r\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\r\n </button>\r\n </li>\r\n }\r\n\r\n @if (pages().length > 1) {\r\n <li [class]=\"pageItemClasses(page() === pageCount())\">\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [selected]=\"page() === pageCount()\"\r\n [attr.aria-label]=\"'Page ' + pageCount()\"\r\n [attr.aria-current]=\"page() === pageCount() ? 'page' : null\"\r\n (click)=\"onPageClick(pageCount())\">\r\n {{ pageCount() }}\r\n </button>\r\n </li>\r\n }\r\n }\r\n\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\r\n }\r\n\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\r\n }\r\n\r\n @if (pageInputVisible() && pageInput()) {\r\n <li>\r\n <mona-numeric-text-box\r\n monaPagerFocusable\r\n [spinners]=\"false\"\r\n [minValue]=\"1\"\r\n [maxValue]=\"pageCount()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [ngModel]=\"inputValue()\"\r\n (ngModelChange)=\"inputValue.set($event)\"\r\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\r\n </li>\r\n }\r\n\r\n @if (pageInputVisible() && pageSizeDropdownData().length > 0) {\r\n <li>\r\n @if (pageSizeTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"pageSizeTemplateRef\"\r\n [ngTemplateOutletContext]=\"{ $implicit: pageSizeDropdownData() }\">\r\n </ng-container>\r\n } @else {\r\n <mona-dropdown-list\r\n monaPagerFocusable\r\n [data]=\"pageSizeDropdownData()\"\r\n [ngModel]=\"pageSize()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n (ngModelChange)=\"onPageSizeValueChange($event)\"\r\n #pageSizeDropdownList>\r\n <ng-template monaDropDownListValueTemplate let-item>\r\n <span>{{ item }} / page</span>\r\n </ng-template>\r\n </mona-dropdown-list>\r\n }\r\n </li>\r\n }\r\n </ol>\r\n }\r\n @if (infoVisible()) {\r\n @if (pagerInfoTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\r\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\r\n } @else {\r\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\r\n }\r\n }\r\n}\r\n@if (type() === \"input\") {\r\n <div [class]=\"inputClasses()\">\r\n @if (pageListVisible()) {\r\n <ol [class]=\"listClasses()\">\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\r\n }\r\n <li class=\"flex items-center gap-2 mx-2\">\r\n <span>Page</span>\r\n <mona-numeric-text-box\r\n monaPagerFocusable\r\n [spinners]=\"false\"\r\n [minValue]=\"1\"\r\n [maxValue]=\"pageCount()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [ngModel]=\"inputValue()\"\r\n (ngModelChange)=\"inputValue.set($event)\"\r\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\r\n <span>of</span>\r\n <span>{{ pageCount() }}</span>\r\n </li>\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\r\n }\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\r\n }\r\n </ol>\r\n }\r\n </div>\r\n @if (infoVisible()) {\r\n @if (pagerInfoTemplateRef) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\r\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\r\n } @else {\r\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\r\n }\r\n }\r\n}\r\n@if (!pageListVisible()) {\r\n <ol [class]=\"listClasses()\">\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\r\n }\r\n @if (pageCount() !== 0) {\r\n <li>\r\n <mona-dropdown-list\r\n monaPagerFocusable\r\n [data]=\"pageList()\"\r\n [ngModel]=\"page()\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n monaDropDownVirtualScroll\r\n (ngModelChange)=\"onPageClick($event)\"\r\n style=\"width: 75px\"></mona-dropdown-list>\r\n </li>\r\n }\r\n @if (previousNext()) {\r\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\r\n }\r\n @if (firstLast()) {\r\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\r\n }\r\n </ol>\r\n}\r\n\r\n<ng-template #firstPageButton>\r\n <li>\r\n @let firstPageTemplate = firstPageNavigationTemplate();\r\n @if (firstPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"firstPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() === 1\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"firstPageLabel\"\r\n (click)=\"onPageClick(1)\"\r\n [disabled]=\"page() === 1\">\r\n <svg lucideChevronsLeft [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #previousPageButton>\r\n <li>\r\n @let previousPageTemplate = previousPageNavigationTemplate();\r\n @if (previousPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"previousPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() <= 1\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [disabled]=\"page() <= 1\"\r\n [attr.aria-label]=\"previousPageLabel\"\r\n (click)=\"onPreviousPageClick()\">\r\n <svg lucideChevronLeft [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #nextPageButton>\r\n <li>\r\n @let nextPageTemplate = nextPageNavigationTemplate();\r\n @if (nextPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"nextPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() < 1 || page() === pageCount()\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [disabled]=\"page() < 1 || page() === pageCount()\"\r\n [attr.aria-label]=\"nextPageLabel\"\r\n (click)=\"onNextPageClick()\">\r\n <svg lucideChevronRight [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n\r\n<ng-template #lastPageButton>\r\n <li>\r\n @let lastPageTemplate = lastPageNavigationTemplate();\r\n @if (lastPageTemplate) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"lastPageTemplate.templateRef\"\r\n [ngTemplateOutletContext]=\"{\r\n totalPages: pageCount(),\r\n pageSize: pagerPageSize(),\r\n disabled: page() === pageCount()\r\n }\">\r\n </ng-container>\r\n } @else {\r\n <button\r\n monaPagerFocusable\r\n monaButton\r\n look=\"ghost\"\r\n [rounded]=\"rounded()\"\r\n [size]=\"size()\"\r\n [attr.aria-label]=\"lastPageLabel\"\r\n (click)=\"onPageClick(pageCount())\"\r\n [disabled]=\"page() === pageCount()\">\r\n <svg lucideChevronsRight [size]=\"iconSize()\"></svg>\r\n </button>\r\n }\r\n </li>\r\n</ng-template>\r\n" }]
|
|
726
|
+
}, template: "@let numericButtonsTemplateRef = numericButtonsTemplate()?.templateRef;\n@let pageSizeTemplateRef = pageSizeTemplate();\n@let pagerInfoTemplateRef = pagerInfoTemplate()?.templateRef;\n\n@if (type() === \"numeric\") {\n @if (pageListVisible()) {\n <ol [class]=\"listClasses()\">\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\n }\n\n @if (numericButtonsTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"numericButtonsTemplateRef\"\n [ngTemplateOutletContext]=\"{ totalPages: pageCount() }\"></ng-container>\n } @else {\n @if (pages().length !== 0) {\n <li [class]=\"pageItemClasses(page() === 1)\">\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [selected]=\"page() === 1\"\n [attr.aria-label]=\"'Page 1'\"\n [attr.aria-current]=\"page() === 1 ? 'page' : null\"\n (click)=\"onPageClick(1)\">\n 1\n </button>\n </li>\n }\n @if (previousJumperVisible()) {\n <li>\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"jumpPreviousLabel()\"\n (click)=\"onJumpPreviousClick()\">\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\n </button>\n </li>\n }\n\n @for (pageItem of pages() | monaSlice: 1 : pages().length - 1; track $index) {\n <li [attr.data-page]=\"pageItem.page\" [class]=\"pageItemClasses(page() === pageItem.page)\">\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [selected]=\"page() === pageItem.page\"\n [attr.aria-label]=\"'Page ' + pageItem.text\"\n [attr.aria-current]=\"page() === pageItem.page ? 'page' : null\"\n (click)=\"onPageClick(pageItem.page)\">\n {{ pageItem.text }}\n </button>\n </li>\n }\n\n @if (nextJumperVisible()) {\n <li>\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"jumpNextLabel()\"\n (click)=\"onJumpNextClick()\">\n <svg lucideEllipsis [size]=\"iconSize()\"></svg>\n </button>\n </li>\n }\n\n @if (pages().length > 1) {\n <li [class]=\"pageItemClasses(page() === pageCount())\">\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [selected]=\"page() === pageCount()\"\n [attr.aria-label]=\"'Page ' + pageCount()\"\n [attr.aria-current]=\"page() === pageCount() ? 'page' : null\"\n (click)=\"onPageClick(pageCount())\">\n {{ pageCount() }}\n </button>\n </li>\n }\n }\n\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\n }\n\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\n }\n\n @if (pageInputVisible() && pageInput()) {\n <li>\n <mona-numeric-text-box\n monaPagerFocusable\n [spinners]=\"false\"\n [minValue]=\"1\"\n [maxValue]=\"pageCount()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"inputValue.set($event)\"\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\n </li>\n }\n\n @if (pageInputVisible() && pageSizeDropdownData().length > 0) {\n <li>\n @if (pageSizeTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"pageSizeTemplateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: pageSizeDropdownData() }\">\n </ng-container>\n } @else {\n <mona-dropdown-list\n monaPagerFocusable\n [data]=\"pageSizeDropdownData()\"\n [ngModel]=\"pageSize()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (ngModelChange)=\"onPageSizeValueChange($event)\"\n #pageSizeDropdownList>\n <ng-template monaDropDownListValueTemplate let-item>\n <span>{{ item }} / page</span>\n </ng-template>\n </mona-dropdown-list>\n }\n </li>\n }\n </ol>\n }\n @if (infoVisible()) {\n @if (pagerInfoTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\n } @else {\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\n }\n }\n}\n@if (type() === \"input\") {\n <div [class]=\"inputClasses()\">\n @if (pageListVisible()) {\n <ol [class]=\"listClasses()\">\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\n }\n <li class=\"flex items-center gap-2 mx-2\">\n <span>Page</span>\n <mona-numeric-text-box\n monaPagerFocusable\n [spinners]=\"false\"\n [minValue]=\"1\"\n [maxValue]=\"pageCount()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"inputValue.set($event)\"\n (inputBlur)=\"onPageInputBlur()\"></mona-numeric-text-box>\n <span>of</span>\n <span>{{ pageCount() }}</span>\n </li>\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\n }\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\n }\n </ol>\n }\n </div>\n @if (infoVisible()) {\n @if (pagerInfoTemplateRef) {\n <ng-container\n [ngTemplateOutlet]=\"pagerInfoTemplateRef\"\n [ngTemplateOutletContext]=\"pagerInfoTemplateContext()\"></ng-container>\n } @else {\n <span [class]=\"infoClasses()\">{{ pagerInfo() }}</span>\n }\n }\n}\n@if (!pageListVisible()) {\n <ol [class]=\"listClasses()\">\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"firstPageButton\"></ng-container>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"previousPageButton\"></ng-container>\n }\n @if (pageCount() !== 0) {\n <li>\n <mona-dropdown-list\n monaPagerFocusable\n [data]=\"pageList()\"\n [ngModel]=\"page()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n monaDropDownVirtualScroll\n (ngModelChange)=\"onPageClick($event)\"\n style=\"width: 75px\"></mona-dropdown-list>\n </li>\n }\n @if (previousNext()) {\n <ng-container [ngTemplateOutlet]=\"nextPageButton\"></ng-container>\n }\n @if (firstLast()) {\n <ng-container [ngTemplateOutlet]=\"lastPageButton\"></ng-container>\n }\n </ol>\n}\n\n<ng-template #firstPageButton>\n <li>\n @let firstPageTemplate = firstPageNavigationTemplate();\n @if (firstPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"firstPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() === 1\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"firstPageLabel\"\n (click)=\"onPageClick(1)\"\n [disabled]=\"page() === 1\">\n <svg lucideChevronsLeft [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n\n<ng-template #previousPageButton>\n <li>\n @let previousPageTemplate = previousPageNavigationTemplate();\n @if (previousPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"previousPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() <= 1\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [disabled]=\"page() <= 1\"\n [attr.aria-label]=\"previousPageLabel\"\n (click)=\"onPreviousPageClick()\">\n <svg lucideChevronLeft [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n\n<ng-template #nextPageButton>\n <li>\n @let nextPageTemplate = nextPageNavigationTemplate();\n @if (nextPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"nextPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() < 1 || page() === pageCount()\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [disabled]=\"page() < 1 || page() === pageCount()\"\n [attr.aria-label]=\"nextPageLabel\"\n (click)=\"onNextPageClick()\">\n <svg lucideChevronRight [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n\n<ng-template #lastPageButton>\n <li>\n @let lastPageTemplate = lastPageNavigationTemplate();\n @if (lastPageTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"lastPageTemplate.templateRef\"\n [ngTemplateOutletContext]=\"{\n totalPages: pageCount(),\n pageSize: pagerPageSize(),\n disabled: page() === pageCount()\n }\">\n </ng-container>\n } @else {\n <button\n monaPagerFocusable\n monaButton\n look=\"ghost\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [attr.aria-label]=\"lastPageLabel\"\n (click)=\"onPageClick(pageCount())\"\n [disabled]=\"page() === pageCount()\">\n <svg lucideChevronsRight [size]=\"iconSize()\"></svg>\n </button>\n }\n </li>\n</ng-template>\n" }]
|
|
779
727
|
}], ctorParameters: () => [], propDecorators: { navigationButtonsTemplateList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PagerNavigationButtonsTemplateDirective), { isSignal: true }] }], numericButtonsTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PagerNumericButtonsTemplateDirective), { isSignal: true }] }], pageSizeDropdownList: [{ type: i0.ViewChild, args: ["pageSizeDropdownList", { isSignal: true }] }], pageSizeTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PagerPageSizeTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], pagerInfoTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => PagerInfoTemplateDirective), { isSignal: true }] }], firstLast: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstLast", required: false }] }], navigable: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigable", required: false }] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], pageInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageInput", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizeChange: [{ type: i0.Output, args: ["pageSizeChange"] }], pageSizeValues: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeValues", required: false }] }], previousNext: [{ type: i0.Input, args: [{ isSignal: true, alias: "previousNext", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], showInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showInfo", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], skip: [{ type: i0.Input, args: [{ isSignal: true, alias: "skip", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], userClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], visiblePages: [{ type: i0.Input, args: [{ isSignal: true, alias: "visiblePages", required: false }] }] } });
|
|
780
728
|
|
|
781
729
|
/*
|
|
@@ -1,49 +1,28 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
2
|
+
import { computed, input, Component } from '@angular/core';
|
|
4
3
|
import { twMerge } from 'tailwind-merge';
|
|
5
4
|
import { cva } from 'class-variance-authority';
|
|
6
5
|
|
|
7
|
-
const
|
|
8
|
-
flex items-center justify-center
|
|
9
|
-
|
|
10
|
-
p-2
|
|
6
|
+
const placeholderBaseThemeVariants = cva(`
|
|
7
|
+
flex items-center justify-center
|
|
8
|
+
h-full w-full
|
|
9
|
+
p-2
|
|
10
|
+
bg-surface-muted/50
|
|
11
11
|
`);
|
|
12
|
-
const
|
|
13
|
-
text-muted-foreground
|
|
14
|
-
uppercase
|
|
12
|
+
const placeholderTextThemeVariants = cva(`
|
|
13
|
+
uppercase text-muted-foreground
|
|
15
14
|
`);
|
|
16
15
|
|
|
17
|
-
const placeholderBaseThemeVariants = (theme) => {
|
|
18
|
-
switch (theme) {
|
|
19
|
-
case "mona":
|
|
20
|
-
return placeholderBaseVariants;
|
|
21
|
-
default:
|
|
22
|
-
return placeholderBaseVariants;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const placeholderTextThemeVariants = (theme) => {
|
|
26
|
-
switch (theme) {
|
|
27
|
-
case "mona":
|
|
28
|
-
return placeholderTextVariants;
|
|
29
|
-
default:
|
|
30
|
-
return placeholderTextVariants;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
16
|
class PlaceholderComponent {
|
|
35
17
|
constructor() {
|
|
36
|
-
this.#themeService = inject(ThemeService);
|
|
37
18
|
this.baseClass = computed(() => {
|
|
38
|
-
const
|
|
39
|
-
const variantClass = placeholderBaseThemeVariants(theme)();
|
|
19
|
+
const variantClass = placeholderBaseThemeVariants();
|
|
40
20
|
const userClass = this.userClass();
|
|
41
21
|
return twMerge(variantClass, userClass);
|
|
42
22
|
}, /* @ts-ignore */
|
|
43
23
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
44
24
|
this.textClass = computed(() => {
|
|
45
|
-
|
|
46
|
-
return placeholderTextThemeVariants(theme)();
|
|
25
|
+
return placeholderTextThemeVariants();
|
|
47
26
|
}, /* @ts-ignore */
|
|
48
27
|
...(ngDevMode ? [{ debugName: "textClass" }] : /* istanbul ignore next */ []));
|
|
49
28
|
/**
|
|
@@ -60,15 +39,14 @@ class PlaceholderComponent {
|
|
|
60
39
|
*/
|
|
61
40
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
62
41
|
}
|
|
63
|
-
#themeService;
|
|
64
42
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
65
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PlaceholderComponent, isStandalone: true, selector: "mona-placeholder", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@if (text()) {\
|
|
43
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PlaceholderComponent, isStandalone: true, selector: "mona-placeholder", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "@if (text()) {\n <span [class]=\"textClass()\">{{ text() }}</span>\n} @else {\n <ng-content></ng-content>\n}\n" }); }
|
|
66
44
|
}
|
|
67
45
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PlaceholderComponent, decorators: [{
|
|
68
46
|
type: Component,
|
|
69
47
|
args: [{ selector: "mona-placeholder", host: {
|
|
70
48
|
"[class]": "baseClass()"
|
|
71
|
-
}, template: "@if (text()) {\
|
|
49
|
+
}, template: "@if (text()) {\n <span [class]=\"textClass()\">{{ text() }}</span>\n} @else {\n <ng-content></ng-content>\n}\n" }]
|
|
72
50
|
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
73
51
|
|
|
74
52
|
/*
|