@coolon/angular-ui-powerups 16.1.0-alpha.281 → 16.1.0-alpha.282
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/assets/form.scss +4 -3
- package/esm2022/lib/components/forms/number-input/number-input.component.mjs +117 -4
- package/fesm2022/coolon-angular-ui-powerups.mjs +115 -2
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/forms/number-input/number-input.component.d.ts +59 -1
- package/package.json +1 -1
|
@@ -9,6 +9,23 @@ export declare class NumberInputComponent extends AbstractValueInputComponent<nu
|
|
|
9
9
|
accessor max: number;
|
|
10
10
|
accessor significantDigits$: ValueModel<number>;
|
|
11
11
|
accessor significantDigits: number;
|
|
12
|
+
/**
|
|
13
|
+
* Selects the layout, not a breakpoint — a touch-density form uses the touch layout throughout,
|
|
14
|
+
* so the two never mix in one column. 'touch' unstacks the steppers to full-height buttons either
|
|
15
|
+
* side of the field, because stacking them in a 56px row would halve each one.
|
|
16
|
+
*
|
|
17
|
+
* Orthogonal to {@link dense}, which goes the other way (a 37px row for tables and sub-forms).
|
|
18
|
+
* Setting both is contradictory; touch wins, since its rules come later.
|
|
19
|
+
*/
|
|
20
|
+
density: 'desktop' | 'touch';
|
|
21
|
+
get touchDensity(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The steppers live outside the field's outline now, so nothing about them is styled by Material.
|
|
24
|
+
* These two say when the block as a whole takes the disabled or error treatment; a single
|
|
25
|
+
* stepper greying out at min/max is the command directive's disabled attribute, not these.
|
|
26
|
+
*/
|
|
27
|
+
get steppersDisabled(): boolean;
|
|
28
|
+
get steppersInError(): boolean;
|
|
12
29
|
protected readonly incrementCommand: Command<void>;
|
|
13
30
|
protected readonly decrementCommand: Command<void>;
|
|
14
31
|
protected readonly displayValue$: ValueModel<number>;
|
|
@@ -17,7 +34,48 @@ export declare class NumberInputComponent extends AbstractValueInputComponent<nu
|
|
|
17
34
|
private increment;
|
|
18
35
|
private decrement;
|
|
19
36
|
private clampSignificantDigits;
|
|
37
|
+
/**
|
|
38
|
+
* Shift, PageUp and PageDown all step by ten times {@link step}.
|
|
39
|
+
*
|
|
40
|
+
* Plain arrow stepping is NOT here: `input[type=number]` already does it natively, honouring the
|
|
41
|
+
* bound min/max/step, and the change arrives through ngModelChange like any other edit. Only the
|
|
42
|
+
* coarse step is ours, because nothing native multiplies by anything.
|
|
43
|
+
*/
|
|
44
|
+
private static readonly COARSE_STEP_FACTOR;
|
|
45
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
46
|
+
/**
|
|
47
|
+
* A focused `input[type=number]` treats the wheel as a stepper, so scrolling the page with the
|
|
48
|
+
* pointer resting on a field you just typed into silently edits it — and this component commits
|
|
49
|
+
* on every change, so that edit IS the commit. There is no confirmation step behind it to catch.
|
|
50
|
+
*
|
|
51
|
+
* Only while focused: an unfocused number input doesn't step, so there is nothing to guard and
|
|
52
|
+
* the page should scroll as normal. The consequence worth knowing is that while the field IS
|
|
53
|
+
* focused the wheel now does nothing over it at all — the page won't scroll either until the
|
|
54
|
+
* pointer moves off. Blurring instead would let the scroll through, but silent focus loss fires
|
|
55
|
+
* every consumer's blur handler, which is a much wider blast radius than a dead wheel.
|
|
56
|
+
*
|
|
57
|
+
* Deliberate adjustment keeps three better paths: the arrows, Shift/PageUp/PageDown for ten, and
|
|
58
|
+
* the steppers.
|
|
59
|
+
*/
|
|
60
|
+
protected onWheel(event: WheelEvent): void;
|
|
61
|
+
private static coarseStepDirection;
|
|
62
|
+
/**
|
|
63
|
+
* A single step stops at the bounds because the command is disabled there, but a coarse step can
|
|
64
|
+
* jump clean over them — 5 with Shift+Up against a max of 10 has to land on 10, not 15.
|
|
65
|
+
*/
|
|
66
|
+
private clampToBounds;
|
|
67
|
+
/**
|
|
68
|
+
* A pointer press on a stepper must leave the field holding focus — the button takes focus on
|
|
69
|
+
* mousedown, then loses it again, so the press ended up landing focus on <body> and taking the
|
|
70
|
+
* field's focus ring with it. Refusing the focus at mousedown stops that, and requesting it for
|
|
71
|
+
* the field matches what a native number input's own spinners do.
|
|
72
|
+
*
|
|
73
|
+
* Bound on mousedown rather than in the commands so it stays POINTER-only: the buttons are still
|
|
74
|
+
* tab stops, and a keyboard activation has to leave focus on the button it came from, or a second
|
|
75
|
+
* press would have nowhere to land.
|
|
76
|
+
*/
|
|
77
|
+
protected onStepperPress(event: MouseEvent): void;
|
|
20
78
|
onValueChange(value: number): void;
|
|
21
79
|
static ɵfac: i0.ɵɵFactoryDeclaration<NumberInputComponent, never>;
|
|
22
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent, "aup-number-input", never, { "autocomplete": { "alias": "autocomplete"; "required": false; }; "min$": { "alias": "min$"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max$": { "alias": "max$"; "required": false; }; "max": { "alias": "max"; "required": false; }; "significantDigits$": { "alias": "significantDigits$"; "required": false; }; "significantDigits": { "alias": "significantDigits"; "required": false; }; }, {}, never, never, false, never>;
|
|
80
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NumberInputComponent, "aup-number-input", never, { "autocomplete": { "alias": "autocomplete"; "required": false; }; "min$": { "alias": "min$"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max$": { "alias": "max$"; "required": false; }; "max": { "alias": "max"; "required": false; }; "significantDigits$": { "alias": "significantDigits$"; "required": false; }; "significantDigits": { "alias": "significantDigits"; "required": false; }; "density": { "alias": "density"; "required": false; }; }, {}, never, never, false, never>;
|
|
23
81
|
}
|