@tylertech/forge 3.9.0-dev.0 → 3.9.0-dev.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/custom-elements.json +1790 -1656
- package/dist/lib.js +27 -105
- package/dist/lib.js.map +4 -4
- package/dist/vscode.css-custom-data.json +76 -49
- package/dist/vscode.html-custom-data.json +167 -180
- package/esm/app-bar/help-button/app-bar-help-button.js +1 -1
- package/esm/app-bar/menu-button/app-bar-menu-button.js +1 -1
- package/esm/app-bar/notification-button/app-bar-notification-button.js +1 -1
- package/esm/app-bar/search/app-bar-search.js +1 -1
- package/esm/autocomplete/autocomplete.js +1 -1
- package/esm/avatar/index.js +3 -3
- package/esm/badge/index.js +3 -3
- package/esm/banner/banner.js +1 -1
- package/esm/button/base/base-button-adapter.js +1 -1
- package/esm/button/base/base-button.js +1 -1
- package/esm/calendar/calendar-adapter.d.ts +0 -24
- package/esm/calendar/calendar-adapter.js +1 -67
- package/esm/calendar/calendar-constants.d.ts +0 -34
- package/esm/calendar/calendar-constants.js +0 -33
- package/esm/calendar/calendar-core.d.ts +0 -60
- package/esm/calendar/calendar-core.js +2 -220
- package/esm/calendar/calendar-dom-utils.d.ts +0 -6
- package/esm/calendar/calendar-dom-utils.js +0 -36
- package/esm/calendar/calendar.d.ts +1 -40
- package/esm/calendar/calendar.js +3 -81
- package/esm/calendar/core/calendar-base.d.ts +0 -3
- package/esm/calendar/core/date-range.d.ts +0 -2
- package/esm/calendar/core/date-range.js +0 -1
- package/esm/card/index.d.ts +1 -1
- package/esm/card/index.js +4 -4
- package/esm/chips/chip/chip.js +1 -1
- package/esm/color-picker/color-picker.js +1 -1
- package/esm/core/utils/dismissible-stack.d.ts +5 -1
- package/esm/core/utils/dismissible-stack.js +6 -0
- package/esm/data-table/body/body.d.ts +33 -0
- package/esm/data-table/body/body.js +42 -0
- package/esm/data-table/body/index.d.ts +6 -0
- package/esm/data-table/body/index.js +6 -0
- package/esm/data-table/cell/cell.d.ts +33 -0
- package/esm/data-table/cell/cell.js +42 -0
- package/esm/data-table/cell/index.d.ts +6 -0
- package/esm/data-table/cell/index.js +6 -0
- package/esm/data-table/column/column.d.ts +33 -0
- package/esm/data-table/column/column.js +42 -0
- package/esm/data-table/column/index.d.ts +6 -0
- package/esm/data-table/column/index.js +6 -0
- package/esm/data-table/footer/footer.d.ts +33 -0
- package/esm/data-table/footer/footer.js +42 -0
- package/esm/data-table/footer/index.d.ts +6 -0
- package/esm/data-table/footer/index.js +6 -0
- package/esm/data-table/head/head.d.ts +33 -0
- package/esm/data-table/head/head.js +42 -0
- package/esm/data-table/head/index.d.ts +6 -0
- package/esm/data-table/head/index.js +6 -0
- package/esm/data-table/index.d.ts +12 -0
- package/esm/data-table/index.js +12 -0
- package/esm/data-table/row/index.d.ts +6 -0
- package/esm/data-table/row/index.js +6 -0
- package/esm/data-table/row/row.d.ts +33 -0
- package/esm/data-table/row/row.js +42 -0
- package/esm/data-table/table/index.d.ts +6 -0
- package/esm/data-table/table/index.js +6 -0
- package/esm/data-table/table/table.d.ts +36 -0
- package/esm/data-table/table/table.js +40 -0
- package/esm/date-picker/base/base-date-picker-adapter.js +3 -0
- package/esm/date-picker/base/base-date-picker-constants.d.ts +0 -3
- package/esm/date-picker/base/base-date-picker-constants.js +0 -3
- package/esm/date-picker/base/base-date-picker-core.d.ts +0 -15
- package/esm/date-picker/base/base-date-picker-core.js +0 -30
- package/esm/date-picker/base/base-date-picker.d.ts +0 -12
- package/esm/date-picker/base/base-date-picker.js +0 -24
- package/esm/date-picker/date-picker-core.d.ts +0 -3
- package/esm/date-picker/date-picker-core.js +0 -20
- package/esm/date-picker/date-picker.js +1 -1
- package/esm/date-range-picker/date-range-picker-constants.d.ts +0 -3
- package/esm/date-range-picker/date-range-picker-constants.js +0 -1
- package/esm/date-range-picker/date-range-picker-core.d.ts +0 -3
- package/esm/date-range-picker/date-range-picker-core.js +2 -62
- package/esm/date-range-picker/date-range-picker.d.ts +0 -3
- package/esm/date-range-picker/date-range-picker.js +1 -4
- package/esm/icon/icon-constants.d.ts +2 -1
- package/esm/icon/icon-constants.js +2 -1
- package/esm/icon/icon-core.js +6 -2
- package/esm/icon/icon-utils.d.ts +2 -1
- package/esm/icon/icon-utils.js +2 -2
- package/esm/icon/icon.d.ts +3 -1
- package/esm/icon/icon.js +1 -1
- package/esm/icon-button/icon-button-core.js +11 -2
- package/esm/key/key/index.js +3 -3
- package/esm/key/key-item/index.js +3 -3
- package/esm/list-dropdown/list-dropdown-utils.js +1 -1
- package/esm/list-dropdown/list-dropdown.js +1 -1
- package/esm/menu/menu.js +1 -1
- package/esm/meter/meter/index.js +2 -2
- package/esm/meter/meter-group/index.js +3 -3
- package/esm/open-icon/open-icon.js +1 -1
- package/esm/paginator/paginator.js +1 -1
- package/esm/popover/popover-constants.d.ts +3 -0
- package/esm/popover/popover-constants.js +4 -2
- package/esm/popover/popover-core.d.ts +4 -0
- package/esm/popover/popover-core.js +20 -0
- package/esm/popover/popover.d.ts +4 -0
- package/esm/popover/popover.js +8 -0
- package/esm/select/select/select.js +1 -1
- package/esm/split-view/split-view-panel/split-view-panel.js +3 -4
- package/esm/stepper/step/step.js +1 -1
- package/esm/table/table-constants.d.ts +1 -0
- package/esm/table/table-constants.js +2 -1
- package/esm/table/table-core.js +3 -0
- package/esm/table/table.d.ts +2 -0
- package/esm/table/table.js +2 -1
- package/esm/tabs/tab-bar/tab-bar-adapter.js +1 -1
- package/esm/tabs/tab-bar/tab-bar.js +1 -1
- package/esm/text-field/text-field.js +1 -1
- package/esm/time-picker/time-picker.js +1 -2
- package/esm/toast/toast.js +1 -1
- package/esm/view-switcher/view-switcher.d.ts +5 -0
- package/esm/view-switcher/view-switcher.js +6 -1
- package/package.json +2 -2
- package/sass/calendar/_mixins.scss +2 -3
- package/sass/data-table/_core.scss +52 -0
- package/sass/data-table/_token-utils.scss +15 -0
- package/sass/data-table/body/body.scss +27 -0
- package/sass/data-table/cell/cell.scss +27 -0
- package/sass/data-table/column/column.scss +27 -0
- package/sass/data-table/footer/footer.scss +27 -0
- package/sass/data-table/head/head.scss +27 -0
- package/sass/data-table/index.scss +12 -0
- package/sass/data-table/row/row.scss +27 -0
- package/sass/data-table/table/table.scss +16 -0
- package/sass/view-switcher/view-switcher.scss +13 -7
|
@@ -18,9 +18,6 @@ export class CalendarCore {
|
|
|
18
18
|
this._month = new Date().getMonth();
|
|
19
19
|
this._year = new Date().getFullYear();
|
|
20
20
|
this._showToday = true;
|
|
21
|
-
this._showYesterday = true;
|
|
22
|
-
this._showLastSevenDays = true;
|
|
23
|
-
this._showLastThirtyDays = true;
|
|
24
21
|
this._showOtherMonths = false;
|
|
25
22
|
this._fixedHeight = false;
|
|
26
23
|
this._events = [];
|
|
@@ -43,9 +40,6 @@ export class CalendarCore {
|
|
|
43
40
|
this._showHeader = true;
|
|
44
41
|
this._clearButton = false;
|
|
45
42
|
this._todayButton = false;
|
|
46
|
-
this._yesterdayButton = false;
|
|
47
|
-
this._lastSevenDaysButton = false;
|
|
48
|
-
this._lastThirtyDaysButton = false;
|
|
49
43
|
// Menu
|
|
50
44
|
this._view = 'date';
|
|
51
45
|
this._menuAnimation = 'scale';
|
|
@@ -72,9 +66,6 @@ export class CalendarCore {
|
|
|
72
66
|
this._preventFocusListener = evt => evt.preventDefault();
|
|
73
67
|
this._previousButtonListener = () => this._onPreviousButtonClicked();
|
|
74
68
|
this._todayButtonListener = () => this._onTodayClicked();
|
|
75
|
-
this._yesterdayButtonListener = () => this._onYesterdayClicked();
|
|
76
|
-
this._lastSevenDaysButtonListener = () => this._onLastSevenDaysClicked();
|
|
77
|
-
this._lastThirtyDaysButtonListener = () => this._onLastThirtyDaysClicked();
|
|
78
69
|
this._yearButtonListener = () => this._onYearButtonClicked();
|
|
79
70
|
}
|
|
80
71
|
initialize() {
|
|
@@ -86,9 +77,6 @@ export class CalendarCore {
|
|
|
86
77
|
this._applyFixedHeight();
|
|
87
78
|
this._applyReadOnly();
|
|
88
79
|
this._applyShowToday();
|
|
89
|
-
this._applyShowYesterday();
|
|
90
|
-
this._applyShowLastSevenDays();
|
|
91
|
-
this._applyShowLastThirtyDays();
|
|
92
80
|
this._applyPreventFocus();
|
|
93
81
|
this._applyShowHeader();
|
|
94
82
|
this._applyMonth();
|
|
@@ -98,9 +86,6 @@ export class CalendarCore {
|
|
|
98
86
|
this._applyLocale();
|
|
99
87
|
this._applyClearButton();
|
|
100
88
|
this._applyTodayButton();
|
|
101
|
-
this._applyYesterdayButton();
|
|
102
|
-
this._applyLastSevenDaysButton();
|
|
103
|
-
this._applyLastThirtyDaysButton();
|
|
104
89
|
this._applyFirstDayOfWeek();
|
|
105
90
|
this._applyShowOtherMonths();
|
|
106
91
|
this._createDateView();
|
|
@@ -430,15 +415,6 @@ export class CalendarCore {
|
|
|
430
415
|
_onTodayClicked() {
|
|
431
416
|
this.today();
|
|
432
417
|
}
|
|
433
|
-
_onYesterdayClicked() {
|
|
434
|
-
this.yesterday();
|
|
435
|
-
}
|
|
436
|
-
_onLastSevenDaysClicked() {
|
|
437
|
-
this.lastSevenDays();
|
|
438
|
-
}
|
|
439
|
-
_onLastThirtyDaysClicked() {
|
|
440
|
-
this.lastThirtyDays();
|
|
441
|
-
}
|
|
442
418
|
/** Attempts to the month and year of the value in single mode, then emits a selection event */
|
|
443
419
|
_trySetValueMonthAndYear(month, year, type = 'date') {
|
|
444
420
|
if (!this.selectionFollowsMonth || this._mode !== 'single' || !this._value?.length) {
|
|
@@ -1384,7 +1360,7 @@ export class CalendarCore {
|
|
|
1384
1360
|
if (!this._clearButton) {
|
|
1385
1361
|
this._adapter.unregisterClearButtonListener(this._clearButtonListener);
|
|
1386
1362
|
this._adapter.removeClearButton();
|
|
1387
|
-
if (!this._todayButton
|
|
1363
|
+
if (!this._todayButton) {
|
|
1388
1364
|
this._adapter.removeFooter();
|
|
1389
1365
|
}
|
|
1390
1366
|
}
|
|
@@ -1681,7 +1657,7 @@ export class CalendarCore {
|
|
|
1681
1657
|
if (!this._todayButton) {
|
|
1682
1658
|
this._adapter.unregisterTodayButtonListener(this._todayButtonListener);
|
|
1683
1659
|
this._adapter.removeTodayButton();
|
|
1684
|
-
if (!this._clearButton
|
|
1660
|
+
if (!this._clearButton) {
|
|
1685
1661
|
this._adapter.removeFooter();
|
|
1686
1662
|
}
|
|
1687
1663
|
}
|
|
@@ -1691,63 +1667,6 @@ export class CalendarCore {
|
|
|
1691
1667
|
this._adapter.registerTodayButtonListener(this._todayButtonListener);
|
|
1692
1668
|
}
|
|
1693
1669
|
}
|
|
1694
|
-
_applyShowYesterday() {
|
|
1695
|
-
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.SHOW_YESTERDAY, this._showYesterday);
|
|
1696
|
-
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.SHOW_YESTERDAY, this._showYesterday);
|
|
1697
|
-
}
|
|
1698
|
-
_applyYesterdayButton() {
|
|
1699
|
-
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.YESTERDAY_BUTTON, true, this._yesterdayButton.toString());
|
|
1700
|
-
if (!this._yesterdayButton) {
|
|
1701
|
-
this._adapter.unregisterYesterdayButtonListener(this._yesterdayButtonListener);
|
|
1702
|
-
this._adapter.removeYesterdayButton();
|
|
1703
|
-
if (!this._clearButton && !this._todayButton && !this._lastSevenDaysButton && !this._lastThirtyDaysButton) {
|
|
1704
|
-
this._adapter.removeFooter();
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
else {
|
|
1708
|
-
this._adapter.setFooter();
|
|
1709
|
-
this._adapter.setYesterdayButton();
|
|
1710
|
-
this._adapter.registerYesterdayButtonListener(this._yesterdayButtonListener);
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
_applyShowLastSevenDays() {
|
|
1714
|
-
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.SHOW_LAST_SEVEN_DAYS, this._showLastSevenDays);
|
|
1715
|
-
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.SHOW_LAST_SEVEN_DAYS, this._showLastSevenDays);
|
|
1716
|
-
}
|
|
1717
|
-
_applyLastSevenDaysButton() {
|
|
1718
|
-
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.LAST_SEVEN_DAYS_BUTTON, true, this._lastSevenDaysButton.toString());
|
|
1719
|
-
if (!this._lastSevenDaysButton) {
|
|
1720
|
-
this._adapter.unregisterLastSevenDaysButtonListener(this._lastSevenDaysButtonListener);
|
|
1721
|
-
this._adapter.removeLastSevenDaysButton();
|
|
1722
|
-
if (!this._clearButton && !this._todayButton && !this._yesterdayButton) {
|
|
1723
|
-
this._adapter.removeFooter();
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
else {
|
|
1727
|
-
this._adapter.setFooter();
|
|
1728
|
-
this._adapter.setLastSevenDaysButton();
|
|
1729
|
-
this._adapter.registerLastSevenDaysButtonListener(this._lastSevenDaysButtonListener);
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
_applyShowLastThirtyDays() {
|
|
1733
|
-
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.SHOW_LAST_THIRTY_DAYS, this._showLastThirtyDays);
|
|
1734
|
-
this._adapter.setContainerClass(CALENDAR_CONSTANTS.classes.SHOW_LAST_THIRTY_DAYS, this._showLastThirtyDays);
|
|
1735
|
-
}
|
|
1736
|
-
_applyLastThirtyDaysButton() {
|
|
1737
|
-
this._adapter.toggleHostAttribute(CALENDAR_CONSTANTS.attributes.LAST_THIRTY_DAYS_BUTTON, true, this._lastThirtyDaysButton.toString());
|
|
1738
|
-
if (!this._lastThirtyDaysButton) {
|
|
1739
|
-
this._adapter.unregisterLastThirtyDaysButtonListener(this._lastThirtyDaysButtonListener);
|
|
1740
|
-
this._adapter.removeLastThirtyDaysButton();
|
|
1741
|
-
if (!this._clearButton && !this._todayButton && !this._yesterdayButton && !this.lastSevenDaysButton) {
|
|
1742
|
-
this._adapter.removeFooter();
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
else {
|
|
1746
|
-
this._adapter.setFooter();
|
|
1747
|
-
this._adapter.setLastThirtyDaysButton();
|
|
1748
|
-
this._adapter.registerLastThirtyDaysButtonListener(this._lastThirtyDaysButtonListener);
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
1670
|
_applyTooltipBuilder() {
|
|
1752
1671
|
if (this._view === 'date') {
|
|
1753
1672
|
this._dates.forEach(d => {
|
|
@@ -2146,99 +2065,6 @@ export class CalendarCore {
|
|
|
2146
2065
|
set todayCallback(value) {
|
|
2147
2066
|
this._todayCallback = value;
|
|
2148
2067
|
}
|
|
2149
|
-
/** Get/set show yesterday */
|
|
2150
|
-
get showYesterday() {
|
|
2151
|
-
return this._showYesterday;
|
|
2152
|
-
}
|
|
2153
|
-
set showYesterday(value) {
|
|
2154
|
-
if (this._showYesterday !== value) {
|
|
2155
|
-
this._showYesterday = value;
|
|
2156
|
-
if (this._isInitialized) {
|
|
2157
|
-
this._applyShowYesterday();
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
/** Get/set whether to show the yesterday button */
|
|
2162
|
-
get yesterdayButton() {
|
|
2163
|
-
return this._yesterdayButton;
|
|
2164
|
-
}
|
|
2165
|
-
set yesterdayButton(value) {
|
|
2166
|
-
if (this._yesterdayButton !== value) {
|
|
2167
|
-
this._yesterdayButton = value;
|
|
2168
|
-
if (this._isInitialized) {
|
|
2169
|
-
this._applyYesterdayButton();
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
/* Get/set the yesterday button callback */
|
|
2174
|
-
get yesterdayCallback() {
|
|
2175
|
-
return this._yesterdayCallback;
|
|
2176
|
-
}
|
|
2177
|
-
set yesterdayCallback(value) {
|
|
2178
|
-
this._yesterdayCallback = value;
|
|
2179
|
-
}
|
|
2180
|
-
/** Get/set show last seven days */
|
|
2181
|
-
get showLastSevenDays() {
|
|
2182
|
-
return this._showLastSevenDays;
|
|
2183
|
-
}
|
|
2184
|
-
set showLastSevenDays(value) {
|
|
2185
|
-
if (this._showLastSevenDays !== value) {
|
|
2186
|
-
this._showLastSevenDays = value;
|
|
2187
|
-
if (this._isInitialized) {
|
|
2188
|
-
this._applyShowLastSevenDays();
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
/** Get/set whether to show the last seven days button */
|
|
2193
|
-
get lastSevenDaysButton() {
|
|
2194
|
-
return this._lastSevenDaysButton;
|
|
2195
|
-
}
|
|
2196
|
-
set lastSevenDaysButton(value) {
|
|
2197
|
-
if (this._lastSevenDaysButton !== value) {
|
|
2198
|
-
this._lastSevenDaysButton = value;
|
|
2199
|
-
if (this._isInitialized) {
|
|
2200
|
-
this._applyLastSevenDaysButton();
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
}
|
|
2204
|
-
/* Get/set the last seven days button callback */
|
|
2205
|
-
get lastSevenDaysCallback() {
|
|
2206
|
-
return this._lastSevenDaysCallback;
|
|
2207
|
-
}
|
|
2208
|
-
set lastSevenDaysCallback(value) {
|
|
2209
|
-
this._lastSevenDaysCallback = value;
|
|
2210
|
-
}
|
|
2211
|
-
/** Get/set show last thirty days */
|
|
2212
|
-
get showLastThirtyDays() {
|
|
2213
|
-
return this._showLastThirtyDays;
|
|
2214
|
-
}
|
|
2215
|
-
set showLastThirtyDays(value) {
|
|
2216
|
-
if (this._showLastThirtyDays !== value) {
|
|
2217
|
-
this._showLastThirtyDays = value;
|
|
2218
|
-
if (this._isInitialized) {
|
|
2219
|
-
this._applyShowLastThirtyDays();
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
}
|
|
2223
|
-
/** Get/set whether to show the last thirty days button */
|
|
2224
|
-
get lastThirtyDaysButton() {
|
|
2225
|
-
return this._lastThirtyDaysButton;
|
|
2226
|
-
}
|
|
2227
|
-
set lastThirtyDaysButton(value) {
|
|
2228
|
-
if (this._lastThirtyDaysButton !== value) {
|
|
2229
|
-
this._lastThirtyDaysButton = value;
|
|
2230
|
-
if (this._isInitialized) {
|
|
2231
|
-
this._applyLastThirtyDaysButton();
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2234
|
-
}
|
|
2235
|
-
/* Get/set the last thirty days button callback */
|
|
2236
|
-
get lastThirtyDaysCallback() {
|
|
2237
|
-
return this._lastThirtyDaysCallback;
|
|
2238
|
-
}
|
|
2239
|
-
set lastThirtyDaysCallback(value) {
|
|
2240
|
-
this._lastThirtyDaysCallback = value;
|
|
2241
|
-
}
|
|
2242
2068
|
/** Get/set the tooltip builder */
|
|
2243
2069
|
get tooltipBuilder() {
|
|
2244
2070
|
return this._tooltipBuilder;
|
|
@@ -2387,55 +2213,11 @@ export class CalendarCore {
|
|
|
2387
2213
|
today() {
|
|
2388
2214
|
const today = new Date();
|
|
2389
2215
|
today.setHours(0, 0, 0, 0);
|
|
2390
|
-
const endOfToday = new Date();
|
|
2391
|
-
endOfToday.setHours(23, 59, 59, 0);
|
|
2392
2216
|
this._goToDate(today, true);
|
|
2393
2217
|
if (this._todayCallback) {
|
|
2394
2218
|
this._todayCallback();
|
|
2395
2219
|
}
|
|
2396
2220
|
}
|
|
2397
|
-
/** Go to yesterday */
|
|
2398
|
-
yesterday() {
|
|
2399
|
-
const today = new Date();
|
|
2400
|
-
const yesterdayFrom = new Date(today.setDate(today.getDate() - 1));
|
|
2401
|
-
yesterdayFrom.setHours(0, 0, 0, 0);
|
|
2402
|
-
const yesterdayTo = new Date(yesterdayFrom);
|
|
2403
|
-
yesterdayTo.setHours(23, 59, 59, 0);
|
|
2404
|
-
const dateRange = [yesterdayFrom, yesterdayTo];
|
|
2405
|
-
this._adapter.setRange(dateRange);
|
|
2406
|
-
this._goToDate(yesterdayFrom, true);
|
|
2407
|
-
if (this._yesterdayCallback) {
|
|
2408
|
-
this._yesterdayCallback();
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
/** Go to last seven days */
|
|
2412
|
-
lastSevenDays() {
|
|
2413
|
-
const today = new Date();
|
|
2414
|
-
const lastSevenDaysFrom = new Date(today.setDate(today.getDate() - 7));
|
|
2415
|
-
lastSevenDaysFrom.setHours(0, 0, 0, 0);
|
|
2416
|
-
const lastSevenDaysTo = new Date();
|
|
2417
|
-
lastSevenDaysTo.setHours(23, 59, 59, 0);
|
|
2418
|
-
const dateRange = [lastSevenDaysFrom, lastSevenDaysTo];
|
|
2419
|
-
this._adapter.setRange(dateRange);
|
|
2420
|
-
this._applyValue(dateRange);
|
|
2421
|
-
if (this._lastSevenDaysCallback) {
|
|
2422
|
-
this._lastSevenDaysCallback();
|
|
2423
|
-
}
|
|
2424
|
-
}
|
|
2425
|
-
/** Go to last thirty days */
|
|
2426
|
-
lastThirtyDays() {
|
|
2427
|
-
const today = new Date();
|
|
2428
|
-
const lastThirtyDaysFrom = new Date(today.setDate(today.getDate() - 30));
|
|
2429
|
-
lastThirtyDaysFrom.setHours(0, 0, 0, 0);
|
|
2430
|
-
const lastThirtyDaysTo = new Date();
|
|
2431
|
-
lastThirtyDaysTo.setHours(23, 59, 59, 0);
|
|
2432
|
-
const dateRange = [lastThirtyDaysFrom, lastThirtyDaysTo];
|
|
2433
|
-
this._adapter.setRange(dateRange);
|
|
2434
|
-
this._applyValue(dateRange);
|
|
2435
|
-
if (this._lastThirtyDaysCallback) {
|
|
2436
|
-
this._lastThirtyDaysCallback();
|
|
2437
|
-
}
|
|
2438
|
-
}
|
|
2439
2221
|
/** Toggles a date selected or unselected */
|
|
2440
2222
|
toggleDate(date, force) {
|
|
2441
2223
|
this._onDateSelected(date);
|
|
@@ -38,12 +38,6 @@ export declare function getFooter(): HTMLElement;
|
|
|
38
38
|
export declare function getClearButton(): HTMLElement;
|
|
39
39
|
/** Returns a today button. */
|
|
40
40
|
export declare function getTodayButton(): HTMLElement;
|
|
41
|
-
/** Returns a yesterday button. */
|
|
42
|
-
export declare function getYesterdayButton(): HTMLElement;
|
|
43
|
-
/** Returns a last seven days button. */
|
|
44
|
-
export declare function getLastSevenDaysButton(): HTMLElement;
|
|
45
|
-
/** Returns a last thirty days button. */
|
|
46
|
-
export declare function getLastThirtyDaysButton(): HTMLElement;
|
|
47
41
|
/** Checks whether an event originated from a date element, returning the element if it did. */
|
|
48
42
|
export declare function eventIncludesDate(evt: Event, includeDisabled?: boolean): HTMLElement | null;
|
|
49
43
|
/** Checks whether an event originated from an element with the given id, returning the element if it did. */
|
|
@@ -270,42 +270,6 @@ export function getTodayButton() {
|
|
|
270
270
|
todayButton.appendChild(slot);
|
|
271
271
|
return todayButton;
|
|
272
272
|
}
|
|
273
|
-
/** Returns a yesterday button. */
|
|
274
|
-
export function getYesterdayButton() {
|
|
275
|
-
const yesterdayButton = document.createElement('forge-button');
|
|
276
|
-
yesterdayButton.id = CALENDAR_CONSTANTS.ids.YESTERDAY_BUTTON;
|
|
277
|
-
yesterdayButton.setAttribute('part', CALENDAR_CONSTANTS.parts.YESTERDAY_BUTTON);
|
|
278
|
-
yesterdayButton.type = 'button';
|
|
279
|
-
const slot = document.createElement('slot');
|
|
280
|
-
slot.name = CALENDAR_CONSTANTS.slots.YESTERDAY_BUTTON_TEXT;
|
|
281
|
-
slot.innerText = CALENDAR_CONSTANTS.strings.DEFAULT_YESTERDAY_BUTTON_TEXT;
|
|
282
|
-
yesterdayButton.appendChild(slot);
|
|
283
|
-
return yesterdayButton;
|
|
284
|
-
}
|
|
285
|
-
/** Returns a last seven days button. */
|
|
286
|
-
export function getLastSevenDaysButton() {
|
|
287
|
-
const lastSevenDaysButton = document.createElement('forge-button');
|
|
288
|
-
lastSevenDaysButton.id = CALENDAR_CONSTANTS.ids.LAST_SEVEN_DAYS_BUTTON;
|
|
289
|
-
lastSevenDaysButton.setAttribute('part', CALENDAR_CONSTANTS.parts.LAST_SEVEN_DAYS_BUTTON);
|
|
290
|
-
lastSevenDaysButton.type = 'button';
|
|
291
|
-
const slot = document.createElement('slot');
|
|
292
|
-
slot.name = CALENDAR_CONSTANTS.slots.LAST_SEVEN_DAYS_BUTTON_TEXT;
|
|
293
|
-
slot.innerText = CALENDAR_CONSTANTS.strings.DEFAULT_LAST_SEVEN_DAYS_BUTTON_TEXT;
|
|
294
|
-
lastSevenDaysButton.appendChild(slot);
|
|
295
|
-
return lastSevenDaysButton;
|
|
296
|
-
}
|
|
297
|
-
/** Returns a last thirty days button. */
|
|
298
|
-
export function getLastThirtyDaysButton() {
|
|
299
|
-
const lastThirtyDaysButton = document.createElement('forge-button');
|
|
300
|
-
lastThirtyDaysButton.id = CALENDAR_CONSTANTS.ids.LAST_THIRTY_DAYS_BUTTON;
|
|
301
|
-
lastThirtyDaysButton.setAttribute('part', CALENDAR_CONSTANTS.parts.LAST_THIRTY_DAYS_BUTTON);
|
|
302
|
-
lastThirtyDaysButton.type = 'button';
|
|
303
|
-
const slot = document.createElement('slot');
|
|
304
|
-
slot.name = CALENDAR_CONSTANTS.slots.LAST_THIRTY_DAYS_BUTTON_TEXT;
|
|
305
|
-
slot.innerText = CALENDAR_CONSTANTS.strings.DEFAULT_LAST_THIRTY_DAYS_BUTTON_TEXT;
|
|
306
|
-
lastThirtyDaysButton.appendChild(slot);
|
|
307
|
-
return lastThirtyDaysButton;
|
|
308
|
-
}
|
|
309
273
|
/** Checks whether an event originated from a date element, returning the element if it did. */
|
|
310
274
|
export function eventIncludesDate(evt, includeDisabled) {
|
|
311
275
|
const element = getEventPath(evt).find(p => p.classList && p.classList.contains(CALENDAR_CONSTANTS.classes.DATE));
|
|
@@ -17,20 +17,11 @@ export interface ICalendarComponent extends ICalendarBase, IBaseComponent {
|
|
|
17
17
|
menuAnimation: CalendarMenuAnimationType;
|
|
18
18
|
clearButton: boolean;
|
|
19
19
|
todayButton: boolean;
|
|
20
|
-
yesterdayButton: boolean;
|
|
21
|
-
lastSevenDaysButton: boolean;
|
|
22
|
-
lastThirtyDaysButton: boolean;
|
|
23
20
|
clearCallback: (() => void) | undefined;
|
|
24
21
|
todayCallback: (() => void) | undefined;
|
|
25
|
-
yesterdayCallback: (() => void) | undefined;
|
|
26
|
-
lastSevenDaysCallback: (() => void) | undefined;
|
|
27
|
-
lastThirtyDaysCallback: (() => void) | undefined;
|
|
28
22
|
tooltipBuilder: CalendarTooltipBuilder | undefined;
|
|
29
23
|
clear(): void;
|
|
30
24
|
today(): void;
|
|
31
|
-
yesterday(): void;
|
|
32
|
-
lastSevenDays(): void;
|
|
33
|
-
lastThirtyDays(): void;
|
|
34
25
|
selectDate(date: Date, setFocus?: boolean): void;
|
|
35
26
|
deselectDate(date: Date): void;
|
|
36
27
|
toggleDate(date: Date, force?: boolean): void;
|
|
@@ -83,15 +74,6 @@ declare global {
|
|
|
83
74
|
* @property {boolean} [showToday=true] - Whether to show the today button.
|
|
84
75
|
* @property {boolean} [todayButton=false] - Whether to show a button to select today.
|
|
85
76
|
* @property {() => void | undefined} todayCallback - Callback function to call when the today button is clicked.
|
|
86
|
-
* @property {boolean} [showYesterday=true] - Whether to show the yesterday button.
|
|
87
|
-
* @property {boolean} [yesterdayButton=false] - Whether to show a button to select yesterday.
|
|
88
|
-
* @property {() => void | undefined} yesterdayCallback - Callback function to call when the yesterday button is clicked.
|
|
89
|
-
* @property {boolean} [showLastSevenDays=true] - Whether to show the last seven days button.
|
|
90
|
-
* @property {boolean} [lastSevenDaysButton=false] - Whether to show a button to select last seven days.
|
|
91
|
-
* @property {() => void | undefined} lastSevenDaysCallback - Callback function to call when the last seven days button is clicked.
|
|
92
|
-
* @property {boolean} [showLastThirtyDays=true] - Whether to show the last thirty days button.
|
|
93
|
-
* @property {boolean} [lastThirtyDaysButton=false] - Whether to show a button to select last thirty days.
|
|
94
|
-
* @property {() => void | undefined} lastThirtyDaysCallback - Callback function to call when the last thirty days button is clicked.
|
|
95
77
|
* @property {CalendarTooltipBuilder | undefined} tooltipBuilder - Function to build the tooltip content.
|
|
96
78
|
* @property {Date | Date[] | DateRange | null | undefined} [value=[]] - The selected date(s).
|
|
97
79
|
* @property {CalendarView} [view="date"] - The view of the calendar.
|
|
@@ -117,13 +99,7 @@ declare global {
|
|
|
117
99
|
* @attribute {boolean} [show-header=true] - Whether to show the header.
|
|
118
100
|
* @attribute {boolean} [show-other-months=false] - Whether to show days from other months.
|
|
119
101
|
* @attribute {boolean} [show-today=true] - Whether to show the today button.
|
|
120
|
-
* @attribute {boolean} [today-button=
|
|
121
|
-
* @attribute {boolean} [show-yesterday=true] - Whether to show the yesterday button.
|
|
122
|
-
* @attribute {boolean} [yesterday-button=false] - Whether to show a button to select yesterday.
|
|
123
|
-
* @attribute {boolean} [show-last-seven-days=true] - Whether to show the last seven days button.
|
|
124
|
-
* @attribute {boolean} [last-seven-days-button=false] - Whether to show a button to select last seven days.
|
|
125
|
-
* @attribute {boolean} [show-last-thirty-days=true] - Whether to show the last thirty days button.
|
|
126
|
-
* @attribute {boolean} [last-thirty-days-button=false] - Whether to show a button to select last thirty days.
|
|
102
|
+
* @attribute {boolean} [today-button=fakse] - Whether to show a button to select today.
|
|
127
103
|
* @attribute {CalendarView} [view="date"] - The view of the calendar.
|
|
128
104
|
* @attribute {number} [year=<current year>] - The year to display.
|
|
129
105
|
* @attribute {string} [year-range="-50:+50"] - The range of years to display.
|
|
@@ -134,9 +110,6 @@ declare global {
|
|
|
134
110
|
* @fires {CustomEvent<CalendarView>} forge-calendar-view-change - Event fired when the view changes.
|
|
135
111
|
*
|
|
136
112
|
* @slot today-button-text - Text to display in the today button.
|
|
137
|
-
* @slot yesterday-button-text - Text to display in the yesterday button.
|
|
138
|
-
* @slot last-seven-days-button-text - Text to display in the last seven days button.
|
|
139
|
-
* @slot last-thirty-days-button-text - Text to display in the last thirty days button.
|
|
140
113
|
* @slot clear-button-text - Text to display in the clear button.
|
|
141
114
|
* @slot next-month-button-text - Text to display in the next month button's tooltip.
|
|
142
115
|
* @slot previous-month-button-text - Text to display in the previous month button's tooltip.
|
|
@@ -183,15 +156,6 @@ export declare class CalendarComponent extends BaseComponent implements ICalenda
|
|
|
183
156
|
showToday: boolean;
|
|
184
157
|
todayButton: boolean;
|
|
185
158
|
todayCallback: (() => void) | undefined;
|
|
186
|
-
showYesterday: boolean;
|
|
187
|
-
yesterdayButton: boolean;
|
|
188
|
-
yesterdayCallback: (() => void) | undefined;
|
|
189
|
-
showLastSevenDays: boolean;
|
|
190
|
-
lastSevenDaysButton: boolean;
|
|
191
|
-
lastSevenDaysCallback: (() => void) | undefined;
|
|
192
|
-
showLastThirtyDays: boolean;
|
|
193
|
-
lastThirtyDaysButton: boolean;
|
|
194
|
-
lastThirtyDaysCallback: (() => void) | undefined;
|
|
195
159
|
tooltipBuilder: CalendarTooltipBuilder | undefined;
|
|
196
160
|
value: Date | Date[] | DateRange | null | undefined;
|
|
197
161
|
view: CalendarView;
|
|
@@ -230,9 +194,6 @@ export declare class CalendarComponent extends BaseComponent implements ICalenda
|
|
|
230
194
|
* Sets the calendar to today.
|
|
231
195
|
*/
|
|
232
196
|
today(): void;
|
|
233
|
-
yesterday(): void;
|
|
234
|
-
lastSevenDays(): void;
|
|
235
|
-
lastThirtyDays(): void;
|
|
236
197
|
/**
|
|
237
198
|
* Toggles a date selection.
|
|
238
199
|
*/
|
package/esm/calendar/calendar.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { __decorate } from "tslib";
|
|
7
7
|
import { customElement, attachShadowTemplate, coreProperty, coerceNumber, coerceBoolean, elementParents } from '@tylertech/forge-core';
|
|
8
|
-
import { tylIconAdd, tylIconArrowDropDown, tylIconKeyboardArrowLeft, tylIconKeyboardArrowRight, tylIconLens } from '@tylertech/tyler-icons
|
|
8
|
+
import { tylIconAdd, tylIconArrowDropDown, tylIconKeyboardArrowLeft, tylIconKeyboardArrowRight, tylIconLens } from '@tylertech/tyler-icons';
|
|
9
9
|
import { CalendarAdapter } from './calendar-adapter';
|
|
10
10
|
import { CalendarCore } from './calendar-core';
|
|
11
11
|
import { CALENDAR_CONSTANTS } from './calendar-constants';
|
|
@@ -18,7 +18,7 @@ import { StateLayerComponent } from '../state-layer';
|
|
|
18
18
|
import { FocusIndicatorComponent } from '../focus-indicator';
|
|
19
19
|
import { BaseComponent } from '../core/base/base-component';
|
|
20
20
|
const template = '<template><div class=\"forge-calendar\" part=\"root\"><div id=\"view\" class=\"forge-calendar__view\" part=\"view\"><div id=\"date-view\" class=\"forge-calendar__date-view\" role=\"grid\" part=\"date-view\"><div role=\"rowgroup\" part=\"date-view-container\"><div id=\"day-row\" class=\"forge-calendar__date-view__row\" role=\"row\" part=\"date-view-row\"></div></div><div id=\"date-grid\" class=\"forge-calendar__date-grid\" role=\"rowgroup\" part=\"date-grid-container\"></div></div><forge-calendar-menu id=\"menu\" part=\"calendar-menu\"></forge-calendar-menu></div></div></template>';
|
|
21
|
-
const styles = '.forge-calendar{width:var(--forge-calendar-width,100%);height:fit-content;position:relative}.forge-calendar__header{padding:var(--forge-calendar-controls-padding,0);display:flex;align-items:center;justify-content:space-between}.forge-calendar__footer{padding:var(--forge-calendar-controls-padding,0);display:
|
|
21
|
+
const styles = '.forge-calendar{width:var(--forge-calendar-width,100%);height:fit-content;position:relative}.forge-calendar__header{padding:var(--forge-calendar-controls-padding,0);display:flex;align-items:center;justify-content:space-between}.forge-calendar__footer{padding:var(--forge-calendar-controls-padding,0);display:flex;align-items:center;justify-content:space-between}.forge-calendar__view{position:relative}.forge-calendar__date-view{display:block}.forge-calendar__date-view__row{display:grid;grid-template-columns:repeat(7,1fr)}.forge-calendar__date-grid{display:grid}.forge-calendar__day{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-label2-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-label2-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-font-size-scale, .8125)));font-weight:var(--forge-typography-label2-font-weight,400);line-height:var(--forge-typography-label2-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-label-line-height-scale, 1.25)));letter-spacing:var(--forge-typography-label2-letter-spacing, .0096153846em);text-transform:var(--forge-typography-label2-text-transform,inherit);text-decoration:var(--forge-typography-label2-text-decoration,inherit);display:flex;justify-content:center;align-items:center;min-width:0;padding:0;font-weight:700;user-select:none}.forge-calendar__day::after{float:left;padding-top:100%;content:\"\"}.forge-calendar__date{margin-top:var(--forge-calendar-row-gap,2px);min-width:0;padding:0;border-radius:50%;position:relative;outline:0;cursor:default;user-select:none}.forge-calendar__date::after{float:left;padding-top:100%;content:\"\"}.forge-calendar__date forge-focus-indicator{--forge-focus-indicator-shape:50%}.forge-calendar__date__inner{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--forge-typography-body1-font-family, var(--forge-typography-font-family, \"Roboto\", sans-serif));font-size:var(--forge-typography-body1-font-size, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-font-size-scale, .875)));font-weight:var(--forge-typography-body1-font-weight,400);line-height:var(--forge-typography-body1-line-height, calc(var(--forge-typography-font-size, 1rem) * var(--forge-typography-body-line-height-scale, 1.125)));letter-spacing:var(--forge-typography-body1-letter-spacing, .0357142857em);text-transform:var(--forge-typography-body1-text-transform,inherit);text-decoration:var(--forge-typography-body1-text-decoration,inherit);position:absolute;width:calc(100% - 2px);height:calc(100% - 2px);top:calc(2px / 2);left:calc(2px / 2);display:flex;justify-content:center;align-items:center;border-radius:inherit;box-sizing:border-box}.forge-calendar--show-today .forge-calendar__date--today:not([disabled]){color:var(--forge-theme-primary,#3f51b5);border-color:var(--forge-theme-primary,#3f51b5)}.forge-calendar--show-today .forge-calendar__date--today .forge-calendar__date__inner{border-color:inherit;border-width:1px;border-style:solid;font-weight:700}.forge-calendar--show-today .forge-calendar__date--today.forge-calendar__date--selected{color:var(--forge-theme-on-primary,#fff)}.forge-calendar:not(.forge-calendar--readonly) .forge-calendar__date:not([disabled]){cursor:pointer}.forge-calendar__date--selected:not([disabled]) .forge-calendar__date__inner{background-color:var(--forge-theme-primary,#3f51b5);color:var(--forge-theme-on-primary,#fff)}.forge-calendar__date--selected[disabled] .forge-calendar__date__inner{background-color:var(--forge-theme-primary-container-minimum,#f7f8fc);color:var(--forge-theme-text-low,rgba(0,0,0,.38))}.forge-calendar__date--selected forge-focus-indicator{--forge-focus-indicator-color:var(--forge-theme-primary-container)}.forge-calendar__date[disabled]{color:var(--forge-theme-text-low,rgba(0,0,0,.38))}.forge-calendar__date-spacer{pointer-events:none}.forge-calendar--fixed-height .forge-calendar__date-spacer{margin-top:var(--forge-calendar-row-gap,2px)}.forge-calendar--fixed-height .forge-calendar__date-spacer::after{float:left;padding-top:100%;content:\"\"}.forge-calendar__range:not(.forge-calendar__date-spacer) .forge-calendar__range__target{background-color:var(--forge-theme-primary,#3f51b5);position:absolute;width:100%;height:100%;opacity:.14;border-radius:0}.forge-calendar__range:not(.forge-calendar__date-spacer).forge-calendar__range--start .forge-calendar__range__target{border-top-left-radius:50%;border-bottom-left-radius:50%}.forge-calendar__range:not(.forge-calendar__date-spacer).forge-calendar__range--end .forge-calendar__range__target{border-top-right-radius:50%;border-bottom-right-radius:50%}.forge-calendar__range:not(.forge-calendar__range--start):first-of-type .forge-calendar__range__target{border-top-left-radius:4px;border-bottom-left-radius:4px}.forge-calendar__range:not(.forge-calendar__range--end):last-of-type .forge-calendar__range__target{border-top-right-radius:4px;border-bottom-right-radius:4px}.forge-calendar--allow-single-date-range .forge-calendar__range--start.forge-calendar__range--end .forge-calendar__range__target{transition:transform .2s;transform:scale(1.15);transform-origin:center}.forge-calendar__event{font-size:var(--forge-calendar-event-dot-size, 12px)}.forge-calendar__event[data-event-theme=primary]{color:var(--forge-calendar-theme-event-primary-accent,#3f51b5)}.forge-calendar__event[data-event-theme=secondary]{color:var(--forge-calendar-theme-event-secondary-accent,#ffc107)}.forge-calendar__event[data-event-theme=blue]{color:var(--forge-calendar-theme-event-blue-accent,#2196f3)}.forge-calendar__event[data-event-theme=light-green]{color:var(--forge-calendar-theme-event-light-green-accent,#8bc34a)}.forge-calendar__event[data-event-theme=cyan]{color:var(--forge-calendar-theme-event-cyan-accent,#00bcd4)}.forge-calendar__event[data-event-theme=teal]{color:var(--forge-calendar-theme-event-teal-accent,#009688)}.forge-calendar__event[data-event-theme=orange]{color:var(--forge-calendar-theme-event-orange-accent,#ff9800)}.forge-calendar__event[data-event-theme=blue-grey]{color:var(--forge-calendar-theme-event-blue-grey-accent,#607d8b)}.forge-calendar__event[data-event-theme=grey]{color:var(--forge-calendar-theme-event-grey-accent,#9e9e9e)}.forge-calendar__event[data-event-theme=red]{color:var(--forge-calendar-theme-event-red-accent,#f44336)}.forge-calendar__event[data-event-theme=pink]{color:var(--forge-calendar-theme-event-pink-accent,#e91e63)}.forge-calendar__event[data-event-theme=purple]{color:var(--forge-calendar-theme-event-purple-accent,#9c27b0)}.forge-calendar__event[data-event-theme=light-blue]{color:var(--forge-calendar-theme-event-light-blue-accent,#03a9f4)}.forge-calendar__event[data-event-theme=deep-purple]{color:var(--forge-calendar-theme-event-deep-purple-accent,#673ab7)}.forge-calendar__event[data-event-theme=green]{color:var(--forge-calendar-theme-event-green-accent,#4caf50)}.forge-calendar__event[data-event-theme=lime]{color:var(--forge-calendar-theme-event-lime-accent,#cddc39)}.forge-calendar__event[data-event-theme=yellow]{color:var(--forge-calendar-theme-event-yellow-accent,#ffeb3b)}.forge-calendar__event[data-event-theme=brown]{color:var(--forge-calendar-theme-event-brown-accent,#795548)}.forge-calendar__event[data-event-theme=deep-orange]{color:var(--forge-calendar-theme-event-deep-orange-accent,#ff5722)}.forge-calendar__date[disabled] .forge-calendar__event{opacity:.14}.forge-calendar__event--overflow{background-color:var(--forge-theme-surface,#fff);color:var(--forge-theme-on-surface,#000);border-radius:50%}.forge-calendar__event__wrapper{display:flex;justify-content:center;gap:2px;position:absolute;bottom:0;left:0;width:100%;padding-bottom:2px;pointer-events:none}.forge-calendar__date-spacer .forge-calendar__event__wrapper{display:none}.forge-calendar--rtl .forge-calendar__header forge-icon-button forge-icon{transform:rotate(180deg)}#accessible-header{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:fixed;width:1px;outline:0;-webkit-appearance:none;-moz-appearance:none}#month-button forge-icon{transition:transform .2s}.forge-calendar--month-menu-open #month-button forge-icon{transform:rotate(180deg)}#year-button forge-icon{transition:transform .2s}.forge-calendar--year-menu-open #year-button forge-icon{transform:rotate(180deg)}:host{--forge-calendar-event-stroke-color:var(--forge-theme-surface, #ffffff);display:inline-block}:host([hidden]){display:none}:host([forge-popover-context=true]){--forge-calendar-event-stroke-color:var(--forge-theme-surface-bright, #ffffff)}';
|
|
22
22
|
/**
|
|
23
23
|
* @tag forge-calendar
|
|
24
24
|
*
|
|
@@ -52,15 +52,6 @@ const styles = '.forge-calendar{width:var(--forge-calendar-width,100%);height:fi
|
|
|
52
52
|
* @property {boolean} [showToday=true] - Whether to show the today button.
|
|
53
53
|
* @property {boolean} [todayButton=false] - Whether to show a button to select today.
|
|
54
54
|
* @property {() => void | undefined} todayCallback - Callback function to call when the today button is clicked.
|
|
55
|
-
* @property {boolean} [showYesterday=true] - Whether to show the yesterday button.
|
|
56
|
-
* @property {boolean} [yesterdayButton=false] - Whether to show a button to select yesterday.
|
|
57
|
-
* @property {() => void | undefined} yesterdayCallback - Callback function to call when the yesterday button is clicked.
|
|
58
|
-
* @property {boolean} [showLastSevenDays=true] - Whether to show the last seven days button.
|
|
59
|
-
* @property {boolean} [lastSevenDaysButton=false] - Whether to show a button to select last seven days.
|
|
60
|
-
* @property {() => void | undefined} lastSevenDaysCallback - Callback function to call when the last seven days button is clicked.
|
|
61
|
-
* @property {boolean} [showLastThirtyDays=true] - Whether to show the last thirty days button.
|
|
62
|
-
* @property {boolean} [lastThirtyDaysButton=false] - Whether to show a button to select last thirty days.
|
|
63
|
-
* @property {() => void | undefined} lastThirtyDaysCallback - Callback function to call when the last thirty days button is clicked.
|
|
64
55
|
* @property {CalendarTooltipBuilder | undefined} tooltipBuilder - Function to build the tooltip content.
|
|
65
56
|
* @property {Date | Date[] | DateRange | null | undefined} [value=[]] - The selected date(s).
|
|
66
57
|
* @property {CalendarView} [view="date"] - The view of the calendar.
|
|
@@ -86,13 +77,7 @@ const styles = '.forge-calendar{width:var(--forge-calendar-width,100%);height:fi
|
|
|
86
77
|
* @attribute {boolean} [show-header=true] - Whether to show the header.
|
|
87
78
|
* @attribute {boolean} [show-other-months=false] - Whether to show days from other months.
|
|
88
79
|
* @attribute {boolean} [show-today=true] - Whether to show the today button.
|
|
89
|
-
* @attribute {boolean} [today-button=
|
|
90
|
-
* @attribute {boolean} [show-yesterday=true] - Whether to show the yesterday button.
|
|
91
|
-
* @attribute {boolean} [yesterday-button=false] - Whether to show a button to select yesterday.
|
|
92
|
-
* @attribute {boolean} [show-last-seven-days=true] - Whether to show the last seven days button.
|
|
93
|
-
* @attribute {boolean} [last-seven-days-button=false] - Whether to show a button to select last seven days.
|
|
94
|
-
* @attribute {boolean} [show-last-thirty-days=true] - Whether to show the last thirty days button.
|
|
95
|
-
* @attribute {boolean} [last-thirty-days-button=false] - Whether to show a button to select last thirty days.
|
|
80
|
+
* @attribute {boolean} [today-button=fakse] - Whether to show a button to select today.
|
|
96
81
|
* @attribute {CalendarView} [view="date"] - The view of the calendar.
|
|
97
82
|
* @attribute {number} [year=<current year>] - The year to display.
|
|
98
83
|
* @attribute {string} [year-range="-50:+50"] - The range of years to display.
|
|
@@ -103,9 +88,6 @@ const styles = '.forge-calendar{width:var(--forge-calendar-width,100%);height:fi
|
|
|
103
88
|
* @fires {CustomEvent<CalendarView>} forge-calendar-view-change - Event fired when the view changes.
|
|
104
89
|
*
|
|
105
90
|
* @slot today-button-text - Text to display in the today button.
|
|
106
|
-
* @slot yesterday-button-text - Text to display in the yesterday button.
|
|
107
|
-
* @slot last-seven-days-button-text - Text to display in the last seven days button.
|
|
108
|
-
* @slot last-thirty-days-button-text - Text to display in the last thirty days button.
|
|
109
91
|
* @slot clear-button-text - Text to display in the clear button.
|
|
110
92
|
* @slot next-month-button-text - Text to display in the next month button's tooltip.
|
|
111
93
|
* @slot previous-month-button-text - Text to display in the previous month button's tooltip.
|
|
@@ -136,12 +118,6 @@ let CalendarComponent = class CalendarComponent extends BaseComponent {
|
|
|
136
118
|
CALENDAR_CONSTANTS.attributes.SHOW_OTHER_MONTHS,
|
|
137
119
|
CALENDAR_CONSTANTS.attributes.SHOW_TODAY,
|
|
138
120
|
CALENDAR_CONSTANTS.attributes.TODAY_BUTTON,
|
|
139
|
-
CALENDAR_CONSTANTS.attributes.SHOW_YESTERDAY,
|
|
140
|
-
CALENDAR_CONSTANTS.attributes.YESTERDAY_BUTTON,
|
|
141
|
-
CALENDAR_CONSTANTS.attributes.SHOW_LAST_SEVEN_DAYS,
|
|
142
|
-
CALENDAR_CONSTANTS.attributes.LAST_SEVEN_DAYS_BUTTON,
|
|
143
|
-
CALENDAR_CONSTANTS.attributes.SHOW_LAST_THIRTY_DAYS,
|
|
144
|
-
CALENDAR_CONSTANTS.attributes.LAST_THIRTY_DAYS_BUTTON,
|
|
145
121
|
CALENDAR_CONSTANTS.attributes.VIEW,
|
|
146
122
|
CALENDAR_CONSTANTS.attributes.YEAR,
|
|
147
123
|
CALENDAR_CONSTANTS.attributes.YEAR_RANGE
|
|
@@ -224,24 +200,6 @@ let CalendarComponent = class CalendarComponent extends BaseComponent {
|
|
|
224
200
|
case CALENDAR_CONSTANTS.attributes.TODAY_BUTTON:
|
|
225
201
|
this.todayButton = coerceBoolean(newValue);
|
|
226
202
|
break;
|
|
227
|
-
case CALENDAR_CONSTANTS.attributes.SHOW_YESTERDAY:
|
|
228
|
-
this.showYesterday = coerceBoolean(newValue);
|
|
229
|
-
break;
|
|
230
|
-
case CALENDAR_CONSTANTS.attributes.YESTERDAY_BUTTON:
|
|
231
|
-
this.yesterdayButton = coerceBoolean(newValue);
|
|
232
|
-
break;
|
|
233
|
-
case CALENDAR_CONSTANTS.attributes.SHOW_LAST_SEVEN_DAYS:
|
|
234
|
-
this.showLastSevenDays = coerceBoolean(newValue);
|
|
235
|
-
break;
|
|
236
|
-
case CALENDAR_CONSTANTS.attributes.LAST_SEVEN_DAYS_BUTTON:
|
|
237
|
-
this.lastSevenDaysButton = coerceBoolean(newValue);
|
|
238
|
-
break;
|
|
239
|
-
case CALENDAR_CONSTANTS.attributes.SHOW_LAST_THIRTY_DAYS:
|
|
240
|
-
this.showLastThirtyDays = coerceBoolean(newValue);
|
|
241
|
-
break;
|
|
242
|
-
case CALENDAR_CONSTANTS.attributes.LAST_THIRTY_DAYS_BUTTON:
|
|
243
|
-
this.lastThirtyDaysButton = coerceBoolean(newValue);
|
|
244
|
-
break;
|
|
245
203
|
case CALENDAR_CONSTANTS.attributes.VIEW:
|
|
246
204
|
this.view = newValue;
|
|
247
205
|
break;
|
|
@@ -301,15 +259,6 @@ let CalendarComponent = class CalendarComponent extends BaseComponent {
|
|
|
301
259
|
today() {
|
|
302
260
|
this._core.today();
|
|
303
261
|
}
|
|
304
|
-
yesterday() {
|
|
305
|
-
this._core.yesterday();
|
|
306
|
-
}
|
|
307
|
-
lastSevenDays() {
|
|
308
|
-
this._core.lastSevenDays();
|
|
309
|
-
}
|
|
310
|
-
lastThirtyDays() {
|
|
311
|
-
this._core.lastThirtyDays();
|
|
312
|
-
}
|
|
313
262
|
/**
|
|
314
263
|
* Toggles a date selection.
|
|
315
264
|
*/
|
|
@@ -407,33 +356,6 @@ __decorate([
|
|
|
407
356
|
__decorate([
|
|
408
357
|
coreProperty()
|
|
409
358
|
], CalendarComponent.prototype, "todayCallback", void 0);
|
|
410
|
-
__decorate([
|
|
411
|
-
coreProperty()
|
|
412
|
-
], CalendarComponent.prototype, "showYesterday", void 0);
|
|
413
|
-
__decorate([
|
|
414
|
-
coreProperty()
|
|
415
|
-
], CalendarComponent.prototype, "yesterdayButton", void 0);
|
|
416
|
-
__decorate([
|
|
417
|
-
coreProperty()
|
|
418
|
-
], CalendarComponent.prototype, "yesterdayCallback", void 0);
|
|
419
|
-
__decorate([
|
|
420
|
-
coreProperty()
|
|
421
|
-
], CalendarComponent.prototype, "showLastSevenDays", void 0);
|
|
422
|
-
__decorate([
|
|
423
|
-
coreProperty()
|
|
424
|
-
], CalendarComponent.prototype, "lastSevenDaysButton", void 0);
|
|
425
|
-
__decorate([
|
|
426
|
-
coreProperty()
|
|
427
|
-
], CalendarComponent.prototype, "lastSevenDaysCallback", void 0);
|
|
428
|
-
__decorate([
|
|
429
|
-
coreProperty()
|
|
430
|
-
], CalendarComponent.prototype, "showLastThirtyDays", void 0);
|
|
431
|
-
__decorate([
|
|
432
|
-
coreProperty()
|
|
433
|
-
], CalendarComponent.prototype, "lastThirtyDaysButton", void 0);
|
|
434
|
-
__decorate([
|
|
435
|
-
coreProperty()
|
|
436
|
-
], CalendarComponent.prototype, "lastThirtyDaysCallback", void 0);
|
|
437
359
|
__decorate([
|
|
438
360
|
coreProperty()
|
|
439
361
|
], CalendarComponent.prototype, "tooltipBuilder", void 0);
|
|
@@ -22,9 +22,6 @@ export interface ICalendarBase {
|
|
|
22
22
|
readonly: boolean;
|
|
23
23
|
showOtherMonths: boolean;
|
|
24
24
|
showToday: boolean;
|
|
25
|
-
showYesterday: boolean;
|
|
26
|
-
showLastSevenDays: boolean;
|
|
27
|
-
showLastThirtyDays: boolean;
|
|
28
25
|
value: Date | Date[] | DateRange | null | undefined;
|
|
29
26
|
weekendDays: DayOfWeek[] | null | undefined;
|
|
30
27
|
year: number;
|
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
export interface IDateRange {
|
|
7
7
|
from?: Date;
|
|
8
8
|
to?: Date;
|
|
9
|
-
rangeName?: string;
|
|
10
9
|
}
|
|
11
10
|
export declare class DateRange implements IDateRange {
|
|
12
11
|
from?: Date;
|
|
13
12
|
to?: Date;
|
|
14
|
-
rangeName?: string;
|
|
15
13
|
constructor(range?: IDateRange | null);
|
|
16
14
|
copy(): DateRange;
|
|
17
15
|
}
|