@star-ng/ui 0.0.0-stage → 0.1.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 +148 -2
- package/fesm2022/star-ng-ui-accordion.mjs +376 -0
- package/fesm2022/star-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/star-ng-ui-autocomplete.mjs +782 -0
- package/fesm2022/star-ng-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/star-ng-ui-avatar.mjs +154 -0
- package/fesm2022/star-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/star-ng-ui-badge.mjs +153 -0
- package/fesm2022/star-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/star-ng-ui-breadcrumb.mjs +199 -0
- package/fesm2022/star-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/star-ng-ui-button.mjs +282 -0
- package/fesm2022/star-ng-ui-button.mjs.map +1 -0
- package/fesm2022/star-ng-ui-card.mjs +112 -0
- package/fesm2022/star-ng-ui-card.mjs.map +1 -0
- package/fesm2022/star-ng-ui-chart.mjs +1904 -0
- package/fesm2022/star-ng-ui-chart.mjs.map +1 -0
- package/fesm2022/star-ng-ui-checkbox.mjs +345 -0
- package/fesm2022/star-ng-ui-checkbox.mjs.map +1 -0
- package/fesm2022/star-ng-ui-core.mjs +392 -0
- package/fesm2022/star-ng-ui-core.mjs.map +1 -0
- package/fesm2022/star-ng-ui-data-display.mjs +1556 -0
- package/fesm2022/star-ng-ui-data-display.mjs.map +1 -0
- package/fesm2022/star-ng-ui-date-picker.mjs +2786 -0
- package/fesm2022/star-ng-ui-date-picker.mjs.map +1 -0
- package/fesm2022/star-ng-ui-dialog.mjs +948 -0
- package/fesm2022/star-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/star-ng-ui-drawer.mjs +158 -0
- package/fesm2022/star-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/star-ng-ui-editor.mjs +416 -0
- package/fesm2022/star-ng-ui-editor.mjs.map +1 -0
- package/fesm2022/star-ng-ui-field.mjs +378 -0
- package/fesm2022/star-ng-ui-field.mjs.map +1 -0
- package/fesm2022/star-ng-ui-file-upload.mjs +762 -0
- package/fesm2022/star-ng-ui-file-upload.mjs.map +1 -0
- package/fesm2022/star-ng-ui-i18n-de.mjs +179 -0
- package/fesm2022/star-ng-ui-i18n-de.mjs.map +1 -0
- package/fesm2022/star-ng-ui-i18n-es.mjs +179 -0
- package/fesm2022/star-ng-ui-i18n-es.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-group.mjs +188 -0
- package/fesm2022/star-ng-ui-input-group.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-mask.mjs +434 -0
- package/fesm2022/star-ng-ui-input-mask.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-number.mjs +691 -0
- package/fesm2022/star-ng-ui-input-number.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-otp.mjs +343 -0
- package/fesm2022/star-ng-ui-input-otp.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-tags.mjs +616 -0
- package/fesm2022/star-ng-ui-input-tags.mjs.map +1 -0
- package/fesm2022/star-ng-ui-knob.mjs +514 -0
- package/fesm2022/star-ng-ui-knob.mjs.map +1 -0
- package/fesm2022/star-ng-ui-layout.mjs +608 -0
- package/fesm2022/star-ng-ui-layout.mjs.map +1 -0
- package/fesm2022/star-ng-ui-listbox.mjs +978 -0
- package/fesm2022/star-ng-ui-listbox.mjs.map +1 -0
- package/fesm2022/star-ng-ui-media.mjs +833 -0
- package/fesm2022/star-ng-ui-media.mjs.map +1 -0
- package/fesm2022/star-ng-ui-menu.mjs +1840 -0
- package/fesm2022/star-ng-ui-menu.mjs.map +1 -0
- package/fesm2022/star-ng-ui-message.mjs +191 -0
- package/fesm2022/star-ng-ui-message.mjs.map +1 -0
- package/fesm2022/star-ng-ui-paginator.mjs +387 -0
- package/fesm2022/star-ng-ui-paginator.mjs.map +1 -0
- package/fesm2022/star-ng-ui-panel.mjs +324 -0
- package/fesm2022/star-ng-ui-panel.mjs.map +1 -0
- package/fesm2022/star-ng-ui-password.mjs +517 -0
- package/fesm2022/star-ng-ui-password.mjs.map +1 -0
- package/fesm2022/star-ng-ui-popover.mjs +241 -0
- package/fesm2022/star-ng-ui-popover.mjs.map +1 -0
- package/fesm2022/star-ng-ui-progress-bar.mjs +183 -0
- package/fesm2022/star-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/star-ng-ui-radio.mjs +411 -0
- package/fesm2022/star-ng-ui-radio.mjs.map +1 -0
- package/fesm2022/star-ng-ui-rating.mjs +211 -0
- package/fesm2022/star-ng-ui-rating.mjs.map +1 -0
- package/fesm2022/star-ng-ui-select-button.mjs +613 -0
- package/fesm2022/star-ng-ui-select-button.mjs.map +1 -0
- package/fesm2022/star-ng-ui-select.mjs +2523 -0
- package/fesm2022/star-ng-ui-select.mjs.map +1 -0
- package/fesm2022/star-ng-ui-skeleton.mjs +160 -0
- package/fesm2022/star-ng-ui-skeleton.mjs.map +1 -0
- package/fesm2022/star-ng-ui-slider.mjs +552 -0
- package/fesm2022/star-ng-ui-slider.mjs.map +1 -0
- package/fesm2022/star-ng-ui-spinner.mjs +148 -0
- package/fesm2022/star-ng-ui-spinner.mjs.map +1 -0
- package/fesm2022/star-ng-ui-stepper.mjs +360 -0
- package/fesm2022/star-ng-ui-stepper.mjs.map +1 -0
- package/fesm2022/star-ng-ui-table.mjs +3477 -0
- package/fesm2022/star-ng-ui-table.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tabs.mjs +464 -0
- package/fesm2022/star-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tag.mjs +129 -0
- package/fesm2022/star-ng-ui-tag.mjs.map +1 -0
- package/fesm2022/star-ng-ui-theme-switch.mjs +105 -0
- package/fesm2022/star-ng-ui-theme-switch.mjs.map +1 -0
- package/fesm2022/star-ng-ui-theme.mjs +98 -0
- package/fesm2022/star-ng-ui-theme.mjs.map +1 -0
- package/fesm2022/star-ng-ui-toast.mjs +298 -0
- package/fesm2022/star-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/star-ng-ui-toggle-switch.mjs +316 -0
- package/fesm2022/star-ng-ui-toggle-switch.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tooltip.mjs +297 -0
- package/fesm2022/star-ng-ui-tooltip.mjs.map +1 -0
- package/fesm2022/star-ng-ui-transloco.mjs +40 -0
- package/fesm2022/star-ng-ui-transloco.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tree.mjs +1446 -0
- package/fesm2022/star-ng-ui-tree.mjs.map +1 -0
- package/fesm2022/star-ng-ui-utility.mjs +2134 -0
- package/fesm2022/star-ng-ui-utility.mjs.map +1 -0
- package/fesm2022/star-ng-ui.mjs +51 -0
- package/package.json +281 -3
- package/styles/_base.scss +70 -0
- package/styles/_shared.scss +2 -0
- package/styles/_tokens.scss +190 -0
- package/styles/controls/_accordion.scss +75 -0
- package/styles/controls/_autocomplete.scss +44 -0
- package/styles/controls/_avatar.scss +39 -0
- package/styles/controls/_breadcrumb.scss +45 -0
- package/styles/controls/_button.scss +137 -0
- package/styles/controls/_card.scss +38 -0
- package/styles/controls/_chart.scss +214 -0
- package/styles/controls/_chip.scss +51 -0
- package/styles/controls/_choice.scss +153 -0
- package/styles/controls/_data-display.scss +118 -0
- package/styles/controls/_date-picker.scss +300 -0
- package/styles/controls/_dialog.scss +123 -0
- package/styles/controls/_drawer.scss +118 -0
- package/styles/controls/_editor.scss +74 -0
- package/styles/controls/_field.scss +92 -0
- package/styles/controls/_file-upload.scss +136 -0
- package/styles/controls/_input-group.scss +104 -0
- package/styles/controls/_input-mask.scss +46 -0
- package/styles/controls/_input-number.scss +125 -0
- package/styles/controls/_knob.scss +76 -0
- package/styles/controls/_layout.scss +182 -0
- package/styles/controls/_listbox.scss +38 -0
- package/styles/controls/_media.scss +222 -0
- package/styles/controls/_menu.scss +254 -0
- package/styles/controls/_message.scss +48 -0
- package/styles/controls/_org-chart.scss +128 -0
- package/styles/controls/_paginator.scss +59 -0
- package/styles/controls/_panel.scss +83 -0
- package/styles/controls/_popover.scss +40 -0
- package/styles/controls/_progress-bar.scss +74 -0
- package/styles/controls/_select-button.scss +61 -0
- package/styles/controls/_select.scss +216 -0
- package/styles/controls/_skeleton.scss +43 -0
- package/styles/controls/_slider.scss +163 -0
- package/styles/controls/_spinner.scss +34 -0
- package/styles/controls/_stepper.scss +109 -0
- package/styles/controls/_table.scss +523 -0
- package/styles/controls/_tabs.scss +93 -0
- package/styles/controls/_tag.scss +84 -0
- package/styles/controls/_toast.scss +141 -0
- package/styles/controls/_tooltip.scss +14 -0
- package/styles/controls/_tree.scss +113 -0
- package/styles/controls/_utility.scss +654 -0
- package/styles/star-ng.css +5803 -0
- package/styles/star-ng.min.css +1 -0
- package/styles/star-ng.scss +50 -0
- package/theme/star-theme-first-paint.js +1 -0
- package/types/star-ng-ui-accordion.d.ts +82 -0
- package/types/star-ng-ui-autocomplete.d.ts +171 -0
- package/types/star-ng-ui-avatar.d.ts +43 -0
- package/types/star-ng-ui-badge.d.ts +46 -0
- package/types/star-ng-ui-breadcrumb.d.ts +39 -0
- package/types/star-ng-ui-button.d.ts +79 -0
- package/types/star-ng-ui-card.d.ts +29 -0
- package/types/star-ng-ui-chart.d.ts +337 -0
- package/types/star-ng-ui-checkbox.d.ts +92 -0
- package/types/star-ng-ui-core.d.ts +310 -0
- package/types/star-ng-ui-data-display.d.ts +339 -0
- package/types/star-ng-ui-date-picker.d.ts +701 -0
- package/types/star-ng-ui-dialog.d.ts +254 -0
- package/types/star-ng-ui-drawer.d.ts +29 -0
- package/types/star-ng-ui-editor.d.ts +96 -0
- package/types/star-ng-ui-field.d.ts +146 -0
- package/types/star-ng-ui-file-upload.d.ts +192 -0
- package/types/star-ng-ui-i18n-de.d.ts +7 -0
- package/types/star-ng-ui-i18n-es.d.ts +7 -0
- package/types/star-ng-ui-input-group.d.ts +58 -0
- package/types/star-ng-ui-input-mask.d.ts +126 -0
- package/types/star-ng-ui-input-number.d.ts +193 -0
- package/types/star-ng-ui-input-otp.d.ts +86 -0
- package/types/star-ng-ui-input-tags.d.ts +159 -0
- package/types/star-ng-ui-knob.d.ts +121 -0
- package/types/star-ng-ui-layout.d.ts +154 -0
- package/types/star-ng-ui-listbox.d.ts +197 -0
- package/types/star-ng-ui-media.d.ts +161 -0
- package/types/star-ng-ui-menu.d.ts +332 -0
- package/types/star-ng-ui-message.d.ts +52 -0
- package/types/star-ng-ui-paginator.d.ts +85 -0
- package/types/star-ng-ui-panel.d.ts +65 -0
- package/types/star-ng-ui-password.d.ts +129 -0
- package/types/star-ng-ui-popover.d.ts +57 -0
- package/types/star-ng-ui-progress-bar.d.ts +49 -0
- package/types/star-ng-ui-radio.d.ts +116 -0
- package/types/star-ng-ui-rating.d.ts +52 -0
- package/types/star-ng-ui-select-button.d.ts +169 -0
- package/types/star-ng-ui-select.d.ts +540 -0
- package/types/star-ng-ui-skeleton.d.ts +47 -0
- package/types/star-ng-ui-slider.d.ts +145 -0
- package/types/star-ng-ui-spinner.d.ts +29 -0
- package/types/star-ng-ui-stepper.d.ts +89 -0
- package/types/star-ng-ui-table.d.ts +829 -0
- package/types/star-ng-ui-tabs.d.ts +109 -0
- package/types/star-ng-ui-tag.d.ts +35 -0
- package/types/star-ng-ui-theme-switch.d.ts +36 -0
- package/types/star-ng-ui-theme.d.ts +95 -0
- package/types/star-ng-ui-toast.d.ts +84 -0
- package/types/star-ng-ui-toggle-switch.d.ts +81 -0
- package/types/star-ng-ui-tooltip.d.ts +66 -0
- package/types/star-ng-ui-transloco.d.ts +14 -0
- package/types/star-ng-ui-tree.d.ts +310 -0
- package/types/star-ng-ui-utility.d.ts +533 -0
- package/types/star-ng-ui.d.ts +51 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { HttpEvent } from "@angular/common/http";
|
|
4
|
+
import { Observable } from "rxjs";
|
|
5
|
+
export interface StarRejectedFile {
|
|
6
|
+
readonly file: File;
|
|
7
|
+
readonly reason: 'type' | 'size' | 'limit';
|
|
8
|
+
}
|
|
9
|
+
/** Upload state of one file. The page that uploads the files owns this state. */
|
|
10
|
+
export interface StarFileStatus {
|
|
11
|
+
/** Percent sent, 0 to 100. Shows a progress bar while `state` is `'uploading'`. */
|
|
12
|
+
readonly progress?: number;
|
|
13
|
+
readonly state?: 'uploading' | 'done' | 'error';
|
|
14
|
+
/** Error text, shown with `state: 'error'`. */
|
|
15
|
+
readonly message?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Human-readable size with `Intl.NumberFormat` byte units (kB, MB). */
|
|
18
|
+
export declare function formatFileSize(bytes: number, locale?: string): string;
|
|
19
|
+
/** Matches a file against an `accept` list such as `.pdf,image/*,application/msword`. */
|
|
20
|
+
export declare function fileMatchesAccept(file: File, accept: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* File picker with drag and drop (PrimeNG `p-fileupload`, "advanced" mode without the HTTP
|
|
23
|
+
* part). The value is the list of chosen `File`s; upload them in your own service.
|
|
24
|
+
* Validates `accept`, `maxFileSize` and `fileLimit`, and lists rejected files with a reason.
|
|
25
|
+
*
|
|
26
|
+
* `fileStatus` shows the upload state of each file (progress bar, done, error); the control
|
|
27
|
+
* does not upload (`toUploadStatus()` maps an `HttpClient` upload to that state).
|
|
28
|
+
* `reorderable` lets the user change the file order (buttons or drag). `thumbnails` shows a
|
|
29
|
+
* picture for image files. Files pasted while focus is in the control are added.
|
|
30
|
+
*
|
|
31
|
+
* `<star-file-upload [formField]="form.attachments" accept=".pdf,image/*" [maxFileSize]="10_000_000" multiple />`
|
|
32
|
+
*/
|
|
33
|
+
export declare class StarFileUpload implements FormValueControl<readonly File[]> {
|
|
34
|
+
protected readonly text: import("@star-ng/ui/core").StarUiText;
|
|
35
|
+
private readonly ids;
|
|
36
|
+
constructor();
|
|
37
|
+
/** The chosen files, in list order. */
|
|
38
|
+
readonly value: import("@angular/core").ModelSignal<readonly File[]>;
|
|
39
|
+
/** Allowed files: extensions and MIME types such as `.pdf,image/*`. Empty allows every file. */
|
|
40
|
+
readonly accept: import("@angular/core").InputSignal<string>;
|
|
41
|
+
/** Allows more than one file. Without it a new file replaces the old one. */
|
|
42
|
+
readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
43
|
+
/** Bytes (0 = no limit). */
|
|
44
|
+
readonly maxFileSize: import("@angular/core").InputSignal<number>;
|
|
45
|
+
/** Maximum number of files (0 = no limit). */
|
|
46
|
+
readonly fileLimit: import("@angular/core").InputSignal<number>;
|
|
47
|
+
/** Locale for the file sizes (default: the application locale). */
|
|
48
|
+
readonly locale: import("@angular/core").InputSignal<string | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Upload state of a file, or `null`. Read your own signal in the function: the list then
|
|
51
|
+
* follows the upload.
|
|
52
|
+
*/
|
|
53
|
+
readonly fileStatus: import("@angular/core").InputSignal<((file: File) => StarFileStatus | null | undefined) | null>;
|
|
54
|
+
/** The user can change the order of the files. */
|
|
55
|
+
readonly reorderable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
56
|
+
/** Shows a small picture in place of the file icon for image files. */
|
|
57
|
+
readonly thumbnails: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
58
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
59
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
60
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
61
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
62
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
63
|
+
/** Emits the files that passed the checks, each time files are added. */
|
|
64
|
+
readonly selected: import("@angular/core").OutputEmitterRef<readonly File[]>;
|
|
65
|
+
/** Emits the files that failed a check, with the reason (`type`, `size` or `limit`). */
|
|
66
|
+
readonly rejectedChange: import("@angular/core").OutputEmitterRef<readonly StarRejectedFile[]>;
|
|
67
|
+
protected readonly inputId: string;
|
|
68
|
+
protected readonly hintId: string;
|
|
69
|
+
protected readonly dragging: import("@angular/core").WritableSignal<boolean>;
|
|
70
|
+
protected readonly rejected: import("@angular/core").WritableSignal<readonly StarRejectedFile[]>;
|
|
71
|
+
protected readonly dropIndex: import("@angular/core").WritableSignal<number | null>;
|
|
72
|
+
private dragIndex;
|
|
73
|
+
protected readonly canReorder: import("@angular/core").Signal<boolean>;
|
|
74
|
+
private readonly input;
|
|
75
|
+
protected readonly hint: import("@angular/core").Signal<string>;
|
|
76
|
+
protected statusOf(file: File): StarFileStatus | null;
|
|
77
|
+
protected percent(status: StarFileStatus | null): number;
|
|
78
|
+
/** Moves the file at index `from` to index `to`. */
|
|
79
|
+
move(from: number, to: number): void;
|
|
80
|
+
protected onFileDragStart(index: number, event: DragEvent): void;
|
|
81
|
+
protected onFileDragOver(index: number, event: DragEvent): void;
|
|
82
|
+
protected onFileDrop(index: number, event: DragEvent): void;
|
|
83
|
+
protected endFileDrag(): void;
|
|
84
|
+
protected size(file: File): string;
|
|
85
|
+
protected rejectionText(item: StarRejectedFile): string;
|
|
86
|
+
protected onDrag(event: DragEvent, over: boolean): void;
|
|
87
|
+
protected onDrop(event: DragEvent): void;
|
|
88
|
+
protected onPicked(input: HTMLInputElement): void;
|
|
89
|
+
/** Validates and adds files (also usable from code, for example paste handlers). */
|
|
90
|
+
add(files: readonly File[]): void;
|
|
91
|
+
remove(file: File): void;
|
|
92
|
+
/** Object URL per image file, made when first shown and released when the file goes. */
|
|
93
|
+
private readonly thumbnailUrls;
|
|
94
|
+
protected thumbnailOf(file: File): string | null;
|
|
95
|
+
private releaseThumbnail;
|
|
96
|
+
/** Files on the clipboard (a screenshot, a copied file) are added while focus is in the control. */
|
|
97
|
+
protected onPaste(event: ClipboardEvent): void;
|
|
98
|
+
focus(): void;
|
|
99
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarFileUpload, never>;
|
|
100
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarFileUpload, "star-file-upload", never, {
|
|
101
|
+
"value": {
|
|
102
|
+
"alias": "value";
|
|
103
|
+
"required": false;
|
|
104
|
+
"isSignal": true;
|
|
105
|
+
};
|
|
106
|
+
"accept": {
|
|
107
|
+
"alias": "accept";
|
|
108
|
+
"required": false;
|
|
109
|
+
"isSignal": true;
|
|
110
|
+
};
|
|
111
|
+
"multiple": {
|
|
112
|
+
"alias": "multiple";
|
|
113
|
+
"required": false;
|
|
114
|
+
"isSignal": true;
|
|
115
|
+
};
|
|
116
|
+
"maxFileSize": {
|
|
117
|
+
"alias": "maxFileSize";
|
|
118
|
+
"required": false;
|
|
119
|
+
"isSignal": true;
|
|
120
|
+
};
|
|
121
|
+
"fileLimit": {
|
|
122
|
+
"alias": "fileLimit";
|
|
123
|
+
"required": false;
|
|
124
|
+
"isSignal": true;
|
|
125
|
+
};
|
|
126
|
+
"locale": {
|
|
127
|
+
"alias": "locale";
|
|
128
|
+
"required": false;
|
|
129
|
+
"isSignal": true;
|
|
130
|
+
};
|
|
131
|
+
"fileStatus": {
|
|
132
|
+
"alias": "fileStatus";
|
|
133
|
+
"required": false;
|
|
134
|
+
"isSignal": true;
|
|
135
|
+
};
|
|
136
|
+
"reorderable": {
|
|
137
|
+
"alias": "reorderable";
|
|
138
|
+
"required": false;
|
|
139
|
+
"isSignal": true;
|
|
140
|
+
};
|
|
141
|
+
"thumbnails": {
|
|
142
|
+
"alias": "thumbnails";
|
|
143
|
+
"required": false;
|
|
144
|
+
"isSignal": true;
|
|
145
|
+
};
|
|
146
|
+
"disabled": {
|
|
147
|
+
"alias": "disabled";
|
|
148
|
+
"required": false;
|
|
149
|
+
"isSignal": true;
|
|
150
|
+
};
|
|
151
|
+
"readonly": {
|
|
152
|
+
"alias": "readonly";
|
|
153
|
+
"required": false;
|
|
154
|
+
"isSignal": true;
|
|
155
|
+
};
|
|
156
|
+
"invalid": {
|
|
157
|
+
"alias": "invalid";
|
|
158
|
+
"required": false;
|
|
159
|
+
"isSignal": true;
|
|
160
|
+
};
|
|
161
|
+
"touched": {
|
|
162
|
+
"alias": "touched";
|
|
163
|
+
"required": false;
|
|
164
|
+
"isSignal": true;
|
|
165
|
+
};
|
|
166
|
+
}, {
|
|
167
|
+
"value": "valueChange";
|
|
168
|
+
"touch": "touch";
|
|
169
|
+
"selected": "selected";
|
|
170
|
+
"rejectedChange": "rejectedChange";
|
|
171
|
+
}, never, never, true, never>;
|
|
172
|
+
}
|
|
173
|
+
/** Upload state of one file, with the server response when the upload is done. */
|
|
174
|
+
export interface StarUploadResult<T> extends StarFileStatus {
|
|
175
|
+
readonly response?: T;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Turns the events of one `HttpClient` upload into `StarFileStatus` values for
|
|
179
|
+
* `<star-file-upload [fileStatus]>`: progress while the body is sent, then `done` with the
|
|
180
|
+
* response body, or `error` with a message. The observable does not fail.
|
|
181
|
+
*
|
|
182
|
+
* The control does not upload. The page sends the request with
|
|
183
|
+
* `{ reportProgress: true, observe: 'events' }` and pipes it here:
|
|
184
|
+
*
|
|
185
|
+
* ```ts
|
|
186
|
+
* this.api.upload(file).pipe(toUploadStatus()).subscribe((status) =>
|
|
187
|
+
* this.uploads.update((map) => new Map(map).set(file, status)));
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* @param errorMessage Text for a failed upload. The default uses the HTTP status text.
|
|
191
|
+
*/
|
|
192
|
+
export declare function toUploadStatus<T>(errorMessage?: (error: unknown) => string): (events: Observable<HttpEvent<T>>) => Observable<StarUploadResult<T>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StarUiText } from "@star-ng/ui/core";
|
|
2
|
+
/**
|
|
3
|
+
* German control texts (formal address "Sie"). Provide them with
|
|
4
|
+
* `provideStarUiText(STAR_UI_TEXT_DE)` or through `provideStarUiTextFromSignal()`.
|
|
5
|
+
* The `StarUiText` type makes a missing entry a compile error.
|
|
6
|
+
*/
|
|
7
|
+
export declare const STAR_UI_TEXT_DE: StarUiText;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StarUiText } from "@star-ng/ui/core";
|
|
2
|
+
/**
|
|
3
|
+
* Spanish control texts in neutral Spanish: no regional words, no "tú" or "usted" forms (actions
|
|
4
|
+
* use the infinitive). Provide them with `provideStarUiText(STAR_UI_TEXT_ES)` or through
|
|
5
|
+
* `provideStarUiTextFromSignal()`. The `StarUiText` type makes a missing entry a compile error.
|
|
6
|
+
*/
|
|
7
|
+
export declare const STAR_UI_TEXT_ES: StarUiText;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Icon inside a text input (PrimeNG `p-iconfield` + `p-inputicon`). The icon is decoration
|
|
4
|
+
* only: the input still needs a label (`star-field` or `aria-label`).
|
|
5
|
+
*
|
|
6
|
+
* ```html
|
|
7
|
+
* <star-icon-field icon="ph-bold ph-magnifying-glass">
|
|
8
|
+
* <input starInput type="search" aria-label="Search cases" />
|
|
9
|
+
* </star-icon-field>
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare class StarIconField {
|
|
13
|
+
/** Phosphor icon classes, for example `ph-bold ph-magnifying-glass`. */
|
|
14
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
15
|
+
readonly iconPosition: import("@angular/core").InputSignal<"start" | "end">;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarIconField, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarIconField, "star-icon-field", never, {
|
|
18
|
+
"icon": {
|
|
19
|
+
"alias": "icon";
|
|
20
|
+
"required": true;
|
|
21
|
+
"isSignal": true;
|
|
22
|
+
};
|
|
23
|
+
"iconPosition": {
|
|
24
|
+
"alias": "iconPosition";
|
|
25
|
+
"required": false;
|
|
26
|
+
"isSignal": true;
|
|
27
|
+
};
|
|
28
|
+
}, {}, never, ["*"], true, never>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Joins an input with add-ons before or after it (PrimeNG `p-inputgroup`): a unit, a prefix
|
|
32
|
+
* text, an icon or a button. Put `star-input-group-addon` elements, native `starInput` inputs
|
|
33
|
+
* and `star-button` elements inside, in visual order.
|
|
34
|
+
*
|
|
35
|
+
* ```html
|
|
36
|
+
* <star-input-group>
|
|
37
|
+
* <star-input-group-addon>https://</star-input-group-addon>
|
|
38
|
+
* <input starInput aria-label="Website" />
|
|
39
|
+
* <star-button variant="secondary">Check</star-button>
|
|
40
|
+
* </star-input-group>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare class StarInputGroup {
|
|
44
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarInputGroup, never>;
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarInputGroup, "star-input-group", never, {
|
|
47
|
+
"ariaLabel": {
|
|
48
|
+
"alias": "ariaLabel";
|
|
49
|
+
"required": false;
|
|
50
|
+
"isSignal": true;
|
|
51
|
+
};
|
|
52
|
+
}, {}, never, ["*"], true, never>;
|
|
53
|
+
}
|
|
54
|
+
/** Text or icon add-on of `star-input-group`. */
|
|
55
|
+
export declare class StarInputGroupAddon {
|
|
56
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarInputGroupAddon, never>;
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarInputGroupAddon, "star-input-group-addon", never, {}, {}, never, ["*"], true, never>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
2
|
+
import { StarField } from "@star-ng/ui/field";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Applies a mask to raw characters; returns the masked text (unfilled slots as `slotChar`). */
|
|
5
|
+
export declare function applyMask(mask: string, raw: string, slotChar?: string): string;
|
|
6
|
+
/** Characters typed into the slots, without literals and slot chars. */
|
|
7
|
+
export declare function unmask(mask: string, masked: string, slotChar?: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Masked text field (PrimeNG `p-inputmask`): fixed-format entry such as phone numbers, postal
|
|
10
|
+
* codes or serial numbers. Mask tokens: `9` digit, `a` letter, `*` letter or digit; other
|
|
11
|
+
* characters are literals. The value is the masked text, or the raw slots with `unmask`.
|
|
12
|
+
*
|
|
13
|
+
* `<star-input-mask mask="(999) 999-9999" [formField]="form.phone" ariaLabel="Phone number" />`
|
|
14
|
+
*/
|
|
15
|
+
export declare class StarInputMask implements FormValueControl<string> {
|
|
16
|
+
protected readonly field: StarField | null;
|
|
17
|
+
/** Invalid after touch, or while the parent `star-field` shows an error. */
|
|
18
|
+
protected readonly showInvalid: import("@angular/core").Signal<boolean>;
|
|
19
|
+
constructor();
|
|
20
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
21
|
+
readonly mask: import("@angular/core").InputSignal<string>;
|
|
22
|
+
readonly slotChar: import("@angular/core").InputSignal<string>;
|
|
23
|
+
/** Store only the typed characters (no literals). */
|
|
24
|
+
readonly unmask: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
25
|
+
/** Keep a partly filled value on blur (default clears it). */
|
|
26
|
+
readonly autoClear: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
27
|
+
readonly placeholder: import("@angular/core").InputSignal<string | null>;
|
|
28
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
29
|
+
readonly inputId: import("@angular/core").InputSignal<string>;
|
|
30
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
31
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
32
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
33
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
34
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
35
|
+
readonly name: import("@angular/core").InputSignal<string>;
|
|
36
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
37
|
+
readonly completed: import("@angular/core").OutputEmitterRef<string>;
|
|
38
|
+
protected readonly tokenPattern: RegExp;
|
|
39
|
+
private readonly input;
|
|
40
|
+
protected readonly numericOnly: import("@angular/core").Signal<boolean>;
|
|
41
|
+
protected readonly display: import("@angular/core").Signal<string>;
|
|
42
|
+
private slotsFilled;
|
|
43
|
+
protected onFocus(input: HTMLInputElement): void;
|
|
44
|
+
protected onInput(input: HTMLInputElement): void;
|
|
45
|
+
protected onBlur(input: HTMLInputElement): void;
|
|
46
|
+
/** Puts the caret on the first empty slot. */
|
|
47
|
+
private placeCaret;
|
|
48
|
+
focus(): void;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarInputMask, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarInputMask, "star-input-mask", never, {
|
|
51
|
+
"value": {
|
|
52
|
+
"alias": "value";
|
|
53
|
+
"required": false;
|
|
54
|
+
"isSignal": true;
|
|
55
|
+
};
|
|
56
|
+
"mask": {
|
|
57
|
+
"alias": "mask";
|
|
58
|
+
"required": true;
|
|
59
|
+
"isSignal": true;
|
|
60
|
+
};
|
|
61
|
+
"slotChar": {
|
|
62
|
+
"alias": "slotChar";
|
|
63
|
+
"required": false;
|
|
64
|
+
"isSignal": true;
|
|
65
|
+
};
|
|
66
|
+
"unmask": {
|
|
67
|
+
"alias": "unmask";
|
|
68
|
+
"required": false;
|
|
69
|
+
"isSignal": true;
|
|
70
|
+
};
|
|
71
|
+
"autoClear": {
|
|
72
|
+
"alias": "autoClear";
|
|
73
|
+
"required": false;
|
|
74
|
+
"isSignal": true;
|
|
75
|
+
};
|
|
76
|
+
"placeholder": {
|
|
77
|
+
"alias": "placeholder";
|
|
78
|
+
"required": false;
|
|
79
|
+
"isSignal": true;
|
|
80
|
+
};
|
|
81
|
+
"ariaLabel": {
|
|
82
|
+
"alias": "ariaLabel";
|
|
83
|
+
"required": false;
|
|
84
|
+
"isSignal": true;
|
|
85
|
+
};
|
|
86
|
+
"inputId": {
|
|
87
|
+
"alias": "inputId";
|
|
88
|
+
"required": false;
|
|
89
|
+
"isSignal": true;
|
|
90
|
+
};
|
|
91
|
+
"disabled": {
|
|
92
|
+
"alias": "disabled";
|
|
93
|
+
"required": false;
|
|
94
|
+
"isSignal": true;
|
|
95
|
+
};
|
|
96
|
+
"readonly": {
|
|
97
|
+
"alias": "readonly";
|
|
98
|
+
"required": false;
|
|
99
|
+
"isSignal": true;
|
|
100
|
+
};
|
|
101
|
+
"required": {
|
|
102
|
+
"alias": "required";
|
|
103
|
+
"required": false;
|
|
104
|
+
"isSignal": true;
|
|
105
|
+
};
|
|
106
|
+
"invalid": {
|
|
107
|
+
"alias": "invalid";
|
|
108
|
+
"required": false;
|
|
109
|
+
"isSignal": true;
|
|
110
|
+
};
|
|
111
|
+
"touched": {
|
|
112
|
+
"alias": "touched";
|
|
113
|
+
"required": false;
|
|
114
|
+
"isSignal": true;
|
|
115
|
+
};
|
|
116
|
+
"name": {
|
|
117
|
+
"alias": "name";
|
|
118
|
+
"required": false;
|
|
119
|
+
"isSignal": true;
|
|
120
|
+
};
|
|
121
|
+
}, {
|
|
122
|
+
"value": "valueChange";
|
|
123
|
+
"touch": "touch";
|
|
124
|
+
"completed": "completed";
|
|
125
|
+
}, never, never, true, never>;
|
|
126
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
2
|
+
import { StarField } from "@star-ng/ui/field";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Number field (PrimeNG `p-inputnumber`): locale formatting with `Intl.NumberFormat`
|
|
6
|
+
* (decimal, currency, percent, units), min / max clamping, step buttons, Arrow keys and
|
|
7
|
+
* PageUp / PageDown, `role="spinbutton"`. While focused the field shows plain editable digits;
|
|
8
|
+
* on blur it shows the formatted number.
|
|
9
|
+
*
|
|
10
|
+
* `<star-input-number [formField]="form.quantity" [min]="0" [max]="500" unit="kilogram" showButtons />`
|
|
11
|
+
*/
|
|
12
|
+
export declare class StarInputNumber implements FormValueControl<number | null> {
|
|
13
|
+
protected readonly uiText: import("@star-ng/ui/core").StarUiText;
|
|
14
|
+
protected readonly field: StarField | null;
|
|
15
|
+
/** Invalid after touch, or while the parent `star-field` shows an error. */
|
|
16
|
+
protected readonly showInvalid: import("@angular/core").Signal<boolean>;
|
|
17
|
+
constructor();
|
|
18
|
+
readonly value: import("@angular/core").ModelSignal<number | null>;
|
|
19
|
+
readonly mode: import("@angular/core").InputSignal<"decimal" | "currency" | "percent" | "unit">;
|
|
20
|
+
/** ISO 4217 code for `mode="currency"`, for example `EUR`. */
|
|
21
|
+
readonly currency: import("@angular/core").InputSignal<string>;
|
|
22
|
+
/**
|
|
23
|
+
* ECMA-402 sanctioned unit for `mode="unit"`, for example `kilogram`, `milliliter`, `day`.
|
|
24
|
+
* An unsupported unit (such as `milligram`) is shown as a plain suffix instead of failing.
|
|
25
|
+
*/
|
|
26
|
+
readonly unit: import("@angular/core").InputSignal<string>;
|
|
27
|
+
/** Text before the number, for example `~ `. */
|
|
28
|
+
readonly prefix: import("@angular/core").InputSignal<string>;
|
|
29
|
+
/** Text after the number, for example ` kg`. */
|
|
30
|
+
readonly suffix: import("@angular/core").InputSignal<string>;
|
|
31
|
+
readonly locale: import("@angular/core").InputSignal<string | undefined>;
|
|
32
|
+
/** Default: the Intl default for the mode (0 for decimal, 2 for most currencies). */
|
|
33
|
+
readonly minFractionDigits: import("@angular/core").InputSignal<number | undefined>;
|
|
34
|
+
/** Default: the Intl default for the mode (3 for decimal, 2 for most currencies). */
|
|
35
|
+
readonly maxFractionDigits: import("@angular/core").InputSignal<number | undefined>;
|
|
36
|
+
readonly useGrouping: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
37
|
+
readonly step: import("@angular/core").InputSignal<number>;
|
|
38
|
+
readonly min: import("@angular/core").InputSignal<number | undefined>;
|
|
39
|
+
readonly max: import("@angular/core").InputSignal<number | undefined>;
|
|
40
|
+
readonly showButtons: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
41
|
+
readonly placeholder: import("@angular/core").InputSignal<string | null>;
|
|
42
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
43
|
+
readonly inputId: import("@angular/core").InputSignal<string>;
|
|
44
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
45
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
46
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
47
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
48
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
49
|
+
readonly name: import("@angular/core").InputSignal<string>;
|
|
50
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
51
|
+
private readonly input;
|
|
52
|
+
private readonly focused;
|
|
53
|
+
/** Unit text appended when Intl does not support `unit`. */
|
|
54
|
+
private readonly fallbackUnit;
|
|
55
|
+
private readonly formatter;
|
|
56
|
+
/** Decimal separator of the locale (`.` or `,`). */
|
|
57
|
+
private readonly decimal;
|
|
58
|
+
protected readonly formatted: import("@angular/core").Signal<string>;
|
|
59
|
+
/** Plain digits while editing, formatted text otherwise. */
|
|
60
|
+
protected readonly text: import("@angular/core").WritableSignal<string>;
|
|
61
|
+
private plain;
|
|
62
|
+
/** Reads typed text with either separator; ignores grouping, currency and unit symbols. */
|
|
63
|
+
parse(text: string): number | null | undefined;
|
|
64
|
+
private clamp;
|
|
65
|
+
protected onFocus(): void;
|
|
66
|
+
protected onBlur(): void;
|
|
67
|
+
private commit;
|
|
68
|
+
protected canStep(direction: 1 | -1): boolean;
|
|
69
|
+
stepBy(direction: number): void;
|
|
70
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
71
|
+
focus(options?: FocusOptions): void;
|
|
72
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarInputNumber, never>;
|
|
73
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarInputNumber, "star-input-number", never, {
|
|
74
|
+
"value": {
|
|
75
|
+
"alias": "value";
|
|
76
|
+
"required": false;
|
|
77
|
+
"isSignal": true;
|
|
78
|
+
};
|
|
79
|
+
"mode": {
|
|
80
|
+
"alias": "mode";
|
|
81
|
+
"required": false;
|
|
82
|
+
"isSignal": true;
|
|
83
|
+
};
|
|
84
|
+
"currency": {
|
|
85
|
+
"alias": "currency";
|
|
86
|
+
"required": false;
|
|
87
|
+
"isSignal": true;
|
|
88
|
+
};
|
|
89
|
+
"unit": {
|
|
90
|
+
"alias": "unit";
|
|
91
|
+
"required": false;
|
|
92
|
+
"isSignal": true;
|
|
93
|
+
};
|
|
94
|
+
"prefix": {
|
|
95
|
+
"alias": "prefix";
|
|
96
|
+
"required": false;
|
|
97
|
+
"isSignal": true;
|
|
98
|
+
};
|
|
99
|
+
"suffix": {
|
|
100
|
+
"alias": "suffix";
|
|
101
|
+
"required": false;
|
|
102
|
+
"isSignal": true;
|
|
103
|
+
};
|
|
104
|
+
"locale": {
|
|
105
|
+
"alias": "locale";
|
|
106
|
+
"required": false;
|
|
107
|
+
"isSignal": true;
|
|
108
|
+
};
|
|
109
|
+
"minFractionDigits": {
|
|
110
|
+
"alias": "minFractionDigits";
|
|
111
|
+
"required": false;
|
|
112
|
+
"isSignal": true;
|
|
113
|
+
};
|
|
114
|
+
"maxFractionDigits": {
|
|
115
|
+
"alias": "maxFractionDigits";
|
|
116
|
+
"required": false;
|
|
117
|
+
"isSignal": true;
|
|
118
|
+
};
|
|
119
|
+
"useGrouping": {
|
|
120
|
+
"alias": "useGrouping";
|
|
121
|
+
"required": false;
|
|
122
|
+
"isSignal": true;
|
|
123
|
+
};
|
|
124
|
+
"step": {
|
|
125
|
+
"alias": "step";
|
|
126
|
+
"required": false;
|
|
127
|
+
"isSignal": true;
|
|
128
|
+
};
|
|
129
|
+
"min": {
|
|
130
|
+
"alias": "min";
|
|
131
|
+
"required": false;
|
|
132
|
+
"isSignal": true;
|
|
133
|
+
};
|
|
134
|
+
"max": {
|
|
135
|
+
"alias": "max";
|
|
136
|
+
"required": false;
|
|
137
|
+
"isSignal": true;
|
|
138
|
+
};
|
|
139
|
+
"showButtons": {
|
|
140
|
+
"alias": "showButtons";
|
|
141
|
+
"required": false;
|
|
142
|
+
"isSignal": true;
|
|
143
|
+
};
|
|
144
|
+
"placeholder": {
|
|
145
|
+
"alias": "placeholder";
|
|
146
|
+
"required": false;
|
|
147
|
+
"isSignal": true;
|
|
148
|
+
};
|
|
149
|
+
"ariaLabel": {
|
|
150
|
+
"alias": "ariaLabel";
|
|
151
|
+
"required": false;
|
|
152
|
+
"isSignal": true;
|
|
153
|
+
};
|
|
154
|
+
"inputId": {
|
|
155
|
+
"alias": "inputId";
|
|
156
|
+
"required": false;
|
|
157
|
+
"isSignal": true;
|
|
158
|
+
};
|
|
159
|
+
"disabled": {
|
|
160
|
+
"alias": "disabled";
|
|
161
|
+
"required": false;
|
|
162
|
+
"isSignal": true;
|
|
163
|
+
};
|
|
164
|
+
"readonly": {
|
|
165
|
+
"alias": "readonly";
|
|
166
|
+
"required": false;
|
|
167
|
+
"isSignal": true;
|
|
168
|
+
};
|
|
169
|
+
"required": {
|
|
170
|
+
"alias": "required";
|
|
171
|
+
"required": false;
|
|
172
|
+
"isSignal": true;
|
|
173
|
+
};
|
|
174
|
+
"invalid": {
|
|
175
|
+
"alias": "invalid";
|
|
176
|
+
"required": false;
|
|
177
|
+
"isSignal": true;
|
|
178
|
+
};
|
|
179
|
+
"touched": {
|
|
180
|
+
"alias": "touched";
|
|
181
|
+
"required": false;
|
|
182
|
+
"isSignal": true;
|
|
183
|
+
};
|
|
184
|
+
"name": {
|
|
185
|
+
"alias": "name";
|
|
186
|
+
"required": false;
|
|
187
|
+
"isSignal": true;
|
|
188
|
+
};
|
|
189
|
+
}, {
|
|
190
|
+
"value": "valueChange";
|
|
191
|
+
"touch": "touch";
|
|
192
|
+
}, never, never, true, never>;
|
|
193
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* One-time code field (PrimeNG `p-inputotp`): one box per character, auto-advance, Backspace
|
|
5
|
+
* goes back, Arrow keys move, pasting a full code fills every box, `autocomplete="one-time-code"`
|
|
6
|
+
* on the first box so phones offer SMS codes.
|
|
7
|
+
*
|
|
8
|
+
* `<star-input-otp [length]="6" integerOnly [formField]="form.code" (completed)="verify($event)" />`
|
|
9
|
+
*/
|
|
10
|
+
export declare class StarInputOtp implements FormValueControl<string> {
|
|
11
|
+
protected readonly text: import("@star-ng/ui/core").StarUiText;
|
|
12
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
13
|
+
readonly length: import("@angular/core").InputSignal<number>;
|
|
14
|
+
readonly integerOnly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
15
|
+
/** Hides characters like a password. */
|
|
16
|
+
readonly mask: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
17
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
18
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
19
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
20
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
21
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
22
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
23
|
+
readonly completed: import("@angular/core").OutputEmitterRef<string>;
|
|
24
|
+
private readonly boxes;
|
|
25
|
+
protected readonly slots: import("@angular/core").Signal<number[]>;
|
|
26
|
+
protected readonly chars: import("@angular/core").Signal<string[]>;
|
|
27
|
+
private allowed;
|
|
28
|
+
private setChar;
|
|
29
|
+
private focusBox;
|
|
30
|
+
protected onInput(event: Event, index: number): void;
|
|
31
|
+
protected onKeydown(event: KeyboardEvent, index: number): void;
|
|
32
|
+
protected onPaste(event: ClipboardEvent, index: number): void;
|
|
33
|
+
focus(): void;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarInputOtp, never>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarInputOtp, "star-input-otp", never, {
|
|
36
|
+
"value": {
|
|
37
|
+
"alias": "value";
|
|
38
|
+
"required": false;
|
|
39
|
+
"isSignal": true;
|
|
40
|
+
};
|
|
41
|
+
"length": {
|
|
42
|
+
"alias": "length";
|
|
43
|
+
"required": false;
|
|
44
|
+
"isSignal": true;
|
|
45
|
+
};
|
|
46
|
+
"integerOnly": {
|
|
47
|
+
"alias": "integerOnly";
|
|
48
|
+
"required": false;
|
|
49
|
+
"isSignal": true;
|
|
50
|
+
};
|
|
51
|
+
"mask": {
|
|
52
|
+
"alias": "mask";
|
|
53
|
+
"required": false;
|
|
54
|
+
"isSignal": true;
|
|
55
|
+
};
|
|
56
|
+
"ariaLabel": {
|
|
57
|
+
"alias": "ariaLabel";
|
|
58
|
+
"required": false;
|
|
59
|
+
"isSignal": true;
|
|
60
|
+
};
|
|
61
|
+
"disabled": {
|
|
62
|
+
"alias": "disabled";
|
|
63
|
+
"required": false;
|
|
64
|
+
"isSignal": true;
|
|
65
|
+
};
|
|
66
|
+
"readonly": {
|
|
67
|
+
"alias": "readonly";
|
|
68
|
+
"required": false;
|
|
69
|
+
"isSignal": true;
|
|
70
|
+
};
|
|
71
|
+
"invalid": {
|
|
72
|
+
"alias": "invalid";
|
|
73
|
+
"required": false;
|
|
74
|
+
"isSignal": true;
|
|
75
|
+
};
|
|
76
|
+
"touched": {
|
|
77
|
+
"alias": "touched";
|
|
78
|
+
"required": false;
|
|
79
|
+
"isSignal": true;
|
|
80
|
+
};
|
|
81
|
+
}, {
|
|
82
|
+
"value": "valueChange";
|
|
83
|
+
"touch": "touch";
|
|
84
|
+
"completed": "completed";
|
|
85
|
+
}, never, never, true, never>;
|
|
86
|
+
}
|