@recursyve/nice-ui-kit.v2 15.0.0-beta.119 → 15.0.0-beta.121

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.
Files changed (54) hide show
  1. package/esm2020/lib/components/assets-carousel/assets-carousel.component.mjs +48 -25
  2. package/esm2020/lib/components/date-range-picker/date-range-picker.component.mjs +33 -12
  3. package/esm2020/lib/components/export-bottom-sheet/export-bottom-sheet.component.mjs +3 -3
  4. package/esm2020/lib/components/loading-toast/index.mjs +2 -0
  5. package/esm2020/lib/components/loading-toast/loading-toast.component.mjs +38 -0
  6. package/esm2020/lib/components/loading-toast/loading-toast.constant.mjs +3 -0
  7. package/esm2020/lib/components/loading-toast/loading-toast.directive.mjs +64 -0
  8. package/esm2020/lib/components/loading-toast/loading-toast.module.mjs +62 -0
  9. package/esm2020/lib/components/loading-toast/loading-toast.service.mjs +47 -0
  10. package/esm2020/lib/components/loading-toast/public-api.mjs +6 -0
  11. package/esm2020/lib/components/loading-toast/rxjs/show-loading-toast.operator.mjs +12 -0
  12. package/esm2020/lib/components/public-api.mjs +2 -1
  13. package/esm2020/lib/components/toast/public-api.mjs +3 -1
  14. package/esm2020/lib/components/toast/rxjs/show-success-or-error-toast.operator.mjs +22 -0
  15. package/esm2020/lib/components/toast/rxjs/show-toast.operator.mjs +22 -0
  16. package/esm2020/lib/components/translation-form/components/textarea/translation-form-textarea.component.mjs +4 -3
  17. package/esm2020/lib/components/translation-form/components/textfield/translation-form-textfield.component.mjs +4 -3
  18. package/esm2020/lib/components/translation-form/components/translation-form.component.mjs +8 -7
  19. package/esm2020/lib/components/translation-form/decorators/translation-form-group.decorator.mjs +4 -0
  20. package/esm2020/lib/components/translation-form/directives/translation-context.directive.mjs +11 -5
  21. package/esm2020/lib/components/translation-form/providers/nice-translation-form.service.mjs +59 -0
  22. package/esm2020/lib/components/translation-form/public-api.mjs +7 -7
  23. package/esm2020/lib/components/translation-form/toggle/translation-toggle.component.mjs +5 -5
  24. package/esm2020/lib/components/translation-form/validators/require-for-languages.validator.mjs +22 -21
  25. package/fesm2015/recursyve-nice-ui-kit.v2.mjs +512 -208
  26. package/fesm2015/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  27. package/fesm2020/recursyve-nice-ui-kit.v2.mjs +504 -208
  28. package/fesm2020/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  29. package/lib/components/assets-carousel/assets-carousel.component.d.ts +8 -4
  30. package/lib/components/date-range-picker/date-range-picker.component.d.ts +1 -2
  31. package/lib/components/loading-toast/index.d.ts +1 -0
  32. package/lib/components/loading-toast/loading-toast.component.d.ts +19 -0
  33. package/lib/components/loading-toast/loading-toast.constant.d.ts +2 -0
  34. package/lib/components/loading-toast/loading-toast.directive.d.ts +18 -0
  35. package/lib/components/loading-toast/loading-toast.module.d.ts +16 -0
  36. package/lib/components/loading-toast/loading-toast.service.d.ts +20 -0
  37. package/lib/components/loading-toast/public-api.d.ts +5 -0
  38. package/lib/components/loading-toast/rxjs/show-loading-toast.operator.d.ts +6 -0
  39. package/lib/components/public-api.d.ts +1 -0
  40. package/lib/components/toast/public-api.d.ts +2 -0
  41. package/lib/components/toast/rxjs/show-success-or-error-toast.operator.d.ts +37 -0
  42. package/lib/components/toast/rxjs/show-toast.operator.d.ts +17 -0
  43. package/lib/components/translation-form/components/translation-form.component.d.ts +2 -2
  44. package/lib/components/translation-form/decorators/translation-form-group.decorator.d.ts +1 -0
  45. package/lib/components/translation-form/directives/translation-context.directive.d.ts +3 -2
  46. package/lib/components/translation-form/providers/nice-translation-form.service.d.ts +16 -0
  47. package/lib/components/translation-form/public-api.d.ts +6 -6
  48. package/lib/components/translation-form/toggle/translation-toggle.component.d.ts +3 -3
  49. package/lib/components/translation-form/validators/require-for-languages.validator.d.ts +3 -3
  50. package/package.json +1 -1
  51. package/esm2020/lib/components/translation-form/decorators/translation-form.decorator.mjs +0 -4
  52. package/esm2020/lib/components/translation-form/providers/translation-form.service.mjs +0 -46
  53. package/lib/components/translation-form/decorators/translation-form.decorator.d.ts +0 -1
  54. package/lib/components/translation-form/providers/translation-form.service.d.ts +0 -12
