@recursyve/nice-ui-kit.v2 14.0.0-beta.120 → 14.0.0-beta.122

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 (24) hide show
  1. package/esm2020/lib/components/date-range-picker/date-range-picker.component.mjs +3 -3
  2. package/esm2020/lib/components/translation-form/components/translation-form.component.mjs +5 -5
  3. package/esm2020/lib/components/translation-form/decorators/translation-form-group.decorator.mjs +4 -0
  4. package/esm2020/lib/components/translation-form/directives/translation-context.directive.mjs +5 -5
  5. package/esm2020/lib/components/translation-form/providers/nice-translation-form.service.mjs +59 -0
  6. package/esm2020/lib/components/translation-form/public-api.mjs +7 -7
  7. package/esm2020/lib/components/translation-form/toggle/translation-toggle.component.mjs +5 -5
  8. package/esm2020/lib/components/translation-form/validators/require-for-languages.validator.mjs +22 -21
  9. package/fesm2015/recursyve-nice-ui-kit.v2.mjs +73 -59
  10. package/fesm2015/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  11. package/fesm2020/recursyve-nice-ui-kit.v2.mjs +72 -59
  12. package/fesm2020/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  13. package/lib/components/translation-form/components/translation-form.component.d.ts +2 -2
  14. package/lib/components/translation-form/decorators/translation-form-group.decorator.d.ts +1 -0
  15. package/lib/components/translation-form/directives/translation-context.directive.d.ts +2 -2
  16. package/lib/components/translation-form/providers/nice-translation-form.service.d.ts +16 -0
  17. package/lib/components/translation-form/public-api.d.ts +6 -6
  18. package/lib/components/translation-form/toggle/translation-toggle.component.d.ts +3 -3
  19. package/lib/components/translation-form/validators/require-for-languages.validator.d.ts +3 -3
  20. package/package.json +1 -1
  21. package/esm2020/lib/components/translation-form/decorators/translation-form.decorator.mjs +0 -4
  22. package/esm2020/lib/components/translation-form/providers/translation-form.service.mjs +0 -46
  23. package/lib/components/translation-form/decorators/translation-form.decorator.d.ts +0 -1
  24. package/lib/components/translation-form/providers/translation-form.service.d.ts +0 -12
@@ -3932,7 +3932,7 @@ NiceDateRangePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14
3932
3932
  useExisting: forwardRef(() => NiceDateRangePickerComponent),
3933
3933
  multi: true
3934
3934
  }
