@valtimo/layout 13.2.1 → 13.3.0

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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, InjectionToken, EventEmitter, computed, Output, Input, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, signal, ViewChild, Optional, Inject, ViewContainerRef, NgModule } from '@angular/core';
3
- import { Subscription, debounceTime, map, BehaviorSubject, combineLatest, filter, tap, switchMap, take, of, startWith, delay, Subject } from 'rxjs';
3
+ import { Subscription, debounceTime, map, BehaviorSubject, combineLatest, filter, tap, switchMap, take, of, startWith, merge, delay, Subject } from 'rxjs';
4
4
  import * as i4 from '@angular/common';
5
5
  import { CommonModule, DOCUMENT } from '@angular/common';
6
6
  import * as i2 from '@angular/forms';
@@ -18,12 +18,12 @@ import { filter as filter$1 } from 'rxjs/operators';
18
18
  import * as i2$3 from '@valtimo/shared';
19
19
  import { GlobalNotificationComponent, ROLE_ADMIN } from '@valtimo/shared';
20
20
  import { isEqual, cloneDeep } from 'lodash';
21
+ import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
21
22
  import * as i1$1 from '@valtimo/form';
22
23
  import * as i2$4 from '@valtimo/document';
23
24
  import * as i3$1 from '@valtimo/access-control';
24
25
  import { v4 } from 'uuid';
25
26
  import Muuri from 'muuri';
26
- import { toObservable } from '@angular/core/rxjs-interop';
27
27
  import { AuthGuardService } from '@valtimo/security';
28
28
 
