@quadrel-enterprise-ui/framework 21.12.24 → 21.12.25

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.
@@ -19994,6 +19994,7 @@ class QdDialogRecordStepperComponent {
19994
19994
  dialogService = inject(QdDialogService);
19995
19995
  /**
19996
19996
  * The data processed by this component.
19997
+ * Its `initialPaginationIndex` sets the first view. Without it, the index of the dialog service is used.
19997
19998
  */
19998
19999
  data = { navigation: false, initialPaginationIndex: 0, views: [] };
19999
20000
  /**
@@ -20009,7 +20010,7 @@ class QdDialogRecordStepperComponent {
20009
20010
  currentIndex;
20010
20011
  itemsCount = 0;
20011
20012
  ngOnInit() {
20012
- this.currentIndex = this.dialogService.dialogData.initialPaginationIndex || 0;
20013
+ this.currentIndex = this.getInitialIndex();
20013
20014
  }
20014
20015
  ngAfterContentInit() {
20015
20016
  this.setItemsCount();
@@ -20039,6 +20040,13 @@ class QdDialogRecordStepperComponent {
20039
20040
  setItemsCount() {
20040
20041
  this.itemsCount = this.data.views?.length || 0;
20041
20042
  }
20043
+ getInitialIndex() {
20044
+ const index = this.data?.initialPaginationIndex;
20045
+ if (index === undefined || index === null)
20046
+ return this.dialogService.dialogData.initialPaginationIndex || 0;
20047
+ const lastIndex = (this.data.views?.length ?? 0) - 1;
20048
+ return Math.max(0, Math.min(index, lastIndex));
20049
+ }
20042
20050
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: QdDialogRecordStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
20043
20051
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: QdDialogRecordStepperComponent, isStandalone: false, selector: "qd-dialog-record-stepper", inputs: { data: "data" }, outputs: { changeStep: "changeStep" }, host: { properties: { "class.first-item": "this.firstItem", "class.last-item": "this.lastItem" }, classAttribute: "qd-dialog-record-stepper " }, ngImport: i0, template: "<qd-icon icon=\"arrowLeft\" class=\"previous\" (click)=\"previous()\"></qd-icon>\n<span class=\"range\">{{ currentIndex + 1 }}/{{ itemsCount }}</span>\n<qd-icon icon=\"arrowRight\" class=\"next\" (click)=\"next()\"></qd-icon>\n", styles: [".qd-dialog-record-stepper{display:flex}.qd-dialog-record-stepper .previous,.qd-dialog-record-stepper .next{display:flex;align-items:center;margin-right:.75rem;color:#757575;font-size:1.125rem}.qd-dialog-record-stepper .previous:hover,.qd-dialog-record-stepper .next:hover{color:#171717;cursor:pointer}.qd-dialog-record-stepper .previous .qd-icon,.qd-dialog-record-stepper .next .qd-icon{font-size:1.4rem}.qd-dialog-record-stepper.last-item .next,.qd-dialog-record-stepper.first-item .previous{color:#d5d5d5;cursor:default}.qd-dialog-record-stepper .range{display:flex;align-items:center;margin-right:.75rem;cursor:default}\n"], dependencies: [{ kind: "component", type: QdIconComponent, selector: "qd-icon", inputs: ["icon", "status"] }], encapsulation: i0.ViewEncapsulation.None });
20044
20052
  }