@mk-kit/ui 0.42.0 → 0.44.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/README.md +5 -3
- package/THIRD_PARTY_NOTICES.md +4 -2
- package/fesm2022/mk-kit-ui-block-editor.mjs +4 -2
- package/fesm2022/mk-kit-ui-block-editor.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-checkbox.mjs +4 -2
- package/fesm2022/mk-kit-ui-checkbox.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-core.mjs +136 -1
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-data.mjs +438 -8
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-datetime.mjs +88 -50
- package/fesm2022/mk-kit-ui-datetime.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-directives.mjs +27 -8
- package/fesm2022/mk-kit-ui-directives.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-dnd.mjs +43 -8
- package/fesm2022/mk-kit-ui-dnd.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-dynamic-form.mjs +149 -2
- package/fesm2022/mk-kit-ui-dynamic-form.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-feedback.mjs +1 -1
- package/fesm2022/mk-kit-ui-feedback.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-forms.mjs +326 -78
- package/fesm2022/mk-kit-ui-forms.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-icon-extended.mjs +425 -0
- package/fesm2022/mk-kit-ui-icon-extended.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-icon.mjs +296 -459
- package/fesm2022/mk-kit-ui-icon.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-media.mjs +1 -1
- package/fesm2022/mk-kit-ui-media.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-query-builder.mjs +1 -1
- package/fesm2022/mk-kit-ui-query-builder.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-rich-text.mjs +4 -2
- package/fesm2022/mk-kit-ui-rich-text.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-table.mjs +668 -24
- package/fesm2022/mk-kit-ui-table.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-testing.mjs +54 -0
- package/fesm2022/mk-kit-ui-testing.mjs.map +1 -1
- package/fesm2022/mk-kit-ui.mjs +1 -0
- package/fesm2022/mk-kit-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/schematics/migrate-primeng/transform.js +4 -1
- package/schematics/ng-add/index.js +30 -2
- package/schematics/ng-add/schema.json +6 -0
- package/types/mk-kit-ui-block-editor.d.ts +2 -0
- package/types/mk-kit-ui-checkbox.d.ts +2 -0
- package/types/mk-kit-ui-core.d.ts +82 -2
- package/types/mk-kit-ui-data.d.ts +203 -2
- package/types/mk-kit-ui-datetime.d.ts +41 -19
- package/types/mk-kit-ui-directives.d.ts +12 -6
- package/types/mk-kit-ui-dnd.d.ts +32 -4
- package/types/mk-kit-ui-dynamic-form.d.ts +44 -1
- package/types/mk-kit-ui-forms.d.ts +154 -16
- package/types/mk-kit-ui-icon-extended.d.ts +83 -0
- package/types/mk-kit-ui-icon.d.ts +100 -17
- package/types/mk-kit-ui-rich-text.d.ts +2 -0
- package/types/mk-kit-ui-table.d.ts +234 -25
- package/types/mk-kit-ui-testing.d.ts +16 -0
- package/types/mk-kit-ui.d.ts +1 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { MkIconMap } from '@mk-kit/ui/icon';
|
|
2
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* GENERATED by scripts/gen-icons.mjs from scripts/icons.json — do not edit.
|
|
6
|
+
*
|
|
7
|
+
* The opt-in extended icon set: `MK_EXTENDED_ICONS` (everything) and one `MK_EXTENDED_ICONS_<GROUP>` subset per themed group. Every map is built by a call marked pure, so an app pays only for the maps it actually passes to `provideMkIcons()` / `provideMkExtendedIcons()`.
|
|
8
|
+
*
|
|
9
|
+
* Glyphs © Lucide Icons and Contributors, ISC licence (lucide-static
|
|
10
|
+
* v1.34.0); see THIRD_PARTY_NOTICES.md. Bodies only — the registry-facing
|
|
11
|
+
* maps wrap them with the same `<svg>` attributes as the hand-made defaults
|
|
12
|
+
* so both sets render identically.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** `navigation` subset of {@link MK_EXTENDED_ICONS} (34 icons). */
|
|
16
|
+
declare const MK_EXTENDED_ICONS_NAVIGATION: MkIconMap;
|
|
17
|
+
/** `layout` subset of {@link MK_EXTENDED_ICONS} (17 icons). */
|
|
18
|
+
declare const MK_EXTENDED_ICONS_LAYOUT: MkIconMap;
|
|
19
|
+
/** `data` subset of {@link MK_EXTENDED_ICONS} (15 icons). */
|
|
20
|
+
declare const MK_EXTENDED_ICONS_DATA: MkIconMap;
|
|
21
|
+
/** `files` subset of {@link MK_EXTENDED_ICONS} (22 icons). */
|
|
22
|
+
declare const MK_EXTENDED_ICONS_FILES: MkIconMap;
|
|
23
|
+
/** `communication` subset of {@link MK_EXTENDED_ICONS} (15 icons). */
|
|
24
|
+
declare const MK_EXTENDED_ICONS_COMMUNICATION: MkIconMap;
|
|
25
|
+
/** `people` subset of {@link MK_EXTENDED_ICONS} (11 icons). */
|
|
26
|
+
declare const MK_EXTENDED_ICONS_PEOPLE: MkIconMap;
|
|
27
|
+
/** `commerce` subset of {@link MK_EXTENDED_ICONS} (23 icons). */
|
|
28
|
+
declare const MK_EXTENDED_ICONS_COMMERCE: MkIconMap;
|
|
29
|
+
/** `status` subset of {@link MK_EXTENDED_ICONS} (20 icons). */
|
|
30
|
+
declare const MK_EXTENDED_ICONS_STATUS: MkIconMap;
|
|
31
|
+
/** `time` subset of {@link MK_EXTENDED_ICONS} (8 icons). */
|
|
32
|
+
declare const MK_EXTENDED_ICONS_TIME: MkIconMap;
|
|
33
|
+
/** `developer` subset of {@link MK_EXTENDED_ICONS} (23 icons). */
|
|
34
|
+
declare const MK_EXTENDED_ICONS_DEVELOPER: MkIconMap;
|
|
35
|
+
/** `devices` subset of {@link MK_EXTENDED_ICONS} (15 icons). */
|
|
36
|
+
declare const MK_EXTENDED_ICONS_DEVICES: MkIconMap;
|
|
37
|
+
/** `media` subset of {@link MK_EXTENDED_ICONS} (14 icons). */
|
|
38
|
+
declare const MK_EXTENDED_ICONS_MEDIA: MkIconMap;
|
|
39
|
+
/** `editing` subset of {@link MK_EXTENDED_ICONS} (34 icons). */
|
|
40
|
+
declare const MK_EXTENDED_ICONS_EDITING: MkIconMap;
|
|
41
|
+
/** `security` subset of {@link MK_EXTENDED_ICONS} (5 icons). */
|
|
42
|
+
declare const MK_EXTENDED_ICONS_SECURITY: MkIconMap;
|
|
43
|
+
/** `travel` subset of {@link MK_EXTENDED_ICONS} (9 icons). */
|
|
44
|
+
declare const MK_EXTENDED_ICONS_TRAVEL: MkIconMap;
|
|
45
|
+
/** `lifestyle` subset of {@link MK_EXTENDED_ICONS} (40 icons). */
|
|
46
|
+
declare const MK_EXTENDED_ICONS_LIFESTYLE: MkIconMap;
|
|
47
|
+
/**
|
|
48
|
+
* The themed subsets by group name — handy for a picker or for registering
|
|
49
|
+
* several groups at once: `provideMkIcons(MK_EXTENDED_ICON_GROUPS['files'])`.
|
|
50
|
+
*/
|
|
51
|
+
declare const MK_EXTENDED_ICON_GROUPS: Readonly<Record<string, MkIconMap>>;
|
|
52
|
+
/**
|
|
53
|
+
* Every Lucide-derived icon (305 glyphs). Not registered by
|
|
54
|
+
* default — install it with `provideMkExtendedIcons()`, pass a themed subset
|
|
55
|
+
* to `provideMkIcons()`, or load it lazily:
|
|
56
|
+
* `provideMkIcons(() => import('@mk-kit/ui/icon/extended').then((m) => m.MK_EXTENDED_ICONS))`.
|
|
57
|
+
*/
|
|
58
|
+
declare const MK_EXTENDED_ICONS: MkIconMap;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Registers the whole Lucide-derived extended set ({@link MK_EXTENDED_ICONS})
|
|
62
|
+
* so every `<mk-icon name="…">` in the catalogue resolves. Opt-in: without
|
|
63
|
+
* it only the hand-made defaults are available and an unknown name warns
|
|
64
|
+
* once in dev mode.
|
|
65
|
+
*
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { provideMkExtendedIcons } from '@mk-kit/ui/icon/extended';
|
|
68
|
+
*
|
|
69
|
+
* bootstrapApplication(App, {
|
|
70
|
+
* providers: [provideMkExtendedIcons()],
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* Size-conscious alternatives (see `provideMkIcons`): register only the
|
|
75
|
+
* themed subsets you use (`provideMkIcons(MK_EXTENDED_ICONS_FILES)`), or load
|
|
76
|
+
* the full set lazily in its own chunk:
|
|
77
|
+
* `provideMkIcons(() => import('@mk-kit/ui/icon/extended').then((m) => m.MK_EXTENDED_ICONS))`.
|
|
78
|
+
* The hand-made defaults keep their names — the generated set never
|
|
79
|
+
* overlaps them.
|
|
80
|
+
*/
|
|
81
|
+
declare function provideMkExtendedIcons(): EnvironmentProviders;
|
|
82
|
+
|
|
83
|
+
export { MK_EXTENDED_ICONS, MK_EXTENDED_ICONS_COMMERCE, MK_EXTENDED_ICONS_COMMUNICATION, MK_EXTENDED_ICONS_DATA, MK_EXTENDED_ICONS_DEVELOPER, MK_EXTENDED_ICONS_DEVICES, MK_EXTENDED_ICONS_EDITING, MK_EXTENDED_ICONS_FILES, MK_EXTENDED_ICONS_LAYOUT, MK_EXTENDED_ICONS_LIFESTYLE, MK_EXTENDED_ICONS_MEDIA, MK_EXTENDED_ICONS_NAVIGATION, MK_EXTENDED_ICONS_PEOPLE, MK_EXTENDED_ICONS_SECURITY, MK_EXTENDED_ICONS_STATUS, MK_EXTENDED_ICONS_TIME, MK_EXTENDED_ICONS_TRAVEL, MK_EXTENDED_ICON_GROUPS, provideMkExtendedIcons };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_platform_browser from '@angular/platform-browser';
|
|
2
2
|
import { SafeHtml } from '@angular/platform-browser';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
|
-
import { EnvironmentProviders } from '@angular/core';
|
|
4
|
+
import { Signal, EnvironmentProviders } from '@angular/core';
|
|
5
5
|
import { MkSize } from '@mk-kit/ui/core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -29,18 +29,31 @@ declare class MkIcon {
|
|
|
29
29
|
readonly label: _angular_core.InputSignal<string>;
|
|
30
30
|
/** CSS length for the icon box (width = height = font-size). */
|
|
31
31
|
protected readonly dimension: _angular_core.Signal<string>;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Sanitized SVG for the named icon, or `null` (falls back to projection).
|
|
34
|
+
* Tracks the registry's `changes` so a late registration (lazy-loaded set,
|
|
35
|
+
* runtime `register()`) fills the icon in without re-binding `name`.
|
|
36
|
+
*/
|
|
33
37
|
protected readonly svg: _angular_core.Signal<_angular_platform_browser.SafeHtml | null>;
|
|
34
38
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkIcon, never>;
|
|
35
39
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkIcon, "mk-icon", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
/** A `{ name: '<svg …>…</svg>' }` map — what every registration API accepts. */
|
|
43
|
+
type MkIconMap = Readonly<Record<string, string>>;
|
|
44
|
+
/**
|
|
45
|
+
* Loads an icon map on demand — typically a dynamic import of the extended
|
|
46
|
+
* set: `() => import('@mk-kit/ui/icon/extended').then((m) => m.MK_EXTENDED_ICONS)`.
|
|
47
|
+
*/
|
|
48
|
+
type MkIconLoader = () => Promise<MkIconMap>;
|
|
38
49
|
/**
|
|
39
|
-
* IconRegistry — the name → SVG store behind `<mk-icon name="…">`. The
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
50
|
+
* IconRegistry — the name → SVG store behind `<mk-icon name="…">`. The
|
|
51
|
+
* hand-made {@link MK_DEFAULT_ICONS} are registered on construction and ship
|
|
52
|
+
* with every app. Everything else is opt-in and tree-shakeable: the
|
|
53
|
+
* Lucide-derived extended set via `provideMkExtendedIcons()` (from
|
|
54
|
+
* `@mk-kit/ui/icon/extended`), a themed subset or your own SVGs (from a
|
|
55
|
+
* sprite, a design export, anything) via `provideMkIcons()`, or at runtime
|
|
56
|
+
* with {@link register} / {@link registerIcons} / {@link load}.
|
|
44
57
|
*
|
|
45
58
|
* SVG markup is trusted verbatim (bypassed through `DomSanitizer`), so only
|
|
46
59
|
* register icons from sources you control — never user input.
|
|
@@ -49,35 +62,72 @@ declare class MkIcon {
|
|
|
49
62
|
* const reg = inject(MkIconRegistry);
|
|
50
63
|
* reg.register('logo', '<svg viewBox="0 0 24 24">…</svg>');
|
|
51
64
|
* reg.registerIcons({ save: '<svg…>', share: '<svg…>' });
|
|
65
|
+
* reg.load(() => import('@mk-kit/ui/icon/extended').then((m) => m.MK_EXTENDED_ICONS_FILES));
|
|
52
66
|
* ```
|
|
53
67
|
*/
|
|
54
68
|
declare class MkIconRegistry {
|
|
55
69
|
private readonly sanitizer;
|
|
70
|
+
private readonly pendingTasks;
|
|
56
71
|
private readonly icons;
|
|
57
72
|
private readonly aliases;
|
|
73
|
+
private readonly version;
|
|
74
|
+
private readonly loads;
|
|
75
|
+
private readonly warned;
|
|
76
|
+
/**
|
|
77
|
+
* Bumps on every registration. `<mk-icon>` reads it, so an icon that
|
|
78
|
+
* arrives late (a lazy {@link load}, a runtime {@link register}) renders in
|
|
79
|
+
* place without any re-binding.
|
|
80
|
+
*/
|
|
81
|
+
readonly changes: Signal<number>;
|
|
82
|
+
/** Whether a lazy {@link load} is still in flight. */
|
|
83
|
+
readonly pending: Signal<boolean>;
|
|
58
84
|
constructor();
|
|
59
85
|
/** Register (or overwrite) a single named icon from raw SVG markup. */
|
|
60
86
|
register(name: string, svg: string): this;
|
|
61
|
-
/**
|
|
62
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Register many icons at once from a `{ name: svg }` map — a whole set, a
|
|
89
|
+
* themed subset (`MK_EXTENDED_ICONS_FILES`) or a hand-picked few. Later
|
|
90
|
+
* registrations overwrite earlier ones on a shared name.
|
|
91
|
+
*/
|
|
92
|
+
registerIcons(icons: MkIconMap): this;
|
|
63
93
|
/**
|
|
64
94
|
* Register alternative names that resolve to existing icons — e.g. map
|
|
65
95
|
* Material Symbols ligature names onto the built-in set
|
|
66
96
|
* (`{ delete: 'trash', expand_more: 'chevron-down' }`). A real icon
|
|
67
|
-
* registered under an alias name always wins over the alias
|
|
97
|
+
* registered under an alias name always wins over the alias; an alias
|
|
98
|
+
* whose target is not registered resolves to nothing (and, in dev mode,
|
|
99
|
+
* warns once naming the missing target).
|
|
68
100
|
*/
|
|
69
101
|
registerAliases(aliases: Readonly<Record<string, string>>): this;
|
|
102
|
+
/**
|
|
103
|
+
* Load an icon map asynchronously and register it once it arrives. Icons
|
|
104
|
+
* already on screen fill in when the map lands (see {@link changes}); the
|
|
105
|
+
* missing-icon warning stays quiet while a load is pending. Server-side
|
|
106
|
+
* rendering waits for it (Angular's `PendingTasks`), so the HTML ships with
|
|
107
|
+
* the icons in place.
|
|
108
|
+
*
|
|
109
|
+
* ```ts
|
|
110
|
+
* registry.load(() => import('@mk-kit/ui/icon/extended').then((m) => m.MK_EXTENDED_ICONS));
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
load(loader: MkIconLoader): Promise<void>;
|
|
70
114
|
/** Sanitized SVG for a name (aliases resolved), or `null` when unknown. */
|
|
71
115
|
get(name: string): SafeHtml | null;
|
|
72
116
|
/** Whether an icon with this name (or alias) is registered. */
|
|
73
117
|
has(name: string): boolean;
|
|
74
118
|
/** All registered icon names (useful for a picker / catalogue). */
|
|
75
119
|
names(): string[];
|
|
120
|
+
/**
|
|
121
|
+
* Dev-mode only: warn once per unknown name with a hint about the opt-in
|
|
122
|
+
* extended set. Silent in production builds and while a {@link load} is
|
|
123
|
+
* pending (the name may be on its way). Called by `<mk-icon>`.
|
|
124
|
+
*/
|
|
125
|
+
warnMissing(name: string): void;
|
|
76
126
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkIconRegistry, never>;
|
|
77
127
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkIconRegistry>;
|
|
78
128
|
}
|
|
79
129
|
|
|
80
|
-
/** Name → SVG markup map of the default icons. */
|
|
130
|
+
/** Name → SVG markup map of the default icons (registered by {@link MkIconRegistry} on construction). */
|
|
81
131
|
declare const MK_DEFAULT_ICONS: Readonly<Record<string, string>>;
|
|
82
132
|
|
|
83
133
|
/**
|
|
@@ -87,9 +137,13 @@ declare const MK_DEFAULT_ICONS: Readonly<Record<string, string>>;
|
|
|
87
137
|
* glyph once {@link provideMkMaterialIcons} is installed.
|
|
88
138
|
*
|
|
89
139
|
* Several Material names intentionally collapse onto one mk glyph (all the
|
|
90
|
-
* calendar variants → `calendar`, the delete variants → `trash`, …).
|
|
91
|
-
*
|
|
92
|
-
*
|
|
140
|
+
* calendar variants → `calendar`, the delete variants → `trash`, …). Every
|
|
141
|
+
* target is a default icon, so the aliases work without the opt-in extended
|
|
142
|
+
* set. Names not listed here have no sensible built-in equivalent — register
|
|
143
|
+
* your own SVG under the Material name via `MkIconRegistry.register`, or
|
|
144
|
+
* alias it onto an extended glyph with `registerAliases` once
|
|
145
|
+
* `provideMkExtendedIcons()` is installed (an alias whose target is missing
|
|
146
|
+
* renders nothing and warns once in dev mode).
|
|
93
147
|
*/
|
|
94
148
|
declare const MK_MATERIAL_ICON_ALIASES: Readonly<Record<string, string>>;
|
|
95
149
|
/**
|
|
@@ -106,7 +160,36 @@ declare const MK_MATERIAL_ICON_ALIASES: Readonly<Record<string, string>>;
|
|
|
106
160
|
*/
|
|
107
161
|
declare function provideMkMaterialIcons(): EnvironmentProviders;
|
|
108
162
|
|
|
109
|
-
/**
|
|
110
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Registers extra icons at bootstrap — a themed subset of the extended set,
|
|
165
|
+
* a hand-picked few, your own SVGs, or a lazily loaded map. Call it as many
|
|
166
|
+
* times as you like; each call adds to the {@link MkIconRegistry}. The
|
|
167
|
+
* hand-made defaults are always there; this is for everything else.
|
|
168
|
+
*
|
|
169
|
+
* ```ts
|
|
170
|
+
* import { provideMkIcons } from '@mk-kit/ui/icon';
|
|
171
|
+
* import { MK_EXTENDED_ICONS_FILES, MK_EXTENDED_ICONS_DATA } from '@mk-kit/ui/icon/extended';
|
|
172
|
+
*
|
|
173
|
+
* bootstrapApplication(App, {
|
|
174
|
+
* providers: [
|
|
175
|
+
* // themed subsets — only these glyphs end up in the bundle
|
|
176
|
+
* provideMkIcons(MK_EXTENDED_ICONS_FILES),
|
|
177
|
+
* provideMkIcons(MK_EXTENDED_ICONS_DATA),
|
|
178
|
+
* // your own
|
|
179
|
+
* provideMkIcons({ logo: '<svg viewBox="0 0 24 24">…</svg>' }),
|
|
180
|
+
* // or the whole extended set in its own lazy chunk, off the critical path
|
|
181
|
+
* provideMkIcons(() => import('@mk-kit/ui/icon/extended').then((m) => m.MK_EXTENDED_ICONS)),
|
|
182
|
+
* ],
|
|
183
|
+
* });
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* A loader runs once at bootstrap without blocking it: icons already on
|
|
187
|
+
* screen fill in when the chunk lands, and server-side rendering waits for
|
|
188
|
+
* it. Picking single names out of the full map
|
|
189
|
+
* (`{ receipt: MK_EXTENDED_ICONS['receipt'] }`) works but still bundles the
|
|
190
|
+
* whole map — use a subset or copy the SVG when size matters.
|
|
191
|
+
*/
|
|
192
|
+
declare function provideMkIcons(icons: MkIconMap | MkIconLoader): EnvironmentProviders;
|
|
111
193
|
|
|
112
|
-
export { MK_DEFAULT_ICONS,
|
|
194
|
+
export { MK_DEFAULT_ICONS, MK_MATERIAL_ICON_ALIASES, MkIcon, MkIconRegistry, provideMkIcons, provideMkMaterialIcons };
|
|
195
|
+
export type { MkIconLoader, MkIconMap };
|
|
@@ -23,6 +23,8 @@ import * as _mk_kit_ui_core from '@mk-kit/ui/core';
|
|
|
23
23
|
*/
|
|
24
24
|
declare class MkRichText implements ControlValueAccessor {
|
|
25
25
|
private readonly field;
|
|
26
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
27
|
+
private readonly fieldTouched;
|
|
26
28
|
private readonly i18n;
|
|
27
29
|
/** Two-way HTML string value (sanitised; `''` when visually empty). */
|
|
28
30
|
readonly value: _angular_core.ModelSignal<string>;
|
|
@@ -92,6 +92,29 @@ type MkTableAlign = 'start' | 'center' | 'end';
|
|
|
92
92
|
type MkSortDirection = 'asc' | 'desc' | 'none';
|
|
93
93
|
/** Row vertical density. */
|
|
94
94
|
type MkTableDensity = 'comfortable' | 'compact';
|
|
95
|
+
/** Which control a column's header filter renders (see {@link MkTableColumn.filter}). */
|
|
96
|
+
type MkTableFilterKind = 'text' | 'select' | 'number' | 'date';
|
|
97
|
+
/** One option of a `select` header filter. */
|
|
98
|
+
interface MkTableFilterOption {
|
|
99
|
+
/** The value compared against the cell (by `String()` equality). */
|
|
100
|
+
value: unknown;
|
|
101
|
+
/** Visible option text. */
|
|
102
|
+
label: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* An inclusive range accepted as the value of a `number` or `date` filter
|
|
106
|
+
* (dates as `YYYY-MM-DD`, `Date` or a timestamp). Either bound may be omitted.
|
|
107
|
+
*/
|
|
108
|
+
interface MkTableFilterRange<V = number | string | Date> {
|
|
109
|
+
min?: V | null;
|
|
110
|
+
max?: V | null;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Active header filters keyed by column key: a string for `text`, an option
|
|
114
|
+
* value for `select`, a number / date (`>=`) or a {@link MkTableFilterRange}
|
|
115
|
+
* for `number` and `date`. Empty strings and `null` mean "no filter".
|
|
116
|
+
*/
|
|
117
|
+
type MkTableFilters = Record<string, unknown>;
|
|
95
118
|
/** Column definition for {@link MkTable}. */
|
|
96
119
|
interface MkTableColumn<T = Record<string, unknown>> {
|
|
97
120
|
/** Property key on each row object supplying the cell value. */
|
|
@@ -131,6 +154,26 @@ interface MkTableColumn<T = Record<string, unknown>> {
|
|
|
131
154
|
* an expandable row detail already repeats.
|
|
132
155
|
*/
|
|
133
156
|
stack?: 'title' | 'footer' | 'hide';
|
|
157
|
+
/**
|
|
158
|
+
* The header-row filter control for this column (rendered when the table is
|
|
159
|
+
* {@link MkTable.filterable}). Omitted, a filterable table gives the column a
|
|
160
|
+
* text filter; `false` leaves its filter cell empty.
|
|
161
|
+
*
|
|
162
|
+
* - `'text'` — case-insensitive *contains* on the displayed (formatted) text.
|
|
163
|
+
* - `'select'` — equality against one of {@link filterOptions}; without
|
|
164
|
+
* options, the distinct values found in `data`.
|
|
165
|
+
* - `'number'` / `'date'` — the control keeps rows whose value is **≥** the
|
|
166
|
+
* entry. Set `{ min, max }` through {@link MkTable.filters} for an
|
|
167
|
+
* inclusive range. Dates compare by local calendar day.
|
|
168
|
+
*/
|
|
169
|
+
filter?: MkTableFilterKind | false;
|
|
170
|
+
/**
|
|
171
|
+
* Options of a `select` filter — strings / numbers, or `{ value, label }`.
|
|
172
|
+
* Omitted: every distinct value of the column in `data`, sorted.
|
|
173
|
+
*/
|
|
174
|
+
filterOptions?: readonly (string | number | MkTableFilterOption)[];
|
|
175
|
+
/** Placeholder of the filter control (text: `i18n.filter`; number / date: `i18n.filterMin`). */
|
|
176
|
+
filterPlaceholder?: string;
|
|
134
177
|
}
|
|
135
178
|
/** Payload emitted by {@link MkTable.sortChange}. */
|
|
136
179
|
interface MkSortChange {
|
|
@@ -204,6 +247,8 @@ interface MkTableExportOptions extends MkCsvExportOptions, MkTableExportRowsOpti
|
|
|
204
247
|
/** Start the browser download (default `true`); `false` just returns the text. */
|
|
205
248
|
download?: boolean;
|
|
206
249
|
}
|
|
250
|
+
/** Drop the empty entries of a filter map (`null` when nothing is left). */
|
|
251
|
+
declare function mkCompactFilters(filters: MkTableFilters | null | undefined): MkTableFilters | null;
|
|
207
252
|
/** One rendered tbody entry: either a group header or a data row. */
|
|
208
253
|
type MkTableItem<T> = {
|
|
209
254
|
kind: 'group';
|
|
@@ -218,22 +263,6 @@ type MkTableItem<T> = {
|
|
|
218
263
|
/** Whether its children are currently shown (tree mode). */
|
|
219
264
|
expanded: boolean;
|
|
220
265
|
};
|
|
221
|
-
/**
|
|
222
|
-
* Table — a themed data table built on a native `<table>` for accessibility.
|
|
223
|
-
* Supply `columns` and `data`; opt into sortable columns, sticky header,
|
|
224
|
-
* zebra striping, hover and density. Sorting is fully keyboard operable
|
|
225
|
-
* (Enter/Space on a header) and announces changes via {@link MkLiveAnnouncer}.
|
|
226
|
-
*
|
|
227
|
-
* ```html
|
|
228
|
-
* <mk-table
|
|
229
|
-
* [columns]="columns"
|
|
230
|
-
* [data]="rows()"
|
|
231
|
-
* stickyHeader
|
|
232
|
-
* zebra
|
|
233
|
-
* (sortChange)="onSort($event)"
|
|
234
|
-
* (rowClick)="open($event)" />
|
|
235
|
-
* ```
|
|
236
|
-
*/
|
|
237
266
|
declare class MkTable<T = Record<string, unknown>> {
|
|
238
267
|
private readonly announcer;
|
|
239
268
|
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
@@ -252,8 +281,11 @@ declare class MkTable<T = Record<string, unknown>> {
|
|
|
252
281
|
*/
|
|
253
282
|
protected readonly stacked: _angular_core.WritableSignal<boolean>;
|
|
254
283
|
constructor();
|
|
255
|
-
/**
|
|
256
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Measures the header row and the thead and exposes them as the sticky
|
|
286
|
+
* offsets of the filter row and of the group rows.
|
|
287
|
+
*/
|
|
288
|
+
private applyStickyOffsets;
|
|
257
289
|
/** Column definitions (order = display order). */
|
|
258
290
|
readonly columns: _angular_core.InputSignal<MkTableColumn<T>[]>;
|
|
259
291
|
/** Row objects to render. */
|
|
@@ -325,6 +357,50 @@ declare class MkTable<T = Record<string, unknown>> {
|
|
|
325
357
|
readonly groupBy: _angular_core.InputSignal<string | ((row: T) => unknown) | null>;
|
|
326
358
|
/** Formats a group header label; defaults to `String(value)`. */
|
|
327
359
|
readonly groupLabel: _angular_core.InputSignal<((value: unknown, rows: T[]) => string) | null>;
|
|
360
|
+
/**
|
|
361
|
+
* Render only the rows in view (plus {@link overscan}) — for tables of
|
|
362
|
+
* thousands of rows. The `<table>` scrolls inside its own box sized by
|
|
363
|
+
* {@link height} / {@link maxHeight} (`max-height: 60vh` when neither is
|
|
364
|
+
* set) with the header pinned; spacer rows keep the scrollbar honest.
|
|
365
|
+
*
|
|
366
|
+
* Works with sorting, selection (select-all still covers every row), tree
|
|
367
|
+
* rows, grouping (group headers are rows too), expandable detail rows (their
|
|
368
|
+
* height is measured once rendered; an unmeasured detail counts as one row)
|
|
369
|
+
* and the header filter row. Falls back to the full render while stacked
|
|
370
|
+
* into cards. Export and select-all always see every row, not the window.
|
|
371
|
+
*/
|
|
372
|
+
readonly virtual: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
373
|
+
/**
|
|
374
|
+
* Height (px) of one row in virtual mode. Leave unset to have it measured
|
|
375
|
+
* from the first rendered row — which follows `density` and
|
|
376
|
+
* `data-mk-density` automatically — starting from 44 (comfortable).
|
|
377
|
+
*/
|
|
378
|
+
readonly rowHeight: _angular_core.InputSignalWithTransform<number | null, unknown>;
|
|
379
|
+
/** Rows rendered beyond each edge of the viewport in virtual mode. */
|
|
380
|
+
readonly overscan: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
381
|
+
/** Fixed height of the scroll box (CSS length, or px as a number). */
|
|
382
|
+
readonly height: _angular_core.InputSignal<string | number | null>;
|
|
383
|
+
/** Maximum height of the scroll box (CSS length, or px as a number). */
|
|
384
|
+
readonly maxHeight: _angular_core.InputSignal<string | number | null>;
|
|
385
|
+
/**
|
|
386
|
+
* Render a second header row with a filter control per column — a text
|
|
387
|
+
* box, a select, a number or a date field as the column's
|
|
388
|
+
* {@link MkTableColumn.filter} says. Values live in {@link filters}.
|
|
389
|
+
*/
|
|
390
|
+
readonly filterable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
391
|
+
/**
|
|
392
|
+
* The active filters, keyed by column key (`[(filters)]`; `filtersChange`
|
|
393
|
+
* emits the whole map on every edit). Text filters hold the typed string,
|
|
394
|
+
* select filters the chosen option value, number / date filters the lower
|
|
395
|
+
* bound or a `{ min, max }` range. Set programmatically to pre-filter.
|
|
396
|
+
*/
|
|
397
|
+
readonly filters: _angular_core.ModelSignal<MkTableFilters>;
|
|
398
|
+
/**
|
|
399
|
+
* Filter rows in the browser (default). Turn off when the server applies
|
|
400
|
+
* the filters — `MkTableDataSource.setFilters($event)` on `filtersChange` —
|
|
401
|
+
* so the page it returns is shown as-is.
|
|
402
|
+
*/
|
|
403
|
+
readonly clientFilter: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
328
404
|
/** Emitted when the sort column/direction changes. */
|
|
329
405
|
readonly sortChange: _angular_core.OutputEmitterRef<MkSortChange>;
|
|
330
406
|
/** Emitted when a row is clicked (enable via `clickableRows`). */
|
|
@@ -448,9 +524,54 @@ declare class MkTable<T = Record<string, unknown>> {
|
|
|
448
524
|
* re-resolves locale data on every call; one cached `Intl.Collator` makes
|
|
449
525
|
* large-table sorts several-fold faster with the same default-locale order.
|
|
450
526
|
*/
|
|
451
|
-
private static readonly sortCollator;
|
|
452
527
|
/** Data sorted by the active column, or the input order when unsorted. */
|
|
453
528
|
protected readonly sortedData: _angular_core.Signal<T[]>;
|
|
529
|
+
/** The filter control a column renders, or `null` for none. */
|
|
530
|
+
protected filterKind(col: MkTableColumn<T>): MkTableFilterKind | null;
|
|
531
|
+
/** One predicate per active filter, or `null` when nothing is filtered. */
|
|
532
|
+
private readonly rowPredicate;
|
|
533
|
+
/** Build the predicate for one column's filter value. */
|
|
534
|
+
private columnTest;
|
|
535
|
+
/**
|
|
536
|
+
* Tree mode: which rows survive the filters — a row is kept when it matches
|
|
537
|
+
* or any descendant does, so a matching child keeps its parents.
|
|
538
|
+
*/
|
|
539
|
+
private readonly treeKeep;
|
|
540
|
+
/** The input rows with the active filters applied (input order). */
|
|
541
|
+
private readonly filteredData;
|
|
542
|
+
/** The child rows of `row` that survive the filters (tree mode). */
|
|
543
|
+
private visibleChildrenOf;
|
|
544
|
+
/** Options of every `select` filter, keyed by column (derived when unset). */
|
|
545
|
+
private readonly selectOptions;
|
|
546
|
+
/** The options a column's select filter offers. */
|
|
547
|
+
protected filterOptionsFor(col: MkTableColumn<T>): MkTableFilterOption[];
|
|
548
|
+
/** Whether `option` is the column's current select-filter value. */
|
|
549
|
+
protected isFilterOption(col: MkTableColumn<T>, option: MkTableFilterOption): boolean;
|
|
550
|
+
/** Whether a column has an active filter. */
|
|
551
|
+
protected hasFilter(key: string): boolean;
|
|
552
|
+
/** The text a column's filter box shows (a range shows its lower bound). */
|
|
553
|
+
protected filterText(key: string): string;
|
|
554
|
+
/** Accessible name of a column's filter control. */
|
|
555
|
+
protected filterLabel(col: MkTableColumn<T>): string;
|
|
556
|
+
/** Placeholder of a column's filter control. */
|
|
557
|
+
protected filterPlaceholder(col: MkTableColumn<T>): string;
|
|
558
|
+
/**
|
|
559
|
+
* Set one column's filter (`null` / `''` clears it). Updates
|
|
560
|
+
* {@link filters} and emits `filtersChange`; a no-op when unchanged.
|
|
561
|
+
*/
|
|
562
|
+
setFilter(key: string, value: unknown): void;
|
|
563
|
+
/** Clear one column's filter. */
|
|
564
|
+
clearFilter(key: string): void;
|
|
565
|
+
/** Clear every filter. */
|
|
566
|
+
clearFilters(): void;
|
|
567
|
+
/** Text / number / date filter box input. */
|
|
568
|
+
protected onFilterInput(col: MkTableColumn<T>, event: Event): void;
|
|
569
|
+
/** Select filter change: map the option string back to its original value. */
|
|
570
|
+
protected onFilterSelect(col: MkTableColumn<T>, event: Event): void;
|
|
571
|
+
/** Escape in a filter box clears that filter (and stays in the box). */
|
|
572
|
+
protected onFilterKeydown(col: MkTableColumn<T>, event: KeyboardEvent): void;
|
|
573
|
+
/** Header rows above the body (for `aria-rowindex`). */
|
|
574
|
+
protected readonly headerRows: _angular_core.Signal<number>;
|
|
454
575
|
/** Sort one sibling group by the active column (input order when unsorted). */
|
|
455
576
|
private sortRows;
|
|
456
577
|
/** `aria-sort` value for a header cell. */
|
|
@@ -505,6 +626,75 @@ declare class MkTable<T = Record<string, unknown>> {
|
|
|
505
626
|
private pushRows;
|
|
506
627
|
/** The child rows of `row` (tree mode), or an empty list. */
|
|
507
628
|
private childrenOf;
|
|
629
|
+
/** The scroll box around the table. */
|
|
630
|
+
private readonly scroller;
|
|
631
|
+
/** Virtual mode in force (cards always render in full). */
|
|
632
|
+
protected readonly isVirtual: _angular_core.Signal<boolean>;
|
|
633
|
+
/** Current scroll offset of the scroll box (virtual mode). */
|
|
634
|
+
private readonly scrollTop;
|
|
635
|
+
/** Measured height of the scroll box (0 until measured / on the server). */
|
|
636
|
+
private readonly viewportHeight;
|
|
637
|
+
/** Measured height of the thead — the sticky header hides that much of the top. */
|
|
638
|
+
private readonly headHeight;
|
|
639
|
+
/** Row height read back from the first rendered row. */
|
|
640
|
+
private readonly measuredRowHeight;
|
|
641
|
+
/** Measured heights of expanded detail rows, by row key. */
|
|
642
|
+
private readonly detailHeights;
|
|
643
|
+
/** The row height virtual mode lays rows out with. */
|
|
644
|
+
protected readonly effectiveRowHeight: _angular_core.Signal<number>;
|
|
645
|
+
private cssLength;
|
|
646
|
+
/** `height` of the scroll box. */
|
|
647
|
+
protected readonly scrollHeight: _angular_core.Signal<string | null>;
|
|
648
|
+
/** `max-height` of the scroll box (60vh in virtual mode with no size given). */
|
|
649
|
+
protected readonly scrollMaxHeight: _angular_core.Signal<string | null>;
|
|
650
|
+
/**
|
|
651
|
+
* Top offset of every display item, or `null` while every item is exactly
|
|
652
|
+
* one row tall (the common case — then offsets are plain multiplication).
|
|
653
|
+
* Only expanded detail rows make heights vary.
|
|
654
|
+
*/
|
|
655
|
+
private readonly itemOffsets;
|
|
656
|
+
/** Full height of the body, spacers included. */
|
|
657
|
+
private readonly totalHeight;
|
|
658
|
+
/** Top offset (px) of display item `index`. */
|
|
659
|
+
private offsetOf;
|
|
660
|
+
/** Index of the display item covering the body offset `y`. */
|
|
661
|
+
private indexAt;
|
|
662
|
+
/** The `[start, end)` slice of display items currently rendered. */
|
|
663
|
+
protected readonly windowRange: _angular_core.Signal<{
|
|
664
|
+
start: number;
|
|
665
|
+
end: number;
|
|
666
|
+
}>;
|
|
667
|
+
/** Display index of the first rendered item. */
|
|
668
|
+
protected readonly windowStart: _angular_core.Signal<number>;
|
|
669
|
+
/** The items the tbody renders: the window in virtual mode, else all. */
|
|
670
|
+
protected readonly renderedItems: _angular_core.Signal<MkTableItem<T>[]>;
|
|
671
|
+
/** Height (px) of the spacer above the window. */
|
|
672
|
+
protected readonly topSpace: _angular_core.Signal<number>;
|
|
673
|
+
/** Height (px) of the spacer below the window. */
|
|
674
|
+
protected readonly bottomSpace: _angular_core.Signal<number>;
|
|
675
|
+
/** Scroll box scrolled: move the window. */
|
|
676
|
+
protected onScroll(event: Event): void;
|
|
677
|
+
/**
|
|
678
|
+
* Read the viewport, thead, first-row and detail-row heights back from the
|
|
679
|
+
* DOM. Heights are accepted only when they move by more than a pixel:
|
|
680
|
+
* collapsed table borders make the same row measure 44 or 44.5 depending
|
|
681
|
+
* on where it sits, and letting that flip the row height would shift a
|
|
682
|
+
* 10,000-row body by thousands of pixels on every window change. A density
|
|
683
|
+
* change (44 → 36 or 52) still gets through.
|
|
684
|
+
*/
|
|
685
|
+
private measureViewport;
|
|
686
|
+
/**
|
|
687
|
+
* Scroll a row into view. A number is the row's **display index** — its
|
|
688
|
+
* position among the rendered rows, group headers included, after sorting,
|
|
689
|
+
* filtering and tree expansion; anything else is a row key (the `trackKey`
|
|
690
|
+
* value, or the row object when there is none). Pass `'key'` to look a
|
|
691
|
+
* numeric key up. Returns `false` when the row is not currently displayed
|
|
692
|
+
* (filtered out, under a collapsed parent or group).
|
|
693
|
+
*
|
|
694
|
+
* In virtual mode the row lands at the top of the viewport, just under the
|
|
695
|
+
* header; otherwise it is scrolled to the nearest edge.
|
|
696
|
+
*/
|
|
697
|
+
scrollToRow(target: unknown, by?: 'index' | 'key'): boolean;
|
|
508
698
|
/** Keys of parent rows whose children are shown. */
|
|
509
699
|
private readonly treeExpanded;
|
|
510
700
|
/** Whether a parent row's children are currently shown (tree mode). */
|
|
@@ -518,7 +708,8 @@ declare class MkTable<T = Record<string, unknown>> {
|
|
|
518
708
|
/**
|
|
519
709
|
* The rows and columns an export writes — exactly what {@link exportCsv}
|
|
520
710
|
* serialises, for other formats (XLSX, PDF, the clipboard, …): rows in
|
|
521
|
-
* display order with the current sort
|
|
711
|
+
* display order with the current sort and header {@link filters} applied
|
|
712
|
+
* (every matching row, never just the virtual window) and tree children
|
|
522
713
|
* (`childrenKey`) flattened under their parent whether or not they are
|
|
523
714
|
* expanded, optionally only the selected ones; columns in the table's
|
|
524
715
|
* current order, restricted to `options.columns` when given, each carrying
|
|
@@ -534,8 +725,8 @@ declare class MkTable<T = Record<string, unknown>> {
|
|
|
534
725
|
getExportRows(options?: MkTableExportRowsOptions): MkTableExportRows<T>;
|
|
535
726
|
/**
|
|
536
727
|
* The table's rows as CSV: current column order, column formatters applied,
|
|
537
|
-
* sorted the way they are shown, tree children flattened under
|
|
538
|
-
* whether or not they are expanded. Downloads the file (default name
|
|
728
|
+
* sorted and filtered the way they are shown, tree children flattened under
|
|
729
|
+
* their parent whether or not they are expanded. Downloads the file (default name
|
|
539
730
|
* `table.csv`) and returns the text. Built on {@link getExportRows}.
|
|
540
731
|
*/
|
|
541
732
|
exportCsv(options?: MkTableExportOptions): string;
|
|
@@ -563,7 +754,7 @@ declare class MkTable<T = Record<string, unknown>> {
|
|
|
563
754
|
/** Toggle a row's detail panel, honouring `singleExpand`. */
|
|
564
755
|
protected toggleExpand(row: T, event?: Event): void;
|
|
565
756
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTable<any>, never>;
|
|
566
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTable<any>, "mk-table", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "zebra": { "alias": "zebra"; "required": false; "isSignal": true; }; "hover": { "alias": "hover"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "stackAt": { "alias": "stackAt"; "required": false; "isSignal": true; }; "clickableRows": { "alias": "clickableRows"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "trackKey": { "alias": "trackKey"; "required": false; "isSignal": true; }; "rowClass": { "alias": "rowClass"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "singleExpand": { "alias": "singleExpand"; "required": false; "isSignal": true; }; "resizableColumns": { "alias": "resizableColumns"; "required": false; "isSignal": true; }; "reorderableColumns": { "alias": "reorderableColumns"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "groupLabel": { "alias": "groupLabel"; "required": false; "isSignal": true; }; "childrenKey": { "alias": "childrenKey"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "sortChange": "sortChange"; "rowClick": "rowClick"; "selectionChange": "selectionChange"; "expandedChange": "expandedChange"; "columnResize": "columnResize"; "columnReorder": "columnReorder"; "cellEdit": "cellEdit"; "groupToggle": "groupToggle"; "treeToggle": "treeToggle"; }, ["rowDetail", "cellTemplates"], ["[mkTableEmpty]"], true, never>;
|
|
757
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTable<any>, "mk-table", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "zebra": { "alias": "zebra"; "required": false; "isSignal": true; }; "hover": { "alias": "hover"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "stackAt": { "alias": "stackAt"; "required": false; "isSignal": true; }; "clickableRows": { "alias": "clickableRows"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "trackKey": { "alias": "trackKey"; "required": false; "isSignal": true; }; "rowClass": { "alias": "rowClass"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "singleExpand": { "alias": "singleExpand"; "required": false; "isSignal": true; }; "resizableColumns": { "alias": "resizableColumns"; "required": false; "isSignal": true; }; "reorderableColumns": { "alias": "reorderableColumns"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "groupLabel": { "alias": "groupLabel"; "required": false; "isSignal": true; }; "virtual": { "alias": "virtual"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "overscan": { "alias": "overscan"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "filterable": { "alias": "filterable"; "required": false; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "clientFilter": { "alias": "clientFilter"; "required": false; "isSignal": true; }; "childrenKey": { "alias": "childrenKey"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "filters": "filtersChange"; "sortChange": "sortChange"; "rowClick": "rowClick"; "selectionChange": "selectionChange"; "expandedChange": "expandedChange"; "columnResize": "columnResize"; "columnReorder": "columnReorder"; "cellEdit": "cellEdit"; "groupToggle": "groupToggle"; "treeToggle": "treeToggle"; }, ["rowDetail", "cellTemplates"], ["[mkTableEmpty]"], true, never>;
|
|
567
758
|
}
|
|
568
759
|
|
|
569
760
|
/** Context handed to an `[mkTableCell]` template. */
|
|
@@ -714,6 +905,12 @@ interface MkDataRequest {
|
|
|
714
905
|
filter: string;
|
|
715
906
|
/** Structured filter from `mk-query-builder` (`null` = none). Compacted: no empty groups or unfinished rules. */
|
|
716
907
|
query: MkQueryGroup | null;
|
|
908
|
+
/**
|
|
909
|
+
* Per-column filters from `mk-table`'s header filter row (`null` = none),
|
|
910
|
+
* keyed by column key with empty entries dropped — see
|
|
911
|
+
* {@link MkTableDataSource.setFilters}.
|
|
912
|
+
*/
|
|
913
|
+
filters: MkTableFilters | null;
|
|
717
914
|
}
|
|
718
915
|
/** One page of server data returned by a {@link MkDataFetcher}. */
|
|
719
916
|
interface MkDataPage<T> {
|
|
@@ -827,6 +1024,7 @@ declare class MkTableDataSource<T> {
|
|
|
827
1024
|
private readonly _sort;
|
|
828
1025
|
private readonly _filter;
|
|
829
1026
|
private readonly _query;
|
|
1027
|
+
private readonly _filters;
|
|
830
1028
|
/** Rows of the current page (`[]` until the first load lands). */
|
|
831
1029
|
readonly rows: Signal<T[]>;
|
|
832
1030
|
/** Total row count across all pages (feed to `mk-pagination`'s `total`). */
|
|
@@ -845,6 +1043,8 @@ declare class MkTableDataSource<T> {
|
|
|
845
1043
|
readonly filter: Signal<string>;
|
|
846
1044
|
/** Current structured query, or `null`. */
|
|
847
1045
|
readonly query: Signal<MkQueryGroup | null>;
|
|
1046
|
+
/** Current per-column filters, or `null`. */
|
|
1047
|
+
readonly filters: Signal<MkTableFilters | null>;
|
|
848
1048
|
/** True when a settled load reported no rows at all. */
|
|
849
1049
|
readonly empty: Signal<boolean>;
|
|
850
1050
|
/** Monotonic request id — settles from older epochs are discarded. */
|
|
@@ -880,6 +1080,15 @@ declare class MkTableDataSource<T> {
|
|
|
880
1080
|
* with nothing left is sent as `null`. Resets to page 1 and loads at once.
|
|
881
1081
|
*/
|
|
882
1082
|
setQuery(query: MkQueryGroup | null): void;
|
|
1083
|
+
/**
|
|
1084
|
+
* Set (or clear with `null` / `{}`) the per-column filters from `mk-table`'s
|
|
1085
|
+
* header filter row — bind `(filtersChange)="ds.setFilters($event)"` and
|
|
1086
|
+
* turn the table's `clientFilter` off. Empty entries are dropped before the
|
|
1087
|
+
* request; nothing left is sent as `null`. Resets to page 1 and loads at
|
|
1088
|
+
* once (the table already debounces nothing, so debounce the fetcher if
|
|
1089
|
+
* your API needs it). A no-op when unchanged.
|
|
1090
|
+
*/
|
|
1091
|
+
setFilters(filters: MkTableFilters | null): void;
|
|
883
1092
|
/**
|
|
884
1093
|
* Re-run the current request immediately (e.g. after a mutation). Flushes a
|
|
885
1094
|
* pending debounced filter, since the request reads the live filter value.
|
|
@@ -909,5 +1118,5 @@ declare class MkTableDataSource<T> {
|
|
|
909
1118
|
private clearSub;
|
|
910
1119
|
}
|
|
911
1120
|
|
|
912
|
-
export { MkSort, MkSortHeader, MkTable, MkTableCell, MkTableDataSource, MkTableRowDetail, mkDownloadText, mkExportCsv, mkToCsv };
|
|
913
|
-
export type { MkCellEdit, MkColumnResize, MkCsvColumn, MkCsvExportOptions, MkCsvOptions, MkDataFetcher, MkDataPage, MkDataRequest, MkGroupToggle, MkSortChange, MkSortDirection, MkSortState, MkSortable, MkTableAlign, MkTableCellContext, MkTableColumn, MkTableDataSourceOptions, MkTableDensity, MkTableExportOptions, MkTableExportRows, MkTableExportRowsOptions, MkTableGroup, MkTreeToggle };
|
|
1121
|
+
export { MkSort, MkSortHeader, MkTable, MkTableCell, MkTableDataSource, MkTableRowDetail, mkCompactFilters, mkDownloadText, mkExportCsv, mkToCsv };
|
|
1122
|
+
export type { MkCellEdit, MkColumnResize, MkCsvColumn, MkCsvExportOptions, MkCsvOptions, MkDataFetcher, MkDataPage, MkDataRequest, MkGroupToggle, MkSortChange, MkSortDirection, MkSortState, MkSortable, MkTableAlign, MkTableCellContext, MkTableColumn, MkTableDataSourceOptions, MkTableDensity, MkTableExportOptions, MkTableExportRows, MkTableExportRowsOptions, MkTableFilterKind, MkTableFilterOption, MkTableFilterRange, MkTableFilters, MkTableGroup, MkTreeToggle };
|