@nanahoshi/mona-ui 0.24.6 → 0.24.8
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/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +14 -4
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +233 -231
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-CD_ODHpU.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-DdyHnUIr.mjs} +24 -12
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-B6gq7Hu3.mjs +208 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DdUY3I7P.mjs +1100 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-Sa1aAtJ-.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-DG8Bu4Dy.mjs} +34 -21
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BvUM9nPt.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CVqpbMcb.mjs} +2565 -928
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +79 -11
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +20 -4
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +335 -45
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +565 -197
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +28 -2
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +598 -208
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +193 -74
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +58 -11
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +62 -11
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +62 -11
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +69 -11
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +58 -11
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +62 -11
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +58 -11
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +58 -11
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +62 -11
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +78 -11
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +58 -11
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +58 -11
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +58 -11
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +367 -463
- package/fesm2022/nanahoshi-mona-ui-query.mjs +317 -122
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +205 -140
- package/i18n/catalogs/en-US.messages.json +64 -17
- package/locales/ar-sa/ar-sa.messages.json +58 -11
- package/locales/de-de/de-de.messages.json +58 -11
- package/locales/es-es/es-es.messages.json +58 -11
- package/locales/fr-fr/fr-fr.messages.json +58 -11
- package/locales/id-id/id-id.messages.json +58 -11
- package/locales/it-it/it-it.messages.json +58 -11
- package/locales/ja-jp/ja-jp.messages.json +58 -11
- package/locales/ko-kr/ko-kr.messages.json +58 -11
- package/locales/pt-br/pt-br.messages.json +58 -11
- package/locales/ru-ru/ru-ru.messages.json +58 -11
- package/locales/tr-tr/tr-tr.messages.json +58 -11
- package/locales/zh-cn/zh-cn.messages.json +58 -11
- package/locales/zh-tw/zh-tw.messages.json +58 -11
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-check-box.d.ts +11 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +54 -32
- package/types/nanahoshi-mona-ui-grid.d.ts +359 -110
- package/types/nanahoshi-mona-ui-i18n.d.ts +97 -6
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +14 -2
- package/types/nanahoshi-mona-ui-internal-list.d.ts +89 -10
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +155 -40
- package/types/nanahoshi-mona-ui-internal.d.ts +10 -2
- package/types/nanahoshi-mona-ui-list-box.d.ts +148 -47
- package/types/nanahoshi-mona-ui-list-view.d.ts +111 -21
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +53 -6
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +53 -6
- package/types/nanahoshi-mona-ui-pager.d.ts +159 -76
- package/types/nanahoshi-mona-ui-query.d.ts +45 -14
- package/types/nanahoshi-mona-ui-tree-view.d.ts +84 -40
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-0jN7I1jo.mjs +0 -176
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BI_iE7pl.mjs +0 -946
|
@@ -7,53 +7,78 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
|
|
|
7
7
|
import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
8
8
|
import { VariantProps } from 'class-variance-authority';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The pager's state and actions, passed to every custom template.
|
|
12
|
+
*/
|
|
13
|
+
interface PagerContext {
|
|
14
|
+
/** The current page, starting at 1. */
|
|
15
|
+
readonly currentPage: number;
|
|
16
|
+
/** The position of the last item on the current page, or 0 when there are no items. */
|
|
17
|
+
readonly end: number;
|
|
18
|
+
/** Goes to a page (clamped to the page range) and emits `pageChange`, as a click on a page button does. */
|
|
19
|
+
goToPage(page: number): void;
|
|
13
20
|
/** The number of items per page. */
|
|
14
|
-
pageSize: number;
|
|
15
|
-
/** The
|
|
16
|
-
|
|
21
|
+
readonly pageSize: number;
|
|
22
|
+
/** The page sizes offered by the page-size dropdown. */
|
|
23
|
+
readonly pageSizes: readonly number[];
|
|
24
|
+
/** Changes the page size through the cancelable `pageSizeSelect` event, as the page-size dropdown does. `null` and values below 1 are ignored. */
|
|
25
|
+
setPageSize(pageSize: number | null): void;
|
|
26
|
+
/** The number of items before the current page. */
|
|
27
|
+
readonly skip: number;
|
|
28
|
+
/** The position of the first item on the current page, or 0 when there are no items. */
|
|
29
|
+
readonly start: number;
|
|
17
30
|
/** The total number of items. */
|
|
18
|
-
total: number;
|
|
31
|
+
readonly total: number;
|
|
19
32
|
/** The total number of pages. */
|
|
20
|
-
totalPages: number;
|
|
33
|
+
readonly totalPages: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface InfoTemplateContext extends PagerContext {
|
|
37
|
+
readonly $implicit: PagerContext;
|
|
21
38
|
}
|
|
22
39
|
|
|
23
40
|
declare class PagerInfoTemplateDirective {
|
|
24
41
|
readonly templateRef: TemplateRef<InfoTemplateContext>;
|
|
42
|
+
static ngTemplateContextGuard(_directive: PagerInfoTemplateDirective, _context: unknown): _context is InfoTemplateContext;
|
|
25
43
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PagerInfoTemplateDirective, never>;
|
|
26
44
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PagerInfoTemplateDirective, "ng-template[monaPagerInfoTemplate]", never, {}, {}, never, never, true, never>;
|
|
27
45
|
}
|
|
28
46
|
|
|
29
|
-
interface NavigationButtonsTemplateContext {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
47
|
+
interface NavigationButtonsTemplateContext extends PagerContext {
|
|
48
|
+
readonly $implicit: PagerContext;
|
|
49
|
+
/** True when the button has nowhere to go (the first or last page is current, or there are no pages). */
|
|
50
|
+
readonly disabled: boolean;
|
|
51
|
+
/** Goes to {@link targetPage}. */
|
|
52
|
+
navigate(): void;
|
|
53
|
+
/** The page the button goes to. */
|
|
54
|
+
readonly targetPage: number;
|
|
33
55
|
}
|
|
34
56
|
|
|
35
57
|
declare class PagerNavigationButtonsTemplateDirective {
|
|
36
58
|
readonly templateRef: TemplateRef<NavigationButtonsTemplateContext>;
|
|
37
59
|
readonly type: _angular_core.InputSignal<"first" | "last" | "next" | "previous">;
|
|
60
|
+
static ngTemplateContextGuard(_directive: PagerNavigationButtonsTemplateDirective, _context: unknown): _context is NavigationButtonsTemplateContext;
|
|
38
61
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PagerNavigationButtonsTemplateDirective, never>;
|
|
39
62
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PagerNavigationButtonsTemplateDirective, "ng-template[monaPagerNavigationButtonsTemplate]", never, { "type": { "alias": "type"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
40
63
|
}
|
|
41
64
|
|
|
42
|
-
|
|
43
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Context of `monaPagerNumericButtonsTemplate`. The template renders inside the pager's `<ol>`, so put each
|
|
67
|
+
* control in an `<li>`.
|
|
68
|
+
*/
|
|
69
|
+
interface NumericButtonsTemplateContext extends PagerContext {
|
|
70
|
+
readonly $implicit: PagerContext;
|
|
71
|
+
/** The page numbers the default buttons would show, in order (the first and last page included). */
|
|
72
|
+
readonly pages: readonly number[];
|
|
44
73
|
}
|
|
45
74
|
|
|
46
75
|
declare class PagerNumericButtonsTemplateDirective {
|
|
47
76
|
readonly templateRef: TemplateRef<NumericButtonsTemplateContext>;
|
|
77
|
+
static ngTemplateContextGuard(_directive: PagerNumericButtonsTemplateDirective, _context: unknown): _context is NumericButtonsTemplateContext;
|
|
48
78
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PagerNumericButtonsTemplateDirective, never>;
|
|
49
79
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PagerNumericButtonsTemplateDirective, "ng-template[monaPagerNumericButtonsTemplate]", never, {}, {}, never, never, true, never>;
|
|
50
80
|
}
|
|
51
81
|
|
|
52
|
-
interface Page {
|
|
53
|
-
page: number;
|
|
54
|
-
text: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
82
|
interface PageChangeEvent {
|
|
58
83
|
page: number;
|
|
59
84
|
skip: number;
|
|
@@ -62,12 +87,18 @@ interface PageChangeEvent {
|
|
|
62
87
|
|
|
63
88
|
type PagerType = "input" | "numeric";
|
|
64
89
|
|
|
90
|
+
/** The cancelable payload of the pager's `pageSizeSelect` event. */
|
|
65
91
|
declare class PageSizeChangeEvent extends PreventableEvent {
|
|
66
92
|
readonly newPageSize: number;
|
|
67
93
|
readonly oldPageSize: number;
|
|
68
94
|
constructor(newPageSize: number, oldPageSize: number);
|
|
69
95
|
}
|
|
70
96
|
|
|
97
|
+
interface PageSizeTemplateContext extends PagerContext {
|
|
98
|
+
/** The page sizes offered, as for the default dropdown. */
|
|
99
|
+
readonly $implicit: readonly number[];
|
|
100
|
+
}
|
|
101
|
+
|
|
71
102
|
declare const pagerBaseThemeVariants: (props?: ({
|
|
72
103
|
rounded?: "none" | "small" | "medium" | "large" | "full" | null | undefined;
|
|
73
104
|
size?: "small" | "medium" | "large" | null | undefined;
|
|
@@ -82,83 +113,128 @@ type PagerListVariantProps = VariantProps<typeof pagerListThemeVariants>;
|
|
|
82
113
|
type PagerListVariantInputs = VariantInputs<PagerListVariantProps>;
|
|
83
114
|
type PagerVariantInputs = PagerBaseVariantInputs & PagerInputVariantInputs & PagerListVariantInputs;
|
|
84
115
|
|
|
116
|
+
type PagerItem = {
|
|
117
|
+
readonly key: string;
|
|
118
|
+
readonly kind: "page";
|
|
119
|
+
readonly page: number;
|
|
120
|
+
} | {
|
|
121
|
+
readonly direction: "backward" | "forward";
|
|
122
|
+
readonly key: string;
|
|
123
|
+
readonly kind: "jump";
|
|
124
|
+
readonly page: number;
|
|
125
|
+
};
|
|
85
126
|
declare class PagerComponent implements PagerVariantInputs {
|
|
86
127
|
#private;
|
|
87
128
|
private readonly navigationButtonsTemplateList;
|
|
88
129
|
protected readonly baseClasses: Signal<string>;
|
|
130
|
+
protected readonly compact: Signal<boolean>;
|
|
131
|
+
/** The position of the last item on the current page, or 0 when there are no items. */
|
|
132
|
+
protected readonly end: Signal<number>;
|
|
133
|
+
protected readonly firstNavigationContext: Signal<NavigationButtonsTemplateContext>;
|
|
89
134
|
protected readonly firstPageNavigationTemplate: Signal<PagerNavigationButtonsTemplateDirective | undefined>;
|
|
90
135
|
protected readonly hasPages: Signal<boolean>;
|
|
91
|
-
protected readonly iconSize: Signal<
|
|
92
|
-
protected readonly infoClasses:
|
|
93
|
-
protected readonly
|
|
94
|
-
protected readonly inputClasses:
|
|
95
|
-
protected readonly inputValue: _angular_core.WritableSignal<number>;
|
|
136
|
+
protected readonly iconSize: Signal<20 | 18 | 22>;
|
|
137
|
+
protected readonly infoClasses: string;
|
|
138
|
+
protected readonly infoContext: Signal<InfoTemplateContext>;
|
|
139
|
+
protected readonly inputClasses: string;
|
|
140
|
+
protected readonly inputValue: _angular_core.WritableSignal<number | null>;
|
|
96
141
|
protected readonly jumpNextLabel: Signal<string>;
|
|
97
142
|
protected readonly jumpPreviousLabel: Signal<string>;
|
|
143
|
+
protected readonly lastNavigationContext: Signal<NavigationButtonsTemplateContext>;
|
|
98
144
|
protected readonly lastPageNavigationTemplate: Signal<PagerNavigationButtonsTemplateDirective | undefined>;
|
|
99
|
-
protected readonly listClasses:
|
|
145
|
+
protected readonly listClasses: string;
|
|
146
|
+
/** Announces page changes made by the user; programmatic changes stay silent. */
|
|
147
|
+
protected readonly liveStatus: _angular_core.WritableSignal<string>;
|
|
100
148
|
protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaPagerMessages>;
|
|
101
|
-
protected readonly
|
|
149
|
+
protected readonly nextNavigationContext: Signal<NavigationButtonsTemplateContext>;
|
|
102
150
|
protected readonly nextPageNavigationTemplate: Signal<PagerNavigationButtonsTemplateDirective | undefined>;
|
|
151
|
+
protected readonly numericButtonsContext: Signal<NumericButtonsTemplateContext>;
|
|
103
152
|
protected readonly numericButtonsTemplate: Signal<PagerNumericButtonsTemplateDirective | undefined>;
|
|
153
|
+
/** The current page: the page holding `skip`, clamped to the last page. */
|
|
104
154
|
protected readonly page: Signal<number>;
|
|
105
155
|
protected readonly pageCount: Signal<number>;
|
|
106
|
-
protected readonly
|
|
156
|
+
protected readonly pageInputId: string;
|
|
157
|
+
protected readonly pageInputLabelledBy: string;
|
|
158
|
+
protected readonly pageInputPrefixId: string;
|
|
159
|
+
protected readonly pageInputSuffixId: string;
|
|
160
|
+
protected readonly pageItems: Signal<PagerItem[]>;
|
|
107
161
|
protected readonly pageList: Signal<number[]>;
|
|
108
|
-
protected readonly
|
|
109
|
-
protected readonly pageSizeDropdownData: Signal<number[]>;
|
|
162
|
+
protected readonly pageSizeContext: Signal<PageSizeTemplateContext>;
|
|
110
163
|
protected readonly pageSizeDropdownList: Signal<DropdownListComponent<number> | undefined>;
|
|
164
|
+
protected readonly pageSizeOptions: Signal<readonly number[]>;
|
|
111
165
|
protected readonly pageSizeTemplate: Signal<TemplateRef<any> | undefined>;
|
|
166
|
+
/** The page size in use: `pageSize`, or the size the user picked since, as a whole number of at least 1. */
|
|
167
|
+
protected readonly pageSizeValue: Signal<number>;
|
|
168
|
+
protected readonly pagerContext: Signal<PagerContext>;
|
|
112
169
|
protected readonly pagerInfo: Signal<string>;
|
|
113
170
|
protected readonly pagerInfoTemplate: Signal<PagerInfoTemplateDirective | undefined>;
|
|
114
|
-
protected readonly
|
|
115
|
-
protected readonly pagerPageSize: _angular_core.WritableSignal<number>;
|
|
116
|
-
protected readonly pages: Signal<Page[]>;
|
|
117
|
-
protected readonly previousJumperVisible: Signal<boolean>;
|
|
171
|
+
protected readonly previousNavigationContext: Signal<NavigationButtonsTemplateContext>;
|
|
118
172
|
protected readonly previousPageNavigationTemplate: Signal<PagerNavigationButtonsTemplateDirective | undefined>;
|
|
173
|
+
/** `skip` as a whole number of at least 0. */
|
|
174
|
+
protected readonly skipValue: Signal<number>;
|
|
175
|
+
/** The position of the first item on the current page, or 0 when there are no items. */
|
|
176
|
+
protected readonly start: Signal<number>;
|
|
177
|
+
/**
|
|
178
|
+
* @description Accessible name of the pager's navigation landmark. Defaults to the localized "Pagination";
|
|
179
|
+
* name each pager when a page has several.
|
|
180
|
+
*/
|
|
181
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
182
|
+
/**
|
|
183
|
+
* @description Id of the element that names the pager. Takes precedence over {@link ariaLabel}.
|
|
184
|
+
*/
|
|
185
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string>;
|
|
119
186
|
/**
|
|
120
187
|
* @description Shows the first and last page navigation buttons.
|
|
121
188
|
* @default true
|
|
122
189
|
*/
|
|
123
|
-
readonly firstLast: _angular_core.
|
|
190
|
+
readonly firstLast: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
124
191
|
/**
|
|
125
|
-
* @description Enables
|
|
192
|
+
* @description Enables page shortcuts while a pager button has focus: Page Up and Page Down go to the
|
|
193
|
+
* previous and next page, Home and End to the first and last, and the left and right arrows to the previous
|
|
194
|
+
* and next page (mirrored right to left). The buttons themselves are always ordinary tab stops.
|
|
126
195
|
* @default true
|
|
127
196
|
*/
|
|
128
|
-
readonly navigable: _angular_core.
|
|
197
|
+
readonly navigable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
129
198
|
/**
|
|
130
|
-
* @description Emitted when the
|
|
199
|
+
* @description Emitted when the user changes the page or the page size, or when the pager corrects a `skip`
|
|
200
|
+
* that is past the last page or not on a page boundary. Setting `skip` or `pageSize` from code to a valid
|
|
201
|
+
* value doesn't emit it.
|
|
131
202
|
*/
|
|
132
203
|
readonly pageChange: _angular_core.OutputEmitterRef<PageChangeEvent>;
|
|
133
204
|
/**
|
|
134
205
|
* @description Shows a numeric input for jumping directly to a page.
|
|
135
206
|
* @default false
|
|
136
207
|
*/
|
|
137
|
-
readonly pageInput: _angular_core.
|
|
208
|
+
readonly pageInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
138
209
|
/**
|
|
139
|
-
* @description Number of items displayed per page.
|
|
210
|
+
* @description Number of items displayed per page; values below 1 count as 1. Supports two-way binding
|
|
211
|
+
* (`[(pageSize)]`): `pageSizeChange` emits the new size after the user changes it, and `pageChange` reports it
|
|
212
|
+
* as `take`.
|
|
140
213
|
* @default 5
|
|
141
214
|
*/
|
|
142
|
-
readonly pageSize: _angular_core.
|
|
215
|
+
readonly pageSize: _angular_core.ModelSignal<number>;
|
|
143
216
|
/**
|
|
144
|
-
* @description Emitted when the page size
|
|
217
|
+
* @description Emitted when the user picks a page size, before it is applied. Call `preventDefault()` on the
|
|
218
|
+
* event to keep the current size.
|
|
145
219
|
*/
|
|
146
|
-
readonly
|
|
220
|
+
readonly pageSizeSelect: _angular_core.OutputEmitterRef<PageSizeChangeEvent>;
|
|
147
221
|
/**
|
|
148
|
-
* @description Page-size options shown in the page-size dropdown.
|
|
222
|
+
* @description Page-size options shown in the page-size dropdown. `true` shows the default options; `false`
|
|
223
|
+
* or an empty array hides the dropdown.
|
|
149
224
|
* @default [5, 10, 20, 50, 100]
|
|
150
225
|
*/
|
|
151
|
-
readonly pageSizeValues: _angular_core.InputSignal<boolean | number[]>;
|
|
226
|
+
readonly pageSizeValues: _angular_core.InputSignal<boolean | readonly number[]>;
|
|
152
227
|
/**
|
|
153
228
|
* @description Shows the previous and next page navigation buttons.
|
|
154
229
|
* @default true
|
|
155
230
|
*/
|
|
156
|
-
readonly previousNext: _angular_core.
|
|
231
|
+
readonly previousNext: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
157
232
|
/**
|
|
158
|
-
* @description
|
|
233
|
+
* @description Replaces the page buttons with a page dropdown when the pager is narrower than 480px.
|
|
234
|
+
* Other sections wrap onto a new line instead of being hidden.
|
|
159
235
|
* @default true
|
|
160
236
|
*/
|
|
161
|
-
readonly responsive: _angular_core.
|
|
237
|
+
readonly responsive: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
162
238
|
/**
|
|
163
239
|
* @description Border-radius preset applied to the component.
|
|
164
240
|
* @default "medium"
|
|
@@ -168,22 +244,23 @@ declare class PagerComponent implements PagerVariantInputs {
|
|
|
168
244
|
* @description Displays the summary of the current page range and total item count.
|
|
169
245
|
* @default true
|
|
170
246
|
*/
|
|
171
|
-
readonly showInfo: _angular_core.
|
|
247
|
+
readonly showInfo: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
172
248
|
/**
|
|
173
249
|
* @description Size preset controlling the component's dimensions.
|
|
174
250
|
* @default "medium"
|
|
175
251
|
*/
|
|
176
252
|
readonly size: _angular_core.InputSignal<"small" | "medium" | "large" | null | undefined>;
|
|
177
253
|
/**
|
|
178
|
-
* @description Number of items
|
|
254
|
+
* @description Number of items before the current page. Supports two-way binding. A value past the last page,
|
|
255
|
+
* or between page boundaries, is corrected to the start of the page that holds it, and `pageChange` reports it.
|
|
179
256
|
* @default 0
|
|
180
257
|
*/
|
|
181
|
-
readonly skip: _angular_core.
|
|
258
|
+
readonly skip: _angular_core.ModelSignal<number>;
|
|
182
259
|
/**
|
|
183
260
|
* @description Total number of items in the paged collection.
|
|
184
261
|
* @default 0
|
|
185
262
|
*/
|
|
186
|
-
readonly total: _angular_core.
|
|
263
|
+
readonly total: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
187
264
|
/**
|
|
188
265
|
* @description Visual mode of the pager: numeric page buttons, or a page-jump input.
|
|
189
266
|
* @default "numeric"
|
|
@@ -195,58 +272,64 @@ declare class PagerComponent implements PagerVariantInputs {
|
|
|
195
272
|
*/
|
|
196
273
|
readonly userClasses: _angular_core.InputSignal<string>;
|
|
197
274
|
/**
|
|
198
|
-
* @description Number of
|
|
275
|
+
* @description Number of page buttons shown between the first and last page before the rest collapse into
|
|
276
|
+
* jump buttons. At least 1.
|
|
199
277
|
* @default 5
|
|
200
278
|
*/
|
|
201
|
-
readonly visiblePages: _angular_core.
|
|
279
|
+
readonly visiblePages: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
202
280
|
constructor();
|
|
281
|
+
protected changePageSize(value: number | null): void;
|
|
282
|
+
protected commitPageInput(): void;
|
|
203
283
|
protected formatPageNumber(value: number): string;
|
|
204
|
-
|
|
205
|
-
protected
|
|
284
|
+
/** Goes to a page (clamped to the page range), as a user action: emits `pageChange` and announces the range. */
|
|
285
|
+
protected goToPage(page: number | null): void;
|
|
206
286
|
protected onKeydown(event: KeyboardEvent): void;
|
|
207
|
-
protected
|
|
208
|
-
protected onPageClick(page: number): void;
|
|
209
|
-
protected onPageInputBlur(): void;
|
|
210
|
-
protected onPageSizeValueChange(value: number): void;
|
|
211
|
-
protected onPreviousPageClick(): void;
|
|
287
|
+
protected onPageInputEnter(event: Event): void;
|
|
212
288
|
protected pageItemClasses(active: boolean): string;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
private
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
private
|
|
223
|
-
private
|
|
224
|
-
private
|
|
225
|
-
private
|
|
226
|
-
private
|
|
289
|
+
/**
|
|
290
|
+
* After a user change: announces the new range, and keeps focus in the pager when the focused control was
|
|
291
|
+
* removed or disabled (a jump button that is no longer needed, Next on the last page).
|
|
292
|
+
*/
|
|
293
|
+
private afterUserChange;
|
|
294
|
+
/**
|
|
295
|
+
* The page buttons: the first and last page, a window of `visiblePages` pages around the current one, and a
|
|
296
|
+
* jump button for each longer gap. A gap of one page shows that page instead.
|
|
297
|
+
*/
|
|
298
|
+
private buildPageItems;
|
|
299
|
+
private createNavigationContext;
|
|
300
|
+
private emitPageChange;
|
|
301
|
+
private findNavigationTemplate;
|
|
302
|
+
private focusedInside;
|
|
303
|
+
private isDisabled;
|
|
227
304
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PagerComponent, never>;
|
|
228
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PagerComponent, "mona-pager", never, { "firstLast": { "alias": "firstLast"; "required": false; "isSignal": true; }; "navigable": { "alias": "navigable"; "required": false; "isSignal": true; }; "pageInput": { "alias": "pageInput"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageSizeValues": { "alias": "pageSizeValues"; "required": false; "isSignal": true; }; "previousNext": { "alias": "previousNext"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "showInfo": { "alias": "showInfo"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "skip": { "alias": "skip"; "required": false; "isSignal": true; }; "total": { "alias": "total"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClasses": { "alias": "class"; "required": false; "isSignal": true; }; "visiblePages": { "alias": "visiblePages"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; "
|
|
305
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PagerComponent, "mona-pager", never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "firstLast": { "alias": "firstLast"; "required": false; "isSignal": true; }; "navigable": { "alias": "navigable"; "required": false; "isSignal": true; }; "pageInput": { "alias": "pageInput"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageSizeValues": { "alias": "pageSizeValues"; "required": false; "isSignal": true; }; "previousNext": { "alias": "previousNext"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "showInfo": { "alias": "showInfo"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "skip": { "alias": "skip"; "required": false; "isSignal": true; }; "total": { "alias": "total"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClasses": { "alias": "class"; "required": false; "isSignal": true; }; "visiblePages": { "alias": "visiblePages"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; "pageSize": "pageSizeChange"; "pageSizeSelect": "pageSizeSelect"; "skip": "skipChange"; }, ["navigationButtonsTemplateList", "numericButtonsTemplate", "pageSizeTemplate", "pagerInfoTemplate"], never, true, never>;
|
|
229
306
|
}
|
|
230
307
|
|
|
231
308
|
declare class PagerPageSizeTemplateDirective {
|
|
309
|
+
static ngTemplateContextGuard(_directive: PagerPageSizeTemplateDirective, _context: unknown): _context is PageSizeTemplateContext;
|
|
232
310
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PagerPageSizeTemplateDirective, never>;
|
|
233
311
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PagerPageSizeTemplateDirective, "ng-template[monaPagerPageSizeTemplate]", never, {}, {}, never, never, true, never>;
|
|
234
312
|
}
|
|
235
313
|
|
|
236
314
|
declare const PAGER_DEFAULT_MESSAGES: {
|
|
237
315
|
firstPageLabel: string;
|
|
316
|
+
itemsPerPageLabel: string;
|
|
238
317
|
jumpBackwardLabel: (pages: number) => string;
|
|
239
318
|
jumpForwardLabel: (pages: number) => string;
|
|
240
319
|
lastPageLabel: string;
|
|
241
320
|
nextPageLabel: string;
|
|
242
321
|
ofText: string;
|
|
322
|
+
pageInputPrefix: (_totalPages: number) => string;
|
|
323
|
+
pageInputSuffix: (totalPages: number) => string;
|
|
243
324
|
pageLabel: (page: number) => string;
|
|
325
|
+
pageSelectLabel: string;
|
|
244
326
|
pageSizeLabel: (pageSize: number) => string;
|
|
245
327
|
pageStatus: (page: number, totalPages: number) => string;
|
|
246
328
|
pageText: string;
|
|
329
|
+
pagerLabel: string;
|
|
247
330
|
previousPageLabel: string;
|
|
248
331
|
rangeStatus: (start: number, end: number, total: number) => string;
|
|
249
332
|
};
|
|
250
333
|
|
|
251
334
|
export { PAGER_DEFAULT_MESSAGES, PageSizeChangeEvent, PagerComponent, PagerInfoTemplateDirective, PagerNavigationButtonsTemplateDirective, PagerNumericButtonsTemplateDirective, PagerPageSizeTemplateDirective };
|
|
252
|
-
export type { PageChangeEvent };
|
|
335
|
+
export type { InfoTemplateContext, NavigationButtonsTemplateContext, NumericButtonsTemplateContext, PageChangeEvent, PageSizeTemplateContext, PagerContext, PagerType };
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Selector } from '@mirei/ts-collections';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description Options shared by sorting and filtering.
|
|
5
|
+
*/
|
|
6
|
+
interface QueryOptions {
|
|
7
|
+
/**
|
|
8
|
+
* @description BCP 47 locale used to compare and lowercase strings. Defaults to the runtime's locale.
|
|
9
|
+
*/
|
|
10
|
+
readonly locale?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Compares two field values with one total order, so sorts, group orders and min/max agree:
|
|
14
|
+
* - empty values come first and are equal to each other: null, undefined, NaN, invalid dates, and values
|
|
15
|
+
* with no natural order (objects, arrays, symbols, functions);
|
|
16
|
+
* - then booleans, numbers and bigints (by value), dates (`Date` or luxon `DateTime`, by time),
|
|
17
|
+
* and strings (by the locale, with digits compared by value: "item 2" before "item 10").
|
|
18
|
+
*/
|
|
19
|
+
declare function compareValues(left: unknown, right: unknown, options?: QueryOptions): number;
|
|
2
20
|
|
|
3
21
|
type CommonFilterOperators = "eq" | "neq";
|
|
4
22
|
type NullFilterOperators = "isnull" | "isnotnull";
|
|
@@ -17,7 +35,7 @@ type FieldDefinition = {
|
|
|
17
35
|
};
|
|
18
36
|
type CommonFilterDescriptor = FieldDefinition & {
|
|
19
37
|
operator: CommonFilterOperators;
|
|
20
|
-
value:
|
|
38
|
+
value: unknown;
|
|
21
39
|
};
|
|
22
40
|
type NullFilterDescriptor = FieldDefinition & {
|
|
23
41
|
operator: NullFilterOperators;
|
|
@@ -45,45 +63,58 @@ type DateFilterDescriptor = FieldDefinition & ({
|
|
|
45
63
|
} | NullFilterDescriptor);
|
|
46
64
|
type ArrayFilterDescriptor = FieldDefinition & {
|
|
47
65
|
operator: ArrayFilterOperators;
|
|
48
|
-
value:
|
|
66
|
+
value: readonly unknown[];
|
|
49
67
|
};
|
|
68
|
+
/** A bound of a range filter. `null` leaves that end open. */
|
|
69
|
+
type RangeFilterBound = number | Date | string | null;
|
|
70
|
+
/** `between` and `notbetween` include both bounds. */
|
|
50
71
|
type RangeFilterDescriptor = FieldDefinition & {
|
|
51
72
|
operator: RangeFilterOperators;
|
|
52
|
-
value: [
|
|
73
|
+
value: readonly [from: RangeFilterBound, to: RangeFilterBound];
|
|
53
74
|
};
|
|
54
75
|
type FunctionFilterDescriptor = FieldDefinition & {
|
|
55
76
|
operator: FunctionFilterOperators;
|
|
56
|
-
|
|
77
|
+
/** Receives the value of `field`, not the row. */
|
|
78
|
+
predicate(value: unknown): boolean;
|
|
57
79
|
};
|
|
58
80
|
type FilterDescriptor = CommonFilterDescriptor | BooleanFilterDescriptor | NumericFilterDescriptor | StringFilterDescriptor | DateFilterDescriptor | NullFilterDescriptor | EmptyFilterDescriptor | NullOrEmptyFilterDescriptor | ArrayFilterDescriptor | RangeFilterDescriptor | FunctionFilterDescriptor;
|
|
59
81
|
type FilterLogic = "and" | "or";
|
|
82
|
+
/** An empty `filters` list matches every item, whatever the logic. */
|
|
60
83
|
interface CompositeFilterDescriptor {
|
|
61
|
-
logic: FilterLogic;
|
|
62
84
|
filters: Array<FilterDescriptor | CompositeFilterDescriptor>;
|
|
85
|
+
logic: FilterLogic;
|
|
63
86
|
}
|
|
64
87
|
|
|
65
|
-
interface SortDescriptor<
|
|
88
|
+
interface SortDescriptor<TValue = unknown> {
|
|
66
89
|
dir: SortDirection;
|
|
67
90
|
field: string;
|
|
68
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Compares two values of `field` (not two rows). Return a negative number when `left` comes first
|
|
93
|
+
* in ascending order; `dir: "desc"` reverses the result. Empty values are passed in as they are.
|
|
94
|
+
*/
|
|
95
|
+
sort?(left: TValue, right: TValue): number;
|
|
69
96
|
}
|
|
70
97
|
type SortDirection = "asc" | "desc";
|
|
71
98
|
|
|
72
99
|
interface IQuery<T> extends Iterable<T> {
|
|
73
100
|
filter<R>(filter: FilterDescriptor | CompositeFilterDescriptor, fieldSelector?: Selector<T, R>): IQuery<T>;
|
|
74
101
|
run(): T[];
|
|
75
|
-
sort<R>(descriptor: SortDescriptor
|
|
102
|
+
sort<R>(descriptor: readonly SortDescriptor[], fieldSelector?: Selector<T, R>): IQuery<T>;
|
|
76
103
|
}
|
|
77
104
|
declare class Query<T> implements IQuery<T> {
|
|
78
105
|
#private;
|
|
79
|
-
private readonly iterable;
|
|
80
106
|
private constructor();
|
|
107
|
+
/**
|
|
108
|
+
* @description Starts a query over the given items.
|
|
109
|
+
* @param iterable The items to filter and sort.
|
|
110
|
+
* @param options `locale` sets how strings are compared and lowercased; it defaults to the runtime's locale.
|
|
111
|
+
*/
|
|
112
|
+
static from<T>(iterable: Iterable<T>, options?: QueryOptions): IQuery<T>;
|
|
81
113
|
[Symbol.iterator](): Iterator<T>;
|
|
82
|
-
static from<T>(iterable: Iterable<T>): IQuery<T>;
|
|
83
114
|
filter<R>(filter: FilterDescriptor | CompositeFilterDescriptor, fieldSelector?: Selector<T, R>): IQuery<T>;
|
|
84
115
|
run(): T[];
|
|
85
|
-
sort<R>(descriptor: SortDescriptor
|
|
116
|
+
sort<R>(descriptor: readonly SortDescriptor[], fieldSelector?: Selector<T, R>): IQuery<T>;
|
|
86
117
|
}
|
|
87
118
|
|
|
88
|
-
export { Query };
|
|
89
|
-
export type { ArrayFilterDescriptor, ArrayFilterOperators, BooleanFilterDescriptor, BooleanFilterOperators, CommonFilterDescriptor, CommonFilterOperators, CompositeFilterDescriptor, DateFilterDescriptor, DateFilterOperators, EmptyFilterDescriptor, EmptyFilterOperators, FieldDefinition, FilterDescriptor, FilterLogic, FilterOperators, FunctionFilterDescriptor, FunctionFilterOperators, NullFilterDescriptor, NullFilterOperators, NullOrEmptyFilterDescriptor, NullOrEmptyFilterOperators, NumericFilterDescriptor, NumericFilterOperators, RangeFilterDescriptor, RangeFilterOperators, SortDescriptor, SortDirection, StringFilterDescriptor, StringFilterOperators };
|
|
119
|
+
export { Query, compareValues };
|
|
120
|
+
export type { ArrayFilterDescriptor, ArrayFilterOperators, BooleanFilterDescriptor, BooleanFilterOperators, CommonFilterDescriptor, CommonFilterOperators, CompositeFilterDescriptor, DateFilterDescriptor, DateFilterOperators, EmptyFilterDescriptor, EmptyFilterOperators, FieldDefinition, FilterDescriptor, FilterLogic, FilterOperators, FunctionFilterDescriptor, FunctionFilterOperators, NullFilterDescriptor, NullFilterOperators, NullOrEmptyFilterDescriptor, NullOrEmptyFilterOperators, NumericFilterDescriptor, NumericFilterOperators, QueryOptions, RangeFilterBound, RangeFilterDescriptor, RangeFilterOperators, SortDescriptor, SortDirection, StringFilterDescriptor, StringFilterOperators };
|