@tlmgo/tui-calendar 2.2.0 → 2.2.2
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/README.md +183 -183
- package/dist/toastui-calendar.css +1117 -1117
- package/dist/toastui-calendar.ie11.js +1074 -1074
- package/dist/toastui-calendar.ie11.min.js +1 -1
- package/dist/toastui-calendar.js +1074 -1074
- package/dist/toastui-calendar.min.css +1 -1
- package/dist/toastui-calendar.min.js +1 -1
- package/dist/toastui-calendar.mjs +1 -1
- package/package.json +108 -108
- package/types/factory/calendar.d.ts +14 -14
- package/types/factory/calendarCore.d.ts +504 -504
- package/types/factory/day.d.ts +7 -7
- package/types/factory/month.d.ts +11 -11
- package/types/factory/week.d.ts +7 -7
- package/types/index.d.ts +11 -11
- package/types/time/date.d.ts +206 -206
- package/types/types/eventBus.d.ts +40 -40
- package/types/types/events.d.ts +141 -141
- package/types/types/options.d.ts +82 -82
- package/types/types/template.d.ts +97 -97
- package/types/types/theme.d.ts +140 -140
package/dist/toastui-calendar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* TOAST UI Calendar 2nd Edition
|
|
3
|
-
* @version 2.
|
|
3
|
+
* @version 2.2.2 | Thu Jan 29 2026
|
|
4
4
|
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -6087,11 +6087,11 @@ function toPercent(value) {
|
|
|
6087
6087
|
function toPx(value) {
|
|
6088
6088
|
return "".concat(value, "px");
|
|
6089
6089
|
}
|
|
6090
|
-
/**
|
|
6091
|
-
* ex)
|
|
6092
|
-
* extractPercentPx('calc(100% - 22px)') // { percent: 100, px: -22 }
|
|
6093
|
-
* extractPercentPx('100%') // { percent: 100, px: 0 }
|
|
6094
|
-
* extractPercentPx('-22px') // { percent: 0, px: -22 }
|
|
6090
|
+
/**
|
|
6091
|
+
* ex)
|
|
6092
|
+
* extractPercentPx('calc(100% - 22px)') // { percent: 100, px: -22 }
|
|
6093
|
+
* extractPercentPx('100%') // { percent: 100, px: 0 }
|
|
6094
|
+
* extractPercentPx('-22px') // { percent: 0, px: -22 }
|
|
6095
6095
|
*/
|
|
6096
6096
|
|
|
6097
6097
|
function extractPercentPx(value) {
|
|
@@ -6407,11 +6407,11 @@ const MESSAGE_PREFIX = '@tlmgo/tui-calendar: ';
|
|
|
6407
6407
|
|
|
6408
6408
|
|
|
6409
6409
|
|
|
6410
|
-
/**
|
|
6411
|
-
* Define custom errors for calendar
|
|
6412
|
-
* These errors are exposed to the user.
|
|
6413
|
-
*
|
|
6414
|
-
* We can throw the default `Error` instance for internal errors.
|
|
6410
|
+
/**
|
|
6411
|
+
* Define custom errors for calendar
|
|
6412
|
+
* These errors are exposed to the user.
|
|
6413
|
+
*
|
|
6414
|
+
* We can throw the default `Error` instance for internal errors.
|
|
6415
6415
|
*/
|
|
6416
6416
|
|
|
6417
6417
|
class InvalidTimezoneNameError extends Error {
|
|
@@ -6506,10 +6506,10 @@ function date() {
|
|
|
6506
6506
|
function getLocalTimezoneOffset() {
|
|
6507
6507
|
return -new Date().getTimezoneOffset();
|
|
6508
6508
|
}
|
|
6509
|
-
/**
|
|
6510
|
-
* Calculate timezone offset from UTC.
|
|
6511
|
-
*
|
|
6512
|
-
* Target date is needed for the case when the timezone is applicable to DST.
|
|
6509
|
+
/**
|
|
6510
|
+
* Calculate timezone offset from UTC.
|
|
6511
|
+
*
|
|
6512
|
+
* Target date is needed for the case when the timezone is applicable to DST.
|
|
6513
6513
|
*/
|
|
6514
6514
|
|
|
6515
6515
|
function calculateTimezoneOffset(timezoneName) {
|
|
@@ -6547,9 +6547,9 @@ const timezoneNameValidationCache = {};
|
|
|
6547
6547
|
function isIntlDateTimeFormatSupported() {
|
|
6548
6548
|
var _Intl, _Intl$DateTimeFormat, _Intl$DateTimeFormat$;
|
|
6549
6549
|
|
|
6550
|
-
/**
|
|
6551
|
-
* Intl.DateTimeFormat & IANA Timezone Data should be supported.
|
|
6552
|
-
* also, hourCycle options should be supported.
|
|
6550
|
+
/**
|
|
6551
|
+
* Intl.DateTimeFormat & IANA Timezone Data should be supported.
|
|
6552
|
+
* also, hourCycle options should be supported.
|
|
6553
6553
|
*/
|
|
6554
6554
|
return isFunction((_Intl = Intl) === null || _Intl === void 0 ? void 0 : (_Intl$DateTimeFormat = _Intl.DateTimeFormat) === null || _Intl$DateTimeFormat === void 0 ? void 0 : (_Intl$DateTimeFormat$ = _Intl$DateTimeFormat.prototype) === null || _Intl$DateTimeFormat$ === void 0 ? void 0 : _Intl$DateTimeFormat$.formatToParts);
|
|
6555
6555
|
}
|
|
@@ -6633,13 +6633,13 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6633
6633
|
function getTZOffsetMSDifference(offset) {
|
|
6634
6634
|
return (getLocalTimezoneOffset() - offset) * MS_PER_MINUTES;
|
|
6635
6635
|
}
|
|
6636
|
-
/**
|
|
6637
|
-
* Custom Date Class to handle timezone offset.
|
|
6638
|
-
*
|
|
6639
|
-
* For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/tzdate.md|TZDate} in guide.
|
|
6640
|
-
*
|
|
6641
|
-
* @class TZDate
|
|
6642
|
-
* @param {number|TZDate|Date|string} date - date value to be converted. If date is number or string, it should be eligible to parse by Date constructor.
|
|
6636
|
+
/**
|
|
6637
|
+
* Custom Date Class to handle timezone offset.
|
|
6638
|
+
*
|
|
6639
|
+
* For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/tzdate.md|TZDate} in guide.
|
|
6640
|
+
*
|
|
6641
|
+
* @class TZDate
|
|
6642
|
+
* @param {number|TZDate|Date|string} date - date value to be converted. If date is number or string, it should be eligible to parse by Date constructor.
|
|
6643
6643
|
*/
|
|
6644
6644
|
|
|
6645
6645
|
|
|
@@ -6657,19 +6657,19 @@ class date_TZDate {
|
|
|
6657
6657
|
this.d = date(...args);
|
|
6658
6658
|
}
|
|
6659
6659
|
}
|
|
6660
|
-
/**
|
|
6661
|
-
* Get the string representation of the date.
|
|
6662
|
-
* @returns {string} string representation of the date.
|
|
6660
|
+
/**
|
|
6661
|
+
* Get the string representation of the date.
|
|
6662
|
+
* @returns {string} string representation of the date.
|
|
6663
6663
|
*/
|
|
6664
6664
|
|
|
6665
6665
|
|
|
6666
6666
|
toString() {
|
|
6667
6667
|
return this.d.toString();
|
|
6668
6668
|
}
|
|
6669
|
-
/**
|
|
6670
|
-
* Add years to the instance.
|
|
6671
|
-
* @param {number} y - number of years to be added.
|
|
6672
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6669
|
+
/**
|
|
6670
|
+
* Add years to the instance.
|
|
6671
|
+
* @param {number} y - number of years to be added.
|
|
6672
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6673
6673
|
*/
|
|
6674
6674
|
|
|
6675
6675
|
|
|
@@ -6677,10 +6677,10 @@ class date_TZDate {
|
|
|
6677
6677
|
this.setFullYear(this.getFullYear() + y);
|
|
6678
6678
|
return this;
|
|
6679
6679
|
}
|
|
6680
|
-
/**
|
|
6681
|
-
* Add months to the instance.
|
|
6682
|
-
* @param {number} m - number of months to be added.
|
|
6683
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6680
|
+
/**
|
|
6681
|
+
* Add months to the instance.
|
|
6682
|
+
* @param {number} m - number of months to be added.
|
|
6683
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6684
6684
|
*/
|
|
6685
6685
|
|
|
6686
6686
|
|
|
@@ -6688,10 +6688,10 @@ class date_TZDate {
|
|
|
6688
6688
|
this.setMonth(this.getMonth() + m);
|
|
6689
6689
|
return this;
|
|
6690
6690
|
}
|
|
6691
|
-
/**
|
|
6692
|
-
* Add dates to the instance.
|
|
6693
|
-
* @param {number} d - number of days to be added.
|
|
6694
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6691
|
+
/**
|
|
6692
|
+
* Add dates to the instance.
|
|
6693
|
+
* @param {number} d - number of days to be added.
|
|
6694
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6695
6695
|
*/
|
|
6696
6696
|
|
|
6697
6697
|
|
|
@@ -6699,10 +6699,10 @@ class date_TZDate {
|
|
|
6699
6699
|
this.setDate(this.getDate() + d);
|
|
6700
6700
|
return this;
|
|
6701
6701
|
}
|
|
6702
|
-
/**
|
|
6703
|
-
* Add hours to the instance.
|
|
6704
|
-
* @param {number} h - number of hours to be added.
|
|
6705
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6702
|
+
/**
|
|
6703
|
+
* Add hours to the instance.
|
|
6704
|
+
* @param {number} h - number of hours to be added.
|
|
6705
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6706
6706
|
*/
|
|
6707
6707
|
|
|
6708
6708
|
|
|
@@ -6710,10 +6710,10 @@ class date_TZDate {
|
|
|
6710
6710
|
this.setHours(this.getHours() + h);
|
|
6711
6711
|
return this;
|
|
6712
6712
|
}
|
|
6713
|
-
/**
|
|
6714
|
-
* Add minutes to the instance.
|
|
6715
|
-
* @param {number} M - number of minutes to be added.
|
|
6716
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6713
|
+
/**
|
|
6714
|
+
* Add minutes to the instance.
|
|
6715
|
+
* @param {number} M - number of minutes to be added.
|
|
6716
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6717
6717
|
*/
|
|
6718
6718
|
|
|
6719
6719
|
|
|
@@ -6721,10 +6721,10 @@ class date_TZDate {
|
|
|
6721
6721
|
this.setMinutes(this.getMinutes() + M);
|
|
6722
6722
|
return this;
|
|
6723
6723
|
}
|
|
6724
|
-
/**
|
|
6725
|
-
* Add seconds to the instance.
|
|
6726
|
-
* @param {number} s - number of seconds to be added.
|
|
6727
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6724
|
+
/**
|
|
6725
|
+
* Add seconds to the instance.
|
|
6726
|
+
* @param {number} s - number of seconds to be added.
|
|
6727
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6728
6728
|
*/
|
|
6729
6729
|
|
|
6730
6730
|
|
|
@@ -6732,10 +6732,10 @@ class date_TZDate {
|
|
|
6732
6732
|
this.setSeconds(this.getSeconds() + s);
|
|
6733
6733
|
return this;
|
|
6734
6734
|
}
|
|
6735
|
-
/**
|
|
6736
|
-
* Add milliseconds to the instance.
|
|
6737
|
-
* @param {number} ms - number of milliseconds to be added.
|
|
6738
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6735
|
+
/**
|
|
6736
|
+
* Add milliseconds to the instance.
|
|
6737
|
+
* @param {number} ms - number of milliseconds to be added.
|
|
6738
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6739
6739
|
*/
|
|
6740
6740
|
|
|
6741
6741
|
|
|
@@ -6745,16 +6745,16 @@ class date_TZDate {
|
|
|
6745
6745
|
}
|
|
6746
6746
|
/* eslint-disable max-params*/
|
|
6747
6747
|
|
|
6748
|
-
/**
|
|
6749
|
-
* Set the date and time all at once.
|
|
6750
|
-
* @param {number} y - year
|
|
6751
|
-
* @param {number} m - month
|
|
6752
|
-
* @param {number} d - date
|
|
6753
|
-
* @param {number} h - hours
|
|
6754
|
-
* @param {number} M - minutes
|
|
6755
|
-
* @param {number} s - seconds
|
|
6756
|
-
* @param {number} ms - milliseconds
|
|
6757
|
-
* @returns {TZDate} - returns the instance itself.
|
|
6748
|
+
/**
|
|
6749
|
+
* Set the date and time all at once.
|
|
6750
|
+
* @param {number} y - year
|
|
6751
|
+
* @param {number} m - month
|
|
6752
|
+
* @param {number} d - date
|
|
6753
|
+
* @param {number} h - hours
|
|
6754
|
+
* @param {number} M - minutes
|
|
6755
|
+
* @param {number} s - seconds
|
|
6756
|
+
* @param {number} ms - milliseconds
|
|
6757
|
+
* @returns {TZDate} - returns the instance itself.
|
|
6758
6758
|
*/
|
|
6759
6759
|
|
|
6760
6760
|
|
|
@@ -6763,27 +6763,27 @@ class date_TZDate {
|
|
|
6763
6763
|
this.setHours(h, M, s, ms);
|
|
6764
6764
|
return this;
|
|
6765
6765
|
}
|
|
6766
|
-
/**
|
|
6767
|
-
* Convert the instance to the native `Date` object.
|
|
6768
|
-
* @returns {Date} - The native `Date` object.
|
|
6766
|
+
/**
|
|
6767
|
+
* Convert the instance to the native `Date` object.
|
|
6768
|
+
* @returns {Date} - The native `Date` object.
|
|
6769
6769
|
*/
|
|
6770
6770
|
|
|
6771
6771
|
|
|
6772
6772
|
toDate() {
|
|
6773
6773
|
return this.d.toDate();
|
|
6774
6774
|
}
|
|
6775
|
-
/**
|
|
6776
|
-
* Get the value of the date. (milliseconds since 1970-01-01 00:00:00 (UTC+0))
|
|
6777
|
-
* @returns {number} - value of the date.
|
|
6775
|
+
/**
|
|
6776
|
+
* Get the value of the date. (milliseconds since 1970-01-01 00:00:00 (UTC+0))
|
|
6777
|
+
* @returns {number} - value of the date.
|
|
6778
6778
|
*/
|
|
6779
6779
|
|
|
6780
6780
|
|
|
6781
6781
|
valueOf() {
|
|
6782
6782
|
return this.getTime();
|
|
6783
6783
|
}
|
|
6784
|
-
/**
|
|
6785
|
-
* Get the timezone offset from UTC in minutes.
|
|
6786
|
-
* @returns {number} - timezone offset in minutes.
|
|
6784
|
+
/**
|
|
6785
|
+
* Get the timezone offset from UTC in minutes.
|
|
6786
|
+
* @returns {number} - timezone offset in minutes.
|
|
6787
6787
|
*/
|
|
6788
6788
|
|
|
6789
6789
|
|
|
@@ -6793,103 +6793,103 @@ class date_TZDate {
|
|
|
6793
6793
|
return (_this$tzOffset = this.tzOffset) !== null && _this$tzOffset !== void 0 ? _this$tzOffset : this.d.getTimezoneOffset();
|
|
6794
6794
|
} // Native properties
|
|
6795
6795
|
|
|
6796
|
-
/**
|
|
6797
|
-
* Get milliseconds which is converted by timezone
|
|
6798
|
-
* @returns {number} milliseconds
|
|
6796
|
+
/**
|
|
6797
|
+
* Get milliseconds which is converted by timezone
|
|
6798
|
+
* @returns {number} milliseconds
|
|
6799
6799
|
*/
|
|
6800
6800
|
|
|
6801
6801
|
|
|
6802
6802
|
getTime() {
|
|
6803
6803
|
return this.d.getTime();
|
|
6804
6804
|
}
|
|
6805
|
-
/**
|
|
6806
|
-
* Get the year of the instance.
|
|
6807
|
-
* @returns {number} - full year
|
|
6805
|
+
/**
|
|
6806
|
+
* Get the year of the instance.
|
|
6807
|
+
* @returns {number} - full year
|
|
6808
6808
|
*/
|
|
6809
6809
|
|
|
6810
6810
|
|
|
6811
6811
|
getFullYear() {
|
|
6812
6812
|
return this.d.getFullYear();
|
|
6813
6813
|
}
|
|
6814
|
-
/**
|
|
6815
|
-
* Get the month of the instance. (zero-based)
|
|
6816
|
-
* @returns {number} - month
|
|
6814
|
+
/**
|
|
6815
|
+
* Get the month of the instance. (zero-based)
|
|
6816
|
+
* @returns {number} - month
|
|
6817
6817
|
*/
|
|
6818
6818
|
|
|
6819
6819
|
|
|
6820
6820
|
getMonth() {
|
|
6821
6821
|
return this.d.getMonth();
|
|
6822
6822
|
}
|
|
6823
|
-
/**
|
|
6824
|
-
* Get the date of the instance.
|
|
6825
|
-
* @returns {number} - date
|
|
6823
|
+
/**
|
|
6824
|
+
* Get the date of the instance.
|
|
6825
|
+
* @returns {number} - date
|
|
6826
6826
|
*/
|
|
6827
6827
|
|
|
6828
6828
|
|
|
6829
6829
|
getDate() {
|
|
6830
6830
|
return this.d.getDate();
|
|
6831
6831
|
}
|
|
6832
|
-
/**
|
|
6833
|
-
* Get the hours of the instance.
|
|
6834
|
-
* @returns {number} - hours
|
|
6832
|
+
/**
|
|
6833
|
+
* Get the hours of the instance.
|
|
6834
|
+
* @returns {number} - hours
|
|
6835
6835
|
*/
|
|
6836
6836
|
|
|
6837
6837
|
|
|
6838
6838
|
getHours() {
|
|
6839
6839
|
return this.d.getHours();
|
|
6840
6840
|
}
|
|
6841
|
-
/**
|
|
6842
|
-
* Get the minutes of the instance.
|
|
6843
|
-
* @returns {number} - minutes
|
|
6841
|
+
/**
|
|
6842
|
+
* Get the minutes of the instance.
|
|
6843
|
+
* @returns {number} - minutes
|
|
6844
6844
|
*/
|
|
6845
6845
|
|
|
6846
6846
|
|
|
6847
6847
|
getMinutes() {
|
|
6848
6848
|
return this.d.getMinutes();
|
|
6849
6849
|
}
|
|
6850
|
-
/**
|
|
6851
|
-
* Get the seconds of the instance.
|
|
6852
|
-
* @returns {number} - seconds
|
|
6850
|
+
/**
|
|
6851
|
+
* Get the seconds of the instance.
|
|
6852
|
+
* @returns {number} - seconds
|
|
6853
6853
|
*/
|
|
6854
6854
|
|
|
6855
6855
|
|
|
6856
6856
|
getSeconds() {
|
|
6857
6857
|
return this.d.getSeconds();
|
|
6858
6858
|
}
|
|
6859
|
-
/**
|
|
6860
|
-
* Get the milliseconds of the instance.
|
|
6861
|
-
* @returns {number} - milliseconds
|
|
6859
|
+
/**
|
|
6860
|
+
* Get the milliseconds of the instance.
|
|
6861
|
+
* @returns {number} - milliseconds
|
|
6862
6862
|
*/
|
|
6863
6863
|
|
|
6864
6864
|
|
|
6865
6865
|
getMilliseconds() {
|
|
6866
6866
|
return this.d.getMilliseconds();
|
|
6867
6867
|
}
|
|
6868
|
-
/**
|
|
6869
|
-
* Get the day of the week of the instance.
|
|
6870
|
-
* @returns {number} - day of the week
|
|
6868
|
+
/**
|
|
6869
|
+
* Get the day of the week of the instance.
|
|
6870
|
+
* @returns {number} - day of the week
|
|
6871
6871
|
*/
|
|
6872
6872
|
|
|
6873
6873
|
|
|
6874
6874
|
getDay() {
|
|
6875
6875
|
return this.d.getDay();
|
|
6876
6876
|
}
|
|
6877
|
-
/**
|
|
6878
|
-
* Sets the instance to the time represented by a number of milliseconds since 1970-01-01 00:00:00 (UTC+0).
|
|
6879
|
-
* @param {number} t - number of milliseconds
|
|
6880
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6877
|
+
/**
|
|
6878
|
+
* Sets the instance to the time represented by a number of milliseconds since 1970-01-01 00:00:00 (UTC+0).
|
|
6879
|
+
* @param {number} t - number of milliseconds
|
|
6880
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6881
6881
|
*/
|
|
6882
6882
|
|
|
6883
6883
|
|
|
6884
6884
|
setTime(t) {
|
|
6885
6885
|
return this.d.setTime(t);
|
|
6886
6886
|
}
|
|
6887
|
-
/**
|
|
6888
|
-
* Sets the year-month-date of the instance. Equivalent to calling `setFullYear` of `Date` object.
|
|
6889
|
-
* @param {number} y - year
|
|
6890
|
-
* @param {number} m - month (zero-based)
|
|
6891
|
-
* @param {number} d - date
|
|
6892
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6887
|
+
/**
|
|
6888
|
+
* Sets the year-month-date of the instance. Equivalent to calling `setFullYear` of `Date` object.
|
|
6889
|
+
* @param {number} y - year
|
|
6890
|
+
* @param {number} m - month (zero-based)
|
|
6891
|
+
* @param {number} d - date
|
|
6892
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6893
6893
|
*/
|
|
6894
6894
|
|
|
6895
6895
|
|
|
@@ -6898,11 +6898,11 @@ class date_TZDate {
|
|
|
6898
6898
|
let d = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getDate();
|
|
6899
6899
|
return this.d.setFullYear(y, m, d);
|
|
6900
6900
|
}
|
|
6901
|
-
/**
|
|
6902
|
-
* Sets the month of the instance. Equivalent to calling `setMonth` of `Date` object.
|
|
6903
|
-
* @param {number} m - month (zero-based)
|
|
6904
|
-
* @param {number} d - date
|
|
6905
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6901
|
+
/**
|
|
6902
|
+
* Sets the month of the instance. Equivalent to calling `setMonth` of `Date` object.
|
|
6903
|
+
* @param {number} m - month (zero-based)
|
|
6904
|
+
* @param {number} d - date
|
|
6905
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6906
6906
|
*/
|
|
6907
6907
|
|
|
6908
6908
|
|
|
@@ -6910,23 +6910,23 @@ class date_TZDate {
|
|
|
6910
6910
|
let d = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getDate();
|
|
6911
6911
|
return this.d.setMonth(m, d);
|
|
6912
6912
|
}
|
|
6913
|
-
/**
|
|
6914
|
-
* Sets the date of the instance. Equivalent to calling `setDate` of `Date` object.
|
|
6915
|
-
* @param {number} d - date
|
|
6916
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6913
|
+
/**
|
|
6914
|
+
* Sets the date of the instance. Equivalent to calling `setDate` of `Date` object.
|
|
6915
|
+
* @param {number} d - date
|
|
6916
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6917
6917
|
*/
|
|
6918
6918
|
|
|
6919
6919
|
|
|
6920
6920
|
setDate(d) {
|
|
6921
6921
|
return this.d.setDate(d);
|
|
6922
6922
|
}
|
|
6923
|
-
/**
|
|
6924
|
-
* Sets the hours of the instance. Equivalent to calling `setHours` of `Date` object.
|
|
6925
|
-
* @param {number} h - hours
|
|
6926
|
-
* @param {number} M - minutes
|
|
6927
|
-
* @param {number} s - seconds
|
|
6928
|
-
* @param {number} ms - milliseconds
|
|
6929
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6923
|
+
/**
|
|
6924
|
+
* Sets the hours of the instance. Equivalent to calling `setHours` of `Date` object.
|
|
6925
|
+
* @param {number} h - hours
|
|
6926
|
+
* @param {number} M - minutes
|
|
6927
|
+
* @param {number} s - seconds
|
|
6928
|
+
* @param {number} ms - milliseconds
|
|
6929
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6930
6930
|
*/
|
|
6931
6931
|
|
|
6932
6932
|
|
|
@@ -6936,12 +6936,12 @@ class date_TZDate {
|
|
|
6936
6936
|
let ms = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.getMilliseconds();
|
|
6937
6937
|
return this.d.setHours(h, M, s, ms);
|
|
6938
6938
|
}
|
|
6939
|
-
/**
|
|
6940
|
-
* Sets the minutes of the instance. Equivalent to calling `setMinutes` of `Date` object.
|
|
6941
|
-
* @param {number} M - minutes
|
|
6942
|
-
* @param {number} s - seconds
|
|
6943
|
-
* @param {number} ms - milliseconds
|
|
6944
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6939
|
+
/**
|
|
6940
|
+
* Sets the minutes of the instance. Equivalent to calling `setMinutes` of `Date` object.
|
|
6941
|
+
* @param {number} M - minutes
|
|
6942
|
+
* @param {number} s - seconds
|
|
6943
|
+
* @param {number} ms - milliseconds
|
|
6944
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6945
6945
|
*/
|
|
6946
6946
|
|
|
6947
6947
|
|
|
@@ -6950,11 +6950,11 @@ class date_TZDate {
|
|
|
6950
6950
|
let ms = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.getMilliseconds();
|
|
6951
6951
|
return this.d.setMinutes(M, s, ms);
|
|
6952
6952
|
}
|
|
6953
|
-
/**
|
|
6954
|
-
* Sets the seconds of the instance. Equivalent to calling `setSeconds` of `Date` object.
|
|
6955
|
-
* @param {number} s - seconds
|
|
6956
|
-
* @param {number} ms - milliseconds
|
|
6957
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6953
|
+
/**
|
|
6954
|
+
* Sets the seconds of the instance. Equivalent to calling `setSeconds` of `Date` object.
|
|
6955
|
+
* @param {number} s - seconds
|
|
6956
|
+
* @param {number} ms - milliseconds
|
|
6957
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6958
6958
|
*/
|
|
6959
6959
|
|
|
6960
6960
|
|
|
@@ -6962,20 +6962,20 @@ class date_TZDate {
|
|
|
6962
6962
|
let ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getMilliseconds();
|
|
6963
6963
|
return this.d.setSeconds(s, ms);
|
|
6964
6964
|
}
|
|
6965
|
-
/**
|
|
6966
|
-
* Sets the milliseconds of the instance. Equivalent to calling `setMilliseconds` of `Date` object.
|
|
6967
|
-
* @param {number} ms - milliseconds
|
|
6968
|
-
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6965
|
+
/**
|
|
6966
|
+
* Sets the milliseconds of the instance. Equivalent to calling `setMilliseconds` of `Date` object.
|
|
6967
|
+
* @param {number} ms - milliseconds
|
|
6968
|
+
* @returns {number} - Passed milliseconds of the instance since 1970-01-01 00:00:00 (UTC+0).
|
|
6969
6969
|
*/
|
|
6970
6970
|
|
|
6971
6971
|
|
|
6972
6972
|
setMilliseconds(ms) {
|
|
6973
6973
|
return this.d.setMilliseconds(ms);
|
|
6974
6974
|
}
|
|
6975
|
-
/**
|
|
6976
|
-
* Set the timezone offset of the instance.
|
|
6977
|
-
* @param {string|number} tzValue - The name of timezone(IANA name) or timezone offset(in minutes).
|
|
6978
|
-
* @returns {TZDate} - New instance with the timezone offset.
|
|
6975
|
+
/**
|
|
6976
|
+
* Set the timezone offset of the instance.
|
|
6977
|
+
* @param {string|number} tzValue - The name of timezone(IANA name) or timezone offset(in minutes).
|
|
6978
|
+
* @returns {TZDate} - New instance with the timezone offset.
|
|
6979
6979
|
*/
|
|
6980
6980
|
|
|
6981
6981
|
|
|
@@ -6989,15 +6989,15 @@ class date_TZDate {
|
|
|
6989
6989
|
newTZDate.tzOffset = tzOffset;
|
|
6990
6990
|
return newTZDate;
|
|
6991
6991
|
}
|
|
6992
|
-
/**
|
|
6993
|
-
* Get the new instance following the system's timezone.
|
|
6994
|
-
* If the system timezone is different from the timezone of the instance,
|
|
6995
|
-
* the instance is converted to the system timezone.
|
|
6996
|
-
*
|
|
6997
|
-
* Instance's `tzOffset` property will be ignored if there is a `tzValue` parameter.
|
|
6998
|
-
*
|
|
6999
|
-
* @param {string|number} tzValue - The name of timezone(IANA name) or timezone offset(in minutes).
|
|
7000
|
-
* @returns {TZDate} - New instance with the system timezone.
|
|
6992
|
+
/**
|
|
6993
|
+
* Get the new instance following the system's timezone.
|
|
6994
|
+
* If the system timezone is different from the timezone of the instance,
|
|
6995
|
+
* the instance is converted to the system timezone.
|
|
6996
|
+
*
|
|
6997
|
+
* Instance's `tzOffset` property will be ignored if there is a `tzValue` parameter.
|
|
6998
|
+
*
|
|
6999
|
+
* @param {string|number} tzValue - The name of timezone(IANA name) or timezone offset(in minutes).
|
|
7000
|
+
* @returns {TZDate} - New instance with the system timezone.
|
|
7001
7001
|
*/
|
|
7002
7002
|
|
|
7003
7003
|
|
|
@@ -7027,27 +7027,27 @@ function pick(obj) {
|
|
|
7027
7027
|
return acc;
|
|
7028
7028
|
}, {});
|
|
7029
7029
|
}
|
|
7030
|
-
/**
|
|
7031
|
-
* Clone an instance of a ES6 class.
|
|
7032
|
-
*
|
|
7033
|
-
* The cloned instance will have the (most of) same properties as the original.
|
|
7034
|
-
*
|
|
7035
|
-
* Reference: https://stackoverflow.com/a/44782052
|
|
7030
|
+
/**
|
|
7031
|
+
* Clone an instance of a ES6 class.
|
|
7032
|
+
*
|
|
7033
|
+
* The cloned instance will have the (most of) same properties as the original.
|
|
7034
|
+
*
|
|
7035
|
+
* Reference: https://stackoverflow.com/a/44782052
|
|
7036
7036
|
*/
|
|
7037
7037
|
|
|
7038
7038
|
function object_clone(source) {
|
|
7039
7039
|
return Object.assign(Object.create(Object.getPrototypeOf(source)), source);
|
|
7040
7040
|
}
|
|
7041
|
-
/**
|
|
7042
|
-
* Merge two objects together. And It has some pitfalls.
|
|
7043
|
-
*
|
|
7044
|
-
* For performance reason this function only mutates the target object.
|
|
7045
|
-
*
|
|
7046
|
-
* Also, it only merges values of nested objects. Array or TZDate instance will be totally replaced.
|
|
7047
|
-
*
|
|
7048
|
-
* Other non-basic objects are not supported.
|
|
7049
|
-
*
|
|
7050
|
-
* Since it mutates the target object, avoid using it outside immer `produce` function.
|
|
7041
|
+
/**
|
|
7042
|
+
* Merge two objects together. And It has some pitfalls.
|
|
7043
|
+
*
|
|
7044
|
+
* For performance reason this function only mutates the target object.
|
|
7045
|
+
*
|
|
7046
|
+
* Also, it only merges values of nested objects. Array or TZDate instance will be totally replaced.
|
|
7047
|
+
*
|
|
7048
|
+
* Other non-basic objects are not supported.
|
|
7049
|
+
*
|
|
7050
|
+
* Since it mutates the target object, avoid using it outside immer `produce` function.
|
|
7051
7051
|
*/
|
|
7052
7052
|
|
|
7053
7053
|
function mergeObject(target) {
|
|
@@ -7078,81 +7078,81 @@ function eventUIModel_defineProperty(obj, key, value) { if (key in obj) { Object
|
|
|
7078
7078
|
|
|
7079
7079
|
|
|
7080
7080
|
const eventUIPropsKey = ['top', 'left', 'width', 'height', 'exceedLeft', 'exceedRight', 'croppedStart', 'croppedEnd', 'goingDurationHeight', 'modelDurationHeight', 'comingDurationHeight', 'duplicateEvents', 'duplicateEventIndex', 'duplicateStarts', 'duplicateEnds', 'duplicateLeft', 'duplicateWidth', 'collapse', 'isMain'];
|
|
7081
|
-
/**
|
|
7082
|
-
* Set of UI-related properties for calendar event.
|
|
7083
|
-
* @class
|
|
7084
|
-
* @param {EventModel} event EventModel instance.
|
|
7081
|
+
/**
|
|
7082
|
+
* Set of UI-related properties for calendar event.
|
|
7083
|
+
* @class
|
|
7084
|
+
* @param {EventModel} event EventModel instance.
|
|
7085
7085
|
*/
|
|
7086
7086
|
|
|
7087
7087
|
class EventUIModel {
|
|
7088
7088
|
// If it is one of duplicate events, represents the left value of a group of duplicate events.
|
|
7089
7089
|
// If it is one of duplicate events, represents the width value of a group of duplicate events.
|
|
7090
7090
|
|
|
7091
|
-
/**
|
|
7092
|
-
* whether the actual start-date is before the render-start-date
|
|
7093
|
-
* @type {boolean}
|
|
7091
|
+
/**
|
|
7092
|
+
* whether the actual start-date is before the render-start-date
|
|
7093
|
+
* @type {boolean}
|
|
7094
7094
|
*/
|
|
7095
7095
|
|
|
7096
|
-
/**
|
|
7097
|
-
* whether the actual end-date is after the render-end-date
|
|
7098
|
-
* @type {boolean}
|
|
7096
|
+
/**
|
|
7097
|
+
* whether the actual end-date is after the render-end-date
|
|
7098
|
+
* @type {boolean}
|
|
7099
7099
|
*/
|
|
7100
7100
|
|
|
7101
|
-
/**
|
|
7102
|
-
* whether the actual start-date is before the render-start-date for column
|
|
7103
|
-
* @type {boolean}
|
|
7101
|
+
/**
|
|
7102
|
+
* whether the actual start-date is before the render-start-date for column
|
|
7103
|
+
* @type {boolean}
|
|
7104
7104
|
*/
|
|
7105
7105
|
|
|
7106
|
-
/**
|
|
7107
|
-
* whether the actual end-date is after the render-end-date for column
|
|
7108
|
-
* @type {boolean}
|
|
7106
|
+
/**
|
|
7107
|
+
* whether the actual end-date is after the render-end-date for column
|
|
7108
|
+
* @type {boolean}
|
|
7109
7109
|
*/
|
|
7110
7110
|
|
|
7111
|
-
/**
|
|
7112
|
-
* @type {number} percent
|
|
7111
|
+
/**
|
|
7112
|
+
* @type {number} percent
|
|
7113
7113
|
*/
|
|
7114
7114
|
|
|
7115
|
-
/**
|
|
7116
|
-
* @type {number} percent
|
|
7115
|
+
/**
|
|
7116
|
+
* @type {number} percent
|
|
7117
7117
|
*/
|
|
7118
7118
|
|
|
7119
|
-
/**
|
|
7120
|
-
* @type {number} percent
|
|
7119
|
+
/**
|
|
7120
|
+
* @type {number} percent
|
|
7121
7121
|
*/
|
|
7122
7122
|
|
|
7123
|
-
/**
|
|
7124
|
-
* the sorted list of duplicate events.
|
|
7125
|
-
* @type {EventUIModel[]}
|
|
7123
|
+
/**
|
|
7124
|
+
* the sorted list of duplicate events.
|
|
7125
|
+
* @type {EventUIModel[]}
|
|
7126
7126
|
*/
|
|
7127
7127
|
|
|
7128
|
-
/**
|
|
7129
|
-
* the index of this event among the duplicate events.
|
|
7130
|
-
* @type {number}
|
|
7128
|
+
/**
|
|
7129
|
+
* the index of this event among the duplicate events.
|
|
7130
|
+
* @type {number}
|
|
7131
7131
|
*/
|
|
7132
7132
|
|
|
7133
|
-
/**
|
|
7134
|
-
* represent the left value of a duplicate event.
|
|
7135
|
-
* ex) calc(50% - 24px), calc(50%), ...
|
|
7136
|
-
*
|
|
7137
|
-
* @type {string}
|
|
7133
|
+
/**
|
|
7134
|
+
* represent the left value of a duplicate event.
|
|
7135
|
+
* ex) calc(50% - 24px), calc(50%), ...
|
|
7136
|
+
*
|
|
7137
|
+
* @type {string}
|
|
7138
7138
|
*/
|
|
7139
7139
|
|
|
7140
|
-
/**
|
|
7141
|
-
* represent the width value of a duplicate event.
|
|
7142
|
-
* ex) calc(50% - 24px), 9px, ...
|
|
7143
|
-
*
|
|
7144
|
-
* @type {string}
|
|
7140
|
+
/**
|
|
7141
|
+
* represent the width value of a duplicate event.
|
|
7142
|
+
* ex) calc(50% - 24px), 9px, ...
|
|
7143
|
+
*
|
|
7144
|
+
* @type {string}
|
|
7145
7145
|
*/
|
|
7146
7146
|
|
|
7147
|
-
/**
|
|
7148
|
-
* whether the event is collapsed or not among the duplicate events.
|
|
7149
|
-
* @type {boolean}
|
|
7147
|
+
/**
|
|
7148
|
+
* whether the event is collapsed or not among the duplicate events.
|
|
7149
|
+
* @type {boolean}
|
|
7150
7150
|
*/
|
|
7151
7151
|
|
|
7152
|
-
/**
|
|
7153
|
-
* whether the event is main or not.
|
|
7154
|
-
* The main event is expanded on the initial rendering.
|
|
7155
|
-
* @type {boolean}
|
|
7152
|
+
/**
|
|
7153
|
+
* whether the event is main or not.
|
|
7154
|
+
* The main event is expanded on the initial rendering.
|
|
7155
|
+
* @type {boolean}
|
|
7156
7156
|
*/
|
|
7157
7157
|
constructor(event) {
|
|
7158
7158
|
eventUIModel_defineProperty(this, "top", 0);
|
|
@@ -7199,10 +7199,10 @@ class EventUIModel {
|
|
|
7199
7199
|
setUIProps(props) {
|
|
7200
7200
|
Object.assign(this, props);
|
|
7201
7201
|
}
|
|
7202
|
-
/**
|
|
7203
|
-
* return renderStarts property to render properly when specific event that exceed rendering date range.
|
|
7204
|
-
*
|
|
7205
|
-
* if renderStarts is not set. return model's start property.
|
|
7202
|
+
/**
|
|
7203
|
+
* return renderStarts property to render properly when specific event that exceed rendering date range.
|
|
7204
|
+
*
|
|
7205
|
+
* if renderStarts is not set. return model's start property.
|
|
7206
7206
|
*/
|
|
7207
7207
|
|
|
7208
7208
|
|
|
@@ -7213,10 +7213,10 @@ class EventUIModel {
|
|
|
7213
7213
|
|
|
7214
7214
|
return this.model.getStarts();
|
|
7215
7215
|
}
|
|
7216
|
-
/**
|
|
7217
|
-
* return renderStarts property to render properly when specific event that exceed rendering date range.
|
|
7218
|
-
*
|
|
7219
|
-
* if renderEnds is not set. return model's end property.
|
|
7216
|
+
/**
|
|
7217
|
+
* return renderStarts property to render properly when specific event that exceed rendering date range.
|
|
7218
|
+
*
|
|
7219
|
+
* if renderEnds is not set. return model's end property.
|
|
7220
7220
|
*/
|
|
7221
7221
|
|
|
7222
7222
|
|
|
@@ -7227,25 +7227,25 @@ class EventUIModel {
|
|
|
7227
7227
|
|
|
7228
7228
|
return this.model.getEnds();
|
|
7229
7229
|
}
|
|
7230
|
-
/**
|
|
7231
|
-
* @returns {number} unique number for model.
|
|
7230
|
+
/**
|
|
7231
|
+
* @returns {number} unique number for model.
|
|
7232
7232
|
*/
|
|
7233
7233
|
|
|
7234
7234
|
|
|
7235
7235
|
cid() {
|
|
7236
7236
|
return this.model.cid();
|
|
7237
7237
|
}
|
|
7238
|
-
/**
|
|
7239
|
-
* Shadowing valueOf method for event sorting.
|
|
7238
|
+
/**
|
|
7239
|
+
* Shadowing valueOf method for event sorting.
|
|
7240
7240
|
*/
|
|
7241
7241
|
|
|
7242
7242
|
|
|
7243
7243
|
valueOf() {
|
|
7244
7244
|
return this.model;
|
|
7245
7245
|
}
|
|
7246
|
-
/**
|
|
7247
|
-
* Link duration method
|
|
7248
|
-
* @returns {number} EventModel#duration result.
|
|
7246
|
+
/**
|
|
7247
|
+
* Link duration method
|
|
7248
|
+
* @returns {number} EventModel#duration result.
|
|
7249
7249
|
*/
|
|
7250
7250
|
|
|
7251
7251
|
|
|
@@ -7457,8 +7457,8 @@ const memo = {
|
|
|
7457
7457
|
millisecondsFrom: {}
|
|
7458
7458
|
};
|
|
7459
7459
|
const convByTimeUnit = [24, 60, 60, 1000];
|
|
7460
|
-
/**
|
|
7461
|
-
* pad left zero characters
|
|
7460
|
+
/**
|
|
7461
|
+
* pad left zero characters
|
|
7462
7462
|
*/
|
|
7463
7463
|
|
|
7464
7464
|
function leadingZero(number, length) {
|
|
@@ -7532,22 +7532,22 @@ const tokenFunc = {
|
|
|
7532
7532
|
const MS_PER_DAY = 86400000;
|
|
7533
7533
|
const MS_PER_HOUR = 3600000;
|
|
7534
7534
|
const MS_PER_MINUTES = 60000;
|
|
7535
|
-
/**
|
|
7536
|
-
* The number of milliseconds 20 minutes for event min duration
|
|
7535
|
+
/**
|
|
7536
|
+
* The number of milliseconds 20 minutes for event min duration
|
|
7537
7537
|
*/
|
|
7538
7538
|
|
|
7539
7539
|
const MS_EVENT_MIN_DURATION = 20 * MS_PER_MINUTES;
|
|
7540
7540
|
const MS_PER_THIRTY_MINUTES = 30 * 60 * 1000;
|
|
7541
7541
|
const SIXTY_SECONDS = 60;
|
|
7542
|
-
/**
|
|
7543
|
-
* Return formatted string as basis of supplied string.
|
|
7544
|
-
*
|
|
7545
|
-
* Supported Token Lists.
|
|
7546
|
-
*
|
|
7547
|
-
* - YYYY => 1988
|
|
7548
|
-
* - MM => 01 ~ 12
|
|
7549
|
-
* - DD => 01 ~ 31
|
|
7550
|
-
* - YYYYMMDD => 19880925
|
|
7542
|
+
/**
|
|
7543
|
+
* Return formatted string as basis of supplied string.
|
|
7544
|
+
*
|
|
7545
|
+
* Supported Token Lists.
|
|
7546
|
+
*
|
|
7547
|
+
* - YYYY => 1988
|
|
7548
|
+
* - MM => 01 ~ 12
|
|
7549
|
+
* - DD => 01 ~ 31
|
|
7550
|
+
* - YYYYMMDD => 19880925
|
|
7551
7551
|
*/
|
|
7552
7552
|
|
|
7553
7553
|
function datetime_toFormat(date, strFormat) {
|
|
@@ -7558,8 +7558,8 @@ function datetime_toFormat(date, strFormat) {
|
|
|
7558
7558
|
});
|
|
7559
7559
|
return result;
|
|
7560
7560
|
}
|
|
7561
|
-
/**
|
|
7562
|
-
* convert to milliseconds
|
|
7561
|
+
/**
|
|
7562
|
+
* convert to milliseconds
|
|
7563
7563
|
*/
|
|
7564
7564
|
|
|
7565
7565
|
function convMilliseconds(type, value, iteratee) {
|
|
@@ -7576,8 +7576,8 @@ function convMilliseconds(type, value, iteratee) {
|
|
|
7576
7576
|
|
|
7577
7577
|
return [value].concat(convByTimeUnit.slice(index[type])).reduce(iteratee);
|
|
7578
7578
|
}
|
|
7579
|
-
/**
|
|
7580
|
-
* Convert value to milliseconds
|
|
7579
|
+
/**
|
|
7580
|
+
* Convert value to milliseconds
|
|
7581
7581
|
*/
|
|
7582
7582
|
|
|
7583
7583
|
|
|
@@ -7598,8 +7598,8 @@ function millisecondsFrom(type, value) {
|
|
|
7598
7598
|
cache[key] = result;
|
|
7599
7599
|
return cache[key];
|
|
7600
7600
|
}
|
|
7601
|
-
/**
|
|
7602
|
-
* Return 00:00:00 supplied date
|
|
7601
|
+
/**
|
|
7602
|
+
* Return 00:00:00 supplied date
|
|
7603
7603
|
*/
|
|
7604
7604
|
|
|
7605
7605
|
function toStartOfDay(date) {
|
|
@@ -7607,8 +7607,8 @@ function toStartOfDay(date) {
|
|
|
7607
7607
|
d.setHours(0, 0, 0, 0);
|
|
7608
7608
|
return d;
|
|
7609
7609
|
}
|
|
7610
|
-
/**
|
|
7611
|
-
* Make date array from supplied parameters
|
|
7610
|
+
/**
|
|
7611
|
+
* Make date array from supplied parameters
|
|
7612
7612
|
*/
|
|
7613
7613
|
|
|
7614
7614
|
function makeDateRange(startDate, endDate, step) {
|
|
@@ -7626,19 +7626,19 @@ function makeDateRange(startDate, endDate, step) {
|
|
|
7626
7626
|
|
|
7627
7627
|
return result;
|
|
7628
7628
|
}
|
|
7629
|
-
/**
|
|
7630
|
-
* Clone supplied date
|
|
7629
|
+
/**
|
|
7630
|
+
* Clone supplied date
|
|
7631
7631
|
*/
|
|
7632
7632
|
|
|
7633
7633
|
function datetime_clone(date) {
|
|
7634
7634
|
return new date_TZDate(date);
|
|
7635
7635
|
}
|
|
7636
|
-
/**
|
|
7637
|
-
* Compare two dates.
|
|
7638
|
-
*
|
|
7639
|
-
* when first date is latest then seconds then return -1.
|
|
7640
|
-
*
|
|
7641
|
-
* return +1 reverse, and return 0 is same.
|
|
7636
|
+
/**
|
|
7637
|
+
* Compare two dates.
|
|
7638
|
+
*
|
|
7639
|
+
* when first date is latest then seconds then return -1.
|
|
7640
|
+
*
|
|
7641
|
+
* return +1 reverse, and return 0 is same.
|
|
7642
7642
|
*/
|
|
7643
7643
|
|
|
7644
7644
|
function compare(d1, d2) {
|
|
@@ -7671,15 +7671,15 @@ function max(d1, d2) {
|
|
|
7671
7671
|
function min(d1, d2) {
|
|
7672
7672
|
return compare(d1, d2) === -1 ? d1 : d2;
|
|
7673
7673
|
}
|
|
7674
|
-
/**
|
|
7675
|
-
* Convert date string to date object.
|
|
7676
|
-
* Only listed below formats available.
|
|
7677
|
-
*
|
|
7678
|
-
* - YYYYMMDD
|
|
7679
|
-
* - YYYY/MM/DD
|
|
7680
|
-
* - YYYY-MM-DD
|
|
7681
|
-
* - YYYY/MM/DD HH:mm:SS
|
|
7682
|
-
* - YYYY-MM-DD HH:mm:SS
|
|
7674
|
+
/**
|
|
7675
|
+
* Convert date string to date object.
|
|
7676
|
+
* Only listed below formats available.
|
|
7677
|
+
*
|
|
7678
|
+
* - YYYYMMDD
|
|
7679
|
+
* - YYYY/MM/DD
|
|
7680
|
+
* - YYYY-MM-DD
|
|
7681
|
+
* - YYYY/MM/DD HH:mm:SS
|
|
7682
|
+
* - YYYY-MM-DD HH:mm:SS
|
|
7683
7683
|
*/
|
|
7684
7684
|
|
|
7685
7685
|
function parse(str) {
|
|
@@ -7711,9 +7711,9 @@ function parse(str) {
|
|
|
7711
7711
|
|
|
7712
7712
|
return new date_TZDate().setWithRaw(Number(ymd[0]), Number(ymd[1]) + fixMonth, Number(ymd[2]), Number(hms[0]), Number(hms[1]), Number(hms[2]), 0);
|
|
7713
7713
|
}
|
|
7714
|
-
/**
|
|
7715
|
-
* Return 23:59:59 supplied date.
|
|
7716
|
-
* If you want to use milliseconds, use format 'YYYY-MM-DDTHH:mm:ss.sssZ' based on http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
|
|
7714
|
+
/**
|
|
7715
|
+
* Return 23:59:59 supplied date.
|
|
7716
|
+
* If you want to use milliseconds, use format 'YYYY-MM-DDTHH:mm:ss.sssZ' based on http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
|
|
7717
7717
|
*/
|
|
7718
7718
|
|
|
7719
7719
|
function toEndOfDay(date) {
|
|
@@ -7730,8 +7730,8 @@ function isSunday(day) {
|
|
|
7730
7730
|
function isSaturday(day) {
|
|
7731
7731
|
return day === Day.SAT;
|
|
7732
7732
|
}
|
|
7733
|
-
/**
|
|
7734
|
-
* Whether date is between supplied dates with date value?
|
|
7733
|
+
/**
|
|
7734
|
+
* Whether date is between supplied dates with date value?
|
|
7735
7735
|
*/
|
|
7736
7736
|
|
|
7737
7737
|
function isBetweenWithDate(d, d1, d2) {
|
|
@@ -7757,8 +7757,8 @@ function toEndOfMonth(date) {
|
|
|
7757
7757
|
endDate.setHours(23, 59, 59, 999);
|
|
7758
7758
|
return endDate;
|
|
7759
7759
|
}
|
|
7760
|
-
/**
|
|
7761
|
-
* Calculate grid left(%), width(%) by narrowWeekend, startDayOfWeek, workweek
|
|
7760
|
+
/**
|
|
7761
|
+
* Calculate grid left(%), width(%) by narrowWeekend, startDayOfWeek, workweek
|
|
7762
7762
|
*/
|
|
7763
7763
|
|
|
7764
7764
|
function getRowStyleInfo(days, narrowWeekend, startDayOfWeek, workweek) {
|
|
@@ -7833,10 +7833,10 @@ function subtractDate(d, steps) {
|
|
|
7833
7833
|
date.setDate(d.getDate() - steps);
|
|
7834
7834
|
return date;
|
|
7835
7835
|
}
|
|
7836
|
-
/**
|
|
7837
|
-
* Inspired by `date-fns`
|
|
7838
|
-
*
|
|
7839
|
-
* See more: https://github.com/date-fns/date-fns/blob/master/src/addMonths/index.ts
|
|
7836
|
+
/**
|
|
7837
|
+
* Inspired by `date-fns`
|
|
7838
|
+
*
|
|
7839
|
+
* See more: https://github.com/date-fns/date-fns/blob/master/src/addMonths/index.ts
|
|
7840
7840
|
*/
|
|
7841
7841
|
|
|
7842
7842
|
function addMonths(d) {
|
|
@@ -7953,8 +7953,8 @@ function eventModel_defineProperty(obj, key, value) { if (key in obj) { Object.d
|
|
|
7953
7953
|
|
|
7954
7954
|
|
|
7955
7955
|
class EventModel {
|
|
7956
|
-
/**
|
|
7957
|
-
* whether the event includes multiple dates
|
|
7956
|
+
/**
|
|
7957
|
+
* whether the event includes multiple dates
|
|
7958
7958
|
*/
|
|
7959
7959
|
constructor() {
|
|
7960
7960
|
let event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -8109,34 +8109,34 @@ class EventModel {
|
|
|
8109
8109
|
|
|
8110
8110
|
this.hasMultiDates = this.end.getTime() - this.start.getTime() > MS_PER_DAY;
|
|
8111
8111
|
}
|
|
8112
|
-
/**
|
|
8113
|
-
* @returns {TZDate} render start date.
|
|
8112
|
+
/**
|
|
8113
|
+
* @returns {TZDate} render start date.
|
|
8114
8114
|
*/
|
|
8115
8115
|
|
|
8116
8116
|
|
|
8117
8117
|
getStarts() {
|
|
8118
8118
|
return this.start;
|
|
8119
8119
|
}
|
|
8120
|
-
/**
|
|
8121
|
-
* @returns {TZDate} render end date.
|
|
8120
|
+
/**
|
|
8121
|
+
* @returns {TZDate} render end date.
|
|
8122
8122
|
*/
|
|
8123
8123
|
|
|
8124
8124
|
|
|
8125
8125
|
getEnds() {
|
|
8126
8126
|
return this.end;
|
|
8127
8127
|
}
|
|
8128
|
-
/**
|
|
8129
|
-
* @returns {number} instance unique id.
|
|
8128
|
+
/**
|
|
8129
|
+
* @returns {number} instance unique id.
|
|
8130
8130
|
*/
|
|
8131
8131
|
|
|
8132
8132
|
|
|
8133
8133
|
cid() {
|
|
8134
8134
|
return stamp(this);
|
|
8135
8135
|
}
|
|
8136
|
-
/**
|
|
8137
|
-
* Check two are equals (means title, isAllday, start, end are same)
|
|
8138
|
-
* @param {EventModel} event model instance to compare.
|
|
8139
|
-
* @returns {boolean} Return false when not same.
|
|
8136
|
+
/**
|
|
8137
|
+
* Check two are equals (means title, isAllday, start, end are same)
|
|
8138
|
+
* @param {EventModel} event model instance to compare.
|
|
8139
|
+
* @returns {boolean} Return false when not same.
|
|
8140
8140
|
*/
|
|
8141
8141
|
// eslint-disable-next-line complexity
|
|
8142
8142
|
|
|
@@ -8184,9 +8184,9 @@ class EventModel {
|
|
|
8184
8184
|
|
|
8185
8185
|
return true;
|
|
8186
8186
|
}
|
|
8187
|
-
/**
|
|
8188
|
-
* return duration between start and end.
|
|
8189
|
-
* @returns {number} duration milliseconds (UTC)
|
|
8187
|
+
/**
|
|
8188
|
+
* return duration between start and end.
|
|
8189
|
+
* @returns {number} duration milliseconds (UTC)
|
|
8190
8190
|
*/
|
|
8191
8191
|
|
|
8192
8192
|
|
|
@@ -8207,12 +8207,12 @@ class EventModel {
|
|
|
8207
8207
|
valueOf() {
|
|
8208
8208
|
return this;
|
|
8209
8209
|
}
|
|
8210
|
-
/**
|
|
8211
|
-
* Returns true if the given EventModel coincides with the same time as the
|
|
8212
|
-
* calling EventModel.
|
|
8213
|
-
* @param {EventModel | EventUIModel} event The other event to compare with this EventModel.
|
|
8214
|
-
* @param {boolean = true} usingTravelTime When calculating collision, whether to calculate with travel time.
|
|
8215
|
-
* @returns {boolean} If the other event occurs within the same time as the first object.
|
|
8210
|
+
/**
|
|
8211
|
+
* Returns true if the given EventModel coincides with the same time as the
|
|
8212
|
+
* calling EventModel.
|
|
8213
|
+
* @param {EventModel | EventUIModel} event The other event to compare with this EventModel.
|
|
8214
|
+
* @param {boolean = true} usingTravelTime When calculating collision, whether to calculate with travel time.
|
|
8215
|
+
* @returns {boolean} If the other event occurs within the same time as the first object.
|
|
8216
8216
|
*/
|
|
8217
8217
|
|
|
8218
8218
|
|
|
@@ -8301,13 +8301,13 @@ function collection_defineProperty(obj, key, value) { if (key in obj) { Object.d
|
|
|
8301
8301
|
|
|
8302
8302
|
|
|
8303
8303
|
|
|
8304
|
-
/**
|
|
8305
|
-
* Generic collection base on ES6 Map.
|
|
8306
|
-
*
|
|
8307
|
-
* It needs function for get model's unique id.
|
|
8308
|
-
*
|
|
8309
|
-
* if the function is not supplied then it uses default function {@link Collection#getItemID}
|
|
8310
|
-
* @param {function} [getItemIDFn] function for get model's id.
|
|
8304
|
+
/**
|
|
8305
|
+
* Generic collection base on ES6 Map.
|
|
8306
|
+
*
|
|
8307
|
+
* It needs function for get model's unique id.
|
|
8308
|
+
*
|
|
8309
|
+
* if the function is not supplied then it uses default function {@link Collection#getItemID}
|
|
8310
|
+
* @param {function} [getItemIDFn] function for get model's id.
|
|
8311
8311
|
*/
|
|
8312
8312
|
class Collection {
|
|
8313
8313
|
constructor(getItemIDFn) {
|
|
@@ -8317,10 +8317,10 @@ class Collection {
|
|
|
8317
8317
|
this.getItemID = getItemIDFn;
|
|
8318
8318
|
}
|
|
8319
8319
|
}
|
|
8320
|
-
/**
|
|
8321
|
-
* Combine supplied function filters and condition.
|
|
8322
|
-
* @param {...Filter} filterFns - function filters
|
|
8323
|
-
* @returns {function} combined filter
|
|
8320
|
+
/**
|
|
8321
|
+
* Combine supplied function filters and condition.
|
|
8322
|
+
* @param {...Filter} filterFns - function filters
|
|
8323
|
+
* @returns {function} combined filter
|
|
8324
8324
|
*/
|
|
8325
8325
|
|
|
8326
8326
|
|
|
@@ -8342,10 +8342,10 @@ class Collection {
|
|
|
8342
8342
|
return true;
|
|
8343
8343
|
};
|
|
8344
8344
|
}
|
|
8345
|
-
/**
|
|
8346
|
-
* Combine multiple function filters with OR clause.
|
|
8347
|
-
* @param {...function} filterFns - function filters
|
|
8348
|
-
* @returns {function} combined filter
|
|
8345
|
+
/**
|
|
8346
|
+
* Combine multiple function filters with OR clause.
|
|
8347
|
+
* @param {...function} filterFns - function filters
|
|
8348
|
+
* @returns {function} combined filter
|
|
8349
8349
|
*/
|
|
8350
8350
|
|
|
8351
8351
|
|
|
@@ -8372,10 +8372,10 @@ class Collection {
|
|
|
8372
8372
|
return result;
|
|
8373
8373
|
};
|
|
8374
8374
|
}
|
|
8375
|
-
/**
|
|
8376
|
-
* get model's unique id.
|
|
8377
|
-
* @param {object} item model instance.
|
|
8378
|
-
* @returns {string | number} model unique id.
|
|
8375
|
+
/**
|
|
8376
|
+
* get model's unique id.
|
|
8377
|
+
* @param {object} item model instance.
|
|
8378
|
+
* @returns {string | number} model unique id.
|
|
8379
8379
|
*/
|
|
8380
8380
|
|
|
8381
8381
|
|
|
@@ -8389,9 +8389,9 @@ class Collection {
|
|
|
8389
8389
|
const iterator = this.internalMap.values();
|
|
8390
8390
|
return iterator.next().value;
|
|
8391
8391
|
}
|
|
8392
|
-
/**
|
|
8393
|
-
* add models.
|
|
8394
|
-
* @param {Object[]} items - models to add this collection.
|
|
8392
|
+
/**
|
|
8393
|
+
* add models.
|
|
8394
|
+
* @param {Object[]} items - models to add this collection.
|
|
8395
8395
|
*/
|
|
8396
8396
|
|
|
8397
8397
|
|
|
@@ -8406,9 +8406,9 @@ class Collection {
|
|
|
8406
8406
|
});
|
|
8407
8407
|
return this;
|
|
8408
8408
|
}
|
|
8409
|
-
/**
|
|
8410
|
-
* remove models.
|
|
8411
|
-
* @param {Array.<(Object|string|number)>} items model instances or unique ids to delete.
|
|
8409
|
+
/**
|
|
8410
|
+
* remove models.
|
|
8411
|
+
* @param {Array.<(Object|string|number)>} items model instances or unique ids to delete.
|
|
8412
8412
|
*/
|
|
8413
8413
|
|
|
8414
8414
|
|
|
@@ -8431,10 +8431,10 @@ class Collection {
|
|
|
8431
8431
|
});
|
|
8432
8432
|
return removeResult.length === 1 ? removeResult[0] : removeResult;
|
|
8433
8433
|
}
|
|
8434
|
-
/**
|
|
8435
|
-
* check collection has specific model.
|
|
8436
|
-
* @param {(object|string|number)} id model instance or id to check
|
|
8437
|
-
* @returns {boolean} is has model?
|
|
8434
|
+
/**
|
|
8435
|
+
* check collection has specific model.
|
|
8436
|
+
* @param {(object|string|number)} id model instance or id to check
|
|
8437
|
+
* @returns {boolean} is has model?
|
|
8438
8438
|
*/
|
|
8439
8439
|
|
|
8440
8440
|
|
|
@@ -8449,10 +8449,10 @@ class Collection {
|
|
|
8449
8449
|
const id = isString_default()(item) || isNumber_default()(item) ? item : this.getItemID(item);
|
|
8450
8450
|
return (_this$internalMap$get = this.internalMap.get(id)) !== null && _this$internalMap$get !== void 0 ? _this$internalMap$get : null;
|
|
8451
8451
|
}
|
|
8452
|
-
/**
|
|
8453
|
-
* invoke callback when model exist in collection.
|
|
8454
|
-
* @param {(string|number)} id model unique id.
|
|
8455
|
-
* @param {function} callback the callback.
|
|
8452
|
+
/**
|
|
8453
|
+
* invoke callback when model exist in collection.
|
|
8454
|
+
* @param {(string|number)} id model unique id.
|
|
8455
|
+
* @param {function} callback the callback.
|
|
8456
8456
|
*/
|
|
8457
8457
|
|
|
8458
8458
|
|
|
@@ -8465,26 +8465,26 @@ class Collection {
|
|
|
8465
8465
|
|
|
8466
8466
|
callback(item);
|
|
8467
8467
|
}
|
|
8468
|
-
/**
|
|
8469
|
-
* Search model. and return new collection.
|
|
8470
|
-
* @param {function} filterFn filter function.
|
|
8471
|
-
* @returns {Collection} new collection with filtered models.
|
|
8472
|
-
* @example
|
|
8473
|
-
* collection.filter(function(item) {
|
|
8474
|
-
* return item.edited === true;
|
|
8475
|
-
* });
|
|
8476
|
-
*
|
|
8477
|
-
* function filter1(item) {
|
|
8478
|
-
* return item.edited === false;
|
|
8479
|
-
* }
|
|
8480
|
-
*
|
|
8481
|
-
* function filter2(item) {
|
|
8482
|
-
* return item.disabled === false;
|
|
8483
|
-
* }
|
|
8484
|
-
*
|
|
8485
|
-
* collection.filter(Collection.and(filter1, filter2));
|
|
8486
|
-
*
|
|
8487
|
-
* collection.filter(Collection.or(filter1, filter2));
|
|
8468
|
+
/**
|
|
8469
|
+
* Search model. and return new collection.
|
|
8470
|
+
* @param {function} filterFn filter function.
|
|
8471
|
+
* @returns {Collection} new collection with filtered models.
|
|
8472
|
+
* @example
|
|
8473
|
+
* collection.filter(function(item) {
|
|
8474
|
+
* return item.edited === true;
|
|
8475
|
+
* });
|
|
8476
|
+
*
|
|
8477
|
+
* function filter1(item) {
|
|
8478
|
+
* return item.edited === false;
|
|
8479
|
+
* }
|
|
8480
|
+
*
|
|
8481
|
+
* function filter2(item) {
|
|
8482
|
+
* return item.disabled === false;
|
|
8483
|
+
* }
|
|
8484
|
+
*
|
|
8485
|
+
* collection.filter(Collection.and(filter1, filter2));
|
|
8486
|
+
*
|
|
8487
|
+
* collection.filter(Collection.or(filter1, filter2));
|
|
8488
8488
|
*/
|
|
8489
8489
|
|
|
8490
8490
|
|
|
@@ -8502,24 +8502,24 @@ class Collection {
|
|
|
8502
8502
|
});
|
|
8503
8503
|
return result;
|
|
8504
8504
|
}
|
|
8505
|
-
/**
|
|
8506
|
-
* Group element by specific key values.
|
|
8507
|
-
*
|
|
8508
|
-
* if key parameter is function then invoke it and use returned value.
|
|
8509
|
-
* @param {(string|number|function)} groupByFn key property or getter function.
|
|
8510
|
-
* @returns {object.<string|number, Collection>} grouped object
|
|
8511
|
-
* @example
|
|
8512
|
-
* // pass `string`, `number`, `boolean` type value then group by property value.
|
|
8513
|
-
* collection.groupBy('gender'); // group by 'gender' property value.
|
|
8514
|
-
* collection.groupBy(50); // group by '50' property value.
|
|
8515
|
-
*
|
|
8516
|
-
* // pass `function` then group by return value. each invocation `function` is called with `(item)`.
|
|
8517
|
-
* collection.groupBy(function(item) {
|
|
8518
|
-
* if (item.score > 60) {
|
|
8519
|
-
* return 'pass';
|
|
8520
|
-
* }
|
|
8521
|
-
* return 'fail';
|
|
8522
|
-
* });
|
|
8505
|
+
/**
|
|
8506
|
+
* Group element by specific key values.
|
|
8507
|
+
*
|
|
8508
|
+
* if key parameter is function then invoke it and use returned value.
|
|
8509
|
+
* @param {(string|number|function)} groupByFn key property or getter function.
|
|
8510
|
+
* @returns {object.<string|number, Collection>} grouped object
|
|
8511
|
+
* @example
|
|
8512
|
+
* // pass `string`, `number`, `boolean` type value then group by property value.
|
|
8513
|
+
* collection.groupBy('gender'); // group by 'gender' property value.
|
|
8514
|
+
* collection.groupBy(50); // group by '50' property value.
|
|
8515
|
+
*
|
|
8516
|
+
* // pass `function` then group by return value. each invocation `function` is called with `(item)`.
|
|
8517
|
+
* collection.groupBy(function(item) {
|
|
8518
|
+
* if (item.score > 60) {
|
|
8519
|
+
* return 'pass';
|
|
8520
|
+
* }
|
|
8521
|
+
* return 'fail';
|
|
8522
|
+
* });
|
|
8523
8523
|
*/
|
|
8524
8524
|
|
|
8525
8525
|
|
|
@@ -8539,10 +8539,10 @@ class Collection {
|
|
|
8539
8539
|
});
|
|
8540
8540
|
return result;
|
|
8541
8541
|
}
|
|
8542
|
-
/**
|
|
8543
|
-
* Return the first item in collection that satisfies the provided function.
|
|
8544
|
-
* @param {function} [findFn] - function filter
|
|
8545
|
-
* @returns {object|null} item.
|
|
8542
|
+
/**
|
|
8543
|
+
* Return the first item in collection that satisfies the provided function.
|
|
8544
|
+
* @param {function} [findFn] - function filter
|
|
8545
|
+
* @returns {object|null} item.
|
|
8546
8546
|
*/
|
|
8547
8547
|
|
|
8548
8548
|
|
|
@@ -8562,21 +8562,21 @@ class Collection {
|
|
|
8562
8562
|
|
|
8563
8563
|
return result;
|
|
8564
8564
|
}
|
|
8565
|
-
/**
|
|
8566
|
-
* sort a basis of supplied compare function.
|
|
8567
|
-
* @param {function} compareFn compareFunction
|
|
8568
|
-
* @returns {array} sorted array.
|
|
8565
|
+
/**
|
|
8566
|
+
* sort a basis of supplied compare function.
|
|
8567
|
+
* @param {function} compareFn compareFunction
|
|
8568
|
+
* @returns {array} sorted array.
|
|
8569
8569
|
*/
|
|
8570
8570
|
|
|
8571
8571
|
|
|
8572
8572
|
sort(compareFn) {
|
|
8573
8573
|
return this.toArray().sort(compareFn);
|
|
8574
8574
|
}
|
|
8575
|
-
/**
|
|
8576
|
-
* iterate each model element.
|
|
8577
|
-
*
|
|
8578
|
-
* when iteratee return false then break the loop.
|
|
8579
|
-
* @param {function} iteratee iteratee(item, index, items)
|
|
8575
|
+
/**
|
|
8576
|
+
* iterate each model element.
|
|
8577
|
+
*
|
|
8578
|
+
* when iteratee return false then break the loop.
|
|
8579
|
+
* @param {function} iteratee iteratee(item, index, items)
|
|
8580
8580
|
*/
|
|
8581
8581
|
|
|
8582
8582
|
|
|
@@ -8594,17 +8594,17 @@ class Collection {
|
|
|
8594
8594
|
next = entries.next();
|
|
8595
8595
|
}
|
|
8596
8596
|
}
|
|
8597
|
-
/**
|
|
8598
|
-
* remove all models in collection.
|
|
8597
|
+
/**
|
|
8598
|
+
* remove all models in collection.
|
|
8599
8599
|
*/
|
|
8600
8600
|
|
|
8601
8601
|
|
|
8602
8602
|
clear() {
|
|
8603
8603
|
this.internalMap.clear();
|
|
8604
8604
|
}
|
|
8605
|
-
/**
|
|
8606
|
-
* return new array with collection items.
|
|
8607
|
-
* @returns {array} new array.
|
|
8605
|
+
/**
|
|
8606
|
+
* return new array with collection items.
|
|
8607
|
+
* @returns {array} new array.
|
|
8608
8608
|
*/
|
|
8609
8609
|
|
|
8610
8610
|
|
|
@@ -8624,9 +8624,9 @@ class Collection {
|
|
|
8624
8624
|
|
|
8625
8625
|
|
|
8626
8626
|
|
|
8627
|
-
/**
|
|
8628
|
-
* Make a event collection
|
|
8629
|
-
* @returns {Collection<EventModel>} instance
|
|
8627
|
+
/**
|
|
8628
|
+
* Make a event collection
|
|
8629
|
+
* @returns {Collection<EventModel>} instance
|
|
8630
8630
|
*/
|
|
8631
8631
|
function createEventCollection() {
|
|
8632
8632
|
const collection = new Collection(event => event.cid());
|
|
@@ -8637,11 +8637,11 @@ function createEventCollection() {
|
|
|
8637
8637
|
|
|
8638
8638
|
return collection;
|
|
8639
8639
|
}
|
|
8640
|
-
/**
|
|
8641
|
-
* Calculate contain dates in event.
|
|
8642
|
-
* @param {TZDate} start - start date of range
|
|
8643
|
-
* @param {TZDate} end - end date of range
|
|
8644
|
-
* @returns {array} contain dates.
|
|
8640
|
+
/**
|
|
8641
|
+
* Calculate contain dates in event.
|
|
8642
|
+
* @param {TZDate} start - start date of range
|
|
8643
|
+
* @param {TZDate} end - end date of range
|
|
8644
|
+
* @returns {array} contain dates.
|
|
8645
8645
|
*/
|
|
8646
8646
|
|
|
8647
8647
|
function getDateRange(start, end) {
|
|
@@ -8650,11 +8650,11 @@ function getDateRange(start, end) {
|
|
|
8650
8650
|
function isAllday(event) {
|
|
8651
8651
|
return event.isAllday || event.category === 'time' && Number(event.end) - Number(event.start) > MS_PER_DAY;
|
|
8652
8652
|
}
|
|
8653
|
-
/**
|
|
8654
|
-
* function for group each event models.
|
|
8655
|
-
* @type {function}
|
|
8656
|
-
* @param {EventUIModel} uiModel - ui model instance
|
|
8657
|
-
* @returns {string} group key
|
|
8653
|
+
/**
|
|
8654
|
+
* function for group each event models.
|
|
8655
|
+
* @type {function}
|
|
8656
|
+
* @param {EventUIModel} uiModel - ui model instance
|
|
8657
|
+
* @returns {string} group key
|
|
8658
8658
|
*/
|
|
8659
8659
|
|
|
8660
8660
|
function filterByCategory(uiModel) {
|
|
@@ -8668,14 +8668,14 @@ function filterByCategory(uiModel) {
|
|
|
8668
8668
|
|
|
8669
8669
|
return model.category;
|
|
8670
8670
|
}
|
|
8671
|
-
/****************
|
|
8672
|
-
* Events CRUD
|
|
8671
|
+
/****************
|
|
8672
|
+
* Events CRUD
|
|
8673
8673
|
****************/
|
|
8674
8674
|
|
|
8675
|
-
/**
|
|
8676
|
-
* Set date matrix to supplied event model instance.
|
|
8677
|
-
* @param {IDS_OF_DAY} idsOfDay - ids of day
|
|
8678
|
-
* @param {EventModel} event - instance of event model.
|
|
8675
|
+
/**
|
|
8676
|
+
* Set date matrix to supplied event model instance.
|
|
8677
|
+
* @param {IDS_OF_DAY} idsOfDay - ids of day
|
|
8678
|
+
* @param {EventModel} event - instance of event model.
|
|
8679
8679
|
*/
|
|
8680
8680
|
|
|
8681
8681
|
function addToMatrix(idsOfDay, event) {
|
|
@@ -8686,10 +8686,10 @@ function addToMatrix(idsOfDay, event) {
|
|
|
8686
8686
|
matrix.push(event.cid());
|
|
8687
8687
|
});
|
|
8688
8688
|
}
|
|
8689
|
-
/**
|
|
8690
|
-
* Remove event's id from matrix.
|
|
8691
|
-
* @param {IDS_OF_DAY} idsOfDay - ids of day
|
|
8692
|
-
* @param {EventModel} event - instance of event model
|
|
8689
|
+
/**
|
|
8690
|
+
* Remove event's id from matrix.
|
|
8691
|
+
* @param {IDS_OF_DAY} idsOfDay - ids of day
|
|
8692
|
+
* @param {EventModel} event - instance of event model
|
|
8693
8693
|
*/
|
|
8694
8694
|
|
|
8695
8695
|
function removeFromMatrix(idsOfDay, event) {
|
|
@@ -8715,13 +8715,13 @@ function createEvents(calendarData) {
|
|
|
8715
8715
|
let events = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
8716
8716
|
return events.map(eventData => createEvent(calendarData, eventData));
|
|
8717
8717
|
}
|
|
8718
|
-
/**
|
|
8719
|
-
* Update an event.
|
|
8720
|
-
* @param {CalendarData} calendarData - data of calendar
|
|
8721
|
-
* @param {string} eventId - event id
|
|
8722
|
-
* @param {string} calendarId - calendar id
|
|
8723
|
-
* @param {EventObject} eventData - event data
|
|
8724
|
-
* @returns {boolean} success or failure
|
|
8718
|
+
/**
|
|
8719
|
+
* Update an event.
|
|
8720
|
+
* @param {CalendarData} calendarData - data of calendar
|
|
8721
|
+
* @param {string} eventId - event id
|
|
8722
|
+
* @param {string} calendarId - calendar id
|
|
8723
|
+
* @param {EventObject} eventData - event data
|
|
8724
|
+
* @returns {boolean} success or failure
|
|
8725
8725
|
*/
|
|
8726
8726
|
|
|
8727
8727
|
function updateEvent(calendarData, eventId, calendarId, eventData) {
|
|
@@ -8741,11 +8741,11 @@ function updateEvent(calendarData, eventId, calendarId, eventData) {
|
|
|
8741
8741
|
addToMatrix(idsOfDay, event);
|
|
8742
8742
|
return true;
|
|
8743
8743
|
}
|
|
8744
|
-
/**
|
|
8745
|
-
* Delete event instance from controller.
|
|
8746
|
-
* @param {CalendarData} calendarData - data of calendar
|
|
8747
|
-
* @param {EventModel} event - event model instance to delete
|
|
8748
|
-
* @returns {EventModel} deleted model instance.
|
|
8744
|
+
/**
|
|
8745
|
+
* Delete event instance from controller.
|
|
8746
|
+
* @param {CalendarData} calendarData - data of calendar
|
|
8747
|
+
* @param {EventModel} event - event model instance to delete
|
|
8748
|
+
* @returns {EventModel} deleted model instance.
|
|
8749
8749
|
*/
|
|
8750
8750
|
|
|
8751
8751
|
function deleteEvent(calendarData, event) {
|
|
@@ -8757,22 +8757,22 @@ function clearEvents(calendarData) {
|
|
|
8757
8757
|
calendarData.idsOfDay = {};
|
|
8758
8758
|
calendarData.events.clear();
|
|
8759
8759
|
}
|
|
8760
|
-
/**
|
|
8761
|
-
* Set calendar list
|
|
8762
|
-
* @param {CalendarData} calendarData - data of calendar
|
|
8763
|
-
* @param {Array.<Calendar>} calendars - calendar list
|
|
8760
|
+
/**
|
|
8761
|
+
* Set calendar list
|
|
8762
|
+
* @param {CalendarData} calendarData - data of calendar
|
|
8763
|
+
* @param {Array.<Calendar>} calendars - calendar list
|
|
8764
8764
|
*/
|
|
8765
8765
|
|
|
8766
8766
|
function setCalendars(calendarData, calendars) {
|
|
8767
8767
|
calendarData.calendars = calendars;
|
|
8768
8768
|
}
|
|
8769
|
-
/**
|
|
8770
|
-
* Return events in supplied date range.
|
|
8771
|
-
*
|
|
8772
|
-
* available only YMD.
|
|
8773
|
-
* @param {CalendarData} calendarData - data of calendar
|
|
8774
|
-
* @param {{start: TZDate, end: TZDate}} condition - condition of find range
|
|
8775
|
-
* @returns {object.<string, Collection>} event collection grouped by dates.
|
|
8769
|
+
/**
|
|
8770
|
+
* Return events in supplied date range.
|
|
8771
|
+
*
|
|
8772
|
+
* available only YMD.
|
|
8773
|
+
* @param {CalendarData} calendarData - data of calendar
|
|
8774
|
+
* @param {{start: TZDate, end: TZDate}} condition - condition of find range
|
|
8775
|
+
* @returns {object.<string, Collection>} event collection grouped by dates.
|
|
8776
8776
|
*/
|
|
8777
8777
|
|
|
8778
8778
|
function findByDateRange(calendarData, condition) {
|
|
@@ -9731,10 +9731,10 @@ function createViewDispatchers(set) {
|
|
|
9731
9731
|
|
|
9732
9732
|
|
|
9733
9733
|
|
|
9734
|
-
/**
|
|
9735
|
-
* Inspired by Zustand
|
|
9736
|
-
*
|
|
9737
|
-
* See more: https://github.com/pmndrs/zustand
|
|
9734
|
+
/**
|
|
9735
|
+
* Inspired by Zustand
|
|
9736
|
+
*
|
|
9737
|
+
* See more: https://github.com/pmndrs/zustand
|
|
9738
9738
|
*/
|
|
9739
9739
|
const isSSR = isUndefined_default()(window) || !window.navigator;
|
|
9740
9740
|
const useIsomorphicLayoutEffect = isSSR ? hooks_module_ : hooks_module_h;
|
|
@@ -9826,9 +9826,9 @@ function createStoreContext() {
|
|
|
9826
9826
|
}, []);
|
|
9827
9827
|
return hasNewStateSlice ? newStateSlice : currentSliceRef.current;
|
|
9828
9828
|
};
|
|
9829
|
-
/**
|
|
9830
|
-
* For handling often occurring state changes (Transient updates)
|
|
9831
|
-
* See more: https://github.com/pmndrs/zustand/blob/master/readme.md#transient-updates-for-often-occuring-state-changes
|
|
9829
|
+
/**
|
|
9830
|
+
* For handling often occurring state changes (Transient updates)
|
|
9831
|
+
* See more: https://github.com/pmndrs/zustand/blob/master/readme.md#transient-updates-for-often-occuring-state-changes
|
|
9832
9832
|
*/
|
|
9833
9833
|
|
|
9834
9834
|
|
|
@@ -9975,9 +9975,9 @@ var browser_default = /*#__PURE__*/__webpack_require__.n(browser);
|
|
|
9975
9975
|
// For temporarily saving original target value
|
|
9976
9976
|
|
|
9977
9977
|
const TEMP_TARGET_ATTRIBUTE = 'data-target-temp';
|
|
9978
|
-
/**
|
|
9979
|
-
* Add DOMPurify hook to handling exceptional rules for certain HTML attributes.
|
|
9980
|
-
* Should be set when the calendar instance is created.
|
|
9978
|
+
/**
|
|
9979
|
+
* Add DOMPurify hook to handling exceptional rules for certain HTML attributes.
|
|
9980
|
+
* Should be set when the calendar instance is created.
|
|
9981
9981
|
*/
|
|
9982
9982
|
|
|
9983
9983
|
function addAttributeHooks() {
|
|
@@ -10004,16 +10004,16 @@ function addAttributeHooks() {
|
|
|
10004
10004
|
}
|
|
10005
10005
|
});
|
|
10006
10006
|
}
|
|
10007
|
-
/**
|
|
10008
|
-
* Remove all attribute sanitizing hooks.
|
|
10009
|
-
* Use it in `Calendar#destroy`.
|
|
10007
|
+
/**
|
|
10008
|
+
* Remove all attribute sanitizing hooks.
|
|
10009
|
+
* Use it in `Calendar#destroy`.
|
|
10010
10010
|
*/
|
|
10011
10011
|
|
|
10012
10012
|
function removeAttributeHooks() {
|
|
10013
10013
|
browser_default().removeAllHooks();
|
|
10014
10014
|
}
|
|
10015
|
-
/**
|
|
10016
|
-
* Prevent XSS attack by sanitizing input string values via DOMPurify
|
|
10015
|
+
/**
|
|
10016
|
+
* Prevent XSS attack by sanitizing input string values via DOMPurify
|
|
10017
10017
|
*/
|
|
10018
10018
|
|
|
10019
10019
|
function sanitize(str) {
|
|
@@ -10228,9 +10228,9 @@ function DayName(_ref3) {
|
|
|
10228
10228
|
;// CONCATENATED MODULE: ./src/selectors/theme.ts
|
|
10229
10229
|
|
|
10230
10230
|
|
|
10231
|
-
/**
|
|
10232
|
-
* Selectors for the theme state.
|
|
10233
|
-
* Use selectors with `useTheme` hooks only.
|
|
10231
|
+
/**
|
|
10232
|
+
* Selectors for the theme state.
|
|
10233
|
+
* Use selectors with `useTheme` hooks only.
|
|
10234
10234
|
*/
|
|
10235
10235
|
const commonThemeSelector = topLevelStateSelector('common');
|
|
10236
10236
|
const theme_weekThemeSelector = topLevelStateSelector('week');
|
|
@@ -10572,11 +10572,11 @@ let CellBarType;
|
|
|
10572
10572
|
|
|
10573
10573
|
|
|
10574
10574
|
|
|
10575
|
-
/**
|
|
10576
|
-
* Calculate collision group.
|
|
10577
|
-
* @param {Array<EventModel|EventUIModel>} events list of ui models.
|
|
10578
|
-
* @param {boolean} [usingTravelTime = true]
|
|
10579
|
-
* @returns {Array<number[]>} Collision Group.
|
|
10575
|
+
/**
|
|
10576
|
+
* Calculate collision group.
|
|
10577
|
+
* @param {Array<EventModel|EventUIModel>} events list of ui models.
|
|
10578
|
+
* @param {boolean} [usingTravelTime = true]
|
|
10579
|
+
* @returns {Array<number[]>} Collision Group.
|
|
10580
10580
|
*/
|
|
10581
10581
|
function getCollisionGroup(events) {
|
|
10582
10582
|
let usingTravelTime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
@@ -10610,11 +10610,11 @@ function getCollisionGroup(events) {
|
|
|
10610
10610
|
});
|
|
10611
10611
|
return collisionGroups;
|
|
10612
10612
|
}
|
|
10613
|
-
/**
|
|
10614
|
-
* Get row length by column index in 2d matrix.
|
|
10615
|
-
* @param {array[]} matrix Matrix
|
|
10616
|
-
* @param {number} col Column index.
|
|
10617
|
-
* @returns {number} Last row number in column or -1
|
|
10613
|
+
/**
|
|
10614
|
+
* Get row length by column index in 2d matrix.
|
|
10615
|
+
* @param {array[]} matrix Matrix
|
|
10616
|
+
* @param {number} col Column index.
|
|
10617
|
+
* @returns {number} Last row number in column or -1
|
|
10618
10618
|
*/
|
|
10619
10619
|
|
|
10620
10620
|
function getLastRowInColumn(matrix, col) {
|
|
@@ -10632,12 +10632,12 @@ function getLastRowInColumn(matrix, col) {
|
|
|
10632
10632
|
|
|
10633
10633
|
return -1;
|
|
10634
10634
|
}
|
|
10635
|
-
/**
|
|
10636
|
-
* Calculate matrix for appointment block element placing.
|
|
10637
|
-
* @param {Collection} collection model collection.
|
|
10638
|
-
* @param {Array<number[]>} collisionGroups Collision groups for event set.
|
|
10639
|
-
* @param {boolean} [usingTravelTime = true]
|
|
10640
|
-
* @returns {array} matrices
|
|
10635
|
+
/**
|
|
10636
|
+
* Calculate matrix for appointment block element placing.
|
|
10637
|
+
* @param {Collection} collection model collection.
|
|
10638
|
+
* @param {Array<number[]>} collisionGroups Collision groups for event set.
|
|
10639
|
+
* @param {boolean} [usingTravelTime = true]
|
|
10640
|
+
* @returns {array} matrices
|
|
10641
10641
|
*/
|
|
10642
10642
|
|
|
10643
10643
|
function getMatrices(collection, collisionGroups) {
|
|
@@ -10676,11 +10676,11 @@ function getMatrices(collection, collisionGroups) {
|
|
|
10676
10676
|
});
|
|
10677
10677
|
return result;
|
|
10678
10678
|
}
|
|
10679
|
-
/**
|
|
10680
|
-
* Filter that get event model in supplied date ranges.
|
|
10681
|
-
* @param {TZDate} start - start date
|
|
10682
|
-
* @param {TZDate} end - end date
|
|
10683
|
-
* @returns {function} event filter function
|
|
10679
|
+
/**
|
|
10680
|
+
* Filter that get event model in supplied date ranges.
|
|
10681
|
+
* @param {TZDate} start - start date
|
|
10682
|
+
* @param {TZDate} end - end date
|
|
10683
|
+
* @returns {function} event filter function
|
|
10684
10684
|
*/
|
|
10685
10685
|
|
|
10686
10686
|
function getEventInDateRangeFilter(start, end) {
|
|
@@ -10695,12 +10695,12 @@ function getEventInDateRangeFilter(start, end) {
|
|
|
10695
10695
|
return !(ownEnds < start || ownStarts > end);
|
|
10696
10696
|
};
|
|
10697
10697
|
}
|
|
10698
|
-
/**
|
|
10699
|
-
* Position each ui model for placing into container
|
|
10700
|
-
* @param {TZDate} start - start date to render
|
|
10701
|
-
* @param {TZDate} end - end date to render
|
|
10702
|
-
* @param {Matrix3d} matrices - matrices from controller
|
|
10703
|
-
* @param {function} [iteratee] - iteratee function invoke each ui models
|
|
10698
|
+
/**
|
|
10699
|
+
* Position each ui model for placing into container
|
|
10700
|
+
* @param {TZDate} start - start date to render
|
|
10701
|
+
* @param {TZDate} end - end date to render
|
|
10702
|
+
* @param {Matrix3d} matrices - matrices from controller
|
|
10703
|
+
* @param {function} [iteratee] - iteratee function invoke each ui models
|
|
10704
10704
|
*/
|
|
10705
10705
|
|
|
10706
10706
|
function positionUIModels(start, end, matrices, iteratee) {
|
|
@@ -10722,12 +10722,12 @@ function positionUIModels(start, end, matrices, iteratee) {
|
|
|
10722
10722
|
});
|
|
10723
10723
|
});
|
|
10724
10724
|
}
|
|
10725
|
-
/**
|
|
10726
|
-
* Limit render range for ui models
|
|
10727
|
-
* @param {TZDate} start
|
|
10728
|
-
* @param {TZDate} end
|
|
10729
|
-
* @param {EventUIModel} uiModel - ui model instance
|
|
10730
|
-
* @returns {EventUIModel} ui model that limited render range
|
|
10725
|
+
/**
|
|
10726
|
+
* Limit render range for ui models
|
|
10727
|
+
* @param {TZDate} start
|
|
10728
|
+
* @param {TZDate} end
|
|
10729
|
+
* @param {EventUIModel} uiModel - ui model instance
|
|
10730
|
+
* @returns {EventUIModel} ui model that limited render range
|
|
10731
10731
|
*/
|
|
10732
10732
|
|
|
10733
10733
|
function limit(start, end, uiModel) {
|
|
@@ -10743,13 +10743,13 @@ function limit(start, end, uiModel) {
|
|
|
10743
10743
|
|
|
10744
10744
|
return uiModel;
|
|
10745
10745
|
}
|
|
10746
|
-
/**
|
|
10747
|
-
* Limit start, end date each ui model for render properly
|
|
10748
|
-
* @param {TZDate} start - start date to render
|
|
10749
|
-
* @param {TZDate} end - end date to render
|
|
10750
|
-
* @param {Collection<EventUIModel>|EventUIModel} uiModelColl - collection of EventUIModel or EventUIModel
|
|
10751
|
-
* @returns {?EventUIModel} return ui model when third parameter is
|
|
10752
|
-
* ui model
|
|
10746
|
+
/**
|
|
10747
|
+
* Limit start, end date each ui model for render properly
|
|
10748
|
+
* @param {TZDate} start - start date to render
|
|
10749
|
+
* @param {TZDate} end - end date to render
|
|
10750
|
+
* @param {Collection<EventUIModel>|EventUIModel} uiModelColl - collection of EventUIModel or EventUIModel
|
|
10751
|
+
* @returns {?EventUIModel} return ui model when third parameter is
|
|
10752
|
+
* ui model
|
|
10753
10753
|
*/
|
|
10754
10754
|
|
|
10755
10755
|
|
|
@@ -10764,10 +10764,10 @@ function limitRenderRange(start, end, uiModelColl) {
|
|
|
10764
10764
|
|
|
10765
10765
|
return limit(start, end, uiModelColl);
|
|
10766
10766
|
}
|
|
10767
|
-
/**
|
|
10768
|
-
* Convert event model collection to ui model collection.
|
|
10769
|
-
* @param {Collection} eventCollection - collection of event model
|
|
10770
|
-
* @returns {Collection} collection of event ui model
|
|
10767
|
+
/**
|
|
10768
|
+
* Convert event model collection to ui model collection.
|
|
10769
|
+
* @param {Collection} eventCollection - collection of event model
|
|
10770
|
+
* @returns {Collection} collection of event ui model
|
|
10771
10771
|
*/
|
|
10772
10772
|
|
|
10773
10773
|
function convertToUIModel(eventCollection) {
|
|
@@ -10787,10 +10787,10 @@ function convertToUIModel(eventCollection) {
|
|
|
10787
10787
|
|
|
10788
10788
|
|
|
10789
10789
|
|
|
10790
|
-
/**
|
|
10791
|
-
* Filter function for find allday event
|
|
10792
|
-
* @param {EventUIModel} uiModel - ui model
|
|
10793
|
-
* @returns {boolean} whether model is allday event?
|
|
10790
|
+
/**
|
|
10791
|
+
* Filter function for find allday event
|
|
10792
|
+
* @param {EventUIModel} uiModel - ui model
|
|
10793
|
+
* @returns {boolean} whether model is allday event?
|
|
10794
10794
|
*/
|
|
10795
10795
|
function _isAllday(_ref) {
|
|
10796
10796
|
let {
|
|
@@ -10798,19 +10798,19 @@ function _isAllday(_ref) {
|
|
|
10798
10798
|
} = _ref;
|
|
10799
10799
|
return model.isAllday || model.hasMultiDates;
|
|
10800
10800
|
}
|
|
10801
|
-
/**
|
|
10802
|
-
* Filter function for find time event
|
|
10803
|
-
* @param {EventUIModel} uiModel - ui model
|
|
10804
|
-
* @returns {boolean} whether model is time event?
|
|
10801
|
+
/**
|
|
10802
|
+
* Filter function for find time event
|
|
10803
|
+
* @param {EventUIModel} uiModel - ui model
|
|
10804
|
+
* @returns {boolean} whether model is time event?
|
|
10805
10805
|
*/
|
|
10806
10806
|
|
|
10807
10807
|
|
|
10808
10808
|
function _isNotAllday(uiModel) {
|
|
10809
10809
|
return !_isAllday(uiModel);
|
|
10810
10810
|
}
|
|
10811
|
-
/**
|
|
10812
|
-
* Weight top value +1 for month view render
|
|
10813
|
-
* @param {EventUIModel} uiModel - ui model
|
|
10811
|
+
/**
|
|
10812
|
+
* Weight top value +1 for month view render
|
|
10813
|
+
* @param {EventUIModel} uiModel - ui model
|
|
10814
10814
|
*/
|
|
10815
10815
|
|
|
10816
10816
|
|
|
@@ -10818,14 +10818,14 @@ function _weightTopValue(uiModel) {
|
|
|
10818
10818
|
uiModel.top = uiModel.top || 0;
|
|
10819
10819
|
uiModel.top += 1;
|
|
10820
10820
|
}
|
|
10821
|
-
/**
|
|
10822
|
-
* Adjust render range to render properly.
|
|
10823
|
-
*
|
|
10824
|
-
* Limit start, end for each allday events and expand start, end for
|
|
10825
|
-
* each time events
|
|
10826
|
-
* @param {TZDate} start - render start date
|
|
10827
|
-
* @param {TZDate} end - render end date
|
|
10828
|
-
* @param {Collection} uiModelColl - collection of ui model.
|
|
10821
|
+
/**
|
|
10822
|
+
* Adjust render range to render properly.
|
|
10823
|
+
*
|
|
10824
|
+
* Limit start, end for each allday events and expand start, end for
|
|
10825
|
+
* each time events
|
|
10826
|
+
* @param {TZDate} start - render start date
|
|
10827
|
+
* @param {TZDate} end - render end date
|
|
10828
|
+
* @param {Collection} uiModelColl - collection of ui model.
|
|
10829
10829
|
*/
|
|
10830
10830
|
|
|
10831
10831
|
|
|
@@ -10836,12 +10836,12 @@ function _adjustRenderRange(start, end, uiModelColl) {
|
|
|
10836
10836
|
}
|
|
10837
10837
|
});
|
|
10838
10838
|
}
|
|
10839
|
-
/**
|
|
10840
|
-
* Get max top index value for allday events in specific date (YMD)
|
|
10841
|
-
* @param idsOfDay
|
|
10842
|
-
* @param {string} ymd - yyyymmdd formatted value
|
|
10843
|
-
* @param {Collection} uiModelAlldayColl - collection of allday events
|
|
10844
|
-
* @returns {number} max top index value in date
|
|
10839
|
+
/**
|
|
10840
|
+
* Get max top index value for allday events in specific date (YMD)
|
|
10841
|
+
* @param idsOfDay
|
|
10842
|
+
* @param {string} ymd - yyyymmdd formatted value
|
|
10843
|
+
* @param {Collection} uiModelAlldayColl - collection of allday events
|
|
10844
|
+
* @returns {number} max top index value in date
|
|
10845
10845
|
*/
|
|
10846
10846
|
|
|
10847
10847
|
|
|
@@ -10859,10 +10859,10 @@ function _getAlldayMaxTopIndexAtYMD(idsOfDay, ymd, uiModelAlldayColl) {
|
|
|
10859
10859
|
|
|
10860
10860
|
return 0;
|
|
10861
10861
|
}
|
|
10862
|
-
/**
|
|
10863
|
-
* Adjust time ui model's top index value
|
|
10864
|
-
* @param idsOfDay
|
|
10865
|
-
* @param {Collection} uiModelColl - collection of ui ui model
|
|
10862
|
+
/**
|
|
10863
|
+
* Adjust time ui model's top index value
|
|
10864
|
+
* @param idsOfDay
|
|
10865
|
+
* @param {Collection} uiModelColl - collection of ui ui model
|
|
10866
10866
|
*/
|
|
10867
10867
|
|
|
10868
10868
|
|
|
@@ -10881,10 +10881,10 @@ function _adjustTimeTopIndex(idsOfDay, uiModelColl) {
|
|
|
10881
10881
|
maxIndexInYMD[eventYMD] = timeUIModel.top = alldayMaxTopInYMD + 1;
|
|
10882
10882
|
});
|
|
10883
10883
|
}
|
|
10884
|
-
/**
|
|
10885
|
-
* Adjust time ui model's top index value
|
|
10886
|
-
* @param {IDS_OF_DAY} idsOfDay - ids of days
|
|
10887
|
-
* @param {Collection} uiModelColl - collection of ui ui model
|
|
10884
|
+
/**
|
|
10885
|
+
* Adjust time ui model's top index value
|
|
10886
|
+
* @param {IDS_OF_DAY} idsOfDay - ids of days
|
|
10887
|
+
* @param {Collection} uiModelColl - collection of ui ui model
|
|
10888
10888
|
*/
|
|
10889
10889
|
|
|
10890
10890
|
|
|
@@ -10920,10 +10920,10 @@ function _stackTimeFromTop(idsOfDay, uiModelColl) {
|
|
|
10920
10920
|
topArrayInYMD.push(timeUIModel.top);
|
|
10921
10921
|
});
|
|
10922
10922
|
}
|
|
10923
|
-
/**
|
|
10924
|
-
* Convert multi-date time event to all-day event
|
|
10925
|
-
* @param {Collection} uiModelColl - collection of ui models.
|
|
10926
|
-
* property.
|
|
10923
|
+
/**
|
|
10924
|
+
* Convert multi-date time event to all-day event
|
|
10925
|
+
* @param {Collection} uiModelColl - collection of ui models.
|
|
10926
|
+
* property.
|
|
10927
10927
|
*/
|
|
10928
10928
|
|
|
10929
10929
|
|
|
@@ -10942,11 +10942,11 @@ function _addMultiDatesInfo(uiModelColl) {
|
|
|
10942
10942
|
}
|
|
10943
10943
|
});
|
|
10944
10944
|
}
|
|
10945
|
-
/**
|
|
10946
|
-
* Find event and get ui model for specific month
|
|
10947
|
-
* @returns {object} ui model data
|
|
10948
|
-
* @param calendarData
|
|
10949
|
-
* @param condition
|
|
10945
|
+
/**
|
|
10946
|
+
* Find event and get ui model for specific month
|
|
10947
|
+
* @returns {object} ui model data
|
|
10948
|
+
* @param calendarData
|
|
10949
|
+
* @param condition
|
|
10950
10950
|
*/
|
|
10951
10951
|
|
|
10952
10952
|
|
|
@@ -10993,15 +10993,15 @@ function month_findByDateRange(calendarData, condition) {
|
|
|
10993
10993
|
|
|
10994
10994
|
|
|
10995
10995
|
|
|
10996
|
-
/**********
|
|
10997
|
-
* TIME GRID VIEW
|
|
10996
|
+
/**********
|
|
10997
|
+
* TIME GRID VIEW
|
|
10998
10998
|
**********/
|
|
10999
10999
|
|
|
11000
|
-
/**
|
|
11001
|
-
* make a filter function that is not included range of start, end hour
|
|
11002
|
-
* @param {number} hStart - hour start
|
|
11003
|
-
* @param {number} hEnd - hour end
|
|
11004
|
-
* @returns {function} - filtering function
|
|
11000
|
+
/**
|
|
11001
|
+
* make a filter function that is not included range of start, end hour
|
|
11002
|
+
* @param {number} hStart - hour start
|
|
11003
|
+
* @param {number} hEnd - hour end
|
|
11004
|
+
* @returns {function} - filtering function
|
|
11005
11005
|
*/
|
|
11006
11006
|
function _makeHourRangeFilter(hStart, hEnd) {
|
|
11007
11007
|
// eslint-disable-next-line complexity
|
|
@@ -11018,13 +11018,13 @@ function _makeHourRangeFilter(hStart, hEnd) {
|
|
|
11018
11018
|
return ownHourStartTime >= hourStart && ownHourStartTime < hourEnd || ownHourEndTime > hourStart && ownHourEndTime <= hourEnd || ownHourStartTime < hourStart && ownHourEndTime > hourStart || ownHourEndTime > hourEnd && ownHourStartTime < hourEnd;
|
|
11019
11019
|
};
|
|
11020
11020
|
}
|
|
11021
|
-
/**
|
|
11022
|
-
* make ui model function depending on start and end hour
|
|
11023
|
-
* if time view options has start or end hour condition
|
|
11024
|
-
* it add filter
|
|
11025
|
-
* @param {number} hourStart - start hour to be shown
|
|
11026
|
-
* @param {number} hourEnd - end hour to be shown
|
|
11027
|
-
* @returns {function} function
|
|
11021
|
+
/**
|
|
11022
|
+
* make ui model function depending on start and end hour
|
|
11023
|
+
* if time view options has start or end hour condition
|
|
11024
|
+
* it add filter
|
|
11025
|
+
* @param {number} hourStart - start hour to be shown
|
|
11026
|
+
* @param {number} hourEnd - end hour to be shown
|
|
11027
|
+
* @returns {function} function
|
|
11028
11028
|
*/
|
|
11029
11029
|
|
|
11030
11030
|
function _makeGetUIModelFuncForTimeView(hourStart, hourEnd) {
|
|
@@ -11038,13 +11038,13 @@ function _makeGetUIModelFuncForTimeView(hourStart, hourEnd) {
|
|
|
11038
11038
|
return uiModelColl.filter(_makeHourRangeFilter(hourStart, hourEnd)).sort(array.compare.event.asc);
|
|
11039
11039
|
};
|
|
11040
11040
|
}
|
|
11041
|
-
/**
|
|
11042
|
-
* split event model by ymd.
|
|
11043
|
-
* @param {IDS_OF_DAY} idsOfDay - ids of days
|
|
11044
|
-
* @param {TZDate} start - start date
|
|
11045
|
-
* @param {TZDate} end - end date
|
|
11046
|
-
* @param {Collection<EventUIModel>} uiModelColl - collection of ui models.
|
|
11047
|
-
* @returns {object.<string, Collection>} splitted event model collections.
|
|
11041
|
+
/**
|
|
11042
|
+
* split event model by ymd.
|
|
11043
|
+
* @param {IDS_OF_DAY} idsOfDay - ids of days
|
|
11044
|
+
* @param {TZDate} start - start date
|
|
11045
|
+
* @param {TZDate} end - end date
|
|
11046
|
+
* @param {Collection<EventUIModel>} uiModelColl - collection of ui models.
|
|
11047
|
+
* @returns {object.<string, Collection>} splitted event model collections.
|
|
11048
11048
|
*/
|
|
11049
11049
|
|
|
11050
11050
|
function splitEventByDateRange(idsOfDay, start, end, uiModelColl) {
|
|
@@ -11067,16 +11067,16 @@ function splitEventByDateRange(idsOfDay, start, end, uiModelColl) {
|
|
|
11067
11067
|
}, {});
|
|
11068
11068
|
return result;
|
|
11069
11069
|
}
|
|
11070
|
-
/**
|
|
11071
|
-
* create ui model for time view part
|
|
11072
|
-
* @param {IDS_OF_DAY} idsOfDay - model controller
|
|
11073
|
-
* @param {object} condition - find options
|
|
11074
|
-
* @param {TZDate} condition.start - start date.
|
|
11075
|
-
* @param {TZDate} condition.end - end date.
|
|
11076
|
-
* @param {Collection} condition.uiModelTimeColl - collection of ui models.
|
|
11077
|
-
* @param {number} condition.hourStart - start hour to be shown
|
|
11078
|
-
* @param {number} condition.hourEnd - end hour to be shown
|
|
11079
|
-
* @returns {object} ui model for time part.
|
|
11070
|
+
/**
|
|
11071
|
+
* create ui model for time view part
|
|
11072
|
+
* @param {IDS_OF_DAY} idsOfDay - model controller
|
|
11073
|
+
* @param {object} condition - find options
|
|
11074
|
+
* @param {TZDate} condition.start - start date.
|
|
11075
|
+
* @param {TZDate} condition.end - end date.
|
|
11076
|
+
* @param {Collection} condition.uiModelTimeColl - collection of ui models.
|
|
11077
|
+
* @param {number} condition.hourStart - start hour to be shown
|
|
11078
|
+
* @param {number} condition.hourEnd - end hour to be shown
|
|
11079
|
+
* @returns {object} ui model for time part.
|
|
11080
11080
|
*/
|
|
11081
11081
|
|
|
11082
11082
|
function getUIModelForTimeView(idsOfDay, condition) {
|
|
@@ -11104,13 +11104,13 @@ function getUIModelForTimeView(idsOfDay, condition) {
|
|
|
11104
11104
|
});
|
|
11105
11105
|
return result;
|
|
11106
11106
|
}
|
|
11107
|
-
/**********
|
|
11108
|
-
* ALLDAY VIEW
|
|
11107
|
+
/**********
|
|
11108
|
+
* ALLDAY VIEW
|
|
11109
11109
|
**********/
|
|
11110
11110
|
|
|
11111
|
-
/**
|
|
11112
|
-
* Set hasMultiDates flag to true and set date ranges for rendering
|
|
11113
|
-
* @param {Collection} uiModelColl - collection of ui models.
|
|
11111
|
+
/**
|
|
11112
|
+
* Set hasMultiDates flag to true and set date ranges for rendering
|
|
11113
|
+
* @param {Collection} uiModelColl - collection of ui models.
|
|
11114
11114
|
*/
|
|
11115
11115
|
|
|
11116
11116
|
function week_addMultiDatesInfo(uiModelColl) {
|
|
@@ -11123,12 +11123,12 @@ function week_addMultiDatesInfo(uiModelColl) {
|
|
|
11123
11123
|
uiModel.renderEnds = toEndOfDay(model.getEnds());
|
|
11124
11124
|
});
|
|
11125
11125
|
}
|
|
11126
|
-
/**
|
|
11127
|
-
* create ui model for allday view part
|
|
11128
|
-
* @param {TZDate} start start date.
|
|
11129
|
-
* @param {TZDate} end end date.
|
|
11130
|
-
* @param {Collection} uiModelColl - ui models of allday event.
|
|
11131
|
-
* @returns {DayGridEventMatrix} matrix of allday event ui models.
|
|
11126
|
+
/**
|
|
11127
|
+
* create ui model for allday view part
|
|
11128
|
+
* @param {TZDate} start start date.
|
|
11129
|
+
* @param {TZDate} end end date.
|
|
11130
|
+
* @param {Collection} uiModelColl - ui models of allday event.
|
|
11131
|
+
* @returns {DayGridEventMatrix} matrix of allday event ui models.
|
|
11132
11132
|
*/
|
|
11133
11133
|
|
|
11134
11134
|
function getUIModelForAlldayView(start, end, uiModelColl) {
|
|
@@ -11146,21 +11146,21 @@ function getUIModelForAlldayView(start, end, uiModelColl) {
|
|
|
11146
11146
|
positionUIModels(start, end, matrices);
|
|
11147
11147
|
return matrices;
|
|
11148
11148
|
}
|
|
11149
|
-
/**********
|
|
11150
|
-
* READ
|
|
11149
|
+
/**********
|
|
11150
|
+
* READ
|
|
11151
11151
|
**********/
|
|
11152
11152
|
|
|
11153
|
-
/**
|
|
11154
|
-
* Populate events in date range.
|
|
11155
|
-
* @param {CalendarData} calendarData - data store
|
|
11156
|
-
* @param {object} condition - find options
|
|
11157
|
-
* @param {IDS_OF_DAY} condition.idsOfDay - model controller
|
|
11158
|
-
* @param {TZDate} condition.start start date.
|
|
11159
|
-
* @param {TZDate} condition.end end date.
|
|
11160
|
-
* @param {Array.<object>} condition.panels - event panels like 'milestone', 'task', 'allday', 'time'
|
|
11161
|
-
* @param {function[]} condition.[andFilters] - optional filters to applying search query
|
|
11162
|
-
* @param {Object} condition.options - week view options
|
|
11163
|
-
* @returns {object} events grouped by dates.
|
|
11153
|
+
/**
|
|
11154
|
+
* Populate events in date range.
|
|
11155
|
+
* @param {CalendarData} calendarData - data store
|
|
11156
|
+
* @param {object} condition - find options
|
|
11157
|
+
* @param {IDS_OF_DAY} condition.idsOfDay - model controller
|
|
11158
|
+
* @param {TZDate} condition.start start date.
|
|
11159
|
+
* @param {TZDate} condition.end end date.
|
|
11160
|
+
* @param {Array.<object>} condition.panels - event panels like 'milestone', 'task', 'allday', 'time'
|
|
11161
|
+
* @param {function[]} condition.[andFilters] - optional filters to applying search query
|
|
11162
|
+
* @param {Object} condition.options - week view options
|
|
11163
|
+
* @returns {object} events grouped by dates.
|
|
11164
11164
|
*/
|
|
11165
11165
|
|
|
11166
11166
|
function week_findByDateRange(calendarData, condition) {
|
|
@@ -11214,10 +11214,10 @@ function math_limit(value, minArr, maxArr) {
|
|
|
11214
11214
|
const v = Math.max(value, ...minArr);
|
|
11215
11215
|
return Math.min(v, ...maxArr);
|
|
11216
11216
|
}
|
|
11217
|
-
/**
|
|
11218
|
-
* a : b = y : x;
|
|
11219
|
-
* ==
|
|
11220
|
-
* x = (b * y) / a;
|
|
11217
|
+
/**
|
|
11218
|
+
* a : b = y : x;
|
|
11219
|
+
* ==
|
|
11220
|
+
* x = (b * y) / a;
|
|
11221
11221
|
*/
|
|
11222
11222
|
|
|
11223
11223
|
function ratio(a, b, y) {
|
|
@@ -12197,10 +12197,10 @@ function useDrag(draggingItemType) {
|
|
|
12197
12197
|
return handleMouseDown;
|
|
12198
12198
|
}
|
|
12199
12199
|
;// CONCATENATED MODULE: ./src/utils/preact.ts
|
|
12200
|
-
/**
|
|
12201
|
-
* Pass the prop to component conditionally.
|
|
12202
|
-
* just passing `undefined` violates the ESLint rule, and it's less readable.
|
|
12203
|
-
* So let's use this function to pass the conditional prop.
|
|
12200
|
+
/**
|
|
12201
|
+
* Pass the prop to component conditionally.
|
|
12202
|
+
* just passing `undefined` violates the ESLint rule, and it's less readable.
|
|
12203
|
+
* So let's use this function to pass the conditional prop.
|
|
12204
12204
|
*/
|
|
12205
12205
|
function passConditionalProp(condition, prop) {
|
|
12206
12206
|
// eslint-disable-next-line no-undefined
|
|
@@ -12483,37 +12483,37 @@ function HorizontalEvent(_ref4) {
|
|
|
12483
12483
|
}
|
|
12484
12484
|
;// CONCATENATED MODULE: ./src/hooks/common/useWhen.ts
|
|
12485
12485
|
|
|
12486
|
-
/**
|
|
12487
|
-
* Check the condition and call the callback if the condition is true.
|
|
12488
|
-
* callback is always referencing the latest value
|
|
12489
|
-
* so that it doesn't have to register all values in the callback as deps to useEffect.
|
|
12490
|
-
* But it's not suitable when you need to keep tracking the value related to condition.
|
|
12491
|
-
*
|
|
12492
|
-
* @example
|
|
12493
|
-
* // when the condition is true, the callback is called.
|
|
12494
|
-
* useWhen(() => {
|
|
12495
|
-
* if (shouldUpdateEvent) {
|
|
12496
|
-
* // update event
|
|
12497
|
-
* }
|
|
12498
|
-
* }, isDraggingEnd)
|
|
12499
|
-
*
|
|
12500
|
-
* @example
|
|
12501
|
-
* // avoid this when you need to keep updating `setGridDiff` by `currentGridPos` and `initGridPosition`.
|
|
12502
|
-
* useWhen(() => {
|
|
12503
|
-
* // it will fire once.
|
|
12504
|
-
* setGridDiff({
|
|
12505
|
-
* columnIndex: currentGridPos.columnIndex - initGridPosition.columnIndex,
|
|
12506
|
-
* rowIndex: currentGridPos.rowIndex - initGridPosition.rowIndex,
|
|
12507
|
-
* });
|
|
12508
|
-
* }, isPresent(currentGridPos) && isPresent(initGridPosition));
|
|
12509
|
-
*
|
|
12510
|
-
* // You need to use `useEffect` this time.
|
|
12511
|
-
* useEffect(() => {
|
|
12512
|
-
* setGridDiff({
|
|
12513
|
-
* columnIndex: currentGridPos.columnIndex - initGridPosition.columnIndex,
|
|
12514
|
-
* rowIndex: currentGridPos.rowIndex - initGridPosition.rowIndex,
|
|
12515
|
-
* });
|
|
12516
|
-
* }, [currentGridPos, initGridPosition]);
|
|
12486
|
+
/**
|
|
12487
|
+
* Check the condition and call the callback if the condition is true.
|
|
12488
|
+
* callback is always referencing the latest value
|
|
12489
|
+
* so that it doesn't have to register all values in the callback as deps to useEffect.
|
|
12490
|
+
* But it's not suitable when you need to keep tracking the value related to condition.
|
|
12491
|
+
*
|
|
12492
|
+
* @example
|
|
12493
|
+
* // when the condition is true, the callback is called.
|
|
12494
|
+
* useWhen(() => {
|
|
12495
|
+
* if (shouldUpdateEvent) {
|
|
12496
|
+
* // update event
|
|
12497
|
+
* }
|
|
12498
|
+
* }, isDraggingEnd)
|
|
12499
|
+
*
|
|
12500
|
+
* @example
|
|
12501
|
+
* // avoid this when you need to keep updating `setGridDiff` by `currentGridPos` and `initGridPosition`.
|
|
12502
|
+
* useWhen(() => {
|
|
12503
|
+
* // it will fire once.
|
|
12504
|
+
* setGridDiff({
|
|
12505
|
+
* columnIndex: currentGridPos.columnIndex - initGridPosition.columnIndex,
|
|
12506
|
+
* rowIndex: currentGridPos.rowIndex - initGridPosition.rowIndex,
|
|
12507
|
+
* });
|
|
12508
|
+
* }, isPresent(currentGridPos) && isPresent(initGridPosition));
|
|
12509
|
+
*
|
|
12510
|
+
* // You need to use `useEffect` this time.
|
|
12511
|
+
* useEffect(() => {
|
|
12512
|
+
* setGridDiff({
|
|
12513
|
+
* columnIndex: currentGridPos.columnIndex - initGridPosition.columnIndex,
|
|
12514
|
+
* rowIndex: currentGridPos.rowIndex - initGridPosition.rowIndex,
|
|
12515
|
+
* });
|
|
12516
|
+
* }, [currentGridPos, initGridPosition]);
|
|
12517
12517
|
*/
|
|
12518
12518
|
|
|
12519
12519
|
function useWhen(callback, condition) {
|
|
@@ -15449,8 +15449,8 @@ function useTimeGridEventResize(_ref) {
|
|
|
15449
15449
|
columns,
|
|
15450
15450
|
rows
|
|
15451
15451
|
} = timeGridData;
|
|
15452
|
-
/**
|
|
15453
|
-
* Filter UIModels that are made from the target event.
|
|
15452
|
+
/**
|
|
15453
|
+
* Filter UIModels that are made from the target event.
|
|
15454
15454
|
*/
|
|
15455
15455
|
|
|
15456
15456
|
const resizeTargetUIModelColumns = totalUIModels.map(uiModels => uiModels.filter(uiModel => uiModel.cid() === resizingStartUIModel.cid()));
|
|
@@ -16338,11 +16338,11 @@ const TimeColumn = compat_module_g(function TimeColumn(_ref3) {
|
|
|
16338
16338
|
|
|
16339
16339
|
|
|
16340
16340
|
|
|
16341
|
-
/**
|
|
16342
|
-
* @param date
|
|
16343
|
-
* @param {TZDate} [start] - start time
|
|
16344
|
-
* @param {TZDate} [end] - end time
|
|
16345
|
-
* @returns {number} The percent value represent current time between start and end
|
|
16341
|
+
/**
|
|
16342
|
+
* @param date
|
|
16343
|
+
* @param {TZDate} [start] - start time
|
|
16344
|
+
* @param {TZDate} [end] - end time
|
|
16345
|
+
* @returns {number} The percent value represent current time between start and end
|
|
16346
16346
|
*/
|
|
16347
16347
|
function getTopPercentByTime(date, start, end) {
|
|
16348
16348
|
const startTime = start.getTime();
|
|
@@ -16352,19 +16352,19 @@ function getTopPercentByTime(date, start, end) {
|
|
|
16352
16352
|
const topPercent = ratio(max, 100, time);
|
|
16353
16353
|
return math_limit(topPercent, [0], [100]);
|
|
16354
16354
|
}
|
|
16355
|
-
/**
|
|
16356
|
-
* @typedef {Object} VerticalPositionsByTime
|
|
16357
|
-
* @property {number} top - top percent
|
|
16358
|
-
* @property {number} height - height percent
|
|
16355
|
+
/**
|
|
16356
|
+
* @typedef {Object} VerticalPositionsByTime
|
|
16357
|
+
* @property {number} top - top percent
|
|
16358
|
+
* @property {number} height - height percent
|
|
16359
16359
|
*/
|
|
16360
16360
|
|
|
16361
|
-
/**
|
|
16362
|
-
*
|
|
16363
|
-
* @param {TZDate} start target time which is converted to percent value
|
|
16364
|
-
* @param {TZDate} end target time which is converted to percent value
|
|
16365
|
-
* @param {TZDate} minTime start time
|
|
16366
|
-
* @param {TZDate} maxTime end time
|
|
16367
|
-
* @returns {VerticalPositionsByTime} verticalPositions
|
|
16361
|
+
/**
|
|
16362
|
+
*
|
|
16363
|
+
* @param {TZDate} start target time which is converted to percent value
|
|
16364
|
+
* @param {TZDate} end target time which is converted to percent value
|
|
16365
|
+
* @param {TZDate} minTime start time
|
|
16366
|
+
* @param {TZDate} maxTime end time
|
|
16367
|
+
* @returns {VerticalPositionsByTime} verticalPositions
|
|
16368
16368
|
*/
|
|
16369
16369
|
|
|
16370
16370
|
function getTopHeightByTime(start, end, minTime, maxTime) {
|
|
@@ -16395,12 +16395,12 @@ function setValueByUnit(time, value, unit) {
|
|
|
16395
16395
|
|
|
16396
16396
|
return time;
|
|
16397
16397
|
}
|
|
16398
|
-
/**
|
|
16399
|
-
* Get a previous grid time before the time
|
|
16400
|
-
* @param {TZDate} time - target time
|
|
16401
|
-
* @param slot
|
|
16402
|
-
* @param unit
|
|
16403
|
-
* @returns {TZDate} - next grid time
|
|
16398
|
+
/**
|
|
16399
|
+
* Get a previous grid time before the time
|
|
16400
|
+
* @param {TZDate} time - target time
|
|
16401
|
+
* @param slot
|
|
16402
|
+
* @param unit
|
|
16403
|
+
* @returns {TZDate} - next grid time
|
|
16404
16404
|
*/
|
|
16405
16405
|
|
|
16406
16406
|
|
|
@@ -16421,12 +16421,12 @@ function getPrevGridTime(time, slot, unit) {
|
|
|
16421
16421
|
|
|
16422
16422
|
return prevGridTime;
|
|
16423
16423
|
}
|
|
16424
|
-
/**
|
|
16425
|
-
* Get a next grid time after the time
|
|
16426
|
-
* @param {TZDate} time - target time
|
|
16427
|
-
* @param slot
|
|
16428
|
-
* @param unit
|
|
16429
|
-
* @returns {TZDate} - next grid time
|
|
16424
|
+
/**
|
|
16425
|
+
* Get a next grid time after the time
|
|
16426
|
+
* @param {TZDate} time - target time
|
|
16427
|
+
* @param slot
|
|
16428
|
+
* @param unit
|
|
16429
|
+
* @returns {TZDate} - next grid time
|
|
16430
16430
|
*/
|
|
16431
16431
|
|
|
16432
16432
|
function getNextGridTime(time, slot, unit) {
|
|
@@ -16453,11 +16453,11 @@ function getNextGridTime(time, slot, unit) {
|
|
|
16453
16453
|
|
|
16454
16454
|
const MIN_HEIGHT_PERCENT = 1;
|
|
16455
16455
|
|
|
16456
|
-
/**
|
|
16457
|
-
* Filter that get events in supplied date ranges.
|
|
16458
|
-
* @param {TZDate} startColumnTime - start date
|
|
16459
|
-
* @param {TZDate} endColumnTime - end date
|
|
16460
|
-
* @returns {function} event filter function
|
|
16456
|
+
/**
|
|
16457
|
+
* Filter that get events in supplied date ranges.
|
|
16458
|
+
* @param {TZDate} startColumnTime - start date
|
|
16459
|
+
* @param {TZDate} endColumnTime - end date
|
|
16460
|
+
* @returns {function} event filter function
|
|
16461
16461
|
*/
|
|
16462
16462
|
function column_isBetween(startColumnTime, endColumnTime) {
|
|
16463
16463
|
return uiModel => {
|
|
@@ -16703,11 +16703,11 @@ function setDuplicateEvents(uiModels, options, selectedDuplicateEventCid) {
|
|
|
16703
16703
|
});
|
|
16704
16704
|
return uiModels;
|
|
16705
16705
|
}
|
|
16706
|
-
/**
|
|
16707
|
-
* Convert to EventUIModel and make rendering information of events
|
|
16708
|
-
* @param {EventUIModel[]} events - event list
|
|
16709
|
-
* @param {TZDate} startColumnTime - start date
|
|
16710
|
-
* @param {TZDate} endColumnTime - end date
|
|
16706
|
+
/**
|
|
16707
|
+
* Convert to EventUIModel and make rendering information of events
|
|
16708
|
+
* @param {EventUIModel[]} events - event list
|
|
16709
|
+
* @param {TZDate} startColumnTime - start date
|
|
16710
|
+
* @param {TZDate} endColumnTime - end date
|
|
16711
16711
|
*/
|
|
16712
16712
|
|
|
16713
16713
|
|
|
@@ -18007,8 +18007,8 @@ function useDayGridMonthEventResize(_ref) {
|
|
|
18007
18007
|
if (type_isNil(resizingStartUIModel)) {
|
|
18008
18008
|
return null;
|
|
18009
18009
|
}
|
|
18010
|
-
/**
|
|
18011
|
-
* Filter UIModels that are made from the target event.
|
|
18010
|
+
/**
|
|
18011
|
+
* Filter UIModels that are made from the target event.
|
|
18012
18012
|
*/
|
|
18013
18013
|
|
|
18014
18014
|
|
|
@@ -18086,8 +18086,8 @@ function useDayGridMonthEventResize(_ref) {
|
|
|
18086
18086
|
}, [canCalculateProps, currentGridPos, baseResizingInfo, rowIndex]);
|
|
18087
18087
|
useWhen(() => {
|
|
18088
18088
|
if (canCalculateProps) {
|
|
18089
|
-
/**
|
|
18090
|
-
* Is current grid position is the same or later comparing to the position of the start date?
|
|
18089
|
+
/**
|
|
18090
|
+
* Is current grid position is the same or later comparing to the position of the start date?
|
|
18091
18091
|
*/
|
|
18092
18092
|
const {
|
|
18093
18093
|
eventStartDateColumnIndex,
|
|
@@ -18607,140 +18607,140 @@ class EventBusImpl extends (customEvents_default()) {
|
|
|
18607
18607
|
|
|
18608
18608
|
|
|
18609
18609
|
|
|
18610
|
-
/**
|
|
18611
|
-
* {@link https://nhn.github.io/tui.code-snippet/latest/CustomEvents CustomEvents} document at {@link https://github.com/nhn/tui.code-snippet tui-code-snippet}
|
|
18612
|
-
* @typedef {CustomEvents} CustomEvents
|
|
18610
|
+
/**
|
|
18611
|
+
* {@link https://nhn.github.io/tui.code-snippet/latest/CustomEvents CustomEvents} document at {@link https://github.com/nhn/tui.code-snippet tui-code-snippet}
|
|
18612
|
+
* @typedef {CustomEvents} CustomEvents
|
|
18613
18613
|
*/
|
|
18614
18614
|
|
|
18615
|
-
/**
|
|
18616
|
-
* Define Calendars to group events.
|
|
18617
|
-
*
|
|
18618
|
-
* @typedef {object} CalendarInfo
|
|
18619
|
-
* @property {string} id - Calendar id.
|
|
18620
|
-
* @property {string} name - Calendar name.
|
|
18621
|
-
* @property {string} color - Text color of events.
|
|
18622
|
-
* @property {string} borderColor - Left border color of events.
|
|
18623
|
-
* @property {string} backgroundColor - Background color of events.
|
|
18624
|
-
* @property {string} dragBackgroundColor - Background color of events during dragging.
|
|
18615
|
+
/**
|
|
18616
|
+
* Define Calendars to group events.
|
|
18617
|
+
*
|
|
18618
|
+
* @typedef {object} CalendarInfo
|
|
18619
|
+
* @property {string} id - Calendar id.
|
|
18620
|
+
* @property {string} name - Calendar name.
|
|
18621
|
+
* @property {string} color - Text color of events.
|
|
18622
|
+
* @property {string} borderColor - Left border color of events.
|
|
18623
|
+
* @property {string} backgroundColor - Background color of events.
|
|
18624
|
+
* @property {string} dragBackgroundColor - Background color of events during dragging.
|
|
18625
18625
|
*/
|
|
18626
18626
|
|
|
18627
|
-
/**
|
|
18628
|
-
* Timezone options of the calendar instance.
|
|
18629
|
-
*
|
|
18630
|
-
* For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md#timezone|Timezone options} in guide.
|
|
18631
|
-
*
|
|
18632
|
-
* @typedef {object} TimezoneOptions
|
|
18633
|
-
* @example
|
|
18634
|
-
* const calendar = new Calendar('#container', {
|
|
18635
|
-
* timezone: {
|
|
18636
|
-
* // @property {string} zones[].timezoneName - Timezone name. it should be one of IANA timezone names.
|
|
18637
|
-
* // @property {string} [zones[].displayLabel] - Display label of timezone.
|
|
18638
|
-
* // @property {string} [zones[].tooltip] - Tooltip of the element of the display label.
|
|
18639
|
-
* zones: [
|
|
18640
|
-
* {
|
|
18641
|
-
* timezoneName: 'Asia/Seoul',
|
|
18642
|
-
* displayLabel: 'UTC+9:00',
|
|
18643
|
-
* tooltip: 'Seoul'
|
|
18644
|
-
* },
|
|
18645
|
-
* {
|
|
18646
|
-
* timezoneName: 'Europe/London',
|
|
18647
|
-
* displayLabel: 'UTC+1:00',
|
|
18648
|
-
* tooltip: 'BST'
|
|
18649
|
-
* }
|
|
18650
|
-
* ],
|
|
18651
|
-
* // This function will be called for rendering components for each timezone.
|
|
18652
|
-
* // You don't have to use it if you're able to `Intl.DateTimeFormat` API with `timeZone` option.
|
|
18653
|
-
* // this function should return timezone offset from UTC.
|
|
18654
|
-
* // for instance, using moment-timezone:
|
|
18655
|
-
* customOffsetCalculator: (timezoneName, timestamp) => {
|
|
18656
|
-
* return moment.tz(timezoneName).utcOffset(timestamp);
|
|
18657
|
-
* }
|
|
18658
|
-
* }
|
|
18659
|
-
* });
|
|
18660
|
-
* @property {Array.<object>} zones - Timezone data.
|
|
18661
|
-
* @property {string} zones[].timezoneName - Timezone name. it should be one of IANA timezone names.
|
|
18662
|
-
* @property {string} [zones[].displayLabel] - Display label of timezone.
|
|
18663
|
-
* @property {string} [zones[].tooltip] - Tooltip of the element of the display label.
|
|
18664
|
-
* @property {function} customOffsetCalculator - Custom offset calculator when you're not able to leverage `Intl.DateTimeFormat` API.
|
|
18627
|
+
/**
|
|
18628
|
+
* Timezone options of the calendar instance.
|
|
18629
|
+
*
|
|
18630
|
+
* For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md#timezone|Timezone options} in guide.
|
|
18631
|
+
*
|
|
18632
|
+
* @typedef {object} TimezoneOptions
|
|
18633
|
+
* @example
|
|
18634
|
+
* const calendar = new Calendar('#container', {
|
|
18635
|
+
* timezone: {
|
|
18636
|
+
* // @property {string} zones[].timezoneName - Timezone name. it should be one of IANA timezone names.
|
|
18637
|
+
* // @property {string} [zones[].displayLabel] - Display label of timezone.
|
|
18638
|
+
* // @property {string} [zones[].tooltip] - Tooltip of the element of the display label.
|
|
18639
|
+
* zones: [
|
|
18640
|
+
* {
|
|
18641
|
+
* timezoneName: 'Asia/Seoul',
|
|
18642
|
+
* displayLabel: 'UTC+9:00',
|
|
18643
|
+
* tooltip: 'Seoul'
|
|
18644
|
+
* },
|
|
18645
|
+
* {
|
|
18646
|
+
* timezoneName: 'Europe/London',
|
|
18647
|
+
* displayLabel: 'UTC+1:00',
|
|
18648
|
+
* tooltip: 'BST'
|
|
18649
|
+
* }
|
|
18650
|
+
* ],
|
|
18651
|
+
* // This function will be called for rendering components for each timezone.
|
|
18652
|
+
* // You don't have to use it if you're able to `Intl.DateTimeFormat` API with `timeZone` option.
|
|
18653
|
+
* // this function should return timezone offset from UTC.
|
|
18654
|
+
* // for instance, using moment-timezone:
|
|
18655
|
+
* customOffsetCalculator: (timezoneName, timestamp) => {
|
|
18656
|
+
* return moment.tz(timezoneName).utcOffset(timestamp);
|
|
18657
|
+
* }
|
|
18658
|
+
* }
|
|
18659
|
+
* });
|
|
18660
|
+
* @property {Array.<object>} zones - Timezone data.
|
|
18661
|
+
* @property {string} zones[].timezoneName - Timezone name. it should be one of IANA timezone names.
|
|
18662
|
+
* @property {string} [zones[].displayLabel] - Display label of timezone.
|
|
18663
|
+
* @property {string} [zones[].tooltip] - Tooltip of the element of the display label.
|
|
18664
|
+
* @property {function} customOffsetCalculator - Custom offset calculator when you're not able to leverage `Intl.DateTimeFormat` API.
|
|
18665
18665
|
*/
|
|
18666
18666
|
|
|
18667
|
-
/**
|
|
18668
|
-
* Object to create/modify events.
|
|
18669
|
-
* @typedef {object} EventObject
|
|
18670
|
-
* @property {string} [id] - Event id.
|
|
18671
|
-
* @property {string} [calendarId] - Calendar id.
|
|
18672
|
-
* @property {string} [title] - Event title.
|
|
18673
|
-
* @property {string} [body] - Body content of the event.
|
|
18674
|
-
* @property {string} [isAllday] - Whether the event is all day or not.
|
|
18675
|
-
* @property {string|number|Date|TZDate} [start] - Start time of the event.
|
|
18676
|
-
* @property {string|number|Date|TZDate} [end] - End time of the event.
|
|
18677
|
-
* @property {number} [goingDuration] - Travel time which is taken to go in minutes.
|
|
18678
|
-
* @property {number} [comingDuration] - Travel time which is taken to come back in minutes.
|
|
18679
|
-
* @property {string} [location] - Location of the event.
|
|
18680
|
-
* @property {Array.<string>} [attendees] - Attendees of the event.
|
|
18681
|
-
* @property {string} [category] - Category of the event. Available categories are 'milestone', 'task', 'time' and 'allday'.
|
|
18682
|
-
* @property {string} [dueDateClass] - Classification of work events. (before work, before lunch, before work)
|
|
18683
|
-
* @property {string} [recurrenceRule] - Recurrence rule of the event.
|
|
18684
|
-
* @property {string} [state] - State of the event. Available states are 'Busy', 'Free'.
|
|
18685
|
-
* @property {boolean} [isVisible] - Whether the event is visible or not.
|
|
18686
|
-
* @property {boolean} [isPending] - Whether the event is pending or not.
|
|
18687
|
-
* @property {boolean} [isFocused] - Whether the event is focused or not.
|
|
18688
|
-
* @property {boolean} [isReadOnly] - Whether the event is read only or not.
|
|
18689
|
-
* @property {boolean} [isPrivate] - Whether the event is private or not.
|
|
18690
|
-
* @property {string} [color] - Text color of the event.
|
|
18691
|
-
* @property {string} [backgroundColor] - Background color of the event.
|
|
18692
|
-
* @property {string} [dragBackgroundColor] - Background color of the event during dragging.
|
|
18693
|
-
* @property {string} [borderColor] - Left border color of the event.
|
|
18694
|
-
* @property {object} [customStyle] - Custom style of the event. The key of CSS property should be camelCase (e.g. {'fontSize': '12px'})
|
|
18695
|
-
* @property {*} [raw] - Raw data of the event. it's an arbitrary property for anything.
|
|
18667
|
+
/**
|
|
18668
|
+
* Object to create/modify events.
|
|
18669
|
+
* @typedef {object} EventObject
|
|
18670
|
+
* @property {string} [id] - Event id.
|
|
18671
|
+
* @property {string} [calendarId] - Calendar id.
|
|
18672
|
+
* @property {string} [title] - Event title.
|
|
18673
|
+
* @property {string} [body] - Body content of the event.
|
|
18674
|
+
* @property {string} [isAllday] - Whether the event is all day or not.
|
|
18675
|
+
* @property {string|number|Date|TZDate} [start] - Start time of the event.
|
|
18676
|
+
* @property {string|number|Date|TZDate} [end] - End time of the event.
|
|
18677
|
+
* @property {number} [goingDuration] - Travel time which is taken to go in minutes.
|
|
18678
|
+
* @property {number} [comingDuration] - Travel time which is taken to come back in minutes.
|
|
18679
|
+
* @property {string} [location] - Location of the event.
|
|
18680
|
+
* @property {Array.<string>} [attendees] - Attendees of the event.
|
|
18681
|
+
* @property {string} [category] - Category of the event. Available categories are 'milestone', 'task', 'time' and 'allday'.
|
|
18682
|
+
* @property {string} [dueDateClass] - Classification of work events. (before work, before lunch, before work)
|
|
18683
|
+
* @property {string} [recurrenceRule] - Recurrence rule of the event.
|
|
18684
|
+
* @property {string} [state] - State of the event. Available states are 'Busy', 'Free'.
|
|
18685
|
+
* @property {boolean} [isVisible] - Whether the event is visible or not.
|
|
18686
|
+
* @property {boolean} [isPending] - Whether the event is pending or not.
|
|
18687
|
+
* @property {boolean} [isFocused] - Whether the event is focused or not.
|
|
18688
|
+
* @property {boolean} [isReadOnly] - Whether the event is read only or not.
|
|
18689
|
+
* @property {boolean} [isPrivate] - Whether the event is private or not.
|
|
18690
|
+
* @property {string} [color] - Text color of the event.
|
|
18691
|
+
* @property {string} [backgroundColor] - Background color of the event.
|
|
18692
|
+
* @property {string} [dragBackgroundColor] - Background color of the event during dragging.
|
|
18693
|
+
* @property {string} [borderColor] - Left border color of the event.
|
|
18694
|
+
* @property {object} [customStyle] - Custom style of the event. The key of CSS property should be camelCase (e.g. {'fontSize': '12px'})
|
|
18695
|
+
* @property {*} [raw] - Raw data of the event. it's an arbitrary property for anything.
|
|
18696
18696
|
*/
|
|
18697
18697
|
|
|
18698
|
-
/**
|
|
18699
|
-
* CalendarCore class
|
|
18700
|
-
*
|
|
18701
|
-
* @class CalendarCore
|
|
18702
|
-
* @mixes CustomEvents
|
|
18703
|
-
* @param {string|Element} container - container element or selector.
|
|
18704
|
-
* @param {object} options - calendar options. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/calendar.md|Calendar options} in guide.
|
|
18705
|
-
* @param {string} [options.defaultView="week"] - Initial view type. Available values are: 'day', 'week', 'month'.
|
|
18706
|
-
* @param {boolean} [options.useFormPopup=false] - Whether to use the default form popup when creating/modifying events.
|
|
18707
|
-
* @param {boolean} [options.useDetailPopup=false] - Whether to use the default detail popup when clicking events.
|
|
18708
|
-
* @param {boolean} [options.isReadOnly=false] - Whether the calendar is read-only.
|
|
18709
|
-
* @param {boolean} [options.usageStatistics=true] - Whether to allow collect hostname and send the information to google analytics.
|
|
18710
|
-
* For more information, check out the {@link https://github.com/nhn/tui.calendar/blob/main/apps/calendar/README.md#collect-statistics-on-the-use-of-open-source|documentation}.
|
|
18711
|
-
* @param {function} [options.eventFilter] - A function that returns true if the event should be displayed. The default filter checks if the event's `isVisible` property is true.
|
|
18712
|
-
* @param {object} [options.week] - Week option of the calendar instance.
|
|
18713
|
-
* @param {number} [options.week.startDayOfWeek=0] - Start day of the week. Available values are 0 (Sunday) to 6 (Saturday).
|
|
18714
|
-
* @param {Array.<string>} [options.week.dayNames] - Names of days of the week. Should be 7 items starting from Sunday to Saturday. If not specified, the default names are used.
|
|
18715
|
-
* Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].
|
|
18716
|
-
* @param {boolean} [options.week.workweek=false] - Whether to exclude Saturday and Sunday.
|
|
18717
|
-
* @param {boolean} [options.week.showTimezoneCollapseButton=true] - Whether to show the timezone collapse button.
|
|
18718
|
-
* @param {boolean} [options.week.timezonesCollapsed=false] - Whether to collapse the timezones.
|
|
18719
|
-
* @param {number} [options.week.hourStart=0] - Start hour of the day. Available values are 0 to 24.
|
|
18720
|
-
* @param {number} [options.week.hourEnd=24] - End hour of the day. Available values are 0 to 24. Must be greater than `hourStart`.
|
|
18721
|
-
* @param {boolean} [options.week.narrowWeekend=false] - Whether to narrow down width of weekends to half.
|
|
18722
|
-
* @param {boolean|Array.<string>} [options.week.eventView=true] - Determine which view to display events. Available values are 'allday' and 'time'. set to `false` to disable event view.
|
|
18723
|
-
* @param {boolean|Array.<string>} [options.week.taskView=true] - Determine which view to display tasks. Available values are 'milestone' and 'task'. set to `false` to disable task view.
|
|
18724
|
-
* @param {boolean|object} [options.week.collapseDuplicateEvents=false] - Whether to collapse duplicate events. If you want to filter duplicate events and choose the main event based on your requirements, set `getDuplicateEvents` and `getMainEvent`. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md#weekcollapseduplicateevents|Options} in guide.
|
|
18725
|
-
* @param {object} options.month - Month option of the calendar instance.
|
|
18726
|
-
* @param {number} [options.month.startDayOfWeek=0] - Start day of the week. Available values are 0 (Sunday) to 6 (Saturday).
|
|
18727
|
-
* @param {Array.<string>} [options.month.dayNames] - Names of days of the week. Should be 7 items starting from Sunday to Saturday. If not specified, the default names are used.
|
|
18728
|
-
* Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].
|
|
18729
|
-
* @param {boolean} [options.month.workweek=false] - Whether to exclude Saturday and Sunday.
|
|
18730
|
-
* @param {boolean} [options.month.narrowWeekend=false] - Whether to narrow down width of weekends to half.
|
|
18731
|
-
* @param {number} [options.month.visibleWeeksCount=0] - Number of weeks to display. 0 means display all weeks.
|
|
18732
|
-
* @param {Array.<CalendarInfo>} [options.calendars] - Calendars to group events.
|
|
18733
|
-
* @param {boolean|object} [options.gridSelection=true] - Whether to enable grid selection. or it's option. it's enabled when the value is `true` and object and will be disabled when `isReadOnly` is true.
|
|
18734
|
-
* @param {boolean} options.gridSelection.enableDbClick - Whether to enable double click to select area.
|
|
18735
|
-
* @param {boolean} options.gridSelection.enableClick - Whether to enable click to select area.
|
|
18736
|
-
* @param {TimezoneOptions} options.timezone - Timezone option of the calendar instance. For more information about timezone, check out the {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md|Options} in guide.
|
|
18737
|
-
* @param {Theme} options.theme - Theme option of the calendar instance. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/theme.md|Theme} in guide.
|
|
18738
|
-
* @param {TemplateConfig} options.template - Template option of the calendar instance. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/template.md|Template} in guide.
|
|
18698
|
+
/**
|
|
18699
|
+
* CalendarCore class
|
|
18700
|
+
*
|
|
18701
|
+
* @class CalendarCore
|
|
18702
|
+
* @mixes CustomEvents
|
|
18703
|
+
* @param {string|Element} container - container element or selector.
|
|
18704
|
+
* @param {object} options - calendar options. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/calendar.md|Calendar options} in guide.
|
|
18705
|
+
* @param {string} [options.defaultView="week"] - Initial view type. Available values are: 'day', 'week', 'month'.
|
|
18706
|
+
* @param {boolean} [options.useFormPopup=false] - Whether to use the default form popup when creating/modifying events.
|
|
18707
|
+
* @param {boolean} [options.useDetailPopup=false] - Whether to use the default detail popup when clicking events.
|
|
18708
|
+
* @param {boolean} [options.isReadOnly=false] - Whether the calendar is read-only.
|
|
18709
|
+
* @param {boolean} [options.usageStatistics=true] - Whether to allow collect hostname and send the information to google analytics.
|
|
18710
|
+
* For more information, check out the {@link https://github.com/nhn/tui.calendar/blob/main/apps/calendar/README.md#collect-statistics-on-the-use-of-open-source|documentation}.
|
|
18711
|
+
* @param {function} [options.eventFilter] - A function that returns true if the event should be displayed. The default filter checks if the event's `isVisible` property is true.
|
|
18712
|
+
* @param {object} [options.week] - Week option of the calendar instance.
|
|
18713
|
+
* @param {number} [options.week.startDayOfWeek=0] - Start day of the week. Available values are 0 (Sunday) to 6 (Saturday).
|
|
18714
|
+
* @param {Array.<string>} [options.week.dayNames] - Names of days of the week. Should be 7 items starting from Sunday to Saturday. If not specified, the default names are used.
|
|
18715
|
+
* Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].
|
|
18716
|
+
* @param {boolean} [options.week.workweek=false] - Whether to exclude Saturday and Sunday.
|
|
18717
|
+
* @param {boolean} [options.week.showTimezoneCollapseButton=true] - Whether to show the timezone collapse button.
|
|
18718
|
+
* @param {boolean} [options.week.timezonesCollapsed=false] - Whether to collapse the timezones.
|
|
18719
|
+
* @param {number} [options.week.hourStart=0] - Start hour of the day. Available values are 0 to 24.
|
|
18720
|
+
* @param {number} [options.week.hourEnd=24] - End hour of the day. Available values are 0 to 24. Must be greater than `hourStart`.
|
|
18721
|
+
* @param {boolean} [options.week.narrowWeekend=false] - Whether to narrow down width of weekends to half.
|
|
18722
|
+
* @param {boolean|Array.<string>} [options.week.eventView=true] - Determine which view to display events. Available values are 'allday' and 'time'. set to `false` to disable event view.
|
|
18723
|
+
* @param {boolean|Array.<string>} [options.week.taskView=true] - Determine which view to display tasks. Available values are 'milestone' and 'task'. set to `false` to disable task view.
|
|
18724
|
+
* @param {boolean|object} [options.week.collapseDuplicateEvents=false] - Whether to collapse duplicate events. If you want to filter duplicate events and choose the main event based on your requirements, set `getDuplicateEvents` and `getMainEvent`. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md#weekcollapseduplicateevents|Options} in guide.
|
|
18725
|
+
* @param {object} options.month - Month option of the calendar instance.
|
|
18726
|
+
* @param {number} [options.month.startDayOfWeek=0] - Start day of the week. Available values are 0 (Sunday) to 6 (Saturday).
|
|
18727
|
+
* @param {Array.<string>} [options.month.dayNames] - Names of days of the week. Should be 7 items starting from Sunday to Saturday. If not specified, the default names are used.
|
|
18728
|
+
* Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].
|
|
18729
|
+
* @param {boolean} [options.month.workweek=false] - Whether to exclude Saturday and Sunday.
|
|
18730
|
+
* @param {boolean} [options.month.narrowWeekend=false] - Whether to narrow down width of weekends to half.
|
|
18731
|
+
* @param {number} [options.month.visibleWeeksCount=0] - Number of weeks to display. 0 means display all weeks.
|
|
18732
|
+
* @param {Array.<CalendarInfo>} [options.calendars] - Calendars to group events.
|
|
18733
|
+
* @param {boolean|object} [options.gridSelection=true] - Whether to enable grid selection. or it's option. it's enabled when the value is `true` and object and will be disabled when `isReadOnly` is true.
|
|
18734
|
+
* @param {boolean} options.gridSelection.enableDbClick - Whether to enable double click to select area.
|
|
18735
|
+
* @param {boolean} options.gridSelection.enableClick - Whether to enable click to select area.
|
|
18736
|
+
* @param {TimezoneOptions} options.timezone - Timezone option of the calendar instance. For more information about timezone, check out the {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md|Options} in guide.
|
|
18737
|
+
* @param {Theme} options.theme - Theme option of the calendar instance. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/theme.md|Theme} in guide.
|
|
18738
|
+
* @param {TemplateConfig} options.template - Template option of the calendar instance. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/template.md|Template} in guide.
|
|
18739
18739
|
*/
|
|
18740
18740
|
class CalendarCore {
|
|
18741
|
-
/**
|
|
18742
|
-
* start and end date of weekly, monthly
|
|
18743
|
-
* @private
|
|
18741
|
+
/**
|
|
18742
|
+
* start and end date of weekly, monthly
|
|
18743
|
+
* @private
|
|
18744
18744
|
*/
|
|
18745
18745
|
constructor(container) {
|
|
18746
18746
|
var _document$querySelect, _document;
|
|
@@ -18768,8 +18768,8 @@ class CalendarCore {
|
|
|
18768
18768
|
const dispatchers = this.store.getState().dispatch;
|
|
18769
18769
|
return group ? dispatchers[group] : dispatchers;
|
|
18770
18770
|
}
|
|
18771
|
-
/**
|
|
18772
|
-
* Destroys the instance.
|
|
18771
|
+
/**
|
|
18772
|
+
* Destroys the instance.
|
|
18773
18773
|
*/
|
|
18774
18774
|
|
|
18775
18775
|
|
|
@@ -18856,27 +18856,27 @@ class CalendarCore {
|
|
|
18856
18856
|
}
|
|
18857
18857
|
};
|
|
18858
18858
|
}
|
|
18859
|
-
/**
|
|
18860
|
-
* Move the rendered date to the next/prev range.
|
|
18861
|
-
*
|
|
18862
|
-
* The range of movement differs depending on the current view, Basically:
|
|
18863
|
-
* - In month view, it moves to the next/prev month.
|
|
18864
|
-
* - In week view, it moves to the next/prev week.
|
|
18865
|
-
* - In day view, it moves to the next/prev day.
|
|
18866
|
-
*
|
|
18867
|
-
* Also, the range depends on the options like how many visible weeks/months should be rendered.
|
|
18868
|
-
*
|
|
18869
|
-
* @param {number} offset The offset to move by.
|
|
18870
|
-
*
|
|
18871
|
-
* @example
|
|
18872
|
-
* // Move to the next month in month view.
|
|
18873
|
-
* calendar.move(1);
|
|
18874
|
-
*
|
|
18875
|
-
* // Move to the next year in month view.
|
|
18876
|
-
* calendar.move(12);
|
|
18877
|
-
*
|
|
18878
|
-
* // Move to yesterday in day view.
|
|
18879
|
-
* calendar.move(-1);
|
|
18859
|
+
/**
|
|
18860
|
+
* Move the rendered date to the next/prev range.
|
|
18861
|
+
*
|
|
18862
|
+
* The range of movement differs depending on the current view, Basically:
|
|
18863
|
+
* - In month view, it moves to the next/prev month.
|
|
18864
|
+
* - In week view, it moves to the next/prev week.
|
|
18865
|
+
* - In day view, it moves to the next/prev day.
|
|
18866
|
+
*
|
|
18867
|
+
* Also, the range depends on the options like how many visible weeks/months should be rendered.
|
|
18868
|
+
*
|
|
18869
|
+
* @param {number} offset The offset to move by.
|
|
18870
|
+
*
|
|
18871
|
+
* @example
|
|
18872
|
+
* // Move to the next month in month view.
|
|
18873
|
+
* calendar.move(1);
|
|
18874
|
+
*
|
|
18875
|
+
* // Move to the next year in month view.
|
|
18876
|
+
* calendar.move(12);
|
|
18877
|
+
*
|
|
18878
|
+
* // Move to yesterday in day view.
|
|
18879
|
+
* calendar.move(-1);
|
|
18880
18880
|
*/
|
|
18881
18881
|
|
|
18882
18882
|
|
|
@@ -18926,34 +18926,34 @@ class CalendarCore {
|
|
|
18926
18926
|
setRenderDate(calculatedRenderDate.renderDate);
|
|
18927
18927
|
this.renderRange = calculatedRenderDate.renderRange;
|
|
18928
18928
|
}
|
|
18929
|
-
/**********
|
|
18930
|
-
* CRUD Methods
|
|
18929
|
+
/**********
|
|
18930
|
+
* CRUD Methods
|
|
18931
18931
|
**********/
|
|
18932
18932
|
|
|
18933
|
-
/**
|
|
18934
|
-
* Create events and render calendar.
|
|
18935
|
-
* @param {Array.<EventObject>} events - list of {@link EventObject}
|
|
18936
|
-
* @example
|
|
18937
|
-
* calendar.createEvents([
|
|
18938
|
-
* {
|
|
18939
|
-
* id: '1',
|
|
18940
|
-
* calendarId: '1',
|
|
18941
|
-
* title: 'my event',
|
|
18942
|
-
* category: 'time',
|
|
18943
|
-
* dueDateClass: '',
|
|
18944
|
-
* start: '2018-01-18T22:30:00+09:00',
|
|
18945
|
-
* end: '2018-01-19T02:30:00+09:00',
|
|
18946
|
-
* },
|
|
18947
|
-
* {
|
|
18948
|
-
* id: '2',
|
|
18949
|
-
* calendarId: '1',
|
|
18950
|
-
* title: 'second event',
|
|
18951
|
-
* category: 'time',
|
|
18952
|
-
* dueDateClass: '',
|
|
18953
|
-
* start: '2018-01-18T17:30:00+09:00',
|
|
18954
|
-
* end: '2018-01-19T17:31:00+09:00',
|
|
18955
|
-
* },
|
|
18956
|
-
* ]);
|
|
18933
|
+
/**
|
|
18934
|
+
* Create events and render calendar.
|
|
18935
|
+
* @param {Array.<EventObject>} events - list of {@link EventObject}
|
|
18936
|
+
* @example
|
|
18937
|
+
* calendar.createEvents([
|
|
18938
|
+
* {
|
|
18939
|
+
* id: '1',
|
|
18940
|
+
* calendarId: '1',
|
|
18941
|
+
* title: 'my event',
|
|
18942
|
+
* category: 'time',
|
|
18943
|
+
* dueDateClass: '',
|
|
18944
|
+
* start: '2018-01-18T22:30:00+09:00',
|
|
18945
|
+
* end: '2018-01-19T02:30:00+09:00',
|
|
18946
|
+
* },
|
|
18947
|
+
* {
|
|
18948
|
+
* id: '2',
|
|
18949
|
+
* calendarId: '1',
|
|
18950
|
+
* title: 'second event',
|
|
18951
|
+
* category: 'time',
|
|
18952
|
+
* dueDateClass: '',
|
|
18953
|
+
* start: '2018-01-18T17:30:00+09:00',
|
|
18954
|
+
* end: '2018-01-19T17:31:00+09:00',
|
|
18955
|
+
* },
|
|
18956
|
+
* ]);
|
|
18957
18957
|
*/
|
|
18958
18958
|
|
|
18959
18959
|
|
|
@@ -18976,17 +18976,17 @@ class CalendarCore {
|
|
|
18976
18976
|
return id === eventId && eventCalendarId === calendarId;
|
|
18977
18977
|
});
|
|
18978
18978
|
}
|
|
18979
|
-
/**
|
|
18980
|
-
* Get an {@link EventObject} with event's id and calendar's id.
|
|
18981
|
-
*
|
|
18982
|
-
* @param {string} eventId - event's id
|
|
18983
|
-
* @param {string} calendarId - calendar's id of the event
|
|
18984
|
-
* @returns {EventObject|null} event. If the event can't be found, it returns null.
|
|
18985
|
-
*
|
|
18986
|
-
* @example
|
|
18987
|
-
* const event = calendar.getEvent(eventId, calendarId);
|
|
18988
|
-
*
|
|
18989
|
-
* console.log(event.title);
|
|
18979
|
+
/**
|
|
18980
|
+
* Get an {@link EventObject} with event's id and calendar's id.
|
|
18981
|
+
*
|
|
18982
|
+
* @param {string} eventId - event's id
|
|
18983
|
+
* @param {string} calendarId - calendar's id of the event
|
|
18984
|
+
* @returns {EventObject|null} event. If the event can't be found, it returns null.
|
|
18985
|
+
*
|
|
18986
|
+
* @example
|
|
18987
|
+
* const event = calendar.getEvent(eventId, calendarId);
|
|
18988
|
+
*
|
|
18989
|
+
* console.log(event.title);
|
|
18990
18990
|
*/
|
|
18991
18991
|
|
|
18992
18992
|
|
|
@@ -18995,19 +18995,19 @@ class CalendarCore {
|
|
|
18995
18995
|
|
|
18996
18996
|
return (_this$getEventModel$t = (_this$getEventModel = this.getEventModel(eventId, calendarId)) === null || _this$getEventModel === void 0 ? void 0 : _this$getEventModel.toEventObject()) !== null && _this$getEventModel$t !== void 0 ? _this$getEventModel$t : null;
|
|
18997
18997
|
}
|
|
18998
|
-
/**
|
|
18999
|
-
* Update an event.
|
|
19000
|
-
*
|
|
19001
|
-
* @param {string} eventId - ID of an event to update
|
|
19002
|
-
* @param {string} calendarId - The calendarId of the event to update
|
|
19003
|
-
* @param {EventObject} changes - The new {@link EventObject} data to apply to the event
|
|
19004
|
-
*
|
|
19005
|
-
* @example
|
|
19006
|
-
* calendar.on('beforeUpdateEvent', function ({ event, changes }) {
|
|
19007
|
-
* const { id, calendarId } = event;
|
|
19008
|
-
*
|
|
19009
|
-
* calendar.updateEvent(id, calendarId, changes);
|
|
19010
|
-
* });
|
|
18998
|
+
/**
|
|
18999
|
+
* Update an event.
|
|
19000
|
+
*
|
|
19001
|
+
* @param {string} eventId - ID of an event to update
|
|
19002
|
+
* @param {string} calendarId - The calendarId of the event to update
|
|
19003
|
+
* @param {EventObject} changes - The new {@link EventObject} data to apply to the event
|
|
19004
|
+
*
|
|
19005
|
+
* @example
|
|
19006
|
+
* calendar.on('beforeUpdateEvent', function ({ event, changes }) {
|
|
19007
|
+
* const { id, calendarId } = event;
|
|
19008
|
+
*
|
|
19009
|
+
* calendar.updateEvent(id, calendarId, changes);
|
|
19010
|
+
* });
|
|
19011
19011
|
*/
|
|
19012
19012
|
|
|
19013
19013
|
|
|
@@ -19024,11 +19024,11 @@ class CalendarCore {
|
|
|
19024
19024
|
});
|
|
19025
19025
|
}
|
|
19026
19026
|
}
|
|
19027
|
-
/**
|
|
19028
|
-
* Delete an event.
|
|
19029
|
-
*
|
|
19030
|
-
* @param {string} eventId - event's id to delete
|
|
19031
|
-
* @param {string} calendarId - The CalendarId of the event to delete
|
|
19027
|
+
/**
|
|
19028
|
+
* Delete an event.
|
|
19029
|
+
*
|
|
19030
|
+
* @param {string} eventId - event's id to delete
|
|
19031
|
+
* @param {string} calendarId - The CalendarId of the event to delete
|
|
19032
19032
|
*/
|
|
19033
19033
|
|
|
19034
19034
|
|
|
@@ -19042,15 +19042,15 @@ class CalendarCore {
|
|
|
19042
19042
|
deleteEvent(event);
|
|
19043
19043
|
}
|
|
19044
19044
|
}
|
|
19045
|
-
/**********
|
|
19046
|
-
* General Methods
|
|
19045
|
+
/**********
|
|
19046
|
+
* General Methods
|
|
19047
19047
|
**********/
|
|
19048
19048
|
|
|
19049
|
-
/**
|
|
19050
|
-
* Set events' visibility by calendar ID
|
|
19051
|
-
*
|
|
19052
|
-
* @param {string|Array.<string>} calendarId - The calendar id or ids to change visibility
|
|
19053
|
-
* @param {boolean} isVisible - If set to true, show the events. If set to false, hide the events.
|
|
19049
|
+
/**
|
|
19050
|
+
* Set events' visibility by calendar ID
|
|
19051
|
+
*
|
|
19052
|
+
* @param {string|Array.<string>} calendarId - The calendar id or ids to change visibility
|
|
19053
|
+
* @param {boolean} isVisible - If set to true, show the events. If set to false, hide the events.
|
|
19054
19054
|
*/
|
|
19055
19055
|
|
|
19056
19056
|
|
|
@@ -19061,17 +19061,17 @@ class CalendarCore {
|
|
|
19061
19061
|
const calendarIds = Array.isArray(calendarId) ? calendarId : [calendarId];
|
|
19062
19062
|
setCalendarVisibility(calendarIds, isVisible);
|
|
19063
19063
|
}
|
|
19064
|
-
/**
|
|
19065
|
-
* Render the calendar.
|
|
19066
|
-
*
|
|
19067
|
-
* @example
|
|
19068
|
-
* calendar.render();
|
|
19069
|
-
*
|
|
19070
|
-
* @example
|
|
19071
|
-
* // Re-render the calendar when resizing a window.
|
|
19072
|
-
* window.addEventListener('resize', () => {
|
|
19073
|
-
* calendar.render();
|
|
19074
|
-
* });
|
|
19064
|
+
/**
|
|
19065
|
+
* Render the calendar.
|
|
19066
|
+
*
|
|
19067
|
+
* @example
|
|
19068
|
+
* calendar.render();
|
|
19069
|
+
*
|
|
19070
|
+
* @example
|
|
19071
|
+
* // Re-render the calendar when resizing a window.
|
|
19072
|
+
* window.addEventListener('resize', () => {
|
|
19073
|
+
* calendar.render();
|
|
19074
|
+
* });
|
|
19075
19075
|
*/
|
|
19076
19076
|
|
|
19077
19077
|
|
|
@@ -19086,10 +19086,10 @@ class CalendarCore {
|
|
|
19086
19086
|
|
|
19087
19087
|
return this;
|
|
19088
19088
|
}
|
|
19089
|
-
/**
|
|
19090
|
-
* For SSR(Server Side Rendering), Return the HTML string of the whole calendar.
|
|
19091
|
-
*
|
|
19092
|
-
* @returns {string} HTML string
|
|
19089
|
+
/**
|
|
19090
|
+
* For SSR(Server Side Rendering), Return the HTML string of the whole calendar.
|
|
19091
|
+
*
|
|
19092
|
+
* @returns {string} HTML string
|
|
19093
19093
|
*/
|
|
19094
19094
|
|
|
19095
19095
|
|
|
@@ -19100,11 +19100,11 @@ class CalendarCore {
|
|
|
19100
19100
|
eventBus: this.eventBus
|
|
19101
19101
|
}, this.getComponent()));
|
|
19102
19102
|
}
|
|
19103
|
-
/**
|
|
19104
|
-
* Delete all events and clear view
|
|
19105
|
-
*
|
|
19106
|
-
* @example
|
|
19107
|
-
* calendar.clear();
|
|
19103
|
+
/**
|
|
19104
|
+
* Delete all events and clear view
|
|
19105
|
+
*
|
|
19106
|
+
* @example
|
|
19107
|
+
* calendar.clear();
|
|
19108
19108
|
*/
|
|
19109
19109
|
|
|
19110
19110
|
|
|
@@ -19114,15 +19114,15 @@ class CalendarCore {
|
|
|
19114
19114
|
} = this.getStoreDispatchers('calendar');
|
|
19115
19115
|
clearEvents();
|
|
19116
19116
|
}
|
|
19117
|
-
/**
|
|
19118
|
-
* Scroll to current time on today in case of daily, weekly view.
|
|
19119
|
-
* Nothing happens in the monthly view.
|
|
19120
|
-
*
|
|
19121
|
-
* @example
|
|
19122
|
-
* function onNewEvents(events) {
|
|
19123
|
-
* calendar.createEvents(events);
|
|
19124
|
-
* calendar.scrollToNow('smooth');
|
|
19125
|
-
* }
|
|
19117
|
+
/**
|
|
19118
|
+
* Scroll to current time on today in case of daily, weekly view.
|
|
19119
|
+
* Nothing happens in the monthly view.
|
|
19120
|
+
*
|
|
19121
|
+
* @example
|
|
19122
|
+
* function onNewEvents(events) {
|
|
19123
|
+
* calendar.createEvents(events);
|
|
19124
|
+
* calendar.scrollToNow('smooth');
|
|
19125
|
+
* }
|
|
19126
19126
|
*/
|
|
19127
19127
|
|
|
19128
19128
|
|
|
@@ -19165,13 +19165,13 @@ class CalendarCore {
|
|
|
19165
19165
|
|
|
19166
19166
|
return newRenderRange;
|
|
19167
19167
|
}
|
|
19168
|
-
/**
|
|
19169
|
-
* Move to today.
|
|
19170
|
-
*
|
|
19171
|
-
* @example
|
|
19172
|
-
* function onClickTodayBtn() {
|
|
19173
|
-
* calendar.today();
|
|
19174
|
-
* }
|
|
19168
|
+
/**
|
|
19169
|
+
* Move to today.
|
|
19170
|
+
*
|
|
19171
|
+
* @example
|
|
19172
|
+
* function onClickTodayBtn() {
|
|
19173
|
+
* calendar.today();
|
|
19174
|
+
* }
|
|
19175
19175
|
*/
|
|
19176
19176
|
|
|
19177
19177
|
|
|
@@ -19183,19 +19183,19 @@ class CalendarCore {
|
|
|
19183
19183
|
setRenderDate(today);
|
|
19184
19184
|
this.renderRange = this.calculateRenderRange(today);
|
|
19185
19185
|
}
|
|
19186
|
-
/**
|
|
19187
|
-
* Move to specific date.
|
|
19188
|
-
*
|
|
19189
|
-
* @param {Date|string|number|TZDate} date - The date to move. it should be eligible parameter to create a `Date` instance if `date` is string or number.
|
|
19190
|
-
* @example
|
|
19191
|
-
* calendar.on('clickDayName', (event) => {
|
|
19192
|
-
* if (calendar.getViewName() === 'week') {
|
|
19193
|
-
* const dateToMove = new Date(event.date);
|
|
19194
|
-
*
|
|
19195
|
-
* calendar.setDate(dateToMove);
|
|
19196
|
-
* calendar.changeView('day');
|
|
19197
|
-
* }
|
|
19198
|
-
* });
|
|
19186
|
+
/**
|
|
19187
|
+
* Move to specific date.
|
|
19188
|
+
*
|
|
19189
|
+
* @param {Date|string|number|TZDate} date - The date to move. it should be eligible parameter to create a `Date` instance if `date` is string or number.
|
|
19190
|
+
* @example
|
|
19191
|
+
* calendar.on('clickDayName', (event) => {
|
|
19192
|
+
* if (calendar.getViewName() === 'week') {
|
|
19193
|
+
* const dateToMove = new Date(event.date);
|
|
19194
|
+
*
|
|
19195
|
+
* calendar.setDate(dateToMove);
|
|
19196
|
+
* calendar.changeView('day');
|
|
19197
|
+
* }
|
|
19198
|
+
* });
|
|
19199
19199
|
*/
|
|
19200
19200
|
|
|
19201
19201
|
|
|
@@ -19207,69 +19207,69 @@ class CalendarCore {
|
|
|
19207
19207
|
setRenderDate(dateToChange);
|
|
19208
19208
|
this.renderRange = this.calculateRenderRange(dateToChange);
|
|
19209
19209
|
}
|
|
19210
|
-
/**
|
|
19211
|
-
* Move the calendar forward to the next range.
|
|
19212
|
-
*
|
|
19213
|
-
* @example
|
|
19214
|
-
* function moveToNextOrPrevRange(offset) {
|
|
19215
|
-
* if (offset === -1) {
|
|
19216
|
-
* calendar.prev();
|
|
19217
|
-
* } else if (offset === 1) {
|
|
19218
|
-
* calendar.next();
|
|
19219
|
-
* }
|
|
19220
|
-
* }
|
|
19210
|
+
/**
|
|
19211
|
+
* Move the calendar forward to the next range.
|
|
19212
|
+
*
|
|
19213
|
+
* @example
|
|
19214
|
+
* function moveToNextOrPrevRange(offset) {
|
|
19215
|
+
* if (offset === -1) {
|
|
19216
|
+
* calendar.prev();
|
|
19217
|
+
* } else if (offset === 1) {
|
|
19218
|
+
* calendar.next();
|
|
19219
|
+
* }
|
|
19220
|
+
* }
|
|
19221
19221
|
*/
|
|
19222
19222
|
|
|
19223
19223
|
|
|
19224
19224
|
next() {
|
|
19225
19225
|
this.move(1);
|
|
19226
19226
|
}
|
|
19227
|
-
/**
|
|
19228
|
-
* Move the calendar backward to the previous range.
|
|
19229
|
-
*
|
|
19230
|
-
* @example
|
|
19231
|
-
* function moveToNextOrPrevRange(offset) {
|
|
19232
|
-
* if (offset === -1) {
|
|
19233
|
-
* calendar.prev();
|
|
19234
|
-
* } else if (offset === 1) {
|
|
19235
|
-
* calendar.next();
|
|
19236
|
-
* }
|
|
19237
|
-
* }
|
|
19227
|
+
/**
|
|
19228
|
+
* Move the calendar backward to the previous range.
|
|
19229
|
+
*
|
|
19230
|
+
* @example
|
|
19231
|
+
* function moveToNextOrPrevRange(offset) {
|
|
19232
|
+
* if (offset === -1) {
|
|
19233
|
+
* calendar.prev();
|
|
19234
|
+
* } else if (offset === 1) {
|
|
19235
|
+
* calendar.next();
|
|
19236
|
+
* }
|
|
19237
|
+
* }
|
|
19238
19238
|
*/
|
|
19239
19239
|
|
|
19240
19240
|
|
|
19241
19241
|
prev() {
|
|
19242
19242
|
this.move(-1);
|
|
19243
19243
|
}
|
|
19244
|
-
/**
|
|
19245
|
-
* Change color values of events belong to a certain calendar.
|
|
19246
|
-
*
|
|
19247
|
-
* @param {string} calendarId - The calendar ID
|
|
19248
|
-
* @param {object} colorOptions - The color values of the calendar
|
|
19249
|
-
* @param {string} colorOptions.color - The text color of the events
|
|
19250
|
-
* @param {string} colorOptions.borderColor - Left border color of events
|
|
19251
|
-
* @param {string} colorOptions.backgroundColor - Background color of events
|
|
19252
|
-
* @param {string} colorOptions.dragBackgroundColor - Background color of events during dragging
|
|
19253
|
-
*
|
|
19254
|
-
* @example
|
|
19255
|
-
* calendar.setCalendarColor('1', {
|
|
19256
|
-
* color: '#e8e8e8',
|
|
19257
|
-
* backgroundColor: '#585858',
|
|
19258
|
-
* borderColor: '#a1b56c',
|
|
19259
|
-
* dragBackgroundColor: '#585858',
|
|
19260
|
-
* });
|
|
19261
|
-
* calendar.setCalendarColor('2', {
|
|
19262
|
-
* color: '#282828',
|
|
19263
|
-
* backgroundColor: '#dc9656',
|
|
19264
|
-
* borderColor: '#a1b56c',
|
|
19265
|
-
* dragBackgroundColor: '#dc9656',
|
|
19266
|
-
* });
|
|
19267
|
-
* calendar.setCalendarColor('3', {
|
|
19268
|
-
* color: '#a16946',
|
|
19269
|
-
* backgroundColor: '#ab4642',
|
|
19270
|
-
* borderColor: '#a1b56c',
|
|
19271
|
-
* dragBackgroundColor: '#ab4642',
|
|
19272
|
-
* });
|
|
19244
|
+
/**
|
|
19245
|
+
* Change color values of events belong to a certain calendar.
|
|
19246
|
+
*
|
|
19247
|
+
* @param {string} calendarId - The calendar ID
|
|
19248
|
+
* @param {object} colorOptions - The color values of the calendar
|
|
19249
|
+
* @param {string} colorOptions.color - The text color of the events
|
|
19250
|
+
* @param {string} colorOptions.borderColor - Left border color of events
|
|
19251
|
+
* @param {string} colorOptions.backgroundColor - Background color of events
|
|
19252
|
+
* @param {string} colorOptions.dragBackgroundColor - Background color of events during dragging
|
|
19253
|
+
*
|
|
19254
|
+
* @example
|
|
19255
|
+
* calendar.setCalendarColor('1', {
|
|
19256
|
+
* color: '#e8e8e8',
|
|
19257
|
+
* backgroundColor: '#585858',
|
|
19258
|
+
* borderColor: '#a1b56c',
|
|
19259
|
+
* dragBackgroundColor: '#585858',
|
|
19260
|
+
* });
|
|
19261
|
+
* calendar.setCalendarColor('2', {
|
|
19262
|
+
* color: '#282828',
|
|
19263
|
+
* backgroundColor: '#dc9656',
|
|
19264
|
+
* borderColor: '#a1b56c',
|
|
19265
|
+
* dragBackgroundColor: '#dc9656',
|
|
19266
|
+
* });
|
|
19267
|
+
* calendar.setCalendarColor('3', {
|
|
19268
|
+
* color: '#a16946',
|
|
19269
|
+
* backgroundColor: '#ab4642',
|
|
19270
|
+
* borderColor: '#a1b56c',
|
|
19271
|
+
* dragBackgroundColor: '#ab4642',
|
|
19272
|
+
* });
|
|
19273
19273
|
*/
|
|
19274
19274
|
|
|
19275
19275
|
|
|
@@ -19279,20 +19279,20 @@ class CalendarCore {
|
|
|
19279
19279
|
} = this.getStoreDispatchers().calendar;
|
|
19280
19280
|
setCalendarColor(calendarId, colorOptions);
|
|
19281
19281
|
}
|
|
19282
|
-
/**
|
|
19283
|
-
* Change current view type.
|
|
19284
|
-
*
|
|
19285
|
-
* @param {string} viewName - The new view name to change to. Available values are 'month', 'week', 'day'.
|
|
19286
|
-
*
|
|
19287
|
-
* @example
|
|
19288
|
-
* // change to daily view
|
|
19289
|
-
* calendar.changeView('day');
|
|
19290
|
-
*
|
|
19291
|
-
* // change to weekly view
|
|
19292
|
-
* calendar.changeView('week');
|
|
19293
|
-
*
|
|
19294
|
-
* // change to monthly view
|
|
19295
|
-
* calendar.changeView('month');
|
|
19282
|
+
/**
|
|
19283
|
+
* Change current view type.
|
|
19284
|
+
*
|
|
19285
|
+
* @param {string} viewName - The new view name to change to. Available values are 'month', 'week', 'day'.
|
|
19286
|
+
*
|
|
19287
|
+
* @example
|
|
19288
|
+
* // change to daily view
|
|
19289
|
+
* calendar.changeView('day');
|
|
19290
|
+
*
|
|
19291
|
+
* // change to weekly view
|
|
19292
|
+
* calendar.changeView('week');
|
|
19293
|
+
*
|
|
19294
|
+
* // change to monthly view
|
|
19295
|
+
* calendar.changeView('month');
|
|
19296
19296
|
*/
|
|
19297
19297
|
|
|
19298
19298
|
|
|
@@ -19303,17 +19303,17 @@ class CalendarCore {
|
|
|
19303
19303
|
changeView(viewName);
|
|
19304
19304
|
this.renderRange = this.calculateRenderRange(this.getDate());
|
|
19305
19305
|
}
|
|
19306
|
-
/**
|
|
19307
|
-
* Get the DOM element of the event by event id and calendar id
|
|
19308
|
-
*
|
|
19309
|
-
* @param {string} eventId - ID of event
|
|
19310
|
-
* @param {string} calendarId - calendarId of event
|
|
19311
|
-
* @returns {HTMLElement} event element if found or null
|
|
19312
|
-
*
|
|
19313
|
-
* @example
|
|
19314
|
-
* const element = calendar.getElement(eventId, calendarId);
|
|
19315
|
-
*
|
|
19316
|
-
* console.log(element);
|
|
19306
|
+
/**
|
|
19307
|
+
* Get the DOM element of the event by event id and calendar id
|
|
19308
|
+
*
|
|
19309
|
+
* @param {string} eventId - ID of event
|
|
19310
|
+
* @param {string} calendarId - calendarId of event
|
|
19311
|
+
* @returns {HTMLElement} event element if found or null
|
|
19312
|
+
*
|
|
19313
|
+
* @example
|
|
19314
|
+
* const element = calendar.getElement(eventId, calendarId);
|
|
19315
|
+
*
|
|
19316
|
+
* console.log(element);
|
|
19317
19317
|
*/
|
|
19318
19318
|
|
|
19319
19319
|
|
|
@@ -19326,29 +19326,29 @@ class CalendarCore {
|
|
|
19326
19326
|
|
|
19327
19327
|
return null;
|
|
19328
19328
|
}
|
|
19329
|
-
/**
|
|
19330
|
-
* Set the theme of the calendar.
|
|
19331
|
-
*
|
|
19332
|
-
* @param {Theme} theme - The theme object to apply. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/theme.md|Theme} in guide.
|
|
19333
|
-
*
|
|
19334
|
-
* @example
|
|
19335
|
-
* calendar.setTheme({
|
|
19336
|
-
* common: {
|
|
19337
|
-
* gridSelection: {
|
|
19338
|
-
* backgroundColor: '#333',
|
|
19339
|
-
* },
|
|
19340
|
-
* },
|
|
19341
|
-
* week: {
|
|
19342
|
-
* nowIndicatorLabel: {
|
|
19343
|
-
* color: '#00FF00',
|
|
19344
|
-
* },
|
|
19345
|
-
* },
|
|
19346
|
-
* month: {
|
|
19347
|
-
* dayName: {
|
|
19348
|
-
* borderLeft: '1px solid #e5e5e5',
|
|
19349
|
-
* },
|
|
19350
|
-
* },
|
|
19351
|
-
* });
|
|
19329
|
+
/**
|
|
19330
|
+
* Set the theme of the calendar.
|
|
19331
|
+
*
|
|
19332
|
+
* @param {Theme} theme - The theme object to apply. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/theme.md|Theme} in guide.
|
|
19333
|
+
*
|
|
19334
|
+
* @example
|
|
19335
|
+
* calendar.setTheme({
|
|
19336
|
+
* common: {
|
|
19337
|
+
* gridSelection: {
|
|
19338
|
+
* backgroundColor: '#333',
|
|
19339
|
+
* },
|
|
19340
|
+
* },
|
|
19341
|
+
* week: {
|
|
19342
|
+
* nowIndicatorLabel: {
|
|
19343
|
+
* color: '#00FF00',
|
|
19344
|
+
* },
|
|
19345
|
+
* },
|
|
19346
|
+
* month: {
|
|
19347
|
+
* dayName: {
|
|
19348
|
+
* borderLeft: '1px solid #e5e5e5',
|
|
19349
|
+
* },
|
|
19350
|
+
* },
|
|
19351
|
+
* });
|
|
19352
19352
|
*/
|
|
19353
19353
|
|
|
19354
19354
|
|
|
@@ -19358,10 +19358,10 @@ class CalendarCore {
|
|
|
19358
19358
|
} = this.theme.getState().dispatch;
|
|
19359
19359
|
setTheme(theme);
|
|
19360
19360
|
}
|
|
19361
|
-
/**
|
|
19362
|
-
* Get current options.
|
|
19363
|
-
*
|
|
19364
|
-
* @returns {Options} - The current options of the instance
|
|
19361
|
+
/**
|
|
19362
|
+
* Get current options.
|
|
19363
|
+
*
|
|
19364
|
+
* @returns {Options} - The current options of the instance
|
|
19365
19365
|
*/
|
|
19366
19366
|
|
|
19367
19367
|
|
|
@@ -19379,10 +19379,10 @@ class CalendarCore {
|
|
|
19379
19379
|
theme
|
|
19380
19380
|
};
|
|
19381
19381
|
}
|
|
19382
|
-
/**
|
|
19383
|
-
* Set options of calendar. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md|Options} in guide.
|
|
19384
|
-
*
|
|
19385
|
-
* @param {Options} options - The options to set
|
|
19382
|
+
/**
|
|
19383
|
+
* Set options of calendar. For more information, see {@link https://github.com/nhn/tui.calendar/blob/main/docs/en/apis/options.md|Options} in guide.
|
|
19384
|
+
*
|
|
19385
|
+
* @param {Options} options - The options to set
|
|
19386
19386
|
*/
|
|
19387
19387
|
|
|
19388
19388
|
|
|
@@ -19415,10 +19415,10 @@ class CalendarCore {
|
|
|
19415
19415
|
|
|
19416
19416
|
setOptions(restOptions);
|
|
19417
19417
|
}
|
|
19418
|
-
/**
|
|
19419
|
-
* Get current rendered date. (see {@link TZDate} for further information)
|
|
19420
|
-
*
|
|
19421
|
-
* @returns {TZDate}
|
|
19418
|
+
/**
|
|
19419
|
+
* Get current rendered date. (see {@link TZDate} for further information)
|
|
19420
|
+
*
|
|
19421
|
+
* @returns {TZDate}
|
|
19422
19422
|
*/
|
|
19423
19423
|
|
|
19424
19424
|
|
|
@@ -19428,30 +19428,30 @@ class CalendarCore {
|
|
|
19428
19428
|
} = this.getStoreState().view;
|
|
19429
19429
|
return renderDate;
|
|
19430
19430
|
}
|
|
19431
|
-
/**
|
|
19432
|
-
* Start time of rendered date range. (see {@link TZDate} for further information)
|
|
19433
|
-
*
|
|
19434
|
-
* @returns {TZDate}
|
|
19431
|
+
/**
|
|
19432
|
+
* Start time of rendered date range. (see {@link TZDate} for further information)
|
|
19433
|
+
*
|
|
19434
|
+
* @returns {TZDate}
|
|
19435
19435
|
*/
|
|
19436
19436
|
|
|
19437
19437
|
|
|
19438
19438
|
getDateRangeStart() {
|
|
19439
19439
|
return this.renderRange.start;
|
|
19440
19440
|
}
|
|
19441
|
-
/**
|
|
19442
|
-
* End time of rendered date range. (see {@link TZDate} for further information)
|
|
19443
|
-
*
|
|
19444
|
-
* @returns {TZDate}
|
|
19441
|
+
/**
|
|
19442
|
+
* End time of rendered date range. (see {@link TZDate} for further information)
|
|
19443
|
+
*
|
|
19444
|
+
* @returns {TZDate}
|
|
19445
19445
|
*/
|
|
19446
19446
|
|
|
19447
19447
|
|
|
19448
19448
|
getDateRangeEnd() {
|
|
19449
19449
|
return this.renderRange.end;
|
|
19450
19450
|
}
|
|
19451
|
-
/**
|
|
19452
|
-
* Get current view name('day', 'week', 'month').
|
|
19453
|
-
*
|
|
19454
|
-
* @returns {string} current view name ('day', 'week', 'month')
|
|
19451
|
+
/**
|
|
19452
|
+
* Get current view name('day', 'week', 'month').
|
|
19453
|
+
*
|
|
19454
|
+
* @returns {string} current view name ('day', 'week', 'month')
|
|
19455
19455
|
*/
|
|
19456
19456
|
|
|
19457
19457
|
|
|
@@ -19461,10 +19461,10 @@ class CalendarCore {
|
|
|
19461
19461
|
} = this.getStoreState('view');
|
|
19462
19462
|
return currentView;
|
|
19463
19463
|
}
|
|
19464
|
-
/**
|
|
19465
|
-
* Set calendar list.
|
|
19466
|
-
*
|
|
19467
|
-
* @param {CalendarInfo[]} calendars - list of calendars
|
|
19464
|
+
/**
|
|
19465
|
+
* Set calendar list.
|
|
19466
|
+
*
|
|
19467
|
+
* @param {CalendarInfo[]} calendars - list of calendars
|
|
19468
19468
|
*/
|
|
19469
19469
|
|
|
19470
19470
|
|
|
@@ -19475,10 +19475,10 @@ class CalendarCore {
|
|
|
19475
19475
|
setCalendars(calendars);
|
|
19476
19476
|
} // TODO: specify position of popup
|
|
19477
19477
|
|
|
19478
|
-
/**
|
|
19479
|
-
* Open event form popup with predefined form values.
|
|
19480
|
-
*
|
|
19481
|
-
* @param {EventObject} event - The predefined {@link EventObject} data to show in form.
|
|
19478
|
+
/**
|
|
19479
|
+
* Open event form popup with predefined form values.
|
|
19480
|
+
*
|
|
19481
|
+
* @param {EventObject} event - The predefined {@link EventObject} data to show in form.
|
|
19482
19482
|
*/
|
|
19483
19483
|
|
|
19484
19484
|
|
|
@@ -19552,12 +19552,12 @@ class CalendarCore {
|
|
|
19552
19552
|
function isValidViewType(viewType) {
|
|
19553
19553
|
return !!Object.values(VIEW_TYPE).find(type => type === viewType);
|
|
19554
19554
|
}
|
|
19555
|
-
/**
|
|
19556
|
-
* Calendar class
|
|
19557
|
-
*
|
|
19558
|
-
* @class Calendar
|
|
19559
|
-
* @extends CalendarCore
|
|
19560
|
-
* @param {object} options - Calendar options. Check out {@link CalendarCore} for more information.
|
|
19555
|
+
/**
|
|
19556
|
+
* Calendar class
|
|
19557
|
+
*
|
|
19558
|
+
* @class Calendar
|
|
19559
|
+
* @extends CalendarCore
|
|
19560
|
+
* @param {object} options - Calendar options. Check out {@link CalendarCore} for more information.
|
|
19561
19561
|
*/
|
|
19562
19562
|
|
|
19563
19563
|
|