@getflip/swirl-components-react 0.2.1 → 0.4.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.07628dad.js +58 -0
- package/dist/{flip-action-list-item.entry.8a7c3ed5.js → flip-action-list-item.entry.a330605c.js} +2 -2
- package/dist/{flip-action-list-section.entry.da0cdb9e.js → flip-action-list-section.entry.19091d98.js} +1 -1
- package/dist/{flip-action-list.entry.b8a1ea41.js → flip-action-list.entry.319f0192.js} +2 -2
- package/dist/flip-app-layout_5.entry.ac01996d.js +215 -0
- package/dist/flip-autocomplete.entry.21deedf2.js +70 -0
- package/dist/{flip-avatar-group.entry.b0e66358.js → flip-avatar-group.entry.c2cc9526.js} +18 -9
- package/dist/{flip-avatar.entry.6a8f2e19.js → flip-avatar.entry.7034b888.js} +17 -8
- package/dist/flip-badge.entry.bc935c62.js +20 -0
- package/dist/{flip-banner.entry.f53786a0.js → flip-banner.entry.d257835c.js} +1 -1
- package/dist/flip-button-group.entry.8ce7a3d4.js +20 -0
- package/dist/flip-button.entry.eb07eb8a.js +35 -0
- package/dist/{flip-checkbox.entry.ade04b9c.js → flip-checkbox.entry.43a3832e.js} +2 -2
- package/dist/{flip-chip.entry.42861041.js → flip-chip.entry.a479c5b0.js} +1 -1
- package/dist/{flip-date-input.entry.adafe713.js → flip-date-input.entry.b98d662b.js} +1 -1
- package/dist/{flip-date-picker_3.entry.4a72cca9.js → flip-date-picker_2.entry.c2143459.js} +281 -369
- package/dist/{flip-description-list-item.entry.0844c111.js → flip-description-list-item.entry.f1db6930.js} +1 -1
- package/dist/{flip-description-list.entry.cdb5ba16.js → flip-description-list.entry.0e214ec2.js} +1 -1
- package/dist/{flip-dialog.entry.cdfca16a.js → flip-dialog.entry.24f62804.js} +2 -2
- package/dist/{flip-file-uploader.entry.43c0b766.js → flip-file-uploader.entry.91b6ca52.js} +2 -2
- package/dist/{flip-file-viewer-audio_6.entry.c9978e1a.js → flip-file-viewer_7.entry.47a4ee0d.js} +5115 -4945
- package/dist/{flip-form-control.entry.ec90cfb9.js → flip-form-control.entry.82737412.js} +1 -1
- package/dist/{flip-form-group.entry.6256d521.js → flip-form-group.entry.89c2a7a6.js} +4 -4
- package/dist/flip-heading.entry.00139b62.js +18 -0
- package/dist/{flip-icon-add-photo.entry.d8ca058c.js → flip-icon-add-photo.entry.b5415432.js} +1 -1
- package/dist/flip-icon-add_4.entry.b525e436.js +45 -0
- package/dist/{flip-icon-admin-panel-settings.entry.abfc03bf.js → flip-icon-admin-panel-settings.entry.e416caa2.js} +1 -1
- package/dist/{flip-icon-arrow-back.entry.eff9e6a3.js → flip-icon-arrow-back.entry.3b24c3c4.js} +1 -1
- package/dist/{flip-icon-arrow-forward.entry.b0017297.js → flip-icon-arrow-forward.entry.c3577622.js} +1 -1
- package/dist/flip-icon-arrow-left_3.entry.0e8c6ffd.js +35 -0
- package/dist/{flip-icon-arrow-right-small.entry.dd9ec828.js → flip-icon-arrow-right-small.entry.36a480f8.js} +1 -1
- package/dist/{flip-icon-attachment.entry.d41db045.js → flip-icon-attachment.entry.d44215f9.js} +1 -1
- package/dist/{flip-icon-expand-less_3.entry.8f8fb508.js → flip-icon-cancel_4.entry.90ff0e73.js} +23 -13
- package/dist/{flip-icon-chat-bubble.entry.32859e94.js → flip-icon-chat-bubble.entry.b8022c94.js} +1 -1
- package/dist/{flip-icon-check-circle.entry.cf0be0f3.js → flip-icon-check-circle.entry.b59a0f63.js} +1 -1
- package/dist/flip-icon-check-small_3.entry.fd9f691c.js +145 -0
- package/dist/{flip-icon-check-strong.entry.756abe1c.js → flip-icon-check-strong.entry.cab3e061.js} +1 -1
- package/dist/{flip-icon-check.entry.71f246f6.js → flip-icon-check.entry.f6231fc3.js} +1 -1
- package/dist/{flip-icon-chevron-left.entry.76299ff3.js → flip-icon-chevron-left.entry.cd972c85.js} +1 -1
- package/dist/{flip-icon-chevron-right.entry.56cd2638.js → flip-icon-chevron-right.entry.b96a1ead.js} +1 -1
- package/dist/{flip-icon-close-small.entry.d5bce874.js → flip-icon-close-small.entry.292f402f.js} +1 -1
- package/dist/{flip-icon-close.entry.1c183b2c.js → flip-icon-close.entry.a52651ec.js} +1 -1
- package/dist/{flip-icon-cloud-upload.entry.780eefd8.js → flip-icon-cloud-upload.entry.8c3de009.js} +1 -1
- package/dist/{flip-icon-comment.entry.9c85f2af.js → flip-icon-comment.entry.68e5198c.js} +1 -1
- package/dist/{flip-icon-copy.entry.33ed327d.js → flip-icon-copy.entry.ea55301c.js} +1 -1
- package/dist/{flip-icon-date-range.entry.739ecf4e.js → flip-icon-date-range.entry.78991d34.js} +1 -1
- package/dist/{flip-icon-delete.entry.f3cba347.js → flip-icon-delete.entry.addf184d.js} +1 -1
- package/dist/{flip-icon-description.entry.d0f9e65c.js → flip-icon-description.entry.7688a64f.js} +1 -1
- package/dist/{flip-icon-edit.entry.7b9f186f.js → flip-icon-edit.entry.5df4b598.js} +1 -1
- package/dist/{flip-icon-emoji-mood.entry.e0b32fe1.js → flip-icon-emoji-mood.entry.7772f2da.js} +1 -1
- package/dist/{flip-icon-emoji-satisfied.entry.5ef82f25.js → flip-icon-emoji-satisfied.entry.3f11571c.js} +1 -1
- package/dist/{flip-icon-error_3.entry.87fcf907.js → flip-icon-error_3.entry.6d22b7a2.js} +1 -1
- package/dist/{flip-icon-expand-more.entry.d2c9bf62.js → flip-icon-expand-more.entry.2ffa6f0c.js} +1 -1
- package/dist/{flip-icon-file.entry.0d1868a4.js → flip-icon-file.entry.517a75cc.js} +1 -1
- package/dist/{flip-icon-folder-shared.entry.f1f4317b.js → flip-icon-folder-shared.entry.661494c2.js} +1 -1
- package/dist/{flip-icon-group-assign.entry.2116431e.js → flip-icon-group-assign.entry.8131eb64.js} +1 -1
- package/dist/{flip-icon-groups-custom.entry.415539b5.js → flip-icon-groups-custom.entry.f0086123.js} +1 -1
- package/dist/{flip-icon-groups.entry.25ce8212.js → flip-icon-groups.entry.2e076144.js} +1 -1
- package/dist/{flip-icon-image.entry.ce484f72.js → flip-icon-image.entry.d0482319.js} +1 -1
- package/dist/{flip-icon-info.entry.3f6c72bb.js → flip-icon-info.entry.d16cf109.js} +1 -1
- package/dist/{flip-icon-inventory.entry.fc8b1c79.js → flip-icon-inventory.entry.a209dd1e.js} +1 -1
- package/dist/{flip-icon-like.entry.34ea69dc.js → flip-icon-like.entry.631333f8.js} +1 -1
- package/dist/{flip-icon-link.entry.94b7dd90.js → flip-icon-link.entry.b67ce56a.js} +1 -1
- package/dist/{flip-icon-lock.entry.3e9c3e72.js → flip-icon-lock.entry.13f8fa54.js} +1 -1
- package/dist/{flip-icon-logout.entry.57363229.js → flip-icon-logout.entry.79b91644.js} +1 -1
- package/dist/{flip-icon-mail.entry.b37d0b32.js → flip-icon-mail.entry.62265dc6.js} +1 -1
- package/dist/{flip-icon-manage-accounts.entry.fb4e9a6b.js → flip-icon-manage-accounts.entry.e821e9df.js} +1 -1
- package/dist/{flip-icon-mention.entry.2bfbfa63.js → flip-icon-mention.entry.09ac190a.js} +1 -1
- package/dist/{flip-icon-message.entry.2df9486d.js → flip-icon-message.entry.06934900.js} +1 -1
- package/dist/{flip-icon-more-horizontal.entry.7f45f170.js → flip-icon-more-horizontal.entry.d1d97d3d.js} +1 -1
- package/dist/{flip-icon-more-vertikal.entry.8045a647.js → flip-icon-more-vertikal.entry.d40ca8b0.js} +1 -1
- package/dist/{flip-icon-notifications-active.entry.f03b2fc4.js → flip-icon-notifications-active.entry.c38ee4bb.js} +1 -1
- package/dist/{flip-icon-notifications-off.entry.dd8c68fd.js → flip-icon-notifications-off.entry.02743a47.js} +1 -1
- package/dist/{flip-icon-notifications.entry.edc9821c.js → flip-icon-notifications.entry.4f873bc3.js} +1 -1
- package/dist/{flip-icon-open-in-new.entry.ff63ea33.js → flip-icon-open-in-new.entry.cb673e42.js} +1 -1
- package/dist/{flip-icon-people-alt.entry.aad60933.js → flip-icon-people-alt.entry.648a37d3.js} +1 -1
- package/dist/{flip-icon-person-off.entry.59a3c96c.js → flip-icon-person-off.entry.3bc3e587.js} +1 -1
- package/dist/{flip-icon-person.entry.e69d335c.js → flip-icon-person.entry.b269287a.js} +1 -1
- package/dist/{flip-icon-phone.entry.d3656af0.js → flip-icon-phone.entry.89c67938.js} +1 -1
- package/dist/{flip-icon-poll.entry.16e1615e.js → flip-icon-poll.entry.51bd2d6b.js} +1 -1
- package/dist/{flip-icon-print.entry.16e54d5b.js → flip-icon-print.entry.fcdc08c4.js} +1 -1
- package/dist/{flip-icon-recieved.entry.7a850323.js → flip-icon-recieved.entry.e52d5907.js} +1 -1
- package/dist/{flip-icon-search-strong.entry.fd001082.js → flip-icon-search-strong.entry.f9f740dc.js} +1 -1
- package/dist/{flip-icon-search.entry.2efaf023.js → flip-icon-search.entry.530eb22a.js} +1 -1
- package/dist/{flip-icon-send.entry.6a4cd99f.js → flip-icon-send.entry.1a1f6a9f.js} +1 -1
- package/dist/{flip-icon-settings.entry.44aec164.js → flip-icon-settings.entry.05357f2b.js} +1 -1
- package/dist/{flip-icon-time-filled.entry.bced668e.js → flip-icon-time-filled.entry.7dfefe00.js} +1 -1
- package/dist/{flip-icon-time-outlined.entry.36bb857d.js → flip-icon-time-outlined.entry.b309035e.js} +1 -1
- package/dist/{flip-icon-user-assign.entry.f55379f5.js → flip-icon-user-assign.entry.b595047d.js} +1 -1
- package/dist/{flip-icon-video-camera.entry.23798820.js → flip-icon-video-camera.entry.08411542.js} +1 -1
- package/dist/{flip-icon-warning.entry.ac7a7e4c.js → flip-icon-warning.entry.5d5e3ce9.js} +1 -1
- package/dist/flip-lightbox.entry.d7a5b33f.js +110 -0
- package/dist/{flip-link.entry.31692150.js → flip-link.entry.5415c5a4.js} +1 -1
- package/dist/{flip-list.entry.1eac3a62.js → flip-list.entry.5ffbd0ef.js} +1 -1
- package/dist/flip-modal.entry.8f99c357.js +63 -0
- package/dist/{flip-option-list-section.entry.0f67d7d7.js → flip-option-list-section.entry.1c46b667.js} +1 -1
- package/dist/{flip-pagination.entry.278034c1.js → flip-pagination.entry.44ba4122.js} +1 -1
- package/dist/flip-pdf-reader.entry.4fba8eda.js +79 -0
- package/dist/flip-popover.entry.0f8879c7.js +99 -0
- package/dist/{flip-progress-indicator.entry.99e10b2c.js → flip-progress-indicator.entry.98300d84.js} +1 -1
- package/dist/{flip-radio-group.entry.7cc7a065.js → flip-radio-group.entry.3a737bc9.js} +2 -2
- package/dist/{flip-radio.entry.eacccab0.js → flip-radio.entry.45be80ff.js} +2 -2
- package/dist/{flip-resource-list-file-item.entry.4fd698ae.js → flip-resource-list-file-item.entry.380c5dbe.js} +1 -1
- package/dist/{flip-search.entry.7a786fe8.js → flip-search.entry.6805dae6.js} +1 -1
- package/dist/{flip-stack.entry.a2afebf5.js → flip-stack.entry.c7c6570a.js} +1 -1
- package/dist/{flip-switch.entry.9e81c9b0.js → flip-switch.entry.d92b7292.js} +1 -1
- package/dist/{flip-tab.entry.b64631a4.js → flip-tab.entry.e7a1ab1a.js} +1 -1
- package/dist/flip-tabs.entry.16f909d5.js +67 -0
- package/dist/{flip-tag.entry.c888703b.js → flip-tag.entry.8622ab43.js} +1 -1
- package/dist/flip-text-input.entry.326d7e72.js +58 -0
- package/dist/{flip-text.entry.4bcd3eae.js → flip-text.entry.a01cf4bc.js} +1 -1
- package/dist/{flip-theme-provider.entry.1b167993.js → flip-theme-provider.entry.bb6a10e3.js} +1 -1
- package/dist/{flip-thumbnail.entry.5f2effe1.js → flip-thumbnail.entry.7e078ff9.js} +1 -1
- package/dist/{flip-toast-provider.entry.870ddb2c.js → flip-toast-provider.entry.442c1fb8.js} +1 -1
- package/dist/{flip-toast.entry.f8bc132d.js → flip-toast.entry.696f6bd2.js} +4 -4
- package/dist/{flip-tooltip.entry.e4e0b3a6.js → flip-tooltip.entry.0c1774a4.js} +1 -1
- package/dist/{flip-video-thumbnail.entry.855576fe.js → flip-video-thumbnail.entry.b6b896d0.js} +1 -1
- package/dist/{flip-visually-hidden.entry.8d93e0bb.js → flip-visually-hidden.entry.58a19f2e.js} +1 -1
- package/dist/index.b66ff9f0.js +1365 -0
- package/dist/stencil-generated/index.d.ts +6 -0
- package/dist/swirl-components-react.js +142 -136
- package/dist/swirl-components-react.umd.cjs +52 -34
- package/dist/utils-39b2afe8.37b54ba4.js +40 -0
- package/package.json +2 -2
- package/dist/flip-badge.entry.a6d07965.js +0 -20
- package/dist/flip-button-group.entry.0342e82d.js +0 -15
- package/dist/flip-button.entry.b752e108.js +0 -33
- package/dist/flip-empty-state.entry.77f9c8ed.js +0 -15
- package/dist/flip-file-viewer.entry.85af31ff.js +0 -95
- package/dist/flip-heading.entry.472e3005.js +0 -18
- package/dist/flip-icon-add.entry.79a8d7e6.js +0 -15
- package/dist/flip-icon-arrow-left.entry.234146e1.js +0 -15
- package/dist/flip-icon-arrow-right.entry.d4a36d98.js +0 -15
- package/dist/flip-icon-cancel.entry.c5b57f7f.js +0 -15
- package/dist/flip-icon-check-small.entry.c28df931.js +0 -15
- package/dist/flip-icon-download.entry.9adb287e.js +0 -15
- package/dist/flip-icon-fullscreen-exit.entry.168a2e77.js +0 -15
- package/dist/flip-icon-fullscreen.entry.d78bc3a4.js +0 -15
- package/dist/flip-icon-remove.entry.88fa105e.js +0 -15
- package/dist/flip-modal.entry.5df13219.js +0 -61
- package/dist/flip-option-list-item.entry.f911c3b8.js +0 -30
- package/dist/flip-option-list.entry.32d7928a.js +0 -95
- package/dist/flip-resource-list-item.entry.d9efc26d.js +0 -41
- package/dist/flip-resource-list.entry.dca2afcd.js +0 -49
- package/dist/flip-tabs.entry.a42a1989.js +0 -92
- package/dist/flip-text-input.entry.8deff49d.js +0 -55
- package/dist/index.b70d4c92.js +0 -1359
- package/dist/utils-b46bcd4f.79126bb2.js +0 -30
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as Se, s as Te, 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.b66ff9f0.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, $) {
|
|
6
|
+
(function(N, W) {
|
|
7
|
+
D.exports = W();
|
|
8
|
+
})(Ce, function() {
|
|
13
9
|
return function() {
|
|
14
|
-
var
|
|
10
|
+
var N = { d: function(r, e) {
|
|
15
11
|
for (var t in e)
|
|
16
|
-
|
|
12
|
+
N.o(e, t) && !N.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
|
+
N.d(W, { default: function() {
|
|
17
|
+
return F;
|
|
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 C() {
|
|
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 H(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 b(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 _(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
|
}
|
|
@@ -112,28 +108,28 @@ var Ae = me(function(m, v) {
|
|
|
112
108
|
let e = "\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";
|
|
113
109
|
return new RegExp("(^|>|" + e + ")(" + r + ")($|<|" + e + ")", "g");
|
|
114
110
|
}
|
|
115
|
-
function
|
|
111
|
+
function O(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
|
+
O(this, "focus", () => {
|
|
122
118
|
this.$cell.classList.add("-focus-"), this.focused = !0;
|
|
123
|
-
}),
|
|
119
|
+
}), O(this, "removeFocus", () => {
|
|
124
120
|
this.$cell.classList.remove("-focus-"), this.focused = !1;
|
|
125
|
-
}),
|
|
121
|
+
}), O(this, "select", () => {
|
|
126
122
|
this.$cell.classList.add("-selected-"), this.selected = !0;
|
|
127
|
-
}),
|
|
123
|
+
}), O(this, "removeSelect", () => {
|
|
128
124
|
this.$cell.classList.remove("-selected-", "-range-from-", "-range-to-"), this.selected = !1;
|
|
129
|
-
}),
|
|
125
|
+
}), O(this, "onChangeSelectedDate", () => {
|
|
130
126
|
this.isDisabled || (this._handleSelectedStatus(), this.opts.range && this._handleRangeStatus());
|
|
131
|
-
}),
|
|
127
|
+
}), O(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
|
+
}), O(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
|
}
|
|
138
134
|
init() {
|
|
139
135
|
let { range: e, onRenderCell: t } = this.opts;
|
|
@@ -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 = C({ 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 k(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
|
+
k(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
|
+
}), k(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
|
+
}), k(this, "onChangeCurrentView", (n) => {
|
|
231
227
|
n !== this.type ? this.hide() : (this.show(), this.render());
|
|
232
|
-
}),
|
|
233
|
-
let s =
|
|
228
|
+
}), k(this, "onMouseOverCell", (n) => {
|
|
229
|
+
let s = z(n.target, K);
|
|
234
230
|
this.dp.setFocusDate(!!s && s.adpCell.date);
|
|
235
|
-
}),
|
|
231
|
+
}), k(this, "onMouseOutCell", () => {
|
|
236
232
|
this.dp.setFocusDate(!1);
|
|
237
|
-
}),
|
|
233
|
+
}), k(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
|
+
}), k(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
|
+
}), k(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
|
+
}), k(this, "onMouseUp", () => {
|
|
263
259
|
this.pressed = !1, this.rangeFromFocused = !1, this.rangeToFocused = !1;
|
|
264
|
-
}),
|
|
260
|
+
}), k(this, "onChangeViewDate", (n, s) => {
|
|
265
261
|
if (!this.isVisible)
|
|
266
262
|
return;
|
|
267
|
-
let o =
|
|
263
|
+
let o = H(n), h = H(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
|
+
}), k(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
|
+
b(this.$el, "mouseover", this.onMouseOverCell), b(this.$el, "mouseout", this.onMouseOutCell), b(this.$el, "click", this.onClickBody), e && t && (b(this.$el, "mousedown", this.onMouseDown), b(this.$el, "mousemove", this.onMouseMove), b(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 = C({ 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), M = 0;
|
|
312
|
+
for (; M < u; ) {
|
|
313
|
+
let B = new Date(g, w, p + M);
|
|
314
|
+
this._generateCell(B), M++;
|
|
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 = H(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 L(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
|
+
L(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
|
+
}), L(this, "onChangeViewDate", () => {
|
|
379
375
|
this.render(), this._resetNavStatus(), this.handleNavStatus();
|
|
380
|
-
}),
|
|
376
|
+
}), L(this, "onChangeCurrentView", () => {
|
|
381
377
|
this.render(), this._resetNavStatus(), this.handleNavStatus();
|
|
382
|
-
}),
|
|
378
|
+
}), L(this, "onClickNavTitle", () => {
|
|
383
379
|
this.dp.isFinalView || this.dp.up();
|
|
384
|
-
}),
|
|
380
|
+
}), L(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
|
+
}), L(this, "renderDelay", () => {
|
|
388
384
|
setTimeout(this.render);
|
|
389
|
-
}),
|
|
385
|
+
}), L(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 = C({ 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 = H(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 = C({ 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 C({ 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 E(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
|
+
E(this, "toggleTimepickerIsActive", (a) => {
|
|
505
501
|
this.dp.timepickerIsActive = a;
|
|
506
|
-
}),
|
|
502
|
+
}), E(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
|
+
}), E(this, "onChangeLastSelectedDate", (a) => {
|
|
510
506
|
a && (this.setTime(a), this.render());
|
|
511
|
-
}),
|
|
507
|
+
}), E(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
|
+
}), E(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
|
+
}), E(this, "onFocus", () => {
|
|
518
514
|
this.toggleTimepickerIsActive(!0);
|
|
519
|
-
}),
|
|
515
|
+
}), E(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"), b(this.$ranges, e, this.onChangeInputRange), b(this.$ranges, "mouseenter", this.onMouseEnterLeave), b(this.$ranges, "mouseleave", this.onMouseEnterLeave), b(this.$ranges, "focus", this.onFocus), b(this.$ranges, "mousedown", this.onFocus), b(this.$ranges, "blur", this.onBlur);
|
|
534
530
|
}
|
|
535
531
|
createElement() {
|
|
536
|
-
this.$el =
|
|
532
|
+
this.$el = C({ 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 A(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
|
+
A(this, "pressedKeys", /* @__PURE__ */ new Set()), A(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()]])), A(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
|
+
}), A(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
|
+
}), A(this, "isArrow", (a) => a >= 37 && a <= 40), A(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
|
+
}), A(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 F {
|
|
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, M = 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 - M.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 - M.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 - M.width;
|
|
787
783
|
break;
|
|
788
784
|
case "bottom":
|
|
789
|
-
h =
|
|
785
|
+
h = p.top + p.height - M.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 - M.height / 2 : d = p.left + p.width / 2 - M.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 = _(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 = _(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] = H(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 = C({ 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 = _(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 = C({ className: h = F.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 = C({ 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 && _(e), this.maxDate = !!t && _(t);
|
|
924
920
|
}
|
|
925
921
|
_addTimepicker() {
|
|
926
|
-
this.$timepicker =
|
|
922
|
+
this.$timepicker = C({ 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 = C({ 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 = _(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 = H(e), o = F.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 = _(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 = _(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 = _(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 = _(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 H(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(F, "defaults", ie), m(F, "version", "3.3.0"), m(F, "defaultContainerId", "air-datepicker-global-container"), oe = F.prototype, Object.assign(oe, De), W.default;
|
|
1104
1100
|
}();
|
|
1105
1101
|
});
|
|
1106
|
-
}),
|
|
1107
|
-
Object.defineProperty(
|
|
1102
|
+
}), Me = de(function(D, $) {
|
|
1103
|
+
Object.defineProperty($, "__esModule", {
|
|
1108
1104
|
value: !0
|
|
1109
|
-
}),
|
|
1110
|
-
var
|
|
1105
|
+
}), $.default = void 0;
|
|
1106
|
+
var N = {
|
|
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
|
+
$.default = N;
|
|
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 = ($) => {
|
|
1123
|
+
$.stopPropagation(), $.preventDefault();
|
|
1128
1124
|
};
|
|
1129
1125
|
}
|
|
1130
1126
|
watchProps() {
|
|
@@ -1134,12 +1130,12 @@ 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(), this.picker = new _e(this.containerEl, {
|
|
1143
1139
|
classes: "date-picker",
|
|
1144
1140
|
inline: !0,
|
|
1145
1141
|
locale: this.locale,
|
|
@@ -1147,8 +1143,8 @@ const Oe = /* @__PURE__ */ xe(Le), Ne = ':host{display:block}:host *{box-sizing:
|
|
|
1147
1143
|
minDate: this.minDate,
|
|
1148
1144
|
minView: "days",
|
|
1149
1145
|
nextHtml: "<flip-icon-chevron-right></flip-icon-chevron-right>",
|
|
1150
|
-
onSelect: ({ date:
|
|
1151
|
-
this.valueChange.emit(
|
|
1146
|
+
onSelect: ({ date: $ }) => {
|
|
1147
|
+
this.valueChange.emit($);
|
|
1152
1148
|
},
|
|
1153
1149
|
prevHtml: "<flip-icon-chevron-left></flip-icon-chevron-left>",
|
|
1154
1150
|
range: this.range,
|
|
@@ -1159,7 +1155,7 @@ const Oe = /* @__PURE__ */ xe(Le), Ne = ':host{display:block}:host *{box-sizing:
|
|
|
1159
1155
|
});
|
|
1160
1156
|
}
|
|
1161
1157
|
render() {
|
|
1162
|
-
return
|
|
1158
|
+
return x(be, { onClick: this.onClick }, x("div", { ref: (D) => this.containerEl = D }));
|
|
1163
1159
|
}
|
|
1164
1160
|
static get watchers() {
|
|
1165
1161
|
return {
|
|
@@ -1172,101 +1168,17 @@ const Oe = /* @__PURE__ */ xe(Le), Ne = ':host{display:block}:host *{box-sizing:
|
|
|
1172
1168
|
};
|
|
1173
1169
|
}
|
|
1174
1170
|
};
|
|
1175
|
-
|
|
1176
|
-
const
|
|
1177
|
-
constructor(
|
|
1178
|
-
|
|
1179
|
-
}
|
|
1180
|
-
render() {
|
|
1181
|
-
return b("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 && b(te, null, b("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 && b(te, null, b("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 && b(te, null, b("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" })));
|
|
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-xl);-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 $ = v.relatedTarget || v.target;
|
|
1191
|
-
!this.el.contains($) && 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 Se(this.triggerEl, this.contentContainer, {
|
|
1204
|
-
middleware: [Te(), 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.triggerEl) === 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
|
-
var m;
|
|
1236
|
-
const v = pe(document.body, `#${this.trigger}`)[0];
|
|
1237
|
-
this.triggerEl = (v == null ? void 0 : v.children[0]) || ((m = v == null ? void 0 : v.shadowRoot) === null || m === void 0 ? void 0 : m.children[0]) || v, Boolean(this.triggerEl) && this.triggerEl.addEventListener("click", this.toggle);
|
|
1238
|
-
}
|
|
1239
|
-
updateTriggerAttributes() {
|
|
1240
|
-
!Boolean(this.triggerEl) || (this.triggerEl.setAttribute("aria-controls", this.popoverId), this.triggerEl.setAttribute("aria-expanded", String(this.active)), this.triggerEl.setAttribute("aria-haspopup", "dialog"));
|
|
1241
|
-
}
|
|
1242
|
-
updateChildMenuItems() {
|
|
1243
|
-
this.childMenuItems = pe(this.el, '[role="menuitem"]');
|
|
1244
|
-
}
|
|
1245
|
-
lockBodyScroll() {
|
|
1246
|
-
!ce() || He(this.scrollContainer);
|
|
1247
|
-
}
|
|
1248
|
-
unlockBodyScroll() {
|
|
1249
|
-
de(this.scrollContainer);
|
|
1171
|
+
Te.style = Se;
|
|
1172
|
+
const Ve = ":host{display:inline-flex}", xe = class {
|
|
1173
|
+
constructor(D) {
|
|
1174
|
+
le(this, D), this.size = 24;
|
|
1250
1175
|
}
|
|
1251
1176
|
render() {
|
|
1252
|
-
|
|
1253
|
-
const $ = Ee("popover", {
|
|
1254
|
-
"popover--closing": this.closing,
|
|
1255
|
-
"popover--active": this.active,
|
|
1256
|
-
"popover--inactive": !this.active
|
|
1257
|
-
});
|
|
1258
|
-
return b(ue, { id: this.popoverId, onFocusout: this.onFocusOut }, b("div", { class: $, onKeyDown: this.onKeydown }, b("div", { "aria-hidden": this.active ? "false" : "true", "aria-label": this.label, class: "popover__content", role: "dialog", tabindex: "-1", ref: (T) => this.contentContainer = T, style: {
|
|
1259
|
-
top: Boolean(this.position) ? `${(m = this.position) === null || m === void 0 ? void 0 : m.y}px` : "",
|
|
1260
|
-
left: Boolean(this.position) ? `${(v = this.position) === null || v === void 0 ? void 0 : v.x}px` : ""
|
|
1261
|
-
} }, b("span", { class: "popover__handle" }), b("div", { class: "popover__scroll-container", ref: (T) => this.scrollContainer = T }, b("slot", null))), this.active && b("div", { class: "popover__backdrop", onClick: this.onCloseButtonClick })));
|
|
1262
|
-
}
|
|
1263
|
-
get el() {
|
|
1264
|
-
return Me(this);
|
|
1177
|
+
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" })));
|
|
1265
1178
|
}
|
|
1266
1179
|
};
|
|
1267
|
-
|
|
1180
|
+
xe.style = Ve;
|
|
1268
1181
|
export {
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
ze as flip_popover
|
|
1182
|
+
Te as flip_date_picker,
|
|
1183
|
+
xe as flip_icon_today
|
|
1272
1184
|
};
|