@propbinder/mobile-design 0.2.54 → 0.2.55
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.
|
@@ -16659,6 +16659,7 @@ class DsMobileBookingModalComponent {
|
|
|
16659
16659
|
confirmBookingText = 'Bekræft booking';
|
|
16660
16660
|
availableDates;
|
|
16661
16661
|
availableTimeSlots;
|
|
16662
|
+
useMockData = false;
|
|
16662
16663
|
swiperComponent;
|
|
16663
16664
|
// Signals for reactive state management
|
|
16664
16665
|
dateOptions = signal([], ...(ngDevMode ? [{ debugName: "dateOptions" }] : []));
|
|
@@ -16672,7 +16673,9 @@ class DsMobileBookingModalComponent {
|
|
|
16672
16673
|
}, ...(ngDevMode ? [{ debugName: "canConfirm" }] : []));
|
|
16673
16674
|
constructor(modalController) {
|
|
16674
16675
|
this.modalController = modalController;
|
|
16675
|
-
|
|
16676
|
+
}
|
|
16677
|
+
ngOnInit() {
|
|
16678
|
+
this.initializeData();
|
|
16676
16679
|
}
|
|
16677
16680
|
/**
|
|
16678
16681
|
* After view init - force swiper update to fix initial positioning
|
|
@@ -16721,9 +16724,9 @@ class DsMobileBookingModalComponent {
|
|
|
16721
16724
|
};
|
|
16722
16725
|
}, ...(ngDevMode ? [{ debugName: "dateDisabledFn" }] : []));
|
|
16723
16726
|
/**
|
|
16724
|
-
*
|
|
16727
|
+
* Initialize date and time data or optionally use mock data for testing
|
|
16725
16728
|
*/
|
|
16726
|
-
|
|
16729
|
+
initializeData() {
|
|
16727
16730
|
if (this.availableDates && this.availableDates.length > 0) {
|
|
16728
16731
|
this.dateOptions.set(this.availableDates);
|
|
16729
16732
|
const firstAvailableDate = this.availableDates.find(d => d.state !== 'disabled') || this.availableDates[0];
|
|
@@ -16738,11 +16741,16 @@ class DsMobileBookingModalComponent {
|
|
|
16738
16741
|
const selectedRef = updatedDates.find(d => d.id === firstAvailableDate.id);
|
|
16739
16742
|
if (selectedRef) {
|
|
16740
16743
|
this.selectedDate.set(selectedRef);
|
|
16741
|
-
this.
|
|
16744
|
+
this.initializeTimeSlots(selectedRef.fullDate, selectedRef.id);
|
|
16742
16745
|
}
|
|
16743
16746
|
}
|
|
16744
16747
|
return;
|
|
16745
16748
|
}
|
|
16749
|
+
if (!this.useMockData) {
|
|
16750
|
+
this.dateOptions.set([]);
|
|
16751
|
+
this.timeSlots.set([]);
|
|
16752
|
+
return;
|
|
16753
|
+
}
|
|
16746
16754
|
const dates = [];
|
|
16747
16755
|
const today = new Date();
|
|
16748
16756
|
const dayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
@@ -16771,21 +16779,25 @@ class DsMobileBookingModalComponent {
|
|
|
16771
16779
|
// Set the first available date as selected and generate time slots for it
|
|
16772
16780
|
if (firstAvailableDate) {
|
|
16773
16781
|
this.selectedDate.set(firstAvailableDate);
|
|
16774
|
-
this.
|
|
16782
|
+
this.initializeTimeSlots(firstAvailableDate.fullDate, firstAvailableDate.id);
|
|
16775
16783
|
}
|
|
16776
16784
|
else {
|
|
16777
16785
|
// Fallback to today if no available dates
|
|
16778
|
-
this.
|
|
16786
|
+
this.initializeTimeSlots(today);
|
|
16779
16787
|
}
|
|
16780
16788
|
}
|
|
16781
16789
|
/**
|
|
16782
16790
|
* Generate time slots based on selected date and dynamic available timeslots
|
|
16783
16791
|
*/
|
|
16784
|
-
|
|
16792
|
+
initializeTimeSlots(date, dateStringKey) {
|
|
16785
16793
|
if (this.availableTimeSlots && dateStringKey && this.availableTimeSlots[dateStringKey]) {
|
|
16786
16794
|
this.timeSlots.set(this.availableTimeSlots[dateStringKey]);
|
|
16787
16795
|
return;
|
|
16788
16796
|
}
|
|
16797
|
+
if (!this.useMockData) {
|
|
16798
|
+
this.timeSlots.set([]);
|
|
16799
|
+
return;
|
|
16800
|
+
}
|
|
16789
16801
|
const slots = [];
|
|
16790
16802
|
const currentHour = new Date().getHours();
|
|
16791
16803
|
const isToday = date.toDateString() === new Date().toDateString();
|
|
@@ -16824,7 +16836,7 @@ class DsMobileBookingModalComponent {
|
|
|
16824
16836
|
this.dateOptions.set(updatedDates);
|
|
16825
16837
|
this.selectedDate.set(selectedDate);
|
|
16826
16838
|
// Regenerate time slots for the selected date
|
|
16827
|
-
this.
|
|
16839
|
+
this.initializeTimeSlots(selectedDate.fullDate, selectedDate.id);
|
|
16828
16840
|
// Reset time selection
|
|
16829
16841
|
this.selectedTimeSlot.set(null);
|
|
16830
16842
|
}
|
|
@@ -16886,7 +16898,7 @@ class DsMobileBookingModalComponent {
|
|
|
16886
16898
|
await this.modalController.dismiss(null, 'cancel');
|
|
16887
16899
|
}
|
|
16888
16900
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DsMobileBookingModalComponent, deps: [{ token: i1.ModalController }], target: i0.ɵɵFactoryTarget.Component });
|
|
16889
|
-
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" }, viewQueries: [{ propertyName: "swiperComponent", first: true, predicate: DsMobileSwiperComponent, descendants: true }], ngImport: i0, template: `
|
|
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: `
|
|
16890
16902
|
<ds-mobile-modal-base
|
|
16891
16903
|
headerTitle="Hvornår skal det være?"
|
|
16892
16904
|
[showCloseButton]="true"
|
|
@@ -17057,6 +17069,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
17057
17069
|
type: Input
|
|
17058
17070
|
}], availableTimeSlots: [{
|
|
17059
17071
|
type: Input
|
|
17072
|
+
}], useMockData: [{
|
|
17073
|
+
type: Input
|
|
17060
17074
|
}], swiperComponent: [{
|
|
17061
17075
|
type: ViewChild,
|
|
17062
17076
|
args: [DsMobileSwiperComponent]
|
|
@@ -17301,6 +17315,8 @@ class DsMobileBookingModalService extends BaseModalService {
|
|
|
17301
17315
|
componentProps.availableDates = options.availableDates;
|
|
17302
17316
|
if (options.availableTimeSlots !== undefined)
|
|
17303
17317
|
componentProps.availableTimeSlots = options.availableTimeSlots;
|
|
17318
|
+
if (options.useMockData !== undefined)
|
|
17319
|
+
componentProps.useMockData = options.useMockData;
|
|
17304
17320
|
if (options.labels?.selectFromCalendar)
|
|
17305
17321
|
componentProps.selectFromCalendarText = options.labels.selectFromCalendar;
|
|
17306
17322
|
if (options.labels?.confirmBooking)
|
|
@@ -19167,7 +19183,8 @@ class DsMobileFacilityDetailModalComponent {
|
|
|
19167
19183
|
facilityTitle: this.facilityData.facilityTitle,
|
|
19168
19184
|
facilityThumbnail: this.facilityData.heroImage,
|
|
19169
19185
|
availableDates: this.facilityData.availableDates,
|
|
19170
|
-
availableTimeSlots: this.facilityData.availableTimeSlots
|
|
19186
|
+
availableTimeSlots: this.facilityData.availableTimeSlots,
|
|
19187
|
+
useMockData: this.facilityData.useMockData
|
|
19171
19188
|
});
|
|
19172
19189
|
}
|
|
19173
19190
|
/**
|
|
@@ -25059,7 +25076,8 @@ class MobileBookingPageComponent {
|
|
|
25059
25076
|
availabilityStatus: facility.availabilityStatus,
|
|
25060
25077
|
statusLabel: facility.statusLabel,
|
|
25061
25078
|
bookingDate: facility.bookingDate,
|
|
25062
|
-
bookingTime: facility.bookingTime
|
|
25079
|
+
bookingTime: facility.bookingTime,
|
|
25080
|
+
useMockData: true // Aktivér mock data til lokal test
|
|
25063
25081
|
});
|
|
25064
25082
|
}
|
|
25065
25083
|
}
|