primeng 7.1.0-rc.1 → 7.1.3
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/CHANGELOG.md +137 -1
- package/components/accordion/accordion.js +1 -1
- package/components/accordion/accordion.js.map +1 -1
- package/components/accordion/accordion.metadata.json +1 -1
- package/components/autocomplete/autocomplete.d.ts +2 -2
- package/components/autocomplete/autocomplete.js +6 -4
- package/components/autocomplete/autocomplete.js.map +1 -1
- package/components/autocomplete/autocomplete.metadata.json +1 -1
- package/components/calendar/calendar.d.ts +11 -4
- package/components/calendar/calendar.js +84 -31
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/calendar.metadata.json +1 -1
- package/components/checkbox/checkbox.d.ts +1 -0
- package/components/checkbox/checkbox.js +6 -1
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/checkbox.metadata.json +1 -1
- package/components/common/confirmation.d.ts +1 -1
- package/components/confirmdialog/confirmdialog.js +4 -4
- package/components/confirmdialog/confirmdialog.js.map +1 -1
- package/components/confirmdialog/confirmdialog.metadata.json +1 -1
- package/components/contextmenu/contextmenu.js +3 -3
- package/components/contextmenu/contextmenu.js.map +1 -1
- package/components/contextmenu/contextmenu.metadata.json +1 -1
- package/components/dataview/dataview.d.ts +2 -0
- package/components/dataview/dataview.js +13 -2
- package/components/dataview/dataview.js.map +1 -1
- package/components/dataview/dataview.metadata.json +1 -1
- package/components/dialog/dialog.d.ts +6 -0
- package/components/dialog/dialog.js +65 -4
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/dialog.metadata.json +1 -1
- package/components/dom/domhandler.d.ts +1 -1
- package/components/dom/domhandler.js +22 -13
- package/components/dom/domhandler.js.map +1 -1
- package/components/dom/domhandler.metadata.json +1 -1
- package/components/dropdown/dropdown.d.ts +3 -3
- package/components/dropdown/dropdown.js +19 -9
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/dropdown.metadata.json +1 -1
- package/components/dynamicdialog/dynamicdialog.js +3 -3
- package/components/dynamicdialog/dynamicdialog.js.map +1 -1
- package/components/dynamicdialog/dynamicdialog.metadata.json +1 -1
- package/components/fullcalendar/fullcalendar.js +2 -2
- package/components/fullcalendar/fullcalendar.js.map +1 -1
- package/components/galleria/galleria.js +3 -1
- package/components/galleria/galleria.js.map +1 -1
- package/components/galleria/galleria.metadata.json +1 -1
- package/components/gmap/gmap.d.ts +1 -0
- package/components/gmap/gmap.js +14 -0
- package/components/gmap/gmap.js.map +1 -1
- package/components/gmap/gmap.metadata.json +1 -1
- package/components/inputmask/inputmask.d.ts +1 -1
- package/components/inputmask/inputmask.js +2 -2
- package/components/inputmask/inputmask.js.map +1 -1
- package/components/inputtextarea/inputtextarea.js +0 -1
- package/components/inputtextarea/inputtextarea.js.map +1 -1
- package/components/inputtextarea/inputtextarea.metadata.json +1 -1
- package/components/listbox/listbox.d.ts +1 -0
- package/components/listbox/listbox.js +9 -0
- package/components/listbox/listbox.js.map +1 -1
- package/components/listbox/listbox.metadata.json +1 -1
- package/components/menu/menu.js +1 -1
- package/components/menu/menu.js.map +1 -1
- package/components/menu/menu.metadata.json +1 -1
- package/components/menubar/menubar.js +2 -2
- package/components/menubar/menubar.js.map +1 -1
- package/components/multiselect/multiselect.d.ts +1 -0
- package/components/multiselect/multiselect.js +14 -7
- package/components/multiselect/multiselect.js.map +1 -1
- package/components/multiselect/multiselect.metadata.json +1 -1
- package/components/orderlist/orderlist.js +1 -1
- package/components/orderlist/orderlist.js.map +1 -1
- package/components/paginator/paginator.d.ts +7 -1
- package/components/paginator/paginator.js +30 -3
- package/components/paginator/paginator.js.map +1 -1
- package/components/paginator/paginator.metadata.json +1 -1
- package/components/panelmenu/panelmenu.d.ts +5 -0
- package/components/panelmenu/panelmenu.js +11 -7
- package/components/panelmenu/panelmenu.js.map +1 -1
- package/components/panelmenu/panelmenu.metadata.json +1 -1
- package/components/picklist/picklist.js +1 -1
- package/components/picklist/picklist.js.map +1 -1
- package/components/radiobutton/radiobutton.d.ts +5 -3
- package/components/radiobutton/radiobutton.js +19 -7
- package/components/radiobutton/radiobutton.js.map +1 -1
- package/components/radiobutton/radiobutton.metadata.json +1 -1
- package/components/slider/slider.js +9 -0
- package/components/slider/slider.js.map +1 -1
- package/components/slider/slider.metadata.json +1 -1
- package/components/spinner/spinner.d.ts +4 -4
- package/components/spinner/spinner.js +23 -14
- package/components/spinner/spinner.js.map +1 -1
- package/components/spinner/spinner.metadata.json +1 -1
- package/components/table/table.d.ts +15 -4
- package/components/table/table.js +126 -40
- package/components/table/table.js.map +1 -1
- package/components/table/table.metadata.json +1 -1
- package/components/tieredmenu/tieredmenu.d.ts +3 -2
- package/components/tieredmenu/tieredmenu.js +4 -2
- package/components/tieredmenu/tieredmenu.js.map +1 -1
- package/components/tieredmenu/tieredmenu.metadata.json +1 -1
- package/components/tree/tree.js +8 -2
- package/components/tree/tree.js.map +1 -1
- package/components/tree/tree.metadata.json +1 -1
- package/components/treetable/treetable.d.ts +18 -1
- package/components/treetable/treetable.js +128 -8
- package/components/treetable/treetable.js.map +1 -1
- package/components/treetable/treetable.metadata.json +1 -1
- package/package.json +28 -25
- package/resources/components/calendar/calendar.css +1 -0
- package/resources/components/dialog/dialog.css +2 -4
- package/resources/components/dropdown/dropdown.css +1 -0
- package/resources/components/fileupload/fileupload.css +1 -0
- package/resources/components/galleria/galleria.css +1 -2
- package/resources/components/radiobutton/radiobutton.css +1 -1
- package/resources/primeng.css +562 -562
- package/resources/primeng.min.css +1 -1
- package/resources/themes/luna-amber/theme.css +77 -8
- package/resources/themes/luna-blue/theme.css +77 -8
- package/resources/themes/luna-green/theme.css +77 -8
- package/resources/themes/luna-pink/theme.css +77 -8
- package/resources/themes/nova-colored/theme.css +77 -8
- package/resources/themes/nova-dark/theme.css +77 -8
- package/resources/themes/nova-light/theme.css +77 -8
- package/resources/themes/rhea/theme.css +77 -8
@@ -12,6 +12,7 @@ export interface LocaleSettings {
|
|
12
12
|
today: string;
|
13
13
|
clear: string;
|
14
14
|
dateFormat?: string;
|
15
|
+
weekHeader?: string;
|
15
16
|
}
|
16
17
|
export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
|
17
18
|
el: ElementRef;
|
@@ -37,7 +38,6 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
37
38
|
shortYearCutoff: any;
|
38
39
|
monthNavigator: boolean;
|
39
40
|
yearNavigator: boolean;
|
40
|
-
yearRange: string;
|
41
41
|
hourFormat: string;
|
42
42
|
timeOnly: boolean;
|
43
43
|
stepHour: number;
|
@@ -46,6 +46,7 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
46
46
|
showSeconds: boolean;
|
47
47
|
required: boolean;
|
48
48
|
showOnFocus: boolean;
|
49
|
+
showWeek: boolean;
|
49
50
|
dataType: string;
|
50
51
|
selectionMode: string;
|
51
52
|
maxDateCount: number;
|
@@ -94,7 +95,6 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
94
95
|
maskClickListener: Function;
|
95
96
|
overlay: HTMLDivElement;
|
96
97
|
overlayVisible: boolean;
|
97
|
-
datepickerClick: boolean;
|
98
98
|
onModelChange: Function;
|
99
99
|
onModelTouched: Function;
|
100
100
|
calendarElement: any;
|
@@ -109,6 +109,7 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
109
109
|
_minDate: Date;
|
110
110
|
_maxDate: Date;
|
111
111
|
_showTime: boolean;
|
112
|
+
_yearRange: string;
|
112
113
|
preventDocumentListener: boolean;
|
113
114
|
dateTemplate: TemplateRef<any>;
|
114
115
|
_disabledDates: Array<Date>;
|
@@ -121,6 +122,7 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
121
122
|
maxDate: Date;
|
122
123
|
disabledDates: Date[];
|
123
124
|
disabledDays: number[];
|
125
|
+
yearRange: string;
|
124
126
|
showTime: boolean;
|
125
127
|
locale: LocaleSettings;
|
126
128
|
constructor(el: ElementRef, renderer: Renderer2, cd: ChangeDetectorRef);
|
@@ -130,10 +132,12 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
130
132
|
createWeekDays(): void;
|
131
133
|
createMonthPickerValues(): void;
|
132
134
|
createMonths(month: number, year: number): void;
|
135
|
+
getWeekNumber(date: Date): number;
|
133
136
|
createMonth(month: number, year: number): {
|
134
137
|
month: number;
|
135
138
|
year: number;
|
136
139
|
dates: any[];
|
140
|
+
weekNumbers: any[];
|
137
141
|
};
|
138
142
|
initTime(date: Date): void;
|
139
143
|
navBackward(event: any): void;
|
@@ -193,14 +197,15 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
193
197
|
updateTime(): void;
|
194
198
|
toggleAMPM(event: any): void;
|
195
199
|
onUserInput(event: any): void;
|
196
|
-
|
200
|
+
isValidSelection(value: any): boolean;
|
201
|
+
parseValueFromString(text: string): Date | Date[];
|
197
202
|
parseDateTime(text: any): Date;
|
198
203
|
populateTime(value: any, timeString: any, ampm: any): void;
|
199
204
|
updateUI(): void;
|
200
|
-
onDatePickerClick(event: any): void;
|
201
205
|
showOverlay(): void;
|
202
206
|
hideOverlay(): void;
|
203
207
|
onOverlayAnimationStart(event: AnimationEvent): void;
|
208
|
+
onOverlayAnimationDone(event: AnimationEvent): void;
|
204
209
|
appendOverlay(): void;
|
205
210
|
restoreOverlayAppend(): void;
|
206
211
|
alignOverlay(): void;
|
@@ -228,6 +233,8 @@ export declare class Calendar implements OnInit, OnDestroy, ControlValueAccessor
|
|
228
233
|
unbindDocumentClickListener(): void;
|
229
234
|
bindDocumentResizeListener(): void;
|
230
235
|
unbindDocumentResizeListener(): void;
|
236
|
+
isOutsideClicked(event: Event): boolean;
|
237
|
+
isNavIconClicked(event: Event): boolean;
|
231
238
|
onWindowResize(): void;
|
232
239
|
onOverlayHide(): void;
|
233
240
|
ngOnDestroy(): void;
|
@@ -37,6 +37,7 @@ var Calendar = /** @class */ (function () {
|
|
37
37
|
this.stepSecond = 1;
|
38
38
|
this.showSeconds = false;
|
39
39
|
this.showOnFocus = true;
|
40
|
+
this.showWeek = false;
|
40
41
|
this.dataType = 'date';
|
41
42
|
this.selectionMode = 'single';
|
42
43
|
this.todayButtonStyleClass = 'ui-button-secondary';
|
@@ -68,7 +69,8 @@ var Calendar = /** @class */ (function () {
|
|
68
69
|
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
69
70
|
today: 'Today',
|
70
71
|
clear: 'Clear',
|
71
|
-
dateFormat: 'mm/dd/yy'
|
72
|
+
dateFormat: 'mm/dd/yy',
|
73
|
+
weekHeader: 'Wk'
|
72
74
|
};
|
73
75
|
this.onModelChange = function () { };
|
74
76
|
this.onModelTouched = function () { };
|
@@ -137,6 +139,21 @@ var Calendar = /** @class */ (function () {
|
|
137
139
|
enumerable: true,
|
138
140
|
configurable: true
|
139
141
|
});
|
142
|
+
Object.defineProperty(Calendar.prototype, "yearRange", {
|
143
|
+
get: function () {
|
144
|
+
return this._yearRange;
|
145
|
+
},
|
146
|
+
set: function (yearRange) {
|
147
|
+
if (this.yearNavigator && yearRange) {
|
148
|
+
var years = yearRange.split(':');
|
149
|
+
var yearStart = parseInt(years[0]);
|
150
|
+
var yearEnd = parseInt(years[1]);
|
151
|
+
this.populateYearOptions(yearStart, yearEnd);
|
152
|
+
}
|
153
|
+
},
|
154
|
+
enumerable: true,
|
155
|
+
configurable: true
|
156
|
+
});
|
140
157
|
Object.defineProperty(Calendar.prototype, "showTime", {
|
141
158
|
get: function () {
|
142
159
|
return this._showTime;
|
@@ -172,12 +189,6 @@ var Calendar = /** @class */ (function () {
|
|
172
189
|
var date = this.defaultDate || new Date();
|
173
190
|
this.currentMonth = date.getMonth();
|
174
191
|
this.currentYear = date.getFullYear();
|
175
|
-
if (this.yearNavigator && this.yearRange) {
|
176
|
-
var years = this.yearRange.split(':');
|
177
|
-
var yearStart = parseInt(years[0]);
|
178
|
-
var yearEnd = parseInt(years[1]);
|
179
|
-
this.populateYearOptions(yearStart, yearEnd);
|
180
|
-
}
|
181
192
|
if (this.view === 'date') {
|
182
193
|
this.createWeekDays();
|
183
194
|
this.initTime(date);
|
@@ -233,14 +244,22 @@ var Calendar = /** @class */ (function () {
|
|
233
244
|
this.months.push(this.createMonth(m, y));
|
234
245
|
}
|
235
246
|
};
|
247
|
+
Calendar.prototype.getWeekNumber = function (date) {
|
248
|
+
var checkDate = new Date(date.getTime());
|
249
|
+
checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
|
250
|
+
var time = checkDate.getTime();
|
251
|
+
checkDate.setMonth(0);
|
252
|
+
checkDate.setDate(1);
|
253
|
+
return Math.floor(Math.round((time - checkDate.getTime()) / 86400000) / 7) + 1;
|
254
|
+
};
|
236
255
|
Calendar.prototype.createMonth = function (month, year) {
|
237
256
|
var dates = [];
|
238
257
|
var firstDay = this.getFirstDayOfMonthIndex(month, year);
|
239
258
|
var daysLength = this.getDaysCountInMonth(month, year);
|
240
259
|
var prevMonthDaysLength = this.getDaysCountInPrevMonth(month, year);
|
241
|
-
var sundayIndex = this.getSundayIndex();
|
242
260
|
var dayNo = 1;
|
243
261
|
var today = new Date();
|
262
|
+
var weekNumbers = [];
|
244
263
|
for (var i = 0; i < 6; i++) {
|
245
264
|
var week = [];
|
246
265
|
if (i == 0) {
|
@@ -271,12 +290,16 @@ var Calendar = /** @class */ (function () {
|
|
271
290
|
dayNo++;
|
272
291
|
}
|
273
292
|
}
|
293
|
+
if (this.showWeek) {
|
294
|
+
weekNumbers.push(this.getWeekNumber(new Date(week[0].year, week[0].month, week[0].day)));
|
295
|
+
}
|
274
296
|
dates.push(week);
|
275
297
|
}
|
276
298
|
return {
|
277
299
|
month: month,
|
278
300
|
year: year,
|
279
|
-
dates: dates
|
301
|
+
dates: dates,
|
302
|
+
weekNumbers: weekNumbers
|
280
303
|
};
|
281
304
|
};
|
282
305
|
Calendar.prototype.initTime = function (date) {
|
@@ -314,7 +337,6 @@ var Calendar = /** @class */ (function () {
|
|
314
337
|
this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
|
315
338
|
this.createMonths(this.currentMonth, this.currentYear);
|
316
339
|
}
|
317
|
-
event.preventDefault();
|
318
340
|
};
|
319
341
|
Calendar.prototype.navForward = function (event) {
|
320
342
|
if (this.disabled) {
|
@@ -335,7 +357,6 @@ var Calendar = /** @class */ (function () {
|
|
335
357
|
this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
|
336
358
|
this.createMonths(this.currentMonth, this.currentYear);
|
337
359
|
}
|
338
|
-
event.preventDefault();
|
339
360
|
};
|
340
361
|
Calendar.prototype.decrementYear = function () {
|
341
362
|
this.currentYear--;
|
@@ -391,7 +412,7 @@ var Calendar = /** @class */ (function () {
|
|
391
412
|
};
|
392
413
|
Calendar.prototype.shouldSelectDate = function (dateMeta) {
|
393
414
|
if (this.isMultipleSelection())
|
394
|
-
return
|
415
|
+
return this.maxDateCount != null ? this.maxDateCount > (this.value ? this.value.length : 0) : true;
|
395
416
|
else
|
396
417
|
return true;
|
397
418
|
};
|
@@ -682,7 +703,6 @@ var Calendar = /** @class */ (function () {
|
|
682
703
|
this.onFocus.emit(event);
|
683
704
|
};
|
684
705
|
Calendar.prototype.onInputClick = function (event) {
|
685
|
-
this.datepickerClick = true;
|
686
706
|
if (this.overlay && this.autoZIndex) {
|
687
707
|
this.overlay.style.zIndex = String(this.baseZIndex + (++domhandler_1.DomHandler.zindex));
|
688
708
|
}
|
@@ -706,7 +726,6 @@ var Calendar = /** @class */ (function () {
|
|
706
726
|
else {
|
707
727
|
this.hideOverlay();
|
708
728
|
}
|
709
|
-
this.datepickerClick = true;
|
710
729
|
};
|
711
730
|
Calendar.prototype.onInputKeydown = function (event) {
|
712
731
|
this.isKeydown = true;
|
@@ -951,18 +970,32 @@ var Calendar = /** @class */ (function () {
|
|
951
970
|
var val = event.target.value;
|
952
971
|
try {
|
953
972
|
var value = this.parseValueFromString(val);
|
954
|
-
if (this.
|
973
|
+
if (this.isValidSelection(value)) {
|
955
974
|
this.updateModel(value);
|
956
975
|
this.updateUI();
|
957
976
|
}
|
958
977
|
}
|
959
978
|
catch (err) {
|
960
979
|
//invalid date
|
961
|
-
this.updateModel(null);
|
962
980
|
}
|
963
981
|
this.filled = val != null && val.length;
|
964
982
|
this.onInput.emit(event);
|
965
983
|
};
|
984
|
+
Calendar.prototype.isValidSelection = function (value) {
|
985
|
+
var _this = this;
|
986
|
+
var isValid = true;
|
987
|
+
if (this.isSingleSelection()) {
|
988
|
+
if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) {
|
989
|
+
isValid = false;
|
990
|
+
}
|
991
|
+
}
|
992
|
+
else if (value.every(function (v) { return _this.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false); })) {
|
993
|
+
if (this.isRangeSelection()) {
|
994
|
+
isValid = value.length > 1 && value[1] > value[0] ? true : false;
|
995
|
+
}
|
996
|
+
}
|
997
|
+
return isValid;
|
998
|
+
};
|
966
999
|
Calendar.prototype.parseValueFromString = function (text) {
|
967
1000
|
if (!text || text.trim().length === 0) {
|
968
1001
|
return null;
|
@@ -1043,12 +1076,11 @@ var Calendar = /** @class */ (function () {
|
|
1043
1076
|
this.currentSecond = val.getSeconds();
|
1044
1077
|
}
|
1045
1078
|
};
|
1046
|
-
Calendar.prototype.onDatePickerClick = function (event) {
|
1047
|
-
this.datepickerClick = true;
|
1048
|
-
};
|
1049
1079
|
Calendar.prototype.showOverlay = function () {
|
1050
|
-
this.
|
1051
|
-
|
1080
|
+
if (!this.overlayVisible) {
|
1081
|
+
this.updateUI();
|
1082
|
+
this.overlayVisible = true;
|
1083
|
+
}
|
1052
1084
|
};
|
1053
1085
|
Calendar.prototype.hideOverlay = function () {
|
1054
1086
|
this.overlayVisible = false;
|
@@ -1067,8 +1099,6 @@ var Calendar = /** @class */ (function () {
|
|
1067
1099
|
this.overlay.style.zIndex = String(this.baseZIndex + (++domhandler_1.DomHandler.zindex));
|
1068
1100
|
}
|
1069
1101
|
this.alignOverlay();
|
1070
|
-
this.bindDocumentClickListener();
|
1071
|
-
this.bindDocumentResizeListener();
|
1072
1102
|
}
|
1073
1103
|
break;
|
1074
1104
|
case 'void':
|
@@ -1077,6 +1107,17 @@ var Calendar = /** @class */ (function () {
|
|
1077
1107
|
break;
|
1078
1108
|
}
|
1079
1109
|
};
|
1110
|
+
Calendar.prototype.onOverlayAnimationDone = function (event) {
|
1111
|
+
switch (event.toState) {
|
1112
|
+
case 'visible':
|
1113
|
+
case 'visibleTouchUI':
|
1114
|
+
if (!this.inline) {
|
1115
|
+
this.bindDocumentClickListener();
|
1116
|
+
this.bindDocumentResizeListener();
|
1117
|
+
}
|
1118
|
+
break;
|
1119
|
+
}
|
1120
|
+
};
|
1080
1121
|
Calendar.prototype.appendOverlay = function () {
|
1081
1122
|
if (this.appendTo) {
|
1082
1123
|
if (this.appendTo === 'body')
|
@@ -1452,10 +1493,9 @@ var Calendar = /** @class */ (function () {
|
|
1452
1493
|
var _this = this;
|
1453
1494
|
if (!this.documentClickListener) {
|
1454
1495
|
this.documentClickListener = this.renderer.listen('document', 'click', function (event) {
|
1455
|
-
if (
|
1496
|
+
if (_this.isOutsideClicked(event) && _this.overlayVisible) {
|
1456
1497
|
_this.hideOverlay();
|
1457
1498
|
}
|
1458
|
-
_this.datepickerClick = false;
|
1459
1499
|
_this.cd.detectChanges();
|
1460
1500
|
});
|
1461
1501
|
}
|
@@ -1478,8 +1518,16 @@ var Calendar = /** @class */ (function () {
|
|
1478
1518
|
this.documentResizeListener = null;
|
1479
1519
|
}
|
1480
1520
|
};
|
1521
|
+
Calendar.prototype.isOutsideClicked = function (event) {
|
1522
|
+
return !(this.el.nativeElement.isSameNode(event.target) || this.isNavIconClicked(event) ||
|
1523
|
+
this.el.nativeElement.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
|
1524
|
+
};
|
1525
|
+
Calendar.prototype.isNavIconClicked = function (event) {
|
1526
|
+
return (domhandler_1.DomHandler.hasClass(event.target, 'ui-datepicker-prev') || domhandler_1.DomHandler.hasClass(event.target, 'ui-datepicker-prev-icon')
|
1527
|
+
|| domhandler_1.DomHandler.hasClass(event.target, 'ui-datepicker-next') || domhandler_1.DomHandler.hasClass(event.target, 'ui-datepicker-next-icon'));
|
1528
|
+
};
|
1481
1529
|
Calendar.prototype.onWindowResize = function () {
|
1482
|
-
if (this.overlayVisible) {
|
1530
|
+
if (this.overlayVisible && !domhandler_1.DomHandler.isAndroid()) {
|
1483
1531
|
this.hideOverlay();
|
1484
1532
|
}
|
1485
1533
|
};
|
@@ -1573,10 +1621,6 @@ var Calendar = /** @class */ (function () {
|
|
1573
1621
|
core_1.Input(),
|
1574
1622
|
__metadata("design:type", Boolean)
|
1575
1623
|
], Calendar.prototype, "yearNavigator", void 0);
|
1576
|
-
__decorate([
|
1577
|
-
core_1.Input(),
|
1578
|
-
__metadata("design:type", String)
|
1579
|
-
], Calendar.prototype, "yearRange", void 0);
|
1580
1624
|
__decorate([
|
1581
1625
|
core_1.Input(),
|
1582
1626
|
__metadata("design:type", String)
|
@@ -1609,6 +1653,10 @@ var Calendar = /** @class */ (function () {
|
|
1609
1653
|
core_1.Input(),
|
1610
1654
|
__metadata("design:type", Boolean)
|
1611
1655
|
], Calendar.prototype, "showOnFocus", void 0);
|
1656
|
+
__decorate([
|
1657
|
+
core_1.Input(),
|
1658
|
+
__metadata("design:type", Boolean)
|
1659
|
+
], Calendar.prototype, "showWeek", void 0);
|
1612
1660
|
__decorate([
|
1613
1661
|
core_1.Input(),
|
1614
1662
|
__metadata("design:type", String)
|
@@ -1754,6 +1802,11 @@ var Calendar = /** @class */ (function () {
|
|
1754
1802
|
__metadata("design:type", Array),
|
1755
1803
|
__metadata("design:paramtypes", [Array])
|
1756
1804
|
], Calendar.prototype, "disabledDays", null);
|
1805
|
+
__decorate([
|
1806
|
+
core_1.Input(),
|
1807
|
+
__metadata("design:type", String),
|
1808
|
+
__metadata("design:paramtypes", [String])
|
1809
|
+
], Calendar.prototype, "yearRange", null);
|
1757
1810
|
__decorate([
|
1758
1811
|
core_1.Input(),
|
1759
1812
|
__metadata("design:type", Boolean),
|
@@ -1767,7 +1820,7 @@ var Calendar = /** @class */ (function () {
|
|
1767
1820
|
Calendar = __decorate([
|
1768
1821
|
core_1.Component({
|
1769
1822
|
selector: 'p-calendar',
|
1770
|
-
template: "\n <span [ngClass]=\"{'ui-calendar':true, 'ui-calendar-w-btn': showIcon, 'ui-calendar-timeonly': timeOnly}\" [ngStyle]=\"style\" [class]=\"styleClass\">\n <ng-template [ngIf]=\"!inline\">\n <input #inputfield type=\"text\" [attr.id]=\"inputId\" [attr.name]=\"name\" [attr.required]=\"required\" [value]=\"inputFieldValue\" (focus)=\"onInputFocus($event)\" (keydown)=\"onInputKeydown($event)\" (click)=\"onInputClick($event)\" (blur)=\"onInputBlur($event)\"\n [readonly]=\"readonlyInput\" (input)=\"onUserInput($event)\" [ngStyle]=\"inputStyle\" [class]=\"inputStyleClass\" [placeholder]=\"placeholder||''\" [disabled]=\"disabled\" [attr.tabindex]=\"tabindex\"\n [ngClass]=\"'ui-inputtext ui-widget ui-state-default ui-corner-all'\" autocomplete=\"off\"\n ><button type=\"button\" [icon]=\"icon\" pButton *ngIf=\"showIcon\" (click)=\"onButtonClick($event,inputfield)\" class=\"ui-datepicker-trigger ui-calendar-button\"\n [ngClass]=\"{'ui-state-disabled':disabled}\" [disabled]=\"disabled\" tabindex=\"-1\"></button>\n </ng-template>\n <div [class]=\"panelStyleClass\" [ngStyle]=\"panelStyle\" [ngClass]=\"{'ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all': true, 'ui-datepicker-inline':inline,'ui-shadow':!inline,\n 'ui-state-disabled':disabled,'ui-datepicker-timeonly':timeOnly,'ui-datepicker-multiple-month': this.numberOfMonths > 1, 'ui-datepicker-monthpicker': (view === 'month'), 'ui-datepicker-touch-ui': touchUI}\"\n (click)=\"onDatePickerClick($event)\" [@overlayAnimation]=\"touchUI ? {value: 'visibleTouchUI', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}: \n {value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}\" \n [@.disabled]=\"inline === true\" (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\" *ngIf=\"inline || overlayVisible\">\n <ng-container *ngIf=\"!timeOnly\">\n <div class=\"ui-datepicker-group ui-widget-content\" *ngFor=\"let month of months; let i = index;\">\n <div class=\"ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all\">\n <ng-content select=\"p-header\"></ng-content>\n <a class=\"ui-datepicker-prev ui-corner-all\" tabindex=\"0\" (click)=\"navBackward($event)\" *ngIf=\"i === 0\">\n <span class=\"pi pi-chevron-left\"></span>\n </a>\n <a class=\"ui-datepicker-next ui-corner-all\" tabindex=\"0\" (click)=\"navForward($event)\" *ngIf=\"numberOfMonths === 1 ? true : (i === numberOfMonths -1)\">\n <span class=\"pi pi-chevron-right\"></span>\n </a>\n <div class=\"ui-datepicker-title\">\n <span class=\"ui-datepicker-month\" *ngIf=\"!monthNavigator && (view !== 'month')\">{{locale.monthNames[month.month]}}</span>\n <select class=\"ui-datepicker-month\" *ngIf=\"monthNavigator && (view !== 'month') && numberOfMonths === 1\" (change)=\"onMonthDropdownChange($event.target.value)\">\n <option [value]=\"i\" *ngFor=\"let monthName of locale.monthNames;let i = index\" [selected]=\"i === month.month\">{{monthName}}</option>\n </select>\n <select class=\"ui-datepicker-year\" *ngIf=\"yearNavigator && numberOfMonths === 1\" (change)=\"onYearDropdownChange($event.target.value)\">\n <option [value]=\"year\" *ngFor=\"let year of yearOptions\" [selected]=\"year === currentYear\">{{year}}</option>\n </select>\n <span class=\"ui-datepicker-year\" *ngIf=\"!yearNavigator\">{{view === 'month' ? currentYear : month.year}}</span>\n </div>\n </div>\n <div class=\"ui-datepicker-calendar-container\" *ngIf=\"view ==='date'\">\n <table class=\"ui-datepicker-calendar\">\n <thead>\n <tr>\n <th scope=\"col\" *ngFor=\"let weekDay of weekDays;let begin = first; let end = last\">\n <span>{{weekDay}}</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let week of month.dates\">\n <td *ngFor=\"let date of week\" [ngClass]=\"{'ui-datepicker-other-month': date.otherMonth,\n 'ui-datepicker-current-day':isSelected(date),'ui-datepicker-today':date.today}\">\n <ng-container *ngIf=\"date.otherMonth ? showOtherMonths : true\">\n <a class=\"ui-state-default\" *ngIf=\"date.selectable\" [ngClass]=\"{'ui-state-active':isSelected(date), 'ui-state-highlight':date.today}\"\n (click)=\"onDateSelect($event,date)\" draggable=\"false\">\n <ng-container *ngIf=\"!dateTemplate\">{{date.day}}</ng-container>\n <ng-container *ngTemplateOutlet=\"dateTemplate; context: {$implicit: date}\"></ng-container>\n </a>\n <span class=\"ui-state-default ui-state-disabled\" [ngClass]=\"{'ui-state-active':isSelected(date), 'ui-state-highlight':date.today}\" *ngIf=\"!date.selectable\">\n {{date.day}}\n </span>\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div class=\"ui-monthpicker\" *ngIf=\"view === 'month'\">\n <a tabindex=\"0\" *ngFor=\"let m of monthPickerValues; let i = index\" (click)=\"onMonthSelect($event, i)\" class=\"ui-monthpicker-month\" [ngClass]=\"{'ui-state-active': isMonthSelected(i)}\">\n {{m}}\n </a>\n </div>\n </ng-container>\n <div class=\"ui-timepicker ui-widget-header ui-corner-all\" *ngIf=\"showTime||timeOnly\">\n <div class=\"ui-hour-picker\">\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 0, 1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span [ngStyle]=\"{'display': currentHour < 10 ? 'inline': 'none'}\">0</span><span>{{currentHour}}</span>\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 0, -1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-separator\">\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span>{{timeSeparator}}</span>\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-minute-picker\">\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 1, 1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span [ngStyle]=\"{'display': currentMinute < 10 ? 'inline': 'none'}\">0</span><span>{{currentMinute}}</span>\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 1, -1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-separator\" *ngIf=\"showSeconds\">\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span>{{timeSeparator}}</span>\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-second-picker\" *ngIf=\"showSeconds\">\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 2, 1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span [ngStyle]=\"{'display': currentSecond < 10 ? 'inline': 'none'}\">0</span><span>{{currentSecond}}</span>\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 2, -1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-ampm-picker\" *ngIf=\"hourFormat=='12'\">\n <a tabindex=\"0\" (click)=\"toggleAMPM($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span>{{pm ? 'PM' : 'AM'}}</span>\n <a tabindex=\"0\" (click)=\"toggleAMPM($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n </div>\n <div class=\"ui-datepicker-buttonbar ui-widget-header\" *ngIf=\"showButtonBar\">\n <div class=\"ui-g\">\n <div class=\"ui-g-6\">\n <button type=\"button\" [label]=\"_locale.today\" (click)=\"onTodayButtonClick($event)\" pButton [ngClass]=\"[todayButtonStyleClass]\"></button>\n </div>\n <div class=\"ui-g-6\">\n <button type=\"button\" [label]=\"_locale.clear\" (click)=\"onClearButtonClick($event)\" pButton [ngClass]=\"[clearButtonStyleClass]\"></button>\n </div>\n </div>\n </div>\n <ng-content select=\"p-footer\"></ng-content>\n </div>\n </span>\n ",
|
1823
|
+
template: "\n <span [ngClass]=\"{'ui-calendar':true, 'ui-calendar-w-btn': showIcon, 'ui-calendar-timeonly': timeOnly}\" [ngStyle]=\"style\" [class]=\"styleClass\">\n <ng-template [ngIf]=\"!inline\">\n <input #inputfield type=\"text\" [attr.id]=\"inputId\" [attr.name]=\"name\" [attr.required]=\"required\" [value]=\"inputFieldValue\" (focus)=\"onInputFocus($event)\" (keydown)=\"onInputKeydown($event)\" (click)=\"onInputClick($event)\" (blur)=\"onInputBlur($event)\"\n [readonly]=\"readonlyInput\" (input)=\"onUserInput($event)\" [ngStyle]=\"inputStyle\" [class]=\"inputStyleClass\" [placeholder]=\"placeholder||''\" [disabled]=\"disabled\" [attr.tabindex]=\"tabindex\"\n [ngClass]=\"'ui-inputtext ui-widget ui-state-default ui-corner-all'\" autocomplete=\"off\"\n ><button type=\"button\" [icon]=\"icon\" pButton *ngIf=\"showIcon\" (click)=\"onButtonClick($event,inputfield)\" class=\"ui-datepicker-trigger ui-calendar-button\"\n [ngClass]=\"{'ui-state-disabled':disabled}\" [disabled]=\"disabled\" tabindex=\"-1\"></button>\n </ng-template>\n <div [class]=\"panelStyleClass\" [ngStyle]=\"panelStyle\" [ngClass]=\"{'ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all': true, 'ui-datepicker-inline':inline,'ui-shadow':!inline,\n 'ui-state-disabled':disabled,'ui-datepicker-timeonly':timeOnly,'ui-datepicker-multiple-month': this.numberOfMonths > 1, 'ui-datepicker-monthpicker': (view === 'month'), 'ui-datepicker-touch-ui': touchUI}\"\n [@overlayAnimation]=\"touchUI ? {value: 'visibleTouchUI', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}: \n {value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}\" \n [@.disabled]=\"inline === true\" (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\" (@overlayAnimation.done)=\"onOverlayAnimationDone($event)\" *ngIf=\"inline || overlayVisible\">\n <ng-container *ngIf=\"!timeOnly\">\n <div class=\"ui-datepicker-group ui-widget-content\" *ngFor=\"let month of months; let i = index;\">\n <div class=\"ui-datepicker-header ui-widget-header ui-helper-clearfix ui-corner-all\">\n <ng-content select=\"p-header\"></ng-content>\n <a class=\"ui-datepicker-prev ui-corner-all\" (click)=\"navBackward($event)\" *ngIf=\"i === 0\">\n <span class=\"ui-datepicker-prev-icon pi pi-chevron-left\"></span>\n </a>\n <a class=\"ui-datepicker-next ui-corner-all\" (click)=\"navForward($event)\" *ngIf=\"numberOfMonths === 1 ? true : (i === numberOfMonths -1)\">\n <span class=\"ui-datepicker-next-icon pi pi-chevron-right\"></span>\n </a>\n <div class=\"ui-datepicker-title\">\n <span class=\"ui-datepicker-month\" *ngIf=\"!monthNavigator && (view !== 'month')\">{{locale.monthNames[month.month]}}</span>\n <select class=\"ui-datepicker-month\" *ngIf=\"monthNavigator && (view !== 'month') && numberOfMonths === 1\" (change)=\"onMonthDropdownChange($event.target.value)\">\n <option [value]=\"i\" *ngFor=\"let monthName of locale.monthNames;let i = index\" [selected]=\"i === month.month\">{{monthName}}</option>\n </select>\n <select class=\"ui-datepicker-year\" *ngIf=\"yearNavigator && numberOfMonths === 1\" (change)=\"onYearDropdownChange($event.target.value)\">\n <option [value]=\"year\" *ngFor=\"let year of yearOptions\" [selected]=\"year === currentYear\">{{year}}</option>\n </select>\n <span class=\"ui-datepicker-year\" *ngIf=\"!yearNavigator\">{{view === 'month' ? currentYear : month.year}}</span>\n </div>\n </div>\n <div class=\"ui-datepicker-calendar-container\" *ngIf=\"view ==='date'\">\n <table class=\"ui-datepicker-calendar\">\n <thead>\n <tr>\n <th *ngIf=\"showWeek\" class=\"ui-datepicker-weekheader\">\n <span>{{locale['weekHeader']}}</span>\n </th>\n <th scope=\"col\" *ngFor=\"let weekDay of weekDays;let begin = first; let end = last\">\n <span>{{weekDay}}</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let week of month.dates; let i = index;\">\n <td *ngIf=\"showWeek\" class=\"ui-datepicker-weeknumber ui-state-disabled\">\n <span>\n {{month.weekNumbers[i]}}\n </span>\n </td>\n <td *ngFor=\"let date of week\" [ngClass]=\"{'ui-datepicker-other-month': date.otherMonth,\n 'ui-datepicker-current-day':isSelected(date),'ui-datepicker-today':date.today}\">\n <ng-container *ngIf=\"date.otherMonth ? showOtherMonths : true\">\n <a class=\"ui-state-default\" *ngIf=\"date.selectable\" [ngClass]=\"{'ui-state-active':isSelected(date), 'ui-state-highlight':date.today}\"\n (click)=\"onDateSelect($event,date)\" draggable=\"false\">\n <ng-container *ngIf=\"!dateTemplate\">{{date.day}}</ng-container>\n <ng-container *ngTemplateOutlet=\"dateTemplate; context: {$implicit: date}\"></ng-container>\n </a>\n <span class=\"ui-state-default ui-state-disabled\" [ngClass]=\"{'ui-state-active':isSelected(date), 'ui-state-highlight':date.today}\" *ngIf=\"!date.selectable\">\n {{date.day}}\n </span>\n </ng-container>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div class=\"ui-monthpicker\" *ngIf=\"view === 'month'\">\n <a tabindex=\"0\" *ngFor=\"let m of monthPickerValues; let i = index\" (click)=\"onMonthSelect($event, i)\" class=\"ui-monthpicker-month\" [ngClass]=\"{'ui-state-active': isMonthSelected(i)}\">\n {{m}}\n </a>\n </div>\n </ng-container>\n <div class=\"ui-timepicker ui-widget-header ui-corner-all\" *ngIf=\"showTime||timeOnly\">\n <div class=\"ui-hour-picker\">\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 0, 1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span [ngStyle]=\"{'display': currentHour < 10 ? 'inline': 'none'}\">0</span><span>{{currentHour}}</span>\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 0, -1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-separator\">\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span>{{timeSeparator}}</span>\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-minute-picker\">\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 1, 1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span [ngStyle]=\"{'display': currentMinute < 10 ? 'inline': 'none'}\">0</span><span>{{currentMinute}}</span>\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 1, -1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-separator\" *ngIf=\"showSeconds\">\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span>{{timeSeparator}}</span>\n <a tabindex=\"0\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-second-picker\" *ngIf=\"showSeconds\">\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 2, 1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span [ngStyle]=\"{'display': currentSecond < 10 ? 'inline': 'none'}\">0</span><span>{{currentSecond}}</span>\n <a tabindex=\"0\" (mousedown)=\"onTimePickerElementMouseDown($event, 2, -1)\" (mouseup)=\"onTimePickerElementMouseUp($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n <div class=\"ui-ampm-picker\" *ngIf=\"hourFormat=='12'\">\n <a tabindex=\"0\" (click)=\"toggleAMPM($event)\">\n <span class=\"pi pi-chevron-up\"></span>\n </a>\n <span>{{pm ? 'PM' : 'AM'}}</span>\n <a tabindex=\"0\" (click)=\"toggleAMPM($event)\">\n <span class=\"pi pi-chevron-down\"></span>\n </a>\n </div>\n </div>\n <div class=\"ui-datepicker-buttonbar ui-widget-header\" *ngIf=\"showButtonBar\">\n <div class=\"ui-g\">\n <div class=\"ui-g-6\">\n <button type=\"button\" [label]=\"_locale.today\" (click)=\"onTodayButtonClick($event)\" pButton [ngClass]=\"[todayButtonStyleClass]\"></button>\n </div>\n <div class=\"ui-g-6\">\n <button type=\"button\" [label]=\"_locale.clear\" (click)=\"onClearButtonClick($event)\" pButton [ngClass]=\"[clearButtonStyleClass]\"></button>\n </div>\n </div>\n </div>\n <ng-content select=\"p-footer\"></ng-content>\n </div>\n </span>\n ",
|
1771
1824
|
animations: [
|
1772
1825
|
animations_1.trigger('overlayAnimation', [
|
1773
1826
|
animations_1.state('visible', animations_1.style({
|