nath-angular-ui 0.6.0 → 0.7.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/fesm2022/nath-angular-ui.mjs +384 -32
- package/fesm2022/nath-angular-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/styles.css +5 -1
- package/types/nath-angular-ui.d.ts +89 -31
package/package.json
CHANGED
package/styles/styles.css
CHANGED
|
@@ -131,12 +131,16 @@
|
|
|
131
131
|
.button:not(.icon-button):not(.button-unstyled) {
|
|
132
132
|
@apply cursor-pointer
|
|
133
133
|
rounded-md box-border border border-transparent
|
|
134
|
-
focus:outline-
|
|
134
|
+
focus:outline-1 focus:outline-zinc-500
|
|
135
135
|
inline-flex gap-2 items-center justify-center leading-5
|
|
136
136
|
px-2 py-2.5
|
|
137
137
|
hover:no-underline
|
|
138
138
|
transition duration-200
|
|
139
139
|
disabled:opacity-50 disabled:cursor-not-allowed;
|
|
140
|
+
|
|
141
|
+
.dark & {
|
|
142
|
+
@apply focus:outline-white;
|
|
143
|
+
}
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
button:disabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef, TemplateRef, InjectionToken, Injector, EmbeddedViewRef, OnInit, OnDestroy, AfterContentInit, Signal, StaticProvider } from '@angular/core';
|
|
2
|
+
import { ElementRef, TemplateRef, InjectionToken, Injector, EmbeddedViewRef, OnInit, OnDestroy, AfterContentInit, AfterViewInit, Signal, StaticProvider } from '@angular/core';
|
|
3
3
|
import { FormValueControl, Field, FieldState } from '@angular/forms/signals';
|
|
4
4
|
import { LucideIcon, isLucideIconComponent, LucideMinimize2, LucideMaximize2, LucideMoon, LucideSun } from '@lucide/angular';
|
|
5
5
|
import * as nath_angular_ui from 'nath-angular-ui';
|
|
@@ -96,7 +96,7 @@ interface Breadcrumb {
|
|
|
96
96
|
disabled?: boolean;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
declare class
|
|
99
|
+
declare class NathBreadcrumbService {
|
|
100
100
|
private readonly _home;
|
|
101
101
|
private readonly _breadcrumbs;
|
|
102
102
|
home: _angular_core.Signal<Breadcrumb | null>;
|
|
@@ -110,15 +110,29 @@ declare class BreadcrumbService {
|
|
|
110
110
|
* Set the breadcrumbs for the current view.
|
|
111
111
|
* @param crumbs Array of breadcrumbs items
|
|
112
112
|
*/
|
|
113
|
-
set(crumbs: Breadcrumb[]): void;
|
|
113
|
+
set(crumbs: (Breadcrumb | null)[]): void;
|
|
114
|
+
/**
|
|
115
|
+
* Add a new breadcrumb to the current breadcrumbs array.
|
|
116
|
+
* @param crumb
|
|
117
|
+
*/
|
|
114
118
|
add(crumb: Breadcrumb): void;
|
|
119
|
+
/**
|
|
120
|
+
* Update a breadcrumb at a specific index.
|
|
121
|
+
* @param index
|
|
122
|
+
* @param crumb
|
|
123
|
+
*/
|
|
115
124
|
update(index: number, crumb: Breadcrumb): void;
|
|
116
125
|
/**
|
|
117
|
-
*
|
|
126
|
+
* Remove a breadcrumb at a specific index.
|
|
127
|
+
* @param index
|
|
128
|
+
*/
|
|
129
|
+
remove(index: number): void;
|
|
130
|
+
/**
|
|
131
|
+
* Clear all breadcrumbs.
|
|
118
132
|
*/
|
|
119
133
|
clear(): void;
|
|
120
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
121
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
134
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NathBreadcrumbService, never>;
|
|
135
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NathBreadcrumbService>;
|
|
122
136
|
}
|
|
123
137
|
|
|
124
138
|
interface CodeFile {
|
|
@@ -342,7 +356,7 @@ declare class NathImagePreview {
|
|
|
342
356
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NathImagePreview, "nath-image-preview", never, { "image": { "alias": "image"; "required": true; "isSignal": true; }; "thumbnail": { "alias": "thumbnail"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": true; "isSignal": true; }; "fallbackIcon": { "alias": "fallbackIcon"; "required": true; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "preview": { "alias": "preview"; "required": false; "isSignal": true; }; }, { "imageClick": "imageClick"; }, never, never, true, never>;
|
|
343
357
|
}
|
|
344
358
|
|
|
345
|
-
interface
|
|
359
|
+
interface NathMenuItemCommandEvent {
|
|
346
360
|
/**
|
|
347
361
|
* Browser event.
|
|
348
362
|
*/
|
|
@@ -350,13 +364,13 @@ interface MenuItemCommandEvent {
|
|
|
350
364
|
/**
|
|
351
365
|
* Selected menu item.
|
|
352
366
|
*/
|
|
353
|
-
item?:
|
|
367
|
+
item?: NathMenuItem;
|
|
354
368
|
/**
|
|
355
369
|
* Index of the selected item.
|
|
356
370
|
*/
|
|
357
371
|
index?: number;
|
|
358
372
|
}
|
|
359
|
-
interface
|
|
373
|
+
interface NathMenuItem {
|
|
360
374
|
/**
|
|
361
375
|
* Text of the item.
|
|
362
376
|
*/
|
|
@@ -368,7 +382,7 @@ interface MenuItem {
|
|
|
368
382
|
/**
|
|
369
383
|
* Callback to execute when item is clicked.
|
|
370
384
|
*/
|
|
371
|
-
command?(event:
|
|
385
|
+
command?(event: NathMenuItemCommandEvent): void;
|
|
372
386
|
/**
|
|
373
387
|
* External link to navigate when item is clicked.
|
|
374
388
|
*/
|
|
@@ -376,7 +390,7 @@ interface MenuItem {
|
|
|
376
390
|
/**
|
|
377
391
|
* An array of children menuitems.
|
|
378
392
|
*/
|
|
379
|
-
items?:
|
|
393
|
+
items?: NathMenuItem[];
|
|
380
394
|
/**
|
|
381
395
|
* Visibility of submenu.
|
|
382
396
|
*/
|
|
@@ -509,15 +523,10 @@ interface MenuItem {
|
|
|
509
523
|
linkClass?: string;
|
|
510
524
|
/**
|
|
511
525
|
* Developer-defined state that can be passed to any navigation.
|
|
512
|
-
* @see {MenuItemState}
|
|
513
526
|
*/
|
|
514
527
|
state?: {
|
|
515
528
|
[k: string]: any;
|
|
516
529
|
};
|
|
517
|
-
/**
|
|
518
|
-
* Options of the item's tooltip.
|
|
519
|
-
* @see {TooltipOptions}
|
|
520
|
-
*/
|
|
521
530
|
/**
|
|
522
531
|
* Optional
|
|
523
532
|
*/
|
|
@@ -529,8 +538,9 @@ type NathMenuPositionY = 'auto' | 'top' | 'bottom';
|
|
|
529
538
|
|
|
530
539
|
declare class NathMenu implements AfterContentInit, OnDestroy {
|
|
531
540
|
private readonly document;
|
|
532
|
-
model: _angular_core.ModelSignal<
|
|
541
|
+
model: _angular_core.ModelSignal<NathMenuItem[]>;
|
|
533
542
|
styleClass: _angular_core.ModelSignal<string | null | undefined>;
|
|
543
|
+
panelStyleClass: _angular_core.ModelSignal<string | null | undefined>;
|
|
534
544
|
positionX: _angular_core.InputSignal<NathMenuPositionX>;
|
|
535
545
|
positionY: _angular_core.InputSignal<NathMenuPositionY>;
|
|
536
546
|
inline: _angular_core.InputSignal<boolean>;
|
|
@@ -550,43 +560,91 @@ declare class NathMenu implements AfterContentInit, OnDestroy {
|
|
|
550
560
|
/**
|
|
551
561
|
* Show menu in popup mode
|
|
552
562
|
*/
|
|
553
|
-
show(event:
|
|
563
|
+
show(event: Event): void;
|
|
554
564
|
hide(): void;
|
|
555
565
|
toggle(event: MouseEvent): void;
|
|
556
566
|
handleCommand(payload: {
|
|
557
|
-
item:
|
|
567
|
+
item: NathMenuItem;
|
|
558
568
|
index?: number;
|
|
559
569
|
event?: Event;
|
|
560
570
|
}): void;
|
|
561
571
|
ngOnDestroy(): void;
|
|
562
572
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NathMenu, never>;
|
|
563
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NathMenu, "nath-menu", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "positionX": { "alias": "positionX"; "required": false; "isSignal": true; }; "positionY": { "alias": "positionY"; "required": false; "isSignal": true; }; "inline": { "alias": "inline"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "styleClass": "styleClassChange"; "whenHide": "whenHide"; }, never, never, true, never>;
|
|
573
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NathMenu, "nath-menu", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "panelStyleClass": { "alias": "panelStyleClass"; "required": false; "isSignal": true; }; "positionX": { "alias": "positionX"; "required": false; "isSignal": true; }; "positionY": { "alias": "positionY"; "required": false; "isSignal": true; }; "inline": { "alias": "inline"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; }, { "model": "modelChange"; "styleClass": "styleClassChange"; "panelStyleClass": "panelStyleClassChange"; "whenHide": "whenHide"; }, never, never, true, never>;
|
|
564
574
|
}
|
|
565
575
|
|
|
566
|
-
declare class NathMenuList {
|
|
576
|
+
declare class NathMenuList implements AfterViewInit {
|
|
577
|
+
private readonly document;
|
|
567
578
|
private readonly sanitizer;
|
|
568
|
-
|
|
579
|
+
private readonly destroyRef;
|
|
580
|
+
private readonly elementRef;
|
|
581
|
+
items: _angular_core.InputSignal<NathMenuItem[]>;
|
|
569
582
|
direction: _angular_core.InputSignal<"left" | "right">;
|
|
570
583
|
flat: _angular_core.InputSignal<boolean>;
|
|
571
584
|
whenCommand: _angular_core.OutputEmitterRef<{
|
|
572
|
-
item:
|
|
585
|
+
item: NathMenuItem;
|
|
573
586
|
index?: number;
|
|
574
587
|
event?: Event;
|
|
575
588
|
}>;
|
|
576
589
|
private readonly submenuContainers;
|
|
577
|
-
protected readonly activeItem: _angular_core.WritableSignal<
|
|
590
|
+
protected readonly activeItem: _angular_core.WritableSignal<NathMenuItem | null>;
|
|
591
|
+
readonly focusedIndex: _angular_core.WritableSignal<number>;
|
|
578
592
|
protected readonly submenuTop: _angular_core.WritableSignal<number>;
|
|
579
593
|
protected readonly submenuLeft: _angular_core.WritableSignal<number>;
|
|
580
594
|
protected readonly nextSubmenuDirection: _angular_core.WritableSignal<"left" | "right">;
|
|
581
|
-
|
|
582
|
-
|
|
595
|
+
private readonly menuItemsElements;
|
|
596
|
+
ngAfterViewInit(): void;
|
|
597
|
+
protected getMenuLabel(item: NathMenuItem): string | SafeHtml;
|
|
598
|
+
protected onItemHover(item: NathMenuItem, event: Event): void;
|
|
583
599
|
private executeItem;
|
|
584
600
|
protected onItemClick(item: any, $index: number, $event: Event): void;
|
|
585
601
|
protected readonly isLucideIconComponent: typeof isLucideIconComponent;
|
|
602
|
+
protected onMouseLeave(event: MouseEvent): void;
|
|
603
|
+
private readonly debounce;
|
|
604
|
+
protected handleKeyDown: (...args: any) => void;
|
|
586
605
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NathMenuList, never>;
|
|
587
606
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NathMenuList, "nath-menu-list", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; }, { "whenCommand": "whenCommand"; }, never, never, true, never>;
|
|
588
607
|
}
|
|
589
608
|
|
|
609
|
+
declare class NathMenuBar implements AfterViewInit, OnDestroy {
|
|
610
|
+
private readonly document;
|
|
611
|
+
private readonly sanitizer;
|
|
612
|
+
private readonly destroyRef;
|
|
613
|
+
model: _angular_core.InputSignal<NathMenuItem[]>;
|
|
614
|
+
styleClass: _angular_core.InputSignal<string | null | undefined>;
|
|
615
|
+
whenCommand: _angular_core.OutputEmitterRef<{
|
|
616
|
+
item: NathMenuItem;
|
|
617
|
+
index?: number;
|
|
618
|
+
event?: Event;
|
|
619
|
+
}>;
|
|
620
|
+
menuBarElement: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
|
|
621
|
+
dropdownMenu: _angular_core.Signal<NathMenu | undefined>;
|
|
622
|
+
readonly isMobileMenuOpen: _angular_core.WritableSignal<boolean>;
|
|
623
|
+
readonly activeItem: _angular_core.WritableSignal<NathMenuItem | null>;
|
|
624
|
+
readonly activeItemIndex: _angular_core.WritableSignal<number>;
|
|
625
|
+
readonly focusedIndex: _angular_core.WritableSignal<number>;
|
|
626
|
+
private readonly menuItemsElements;
|
|
627
|
+
ngAfterViewInit(): void;
|
|
628
|
+
handleDocumentClick(event: MouseEvent): void;
|
|
629
|
+
handleItemClick(item: NathMenuItem, index: number, event: Event): void;
|
|
630
|
+
handleItemHover(item: NathMenuItem, index: number, event: MouseEvent): void;
|
|
631
|
+
toggleSubmenu(item: NathMenuItem, index: number, event: Event): void;
|
|
632
|
+
closeAllMenus(): void;
|
|
633
|
+
toggleMobileMenu(): void;
|
|
634
|
+
executeItem(item: NathMenuItem, index?: number, event?: Event): void;
|
|
635
|
+
handleKeyDown(event: KeyboardEvent): void;
|
|
636
|
+
handleSubmenuCommand(payload: {
|
|
637
|
+
item: NathMenuItem;
|
|
638
|
+
index?: number;
|
|
639
|
+
event?: Event;
|
|
640
|
+
}): void;
|
|
641
|
+
protected getMenuLabel(item: NathMenuItem): string | SafeHtml;
|
|
642
|
+
protected readonly isLucideIconComponent: typeof isLucideIconComponent;
|
|
643
|
+
ngOnDestroy(): void;
|
|
644
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NathMenuBar, never>;
|
|
645
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NathMenuBar, "nath-menu-bar", never, { "model": { "alias": "model"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, { "whenCommand": "whenCommand"; }, never, never, true, never>;
|
|
646
|
+
}
|
|
647
|
+
|
|
590
648
|
declare class NathMultiselect implements FormValueControl<any[]> {
|
|
591
649
|
protected readonly elementRef: ElementRef<any>;
|
|
592
650
|
private readonly uniqueId;
|
|
@@ -1041,7 +1099,7 @@ declare class NathSortIcon {
|
|
|
1041
1099
|
}
|
|
1042
1100
|
|
|
1043
1101
|
declare class NathSplitButton {
|
|
1044
|
-
menu: _angular_core.InputSignal<
|
|
1102
|
+
menu: _angular_core.InputSignal<NathMenuItem[]>;
|
|
1045
1103
|
buttonClass: _angular_core.InputSignal<string>;
|
|
1046
1104
|
disabled: _angular_core.InputSignal<boolean>;
|
|
1047
1105
|
positionX: _angular_core.InputSignal<NathMenuPositionX>;
|
|
@@ -1119,7 +1177,7 @@ declare class NathThemeSwitch {
|
|
|
1119
1177
|
darkText: _angular_core.InputSignal<string>;
|
|
1120
1178
|
systemText: _angular_core.InputSignal<string>;
|
|
1121
1179
|
switchTooltip: _angular_core.InputSignal<string>;
|
|
1122
|
-
themes:
|
|
1180
|
+
themes: NathMenuItem[];
|
|
1123
1181
|
protected readonly LucideMoon: typeof LucideMoon;
|
|
1124
1182
|
protected readonly LucideSun: typeof LucideSun;
|
|
1125
1183
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NathThemeSwitch, never>;
|
|
@@ -1233,7 +1291,7 @@ declare const validateAllFormFields: (formGroup: FormGroup) => void;
|
|
|
1233
1291
|
declare function hasRequiredValidator(control: AbstractControl | null): boolean;
|
|
1234
1292
|
declare function isRequired(fieldState: FieldState<any, any> | null): boolean;
|
|
1235
1293
|
|
|
1236
|
-
declare function
|
|
1294
|
+
declare function nextSibling(el: Element, selector?: string): Element | null;
|
|
1237
1295
|
|
|
1238
1296
|
declare const isTruthy: <T>(x: T | undefined | null) => x is T;
|
|
1239
1297
|
|
|
@@ -1243,5 +1301,5 @@ declare const rangeNotMinMax: (range: number[] | undefined, min: number | undefi
|
|
|
1243
1301
|
|
|
1244
1302
|
declare function isSortOrderValid(order: string): boolean;
|
|
1245
1303
|
|
|
1246
|
-
export {
|
|
1247
|
-
export type { BooleanDisplayMode, Breadcrumb, CodeFile,
|
|
1304
|
+
export { DARK_THEME_CLASS, DIALOG_DATA, NathAutocomplete, NathBooleanControl, NathBreadcrumbService, NathBreadcrumbs, NathCodeViewer, NathConfirmationDialog, NathConfirmationService, NathDatepicker, NathDialogContainer, NathDialogRef, NathDialogService, NathDrawer, NathFileUpload, NathFloatingLabel, NathFormField, NathImagePreview, NathMenu, NathMenuBar, NathMenuList, NathMultiselect, NathPaginatedView, NathPaginator, NathPanel, NathPickList, NathProgressBar, NathProgressCircle, NathRadioButtonGroup, NathRatingHeart, NathRatingInput, NathSelect, NathShowErrors, NathSkeleton, NathSlider, NathSortIcon, NathSplitButton, NathTabs, NathTag, NathThemeSwitch, NathToastContainer, NathToc, NathTooltipContainer, NathTooltipDirective, ORDER, RATING_MAP, THEME_CONFIG, TabDirective, TabPanelDirective, ThemeService, ToastService, getRatingColor, hasRequiredValidator, isRequired, isSortOrderValid, isTruthy, nextSibling, provideThemeConfig, rangeMinMax, rangeNotMinMax, validateAllFormFields };
|
|
1305
|
+
export type { BooleanDisplayMode, Breadcrumb, CodeFile, NathConfirmationButton, NathConfirmationConfig, NathDialogConfig, NathMenuItem, NathMenuPositionX, NathMenuPositionY, NathToastPosition, NathToastType, NathTooltipPosition, PaginatorChangeEvent, RadioOption, SelectItem, SliderValue, ThemeConfig, Toast, TrackByFnOrKey, TristateValue };
|