@corto-ai/gds-angular 2.2.1-dev.4 → 2.2.1-dev.5
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
|
@@ -687,30 +687,63 @@ export declare class GdsDialogComponent {
|
|
|
687
687
|
outputs: {};
|
|
688
688
|
}]>;
|
|
689
689
|
}
|
|
690
|
-
interface
|
|
690
|
+
interface GdsDialogConfig<T = unknown> {
|
|
691
691
|
data?: T;
|
|
692
692
|
}
|
|
693
|
-
|
|
693
|
+
/**
|
|
694
|
+
* Type-only declaration of the members added by the {@link GdsDialog} mixin.
|
|
695
|
+
* TypeScript doesn't allow mixin classes to be generic, or emit their `protected` members to declaration files,
|
|
696
|
+
* so this provides that typing instead. Keep it in sync with `GdsDialogMixinDirective`.
|
|
697
|
+
*/
|
|
698
|
+
declare class GdsDialogMixin<TData, TOutput> {
|
|
694
699
|
protected closedSub: Subject<TOutput>;
|
|
695
|
-
protected config:
|
|
696
|
-
dialog:
|
|
697
|
-
isAnimated:
|
|
700
|
+
protected config: GdsDialogConfig<TData>;
|
|
701
|
+
dialog: Signal<GdsDialogComponent>;
|
|
702
|
+
isAnimated: Signal<boolean>;
|
|
698
703
|
get closed$(): Observable<TOutput>;
|
|
699
|
-
ngOnInit(): void;
|
|
700
704
|
show(): void;
|
|
701
705
|
hide(result: TOutput): void;
|
|
702
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<GdsDialogBaseDirective<any, any>, never>;
|
|
703
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<GdsDialogBaseDirective<any, any>, never, never, {}, {}, never, never, true, never>;
|
|
704
706
|
}
|
|
705
707
|
export declare class GdsDialogService {
|
|
706
708
|
#private;
|
|
707
|
-
open: <TData = void, TOutput = void>(component: Type<
|
|
709
|
+
open: <TData = void, TOutput = void>(component: Type<GdsDialogMixin<TData, TOutput>>, data?: TData, id?: string) => Observable<TOutput>;
|
|
708
710
|
close: (id: string) => boolean;
|
|
709
711
|
closeAll: () => void;
|
|
710
712
|
isOpen: (id: string) => boolean;
|
|
711
713
|
static ɵfac: i0.ɵɵFactoryDeclaration<GdsDialogService, never>;
|
|
712
714
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
713
715
|
}
|
|
716
|
+
type GdsConstructor<T = object> = new (...args: any[]) => T;
|
|
717
|
+
type GdsMixinTypeCheck<T> = GdsConstructor<Pick<T, keyof T>>;
|
|
718
|
+
declare const GdsDialogBaseDirective_base: Pick<GdsConstructor, never> & GdsConstructor<object> & (new <TData_1 = void, TOutput_1 = void>(...args: unknown[]) => GdsDialogMixin<TData_1, TOutput_1> & import("@angular/core").OnInit);
|
|
719
|
+
/** @deprecated CRT-12719 -- use the `GdsDialog` class mixin directly instead. Kept around for backwards compatibility */
|
|
720
|
+
export declare class GdsDialogBaseDirective<TData = void, TOutput = void> extends GdsDialogBaseDirective_base<TData, TOutput> {
|
|
721
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GdsDialogBaseDirective<any, any>, never>;
|
|
722
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GdsDialogBaseDirective<any, any>, never, never, {}, {}, never, never, true, never>;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Class returned by the {@link GdsDialog} mixin. Keeps the static and instance members of `TBase`,
|
|
726
|
+
* and adds the {@link GdsDialogMixin} members with their `TData`/`TOutput` type arguments.
|
|
727
|
+
* Basically, this is just a hack so that the end result of the {@link GdsDialog} mixin has the correct typing
|
|
728
|
+
* on the generic properties that are added by the mixin.
|
|
729
|
+
*/
|
|
730
|
+
type GdsDialogMixinConstructor<TBase extends GdsConstructor> = Pick<TBase, keyof TBase> & GdsConstructor<InstanceType<TBase>> & (new <TData = void, TOutput = void>(...args: unknown[]) => GdsDialogMixin<TData, TOutput> & OnInit);
|
|
731
|
+
/**
|
|
732
|
+
* This function returns a class that extends `Base` (or an empty class if `Base` is not provided)
|
|
733
|
+
* and adds GDS dialog behaviour. The idea here is that we can use it to replace the old `GdsDialogBaseDirective`.
|
|
734
|
+
* so that we can easily share logic between a view page and the modal version, such as the document preview
|
|
735
|
+
*
|
|
736
|
+
* This class has a lot of `unknown` types because class mixins don't support generics.
|
|
737
|
+
* However, there is another {@link GdsDialogMixin} class which this gets typed as, providing the correct
|
|
738
|
+
* strong typings when used in your dialog component.
|
|
739
|
+
*
|
|
740
|
+
* However, that {@link GdsDialogMixin} class needs to be kept in sync with the class returned by this function
|
|
741
|
+
* so be sure that you update both if you make changes to the dialog properties.
|
|
742
|
+
*
|
|
743
|
+
* @example
|
|
744
|
+
* export class MyDialogComponent extends GdsDialog(MyBaseComponent)<MyDataVM, MyResultVM> {}
|
|
745
|
+
*/
|
|
746
|
+
export declare const GdsDialog: <TBase extends GdsConstructor>(Base?: TBase) => GdsDialogMixinConstructor<TBase>;
|
|
714
747
|
export declare class GdsDocumentItemComponent {
|
|
715
748
|
name: import("@angular/core").InputSignal<string>;
|
|
716
749
|
subtitle: import("@angular/core").InputSignal<string | undefined>;
|