valtech-components 2.0.569 → 2.0.571

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.
@@ -8745,15 +8745,28 @@ class SelectSearchComponent {
8745
8745
  event.stopPropagation();
8746
8746
  this.openModal();
8747
8747
  }
8748
- cancelModal() {
8749
- // Reset filter and show all options when closing modal
8748
+ /**
8749
+ * Reset state only - called by didDismiss event
8750
+ * Separated from closeModal to avoid double dismissal and scroll issues
8751
+ */
8752
+ resetState() {
8750
8753
  this.searchTerm = '';
8751
8754
  this.filteredItems = this.props?.options ? [...this.props.options] : [];
8752
- this.changeDetector.detectChanges();
8755
+ }
8756
+ /**
8757
+ * Close modal only - does not reset state (didDismiss will handle that)
8758
+ */
8759
+ closeModal() {
8753
8760
  if (this.modal) {
8754
8761
  this.modal.dismiss();
8755
8762
  }
8756
8763
  }
8764
+ /**
8765
+ * @deprecated Use closeModal() instead. Kept for backwards compatibility.
8766
+ */
8767
+ cancelModal() {
8768
+ this.closeModal();
8769
+ }
8757
8770
  selectItem(item) {
8758
8771
  if (this.multiple) {
8759
8772
  const index = this.selectedItems.findIndex(selectedItem => selectedItem[this.valueProperty] === item[this.valueProperty]);
@@ -8766,7 +8779,7 @@ class SelectSearchComponent {
8766
8779
  }
8767
8780
  else {
8768
8781
  this.selectedItems = [item];
8769
- this.cancelModal();
8782
+ this.closeModal();
8770
8783
  }
8771
8784
  this.updateDisplayValue();
8772
8785
  this.applyChanges();
@@ -8836,7 +8849,7 @@ class SelectSearchComponent {
8836
8849
  trigger="open-modal"
8837
8850
  [initialBreakpoint]="1"
8838
8851
  [breakpoints]="[0, 0.5, 0.75, 1]"
8839
- (didDismiss)="cancelModal()"
8852
+ (didDismiss)="resetState()"
8840
8853
  >
8841
8854
  <ng-template>
8842
8855
  <ion-header>
@@ -8883,7 +8896,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
8883
8896
  trigger="open-modal"
8884
8897
  [initialBreakpoint]="1"
8885
8898
  [breakpoints]="[0, 0.5, 0.75, 1]"
8886
- (didDismiss)="cancelModal()"
8899
+ (didDismiss)="resetState()"
8887
8900
  >
8888
8901
  <ng-template>
8889
8902
  <ion-header>
@@ -11865,15 +11878,28 @@ class MultiSelectSearchComponent {
11865
11878
  event.stopPropagation();
11866
11879
  this.openModal();
11867
11880
  }
11868
- cancelModal() {
11869
- // Reset filter and show all options when closing modal
11881
+ /**
11882
+ * Reset state only - called by didDismiss event
11883
+ * Separated from closeModal to avoid double dismissal and scroll issues
11884
+ */
11885
+ resetState() {
11870
11886
  this.searchTerm = '';
11871
11887
  this.filteredItems = this.props?.options ? [...this.props.options] : [];
11872
- this.changeDetector.detectChanges();
11888
+ }
11889
+ /**
11890
+ * Close modal only - does not reset state (didDismiss will handle that)
11891
+ */
11892
+ closeModal() {
11873
11893
  if (this.modal) {
11874
11894
  this.modal.dismiss();
11875
11895
  }
11876
11896
  }
11897
+ /**
11898
+ * @deprecated Use closeModal() instead. Kept for backwards compatibility.
11899
+ */
11900
+ cancelModal() {
11901
+ this.closeModal();
11902
+ }
11877
11903
  selectItem(item) {
11878
11904
  // Multi-select logic: toggle selection
11879
11905
  const index = this.selectedItems.findIndex(selectedItem => selectedItem[this.valueProperty] === item[this.valueProperty]);
@@ -11938,7 +11964,7 @@ class MultiSelectSearchComponent {
11938
11964
  }
11939
11965
  applyAndClose() {
11940
11966
  this.applyChanges();
11941
- this.cancelModal();
11967
+ this.closeModal();
11942
11968
  }
11943
11969
  // Método público para reiniciar el componente
11944
11970
  reset() {
@@ -11966,7 +11992,7 @@ class MultiSelectSearchComponent {
11966
11992
  trigger="open-modal"
11967
11993
  [initialBreakpoint]="1"
11968
11994
  [breakpoints]="[0, 0.5, 0.75, 1]"
11969
- (didDismiss)="cancelModal()"
11995
+ (didDismiss)="resetState()"
11970
11996
  >
11971
11997
  <ng-template>
11972
11998
  <ion-header>
@@ -12044,7 +12070,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
12044
12070
  trigger="open-modal"
12045
12071
  [initialBreakpoint]="1"
12046
12072
  [breakpoints]="[0, 0.5, 0.75, 1]"
12047
- (didDismiss)="cancelModal()"
12073
+ (didDismiss)="resetState()"
12048
12074
  >
12049
12075
  <ng-template>
12050
12076
  <ion-header>
@@ -31705,7 +31731,7 @@ class SimpleModalContentComponent {
31705
31731
  </ion-toolbar>
31706
31732
  </ion-footer>
31707
31733
  }
31708
- `, isInline: true, styles: [".button-container{display:flex;justify-content:flex-end;gap:8px;padding:8px 0}ion-content{--padding-top: 16px;--padding-bottom: 16px}ion-footer ion-toolbar{--padding-start: 16px;--padding-end: 16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }] }); }
31734
+ `, isInline: true, styles: [":host{display:flex;flex-direction:column;height:100%}.button-container{display:flex;justify-content:flex-end;gap:8px;padding:8px 0}ion-header{flex-shrink:0}ion-content{flex:1 1 auto;--padding-top: 16px;--padding-bottom: 16px;--padding-start: 16px;--padding-end: 16px}ion-content::part(scroll){overflow-y:auto}ion-footer{flex-shrink:0}ion-footer ion-toolbar{--padding-start: 16px;--padding-end: 16px}:host ::ng-deep ul,:host ::ng-deep ol{padding-left:20px;margin:8px 0}:host ::ng-deep li{margin:4px 0}:host ::ng-deep p{margin:8px 0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }] }); }
31709
31735
  }
31710
31736
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SimpleModalContentComponent, decorators: [{
31711
31737
  type: Component,
@@ -31751,7 +31777,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
31751
31777
  </ion-toolbar>
31752
31778
  </ion-footer>
31753
31779
  }
31754
- `, styles: [".button-container{display:flex;justify-content:flex-end;gap:8px;padding:8px 0}ion-content{--padding-top: 16px;--padding-bottom: 16px}ion-footer ion-toolbar{--padding-start: 16px;--padding-end: 16px}\n"] }]
31780
+ `, styles: [":host{display:flex;flex-direction:column;height:100%}.button-container{display:flex;justify-content:flex-end;gap:8px;padding:8px 0}ion-header{flex-shrink:0}ion-content{flex:1 1 auto;--padding-top: 16px;--padding-bottom: 16px;--padding-start: 16px;--padding-end: 16px}ion-content::part(scroll){overflow-y:auto}ion-footer{flex-shrink:0}ion-footer ion-toolbar{--padding-start: 16px;--padding-end: 16px}:host ::ng-deep ul,:host ::ng-deep ol{padding-left:20px;margin:8px 0}:host ::ng-deep li{margin:4px 0}:host ::ng-deep p{margin:8px 0}\n"] }]
31755
31781
  }], propDecorators: { title: [{
31756
31782
  type: Input
31757
31783
  }], content: [{
@@ -31845,7 +31871,16 @@ class ModalService {
31845
31871
  if (options.width || options.height || size) {
31846
31872
  const modalEl = modal;
31847
31873
  modalEl.style.setProperty('--width', options.width || size.width || 'auto');
31848
- modalEl.style.setProperty('--height', options.height || size.height || 'auto');
31874
+ // Use min-height for auto to allow content to determine size
31875
+ const heightValue = options.height || size.height || 'auto';
31876
+ if (heightValue === 'auto') {
31877
+ modalEl.style.setProperty('--height', 'auto');
31878
+ modalEl.style.setProperty('--min-height', '200px');
31879
+ modalEl.style.setProperty('--max-height', '90vh');
31880
+ }
31881
+ else {
31882
+ modalEl.style.setProperty('--height', heightValue);
31883
+ }
31849
31884
  }
31850
31885
  await modal.present();
31851
31886
  const { data, role } = await modal.onDidDismiss();