@mk-kit/ui 0.34.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/LICENSE +21 -0
- package/README.md +115 -0
- package/block-editor/README.md +254 -0
- package/fesm2022/mk-kit-ui-block-editor.mjs +2158 -0
- package/fesm2022/mk-kit-ui-block-editor.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-button.mjs +81 -0
- package/fesm2022/mk-kit-ui-button.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-checkbox.mjs +136 -0
- package/fesm2022/mk-kit-ui-checkbox.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-chip.mjs +122 -0
- package/fesm2022/mk-kit-ui-chip.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-context-menu.mjs +144 -0
- package/fesm2022/mk-kit-ui-context-menu.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-core.mjs +1576 -0
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-data.mjs +6055 -0
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-datetime.mjs +3409 -0
- package/fesm2022/mk-kit-ui-datetime.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-directives.mjs +1779 -0
- package/fesm2022/mk-kit-ui-directives.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-dnd.mjs +1073 -0
- package/fesm2022/mk-kit-ui-dnd.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-feedback.mjs +2426 -0
- package/fesm2022/mk-kit-ui-feedback.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-forms.mjs +9208 -0
- package/fesm2022/mk-kit-ui-forms.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-icon.mjs +470 -0
- package/fesm2022/mk-kit-ui-icon.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-media.mjs +896 -0
- package/fesm2022/mk-kit-ui-media.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-navigation.mjs +2542 -0
- package/fesm2022/mk-kit-ui-navigation.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-rich-text.mjs +565 -0
- package/fesm2022/mk-kit-ui-rich-text.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-table.mjs +1378 -0
- package/fesm2022/mk-kit-ui-table.mjs.map +1 -0
- package/fesm2022/mk-kit-ui.mjs +32 -0
- package/fesm2022/mk-kit-ui.mjs.map +1 -0
- package/package.json +130 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.js +113 -0
- package/schematics/ng-add/schema.json +22 -0
- package/schematics/package.json +3 -0
- package/styles/mk-kit.css +750 -0
- package/types/mk-kit-ui-block-editor.d.ts +292 -0
- package/types/mk-kit-ui-button.d.ts +40 -0
- package/types/mk-kit-ui-checkbox.d.ts +62 -0
- package/types/mk-kit-ui-chip.d.ts +59 -0
- package/types/mk-kit-ui-context-menu.d.ts +57 -0
- package/types/mk-kit-ui-core.d.ts +1105 -0
- package/types/mk-kit-ui-data.d.ts +2580 -0
- package/types/mk-kit-ui-datetime.d.ts +1171 -0
- package/types/mk-kit-ui-directives.d.ts +807 -0
- package/types/mk-kit-ui-dnd.d.ts +423 -0
- package/types/mk-kit-ui-feedback.d.ts +1270 -0
- package/types/mk-kit-ui-forms.d.ts +3586 -0
- package/types/mk-kit-ui-icon.d.ts +108 -0
- package/types/mk-kit-ui-media.d.ts +549 -0
- package/types/mk-kit-ui-navigation.d.ts +1169 -0
- package/types/mk-kit-ui-rich-text.d.ts +187 -0
- package/types/mk-kit-ui-table.d.ts +739 -0
- package/types/mk-kit-ui.d.ts +17 -0
|
@@ -0,0 +1,1169 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ElementRef, OnDestroy, TemplateRef } from '@angular/core';
|
|
3
|
+
import * as _mk_kit_ui_core from '@mk-kit/ui/core';
|
|
4
|
+
import { MkTone, MkSize } from '@mk-kit/ui/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A single tab + its panel. Declared inside `<mk-tabs>`; the projected content
|
|
8
|
+
* becomes the tab panel body while `label` is rendered in the tablist.
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <mk-tabs>
|
|
12
|
+
* <mk-tab label="Overview">…panel content…</mk-tab>
|
|
13
|
+
* <mk-tab label="Settings" [disabled]="locked()">…</mk-tab>
|
|
14
|
+
* </mk-tabs>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare class MkTab {
|
|
18
|
+
/** Text shown on the tab button in the tablist. */
|
|
19
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
20
|
+
/** Disable selection of this tab. */
|
|
21
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
22
|
+
/** Stable id for the tab button (wires `aria-labelledby`). */
|
|
23
|
+
readonly tabId: string;
|
|
24
|
+
/** Stable id for the panel (wires `aria-controls`). */
|
|
25
|
+
readonly panelId: string;
|
|
26
|
+
/** Whether this tab is currently selected. Set by the parent `MkTabs`. */
|
|
27
|
+
readonly active: _angular_core.WritableSignal<boolean>;
|
|
28
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTab, never>;
|
|
29
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTab, "mk-tab", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Visual style for the tablist. */
|
|
33
|
+
type MkTabsVariant = 'line' | 'pill';
|
|
34
|
+
/**
|
|
35
|
+
* Accessible tabs implementing the ARIA tabs pattern: a `role="tablist"` with
|
|
36
|
+
* roving tabindex, Arrow/Home/End keyboard navigation and an animated active
|
|
37
|
+
* indicator. Selection is two-way bindable via `selectedIndex`.
|
|
38
|
+
*
|
|
39
|
+
* ```html
|
|
40
|
+
* <mk-tabs [(selectedIndex)]="tab" variant="line">
|
|
41
|
+
* <mk-tab label="Profile">…</mk-tab>
|
|
42
|
+
* <mk-tab label="Billing">…</mk-tab>
|
|
43
|
+
* </mk-tabs>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare class MkTabs {
|
|
47
|
+
/** Projected tabs, kept live via a signal content query. */
|
|
48
|
+
readonly tabs: _angular_core.Signal<readonly MkTab[]>;
|
|
49
|
+
/** Rendered tab buttons, used to move focus and measure the indicator. */
|
|
50
|
+
protected readonly tabButtons: _angular_core.Signal<readonly ElementRef<HTMLButtonElement>[]>;
|
|
51
|
+
/** Zero-based index of the active tab (two-way). */
|
|
52
|
+
readonly selectedIndex: _angular_core.ModelSignal<number>;
|
|
53
|
+
/** `line` shows an underline indicator; `pill` uses filled pills. */
|
|
54
|
+
readonly variant: _angular_core.InputSignal<MkTabsVariant>;
|
|
55
|
+
/** Sliding indicator geometry (line variant). */
|
|
56
|
+
protected readonly indicatorLeft: _angular_core.WritableSignal<number>;
|
|
57
|
+
protected readonly indicatorWidth: _angular_core.WritableSignal<number>;
|
|
58
|
+
constructor();
|
|
59
|
+
protected select(index: number): void;
|
|
60
|
+
protected focusTab(index: number): void;
|
|
61
|
+
protected onKeydown(event: KeyboardEvent, index: number): void;
|
|
62
|
+
/** Next non-disabled tab index starting from `from`, wrapping around. */
|
|
63
|
+
private nextEnabled;
|
|
64
|
+
private measureIndicator;
|
|
65
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTabs, never>;
|
|
66
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTabs, "mk-tabs", never, { "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, { "selectedIndex": "selectedIndexChange"; }, ["tabs"], ["*"], true, never>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A collapsible section within an `<mk-accordion>`. The header is a button that
|
|
71
|
+
* toggles a smoothly animated body region wired with `aria-expanded` /
|
|
72
|
+
* `aria-controls`. Open state is two-way bindable via `open`.
|
|
73
|
+
*
|
|
74
|
+
* ```html
|
|
75
|
+
* <mk-accordion-item header="Shipping" [(open)]="shippingOpen">
|
|
76
|
+
* …body…
|
|
77
|
+
* </mk-accordion-item>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare class MkAccordionItem {
|
|
81
|
+
private readonly accordion;
|
|
82
|
+
/** Plain-text header (ignored when `[mkAccordionHeader]` is projected). */
|
|
83
|
+
readonly header: _angular_core.InputSignal<string>;
|
|
84
|
+
/** Disable toggling of this item. */
|
|
85
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
86
|
+
/** Whether the item is expanded (two-way). */
|
|
87
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
88
|
+
/** Stable id for the trigger button. */
|
|
89
|
+
readonly triggerId: string;
|
|
90
|
+
/** Stable id for the panel region. */
|
|
91
|
+
readonly panelId: string;
|
|
92
|
+
protected toggle(): void;
|
|
93
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkAccordionItem, never>;
|
|
94
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkAccordionItem, "mk-accordion-item", never, { "header": { "alias": "header"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["[mkAccordionHeader]", "*"], true, never>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Groups `<mk-accordion-item>`s. By default only one item can be open at a
|
|
99
|
+
* time (single-open); set `multi` to allow several. Coordinates its children
|
|
100
|
+
* through their two-way `open` models.
|
|
101
|
+
*
|
|
102
|
+
* ```html
|
|
103
|
+
* <mk-accordion [multi]="false">
|
|
104
|
+
* <mk-accordion-item header="One">…</mk-accordion-item>
|
|
105
|
+
* <mk-accordion-item header="Two">…</mk-accordion-item>
|
|
106
|
+
* </mk-accordion>
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
declare class MkAccordion {
|
|
110
|
+
/** Allow multiple items open simultaneously. */
|
|
111
|
+
readonly multi: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
112
|
+
/** Registered items collapse siblings on open in single mode. */
|
|
113
|
+
private readonly items;
|
|
114
|
+
/** Called by an item just before its open state changes. */
|
|
115
|
+
onItemToggle(source: MkAccordionItem, opening: boolean): void;
|
|
116
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkAccordion, never>;
|
|
117
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkAccordion, "mk-accordion", never, { "multi": { "alias": "multi"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Marks projected content as the header of an `<mk-accordion-item>`. Use when
|
|
122
|
+
* the header needs rich markup instead of the plain-text `header` input.
|
|
123
|
+
*
|
|
124
|
+
* ```html
|
|
125
|
+
* <mk-accordion-item>
|
|
126
|
+
* <span mkAccordionHeader><mk-icon name="user" /> Account</span>
|
|
127
|
+
* …body…
|
|
128
|
+
* </mk-accordion-item>
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
declare class MkAccordionHeader {
|
|
132
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkAccordionHeader, never>;
|
|
133
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkAccordionHeader, "[mkAccordionHeader]", never, {}, {}, never, never, true, never>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Breadcrumb trail. Renders `nav[aria-label="Breadcrumb"] > ol` and marks the
|
|
138
|
+
* final `<mk-breadcrumb-item>` as the current page. The separator is drawn in
|
|
139
|
+
* CSS and can be customised via `separator`.
|
|
140
|
+
*
|
|
141
|
+
* ```html
|
|
142
|
+
* <mk-breadcrumb separator="›">
|
|
143
|
+
* <mk-breadcrumb-item href="/">Home</mk-breadcrumb-item>
|
|
144
|
+
* <mk-breadcrumb-item href="/users">Users</mk-breadcrumb-item>
|
|
145
|
+
* <mk-breadcrumb-item>Jane</mk-breadcrumb-item>
|
|
146
|
+
* </mk-breadcrumb>
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
declare class MkBreadcrumb {
|
|
150
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
151
|
+
/** Accessible label for the navigation landmark. */
|
|
152
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
153
|
+
/** Separator character rendered between crumbs. */
|
|
154
|
+
readonly separator: _angular_core.InputSignal<string>;
|
|
155
|
+
private readonly items;
|
|
156
|
+
/** Wrap the separator in quotes for the CSS `content` property. */
|
|
157
|
+
protected readonly separatorValue: _angular_core.Signal<string>;
|
|
158
|
+
constructor();
|
|
159
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkBreadcrumb, never>;
|
|
160
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkBreadcrumb, "mk-breadcrumb", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; }, {}, ["items"], ["*"], true, never>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* A single crumb inside `<mk-breadcrumb>`. Renders a link when `href` is set,
|
|
165
|
+
* otherwise plain text. The last item is automatically marked
|
|
166
|
+
* `aria-current="page"` by the parent.
|
|
167
|
+
*
|
|
168
|
+
* ```html
|
|
169
|
+
* <mk-breadcrumb-item href="/">Home</mk-breadcrumb-item>
|
|
170
|
+
* <mk-breadcrumb-item>Current page</mk-breadcrumb-item>
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
declare class MkBreadcrumbItem {
|
|
174
|
+
/** Optional link target. Rendered as text when omitted or when it is last. */
|
|
175
|
+
readonly href: _angular_core.InputSignal<string | undefined>;
|
|
176
|
+
/** Whether this is the final crumb. Set by the parent `MkBreadcrumb`. */
|
|
177
|
+
readonly last: _angular_core.WritableSignal<boolean>;
|
|
178
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkBreadcrumbItem, never>;
|
|
179
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkBreadcrumbItem, "mk-breadcrumb-item", never, { "href": { "alias": "href"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** A rendered pagination cell: a real page number or a gap marker. */
|
|
183
|
+
type MkPageItem = number | 'ellipsis';
|
|
184
|
+
/**
|
|
185
|
+
* Page navigation with previous/next controls and numbered pages that collapse
|
|
186
|
+
* to ellipses for large ranges. Provide either `total` (+ `pageSize`) or a
|
|
187
|
+
* direct `pageCount`. `page` is 1-based and two-way bindable.
|
|
188
|
+
*
|
|
189
|
+
* ```html
|
|
190
|
+
* <mk-pagination
|
|
191
|
+
* [total]="240"
|
|
192
|
+
* [pageSize]="20"
|
|
193
|
+
* [(page)]="page"
|
|
194
|
+
* (pageChange)="load($event)"
|
|
195
|
+
* />
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
declare class MkPagination {
|
|
199
|
+
/** Localised strings (override globally via `provideMkI18n`). */
|
|
200
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
201
|
+
/** Total number of items (used with `pageSize` when `pageCount` is unset). */
|
|
202
|
+
readonly total: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
203
|
+
/** Items per page. */
|
|
204
|
+
readonly pageSize: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
205
|
+
/** Explicit page count; overrides `total`/`pageSize` when > 0. */
|
|
206
|
+
readonly pageCount: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
207
|
+
/** Current 1-based page (two-way). */
|
|
208
|
+
readonly page: _angular_core.ModelSignal<number>;
|
|
209
|
+
/** Number of page buttons to keep on each side of the current page. */
|
|
210
|
+
readonly siblingCount: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
211
|
+
/** Number of page buttons pinned at each end. */
|
|
212
|
+
readonly boundaryCount: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
213
|
+
/** Accessible label for the navigation landmark. */
|
|
214
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
215
|
+
/**
|
|
216
|
+
* `pageChange` is emitted automatically by the two-way `page` model whenever
|
|
217
|
+
* the page changes — bind it via `(pageChange)` or `[(page)]`.
|
|
218
|
+
*/
|
|
219
|
+
/** Resolved total number of pages (at least 1). */
|
|
220
|
+
protected readonly pages: _angular_core.Signal<number>;
|
|
221
|
+
protected readonly current: _angular_core.Signal<number>;
|
|
222
|
+
protected readonly hasPrev: _angular_core.Signal<boolean>;
|
|
223
|
+
protected readonly hasNext: _angular_core.Signal<boolean>;
|
|
224
|
+
/** The sequence of page cells with ellipsis gaps. */
|
|
225
|
+
protected readonly items: _angular_core.Signal<MkPageItem[]>;
|
|
226
|
+
protected goTo(page: number): void;
|
|
227
|
+
protected prev(): void;
|
|
228
|
+
protected next(): void;
|
|
229
|
+
private range;
|
|
230
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPagination, never>;
|
|
231
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkPagination, "mk-pagination", never, { "total": { "alias": "total"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "pageCount": { "alias": "pageCount"; "required": false; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; "siblingCount": { "alias": "siblingCount"; "required": false; "isSignal": true; }; "boundaryCount": { "alias": "boundaryCount"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "page": "pageChange"; }, never, never, true, never>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Dropdown menu implementing the ARIA menu pattern (roving focus, Arrow / Home
|
|
236
|
+
* / End / typeahead, Enter/Space to activate). Attach it to a trigger with the
|
|
237
|
+
* `mkMenuTriggerFor` directive; the trigger controls opening and positioning.
|
|
238
|
+
*
|
|
239
|
+
* The panel is rendered in the browser top layer via {@link MkAnchoredPanel}, so
|
|
240
|
+
* it is never clipped by an ancestor's `overflow`/`transform` and always flips
|
|
241
|
+
* back on-screen near a viewport edge.
|
|
242
|
+
*
|
|
243
|
+
* ```html
|
|
244
|
+
* <button mkButton [mkMenuTriggerFor]="menu">Actions</button>
|
|
245
|
+
* <mk-menu #menu>
|
|
246
|
+
* <mk-menu-item (action)="edit()">Edit</mk-menu-item>
|
|
247
|
+
* <mk-menu-item danger (action)="del()">Delete</mk-menu-item>
|
|
248
|
+
* </mk-menu>
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
declare class MkMenu implements OnDestroy {
|
|
252
|
+
private readonly document;
|
|
253
|
+
private readonly injector;
|
|
254
|
+
private readonly isBrowser;
|
|
255
|
+
private readonly items;
|
|
256
|
+
/** Stable id for `aria-controls` on the trigger. */
|
|
257
|
+
readonly panelId: string;
|
|
258
|
+
private readonly _open;
|
|
259
|
+
/** Whether the menu is currently open. */
|
|
260
|
+
readonly opened: _angular_core.Signal<boolean>;
|
|
261
|
+
/** Accessible label for the menu (defaults via the trigger if unset). */
|
|
262
|
+
readonly ariaLabel: _angular_core.WritableSignal<string | undefined>;
|
|
263
|
+
/** Element to anchor the panel to (element-anchored open). */
|
|
264
|
+
protected readonly anchorEl: _angular_core.WritableSignal<HTMLElement | undefined>;
|
|
265
|
+
/** Viewport point to anchor to (`openAt` / context menu). */
|
|
266
|
+
protected readonly anchorPoint: _angular_core.WritableSignal<{
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
} | undefined>;
|
|
270
|
+
private triggerEl;
|
|
271
|
+
private typeahead;
|
|
272
|
+
private typeaheadTimer?;
|
|
273
|
+
/**
|
|
274
|
+
* Open the menu anchored to `trigger`. `focus` picks the item that receives
|
|
275
|
+
* focus once the panel is painted: `true`/`'first'` for the first enabled
|
|
276
|
+
* item, `'last'` for the last (ArrowUp on a menu button, per the APG
|
|
277
|
+
* menu-button pattern), `false` to leave focus where it is (mouse open).
|
|
278
|
+
*/
|
|
279
|
+
open(trigger: HTMLElement, focus?: boolean | 'first' | 'last'): void;
|
|
280
|
+
/**
|
|
281
|
+
* Open the menu at viewport coordinates — e.g. a right-click point from a
|
|
282
|
+
* `contextmenu` event. Positioning (and flip/shift back on-screen) is handled
|
|
283
|
+
* by {@link MkAnchoredPanel} via the point anchor. Focus moves to the first
|
|
284
|
+
* item; `restoreFocusEl` (when provided) regains focus on close.
|
|
285
|
+
*/
|
|
286
|
+
openAt(x: number, y: number, restoreFocusEl?: HTMLElement): void;
|
|
287
|
+
/** Close the menu; optionally restore focus to the trigger. */
|
|
288
|
+
close(restoreFocus?: boolean): void;
|
|
289
|
+
/** Toggle open/closed from a trigger. */
|
|
290
|
+
toggle(trigger: HTMLElement, focusFirst?: boolean): void;
|
|
291
|
+
/**
|
|
292
|
+
* Move focus to the first enabled item. Used by the trigger when the menu is
|
|
293
|
+
* already open (e.g. ArrowDown after a mouse open), so arrow keys always
|
|
294
|
+
* reach the items even though focus never left the trigger.
|
|
295
|
+
*/
|
|
296
|
+
focusFirstItem(): void;
|
|
297
|
+
/** Move focus to the last enabled item (ArrowUp from the trigger). */
|
|
298
|
+
focusLastItem(): void;
|
|
299
|
+
/** Focus an item once the panel is in the top layer and painted. */
|
|
300
|
+
private focusAfterOpen;
|
|
301
|
+
protected onPanelKeydown(event: KeyboardEvent): void;
|
|
302
|
+
private enabled;
|
|
303
|
+
private activeItem;
|
|
304
|
+
private currentIndex;
|
|
305
|
+
private move;
|
|
306
|
+
private focusFirst;
|
|
307
|
+
private focusLast;
|
|
308
|
+
private onTypeahead;
|
|
309
|
+
ngOnDestroy(): void;
|
|
310
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkMenu, never>;
|
|
311
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkMenu, "mk-menu", ["mkMenu"], {}, {}, ["items"], ["*"], true, never>;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* An item within an `<mk-menu>`. Renders as an ARIA `menuitem` with an optional
|
|
316
|
+
* icon slot (`[mkMenuItemIcon]`), disabled and danger states, and either emits
|
|
317
|
+
* `action` or navigates when `href` is set. Activating closes the menu.
|
|
318
|
+
*
|
|
319
|
+
* ```html
|
|
320
|
+
* <mk-menu-item (action)="rename()">
|
|
321
|
+
* <svg mkMenuItemIcon>…</svg> Rename
|
|
322
|
+
* </mk-menu-item>
|
|
323
|
+
* <mk-menu-item danger (action)="remove()">Delete</mk-menu-item>
|
|
324
|
+
* <mk-menu-item href="/help">Help</mk-menu-item>
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
declare class MkMenuItem {
|
|
328
|
+
private readonly el;
|
|
329
|
+
private readonly document;
|
|
330
|
+
private readonly menu;
|
|
331
|
+
/** Prevent selection and focus. */
|
|
332
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
333
|
+
/** Destructive styling (e.g. Delete). */
|
|
334
|
+
readonly danger: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
335
|
+
/** When set, activating the item navigates here. */
|
|
336
|
+
readonly href: _angular_core.InputSignal<string | undefined>;
|
|
337
|
+
/** Emitted when the item is activated (not for disabled items). */
|
|
338
|
+
readonly action: _angular_core.OutputEmitterRef<void>;
|
|
339
|
+
activate(event?: Event): void;
|
|
340
|
+
/** Move DOM focus to this item (roving focus). */
|
|
341
|
+
focusEl(): void;
|
|
342
|
+
/** Whether `node` lives inside this item. */
|
|
343
|
+
contains(node: Node | null): boolean;
|
|
344
|
+
/** Lowercased text content, used for typeahead matching. */
|
|
345
|
+
text(): string;
|
|
346
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkMenuItem, never>;
|
|
347
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkMenuItem, "mk-menu-item", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "danger": { "alias": "danger"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; }, { "action": "action"; }, never, ["[mkMenuItemIcon]", "*"], true, never>;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Turns its host button into a trigger for an `<mk-menu>`. Wires
|
|
352
|
+
* `aria-haspopup="menu"` / `aria-expanded` / `aria-controls`, toggles on click,
|
|
353
|
+
* opens on ArrowDown / Enter / Space (focusing the first item) and on ArrowUp
|
|
354
|
+
* (focusing the last item, per the APG menu-button pattern), and closes on
|
|
355
|
+
* Escape. When the menu is already open — e.g. after a mouse click, which
|
|
356
|
+
* deliberately leaves focus on the trigger — ArrowDown moves focus to the
|
|
357
|
+
* first item and ArrowUp to the last, so the keyboard is never dead.
|
|
358
|
+
*
|
|
359
|
+
* ```html
|
|
360
|
+
* <button mkButton [mkMenuTriggerFor]="menu">Actions</button>
|
|
361
|
+
* <mk-menu #menu>…</mk-menu>
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
declare class MkMenuTrigger {
|
|
365
|
+
private readonly host;
|
|
366
|
+
/** The menu instance to control. */
|
|
367
|
+
readonly menu: _angular_core.InputSignal<MkMenu>;
|
|
368
|
+
protected onClick(event: Event): void;
|
|
369
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
370
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkMenuTrigger, never>;
|
|
371
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkMenuTrigger, "[mkMenuTriggerFor]", ["mkMenuTrigger"], { "menu": { "alias": "mkMenuTriggerFor"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Admin dashboard layout with a fixed header, a collapsible/responsive sidebar
|
|
376
|
+
* and a main content area. On small screens the sidebar becomes a focus-trapped
|
|
377
|
+
* off-canvas drawer with a scrim (Escape to close). Includes a skip-to-content
|
|
378
|
+
* link for keyboard users.
|
|
379
|
+
*
|
|
380
|
+
* ```html
|
|
381
|
+
* <mk-app-shell [(sidebarOpen)]="open" [(sidebarCollapsed)]="collapsed">
|
|
382
|
+
* <div mkAppHeader>
|
|
383
|
+
* <button mkButton iconOnly (click)="shell.toggleSidebar()">☰</button>
|
|
384
|
+
* </div>
|
|
385
|
+
* <mk-nav-list mkAppSidebar [collapsed]="collapsed()">…</mk-nav-list>
|
|
386
|
+
* <router-outlet />
|
|
387
|
+
* </mk-app-shell>
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
declare class MkAppShell {
|
|
391
|
+
private readonly document;
|
|
392
|
+
private readonly isBrowser;
|
|
393
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
394
|
+
private readonly sidebarRef;
|
|
395
|
+
/** Whether the mobile drawer is open (two-way). */
|
|
396
|
+
readonly sidebarOpen: _angular_core.ModelSignal<boolean>;
|
|
397
|
+
/** Whether the desktop sidebar is collapsed to icons (two-way). */
|
|
398
|
+
readonly sidebarCollapsed: _angular_core.ModelSignal<boolean>;
|
|
399
|
+
/** True when the viewport is at/below the mobile breakpoint. */
|
|
400
|
+
readonly isMobile: _angular_core.WritableSignal<boolean>;
|
|
401
|
+
private focusTrap?;
|
|
402
|
+
constructor();
|
|
403
|
+
private mql?;
|
|
404
|
+
private readonly onMediaChange;
|
|
405
|
+
ngOnDestroy(): void;
|
|
406
|
+
/** Toggle the mobile drawer open/closed. Handy for a hamburger button. */
|
|
407
|
+
toggleSidebar(): void;
|
|
408
|
+
/** Open the mobile drawer. */
|
|
409
|
+
openSidebar(): void;
|
|
410
|
+
/** Close the mobile drawer. */
|
|
411
|
+
closeSidebar(): void;
|
|
412
|
+
/** Toggle the desktop collapsed (icon-only) state. */
|
|
413
|
+
toggleCollapsed(): void;
|
|
414
|
+
protected onSidebarKeydown(event: KeyboardEvent): void;
|
|
415
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkAppShell, never>;
|
|
416
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkAppShell, "mk-app-shell", never, { "sidebarOpen": { "alias": "sidebarOpen"; "required": false; "isSignal": true; }; "sidebarCollapsed": { "alias": "sidebarCollapsed"; "required": false; "isSignal": true; }; }, { "sidebarOpen": "sidebarOpenChange"; "sidebarCollapsed": "sidebarCollapsedChange"; }, never, ["[mkAppHeader]", "[mkAppSidebar]", "*"], true, never>;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Sidebar navigation list. Hosts `<mk-nav-item>`s and, when `collapsed`, drives
|
|
421
|
+
* them into an icon-only rail (labels hidden, exposed via `title` tooltips).
|
|
422
|
+
* Designed to sit inside the `mkAppSidebar` slot of `<mk-app-shell>`.
|
|
423
|
+
*
|
|
424
|
+
* ```html
|
|
425
|
+
* <mk-nav-list [collapsed]="collapsed()">
|
|
426
|
+
* <mk-nav-item label="Dashboard" href="/" active>
|
|
427
|
+
* <svg mkNavIcon>…</svg>
|
|
428
|
+
* </mk-nav-item>
|
|
429
|
+
* </mk-nav-list>
|
|
430
|
+
* ```
|
|
431
|
+
*/
|
|
432
|
+
declare class MkNavList {
|
|
433
|
+
/** Collapse items to icon-only. Read by descendant `MkNavItem`s. */
|
|
434
|
+
readonly collapsed: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
435
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkNavList, never>;
|
|
436
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkNavList, "mk-nav-list", never, { "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* A single sidebar entry: icon slot (`[mkNavIcon]`), label, optional badge and
|
|
441
|
+
* active state. Renders a link when `href` is set, otherwise a button that
|
|
442
|
+
* emits `action`. If it contains nested `<mk-nav-item>`s it becomes an
|
|
443
|
+
* expandable disclosure (`aria-expanded`). Collapses to an icon in a collapsed
|
|
444
|
+
* list, exposing the label as a tooltip — and because a sub-list can't be shown
|
|
445
|
+
* at rail width, a parent item there emits `action` (navigate) instead of
|
|
446
|
+
* toggling, so it never becomes a dead button.
|
|
447
|
+
*
|
|
448
|
+
* ```html
|
|
449
|
+
* <mk-nav-item label="Reports" active href="/reports" badge="3">
|
|
450
|
+
* <svg mkNavIcon>…</svg>
|
|
451
|
+
* </mk-nav-item>
|
|
452
|
+
* <mk-nav-item label="Settings">
|
|
453
|
+
* <svg mkNavIcon>…</svg>
|
|
454
|
+
* <mk-nav-item label="Team" href="/team" />
|
|
455
|
+
* </mk-nav-item>
|
|
456
|
+
* ```
|
|
457
|
+
*/
|
|
458
|
+
declare class MkNavItem {
|
|
459
|
+
private readonly list;
|
|
460
|
+
/** Visible label. Also used as the tooltip when collapsed. */
|
|
461
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
462
|
+
/** Link target. Renders an anchor instead of a button. */
|
|
463
|
+
readonly href: _angular_core.InputSignal<string | undefined>;
|
|
464
|
+
/** Marks the current page (`aria-current="page"`). */
|
|
465
|
+
readonly active: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
466
|
+
/** Disable interaction. */
|
|
467
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
468
|
+
/** Optional badge (count or short text). */
|
|
469
|
+
readonly badge: _angular_core.InputSignal<string | number | undefined>;
|
|
470
|
+
/** Whether nested children are expanded (two-way). */
|
|
471
|
+
readonly expanded: _angular_core.ModelSignal<boolean>;
|
|
472
|
+
/** Emitted when a button-style item is activated. */
|
|
473
|
+
readonly action: _angular_core.OutputEmitterRef<void>;
|
|
474
|
+
/** Nested items projected inside this one. */
|
|
475
|
+
private readonly children;
|
|
476
|
+
protected readonly hasChildren: _angular_core.Signal<boolean>;
|
|
477
|
+
/** Collapsed state inherited from the enclosing `MkNavList`. */
|
|
478
|
+
protected readonly collapsed: _angular_core.Signal<boolean>;
|
|
479
|
+
/** Id wiring the disclosure button to its sub-list. */
|
|
480
|
+
protected readonly subId: string;
|
|
481
|
+
protected toggle(): void;
|
|
482
|
+
protected activate(): void;
|
|
483
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkNavItem, never>;
|
|
484
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkNavItem, "mk-nav-item", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "badge": { "alias": "badge"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; "action": "action"; }, ["children"], ["[mkNavIcon]", "mk-nav-item"], true, never>;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* A titled section within an `<mk-nav-list>` — the "MAIN" / "SETTINGS" groupings
|
|
489
|
+
* common in admin/CMS sidebars. Static by default; set `collapsible` to make
|
|
490
|
+
* the label a toggle that expands/collapses its items (`aria-expanded` +
|
|
491
|
+
* region). In a collapsed icon rail the label becomes a divider.
|
|
492
|
+
*
|
|
493
|
+
* ```html
|
|
494
|
+
* <mk-nav-list>
|
|
495
|
+
* <mk-nav-group label="Main">
|
|
496
|
+
* <mk-nav-item label="Dashboard" href="/" />
|
|
497
|
+
* </mk-nav-group>
|
|
498
|
+
* <mk-nav-group label="Settings" collapsible>
|
|
499
|
+
* <mk-nav-item label="Team" href="/team" />
|
|
500
|
+
* </mk-nav-group>
|
|
501
|
+
* </mk-nav-list>
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
504
|
+
declare class MkNavGroup {
|
|
505
|
+
private readonly list;
|
|
506
|
+
/** Section title. */
|
|
507
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
508
|
+
/** Make the label a toggle that shows/hides the items. */
|
|
509
|
+
readonly collapsible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
510
|
+
/** Whether the section is expanded (two-way; only meaningful when collapsible). */
|
|
511
|
+
readonly expanded: _angular_core.ModelSignal<boolean>;
|
|
512
|
+
/** Id of the items region (for `aria-controls`). */
|
|
513
|
+
readonly regionId: string;
|
|
514
|
+
/** Whether the enclosing list is a collapsed icon rail. */
|
|
515
|
+
protected readonly railCollapsed: _angular_core.Signal<boolean>;
|
|
516
|
+
/** Items are visible unless collapsible-and-closed. */
|
|
517
|
+
protected readonly itemsVisible: _angular_core.Signal<boolean>;
|
|
518
|
+
protected toggle(): void;
|
|
519
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkNavGroup, never>;
|
|
520
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkNavGroup, "mk-nav-group", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, ["*"], true, never>;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* A single step + its content panel. Declared inside `<mk-stepper>`; the
|
|
525
|
+
* projected content becomes the step body while `label` (and optional
|
|
526
|
+
* `description`) render in the step header.
|
|
527
|
+
*
|
|
528
|
+
* `completed` is a two-way model so a parent can gate a `linear` stepper:
|
|
529
|
+
* `<mk-step label="Details" [(completed)]="detailsValid()">`.
|
|
530
|
+
*
|
|
531
|
+
* ```html
|
|
532
|
+
* <mk-stepper linear>
|
|
533
|
+
* <mk-step label="Account" [completed]="form.valid">…</mk-step>
|
|
534
|
+
* <mk-step label="Payment" optional>…</mk-step>
|
|
535
|
+
* </mk-stepper>
|
|
536
|
+
* ```
|
|
537
|
+
*/
|
|
538
|
+
declare class MkStep {
|
|
539
|
+
/** Title shown in the step header. */
|
|
540
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
541
|
+
/** Optional secondary line under the label. */
|
|
542
|
+
readonly description: _angular_core.InputSignal<string>;
|
|
543
|
+
/** Marks the step optional (skippable in a `linear` stepper). */
|
|
544
|
+
readonly optional: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
545
|
+
/** Whether the step is complete (two-way; drives `linear` gating + the ✓). */
|
|
546
|
+
readonly completed: _angular_core.ModelSignal<boolean>;
|
|
547
|
+
/** Show the error state in the header (e.g. failed validation). */
|
|
548
|
+
readonly hasError: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
549
|
+
/** Allow returning to this step after it is completed. */
|
|
550
|
+
readonly editable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
551
|
+
/** Stable id for the header button (wires `aria-labelledby`). */
|
|
552
|
+
readonly headerId: string;
|
|
553
|
+
/** Stable id for the panel (wires `aria-controls`). */
|
|
554
|
+
readonly panelId: string;
|
|
555
|
+
/** Whether this step is currently selected. Set by the parent `MkStepper`. */
|
|
556
|
+
readonly active: _angular_core.WritableSignal<boolean>;
|
|
557
|
+
/**
|
|
558
|
+
* The step body, captured so `MkStepper` can render it in the position the
|
|
559
|
+
* orientation calls for. The host element itself stays empty — the panel
|
|
560
|
+
* wrapper (and its role/aria) belongs to the stepper, which is the only
|
|
561
|
+
* place that knows whether this is a tab panel or a disclosure region.
|
|
562
|
+
*/
|
|
563
|
+
readonly content: _angular_core.Signal<TemplateRef<any>>;
|
|
564
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkStep, never>;
|
|
565
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkStep, "mk-step", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "completed": { "alias": "completed"; "required": false; "isSignal": true; }; "hasError": { "alias": "hasError"; "required": false; "isSignal": true; }; "editable": { "alias": "editable"; "required": false; "isSignal": true; }; }, { "completed": "completedChange"; }, never, ["*"], true, never>;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/** Orientation of the step header rail. */
|
|
569
|
+
type MkStepperOrientation = 'horizontal' | 'vertical';
|
|
570
|
+
/**
|
|
571
|
+
* Stepper — walks a user through an ordered sequence of `<mk-step>`s with an
|
|
572
|
+
* accessible header rail (ARIA `tablist` + roving tabindex, Arrow/Home/End
|
|
573
|
+
* navigation) and a single visible panel.
|
|
574
|
+
*
|
|
575
|
+
* In `linear` mode a step is only reachable once every preceding required
|
|
576
|
+
* (non-`optional`) step reports `completed`. Drive completion from your form
|
|
577
|
+
* state and move with the `next()` / `previous()` / `reset()` API or by
|
|
578
|
+
* clicking a reachable header.
|
|
579
|
+
*
|
|
580
|
+
* ```html
|
|
581
|
+
* <mk-stepper #s linear [(selectedIndex)]="index">
|
|
582
|
+
* <mk-step label="Account" [completed]="accountValid()">…</mk-step>
|
|
583
|
+
* <mk-step label="Address" [completed]="addressValid()">…</mk-step>
|
|
584
|
+
* <mk-step label="Review">…</mk-step>
|
|
585
|
+
* </mk-stepper>
|
|
586
|
+
* <button mkButton (click)="s.previous()">Back</button>
|
|
587
|
+
* <button mkButton (click)="s.next()">Next</button>
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
declare class MkStepper {
|
|
591
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
592
|
+
/** Step hosts are projected on the server only — see stepper.html. */
|
|
593
|
+
protected readonly isServer: boolean;
|
|
594
|
+
/** Projected steps, kept live via a signal content query. */
|
|
595
|
+
readonly steps: _angular_core.Signal<readonly MkStep[]>;
|
|
596
|
+
/** Rendered header buttons, used to move focus. */
|
|
597
|
+
protected readonly headerButtons: _angular_core.Signal<readonly ElementRef<HTMLButtonElement>[]>;
|
|
598
|
+
/** Zero-based index of the active step (two-way). */
|
|
599
|
+
readonly selectedIndex: _angular_core.ModelSignal<number>;
|
|
600
|
+
/** Header rail orientation. */
|
|
601
|
+
readonly orientation: _angular_core.InputSignal<MkStepperOrientation>;
|
|
602
|
+
/** Enforce sequential completion before a step becomes reachable. */
|
|
603
|
+
readonly linear: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
604
|
+
protected readonly isHorizontal: _angular_core.Signal<boolean>;
|
|
605
|
+
/** Emits the newly selected index whenever the active step changes. */
|
|
606
|
+
readonly selectionChange: _angular_core.OutputEmitterRef<number>;
|
|
607
|
+
constructor();
|
|
608
|
+
private readonly clampedIndex;
|
|
609
|
+
/** 1-based label for the header circle. */
|
|
610
|
+
protected stepNumber(index: number): number;
|
|
611
|
+
/**
|
|
612
|
+
* Whether a step can be selected. In linear mode every earlier required step
|
|
613
|
+
* must be completed; a completed step is reachable only when `editable`.
|
|
614
|
+
*/
|
|
615
|
+
isReachable(index: number): boolean;
|
|
616
|
+
protected select(index: number): void;
|
|
617
|
+
protected focusHeader(index: number): void;
|
|
618
|
+
/** Advance to the next reachable step, if any. */
|
|
619
|
+
next(): void;
|
|
620
|
+
/** Return to the previous step, if any. */
|
|
621
|
+
previous(): void;
|
|
622
|
+
/** Reset to the first step and clear every step's completed flag. */
|
|
623
|
+
reset(): void;
|
|
624
|
+
protected onKeydown(event: KeyboardEvent, index: number): void;
|
|
625
|
+
/** Next header index (wrapping) whose step is reachable. */
|
|
626
|
+
private nextFocusable;
|
|
627
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkStepper, never>;
|
|
628
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkStepper, "mk-stepper", never, { "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; }, { "selectedIndex": "selectedIndexChange"; "selectionChange": "selectionChange"; }, ["steps"], ["*"], true, never>;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/** A node in an {@link MkTree}. `children` makes it expandable. */
|
|
632
|
+
interface MkTreeNode {
|
|
633
|
+
/** Text shown for the node. */
|
|
634
|
+
label: string;
|
|
635
|
+
/** Value bound to the selection when the node is chosen (defaults to the node). */
|
|
636
|
+
value?: unknown;
|
|
637
|
+
/** Child nodes; a non-empty array makes the node a parent (expandable). */
|
|
638
|
+
children?: MkTreeNode[];
|
|
639
|
+
/** Disable selection/toggling of this node (still focusable). */
|
|
640
|
+
disabled?: boolean;
|
|
641
|
+
/** Expand this node initially. */
|
|
642
|
+
expanded?: boolean;
|
|
643
|
+
/** Optional leading glyph (any short string / emoji). */
|
|
644
|
+
icon?: string;
|
|
645
|
+
}
|
|
646
|
+
/** One visible row after flattening the tree for keyboard + rendering. */
|
|
647
|
+
interface MkTreeRow {
|
|
648
|
+
node: MkTreeNode;
|
|
649
|
+
level: number;
|
|
650
|
+
posinset: number;
|
|
651
|
+
setsize: number;
|
|
652
|
+
expandable: boolean;
|
|
653
|
+
expanded: boolean;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Tree — renders hierarchical data following the ARIA tree pattern
|
|
657
|
+
* (`role="tree"` / `treeitem` with `aria-level`, `aria-expanded`,
|
|
658
|
+
* `aria-selected`). Supply `nodes`; expansion is managed internally.
|
|
659
|
+
*
|
|
660
|
+
* Keyboard: Up/Down move between visible rows, Right expands (or steps into the
|
|
661
|
+
* first child), Left collapses (or steps out to the parent), Home/End jump, and
|
|
662
|
+
* Enter/Space toggles expansion and selects (when `selectable`). A single
|
|
663
|
+
* roving tabindex keeps the whole tree one tab stop.
|
|
664
|
+
*
|
|
665
|
+
* ```html
|
|
666
|
+
* <mk-tree selectable [nodes]="tree" [(selected)]="picked"
|
|
667
|
+
* (selectionChange)="onPick($event)" />
|
|
668
|
+
* ```
|
|
669
|
+
*/
|
|
670
|
+
declare class MkTree {
|
|
671
|
+
/** The hierarchical data to render. */
|
|
672
|
+
readonly nodes: _angular_core.InputSignal<readonly MkTreeNode[]>;
|
|
673
|
+
/** Allow choosing a node (adds selection styling + `aria-selected`). */
|
|
674
|
+
readonly selectable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
675
|
+
/** Accessible name for the tree. */
|
|
676
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
677
|
+
/** Two-way selected value (a node's `value`, or the node itself if unset). */
|
|
678
|
+
readonly selected: _angular_core.ModelSignal<unknown>;
|
|
679
|
+
/** Emits the selected value whenever the selection changes. */
|
|
680
|
+
readonly selectionChange: _angular_core.OutputEmitterRef<unknown>;
|
|
681
|
+
/** Emits a node whenever it is expanded or collapsed. */
|
|
682
|
+
readonly nodeToggle: _angular_core.OutputEmitterRef<MkTreeNode>;
|
|
683
|
+
protected readonly rowRefs: _angular_core.Signal<readonly ElementRef<HTMLElement>[]>;
|
|
684
|
+
/**
|
|
685
|
+
* Expanded nodes. Survives `nodes` identity changes (a consumer rebuilding
|
|
686
|
+
* the array keeps the user's expansion state for the node objects it
|
|
687
|
+
* reuses); a node's `expanded` flag only seeds nodes NOT present in the
|
|
688
|
+
* previous array — so it applies on first render and to newly added nodes,
|
|
689
|
+
* without reverting branches the user has since collapsed.
|
|
690
|
+
*/
|
|
691
|
+
private readonly expandedSet;
|
|
692
|
+
protected readonly activeIndex: _angular_core.WritableSignal<number>;
|
|
693
|
+
/** Flattened list of currently visible rows (respects expansion). */
|
|
694
|
+
protected readonly rows: _angular_core.Signal<MkTreeRow[]>;
|
|
695
|
+
private valueOf;
|
|
696
|
+
protected isSelected(node: MkTreeNode): boolean;
|
|
697
|
+
protected isExpanded(node: MkTreeNode): boolean;
|
|
698
|
+
protected toggle(node: MkTreeNode): void;
|
|
699
|
+
private expand;
|
|
700
|
+
private collapse;
|
|
701
|
+
protected select(node: MkTreeNode): void;
|
|
702
|
+
/**
|
|
703
|
+
* Click on a parent row's chevron: toggle expansion WITHOUT selecting, so
|
|
704
|
+
* mouse users can open a branch without committing it (hosts like
|
|
705
|
+
* `mk-tree-select` close on any selection, which would make children
|
|
706
|
+
* unreachable by mouse otherwise). On leaf rows the click falls through to
|
|
707
|
+
* the row handler and behaves as a normal row click.
|
|
708
|
+
*/
|
|
709
|
+
protected onToggleClick(event: Event, index: number): void;
|
|
710
|
+
/** Click a row: toggle expansion for parents, select when selectable. */
|
|
711
|
+
protected onRowClick(index: number): void;
|
|
712
|
+
protected onKeydown(event: KeyboardEvent, index: number): void;
|
|
713
|
+
/** Index of the nearest preceding row one level up (or the row itself). */
|
|
714
|
+
private parentIndex;
|
|
715
|
+
private focusRow;
|
|
716
|
+
protected tabIndexFor(index: number): number;
|
|
717
|
+
protected indent(level: number): string;
|
|
718
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTree, never>;
|
|
719
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTree, "mk-tree", never, { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "selectionChange": "selectionChange"; "nodeToggle": "nodeToggle"; }, never, never, true, never>;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/** Edge the drawer slides in from. */
|
|
723
|
+
type MkDrawerSide = 'start' | 'end' | 'top' | 'bottom';
|
|
724
|
+
/**
|
|
725
|
+
* Drawer — a declarative slide-out panel anchored to a viewport edge, driven by
|
|
726
|
+
* a two-way `open`. Ideal for admin/CMS side panels: filters, entity details,
|
|
727
|
+
* settings, quick-create forms. Traps focus while open, closes on backdrop
|
|
728
|
+
* click or Escape, restores focus on close, and locks body scroll when modal.
|
|
729
|
+
*
|
|
730
|
+
* Slots: `[mkDrawerHeader]` (extra header content), default content (body),
|
|
731
|
+
* `[mkDrawerFooter]` (sticky footer).
|
|
732
|
+
*
|
|
733
|
+
* ```html
|
|
734
|
+
* <button mkButton (click)="filters.set(true)">Filters</button>
|
|
735
|
+
* <mk-drawer [(open)]="filters" side="end" heading="Filters">
|
|
736
|
+
* …filter form…
|
|
737
|
+
* <div mkDrawerFooter>
|
|
738
|
+
* <button mkButton variant="ghost" (click)="filters.set(false)">Close</button>
|
|
739
|
+
* <button mkButton (click)="apply()">Apply</button>
|
|
740
|
+
* </div>
|
|
741
|
+
* </mk-drawer>
|
|
742
|
+
* ```
|
|
743
|
+
*/
|
|
744
|
+
declare class MkDrawer {
|
|
745
|
+
private readonly document;
|
|
746
|
+
/** Localised strings (override globally via `provideMkI18n`). */
|
|
747
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
748
|
+
private readonly isBrowser;
|
|
749
|
+
private readonly panelRef;
|
|
750
|
+
/** Whether the drawer is open (two-way). */
|
|
751
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
752
|
+
/** Viewport edge to anchor to. */
|
|
753
|
+
readonly side: _angular_core.InputSignal<MkDrawerSide>;
|
|
754
|
+
/** Panel width (start/end) or height (top/bottom) — any CSS length. */
|
|
755
|
+
readonly size: _angular_core.InputSignal<string>;
|
|
756
|
+
/** Render a dimmed backdrop and lock body scroll (modal). */
|
|
757
|
+
readonly hasBackdrop: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
758
|
+
/** Close when the backdrop is clicked. */
|
|
759
|
+
readonly closeOnBackdrop: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
760
|
+
/** Close on the Escape key. */
|
|
761
|
+
readonly closeOnEscape: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
762
|
+
/** Trap Tab focus inside the panel while open. */
|
|
763
|
+
readonly trapFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
764
|
+
/** Optional heading rendered in the header. */
|
|
765
|
+
readonly heading: _angular_core.InputSignal<string>;
|
|
766
|
+
/** Hide the header close button. */
|
|
767
|
+
readonly hideClose: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
768
|
+
/** Accessible name when no `heading` is provided. */
|
|
769
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
770
|
+
readonly titleId: string;
|
|
771
|
+
private focusTrap?;
|
|
772
|
+
private previouslyFocused;
|
|
773
|
+
private scrollLocked;
|
|
774
|
+
constructor();
|
|
775
|
+
private sync;
|
|
776
|
+
/** Release the focus trap + scroll lock if destroyed while open. */
|
|
777
|
+
ngOnDestroy(): void;
|
|
778
|
+
/** Close the drawer. */
|
|
779
|
+
close(): void;
|
|
780
|
+
protected onBackdrop(): void;
|
|
781
|
+
protected onEscape(event: Event): void;
|
|
782
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkDrawer, never>;
|
|
783
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDrawer, "mk-drawer", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "side": { "alias": "side"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; "isSignal": true; }; "closeOnBackdrop": { "alias": "closeOnBackdrop"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "trapFocus": { "alias": "trapFocus"; "required": false; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["[mkDrawerHeader]", "*", "[mkDrawerFooter]"], true, never>;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/**
|
|
787
|
+
* Toolbar — a horizontal action bar: content flows on the start side, anything
|
|
788
|
+
* marked `mkToolbarEnd` is pushed to the end. Handy above tables and lists for
|
|
789
|
+
* a title/search on the left and actions on the right.
|
|
790
|
+
*
|
|
791
|
+
* The projected controls are ordinary tab stops (no roving focus), so this is a
|
|
792
|
+
* layout container, not an ARIA `toolbar` widget.
|
|
793
|
+
*
|
|
794
|
+
* ```html
|
|
795
|
+
* <mk-toolbar bordered aria-label="Users actions">
|
|
796
|
+
* <strong>Users</strong>
|
|
797
|
+
* <span mkToolbarEnd>
|
|
798
|
+
* <button mkButton variant="outline">Export</button>
|
|
799
|
+
* <button mkButton>New user</button>
|
|
800
|
+
* </span>
|
|
801
|
+
* </mk-toolbar>
|
|
802
|
+
* ```
|
|
803
|
+
*/
|
|
804
|
+
declare class MkToolbar {
|
|
805
|
+
/** Wrap the bar in a themed, bordered surface. */
|
|
806
|
+
readonly bordered: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
807
|
+
/** Accessible name (also promotes the bar to an ARIA `group`). */
|
|
808
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
809
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkToolbar, never>;
|
|
810
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkToolbar, "mk-toolbar", never, { "bordered": { "alias": "bordered"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[mkToolbarEnd]"], true, never>;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* PageHeader — the standard heading block at the top of an admin/CMS page: an
|
|
815
|
+
* optional breadcrumb, a page title with optional description and inline meta
|
|
816
|
+
* (badges/status), a right-aligned actions cluster, and an optional tab row
|
|
817
|
+
* beneath. Everything but the title/description is projected, so it composes
|
|
818
|
+
* with `mk-breadcrumb`, `mk-tabs`, buttons, badges, etc.
|
|
819
|
+
*
|
|
820
|
+
* Slots: `[mkPageHeaderBreadcrumb]`, `[mkPageHeaderMeta]` (beside the title),
|
|
821
|
+
* `[mkPageHeaderActions]` (right), `[mkPageHeaderTabs]` (below).
|
|
822
|
+
*
|
|
823
|
+
* ```html
|
|
824
|
+
* <mk-page-header heading="Articles" description="Manage your published posts.">
|
|
825
|
+
* <mk-breadcrumb mkPageHeaderBreadcrumb …></mk-breadcrumb>
|
|
826
|
+
* <mk-badge mkPageHeaderMeta tone="success">Live</mk-badge>
|
|
827
|
+
* <div mkPageHeaderActions>
|
|
828
|
+
* <button mkButton variant="outline">Import</button>
|
|
829
|
+
* <button mkButton>New article</button>
|
|
830
|
+
* </div>
|
|
831
|
+
* </mk-page-header>
|
|
832
|
+
* ```
|
|
833
|
+
*/
|
|
834
|
+
declare class MkPageHeader {
|
|
835
|
+
/** The page title (rendered as an `<h1>`). */
|
|
836
|
+
readonly heading: _angular_core.InputSignal<string>;
|
|
837
|
+
/** Supporting description under the title. */
|
|
838
|
+
readonly description: _angular_core.InputSignal<string>;
|
|
839
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPageHeader, never>;
|
|
840
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkPageHeader, "mk-page-header", never, { "heading": { "alias": "heading"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; }, {}, never, ["[mkPageHeaderBreadcrumb]", "[mkPageHeaderMedia]", "[mkPageHeaderMeta]", "[mkPageHeaderActions]", "[mkPageHeaderTabs]"], true, never>;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/** A single actionable entry in the {@link MkCommandPalette}. */
|
|
844
|
+
interface MkCommand {
|
|
845
|
+
/** Stable unique id. */
|
|
846
|
+
id: string;
|
|
847
|
+
/** Text shown (and the primary search target). */
|
|
848
|
+
label: string;
|
|
849
|
+
/** Optional section heading this command is grouped under. */
|
|
850
|
+
group?: string;
|
|
851
|
+
/** Secondary text shown after the label. */
|
|
852
|
+
hint?: string;
|
|
853
|
+
/** Name of a registered icon (see `MkIconRegistry`). */
|
|
854
|
+
icon?: string;
|
|
855
|
+
/** Extra search terms (not shown). */
|
|
856
|
+
keywords?: string;
|
|
857
|
+
/** Display-only shortcut hint, e.g. `⌘S`. */
|
|
858
|
+
shortcut?: string;
|
|
859
|
+
/** Disable the command (skipped by keyboard, not runnable). */
|
|
860
|
+
disabled?: boolean;
|
|
861
|
+
/** Invoked when the command is chosen. */
|
|
862
|
+
run?: () => void;
|
|
863
|
+
}
|
|
864
|
+
interface Group {
|
|
865
|
+
name: string;
|
|
866
|
+
items: {
|
|
867
|
+
cmd: MkCommand;
|
|
868
|
+
index: number;
|
|
869
|
+
}[];
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* CommandPalette — a modal ⌘K/Ctrl+K menu for fast, keyboard-first actions and
|
|
873
|
+
* navigation. Supply a flat `commands` list (optionally grouped); the palette
|
|
874
|
+
* filters as you type, groups results, and runs the chosen command. Implements
|
|
875
|
+
* the ARIA combobox + listbox pattern with full keyboard support and focus
|
|
876
|
+
* trapping.
|
|
877
|
+
*
|
|
878
|
+
* Mount it once near your app root and bind `open` (the built-in hotkey toggles
|
|
879
|
+
* it, or open it yourself).
|
|
880
|
+
*
|
|
881
|
+
* ```html
|
|
882
|
+
* <mk-command-palette [(open)]="paletteOpen" [commands]="commands"
|
|
883
|
+
* (commandSelected)="run($event)" />
|
|
884
|
+
* ```
|
|
885
|
+
*/
|
|
886
|
+
declare class MkCommandPalette {
|
|
887
|
+
private readonly document;
|
|
888
|
+
private readonly isBrowser;
|
|
889
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
890
|
+
private readonly panelRef;
|
|
891
|
+
private readonly inputRef;
|
|
892
|
+
/** Whether the palette is open (two-way). */
|
|
893
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
894
|
+
/** The commands to search and run. */
|
|
895
|
+
readonly commands: _angular_core.InputSignal<readonly MkCommand[]>;
|
|
896
|
+
/** Search field placeholder. */
|
|
897
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
898
|
+
/** Message shown when nothing matches. */
|
|
899
|
+
readonly emptyMessage: _angular_core.InputSignal<string>;
|
|
900
|
+
/** Toggle open with ⌘K / Ctrl+K anywhere. */
|
|
901
|
+
readonly hotkey: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
902
|
+
/** Emits the chosen command (its own `run` callback also fires). */
|
|
903
|
+
readonly commandSelected: _angular_core.OutputEmitterRef<MkCommand>;
|
|
904
|
+
protected readonly query: _angular_core.WritableSignal<string>;
|
|
905
|
+
protected readonly activeIndex: _angular_core.WritableSignal<number>;
|
|
906
|
+
readonly listId: string;
|
|
907
|
+
private focusTrap?;
|
|
908
|
+
private scrollLocked;
|
|
909
|
+
private previouslyFocused;
|
|
910
|
+
/** Commands matching the current query (label + keywords + group). */
|
|
911
|
+
protected readonly filtered: _angular_core.Signal<readonly MkCommand[]>;
|
|
912
|
+
/** Filtered commands bucketed into ordered groups (flat index preserved). */
|
|
913
|
+
protected readonly grouped: _angular_core.Signal<Group[]>;
|
|
914
|
+
constructor();
|
|
915
|
+
protected optionId(index: number): string;
|
|
916
|
+
protected groupId(index: number): string;
|
|
917
|
+
private sync;
|
|
918
|
+
/**
|
|
919
|
+
* Release the scroll lock + focus trap if the palette is destroyed while
|
|
920
|
+
* open (e.g. a command triggered a route navigation).
|
|
921
|
+
*/
|
|
922
|
+
ngOnDestroy(): void;
|
|
923
|
+
protected onGlobalKey(event: Event): void;
|
|
924
|
+
protected onInput(event: Event): void;
|
|
925
|
+
protected onKeydown(event: Event): void;
|
|
926
|
+
protected select(index: number): void;
|
|
927
|
+
protected close(): void;
|
|
928
|
+
private move;
|
|
929
|
+
private firstEnabled;
|
|
930
|
+
private lastEnabled;
|
|
931
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkCommandPalette, never>;
|
|
932
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkCommandPalette, "mk-command-palette", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "commands": { "alias": "commands"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "hotkey": { "alias": "hotkey"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "commandSelected": "commandSelected"; }, never, never, true, never>;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/** Split direction for {@link MkSplitter}. */
|
|
936
|
+
type MkSplitterOrientation = 'horizontal' | 'vertical';
|
|
937
|
+
/**
|
|
938
|
+
* Splitter — two resizable panes with a draggable, keyboard-operable separator
|
|
939
|
+
* (ARIA `separator` with `aria-valuenow`). `horizontal` places the panes
|
|
940
|
+
* side-by-side (a vertical handle); `vertical` stacks them (a horizontal
|
|
941
|
+
* handle). The start pane's size is a two-way `position` model (percent).
|
|
942
|
+
*
|
|
943
|
+
* Project the panes with `mkSplitterStart` / `mkSplitterEnd`:
|
|
944
|
+
* ```html
|
|
945
|
+
* <mk-splitter [(position)]="split" [min]="20">
|
|
946
|
+
* <nav mkSplitterStart>…</nav>
|
|
947
|
+
* <main mkSplitterEnd>…</main>
|
|
948
|
+
* </mk-splitter>
|
|
949
|
+
* ```
|
|
950
|
+
* Drag the handle, or focus it and use Arrow keys (Home/End jump to min/max).
|
|
951
|
+
*/
|
|
952
|
+
declare class MkSplitter {
|
|
953
|
+
private readonly host;
|
|
954
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
955
|
+
/** `horizontal` = side-by-side; `vertical` = stacked. */
|
|
956
|
+
readonly orientation: _angular_core.InputSignal<MkSplitterOrientation>;
|
|
957
|
+
/** Two-way position of the separator = start-pane size, in percent (0–100). */
|
|
958
|
+
readonly position: _angular_core.ModelSignal<number>;
|
|
959
|
+
/** Minimum start-pane size (percent). */
|
|
960
|
+
readonly min: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
961
|
+
/** Maximum start-pane size (percent). */
|
|
962
|
+
readonly max: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
963
|
+
/** Keyboard resize increment (percent). */
|
|
964
|
+
readonly step: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
965
|
+
/** Disable resizing. */
|
|
966
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
967
|
+
/** Accessible label for the separator. */
|
|
968
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
969
|
+
private dragging;
|
|
970
|
+
/** Clamped size actually applied (defends against out-of-range inputs). */
|
|
971
|
+
protected readonly clampedSize: _angular_core.Signal<number>;
|
|
972
|
+
protected onPointerdown(event: PointerEvent): void;
|
|
973
|
+
protected onPointermove(event: PointerEvent): void;
|
|
974
|
+
protected onPointerup(event: PointerEvent): void;
|
|
975
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
976
|
+
private setSize;
|
|
977
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkSplitter, never>;
|
|
978
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkSplitter, "mk-splitter", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "position": "positionChange"; }, never, ["[mkSplitterStart]", "[mkSplitterEnd]"], true, never>;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
/** Corner placement for a fixed {@link MkFab}. `static` renders it inline. */
|
|
982
|
+
type MkFabPosition = 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start' | 'static';
|
|
983
|
+
/** A speed-dial action button projected into {@link MkFab}. */
|
|
984
|
+
declare class MkFabAction {
|
|
985
|
+
readonly el: ElementRef<HTMLElement>;
|
|
986
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkFabAction, never>;
|
|
987
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkFabAction, "[mkFabAction]", never, {}, {}, never, never, true, never>;
|
|
988
|
+
}
|
|
989
|
+
/**
|
|
990
|
+
* FAB — a floating action button, fixed to a corner (or `static` for inline
|
|
991
|
+
* use). Project the icon as content and set `label` for the accessible name
|
|
992
|
+
* (shown too when `extended`). Add `mkFabAction` buttons to turn it into a
|
|
993
|
+
* speed-dial that reveals them on toggle.
|
|
994
|
+
*
|
|
995
|
+
* ```html
|
|
996
|
+
* <mk-fab label="Create" position="bottom-end">
|
|
997
|
+
* <svg>…</svg>
|
|
998
|
+
* <button mkFabAction (click)="newDoc()">Doc</button>
|
|
999
|
+
* <button mkFabAction (click)="newFolder()">Folder</button>
|
|
1000
|
+
* </mk-fab>
|
|
1001
|
+
* ```
|
|
1002
|
+
*/
|
|
1003
|
+
declare class MkFab {
|
|
1004
|
+
private readonly actions;
|
|
1005
|
+
private readonly trigger;
|
|
1006
|
+
private readonly injector;
|
|
1007
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
1008
|
+
/** Id of the actions container, referenced by the trigger's aria-controls. */
|
|
1009
|
+
protected readonly actionsId: string;
|
|
1010
|
+
/** Corner placement (or `static` to render inline). */
|
|
1011
|
+
readonly position: _angular_core.InputSignal<MkFabPosition>;
|
|
1012
|
+
/** Semantic tone. */
|
|
1013
|
+
readonly tone: _angular_core.InputSignal<MkTone>;
|
|
1014
|
+
/** Size scale. */
|
|
1015
|
+
readonly size: _angular_core.InputSignal<MkSize>;
|
|
1016
|
+
/** Accessible label (and visible text when `extended`). */
|
|
1017
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
1018
|
+
/** Render as a pill with the label beside the icon. */
|
|
1019
|
+
readonly extended: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1020
|
+
/** Disable the button. */
|
|
1021
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1022
|
+
/** Two-way open state of the speed-dial. */
|
|
1023
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
1024
|
+
/** Emitted when the FAB is activated (only when it has no actions). */
|
|
1025
|
+
readonly action: _angular_core.OutputEmitterRef<void>;
|
|
1026
|
+
protected readonly hasActions: _angular_core.Signal<boolean>;
|
|
1027
|
+
protected onClick(): void;
|
|
1028
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
1029
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkFab, never>;
|
|
1030
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkFab, "mk-fab", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "extended": { "alias": "extended"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "action": "action"; }, ["actions"], ["*", "[mkFabAction]"], true, never>;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* BackToTop — a floating button that appears once the page (or a scroll target)
|
|
1035
|
+
* has scrolled past `threshold`, and smooth-scrolls back to the top on click.
|
|
1036
|
+
*
|
|
1037
|
+
* ```html
|
|
1038
|
+
* <mk-back-to-top [threshold]="600" />
|
|
1039
|
+
* ```
|
|
1040
|
+
* Pass `[target]` to watch/scroll a specific scroll container instead of the
|
|
1041
|
+
* window.
|
|
1042
|
+
*/
|
|
1043
|
+
declare class MkBackToTop {
|
|
1044
|
+
private readonly document;
|
|
1045
|
+
private readonly isBrowser;
|
|
1046
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
1047
|
+
/** Scroll distance (px) before the button appears. */
|
|
1048
|
+
readonly threshold: _angular_core.InputSignal<number>;
|
|
1049
|
+
/** Optional scroll container; defaults to the window. */
|
|
1050
|
+
readonly target: _angular_core.InputSignal<HTMLElement | null>;
|
|
1051
|
+
/** Accessible label. */
|
|
1052
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
1053
|
+
/**
|
|
1054
|
+
* Smooth-scroll on click. Ignored under `prefers-reduced-motion: reduce`
|
|
1055
|
+
* (programmatic `scrollTo` is not toned down by browsers, so the component
|
|
1056
|
+
* falls back to an instant jump itself).
|
|
1057
|
+
*/
|
|
1058
|
+
readonly smooth: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1059
|
+
private readonly scrollY;
|
|
1060
|
+
protected readonly visible: _angular_core.Signal<boolean>;
|
|
1061
|
+
private scrollSource?;
|
|
1062
|
+
private readonly onScroll;
|
|
1063
|
+
constructor();
|
|
1064
|
+
protected scrollToTop(): void;
|
|
1065
|
+
/**
|
|
1066
|
+
* Once the page is back at the top the button hides itself, which would
|
|
1067
|
+
* silently drop keyboard focus on `<body>` (WCAG 2.4.3). Move focus to the
|
|
1068
|
+
* scroll container instead, so the tab sequence resumes from the top.
|
|
1069
|
+
*/
|
|
1070
|
+
private focusScrollTarget;
|
|
1071
|
+
/** `prefers-reduced-motion: reduce`, SSR-safe. */
|
|
1072
|
+
private prefersReducedMotion;
|
|
1073
|
+
ngOnDestroy(): void;
|
|
1074
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkBackToTop, never>;
|
|
1075
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkBackToTop, "mk-back-to-top", never, { "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "smooth": { "alias": "smooth"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/** Which axes get a custom scrollbar for {@link MkScrollArea}. */
|
|
1079
|
+
type MkScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';
|
|
1080
|
+
type Axis = 'vertical' | 'horizontal';
|
|
1081
|
+
/**
|
|
1082
|
+
* ScrollArea — a scroll container that hides the native scrollbar and renders
|
|
1083
|
+
* its own themed overlay bars (à la Radix ScrollArea). The projected content
|
|
1084
|
+
* scrolls inside a real, keyboard-focusable viewport, so native wheel / arrow
|
|
1085
|
+
* scrolling keeps working; the custom bars are decorative (`aria-hidden`) and
|
|
1086
|
+
* draggable.
|
|
1087
|
+
*
|
|
1088
|
+
* ```html
|
|
1089
|
+
* <mk-scroll-area maxHeight="20rem">
|
|
1090
|
+
* <p>…lots of content…</p>
|
|
1091
|
+
* </mk-scroll-area>
|
|
1092
|
+
* ```
|
|
1093
|
+
*
|
|
1094
|
+
* Set `orientation` to `horizontal` / `both` for a horizontal bar, and
|
|
1095
|
+
* `hideDelay` to auto-hide the bars after inactivity (`0` = always visible).
|
|
1096
|
+
*/
|
|
1097
|
+
declare class MkScrollArea {
|
|
1098
|
+
private readonly isBrowser;
|
|
1099
|
+
private readonly viewportRef;
|
|
1100
|
+
private readonly contentRef;
|
|
1101
|
+
/** Optional CSS max-height for the viewport, e.g. `'20rem'`. */
|
|
1102
|
+
readonly maxHeight: _angular_core.InputSignal<string>;
|
|
1103
|
+
/**
|
|
1104
|
+
* Accessible name for the scrollable viewport. When set, the viewport is
|
|
1105
|
+
* exposed as a labelled `region` landmark — recommended, since the viewport
|
|
1106
|
+
* is keyboard-focusable (`tabindex="0"`) and a focusable scroll container
|
|
1107
|
+
* should have an accessible name. When empty, no role / label is added.
|
|
1108
|
+
*/
|
|
1109
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
1110
|
+
/** Which axes render a custom bar. */
|
|
1111
|
+
readonly orientation: _angular_core.InputSignal<MkScrollAreaOrientation>;
|
|
1112
|
+
/** Auto-hide the bars after this many ms of inactivity (`0` = always on). */
|
|
1113
|
+
readonly hideDelay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
1114
|
+
protected readonly viewportId: string;
|
|
1115
|
+
protected readonly scrollTop: _angular_core.WritableSignal<number>;
|
|
1116
|
+
protected readonly scrollLeft: _angular_core.WritableSignal<number>;
|
|
1117
|
+
protected readonly scrollHeight: _angular_core.WritableSignal<number>;
|
|
1118
|
+
protected readonly scrollWidth: _angular_core.WritableSignal<number>;
|
|
1119
|
+
protected readonly clientHeight: _angular_core.WritableSignal<number>;
|
|
1120
|
+
protected readonly clientWidth: _angular_core.WritableSignal<number>;
|
|
1121
|
+
protected readonly showVertical: _angular_core.Signal<boolean>;
|
|
1122
|
+
protected readonly showHorizontal: _angular_core.Signal<boolean>;
|
|
1123
|
+
/** The viewport actually overflows on the given axis. */
|
|
1124
|
+
protected readonly vScrollable: _angular_core.Signal<boolean>;
|
|
1125
|
+
protected readonly hScrollable: _angular_core.Signal<boolean>;
|
|
1126
|
+
/** Thumb length as a fraction of the track (`clientHeight / scrollHeight`). */
|
|
1127
|
+
protected readonly vThumbSize: _angular_core.Signal<number>;
|
|
1128
|
+
protected readonly hThumbSize: _angular_core.Signal<number>;
|
|
1129
|
+
/** Thumb position as a fraction of the scroll range (0 = start, 1 = end). */
|
|
1130
|
+
protected readonly vThumbOffset: _angular_core.Signal<number>;
|
|
1131
|
+
protected readonly hThumbOffset: _angular_core.Signal<number>;
|
|
1132
|
+
/** CSS `top` / `left` for the thumb, accounting for its own length. */
|
|
1133
|
+
protected readonly vThumbTop: _angular_core.Signal<string>;
|
|
1134
|
+
protected readonly hThumbLeft: _angular_core.Signal<string>;
|
|
1135
|
+
private readonly _visible;
|
|
1136
|
+
/** Whether the bars are currently shown (always true when `hideDelay` is 0). */
|
|
1137
|
+
protected readonly barsVisible: _angular_core.Signal<boolean>;
|
|
1138
|
+
private dragAxis;
|
|
1139
|
+
private dragStartPointer;
|
|
1140
|
+
private dragStartScroll;
|
|
1141
|
+
private hideTimer?;
|
|
1142
|
+
private resizeObserver?;
|
|
1143
|
+
private scrollRaf;
|
|
1144
|
+
constructor();
|
|
1145
|
+
/** Snapshot the viewport's scroll metrics into signals. */
|
|
1146
|
+
private measure;
|
|
1147
|
+
/**
|
|
1148
|
+
* rAF-coalesced (same pattern as `MkScrollspy`): a burst of scroll events
|
|
1149
|
+
* per frame triggers a single batch of layout reads + signal writes, and the
|
|
1150
|
+
* auto-hide idle timer restarts once per flushed frame rather than per raw
|
|
1151
|
+
* event.
|
|
1152
|
+
*/
|
|
1153
|
+
protected onScroll(): void;
|
|
1154
|
+
protected onEnter(): void;
|
|
1155
|
+
protected onLeave(): void;
|
|
1156
|
+
protected onThumbPointerdown(event: PointerEvent, axis: Axis): void;
|
|
1157
|
+
protected onThumbPointermove(event: PointerEvent): void;
|
|
1158
|
+
protected onThumbPointerup(event: PointerEvent): void;
|
|
1159
|
+
protected onTrackPointerdown(event: PointerEvent, axis: Axis): void;
|
|
1160
|
+
private show;
|
|
1161
|
+
private scheduleHide;
|
|
1162
|
+
private clearHideTimer;
|
|
1163
|
+
ngOnDestroy(): void;
|
|
1164
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkScrollArea, never>;
|
|
1165
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkScrollArea, "mk-scroll-area", never, { "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "hideDelay"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
export { MkAccordion, MkAccordionHeader, MkAccordionItem, MkAppShell, MkBackToTop, MkBreadcrumb, MkBreadcrumbItem, MkCommandPalette, MkDrawer, MkFab, MkFabAction, MkMenu, MkMenuItem, MkMenuTrigger, MkNavGroup, MkNavItem, MkNavList, MkPageHeader, MkPagination, MkScrollArea, MkSplitter, MkStep, MkStepper, MkTab, MkTabs, MkToolbar, MkTree };
|
|
1169
|
+
export type { MkCommand, MkDrawerSide, MkFabPosition, MkPageItem, MkScrollAreaOrientation, MkSplitterOrientation, MkStepperOrientation, MkTabsVariant, MkTreeNode };
|