@acorex/components 19.14.2 → 19.14.4
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.
@@ -11,7 +11,7 @@ import { AXTranslatorPipe, AXTranslationService } from '@acorex/core/translation
|
|
11
11
|
import { AXUnsubscriber, AXHtmlUtil } from '@acorex/core/utils';
|
12
12
|
import { AsyncPipe, isPlatformBrowser, NgClass } from '@angular/common';
|
13
13
|
import * as i0 from '@angular/core';
|
14
|
-
import { inject, Injectable, input, computed, output, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, PLATFORM_ID, viewChild, linkedSignal, signal, model, effect,
|
14
|
+
import { inject, Injectable, input, computed, output, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, PLATFORM_ID, viewChild, linkedSignal, signal, model, effect, NgModule } from '@angular/core';
|
15
15
|
import * as i1 from '@angular/forms';
|
16
16
|
import { FormsModule } from '@angular/forms';
|
17
17
|
import { AXDragDirective, AXDropZoneDirective } from '@acorex/cdk/drag-drop';
|
@@ -2007,10 +2007,6 @@ class AXSchedulerComponent extends NXComponent {
|
|
2007
2007
|
this.calendarType = linkedSignal(() => this.calendar() ?? this.localeService.activeProfile().calendar.system);
|
2008
2008
|
this.startingDate = input(new Date());
|
2009
2009
|
this.currentDate = linkedSignal(() => this.calendarService.create(this.startingDate(), this.calendarType()).startOf('day'));
|
2010
|
-
this._endRange = signal(null);
|
2011
|
-
this.endRange = this._endRange.asReadonly();
|
2012
|
-
this._fromRange = signal(null);
|
2013
|
-
this.fromRange = this._fromRange.asReadonly();
|
2014
2010
|
this._appointments = signal([]);
|
2015
2011
|
this.appointments = this._appointments.asReadonly();
|
2016
2012
|
this.rtl = signal(false);
|
@@ -2048,12 +2044,11 @@ class AXSchedulerComponent extends NXComponent {
|
|
2048
2044
|
this.#appointmentEffect = effect(async () => {
|
2049
2045
|
if (typeof this.dataSource() === 'function') {
|
2050
2046
|
const func = this.dataSource();
|
2051
|
-
const
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
});
|
2047
|
+
const range = {
|
2048
|
+
end: this.range().end,
|
2049
|
+
from: this.range().from,
|
2050
|
+
};
|
2051
|
+
const list = await func({ range });
|
2057
2052
|
this._appointments.set(list);
|
2058
2053
|
}
|
2059
2054
|
else {
|
@@ -2111,7 +2106,6 @@ class AXSchedulerComponent extends NXComponent {
|
|
2111
2106
|
case 'month':
|
2112
2107
|
case 'timeline-month':
|
2113
2108
|
return 'month';
|
2114
|
-
return 'day';
|
2115
2109
|
}
|
2116
2110
|
});
|
2117
2111
|
this.mappedAppointments = computed(() => {
|
@@ -2146,66 +2140,51 @@ class AXSchedulerComponent extends NXComponent {
|
|
2146
2140
|
})
|
2147
2141
|
.filter((appt) => appt !== null); // Filter out nulls from invalid dates
|
2148
2142
|
});
|
2149
|
-
this.
|
2143
|
+
this.range = computed(() => {
|
2150
2144
|
const view = this.selectedView();
|
2151
|
-
const current = this.currentDate();
|
2152
|
-
|
2153
|
-
|
2154
|
-
return [];
|
2145
|
+
const current = this.currentDate().startOf('day');
|
2146
|
+
if (!current)
|
2147
|
+
return { from: null, end: null };
|
2155
2148
|
switch (view) {
|
2156
2149
|
case 'day':
|
2157
2150
|
case 'timeline-day': {
|
2158
|
-
const
|
2159
|
-
|
2160
|
-
|
2161
|
-
this._endRange.set(dayEnd.date);
|
2162
|
-
this._fromRange.set(dayStart.date);
|
2163
|
-
this.onRangeChanged.emit({ from: dayStart.date, to: dayEnd.date });
|
2164
|
-
});
|
2165
|
-
return mapped.filter((appt) => appt.endDate.compare(dayStart, 'day') >= 0 && appt.startDate.compare(dayEnd, 'day') <= 0);
|
2151
|
+
const range = { from: current.date, end: current.endOf('day').date };
|
2152
|
+
this.onRangeChanged.emit(range);
|
2153
|
+
return range;
|
2166
2154
|
}
|
2167
2155
|
case 'week': {
|
2168
|
-
const
|
2169
|
-
|
2170
|
-
|
2171
|
-
this._endRange.set(weekEnd.date);
|
2172
|
-
this._fromRange.set(weekStart.date);
|
2173
|
-
this.onRangeChanged.emit({ from: weekStart.date, to: weekEnd.date });
|
2174
|
-
});
|
2175
|
-
return mapped.filter((appt) => appt.startDate.compare(weekEnd, 'day') < 0 && appt.endDate.compare(weekStart, 'day') >= 0);
|
2156
|
+
const range = { from: current.date, end: current.add('day', 7).date };
|
2157
|
+
this.onRangeChanged.emit(range);
|
2158
|
+
return range;
|
2176
2159
|
}
|
2177
2160
|
case 'month': {
|
2178
2161
|
const { gridStartDate, gridEndDate } = this.getGridDateRange(current);
|
2179
|
-
const
|
2180
|
-
|
2181
|
-
|
2182
|
-
this._fromRange.set(gridStartDate.date);
|
2183
|
-
});
|
2184
|
-
return mapped.filter((appt) => appt.startDate.compare(exclusiveGridEndDate, 'day') < 0 && appt.endDate.compare(gridStartDate, 'day') >= 0);
|
2162
|
+
const range = { from: gridStartDate.date, end: gridEndDate.add('day', 1).date };
|
2163
|
+
this.onRangeChanged.emit(range);
|
2164
|
+
return range;
|
2185
2165
|
}
|
2186
2166
|
case 'timeline-month': {
|
2187
|
-
const
|
2188
|
-
|
2189
|
-
|
2190
|
-
this._endRange.set(dayEnd.date);
|
2191
|
-
this._fromRange.set(dayStart.date);
|
2192
|
-
this.onRangeChanged.emit({ from: dayStart.date, to: dayEnd.date });
|
2193
|
-
});
|
2194
|
-
return mapped.filter((appt) => appt.startDate.compare(dayEnd, 'day') < 0 && appt.endDate.compare(dayStart, 'day') >= 0);
|
2167
|
+
const range = { from: current.startOf('month').date, end: current.endOf('month').date };
|
2168
|
+
this.onRangeChanged.emit(range);
|
2169
|
+
return range;
|
2195
2170
|
}
|
2196
2171
|
case 'agenda':
|
2197
2172
|
case 'timeline-multi-day': {
|
2198
|
-
const
|
2199
|
-
|
2200
|
-
|
2201
|
-
this._endRange.set(dayEnd.date);
|
2202
|
-
this._fromRange.set(dayStart.date);
|
2203
|
-
this.onRangeChanged.emit({ from: dayStart.date, to: dayEnd.date });
|
2204
|
-
});
|
2205
|
-
return mapped.filter((appt) => appt.startDate.compare(dayEnd, 'day') < 0 && appt.endDate.compare(dayStart, 'day') >= 0);
|
2173
|
+
const range = { from: current.date, end: current.add('day', this.multiDayViewDaysCount()).date };
|
2174
|
+
this.onRangeChanged.emit(range);
|
2175
|
+
return range;
|
2206
2176
|
}
|
2207
2177
|
}
|
2208
2178
|
});
|
2179
|
+
this.viewAppointments = computed(() => {
|
2180
|
+
const current = this.currentDate();
|
2181
|
+
const mapped = this.mappedAppointments();
|
2182
|
+
const rangeStart = this.range().from;
|
2183
|
+
const rangeEnd = this.range().end;
|
2184
|
+
if (!current || mapped.length === 0)
|
2185
|
+
return [];
|
2186
|
+
return mapped.filter((appt) => appt.startDate.compare(rangeEnd, 'second') <= 0 && appt.endDate.compare(rangeStart, 'second') >= 0);
|
2187
|
+
});
|
2209
2188
|
}
|
2210
2189
|
// --- Internal Handlers for View Outputs ---
|
2211
2190
|
handleSlotClickInternal(eventData) {
|