@ckui/core 0.1.0-next.1 → 0.1.0-next.3
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 +337 -4
- package/fesm2022/ckui-core-badge.mjs +169 -0
- package/fesm2022/ckui-core-badge.mjs.map +1 -0
- package/fesm2022/ckui-core-chip.mjs +300 -0
- package/fesm2022/ckui-core-chip.mjs.map +1 -0
- package/fesm2022/ckui-core-dialog.mjs +18 -286
- package/fesm2022/ckui-core-dialog.mjs.map +1 -1
- package/fesm2022/ckui-core-drawer.mjs +342 -0
- package/fesm2022/ckui-core-drawer.mjs.map +1 -0
- package/fesm2022/ckui-core-internal-dialog.mjs +296 -0
- package/fesm2022/ckui-core-internal-dialog.mjs.map +1 -0
- package/fesm2022/ckui-core-internal-overlay.mjs +479 -0
- package/fesm2022/ckui-core-internal-overlay.mjs.map +1 -0
- package/fesm2022/ckui-core-internal.mjs +2 -463
- package/fesm2022/ckui-core-internal.mjs.map +1 -1
- package/fesm2022/ckui-core-progress.mjs +165 -0
- package/fesm2022/ckui-core-progress.mjs.map +1 -0
- package/fesm2022/ckui-core-segmented.mjs +184 -8
- package/fesm2022/ckui-core-segmented.mjs.map +1 -1
- package/fesm2022/ckui-core-stepper.mjs +842 -0
- package/fesm2022/ckui-core-stepper.mjs.map +1 -0
- package/fesm2022/ckui-core-switch.mjs +327 -0
- package/fesm2022/ckui-core-switch.mjs.map +1 -0
- package/fesm2022/ckui-core-tabs.mjs +678 -0
- package/fesm2022/ckui-core-tabs.mjs.map +1 -0
- package/fesm2022/ckui-core.mjs +2 -0
- package/fesm2022/ckui-core.mjs.map +1 -1
- package/package.json +37 -1
- package/types/ckui-core-badge.d.ts +44 -0
- package/types/ckui-core-chip.d.ts +62 -0
- package/types/ckui-core-dialog.d.ts +5 -40
- package/types/ckui-core-drawer.d.ts +153 -0
- package/types/ckui-core-internal-dialog.d.ts +102 -0
- package/types/ckui-core-internal-overlay.d.ts +83 -0
- package/types/ckui-core-internal.d.ts +2 -75
- package/types/ckui-core-progress.d.ts +43 -0
- package/types/ckui-core-segmented.d.ts +26 -0
- package/types/ckui-core-stepper.d.ts +186 -0
- package/types/ckui-core-switch.d.ts +90 -0
- package/types/ckui-core-tabs.d.ts +212 -0
- package/types/ckui-core.d.ts +2 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Signal, TemplateRef } from "@angular/core";
|
|
3
|
+
import { CkSize } from "@ckui/core";
|
|
4
|
+
type CkTabsActivation = 'auto' | 'manual';
|
|
5
|
+
/** The part of a `ck-tab` its tabs group reads, so the files need not import each other's classes. */
|
|
6
|
+
interface CkTabRef {
|
|
7
|
+
readonly element: HTMLElement;
|
|
8
|
+
readonly id: Signal<string>;
|
|
9
|
+
/** The tab's value, or an unmatchable symbol while its `value` input is not set yet. */
|
|
10
|
+
readonly current: Signal<unknown>;
|
|
11
|
+
readonly disabled: Signal<boolean>;
|
|
12
|
+
readonly group: CkTabsContext;
|
|
13
|
+
}
|
|
14
|
+
/** The part of a `ck-tab-panel` its tabs group reads. */
|
|
15
|
+
interface CkTabPanelRef {
|
|
16
|
+
readonly id: Signal<string>;
|
|
17
|
+
/** The value of the tab the panel belongs to; `null` or `undefined` for the shared panel. */
|
|
18
|
+
readonly value: Signal<unknown>;
|
|
19
|
+
readonly group: CkTabsContext;
|
|
20
|
+
}
|
|
21
|
+
/** What the parts of a tabs group need from it. */
|
|
22
|
+
interface CkTabsContext {
|
|
23
|
+
readonly activation: Signal<CkTabsActivation>;
|
|
24
|
+
/** Only the tabs of this group, not those of a group nested in one of its panels. */
|
|
25
|
+
readonly tabs: Signal<readonly CkTabRef[]>;
|
|
26
|
+
/** The tab that is shown: the one the value names, else the first enabled tab. */
|
|
27
|
+
readonly selectedTab: Signal<CkTabRef | null>;
|
|
28
|
+
select(tab: CkTabRef): void;
|
|
29
|
+
panelIdFor(tab: CkTabRef): string | null;
|
|
30
|
+
tabIdFor(panel: CkTabPanelRef): string | null;
|
|
31
|
+
isShown(panel: CkTabPanelRef): boolean;
|
|
32
|
+
hasTab(value: unknown): boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* One tab of a `ck-tab-list`. Its content is the label. `value` names it in the group's value and
|
|
36
|
+
* ties it to its panel. A disabled tab stays visible, cannot be selected and is skipped by the
|
|
37
|
+
* arrow keys.
|
|
38
|
+
*/
|
|
39
|
+
export declare class CkTab<T = unknown> implements CkTabRef {
|
|
40
|
+
readonly value: import("@angular/core").InputSignal<T>;
|
|
41
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
42
|
+
/** Defaults to a generated id; the panel's `aria-labelledby` follows a change. */
|
|
43
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
|
44
|
+
/** @internal Used by `ck-tabs` and `ck-tab-list`. */
|
|
45
|
+
readonly element: HTMLElement;
|
|
46
|
+
/** @internal */
|
|
47
|
+
readonly group: CkTabsContext;
|
|
48
|
+
/**
|
|
49
|
+
* @internal A tab the template has just created has no value yet, though its group already
|
|
50
|
+
* reads it.
|
|
51
|
+
*/
|
|
52
|
+
readonly current: import("@angular/core").Signal<unknown>;
|
|
53
|
+
protected readonly selected: import("@angular/core").Signal<boolean>;
|
|
54
|
+
protected readonly controls: import("@angular/core").Signal<string | null>;
|
|
55
|
+
/** Never the roving 0 for a disabled tab; -1 keeps focus on a tab that becomes disabled under it. */
|
|
56
|
+
protected readonly tabIndex: import("@angular/core").Signal<0 | -1>;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CkTab<any>, never>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CkTab<any>, "ck-tab", never, {
|
|
59
|
+
"value": {
|
|
60
|
+
"alias": "value";
|
|
61
|
+
"required": true;
|
|
62
|
+
"isSignal": true;
|
|
63
|
+
};
|
|
64
|
+
"disabled": {
|
|
65
|
+
"alias": "disabled";
|
|
66
|
+
"required": false;
|
|
67
|
+
"isSignal": true;
|
|
68
|
+
};
|
|
69
|
+
"id": {
|
|
70
|
+
"alias": "id";
|
|
71
|
+
"required": false;
|
|
72
|
+
"isSignal": true;
|
|
73
|
+
};
|
|
74
|
+
}, {}, never, ["*"], true, never>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Marks the `<ng-template>` of a `ck-tab-panel` whose content is created only while the panel is
|
|
78
|
+
* shown and destroyed again when it is hidden.
|
|
79
|
+
*/
|
|
80
|
+
export declare class CkTabContent {
|
|
81
|
+
/** @internal Used by `ck-tab-panel`. */
|
|
82
|
+
readonly template: TemplateRef<unknown>;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CkTabContent, never>;
|
|
84
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CkTabContent, "ng-template[ckTabContent]", never, {}, {}, never, never, true, never>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The row of tabs: `role="tablist"`, one tab stop, Left and Right move between tabs (swapped in
|
|
88
|
+
* right-to-left text), Home and End jump. When the tabs do not fit, the row scrolls sideways and
|
|
89
|
+
* keeps the selected and the focused tab in view. It needs a name: `aria-label` or
|
|
90
|
+
* `aria-labelledby`.
|
|
91
|
+
*/
|
|
92
|
+
export declare class CkTabList {
|
|
93
|
+
private readonly group;
|
|
94
|
+
private readonly element;
|
|
95
|
+
private readonly browser;
|
|
96
|
+
private destroyed;
|
|
97
|
+
private observer;
|
|
98
|
+
private focusedTab;
|
|
99
|
+
constructor();
|
|
100
|
+
/** Watches the row and every tab: a resize, a longer label or a late font moves the selected tab. */
|
|
101
|
+
private watch;
|
|
102
|
+
/** A focused tab that was removed leaves focus on the body: move it to the selected tab. */
|
|
103
|
+
private rescueFocus;
|
|
104
|
+
private revealSelected;
|
|
105
|
+
/** The focused tab when focus is in the row (manual activation may have moved it), else the selected one. */
|
|
106
|
+
private revealCurrent;
|
|
107
|
+
/** Scrolls the row, never the page, so the tab is fully visible. Sizes are divided by any scale. */
|
|
108
|
+
private reveal;
|
|
109
|
+
protected onFocusIn(event: FocusEvent): void;
|
|
110
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
111
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
112
|
+
/** The tab a navigation key leads to, or `null` for a key that does not navigate. */
|
|
113
|
+
private targetOf;
|
|
114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CkTabList, never>;
|
|
115
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CkTabList, "ck-tab-list", never, {}, {}, never, ["*"], true, never>;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The content of a tab. With a `value` it belongs to the tab of that value and is hidden unless
|
|
119
|
+
* that tab is selected. Without one it is the shared panel: it shows the content of whichever tab
|
|
120
|
+
* is selected, and every tab points at it. Put an `<ng-template ckTabContent>` inside to create
|
|
121
|
+
* the content only while the panel is shown.
|
|
122
|
+
*/
|
|
123
|
+
export declare class CkTabPanel<T = unknown> implements CkTabPanelRef {
|
|
124
|
+
/** The value of the tab this panel belongs to. Leave it out for one panel shared by all tabs. */
|
|
125
|
+
readonly value: import("@angular/core").InputSignal<T | null | undefined>;
|
|
126
|
+
/** Defaults to a generated id; the tabs' `aria-controls` follow a change. */
|
|
127
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
|
128
|
+
/** @internal */
|
|
129
|
+
readonly group: CkTabsContext;
|
|
130
|
+
private readonly content;
|
|
131
|
+
protected readonly shown: import("@angular/core").Signal<boolean>;
|
|
132
|
+
protected readonly labelledBy: import("@angular/core").Signal<string | null>;
|
|
133
|
+
protected readonly lazy: import("@angular/core").Signal<import("@angular/core").TemplateRef<unknown> | null>;
|
|
134
|
+
constructor();
|
|
135
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CkTabPanel<any>, never>;
|
|
136
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CkTabPanel<any>, "ck-tab-panel", never, {
|
|
137
|
+
"value": {
|
|
138
|
+
"alias": "value";
|
|
139
|
+
"required": false;
|
|
140
|
+
"isSignal": true;
|
|
141
|
+
};
|
|
142
|
+
"id": {
|
|
143
|
+
"alias": "id";
|
|
144
|
+
"required": false;
|
|
145
|
+
"isSignal": true;
|
|
146
|
+
};
|
|
147
|
+
}, {}, ["content"], ["*"], true, never>;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Tabs that switch between panels: a `ck-tab-list` of `ck-tab`s and one or more `ck-tab-panel`s.
|
|
151
|
+
* It is not a form control. `value` is the `value` of the selected tab, two-way.
|
|
152
|
+
*
|
|
153
|
+
* A `value` of `null`, or one no enabled tab has, shows the first enabled tab. That is only
|
|
154
|
+
* reflected: the model is written when the user picks a tab, never for the implicit default.
|
|
155
|
+
*/
|
|
156
|
+
export declare class CkTabs<T = unknown> implements CkTabsContext {
|
|
157
|
+
/** The value of the selected tab. `null` shows the first enabled tab without writing it back. */
|
|
158
|
+
readonly value: import("@angular/core").ModelSignal<T | null>;
|
|
159
|
+
/** `auto` selects a tab when the arrow keys focus it; `manual` waits for Enter or Space. */
|
|
160
|
+
readonly activation: import("@angular/core").InputSignal<CkTabsActivation>;
|
|
161
|
+
/** `undefined` uses the size from `provideCkui`. */
|
|
162
|
+
readonly size: import("@angular/core").InputSignal<CkSize | undefined>;
|
|
163
|
+
/** Stretches the tabs to share the width of the row equally. */
|
|
164
|
+
readonly fullWidth: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
165
|
+
private readonly config;
|
|
166
|
+
private readonly allTabs;
|
|
167
|
+
private readonly allPanels;
|
|
168
|
+
protected readonly modifierClasses: Signal<string>;
|
|
169
|
+
/** @internal Only this group's own tabs, not those of a group nested in a panel. */
|
|
170
|
+
readonly tabs: Signal<readonly CkTabRef[]>;
|
|
171
|
+
private readonly panels;
|
|
172
|
+
/** @internal */
|
|
173
|
+
readonly selectedTab: Signal<CkTabRef | null>;
|
|
174
|
+
/** @internal */
|
|
175
|
+
select(tab: CkTabRef): void;
|
|
176
|
+
/** @internal */
|
|
177
|
+
panelIdFor(tab: CkTabRef): string | null;
|
|
178
|
+
/** @internal */
|
|
179
|
+
tabIdFor(panel: CkTabPanelRef): string | null;
|
|
180
|
+
/** @internal */
|
|
181
|
+
isShown(panel: CkTabPanelRef): boolean;
|
|
182
|
+
/** @internal */
|
|
183
|
+
hasTab(value: unknown): boolean;
|
|
184
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CkTabs<any>, never>;
|
|
185
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CkTabs<any>, "ck-tabs", never, {
|
|
186
|
+
"value": {
|
|
187
|
+
"alias": "value";
|
|
188
|
+
"required": false;
|
|
189
|
+
"isSignal": true;
|
|
190
|
+
};
|
|
191
|
+
"activation": {
|
|
192
|
+
"alias": "activation";
|
|
193
|
+
"required": false;
|
|
194
|
+
"isSignal": true;
|
|
195
|
+
};
|
|
196
|
+
"size": {
|
|
197
|
+
"alias": "size";
|
|
198
|
+
"required": false;
|
|
199
|
+
"isSignal": true;
|
|
200
|
+
};
|
|
201
|
+
"fullWidth": {
|
|
202
|
+
"alias": "fullWidth";
|
|
203
|
+
"required": false;
|
|
204
|
+
"isSignal": true;
|
|
205
|
+
};
|
|
206
|
+
}, {
|
|
207
|
+
"value": "valueChange";
|
|
208
|
+
}, ["allTabs", "allPanels"], ["*"], true, never>;
|
|
209
|
+
}
|
|
210
|
+
/** Everything a template needs for tabs: `imports: [CK_TABS_IMPORTS]`. */
|
|
211
|
+
export declare const CK_TABS_IMPORTS: readonly [typeof CkTabs, typeof CkTabList, typeof CkTab, typeof CkTabPanel, typeof CkTabContent];
|
|
212
|
+
export type { CkTabsActivation };
|
package/types/ckui-core.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ export declare const CK_SIZES: readonly CkSize[];
|
|
|
4
4
|
/** Built-in strings. Each package adds its keys; consumers pass a `Partial`. */
|
|
5
5
|
interface CkLabels {
|
|
6
6
|
close: string;
|
|
7
|
+
decrement: string;
|
|
7
8
|
dismiss: string;
|
|
9
|
+
increment: string;
|
|
8
10
|
loading: string;
|
|
9
11
|
noResults: string;
|
|
10
12
|
notifications: string;
|