@ckui/core 0.1.0-next.1 → 0.1.0-next.2
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 +122 -4
- package/fesm2022/ckui-core-badge.mjs +169 -0
- package/fesm2022/ckui-core-badge.mjs.map +1 -0
- package/fesm2022/ckui-core-dialog.mjs +2 -1
- package/fesm2022/ckui-core-dialog.mjs.map +1 -1
- package/fesm2022/ckui-core-internal-overlay.mjs +468 -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.mjs +2 -0
- package/fesm2022/ckui-core.mjs.map +1 -1
- package/package.json +17 -1
- package/types/ckui-core-badge.d.ts +44 -0
- package/types/ckui-core-internal-overlay.d.ts +76 -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.d.ts +2 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { CkSize } from "@ckui/core";
|
|
2
|
+
import { CkValueControl } from "@ckui/core/internal";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
type Direction = 1 | -1;
|
|
5
|
+
/**
|
|
6
|
+
* A number field with a minus and a plus button. The value is a real text input with the
|
|
7
|
+
* `spinbutton` role: type a number (committed on Enter or blur, snapped to `step` and clamped to
|
|
8
|
+
* `min` / `max`), use the arrow keys, or press the buttons, which repeat while held. An empty
|
|
9
|
+
* field is `null`. The buttons are outside the tab order; the input is the one tab stop.
|
|
10
|
+
*
|
|
11
|
+
* Name it with `aria-label` or `aria-labelledby` on `ck-stepper`, or wrap it in a `<label>`. The
|
|
12
|
+
* attributes are inputs here and move to the input element.
|
|
13
|
+
*
|
|
14
|
+
* The input comes first in the DOM, so a wrapping `<label>` names it rather than a button; the
|
|
15
|
+
* minus button is moved in front of it with CSS `order`.
|
|
16
|
+
*/
|
|
17
|
+
export declare class CkStepper extends CkValueControl<number | null> {
|
|
18
|
+
/** Smallest value. Without it the value has no lower limit. When above `max`, `min` wins. */
|
|
19
|
+
readonly min: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
20
|
+
/** Largest value. Without it the value has no upper limit. */
|
|
21
|
+
readonly max: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
22
|
+
/** Distance between values, counted from `min` (else 0). Not a number above 0 counts as 1. */
|
|
23
|
+
readonly step: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
24
|
+
/** What Page Up and Page Down move by. Default: 10 steps. */
|
|
25
|
+
readonly largeStep: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
26
|
+
/** Text after the value, part of the value text for assistive technology: `W` reads "250 W". */
|
|
27
|
+
readonly unit: import("@angular/core").InputSignal<string>;
|
|
28
|
+
/** `undefined` uses the size from `provideCkui`. */
|
|
29
|
+
readonly size: import("@angular/core").InputSignal<CkSize | undefined>;
|
|
30
|
+
/** The value can be read and focused, but not typed or stepped. */
|
|
31
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
32
|
+
/** Replaces the label of the minus button ("FTP minus 5"). */
|
|
33
|
+
readonly decrementLabel: import("@angular/core").InputSignal<string>;
|
|
34
|
+
/** Replaces the label of the plus button ("FTP plus 5"). */
|
|
35
|
+
readonly incrementLabel: import("@angular/core").InputSignal<string>;
|
|
36
|
+
/** The accessible name of the input. Moves from the host to the input element. */
|
|
37
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
38
|
+
/** The ids of the elements that name the input. Moves from the host to the input element. */
|
|
39
|
+
readonly ariaLabelledby: import("@angular/core").InputSignal<string | null>;
|
|
40
|
+
/** The ids of a hint or error for the input. Moves from the host to the input element. */
|
|
41
|
+
readonly ariaDescribedby: import("@angular/core").InputSignal<string | null>;
|
|
42
|
+
private readonly config;
|
|
43
|
+
private readonly labels;
|
|
44
|
+
private readonly locale;
|
|
45
|
+
private readonly media;
|
|
46
|
+
private readonly document;
|
|
47
|
+
private readonly browser;
|
|
48
|
+
private readonly element;
|
|
49
|
+
private readonly inputRef;
|
|
50
|
+
/** Typed text that is not committed yet. */
|
|
51
|
+
protected editing: boolean;
|
|
52
|
+
/** The text last written into the input, so the render after a commit does not redo it. */
|
|
53
|
+
private shown;
|
|
54
|
+
private holding;
|
|
55
|
+
/** Set by an accepted pointerdown on a button; the click that follows it must not step again. */
|
|
56
|
+
private pressed;
|
|
57
|
+
private stopWatchingRelease;
|
|
58
|
+
private repeatTimer;
|
|
59
|
+
private repeatElapsed;
|
|
60
|
+
private repeatDirection;
|
|
61
|
+
protected readonly modifierClasses: import("@angular/core").Signal<string>;
|
|
62
|
+
/** The decimal keypad has no minus sign, so a range that allows negatives gets the text one. */
|
|
63
|
+
protected readonly inputMode: import("@angular/core").Signal<"decimal" | "text">;
|
|
64
|
+
protected readonly stepSize: import("@angular/core").Signal<number>;
|
|
65
|
+
/** The limits, with `max` raised to `min` when they cross. */
|
|
66
|
+
protected readonly bounds: import("@angular/core").Signal<{
|
|
67
|
+
min: number | null;
|
|
68
|
+
max: number | null;
|
|
69
|
+
}>;
|
|
70
|
+
private readonly digits;
|
|
71
|
+
private readonly grid;
|
|
72
|
+
private readonly largeDelta;
|
|
73
|
+
private readonly separators;
|
|
74
|
+
/** The committed value, `null` for none (or anything that is not a finite number). */
|
|
75
|
+
protected readonly current: import("@angular/core").Signal<number | null>;
|
|
76
|
+
private format;
|
|
77
|
+
protected readonly displayValue: import("@angular/core").Signal<string>;
|
|
78
|
+
protected readonly valueText: import("@angular/core").Signal<string | null>;
|
|
79
|
+
/** Width of the value in characters, from the formatted limits (else the value), at least 3. */
|
|
80
|
+
protected readonly chars: import("@angular/core").Signal<number>;
|
|
81
|
+
protected readonly decrementText: import("@angular/core").Signal<string>;
|
|
82
|
+
protected readonly incrementText: import("@angular/core").Signal<string>;
|
|
83
|
+
private readonly locked;
|
|
84
|
+
protected readonly decrementBlocked: import("@angular/core").Signal<boolean>;
|
|
85
|
+
protected readonly incrementBlocked: import("@angular/core").Signal<boolean>;
|
|
86
|
+
constructor();
|
|
87
|
+
private watchConfiguration;
|
|
88
|
+
/** Writes text into the input and drops any uncommitted typing. */
|
|
89
|
+
private show;
|
|
90
|
+
/** The value arrows and buttons start from: the typed text when valid, else the value. */
|
|
91
|
+
private base;
|
|
92
|
+
/** Moves by `count` steps from the base. Returns whether the committed value changed. */
|
|
93
|
+
private stepBy;
|
|
94
|
+
/** Commits a value from the user and shows what the control then holds. */
|
|
95
|
+
private settle;
|
|
96
|
+
private commitText;
|
|
97
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
98
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
99
|
+
/** A click on the field around the value (the unit, the padding) focuses the input. */
|
|
100
|
+
protected focusInput(event: Event): void;
|
|
101
|
+
/** The press starts on pointerdown, so the first step happens at once and a hold can repeat. */
|
|
102
|
+
protected onPress(event: PointerEvent, direction: Direction): void;
|
|
103
|
+
/** A pointer that has moved off the button no longer holds it. */
|
|
104
|
+
protected onPressMove(event: PointerEvent): void;
|
|
105
|
+
/** The browser took the pointer away: no click follows. */
|
|
106
|
+
protected onPressCancel(): void;
|
|
107
|
+
/**
|
|
108
|
+
* The click after a pointer press was handled on pointerdown and is skipped. A click without a
|
|
109
|
+
* pointerdown (keyboard, a screen reader's activation, `button.click()`) steps once here.
|
|
110
|
+
*/
|
|
111
|
+
protected onButtonClick(direction: Direction): void;
|
|
112
|
+
private scheduleRepeat;
|
|
113
|
+
/**
|
|
114
|
+
* On a coarse pointer the input is not focused during a press, so the window losing focus and
|
|
115
|
+
* the document turning hidden are the only signals that the finger will not be released here.
|
|
116
|
+
*/
|
|
117
|
+
private watchRelease;
|
|
118
|
+
private unwatchRelease;
|
|
119
|
+
private clearRepeat;
|
|
120
|
+
/** Release, cancel, lost capture, leave, blur, hidden, a bound or a lock: stops, counts as touched. */
|
|
121
|
+
protected endPress(): void;
|
|
122
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CkStepper, never>;
|
|
123
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CkStepper, "ck-stepper", never, {
|
|
124
|
+
"min": {
|
|
125
|
+
"alias": "min";
|
|
126
|
+
"required": false;
|
|
127
|
+
"isSignal": true;
|
|
128
|
+
};
|
|
129
|
+
"max": {
|
|
130
|
+
"alias": "max";
|
|
131
|
+
"required": false;
|
|
132
|
+
"isSignal": true;
|
|
133
|
+
};
|
|
134
|
+
"step": {
|
|
135
|
+
"alias": "step";
|
|
136
|
+
"required": false;
|
|
137
|
+
"isSignal": true;
|
|
138
|
+
};
|
|
139
|
+
"largeStep": {
|
|
140
|
+
"alias": "largeStep";
|
|
141
|
+
"required": false;
|
|
142
|
+
"isSignal": true;
|
|
143
|
+
};
|
|
144
|
+
"unit": {
|
|
145
|
+
"alias": "unit";
|
|
146
|
+
"required": false;
|
|
147
|
+
"isSignal": true;
|
|
148
|
+
};
|
|
149
|
+
"size": {
|
|
150
|
+
"alias": "size";
|
|
151
|
+
"required": false;
|
|
152
|
+
"isSignal": true;
|
|
153
|
+
};
|
|
154
|
+
"readonly": {
|
|
155
|
+
"alias": "readonly";
|
|
156
|
+
"required": false;
|
|
157
|
+
"isSignal": true;
|
|
158
|
+
};
|
|
159
|
+
"decrementLabel": {
|
|
160
|
+
"alias": "decrementLabel";
|
|
161
|
+
"required": false;
|
|
162
|
+
"isSignal": true;
|
|
163
|
+
};
|
|
164
|
+
"incrementLabel": {
|
|
165
|
+
"alias": "incrementLabel";
|
|
166
|
+
"required": false;
|
|
167
|
+
"isSignal": true;
|
|
168
|
+
};
|
|
169
|
+
"ariaLabel": {
|
|
170
|
+
"alias": "aria-label";
|
|
171
|
+
"required": false;
|
|
172
|
+
"isSignal": true;
|
|
173
|
+
};
|
|
174
|
+
"ariaLabelledby": {
|
|
175
|
+
"alias": "aria-labelledby";
|
|
176
|
+
"required": false;
|
|
177
|
+
"isSignal": true;
|
|
178
|
+
};
|
|
179
|
+
"ariaDescribedby": {
|
|
180
|
+
"alias": "aria-describedby";
|
|
181
|
+
"required": false;
|
|
182
|
+
"isSignal": true;
|
|
183
|
+
};
|
|
184
|
+
}, {}, never, never, true, never>;
|
|
185
|
+
}
|
|
186
|
+
export {};
|
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;
|