@corto-ai/gds-angular 2.2.1-test.1 → 2.2.1-test.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@corto-ai/gds-angular",
3
- "version": "2.2.1-test.1",
4
- "devVersion": "1",
3
+ "version": "2.2.1-test.5",
4
+ "devVersion": "5",
5
5
  "exports": {
6
6
  "./assets/*": "./assets/*",
7
7
  "./package.json": {
@@ -561,7 +561,7 @@ export declare class GdsContextMenuItemComponent extends GdsContextMenuBaseDirec
561
561
  "required": false;
562
562
  "isSignal": true;
563
563
  };
564
- }, {}, never, ["[label]"], true, [{
564
+ }, {}, never, ["[leading-visual]", "[label]"], true, [{
565
565
  directive: typeof i1$3.CdkMenuItem;
566
566
  inputs: {};
567
567
  outputs: {
@@ -580,7 +580,7 @@ export declare class GdsContextMenuItemComponent extends GdsContextMenuBaseDirec
580
580
  export declare class GdsContextMenuHeadingComponent extends GdsContextMenuBaseDirective {
581
581
  variant: import("@angular/core").Signal<"switch" | "default" | "radio" | "check" | "indent" | "double-indent" | "heading">;
582
582
  static ɵfac: i0.ɵɵFactoryDeclaration<GdsContextMenuHeadingComponent, never>;
583
- static ɵcmp: i0.ɵɵComponentDeclaration<GdsContextMenuHeadingComponent, "gds-context-menu-heading", never, {}, {}, never, ["[label]"], true, never>;
583
+ static ɵcmp: i0.ɵɵComponentDeclaration<GdsContextMenuHeadingComponent, "gds-context-menu-heading", never, {}, {}, never, ["[leading-visual]", "[label]"], true, never>;
584
584
  }
585
585
  export declare class GdsContextMenuSwitchComponent extends GdsContextMenuBaseDirective implements OnInit {
586
586
  #private;
@@ -603,7 +603,7 @@ export declare class GdsContextMenuSwitchComponent extends GdsContextMenuBaseDir
603
603
  }, {
604
604
  "selected": "selectedChange";
605
605
  "triggered": "triggeredChange";
606
- }, never, ["[label]"], true, [{
606
+ }, never, ["[leading-visual]", "[label]"], true, [{
607
607
  directive: typeof i1$3.CdkMenuItemCheckbox;
608
608
  inputs: {
609
609
  "cdkMenuItemChecked": "selected";
@@ -687,30 +687,63 @@ export declare class GdsDialogComponent {
687
687
  outputs: {};
688
688
  }]>;
689
689
  }
690
- interface GdsDialog<T = unknown> {
690
+ interface GdsDialogConfig<T = unknown> {
691
691
  data?: T;
692
692
  }
693
- export declare abstract class GdsDialogBaseDirective<TData = void, TOutput = void> implements OnInit {
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: GdsDialog<TData>;
696
- dialog: import("@angular/core").Signal<GdsDialogComponent>;
697
- isAnimated: import("@angular/core").Signal<boolean>;
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<GdsDialogBaseDirective<TData, TOutput>>, data?: TData, id?: string) => Observable<TOutput>;
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>;