@recursyve/nice-ui-kit.v2 14.0.0-beta.119 → 14.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 (25) hide show
  1. package/esm2020/lib/components/assets-carousel/assets-carousel.component.mjs +48 -25
  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 +119 -81
  10. package/fesm2015/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  11. package/fesm2020/recursyve-nice-ui-kit.v2.mjs +117 -81
  12. package/fesm2020/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  13. package/lib/components/assets-carousel/assets-carousel.component.d.ts +8 -4
  14. package/lib/components/translation-form/components/translation-form.component.d.ts +2 -2
  15. package/lib/components/translation-form/decorators/translation-form-group.decorator.d.ts +1 -0
  16. package/lib/components/translation-form/directives/translation-context.directive.d.ts +2 -2
  17. package/lib/components/translation-form/providers/nice-translation-form.service.d.ts +16 -0
  18. package/lib/components/translation-form/public-api.d.ts +6 -6
  19. package/lib/components/translation-form/toggle/translation-toggle.component.d.ts +3 -3
  20. package/lib/components/translation-form/validators/require-for-languages.validator.d.ts +3 -3
  21. package/package.json +1 -1
  22. package/esm2020/lib/components/translation-form/decorators/translation-form.decorator.mjs +0 -4
  23. package/esm2020/lib/components/translation-form/providers/translation-form.service.mjs +0 -46
  24. package/lib/components/translation-form/decorators/translation-form.decorator.d.ts +0 -1
  25. package/lib/components/translation-form/providers/translation-form.service.d.ts +0 -12
@@ -1,9 +1,9 @@
1
1
  import { Component } from "@angular/core";
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
  import * as i1 from "../directives/translation-context.directive";
6
- import * as i2 from "../providers/translation-form.service";
6
+ import * as i2 from "../providers/nice-translation-form.service";
7
7
  import * as i3 from "@angular/material/button-toggle";
8
8
  import * as i4 from "@angular/common";
9
9
  export class TranslationToggleComponent {
@@ -17,10 +17,10 @@ export class TranslationToggleComponent {
17
17
  this.context.updateLanguage($event.value);
18
18
  }
19
19
  }
20
- TranslationToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationToggleComponent, deps: [{ token: i1.TranslationContextDirective }, { token: i2.TranslationFormService }], target: i0.ɵɵFactoryTarget.Component });
20
+ TranslationToggleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationToggleComponent, deps: [{ token: i1.TranslationContextDirective }, { token: i2.NiceTranslationFormService }], target: i0.ɵɵFactoryTarget.Component });
21
21
  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.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3.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: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.UpperCasePipe, name: "uppercase" }] });
22
22
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationToggleComponent, decorators: [{
23
23
  type: Component,
24
24
  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" }]
25
- }], ctorParameters: function () { return [{ type: i1.TranslationContextDirective }, { type: i2.TranslationFormService }]; } });
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24tdG9nZ2xlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25pY2UtdWkta2l0LXYyL3NyYy9saWIvY29tcG9uZW50cy90cmFuc2xhdGlvbi1mb3JtL3RvZ2dsZS90cmFuc2xhdGlvbi10b2dnbGUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmljZS11aS1raXQtdjIvc3JjL2xpYi9jb21wb25lbnRzL3RyYW5zbGF0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XZlbnQpXCJcbiAgICBbdmFsdWVdPVwiYWN0aXZlTGFuZ3VhZ2UkIHwgYXN5bmNcIlxuPlxuICAgIDxtYXQtYnV0dG9uLXRvZ2dsZSAqbmdGb3I9XCJsZXQgbGFuZ3VhZ2Ugb2YgbGFuZ3VhZ2VzJCB8IGFzeW5jXCIgW3ZhbHVlXT1cImxhbmd1YWdlXCI+XG4gICAgICAgIHt7IGxhbmd1YWdlIHwgdXBwZXJjYXNlIH19XG4gICAgPC9tYXQtYnV0dG9uLXRvZ2dsZT5cbjwvbWF0LWJ1dHRvbi10b2dnbGUtZ3JvdXA+XG4iXX0=
25
+ }], ctorParameters: function () { return [{ type: i1.TranslationContextDirective }, { type: i2.NiceTranslationFormService }]; } });
26
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24tdG9nZ2xlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25pY2UtdWkta2l0LXYyL3NyYy9saWIvY29tcG9uZW50cy90cmFuc2xhdGlvbi1mb3JtL3RvZ2dsZS90cmFuc2xhdGlvbi10b2dnbGUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmljZS11aS1raXQtdjIvc3JjL2xpYi9jb21wb25lbnRzL3RyYW5zbGF0aW9uLWZvcm0vdG9nZ2xlL3RyYW5zbGF0aW9uLXRvZ2dsZS50ZW1wbGF0ZS5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFMUMsT0FBTyxFQUFFLDJCQUEyQixFQUFFLE1BQU0sNkNBQTZDLENBQUM7QUFDMUYsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sNENBQTRDLENBQUM7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bi10b2dnbGU+XG48L21hdC1idXR0b24tdG9nZ2xlLWdyb3VwPlxuIl19
@@ -1,9 +1,9 @@
1
1
  import { Injectable } from "@angular/core";