3935
- ], viewQueries: [{ propertyName: "picker", first: true, predicate: MatDateRangePicker, descendants: true }], ngImport: i0, template: "<div class=\"nice-date-picker-container\">\n <div class=\"nice-date-picker-header\">\n <div class=\"from-to\">\n <ng-container *ngIf=\"value.from\">\n {{ value.from | localizedDate: \"longDate\" }}\n </ng-container>\n <ng-container *ngIf=\"value.to\">\n <div class=\"separator\">-</div>\n {{ value.to | localizedDate: \"longDate\" }}\n </ng-container>\n </div>\n </div>\n\n <mat-date-range-input [formGroup]=\"formGroup\" [max]=\"nowIsMax ? now : null\" [rangePicker]=\"picker\">\n <input formControlName=\"from\" class=\"hidden-input\" matStartDate placeholder=\"Start date\">\n <input formControlName=\"to\" class=\"hidden-input\" matEndDate placeholder=\"End date\">\n </mat-date-range-input>\n\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n\n <mat-date-range-picker\n [calendarHeaderComponent]=\"HeaderComponent\"\n #picker\n ></mat-date-range-picker>\n</div>\n", styles: ["nice-date-range-picker .mat-date-range-input{width:0;height:0;padding:0;margin:0;border:none;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$3.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2$3.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2$3.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2$3.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "directive", type: i1$3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: LocalizedDatePipe, name: "localizedDate" }], encapsulation: i0.ViewEncapsulation.None });
3935
+ ], viewQueries: [{ propertyName: "picker", first: true, predicate: MatDateRangePicker, descendants: true }], ngImport: i0, template: "<div class=\"nice-date-picker-container\">\n <div class=\"nice-date-picker-header\">\n <div class=\"from-to\">\n <ng-container *ngIf=\"value?.from\">\n {{ value.from | localizedDate: \"longDate\" }}\n </ng-container>\n <ng-container *ngIf=\"value?.to\">\n <div class=\"separator\">-</div>\n {{ value.to | localizedDate: \"longDate\" }}\n </ng-container>\n </div>\n </div>\n\n <mat-date-range-input [formGroup]=\"formGroup\" [max]=\"nowIsMax ? now : null\" [rangePicker]=\"picker\">\n <input formControlName=\"from\" class=\"hidden-input\" matStartDate placeholder=\"Start date\">\n <input formControlName=\"to\" class=\"hidden-input\" matEndDate placeholder=\"End date\">\n </mat-date-range-input>\n\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n\n <mat-date-range-picker\n [calendarHeaderComponent]=\"HeaderComponent\"\n #picker\n ></mat-date-range-picker>\n</div>\n", styles: ["nice-date-range-picker .mat-date-range-input{width:0;height:0;padding:0;margin:0;border:none;visibility:hidden}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i2$3.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i2$3.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i2$3.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i2$3.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "directive", type: i1$3.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "pipe", type: LocalizedDatePipe, name: "localizedDate" }], encapsulation: i0.ViewEncapsulation.None });
3936
3936
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceDateRangePickerComponent, decorators: [{
3937
3937
  type: Component,
3938
3938
  args: [{ selector: "nice-date-range-picker", encapsulation: ViewEncapsulation.None, providers: [
@@ -3941,7 +3941,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
3941
3941
  useExisting: forwardRef(() => NiceDateRangePickerComponent),
3942
3942
  multi: true
3943
3943
  }
3944
- ], template: "<div class=\"nice-date-picker-container\">\n <div class=\"nice-date-picker-header\">\n <div class=\"from-to\">\n <ng-container *ngIf=\"value.from\">\n {{ value.from | localizedDate: \"longDate\" }}\n </ng-container>\n <ng-container *ngIf=\"value.to\">\n <div class=\"separator\">-</div>\n {{ value.to | localizedDate: \"longDate\" }}\n </ng-container>\n </div>\n </div>\n\n <mat-date-range-input [formGroup]=\"formGroup\" [max]=\"nowIsMax ? now : null\" [rangePicker]=\"picker\">\n <input formControlName=\"from\" class=\"hidden-input\" matStartDate placeholder=\"Start date\">\n <input formControlName=\"to\" class=\"hidden-input\" matEndDate placeholder=\"End date\">\n </mat-date-range-input>\n\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n\n <mat-date-range-picker\n [calendarHeaderComponent]=\"HeaderComponent\"\n #picker\n ></mat-date-range-picker>\n</div>\n", styles: ["nice-date-range-picker .mat-date-range-input{width:0;height:0;padding:0;margin:0;border:none;visibility:hidden}\n"] }]
3944
+ ], template: "<div class=\"nice-date-picker-container\">\n <div class=\"nice-date-picker-header\">\n <div class=\"from-to\">\n <ng-container *ngIf=\"value?.from\">\n {{ value.from | localizedDate: \"longDate\" }}\n </ng-container>\n <ng-container *ngIf=\"value?.to\">\n <div class=\"separator\">-</div>\n {{ value.to | localizedDate: \"longDate\" }}\n </ng-container>\n </div>\n </div>\n\n <mat-date-range-input [formGroup]=\"formGroup\" [max]=\"nowIsMax ? now : null\" [rangePicker]=\"picker\">\n <input formControlName=\"from\" class=\"hidden-input\" matStartDate placeholder=\"Start date\">\n <input formControlName=\"to\" class=\"hidden-input\" matEndDate placeholder=\"End date\">\n </mat-date-range-input>\n\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n\n <mat-date-range-picker\n [calendarHeaderComponent]=\"HeaderComponent\"\n #picker\n ></mat-date-range-picker>\n</div>\n", styles: ["nice-date-range-picker .mat-date-range-input{width:0;height:0;padding:0;margin:0;border:none;visibility:hidden}\n"] }]
3945
3945
  }], propDecorators: { picker: [{
3946
3946
  type: ViewChild,
3947
3947
  args: [MatDateRangePicker]
@@ -10105,16 +10105,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
10105
10105
  }]
10106
10106
  }] });
10107
10107
 
