@coreui/angular-pro 5.4.3 → 5.4.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.
|
@@ -2010,6 +2010,29 @@ const isDateInRangeDisabled = (startDate, endDate, dates, dateFilter) => {
|
|
|
2010
2010
|
}
|
|
2011
2011
|
return false;
|
|
2012
2012
|
};
|
|
2013
|
+
const getUtcTime = (value) => {
|
|
2014
|
+
const hours = value?.getUTCHours() ?? 0;
|
|
2015
|
+
const minutes = value?.getUTCMinutes() ?? 0;
|
|
2016
|
+
const seconds = value?.getUTCSeconds() ?? 0;
|
|
2017
|
+
const ms = value?.getUTCMilliseconds() ?? 0;
|
|
2018
|
+
const offset = value?.getTimezoneOffset() ?? 0;
|
|
2019
|
+
const utcTimeObj = { hours, minutes, seconds, ms, offset };
|
|
2020
|
+
Object.entries(utcTimeObj).forEach(([key, value]) => {
|
|
2021
|
+
if (value && Number.isNaN(value)) {
|
|
2022
|
+
utcTimeObj[key] = 0;
|
|
2023
|
+
}
|
|
2024
|
+
});
|
|
2025
|
+
Object.freeze(utcTimeObj);
|
|
2026
|
+
return utcTimeObj;
|
|
2027
|
+
};
|
|
2028
|
+
const setUtcTime = (value, time, withTime) => {
|
|
2029
|
+
if (!value || Number.isNaN(value?.getTime() ?? NaN) || !withTime) {
|
|
2030
|
+
return value;
|
|
2031
|
+
}
|
|
2032
|
+
const date = new Date(value);
|
|
2033
|
+
date.setUTCHours(time['hours'], time['minutes'], time['seconds'], time['ms']);
|
|
2034
|
+
return new Date(date);
|
|
2035
|
+
};
|
|
2013
2036
|
// type DateParts = {
|
|
2014
2037
|
// [key in DateTimeFormatPartTypes]?: string;
|
|
2015
2038
|
// };
|
|
@@ -7398,6 +7421,12 @@ class DateRangePickerComponent {
|
|
|
7398
7421
|
* @default undefined
|
|
7399
7422
|
*/
|
|
7400
7423
|
this.size = input();
|
|
7424
|
+
/**
|
|
7425
|
+
* Keep track of the time with the date value.
|
|
7426
|
+
* @return boolean
|
|
7427
|
+
* @default false
|
|
7428
|
+
*/
|
|
7429
|
+
this.withTime = input(false, { transform: booleanAttribute });
|
|
7401
7430
|
/**
|
|
7402
7431
|
* Provide an additional time selection by adding select boxes to choose time.
|
|
7403
7432
|
* @return boolean
|
|
@@ -7415,7 +7444,7 @@ class DateRangePickerComponent {
|
|
|
7415
7444
|
* @return boolean
|
|
7416
7445
|
* @default false
|
|
7417
7446
|
*/
|
|
7418
|
-
this.visibleInput = input(false, { transform: booleanAttribute });
|
|
7447
|
+
this.visibleInput = input(false, { transform: booleanAttribute, alias: 'visible' });
|
|
7419
7448
|
this.#visibleInputEffect = effect(() => {
|
|
7420
7449
|
this.visible.set(this.visibleInput());
|
|
7421
7450
|
});
|
|
@@ -7435,6 +7464,12 @@ class DateRangePickerComponent {
|
|
|
7435
7464
|
const startDate = this.startDateModel();
|
|
7436
7465
|
return startDate ? new Date(startDate) : null;
|
|
7437
7466
|
}, { equal: equalDates });
|
|
7467
|
+
this.startTime = computed(() => {
|
|
7468
|
+
return getUtcTime(this.startDate());
|
|
7469
|
+
});
|
|
7470
|
+
this.endTime = computed(() => {
|
|
7471
|
+
return getUtcTime(this.endDate());
|
|
7472
|
+
});
|
|
7438
7473
|
this.startDateChange = toObservable(this.startDate);
|
|
7439
7474
|
this.endDateModel = model(null, {
|
|
7440
7475
|
alias: 'endDate'
|
|
@@ -7762,14 +7797,16 @@ class DateRangePickerComponent {
|
|
|
7762
7797
|
}
|
|
7763
7798
|
}
|
|
7764
7799
|
handleStartDateChange(date) {
|
|
7765
|
-
this.
|
|
7800
|
+
const newDate = setUtcTime(date, this.startTime(), this.withTime());
|
|
7801
|
+
this.startDateModel.set(newDate ?? null);
|
|
7766
7802
|
this.inputStartHoverValue.set(null);
|
|
7767
7803
|
}
|
|
7768
7804
|
handleEndDateChange(date) {
|
|
7769
7805
|
if (!this.range()) {
|
|
7770
7806
|
return;
|
|
7771
7807
|
}
|
|
7772
|
-
this.
|
|
7808
|
+
const newDate = setUtcTime(date, this.endTime(), this.withTime());
|
|
7809
|
+
this.endDateModel.set(newDate ?? null);
|
|
7773
7810
|
this.inputEndHoverValue.set(null);
|
|
7774
7811
|
}
|
|
7775
7812
|
handleClear($event) {
|
|
@@ -7843,7 +7880,7 @@ class DateRangePickerComponent {
|
|
|
7843
7880
|
this.endDateModel.set(time ?? this.endDate());
|
|
7844
7881
|
}
|
|
7845
7882
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: DateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7846
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: DateRangePickerComponent, isStandalone: true, selector: "c-date-range-picker", inputs: { dayFormat: { classPropertyName: "dayFormat", publicName: "dayFormat", isSignal: true, isRequired: false, transformFunction: null }, calendars: { classPropertyName: "calendars", publicName: "calendars", isSignal: true, isRequired: false, transformFunction: null }, cleaner: { classPropertyName: "cleaner", publicName: "cleaner", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, indicator: { classPropertyName: "indicator", publicName: "indicator", isSignal: true, isRequired: false, transformFunction: null }, inputDateFormat: { classPropertyName: "inputDateFormat", publicName: "inputDateFormat", isSignal: true, isRequired: false, transformFunction: null }, inputDateParse: { classPropertyName: "inputDateParse", publicName: "inputDateParse", isSignal: true, isRequired: false, transformFunction: null }, inputReadOnlyInput: { classPropertyName: "inputReadOnlyInput", publicName: "inputReadOnly", isSignal: true, isRequired: false, transformFunction: null }, navYearFirst: { classPropertyName: "navYearFirst", publicName: "navYearFirst", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null }, rangesButtonsColor: { classPropertyName: "rangesButtonsColor", publicName: "rangesButtonsColor", isSignal: true, isRequired: false, transformFunction: null }, rangesButtonsSize: { classPropertyName: "rangesButtonsSize", publicName: "rangesButtonsSize", isSignal: true, isRequired: false, transformFunction: null }, rangesButtonsVariant: { classPropertyName: "rangesButtonsVariant", publicName: "rangesButtonsVariant", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, timepickerInput: { classPropertyName: "timepickerInput", publicName: "timepicker", isSignal: true, isRequired: false, transformFunction: null }, valid: { classPropertyName: "valid", publicName: "valid", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "
|
|
7883
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: DateRangePickerComponent, isStandalone: true, selector: "c-date-range-picker", inputs: { dayFormat: { classPropertyName: "dayFormat", publicName: "dayFormat", isSignal: true, isRequired: false, transformFunction: null }, calendars: { classPropertyName: "calendars", publicName: "calendars", isSignal: true, isRequired: false, transformFunction: null }, cleaner: { classPropertyName: "cleaner", publicName: "cleaner", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, indicator: { classPropertyName: "indicator", publicName: "indicator", isSignal: true, isRequired: false, transformFunction: null }, inputDateFormat: { classPropertyName: "inputDateFormat", publicName: "inputDateFormat", isSignal: true, isRequired: false, transformFunction: null }, inputDateParse: { classPropertyName: "inputDateParse", publicName: "inputDateParse", isSignal: true, isRequired: false, transformFunction: null }, inputReadOnlyInput: { classPropertyName: "inputReadOnlyInput", publicName: "inputReadOnly", isSignal: true, isRequired: false, transformFunction: null }, navYearFirst: { classPropertyName: "navYearFirst", publicName: "navYearFirst", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null }, rangesButtonsColor: { classPropertyName: "rangesButtonsColor", publicName: "rangesButtonsColor", isSignal: true, isRequired: false, transformFunction: null }, rangesButtonsSize: { classPropertyName: "rangesButtonsSize", publicName: "rangesButtonsSize", isSignal: true, isRequired: false, transformFunction: null }, rangesButtonsVariant: { classPropertyName: "rangesButtonsVariant", publicName: "rangesButtonsVariant", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, withTime: { classPropertyName: "withTime", publicName: "withTime", isSignal: true, isRequired: false, transformFunction: null }, timepickerInput: { classPropertyName: "timepickerInput", publicName: "timepicker", isSignal: true, isRequired: false, transformFunction: null }, valid: { classPropertyName: "valid", publicName: "valid", isSignal: true, isRequired: false, transformFunction: null }, visibleInput: { classPropertyName: "visibleInput", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, startDateModel: { classPropertyName: "startDateModel", publicName: "startDate", isSignal: true, isRequired: false, transformFunction: null }, endDateModel: { classPropertyName: "endDateModel", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null }, calendarDateInput: { classPropertyName: "calendarDateInput", publicName: "calendarDate", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, navigation: { classPropertyName: "navigation", publicName: "navigation", isSignal: true, isRequired: false, transformFunction: null }, rangeInput: { classPropertyName: "rangeInput", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, valueModel: { classPropertyName: "valueModel", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, weekdayFormat: { classPropertyName: "weekdayFormat", publicName: "weekdayFormat", isSignal: true, isRequired: false, transformFunction: null }, popperjsOptions: { classPropertyName: "popperjsOptions", publicName: "popperOptions", isSignal: true, isRequired: false, transformFunction: null }, selectAdjacentDays: { classPropertyName: "selectAdjacentDays", publicName: "selectAdjacentDays", isSignal: true, isRequired: false, transformFunction: null }, showAdjacentDays: { classPropertyName: "showAdjacentDays", publicName: "showAdjacentDays", isSignal: true, isRequired: false, transformFunction: null }, selectionType: { classPropertyName: "selectionType", publicName: "selectionType", isSignal: true, isRequired: false, transformFunction: null }, showWeekNumber: { classPropertyName: "showWeekNumber", publicName: "showWeekNumber", isSignal: true, isRequired: false, transformFunction: null }, weekNumbersLabel: { classPropertyName: "weekNumbersLabel", publicName: "weekNumbersLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startDateModel: "startDateChange", endDateModel: "endDateChange", valueModel: "valueChange", valueChange: "valueChange", calendarCellHover: "calendarCellHover", calendarDateChange: "calendarDateChange" }, host: { listeners: { "focusout": "onBlur()" }, properties: { "class": "datePickerClasses()" } }, providers: [
|
|
7847
7884
|
{
|
|
7848
7885
|
provide: NG_VALUE_ACCESSOR,
|
|
7849
7886
|
useExisting: forwardRef(() => DateRangePickerComponent),
|