forked from hero/www_hero
2 lines
42 KiB
JavaScript
2 lines
42 KiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Flowbite",[],t):"object"==typeof exports?exports.Flowbite=t():e.Flowbite=t()}(self,(function(){return function(){"use strict";var e={781:function(e,t,i){i.d(t,{initDatepickers:function(){return o}});var r=i(770),n=i(482),a=i(947),s=function(e){var t=e.hasAttribute("datepicker-buttons"),i=e.hasAttribute("datepicker-autohide"),r=e.hasAttribute("datepicker-format"),n=e.hasAttribute("datepicker-orientation"),a=e.hasAttribute("datepicker-title"),s={};return t&&(s.todayBtn=!0,s.clearBtn=!0),i&&(s.autohide=!0),r&&(s.format=e.getAttribute("datepicker-format")),n&&(s.orientation=e.getAttribute("datepicker-orientation")),a&&(s.title=e.getAttribute("datepicker-title")),s};function o(){document.querySelectorAll("[datepicker]").forEach((function(e){new r.Z(e,s(e))})),document.querySelectorAll("[inline-datepicker]").forEach((function(e){new r.Z(e,s(e))})),document.querySelectorAll("[date-rangepicker]").forEach((function(e){new n.Z(e,s(e))}))}new a.default("DOMContentLoaded",[o]).init()},482:function(e,t,i){i.d(t,{Z:function(){return c}});var r=i(698),n=i(963),a=i(770);function s(e){const t=Object.assign({},e);return delete t.inputs,delete t.allowOneSidedRange,delete t.maxNumberOfDates,t}function o(e,t,i,n){(0,r.cF)(e,[[i,"changeDate",t]]),new a.Z(i,n,e)}function d(e,t){if(e._updating)return;e._updating=!0;const i=t.target;if(void 0===i.datepicker)return;const r=e.datepickers,n={render:!1},a=e.inputs.indexOf(i),s=0===a?1:0,o=r[a].dates[0],d=r[s].dates[0];void 0!==o&&void 0!==d?0===a&&o>d?(r[0].setDate(d,n),r[1].setDate(o,n)):1===a&&o<d&&(r[0].setDate(o,n),r[1].setDate(d,n)):e.allowOneSidedRange||void 0===o&&void 0===d||(n.clear=!0,r[s].setDate(r[a].dates,n)),r[0].picker.update().render(),r[1].picker.update().render(),delete e._updating}class c{constructor(e,t={}){const i=Array.isArray(t.inputs)?t.inputs:Array.from(e.querySelectorAll("input"));if(i.length<2)return;e.rangepicker=this,this.element=e,this.inputs=i.slice(0,2),this.allowOneSidedRange=!!t.allowOneSidedRange;const r=d.bind(null,this),n=s(t),a=[];Object.defineProperty(this,"datepickers",{get(){return a}}),o(this,r,this.inputs[0],n),o(this,r,this.inputs[1],n),Object.freeze(a),a[0].dates.length>0?d(this,{target:this.inputs[0]}):a[1].dates.length>0&&d(this,{target:this.inputs[1]})}get dates(){return 2===this.datepickers.length?[this.datepickers[0].dates[0],this.datepickers[1].dates[0]]:void 0}setOptions(e){this.allowOneSidedRange=!!e.allowOneSidedRange;const t=s(e);this.datepickers[0].setOptions(t),this.datepickers[1].setOptions(t)}destroy(){this.datepickers[0].destroy(),this.datepickers[1].destroy(),(0,r.uV)(this),delete this.element.rangepicker}getDates(e){const t=e?t=>(0,n.p6)(t,e,this.datepickers[0].config.locale):e=>new Date(e);return this.dates.map((e=>void 0===e?e:t(e)))}setDates(e,t){const[i,r]=this.datepickers,n=this.dates;this._updating=!0,i.setDate(e),r.setDate(t),delete this._updating,r.dates[0]!==n[1]?d(this,{target:this.inputs[1]}):i.dates[0]!==n[0]&&d(this,{target:this.inputs[0]})}}},770:function(e,t,i){i.d(t,{Z:function(){return ae}});var r=i(105),n=i(560),a=i(963),s=i(698);const o={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}};var d={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,calendarWeeks:!1,clearBtn:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:'<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://w
|
||
|
//# sourceMappingURL=datepicker.turbo.min.js.map
|