@nexterajs/ui 0.0.1 → 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/README.md +279 -34
- package/fesm2022/nexterajs-ui-charts.mjs +1096 -0
- package/fesm2022/nexterajs-ui-charts.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-core.mjs +835 -11
- package/fesm2022/nexterajs-ui-core.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-display.mjs +1142 -0
- package/fesm2022/nexterajs-ui-display.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-dropdowns.mjs +621 -69
- package/fesm2022/nexterajs-ui-dropdowns.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-file-uploader.mjs +576 -11
- package/fesm2022/nexterajs-ui-file-uploader.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-forms.mjs +2702 -452
- package/fesm2022/nexterajs-ui-forms.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-grid.mjs +2350 -336
- package/fesm2022/nexterajs-ui-grid.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-intl.mjs +117 -15
- package/fesm2022/nexterajs-ui-intl.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-navigation.mjs +1054 -0
- package/fesm2022/nexterajs-ui-navigation.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-notify.mjs +353 -0
- package/fesm2022/nexterajs-ui-notify.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-overlay.mjs +1671 -0
- package/fesm2022/nexterajs-ui-overlay.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-pivot.mjs +191 -136
- package/fesm2022/nexterajs-ui-pivot.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-shell.mjs +542 -0
- package/fesm2022/nexterajs-ui-shell.mjs.map +1 -0
- package/fesm2022/nexterajs-ui-styling.mjs +568 -3
- package/fesm2022/nexterajs-ui-styling.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-tree-view.mjs +150 -18
- package/fesm2022/nexterajs-ui-tree-view.mjs.map +1 -1
- package/fesm2022/nexterajs-ui-validation.mjs +283 -97
- package/fesm2022/nexterajs-ui-validation.mjs.map +1 -1
- package/fesm2022/nexterajs-ui.mjs +6 -0
- package/fesm2022/nexterajs-ui.mjs.map +1 -1
- package/package.json +37 -2
- package/styles/_dropdown.scss +150 -1
- package/styles/_editor.scss +75 -21
- package/styles/_icons.scss +92 -0
- package/styles/_mixins.scss +104 -1
- package/styles/_scrollbar.scss +134 -0
- package/styles/_status.scss +21 -0
- package/styles/_toast.scss +243 -0
- package/styles/_tokens.scss +467 -2
- package/styles/_widget.scss +14 -3
- package/styles/index.scss +10 -4
- package/types/nexterajs-ui-charts.d.ts +446 -0
- package/types/nexterajs-ui-core.d.ts +515 -30
- package/types/nexterajs-ui-display.d.ts +720 -0
- package/types/nexterajs-ui-dropdowns.d.ts +318 -57
- package/types/nexterajs-ui-file-uploader.d.ts +240 -8
- package/types/nexterajs-ui-forms.d.ts +772 -43
- package/types/nexterajs-ui-grid.d.ts +878 -135
- package/types/nexterajs-ui-intl.d.ts +39 -4
- package/types/nexterajs-ui-navigation.d.ts +531 -0
- package/types/nexterajs-ui-notify.d.ts +149 -0
- package/types/nexterajs-ui-overlay.d.ts +703 -0
- package/types/nexterajs-ui-pivot.d.ts +91 -70
- package/types/nexterajs-ui-shell.d.ts +294 -0
- package/types/nexterajs-ui-styling.d.ts +163 -3
- package/types/nexterajs-ui-tree-view.d.ts +56 -4
- package/types/nexterajs-ui-validation.d.ts +110 -22
- package/types/nexterajs-ui.d.ts +6 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
4
|
+
import { NxeMessageService } from '@nexterajs/ui/core';
|
|
5
|
+
|
|
6
|
+
type NxeToastType = 'success' | 'error' | 'warning' | 'info';
|
|
7
|
+
type NxeToastPosition = 'toast-top-center' | 'toast-bottom-center' | 'toast-top-right' | 'toast-bottom-right' | 'toast-top-left' | 'toast-bottom-left' | 'toast-top-full-width' | 'toast-bottom-full-width';
|
|
8
|
+
/** Per-call options. Anything omitted falls back to the global {@link NxeToastConfig}. */
|
|
9
|
+
interface NxeToastOverride {
|
|
10
|
+
/**
|
|
11
|
+
* Render the message as HTML rather than text.
|
|
12
|
+
*
|
|
13
|
+
* The message is still sanitised. Callers pass server-composed strings here — a list of
|
|
14
|
+
* validation failures joined with `<br>` — so the markup is not author-controlled and must not
|
|
15
|
+
* be trusted, but stripping it entirely would collapse those lists onto one line.
|
|
16
|
+
*/
|
|
17
|
+
enableHtml?: boolean;
|
|
18
|
+
/** Dismiss when the body is clicked. The close button works regardless. */
|
|
19
|
+
tapToDismiss?: boolean;
|
|
20
|
+
/** Milliseconds before auto-dismiss. `0` keeps it up until dismissed. */
|
|
21
|
+
timeOut?: number;
|
|
22
|
+
closeButton?: boolean;
|
|
23
|
+
progressBar?: boolean;
|
|
24
|
+
/** Extra classes on the toast element. */
|
|
25
|
+
toastClass?: string;
|
|
26
|
+
titleClass?: string;
|
|
27
|
+
messageClass?: string;
|
|
28
|
+
}
|
|
29
|
+
interface NxeToastConfig extends NxeToastOverride {
|
|
30
|
+
/** Which corner or edge the stack is anchored to. */
|
|
31
|
+
positionClass?: NxeToastPosition;
|
|
32
|
+
/**
|
|
33
|
+
* Put the newest toast at the top of the stack.
|
|
34
|
+
*
|
|
35
|
+
* Defaults to true, matching the library this replaces. A naive appending list reverses it —
|
|
36
|
+
* visibly, and without any test failing.
|
|
37
|
+
*/
|
|
38
|
+
newestOnTop?: boolean;
|
|
39
|
+
/** Drop a toast whose type, title and message match one already showing. */
|
|
40
|
+
preventDuplicates?: boolean;
|
|
41
|
+
/** Cap the stack; 0 means no cap. Older toasts are dismissed first. */
|
|
42
|
+
maxOpened?: number;
|
|
43
|
+
}
|
|
44
|
+
declare const NXE_TOAST_DEFAULTS: Required<Pick<NxeToastConfig, 'positionClass' | 'timeOut' | 'closeButton' | 'progressBar' | 'tapToDismiss' | 'enableHtml' | 'newestOnTop' | 'preventDuplicates' | 'maxOpened'>>;
|
|
45
|
+
declare const NXE_TOAST_CONFIG: InjectionToken<NxeToastConfig>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* One toast. Rendered by {@link NxeToastService} into its container; not used directly.
|
|
49
|
+
*
|
|
50
|
+
* **The element order is load-bearing.** The close button comes first and is floated right, which
|
|
51
|
+
* is how the library this replaces positioned it — move it after the title and it drops below the
|
|
52
|
+
* text instead of sitting in the corner. Likewise the host carries the classes rather than an
|
|
53
|
+
* inner wrapper, because the shipped stylesheet targets `.nxe-toast-container .nxe-toast`
|
|
54
|
+
* directly and an extra element between them changes what `width` and `margin` apply to.
|
|
55
|
+
*
|
|
56
|
+
* Styles are global (`@nexterajs/ui/styles/_toast.scss`), not encapsulated, so an application's
|
|
57
|
+
* existing overrides keep winning on specificity exactly as they did before.
|
|
58
|
+
*
|
|
59
|
+
* Accessibility, which the original had none of:
|
|
60
|
+
* - `error` and `warning` announce as `alert` (assertive — the user's own action caused it).
|
|
61
|
+
* `success` and `info` announce as `status` (polite).
|
|
62
|
+
* - Focus is never taken. A validation toast typically appears mid-keystroke, and moving focus
|
|
63
|
+
* would pull the caret out of the field being corrected.
|
|
64
|
+
* - The close button is a real `<button>` with a label, reachable by keyboard.
|
|
65
|
+
*/
|
|
66
|
+
declare class NxeToastComponent {
|
|
67
|
+
protected readonly messages: NxeMessageService;
|
|
68
|
+
private readonly sanitizer;
|
|
69
|
+
readonly type: _angular_core.InputSignal<NxeToastType>;
|
|
70
|
+
readonly title: _angular_core.InputSignal<string | null>;
|
|
71
|
+
readonly message: _angular_core.InputSignal<string | null>;
|
|
72
|
+
readonly enableHtml: _angular_core.InputSignal<boolean>;
|
|
73
|
+
readonly tapToDismiss: _angular_core.InputSignal<boolean>;
|
|
74
|
+
readonly closeButton: _angular_core.InputSignal<boolean>;
|
|
75
|
+
readonly progressBar: _angular_core.InputSignal<boolean>;
|
|
76
|
+
readonly toastClass: _angular_core.InputSignal<string>;
|
|
77
|
+
readonly titleClass: _angular_core.InputSignal<string>;
|
|
78
|
+
readonly messageClass: _angular_core.InputSignal<string>;
|
|
79
|
+
readonly dismissed: _angular_core.OutputEmitterRef<void>;
|
|
80
|
+
/** Pre-enter state: the service clears it a frame later so the opacity transition runs. */
|
|
81
|
+
readonly entering: _angular_core.WritableSignal<boolean>;
|
|
82
|
+
/** Set while the leave transition plays; the service removes the view once it finishes. */
|
|
83
|
+
readonly dismissing: _angular_core.WritableSignal<boolean>;
|
|
84
|
+
readonly progressWidth: _angular_core.WritableSignal<number>;
|
|
85
|
+
protected readonly assertive: _angular_core.Signal<boolean>;
|
|
86
|
+
protected readonly hostClass: _angular_core.Signal<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Sanitised HTML for the message.
|
|
89
|
+
*
|
|
90
|
+
* Callers pass server-composed strings here — validation failures joined with `<br>` — so this
|
|
91
|
+
* is data, not markup the application authored. `sanitize` drops anything executable and keeps
|
|
92
|
+
* the line breaks the lists depend on.
|
|
93
|
+
*/
|
|
94
|
+
protected readonly safeMessage: _angular_core.Signal<SafeHtml>;
|
|
95
|
+
protected onBodyClick(): void;
|
|
96
|
+
protected onCloseClick(event: Event): void;
|
|
97
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeToastComponent, never>;
|
|
98
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NxeToastComponent, "nxe-toast", never, { "type": { "alias": "type"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "enableHtml": { "alias": "enableHtml"; "required": false; "isSignal": true; }; "tapToDismiss": { "alias": "tapToDismiss"; "required": false; "isSignal": true; }; "closeButton": { "alias": "closeButton"; "required": false; "isSignal": true; }; "progressBar": { "alias": "progressBar"; "required": false; "isSignal": true; }; "toastClass": { "alias": "toastClass"; "required": false; "isSignal": true; }; "titleClass": { "alias": "titleClass"; "required": false; "isSignal": true; }; "messageClass": { "alias": "messageClass"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; }, never, never, true, never>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Handle on a shown toast. `dismiss()` is safe to call more than once. */
|
|
102
|
+
interface NxeToastRef {
|
|
103
|
+
dismiss(): void;
|
|
104
|
+
readonly type: NxeToastType;
|
|
105
|
+
readonly title: string | null;
|
|
106
|
+
readonly message: string | null;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Configure the toast stack once, at bootstrap.
|
|
110
|
+
*
|
|
111
|
+
* ```ts
|
|
112
|
+
* providers: [provideNxeToast({ positionClass: 'toast-top-center' })]
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
declare function provideNxeToast(config?: NxeToastConfig): EnvironmentProviders;
|
|
116
|
+
/**
|
|
117
|
+
* Shows toasts.
|
|
118
|
+
*
|
|
119
|
+
* **The container is deliberately not a CDK overlay.** A CDK overlay pane lands in the same
|
|
120
|
+
* `.cdk-overlay-container` as the application's dialogs, which makes paint order creation order —
|
|
121
|
+
* so a toast raised right after a dialog closes can end up behind the next dialog that opens.
|
|
122
|
+
* Callers do exactly that. A dedicated container with its own stacking context keeps toasts above
|
|
123
|
+
* dialogs regardless of the order things were created in.
|
|
124
|
+
*/
|
|
125
|
+
declare class NxeToastService {
|
|
126
|
+
private readonly appRef;
|
|
127
|
+
private readonly injector;
|
|
128
|
+
private readonly document;
|
|
129
|
+
private readonly userConfig;
|
|
130
|
+
private readonly config;
|
|
131
|
+
private container;
|
|
132
|
+
private readonly active;
|
|
133
|
+
success(message?: string | null, title?: string | null, override?: NxeToastOverride): NxeToastRef;
|
|
134
|
+
error(message?: string | null, title?: string | null, override?: NxeToastOverride): NxeToastRef;
|
|
135
|
+
warning(message?: string | null, title?: string | null, override?: NxeToastOverride): NxeToastRef;
|
|
136
|
+
info(message?: string | null, title?: string | null, override?: NxeToastOverride): NxeToastRef;
|
|
137
|
+
/** Dismiss everything currently showing. */
|
|
138
|
+
clear(): void;
|
|
139
|
+
show(type: NxeToastType, message?: string | null, title?: string | null, override?: NxeToastOverride): NxeToastRef;
|
|
140
|
+
/** Shrink the progress bar across the toast's lifetime, the way the original drove it. */
|
|
141
|
+
private runProgress;
|
|
142
|
+
private remove;
|
|
143
|
+
private ensureContainer;
|
|
144
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NxeToastService, never>;
|
|
145
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NxeToastService>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export { NXE_TOAST_CONFIG, NXE_TOAST_DEFAULTS, NxeToastComponent, NxeToastService, provideNxeToast };
|
|
149
|
+
export type { NxeToastConfig, NxeToastOverride, NxeToastPosition, NxeToastRef, NxeToastType };
|