@corto-ai/gds-angular 2.2.1-dev.4 → 2.2.1-dev.6

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-dev.4",
4
- "devVersion": "4",
3
+ "version": "2.2.1-dev.6",
4
+ "devVersion": "6",
5
5
  "exports": {
6
6
  "./assets/*": "./assets/*",
7
7
  "./package.json": {
@@ -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>;
@@ -3128,6 +3161,7 @@ export declare class GdsInputAutocompleteDirective<T> implements OnInit {
3128
3161
  menu: import("@angular/core").InputSignal<TemplateRef<unknown>>;
3129
3162
  autocompleteOptions: import("@angular/core").InputSignal<T[]>;
3130
3163
  valueProp: import("@angular/core").InputSignal<keyof T | undefined>;
3164
+ autocompleteFilter: import("@angular/core").InputSignal<boolean>;
3131
3165
  autocompleteSelected: import("@angular/core").OutputEmitterRef<T>;
3132
3166
  ngOnInit(): void;
3133
3167
  selectedOption: import("@angular/core").Signal<T>;
@@ -3151,6 +3185,11 @@ export declare class GdsInputAutocompleteDirective<T> implements OnInit {
3151
3185
  "required": false;
3152
3186
  "isSignal": true;
3153
3187
  };
3188
+ "autocompleteFilter": {
3189
+ "alias": "autocompleteFilter";
3190
+ "required": false;
3191
+ "isSignal": true;
3192
+ };
3154
3193
  }, {
3155
3194
  "autocompleteSelected": "autocompleteSelected";
3156
3195
  }, never, never, true, [{