dasar-ui 2.5.1 → 2.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dasar-ui",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "UI component library for Angular",
5
5
  "author": "dxxta",
6
6
  "license": "MIT",
@@ -7,7 +7,7 @@ import { DasarListConfig as DasarListConfig$1, DasarListItemConfig as DasarListI
7
7
  import { DasarPaginationConfig as DasarPaginationConfig$1 } from "@components/dasar-pagination/dasar-pagination";
8
8
  import { DasarSwitchConfig as DasarSwitchConfig$1 } from "@components/dasar-switch/dasar-switch";
9
9
  import { DasarSkeletonConfig as DasarSkeletonConfig$1 } from "@components/dasar-skeleton/dasar-skeleton";
10
- import { DasarComponentConfig as DasarComponentConfig$1, DasarThemeAlert as DasarThemeAlert$1, DasarThemeButton as DasarThemeButton$1, DasarThemeButtonGroup as DasarThemeButtonGroup$1, DasarThemeCalendar as DasarThemeCalendar$1, DasarThemeCard as DasarThemeCard$1, DasarThemeCheckbox as DasarThemeCheckbox$1, DasarThemeChip as DasarThemeChip$1, DasarThemeCommon as DasarThemeCommon$1, DasarThemeConfig as DasarThemeConfig$1, DasarThemeDatepicker as DasarThemeDatepicker$1, DasarThemeDivider as DasarThemeDivider$1, DasarThemeDrawer as DasarThemeDrawer$1, DasarThemeInput as DasarThemeInput$1, DasarThemeMenu as DasarThemeMenu$1, DasarThemeModal as DasarThemeModal$1, DasarThemeMode as DasarThemeMode$1, DasarThemeOverlay as DasarThemeOverlay$1, DasarThemeRadio as DasarThemeRadio$1, DasarThemeSelect as DasarThemeSelect$1, DasarThemeSkeleton as DasarThemeSkeleton$1, DasarThemeSplit as DasarThemeSplit$1, DasarThemeTabs as DasarThemeTabs$1, DasarThemeTree as DasarThemeTree$1 } from "@models/theme.model";
10
+ import { DasarComponentConfig as DasarComponentConfig$1, DasarThemeAlert as DasarThemeAlert$1, DasarThemeButton as DasarThemeButton$1, DasarThemeButtonGroup as DasarThemeButtonGroup$1, DasarThemeCalendar as DasarThemeCalendar$1, DasarThemeCard as DasarThemeCard$1, DasarThemeCheckbox as DasarThemeCheckbox$1, DasarThemeChip as DasarThemeChip$1, DasarThemeCommon as DasarThemeCommon$1, DasarThemeConfig as DasarThemeConfig$1, DasarThemeDatepicker as DasarThemeDatepicker$1, DasarThemeDivider as DasarThemeDivider$1, DasarThemeDrawer as DasarThemeDrawer$1, DasarThemeInput as DasarThemeInput$1, DasarThemeMenu as DasarThemeMenu$1, DasarThemeModal as DasarThemeModal$1, DasarThemeMode as DasarThemeMode$1, DasarThemeOverlay as DasarThemeOverlay$1, DasarThemeRadio as DasarThemeRadio$1, DasarThemeSelect as DasarThemeSelect$1, DasarThemeSkeleton as DasarThemeSkeleton$1, DasarThemeSplit as DasarThemeSplit$1, DasarThemeTabs as DasarThemeTabs$1, DasarThemeToast as DasarThemeToast$1, DasarThemeTree as DasarThemeTree$1 } from "@models/theme.model";
11
11
  import { Observable } from "rxjs";
12
12
  type ClassType = string | string[] | Set<string> | {
13
13
  [klass: string]: any;
@@ -3229,6 +3229,10 @@ export declare class DasarAlertIconSlot {
3229
3229
  static ɵfac: i0.ɵɵFactoryDeclaration<DasarAlertIconSlot, never>;
3230
3230
  static ɵdir: i0.ɵɵDirectiveDeclaration<DasarAlertIconSlot, "[icon-slot]", never, {}, {}, never, never, true, never>;
3231
3231
  }
3232
+ export declare class DasarAlertCloseableSlot {
3233
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarAlertCloseableSlot, never>;
3234
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DasarAlertCloseableSlot, "[closeable-slot]", never, {}, {}, never, never, true, never>;
3235
+ }
3232
3236
  export declare class DasarAlert implements OnDestroy {
3233
3237
  private themeProvider;
3234
3238
  private themeService;
@@ -3255,6 +3259,7 @@ export declare class DasarAlert implements OnDestroy {
3255
3259
  onAfterLeave: EventEmitter<void>;
3256
3260
  headerSlot?: DasarAlertHeaderSlot;
3257
3261
  iconSlot?: DasarAlertIconSlot;
3262
+ closeableSlot?: DasarAlertCloseableSlot;
3258
3263
  get hostClasses(): string;
3259
3264
  get role(): string;
3260
3265
  get hasIcon(): boolean;
@@ -3329,12 +3334,12 @@ export declare class DasarAlert implements OnDestroy {
3329
3334
  "visibleChange": "visibleChange";
3330
3335
  "onClose": "onClose";
3331
3336
  "onAfterLeave": "onAfterLeave";
3332
- }, ["headerSlot", "iconSlot"], ["[icon-slot]", "[header-slot]", "*"], true, never>;
3337
+ }, ["headerSlot", "iconSlot", "closeableSlot"], ["[icon-slot]", "[header-slot]", "*", "[closeable-slot]"], true, never>;
3333
3338
  static ngAcceptInputType_bordered: unknown;
3334
3339
  static ngAcceptInputType_closeable: unknown;
3335
3340
  static ngAcceptInputType_visible: unknown;
3336
3341
  }
3337
- export declare const DasarAlertComponent: readonly [typeof DasarAlert, typeof DasarAlertHeaderSlot, typeof DasarAlertIconSlot];
3342
+ export declare const DasarAlertComponent: readonly [typeof DasarAlert, typeof DasarAlertHeaderSlot, typeof DasarAlertIconSlot, typeof DasarAlertCloseableSlot];
3338
3343
  export type DasarCheckboxSizeType = Extract<ScaleAttributeType$1, 'sm' | 'md' | 'lg'>;
3339
3344
  export interface DasarCheckboxGroupState {
3340
3345
  checked: boolean;
@@ -4909,6 +4914,54 @@ export declare class DasarSplit implements OnDestroy {
4909
4914
  static ngAcceptInputType_disabled: unknown;
4910
4915
  }
4911
4916
  export declare const DasarSplitComponent: readonly [typeof DasarSplit];
4917
+ export type DasarToastVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
4918
+ export type DasarToastPlacement = 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right';
4919
+ export type DasarToastCloseReason = 'button' | 'timeout' | 'destroy';
4920
+ export type DasarToastState = 'entering' | 'visible' | 'leaving';
4921
+ export interface DasarToastRef {
4922
+ readonly id: number;
4923
+ close(): void;
4924
+ update(options: Partial<DasarToastOptions>): void;
4925
+ }
4926
+ export interface DasarToastContext {
4927
+ $implicit: DasarToastItem;
4928
+ toast: DasarToastItem;
4929
+ close: () => void;
4930
+ }
4931
+ export interface DasarToastOptions {
4932
+ label?: string;
4933
+ caption?: string;
4934
+ description?: string;
4935
+ content?: string | TemplateRef<DasarToastContext>;
4936
+ duration?: number;
4937
+ closeable?: boolean;
4938
+ icon?: string;
4939
+ to?: string;
4940
+ variant?: DasarToastVariant;
4941
+ aliveOnHover?: boolean;
4942
+ onEnter?: (ref: DasarToastRef) => void;
4943
+ onClose?: (ref: DasarToastRef, reason: DasarToastCloseReason) => void;
4944
+ onLeave?: (ref: DasarToastRef) => void;
4945
+ }
4946
+ export interface DasarToastItem {
4947
+ id: number;
4948
+ options: DasarToastOptions;
4949
+ state: DasarToastState;
4950
+ ref: DasarToastRef;
4951
+ }
4952
+ export interface DasarToastConfig {
4953
+ duration?: number;
4954
+ closeable?: boolean;
4955
+ variant?: DasarToastVariant;
4956
+ aliveOnHover?: boolean;
4957
+ closeIconName?: string;
4958
+ max?: number;
4959
+ placement?: DasarToastPlacement;
4960
+ scrollable?: boolean;
4961
+ blur?: string;
4962
+ containerClass?: ClassType;
4963
+ containerStyle?: StyleType;
4964
+ }
4912
4965
  type DasarTreeKey = string | number;
4913
4966
  type DasarTreeDropPosition = 'before' | 'inside' | 'after';
4914
4967
  type DasarTreeCheckState = 'checked' | 'unchecked' | 'indeterminate';
@@ -6210,6 +6263,32 @@ export interface DasarThemeSplit {
6210
6263
  barActiveColor?: string;
6211
6264
  gripColor?: string;
6212
6265
  }
6266
+ export interface DasarThemeToast {
6267
+ background?: string;
6268
+ color?: string;
6269
+ captionColor?: string;
6270
+ border?: string;
6271
+ shadow?: string;
6272
+ radius?: string;
6273
+ padding?: string;
6274
+ gap?: string;
6275
+ stackGap?: string;
6276
+ scrollPadding?: string;
6277
+ iconSize?: string;
6278
+ width?: string;
6279
+ gutter?: string;
6280
+ zIndex?: string;
6281
+ fontSize?: string;
6282
+ labelFontSize?: string;
6283
+ animationDuration?: string;
6284
+ enterOffset?: string;
6285
+ blur?: string;
6286
+ primaryAccent?: string;
6287
+ secondaryAccent?: string;
6288
+ successAccent?: string;
6289
+ warningAccent?: string;
6290
+ dangerAccent?: string;
6291
+ }
6213
6292
  export interface DasarThemeModal {
6214
6293
  background?: string;
6215
6294
  bodyColor?: string;
@@ -6273,6 +6352,7 @@ export type DasarComponentConfig = {
6273
6352
  drawer?: DasarDrawerConfig;
6274
6353
  tree?: DasarTreeConfig;
6275
6354
  split?: DasarSplitConfig;
6355
+ toast?: DasarToastConfig;
6276
6356
  overlay?: DasarOverlayConfig;
6277
6357
  icon?: DasarIconConfig;
6278
6358
  menu?: DasarMenuConfig;
@@ -6316,6 +6396,7 @@ export interface DasarThemeConfig {
6316
6396
  drawer?: DasarThemeDrawer;
6317
6397
  tree?: DasarThemeTree;
6318
6398
  split?: DasarThemeSplit;
6399
+ toast?: DasarThemeToast;
6319
6400
  };
6320
6401
  dark?: {
6321
6402
  common?: DasarThemeCommon;
@@ -6343,6 +6424,7 @@ export interface DasarThemeConfig {
6343
6424
  drawer?: DasarThemeDrawer;
6344
6425
  tree?: DasarThemeTree;
6345
6426
  split?: DasarThemeSplit;
6427
+ toast?: DasarThemeToast;
6346
6428
  };
6347
6429
  };
6348
6430
  }
@@ -6449,6 +6531,167 @@ export declare class DasarBreakpoint {
6449
6531
  }, never, ["*"], true, never>;
6450
6532
  }
6451
6533
  export declare const DasarBreakpointComponent: readonly [typeof DasarBreakpoint];
6534
+ export declare class DasarToastService {
6535
+ private nextId;
6536
+ readonly items: import("@angular/core").WritableSignal<DasarToastItem[]>;
6537
+ readonly max: import("@angular/core").WritableSignal<number>;
6538
+ create(options: DasarToastOptions): DasarToastRef;
6539
+ update(target: DasarToastRef | number, patch: Partial<DasarToastOptions>): void;
6540
+ destroy(target: DasarToastRef | number): void;
6541
+ destroyEverything(): void;
6542
+ isRendered(id: number): boolean;
6543
+ close(id: number, reason: DasarToastCloseReason): void;
6544
+ entered(id: number): void;
6545
+ remove(id: number): void;
6546
+ private setState;
6547
+ private find;
6548
+ private idOf;
6549
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarToastService, never>;
6550
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
6551
+ }
6552
+ export declare const DASAR_TOAST_NAVIGATOR: InjectionToken<(to: string) => void>;
6553
+ export declare class DasarToast implements OnInit, OnChanges, OnDestroy {
6554
+ private themeProvider;
6555
+ private themeService;
6556
+ private service;
6557
+ private navigator;
6558
+ private platformId;
6559
+ private timer;
6560
+ private enterTimer;
6561
+ private leaveTimer;
6562
+ private readonly defaultDuration;
6563
+ private readonly defaultCloseable;
6564
+ private readonly defaultVariant;
6565
+ private readonly defaultAliveOnHover;
6566
+ protected readonly closeIconName: string;
6567
+ item: DasarToastItem;
6568
+ index: number;
6569
+ labelSlot?: TemplateRef<DasarToastContext>;
6570
+ captionSlot?: TemplateRef<DasarToastContext>;
6571
+ contentSlot?: TemplateRef<DasarToastContext>;
6572
+ closeSlot?: TemplateRef<DasarToastContext>;
6573
+ entered: EventEmitter<number>;
6574
+ protected get duration(): number;
6575
+ protected get closeable(): boolean;
6576
+ protected get variant(): DasarToastVariant;
6577
+ protected get aliveOnHover(): boolean;
6578
+ protected get role(): string;
6579
+ protected get stringContent(): string | null;
6580
+ protected get templateContent(): TemplateRef<DasarToastContext> | null;
6581
+ protected get context(): DasarToastContext;
6582
+ ngOnInit(): void;
6583
+ ngOnChanges(changes: SimpleChanges): void;
6584
+ ngOnDestroy(): void;
6585
+ protected pause(): void;
6586
+ protected resume(): void;
6587
+ protected closeByButton(): void;
6588
+ protected onKeydown(event: KeyboardEvent): void;
6589
+ protected onAnimationEnd(event: AnimationEvent): void;
6590
+ protected onLinkClick(event: MouseEvent): void;
6591
+ private markEntered;
6592
+ private finishLeave;
6593
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarToast, never>;
6594
+ static ɵcmp: i0.ɵɵComponentDeclaration<DasarToast, "dasar-toast", never, {
6595
+ "item": {
6596
+ "alias": "item";
6597
+ "required": true;
6598
+ };
6599
+ "index": {
6600
+ "alias": "index";
6601
+ "required": false;
6602
+ };
6603
+ "labelSlot": {
6604
+ "alias": "labelSlot";
6605
+ "required": false;
6606
+ };
6607
+ "captionSlot": {
6608
+ "alias": "captionSlot";
6609
+ "required": false;
6610
+ };
6611
+ "contentSlot": {
6612
+ "alias": "contentSlot";
6613
+ "required": false;
6614
+ };
6615
+ "closeSlot": {
6616
+ "alias": "closeSlot";
6617
+ "required": false;
6618
+ };
6619
+ }, {
6620
+ "entered": "entered";
6621
+ }, never, never, true, never>;
6622
+ }
6623
+ export declare class DasarToastLabelSlot {
6624
+ readonly templateRef: TemplateRef<any>;
6625
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarToastLabelSlot, never>;
6626
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DasarToastLabelSlot, "ng-template[label-slot]", never, {}, {}, never, never, true, never>;
6627
+ }
6628
+ export declare class DasarToastCaptionSlot {
6629
+ readonly templateRef: TemplateRef<any>;
6630
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarToastCaptionSlot, never>;
6631
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DasarToastCaptionSlot, "ng-template[caption-slot]", never, {}, {}, never, never, true, never>;
6632
+ }
6633
+ export declare class DasarToastContentSlot {
6634
+ readonly templateRef: TemplateRef<any>;
6635
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarToastContentSlot, never>;
6636
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DasarToastContentSlot, "ng-template[content-slot]", never, {}, {}, never, never, true, never>;
6637
+ }
6638
+ export declare class DasarToastCloseableSlot {
6639
+ readonly templateRef: TemplateRef<any>;
6640
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarToastCloseableSlot, never>;
6641
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DasarToastCloseableSlot, "ng-template[closeable-slot], ng-template[closable-slot]", never, {}, {}, never, never, true, never>;
6642
+ }
6643
+ export declare class DasarToastProvider {
6644
+ private themeProvider;
6645
+ private themeService;
6646
+ protected readonly service: DasarToastService;
6647
+ private _max;
6648
+ protected readonly expanded: import("@angular/core").WritableSignal<boolean>;
6649
+ labelSlot?: DasarToastLabelSlot;
6650
+ captionSlot?: DasarToastCaptionSlot;
6651
+ contentSlot?: DasarToastContentSlot;
6652
+ closeableSlot?: DasarToastCloseableSlot;
6653
+ set max(value: number);
6654
+ get max(): number;
6655
+ placement: NonNullable<DasarToastPlacement | undefined>;
6656
+ scrollable: NonNullable<boolean | undefined>;
6657
+ blur: string | null;
6658
+ containerClass: NonNullable<ClassType> | null | undefined;
6659
+ containerStyle: NonNullable<StyleType | undefined> | null;
6660
+ protected readonly visibleItems: import("@angular/core").Signal<import("dasar-ui").DasarToastItem[]>;
6661
+ protected readonly renderItems: import("@angular/core").Signal<import("dasar-ui").DasarToastItem[]>;
6662
+ constructor();
6663
+ protected get isTop(): boolean;
6664
+ protected get containerClasses(): Record<string, boolean>;
6665
+ static ɵfac: i0.ɵɵFactoryDeclaration<DasarToastProvider, never>;
6666
+ static ɵcmp: i0.ɵɵComponentDeclaration<DasarToastProvider, "dasar-toast-provider", never, {
6667
+ "max": {
6668
+ "alias": "max";
6669
+ "required": false;
6670
+ };
6671
+ "placement": {
6672
+ "alias": "placement";
6673
+ "required": false;
6674
+ };
6675
+ "scrollable": {
6676
+ "alias": "scrollable";
6677
+ "required": false;
6678
+ };
6679
+ "blur": {
6680
+ "alias": "blur";
6681
+ "required": false;
6682
+ };
6683
+ "containerClass": {
6684
+ "alias": "container-class";
6685
+ "required": false;
6686
+ };
6687
+ "containerStyle": {
6688
+ "alias": "container-style";
6689
+ "required": false;
6690
+ };
6691
+ }, {}, ["labelSlot", "captionSlot", "contentSlot", "closeableSlot"], ["*"], true, never>;
6692
+ static ngAcceptInputType_scrollable: unknown;
6693
+ }
6694
+ export declare const DasarToastComponent: readonly [typeof DasarToastProvider, typeof DasarToastLabelSlot, typeof DasarToastCaptionSlot, typeof DasarToastContentSlot, typeof DasarToastCloseableSlot];
6452
6695
  export declare const DASAR_THEME_PROVIDER: InjectionToken<DasarThemeProviderComponent>;
6453
6696
  export declare const defaultLightCommonTokens: DasarThemeCommon$1;
6454
6697
  export declare const defaultDarkCommonTokens: DasarThemeCommon$1;
@@ -6515,6 +6758,7 @@ export declare const skeletonMap: Record<keyof DasarThemeSkeleton$1, string>;
6515
6758
  export declare const tabsMap: Record<keyof DasarThemeTabs$1, string>;
6516
6759
  export declare const overlayMap: Record<keyof DasarThemeOverlay$1, string>;
6517
6760
  export declare const treeMap: Record<keyof DasarThemeTree$1, string>;
6761
+ export declare const toastMap: Record<keyof DasarThemeToast$1, string>;
6518
6762
  export declare const splitMap: Record<keyof DasarThemeSplit$1, string>;
6519
6763
  export declare const drawerMap: Record<keyof DasarThemeDrawer$1, string>;
6520
6764
  export declare const modalMap: Record<keyof DasarThemeModal$1, string>;