ng-luna 0.4.3 → 0.5.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 +8 -0
- package/controls/index.d.ts +2 -0
- package/controls/modal/index.d.ts +4 -0
- package/controls/modal/message-box-data.d.ts +22 -0
- package/controls/modal/message-box.component.d.ts +16 -0
- package/controls/modal/modal-data.d.ts +2 -0
- package/controls/modal/modal-ref.d.ts +8 -0
- package/controls/modal/modal.service.d.ts +27 -0
- package/controls/tooltip/index.d.ts +3 -0
- package/controls/tooltip/tooltip-data.d.ts +2 -0
- package/controls/tooltip/tooltip.component.d.ts +6 -0
- package/controls/tooltip/tooltip.directive.d.ts +27 -0
- package/fesm2022/ng-luna.mjs +400 -47
- package/fesm2022/ng-luna.mjs.map +1 -1
- package/package.json +3 -2
- package/theme/_modal.scss +18 -0
- package/theme/_tooltip.scss +13 -0
package/README.md
CHANGED
|
@@ -609,6 +609,14 @@ For a detailed explanation of the library architecture, build process, and how t
|
|
|
609
609
|
npm run build
|
|
610
610
|
```
|
|
611
611
|
|
|
612
|
+
**Clean build** (use when the build fails, e.g. "Cannot find module 'rxjs'"):
|
|
613
|
+
|
|
614
|
+
1. **Clean** – Remove `node_modules`, `dist`, and `.angular` if present. Optionally remove `package-lock.json` for a full dependency refresh.
|
|
615
|
+
2. **Install** – `npm install`
|
|
616
|
+
3. **Build** – `npm run build`
|
|
617
|
+
|
|
618
|
+
The library uses `import { Observable } from 'rxjs'` like other Angular libraries. `rxjs` is in **peerDependencies** (for apps that use the library) and in **devDependencies** (for this repo's build). If the build still cannot find `rxjs`, confirm that `node_modules/rxjs` exists after `npm install`; if not, run `npm install rxjs --save-dev` and try again.
|
|
619
|
+
|
|
612
620
|
The build process uses `ng-packagr` to:
|
|
613
621
|
- Compile TypeScript to ESM modules
|
|
614
622
|
- Generate type definitions
|
package/controls/index.d.ts
CHANGED
|
@@ -10,4 +10,6 @@ export * from './slider/slider.component';
|
|
|
10
10
|
export * from './tabs/tab.component';
|
|
11
11
|
export * from './tabs/tabs.component';
|
|
12
12
|
export * from './textarea/textarea.component';
|
|
13
|
+
export * from './tooltip';
|
|
13
14
|
export * from './window/window.component';
|
|
15
|
+
export * from './modal';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export type MessageBoxType = 'alert' | 'confirm' | 'prompt';
|
|
3
|
+
export interface MessageBoxReturnData {
|
|
4
|
+
button: 'cancel' | 'ok';
|
|
5
|
+
promptValue?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface MessageBoxOptions<T = boolean> {
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
cancelValue?: T;
|
|
10
|
+
okLabel?: string;
|
|
11
|
+
okValue?: T;
|
|
12
|
+
promptDefaultValue?: string;
|
|
13
|
+
promptPlaceholder?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface MessageBoxData<T = boolean> {
|
|
17
|
+
message: string;
|
|
18
|
+
options?: MessageBoxOptions<T>;
|
|
19
|
+
title?: string;
|
|
20
|
+
type: MessageBoxType;
|
|
21
|
+
}
|
|
22
|
+
export declare const MESSAGE_BOX_DATA: InjectionToken<MessageBoxData<unknown>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MessageBoxData } from './message-box-data';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MessageBoxComponent {
|
|
4
|
+
protected readonly data: MessageBoxData<unknown>;
|
|
5
|
+
private readonly modalRef;
|
|
6
|
+
promptValue: string;
|
|
7
|
+
get cancelLabel(): string;
|
|
8
|
+
get messageBoxTitle(): string | undefined;
|
|
9
|
+
get okLabel(): string;
|
|
10
|
+
get promptPlaceholder(): string;
|
|
11
|
+
ngOnInit(): void;
|
|
12
|
+
onCancel(): void;
|
|
13
|
+
onOk(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessageBoxComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageBoxComponent, "luna-message-box", never, {}, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare class LunaModalRef<T = unknown> {
|
|
3
|
+
private readonly onClose;
|
|
4
|
+
private readonly afterClosedSubject;
|
|
5
|
+
readonly afterClosed: Observable<T | undefined>;
|
|
6
|
+
constructor(onClose: () => void);
|
|
7
|
+
close(result?: T): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { MessageBoxOptions, MessageBoxReturnData } from './message-box-data';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Service for showing modal dialogs with a dimmed backdrop. No template markup required.
|
|
7
|
+
* Requires OverlayModule to be imported in the application (e.g. in app config or root component).
|
|
8
|
+
* For the dimmed backdrop style, include the theme: @use 'ng-luna/theme/modal'; in global styles.
|
|
9
|
+
*/
|
|
10
|
+
export declare class LunaModalService {
|
|
11
|
+
private readonly overlay;
|
|
12
|
+
private readonly injector;
|
|
13
|
+
private isMessageBoxOpen;
|
|
14
|
+
alert(message: string, titleOrOptions?: string | MessageBoxOptions<void>): Observable<void | undefined>;
|
|
15
|
+
alertWith<T>(message: string, options?: MessageBoxOptions<T>): Observable<T | undefined>;
|
|
16
|
+
confirm(message: string, titleOrOptions?: string | MessageBoxOptions<boolean>): Observable<boolean>;
|
|
17
|
+
confirmWith<T>(message: string, options: MessageBoxOptions<T>): Observable<T | undefined>;
|
|
18
|
+
prompt(message: string, titleOrOptions?: string | MessageBoxOptions<MessageBoxReturnData>): Observable<MessageBoxReturnData>;
|
|
19
|
+
promptWith(message: string, options?: MessageBoxOptions<MessageBoxReturnData>): Observable<MessageBoxReturnData>;
|
|
20
|
+
private normalizeMessageBoxData;
|
|
21
|
+
private openMessageBox;
|
|
22
|
+
open<T>(component: Type<unknown>, config?: {
|
|
23
|
+
data?: unknown;
|
|
24
|
+
}): Observable<T | undefined>;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LunaModalService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LunaModalService>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class TooltipComponent {
|
|
3
|
+
protected readonly text: string;
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "luna-tooltip", never, {}, {}, never, never, true, never>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TooltipDirective implements OnDestroy {
|
|
4
|
+
lunaTooltip: string;
|
|
5
|
+
lunaTooltipHideDelay: number;
|
|
6
|
+
lunaTooltipShowDelay: number;
|
|
7
|
+
private readonly elementRef;
|
|
8
|
+
private readonly injector;
|
|
9
|
+
private readonly overlay;
|
|
10
|
+
private hideTimeout;
|
|
11
|
+
private overlayRef;
|
|
12
|
+
private showTimeout;
|
|
13
|
+
onBlur(): void;
|
|
14
|
+
onFocus(): void;
|
|
15
|
+
onMouseEnter(): void;
|
|
16
|
+
onMouseLeave(): void;
|
|
17
|
+
ngOnDestroy(): void;
|
|
18
|
+
private clearHideTimeout;
|
|
19
|
+
private clearShowTimeout;
|
|
20
|
+
private destroyOverlay;
|
|
21
|
+
private scheduleHide;
|
|
22
|
+
private scheduleShow;
|
|
23
|
+
private hideWithFade;
|
|
24
|
+
private show;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
|
|
26
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[lunaTooltip]", never, { "lunaTooltip": { "alias": "lunaTooltip"; "required": false; }; "lunaTooltipHideDelay": { "alias": "lunaTooltipHideDelay"; "required": false; }; "lunaTooltipShowDelay": { "alias": "lunaTooltipShowDelay"; "required": false; }; }, {}, never, never, true, never>;
|
|
27
|
+
}
|