1/** 2 * Minified by jsDelivr using Terser v5.3.5. 3 * Original file: /npm/[email protected]/dist/plugins/monthSelect/index.js 4 * 5 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 */ 7!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).monthSelectPlugin=t()}(this,(function(){"use strict"; 8/*! ***************************************************************************** 9 Copyright (c) Microsoft Corporation. 10 11 Permission to use, copy, modify, and/or distribute this software for any 12 purpose with or without fee is hereby granted. 13 14 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 15 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 16 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 17 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 18 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 19 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 20 PERFORMANCE OF THIS SOFTWARE. 21 ***************************************************************************** */var e=function(){return(e=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var t={shorthand:!1,dateFormat:"F Y",altFormat:"F Y",theme:"light"};return function(n){var a=e(e({},t),n);return function(e){e.config.dateFormat=a.dateFormat,e.config.altFormat=a.altFormat;var t={monthsContainer:null};function n(){if(e.rContainer){for(var t=e.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected"),n=0;n<t.length;n++)t[n].classList.remove("selected");var a=(e.selectedDates[0]||new Date).getMonth(),o=e.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child("+(a+1)+")");o&&o.classList.add("selected")}}function o(){var t=e.selectedDates[0];(t&&((t=new Date(t)).setFullYear(e.currentYear),e.config.minDate&&t<e.config.minDate&&(t=e.config.minDate),e.config.maxDate&&t>e.config.maxDate&&(t=e.config.maxDate),e.currentYear=t.getFullYear()),e.currentYearElement.value=String(e.currentYear),e.rContainer)&&e.rContainer.querySelectorAll(".flatpickr-monthSelect-month").forEach((function(t){t.dateObj.setFullYear(e.currentYear),e.config.minDate&&t.dateObj<e.config.minDate||e.config.maxDate&&t.dateObj>e.config.maxDate?t.classList.add("disabled"):t.classList.remove("disabled")}));n()}function r(t){t.preventDefault(),t.stopPropagation();var n=function(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}(t);n instanceof Element&&!n.classList.contains("disabled")&&(i(n.dateObj),e.close())}function i(t){var a=new Date(t);a.setFullYear(e.currentYear),e.setDate(a,!0),n()}var c={37:-1,39:1,40:3,38:-3};return{onParseConfig:function(){e.config.mode="single",e.config.enableTime=!1},onValueUpdate:n,onKeyDown:function(n,a,o,r){var l=void 0!==c[r.keyCode];if((l||13===r.keyCode)&&e.rContainer&&t.monthsContainer){var s=e.rContainer.querySelector(".flatpickr-monthSelect-month.selected"),d=Array.prototype.indexOf.call(t.monthsContainer.children,document.activeElement);if(-1===d){var f=s||t.monthsContainer.firstElementChild;f.focus(),d=f.$i}l?t.monthsContainer.children[(12+d+c[r.keyCode])%12].focus():13===r.keyCode&&t.monthsContainer.contains(document.activeElement)&&i(document.activeElement.dateObj)}},onReady:[function(){e.currentMonth=0},function(){if(e.rContainer&&e.daysContainer&&e.weekdayContainer){e.rContainer.removeChild(e.daysContainer),e.rContainer.removeChild(e.weekdayContainer);for(var t=0;t<e.monthElements.length;t++){var n=e.monthElements[t];n.parentNode&&n.parentNode.removeChild(n)}}},function(){e._bind(e.prevMonthNav,"click",(function(t){t.preventDefault(),t.stopPropagation(),e.changeYear(e.currentYear-1),o()})),e._bind(e.nextMonthNav,"click",(function(t){t.preventDefault(),t.stopPropagation(),e.changeYear(e.currentYear+1),o()}))},function(){if(e.rContainer){t.monthsContainer=e._createElement("div","flatpickr-monthSelect-months"),t.monthsContainer.tabIndex=-1,e.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+a.theme);for(var n=0;n<12;n++){var o=e._createElement("span","flatpickr-monthSelect-month");o.dateObj=new Date(e.currentYear,n),o.$i=n,o.textContent=(i=n,c=a.shorthand,e.l10n.months[c?"shorthand":"longhand"][i]),o.tabIndex=-1,o.addEventListener("click",r),t.monthsContainer.appendChild(o),(e.config.minDate&&o.dateObj<e.config.minDate||e.config.maxDate&&o.dateObj>e.config.maxDate)&&o.classList.add("disabled")}var i,c;e.rContainer.appendChild(t.monthsContainer)}},n,function(){e.loadedPlugins.push("monthSelect")}],onDestroy:function(){if(null!==t.monthsContainer)for(var e=t.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month"),n=0;n<e.length;n++)e[n].removeEventListener("click",r)}}}}})); 22//# sourceMappingURL=flatpickr.monthSelect.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.