29
29
  /*
@@ -1201,7 +1201,7 @@ class WidgetFieldComponent {
1201
1201
  isRawValue: this.viewContentService.isRawValue({
1202
1202
  ...property.displayProperties,
1203
1203
  viewType: property.displayProperties?.type ?? ViewType.TEXT,
1204
- })
1204
+ }),
1205
1205
  },
1206
1206
  ]
1207
1207
  : []),
@@ -1454,7 +1454,7 @@ class TranslationManagementComponent {
1454
1454
  });
1455
1455
  }
1456
1456
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementComponent, deps: [{ token: i2$1.TranslateService }, { token: i2$3.LocalizationService }, { token: i1.PageHeaderService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
1457
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TranslationManagementComponent, isStandalone: false, selector: "valtimo-translation-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n localizationTranslationValues: localizationTranslationValues$ | async,\n loading: loading$ | async,\n disabled: disabled$ | async,\n multiInputTitles: multiInputTiles$ | async,\n amountOfArbitraryValues: amountOfArbitraryValues$ | async,\n showConfirmationModal: showConfirmationModal$,\n allChangedValuesValid: allChangedValuesValid$ | async,\n valuesChanged: valuesChanged$ | async,\n compactMode: compactMode$ | async,\n } as obs\"\n>\n <ng-container *ngIf=\"!obs.loading && obs.localizationTranslationValues; else loading\">\n <valtimo-carbon-multi-input\n [disabled]=\"obs.disabled\"\n [arbitraryAmountTitles]=\"obs.multiInputTitles\"\n [fullWidth]=\"true\"\n [minimumAmountOfRows]=\"0\"\n type=\"arbitraryAmount\"\n [arbitraryValueAmount]=\"obs.amountOfArbitraryValues\"\n [defaultValues]=\"obs.localizationTranslationValues\"\n (allValuesValidEvent)=\"validChange($event)\"\n (valueChange)=\"valueChange($event)\"\n addRowTranslationKey=\"translationManagement.add\"\n ></valtimo-carbon-multi-input>\n </ng-container>\n\n <ng-template #loading>\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n </ng-template>\n\n <valtimo-confirmation-modal\n [showModalSubject$]=\"obs.showConfirmationModal\"\n (confirmEvent)=\"saveAndRefresh()\"\n (optionalEvent)=\"saveAndStay()\"\n (cancelEvent)=\"cancel()\"\n [showOptionalButton]=\"true\"\n cancelButtonType=\"ghost\"\n optionalButtonType=\"secondary\"\n confirmButtonTextTranslationKey=\"translationManagement.saveWithReload\"\n optionalButtonTextTranslationKey=\"translationManagement.saveWithoutReload\"\n titleTranslationKey=\"translationManagement.modalTitle\"\n contentTranslationKey=\"translationManagement.modalContent\"\n [spacerAfterCancelButton]=\"true\"\n ></valtimo-confirmation-modal>\n\n <ng-container renderInPageHeader>\n <ng-template>\n <button\n cdsButton=\"primary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"showModal()\"\n [disabled]=\"!obs.allChangedValuesValid || obs.disabled || !obs.valuesChanged\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </ng-template>\n </ng-container>\n</ng-container>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.CarbonMultiInputComponent, selector: "valtimo-carbon-multi-input", inputs: ["addRowText", "addRowTranslationKey", "arbitraryAmountTitles", "arbitraryValueAmount", "defaultValues", "deleteRowText", "deleteRowTranslationKey", "disabled", "dropdownColumnTitle", "dropdownItems", "dropdownWidth", "fullWidth", "hideAddButton", "hideDeleteButton", "initialAmountOfRows", "keyColumnTitle", "margin", "maxRows", "minimumAmountOfRows", "name", "required", "title", "titleTranslationKey", "tooltip", "type", "valueColumnTitle", "valuePathSelectorCaseDefinitionKey", "valuePathSelectorPrefixes", "valuePathSelectorShowCaseDefinitionSelector", "valuePathSelectorNotation", "keyColumnFlex", "dropdownColumnFlex", "valueColumnFlex"], outputs: ["valueChange", "allValuesValidEvent"] }, { kind: "component", type: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "directive", type: i1.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
1457
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TranslationManagementComponent, isStandalone: false, selector: "valtimo-translation-management", ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container\n *ngIf=\"{\n localizationTranslationValues: localizationTranslationValues$ | async,\n loading: loading$ | async,\n disabled: disabled$ | async,\n multiInputTitles: multiInputTiles$ | async,\n amountOfArbitraryValues: amountOfArbitraryValues$ | async,\n showConfirmationModal: showConfirmationModal$,\n allChangedValuesValid: allChangedValuesValid$ | async,\n valuesChanged: valuesChanged$ | async,\n compactMode: compactMode$ | async,\n } as obs\"\n>\n <ng-container *ngIf=\"!obs.loading && obs.localizationTranslationValues; else loading\">\n <valtimo-carbon-multi-input\n [disabled]=\"obs.disabled\"\n [arbitraryAmountTitles]=\"obs.multiInputTitles\"\n [fullWidth]=\"true\"\n [minimumAmountOfRows]=\"0\"\n type=\"arbitraryAmount\"\n [arbitraryValueAmount]=\"obs.amountOfArbitraryValues\"\n [defaultValues]=\"obs.localizationTranslationValues\"\n (allValuesValidEvent)=\"validChange($event)\"\n (valueChange)=\"valueChange($event)\"\n addRowTranslationKey=\"translationManagement.add\"\n ></valtimo-carbon-multi-input>\n </ng-container>\n\n <ng-template #loading>\n <div class=\"loading-container\"><cds-loading></cds-loading></div>\n </ng-template>\n\n <valtimo-confirmation-modal\n [showModalSubject$]=\"obs.showConfirmationModal\"\n (confirmEvent)=\"saveAndRefresh()\"\n (optionalEvent)=\"saveAndStay()\"\n (cancelEvent)=\"cancel()\"\n [showOptionalButton]=\"true\"\n cancelButtonType=\"ghost\"\n optionalButtonType=\"secondary\"\n confirmButtonTextTranslationKey=\"translationManagement.saveWithReload\"\n optionalButtonTextTranslationKey=\"translationManagement.saveWithoutReload\"\n titleTranslationKey=\"translationManagement.modalTitle\"\n contentTranslationKey=\"translationManagement.modalContent\"\n [spacerAfterCancelButton]=\"true\"\n ></valtimo-confirmation-modal>\n\n <ng-container renderInPageHeader>\n <ng-template>\n <button\n cdsButton=\"primary\"\n [size]=\"obs.compactMode ? 'sm' : 'md'\"\n (click)=\"showModal()\"\n [disabled]=\"!obs.allChangedValuesValid || obs.disabled || !obs.valuesChanged\"\n >\n {{ 'interface.save' | translate }}\n\n <svg class=\"cds--btn__icon\" cdsIcon=\"save\" size=\"16\"></svg>\n </button>\n </ng-template>\n </ng-container>\n</ng-container>\n", styles: [".loading-container{display:flex;width:100%;justify-content:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.CarbonMultiInputComponent, selector: "valtimo-carbon-multi-input", inputs: ["addRowText", "addButtonType", "addRowTranslationKey", "arbitraryAmountTitles", "arbitraryValueAmount", "defaultValues", "deleteRowText", "deleteRowTranslationKey", "disabled", "dropdownColumnTitle", "dropdownItems", "dropdownWidth", "fullWidth", "hideAddButton", "hideDeleteButton", "initialAmountOfRows", "keyColumnTitle", "margin", "maxRows", "minimumAmountOfRows", "name", "required", "title", "titleTranslationKey", "tooltip", "type", "valueColumnTitle", "valuePathSelectorCaseDefinitionKey", "valuePathSelectorPrefixes", "valuePathSelectorShowCaseDefinitionSelector", "valuePathSelectorNotation", "keyColumnFlex", "dropdownColumnFlex", "valueColumnFlex"], outputs: ["valueChange", "allValuesValidEvent"] }, { kind: "component", type: i3.Loading, selector: "cds-loading, ibm-loading", inputs: ["title", "isActive", "size", "overlay"] }, { kind: "directive", type: i1.RenderInPageHeaderDirective, selector: "[renderInPageHeader]", inputs: ["fullWidth"] }, { kind: "directive", type: i3.Button, selector: "[cdsButton], [ibmButton]", inputs: ["ibmButton", "cdsButton", "size", "skeleton", "iconOnly", "isExpressive"] }, { kind: "directive", type: i3.IconDirective, selector: "[cdsIcon], [ibmIcon]", inputs: ["ibmIcon", "cdsIcon", "size", "title", "ariaLabel", "ariaLabelledBy", "ariaHidden", "isFocusable"] }, { kind: "component", type: i1.ConfirmationModalComponent, selector: "valtimo-confirmation-modal", inputs: ["titleTranslationKey", "title", "content", "contentTranslationKey", "confirmButtonText", "confirmButtonTextTranslationKey", "confirmButtonType", "showOptionalButton", "optionalButtonText", "optionalButtonTextTranslationKey", "optionalButtonType", "cancelButtonText", "cancelButtonTextTranslationKey", "cancelButtonType", "showModalSubject$", "outputOnConfirm", "outputOnOptional", "spacerAfterCancelButton"], outputs: ["confirmEvent", "optionalEvent", "cancelEvent"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
1458
1458
  }
1459
1459
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslationManagementComponent, decorators: [{
1460
1460
  type: Component,
@@ -1506,7 +1506,22 @@ class WidgetFormioComponent {
1506
1506
  this._widgetConfigurationSubject$.next(value);
1507
1507
  }
1508
1508
  set widgetUuid(value) {
1509
+ this._widgetUuid = value;
1510
+ this._hasSignalledExternalDataReady = false;
1509
1511
  this.widgetLayoutService.setWidgetDataLoaded(value);
1512
+ this.widgetLayoutService.setWidgetWithExternalData(value);
1513
+ }
1514
+ set refreshForm(value) {
1515
+ if (value === this._refreshEmitter)
1516
+ return;
1517
+ this._refreshSubscription?.unsubscribe();
1518
+ this._refreshSubscription = null;
1519
+ this._refreshEmitter = value;
1520
+ if (!value)
1521
+ return;
1522
+ this._refreshSubscription = value
1523
+ .pipe(takeUntilDestroyed(this.destroyRef))
1524
+ .subscribe(() => this._refreshTrigger$.next());
1510
1525
  }
1511
1526
  get widgetConfiguration$() {
1512
1527
  return this._widgetConfigurationSubject$.pipe(filter(config => !!config));
@@ -1514,33 +1529,47 @@ class WidgetFormioComponent {
1514
1529
  get _documentId$() {
1515
1530
  return this._documentIdSubject$.pipe(filter(id => !!id));
1516
1531
  }
1517
- constructor(formService, widgetLayoutService) {
1532
+ constructor(formService, widgetLayoutService, destroyRef) {
1518
1533
  this.formService = formService;
1519
1534
  this.widgetLayoutService = widgetLayoutService;
1535
+ this.destroyRef = destroyRef;
1536
+ this._refreshTrigger$ = new BehaviorSubject(undefined);
1537
+ this._refreshEmitter = null;
1538
+ this._refreshSubscription = null;
1539
+ this._widgetUuid = null;
1540
+ this._hasSignalledExternalDataReady = false;
1520
1541
  this._widgetConfigurationSubject$ = new BehaviorSubject(null);
1521
1542
  this._documentIdSubject$ = new BehaviorSubject('');
1522
1543
  this.prefilledFormDefinition$ = combineLatest([
1523
1544
  this.widgetConfiguration$,
1524
1545
  this._documentId$,
1546
+ this._refreshTrigger$,
1525
1547
  ]).pipe(switchMap(([config, documentId]) => combineLatest([
1526
1548
  this.formService.getFormDefinitionByNamePreFilled(config.properties.formDefinitionName, documentId),
1527
1549
  of(config),
1528
1550
  ])), tap(() => {
1529
- this.widgetLayoutService.setWidgetDataLoaded(this.widgetUuid);
1551
+ if (!this._widgetUuid)
1552
+ return;
1553
+ if (!this._hasSignalledExternalDataReady) {
1554
+ this.widgetLayoutService.setWidgetWithExternalDataReady(this._widgetUuid);
1555
+ this._hasSignalledExternalDataReady = true;
1556
+ }
1530
1557
  }), map(([formDef]) => formDef));
1531
1558
  }
1532
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFormioComponent, deps: [{ token: i1$1.FormService }, { token: WidgetLayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
1533
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetFormioComponent, isStandalone: true, selector: "valtimo-widget-formio", inputs: { documentId: "documentId", widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"formio-widget\"\n *ngIf=\"{\n prefilledFormDefinition: prefilledFormDefinition$ | async,\n widgetConfiguration: widgetConfiguration$ | async,\n } as obs\"\n>\n <section class=\"formio-widget__header\">\n <h4 class=\"formio-widget__title\">{{ obs.widgetConfiguration$?.title || '-' }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n <valtimo-form-io [form]=\"obs.prefilledFormDefinition\"></valtimo-form-io>\n</div>\n", styles: [".loading-container{display:flex;width:100%;flex-direction:row;justify-content:center}.error-message{text-align:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormIoModule }, { kind: "component", type: i1.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change", "event"] }, { kind: "ngmodule", type: ButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1559
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFormioComponent, deps: [{ token: i1$1.FormService }, { token: WidgetLayoutService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component }); }
1560
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: WidgetFormioComponent, isStandalone: true, selector: "valtimo-widget-formio", inputs: { documentId: "documentId", widgetConfiguration: "widgetConfiguration", widgetUuid: "widgetUuid", refreshForm: "refreshForm" }, ngImport: i0, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"formio-widget\"\n *ngIf=\"{\n prefilledFormDefinition: prefilledFormDefinition$ | async,\n widgetConfiguration: widgetConfiguration$ | async,\n } as obs\"\n>\n <section class=\"formio-widget__header\">\n <h4 class=\"formio-widget__title\">{{ obs.widgetConfiguration$?.title || '-' }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n <valtimo-form-io [form]=\"obs.prefilledFormDefinition\"></valtimo-form-io>\n</div>\n", styles: [".loading-container{display:flex;width:100%;flex-direction:row;justify-content:center}.error-message{text-align:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: FormIoModule }, { kind: "component", type: i1.FormioComponent, selector: "valtimo-form-io", inputs: ["options", "submission", "form", "readOnly", "formRefresh$"], outputs: ["submit", "change", "event"] }, { kind: "ngmodule", type: ButtonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1534
1561
  }
1535
1562
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: WidgetFormioComponent, decorators: [{
1536
1563
  type: Component,
1537
1564
  args: [{ selector: 'valtimo-widget-formio', standalone: true, imports: [CommonModule, TranslateModule, FormIoModule, ButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n ~ Copyright 2015-2025 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"formio-widget\"\n *ngIf=\"{\n prefilledFormDefinition: prefilledFormDefinition$ | async,\n widgetConfiguration: widgetConfiguration$ | async,\n } as obs\"\n>\n <section class=\"formio-widget__header\">\n <h4 class=\"formio-widget__title\">{{ obs.widgetConfiguration$?.title || '-' }}</h4>\n\n <ng-content></ng-content>\n </section>\n\n <valtimo-form-io [form]=\"obs.prefilledFormDefinition\"></valtimo-form-io>\n</div>\n", styles: [".loading-container{display:flex;width:100%;flex-direction:row;justify-content:center}.error-message{text-align:center}\n/*!\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
1538
- }], ctorParameters: () => [{ type: i1$1.FormService }, { type: WidgetLayoutService }], propDecorators: { documentId: [{
1565
+ }], ctorParameters: () => [{ type: i1$1.FormService }, { type: WidgetLayoutService }, { type: i0.DestroyRef }], propDecorators: { documentId: [{
1539
1566
  type: Input
1540
1567
  }], widgetConfiguration: [{
1541
1568
  type: Input
1542
1569
  }], widgetUuid: [{
1543
1570
  type: Input
1571
+ }], refreshForm: [{
1572
+ type: Input
1544
1573
  }] } });
1545
1574
 
1546
1575
  /*
@@ -2144,9 +2173,11 @@ class WidgetContainerComponent {
2144
2173
  if (!value)
2145
2174
  return;
2146
2175
  const widgetsWithUuids = value.map(widget => ({ ...widget, uuid: v4() }));
2176
+ this.resetLayout();
2147
2177
  this.widgetLayoutService.setWidgets(widgetsWithUuids);
2148
2178
  this.widgetsWithUuids$.next(widgetsWithUuids);
2149
2179
  this.loadingWidgetConfiguration$.next(false);
2180
+ this.initLayout();
2150
2181
  }
2151
2182
  get widgetComponentMap$() {
2152
2183
  return this._widgetComponentMap$.pipe(filter$1(componentMap => componentMap !== null));
@@ -2160,9 +2191,20 @@ class WidgetContainerComponent {
2160
2191
  this._widgetComponentMap$ = new BehaviorSubject(DEFAULT_WIDGET_COMPONENT_MAP);
2161
2192
  this.widgetParams = {};
2162
2193
  this.loadingWidgetConfiguration$ = new BehaviorSubject(true);
2163
- this.loaded$ = this.widgetLayoutService.loaded$.pipe(delay(400));
2194
+ this.reload$ = new BehaviorSubject(false);
2195
+ this.loaded$ = merge(this.reload$, this.widgetLayoutService.loaded$.pipe(delay(400)));
2164
2196
  }
2165
- ngAfterViewInit() {
2197
+ resetLayout() {
2198
+ if (!this._observer)
2199
+ return;
2200
+ this.reload$.next(false);
2201
+ this.destroyLayout();
2202
+ }
2203
+ destroyLayout() {
2204
+ this.widgetLayoutService.reset();
2205
+ this._observer?.disconnect();
2206
+ }
2207
+ initLayout() {
2166
2208
  this._observer = new ResizeObserver(event => {
2167
2209
  this.observerMutation(event);
2168
2210
  });
@@ -2170,8 +2212,7 @@ class WidgetContainerComponent {
2170
2212
  this.initMuuri();
2171
2213
  }
2172
2214
  ngOnDestroy() {
2173
- this._observer?.disconnect();
2174
- this.widgetLayoutService.reset();
2215
+ this.destroyLayout();
2175
2216
  }
2176
2217
  observerMutation(event) {
2177
2218
  const containerWidth = event[0]?.borderBoxSize[0]?.inlineSize;