@propbinder/mobile-design 0.2.55 → 0.2.57

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.
@@ -16660,6 +16660,7 @@ class DsMobileBookingModalComponent {
16660
16660
  availableDates;
16661
16661
  availableTimeSlots;
16662
16662
  useMockData = false;
16663
+ onSubmit;
16663
16664
  swiperComponent;
16664
16665
  // Signals for reactive state management
16665
16666
  dateOptions = signal([], ...(ngDevMode ? [{ debugName: "dateOptions" }] : []));
@@ -16880,8 +16881,6 @@ class DsMobileBookingModalComponent {
16880
16881
  return;
16881
16882
  // Set loading state
16882
16883
  this.isConfirming.set(true);
16883
- // Simulate booking API call with 2 second delay
16884
- await new Promise(resolve => setTimeout(resolve, 2000));
16885
16884
  const result = {
16886
16885
  facilityId: this.facilityId,
16887
16886
  facilityTitle: this.facilityTitle,
@@ -16889,7 +16888,20 @@ class DsMobileBookingModalComponent {
16889
16888
  selectedTimeSlot: this.selectedTimeSlot(),
16890
16889
  timestamp: new Date()
16891
16890
  };
16892
- await this.modalController.dismiss(result, 'confirm');
16891
+ try {
16892
+ if (this.onSubmit) {
16893
+ await this.onSubmit(result);
16894
+ }
16895
+ else {
16896
+ // Simulate booking API call with 2 second delay
16897
+ await new Promise(resolve => setTimeout(resolve, 2000));
16898
+ }
16899
+ await this.modalController.dismiss(result, 'confirm');
16900
+ }
16901
+ catch (e) {
16902
+ console.error('Booking confirmation failed in onSubmit hook', e);
16903
+ this.isConfirming.set(false);
16904
+ }
16893
16905
  }
16894
16906
  /**
16895
16907
  * Handle close button click
@@ -16898,7 +16910,7 @@ class DsMobileBookingModalComponent {
16898
16910
  await this.modalController.dismiss(null, 'cancel');
16899
16911
  }
16900
16912
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DsMobileBookingModalComponent, deps: [{ token: i1.ModalController }], target: i0.ɵɵFactoryTarget.Component });
16901
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: DsMobileBookingModalComponent, isStandalone: true, selector: "ds-mobile-booking-modal", inputs: { facilityId: "facilityId", facilityTitle: "facilityTitle", daysAhead: "daysAhead", selectFromCalendarText: "selectFromCalendarText", confirmBookingText: "confirmBookingText", availableDates: "availableDates", availableTimeSlots: "availableTimeSlots", useMockData: "useMockData" }, viewQueries: [{ propertyName: "swiperComponent", first: true, predicate: DsMobileSwiperComponent, descendants: true }], ngImport: i0, template: `
16913
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: DsMobileBookingModalComponent, isStandalone: true, selector: "ds-mobile-booking-modal", inputs: { facilityId: "facilityId", facilityTitle: "facilityTitle", daysAhead: "daysAhead", selectFromCalendarText: "selectFromCalendarText", confirmBookingText: "confirmBookingText", availableDates: "availableDates", availableTimeSlots: "availableTimeSlots", useMockData: "useMockData", onSubmit: "onSubmit" }, viewQueries: [{ propertyName: "swiperComponent", first: true, predicate: DsMobileSwiperComponent, descendants: true }], ngImport: i0, template: `
16902
16914
  <ds-mobile-modal-base
16903
16915
  headerTitle="Hvornår skal det være?"
16904
16916
  [showCloseButton]="true"
@@ -17071,6 +17083,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
17071
17083
  type: Input
17072
17084
  }], useMockData: [{
17073
17085
  type: Input
17086
+ }], onSubmit: [{
17087
+ type: Input
17074
17088
  }], swiperComponent: [{
17075
17089
  type: ViewChild,
17076
17090
  args: [DsMobileSwiperComponent]
@@ -17317,6 +17331,8 @@ class DsMobileBookingModalService extends BaseModalService {
17317
17331
  componentProps.availableTimeSlots = options.availableTimeSlots;
17318
17332
  if (options.useMockData !== undefined)
17319
17333
  componentProps.useMockData = options.useMockData;
17334
+ if (options.onSubmit !== undefined)
17335
+ componentProps.onSubmit = options.onSubmit;
17320
17336
  if (options.labels?.selectFromCalendar)
17321
17337
  componentProps.selectFromCalendarText = options.labels.selectFromCalendar;
17322
17338
  if (options.labels?.confirmBooking)
@@ -19184,7 +19200,8 @@ class DsMobileFacilityDetailModalComponent {
19184
19200
  facilityThumbnail: this.facilityData.heroImage,
19185
19201
  availableDates: this.facilityData.availableDates,
19186
19202
  availableTimeSlots: this.facilityData.availableTimeSlots,
19187
- useMockData: this.facilityData.useMockData
19203
+ useMockData: this.facilityData.useMockData,
19204
+ onSubmit: this.facilityData.onSubmit
19188
19205
  });
19189
19206
  }
19190
19207
  /**