10108
- class TranslationFormService {
10108
+ class NiceTranslationFormService {
10109
10109
  constructor() {
10110
10110
  this._languages$ = new BehaviorSubject([]);
10111
10111
  this._requiredLanguages$ = new BehaviorSubject([]);
10112
10112
  }
10113
10113
  get languages$() {
10114
- return this._languages$;
10114
+ return this._languages$.asObservable();
10115
+ }
10116
+ get languages() {
10117
+ return this._languages$.getValue();
10115
10118
  }
10116
10119
  get requiredLanguages$() {
10117
- return this._requiredLanguages$;
10120
+ return this._requiredLanguages$.asObservable();
10121
+ }
10122
+ get requiredLanguages() {
10123
+ return this._requiredLanguages$.value;
10124
+ }
10125
+ get hasLanguages$() {
10126
+ return this._languages$.asObservable().pipe(map((languages) => !!languages?.length));
10127
+ }
10128
+ get hasLanguages() {
10129
+ return !!this.languages?.length;
10118
10130
  }
10119
10131
  setLanguages(languages) {
10120
10132
  this._languages$.next(languages ?? []);
@@ -10123,7 +10135,7 @@ class TranslationFormService {
10123
10135
  if (!languages?.length) {
10124
10136
  this._requiredLanguages$.next([]);
10125
10137
  }
10126
- const languagesValues = this.languages$.getValue();
10138
+ const languagesValues = this.languages;
10127
10139
  const unregisteredLanguages = languages?.filter((language) => !languagesValues.includes(language));
10128
10140
  if (unregisteredLanguages?.length) {
10129
10141
  throw new Error(`You provided languages that are not configured
@@ -10139,9 +10151,9 @@ class TranslationFormService {
10139
10151
  }
10140
10152
  }
10141
10153
  }
10142
- TranslationFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10143
- TranslationFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormService, providedIn: "root" });
10144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormService, decorators: [{
10154
+ NiceTranslationFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceTranslationFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10155
+ NiceTranslationFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceTranslationFormService, providedIn: "root" });
10156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceTranslationFormService, decorators: [{
10145
10157
  type: Injectable,
10146
10158
  args: [{
10147
10159
  providedIn: "root",
@@ -10169,12 +10181,12 @@ class TranslationContextDirective {
10169
10181
  this.activeLanguage$.next(language);
10170
10182
  }
10171
10183
  }
10172
- TranslationContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationContextDirective, deps: [{ token: TranslationFormService }], target: i0.ɵɵFactoryTarget.Directive });
10184
+ TranslationContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationContextDirective, deps: [{ token: NiceTranslationFormService }], target: i0.ɵɵFactoryTarget.Directive });
10173
10185
  TranslationContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.3", type: TranslationContextDirective, selector: "[niceTranslationContext]", ngImport: i0 });
10174
10186
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationContextDirective, decorators: [{
10175
10187
  type: Directive,
10176
10188
  args: [{ selector: "[niceTranslationContext]" }]
10177
- }], ctorParameters: function () { return [{ type: TranslationFormService }]; } });
10189
+ }], ctorParameters: function () { return [{ type: NiceTranslationFormService }]; } });
10178
10190
 
10179
10191
  class TranslationToggleComponent {
10180
10192
  constructor(context, translationFormService) {
@@ -10187,54 +10199,12 @@ class TranslationToggleComponent {
10187
10199
  this.context.updateLanguage($event.value);
10188
10200
  }
10189
10201
  }
10190
- TranslationToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationToggleComponent, deps: [{ token: TranslationContextDirective }, { token: TranslationFormService }], target: i0.ɵɵFactoryTarget.Component });
10202
+ TranslationToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationToggleComponent, deps: [{ token: TranslationContextDirective }, { token: NiceTranslationFormService }], target: i0.ɵɵFactoryTarget.Component });
10191
10203
  TranslationToggleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.3", type: TranslationToggleComponent, selector: "nice-translation-toggle", ngImport: i0, template: "<mat-button-toggle-group\n *ngIf=\"(languages$ | async)?.length > 1\"\n (change)=\"onChange($event)\"\n [value]=\"activeLanguage$ | async\"\n>\n <mat-button-toggle *ngFor=\"let language of languages$ | async\" [value]=\"language\">\n {{ language | uppercase }}\n </mat-button-toggle>\n</mat-button-toggle-group>\n", dependencies: [{ kind: "directive", type: i3$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.UpperCasePipe, name: "uppercase" }] });
10192
10204
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationToggleComponent, decorators: [{
10193
10205
  type: Component,
10194
10206
  args: [{ selector: "nice-translation-toggle", template: "<mat-button-toggle-group\n *ngIf=\"(languages$ | async)?.length > 1\"\n (change)=\"onChange($event)\"\n [value]=\"activeLanguage$ | async\"\n>\n <mat-button-toggle *ngFor=\"let language of languages$ | async\" [value]=\"language\">\n {{ language | uppercase }}\n </mat-button-toggle>\n</mat-button-toggle-group>\n" }]
10195
- }], ctorParameters: function () { return [{ type: TranslationContextDirective }, { type: TranslationFormService }]; } });
10196
-
10197
- function RequireForLanguages() {
10198
- return registerAsyncValidatorDecorator({
10199
- name: "RequireForLanguages",
10200
- });
10201
- }
10202
- class RequireForLanguagesValidator extends AsyncValidator {
10203
- constructor(service) {
10204
- super();
10205
- this.service = service;
10206
- this.name = "RequireForLanguages";
10207
- }
10208
- validate(formGroup) {
10209
- const requiredLanguages = this.service.requiredLanguages$.getValue();
10210
- if (!requiredLanguages.length) {
10211
- return of(null);
10212
- }
10213
- const missingLanguages = [];
10214
- for (const requiredLanguage of requiredLanguages) {
10215
- const control = formGroup.get(requiredLanguage);
10216
- if (control?.value) {
10217
- continue;
10218
- }
10219
- missingLanguages.push(requiredLanguage);
10220
- }
10221
- if (missingLanguages?.length) {
10222
- return of({ languageRequired: { missingLanguages } });
10223
- }
10224
- return of(null);
10225
- }
10226
- }
10227
- RequireForLanguagesValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, deps: [{ token: TranslationFormService }], target: i0.ɵɵFactoryTarget.Injectable });
10228
- RequireForLanguagesValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator });
10229
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, decorators: [{
10230
- type: Injectable
10231
- }], ctorParameters: function () { return [{ type: TranslationFormService }]; } });
10232
-
10233
- class TranslationForm {
10234
- constructor(values) {
10235
- Object.assign(this, values ?? {});
10236
- }
10237
- }
10207
+ }], ctorParameters: function () { return [{ type: TranslationContextDirective }, { type: NiceTranslationFormService }]; } });
10238
10208
 
10239
10209
  class TranslationFormComponent {
10240
10210
  constructor(container, context, service, changeDetectorRef) {
@@ -10358,14 +10328,14 @@ class TranslationFormComponent {
10358
10328
  this.currentControl = this.formGroup.get(languages[0]);
10359
10329
  }
10360
10330
  }
10361
- TranslationFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormComponent, deps: [{ token: i1$2.ControlContainer }, { token: TranslationContextDirective }, { token: TranslationFormService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
10331
+ TranslationFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormComponent, deps: [{ token: i1$2.ControlContainer }, { token: TranslationContextDirective }, { token: NiceTranslationFormService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
10362
10332
  TranslationFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.3", type: TranslationFormComponent, selector: "ng-component", inputs: { required: "required", disabled: "disabled", placeholder: "placeholder", floating: "floating", maxLength: "maxLength" }, host: { properties: { "class": "this.classList", "class.floating": "this.shouldLabelFloat", "id": "this.id", "attr.aria-describedby": "this.describedBy" } }, ngImport: i0, template: ``, isInline: true });
10363
10333
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormComponent, decorators: [{
10364
10334
  type: Component,
10365
10335
  args: [{
10366
10336
  template: ``,
10367
10337
  }]
10368
- }], ctorParameters: function () { return [{ type: i1$2.ControlContainer }, { type: TranslationContextDirective }, { type: TranslationFormService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { classList: [{
10338
+ }], ctorParameters: function () { return [{ type: i1$2.ControlContainer }, { type: TranslationContextDirective }, { type: NiceTranslationFormService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { classList: [{
10369
10339
  type: HostBinding,
10370
10340
  args: ["class"]
10371
10341
  }], shouldLabelFloat: [{
@@ -10438,6 +10408,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
10438
10408
  ], template: "<input\n matInput\n [formControl]=\"currentControl\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n/>\n" }]
10439
10409
  }] });
10440
10410
 
10411
+ function RequireForLanguages() {
10412
+ return registerAsyncValidatorDecorator({
10413
+ name: "RequireForLanguages",
10414
+ });
10415
+ }
10416
+ class RequireForLanguagesValidator extends AsyncValidator {
10417
+ constructor(service) {
10418
+ super();
10419
+ this.service = service;
10420
+ this.name = "RequireForLanguages";
10421
+ }
10422
+ validate(formGroup) {
10423
+ return this.service.requiredLanguages$.pipe(take(1), map((requiredLanguages) => {
10424
+ if (!requiredLanguages.length) {
10425
+ return null;
10426
+ }
10427
+ const missingLanguages = [];
10428
+ for (const requiredLanguage of requiredLanguages) {
10429
+ const control = formGroup.get(requiredLanguage);
10430
+ if (control?.value) {
10431
+ continue;
10432
+ }
10433
+ missingLanguages.push(requiredLanguage);
10434
+ }
10435
+ if (missingLanguages?.length) {
10436
+ return { languageRequired: { missingLanguages } };
10437
+ }
10438
+ return null;
10439
+ }));
10440
+ }
10441
+ }
10442
+ RequireForLanguagesValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, deps: [{ token: NiceTranslationFormService }], target: i0.ɵɵFactoryTarget.Injectable });
10443
+ RequireForLanguagesValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator });
10444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, decorators: [{
10445
+ type: Injectable
10446
+ }], ctorParameters: function () { return [{ type: NiceTranslationFormService }]; } });
10447
+
10441
10448
  class NiceTranslationFormModule {
10442
10449
  static forRoot() {
10443
10450
  return {
@@ -10498,7 +10505,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
10498
10505
  }] });
10499
10506
 
10500
10507
  // tslint:disable-next-line:variable-name
10501
- const TranslationFormDecorator = () => DynamicGroup();
10508
+ const TranslationFormGroup = () => DynamicGroup();
10509
+
10510
+ class TranslationForm {
10511
+ constructor(values) {
10512
+ Object.assign(this, values ?? {});
10513
+ }
10514
+ }
10502
10515
 
10503
10516
  class NiceAutofocusDirective {
10504
10517
  constructor(elem) {
@@ -11371,5 +11384,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
11371
11384
  * Generated bundle index. Do not edit.
11372
11385
  */
11373
11386
 
11374
- export { ArrayUtils, BooleanPipe, CapitalizeFirstLetterPipe, CarouselComponent, CaseUtils, CeilPipe, ChipListItemLabelDirective, ColorsUtils, DateUtils, DefaultExportBottomSheetService, EntriesPipe, ExportBottomSheetComponent, ExportBottomSheetService, FileUtils, FindByKeyPipe, FirstLetterPipe, FloorPipe, FontAwesomeUtils, FormDataUtils, HttpStatusCodes, ImgCropperConfig, ImgCropperError, ImgResolution, JoinPipe, KeyboardCodes, LexoRankUtils, LinkPipe, LocalizedBooleanPipe, LocalizedCurrencyPipe, LocalizedDateOnlyPipe, LocalizedDatePipe, MinutesToTimePipe, ModalMode, NICE_ASYNC_TYPEAHEAD_PROVIDER, NavigationHideItemResolver, NavigationHintResolver, NiceAlertComponent, NiceAlertModule, NiceAlertService, NiceApiException, NiceAssetsCarouselActiveContentDirective, NiceAssetsCarouselComponent, NiceAssetsCarouselModule, NiceAsyncTypeaheadComponent, NiceAsyncTypeaheadModule, NiceAsyncTypeaheadProvider, NiceAutofocusDirective, NiceAutofocusDirectiveModule, NiceAutogrowDirective, NiceAutogrowModule, NiceBaseForm, NiceBaseFormComponent, NiceBaseFormModule, NiceCardComponent, NiceCardModule, NiceCarouselModule, NiceChipAsyncTypeaheadDirective, NiceChipListDirective, NiceChipListDirectiveModule, NiceChipListItemsComponent, NiceClickStopPropagationDirective, NiceCollapsableComponent, NiceCollapsableModule, NiceConfigModule, NiceConfigService, NiceControlStatusDirective, NiceCropperAreaComponent, NiceDateRangePickerComponent, NiceDateRangePickerModule, NiceDraggableListDirective, NiceDraggableListModule, NiceDrawerComponent, NiceDrawerModule, NiceDrawerService, NiceDropzoneDirective, NiceDropzoneModule, NiceExportBottomSheetModule, NiceFormErrorComponent, NiceFormErrorModule, NiceFormSubmitDirective, NiceHorizontalNavigationBasicItemComponent, NiceHorizontalNavigationBranchItemComponent, NiceHorizontalNavigationComponent, NiceHorizontalNavigationDividerItemComponent, NiceHorizontalNavigationSpacerItemComponent, NiceHorizontalStepperComponent, NiceHorizontalStepperModule, NiceHttpExceptionFactory, NiceImageCropperComponent, NiceImageCropperModule, NiceImageErrorPlaceholderDirective, NiceImageErrorPlaceholderDirectiveModule, NiceLayoutComponent, NiceLayoutModule, NiceLoadingDirective, NiceLoadingSpinnerComponent, NiceLoadingSpinnerModule, NiceLottieComponent, NiceLottieModule, NiceMaterialModule, NiceMaterialStyleDirective, NiceMediaWatcherModule, NiceMediaWatcherService, NiceModalOnClickDirective, NiceModalOpenerDirective, NiceModule, NiceNavigationComponent, NiceNavigationModule, NiceNavigationService, NicePipesModule, NicePreventCloseWindowDirective, NiceRoundedStyleDirective, NiceScrollResetDirective, NiceScrollResetModule, NiceScrollbarDirective, NiceScrollbarModule, NiceSearchBarComponent, NiceSearchBarModule, NiceSplashScreenModule, NiceSplashScreenService, NiceStepComponent, NiceStopPropagationModule, NiceSweetAlertComponent, NiceSweetAlertDirective, NiceSweetAlertModule, NiceSweetAlertService, NiceToastComponent, NiceToastModule, NiceToastService, NiceToggleButtonGroupModule, NiceTransformResponseInterceptor, NiceTranslationFormModule, NiceTypeaheadComponent, NiceTypeaheadModule, NiceTypeaheadNewValue, NiceUtilsModule, NiceUtilsService, NiceVerticalNavigationAsideItemComponent, NiceVerticalNavigationBasicItemComponent, NiceVerticalNavigationCollapsableItemComponent, NiceVerticalNavigationComponent, NiceVerticalNavigationDividerItemComponent, NiceVerticalNavigationGroupItemComponent, NiceVerticalNavigationSpacerItemComponent, NiceWindowDirectiveModule, NumberToOrdinalIndicatorPipe, NumberUtils, ObjectUtils, OptionsScrollDirective, PadPipe, PhonePipe, PictureModalComponent, PictureModalService, PostalCodePipe, PromiseUtils, QueryParamsUtils, RangePipe, RegexUtils, RequireForLanguages, RequireForLanguagesValidator, RerenderDirective, ResolveDirective, RoundPipe, SanitizeBypassPipe, SecondsToTimePipe, TRANSFORM_TYPE, ToggleButtonComponent, ToggleButtonGroupComponent, TrackByPropPipe, TranslationContextDirective, TranslationForm, TranslationFormDecorator, TranslationFormService, TranslationFormTextareaComponent, TranslationFormTextfieldComponent, TranslationToggleComponent, TypeUtils, UrlUtils, _HintComponentBase, _normalizeDegrees, isNotNullOrUndefined, isNullOrUndefined, mergeDeep, mixinNiceApi, niceAnimations, round };
11387
+ export { ArrayUtils, BooleanPipe, CapitalizeFirstLetterPipe, CarouselComponent, CaseUtils, CeilPipe, ChipListItemLabelDirective, ColorsUtils, DateUtils, DefaultExportBottomSheetService, EntriesPipe, ExportBottomSheetComponent, ExportBottomSheetService, FileUtils, FindByKeyPipe, FirstLetterPipe, FloorPipe, FontAwesomeUtils, FormDataUtils, HttpStatusCodes, ImgCropperConfig, ImgCropperError, ImgResolution, JoinPipe, KeyboardCodes, LexoRankUtils, LinkPipe, LocalizedBooleanPipe, LocalizedCurrencyPipe, LocalizedDateOnlyPipe, LocalizedDatePipe, MinutesToTimePipe, ModalMode, NICE_ASYNC_TYPEAHEAD_PROVIDER, NavigationHideItemResolver, NavigationHintResolver, NiceAlertComponent, NiceAlertModule, NiceAlertService, NiceApiException, NiceAssetsCarouselActiveContentDirective, NiceAssetsCarouselComponent, NiceAssetsCarouselModule, NiceAsyncTypeaheadComponent, NiceAsyncTypeaheadModule, NiceAsyncTypeaheadProvider, NiceAutofocusDirective, NiceAutofocusDirectiveModule, NiceAutogrowDirective, NiceAutogrowModule, NiceBaseForm, NiceBaseFormComponent, NiceBaseFormModule, NiceCardComponent, NiceCardModule, NiceCarouselModule, NiceChipAsyncTypeaheadDirective, NiceChipListDirective, NiceChipListDirectiveModule, NiceChipListItemsComponent, NiceClickStopPropagationDirective, NiceCollapsableComponent, NiceCollapsableModule, NiceConfigModule, NiceConfigService, NiceControlStatusDirective, NiceCropperAreaComponent, NiceDateRangePickerComponent, NiceDateRangePickerModule, NiceDraggableListDirective, NiceDraggableListModule, NiceDrawerComponent, NiceDrawerModule, NiceDrawerService, NiceDropzoneDirective, NiceDropzoneModule, NiceExportBottomSheetModule, NiceFormErrorComponent, NiceFormErrorModule, NiceFormSubmitDirective, NiceHorizontalNavigationBasicItemComponent, NiceHorizontalNavigationBranchItemComponent, NiceHorizontalNavigationComponent, NiceHorizontalNavigationDividerItemComponent, NiceHorizontalNavigationSpacerItemComponent, NiceHorizontalStepperComponent, NiceHorizontalStepperModule, NiceHttpExceptionFactory, NiceImageCropperComponent, NiceImageCropperModule, NiceImageErrorPlaceholderDirective, NiceImageErrorPlaceholderDirectiveModule, NiceLayoutComponent, NiceLayoutModule, NiceLoadingDirective, NiceLoadingSpinnerComponent, NiceLoadingSpinnerModule, NiceLottieComponent, NiceLottieModule, NiceMaterialModule, NiceMaterialStyleDirective, NiceMediaWatcherModule, NiceMediaWatcherService, NiceModalOnClickDirective, NiceModalOpenerDirective, NiceModule, NiceNavigationComponent, NiceNavigationModule, NiceNavigationService, NicePipesModule, NicePreventCloseWindowDirective, NiceRoundedStyleDirective, NiceScrollResetDirective, NiceScrollResetModule, NiceScrollbarDirective, NiceScrollbarModule, NiceSearchBarComponent, NiceSearchBarModule, NiceSplashScreenModule, NiceSplashScreenService, NiceStepComponent, NiceStopPropagationModule, NiceSweetAlertComponent, NiceSweetAlertDirective, NiceSweetAlertModule, NiceSweetAlertService, NiceToastComponent, NiceToastModule, NiceToastService, NiceToggleButtonGroupModule, NiceTransformResponseInterceptor, NiceTranslationFormModule, NiceTranslationFormService, NiceTypeaheadComponent, NiceTypeaheadModule, NiceTypeaheadNewValue, NiceUtilsModule, NiceUtilsService, NiceVerticalNavigationAsideItemComponent, NiceVerticalNavigationBasicItemComponent, NiceVerticalNavigationCollapsableItemComponent, NiceVerticalNavigationComponent, NiceVerticalNavigationDividerItemComponent, NiceVerticalNavigationGroupItemComponent, NiceVerticalNavigationSpacerItemComponent, NiceWindowDirectiveModule, NumberToOrdinalIndicatorPipe, NumberUtils, ObjectUtils, OptionsScrollDirective, PadPipe, PhonePipe, PictureModalComponent, PictureModalService, PostalCodePipe, PromiseUtils, QueryParamsUtils, RangePipe, RegexUtils, RequireForLanguages, RequireForLanguagesValidator, RerenderDirective, ResolveDirective, RoundPipe, SanitizeBypassPipe, SecondsToTimePipe, TRANSFORM_TYPE, ToggleButtonComponent, ToggleButtonGroupComponent, TrackByPropPipe, TranslationContextDirective, TranslationForm, TranslationFormGroup, TranslationFormTextareaComponent, TranslationFormTextfieldComponent, TranslationToggleComponent, TypeUtils, UrlUtils, _HintComponentBase, _normalizeDegrees, isNotNullOrUndefined, isNullOrUndefined, mergeDeep, mixinNiceApi, niceAnimations, round };
11375
11388
  //# sourceMappingURL=recursyve-nice-ui-kit.v2.mjs.map