@@ -1,4 +1,4 @@
1
- import { ElementRef, EventEmitter, QueryList, TemplateRef } from "@angular/core";
1
+ import { ElementRef, EventEmitter, OnChanges, OnInit, QueryList, SimpleChanges, TemplateRef } from "@angular/core";
2
2
  import { ControlValueAccessor } from "@angular/forms";
3
3
  import { CanColor, ThemePalette } from "@angular/material/core";
4
4
  import * as i0 from "@angular/core";
@@ -32,7 +32,7 @@ export interface NiceAssetsCarouselOptions {
32
32
  rightArrow?: NiceAssetsCarouselActionIcon;
33
33
  upload?: NiceAssetsCarouselActionIcon;
34
34
  }
35
- export declare class NiceAssetsCarouselComponent implements ControlValueAccessor, CanColor {
35
+ export declare class NiceAssetsCarouselComponent implements OnInit, OnChanges, ControlValueAccessor, CanColor {
36
36
  readonly options: NiceAssetsCarouselOptions;
37
37
  _activeTranslationPosition: number;
38
38
  _active: number;
@@ -49,7 +49,7 @@ export declare class NiceAssetsCarouselComponent implements ControlValueAccessor
49
49
  loading: boolean;
50
50
  accept: string[];
51
51
  customActions: NiceAssetsCarouselActions[];
52
- imagesProcessor: (fileList: FileList) => Promise<FileList>;
52
+ imagesProcessor: (files: File[]) => Promise<File[]>;
53
53
  multipleUpload: boolean;
54
54
  visiblePreviewAsset: number;
55
55
  showAddAssetContainer: boolean;
@@ -60,6 +60,7 @@ export declare class NiceAssetsCarouselComponent implements ControlValueAccessor
60
60
  transform: string;
61
61
  };
62
62
  showOverlay: boolean;
63
+ private _imagesMimeTypes;
63
64
  private propagate;
64
65
  set activeVideoElement(activeVideoElement: ElementRef<HTMLVideoElement>);
65
66
  set assetsElement(assetsElement: QueryList<ElementRef<HTMLDivElement>>);
@@ -67,6 +68,8 @@ export declare class NiceAssetsCarouselComponent implements ControlValueAccessor
67
68
  private set activeTranslationPosition(value);
68
69
  private set activeAsset(value);
69
70
  constructor(options: NiceAssetsCarouselOptions);
71
+ ngOnInit(): void;
72
+ ngOnChanges(changes: SimpleChanges): void;
70
73
  writeValue(assets: NiceAssets[]): void;
71
74
  registerOnChange(fn: (assets: NiceAssets[]) => void): void;
72
75
  registerOnTouched(fn: (assets: NiceAssets[]) => void): void;
@@ -74,10 +77,11 @@ export declare class NiceAssetsCarouselComponent implements ControlValueAccessor
74
77
  clickRight(): void;
75
78
  clickAsset(index: number): void;
76
79
  onFilesChange(event: Event): Promise<void>;
77
- onFilesDrop(files: FileList): Promise<void>;
80
+ onFilesDrop(fileList: FileList): Promise<void>;
78
81
  clickRemove(): void;
79
82
  clickCustom(action: NiceAssetsCarouselActions): void;
80
83
  startSyncVideo(): Promise<void>;
84
+ private filterOutUnsupportedFiles;
81
85
  private getProcessedFiles;
82
86
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceAssetsCarouselComponent, [{ optional: true; }]>;
83
87
  static ɵcmp: i0.ɵɵComponentDeclaration<NiceAssetsCarouselComponent, "nice-assets-carousel", never, { "color": "color"; "edit": "edit"; "loading": "loading"; "accept": "accept"; "customActions": "customActions"; "imagesProcessor": "imagesProcessor"; "multipleUpload": "multipleUpload"; "visiblePreviewAsset": "visiblePreviewAsset"; "showAddAssetContainer": "showAddAssetContainer"; "assets": "assets"; }, { "activeChange": "activeChange"; "removedAsset": "removedAsset"; }, ["activeContent"], never, false, never>;
@@ -8,7 +8,6 @@ export interface NiceDateRangePickerValue {
8
8
  }
9
9
  export declare class NiceDateRangePickerComponent implements OnInit, ControlValueAccessor {
10
10
  readonly HeaderComponent: typeof HeaderComponent;
11
- private picker;
12
11
  min: Date;
13
12
  max: Date;
14
13
  nowIsMax: boolean;
@@ -19,7 +18,7 @@ export declare class NiceDateRangePickerComponent implements OnInit, ControlValu
19
18
  }>;
20
19
  now: Date;
21
20
  value: NiceDateRangePickerValue;
22
- private propage;
21
+ private propagate;
23
22
  ngOnInit(): void;
24
23
  writeValue(value: NiceDateRangePickerValue): void;
25
24
  registerOnChange(fn: (value: NiceDateRangePickerValue) => void): void;
@@ -0,0 +1 @@
1
+ export * from "./public-api";
@@ -0,0 +1,19 @@
1
+ import { NiceAlertAppearance, NiceAlertColor, NiceAlertType } from "../alert";
2
+ import { NiceLoadingToastOptions } from "./loading-toast.service";
3
+ import * as i0 from "@angular/core";
4
+ export interface NiceLoadingToastData {
5
+ message: string;
6
+ options?: NiceLoadingToastOptions;
7
+ }
8
+ export declare class NiceLoadingToastComponent {
9
+ data?: NiceLoadingToastData;
10
+ message: string;
11
+ options: NiceLoadingToastOptions;
12
+ get appearance(): NiceAlertAppearance;
13
+ get color(): NiceAlertColor;
14
+ get showIcon(): boolean;
15
+ get type(): NiceAlertType;
16
+ constructor(data?: NiceLoadingToastData);
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastComponent, [{ optional: true; }]>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceLoadingToastComponent, "nice-loading-toast", never, { "message": "message"; "options": "options"; }, {}, never, never, false, never>;
19
+ }
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ export declare const NICE_LOADING_TOAST_OPTIONS: InjectionToken<unknown>;
@@ -0,0 +1,18 @@
1
+ import { BooleanInput } from "@angular/cdk/coercion";
2
+ import { Overlay } from "@angular/cdk/overlay";
3
+ import { NiceLoadingToastOptions } from "./loading-toast.service";
4
+ import * as i0 from "@angular/core";
5
+ export declare class NiceLoadingToastDirective {
6
+ private options;
7
+ private overlay;
8
+ static ngAcceptInputType_niceLoadingDisableUserInteraction: BooleanInput;
9
+ private overlayRef;
10
+ private _loading;
11
+ private _niceLoadingDisableUserInteraction;
12
+ niceLoadingMessage: string;
13
+ set niceLoadingDisableUserInteraction(disableUserInteraction: boolean);
14
+ set loading(loading: boolean | null);
15
+ constructor(options: NiceLoadingToastOptions, overlay: Overlay);
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastDirective, [{ optional: true; }, null]>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NiceLoadingToastDirective, "[niceLoadingToast]", never, { "niceLoadingMessage": "niceLoadingMessage"; "niceLoadingDisableUserInteraction": "niceLoadingDisableUserInteraction"; "loading": "niceLoadingToast"; }, {}, never, never, false, never>;
18
+ }
@@ -0,0 +1,16 @@
1
+ import { ModuleWithProviders } from "@angular/core";
2
+ import { NiceLoadingToastOptions } from "./loading-toast.service";
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./loading-toast.component";
5
+ import * as i2 from "./loading-toast.directive";
6
+ import * as i3 from "@angular/common";
7
+ import * as i4 from "@angular/material/snack-bar";
8
+ import * as i5 from "@angular/material/progress-spinner";
9
+ import * as i6 from "../alert/alert.module";
10
+ export declare class NiceLoadingToastModule {
11
+ static forRoot(options?: NiceLoadingToastOptions): ModuleWithProviders<NiceLoadingToastModule>;
12
+ static forFeature(options: NiceLoadingToastOptions): ModuleWithProviders<NiceLoadingToastModule>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NiceLoadingToastModule, [typeof i1.NiceLoadingToastComponent, typeof i2.NiceLoadingToastDirective], [typeof i3.CommonModule, typeof i4.MatSnackBarModule, typeof i5.MatProgressSpinnerModule, typeof i6.NiceAlertModule], [typeof i2.NiceLoadingToastDirective]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<NiceLoadingToastModule>;
16
+ }
@@ -0,0 +1,20 @@
1
+ import { MatSnackBar, MatSnackBarRef } from "@angular/material/snack-bar";
2
+ import { TranslateService } from "@ngx-translate/core";
3
+ import { NiceAlertAppearance, NiceAlertColor, NiceAlertType } from "../alert";
4
+ import * as i0 from "@angular/core";
5
+ export interface NiceLoadingToastOptions {
6
+ appearance?: NiceAlertAppearance;
7
+ showIcon?: boolean;
8
+ type?: NiceAlertType;
9
+ color?: NiceAlertColor;
10
+ }
11
+ export declare class NiceLoadingToastService {
12
+ private options;
13
+ private snackbar;
14
+ private translateService;
15
+ constructor(options: NiceLoadingToastOptions, snackbar: MatSnackBar, translateService: TranslateService);
16
+ showLoadingToast(messageKey: string, params?: object): MatSnackBarRef<any>;
17
+ private getTranslations;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastService, [{ optional: true; }, null, null]>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<NiceLoadingToastService>;
20
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./loading-toast.component";
2
+ export * from "./loading-toast.directive";
3
+ export * from "./loading-toast.module";
4
+ export * from "./loading-toast.service";
5
+ export * from "./rxjs/show-loading-toast.operator";
@@ -0,0 +1,6 @@
1
+ import { MonoTypeOperatorFunction } from "rxjs";
2
+ import { NiceLoadingToastService } from "../loading-toast.service";
3
+ export interface ShowLoadingToastOperatorOptions {
4
+ minDuration?: number;
5
+ }
6
+ export declare function showLoadingToast<T>(loadingToastService: NiceLoadingToastService, key: string, options?: ShowLoadingToastOperatorOptions): MonoTypeOperatorFunction<T>;
@@ -13,6 +13,7 @@ export * from "./horizontal-stepper";
13
13
  export * from "./image-cropper";
14
14
  export * from "./layout";
15
15
  export * from "./loading-spinner";
16
+ export * from "./loading-toast";
16
17
  export * from "./lottie";
17
18
  export * from "./navigation";
18
19
  export * from "./search-bar";
@@ -1,3 +1,5 @@
1
1
  export * from "./toast.component";
2
2
  export * from "./toast.module";
3
3
  export * from "./toast.service";
4
+ export * from "./rxjs/show-toast.operator";
5
+ export * from "./rxjs/show-success-or-error-toast.operator";
@@ -0,0 +1,37 @@
1
+ import { MonoTypeOperatorFunction } from "rxjs";
2
+ import { NiceToastService } from "../toast.service";
3
+ interface ShowToastOperatorCommonKeysOptionsWithoutTitle {
4
+ messageKey: string;
5
+ titleKey?: string;
6
+ params?: object;
7
+ }
8
+ interface ShowToastOperatorCommonKeysOptionsWithoutMessage {
9
+ titleKey: string;
10
+ messageKey?: string;
11
+ params?: object;
12
+ }
13
+ interface ShowToastOperatorOptionsWithoutMessage {
14
+ title: {
15
+ success: string;
16
+ error: string;
17
+ };
18
+ message?: {
19
+ success: string;
20
+ error: string;
21
+ };
22
+ params?: object;
23
+ }
24
+ interface ShowToastOperatorOptionsWithoutTitle {
25
+ message: {
26
+ success: string;
27
+ error: string;
28
+ };
29
+ title?: {
30
+ success: string;
31
+ error: string;
32
+ };
33
+ params?: object;
34
+ }
35
+ export type ShowSuccessOrErrorToastOperatorOptions = ShowToastOperatorCommonKeysOptionsWithoutTitle | ShowToastOperatorCommonKeysOptionsWithoutMessage | ShowToastOperatorOptionsWithoutMessage | ShowToastOperatorOptionsWithoutTitle;
36
+ export declare function showSuccessOrErrorToast<T>(loadingToastService: NiceToastService, options: ShowSuccessOrErrorToastOperatorOptions): MonoTypeOperatorFunction<T>;
37
+ export {};
@@ -0,0 +1,17 @@
1
+ import { MonoTypeOperatorFunction } from "rxjs";
2
+ import { NiceToastService } from "../toast.service";
3
+ export interface ShowToastOperatorOptionsWithoutTitle {
4
+ messageKey: string;
5
+ titleKey?: string;
6
+ params?: object;
7
+ }
8
+ export interface ShowToastOperatorOptionsWithoutMessage {
9
+ titleKey: string;
10
+ messageKey?: string;
11
+ params?: object;
12
+ }
13
+ export type ShowToastOperatorOptions = ShowToastOperatorOptionsWithoutTitle | ShowToastOperatorOptionsWithoutMessage;
14
+ export declare function showSuccessToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
15
+ export declare function showErrorToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
16
+ export declare function showInfoToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
17
+ export declare function showWarningToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
@@ -3,7 +3,7 @@ import { AbstractControlDirective, ControlContainer, ControlValueAccessor, FormC
3
3
  import { MatFormFieldControl } from "@angular/material/form-field";
4
4
  import { Subject } from "rxjs";
5
5
  import { TranslationContextDirective } from "../directives/translation-context.directive";
6
- import { TranslationFormService } from "../providers/translation-form.service";
6
+ import { NiceTranslationFormService } from "../providers/nice-translation-form.service";
7
7
  import * as i0 from "@angular/core";
8
8
  export declare abstract class TranslationFormComponent implements OnInit, OnDestroy, MatFormFieldControl<string>, ControlValueAccessor {
9
9
  private container;
@@ -22,7 +22,7 @@ export declare abstract class TranslationFormComponent implements OnInit, OnDest
22
22
  get value(): any;
23
23
  get empty(): boolean;
24
24
  get errorState(): boolean;
25
- constructor(container: ControlContainer, context: TranslationContextDirective, service: TranslationFormService, changeDetectorRef: ChangeDetectorRef);
25
+ constructor(container: ControlContainer, context: TranslationContextDirective, service: NiceTranslationFormService, changeDetectorRef: ChangeDetectorRef);
26
26
  floating: boolean;
27
27
  maxLength: number;
28
28
  id: string;
@@ -0,0 +1 @@
1
+ export declare const TranslationFormGroup: () => PropertyDecorator;
@@ -1,15 +1,16 @@
1
1
  import { OnDestroy, OnInit } from "@angular/core";
2
2
  import { BehaviorSubject } from "rxjs";
3
- import { TranslationFormService } from "../providers/translation-form.service";
3
+ import { NiceTranslationFormService } from "../providers/nice-translation-form.service";
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class TranslationContextDirective implements OnInit, OnDestroy {
6
6
  private translationFormService;
7
7
  activeLanguage$: BehaviorSubject<string>;
8
8
  private _unsubscribeAll$;
9
- constructor(translationFormService: TranslationFormService);
9
+ constructor(translationFormService: NiceTranslationFormService);
10
10
  ngOnInit(): void;
11
11
  ngOnDestroy(): void;
12
12
  updateLanguage(language: string): void;
13
+ reset(): void;
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<TranslationContextDirective, never>;
14
15
  static ɵdir: i0.ɵɵDirectiveDeclaration<TranslationContextDirective, "[niceTranslationContext]", never, {}, {}, never, never, false, never>;
15
16
  }
@@ -0,0 +1,16 @@
1
+ import { Observable } from "rxjs";
2
+ import * as i0 from "@angular/core";
3
+ export declare class NiceTranslationFormService {
4
+ private _languages$;
5
+ private _requiredLanguages$;
6
+ get languages$(): Observable<string[]>;
7
+ get languages(): string[];
8
+ get requiredLanguages$(): Observable<string[]>;
9
+ get requiredLanguages(): string[];
10
+ get hasLanguages$(): Observable<boolean>;
11
+ get hasLanguages(): boolean;
12
+ setLanguages(languages?: string[]): void;
13
+ setRequiredLanguages(languages?: string[]): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceTranslationFormService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<NiceTranslationFormService>;
16
+ }
@@ -1,9 +1,9 @@
1
- export * from "./toggle/translation-toggle.component";
2
- export * from "./directives/translation-context.directive";
3
- export * from "./providers/translation-form.service";
4
- export * from "./validators/require-for-languages.validator";
5
- export * from "./translation.form";
6
1
  export * from "./components/translation-form.module";
7
2
  export * from "./components/textarea/translation-form-textarea.component";
8
3
  export * from "./components/textfield/translation-form-textfield.component";
9
- export * from "./decorators/translation-form.decorator";
4
+ export * from "./decorators/translation-form-group.decorator";
5
+ export * from "./directives/translation-context.directive";
6
+ export * from "./providers/nice-translation-form.service";
7
+ export * from "./toggle/translation-toggle.component";
8
+ export * from "./validators/require-for-languages.validator";
9
+ export * from "./translation.form";
@@ -1,13 +1,13 @@
1
1
  import { MatButtonToggleChange } from "@angular/material/button-toggle";
2
2
  import { TranslationContextDirective } from "../directives/translation-context.directive";
3
- import { TranslationFormService } from "../providers/translation-form.service";
3
+ import { NiceTranslationFormService } from "../providers/nice-translation-form.service";
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class TranslationToggleComponent {
6
6
  private context;
7
7
  private translationFormService;
8
- languages$: import("rxjs").BehaviorSubject<string[]>;
8
+ languages$: import("rxjs").Observable<string[]>;
9
9
  activeLanguage$: import("rxjs").BehaviorSubject<string>;
10
- constructor(context: TranslationContextDirective, translationFormService: TranslationFormService);
10
+ constructor(context: TranslationContextDirective, translationFormService: NiceTranslationFormService);
11
11
  onChange($event: MatButtonToggleChange): void;
12
12
  static ɵfac: i0.ɵɵFactoryDeclaration<TranslationToggleComponent, never>;
13
13
  static ɵcmp: i0.ɵɵComponentDeclaration<TranslationToggleComponent, "nice-translation-toggle", never, {}, {}, never, never, false, never>;
@@ -1,13 +1,13 @@
1
- import { ValidationErrors, FormGroup } from "@angular/forms";
1
+ import { FormGroup, ValidationErrors } from "@angular/forms";
2
2
  import { AsyncValidator } from "@recursyve/ngx-form-generator";
3
3
  import { Observable } from "rxjs";
4
- import { TranslationFormService } from "../providers/translation-form.service";
4
+ import { NiceTranslationFormService } from "../providers/nice-translation-form.service";
5
5
  import * as i0 from "@angular/core";
6
6
  export declare function RequireForLanguages(): (target: object, propertyKey: string) => void;
7
7
  export declare class RequireForLanguagesValidator extends AsyncValidator {
8
8
  private service;
9
9
  name: string;
10
- constructor(service: TranslationFormService);
10
+ constructor(service: NiceTranslationFormService);
11
11
  validate(formGroup: FormGroup): Observable<ValidationErrors | null>;
12
12
  static ɵfac: i0.ɵɵFactoryDeclaration<RequireForLanguagesValidator, never>;
13
13
  static ɵprov: i0.ɵɵInjectableDeclaration<RequireForLanguagesValidator>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nice-ui-kit.v2",
3
- "version": "15.0.0-beta.119",
3
+ "version": "15.0.0-beta.121",
4
4
  "exports": {
5
5
  ".": {
6
6
  "sass": "./_index.scss",
@@ -1,4 +0,0 @@
1
- import { DynamicGroup } from "@recursyve/ngx-form-generator";
2
- // tslint:disable-next-line:variable-name
3
- export const TranslationFormDecorator = () => DynamicGroup();
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24tZm9ybS5kZWNvcmF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uaWNlLXVpLWtpdC12Mi9zcmMvbGliL2NvbXBvbmVudHMvdHJhbnNsYXRpb24tZm9ybS9kZWNvcmF0b3JzL3RyYW5zbGF0aW9uLWZvcm0uZGVjb3JhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUU3RCx5Q0FBeUM7QUFDekMsTUFBTSxDQUFDLE1BQU0sd0JBQXdCLEdBQUcsR0FBRyxFQUFFLENBQUMsWUFBWSxFQUFFLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEeW5hbWljR3JvdXAgfSBmcm9tIFwiQHJlY3Vyc3l2ZS9uZ3gtZm9ybS1nZW5lcmF0b3JcIjtcblxuLy8gdHNsaW50OmRpc2FibGUtbmV4dC1saW5lOnZhcmlhYmxlLW5hbWVcbmV4cG9ydCBjb25zdCBUcmFuc2xhdGlvbkZvcm1EZWNvcmF0b3IgPSAoKSA9PiBEeW5hbWljR3JvdXAoKTtcbiJdfQ==
@@ -1,46 +0,0 @@
1
- import { Injectable } from "@angular/core";
2
- import { BehaviorSubject } from "rxjs";
3
- import * as i0 from "@angular/core";
4
- export class TranslationFormService {
5
- constructor() {
6
- this._languages$ = new BehaviorSubject([]);
7
- this._requiredLanguages$ = new BehaviorSubject([]);
8
- }
9
- get languages$() {
10
- return this._languages$;
11
- }
12
- get requiredLanguages$() {
13
- return this._requiredLanguages$;
14
- }
15
- setLanguages(languages) {
16
- this._languages$.next(languages ?? []);
17
- }
18
- setRequiredLanguages(languages) {
19
- if (!languages?.length) {
20
- this._requiredLanguages$.next([]);
21
- }
22
- const languagesValues = this.languages$.getValue();
23
- const unregisteredLanguages = languages?.filter((language) => !languagesValues.includes(language));
24
- if (unregisteredLanguages?.length) {
25
- throw new Error(`You provided languages that are not configured
26
- > Configured languages: [${languagesValues}]
27
- > Missing languages provided: [${unregisteredLanguages}]
28
- `);
29
- }
30
- if (languages.length > languagesValues.length) {
31
- this._requiredLanguages$.next(languagesValues);
32
- }
33
- else {
34
- this._requiredLanguages$.next(languages);
35
- }
36
- }
37
- }
38
- TranslationFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TranslationFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
39
- TranslationFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TranslationFormService, providedIn: "root" });
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: TranslationFormService, decorators: [{
41
- type: Injectable,
42
- args: [{
43
- providedIn: "root",
44
- }]
45
- }] });
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24tZm9ybS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmljZS11aS1raXQtdjIvc3JjL2xpYi9jb21wb25lbnRzL3RyYW5zbGF0aW9uLWZvcm0vcHJvdmlkZXJzL3RyYW5zbGF0aW9uLWZvcm0uc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxNQUFNLENBQUM7O0FBS3ZDLE1BQU0sT0FBTyxzQkFBc0I7SUFIbkM7UUFJWSxnQkFBVyxHQUFHLElBQUksZUFBZSxDQUFXLEVBQUUsQ0FBQyxDQUFDO1FBQ2hELHdCQUFtQixHQUFHLElBQUksZUFBZSxDQUFXLEVBQUUsQ0FBQyxDQUFDO0tBc0NuRTtJQXBDRyxJQUFXLFVBQVU7UUFDakIsT0FBTyxJQUFJLENBQUMsV0FBVyxDQUFDO0lBQzVCLENBQUM7SUFFRCxJQUFXLGtCQUFrQjtRQUN6QixPQUFPLElBQUksQ0FBQyx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dChbXSk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBsYW5ndWFnZXNWYWx1ZXMgPSB0aGlzLmxhbmd1YWdlcyQuZ2V0VmFsdWUoKTtcblxuICAgICAgICBjb25zdCB1bnJlZ2lzdGVyZWRMYW5ndWFnZXM6IHN0cmluZ1tdID0gbGFuZ3VhZ2VzPy5maWx0ZXIoXG4gICAgICAgICAgICAobGFuZ3VhZ2UpID0+ICFsYW5ndWFnZXNWYWx1ZXMuaW5jbHVkZXMobGFuZ3VhZ2UpXG4gICAgICAgICk7XG5cbiAgICAgICAgaWYgKHVucmVnaXN0ZXJlZExhbmd1YWdlcz8ubGVuZ3RoKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFlvdSBwcm92aWRlZCBsYW5ndWFnZXMgdGhhdCBhcmUgbm90IGNvbmZpZ3VyZWRcbiAgICAgICAgICAgICAgID4gQ29uZmlndXJlZCBsYW5ndWFnZXM6IFske2xhbmd1YWdlc1ZhbHVlc31dXG4gICAgICAgICAgICAgICA+IE1pc3NpbmcgbGFuZ3VhZ2VzIHByb3ZpZGVkOiBbJHt1bnJlZ2lzdGVyZWRMYW5ndWFnZXN9XVxuICAgICAgICAgICAgYCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobGFuZ3VhZ2VzLmxlbmd0aCA+IGxhbmd1YWdlc1ZhbHVlcy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRoaXMuX3JlcXVpcmVkTGFuZ3VhZ2VzJC5uZXh0KGxhbmd1YWdlc1ZhbHVlcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLl9yZXF1aXJlZExhbmd1YWdlcyQubmV4dChsYW5ndWFnZXMpO1xuICAgICAgICB9XG4gICAgfVxufVxuIl19
@@ -1 +0,0 @@
1
- export declare const TranslationFormDecorator: () => PropertyDecorator;
@@ -1,12 +0,0 @@
1
- import { BehaviorSubject } from "rxjs";
2
- import * as i0 from "@angular/core";
3
- export declare class TranslationFormService {
4
- private _languages$;
5
- private _requiredLanguages$;
6
- get languages$(): BehaviorSubject<string[]>;
7
- get requiredLanguages$(): BehaviorSubject<string[]>;
8
- setLanguages(languages?: string[]): void;
9
- setRequiredLanguages(languages?: string[]): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<TranslationFormService, never>;
11
- static ɵprov: i0.ɵɵInjectableDeclaration<TranslationFormService>;
12
- }