2
2
  import { AsyncValidator, registerAsyncValidatorDecorator, } from "@recursyve/ngx-form-generator";
3
- import { of } from "rxjs";
4
- import { TranslationFormService } from "../providers/translation-form.service";
3
+ import { map, take } from "rxjs/operators";
4
+ import { NiceTranslationFormService } from "../providers/nice-translation-form.service";
5
5
  import * as i0 from "@angular/core";
6
- import * as i1 from "../providers/translation-form.service";
6
+ import * as i1 from "../providers/nice-translation-form.service";
7
7
  export function RequireForLanguages() {
8
8
  return registerAsyncValidatorDecorator({
9
9
  name: "RequireForLanguages",
@@ -16,27 +16,28 @@ export class RequireForLanguagesValidator extends AsyncValidator {
16
16
  this.name = "RequireForLanguages";
17
17
  }
18
18
  validate(formGroup) {
19
- const requiredLanguages = this.service.requiredLanguages$.getValue();
20
- if (!requiredLanguages.length) {
21
- return of(null);
22
- }
23
- const missingLanguages = [];
24
- for (const requiredLanguage of requiredLanguages) {
25
- const control = formGroup.get(requiredLanguage);
26
- if (control?.value) {
27
- continue;
19
+ return this.service.requiredLanguages$.pipe(take(1), map((requiredLanguages) => {
20
+ if (!requiredLanguages.length) {
21
+ return null;
28
22
  }
29
- missingLanguages.push(requiredLanguage);
30
- }
31
- if (missingLanguages?.length) {
32
- return of({ languageRequired: { missingLanguages } });
33
- }
34
- return of(null);
23
+ const missingLanguages = [];
24
+ for (const requiredLanguage of requiredLanguages) {
25
+ const control = formGroup.get(requiredLanguage);
26
+ if (control?.value) {
27
+ continue;
28
+ }
29
+ missingLanguages.push(requiredLanguage);
30
+ }
31
+ if (missingLanguages?.length) {
32
+ return { languageRequired: { missingLanguages } };
33
+ }
34
+ return null;
35
+ }));
35
36
  }
36
37
  }
37
- RequireForLanguagesValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, deps: [{ token: i1.TranslationFormService }], target: i0.ɵɵFactoryTarget.Injectable });
38
+ RequireForLanguagesValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, deps: [{ token: i1.NiceTranslationFormService }], target: i0.ɵɵFactoryTarget.Injectable });
38
39
  RequireForLanguagesValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator });
