@getflip/swirl-components-react 0.3.0 → 0.5.0
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/dist/file-manager.entry.5df78d98.js +58 -0
- package/dist/{flip-action-list-item.entry.bfe816d0.js → flip-action-list-item.entry.080e14b7.js} +1 -1
- package/dist/{flip-action-list-section.entry.8072859c.js → flip-action-list-section.entry.59cc892d.js} +1 -1
- package/dist/{flip-action-list.entry.07c4e8cb.js → flip-action-list.entry.34dd165b.js} +2 -2
- package/dist/flip-app-layout_5.entry.20b263f5.js +215 -0
- package/dist/flip-autocomplete.entry.a63ad331.js +70 -0
- package/dist/{flip-avatar-group.entry.f987aa8b.js → flip-avatar-group.entry.e00bcff1.js} +1 -1
- package/dist/flip-avatar.entry.32cb98bf.js +57 -0
- package/dist/flip-badge.entry.63e2d414.js +20 -0
- package/dist/{flip-banner.entry.50b72a3f.js → flip-banner.entry.a2f5eef8.js} +1 -1
- package/dist/{flip-button-group.entry.9261c585.js → flip-button-group.entry.7856eb4f.js} +1 -1
- package/dist/{flip-button.entry.98440a9e.js → flip-button.entry.82de4159.js} +13 -7
- package/dist/{flip-checkbox.entry.56d1e132.js → flip-checkbox.entry.4af2f2b4.js} +10 -7
- package/dist/{flip-chip.entry.e2be5143.js → flip-chip.entry.9e153968.js} +1 -1
- package/dist/flip-console-layout.entry.940ff9f8.js +22 -0
- package/dist/{flip-date-input.entry.2d5088ea.js → flip-date-input.entry.dce529bc.js} +6 -4
- package/dist/{flip-date-picker_3.entry.d61d1842.js → flip-date-picker_2.entry.177499d7.js} +276 -367
- package/dist/{flip-description-list-item.entry.ebdd7136.js → flip-description-list-item.entry.efd60d4e.js} +1 -1
- package/dist/{flip-description-list.entry.48a4d48b.js → flip-description-list.entry.28fc026b.js} +1 -1
- package/dist/{flip-dialog.entry.bec58ff3.js → flip-dialog.entry.1f35195b.js} +1 -1
- package/dist/{flip-file-uploader.entry.d8919920.js → flip-file-uploader.entry.3888ef19.js} +1 -1
- package/dist/{flip-file-viewer-audio_6.entry.6ac11dbe.js → flip-file-viewer_7.entry.098a3dac.js} +4964 -4794
- package/dist/flip-form-control.entry.8a1150c0.js +65 -0
- package/dist/{flip-form-group.entry.52e6ee89.js → flip-form-group.entry.42d83af8.js} +1 -1
- package/dist/flip-heading_2.entry.36e0c785.js +29 -0
- package/dist/{flip-icon-add-photo.entry.897fe115.js → flip-icon-add-photo.entry.4a5cdf22.js} +1 -1
- package/dist/flip-icon-add_4.entry.890da8d3.js +45 -0
- package/dist/{flip-icon-admin-panel-settings.entry.d1c445fd.js → flip-icon-admin-panel-settings.entry.29420ba1.js} +1 -1
- package/dist/{flip-icon-arrow-back.entry.e054a0e8.js → flip-icon-arrow-back.entry.c75093f3.js} +1 -1
- package/dist/{flip-icon-arrow-forward.entry.ceea49fe.js → flip-icon-arrow-forward.entry.a5ba53d2.js} +1 -1
- package/dist/{flip-icon-arrow-left_3.entry.ec0b28c1.js → flip-icon-arrow-left_3.entry.492c928f.js} +1 -1
- package/dist/{flip-icon-arrow-right-small.entry.88470f4b.js → flip-icon-arrow-right-small.entry.d977647f.js} +1 -1
- package/dist/{flip-icon-attachment.entry.c141c860.js → flip-icon-attachment.entry.33509693.js} +1 -1
- package/dist/{flip-icon-expand-less_3.entry.6e9d656c.js → flip-icon-cancel_4.entry.c7533bde.js} +23 -13
- package/dist/{flip-icon-chat-bubble.entry.13a6899b.js → flip-icon-chat-bubble.entry.796b792b.js} +1 -1
- package/dist/{flip-icon-check-circle.entry.4c134688.js → flip-icon-check-circle.entry.942c13d5.js} +1 -1
- package/dist/flip-icon-check-small_3.entry.0b74d78c.js +143 -0
- package/dist/{flip-icon-check-strong.entry.819065e2.js → flip-icon-check-strong.entry.f072021d.js} +1 -1
- package/dist/{flip-icon-check.entry.e9e18ec0.js → flip-icon-check.entry.e4c5c94a.js} +1 -1
- package/dist/{flip-icon-chevron-left.entry.8b4f8813.js → flip-icon-chevron-left.entry.65b612e3.js} +1 -1
- package/dist/{flip-icon-chevron-right.entry.d32eba9e.js → flip-icon-chevron-right.entry.0ea10200.js} +1 -1
- package/dist/{flip-icon-close-small.entry.e18fcac6.js → flip-icon-close-small.entry.cccd694a.js} +1 -1
- package/dist/{flip-icon-close.entry.30a8abc3.js → flip-icon-close.entry.cf4afdfd.js} +1 -1
- package/dist/{flip-icon-cloud-upload.entry.6412d35e.js → flip-icon-cloud-upload.entry.8f2ba9c7.js} +1 -1
- package/dist/{flip-icon-comment.entry.731b5907.js → flip-icon-comment.entry.bd9871c6.js} +1 -1
- package/dist/{flip-icon-copy.entry.c29519f3.js → flip-icon-copy.entry.1b311d2c.js} +1 -1
- package/dist/{flip-icon-date-range.entry.d6dea969.js → flip-icon-date-range.entry.20ae3be8.js} +1 -1
- package/dist/{flip-icon-delete.entry.e99d814a.js → flip-icon-delete.entry.91cce4b6.js} +1 -1
- package/dist/{flip-icon-description.entry.8448b398.js → flip-icon-description.entry.1e861585.js} +1 -1
- package/dist/{flip-icon-edit.entry.3ae910b7.js → flip-icon-edit.entry.6ce0adc0.js} +1 -1
- package/dist/{flip-icon-emoji-mood.entry.89308bc3.js → flip-icon-emoji-mood.entry.26ff5f4c.js} +1 -1
- package/dist/{flip-icon-emoji-satisfied.entry.5a9bca01.js → flip-icon-emoji-satisfied.entry.c5964eb2.js} +1 -1
- package/dist/{flip-icon-error_3.entry.f44ffe60.js → flip-icon-error_3.entry.ed9ea2ba.js} +1 -1
- package/dist/{flip-icon-expand-more.entry.d0acac42.js → flip-icon-expand-more.entry.dfe65dc1.js} +1 -1
- package/dist/{flip-icon-file.entry.24508e1d.js → flip-icon-file.entry.1337f4a3.js} +1 -1
- package/dist/{flip-icon-folder-shared.entry.c829f971.js → flip-icon-folder-shared.entry.d729af99.js} +1 -1
- package/dist/{flip-icon-group-assign.entry.ba88a447.js → flip-icon-group-assign.entry.1b26fbcc.js} +1 -1
- package/dist/{flip-icon-groups-custom.entry.eeaaa045.js → flip-icon-groups-custom.entry.f1691911.js} +1 -1
- package/dist/{flip-icon-groups.entry.fb62ee22.js → flip-icon-groups.entry.8ee2103f.js} +1 -1
- package/dist/flip-icon-help.entry.258ffe77.js +15 -0
- package/dist/{flip-icon-image.entry.75eebbb0.js → flip-icon-image.entry.ed9e7cea.js} +1 -1
- package/dist/{flip-icon-info.entry.e30b9669.js → flip-icon-info.entry.7ecf555e.js} +1 -1
- package/dist/{flip-icon-inventory.entry.39ebc534.js → flip-icon-inventory.entry.3dfdaf9f.js} +1 -1
- package/dist/{flip-icon-like.entry.80e5f8b9.js → flip-icon-like.entry.0cc26e51.js} +1 -1
- package/dist/{flip-icon-link.entry.c99a2106.js → flip-icon-link.entry.4a62a637.js} +1 -1
- package/dist/{flip-icon-lock.entry.5957290a.js → flip-icon-lock.entry.de97d106.js} +1 -1
- package/dist/{flip-icon-logout.entry.c6240d44.js → flip-icon-logout.entry.551dbbfc.js} +1 -1
- package/dist/{flip-icon-mail.entry.65b32c8b.js → flip-icon-mail.entry.8f23d662.js} +1 -1
- package/dist/{flip-icon-manage-accounts.entry.73cd3a27.js → flip-icon-manage-accounts.entry.587cc1f2.js} +1 -1
- package/dist/{flip-icon-mention.entry.088e8573.js → flip-icon-mention.entry.dea7e9bd.js} +1 -1
- package/dist/{flip-icon-message.entry.e7306c78.js → flip-icon-message.entry.661d3f8b.js} +1 -1
- package/dist/{flip-icon-more-horizontal.entry.9b6c4ab4.js → flip-icon-more-horizontal.entry.e1b56167.js} +1 -1
- package/dist/{flip-icon-more-vertikal.entry.43a77373.js → flip-icon-more-vertikal.entry.c8c2faf5.js} +1 -1
- package/dist/{flip-icon-notifications-active.entry.b48ff150.js → flip-icon-notifications-active.entry.17e2db26.js} +1 -1
- package/dist/{flip-icon-notifications-off.entry.b60ef6aa.js → flip-icon-notifications-off.entry.fccd2c17.js} +1 -1
- package/dist/{flip-icon-notifications.entry.e2d0f244.js → flip-icon-notifications.entry.fd6974d0.js} +1 -1
- package/dist/{flip-icon-open-in-new.entry.bdcb5f7e.js → flip-icon-open-in-new.entry.377230e7.js} +1 -1
- package/dist/{flip-icon-people-alt.entry.4c0917f0.js → flip-icon-people-alt.entry.ff8dcfad.js} +1 -1
- package/dist/{flip-icon-person-off.entry.4dba1b98.js → flip-icon-person-off.entry.c1046231.js} +1 -1
- package/dist/{flip-icon-person.entry.57042a58.js → flip-icon-person.entry.a8e33281.js} +1 -1
- package/dist/{flip-icon-phone.entry.3ad46317.js → flip-icon-phone.entry.b13cd9db.js} +1 -1
- package/dist/{flip-icon-poll.entry.c14b718c.js → flip-icon-poll.entry.d4d7ab35.js} +1 -1
- package/dist/{flip-icon-print.entry.42bc6751.js → flip-icon-print.entry.e22c899f.js} +1 -1
- package/dist/{flip-icon-recieved.entry.35cc64fd.js → flip-icon-recieved.entry.42365f6e.js} +1 -1
- package/dist/{flip-icon-search-strong.entry.d6722aba.js → flip-icon-search-strong.entry.3e2df830.js} +1 -1
- package/dist/{flip-icon-search.entry.c2c88135.js → flip-icon-search.entry.307ecf81.js} +1 -1
- package/dist/{flip-icon-send.entry.6d3ed0a4.js → flip-icon-send.entry.d821277c.js} +1 -1
- package/dist/{flip-icon-settings.entry.3ab04c76.js → flip-icon-settings.entry.39d549e4.js} +1 -1
- package/dist/{flip-icon-time-filled.entry.050c61d7.js → flip-icon-time-filled.entry.59391c42.js} +1 -1
- package/dist/{flip-icon-time-outlined.entry.195df6e9.js → flip-icon-time-outlined.entry.7828e49b.js} +1 -1
- package/dist/{flip-icon-user-assign.entry.60316828.js → flip-icon-user-assign.entry.d015d6d1.js} +1 -1
- package/dist/{flip-icon-video-camera.entry.d376e2da.js → flip-icon-video-camera.entry.08b245ec.js} +1 -1
- package/dist/{flip-icon-warning.entry.7484d16e.js → flip-icon-warning.entry.6646b827.js} +1 -1
- package/dist/{flip-lightbox.entry.cdffd089.js → flip-lightbox.entry.89522005.js} +2 -2
- package/dist/{flip-link.entry.145e89bf.js → flip-link.entry.21826dcf.js} +1 -1
- package/dist/{flip-list.entry.fcece197.js → flip-list.entry.28ca3e9a.js} +1 -1
- package/dist/{flip-modal.entry.f20fd032.js → flip-modal.entry.9dc00a89.js} +10 -10
- package/dist/{flip-option-list-section.entry.c0084261.js → flip-option-list-section.entry.8016c860.js} +1 -1
- package/dist/{flip-pagination.entry.a8a4c1bf.js → flip-pagination.entry.5c31f8e5.js} +1 -1
- package/dist/flip-pdf-reader.entry.79fd6e1f.js +79 -0
- package/dist/flip-popover.entry.712ebb5b.js +115 -0
- package/dist/{flip-progress-indicator.entry.8069914b.js → flip-progress-indicator.entry.342c1c4c.js} +1 -1
- package/dist/{flip-radio-group.entry.4046ee83.js → flip-radio-group.entry.ab35d743.js} +1 -1
- package/dist/{flip-radio.entry.941e407b.js → flip-radio.entry.35aa66f2.js} +8 -5
- package/dist/{flip-resource-list-file-item.entry.678596e2.js → flip-resource-list-file-item.entry.b56f8795.js} +1 -1
- package/dist/{flip-search.entry.05617d72.js → flip-search.entry.cb0d0faa.js} +1 -1
- package/dist/flip-select.entry.67d74a11.js +48 -0
- package/dist/{flip-stack.entry.60b7e7d8.js → flip-stack.entry.b7e0326d.js} +1 -1
- package/dist/{flip-switch.entry.51a1856d.js → flip-switch.entry.a5b1c2c6.js} +1 -1
- package/dist/{flip-tab.entry.fd12f894.js → flip-tab.entry.97e217ad.js} +1 -1
- package/dist/{flip-tabs.entry.9462dbaa.js → flip-tabs.entry.ad810ab3.js} +1 -1
- package/dist/{flip-tag.entry.923d754e.js → flip-tag.entry.8d4916e7.js} +1 -1
- package/dist/flip-text-input.entry.b963e731.js +60 -0
- package/dist/{flip-theme-provider.entry.ab641668.js → flip-theme-provider.entry.d5dd8213.js} +1 -1
- package/dist/{flip-thumbnail.entry.9d00d2f8.js → flip-thumbnail.entry.5f5e44d2.js} +1 -1
- package/dist/{flip-toast-provider.entry.d0391c9a.js → flip-toast-provider.entry.4c55da45.js} +5 -3
- package/dist/{flip-toast.entry.fac8df58.js → flip-toast.entry.c306c0f6.js} +1 -1
- package/dist/{flip-tooltip.entry.f7d80b92.js → flip-tooltip.entry.4544c9e8.js} +2 -2
- package/dist/{flip-video-thumbnail.entry.f45c61bc.js → flip-video-thumbnail.entry.7e6a70de.js} +1 -1
- package/dist/{flip-visually-hidden.entry.1099adf3.js → flip-visually-hidden.entry.59b6f888.js} +1 -1
- package/dist/index.ac96d2b2.js +1368 -0
- package/dist/stencil-generated/index.d.ts +8 -0
- package/dist/swirl-components-react.js +145 -137
- package/dist/swirl-components-react.umd.cjs +56 -37
- package/dist/utils-39b2afe8.37b54ba4.js +40 -0
- package/package.json +2 -2
- package/dist/flip-avatar.entry.7be29e5c.js +0 -57
- package/dist/flip-badge.entry.bb0eb78d.js +0 -20
- package/dist/flip-empty-state.entry.d125feea.js +0 -15
- package/dist/flip-file-viewer.entry.66629b65.js +0 -95
- package/dist/flip-form-control.entry.c45d4428.js +0 -58
- package/dist/flip-heading.entry.b20bb368.js +0 -18
- package/dist/flip-icon-add.entry.a04d115d.js +0 -15
- package/dist/flip-icon-cancel.entry.07a0efa7.js +0 -15
- package/dist/flip-icon-check-small.entry.1da0f061.js +0 -15
- package/dist/flip-icon-fullscreen-exit.entry.4f7369df.js +0 -15
- package/dist/flip-icon-fullscreen.entry.fe6d6998.js +0 -15
- package/dist/flip-icon-remove.entry.7ce5335b.js +0 -15
- package/dist/flip-option-list-item.entry.ed931c3c.js +0 -30
- package/dist/flip-option-list.entry.a07fd2d3.js +0 -95
- package/dist/flip-resource-list-item.entry.3ba2f6c5.js +0 -41
- package/dist/flip-resource-list.entry.b5f4d108.js +0 -49
- package/dist/flip-text-input.entry.09a6024a.js +0 -55
- package/dist/flip-text.entry.634f95b3.js +0 -18
- package/dist/index.0ccdd659.js +0 -1360
- package/dist/utils-b46bcd4f.79126bb2.js +0 -30
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as Te, s as Se, f as Ve, a as Fe } from "./floating-ui.dom.esm-1a4e8b8a.87557233.js";
|
|
4
|
-
import { e as de, d as He } from "./bodyScrollLock.esm-ce6356d8.2c600fb9.js";
|
|
5
|
-
import { c as Ee } from "./index-6d2e18c6.289636d4.js";
|
|
6
|
-
import { i as ce, q as pe } from "./utils-b46bcd4f.79126bb2.js";
|
|
1
|
+
import { r as le, c as we, h as x, H as be, F as te } from "./index.ac96d2b2.js";
|
|
2
|
+
import { c as de, a as Ce, g as ke } from "./_commonjsHelpers-44457d8d.ba94af77.js";
|
|
7
3
|
import "react";
|
|
8
4
|
import "react-dom";
|
|
9
|
-
var
|
|
10
|
-
(function(
|
|
11
|
-
|
|
12
|
-
})(
|
|
5
|
+
var _e = de(function(D, b) {
|
|
6
|
+
(function(F, W) {
|
|
7
|
+
D.exports = W();
|
|
8
|
+
})(Ce, function() {
|
|
13
9
|
return function() {
|
|
14
|
-
var
|
|
10
|
+
var F = { d: function(r, e) {
|
|
15
11
|
for (var t in e)
|
|
16
|
-
|
|
12
|
+
F.o(e, t) && !F.o(r, t) && Object.defineProperty(r, t, { enumerable: !0, get: e[t] });
|
|
17
13
|
}, o: function(r, e) {
|
|
18
14
|
return Object.prototype.hasOwnProperty.call(r, e);
|
|
19
|
-
} },
|
|
20
|
-
|
|
21
|
-
return
|
|
15
|
+
} }, W = {};
|
|
16
|
+
F.d(W, { default: function() {
|
|
17
|
+
return H;
|
|
22
18
|
} });
|
|
23
|
-
var l = { days: "days", months: "months", years: "years", day: "day", month: "month", year: "year", eventChangeViewDate: "changeViewDate", eventChangeCurrentView: "changeCurrentView", eventChangeFocusDate: "changeFocusDate", eventChangeSelectedDate: "changeSelectedDate", eventChangeTime: "changeTime", eventChangeLastSelectedDate: "changeLastSelectedDate", actionSelectDate: "selectDate", actionUnselectDate: "unselectDate", cssClassWeekend: "-weekend-" },
|
|
24
|
-
function
|
|
19
|
+
var l = { days: "days", months: "months", years: "years", day: "day", month: "month", year: "year", eventChangeViewDate: "changeViewDate", eventChangeCurrentView: "changeCurrentView", eventChangeFocusDate: "changeFocusDate", eventChangeSelectedDate: "changeSelectedDate", eventChangeTime: "changeTime", eventChangeLastSelectedDate: "changeLastSelectedDate", actionSelectDate: "selectDate", actionUnselectDate: "unselectDate", cssClassWeekend: "-weekend-" }, ie = { classes: "", inline: !1, locale: { days: ["\u0412\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435", "\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A", "\u0412\u0442\u043E\u0440\u043D\u0438\u043A", "\u0421\u0440\u0435\u0434\u0430", "\u0427\u0435\u0442\u0432\u0435\u0440\u0433", "\u041F\u044F\u0442\u043D\u0438\u0446\u0430", "\u0421\u0443\u0431\u0431\u043E\u0442\u0430"], daysShort: ["\u0412\u043E\u0441", "\u041F\u043E\u043D", "\u0412\u0442\u043E", "\u0421\u0440\u0435", "\u0427\u0435\u0442", "\u041F\u044F\u0442", "\u0421\u0443\u0431"], daysMin: ["\u0412\u0441", "\u041F\u043D", "\u0412\u0442", "\u0421\u0440", "\u0427\u0442", "\u041F\u0442", "\u0421\u0431"], months: ["\u042F\u043D\u0432\u0430\u0440\u044C", "\u0424\u0435\u0432\u0440\u0430\u043B\u044C", "\u041C\u0430\u0440\u0442", "\u0410\u043F\u0440\u0435\u043B\u044C", "\u041C\u0430\u0439", "\u0418\u044E\u043D\u044C", "\u0418\u044E\u043B\u044C", "\u0410\u0432\u0433\u0443\u0441\u0442", "\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C", "\u041E\u043A\u0442\u044F\u0431\u0440\u044C", "\u041D\u043E\u044F\u0431\u0440\u044C", "\u0414\u0435\u043A\u0430\u0431\u0440\u044C"], monthsShort: ["\u042F\u043D\u0432", "\u0424\u0435\u0432", "\u041C\u0430\u0440", "\u0410\u043F\u0440", "\u041C\u0430\u0439", "\u0418\u044E\u043D", "\u0418\u044E\u043B", "\u0410\u0432\u0433", "\u0421\u0435\u043D", "\u041E\u043A\u0442", "\u041D\u043E\u044F", "\u0414\u0435\u043A"], today: "\u0421\u0435\u0433\u043E\u0434\u043D\u044F", clear: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C", dateFormat: "dd.MM.yyyy", timeFormat: "HH:mm", firstDay: 1 }, startDate: new Date(), firstDay: "", weekends: [6, 0], dateFormat: "", altField: "", altFieldDateFormat: "T", toggleSelected: !0, keyboardNav: !0, selectedDates: !1, container: "", isMobile: !1, visible: !1, position: "bottom left", offset: 12, view: l.days, minView: l.days, showOtherMonths: !0, selectOtherMonths: !0, moveToOtherMonthsOnSelect: !0, showOtherYears: !0, selectOtherYears: !0, moveToOtherYearsOnSelect: !0, minDate: "", maxDate: "", disableNavWhenOutOfRange: !0, multipleDates: !1, multipleDatesSeparator: ", ", range: !1, dynamicRange: !0, buttons: !1, monthsField: "monthsShort", showEvent: "focus", autoClose: !1, prevHtml: '<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>', nextHtml: '<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>', navTitles: { days: "MMMM, <i>yyyy</i>", months: "yyyy", years: "yyyy1 - yyyy2" }, timepicker: !1, onlyTimepicker: !1, dateTimeSeparator: " ", timeFormat: "", minHours: 0, maxHours: 24, minMinutes: 0, maxMinutes: 59, hoursStep: 1, minutesStep: 1, onSelect: !1, onChangeViewDate: !1, onChangeView: !1, onRenderCell: !1, onShow: !1, onHide: !1, onClickDayName: !1 };
|
|
20
|
+
function f(r) {
|
|
25
21
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document;
|
|
26
22
|
return typeof r == "string" ? e.querySelector(r) : r;
|
|
27
23
|
}
|
|
28
|
-
function
|
|
24
|
+
function k() {
|
|
29
25
|
let { tagName: r = "div", className: e = "", innerHtml: t = "", id: i = "", attrs: a = {} } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = document.createElement(r);
|
|
30
26
|
return e && n.classList.add(...e.split(" ")), i && (n.id = i), t && (n.innerHTML = t), a && G(n, a), n;
|
|
31
27
|
}
|
|
@@ -34,21 +30,21 @@ var Ae = me(function(m, v) {
|
|
|
34
30
|
i !== void 0 && r.setAttribute(t, i);
|
|
35
31
|
return r;
|
|
36
32
|
}
|
|
37
|
-
function
|
|
33
|
+
function se(r) {
|
|
38
34
|
return new Date(r.getFullYear(), r.getMonth() + 1, 0).getDate();
|
|
39
35
|
}
|
|
40
|
-
function
|
|
36
|
+
function v(r) {
|
|
41
37
|
let e = r.getHours(), t = e % 12 == 0 ? 12 : e % 12;
|
|
42
|
-
return { year: r.getFullYear(), month: r.getMonth(), fullMonth: r.getMonth() + 1 < 10 ? "0" + (r.getMonth() + 1) : r.getMonth() + 1, date: r.getDate(), fullDate: r.getDate() < 10 ? "0" + r.getDate() : r.getDate(), day: r.getDay(), hours: e, fullHours:
|
|
38
|
+
return { year: r.getFullYear(), month: r.getMonth(), fullMonth: r.getMonth() + 1 < 10 ? "0" + (r.getMonth() + 1) : r.getMonth() + 1, date: r.getDate(), fullDate: r.getDate() < 10 ? "0" + r.getDate() : r.getDate(), day: r.getDay(), hours: e, fullHours: I(e), hours12: t, fullHours12: I(t), minutes: r.getMinutes(), fullMinutes: r.getMinutes() < 10 ? "0" + r.getMinutes() : r.getMinutes() };
|
|
43
39
|
}
|
|
44
|
-
function
|
|
40
|
+
function I(r) {
|
|
45
41
|
return r < 10 ? "0" + r : r;
|
|
46
42
|
}
|
|
47
|
-
function
|
|
43
|
+
function O(r) {
|
|
48
44
|
let e = 10 * Math.floor(r.getFullYear() / 10);
|
|
49
45
|
return [e, e + 9];
|
|
50
46
|
}
|
|
51
|
-
function
|
|
47
|
+
function S() {
|
|
52
48
|
let r = [];
|
|
53
49
|
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
|
|
54
50
|
t[i] = arguments[i];
|
|
@@ -60,34 +56,34 @@ var Ae = me(function(m, v) {
|
|
|
60
56
|
a && r.push(a);
|
|
61
57
|
}), r.join(" ");
|
|
62
58
|
}
|
|
63
|
-
function
|
|
59
|
+
function y(r, e) {
|
|
64
60
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : l.days;
|
|
65
61
|
if (!r || !e)
|
|
66
62
|
return !1;
|
|
67
|
-
let i =
|
|
63
|
+
let i = v(r), a = v(e);
|
|
68
64
|
return { [l.days]: i.date === a.date && i.month === a.month && i.year === a.year, [l.months]: i.month === a.month && i.year === a.year, [l.years]: i.year === a.year }[t];
|
|
69
65
|
}
|
|
70
|
-
function
|
|
66
|
+
function T(r, e, t) {
|
|
71
67
|
let i = X(r, !1).getTime(), a = X(e, !1).getTime();
|
|
72
68
|
return t ? i >= a : i > a;
|
|
73
69
|
}
|
|
74
|
-
function
|
|
75
|
-
return !
|
|
70
|
+
function P(r, e) {
|
|
71
|
+
return !T(r, e, !0);
|
|
76
72
|
}
|
|
77
73
|
function X(r) {
|
|
78
74
|
let e = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], t = new Date(r.getTime());
|
|
79
|
-
return typeof e != "boolean" || e ||
|
|
75
|
+
return typeof e != "boolean" || e || ce(t), t;
|
|
80
76
|
}
|
|
81
|
-
function
|
|
77
|
+
function ce(r) {
|
|
82
78
|
return r.setHours(0, 0, 0, 0), r;
|
|
83
79
|
}
|
|
84
|
-
function
|
|
80
|
+
function C(r, e, t) {
|
|
85
81
|
r.length ? r.forEach((i) => {
|
|
86
82
|
i.addEventListener(e, t);
|
|
87
83
|
}) : r.addEventListener(e, t);
|
|
88
84
|
}
|
|
89
|
-
function
|
|
90
|
-
return !(!r || r === document || r instanceof DocumentFragment) && (r.matches(e) ? r :
|
|
85
|
+
function z(r, e) {
|
|
86
|
+
return !(!r || r === document || r instanceof DocumentFragment) && (r.matches(e) ? r : z(r.parentNode, e));
|
|
91
87
|
}
|
|
92
88
|
function R(r, e, t) {
|
|
93
89
|
return r > t ? t : r < e ? e : r;
|
|
@@ -104,7 +100,7 @@ var Ae = me(function(m, v) {
|
|
|
104
100
|
r[n] = s;
|
|
105
101
|
}), r;
|
|
106
102
|
}
|
|
107
|
-
function
|
|
103
|
+
function M(r) {
|
|
108
104
|
let e = r;
|
|
109
105
|
return r instanceof Date || (e = new Date(r)), isNaN(e.getTime()) && (console.log('Unable to convert value "'.concat(r, '" to Date object')), e = !1), e;
|
|
110
106
|
}
|
|
@@ -115,7 +111,7 @@ var Ae = me(function(m, v) {
|
|
|
115
111
|
function L(r, e, t) {
|
|
116
112
|
return e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
117
113
|
}
|
|
118
|
-
class
|
|
114
|
+
class ue {
|
|
119
115
|
constructor() {
|
|
120
116
|
let { type: e, date: t, dp: i, opts: a, body: n } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
121
117
|
L(this, "focus", () => {
|
|
@@ -131,7 +127,7 @@ var Ae = me(function(m, v) {
|
|
|
131
127
|
}), L(this, "onChangeFocusDate", (s) => {
|
|
132
128
|
if (!s)
|
|
133
129
|
return void (this.focused && this.removeFocus());
|
|
134
|
-
let o =
|
|
130
|
+
let o = y(s, this.date, this.type);
|
|
135
131
|
o ? this.focus() : !o && this.focused && this.removeFocus(), this.opts.range && this._handleRangeStatus();
|
|
136
132
|
}), L(this, "render", () => (this.$cell.innerHTML = this._getHtml(), this.$cell.adpCell = this, this.$cell)), this.type = e, this.singleType = this.type.slice(0, -1), this.date = t, this.dp = i, this.opts = a, this.body = n, this.customData = !1, this.init();
|
|
137
133
|
}
|
|
@@ -147,27 +143,27 @@ var Ae = me(function(m, v) {
|
|
|
147
143
|
}
|
|
148
144
|
_createElement() {
|
|
149
145
|
var e;
|
|
150
|
-
let { year: t, month: i, date: a } =
|
|
151
|
-
this.$cell =
|
|
146
|
+
let { year: t, month: i, date: a } = v(this.date), n = ((e = this.customData) === null || e === void 0 ? void 0 : e.attrs) || {};
|
|
147
|
+
this.$cell = k({ className: this._getClassName(), attrs: { "data-year": t, "data-month": i, "data-date": a, ...n } });
|
|
152
148
|
}
|
|
153
149
|
_getClassName() {
|
|
154
150
|
var e, t;
|
|
155
|
-
let i = new Date(), { selectOtherMonths: a, selectOtherYears: n } = this.opts, { minDate: s, maxDate: o } = this.dp, { day: h } =
|
|
151
|
+
let i = new Date(), { selectOtherMonths: a, selectOtherYears: n } = this.opts, { minDate: s, maxDate: o } = this.dp, { day: h } = v(this.date), d = this._isOutOfMinMaxRange(), c = (e = this.customData) === null || e === void 0 ? void 0 : e.disabled, u = S("air-datepicker-cell", "-".concat(this.singleType, "-"), { "-current-": y(i, this.date, this.type), "-min-date-": s && y(s, this.date, this.type), "-max-date-": o && y(o, this.date, this.type) }), p = "";
|
|
156
152
|
switch (this.type) {
|
|
157
153
|
case l.days:
|
|
158
|
-
|
|
154
|
+
p = S({ "-weekend-": this.dp.isWeekend(h), "-other-month-": this.isOtherMonth, "-disabled-": this.isOtherMonth && !a || d || c });
|
|
159
155
|
break;
|
|
160
156
|
case l.months:
|
|
161
|
-
|
|
157
|
+
p = S({ "-disabled-": d || c });
|
|
162
158
|
break;
|
|
163
159
|
case l.years:
|
|
164
|
-
|
|
160
|
+
p = S({ "-other-decade-": this.isOtherDecade, "-disabled-": d || this.isOtherDecade && !n || c });
|
|
165
161
|
}
|
|
166
|
-
return
|
|
162
|
+
return S(u, p, (t = this.customData) === null || t === void 0 ? void 0 : t.classes);
|
|
167
163
|
}
|
|
168
164
|
_getHtml() {
|
|
169
165
|
var e;
|
|
170
|
-
let { year: t, month: i, date: a } =
|
|
166
|
+
let { year: t, month: i, date: a } = v(this.date), { showOtherMonths: n, showOtherYears: s } = this.opts;
|
|
171
167
|
if ((e = this.customData) !== null && e !== void 0 && e.html)
|
|
172
168
|
return this.customData.html;
|
|
173
169
|
switch (this.type) {
|
|
@@ -180,14 +176,14 @@ var Ae = me(function(m, v) {
|
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
178
|
_isOutOfMinMaxRange() {
|
|
183
|
-
let { minDate: e, maxDate: t } = this.dp, { type: i, date: a } = this, { month: n, year: s, date: o } =
|
|
184
|
-
return e && t ?
|
|
179
|
+
let { minDate: e, maxDate: t } = this.dp, { type: i, date: a } = this, { month: n, year: s, date: o } = v(a), h = i === l.days, d = i === l.years, c = !!e && new Date(s, d ? e.getMonth() : n, h ? o : e.getDate()), u = !!t && new Date(s, d ? t.getMonth() : n, h ? o : t.getDate());
|
|
180
|
+
return e && t ? P(c, e) || T(u, t) : e ? P(c, e) : t ? T(u, t) : void 0;
|
|
185
181
|
}
|
|
186
182
|
destroy() {
|
|
187
183
|
this.unbindDatepickerEvents();
|
|
188
184
|
}
|
|
189
185
|
_handleRangeStatus() {
|
|
190
|
-
let { rangeDateFrom: e, rangeDateTo: t } = this.dp, i =
|
|
186
|
+
let { rangeDateFrom: e, rangeDateTo: t } = this.dp, i = S({ "-in-range-": e && t && (a = this.date, n = e, s = t, T(a, n) && P(a, s)), "-range-from-": e && y(this.date, e, this.type), "-range-to-": t && y(this.date, t, this.type) });
|
|
191
187
|
var a, n, s;
|
|
192
188
|
this.$cell.classList.remove("-range-from-", "-range-to-", "-in-range-"), i && this.$cell.classList.add(...i.split(" "));
|
|
193
189
|
}
|
|
@@ -196,7 +192,7 @@ var Ae = me(function(m, v) {
|
|
|
196
192
|
e ? this.select() : !e && this.selected && this.removeSelect();
|
|
197
193
|
}
|
|
198
194
|
_handleInitialFocusStatus() {
|
|
199
|
-
|
|
195
|
+
y(this.dp.focusDate, this.date, this.type) && this.focus();
|
|
200
196
|
}
|
|
201
197
|
get isDisabled() {
|
|
202
198
|
return this.$cell.matches(".-disabled-");
|
|
@@ -208,70 +204,70 @@ var Ae = me(function(m, v) {
|
|
|
208
204
|
return this.dp.isOtherDecade(this.date);
|
|
209
205
|
}
|
|
210
206
|
}
|
|
211
|
-
function
|
|
207
|
+
function _(r, e, t) {
|
|
212
208
|
return e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
213
209
|
}
|
|
214
|
-
let
|
|
215
|
-
const
|
|
216
|
-
class
|
|
210
|
+
let pe = { [l.days]: '<div class="air-datepicker-body--day-names"></div>' + '<div class="air-datepicker-body--cells -'.concat(l.days, '-"></div>'), [l.months]: '<div class="air-datepicker-body--cells -'.concat(l.months, '-"></div>'), [l.years]: '<div class="air-datepicker-body--cells -'.concat(l.years, '-"></div>') };
|
|
211
|
+
const K = ".air-datepicker-cell";
|
|
212
|
+
class ae {
|
|
217
213
|
constructor(e) {
|
|
218
214
|
let { dp: t, type: i, opts: a } = e;
|
|
219
|
-
|
|
220
|
-
let s = n.target.closest(
|
|
215
|
+
_(this, "handleClick", (n) => {
|
|
216
|
+
let s = n.target.closest(K).adpCell;
|
|
221
217
|
if (s.isDisabled)
|
|
222
218
|
return;
|
|
223
219
|
if (!this.dp.isMinViewReached)
|
|
224
220
|
return void this.dp.down();
|
|
225
221
|
let o = this.dp._checkIfDateIsSelected(s.date, s.type);
|
|
226
222
|
o ? this.dp._handleAlreadySelectedDates(o, s.date) : this.dp.selectDate(s.date);
|
|
227
|
-
}),
|
|
223
|
+
}), _(this, "handleDayNameClick", (n) => {
|
|
228
224
|
let s = n.target.getAttribute("data-day-index");
|
|
229
225
|
this.opts.onClickDayName({ dayIndex: Number(s), datepicker: this.dp });
|
|
230
|
-
}),
|
|
226
|
+
}), _(this, "onChangeCurrentView", (n) => {
|
|
231
227
|
n !== this.type ? this.hide() : (this.show(), this.render());
|
|
232
|
-
}),
|
|
233
|
-
let s =
|
|
228
|
+
}), _(this, "onMouseOverCell", (n) => {
|
|
229
|
+
let s = z(n.target, K);
|
|
234
230
|
this.dp.setFocusDate(!!s && s.adpCell.date);
|
|
235
|
-
}),
|
|
231
|
+
}), _(this, "onMouseOutCell", () => {
|
|
236
232
|
this.dp.setFocusDate(!1);
|
|
237
|
-
}),
|
|
233
|
+
}), _(this, "onClickBody", (n) => {
|
|
238
234
|
let { onClickDayName: s } = this.opts, o = n.target;
|
|
239
|
-
o.closest(
|
|
240
|
-
}),
|
|
235
|
+
o.closest(K) && this.handleClick(n), s && o.closest(".air-datepicker-body--day-name") && this.handleDayNameClick(n);
|
|
236
|
+
}), _(this, "onMouseDown", (n) => {
|
|
241
237
|
this.pressed = !0;
|
|
242
|
-
let s =
|
|
243
|
-
|
|
244
|
-
}),
|
|
238
|
+
let s = z(n.target, K), o = s && s.adpCell;
|
|
239
|
+
y(o.date, this.dp.rangeDateFrom) && (this.rangeFromFocused = !0), y(o.date, this.dp.rangeDateTo) && (this.rangeToFocused = !0);
|
|
240
|
+
}), _(this, "onMouseMove", (n) => {
|
|
245
241
|
if (!this.pressed || !this.dp.isMinViewReached)
|
|
246
242
|
return;
|
|
247
243
|
n.preventDefault();
|
|
248
|
-
let s =
|
|
244
|
+
let s = z(n.target, K), o = s && s.adpCell, { selectedDates: h, rangeDateTo: d, rangeDateFrom: c } = this.dp;
|
|
249
245
|
if (!o || o.isDisabled)
|
|
250
246
|
return;
|
|
251
|
-
let { date:
|
|
247
|
+
let { date: u } = o;
|
|
252
248
|
if (h.length === 2) {
|
|
253
|
-
if (this.rangeFromFocused && !
|
|
254
|
-
let { hours:
|
|
255
|
-
|
|
249
|
+
if (this.rangeFromFocused && !T(u, d)) {
|
|
250
|
+
let { hours: p, minutes: g } = v(c);
|
|
251
|
+
u.setHours(p), u.setMinutes(g), this.dp.rangeDateFrom = u, this.dp.replaceDate(c, u);
|
|
256
252
|
}
|
|
257
|
-
if (this.rangeToFocused && !
|
|
258
|
-
let { hours:
|
|
259
|
-
|
|
253
|
+
if (this.rangeToFocused && !P(u, c)) {
|
|
254
|
+
let { hours: p, minutes: g } = v(d);
|
|
255
|
+
u.setHours(p), u.setMinutes(g), this.dp.rangeDateTo = u, this.dp.replaceDate(d, u);
|
|
260
256
|
}
|
|
261
257
|
}
|
|
262
|
-
}),
|
|
258
|
+
}), _(this, "onMouseUp", () => {
|
|
263
259
|
this.pressed = !1, this.rangeFromFocused = !1, this.rangeToFocused = !1;
|
|
264
|
-
}),
|
|
260
|
+
}), _(this, "onChangeViewDate", (n, s) => {
|
|
265
261
|
if (!this.isVisible)
|
|
266
262
|
return;
|
|
267
|
-
let o =
|
|
263
|
+
let o = O(n), h = O(s);
|
|
268
264
|
switch (this.dp.currentView) {
|
|
269
265
|
case l.days:
|
|
270
|
-
if (
|
|
266
|
+
if (y(n, s, l.months))
|
|
271
267
|
return;
|
|
272
268
|
break;
|
|
273
269
|
case l.months:
|
|
274
|
-
if (
|
|
270
|
+
if (y(n, s, l.years))
|
|
275
271
|
return;
|
|
276
272
|
break;
|
|
277
273
|
case l.years:
|
|
@@ -279,7 +275,7 @@ var Ae = me(function(m, v) {
|
|
|
279
275
|
return;
|
|
280
276
|
}
|
|
281
277
|
this.render();
|
|
282
|
-
}),
|
|
278
|
+
}), _(this, "render", () => {
|
|
283
279
|
this.destroyCells(), this._generateCells(), this.cells.forEach((n) => {
|
|
284
280
|
this.$cells.appendChild(n.render());
|
|
285
281
|
});
|
|
@@ -290,36 +286,36 @@ var Ae = me(function(m, v) {
|
|
|
290
286
|
}
|
|
291
287
|
_bindEvents() {
|
|
292
288
|
let { range: e, dynamicRange: t } = this.opts;
|
|
293
|
-
|
|
289
|
+
C(this.$el, "mouseover", this.onMouseOverCell), C(this.$el, "mouseout", this.onMouseOutCell), C(this.$el, "click", this.onClickBody), e && t && (C(this.$el, "mousedown", this.onMouseDown), C(this.$el, "mousemove", this.onMouseMove), C(window.document, "mouseup", this.onMouseUp));
|
|
294
290
|
}
|
|
295
291
|
_bindDatepickerEvents() {
|
|
296
292
|
this.dp.on(l.eventChangeViewDate, this.onChangeViewDate), this.dp.on(l.eventChangeCurrentView, this.onChangeCurrentView);
|
|
297
293
|
}
|
|
298
294
|
_buildBaseHtml() {
|
|
299
|
-
this.$el =
|
|
295
|
+
this.$el = k({ className: "air-datepicker-body -".concat(this.type, "-"), innerHtml: pe[this.type] }), this.$names = f(".air-datepicker-body--day-names", this.$el), this.$cells = f(".air-datepicker-body--cells", this.$el);
|
|
300
296
|
}
|
|
301
297
|
_getDayNamesHtml() {
|
|
302
298
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.dp.locale.firstDay, t = "", i = this.dp.isWeekend, { onClickDayName: a } = this.opts, n = e, s = 0;
|
|
303
299
|
for (; s < 7; ) {
|
|
304
|
-
let o = n % 7, h =
|
|
300
|
+
let o = n % 7, h = S("air-datepicker-body--day-name", { [l.cssClassWeekend]: i(o), "-clickable-": !!a }), d = this.dp.locale.daysMin[o];
|
|
305
301
|
t += '<div class="'.concat(h, `" data-day-index='`).concat(o, "'>").concat(d, "</div>"), s++, n++;
|
|
306
302
|
}
|
|
307
303
|
return t;
|
|
308
304
|
}
|
|
309
305
|
_getDaysCells() {
|
|
310
|
-
let { viewDate: e, locale: { firstDay: t } } = this.dp, i =
|
|
306
|
+
let { viewDate: e, locale: { firstDay: t } } = this.dp, i = se(e), { year: a, month: n } = v(e), s = new Date(a, n, 1), o = new Date(a, n, i), h = s.getDay() - t, d = 6 - o.getDay() + t;
|
|
311
307
|
h = h < 0 ? h + 7 : h, d = d > 6 ? d - 7 : d;
|
|
312
|
-
let c = function(
|
|
313
|
-
let { year:
|
|
314
|
-
return new Date(
|
|
315
|
-
}(s, h),
|
|
316
|
-
for (;
|
|
317
|
-
let
|
|
318
|
-
this._generateCell(
|
|
308
|
+
let c = function(B, U) {
|
|
309
|
+
let { year: Y, month: j, date: q } = v(B);
|
|
310
|
+
return new Date(Y, j, q - U);
|
|
311
|
+
}(s, h), u = i + h + d, p = c.getDate(), { year: g, month: w } = v(c), $ = 0;
|
|
312
|
+
for (; $ < u; ) {
|
|
313
|
+
let B = new Date(g, w, p + $);
|
|
314
|
+
this._generateCell(B), $++;
|
|
319
315
|
}
|
|
320
316
|
}
|
|
321
317
|
_generateCell(e) {
|
|
322
|
-
let { type: t, dp: i, opts: a } = this, n = new
|
|
318
|
+
let { type: t, dp: i, opts: a } = this, n = new ue({ type: t, dp: i, opts: a, date: e, body: this });
|
|
323
319
|
return this.cells.push(n), n;
|
|
324
320
|
}
|
|
325
321
|
_generateDayCells() {
|
|
@@ -331,7 +327,7 @@ var Ae = me(function(m, v) {
|
|
|
331
327
|
this.cells.push(this._generateCell(new Date(e, t))), t++;
|
|
332
328
|
}
|
|
333
329
|
_generateYearCells() {
|
|
334
|
-
let e =
|
|
330
|
+
let e = O(this.dp.viewDate), t = e[0] - 1, i = e[1] + 1, a = t;
|
|
335
331
|
for (; a <= i; )
|
|
336
332
|
this.cells.push(this._generateCell(new Date(a, 0))), a++;
|
|
337
333
|
}
|
|
@@ -363,30 +359,30 @@ var Ae = me(function(m, v) {
|
|
|
363
359
|
this.destroyCells(), this.dp.off(l.eventChangeViewDate, this.onChangeViewDate), this.dp.off(l.eventChangeCurrentView, this.onChangeCurrentView);
|
|
364
360
|
}
|
|
365
361
|
}
|
|
366
|
-
function
|
|
362
|
+
function E(r, e, t) {
|
|
367
363
|
return e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
368
364
|
}
|
|
369
|
-
class
|
|
365
|
+
class me {
|
|
370
366
|
constructor(e) {
|
|
371
367
|
let { dp: t, opts: i } = e;
|
|
372
|
-
|
|
373
|
-
let n =
|
|
368
|
+
E(this, "onClickNav", (a) => {
|
|
369
|
+
let n = z(a.target, ".air-datepicker-nav--action");
|
|
374
370
|
if (!n)
|
|
375
371
|
return;
|
|
376
372
|
let s = n.dataset.action;
|
|
377
373
|
this.dp[s]();
|
|
378
|
-
}),
|
|
374
|
+
}), E(this, "onChangeViewDate", () => {
|
|
379
375
|
this.render(), this._resetNavStatus(), this.handleNavStatus();
|
|
380
|
-
}),
|
|
376
|
+
}), E(this, "onChangeCurrentView", () => {
|
|
381
377
|
this.render(), this._resetNavStatus(), this.handleNavStatus();
|
|
382
|
-
}),
|
|
378
|
+
}), E(this, "onClickNavTitle", () => {
|
|
383
379
|
this.dp.isFinalView || this.dp.up();
|
|
384
|
-
}),
|
|
380
|
+
}), E(this, "update", () => {
|
|
385
381
|
let { prevHtml: a, nextHtml: n } = this.opts;
|
|
386
382
|
this.$prev.innerHTML = a, this.$next.innerHTML = n, this._resetNavStatus(), this.render(), this.handleNavStatus();
|
|
387
|
-
}),
|
|
383
|
+
}), E(this, "renderDelay", () => {
|
|
388
384
|
setTimeout(this.render);
|
|
389
|
-
}),
|
|
385
|
+
}), E(this, "render", () => {
|
|
390
386
|
this.$title.innerHTML = this._getTitle(), function(a, n) {
|
|
391
387
|
for (let s in n)
|
|
392
388
|
n[s] ? a.classList.add(s) : a.classList.remove(s);
|
|
@@ -397,7 +393,7 @@ var Ae = me(function(m, v) {
|
|
|
397
393
|
this._createElement(), this._buildBaseHtml(), this._defineDOM(), this.render(), this.handleNavStatus(), this._bindEvents(), this._bindDatepickerEvents();
|
|
398
394
|
}
|
|
399
395
|
_defineDOM() {
|
|
400
|
-
this.$title =
|
|
396
|
+
this.$title = f(".air-datepicker-nav--title", this.$el), this.$prev = f('[data-action="prev"]', this.$el), this.$next = f('[data-action="next"]', this.$el);
|
|
401
397
|
}
|
|
402
398
|
_bindEvents() {
|
|
403
399
|
this.$el.addEventListener("click", this.onClickNav), this.$title.addEventListener("click", this.onClickNavTitle);
|
|
@@ -409,7 +405,7 @@ var Ae = me(function(m, v) {
|
|
|
409
405
|
this.dp.off(l.eventChangeViewDate, this.onChangeViewDate), this.dp.off(l.eventChangeCurrentView, this.onChangeCurrentView), this.isNavIsFunction && (this.dp.off(l.eventChangeSelectedDate, this.renderDelay), this.dp.opts.timepicker && this.dp.off(l.eventChangeTime, this.render));
|
|
410
406
|
}
|
|
411
407
|
_createElement() {
|
|
412
|
-
this.$el =
|
|
408
|
+
this.$el = k({ tagName: "nav", className: "air-datepicker-nav" });
|
|
413
409
|
}
|
|
414
410
|
_getTitle() {
|
|
415
411
|
let { dp: e, opts: t } = this, i = t.navTitles[e.currentView];
|
|
@@ -419,7 +415,7 @@ var Ae = me(function(m, v) {
|
|
|
419
415
|
let { disableNavWhenOutOfRange: e } = this.opts, { minDate: t, maxDate: i } = this.dp;
|
|
420
416
|
if (!t && !i || !e)
|
|
421
417
|
return;
|
|
422
|
-
let { year: a, month: n } = this.dp.parsedViewDate, s = !!t &&
|
|
418
|
+
let { year: a, month: n } = this.dp.parsedViewDate, s = !!t && v(t), o = !!i && v(i);
|
|
423
419
|
switch (this.dp.currentView) {
|
|
424
420
|
case l.days:
|
|
425
421
|
t && s.month >= n && s.year >= a && this._disableNav("prev"), i && o.month <= n && o.year <= a && this._disableNav("next");
|
|
@@ -428,14 +424,14 @@ var Ae = me(function(m, v) {
|
|
|
428
424
|
t && s.year >= a && this._disableNav("prev"), i && o.year <= a && this._disableNav("next");
|
|
429
425
|
break;
|
|
430
426
|
case l.years: {
|
|
431
|
-
let h =
|
|
427
|
+
let h = O(this.dp.viewDate);
|
|
432
428
|
t && s.year >= h[0] && this._disableNav("prev"), i && o.year <= h[1] && this._disableNav("next");
|
|
433
429
|
break;
|
|
434
430
|
}
|
|
435
431
|
}
|
|
436
432
|
}
|
|
437
433
|
_disableNav(e) {
|
|
438
|
-
|
|
434
|
+
f('[data-action="' + e + '"]', this.$el).classList.add("-disabled-");
|
|
439
435
|
}
|
|
440
436
|
_resetNavStatus() {
|
|
441
437
|
(function(e) {
|
|
@@ -455,8 +451,8 @@ var Ae = me(function(m, v) {
|
|
|
455
451
|
return Object.keys(e).find((t) => typeof e[t] == "function");
|
|
456
452
|
}
|
|
457
453
|
}
|
|
458
|
-
var
|
|
459
|
-
class
|
|
454
|
+
var ne = { today: { content: (r) => r.locale.today, onClick: (r) => r.setViewDate(new Date()) }, clear: { content: (r) => r.locale.clear, onClick: (r) => r.clear() } };
|
|
455
|
+
class ge {
|
|
460
456
|
constructor(e) {
|
|
461
457
|
let { dp: t, opts: i } = e;
|
|
462
458
|
this.dp = t, this.opts = i, this.init();
|
|
@@ -465,7 +461,7 @@ var Ae = me(function(m, v) {
|
|
|
465
461
|
this.createElement(), this.render();
|
|
466
462
|
}
|
|
467
463
|
createElement() {
|
|
468
|
-
this.$el =
|
|
464
|
+
this.$el = k({ className: "air-datepicker-buttons" });
|
|
469
465
|
}
|
|
470
466
|
destroy() {
|
|
471
467
|
this.$el.parentNode.removeChild(this.$el);
|
|
@@ -477,7 +473,7 @@ var Ae = me(function(m, v) {
|
|
|
477
473
|
let { buttons: e } = this.opts;
|
|
478
474
|
Array.isArray(e) || (e = [e]), e.forEach((t) => {
|
|
479
475
|
let i = t;
|
|
480
|
-
typeof t == "string" &&
|
|
476
|
+
typeof t == "string" && ne[t] && (i = ne[t]);
|
|
481
477
|
let a = this.createButton(i);
|
|
482
478
|
i.onClick && this.attachEventToButton(a, i.onClick), this.$el.appendChild(a);
|
|
483
479
|
});
|
|
@@ -489,34 +485,34 @@ var Ae = me(function(m, v) {
|
|
|
489
485
|
}
|
|
490
486
|
createButton(e) {
|
|
491
487
|
let { content: t, className: i, tagName: a = "button", attrs: n = {} } = e, s = typeof t == "function" ? t(this.dp) : t;
|
|
492
|
-
return
|
|
488
|
+
return k({ tagName: a, innerHtml: "<span tabindex='-1'>".concat(s, "</span>"), className: S("air-datepicker-button", i), attrs: n });
|
|
493
489
|
}
|
|
494
490
|
render() {
|
|
495
491
|
this.generateButtons();
|
|
496
492
|
}
|
|
497
493
|
}
|
|
498
|
-
function
|
|
494
|
+
function A(r, e, t) {
|
|
499
495
|
return e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
500
496
|
}
|
|
501
|
-
class
|
|
497
|
+
class ve {
|
|
502
498
|
constructor() {
|
|
503
499
|
let { opts: e, dp: t } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
504
|
-
|
|
500
|
+
A(this, "toggleTimepickerIsActive", (a) => {
|
|
505
501
|
this.dp.timepickerIsActive = a;
|
|
506
|
-
}),
|
|
502
|
+
}), A(this, "onChangeSelectedDate", (a) => {
|
|
507
503
|
let { date: n, updateTime: s = !1 } = a;
|
|
508
504
|
n && (this.setMinMaxTime(n), this.setCurrentTime(!!s && n), this.addTimeToDate(n));
|
|
509
|
-
}),
|
|
505
|
+
}), A(this, "onChangeLastSelectedDate", (a) => {
|
|
510
506
|
a && (this.setTime(a), this.render());
|
|
511
|
-
}),
|
|
507
|
+
}), A(this, "onChangeInputRange", (a) => {
|
|
512
508
|
let n = a.target;
|
|
513
509
|
this[n.getAttribute("name")] = n.value, this.updateText(), this.dp.trigger(l.eventChangeTime, { hours: this.hours, minutes: this.minutes });
|
|
514
|
-
}),
|
|
510
|
+
}), A(this, "onMouseEnterLeave", (a) => {
|
|
515
511
|
let n = a.target.getAttribute("name"), s = this.$minutesText;
|
|
516
512
|
n === "hours" && (s = this.$hoursText), s.classList.toggle("-focus-");
|
|
517
|
-
}),
|
|
513
|
+
}), A(this, "onFocus", () => {
|
|
518
514
|
this.toggleTimepickerIsActive(!0);
|
|
519
|
-
}),
|
|
515
|
+
}), A(this, "onBlur", () => {
|
|
520
516
|
this.toggleTimepickerIsActive(!1);
|
|
521
517
|
}), this.opts = e, this.dp = t;
|
|
522
518
|
let { timeFormat: i } = this.dp.locale;
|
|
@@ -530,20 +526,20 @@ var Ae = me(function(m, v) {
|
|
|
530
526
|
}
|
|
531
527
|
bindDOMEvents() {
|
|
532
528
|
let e = "input";
|
|
533
|
-
navigator.userAgent.match(/trident/gi) && (e = "change"),
|
|
529
|
+
navigator.userAgent.match(/trident/gi) && (e = "change"), C(this.$ranges, e, this.onChangeInputRange), C(this.$ranges, "mouseenter", this.onMouseEnterLeave), C(this.$ranges, "mouseleave", this.onMouseEnterLeave), C(this.$ranges, "focus", this.onFocus), C(this.$ranges, "mousedown", this.onFocus), C(this.$ranges, "blur", this.onBlur);
|
|
534
530
|
}
|
|
535
531
|
createElement() {
|
|
536
|
-
this.$el =
|
|
532
|
+
this.$el = k({ className: S("air-datepicker-time", { "-am-pm-": this.dp.ampm }) });
|
|
537
533
|
}
|
|
538
534
|
destroy() {
|
|
539
535
|
this.dp.off(l.eventChangeSelectedDate, this.onChangeSelectedDate), this.dp.off(l.eventChangeLastSelectedDate, this.onChangeLastSelectedDate), this.$el.parentNode.removeChild(this.$el);
|
|
540
536
|
}
|
|
541
537
|
buildHtml() {
|
|
542
|
-
let { ampm: e, hours: t, displayHours: i, minutes: a, minHours: n, minMinutes: s, maxHours: o, maxMinutes: h, dayPeriod: d, opts: { hoursStep: c, minutesStep:
|
|
543
|
-
this.$el.innerHTML = '<div class="air-datepicker-time--current">' + ' <span class="air-datepicker-time--current-hours">'.concat(
|
|
538
|
+
let { ampm: e, hours: t, displayHours: i, minutes: a, minHours: n, minMinutes: s, maxHours: o, maxMinutes: h, dayPeriod: d, opts: { hoursStep: c, minutesStep: u } } = this;
|
|
539
|
+
this.$el.innerHTML = '<div class="air-datepicker-time--current">' + ' <span class="air-datepicker-time--current-hours">'.concat(I(i), "</span>") + ' <span class="air-datepicker-time--current-colon">:</span>' + ' <span class="air-datepicker-time--current-minutes">'.concat(I(a), "</span>") + " ".concat(e ? "<span class='air-datepicker-time--current-ampm'>".concat(d, "</span>") : "") + '</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row">' + ' <input type="range" name="hours" value="'.concat(t, '" min="').concat(n, '" max="').concat(o, '" step="').concat(c, '"/>') + ' </div> <div class="air-datepicker-time--row">' + ' <input type="range" name="minutes" value="'.concat(a, '" min="').concat(s, '" max="').concat(h, '" step="').concat(u, '"/>') + " </div></div>";
|
|
544
540
|
}
|
|
545
541
|
defineDOM() {
|
|
546
|
-
let e = (t) =>
|
|
542
|
+
let e = (t) => f(t, this.$el);
|
|
547
543
|
this.$ranges = this.$el.querySelectorAll('[type="range"]'), this.$hours = e('[name="hours"]'), this.$minutes = e('[name="minutes"]'), this.$hoursText = e(".air-datepicker-time--current-hours"), this.$minutesText = e(".air-datepicker-time--current-minutes"), this.$ampm = e(".air-datepicker-time--current-ampm");
|
|
548
544
|
}
|
|
549
545
|
setTime(e) {
|
|
@@ -555,11 +551,11 @@ var Ae = me(function(m, v) {
|
|
|
555
551
|
setMinMaxTime(e) {
|
|
556
552
|
if (this.setMinMaxTimeFromOptions(), e) {
|
|
557
553
|
let { minDate: t, maxDate: i } = this.dp;
|
|
558
|
-
t &&
|
|
554
|
+
t && y(e, t) && this.setMinTimeFromMinDate(t), i && y(e, i) && this.setMaxTimeFromMaxDate(i);
|
|
559
555
|
}
|
|
560
556
|
}
|
|
561
557
|
setCurrentTime(e) {
|
|
562
|
-
let { hours: t, minutes: i } = e ?
|
|
558
|
+
let { hours: t, minutes: i } = e ? v(e) : this;
|
|
563
559
|
this.hours = R(t, this.minHours, this.maxHours), this.minutes = R(i, this.minMinutes, this.maxMinutes);
|
|
564
560
|
}
|
|
565
561
|
setMinMaxTimeFromOptions() {
|
|
@@ -576,7 +572,7 @@ var Ae = me(function(m, v) {
|
|
|
576
572
|
}
|
|
577
573
|
getDayPeriod(e, t) {
|
|
578
574
|
let i = e, a = Number(e);
|
|
579
|
-
e instanceof Date && (i =
|
|
575
|
+
e instanceof Date && (i = v(e), a = Number(i.hours));
|
|
580
576
|
let n = "am";
|
|
581
577
|
if (t || this.ampm) {
|
|
582
578
|
switch (!0) {
|
|
@@ -592,7 +588,7 @@ var Ae = me(function(m, v) {
|
|
|
592
588
|
G(this.$hours, { min: this.minHours, max: this.maxHours }).value = this.hours, G(this.$minutes, { min: this.minMinutes, max: this.maxMinutes }).value = this.minutes;
|
|
593
589
|
}
|
|
594
590
|
updateText() {
|
|
595
|
-
this.$hoursText.innerHTML =
|
|
591
|
+
this.$hoursText.innerHTML = I(this.displayHours), this.$minutesText.innerHTML = I(this.minutes), this.ampm && (this.$ampm.innerHTML = this.dayPeriod);
|
|
596
592
|
}
|
|
597
593
|
set hours(e) {
|
|
598
594
|
this._hours = e;
|
|
@@ -606,20 +602,20 @@ var Ae = me(function(m, v) {
|
|
|
606
602
|
this.updateSliders(), this.updateText();
|
|
607
603
|
}
|
|
608
604
|
}
|
|
609
|
-
function
|
|
605
|
+
function N(r, e, t) {
|
|
610
606
|
return e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
611
607
|
}
|
|
612
|
-
class
|
|
608
|
+
class ye {
|
|
613
609
|
constructor(e) {
|
|
614
610
|
let { dp: t, opts: i } = e;
|
|
615
|
-
|
|
616
|
-
let n = this.hotKeys.get(a), s =
|
|
611
|
+
N(this, "pressedKeys", /* @__PURE__ */ new Set()), N(this, "hotKeys", /* @__PURE__ */ new Map([[[["Control", "ArrowRight"], ["Control", "ArrowUp"]], (a) => a.month++], [[["Control", "ArrowLeft"], ["Control", "ArrowDown"]], (a) => a.month--], [[["Shift", "ArrowRight"], ["Shift", "ArrowUp"]], (a) => a.year++], [[["Shift", "ArrowLeft"], ["Shift", "ArrowDown"]], (a) => a.year--], [[["Alt", "ArrowRight"], ["Alt", "ArrowUp"]], (a) => a.year += 10], [[["Alt", "ArrowLeft"], ["Alt", "ArrowDown"]], (a) => a.year -= 10], [["Control", "Shift", "ArrowUp"], (a, n) => n.up()]])), N(this, "handleHotKey", (a) => {
|
|
612
|
+
let n = this.hotKeys.get(a), s = v(this.getInitialFocusDate());
|
|
617
613
|
n(s, this.dp);
|
|
618
|
-
let { year: o, month: h, date: d } = s, c =
|
|
614
|
+
let { year: o, month: h, date: d } = s, c = se(new Date(o, h));
|
|
619
615
|
c < d && (d = c);
|
|
620
|
-
let
|
|
621
|
-
this.dp.setFocusDate(
|
|
622
|
-
}),
|
|
616
|
+
let u = this.dp.getClampedDate(new Date(o, h, d));
|
|
617
|
+
this.dp.setFocusDate(u, { viewDateTransition: !0 });
|
|
618
|
+
}), N(this, "isHotKeyPressed", () => {
|
|
623
619
|
let a = !1, n = this.pressedKeys.size, s = (o) => this.pressedKeys.has(o);
|
|
624
620
|
for (let [o] of this.hotKeys) {
|
|
625
621
|
if (a)
|
|
@@ -635,7 +631,7 @@ var Ae = me(function(m, v) {
|
|
|
635
631
|
}
|
|
636
632
|
}
|
|
637
633
|
return a;
|
|
638
|
-
}),
|
|
634
|
+
}), N(this, "isArrow", (a) => a >= 37 && a <= 40), N(this, "onKeyDown", (a) => {
|
|
639
635
|
let { key: n, which: s } = a, { dp: o, dp: { focusDate: h }, opts: d } = this;
|
|
640
636
|
this.registerKey(n);
|
|
641
637
|
let c = this.isHotKeyPressed();
|
|
@@ -647,12 +643,12 @@ var Ae = me(function(m, v) {
|
|
|
647
643
|
if (o.currentView !== d.minView)
|
|
648
644
|
return void o.down();
|
|
649
645
|
if (h) {
|
|
650
|
-
let
|
|
651
|
-
return void (
|
|
646
|
+
let u = o._checkIfDateIsSelected(h);
|
|
647
|
+
return void (u ? o._handleAlreadySelectedDates(u, h) : o.selectDate(h));
|
|
652
648
|
}
|
|
653
649
|
}
|
|
654
650
|
n === "Escape" && this.dp.hide();
|
|
655
|
-
}),
|
|
651
|
+
}), N(this, "onKeyUp", (a) => {
|
|
656
652
|
this.removeKey(a.key);
|
|
657
653
|
}), this.dp = t, this.opts = i, this.init();
|
|
658
654
|
}
|
|
@@ -683,7 +679,7 @@ var Ae = me(function(m, v) {
|
|
|
683
679
|
return s;
|
|
684
680
|
}
|
|
685
681
|
focusNextCell(e) {
|
|
686
|
-
let t = this.getInitialFocusDate(), { currentView: i } = this.dp, { days: a, months: n, years: s } = l, o =
|
|
682
|
+
let t = this.getInitialFocusDate(), { currentView: i } = this.dp, { days: a, months: n, years: s } = l, o = v(t), h = o.year, d = o.month, c = o.date;
|
|
687
683
|
switch (e) {
|
|
688
684
|
case "ArrowLeft":
|
|
689
685
|
i === a && (c -= 1), i === n && (d -= 1), i === s && (h -= 1);
|
|
@@ -697,8 +693,8 @@ var Ae = me(function(m, v) {
|
|
|
697
693
|
case "ArrowDown":
|
|
698
694
|
i === a && (c += 7), i === n && (d += 3), i === s && (h += 4);
|
|
699
695
|
}
|
|
700
|
-
let
|
|
701
|
-
this.dp.setFocusDate(
|
|
696
|
+
let u = this.dp.getClampedDate(new Date(h, d, c));
|
|
697
|
+
this.dp.setFocusDate(u, { viewDateTransition: !0 });
|
|
702
698
|
}
|
|
703
699
|
registerKey(e) {
|
|
704
700
|
this.pressedKeys.add(e);
|
|
@@ -707,7 +703,7 @@ var Ae = me(function(m, v) {
|
|
|
707
703
|
this.pressedKeys.delete(e);
|
|
708
704
|
}
|
|
709
705
|
}
|
|
710
|
-
let
|
|
706
|
+
let De = { on(r, e) {
|
|
711
707
|
this.__events || (this.__events = {}), this.__events[r] ? this.__events[r].push(e) : this.__events[r] = [e];
|
|
712
708
|
}, off(r, e) {
|
|
713
709
|
this.__events && this.__events[r] && (this.__events[r] = this.__events[r].filter((t) => t !== e));
|
|
@@ -720,14 +716,14 @@ var Ae = me(function(m, v) {
|
|
|
720
716
|
a(...t);
|
|
721
717
|
});
|
|
722
718
|
} };
|
|
723
|
-
function
|
|
719
|
+
function m(r, e, t) {
|
|
724
720
|
return e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
|
|
725
721
|
}
|
|
726
|
-
let ee = "", J = "",
|
|
727
|
-
class
|
|
722
|
+
let ee = "", J = "", V = "", re = !1;
|
|
723
|
+
class H {
|
|
728
724
|
constructor(e, t) {
|
|
729
725
|
var i = this;
|
|
730
|
-
if (
|
|
726
|
+
if (m(this, "viewIndexes", [l.days, l.months, l.years]), m(this, "next", () => {
|
|
731
727
|
let { year: s, month: o } = this.parsedViewDate;
|
|
732
728
|
switch (this.currentView) {
|
|
733
729
|
case l.days:
|
|
@@ -739,7 +735,7 @@ var Ae = me(function(m, v) {
|
|
|
739
735
|
case l.years:
|
|
740
736
|
this.setViewDate(new Date(s + 10, 0, 1));
|
|
741
737
|
}
|
|
742
|
-
}),
|
|
738
|
+
}), m(this, "prev", () => {
|
|
743
739
|
let { year: s, month: o } = this.parsedViewDate;
|
|
744
740
|
switch (this.currentView) {
|
|
745
741
|
case l.days:
|
|
@@ -751,74 +747,74 @@ var Ae = me(function(m, v) {
|
|
|
751
747
|
case l.years:
|
|
752
748
|
this.setViewDate(new Date(s - 10, 0, 1));
|
|
753
749
|
}
|
|
754
|
-
}),
|
|
750
|
+
}), m(this, "_finishHide", () => {
|
|
755
751
|
this.hideAnimation = !1, this._destroyComponents(), this.$container.removeChild(this.$datepicker);
|
|
756
|
-
}),
|
|
752
|
+
}), m(this, "setPosition", function(s) {
|
|
757
753
|
let o = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
758
754
|
if (typeof (s = s || i.opts.position) == "function")
|
|
759
755
|
return void (i.customHide = s({ $datepicker: i.$datepicker, $target: i.$el, $pointer: i.$pointer, isViewChange: o, done: i._finishHide }));
|
|
760
|
-
let h, d, { isMobile: c } = i.opts,
|
|
756
|
+
let h, d, { isMobile: c } = i.opts, u = i.$el.getBoundingClientRect(), p = i.$el.getBoundingClientRect(), g = i.$datepicker.offsetParent, w = i.$el.offsetParent, $ = i.$datepicker.getBoundingClientRect(), B = s.split(" "), U = window.scrollY, Y = window.scrollX, j = i.opts.offset, q = B[0], fe = B[1];
|
|
761
757
|
if (c)
|
|
762
758
|
i.$datepicker.style.cssText = "left: 50%; top: 50%";
|
|
763
759
|
else {
|
|
764
|
-
if (
|
|
765
|
-
let
|
|
766
|
-
|
|
760
|
+
if (g === w && g !== document.body && (p = { top: i.$el.offsetTop, left: i.$el.offsetLeft, width: u.width, height: i.$el.offsetHeight }, U = 0, Y = 0), g !== w && g !== document.body) {
|
|
761
|
+
let he = g.getBoundingClientRect();
|
|
762
|
+
p = { top: u.top - he.top, left: u.left - he.left, width: u.width, height: u.height }, U = 0, Y = 0;
|
|
767
763
|
}
|
|
768
764
|
switch (q) {
|
|
769
765
|
case "top":
|
|
770
|
-
h =
|
|
766
|
+
h = p.top - $.height - j;
|
|
771
767
|
break;
|
|
772
768
|
case "right":
|
|
773
|
-
d =
|
|
769
|
+
d = p.left + p.width + j;
|
|
774
770
|
break;
|
|
775
771
|
case "bottom":
|
|
776
|
-
h =
|
|
772
|
+
h = p.top + p.height + j;
|
|
777
773
|
break;
|
|
778
774
|
case "left":
|
|
779
|
-
d =
|
|
775
|
+
d = p.left - $.width - j;
|
|
780
776
|
}
|
|
781
|
-
switch (
|
|
777
|
+
switch (fe) {
|
|
782
778
|
case "top":
|
|
783
|
-
h =
|
|
779
|
+
h = p.top;
|
|
784
780
|
break;
|
|
785
781
|
case "right":
|
|
786
|
-
d =
|
|
782
|
+
d = p.left + p.width - $.width;
|
|
787
783
|
break;
|
|
788
784
|
case "bottom":
|
|
789
|
-
h =
|
|
785
|
+
h = p.top + p.height - $.height;
|
|
790
786
|
break;
|
|
791
787
|
case "left":
|
|
792
|
-
d =
|
|
788
|
+
d = p.left;
|
|
793
789
|
break;
|
|
794
790
|
case "center":
|
|
795
|
-
/left|right/.test(q) ? h =
|
|
791
|
+
/left|right/.test(q) ? h = p.top + p.height / 2 - $.height / 2 : d = p.left + p.width / 2 - $.width / 2;
|
|
796
792
|
}
|
|
797
|
-
i.$datepicker.style.cssText = "left: ".concat(d +
|
|
793
|
+
i.$datepicker.style.cssText = "left: ".concat(d + Y, "px; top: ").concat(h + U, "px");
|
|
798
794
|
}
|
|
799
|
-
}),
|
|
795
|
+
}), m(this, "_setInputValue", () => {
|
|
800
796
|
let { opts: s, $altField: o, locale: { dateFormat: h } } = this, { altFieldDateFormat: d, altField: c } = s;
|
|
801
797
|
c && o && (o.value = this._getInputValue(d)), this.$el.value = this._getInputValue(h);
|
|
802
|
-
}),
|
|
798
|
+
}), m(this, "_getInputValue", (s) => {
|
|
803
799
|
let { selectedDates: o, opts: h } = this, { multipleDates: d, multipleDatesSeparator: c } = h;
|
|
804
800
|
if (!o.length)
|
|
805
801
|
return "";
|
|
806
|
-
let
|
|
807
|
-
return
|
|
808
|
-
}),
|
|
802
|
+
let u = typeof s == "function", p = u ? s(d ? o : o[0]) : o.map((g) => this.formatDate(g, s));
|
|
803
|
+
return p = u ? p : p.join(c), p;
|
|
804
|
+
}), m(this, "_checkIfDateIsSelected", function(s) {
|
|
809
805
|
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : l.days, h = !1;
|
|
810
806
|
return i.selectedDates.some((d) => {
|
|
811
|
-
let c =
|
|
807
|
+
let c = y(s, d, o);
|
|
812
808
|
return h = c && d, c;
|
|
813
809
|
}), h;
|
|
814
|
-
}),
|
|
810
|
+
}), m(this, "_scheduleCallAfterTransition", (s) => {
|
|
815
811
|
this._cancelScheduledCall(), s && s(!1), this._onTransitionEnd = () => {
|
|
816
812
|
s && s(!0);
|
|
817
813
|
}, this.$datepicker.addEventListener("transitionend", this._onTransitionEnd, { once: !0 });
|
|
818
|
-
}),
|
|
814
|
+
}), m(this, "_cancelScheduledCall", () => {
|
|
819
815
|
this.$datepicker.removeEventListener("transitionend", this._onTransitionEnd);
|
|
820
|
-
}),
|
|
821
|
-
if (!((s =
|
|
816
|
+
}), m(this, "setViewDate", (s) => {
|
|
817
|
+
if (!((s = M(s)) instanceof Date) || y(s, this.viewDate))
|
|
822
818
|
return;
|
|
823
819
|
let o = this.viewDate;
|
|
824
820
|
this.viewDate = s;
|
|
@@ -828,84 +824,84 @@ var Ae = me(function(m, v) {
|
|
|
828
824
|
h({ month: d, year: c, decade: this.curDecade });
|
|
829
825
|
}
|
|
830
826
|
this.trigger(l.eventChangeViewDate, s, o);
|
|
831
|
-
}),
|
|
827
|
+
}), m(this, "setFocusDate", function(s) {
|
|
832
828
|
let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
833
|
-
(!s || (s =
|
|
834
|
-
}),
|
|
829
|
+
(!s || (s = M(s)) instanceof Date) && (i.focusDate = s, i.opts.range && s && i._handleRangeOnFocus(), i.trigger(l.eventChangeFocusDate, s, o));
|
|
830
|
+
}), m(this, "setCurrentView", (s) => {
|
|
835
831
|
if (this.viewIndexes.includes(s)) {
|
|
836
832
|
if (this.currentView = s, this.elIsInput && this.visible && this.setPosition(void 0, !0), this.trigger(l.eventChangeCurrentView, s), !this.views[s]) {
|
|
837
|
-
let o = this.views[s] = new
|
|
833
|
+
let o = this.views[s] = new ae({ dp: this, opts: this.opts, type: s });
|
|
838
834
|
this.shouldUpdateDOM && this.$content.appendChild(o.$el);
|
|
839
835
|
}
|
|
840
836
|
this.opts.onChangeView && this.opts.onChangeView(s);
|
|
841
837
|
}
|
|
842
|
-
}),
|
|
838
|
+
}), m(this, "_updateLastSelectedDate", (s) => {
|
|
843
839
|
this.lastSelectedDate = s, this.trigger(l.eventChangeLastSelectedDate, s);
|
|
844
|
-
}),
|
|
840
|
+
}), m(this, "destroy", () => {
|
|
845
841
|
let { showEvent: s, isMobile: o } = this.opts, h = this.$datepicker.parentNode;
|
|
846
842
|
h && h.removeChild(this.$datepicker), this.$el.removeEventListener(s, this._onFocus), this.$el.removeEventListener("blur", this._onBlur), window.removeEventListener("resize", this._onResize), o && this._removeMobileAttributes(), this.keyboardNav && this.keyboardNav.destroy(), this.views = null, this.nav = null, this.$datepicker = null, this.opts = null, this.$customContainer = null, this.viewDate = null, this.focusDate = null, this.selectedDates = null, this.rangeDateFrom = null, this.rangeDateTo = null;
|
|
847
|
-
}),
|
|
843
|
+
}), m(this, "update", (s) => {
|
|
848
844
|
let o = Z({}, this.opts);
|
|
849
845
|
Z(this.opts, s);
|
|
850
|
-
let { timepicker: h, buttons: d, range: c, selectedDates:
|
|
851
|
-
this._createMinMaxDates(), this._limitViewDateByMaxMinDates(), this._handleLocale(), !o.selectedDates &&
|
|
852
|
-
}),
|
|
853
|
-
let { month: o } =
|
|
846
|
+
let { timepicker: h, buttons: d, range: c, selectedDates: u, isMobile: p } = this.opts, g = this.visible || this.treatAsInline;
|
|
847
|
+
this._createMinMaxDates(), this._limitViewDateByMaxMinDates(), this._handleLocale(), !o.selectedDates && u && this.selectDate(u), s.view && this.setCurrentView(s.view), this._setInputValue(), o.range && !c ? (this.rangeDateTo = !1, this.rangeDateFrom = !1) : !o.range && c && this.selectedDates.length && (this.rangeDateFrom = this.selectedDates[0], this.rangeDateTo = this.selectedDates[1]), o.timepicker && !h ? (g && this.timepicker.destroy(), this.timepicker = !1, this.$timepicker.parentNode.removeChild(this.$timepicker)) : !o.timepicker && h && this._addTimepicker(), !o.buttons && d ? this._addButtons() : o.buttons && !d ? (this.buttons.destroy(), this.$buttons.parentNode.removeChild(this.$buttons)) : g && o.buttons && d && this.buttons.clearHtml().render(), !o.isMobile && p ? (this.treatAsInline || V || this._createMobileOverlay(), this._addMobileAttributes(), this.visible && this._showMobileOverlay()) : o.isMobile && !p && (this._removeMobileAttributes(), this.visible && (V.classList.remove("-active-"), typeof this.opts.position != "function" && this.setPosition())), g && (this.nav.update(), this.views[this.currentView].render(), this.currentView === l.days && this.views[this.currentView].renderDayNames());
|
|
848
|
+
}), m(this, "isOtherMonth", (s) => {
|
|
849
|
+
let { month: o } = v(s);
|
|
854
850
|
return o !== this.parsedViewDate.month;
|
|
855
|
-
}),
|
|
856
|
-
let { year: o } =
|
|
851
|
+
}), m(this, "isOtherYear", (s) => {
|
|
852
|
+
let { year: o } = v(s);
|
|
857
853
|
return o !== this.parsedViewDate.year;
|
|
858
|
-
}),
|
|
859
|
-
let { year: o } =
|
|
854
|
+
}), m(this, "isOtherDecade", (s) => {
|
|
855
|
+
let { year: o } = v(s), [h, d] = O(this.viewDate);
|
|
860
856
|
return o < h || o > d;
|
|
861
|
-
}),
|
|
857
|
+
}), m(this, "_onChangeSelectedDate", (s) => {
|
|
862
858
|
let { silent: o } = s;
|
|
863
859
|
setTimeout(() => {
|
|
864
860
|
this._setInputValue(), this.opts.onSelect && !o && this._triggerOnSelect();
|
|
865
861
|
});
|
|
866
|
-
}),
|
|
862
|
+
}), m(this, "_onChangeFocusedDate", function(s) {
|
|
867
863
|
let { viewDateTransition: o } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
868
864
|
if (!s)
|
|
869
865
|
return;
|
|
870
866
|
let h = !1;
|
|
871
867
|
o && (h = i.isOtherMonth(s) || i.isOtherYear(s) || i.isOtherDecade(s)), h && i.setViewDate(s);
|
|
872
|
-
}),
|
|
873
|
-
let { hours: o, minutes: h } = s, d = new Date(), { lastSelectedDate: c, opts: { onSelect:
|
|
874
|
-
c || (
|
|
875
|
-
let
|
|
876
|
-
|
|
877
|
-
}),
|
|
868
|
+
}), m(this, "_onChangeTime", (s) => {
|
|
869
|
+
let { hours: o, minutes: h } = s, d = new Date(), { lastSelectedDate: c, opts: { onSelect: u } } = this, p = c;
|
|
870
|
+
c || (p = d);
|
|
871
|
+
let g = this.getCell(p, this.currentViewSingular), w = g && g.adpCell;
|
|
872
|
+
w && w.isDisabled || (p.setHours(o), p.setMinutes(h), c ? (this._setInputValue(), u && this._triggerOnSelect()) : this.selectDate(p));
|
|
873
|
+
}), m(this, "_onFocus", (s) => {
|
|
878
874
|
this.visible || this.show();
|
|
879
|
-
}),
|
|
875
|
+
}), m(this, "_onBlur", (s) => {
|
|
880
876
|
this.inFocus || !this.visible || this.opts.isMobile || this.hide();
|
|
881
|
-
}),
|
|
877
|
+
}), m(this, "_onMouseDown", (s) => {
|
|
882
878
|
this.inFocus = !0;
|
|
883
|
-
}),
|
|
879
|
+
}), m(this, "_onMouseUp", (s) => {
|
|
884
880
|
this.inFocus = !1, this.$el.focus();
|
|
885
|
-
}),
|
|
881
|
+
}), m(this, "_onResize", () => {
|
|
886
882
|
this.visible && typeof this.opts.position != "function" && this.setPosition();
|
|
887
|
-
}),
|
|
883
|
+
}), m(this, "_onClickOverlay", () => {
|
|
888
884
|
this.visible && this.hide();
|
|
889
|
-
}),
|
|
885
|
+
}), m(this, "isWeekend", (s) => this.opts.weekends.includes(s)), m(this, "getClampedDate", (s) => {
|
|
890
886
|
let { minDate: o, maxDate: h } = this, d = s;
|
|
891
|
-
return h &&
|
|
892
|
-
}), this.$el =
|
|
887
|
+
return h && T(s, h) ? d = h : o && P(s, o) && (d = o), d;
|
|
888
|
+
}), this.$el = f(e), !this.$el)
|
|
893
889
|
return;
|
|
894
|
-
this.$datepicker =
|
|
890
|
+
this.$datepicker = k({ className: "air-datepicker" }), this.opts = Z({}, ie, t), this.$customContainer = !!this.opts.container && f(this.opts.container), this.$altField = f(this.opts.altField || !1), ee || (ee = f("body"));
|
|
895
891
|
let { view: a, startDate: n } = this.opts;
|
|
896
|
-
n || (this.opts.startDate = new Date()), this.$el.nodeName === "INPUT" && (this.elIsInput = !0), this.inited = !1, this.visible = !1, this.viewDate =
|
|
892
|
+
n || (this.opts.startDate = new Date()), this.$el.nodeName === "INPUT" && (this.elIsInput = !0), this.inited = !1, this.visible = !1, this.viewDate = M(this.opts.startDate), this.focusDate = !1, this.initialReadonly = this.$el.getAttribute("readonly"), this.customHide = !1, this.currentView = a, this.selectedDates = [], this.views = {}, this.keys = [], this.rangeDateFrom = "", this.rangeDateTo = "", this.timepickerIsActive = !1, this.treatAsInline = this.opts.inline || !this.elIsInput, this.init();
|
|
897
893
|
}
|
|
898
894
|
init() {
|
|
899
895
|
let { opts: e, treatAsInline: t, opts: { inline: i, isMobile: a, selectedDates: n, keyboardNav: s, onlyTimepicker: o } } = this;
|
|
900
896
|
var h;
|
|
901
|
-
|
|
897
|
+
re || i || !this.elIsInput || (re = !0, J = k({ className: h = H.defaultContainerId, id: h }), ee.appendChild(J)), !a || V || t || this._createMobileOverlay(), this._handleLocale(), this._bindSubEvents(), this._createMinMaxDates(), this._limitViewDateByMaxMinDates(), this.elIsInput && (i || this._bindEvents(), s && !o && (this.keyboardNav = new ye({ dp: this, opts: e }))), n && this.selectDate(n, { silent: !0 }), this.opts.visible && !t && this.show(), a && !t && this.$el.setAttribute("readonly", !0), t && this._createComponents();
|
|
902
898
|
}
|
|
903
899
|
_createMobileOverlay() {
|
|
904
|
-
|
|
900
|
+
V = k({ className: "air-datepicker-overlay" }), J.appendChild(V);
|
|
905
901
|
}
|
|
906
902
|
_createComponents() {
|
|
907
903
|
let { opts: e, treatAsInline: t, opts: { inline: i, buttons: a, timepicker: n, position: s, classes: o, onlyTimepicker: h, isMobile: d } } = this;
|
|
908
|
-
this._buildBaseHtml(), this.elIsInput && (i || this._setPositionClasses(s)), !i && this.elIsInput || this.$datepicker.classList.add("-inline-"), o && this.$datepicker.classList.add(...o.split(" ")), h && this.$datepicker.classList.add("-only-timepicker-"), d && !t && this._addMobileAttributes(), this.views[this.currentView] = new
|
|
904
|
+
this._buildBaseHtml(), this.elIsInput && (i || this._setPositionClasses(s)), !i && this.elIsInput || this.$datepicker.classList.add("-inline-"), o && this.$datepicker.classList.add(...o.split(" ")), h && this.$datepicker.classList.add("-only-timepicker-"), d && !t && this._addMobileAttributes(), this.views[this.currentView] = new ae({ dp: this, type: this.currentView, opts: e }), this.nav = new me({ dp: this, opts: e }), n && this._addTimepicker(), a && this._addButtons(), this.$content.appendChild(this.views[this.currentView].$el), this.$nav.appendChild(this.nav.$el);
|
|
909
905
|
}
|
|
910
906
|
_destroyComponents() {
|
|
911
907
|
for (let e in this.views)
|
|
@@ -913,20 +909,20 @@ var Ae = me(function(m, v) {
|
|
|
913
909
|
this.views = {}, this.nav.destroy(), this.timepicker && this.timepicker.destroy();
|
|
914
910
|
}
|
|
915
911
|
_addMobileAttributes() {
|
|
916
|
-
|
|
912
|
+
V.addEventListener("click", this._onClickOverlay), this.$datepicker.classList.add("-is-mobile-"), this.$el.setAttribute("readonly", !0);
|
|
917
913
|
}
|
|
918
914
|
_removeMobileAttributes() {
|
|
919
|
-
|
|
915
|
+
V.removeEventListener("click", this._onClickOverlay), this.$datepicker.classList.remove("-is-mobile-"), this.initialReadonly || this.initialReadonly === "" || this.$el.removeAttribute("readonly");
|
|
920
916
|
}
|
|
921
917
|
_createMinMaxDates() {
|
|
922
918
|
let { minDate: e, maxDate: t } = this.opts;
|
|
923
|
-
this.minDate = !!e &&
|
|
919
|
+
this.minDate = !!e && M(e), this.maxDate = !!t && M(t);
|
|
924
920
|
}
|
|
925
921
|
_addTimepicker() {
|
|
926
|
-
this.$timepicker =
|
|
922
|
+
this.$timepicker = k({ className: "air-datepicker--time" }), this.$datepicker.appendChild(this.$timepicker), this.timepicker = new ve({ dp: this, opts: this.opts }), this.$timepicker.appendChild(this.timepicker.$el);
|
|
927
923
|
}
|
|
928
924
|
_addButtons() {
|
|
929
|
-
this.$buttons =
|
|
925
|
+
this.$buttons = k({ className: "air-datepicker--buttons" }), this.$datepicker.appendChild(this.$buttons), this.buttons = new ge({ dp: this, opts: this.opts }), this.$buttons.appendChild(this.buttons.$el);
|
|
930
926
|
}
|
|
931
927
|
_bindSubEvents() {
|
|
932
928
|
this.on(l.eventChangeSelectedDate, this._onChangeSelectedDate), this.on(l.eventChangeFocusDate, this._onChangeFocusedDate), this.on(l.eventChangeTime, this._onChangeTime);
|
|
@@ -934,7 +930,7 @@ var Ae = me(function(m, v) {
|
|
|
934
930
|
_buildBaseHtml() {
|
|
935
931
|
let { inline: e } = this.opts;
|
|
936
932
|
var t, i;
|
|
937
|
-
this.elIsInput ? e ? (t = this.$datepicker, (i = this.$el).parentNode.insertBefore(t, i.nextSibling)) : this.$container.appendChild(this.$datepicker) : this.$el.appendChild(this.$datepicker), this.$datepicker.innerHTML = '<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>', this.$content =
|
|
933
|
+
this.elIsInput ? e ? (t = this.$datepicker, (i = this.$el).parentNode.insertBefore(t, i.nextSibling)) : this.$container.appendChild(this.$datepicker) : this.$el.appendChild(this.$datepicker), this.$datepicker.innerHTML = '<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>', this.$content = f(".air-datepicker--content", this.$datepicker), this.$pointer = f(".air-datepicker--pointer", this.$datepicker), this.$nav = f(".air-datepicker--navigation", this.$datepicker);
|
|
938
934
|
}
|
|
939
935
|
_handleLocale() {
|
|
940
936
|
let { locale: e, dateFormat: t, firstDay: i, timepicker: a, onlyTimepicker: n, timeFormat: s, dateTimeSeparator: o } = this.opts;
|
|
@@ -958,17 +954,17 @@ var Ae = me(function(m, v) {
|
|
|
958
954
|
}
|
|
959
955
|
_limitViewDateByMaxMinDates() {
|
|
960
956
|
let { viewDate: e, minDate: t, maxDate: i } = this;
|
|
961
|
-
i &&
|
|
957
|
+
i && T(e, i) && this.setViewDate(i), t && P(e, t) && this.setViewDate(t);
|
|
962
958
|
}
|
|
963
959
|
formatDate() {
|
|
964
960
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.viewDate, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
965
|
-
if (e =
|
|
961
|
+
if (e = M(e), !(e instanceof Date))
|
|
966
962
|
return;
|
|
967
|
-
let i = t, a = this.locale, n =
|
|
963
|
+
let i = t, a = this.locale, n = v(e), s = O(e), o = H.replacer, h = "am";
|
|
968
964
|
this.opts.timepicker && this.timepicker && (h = this.timepicker.getDayPeriod(e).dayPeriod);
|
|
969
965
|
let d = { T: e.getTime(), m: n.minutes, mm: n.fullMinutes, h: n.hours12, hh: n.fullHours12, H: n.hours, HH: n.fullHours, aa: h, AA: h.toUpperCase(), E: a.daysShort[n.day], EEEE: a.days[n.day], d: n.date, dd: n.fullDate, M: n.month + 1, MM: n.fullMonth, MMM: a.monthsShort[n.month], MMMM: a.months[n.month], yy: n.year.toString().slice(-2), yyyy: n.year, yyyy1: s[0], yyyy2: s[1] };
|
|
970
|
-
for (let [c,
|
|
971
|
-
i = o(i, Q(c),
|
|
966
|
+
for (let [c, u] of Object.entries(d))
|
|
967
|
+
i = o(i, Q(c), u);
|
|
972
968
|
return i;
|
|
973
969
|
}
|
|
974
970
|
down(e) {
|
|
@@ -978,22 +974,22 @@ var Ae = me(function(m, v) {
|
|
|
978
974
|
this._handleUpDownActions(e, "up");
|
|
979
975
|
}
|
|
980
976
|
selectDate(e) {
|
|
981
|
-
let t, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { currentView: a, parsedViewDate: n, selectedDates: s } = this, { updateTime: o } = i, { moveToOtherMonthsOnSelect: h, moveToOtherYearsOnSelect: d, multipleDates: c, range:
|
|
977
|
+
let t, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { currentView: a, parsedViewDate: n, selectedDates: s } = this, { updateTime: o } = i, { moveToOtherMonthsOnSelect: h, moveToOtherYearsOnSelect: d, multipleDates: c, range: u, autoClose: p } = this.opts, g = s.length;
|
|
982
978
|
if (Array.isArray(e))
|
|
983
|
-
return e.forEach((
|
|
984
|
-
this.selectDate(
|
|
985
|
-
}), new Promise((
|
|
986
|
-
setTimeout(
|
|
979
|
+
return e.forEach((w) => {
|
|
980
|
+
this.selectDate(w, i);
|
|
981
|
+
}), new Promise((w) => {
|
|
982
|
+
setTimeout(w);
|
|
987
983
|
});
|
|
988
|
-
if ((e =
|
|
989
|
-
if (a === l.days && e.getMonth() !== n.month && h && (t = new Date(e.getFullYear(), e.getMonth(), 1)), a === l.years && e.getFullYear() !== n.year && d && (t = new Date(e.getFullYear(), 0, 1)), t && this.setViewDate(t), c && !
|
|
990
|
-
if (
|
|
984
|
+
if ((e = M(e)) instanceof Date) {
|
|
985
|
+
if (a === l.days && e.getMonth() !== n.month && h && (t = new Date(e.getFullYear(), e.getMonth(), 1)), a === l.years && e.getFullYear() !== n.year && d && (t = new Date(e.getFullYear(), 0, 1)), t && this.setViewDate(t), c && !u) {
|
|
986
|
+
if (g === c)
|
|
991
987
|
return;
|
|
992
988
|
this._checkIfDateIsSelected(e) || s.push(e);
|
|
993
|
-
} else if (
|
|
994
|
-
switch (
|
|
989
|
+
} else if (u)
|
|
990
|
+
switch (g) {
|
|
995
991
|
case 1:
|
|
996
|
-
s.push(e), this.rangeDateTo || (this.rangeDateTo = e),
|
|
992
|
+
s.push(e), this.rangeDateTo || (this.rangeDateTo = e), T(this.rangeDateFrom, this.rangeDateTo) && (this.rangeDateTo = this.rangeDateFrom, this.rangeDateFrom = e), this.selectedDates = [this.rangeDateFrom, this.rangeDateTo];
|
|
997
993
|
break;
|
|
998
994
|
case 2:
|
|
999
995
|
this.selectedDates = [e], this.rangeDateFrom = e, this.rangeDateTo = "";
|
|
@@ -1003,22 +999,22 @@ var Ae = me(function(m, v) {
|
|
|
1003
999
|
}
|
|
1004
1000
|
else
|
|
1005
1001
|
this.selectedDates = [e];
|
|
1006
|
-
return this.trigger(l.eventChangeSelectedDate, { action: l.actionSelectDate, silent: i == null ? void 0 : i.silent, date: e, updateTime: o }), this._updateLastSelectedDate(e),
|
|
1007
|
-
setTimeout(
|
|
1002
|
+
return this.trigger(l.eventChangeSelectedDate, { action: l.actionSelectDate, silent: i == null ? void 0 : i.silent, date: e, updateTime: o }), this._updateLastSelectedDate(e), p && !this.timepickerIsActive && this.visible && (c || u ? u && g === 1 && this.hide() : this.hide()), new Promise((w) => {
|
|
1003
|
+
setTimeout(w);
|
|
1008
1004
|
});
|
|
1009
1005
|
}
|
|
1010
1006
|
}
|
|
1011
1007
|
unselectDate(e) {
|
|
1012
1008
|
let t = this.selectedDates, i = this;
|
|
1013
|
-
if ((e =
|
|
1009
|
+
if ((e = M(e)) instanceof Date)
|
|
1014
1010
|
return t.some((a, n) => {
|
|
1015
|
-
if (
|
|
1011
|
+
if (y(a, e))
|
|
1016
1012
|
return t.splice(n, 1), i.selectedDates.length ? i._updateLastSelectedDate(i.selectedDates[i.selectedDates.length - 1]) : (i.rangeDateFrom = "", i.rangeDateTo = "", i._updateLastSelectedDate(!1)), this.trigger(l.eventChangeSelectedDate, { action: l.actionUnselectDate, date: e }), !0;
|
|
1017
1013
|
});
|
|
1018
1014
|
}
|
|
1019
1015
|
replaceDate(e, t) {
|
|
1020
|
-
let i = this.selectedDates.find((n) =>
|
|
1021
|
-
a < 0 ||
|
|
1016
|
+
let i = this.selectedDates.find((n) => y(n, e, this.currentView)), a = this.selectedDates.indexOf(i);
|
|
1017
|
+
a < 0 || y(this.selectedDates[a], t, this.currentView) || (this.selectedDates[a] = t, this.trigger(l.eventChangeSelectedDate, { action: l.actionSelectDate, date: t, updateTime: !0 }), this._updateLastSelectedDate(t));
|
|
1022
1018
|
}
|
|
1023
1019
|
clear() {
|
|
1024
1020
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -1034,7 +1030,7 @@ var Ae = me(function(m, v) {
|
|
|
1034
1030
|
let { onHide: e, isMobile: t } = this.opts, i = this._hasTransition();
|
|
1035
1031
|
this.visible = !1, this.hideAnimation = !0, this.$datepicker.classList.remove("-active-"), this.customHide && this.customHide(), this.elIsInput && this.$el.blur(), this._scheduleCallAfterTransition((a) => {
|
|
1036
1032
|
!this.customHide && (a && i || !a && !i) && this._finishHide(), e && e(a);
|
|
1037
|
-
}), t &&
|
|
1033
|
+
}), t && V.classList.remove("-active-");
|
|
1038
1034
|
}
|
|
1039
1035
|
_triggerOnSelect() {
|
|
1040
1036
|
let e = [], t = [], { selectedDates: i, locale: a, opts: { onSelect: n, multipleDates: s, range: o } } = this, h = s || o, d = typeof a.dateFormat == "function";
|
|
@@ -1045,23 +1041,23 @@ var Ae = me(function(m, v) {
|
|
|
1045
1041
|
i ? a ? this.unselectDate(t) : this.selectedDates.length !== 2 && this.selectDate(t) : a && this.unselectDate(t), a || this._updateLastSelectedDate(e);
|
|
1046
1042
|
}
|
|
1047
1043
|
_handleUpDownActions(e, t) {
|
|
1048
|
-
if (!((e =
|
|
1044
|
+
if (!((e = M(e || this.focusDate || this.viewDate)) instanceof Date))
|
|
1049
1045
|
return;
|
|
1050
1046
|
let i = t === "up" ? this.viewIndex + 1 : this.viewIndex - 1;
|
|
1051
1047
|
i > 2 && (i = 2), i < 0 && (i = 0), this.setViewDate(new Date(e.getFullYear(), e.getMonth(), 1)), this.setCurrentView(this.viewIndexes[i]);
|
|
1052
1048
|
}
|
|
1053
1049
|
_handleRangeOnFocus() {
|
|
1054
|
-
this.selectedDates.length === 1 && (
|
|
1050
|
+
this.selectedDates.length === 1 && (T(this.selectedDates[0], this.focusDate) ? (this.rangeDateTo = this.selectedDates[0], this.rangeDateFrom = this.focusDate) : (this.rangeDateTo = this.focusDate, this.rangeDateFrom = this.selectedDates[0]));
|
|
1055
1051
|
}
|
|
1056
1052
|
getCell(e) {
|
|
1057
1053
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : l.day;
|
|
1058
|
-
if (!((e =
|
|
1054
|
+
if (!((e = M(e)) instanceof Date))
|
|
1059
1055
|
return;
|
|
1060
|
-
let { year: i, month: a, date: n } =
|
|
1056
|
+
let { year: i, month: a, date: n } = v(e), s = '[data-year="'.concat(i, '"]'), o = '[data-month="'.concat(a, '"]'), h = '[data-date="'.concat(n, '"]'), d = { [l.day]: "".concat(s).concat(o).concat(h), [l.month]: "".concat(s).concat(o), [l.year]: "".concat(s) };
|
|
1061
1057
|
return this.views[this.currentView].$el.querySelector(d[t]);
|
|
1062
1058
|
}
|
|
1063
1059
|
_showMobileOverlay() {
|
|
1064
|
-
|
|
1060
|
+
V.classList.add("-active-");
|
|
1065
1061
|
}
|
|
1066
1062
|
_hasTransition() {
|
|
1067
1063
|
return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce((e, t) => parseFloat(t) + e, 0) > 0;
|
|
@@ -1070,13 +1066,13 @@ var Ae = me(function(m, v) {
|
|
|
1070
1066
|
return this.visible || this.treatAsInline;
|
|
1071
1067
|
}
|
|
1072
1068
|
get parsedViewDate() {
|
|
1073
|
-
return
|
|
1069
|
+
return v(this.viewDate);
|
|
1074
1070
|
}
|
|
1075
1071
|
get currentViewSingular() {
|
|
1076
1072
|
return this.currentView.slice(0, -1);
|
|
1077
1073
|
}
|
|
1078
1074
|
get curDecade() {
|
|
1079
|
-
return
|
|
1075
|
+
return O(this.viewDate);
|
|
1080
1076
|
}
|
|
1081
1077
|
get viewIndex() {
|
|
1082
1078
|
return this.viewIndexes.indexOf(this.currentView);
|
|
@@ -1099,15 +1095,15 @@ var Ae = me(function(m, v) {
|
|
|
1099
1095
|
});
|
|
1100
1096
|
}
|
|
1101
1097
|
}
|
|
1102
|
-
var
|
|
1103
|
-
return
|
|
1098
|
+
var oe;
|
|
1099
|
+
return m(H, "defaults", ie), m(H, "version", "3.3.0"), m(H, "defaultContainerId", "air-datepicker-global-container"), oe = H.prototype, Object.assign(oe, De), W.default;
|
|
1104
1100
|
}();
|
|
1105
1101
|
});
|
|
1106
|
-
}),
|
|
1107
|
-
Object.defineProperty(
|
|
1102
|
+
}), Me = de(function(D, b) {
|
|
1103
|
+
Object.defineProperty(b, "__esModule", {
|
|
1108
1104
|
value: !0
|
|
1109
|
-
}),
|
|
1110
|
-
var
|
|
1105
|
+
}), b.default = void 0;
|
|
1106
|
+
var F = {
|
|
1111
1107
|
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
1112
1108
|
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1113
1109
|
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
@@ -1119,12 +1115,12 @@ var Ae = me(function(m, v) {
|
|
|
1119
1115
|
timeFormat: "hh:mm aa",
|
|
1120
1116
|
firstDay: 0
|
|
1121
1117
|
};
|
|
1122
|
-
|
|
1118
|
+
b.default = F;
|
|
1123
1119
|
});
|
|
1124
|
-
const
|
|
1125
|
-
constructor(
|
|
1126
|
-
|
|
1127
|
-
|
|
1120
|
+
const $e = /* @__PURE__ */ ke(Me), Se = ':host{display:block}:host *{box-sizing:border-box}.date-picker{padding:var(--s-space-8) var(--s-space-16);background-color:var(--s-surface-overlay-default);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);letter-spacing:var(--s-letter-spacing-tighter)}@media (min-width: 768px){.date-picker{max-width:17.5rem}}.air-datepicker--pointer{display:none}.air-datepicker-nav{display:flex;margin-bottom:var(--s-space-8);align-items:center}.air-datepicker-nav--action{position:relative;display:inline-flex;width:2.5rem;height:2.5rem;justify-content:center;align-items:center;border-radius:50%;color:var(--s-icon-highlight);cursor:pointer;order:2}.air-datepicker-nav--action:hover{background-color:var(--s-surface-overlay-hovered)}.air-datepicker-nav--title{padding:var(--s-space-8);flex-grow:1;border-radius:var(--s-border-radius-s);font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left;cursor:pointer;order:0}.air-datepicker-nav--title i{font-style:normal}.air-datepicker-body--day-names{display:flex;margin-bottom:var(--s-space-8);justify-content:space-between;align-items:center}.air-datepicker-body--day-name{display:inline-flex;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;color:var(--s-text-subdued);aspect-ratio:1}.air-datepicker-body--cells{position:relative;z-index:1;display:flex;flex-wrap:wrap;justify-content:space-between}.air-datepicker-body--cells.-months-{gap:var(--s-space-2)}.air-datepicker-cell{position:relative;display:inline-flex;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;font-weight:var(--s-font-weight-medium);cursor:pointer;aspect-ratio:1}.air-datepicker-cell:not(.-month-):not(.-year-):not(.-in-range-):hover:before{position:absolute;z-index:-1;border-radius:50%;background-color:var(--s-surface-overlay-hovered);content:"";inset:0}.air-datepicker-cell.-month-,.air-datepicker-cell.-year-{height:2.5rem;flex-basis:calc(100 / 3 * 1% - var(--s-space-2) * 2);border-radius:var(--s-border-radius-s);aspect-ratio:auto}.air-datepicker-cell.-month-.-in-range-:before,.air-datepicker-cell.-year-.-in-range-:before{border-radius:var(--s-border-radius-s)}.air-datepicker-cell.-month-:hover:not(.-in-range-):not(.-selected-),.air-datepicker-cell.-year-:hover:not(.-in-range-):not(.-selected-){background-color:var(--s-surface-overlay-hovered)}.air-datepicker-cell.-other-month-{color:var(--s-text-subdued)}.air-datepicker-cell.-current-:not(.-month-):not(.-year-):after{position:absolute;z-index:-1;border:var(--s-border-width-default) solid var(--s-border-highlight);border-radius:50%;content:"";inset:0}.air-datepicker-cell.-selected-{color:var(--s-text-on-surface-highlight)}.air-datepicker-cell.-selected-.-year-,.air-datepicker-cell.-selected-.-month-{background-color:var(--s-surface-highlight-default)}.air-datepicker-cell.-selected-:not(.-month-):not(.-year-):not(.-in-range-):before{position:absolute;z-index:-1;border-radius:50%;background-color:var(--s-surface-highlight-default);content:"";inset:0}.air-datepicker-cell.-disabled-{color:var(--s-text-subdued);cursor:default}.air-datepicker-cell.-disabled-:hover{background-color:transparent}.air-datepicker-cell.-in-range-:before{position:absolute;z-index:-1;top:0.0625rem;right:0;bottom:0.0625rem;left:0;border-radius:0;background-color:var(--s-surface-highlight-default);content:"";opacity:0.2}.air-datepicker-cell.-range-from-:not(.-month-):not(.-year-):not(.-range-to-):hover{color:var(--s-text-on-surface-highlight)}.air-datepicker-cell.-range-from-:not(.-month-):not(.-year-):not(.-range-to-):before{position:absolute;z-index:-1;border-radius:50%;background-color:var(--s-surface-highlight-default);content:"";inset:0}.air-datepicker-cell.-range-from-:not(.-month-):not(.-year-):not(.-range-to-):after{position:absolute;z-index:-1;top:0.0625rem;right:0;bottom:0.0625rem;left:50%;border-radius:0;background-color:var(--s-surface-highlight-default);content:"";opacity:0.2}.air-datepicker-cell.-range-to-:not(.-month-):not(.-year-):not(.-range-from-):hover{color:var(--s-text-on-surface-highlight)}.air-datepicker-cell.-range-to-:not(.-month-):not(.-year-):not(.-range-from-):before{position:absolute;z-index:-1;border-radius:50%;background-color:var(--s-surface-highlight-default);content:"";inset:0}.air-datepicker-cell.-range-to-:not(.-month-):not(.-year-):not(.-range-from-):after{position:absolute;z-index:-1;top:0.0625rem;right:50%;bottom:0.0625rem;left:0;border-radius:0;background-color:var(--s-surface-highlight-default);content:"";opacity:0.2}.-hidden-{display:none}', Te = class {
|
|
1121
|
+
constructor(D) {
|
|
1122
|
+
le(this, D), this.valueChange = we(this, "valueChange", 3), this.locale = $e, this.onClick = (b) => {
|
|
1123
|
+
b.stopPropagation(), b.preventDefault();
|
|
1128
1124
|
};
|
|
1129
1125
|
}
|
|
1130
1126
|
watchProps() {
|
|
@@ -1134,12 +1130,14 @@ const Oe = /* @__PURE__ */ xe(Le), Ne = ':host{display:block}:host *{box-sizing:
|
|
|
1134
1130
|
this.init();
|
|
1135
1131
|
}
|
|
1136
1132
|
disconnectedCallback() {
|
|
1137
|
-
var
|
|
1138
|
-
(
|
|
1133
|
+
var D;
|
|
1134
|
+
(D = this.picker) === null || D === void 0 || D.destroy();
|
|
1139
1135
|
}
|
|
1140
1136
|
init() {
|
|
1141
|
-
var
|
|
1142
|
-
(
|
|
1137
|
+
var D;
|
|
1138
|
+
(D = this.picker) === null || D === void 0 || D.destroy();
|
|
1139
|
+
let b;
|
|
1140
|
+
this.value === void 0 ? b = void 0 : Array.isArray(this.value) ? b = this.value : b = [this.value], this.picker = new _e(this.containerEl, {
|
|
1143
1141
|
classes: "date-picker",
|
|
1144
1142
|
inline: !0,
|
|
1145
1143
|
locale: this.locale,
|
|
@@ -1147,19 +1145,19 @@ const Oe = /* @__PURE__ */ xe(Le), Ne = ':host{display:block}:host *{box-sizing:
|
|
|
1147
1145
|
minDate: this.minDate,
|
|
1148
1146
|
minView: "days",
|
|
1149
1147
|
nextHtml: "<flip-icon-chevron-right></flip-icon-chevron-right>",
|
|
1150
|
-
onSelect: ({ date:
|
|
1151
|
-
this.valueChange.emit(
|
|
1148
|
+
onSelect: ({ date: F }) => {
|
|
1149
|
+
this.valueChange.emit(F);
|
|
1152
1150
|
},
|
|
1153
1151
|
prevHtml: "<flip-icon-chevron-left></flip-icon-chevron-left>",
|
|
1154
1152
|
range: this.range,
|
|
1155
|
-
selectedDates:
|
|
1153
|
+
selectedDates: b,
|
|
1156
1154
|
startDate: this.startDate,
|
|
1157
1155
|
toggleSelected: !this.range,
|
|
1158
1156
|
view: "days"
|
|
1159
1157
|
});
|
|
1160
1158
|
}
|
|
1161
1159
|
render() {
|
|
1162
|
-
return
|
|
1160
|
+
return x(be, { onClick: this.onClick }, x("div", { ref: (D) => this.containerEl = D }));
|
|
1163
1161
|
}
|
|
1164
1162
|
static get watchers() {
|
|
1165
1163
|
return {
|
|
@@ -1172,106 +1170,17 @@ const Oe = /* @__PURE__ */ xe(Le), Ne = ':host{display:block}:host *{box-sizing:
|
|
|
1172
1170
|
};
|
|
1173
1171
|
}
|
|
1174
1172
|
};
|
|
1175
|
-
|
|
1176
|
-
const
|
|
1177
|
-
constructor(
|
|
1178
|
-
|
|
1173
|
+
Te.style = Se;
|
|
1174
|
+
const Ve = ":host{display:inline-flex}", xe = class {
|
|
1175
|
+
constructor(D) {
|
|
1176
|
+
le(this, D), this.size = 24;
|
|
1179
1177
|
}
|
|
1180
1178
|
render() {
|
|
1181
|
-
return
|
|
1182
|
-
}
|
|
1183
|
-
};
|
|
1184
|
-
Be.style = Pe;
|
|
1185
|
-
const Re = ":host{position:relative;z-index:var(--s-z-40);display:inline-flex}:host *{box-sizing:border-box}.popover--active:not(.popover--closing) .popover__backdrop{-webkit-animation:0.15s popover-fade-in;animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__backdrop{-webkit-animation:none;animation:none}}.popover--active:not(.popover--closing) .popover__content{-webkit-animation:0.15s popover-slide-in;animation:0.15s popover-slide-in}@media (min-width: 768px){.popover--active:not(.popover--closing) .popover__content{transform-origin:top left;-webkit-animation:0.15s popover-fade-scale-in;animation:0.15s popover-fade-scale-in}}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__content{-webkit-animation:none;animation:none}}.popover--closing .popover__backdrop{-webkit-animation:0.15s popover-fade-out;animation:0.15s popover-fade-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (prefers-reduced-motion){.popover--closing .popover__backdrop{-webkit-animation:none;animation:none}}.popover--closing .popover__content{-webkit-animation:0.15s popover-slide-out;animation:0.15s popover-slide-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (min-width: 768px){.popover--closing .popover__content{-webkit-animation:0.15s popover-fade-out;animation:0.15s popover-fade-out}}@media (prefers-reduced-motion){.popover--closing .popover__content{-webkit-animation:none;animation:none}}.popover--inactive .popover__content{display:none}.popover__backdrop{position:fixed;z-index:0;background-color:rgba(0, 0, 0, 0.2);-webkit-animation:0.15s popover-backdrop-fade-in;animation:0.15s popover-backdrop-fade-in;inset:0}@media (prefers-reduced-motion){.popover__backdrop{-webkit-animation:none;animation:none}}@media (min-width: 768px){.popover__backdrop{display:none}}.popover__content{position:fixed;z-index:2;right:0;bottom:0;left:0;overflow:hidden;border-top-left-radius:var(--s-border-radius-xl);border-top-right-radius:var(--s-border-radius-xl);background-color:var(--s-surface-overlay-default)}@media (min-width: 768px){.popover__content{right:unset;bottom:unset;left:unset;max-width:22.5rem;border-radius:var(--s-border-radius-sm);-webkit-animation:none;animation:none;box-shadow:0.125rem 0.25rem 2.5rem rgba(0, 0, 0, 0.14)}}.popover__scroll-container{overflow-x:hidden;overflow-y:auto;width:100%;max-height:90vh;padding-top:var(--s-space-24);padding-bottom:var(--s-space-24);overscroll-behavior:contain}@media (min-width: 768px){.popover__scroll-container{max-height:22rem;padding-top:var(--s-space-8);padding-bottom:var(--s-space-8)}}.popover__handle{position:absolute;top:var(--s-space-8);left:50%;width:2.5rem;height:0.375rem;border-radius:0.1875rem;background-color:var(--s-border-default);transform:translatex(-50%)}@media (min-width: 768px){.popover__handle{display:none}}@-webkit-keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes popover-fade-scale-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes popover-fade-scale-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}", ze = class {
|
|
1186
|
-
constructor(m) {
|
|
1187
|
-
ie(this, m), this.placement = "bottom-start", this.active = !1, this.closing = !1, this.onFocusOut = (v) => {
|
|
1188
|
-
if (!this.active)
|
|
1189
|
-
return;
|
|
1190
|
-
const w = v.relatedTarget || v.target;
|
|
1191
|
-
!this.el.contains(w) && this.close();
|
|
1192
|
-
}, this.toggle = (v) => {
|
|
1193
|
-
v.stopPropagation(), this.active ? this.close() : this.open();
|
|
1194
|
-
}, this.onKeydown = (v) => {
|
|
1195
|
-
v.code === "Escape" && this.active && this.close();
|
|
1196
|
-
}, this.reposition = async () => {
|
|
1197
|
-
const v = ce();
|
|
1198
|
-
if (!(!Boolean(this.triggerEl) || !Boolean(this.contentContainer))) {
|
|
1199
|
-
if (v) {
|
|
1200
|
-
this.position = void 0;
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
this.position = await Te(this.triggerEl, this.contentContainer, {
|
|
1204
|
-
middleware: [Se(), Ve()],
|
|
1205
|
-
placement: this.placement,
|
|
1206
|
-
strategy: "fixed"
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
1209
|
-
}, this.onCloseButtonClick = () => {
|
|
1210
|
-
this.close();
|
|
1211
|
-
};
|
|
1212
|
-
}
|
|
1213
|
-
componentDidLoad() {
|
|
1214
|
-
this.connectTrigger(), this.updateChildMenuItems(), this.updateTriggerAttributes();
|
|
1215
|
-
}
|
|
1216
|
-
disconnectedCallback() {
|
|
1217
|
-
de(this.scrollContainer);
|
|
1218
|
-
}
|
|
1219
|
-
onWindowClick(m) {
|
|
1220
|
-
const v = m.target;
|
|
1221
|
-
this.el.contains(v) || this.close();
|
|
1222
|
-
}
|
|
1223
|
-
async close() {
|
|
1224
|
-
var m;
|
|
1225
|
-
this.closing || (this.disableAutoUpdate && this.disableAutoUpdate(), this.closing = !0, setTimeout(() => {
|
|
1226
|
-
this.active = !1, this.closing = !1, this.updateTriggerAttributes();
|
|
1227
|
-
}, 150), this.unlockBodyScroll(), (m = this.getNativeTriggerElement()) === null || m === void 0 || m.focus());
|
|
1228
|
-
}
|
|
1229
|
-
async open() {
|
|
1230
|
-
this.active = !0, this.updateChildMenuItems(), this.updateTriggerAttributes(), requestAnimationFrame(async () => {
|
|
1231
|
-
await this.reposition(), this.childMenuItems.length > 0 ? this.childMenuItems[0].focus() : this.contentContainer.focus(), this.disableAutoUpdate && this.disableAutoUpdate(), this.disableAutoUpdate = Fe(this.triggerEl, this.contentContainer, this.reposition), this.scrollContainer.scrollTop = 0, this.lockBodyScroll();
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1234
|
-
connectTrigger() {
|
|
1235
|
-
this.triggerEl = pe(document.body, `#${this.trigger}`)[0], Boolean(this.triggerEl) && this.triggerEl.addEventListener("click", this.toggle);
|
|
1236
|
-
}
|
|
1237
|
-
getNativeTriggerElement() {
|
|
1238
|
-
var m, v, w;
|
|
1239
|
-
return this.triggerEl.tagName.startsWith("FLIP-") ? ((m = this.triggerEl) === null || m === void 0 ? void 0 : m.children[0]) || ((w = (v = this.triggerEl) === null || v === void 0 ? void 0 : v.shadowRoot) === null || w === void 0 ? void 0 : w.children[0]) || this.triggerEl : this.triggerEl;
|
|
1240
|
-
}
|
|
1241
|
-
updateTriggerAttributes() {
|
|
1242
|
-
if (!Boolean(this.triggerEl))
|
|
1243
|
-
return;
|
|
1244
|
-
const m = this.getNativeTriggerElement();
|
|
1245
|
-
m.setAttribute("aria-controls", this.popoverId), m.setAttribute("aria-expanded", String(this.active)), m.setAttribute("aria-haspopup", "dialog");
|
|
1246
|
-
}
|
|
1247
|
-
updateChildMenuItems() {
|
|
1248
|
-
this.childMenuItems = pe(this.el, '[role="menuitem"]');
|
|
1249
|
-
}
|
|
1250
|
-
lockBodyScroll() {
|
|
1251
|
-
!ce() || He(this.scrollContainer);
|
|
1252
|
-
}
|
|
1253
|
-
unlockBodyScroll() {
|
|
1254
|
-
de(this.scrollContainer);
|
|
1255
|
-
}
|
|
1256
|
-
render() {
|
|
1257
|
-
var m, v;
|
|
1258
|
-
const w = Ee("popover", {
|
|
1259
|
-
"popover--closing": this.closing,
|
|
1260
|
-
"popover--active": this.active,
|
|
1261
|
-
"popover--inactive": !this.active
|
|
1262
|
-
});
|
|
1263
|
-
return b(ue, { id: this.popoverId, onFocusout: this.onFocusOut }, b("div", { class: w, onKeyDown: this.onKeydown }, b("div", { "aria-hidden": this.active ? "false" : "true", "aria-label": this.label, class: "popover__content", role: "dialog", tabindex: "-1", ref: (S) => this.contentContainer = S, style: {
|
|
1264
|
-
top: Boolean(this.position) ? `${(m = this.position) === null || m === void 0 ? void 0 : m.y}px` : "",
|
|
1265
|
-
left: Boolean(this.position) ? `${(v = this.position) === null || v === void 0 ? void 0 : v.x}px` : ""
|
|
1266
|
-
} }, b("span", { class: "popover__handle" }), b("div", { class: "popover__scroll-container", ref: (S) => this.scrollContainer = S }, b("slot", null))), this.active && b("div", { class: "popover__backdrop", onClick: this.onCloseButtonClick })));
|
|
1267
|
-
}
|
|
1268
|
-
get el() {
|
|
1269
|
-
return Me(this);
|
|
1179
|
+
return x("svg", { class: "flip-icon", fill: "none", height: this.size, part: "icon", viewBox: `0 0 ${this.size} ${this.size}`, width: this.size, xmlns: "http://www.w3.org/2000/svg" }, this.size === 16 && x(te, null, x("path", { d: "M6 11C5.53333 11 5.13889 10.8389 4.81667 10.5167C4.49444 10.1945 4.33333 9.80004 4.33333 9.33337C4.33333 8.86671 4.49444 8.47226 4.81667 8.15004C5.13889 7.82782 5.53333 7.66671 6 7.66671C6.46667 7.66671 6.86111 7.82782 7.18333 8.15004C7.50556 8.47226 7.66667 8.86671 7.66667 9.33337C7.66667 9.80004 7.50556 10.1945 7.18333 10.5167C6.86111 10.8389 6.46667 11 6 11ZM3.33333 14.6667C2.96667 14.6667 2.65267 14.5363 2.39133 14.2754C2.13044 14.014 2 13.7 2 13.3334V4.00004C2 3.63337 2.13044 3.3196 2.39133 3.05871C2.65267 2.79737 2.96667 2.66671 3.33333 2.66671H4V2.00004C4 1.81115 4.06378 1.65271 4.19133 1.52471C4.31933 1.39715 4.47778 1.33337 4.66667 1.33337C4.85556 1.33337 5.014 1.39715 5.142 1.52471C5.26956 1.65271 5.33333 1.81115 5.33333 2.00004V2.66671H10.6667V2.00004C10.6667 1.81115 10.7307 1.65271 10.8587 1.52471C10.9862 1.39715 11.1444 1.33337 11.3333 1.33337C11.5222 1.33337 11.6804 1.39715 11.808 1.52471C11.936 1.65271 12 1.81115 12 2.00004V2.66671H12.6667C13.0333 2.66671 13.3473 2.79737 13.6087 3.05871C13.8696 3.3196 14 3.63337 14 4.00004V13.3334C14 13.7 13.8696 14.014 13.6087 14.2754C13.3473 14.5363 13.0333 14.6667 12.6667 14.6667H3.33333ZM3.33333 13.3334H12.6667V6.66671H3.33333V13.3334Z", fill: "currentColor" })), this.size === 24 && x(te, null, x("path", { d: "M9 16.5C8.3 16.5 7.70833 16.2583 7.225 15.775C6.74167 15.2917 6.5 14.7 6.5 14C6.5 13.3 6.74167 12.7083 7.225 12.225C7.70833 11.7417 8.3 11.5 9 11.5C9.7 11.5 10.2917 11.7417 10.775 12.225C11.2583 12.7083 11.5 13.3 11.5 14C11.5 14.7 11.2583 15.2917 10.775 15.775C10.2917 16.2583 9.7 16.5 9 16.5ZM5 22C4.45 22 3.979 21.8043 3.587 21.413C3.19567 21.021 3 20.55 3 20V6C3 5.45 3.19567 4.97933 3.587 4.588C3.979 4.196 4.45 4 5 4H6V3C6 2.71667 6.09567 2.479 6.287 2.287C6.479 2.09567 6.71667 2 7 2C7.28333 2 7.521 2.09567 7.713 2.287C7.90433 2.479 8 2.71667 8 3V4H16V3C16 2.71667 16.096 2.479 16.288 2.287C16.4793 2.09567 16.7167 2 17 2C17.2833 2 17.5207 2.09567 17.712 2.287C17.904 2.479 18 2.71667 18 3V4H19C19.55 4 20.021 4.196 20.413 4.588C20.8043 4.97933 21 5.45 21 6V20C21 20.55 20.8043 21.021 20.413 21.413C20.021 21.8043 19.55 22 19 22H5ZM5 20H19V10H5V20Z", fill: "currentColor" })), this.size === 28 && x(te, null, x("path", { d: "M10.5 19.25C9.68333 19.25 8.99306 18.9681 8.42917 18.4042C7.86528 17.8403 7.58333 17.15 7.58333 16.3334C7.58333 15.5167 7.86528 14.8264 8.42917 14.2625C8.99306 13.6987 9.68333 13.4167 10.5 13.4167C11.3167 13.4167 12.0069 13.6987 12.5708 14.2625C13.1347 14.8264 13.4167 15.5167 13.4167 16.3334C13.4167 17.15 13.1347 17.8403 12.5708 18.4042C12.0069 18.9681 11.3167 19.25 10.5 19.25ZM5.83333 25.6667C5.19167 25.6667 4.64217 25.4384 4.18483 24.9819C3.72828 24.5245 3.5 23.975 3.5 23.3334V7.00004C3.5 6.35837 3.72828 5.80926 4.18483 5.35271C4.64217 4.89537 5.19167 4.66671 5.83333 4.66671H7V3.50004C7 3.16949 7.11161 2.89221 7.33483 2.66821C7.55883 2.44499 7.83611 2.33337 8.16667 2.33337C8.49722 2.33337 8.7745 2.44499 8.9985 2.66821C9.22172 2.89221 9.33333 3.16949 9.33333 3.50004V4.66671H18.6667V3.50004C18.6667 3.16949 18.7787 2.89221 19.0027 2.66821C19.2259 2.44499 19.5028 2.33337 19.8333 2.33337C20.1639 2.33337 20.4408 2.44499 20.664 2.66821C20.888 2.89221 21 3.16949 21 3.50004V4.66671H22.1667C22.8083 4.66671 23.3578 4.89537 23.8152 5.35271C24.2717 5.80926 24.5 6.35837 24.5 7.00004V23.3334C24.5 23.975 24.2717 24.5245 23.8152 24.9819C23.3578 25.4384 22.8083 25.6667 22.1667 25.6667H5.83333ZM5.83333 23.3334H22.1667V11.6667H5.83333V23.3334Z", fill: "currentColor" })));
|
|
1270
1180
|
}
|
|
1271
1181
|
};
|
|
1272
|
-
|
|
1182
|
+
xe.style = Ve;
|
|
1273
1183
|
export {
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
ze as flip_popover
|
|
1184
|
+
Te as flip_date_picker,
|
|
1185
|
+
xe as flip_icon_today
|
|
1277
1186
|
};
|