@coreui/angular-pro 5.1.3 → 5.1.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.
- package/esm2022/lib/date-picker/date-picker.component.mjs +14 -20
- package/esm2022/lib/date-range-picker/date-range-picker/date-range-picker.component.mjs +133 -135
- package/fesm2022/coreui-angular-pro.mjs +143 -152
- package/fesm2022/coreui-angular-pro.mjs.map +1 -1
- package/lib/date-picker/date-picker.component.d.ts +4 -5
- package/lib/date-range-picker/date-range-picker/date-range-picker.component.d.ts +13 -20
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Directive, Input, TemplateRef, Renderer2, booleanAttribute, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, ContentChildren, HostListener, DestroyRef, signal, effect, RendererFactory2, Pipe, computed, numberAttribute, ViewChildren, PLATFORM_ID, Inject, afterNextRender, AfterRenderPhase, ViewChild, forwardRef, ContentChild, Optional,
|
|
2
|
+
import { inject, ElementRef, Directive, Input, TemplateRef, Renderer2, booleanAttribute, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, ContentChildren, HostListener, DestroyRef, signal, effect, RendererFactory2, Pipe, computed, numberAttribute, ViewChildren, PLATFORM_ID, Inject, afterNextRender, AfterRenderPhase, ViewChild, forwardRef, ContentChild, Optional, model, input, ChangeDetectionStrategy, output, NgZone, ViewContainerRef, contentChildren, viewChildren, untracked } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet, DOCUMENT, NgClass, NgOptimizedImage, AsyncPipe, NgStyle, isPlatformServer, isPlatformBrowser, formatDate, I18nPluralPipe, JsonPipe } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/animations';
|
|
5
5
|
import { animation, animate, style, useAnimation, trigger, state, transition, group, query } from '@angular/animations';
|
|
6
|
-
import { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { takeUntilDestroyed, toObservable, outputToObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
7
7
|
import { fromEvent, Subject, BehaviorSubject, Observable, skip, merge, takeWhile, distinctUntilChanged as distinctUntilChanged$1, map as map$1, debounceTime as debounceTime$1 } from 'rxjs';
|
|
8
8
|
import * as i1$1 from '@angular/router';
|
|
9
9
|
import { RouterModule, NavigationEnd, RouterLink } from '@angular/router';
|
|
@@ -7710,6 +7710,35 @@ class DateRangePickerComponent {
|
|
|
7710
7710
|
* @default false
|
|
7711
7711
|
*/
|
|
7712
7712
|
this.visible = false;
|
|
7713
|
+
this.startDateModel = model(undefined, {
|
|
7714
|
+
alias: 'startDate'
|
|
7715
|
+
});
|
|
7716
|
+
this.dateModelEffect = effect(() => {
|
|
7717
|
+
this.dateRangeGroup.patchValue({ startDateInput: this.startDateValue(), endDateInput: this.endDateValue() });
|
|
7718
|
+
});
|
|
7719
|
+
this.startDateChange = outputToObservable(this.startDateModel);
|
|
7720
|
+
this.startDate = computed(() => {
|
|
7721
|
+
const prevDate = this.#startDate ? new Date(this.#startDate) : null;
|
|
7722
|
+
const currDate = this.startDateModel() ? new Date(this.startDateModel()) : null;
|
|
7723
|
+
if (prevDate?.getTime() !== currDate?.getTime()) {
|
|
7724
|
+
return currDate;
|
|
7725
|
+
}
|
|
7726
|
+
return prevDate;
|
|
7727
|
+
});
|
|
7728
|
+
this.#startDate = null;
|
|
7729
|
+
this.endDateModel = model(undefined, {
|
|
7730
|
+
alias: 'endDate'
|
|
7731
|
+
});
|
|
7732
|
+
this.endDateChange = outputToObservable(this.endDateModel);
|
|
7733
|
+
this.endDate = computed(() => {
|
|
7734
|
+
const prevDate = this.#endDate ? new Date(this.#endDate) : null;
|
|
7735
|
+
const currDate = this.endDateModel() ? new Date(this.endDateModel()) : null;
|
|
7736
|
+
if (prevDate?.getTime() !== currDate?.getTime()) {
|
|
7737
|
+
return currDate;
|
|
7738
|
+
}
|
|
7739
|
+
return prevDate;
|
|
7740
|
+
});
|
|
7741
|
+
this.#endDate = null;
|
|
7713
7742
|
this.calendarDate = new Date();
|
|
7714
7743
|
this.disabledDates = [];
|
|
7715
7744
|
/**
|
|
@@ -7718,7 +7747,7 @@ class DateRangePickerComponent {
|
|
|
7718
7747
|
* @default 1 (Monday)
|
|
7719
7748
|
*/
|
|
7720
7749
|
this.firstDayOfWeek = 1;
|
|
7721
|
-
this.locale = 'default';
|
|
7750
|
+
this.locale = input('default');
|
|
7722
7751
|
this.maxDate = null;
|
|
7723
7752
|
this.minDate = null;
|
|
7724
7753
|
/**
|
|
@@ -7779,27 +7808,39 @@ class DateRangePickerComponent {
|
|
|
7779
7808
|
this.valueChange = new EventEmitter();
|
|
7780
7809
|
this.calendarCellHover = new EventEmitter();
|
|
7781
7810
|
this.calendarDateChange = new EventEmitter();
|
|
7782
|
-
this.endDateChange = new EventEmitter();
|
|
7783
|
-
this.startDateChange = new EventEmitter();
|
|
7784
7811
|
this.templates = {};
|
|
7785
7812
|
this.dateChangeSubscriptions = [];
|
|
7786
7813
|
this.isMobile = true;
|
|
7787
7814
|
this.showRanges = false;
|
|
7788
|
-
this.
|
|
7789
|
-
|
|
7815
|
+
this.startDateValue = computed(() => {
|
|
7816
|
+
const locale = this.locale() ?? 'default';
|
|
7817
|
+
const dateFormatted = this.formatDate(this.startDate());
|
|
7818
|
+
this.#startDate = this.startDate();
|
|
7819
|
+
return dateFormatted;
|
|
7820
|
+
});
|
|
7821
|
+
this.endDateValue = computed(() => {
|
|
7822
|
+
const locale = this.locale() ?? 'default';
|
|
7823
|
+
const dateFormatted = this.formatDate(this.endDate());
|
|
7824
|
+
this.#endDate = this.endDate();
|
|
7825
|
+
return dateFormatted;
|
|
7826
|
+
});
|
|
7790
7827
|
// todo: validation
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
]);
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
]);
|
|
7828
|
+
// startDateInput = new FormControl({ value: this.startDateValue, disabled: this.disabled }, [
|
|
7829
|
+
// Validators.required
|
|
7830
|
+
// // Validators.minLength(8),
|
|
7831
|
+
// // Validators.maxLength(10),
|
|
7832
|
+
// // invalidDateStringValidator(this.locale)
|
|
7833
|
+
// ]);
|
|
7834
|
+
// endDateInput = new FormControl({ value: this.endDateValue, disabled: this.disabled }, [
|
|
7835
|
+
// Validators.required
|
|
7836
|
+
// // Validators.minLength(8),
|
|
7837
|
+
// // Validators.maxLength(10),
|
|
7838
|
+
// // invalidDateStringValidator(this.locale)
|
|
7839
|
+
// ]);
|
|
7840
|
+
this.dateRangeGroup = new FormGroup({
|
|
7841
|
+
startDateInput: new FormControl({ value: '', disabled: this.disabled }, [Validators.required]),
|
|
7842
|
+
endDateInput: new FormControl({ value: '', disabled: this.disabled }, [Validators.required])
|
|
7843
|
+
});
|
|
7803
7844
|
this.#breakpoints = {
|
|
7804
7845
|
OneCalendarRanges: '(min-width: 480px)',
|
|
7805
7846
|
TwoCalendars: '(max-width: 650px)',
|
|
@@ -7841,32 +7882,11 @@ class DateRangePickerComponent {
|
|
|
7841
7882
|
// return this.#timepicker;
|
|
7842
7883
|
}
|
|
7843
7884
|
#timepicker;
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
this._startDate = value ? new Date(value) : null;
|
|
7847
|
-
if (prevDate?.getTime() !== this._startDate?.getTime()) {
|
|
7848
|
-
this.startDateValue = this.formatDate(this._startDate);
|
|
7849
|
-
this.startDateChange.emit(this._startDate);
|
|
7850
|
-
}
|
|
7851
|
-
}
|
|
7852
|
-
get startDate() {
|
|
7853
|
-
return this._startDate;
|
|
7854
|
-
}
|
|
7855
|
-
set endDate(value) {
|
|
7856
|
-
const prevDate = this._endDate ? new Date(this._endDate ?? 0) : null;
|
|
7857
|
-
this._endDate = value ? new Date(value) : null;
|
|
7858
|
-
if (prevDate?.getTime() !== this._endDate?.getTime()) {
|
|
7859
|
-
this.endDateValue = this.formatDate(this._endDate);
|
|
7860
|
-
this.endDateChange.emit(this._endDate);
|
|
7861
|
-
}
|
|
7862
|
-
}
|
|
7863
|
-
get endDate() {
|
|
7864
|
-
return this._endDate;
|
|
7865
|
-
}
|
|
7885
|
+
#startDate;
|
|
7886
|
+
#endDate;
|
|
7866
7887
|
set disabled(value) {
|
|
7867
7888
|
this.#disabled = value;
|
|
7868
|
-
this.#disabled ? this.
|
|
7869
|
-
this.#disabled ? this.endDateInput.disable() : this.endDateInput.enable();
|
|
7889
|
+
this.#disabled ? this.dateRangeGroup.disable() : this.dateRangeGroup.enable();
|
|
7870
7890
|
}
|
|
7871
7891
|
get disabled() {
|
|
7872
7892
|
return this.#disabled;
|
|
@@ -7876,16 +7896,10 @@ class DateRangePickerComponent {
|
|
|
7876
7896
|
const newValue = this.range ? { ...value } : value;
|
|
7877
7897
|
if (JSON.stringify(this._value) !== JSON.stringify(newValue)) {
|
|
7878
7898
|
this._value = newValue;
|
|
7879
|
-
if (this.range) {
|
|
7880
|
-
this.handleStartDateChange(newValue.startDate ?? null);
|
|
7881
|
-
this.handleEndDateChange(newValue.endDate ?? null);
|
|
7882
|
-
}
|
|
7883
|
-
else {
|
|
7884
|
-
this.handleStartDateChange(newValue ?? null);
|
|
7885
|
-
}
|
|
7886
7899
|
this.onChange(newValue);
|
|
7887
7900
|
this.onTouched();
|
|
7888
7901
|
this.valueChange.emit(this.value);
|
|
7902
|
+
// this.dateRangeGroup.setValue({ startDateInput: this.startDateValue(), endDateInput: this.endDateValue() });
|
|
7889
7903
|
if (this.closeOnSelect) {
|
|
7890
7904
|
const hasValue = this.range ? !!(this.value.startDate && this.value.endDate) : !!this.value;
|
|
7891
7905
|
this.visible = !hasValue;
|
|
@@ -7898,45 +7912,35 @@ class DateRangePickerComponent {
|
|
|
7898
7912
|
subscribeDateChange(subscribe = true) {
|
|
7899
7913
|
if (subscribe) {
|
|
7900
7914
|
// todo
|
|
7901
|
-
// this.dateChangeSubscriptions.push(
|
|
7902
|
-
// this.
|
|
7903
|
-
//
|
|
7904
|
-
//
|
|
7905
|
-
// this.
|
|
7906
|
-
//
|
|
7907
|
-
//
|
|
7908
|
-
//
|
|
7915
|
+
// this.dateChangeSubscriptions.push(
|
|
7916
|
+
// this.startDateChange.subscribe((next) => {
|
|
7917
|
+
// // console.log('startDateChange', next);
|
|
7918
|
+
// // this.startDate = next;
|
|
7919
|
+
// // this.onChange(next);
|
|
7920
|
+
// })
|
|
7921
|
+
// );
|
|
7922
|
+
// this.dateChangeSubscriptions.push(
|
|
7923
|
+
// this.endDateChange.subscribe((next) => {
|
|
7924
|
+
// // console.log('endDateChange', next);
|
|
7925
|
+
// // this.endDate = next;
|
|
7926
|
+
// // this.onChange(next);
|
|
7927
|
+
// })
|
|
7928
|
+
// );
|
|
7909
7929
|
return;
|
|
7910
7930
|
}
|
|
7911
|
-
this.dateChangeSubscriptions.forEach(subscription => {
|
|
7931
|
+
this.dateChangeSubscriptions.forEach((subscription) => {
|
|
7912
7932
|
subscription?.unsubscribe();
|
|
7913
7933
|
});
|
|
7914
7934
|
}
|
|
7915
7935
|
onBlur() {
|
|
7916
7936
|
this.onTouched();
|
|
7917
7937
|
}
|
|
7918
|
-
set startDateValue(value) {
|
|
7919
|
-
this.startDateInput.setValue(value);
|
|
7920
|
-
this._startDateValue = value;
|
|
7921
|
-
}
|
|
7922
|
-
get startDateValue() {
|
|
7923
|
-
return this._startDateValue;
|
|
7924
|
-
}
|
|
7925
|
-
set endDateValue(value) {
|
|
7926
|
-
this.endDateInput.setValue(value);
|
|
7927
|
-
this._endDateValue = value;
|
|
7928
|
-
}
|
|
7929
|
-
get endDateValue() {
|
|
7930
|
-
return this._endDateValue;
|
|
7931
|
-
}
|
|
7932
7938
|
get startDatePlaceholder() {
|
|
7933
7939
|
return Array.isArray(this.placeholder) ? this.placeholder[0] : this.placeholder;
|
|
7934
7940
|
}
|
|
7935
|
-
;
|
|
7936
7941
|
get endDatePlaceholder() {
|
|
7937
7942
|
return Array.isArray(this.placeholder) ? this.placeholder[1] : this.placeholder;
|
|
7938
7943
|
}
|
|
7939
|
-
;
|
|
7940
7944
|
set inputStartHoverValue(value) {
|
|
7941
7945
|
this._inputStartHoverValue = value;
|
|
7942
7946
|
}
|
|
@@ -7959,30 +7963,32 @@ class DateRangePickerComponent {
|
|
|
7959
7963
|
};
|
|
7960
7964
|
}
|
|
7961
7965
|
formatDate(date) {
|
|
7962
|
-
return !date || !isValidDate(date)
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7966
|
+
return !date || !isValidDate(date)
|
|
7967
|
+
? ''
|
|
7968
|
+
: typeof this.inputDateFormat === 'function'
|
|
7969
|
+
? this.inputDateFormat(date)
|
|
7970
|
+
: !!this.format && !!this.locale() && this.locale() !== 'default'
|
|
7971
|
+
? formatDate(date, this.format, this.locale())
|
|
7972
|
+
: this.timepicker
|
|
7973
|
+
? date.toLocaleString(this.locale())
|
|
7974
|
+
: date.toLocaleDateString(this.locale());
|
|
7967
7975
|
}
|
|
7968
7976
|
#breakpoints;
|
|
7969
7977
|
ngOnInit() {
|
|
7970
7978
|
this.customRanges = this.ranges ? Object.entries(this.ranges) : [];
|
|
7971
7979
|
const breakpoints = this.#breakpoints;
|
|
7972
|
-
this.layoutChanges = this.breakpointObserver
|
|
7973
|
-
breakpoints.OneCalendarRanges,
|
|
7974
|
-
|
|
7975
|
-
breakpoints.TwoCalendarsRanges
|
|
7976
|
-
]).subscribe(result => {
|
|
7980
|
+
this.layoutChanges = this.breakpointObserver
|
|
7981
|
+
.observe([breakpoints.OneCalendarRanges, breakpoints.TwoCalendars, breakpoints.TwoCalendarsRanges])
|
|
7982
|
+
.subscribe((result) => {
|
|
7977
7983
|
if (result.matches) {
|
|
7978
|
-
this.isMobile =
|
|
7984
|
+
this.isMobile =
|
|
7985
|
+
(this.customRanges?.length > 0 && result.breakpoints[breakpoints.TwoCalendarsRanges]) ||
|
|
7986
|
+
result.breakpoints[breakpoints.TwoCalendars];
|
|
7979
7987
|
if (this.customRanges?.length > 0) {
|
|
7980
7988
|
this.showRanges = !result.breakpoints[breakpoints.OneCalendarRanges];
|
|
7981
7989
|
}
|
|
7982
7990
|
}
|
|
7983
7991
|
});
|
|
7984
|
-
this.startDateValue = this.formatDate(this.startDate);
|
|
7985
|
-
this.endDateValue = this.formatDate(this.endDate);
|
|
7986
7992
|
this.subscribeDateChange();
|
|
7987
7993
|
}
|
|
7988
7994
|
ngOnDestroy() {
|
|
@@ -8012,10 +8018,6 @@ class DateRangePickerComponent {
|
|
|
8012
8018
|
const date = this.convertValueToDate(changes['endDate']?.currentValue) ?? null;
|
|
8013
8019
|
this.handleEndDateChange(date);
|
|
8014
8020
|
}
|
|
8015
|
-
if (changes['locale']) {
|
|
8016
|
-
this.startDateValue = this.formatDate(this.startDate);
|
|
8017
|
-
this.endDateValue = this.formatDate(this.endDate);
|
|
8018
|
-
}
|
|
8019
8021
|
}
|
|
8020
8022
|
convertValueToDate(value) {
|
|
8021
8023
|
if (!value) {
|
|
@@ -8033,7 +8035,7 @@ class DateRangePickerComponent {
|
|
|
8033
8035
|
return parsedDate;
|
|
8034
8036
|
}
|
|
8035
8037
|
}
|
|
8036
|
-
return getLocalDateFromString(date, this.locale, this.timepicker);
|
|
8038
|
+
return getLocalDateFromString(date, this.locale(), this.timepicker);
|
|
8037
8039
|
}
|
|
8038
8040
|
getCustomRangeKey(customRange) {
|
|
8039
8041
|
return customRange[0];
|
|
@@ -8045,14 +8047,14 @@ class DateRangePickerComponent {
|
|
|
8045
8047
|
}
|
|
8046
8048
|
handleCalendarCellHover($event) {
|
|
8047
8049
|
this.calendarCellHover.emit($event);
|
|
8048
|
-
if (!this.startDate) {
|
|
8050
|
+
if (!this.startDate()) {
|
|
8049
8051
|
this.setInputValue(this.startDateElementRef, $event);
|
|
8050
8052
|
this.inputStartHoverValue = $event;
|
|
8051
8053
|
this.setInputValue(this.endDateElementRef, null);
|
|
8052
8054
|
this.inputEndHoverValue = null;
|
|
8053
8055
|
return;
|
|
8054
8056
|
}
|
|
8055
|
-
if (!this.endDate) {
|
|
8057
|
+
if (!this.endDate()) {
|
|
8056
8058
|
this.setInputValue(this.endDateElementRef, $event);
|
|
8057
8059
|
this.inputEndHoverValue = $event;
|
|
8058
8060
|
return;
|
|
@@ -8064,23 +8066,19 @@ class DateRangePickerComponent {
|
|
|
8064
8066
|
}
|
|
8065
8067
|
}
|
|
8066
8068
|
handleStartDateChange(date) {
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
this.value = this.range ? { startDate: this.startDate, endDate: this.endDate } : this.startDate;
|
|
8072
|
-
}
|
|
8069
|
+
this.startDateModel.set(date ?? null);
|
|
8070
|
+
this.dateRangeGroup.patchValue({ startDateInput: this.startDateValue() });
|
|
8071
|
+
this.inputStartHoverValue = null;
|
|
8072
|
+
this.value = this.range ? { startDate: this.startDate(), endDate: this.endDate() } : this.startDate();
|
|
8073
8073
|
}
|
|
8074
8074
|
handleEndDateChange(date) {
|
|
8075
|
-
if (
|
|
8076
|
-
|
|
8077
|
-
return;
|
|
8078
|
-
}
|
|
8079
|
-
this.endDate = date ?? null;
|
|
8080
|
-
this.endDateValue = this.formatDate(this.endDate);
|
|
8081
|
-
this.inputEndHoverValue = null;
|
|
8082
|
-
this.value = this.range ? { startDate: this.startDate, endDate: this.endDate } : this.startDate;
|
|
8075
|
+
if (!this.range) {
|
|
8076
|
+
return;
|
|
8083
8077
|
}
|
|
8078
|
+
this.endDateModel.set(date ?? null);
|
|
8079
|
+
this.dateRangeGroup.patchValue({ endDateInput: this.endDateValue() });
|
|
8080
|
+
this.inputEndHoverValue = null;
|
|
8081
|
+
this.value = this.range ? { startDate: this.startDate(), endDate: this.endDate() } : this.startDate();
|
|
8084
8082
|
}
|
|
8085
8083
|
handleClear($event) {
|
|
8086
8084
|
// this.calendarComponent.clearDates();
|
|
@@ -8094,31 +8092,39 @@ class DateRangePickerComponent {
|
|
|
8094
8092
|
// this.calendarComponent.clearDates();
|
|
8095
8093
|
this.handleStartDateChange(null);
|
|
8096
8094
|
this.handleEndDateChange(null);
|
|
8095
|
+
return;
|
|
8097
8096
|
}
|
|
8098
8097
|
if (date instanceof Date && date.getTime()) {
|
|
8099
|
-
|
|
8098
|
+
// @ts-ignore
|
|
8099
|
+
if (!(this.forbiddenDate(date) || (this.endDate() && this.endDate() < date))) {
|
|
8100
8100
|
this.calendarDate = date;
|
|
8101
|
-
this.
|
|
8101
|
+
this.handleStartDateChange(date);
|
|
8102
8102
|
}
|
|
8103
8103
|
}
|
|
8104
|
-
this.handleStartDateChange(this.startDate ?? null);
|
|
8104
|
+
this.handleStartDateChange(this.startDate() ?? null);
|
|
8105
8105
|
}
|
|
8106
8106
|
handleEndDateInputChange($event) {
|
|
8107
8107
|
const inputValue = $event.target.value;
|
|
8108
8108
|
const date = this.inputParse(inputValue);
|
|
8109
8109
|
if (!date) {
|
|
8110
|
-
this.
|
|
8110
|
+
this.handleEndDateChange(null);
|
|
8111
|
+
return;
|
|
8111
8112
|
}
|
|
8112
8113
|
if (date instanceof Date && date.getTime()) {
|
|
8113
|
-
|
|
8114
|
+
// @ts-ignore
|
|
8115
|
+
if (!(this.forbiddenDate(date) || (this.startDate() && this.startDate() > date))) {
|
|
8114
8116
|
this.calendarDate = date;
|
|
8115
|
-
this.
|
|
8117
|
+
this.handleEndDateChange(date);
|
|
8118
|
+
}
|
|
8119
|
+
else {
|
|
8120
|
+
this.handleEndDateChange(null);
|
|
8116
8121
|
}
|
|
8117
8122
|
}
|
|
8118
|
-
this.handleEndDateChange(this.endDate ?? null);
|
|
8123
|
+
this.handleEndDateChange(this.endDate() ?? null);
|
|
8119
8124
|
}
|
|
8120
8125
|
forbiddenDate(date) {
|
|
8121
|
-
return isDateDisabled(date, this.minDate, this.maxDate, this.disabledDates) ||
|
|
8126
|
+
return (isDateDisabled(date, this.minDate, this.maxDate, this.disabledDates) ||
|
|
8127
|
+
(this.dateFilter ? !this.dateFilter(date) : false));
|
|
8122
8128
|
}
|
|
8123
8129
|
registerOnChange(fn) {
|
|
8124
8130
|
this.onChange = fn;
|
|
@@ -8130,27 +8136,28 @@ class DateRangePickerComponent {
|
|
|
8130
8136
|
this.disabled = isDisabled;
|
|
8131
8137
|
}
|
|
8132
8138
|
writeValue(value) {
|
|
8133
|
-
if (value
|
|
8134
|
-
this.
|
|
8139
|
+
if (!!value) {
|
|
8140
|
+
this.handleStartDateChange(this.range ? value.startDate : value);
|
|
8141
|
+
this.handleEndDateChange(this.range ? value.endDate : null);
|
|
8135
8142
|
}
|
|
8136
8143
|
}
|
|
8137
8144
|
handleStartTimeChange(time) {
|
|
8138
|
-
this.
|
|
8145
|
+
this.startDateModel.set(time ?? this.startDate());
|
|
8139
8146
|
}
|
|
8140
8147
|
handleEndTimeChange(time) {
|
|
8141
8148
|
if (!this.range) {
|
|
8142
8149
|
return;
|
|
8143
8150
|
}
|
|
8144
|
-
this.
|
|
8151
|
+
this.endDateModel.set(time ?? this.endDate());
|
|
8145
8152
|
}
|
|
8146
8153
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DateRangePickerComponent, deps: [{ token: i1$4.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8147
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: DateRangePickerComponent, isStandalone: true, selector: "c-date-range-picker", inputs: { dayFormat: "dayFormat", calendars:
|
|
8154
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: DateRangePickerComponent, isStandalone: true, selector: "c-date-range-picker", inputs: { dayFormat: { classPropertyName: "dayFormat", publicName: "dayFormat", isSignal: false, isRequired: false, transformFunction: null }, calendars: { classPropertyName: "calendars", publicName: "calendars", isSignal: false, isRequired: false, transformFunction: numberAttribute }, cleaner: { classPropertyName: "cleaner", publicName: "cleaner", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, format: { classPropertyName: "format", publicName: "format", isSignal: false, isRequired: false, transformFunction: null }, indicator: { classPropertyName: "indicator", publicName: "indicator", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, inputDateFormat: { classPropertyName: "inputDateFormat", publicName: "inputDateFormat", isSignal: false, isRequired: false, transformFunction: null }, inputDateParse: { classPropertyName: "inputDateParse", publicName: "inputDateParse", isSignal: false, isRequired: false, transformFunction: null }, inputReadOnly: { classPropertyName: "inputReadOnly", publicName: "inputReadOnly", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, navYearFirst: { classPropertyName: "navYearFirst", publicName: "navYearFirst", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: false, isRequired: false, transformFunction: null }, rangesButtonsColor: { classPropertyName: "rangesButtonsColor", publicName: "rangesButtonsColor", isSignal: false, isRequired: false, transformFunction: null }, rangesButtonsSize: { classPropertyName: "rangesButtonsSize", publicName: "rangesButtonsSize", isSignal: false, isRequired: false, transformFunction: null }, rangesButtonsVariant: { classPropertyName: "rangesButtonsVariant", publicName: "rangesButtonsVariant", isSignal: false, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, timepicker: { classPropertyName: "timepicker", publicName: "timepicker", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, valid: { classPropertyName: "valid", publicName: "valid", isSignal: false, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, startDateModel: { classPropertyName: "startDateModel", publicName: "startDate", isSignal: true, isRequired: false, transformFunction: null }, endDateModel: { classPropertyName: "endDateModel", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null }, calendarDate: { classPropertyName: "calendarDate", publicName: "calendarDate", isSignal: false, isRequired: false, transformFunction: dateTransform }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: false, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: false, isRequired: false, transformFunction: numberAttribute }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: false, isRequired: false, transformFunction: null }, navigation: { classPropertyName: "navigation", publicName: "navigation", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, range: { classPropertyName: "range", publicName: "range", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, weekdayFormat: { classPropertyName: "weekdayFormat", publicName: "weekdayFormat", isSignal: false, isRequired: false, transformFunction: null }, popperjsOptions: { classPropertyName: "popperjsOptions", publicName: "popperOptions", isSignal: false, isRequired: false, transformFunction: null }, selectAdjacentDays: { classPropertyName: "selectAdjacentDays", publicName: "selectAdjacentDays", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, showAdjacentDays: { classPropertyName: "showAdjacentDays", publicName: "showAdjacentDays", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, selectionType: { classPropertyName: "selectionType", publicName: "selectionType", isSignal: false, isRequired: false, transformFunction: null }, showWeekNumber: { classPropertyName: "showWeekNumber", publicName: "showWeekNumber", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, weekNumbersLabel: { classPropertyName: "weekNumbersLabel", publicName: "weekNumbersLabel", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { startDateModel: "startDateChange", endDateModel: "endDateChange", valueChange: "valueChange", calendarCellHover: "calendarCellHover", calendarDateChange: "calendarDateChange" }, host: { listeners: { "focusout": "onBlur()" }, properties: { "class": "this.datePickerClasses" } }, providers: [
|
|
8148
8155
|
{
|
|
8149
8156
|
provide: NG_VALUE_ACCESSOR,
|
|
8150
8157
|
useExisting: forwardRef(() => DateRangePickerComponent),
|
|
8151
8158
|
multi: true
|
|
8152
8159
|
}
|
|
8153
|
-
], queries: [{ propertyName: "contentTemplates", predicate: TemplateIdDirective, descendants: true }], viewQueries: [{ propertyName: "startDateElementRef", first: true, predicate: ["startDateElementRef"], descendants: true }, { propertyName: "endDateElementRef", first: true, predicate: ["endDateElementRef"], descendants: true }], exportAs: ["cDateRangePicker"], usesOnChanges: true, ngImport: i0, template: "<c-dropdown #dropdown=\"cDropdown\" [
|
|
8160
|
+
], queries: [{ propertyName: "contentTemplates", predicate: TemplateIdDirective, descendants: true }], viewQueries: [{ propertyName: "startDateElementRef", first: true, predicate: ["startDateElementRef"], descendants: true }, { propertyName: "endDateElementRef", first: true, predicate: ["endDateElementRef"], descendants: true }], exportAs: ["cDateRangePicker"], usesOnChanges: true, ngImport: i0, template: "<fieldset [formGroup]=\"dateRangeGroup\">\n <c-dropdown #dropdown=\"cDropdown\" [(visible)]=\"visible\" [autoClose]=\"'outside'\" [ngClass]=\"datePickerClasses\"\n [popperOptions]=\"popperjsOptions\" class=\"date-picker picker\">\n <div [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\"\n cDropdownToggle\n class=\"date-picker-input-group\"\n >\n <input #startDateElementRef\n (change)=\"handleStartDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"range ? undefined : valid\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"startDateInput\"\n pattern=\"[1-9]*\"\n >\n @if (range && separator !== false) {\n <div class=\"date-picker-separator\"></div>\n }\n @if (range) {\n <input #endDateElementRef\n (change)=\"handleEndDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"valid ?? undefined\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"endDateInput\"\n pattern=\"[1-9]*\"\n >\n }\n @if (indicator) {\n <div class=\"date-picker-indicator\"></div>\n }\n @if (cleaner && startDateElementRef.value && !disabled) {\n <div (click)=\"!disabled && handleClear($event)\" class=\"date-picker-cleaner\" role=\"button\"></div>\n }\n </div>\n <div cDropdownMenu class=\"date-picker-dropdown py-0\">\n <div class=\"date-picker-body\">\n @if (!showRanges) {\n @if (ranges && customRanges.length > 0) {\n <div class=\"date-picker-ranges\">\n @for (customRange of customRanges; track customRange) {\n <button (click)=\"setCustomRange(customRange)\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n cButton>\n {{ customRange | customRangeKey }}\n </button>\n }\n </div>\n }\n }\n <c-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [dayFormat]=\"dayFormat\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate()\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale()\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navYearFirst]=\"navYearFirst\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [selectionType]=\"selectionType\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [showWeekNumber]=\"showWeekNumber\"\n [startDate]=\"startDate()\"\n [weekNumbersLabel]=\"weekNumbersLabel\"\n [weekdayFormat]=\"weekdayFormat\"\n class=\"date-picker-calendars\"\n />\n @if (false && timepicker) {\n <div class=\"date-picker-timepickers\">\n <!-- todo-->\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!startDate()\"\n [time]=\"startDate() ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n />\n @if (range) {\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!endDate()\"\n [time]=\"endDate() ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n />\n }\n </div>\n }\n </div>\n @if (templates?.datePickerFooter) {\n <div class=\"date-picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\" />\n </div>\n }\n </div>\n <ng-content />\n </c-dropdown>\n</fieldset>\n", styles: [".form-control.date-picker-input:focus{box-shadow:0 0}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: CalendarComponent, selector: "c-calendar", inputs: ["calendarDate", "calendars", "dayFormat", "disabledDates", "startDate", "endDate", "firstDayOfWeek", "locale", "maxDate", "minDate", "navigation", "navYearFirst", "range", "view", "weekdayFormat", "dateFilter", "selectAdjacentDays", "showAdjacentDays", "selectionType", "showWeekNumber", "weekNumbersLabel"], outputs: ["calendarCellHover", "calendarDateChange", "endDateChange", "startDateChange", "viewChange"], exportAs: ["cCalendar"] }, { kind: "component", type: TimePickerComponent, selector: "c-time-picker", inputs: ["cleaner", "dateTimeFormatOptions", "disabled", "filterHours", "filterMinutes", "filterSeconds", "indicator", "inputReadOnly", "locale", "placeholder", "seconds", "size", "time", "variant", "valid", "visible"], outputs: ["timeChange"], exportAs: ["cTimePicker"] }, { kind: "directive", type: ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "type", "variant"], exportAs: ["cButton"] }, { kind: "component", type: DropdownComponent, selector: "c-dropdown", inputs: ["alignment", "autoClose", "direction", "placement", "popper", "popperOptions", "variant", "visible"], outputs: ["visibleChange"], exportAs: ["cDropdown"] }, { kind: "directive", type: DropdownToggleDirective, selector: "[cDropdownToggle]", inputs: ["dropdownComponent", "disabled", "caret", "split"], exportAs: ["cDropdownToggle"] }, { kind: "directive", type: DropdownMenuDirective, selector: "[cDropdownMenu]", inputs: ["alignment", "visible"], exportAs: ["cDropdownMenu"] }, { kind: "directive", type: FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "pipe", type: CustomRangeKeyPipe, name: "customRangeKey" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8154
8161
|
}
|
|
8155
8162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DateRangePickerComponent, decorators: [{
|
|
8156
8163
|
type: Component,
|
|
@@ -8174,7 +8181,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
8174
8181
|
useExisting: forwardRef(() => DateRangePickerComponent),
|
|
8175
8182
|
multi: true
|
|
8176
8183
|
}
|
|
8177
|
-
], template: "<c-dropdown #dropdown=\"cDropdown\" [
|
|
8184
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<fieldset [formGroup]=\"dateRangeGroup\">\n <c-dropdown #dropdown=\"cDropdown\" [(visible)]=\"visible\" [autoClose]=\"'outside'\" [ngClass]=\"datePickerClasses\"\n [popperOptions]=\"popperjsOptions\" class=\"date-picker picker\">\n <div [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\"\n cDropdownToggle\n class=\"date-picker-input-group\"\n >\n <input #startDateElementRef\n (change)=\"handleStartDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"range ? undefined : valid\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"startDateInput\"\n pattern=\"[1-9]*\"\n >\n @if (range && separator !== false) {\n <div class=\"date-picker-separator\"></div>\n }\n @if (range) {\n <input #endDateElementRef\n (change)=\"handleEndDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"valid ?? undefined\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"endDateInput\"\n pattern=\"[1-9]*\"\n >\n }\n @if (indicator) {\n <div class=\"date-picker-indicator\"></div>\n }\n @if (cleaner && startDateElementRef.value && !disabled) {\n <div (click)=\"!disabled && handleClear($event)\" class=\"date-picker-cleaner\" role=\"button\"></div>\n }\n </div>\n <div cDropdownMenu class=\"date-picker-dropdown py-0\">\n <div class=\"date-picker-body\">\n @if (!showRanges) {\n @if (ranges && customRanges.length > 0) {\n <div class=\"date-picker-ranges\">\n @for (customRange of customRanges; track customRange) {\n <button (click)=\"setCustomRange(customRange)\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n cButton>\n {{ customRange | customRangeKey }}\n </button>\n }\n </div>\n }\n }\n <c-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [dayFormat]=\"dayFormat\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate()\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale()\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navYearFirst]=\"navYearFirst\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [selectionType]=\"selectionType\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [showWeekNumber]=\"showWeekNumber\"\n [startDate]=\"startDate()\"\n [weekNumbersLabel]=\"weekNumbersLabel\"\n [weekdayFormat]=\"weekdayFormat\"\n class=\"date-picker-calendars\"\n />\n @if (false && timepicker) {\n <div class=\"date-picker-timepickers\">\n <!-- todo-->\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!startDate()\"\n [time]=\"startDate() ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n />\n @if (range) {\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!endDate()\"\n [time]=\"endDate() ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n />\n }\n </div>\n }\n </div>\n @if (templates?.datePickerFooter) {\n <div class=\"date-picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\" />\n </div>\n }\n </div>\n <ng-content />\n </c-dropdown>\n</fieldset>\n", styles: [".form-control.date-picker-input:focus{box-shadow:0 0}\n"] }]
|
|
8178
8185
|
}], ctorParameters: () => [{ type: i1$4.BreakpointObserver }], propDecorators: { dayFormat: [{
|
|
8179
8186
|
type: Input
|
|
8180
8187
|
}], calendars: [{
|
|
@@ -8224,10 +8231,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
8224
8231
|
}], visible: [{
|
|
8225
8232
|
type: Input,
|
|
8226
8233
|
args: [{ transform: booleanAttribute }]
|
|
8227
|
-
}], startDate: [{
|
|
8228
|
-
type: Input
|
|
8229
|
-
}], endDate: [{
|
|
8230
|
-
type: Input
|
|
8231
8234
|
}], calendarDate: [{
|
|
8232
8235
|
type: Input,
|
|
8233
8236
|
args: [{ transform: dateTransform }]
|
|
@@ -8236,8 +8239,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
8236
8239
|
}], firstDayOfWeek: [{
|
|
8237
8240
|
type: Input,
|
|
8238
8241
|
args: [{ transform: numberAttribute }]
|
|
8239
|
-
}], locale: [{
|
|
8240
|
-
type: Input
|
|
8241
8242
|
}], maxDate: [{
|
|
8242
8243
|
type: Input
|
|
8243
8244
|
}], minDate: [{
|
|
@@ -8279,10 +8280,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
8279
8280
|
type: Output
|
|
8280
8281
|
}], calendarDateChange: [{
|
|
8281
8282
|
type: Output
|
|
8282
|
-
}], endDateChange: [{
|
|
8283
|
-
type: Output
|
|
8284
|
-
}], startDateChange: [{
|
|
8285
|
-
type: Output
|
|
8286
8283
|
}], startDateElementRef: [{
|
|
8287
8284
|
type: ViewChild,
|
|
8288
8285
|
args: ['startDateElementRef']
|
|
@@ -8317,45 +8314,42 @@ class DatePickerComponent extends DateRangePickerComponent {
|
|
|
8317
8314
|
constructor(breakpointObserver) {
|
|
8318
8315
|
super(breakpointObserver);
|
|
8319
8316
|
this.placeholder = 'Select date';
|
|
8320
|
-
|
|
8321
|
-
this.startDateChange = new EventEmitter();
|
|
8317
|
+
this.dateChange = output();
|
|
8322
8318
|
this.range = false;
|
|
8323
8319
|
this.calendars = 1;
|
|
8320
|
+
this.endDate = model(null);
|
|
8324
8321
|
}
|
|
8325
|
-
|
|
8326
|
-
|
|
8322
|
+
set date(value) {
|
|
8323
|
+
this.startDateModel.set(value);
|
|
8327
8324
|
}
|
|
8328
8325
|
get date() {
|
|
8329
|
-
return this.startDate;
|
|
8326
|
+
return this.startDate();
|
|
8330
8327
|
}
|
|
8331
|
-
set date(value) {
|
|
8332
|
-
this.startDate = value;
|
|
8333
|
-
}
|
|
8334
|
-
// @ts-ignore
|
|
8335
8328
|
writeValue(value) {
|
|
8336
8329
|
this.date = value;
|
|
8337
|
-
|
|
8330
|
+
super.writeValue(value);
|
|
8338
8331
|
}
|
|
8339
8332
|
subscribeDateChange(subscribe = true) {
|
|
8340
8333
|
if (subscribe) {
|
|
8341
|
-
this.dateChangeSubscriptions.push(this.startDateChange.subscribe(next => {
|
|
8334
|
+
this.dateChangeSubscriptions.push(this.startDateChange.subscribe((next) => {
|
|
8342
8335
|
this.date = next;
|
|
8343
8336
|
this.onChange(next);
|
|
8337
|
+
this.dateChange.emit(this.date);
|
|
8344
8338
|
}));
|
|
8345
8339
|
return;
|
|
8346
8340
|
}
|
|
8347
|
-
this.dateChangeSubscriptions.forEach(subscription => {
|
|
8341
|
+
this.dateChangeSubscriptions.forEach((subscription) => {
|
|
8348
8342
|
subscription?.unsubscribe();
|
|
8349
8343
|
});
|
|
8350
8344
|
}
|
|
8351
8345
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DatePickerComponent, deps: [{ token: i1$4.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8352
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: DatePickerComponent, isStandalone: true, selector: "c-date-picker", inputs: { placeholder: "placeholder", date: "date" }, outputs: {
|
|
8346
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.11", type: DatePickerComponent, isStandalone: true, selector: "c-date-picker", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, endDate: { classPropertyName: "endDate", publicName: "endDate", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { dateChange: "dateChange", endDate: "endDateChange" }, providers: [
|
|
8353
8347
|
{
|
|
8354
8348
|
provide: NG_VALUE_ACCESSOR,
|
|
8355
8349
|
useExisting: forwardRef(() => DatePickerComponent),
|
|
8356
8350
|
multi: true
|
|
8357
8351
|
}
|
|
8358
|
-
], exportAs: ["cDatePicker"], usesInheritance: true, ngImport: i0, template: "<c-dropdown #dropdown=\"cDropdown\" [
|
|
8352
|
+
], exportAs: ["cDatePicker"], usesInheritance: true, ngImport: i0, template: "<fieldset [formGroup]=\"dateRangeGroup\">\n <c-dropdown #dropdown=\"cDropdown\" [(visible)]=\"visible\" [autoClose]=\"'outside'\" [ngClass]=\"datePickerClasses\"\n [popperOptions]=\"popperjsOptions\" class=\"date-picker picker\">\n <div [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\"\n cDropdownToggle\n class=\"date-picker-input-group\"\n >\n <input #startDateElementRef\n (change)=\"handleStartDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"range ? undefined : valid\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"startDateInput\"\n pattern=\"[1-9]*\"\n >\n @if (range && separator !== false) {\n <div class=\"date-picker-separator\"></div>\n }\n @if (range) {\n <input #endDateElementRef\n (change)=\"handleEndDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"valid ?? undefined\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"endDateInput\"\n pattern=\"[1-9]*\"\n >\n }\n @if (indicator) {\n <div class=\"date-picker-indicator\"></div>\n }\n @if (cleaner && startDateElementRef.value && !disabled) {\n <div (click)=\"!disabled && handleClear($event)\" class=\"date-picker-cleaner\" role=\"button\"></div>\n }\n </div>\n <div cDropdownMenu class=\"date-picker-dropdown py-0\">\n <div class=\"date-picker-body\">\n @if (!showRanges) {\n @if (ranges && customRanges.length > 0) {\n <div class=\"date-picker-ranges\">\n @for (customRange of customRanges; track customRange) {\n <button (click)=\"setCustomRange(customRange)\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n cButton>\n {{ customRange | customRangeKey }}\n </button>\n }\n </div>\n }\n }\n <c-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [dayFormat]=\"dayFormat\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate()\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale()\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navYearFirst]=\"navYearFirst\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [selectionType]=\"selectionType\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [showWeekNumber]=\"showWeekNumber\"\n [startDate]=\"startDate()\"\n [weekNumbersLabel]=\"weekNumbersLabel\"\n [weekdayFormat]=\"weekdayFormat\"\n class=\"date-picker-calendars\"\n />\n @if (false && timepicker) {\n <div class=\"date-picker-timepickers\">\n <!-- todo-->\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!startDate()\"\n [time]=\"startDate() ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n />\n @if (range) {\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!endDate()\"\n [time]=\"endDate() ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n />\n }\n </div>\n }\n </div>\n @if (templates?.datePickerFooter) {\n <div class=\"date-picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\" />\n </div>\n }\n </div>\n <ng-content />\n </c-dropdown>\n</fieldset>\n", styles: [".form-control.date-picker-input:focus{box-shadow:0 0}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: CalendarComponent, selector: "c-calendar", inputs: ["calendarDate", "calendars", "dayFormat", "disabledDates", "startDate", "endDate", "firstDayOfWeek", "locale", "maxDate", "minDate", "navigation", "navYearFirst", "range", "view", "weekdayFormat", "dateFilter", "selectAdjacentDays", "showAdjacentDays", "selectionType", "showWeekNumber", "weekNumbersLabel"], outputs: ["calendarCellHover", "calendarDateChange", "endDateChange", "startDateChange", "viewChange"], exportAs: ["cCalendar"] }, { kind: "component", type: TimePickerComponent, selector: "c-time-picker", inputs: ["cleaner", "dateTimeFormatOptions", "disabled", "filterHours", "filterMinutes", "filterSeconds", "indicator", "inputReadOnly", "locale", "placeholder", "seconds", "size", "time", "variant", "valid", "visible"], outputs: ["timeChange"], exportAs: ["cTimePicker"] }, { kind: "directive", type: ButtonDirective, selector: "[cButton]", inputs: ["active", "color", "disabled", "shape", "size", "type", "variant"], exportAs: ["cButton"] }, { kind: "component", type: DropdownComponent, selector: "c-dropdown", inputs: ["alignment", "autoClose", "direction", "placement", "popper", "popperOptions", "variant", "visible"], outputs: ["visibleChange"], exportAs: ["cDropdown"] }, { kind: "directive", type: DropdownToggleDirective, selector: "[cDropdownToggle]", inputs: ["dropdownComponent", "disabled", "caret", "split"], exportAs: ["cDropdownToggle"] }, { kind: "directive", type: DropdownMenuDirective, selector: "[cDropdownMenu]", inputs: ["alignment", "visible"], exportAs: ["cDropdownMenu"] }, { kind: "directive", type: FormControlDirective, selector: "input[cFormControl], textarea[cFormControl]", inputs: ["sizing", "valid", "type", "plaintext"] }, { kind: "pipe", type: CustomRangeKeyPipe, name: "customRangeKey" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8359
8353
|
}
|
|
8360
8354
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
8361
8355
|
type: Component,
|
|
@@ -8379,12 +8373,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
|
8379
8373
|
useExisting: forwardRef(() => DatePickerComponent),
|
|
8380
8374
|
multi: true
|
|
8381
8375
|
}
|
|
8382
|
-
], template: "<c-dropdown #dropdown=\"cDropdown\" [
|
|
8376
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<fieldset [formGroup]=\"dateRangeGroup\">\n <c-dropdown #dropdown=\"cDropdown\" [(visible)]=\"visible\" [autoClose]=\"'outside'\" [ngClass]=\"datePickerClasses\"\n [popperOptions]=\"popperjsOptions\" class=\"date-picker picker\">\n <div [caret]=\"false\"\n [disabled]=\"disabled ?? dropdown.visible\"\n cDropdownToggle\n class=\"date-picker-input-group\"\n >\n <input #startDateElementRef\n (change)=\"handleStartDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputStartHoverValue}\"\n [placeholder]=\"startDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"range ? undefined : valid\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"startDateInput\"\n pattern=\"[1-9]*\"\n >\n @if (range && separator !== false) {\n <div class=\"date-picker-separator\"></div>\n }\n @if (range) {\n <input #endDateElementRef\n (change)=\"handleEndDateInputChange($event)\"\n [attr.tabindex]=\"disabled ? -1 : 0\"\n [ngClass]=\"{hover: !!inputEndHoverValue}\"\n [placeholder]=\"endDatePlaceholder\"\n [readonly]=\"inputReadOnly ?? null\"\n [valid]=\"valid ?? undefined\"\n cFormControl\n class=\"date-picker-input\"\n formControlName=\"endDateInput\"\n pattern=\"[1-9]*\"\n >\n }\n @if (indicator) {\n <div class=\"date-picker-indicator\"></div>\n }\n @if (cleaner && startDateElementRef.value && !disabled) {\n <div (click)=\"!disabled && handleClear($event)\" class=\"date-picker-cleaner\" role=\"button\"></div>\n }\n </div>\n <div cDropdownMenu class=\"date-picker-dropdown py-0\">\n <div class=\"date-picker-body\">\n @if (!showRanges) {\n @if (ranges && customRanges.length > 0) {\n <div class=\"date-picker-ranges\">\n @for (customRange of customRanges; track customRange) {\n <button (click)=\"setCustomRange(customRange)\"\n [color]=\"rangesButtonsColor\"\n [size]=\"rangesButtonsSize\"\n [variant]=\"rangesButtonsVariant\"\n cButton>\n {{ customRange | customRangeKey }}\n </button>\n }\n </div>\n }\n }\n <c-calendar\n (calendarCellHover)=\"handleCalendarCellHover($event)\"\n (calendarDateChange)=\"handleCalendarDateChange($event)\"\n (endDateChange)=\"handleEndDateChange($event)\"\n (startDateChange)=\"handleStartDateChange($event)\"\n [calendarDate]=\"calendarDate\"\n [calendars]=\"isMobile ? 1 : calendars\"\n [dateFilter]=\"dateFilter\"\n [dayFormat]=\"dayFormat\"\n [disabledDates]=\"disabledDates\"\n [endDate]=\"endDate()\"\n [firstDayOfWeek]=\"firstDayOfWeek\"\n [locale]=\"locale()\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [navYearFirst]=\"navYearFirst\"\n [navigation]=\"navigation\"\n [range]=\"range\"\n [selectAdjacentDays]=\"selectAdjacentDays\"\n [selectionType]=\"selectionType\"\n [showAdjacentDays]=\"showAdjacentDays\"\n [showWeekNumber]=\"showWeekNumber\"\n [startDate]=\"startDate()\"\n [weekNumbersLabel]=\"weekNumbersLabel\"\n [weekdayFormat]=\"weekdayFormat\"\n class=\"date-picker-calendars\"\n />\n @if (false && timepicker) {\n <div class=\"date-picker-timepickers\">\n <!-- todo-->\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!startDate()\"\n [time]=\"startDate() ?? undefined\"\n (timeChange)=\"handleStartTimeChange($event)\"\n />\n @if (range) {\n <c-time-picker\n variant=\"select\"\n [locale]=\"locale()\"\n [disabled]=\"!endDate()\"\n [time]=\"endDate() ?? undefined\"\n (timeChange)=\"handleEndTimeChange($event)\"\n />\n }\n </div>\n }\n </div>\n @if (templates?.datePickerFooter) {\n <div class=\"date-picker-footer\">\n <ng-container *ngTemplateOutlet=\"templates?.datePickerFooter; context: {$implicit: dropdown}\" />\n </div>\n }\n </div>\n <ng-content />\n </c-dropdown>\n</fieldset>\n", styles: [".form-control.date-picker-input:focus{box-shadow:0 0}\n"] }]
|
|
8383
8377
|
}], ctorParameters: () => [{ type: i1$4.BreakpointObserver }], propDecorators: { placeholder: [{
|
|
8384
8378
|
type: Input
|
|
8385
|
-
}], startDateChange: [{
|
|
8386
|
-
type: Output,
|
|
8387
|
-
args: ['dateChange']
|
|
8388
8379
|
}], date: [{
|
|
8389
8380
|
type: Input
|
|
8390
8381
|
}] } });
|