39
40
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, decorators: [{
40
41
  type: Injectable
41
- }], ctorParameters: function () { return [{ type: i1.TranslationFormService }]; } });
42
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWlyZS1mb3ItbGFuZ3VhZ2VzLnZhbGlkYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25pY2UtdWkta2l0LXYyL3NyYy9saWIvY29tcG9uZW50cy90cmFuc2xhdGlvbi1mb3JtL3ZhbGlkYXRvcnMvcmVxdWlyZS1mb3ItbGFuZ3VhZ2VzLnZhbGlkYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFDSCxjQUFjLEVBQ2QsK0JBQStCLEdBQ2xDLE1BQU0sK0JBQStCLENBQUM7QUFDdkMsT0FBTyxFQUFjLEVBQUUsRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUN0QyxPQUFPLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSx1Q0FBdUMsQ0FBQzs7O0FBRS9FLE1BQU0sVUFBVSxtQkFBbUI7SUFDL0IsT0FBTywrQkFBK0IsQ0FBQztRQ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xWYWxpZGF0aW9uRXJyb3JzIHwgbnVsbD4ge1xuICAgICAgICBjb25zdCByZXF1aXJlZExhbmd1YWdlcyA9IHRoaXMuc2VydmljZS5yZXF1aXJlZExhbmd1YWdlcyQuZ2V0VmFsdWUoKTtcblxuICAgICAgICBpZiAoIXJlcXVpcmVkTGFuZ3VhZ2VzLmxlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuIG9mKG51bGwpO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgbWlzc2luZ0xhbmd1YWdlczogc3RyaW5nW10gPSBbXTtcblxuICAgICAgICBmb3IgKGNvbnN0IHJlcXVpcmVkTGFuZ3VhZ2Ugb2YgcmVxdWlyZWRMYW5ndWFnZXMpIHtcbiAgICAgICAgICAgIGNvbnN0IGNvbnRyb2wgPSBmb3JtR3JvdXAuZ2V0KHJlcXVpcmVkTGFuZ3VhZ2UpO1xuXG4gICAgICAgICAgICBpZiAoY29udHJvbD8udmFsdWUpIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbWlzc2luZ0xhbmd1YWdlcy5wdXNoKHJlcXVpcmVkTGFuZ3VhZ2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG1pc3NpbmdMYW5ndWFnZXM/Lmxlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuIG9mKHsgbGFuZ3VhZ2VSZXF1aXJlZDogeyBtaXNzaW5nTGFuZ3VhZ2VzIH0gfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gb2YobnVsbCk7XG4gICAgfVxufVxuIl19
42
+ }], ctorParameters: function () { return [{ type: i1.NiceTranslationFormService }]; } });
43
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWlyZS1mb3ItbGFuZ3VhZ2VzLnZhbGlkYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4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gcmVxdWlyZWRMYW5ndWFnZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29udHJvbCA9IGZvcm1Hcm91cC5nZXQocmVxdWlyZWRMYW5ndWFnZSk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRyb2w/LnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIG1pc3NpbmdMYW5ndWFnZXMucHVzaChyZXF1aXJlZExhbmd1YWdlKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAobWlzc2luZ0xhbmd1YWdlcz8ubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGxhbmd1YWdlUmVxdWlyZWQ6IHsgbWlzc2luZ0xhbmd1YWdlcyB9IH07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9KVxuICAgICAgICApO1xuICAgIH1cbn1cbiJdfQ==
@@ -1731,7 +1731,7 @@ class NiceAssetsCarouselComponent {
1731
1731
  this.color = this.defaultColor;
1732
1732
  this.edit = false;
1733
1733
  this.loading = false;
1734
- this.accept = ["image/*"];
1734
+ this.accept = [];
1735
1735
  this.customActions = [];
1736
1736
  this.multipleUpload = false;
1737
1737
  this.visiblePreviewAsset = 4;
@@ -1739,6 +1739,7 @@ class NiceAssetsCarouselComponent {
1739
1739
  this.activeChange = new EventEmitter();
1740
1740
  this.removedAsset = new EventEmitter();
1741
1741
  this.listStyle = { transform: "translateX(0px)" };
1742
+ this._imagesMimeTypes = ["image/png", "image/jpeg", "image/webp", "image/avif"];
1742
1743
  if (!this.options) {
1743
1744
  this.options = {
1744
1745
  actionButtons: {
@@ -1800,6 +1801,21 @@ class NiceAssetsCarouselComponent {
1800
1801
  || this._active >= this.visiblePreviewAsset;
1801
1802
  this.activeChange.emit(this._active);
1802
1803
  }
1804
+ ngOnInit() {
1805
+ var _a;
1806
+ if (!((_a = this.accept) === null || _a === void 0 ? void 0 : _a.length)) {
1807
+ this.accept = [...this._imagesMimeTypes];
1808
+ }
1809
+ }
1810
+ ngOnChanges(changes) {
1811
+ if ("accept" in changes && this.accept) {
1812
+ const index = this.accept.indexOf("image/*");
1813
+ if (index >= 0) {
1814
+ this.accept.splice(index, 1);
1815
+ this.accept.push(...this._imagesMimeTypes);
1816
+ }
1817
+ }
1818
+ }
1803
1819
  writeValue(assets) {
1804
1820
  this._assets = assets !== null && assets !== void 0 ? assets : [];
1805
1821
  if (this._assets.length === 0) {
@@ -1844,42 +1860,30 @@ class NiceAssetsCarouselComponent {
1844
1860
  onFilesChange(event) {
1845
1861
  var _a;
1846
1862
  return __awaiter(this, void 0, void 0, function* () {
1847
- let files = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files;
1848
- if (this.imagesProcessor) {
1849
- files = yield this.getProcessedFiles(files);
1850
- }
1863
+ const files = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files;
1851
1864
  yield this.onFilesDrop(files);
1852
1865
  this.inputElement.nativeElement.value = "";
1853
1866
  });
1854
1867
  }
1855
- onFilesDrop(files) {
1868
+ onFilesDrop(fileList) {
1856
1869
  var _a;
1857
1870
  return __awaiter(this, void 0, void 0, function* () {
1871
+ let files = this.filterOutUnsupportedFiles(fileList);
1872
+ if (this.imagesProcessor) {
1873
+ files = yield this.getProcessedFiles(files);
1874
+ }
1858
1875
  if (!(files === null || files === void 0 ? void 0 : files.length)) {
1859
1876
  return;
1860
1877
  }
1861
- let newAssetsAdded = false;
1862
- for (let i = 0; i < files.length; i++) {
1863
- const file = files.item(i);
1864
- if (!this.accept.some((accept) => {
1865
- if (accept.endsWith("*")) {
1866
- return file.type.startsWith(accept.replace("*", ""));
1867
- }
1868
- return accept === file.type;
1869
- })) {
1870
- continue;
1871
- }
1872
- newAssetsAdded = true;
1878
+ for (const file of files) {
1873
1879
  this._assets.push({
1874
1880
  file,
1875
1881
  type: file.type.split("/").shift(),
1876
1882
  base64: yield FileUtils.getDataUrl(file)
1877
1883
  });
1878
1884
  }
1879
- if (newAssetsAdded) {
1880
- this.clickAsset(this._assets.length - 1);
1881
- (_a = this.propagate) === null || _a === void 0 ? void 0 : _a.call(this, this._assets);
1882
- }
1885
+ this.clickAsset(this._assets.length - 1);
1886
+ (_a = this.propagate) === null || _a === void 0 ? void 0 : _a.call(this, this._assets);
1883
1887
  });
1884
1888
  }
1885
1889
  clickRemove() {
@@ -1906,12 +1910,32 @@ class NiceAssetsCarouselComponent {
1906
1910
  yield this._assetsElement.get(this._active).nativeElement.firstElementChild.play();
1907
1911
  });
1908
1912
  }
1913
+ filterOutUnsupportedFiles(fileList) {
1914
+ const files = [];
1915
+ for (let i = 0; i < fileList.length; i++) {
1916
+ const file = fileList.item(i);
1917
+ if (this.accept.some((accept) => {
1918
+ if (accept.endsWith("*")) {
1919
+ return file.type.startsWith(accept.replace("*", ""));
1920
+ }
1921
+ return accept === file.type;
1922
+ })) {
1923
+ files.push(file);
1924
+ }
1925
+ }
1926
+ return files;
1927
+ }
1909
1928
  getProcessedFiles(files) {
1910
1929
  return __awaiter(this, void 0, void 0, function* () {
1911
1930
  try {
1931
+ if (!files.length) {
1932
+ return null;
1933
+ }
1912
1934
  return yield this.imagesProcessor(files);
1913
1935
  }
1914
- catch (e) { }
1936
+ catch (e) {
1937
+ return null;
1938
+ }
1915
1939
  });
1916
1940
  }
1917
1941
  }
@@ -1922,7 +1946,7 @@ NiceAssetsCarouselComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.
1922
1946
  useExisting: forwardRef(() => NiceAssetsCarouselComponent),
1923
1947
  multi: true
1924
1948
  }
1925
- ], queries: [{ propertyName: "activeContent", first: true, predicate: NiceAssetsCarouselActiveContentDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "activeVideoElement", first: true, predicate: ["activeVideo"], descendants: true }, { propertyName: "assetsElement", predicate: ["assets"], descendants: true }], ngImport: i0, template: "<div class=\"carousel-container\" niceDropzone (filesDropped)=\"onFilesDrop($event)\">\n <div\n class=\"active-image\"\n matRipple\n [class.empty-state]=\"!_activeAsset\"\n (click)=\"edit && fileInput.click();\n $event.stopPropagation()\"\n >\n <div *ngIf=\"loading\" class=\"flex flex-row justify-center items-center h-full\">\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n <ng-container *ngIf=\"!loading\">\n <ng-container\n *ngIf=\"_activeAsset && activeContent\"\n [ngTemplateOutlet]=\"activeContent\"\n [ngTemplateOutletContext]=\"{ $implicit: _activeAsset}\"\n ></ng-container>\n <img\n *ngIf=\"_activeAsset?.type === 'image'\"\n (mouseover)=\"showOverlay=true\"\n [src]=\"_activeAsset.url ?? _activeAsset.base64\"\n draggable=\"false\"\n class=\"relative\"\n alt=\"active-image\"\n >\n <video #activeVideo *ngIf=\"_activeAsset?.type === 'video'\" draggable=\"false\" loop [src]=\"_activeAsset.url ?? _activeAsset.base64\"></video>\n\n <div class=\"empty-state-content\" *ngIf=\"!_activeAsset\">\n <mat-icon *ngIf=\"options.upload.matIcon\">{{ options.upload.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.upload.svgIcon\" [svgIcon]=\"options.upload.svgIcon\"></mat-icon>\n <div class=\"text\">\n {{ \"nice_ui_kit.assets_carousel.upload_here\" | translate }}\n </div>\n </div>\n\n <div *ngIf=\"_activeAsset && showOverlay && edit\" class=\"active-image-overlay\">\n <div\n (mouseout)=\"showOverlay=false\"\n class=\"flex flex-col justify-center items-center w-full h-full\"\n >\n <mat-icon *ngIf=\"options.upload.matIcon\">{{ options.upload.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.upload.svgIcon\" [svgIcon]=\"options.upload.svgIcon\"></mat-icon>\n </div>\n </div>\n\n <div *ngIf=\"edit\" class=\"active-buttons\">\n <button mat-icon-button (click)=\"fileInput.click(); $event.stopPropagation()\">\n <mat-icon *ngIf=\"options.actionButtons.addPhoto.matIcon\">{{ options.actionButtons.addPhoto.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.actionButtons.addPhoto.svgIcon\" [svgIcon]=\"options.actionButtons.addPhoto.svgIcon\"></mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"assetActions\" (click)=\"$event.stopPropagation()\" [disabled]=\"!_activeAsset\">\n <mat-icon *ngIf=\"options.actionButtons.moreOptions.matIcon\">{{ options.actionButtons.moreOptions.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.actionButtons.moreOptions.svgIcon\" [svgIcon]=\"options.actionButtons.moreOptions.svgIcon\"></mat-icon>\n </button>\n <mat-menu class=\"nice-asset-options-menu\" [xPosition]=\"'before'\" #assetActions=\"matMenu\">\n <button\n mat-menu-item\n *ngFor=\"let action of customActions\"\n (click)=\"clickCustom(action)\"\n >\n <mat-icon *ngIf=\"action.icon.matIcon\">{{ action.icon.matIcon }}</mat-icon>\n <mat-icon [svgIcon]=\"action.icon.svgIcon\" *ngIf=\"action.icon.svgIcon\"></mat-icon>\n <span>{{ action.name | translate }}</span>\n </button>\n <button mat-menu-item (click)=\"clickRemove()\">\n <mat-icon *ngIf=\"options.actionButtons.remove.matIcon\">{{ options.actionButtons.remove.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.actionButtons.remove.svgIcon\" [svgIcon]=\"options.actionButtons.remove.svgIcon\"></mat-icon>\n <span>{{ \"nice_ui_kit.assets_carousel.delete\" | translate }}</span>\n </button>\n </mat-menu>\n </div>\n </ng-container>\n </div>\n\n <div class=\"carousel\">\n <button *ngIf=\"showAddAssetContainer || _activeAsset\" class=\"action-button left-arrow\" mat-icon-button [disabled]=\"!_active\" (click)=\"clickLeft()\">\n <mat-icon *ngIf=\"options.leftArrow.matIcon\">{{ options.leftArrow.matIcon }}</mat-icon>\n <mat-icon class=\"arrows\" *ngIf=\"options.leftArrow.svgIcon\" [svgIcon]=\"options.leftArrow.svgIcon\"></mat-icon>\n </button>\n <div class=\"asset-list-container\">\n <div *ngIf=\"showAddAssetContainer && edit\" class=\"add-asset-container\">\n <div class=\"add-asset\" matRipple (click)=\"fileInput.click()\">\n <mat-icon *ngIf=\"options.addPhoto.matIcon\">{{ options.addPhoto.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.addPhoto.svgIcon\" [svgIcon]=\"options.addPhoto.svgIcon\"></mat-icon>\n </div>\n </div>\n <div class=\"asset-list\" [ngStyle]=\"listStyle\">\n <div\n #assets\n class=\"asset\"\n *ngFor=\"let asset of _assets; let i = index\"\n (click)=\"clickAsset(i)\"\n [ngClass]=\"color\"\n [class.active]=\"_active === i\"\n >\n <ng-container>\n <img\n *ngIf=\"asset.type === 'image'\"\n draggable=\"false\"\n [src]=\"asset.url ?? asset.base64\"\n alt=\"add-image\"\n />\n <video\n *ngIf=\"asset.type === 'video'\"\n draggable=\"false\"\n loop\n [src]=\"asset.url ?? asset.base64\"\n ></video>\n </ng-container>\n </div>\n </div>\n </div>\n <button *ngIf=\"showAddAssetContainer || _activeAsset\" class=\"action-button right-arrow\" mat-icon-button [disabled]=\"_lastAsset\" (click)=\"clickRight()\">\n <mat-icon *ngIf=\"options.rightArrow.matIcon\">{{ options.rightArrow.matIcon }}</mat-icon>\n <mat-icon class=\"arrows\" *ngIf=\"options.rightArrow.svgIcon\" [svgIcon]=\"options.rightArrow.svgIcon\"></mat-icon>\n </button>\n </div>\n</div>\n\n<input #fileInput type=\"file\" hidden [accept]=\"accept\" (change)=\"onFilesChange($event)\" [multiple]=\"multipleUpload\">\n", styles: [":root{--nice-assets-carousel-asset-width: 90px;--nice-assets-carousel-asset-height: 60px;--nice-assets-carousel-asset-gap: .75rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i2$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "directive", type: NiceDropzoneDirective, selector: "[niceDropzone]", outputs: ["filesDropped"] }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], animations: niceAnimations, encapsulation: i0.ViewEncapsulation.None });
1949
+ ], queries: [{ propertyName: "activeContent", first: true, predicate: NiceAssetsCarouselActiveContentDirective, descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "activeVideoElement", first: true, predicate: ["activeVideo"], descendants: true }, { propertyName: "assetsElement", predicate: ["assets"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"carousel-container\" niceDropzone (filesDropped)=\"onFilesDrop($event)\">\n <div\n class=\"active-image\"\n matRipple\n [class.empty-state]=\"!_activeAsset\"\n (click)=\"edit && fileInput.click();\n $event.stopPropagation()\"\n >\n <div *ngIf=\"loading\" class=\"flex flex-row justify-center items-center h-full\">\n <mat-spinner [diameter]=\"32\"></mat-spinner>\n </div>\n <ng-container *ngIf=\"!loading\">\n <ng-container\n *ngIf=\"_activeAsset && activeContent\"\n [ngTemplateOutlet]=\"activeContent\"\n [ngTemplateOutletContext]=\"{ $implicit: _activeAsset}\"\n ></ng-container>\n <img\n *ngIf=\"_activeAsset?.type === 'image'\"\n (mouseover)=\"showOverlay=true\"\n [src]=\"_activeAsset.url ?? _activeAsset.base64\"\n draggable=\"false\"\n class=\"relative\"\n alt=\"active-image\"\n >\n <video #activeVideo *ngIf=\"_activeAsset?.type === 'video'\" draggable=\"false\" loop [src]=\"_activeAsset.url ?? _activeAsset.base64\"></video>\n\n <div class=\"empty-state-content\" *ngIf=\"!_activeAsset\">\n <mat-icon *ngIf=\"options.upload.matIcon\">{{ options.upload.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.upload.svgIcon\" [svgIcon]=\"options.upload.svgIcon\"></mat-icon>\n <div class=\"text\">\n {{ \"nice_ui_kit.assets_carousel.upload_here\" | translate }}\n </div>\n </div>\n\n <div *ngIf=\"_activeAsset && showOverlay && edit\" class=\"active-image-overlay\">\n <div\n (mouseout)=\"showOverlay=false\"\n class=\"flex flex-col justify-center items-center w-full h-full\"\n >\n <mat-icon *ngIf=\"options.upload.matIcon\">{{ options.upload.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.upload.svgIcon\" [svgIcon]=\"options.upload.svgIcon\"></mat-icon>\n </div>\n </div>\n\n <div *ngIf=\"edit\" class=\"active-buttons\">\n <button mat-icon-button (click)=\"fileInput.click(); $event.stopPropagation()\">\n <mat-icon *ngIf=\"options.actionButtons.addPhoto.matIcon\">{{ options.actionButtons.addPhoto.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.actionButtons.addPhoto.svgIcon\" [svgIcon]=\"options.actionButtons.addPhoto.svgIcon\"></mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"assetActions\" (click)=\"$event.stopPropagation()\" [disabled]=\"!_activeAsset\">\n <mat-icon *ngIf=\"options.actionButtons.moreOptions.matIcon\">{{ options.actionButtons.moreOptions.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.actionButtons.moreOptions.svgIcon\" [svgIcon]=\"options.actionButtons.moreOptions.svgIcon\"></mat-icon>\n </button>\n <mat-menu class=\"nice-asset-options-menu\" [xPosition]=\"'before'\" #assetActions=\"matMenu\">\n <button\n mat-menu-item\n *ngFor=\"let action of customActions\"\n (click)=\"clickCustom(action)\"\n >\n <mat-icon *ngIf=\"action.icon.matIcon\">{{ action.icon.matIcon }}</mat-icon>\n <mat-icon [svgIcon]=\"action.icon.svgIcon\" *ngIf=\"action.icon.svgIcon\"></mat-icon>\n <span>{{ action.name | translate }}</span>\n </button>\n <button mat-menu-item (click)=\"clickRemove()\">\n <mat-icon *ngIf=\"options.actionButtons.remove.matIcon\">{{ options.actionButtons.remove.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.actionButtons.remove.svgIcon\" [svgIcon]=\"options.actionButtons.remove.svgIcon\"></mat-icon>\n <span>{{ \"nice_ui_kit.assets_carousel.delete\" | translate }}</span>\n </button>\n </mat-menu>\n </div>\n </ng-container>\n </div>\n\n <div class=\"carousel\">\n <button *ngIf=\"showAddAssetContainer || _activeAsset\" class=\"action-button left-arrow\" mat-icon-button [disabled]=\"!_active\" (click)=\"clickLeft()\">\n <mat-icon *ngIf=\"options.leftArrow.matIcon\">{{ options.leftArrow.matIcon }}</mat-icon>\n <mat-icon class=\"arrows\" *ngIf=\"options.leftArrow.svgIcon\" [svgIcon]=\"options.leftArrow.svgIcon\"></mat-icon>\n </button>\n <div class=\"asset-list-container\">\n <div *ngIf=\"showAddAssetContainer && edit\" class=\"add-asset-container\">\n <div class=\"add-asset\" matRipple (click)=\"fileInput.click()\">\n <mat-icon *ngIf=\"options.addPhoto.matIcon\">{{ options.addPhoto.matIcon }}</mat-icon>\n <mat-icon *ngIf=\"options.addPhoto.svgIcon\" [svgIcon]=\"options.addPhoto.svgIcon\"></mat-icon>\n </div>\n </div>\n <div class=\"asset-list\" [ngStyle]=\"listStyle\">\n <div\n #assets\n class=\"asset\"\n *ngFor=\"let asset of _assets; let i = index\"\n (click)=\"clickAsset(i)\"\n [ngClass]=\"color\"\n [class.active]=\"_active === i\"\n >\n <ng-container>\n <img\n *ngIf=\"asset.type === 'image'\"\n draggable=\"false\"\n [src]=\"asset.url ?? asset.base64\"\n alt=\"add-image\"\n />\n <video\n *ngIf=\"asset.type === 'video'\"\n draggable=\"false\"\n loop\n [src]=\"asset.url ?? asset.base64\"\n ></video>\n </ng-container>\n </div>\n </div>\n </div>\n <button *ngIf=\"showAddAssetContainer || _activeAsset\" class=\"action-button right-arrow\" mat-icon-button [disabled]=\"_lastAsset\" (click)=\"clickRight()\">\n <mat-icon *ngIf=\"options.rightArrow.matIcon\">{{ options.rightArrow.matIcon }}</mat-icon>\n <mat-icon class=\"arrows\" *ngIf=\"options.rightArrow.svgIcon\" [svgIcon]=\"options.rightArrow.svgIcon\"></mat-icon>\n </button>\n </div>\n</div>\n\n<input #fileInput type=\"file\" hidden [accept]=\"accept\" (change)=\"onFilesChange($event)\" [multiple]=\"multipleUpload\">\n", styles: [":root{--nice-assets-carousel-asset-width: 90px;--nice-assets-carousel-asset-height: 60px;--nice-assets-carousel-asset-gap: .75rem}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i4$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i2$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "directive", type: NiceDropzoneDirective, selector: "[niceDropzone]", outputs: ["filesDropped"] }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], animations: niceAnimations, encapsulation: i0.ViewEncapsulation.None });
1926
1950
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceAssetsCarouselComponent, decorators: [{
1927
1951
  type: Component,
1928
1952
  args: [{ selector: "nice-assets-carousel", encapsulation: ViewEncapsulation.None, animations: niceAnimations, providers: [
@@ -10096,16 +10120,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
10096
10120
  }]
10097
10121
  }] });
10098
10122
 
10099
- class TranslationFormService {
10123
+ class NiceTranslationFormService {
10100
10124
  constructor() {
10101
10125
  this._languages$ = new BehaviorSubject([]);
10102
10126
  this._requiredLanguages$ = new BehaviorSubject([]);
10103
10127
  }
10104
10128
  get languages$() {
10105
- return this._languages$;
10129
+ return this._languages$.asObservable();
10130
+ }
10131
+ get languages() {
10132
+ return this._languages$.getValue();
10106
10133
  }
10107
10134
  get requiredLanguages$() {
10108
- return this._requiredLanguages$;
10135
+ return this._requiredLanguages$.asObservable();
10136
+ }
10137
+ get requiredLanguages() {
10138
+ return this._requiredLanguages$.value;
10139
+ }
10140
+ get hasLanguages$() {
10141
+ return this._languages$.asObservable().pipe(map((languages) => !!(languages === null || languages === void 0 ? void 0 : languages.length)));
10142
+ }
10143
+ get hasLanguages() {
10144
+ var _a;
10145
+ return !!((_a = this.languages) === null || _a === void 0 ? void 0 : _a.length);
10109
10146
  }
10110
10147
  setLanguages(languages) {
10111
10148
  this._languages$.next(languages !== null && languages !== void 0 ? languages : []);
@@ -10114,7 +10151,7 @@ class TranslationFormService {
10114
10151
  if (!(languages === null || languages === void 0 ? void 0 : languages.length)) {
10115
10152
  this._requiredLanguages$.next([]);
10116
10153
  }
10117
- const languagesValues = this.languages$.getValue();
10154
+ const languagesValues = this.languages;
10118
10155
  const unregisteredLanguages = languages === null || languages === void 0 ? void 0 : languages.filter((language) => !languagesValues.includes(language));
10119
10156
  if (unregisteredLanguages === null || unregisteredLanguages === void 0 ? void 0 : unregisteredLanguages.length) {
10120
10157
  throw new Error(`You provided languages that are not configured
@@ -10130,9 +10167,9 @@ class TranslationFormService {
10130
10167
  }
10131
10168
  }
10132
10169
  }
10133
- TranslationFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10134
- TranslationFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormService, providedIn: "root" });
10135
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormService, decorators: [{
10170
+ NiceTranslationFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceTranslationFormService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
10171
+ NiceTranslationFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceTranslationFormService, providedIn: "root" });
10172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: NiceTranslationFormService, decorators: [{
10136
10173
  type: Injectable,
10137
10174
  args: [{
10138
10175
  providedIn: "root",
@@ -10160,12 +10197,12 @@ class TranslationContextDirective {
10160
10197
  this.activeLanguage$.next(language);
10161
10198
  }
10162
10199
  }
10163
- TranslationContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationContextDirective, deps: [{ token: TranslationFormService }], target: i0.ɵɵFactoryTarget.Directive });
10200
+ TranslationContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationContextDirective, deps: [{ token: NiceTranslationFormService }], target: i0.ɵɵFactoryTarget.Directive });
10164
10201
  TranslationContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.3", type: TranslationContextDirective, selector: "[niceTranslationContext]", ngImport: i0 });
10165
10202
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationContextDirective, decorators: [{
10166
10203
  type: Directive,
10167
10204
  args: [{ selector: "[niceTranslationContext]" }]
10168
- }], ctorParameters: function () { return [{ type: TranslationFormService }]; } });
10205
+ }], ctorParameters: function () { return [{ type: NiceTranslationFormService }]; } });
10169
10206
 
10170
10207
  class TranslationToggleComponent {
10171
10208
  constructor(context, translationFormService) {
@@ -10178,54 +10215,12 @@ class TranslationToggleComponent {
10178
10215
  this.context.updateLanguage($event.value);
10179
10216
  }
10180
10217
  }
10181
- 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 });
10218
+ 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 });
10182
10219
  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" }] });
10183
10220
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationToggleComponent, decorators: [{
10184
10221
  type: Component,
10185
10222
  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" }]
10186
- }], ctorParameters: function () { return [{ type: TranslationContextDirective }, { type: TranslationFormService }]; } });
10187
-
10188
- function RequireForLanguages() {
10189
- return registerAsyncValidatorDecorator({
10190
- name: "RequireForLanguages",
10191
- });
10192
- }
10193
- class RequireForLanguagesValidator extends AsyncValidator {
10194
- constructor(service) {
10195
- super();
10196
- this.service = service;
10197
- this.name = "RequireForLanguages";
10198
- }
10199
- validate(formGroup) {
10200
- const requiredLanguages = this.service.requiredLanguages$.getValue();
10201
- if (!requiredLanguages.length) {
10202
- return of(null);
10203
- }
10204
- const missingLanguages = [];
10205
- for (const requiredLanguage of requiredLanguages) {
10206
- const control = formGroup.get(requiredLanguage);
10207
- if (control === null || control === void 0 ? void 0 : control.value) {
10208
- continue;
10209
- }
10210
- missingLanguages.push(requiredLanguage);
10211
- }
10212
- if (missingLanguages === null || missingLanguages === void 0 ? void 0 : missingLanguages.length) {
10213
- return of({ languageRequired: { missingLanguages } });
10214
- }
10215
- return of(null);
10216
- }
10217
- }
10218
- RequireForLanguagesValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, deps: [{ token: TranslationFormService }], target: i0.ɵɵFactoryTarget.Injectable });
10219
- RequireForLanguagesValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator });
10220
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, decorators: [{
10221
- type: Injectable
10222
- }], ctorParameters: function () { return [{ type: TranslationFormService }]; } });
10223
-
10224
- class TranslationForm {
10225
- constructor(values) {
10226
- Object.assign(this, values !== null && values !== void 0 ? values : {});
10227
- }
10228
- }
10223
+ }], ctorParameters: function () { return [{ type: TranslationContextDirective }, { type: NiceTranslationFormService }]; } });
10229
10224
 
10230
10225
  class TranslationFormComponent {
10231
10226
  constructor(container, context, service, changeDetectorRef) {
@@ -10349,14 +10344,14 @@ class TranslationFormComponent {
10349
10344
  this.currentControl = this.formGroup.get(languages[0]);
10350
10345
  }
10351
10346
  }
10352
- 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 });
10347
+ 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 });
10353
10348
  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 });
10354
10349
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: TranslationFormComponent, decorators: [{
10355
10350
  type: Component,
10356
10351
  args: [{
10357
10352
  template: ``,
10358
10353
  }]
10359
- }], ctorParameters: function () { return [{ type: i1$2.ControlContainer }, { type: TranslationContextDirective }, { type: TranslationFormService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { classList: [{
10354
+ }], ctorParameters: function () { return [{ type: i1$2.ControlContainer }, { type: TranslationContextDirective }, { type: NiceTranslationFormService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { classList: [{
10360
10355
  type: HostBinding,
10361
10356
  args: ["class"]
10362
10357
  }], shouldLabelFloat: [{
@@ -10429,6 +10424,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
10429
10424
  ], template: "<input\n matInput\n [formControl]=\"currentControl\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n/>\n" }]
10430
10425
  }] });
10431
10426
 
10427
+ function RequireForLanguages() {
10428
+ return registerAsyncValidatorDecorator({
10429
+ name: "RequireForLanguages",
10430
+ });
10431
+ }
10432
+ class RequireForLanguagesValidator extends AsyncValidator {
10433
+ constructor(service) {
10434
+ super();
10435
+ this.service = service;
10436
+ this.name = "RequireForLanguages";
10437
+ }
10438
+ validate(formGroup) {
10439
+ return this.service.requiredLanguages$.pipe(take(1), map((requiredLanguages) => {
10440
+ if (!requiredLanguages.length) {
10441
+ return null;
10442
+ }
10443
+ const missingLanguages = [];
10444
+ for (const requiredLanguage of requiredLanguages) {
10445
+ const control = formGroup.get(requiredLanguage);
10446
+ if (control === null || control === void 0 ? void 0 : control.value) {
10447
+ continue;
10448
+ }
10449
+ missingLanguages.push(requiredLanguage);
10450
+ }
10451
+ if (missingLanguages === null || missingLanguages === void 0 ? void 0 : missingLanguages.length) {
10452
+ return { languageRequired: { missingLanguages } };
10453
+ }
10454
+ return null;
10455
+ }));
10456
+ }
10457
+ }
10458
+ RequireForLanguagesValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, deps: [{ token: NiceTranslationFormService }], target: i0.ɵɵFactoryTarget.Injectable });
10459
+ RequireForLanguagesValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator });
10460
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImport: i0, type: RequireForLanguagesValidator, decorators: [{
10461
+ type: Injectable
10462
+ }], ctorParameters: function () { return [{ type: NiceTranslationFormService }]; } });
10463
+
10432
10464
  class NiceTranslationFormModule {
10433
10465
  static forRoot() {
10434
10466
  return {
@@ -10489,7 +10521,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
10489
10521
  }] });
10490
10522
 
10491
10523
  // tslint:disable-next-line:variable-name
10492
- const TranslationFormDecorator = () => DynamicGroup();
10524
+ const TranslationFormGroup = () => DynamicGroup();
10525
+
10526
+ class TranslationForm {
10527
+ constructor(values) {
10528
+ Object.assign(this, values !== null && values !== void 0 ? values : {});
10529
+ }
10530
+ }
10493
10531
 
10494
10532
  class NiceAutofocusDirective {
10495
10533
  constructor(elem) {
@@ -11372,5 +11410,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.3", ngImpor
11372
11410
  * Generated bundle index. Do not edit.
11373
11411
  */
11374
11412
 
11375
- 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 };
11413
+ 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 };
11376
11414
  //# sourceMappingURL=recursyve-nice-ui-kit.v2.mjs.map