| 12345678910111213141516171819202122 |
- /**
- * Minified by jsDelivr using Terser v5.3.5.
- * Original file: /npm/flatpickr@4.6.9/dist/plugins/rangePlugin.js
- *
- * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
- */
- !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).rangePlugin=t()}(this,(function(){"use strict";
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */function e(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),i=0;for(t=0;t<n;t++)for(var u=arguments[t],a=0,l=u.length;a<l;a++,i++)o[i]=u[a];return o}return function(t){return void 0===t&&(t={}),function(n){var o,i,u,a="",l={onParseConfig:function(){n.config.mode="range",a=n.config.altInput?n.config.altFormat:n.config.dateFormat},onReady:function(){!function(){if(t.input){if(!(o=t.input instanceof Element?t.input:window.document.querySelector(t.input)))return void n.config.errorHandler(new Error("Invalid input element specified"));n.config.wrap&&(o=o.querySelector("[data-input]"))}else(o=n._input.cloneNode()).removeAttribute("id"),o._flatpickr=void 0;if(o.value){var e=n.parseDate(o.value);e&&n.selectedDates.push(e)}o.setAttribute("data-fp-omit",""),n.config.clickOpens&&(n._bind(o,["focus","click"],(function(){n.selectedDates[1]&&(n.latestSelectedDateObj=n.selectedDates[1],n._setHoursFromDate(n.selectedDates[1]),n.jumpToDate(n.selectedDates[1])),i=!0,n.isOpen=!1,n.open(void 0,"left"===t.position?n._input:o)})),n._bind(n._input,["focus","click"],(function(e){e.preventDefault(),n.isOpen=!1,n.open()}))),n.config.allowInput&&n._bind(o,"keydown",(function(e){"Enter"===e.key&&(n.setDate([n.selectedDates[0],o.value],!0,a),o.click())})),t.input||n._input.parentNode&&n._input.parentNode.insertBefore(o,n._input.nextSibling)}(),n.config.ignoredFocusElements.push(o),n.config.allowInput?(n._input.removeAttribute("readonly"),o.removeAttribute("readonly")):o.setAttribute("readonly","readonly"),n._bind(n._input,"focus",(function(){n.latestSelectedDateObj=n.selectedDates[0],n._setHoursFromDate(n.selectedDates[0]),i=!1,n.jumpToDate(n.selectedDates[0])})),n.config.allowInput&&n._bind(n._input,"keydown",(function(e){"Enter"===e.key&&n.setDate([n._input.value,n.selectedDates[1]],!0,a)})),n.setDate(n.selectedDates,!1),l.onValueUpdate(n.selectedDates),n.loadedPlugins.push("range")},onPreCalendarPosition:function(){i&&(n._positionElement=o,setTimeout((function(){n._positionElement=n._input}),0))},onChange:function(){n.selectedDates.length||setTimeout((function(){n.selectedDates.length||(o.value="",u=[])}),10),i&&setTimeout((function(){o.focus()}),0)},onDestroy:function(){t.input||o.parentNode&&o.parentNode.removeChild(o)},onValueUpdate:function(t){var l,r,s;if(o){if((u=!u||t.length>=u.length?e(t):u).length>t.length){var c=t[0],d=i?[u[0],c]:[c,u[1]];n.setDate(d,!1),u=e(d)}r=(l=n.selectedDates.map((function(e){return n.formatDate(e,a)})))[0],n._input.value=void 0===r?"":r,s=l[1],o.value=void 0===s?"":s}}};return l}}}));
- //# sourceMappingURL=/sm/40e7cb5e6383dabe6c7f68d046ec935fe0f40a0e81906eff84d399f6ff296a44.map
|