@ezuikit/control-date-picker 1.0.5-beta.2 → 2.0.0-alpha.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/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## 时间轴控件
2
2
 
3
+ ![Download](https://img.shields.io/npm/dm/@ezuikit/control-date-picker.svg) ![Version](https://img.shields.io/npm/v/@ezuikit/control-date-picker.svg)
4
+ <!-- ![License](https://img.shields.io/npm/l/@ezuikit/control-date-picker.svg) -->
5
+
3
6
  ## Usage
4
7
 
5
8
  ```bash
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/control-date-picker v1.0.4
3
- * Copyright (c) 2026-01-01 Ezviz-OpenBiz
2
+ * @ezuikit/control-date-picker v1.0.5
3
+ * Copyright (c) 2026-03-15 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  "use strict";var delegate=require("@skax/delegate"),utilsTools=require("@ezuikit/utils-tools"),deepmerge=require("deepmerge"),Picker=require("@skax/picker"),Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day))}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}(),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:!1,showSuperNextIcon:!1,showPrevIcon:!1,showNextIcon:!1,showHeaderClose:!1,showHeaderOk:!1,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>',renderHeaderOkIcon:function(locale){return'<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:!1}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners()}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""))},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html}},_proto.destroy=function(){this.$header&&this.$header.remove()},_proto._eventListeners=function(){var _this=this;_this.$header&&(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options)}),delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options)}),delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options)}),delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options)}),delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault())}),delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault())}))},Header}();function _extends$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$2.apply(this,arguments)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:!0},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:!1}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$2({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container)}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh}else this.locale=this.options.locales.zh},_proto.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();function _create_class$3(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,showPrevIcon:!0,showNextIcon:!0,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return(_this=Container.call(this,container,_extends$1({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,!1),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,!1),_this._onHeader(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$3(subClass,superClass)}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=!0),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?utilsTools.DateTime.toDate(date):date,(!this._current||utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,utilsTools.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=utilsTools.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected")}this._setRenderCurrent(this._current)}catch(error){this._setRenderCurrent(new Date)}else this._setRenderCurrent(new Date);var left,right},_proto.updateBadges=function(badges){this._updateBadges(badges)},_proto._updateBadges=function(badges,rerender){void 0===rerender&&(rerender=!0),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return utilsTools.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate())},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&utilsTools.DateTime.format(this._renderCurrent,"YYYY-MM")!==utilsTools.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate())},_proto._onCell=function(){var _this=this;delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,utilsTools.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault()})},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent)},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent)},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent)},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent)},_proto._onHeader=function(){var _this=this;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent)}),delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent)})},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return"<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body)},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=utilsTools.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return"<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(utilsTools.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return'<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("")}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$3(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}Calendar.DateTime=utilsTools.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return(_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:!1,showNextIcon:!1,prefixCls:"emonth"}],{clone:!1}))||this)._render(),_this.setCurrent(_this.options.current,!1),_this._onHeaderTitle(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$2(subClass,superClass)}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){void 0===change&&(change=!0),this._setCurrent(date,change)},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=utilsTools.DateTime.toDate(d));var current=d;this._current&&utilsTools.DateTime.format(current,"YYYY-MM-DD")===utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,utilsTools.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current)}catch(error){this._setRenderCurrent(new Date)}else this._setRenderCurrent(new Date);var left,right},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&utilsTools.DateTime.format(date,"YYYY")!==utilsTools.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=utilsTools.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected")}this._setHeader()},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._onCell=function(){var _this=this;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=utilsTools.DateTime.toDate(utilsTools.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,utilsTools.DateTime.format(newDate,"YYYY-MM"),disabled)})},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=utilsTools.DateTime.toDate(year+utilsTools.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent)},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=utilsTools.DateTime.toDate(year+utilsTools.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent)},_proto._onHeaderTitle=function(){var _this=this;delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent)})},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>"}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=utilsTools.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+utilsTools.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,utilsTools.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled")}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body)},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return"<tr>\n "+month.map(function(m,i){return'<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(utilsTools.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled()},_create_class$2(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _YEAR_DEFAULT_OPTIONS_={showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return(_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{showPrevIcon:!1,showNextIcon:!1,renderPrevIcon:"",renderNextIcon:""}],{clone:!1}))||this)._render(),_this._setCurrent(_this.options.current,!1),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$1(subClass,superClass)}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){void 0===change&&(change=!0),this._setCurrent(year,change)},_proto._setCurrent=function(year,change){void 0===change&&(change=!0);var left,right,_year="number"==typeof year?utilsTools.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&utilsTools.DateTime.format(_year,"YYYY-MM-DD")===utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList()},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._onCell=function(){var _this=this;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=utilsTools.DateTime.toDate(utilsTools.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,utilsTools.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault()})},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList()},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList()},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body)},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return"<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return+y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(utilsTools.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(utilsTools.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ")},_create_class$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:!1,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return(_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:!1}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:!1}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){void 0===change&&(change=!0),this._setCurrent(date,change)},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges))},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this)},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=!0),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change)},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top")},_proto.hide=function(){this.open=!1},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,!1)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode)},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM-DD")===utilsTools.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk)}})))},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY-MM")===utilsTools.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk)},onYear:this._onYear.bind(this)})))},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&utilsTools.DateTime.format(_this._current,"YYYY")===utilsTools.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk)}})))},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide()},_proto._onClose=function(){this.hide()},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,!0)},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&utilsTools.DateTime.format(date,"YYYY-MM-DD")!==utilsTools.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode()},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode())},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode()},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode()},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode)},_create_class(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);exports.Calendar=Calendar,exports.DatePicker=DatePicker,exports.Header=Header,exports.Month=Month,exports.Year=Year;
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/control-date-picker v1.0.4
3
- * Copyright (c) 2026-01-01 Ezviz-OpenBiz
2
+ * @ezuikit/control-date-picker v1.0.5
3
+ * Copyright (c) 2026-03-15 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  !function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory((global="undefined"!=typeof globalThis?globalThis:global||self).DatePicker={})}(this,function(exports){"use strict";function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}var hasRequiredDelegate,delegate$2={exports:{}};
@@ -8,4 +8,4 @@
8
8
  * delegate.js v4.0.2
9
9
  * Copyright (c) 2025-12-16
10
10
  * Released under the MIT License.
11
- */var hasRequiredDist$1,delegateExports=(hasRequiredDelegate||(hasRequiredDelegate=1,function(module){module.exports=function(){var DOCUMENT_NODE_TYPE=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var proto=Element.prototype;proto.matches=(null==proto?void 0:proto.matchesSelector)||(null==proto?void 0:proto.mozMatchesSelector)||(null==proto?void 0:proto.msMatchesSelector)||(null==proto?void 0:proto.oMatchesSelector)||(null==proto?void 0:proto.webkitMatchesSelector)}function closest(element,selector){for(;element&&element.nodeType!==DOCUMENT_NODE_TYPE;){if("function"==typeof element.matches&&element.matches(selector))return element;element=element.parentNode}return null}function closestNative(element,selector){return element&&element.closest(selector)}var closest$1="function"==typeof Element.prototype.closest?closestNative:closest;function _delegate(element,selector,type,callback,useCapture){var listenerFn=listener.apply(this,arguments);return element.addEventListener(type,listenerFn,useCapture),{destroy:function(){element.removeEventListener(type,listenerFn,useCapture)}}}function delegate(elements,selector,type,callback,useCapture){return"function"==typeof elements.addEventListener?_delegate.apply(null,arguments):"function"==typeof type?_delegate.bind(null,document).apply(null,arguments):("string"==typeof elements&&(elements=document.querySelectorAll(elements)),Array.prototype.map.call(elements,function(element){return _delegate(element,selector,type,callback,useCapture)}))}function listener(element,selector,type,callback){return function(e){e.delegateTarget=closest$1(e.target,selector),e.delegateTarget&&callback.call(element,e)}}return delegate}()}(delegate$2)),delegate$2.exports),delegate=getDefaultExportFromCjs(delegateExports),dist$1={};var cjs,hasRequiredCjs,distExports$1=function(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1;var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1])}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","")}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return{}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else{if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"")}for(var _step,result=format,_iterator=function(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o){if(o){if("string"==typeof o)return _array_like_to_array(o,void 0);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,void 0):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return(date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn)}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return/^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(str+"T00:00:00"):/^\d{8}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T00:00:00")):/^\d{14}$/.test(str)?(str+="",new Date(str.slice(0,4)+"-"+str.slice(4,6)+"-"+str.slice(6,8)+"T"+str.slice(8,10)+":"+str.slice(10,12)+":"+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return"second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();return dist$1.DateTime=DateTime,dist$1.addVc=function(url,codecs){void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce(function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)},0),host=url.split("?")[0],query=url.split("?")[1];return host+"?"+(query=(query||"").split("&").filter(function(item){return!/^vc=\d?/.test(item)}).join("&"))+(query?"&":"")+"vc="+vc},dist$1.getQuery=getQuery,dist$1.getStaticPath=function(path,base){void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return"";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$1.isHttp=function(url){return/^http[s]?:\/\//.test(url)},dist$1.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$1.parseEzopenUrl=parseEzopenUrl,dist$1.pick=function(obj,keys){return Object.entries(obj).reduce(function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc},{})},dist$1.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce(function(acc,param){var key=param[0],value=param[1];return""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"},"?").replace(/&$/,"")}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search},dist$1}(),Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day))}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}();var cjsExports=function(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var isMergeableObject=function(value){return function(value){return!!value&&"object"==typeof value}(value)&&!function(value){var stringValue=Object.prototype.toString.call(value);return"[object RegExp]"===stringValue||"[object Date]"===stringValue||function(value){return value.$$typeof===REACT_ELEMENT_TYPE}(value)}(value)},REACT_ELEMENT_TYPE="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function cloneUnlessOtherwiseSpecified(value,options){return!1!==options.clone&&options.isMergeableObject(value)?deepmerge((val=value,Array.isArray(val)?[]:{}),value,options):value;var val}function defaultArrayMerge(target,source,options){return target.concat(source).map(function(element){return cloneUnlessOtherwiseSpecified(element,options)})}function getKeys(target){return Object.keys(target).concat(function(target){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(target).filter(function(symbol){return Object.propertyIsEnumerable.call(target,symbol)}):[]}(target))}function propertyIsOnObject(object,property){try{return property in object}catch(_){return!1}}function mergeObject(target,source,options){var destination={};return options.isMergeableObject(target)&&getKeys(target).forEach(function(key){destination[key]=cloneUnlessOtherwiseSpecified(target[key],options)}),getKeys(source).forEach(function(key){(function(target,key){return propertyIsOnObject(target,key)&&!(Object.hasOwnProperty.call(target,key)&&Object.propertyIsEnumerable.call(target,key))})(target,key)||(propertyIsOnObject(target,key)&&options.isMergeableObject(source[key])?destination[key]=function(key,options){if(!options.customMerge)return deepmerge;var customMerge=options.customMerge(key);return"function"==typeof customMerge?customMerge:deepmerge}(key,options)(target[key],source[key],options):destination[key]=cloneUnlessOtherwiseSpecified(source[key],options))}),destination}function deepmerge(target,source,options){(options=options||{}).arrayMerge=options.arrayMerge||defaultArrayMerge,options.isMergeableObject=options.isMergeableObject||isMergeableObject,options.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var sourceIsArray=Array.isArray(source);return sourceIsArray===Array.isArray(target)?sourceIsArray?options.arrayMerge(target,source,options):mergeObject(target,source,options):cloneUnlessOtherwiseSpecified(source,options)}return deepmerge.all=function(array,options){if(!Array.isArray(array))throw new Error("first argument should be an array");return array.reduce(function(prev,next){return deepmerge(prev,next,options)},{})},cjs=deepmerge}(),deepmerge=getDefaultExportFromCjs(cjsExports),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:!1,showSuperNextIcon:!1,showPrevIcon:!1,showNextIcon:!1,showHeaderClose:!1,showHeaderOk:!1,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>',renderHeaderOkIcon:function(locale){return'<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:!1}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners()}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""))},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html}},_proto.destroy=function(){this.$header&&this.$header.remove()},_proto._eventListeners=function(){var _this=this;_this.$header&&(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options)}),delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options)}),delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options)}),delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options)}),delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault())}),delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault())}))},Header}();function _extends$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$2.apply(this,arguments)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:!0},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:!1}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$2({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container)}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh}else this.locale=this.options.locales.zh},_proto.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();function _create_class$3(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,showPrevIcon:!0,showNextIcon:!0,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return(_this=Container.call(this,container,_extends$1({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,!1),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,!1),_this._onHeader(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$3(subClass,superClass)}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=!0),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?distExports$1.DateTime.toDate(date):date,(!this._current||distExports$1.DateTime.format(date,"YYYY-MM-DD")!==distExports$1.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,distExports$1.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=distExports$1.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected")}this._setRenderCurrent(this._current)}catch(error){this._setRenderCurrent(new Date)}else this._setRenderCurrent(new Date);var left,right},_proto.updateBadges=function(badges){this._updateBadges(badges)},_proto._updateBadges=function(badges,rerender){void 0===rerender&&(rerender=!0),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return distExports$1.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate())},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&distExports$1.DateTime.format(this._renderCurrent,"YYYY-MM")!==distExports$1.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate())},_proto._onCell=function(){var _this=this;delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,distExports$1.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault()})},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent)},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent)},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent)},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent)},_proto._onHeader=function(){var _this=this;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent)}),delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent)})},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return"<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body)},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=distExports$1.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return"<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&distExports$1.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(distExports$1.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return'<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("")}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$3(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}Calendar.DateTime=distExports$1.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return(_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:!1,showNextIcon:!1,prefixCls:"emonth"}],{clone:!1}))||this)._render(),_this.setCurrent(_this.options.current,!1),_this._onHeaderTitle(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$2(subClass,superClass)}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){void 0===change&&(change=!0),this._setCurrent(date,change)},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=distExports$1.DateTime.toDate(d));var current=d;this._current&&distExports$1.DateTime.format(current,"YYYY-MM-DD")===distExports$1.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,distExports$1.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current)}catch(error){this._setRenderCurrent(new Date)}else this._setRenderCurrent(new Date);var left,right},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&distExports$1.DateTime.format(date,"YYYY")!==distExports$1.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=distExports$1.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected")}this._setHeader()},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._onCell=function(){var _this=this;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=distExports$1.DateTime.toDate(distExports$1.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$1.DateTime.format(newDate,"YYYY-MM"),disabled)})},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=distExports$1.DateTime.toDate(year+distExports$1.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent)},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=distExports$1.DateTime.toDate(year+distExports$1.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent)},_proto._onHeaderTitle=function(){var _this=this;delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent)})},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>"}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=distExports$1.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+distExports$1.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,distExports$1.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled")}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body)},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return"<tr>\n "+month.map(function(m,i){return'<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(distExports$1.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled()},_create_class$2(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var dist,hasRequiredDist,_YEAR_DEFAULT_OPTIONS_={showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return(_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{showPrevIcon:!1,showNextIcon:!1,renderPrevIcon:"",renderNextIcon:""}],{clone:!1}))||this)._render(),_this._setCurrent(_this.options.current,!1),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$1(subClass,superClass)}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){void 0===change&&(change=!0),this._setCurrent(year,change)},_proto._setCurrent=function(year,change){void 0===change&&(change=!0);var left,right,_year="number"==typeof year?distExports$1.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&distExports$1.DateTime.format(_year,"YYYY-MM-DD")===distExports$1.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList()},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._onCell=function(){var _this=this;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=distExports$1.DateTime.toDate(distExports$1.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$1.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault()})},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList()},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList()},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body)},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return"<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return+y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(distExports$1.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(distExports$1.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ")},_create_class$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);var distExports=function(){if(hasRequiredDist)return dist;function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}hasRequiredDist=1;var pickerProvider=function(){function PickerProvider(){this.pickers=[]}var _proto=PickerProvider.prototype;return _proto.add=function(picker){this.pickers.push(picker)},_proto.remove=function(picker){var index=this.pickers.indexOf(picker);index>-1&&this.pickers.splice(index,1)},_proto.closeOther=function(e){for(var _step,_iterator=_create_for_of_iterator_helper_loose(this.pickers);!(_step=_iterator()).done;){var _p_$container_contains,_p_$container,_p_$wrapperContent_contains,_p_$wrapperContent,p=_step.value;!p||e.target===p.$container||(null==(_p_$container=p.$container)||null==(_p_$container_contains=_p_$container.contains)?void 0:_p_$container_contains.call(_p_$container,e.target))||e.target===p.$wrapperContent||(null==(_p_$wrapperContent=p.$wrapperContent)||null==(_p_$wrapperContent_contains=_p_$wrapperContent.contains)?void 0:_p_$wrapperContent_contains.call(_p_$wrapperContent,e.target))||(p.open=!1)}},PickerProvider.getInstance=function(){return PickerProvider.instance||(PickerProvider.instance=new PickerProvider),PickerProvider.instance},PickerProvider}().getInstance();function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}var _$PICKER_PLACEMENT$_=["top","tl","tr","bottom","bl","br"],__$PICKER_DEFAULT_OPTIONS$__={getPopupContainer:function(){return document.body},wrapClassName:"",open:!1,placement:"br",offset:[0,0],zIndex:1e3,content:"",trigger:"click",mouseLeaveDelay:.1,mouseEnterDelay:.1,isMobile:!1,triggerClose:!1},Picker=function(){function Picker(container,options){var _this__$popupContainer,_this__$popupContainer1;this._open=!1,this._OpenChange=!1,this._animationTimer=null,this._disabled=!1,this._timer=null,this._options=Object.assign({},__$PICKER_DEFAULT_OPTIONS$__,options||{}),this._options.isMobile&&(this._options.trigger="click"),pickerProvider.add(this),this.$container="function"==typeof container?container():container,this.$wrapperContent=document.createElement("div"),this._initContentStyle(),"function"==typeof this._options.getPopupContainer?this._$popupContainer=this._options.getPopupContainer():this._$popupContainer=document.body,["INPUT","CANVAS","VIDEO","IMG"].includes(null==(_this__$popupContainer=this._$popupContainer)?void 0:_this__$popupContainer.tagName)&&(this._$popupContainer=document.body),this._$popupContainer!==document.body&&(this._$popupContainer.style.position="relative"),null==(_this__$popupContainer1=this._$popupContainer)||_this__$popupContainer1.appendChild(this.$wrapperContent),this._onContentClick=this._onContentClick.bind(this),this._onShow=this._onShow.bind(this),this._onContainerClick=this._onContainerClick.bind(this),this._onWrapperShow=this._onWrapperShow.bind(this),this._onHide=this._onHide.bind(this),this._onDocumentClick=this._onDocumentClick.bind(this),this._eventListener(),this.open=!!this._options.open}var _proto=Picker.prototype;return _proto.setPlacement=function(placement){this._disabled||(_$PICKER_PLACEMENT$_.includes(placement)&&(this._options.placement=placement),this._setPlacement())},_proto.destroy=function(){this._animationTimerClear(),this._removeHtml(),pickerProvider.remove(this)},_proto.innerHTML=function(html){this.$body&&(this.$body.innerHTML=html||"",this._setPlacement())},_proto._onOpenChange=function(open){null==this._options.onOpenChange||this._options.onOpenChange.call(this._options,!!open)},_proto._animationTimerClear=function(){this._animationTimer&&(clearTimeout(this._animationTimer),this._animationTimer=null)},_proto._removeHtml=function(){var _this_$wrapperContent,_this_$container_removeEventListener,_this_$container,_this_$container_removeEventListener1,_this_$container1,_this_$container_removeEventListener2,_this_$container2,_this_$container_removeEventListener3,_this_$container3,_this_$container_removeEventListener4,_this_$container4,_this_$wrapperContent1,_this_$wrapperContent2;(null==(_this_$wrapperContent=this.$wrapperContent)||_this_$wrapperContent.removeEventListener("click",this._onContentClick),null==(_this_$container=this.$container)||null==(_this_$container_removeEventListener=_this_$container.removeEventListener)||_this_$container_removeEventListener.call(_this_$container,"click",this._onContentClick),"click"===this._options.trigger&&(null==(_this_$container1=this.$container)||null==(_this_$container_removeEventListener1=_this_$container1.removeEventListener)||_this_$container_removeEventListener1.call(_this_$container1,"click",this._onContainerClick)),"hover"===this._options.trigger)&&(null==(_this_$container2=this.$container)||null==(_this_$container_removeEventListener2=_this_$container2.removeEventListener)||_this_$container_removeEventListener2.call(_this_$container2,"mouseenter",this._onShow),null==(_this_$container3=this.$container)||null==(_this_$container_removeEventListener3=_this_$container3.removeEventListener)||_this_$container_removeEventListener3.call(_this_$container3,"mouseover",this._onShow),null==(_this_$container4=this.$container)||null==(_this_$container_removeEventListener4=_this_$container4.removeEventListener)||_this_$container_removeEventListener4.call(_this_$container4,"mouseleave",this._onHide),null==(_this_$wrapperContent1=this.$wrapperContent)||_this_$wrapperContent1.removeEventListener("mouseenter",this._onWrapperShow),null==(_this_$wrapperContent2=this.$wrapperContent)||_this_$wrapperContent2.removeEventListener("mouseleave",this._onHide));this._options.isMobile||(window.removeEventListener("blur",this._onHide),document.removeEventListener("visibilitychange",this._onHide),window.removeEventListener("resize",this._onHide),document.removeEventListener("click",this._onDocumentClick)),this._$mask&&(this._$mask.removeEventListener("click",this._onHide),this._$mask.remove(),this._$mask=null),this._options.isMobile&&document.body.classList.remove("epicker-body-noscroll"),this.$wrapperContent&&(this.$wrapperContent.remove(),this.$wrapperContent=null)},_proto._setPlacement=function(){var _this_$container_getBoundingClientRect,_this_$container;if(this._open&&!this._options.isMobile&&this.$container){var right,$containerRect=null==(_this_$container=this.$container)||null==(_this_$container_getBoundingClientRect=_this_$container.getBoundingClientRect)?void 0:_this_$container_getBoundingClientRect.call(_this_$container),$wrapperContentRect=this.$wrapperContent.getBoundingClientRect(),$popupContainerRect=this._$popupContainer.getBoundingClientRect(),containerLeft=Math.ceil($containerRect.left)-Math.ceil($popupContainerRect.left),containerRight=-(Math.ceil($containerRect.right)-Math.ceil($popupContainerRect.right)),containerTop=Math.ceil($containerRect.y)-Math.ceil($popupContainerRect.y),left=containerLeft+(Math.ceil($containerRect.width)-Math.ceil($wrapperContentRect.width))/2,top=containerTop-Math.ceil($wrapperContentRect.height),bottom=containerTop+Math.ceil($containerRect.height);if(/^t/.test(this._options.placement)){var _this__options_offset,_this__options_offset1,_this__options_offset2;switch(this._options.placement){case"top":right=void 0;break;case"tl":right=void 0,left=containerLeft;break;case"tr":left=void 0,right=containerRight}this.$wrapperContent.style.cssText+="\n "+(void 0!==right?"right: "+(right+((null==(_this__options_offset=this._options.offset)?void 0:_this__options_offset[0])||0))+"px;":"")+"\n "+(void 0!==left?"left: "+(left+((null==(_this__options_offset1=this._options.offset)?void 0:_this__options_offset1[0])||0))+"px;":"")+"\n top: "+(top+((null==(_this__options_offset2=this._options.offset)?void 0:_this__options_offset2[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n "}else if(/^b/.test(this._options.placement)){var _this__options_offset3,_this__options_offset4,_this__options_offset5;switch(this._options.placement){case"bottom":right=void 0;break;case"bl":right=void 0,left=containerLeft;break;case"br":left=void 0,right=containerRight}this.$wrapperContent&&(this.$wrapperContent.style.cssText+="\n "+(void 0!==right?"right: "+(right+((null==(_this__options_offset3=this._options.offset)?void 0:_this__options_offset3[0])||0))+"px;":"")+"\n "+(void 0!==left?"left: "+(left+((null==(_this__options_offset4=this._options.offset)?void 0:_this__options_offset4[0])||0))+"px;":"")+"\n top: "+(bottom+((null==(_this__options_offset5=this._options.offset)?void 0:_this__options_offset5[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n ")}}},_proto._initContentStyle=function(){if(this.$wrapperContent&&(this.$wrapperContent.classList.add("epicker","epicker-wrapper","epicker-"+this._options.placement),this.$wrapperContent.style.display="none",this._options.isMobile&&(this.$wrapperContent.classList.add("epicker-mobile"),this._$mask=document.createElement("div"),this._$mask.classList.add("epicker-mask"),this.$wrapperContent.appendChild(this._$mask)),this.$body=document.createElement("div"),this.$body.classList.add("epicker-body"),this.$wrapperContent.appendChild(this.$body),"string"==typeof this._options.content?this.innerHTML(this._options.content):"function"==typeof this._options.content&&this.innerHTML(null==this._options.content?void 0:this._options.content.call(this._options)),"string"==typeof this._options.wrapClassName))try{var _this_$wrapperContent_classList,_this_$wrapperContent;null==(_this_$wrapperContent=this.$wrapperContent)||(_this_$wrapperContent_classList=_this_$wrapperContent.classList).add.apply(_this_$wrapperContent_classList,[].concat(this._options.wrapClassName.split(" ")))}catch(_error){}},_proto._eventListener=function(){var _this_$container_addEventListener,_this_$container,_this_$container_addEventListener1,_this_$container1,_this_$container_addEventListener2,_this_$container2,_this_$container_addEventListener3,_this_$container3,_this_$container_addEventListener4,_this_$container4;(this.$wrapperContent.addEventListener("click",this._onContentClick),null==(_this_$container=this.$container)||null==(_this_$container_addEventListener=_this_$container.addEventListener)||_this_$container_addEventListener.call(_this_$container,"click",this._onContentClick),"click"===this._options.trigger&&(null==(_this_$container1=this.$container)||null==(_this_$container_addEventListener1=_this_$container1.addEventListener)||_this_$container_addEventListener1.call(_this_$container1,"click",this._onContainerClick)),"hover"===this._options.trigger)&&(null==(_this_$container2=this.$container)||null==(_this_$container_addEventListener2=_this_$container2.addEventListener)||_this_$container_addEventListener2.call(_this_$container2,"mouseenter",this._onShow),null==(_this_$container3=this.$container)||null==(_this_$container_addEventListener3=_this_$container3.addEventListener)||_this_$container_addEventListener3.call(_this_$container3,"mouseover",this._onShow),null==(_this_$container4=this.$container)||null==(_this_$container_addEventListener4=_this_$container4.addEventListener)||_this_$container_addEventListener4.call(_this_$container4,"mouseleave",this._onHide),this.$wrapperContent.addEventListener("mouseenter",this._onWrapperShow),this.$wrapperContent.addEventListener("mouseleave",this._onHide));this._$mask&&this._$mask.addEventListener("click",this._onHide),this._options.isMobile||(window.addEventListener("blur",this._onHide),document.addEventListener("visibilitychange",this._onHide),window.addEventListener("resize",this._onHide),document.addEventListener("click",this._onDocumentClick))},_proto._onContentClick=function(e){pickerProvider.closeOther(e)},_proto._onContainerClick=function(event){var _this_$wrapperContent_contains,_this_$wrapperContent;if(!this._disabled){var contain=(null==(_this_$wrapperContent=this.$wrapperContent)||null==(_this_$wrapperContent_contains=_this_$wrapperContent.contains)?void 0:_this_$wrapperContent_contains.call(_this_$wrapperContent,event.target))||this.$wrapperContent===event.target;this._options.triggerClose&&"click"===this._options.trigger&&!contain?this.open=!this.open:this.open=!0}},_proto._onShow=function(){this._disabled||(this.open=!0)},_proto._onWrapperShow=function(){this._disabled||this._onShow()},_proto._onHide=function(e){this._open&&!this._disabled&&((null==e?void 0:e.target)===this._$mask&&(null==e||e.stopPropagation()),this.open=!1)},_proto._onDocumentClick=function(event){var _this_$container;if(!this.$wrapperContent.contains(event.target)&&this.$wrapperContent!==event.target&&!(null==(_this_$container=this.$container)?void 0:_this_$container.contains(event.target))&&this.$container!==event.target){if(this._disabled)return;this._onHide()}},_create_class(Picker,[{key:"open",get:function(){return this._open},set:function(open){var _this=this;this._disabled||this._open!==!!open&&(this._animationTimerClear(),this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer=open?setTimeout(function(){_this.$wrapperContent&&(_this.$wrapperContent.style.display="inline-flex",_this.$wrapperContent.style.pointerEvents="",_this._options.isMobile&&document.body.classList.add("epicker-body-noscroll"),_this._animationTimer=setTimeout(function(){_this._animationTimerClear(),_this.$wrapperContent.style.opacity="1"},0),requestAnimationFrame(function(){_this._setPlacement()}),_this._OpenChange=open,_this._onOpenChange(open))},1e3*(this._options.mouseEnterDelay<0?0:this._options.mouseEnterDelay)):setTimeout(function(){_this.$wrapperContent&&(_this.$wrapperContent.style.opacity="0",_this.$wrapperContent.style.pointerEvents="none",_this._options.isMobile&&document.body.classList.remove("epicker-body-noscroll"),_this._animationTimer=setTimeout(function(){_this._animationTimerClear(),_this.$wrapperContent.style.display="none"},301),_this._OpenChange=open,_this._onOpenChange(open))},1e3*(this._options.mouseLeaveDelay<0?0:this._options.mouseLeaveDelay)),this._OpenChange===open&&this._timer&&(clearTimeout(this._timer),this._timer=null),this._open=!!open)}},{key:"disabled",get:function(){return this._disabled},set:function(disabled){var _this_$container_classList_add,_this_$container_classList,_this_$container,_this_$container_classList_remove,_this_$container_classList1,_this_$container1;disabled?null==(_this_$container=this.$container)||null==(_this_$container_classList=_this_$container.classList)||null==(_this_$container_classList_add=_this_$container_classList.add)||_this_$container_classList_add.call(_this_$container_classList,"epicker-disabled"):null==(_this_$container1=this.$container)||null==(_this_$container_classList1=_this_$container1.classList)||null==(_this_$container_classList_remove=_this_$container_classList1.remove)||_this_$container_classList_remove.call(_this_$container_classList1,"epicker-disabled");this._disabled=disabled}}]),Picker}();return Picker.VERSION="1.1.7",dist=Picker}(),Picker=getDefaultExportFromCjs(distExports);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:!1,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return(_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:!1}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:!1}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){void 0===change&&(change=!0),this._setCurrent(date,change)},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges))},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this)},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=!0),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change)},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top")},_proto.hide=function(){this.open=!1},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,!1)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode)},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&distExports$1.DateTime.format(_this._current,"YYYY-MM-DD")===distExports$1.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk)}})))},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&distExports$1.DateTime.format(_this._current,"YYYY-MM")===distExports$1.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk)},onYear:this._onYear.bind(this)})))},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&distExports$1.DateTime.format(_this._current,"YYYY")===distExports$1.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk)}})))},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide()},_proto._onClose=function(){this.hide()},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,!0)},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&distExports$1.DateTime.format(date,"YYYY-MM-DD")!==distExports$1.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode()},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode())},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode()},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode()},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode)},_create_class(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);exports.Calendar=Calendar,exports.DatePicker=DatePicker,exports.Month=Month,exports.Year=Year});
11
+ */var hasRequiredDist$1,delegateExports=(hasRequiredDelegate||(hasRequiredDelegate=1,function(module){module.exports=function(){var DOCUMENT_NODE_TYPE=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var proto=Element.prototype;proto.matches=(null==proto?void 0:proto.matchesSelector)||(null==proto?void 0:proto.mozMatchesSelector)||(null==proto?void 0:proto.msMatchesSelector)||(null==proto?void 0:proto.oMatchesSelector)||(null==proto?void 0:proto.webkitMatchesSelector)}function closest(element,selector){for(;element&&element.nodeType!==DOCUMENT_NODE_TYPE;){if("function"==typeof element.matches&&element.matches(selector))return element;element=element.parentNode}return null}function closestNative(element,selector){return element&&element.closest(selector)}var closest$1="function"==typeof Element.prototype.closest?closestNative:closest;function _delegate(element,selector,type,callback,useCapture){var listenerFn=listener.apply(this,arguments);return element.addEventListener(type,listenerFn,useCapture),{destroy:function(){element.removeEventListener(type,listenerFn,useCapture)}}}function delegate(elements,selector,type,callback,useCapture){return"function"==typeof elements.addEventListener?_delegate.apply(null,arguments):"function"==typeof type?_delegate.bind(null,document).apply(null,arguments):("string"==typeof elements&&(elements=document.querySelectorAll(elements)),Array.prototype.map.call(elements,function(element){return _delegate(element,selector,type,callback,useCapture)}))}function listener(element,selector,type,callback){return function(e){e.delegateTarget=closest$1(e.target,selector),e.delegateTarget&&callback.call(element,e)}}return delegate}()}(delegate$2)),delegate$2.exports),delegate=getDefaultExportFromCjs(delegateExports),dist$1={};var cjs,hasRequiredCjs,distExports$1=function(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1;var getQuery=function(url){var query=url.split("?")[1],obj={};if(query)for(var vars=query.split("&"),i=0;i<vars.length;i++){var pair=vars[i].split("=");obj[pair[0]]=decodeURIComponent(pair[1])}return obj};function parseEzopenUrl(url){var obj={};if(/^ezopen:\/\//.test(url)){if(url.includes("@")){var endIndex=url.indexOf("@"),startIndex=url.indexOf("//");obj.validateCode=url.substring(startIndex+2,endIndex),url=url.replace(obj.validateCode+"@","")}obj.protocol=url.split("//")[0],obj.search=url.split("?")[1]?"?"+url.split("?")[1]:"",obj.hostname=url.split("/")[2],obj.origin=obj.protocol+"//"+obj.hostname,obj.pathname=url.split("?")[0].replace(obj.origin,""),obj.href=url;var pathnames=obj.pathname.split("/"),lastPath=pathnames[2].split(".");return obj.deviceSerial=pathnames[1],obj.channelNo=lastPath[0],obj.type=lastPath[lastPath.length-1],"live"===obj.type&&(obj.definition=lastPath.length>2?lastPath[1]:"sd"),"rec"===obj.type&&pathnames[2]&&(obj.recType=pathnames[2].includes(".cloud.")?"cloud":""),obj.searchParams=getQuery(url),obj}return{}}var codec={h264:1,h265:2,h266:4,vp8:8,vp9:16,av1:32};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _instanceof(left,right){return null!=right&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?!!right[Symbol.hasInstance](left):left instanceof right}var DateTime=function(){function DateTime(){}return DateTime.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},DateTime.format=function(input,format){var date;if(_instanceof(input,Date))date=input;else{if("number"!=typeof input&&"string"!=typeof input)throw new Error("Invalid date input");date=DateTime.toDate(input+"")}for(var _step,result=format,_iterator=function(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o){if(o){if("string"==typeof o)return _array_like_to_array(o,void 0);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,void 0):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}([[/(yyyy|YYYY)/g,function(){return DateTime.fillZero(date.getFullYear(),4)}],[/(yy|YY)/g,function(){return DateTime.fillZero(date.getFullYear()%100,2)}],[/(MM)/g,function(){return DateTime.fillZero(date.getMonth()+1,2)}],[/(M)/g,function(){return(date.getMonth()+1).toString()}],[/(dd|DD)/g,function(){return DateTime.fillZero(date.getDate(),2)}],[/(d|D)/g,function(){return date.getDate().toString()}],[/(HH|hh)/g,function(){return DateTime.fillZero(date.getHours(),2)}],[/(H|h)/g,function(){return date.getHours().toString()}],[/(mm)/g,function(){return DateTime.fillZero(date.getMinutes(),2)}],[/(m)/g,function(){return date.getMinutes().toString()}],[/(ss|SS)/g,function(){return DateTime.fillZero(date.getSeconds(),2)}],[/(s|S)/g,function(){return date.getSeconds().toString()}],[/(fff)/g,function(){return DateTime.fillZero(date.getMilliseconds(),3)}]]);!(_step=_iterator()).done;){var _step_value=_step.value,regexp=_step_value[0],fn=_step_value[1];result=result.replace(regexp,fn)}return result},DateTime.toDate=function(str){if(_instanceof(str,Date))return str;str=(str+"").trim().replace(/\/|\./gi,"-"),/^\d{4}$/.test(str)&&(str+="-01"),/^\d{4}-\d{2}$/.test(str)&&(str+="-01");try{return/^\d{4}-\d{2}-\d{2}$/.test(str)?new Date(+str.slice(0,4),+str.slice(5,7)-1,+str.slice(8,10),0,0,0):/^\d{8}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),0,0,0)):/^\d{14}$/.test(str)?(str+="",new Date(+str.slice(0,4),+str.slice(4,6)-1,+str.slice(6,8),+str.slice(8,10),+str.slice(10,12),+str.slice(12,14))):/^\d{13}$/.test(str)?new Date(Number(str)):/^\d{10}$/.test(str)?new Date(1e3*Number(str)):new Date(str)}catch(error){throw new Error("Invalid date string")}},DateTime.diff=function(date1,date2,type){void 0===type&&(type="second");var d1=DateTime.toDate(date1),d2=DateTime.toDate(date2);return"second"===type?Math.floor((d1.getTime()-d2.getTime())/1e3):"minute"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60):"hour"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60):"day"===type?Math.floor((d1.getTime()-d2.getTime())/1e3/60/60/24):Math.abs(d1.getTime()-d2.getTime())},DateTime}();return dist$1.DateTime=DateTime,dist$1.addVc=function(url,codecs){void 0===codecs&&(codecs=["h264"]);var vc=(codecs||["h264"]).reduce(function(acc,key){return key=key.toLowerCase(),acc+(codec[key]||0)},0),host=url.split("?")[0],query=url.split("?")[1];return host+"?"+(query=(query||"").split("&").filter(function(item){return!/^vc=\d?/.test(item)}).join("&"))+(query?"&":"")+"vc="+vc},dist$1.getQuery=getQuery,dist$1.getStaticPath=function(path,base){void 0===base&&(base="");var protocolReg=/^(https?:\/\/|^\/\/)/;if(""===path||void 0===path)return"";if(protocolReg.test(path))return path;path=path.replace(/\/+/g,"/"),base=protocolReg.test(base||"")?base:window.location.href;try{return new URL(path,base).href}catch(error){return path}},dist$1.isHttp=function(url){return/^http[s]?:\/\//.test(url)},dist$1.isMobile=function(agent){var _navigator,_navigator1,_navigator2,_window;return/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i.test(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent)||/Macintosh/i.test(agent||(null==(_navigator1=navigator)?void 0:_navigator1.userAgent))&&(null==(_navigator2=navigator)?void 0:_navigator2.maxTouchPoints)>1||!!(null==(_window=window)?void 0:_window.__IS_MOBILE_SIMULATOR__)},dist$1.isRealMobile=function(agent){var _navigator,ua=(null!=agent?agent:null==(_navigator=navigator)?void 0:_navigator.userAgent).toLowerCase();if(/ipad|tablet|playbook|silk|android(?!.*mobile)/i.test(ua))return!1;var hasTouch="ontouchstart"in window||navigator.maxTouchPoints>0;return/android|webos|iphone|ipod|blackberry|iemobile|opera mini/i.test(ua)&&hasTouch},dist$1.parseEzopenUrl=parseEzopenUrl,dist$1.pick=function(obj,keys){return Object.entries(obj).reduce(function(acc,param){var key=param[0],value=param[1];return keys.includes(key)&&(acc[key]=value),acc},{})},dist$1.switchEzopenUrl=function(url,options){var _ref=null!=options?options:{},type=_ref.type,recType=_ref.recType,search=_ref.search,definition=_ref.definition,channelNo=_ref.channelNo,deviceSerial=_ref.deviceSerial,validateCode=_ref.validateCode,obj=parseEzopenUrl(url);if(search){var ns=Object.assign({},obj.searchParams,getQuery("?"+search.replace("?","")));search=Object.entries(ns).reduce(function(acc,param){var key=param[0],value=param[1];return""===value?acc:acc+=key+"="+encodeURIComponent(value)+"&"},"?").replace(/&$/,"")}else search=obj.search;return type=type||obj.type,recType=null!=recType?recType:obj.recType,definition=null!=definition?definition:obj.definition,channelNo=channelNo||obj.channelNo,deviceSerial=deviceSerial||obj.deviceSerial,validateCode=null!=validateCode?validateCode:obj.validateCode,obj.protocol+"//"+(validateCode?validateCode+"@":"")+obj.hostname+"/"+deviceSerial+"/"+channelNo+("rec"===type&&recType?"."+recType:"")+("live"===type&&"hd"===definition?"."+definition:"")+"."+type+search},dist$1}(),Util=function(){function Util(){}return Util.fillZero=function(num,len){return void 0===len&&(len=2),num.toString().padStart(len,"0")},Util.chunkBySize=function(arr,size){return Array.from({length:Math.ceil(arr.length/size)}).map(function(_,index){return arr.slice(index*size,(index+1)*size)})},Util.generateYears=function(year){for(var years=[],i=year%10+1;i>=0;i--)years.push(year-i);for(var i1=1;years.length<12;i1++)years.push(year+i1);return years},Util.getDaysInMonth=function(year,month){return new Date(year,month+1,0).getDate()},Util.getFirstDayOfMonth=function(year,month,startOfWeek){return void 0===startOfWeek&&(startOfWeek=0),(new Date(year,month).getDay()-startOfWeek+7)%7},Util.generateWeeksByYearMonth=function(year,month,startOfWeek){void 0===startOfWeek&&(startOfWeek=0),month-=1;for(var daysInMonth=Util.getDaysInMonth(year,month),firstDay=Util.getFirstDayOfMonth(year,month,startOfWeek),weeks=[],i=1;i<=firstDay+daysInMonth;i++){var day=i-firstDay;day<1?weeks.push((0===month?year-1:year)+"-"+Util.fillZero((month+12-1)%12+1)+"-"+Util.fillZero(Util.getDaysInMonth(year,month-1)+day)):day>daysInMonth?weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+(day-daysInMonth)):weeks.push(year+"-"+Util.fillZero(month+1)+"-"+Util.fillZero(day))}for(var nextDay=1;weeks.length<42;)weeks.push((11===month?year+1:year)+"-"+Util.fillZero((month+1)%12+1)+"-"+Util.fillZero(nextDay++));return weeks},Util.generateHours=function(){for(var hours=[],i=0;i<24;i++)hours.push(Util.fillZero(i));return hours},Util.generateMinutesOrSeconds=function(){for(var hours=[],i=0;i<=59;i++)hours.push(Util.fillZero(i));return hours},Util}();var cjsExports=function(){if(hasRequiredCjs)return cjs;hasRequiredCjs=1;var isMergeableObject=function(value){return function(value){return!!value&&"object"==typeof value}(value)&&!function(value){var stringValue=Object.prototype.toString.call(value);return"[object RegExp]"===stringValue||"[object Date]"===stringValue||function(value){return value.$$typeof===REACT_ELEMENT_TYPE}(value)}(value)},REACT_ELEMENT_TYPE="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function cloneUnlessOtherwiseSpecified(value,options){return!1!==options.clone&&options.isMergeableObject(value)?deepmerge((val=value,Array.isArray(val)?[]:{}),value,options):value;var val}function defaultArrayMerge(target,source,options){return target.concat(source).map(function(element){return cloneUnlessOtherwiseSpecified(element,options)})}function getKeys(target){return Object.keys(target).concat(function(target){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(target).filter(function(symbol){return Object.propertyIsEnumerable.call(target,symbol)}):[]}(target))}function propertyIsOnObject(object,property){try{return property in object}catch(_){return!1}}function mergeObject(target,source,options){var destination={};return options.isMergeableObject(target)&&getKeys(target).forEach(function(key){destination[key]=cloneUnlessOtherwiseSpecified(target[key],options)}),getKeys(source).forEach(function(key){(function(target,key){return propertyIsOnObject(target,key)&&!(Object.hasOwnProperty.call(target,key)&&Object.propertyIsEnumerable.call(target,key))})(target,key)||(propertyIsOnObject(target,key)&&options.isMergeableObject(source[key])?destination[key]=function(key,options){if(!options.customMerge)return deepmerge;var customMerge=options.customMerge(key);return"function"==typeof customMerge?customMerge:deepmerge}(key,options)(target[key],source[key],options):destination[key]=cloneUnlessOtherwiseSpecified(source[key],options))}),destination}function deepmerge(target,source,options){(options=options||{}).arrayMerge=options.arrayMerge||defaultArrayMerge,options.isMergeableObject=options.isMergeableObject||isMergeableObject,options.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var sourceIsArray=Array.isArray(source);return sourceIsArray===Array.isArray(target)?sourceIsArray?options.arrayMerge(target,source,options):mergeObject(target,source,options):cloneUnlessOtherwiseSpecified(source,options)}return deepmerge.all=function(array,options){if(!Array.isArray(array))throw new Error("first argument should be an array");return array.reduce(function(prev,next){return deepmerge(prev,next,options)},{})},cjs=deepmerge}(),deepmerge=getDefaultExportFromCjs(cjsExports),__$CALENDAR_LOCALES$__={en:{year:"",month:"",weeks:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",ok:"OK",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},zh:{year:"年",month:"月",weeks:["日","一","二","三","四","五","六"],today:"今天",ok:"确定",months:["01","02","03","04","05","06","07","08","09","10","11","12"]}},__DEFAULT_COMPONENTS_OPTIONS__={showSuperPrevIcon:!1,showSuperNextIcon:!1,showPrevIcon:!1,showNextIcon:!1,showHeaderClose:!1,showHeaderOk:!1,renderSuperPrevIcon:'<span class="edate-super-prev-icon"></span>',renderSuperNextIcon:'<span class="edate-super-next-icon"></span>',renderPrevIcon:'<span class="edate-prev-icon"></span>',renderNextIcon:'<span class="edate-next-icon"></span>',renderHeaderCloseIcon:'<span class="edate-close-icon">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>',renderHeaderOkIcon:function(locale){return'<span class="edate-btn-text">'+((null==locale?void 0:locale.ok)||"确定")+"</span>"}},Header=function(){function Header(options){this.$header=null,this.options=deepmerge.all([{},__DEFAULT_COMPONENTS_OPTIONS__,options],{clone:!1}),this.$header=document.createElement("div"),this.$header.classList.add("edate-header",options.prefixCls+"-header"),options.className&&this.$header.classList.add(options.className),this._render(),this._eventListeners()}var _proto=Header.prototype;return _proto._render=function(){var _this__getStrOrFunToStr,_this__getStrOrFunToStr1,_this__getStrOrFunToStr2,_this__getStrOrFunToStr3,_this__getStrOrFunToStr4,_this__getStrOrFunToStr5;this.$header&&(this.$header.innerHTML="\n "+(this.options.showHeaderClose?'<div class="edate-close-btn">\n '+(null!=(_this__getStrOrFunToStr=this._getStrOrFunToStr(this.options.renderHeaderCloseIcon))?_this__getStrOrFunToStr:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderCloseIcon)+"\n </div>":this.options.showHeaderOk?"<span></span>":"")+"\n "+(this.options.showSuperPrevIcon||this.options.showPrevIcon?'\n <div class="edate-prev-btns">\n '+(this.options.showSuperPrevIcon?'<div class="edate-super-prev-btn '+this.options.prefixCls+'-super-prev-btn">\n '+(null!=(_this__getStrOrFunToStr1=this._getStrOrFunToStr(this.options.renderSuperPrevIcon))?_this__getStrOrFunToStr1:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperPrevIcon)+"\n </div>":"")+"\n "+(this.options.showPrevIcon?'<div class="edate-prev-btn '+this.options.prefixCls+'-prev-btn">\n '+(null!=(_this__getStrOrFunToStr2=this._getStrOrFunToStr(this.options.renderPrevIcon))?_this__getStrOrFunToStr2:__DEFAULT_COMPONENTS_OPTIONS__.renderPrevIcon)+"\n </div>":"")+"\n </div>\n ":"")+'\n\n <div class="edate-header-view '+this.options.prefixCls+'-header-view"></div>\n\n '+(this.options.showNextIcon||this.options.showSuperNextIcon?'\n <div class="edate-next-btns">\n '+(this.options.showNextIcon?'<div class="edate-next-btn '+this.options.prefixCls+'-next-btn">\n '+(null!=(_this__getStrOrFunToStr3=this._getStrOrFunToStr(this.options.renderNextIcon))?_this__getStrOrFunToStr3:__DEFAULT_COMPONENTS_OPTIONS__.renderNextIcon)+"\n </div>":"")+"\n "+(this.options.showSuperNextIcon?'<div class="edate-super-next-btn '+this.options.prefixCls+'-super-next-btn">\n '+(null!=(_this__getStrOrFunToStr4=this._getStrOrFunToStr(this.options.renderSuperNextIcon))?_this__getStrOrFunToStr4:__DEFAULT_COMPONENTS_OPTIONS__.renderSuperNextIcon)+"\n </div>":"")+"\n </div>\n ":"")+"\n "+(this.options.showHeaderOk?'<div class="edate-ok-btn">\n '+(null!=(_this__getStrOrFunToStr5=this._getStrOrFunToStr(this.options.renderHeaderOkIcon))?_this__getStrOrFunToStr5:__DEFAULT_COMPONENTS_OPTIONS__.renderHeaderOkIcon)+"\n </div>":this.options.showHeaderClose?"<span></span>":""))},_proto._getStrOrFunToStr=function(value){if(null!=value){var _this_options;if("function"==typeof value)return this._getStrOrFunToStr(null==value?void 0:value(null==(_this_options=this.options)?void 0:_this_options.locale));if("string"==typeof value)return value}},_proto.renderContent=function(html){if(this.$header){var _$content=this.$header.querySelector(".edate-header-view");if(!_$content)return;_$content.innerHTML=html}},_proto.destroy=function(){this.$header&&this.$header.remove()},_proto._eventListeners=function(){var _this=this;_this.$header&&(delegate(_this.$header,".edate-super-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperPrev||_this.options.onSuperPrev.call(_this.options)}),delegate(_this.$header,".edate-prev-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onPrev||_this.options.onPrev.call(_this.options)}),delegate(_this.$header,".edate-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onNext||_this.options.onNext.call(_this.options)}),delegate(_this.$header,".edate-super-next-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||null==_this.options.onSuperNext||_this.options.onSuperNext.call(_this.options)}),delegate(_this.$header,".edate-close-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onClose||_this.options.onClose.call(_this.options),event.stopPropagation(),event.preventDefault())}),delegate(_this.$header,".edate-ok-btn","click",function(event){event.delegateTarget.classList.contains("edate-disabled")||(null==_this.options.onOk||_this.options.onOk.call(_this.options),event.stopPropagation(),event.preventDefault())}))},Header}();function _extends$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$2.apply(this,arguments)}var _CONTAINER_DEFAULT_OPTIONS_={prefixCls:"edate",locales:__$CALENDAR_LOCALES$__,showHeader:!0},Container=function(){function Container(popupContainer,options){this.$panel=document.createElement("div"),this.$body=document.createElement("div"),this.$container=document.createElement("div"),this.language="zh",this.header=null,this.locale=__$CALENDAR_LOCALES$__.zh,this.options=deepmerge.all([{},_CONTAINER_DEFAULT_OPTIONS_,options],{clone:!1}),this.$popupContainer=popupContainer?"function"==typeof popupContainer?popupContainer():popupContainer:document.body,this._setLocale(),this.$container.classList.add("edate-container",(this.options.prefixCls||"edate")+"-container"),options.isMobile&&this.$container.classList.add("edate-mobile",this.options.prefixCls+"-mobile"),this.options.wrapClassName&&this.$container.classList.add(this.options.wrapClassName),this.$panel.classList.add("edate-panel",(this.options.prefixCls||"edate")+"-panel"),this.options.showHeader&&(this.header=new Header(_extends$2({},this.options,{locale:this.locale,onPrev:this._onPrev.bind(this),onNext:this._onNext.bind(this),onSuperPrev:this._onSuperPrev.bind(this),onSuperNext:this._onSuperNext.bind(this),onClose:this._onClose.bind(this),onOk:this._onOk.bind(this)})),this.$panel.appendChild(this.header.$header)),this.$body.classList.add("edate-body",(this.options.prefixCls||"edate")+"-body"),this.$container.appendChild(this.$panel),this.$popupContainer.appendChild(this.$container)}var _proto=Container.prototype;return _proto._setLocale=function(){if(this.options.locales)if("string"==typeof this.options.language){var language=this.options.language||navigator.language;this.options.locales[language]?this.locale=this.options.locales[language]:this.locale=this.options.locales.zh}else this.locale=this.options.locales.zh},_proto.destroy=function(){var _this_$container;(null==(_this_$container=this.$container)?void 0:_this_$container.parentNode)&&this.$container.parentNode.removeChild(this.$container),this.header=null,this.$container=null},_proto.setLocale=function(locale){"string"==typeof locale?this._setLocale():this.locale=locale},_proto._onSuperPrev=function(){},_proto._onSuperNext=function(){},_proto._onPrev=function(){},_proto._onNext=function(){},_proto._onClose=function(){},_proto._onOk=function(){},Container}();function _create_class$3(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var _CALENDAR_DEFAULT_OPTIONS_={startOfWeek:0,showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,showPrevIcon:!0,showNextIcon:!0,language:"zh",renderBadge:'<span class="ecalendar-badge"></span>',badges:[]},Calendar=function(Container){function Calendar(container,options){var _this,_this_options_badges,_this_options,_this_options1,_this_options2;return(_this=Container.call(this,container,_extends$1({},_CALENDAR_DEFAULT_OPTIONS_,options,{prefixCls:"ecalendar"}))||this).badges=[],(null==(_this_options_badges=_this.options.badges)?void 0:_this_options_badges.length)&&_this._updateBadges(_this.options.badges,!1),(null==(_this_options=_this.options)?void 0:_this_options.startOfWeek)&&((null==(_this_options1=_this.options)?void 0:_this_options1.startOfWeek)>6||(null==(_this_options2=_this.options)?void 0:_this_options2.startOfWeek)<0)&&(_this.options.startOfWeek=0),_this._render(),_this.setCurrent(_this.options.current,!1),_this._onHeader(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$3(subClass,superClass)}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=!0),"string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{if(date="string"==typeof date?distExports$1.DateTime.toDate(date):date,(!this._current||distExports$1.DateTime.format(date,"YYYY-MM-DD")!==distExports$1.DateTime.format(this._current,"YYYY-MM-DD"))&&(this._current=date,change&&(null==this.options.onChange||this.options.onChange.call(this.options,date,distExports$1.DateTime.format(date,"YYYY-MM-DD"))),this.$body)){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-cell-selected"))||_this_$body_querySelector.classList.remove("ecalendar-cell-selected");var title=distExports$1.DateTime.format(this._current,"YYYY-MM-DD");null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-cell-in-view[title='"+title+"']"))||_this_$body_querySelector1.classList.add("ecalendar-cell-selected")}this._setRenderCurrent(this._current)}catch(error){this._setRenderCurrent(new Date)}else this._setRenderCurrent(new Date);var left,right},_proto.updateBadges=function(badges){this._updateBadges(badges)},_proto._updateBadges=function(badges,rerender){void 0===rerender&&(rerender=!0),(null==badges?void 0:badges.length)>=0&&(this.badges=badges.map(function(date){return distExports$1.DateTime.format(date,"YYYY-MM-DD")}),rerender&&this._renderDate())},_proto._setRenderCurrent=function(date){(!this._renderCurrent||date&&distExports$1.DateTime.format(this._renderCurrent,"YYYY-MM")!==distExports$1.DateTime.format(date,"YYYY-MM"))&&(this._renderCurrent=date||new Date,this._renderDate())},_proto._onCell=function(){var _this=this;delegate(this.$body,".ecalendar-cell","click",function(event){var date=new Date(event.delegateTarget.getAttribute("title").replace(/\//gi,"/")),disabled=event.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(date),null==_this.options.onCell||_this.options.onCell.call(_this.options,date,distExports$1.DateTime.format(_this._renderCurrent,"YYYY-MM-DD"),disabled),event.stopPropagation(),event.preventDefault()})},_proto._onSuperPrev=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()-1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent)},_proto._onSuperNext=function(){var date=new Date(this._renderCurrent);date.setFullYear(date.getFullYear()+1,date.getMonth(),date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent)},_proto._onPrev=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()-1,date.getDate()),this._setRenderCurrent(date),null==this.options.onPrevMonth||this.options.onPrevMonth.call(this.options,this._current,this._renderCurrent)},_proto._onNext=function(){var date=new Date(this._renderCurrent);date.setMonth(date.getMonth()+1,date.getDate()),this._setRenderCurrent(date),null==this.options.onNextMonth||this.options.onNextMonth.call(this.options,this._current,this._renderCurrent)},_proto._onHeader=function(){var _this=this;delegate(this.$panel,".ecalendar-header-month-btn","click",function(){null==_this.options.onMonth||_this.options.onMonth.call(_this.options,_this._current,_this._renderCurrent)}),delegate(this.$panel,".ecalendar-header-year-btn","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent)})},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._render=function(){var _this_locale,_this_locale1,shiftedCustomDays=[].concat(((null==(_this_locale=this.locale)?void 0:_this_locale.weeks)||[]).slice(this.options.startOfWeek),((null==(_this_locale1=this.locale)?void 0:_this_locale1.weeks)||[]).slice(0,this.options.startOfWeek));this.$body.innerHTML='<table class="ecalendar-content">\n <thead><tr>'+shiftedCustomDays.map(function(day){return"<th>"+day+"</th>"}).join("")+"</tr></thead>\n <tbody></tbody>\n </table>",this.$panel.appendChild(this.$body)},_proto._renderDate=function(){var _this_header,_this_$body_querySelector,_this=this;if(this.$body){var _this_locale_months,_this_locale,_this_locale1,_this_locale2,_this_locale3,_this_locale_months1,_this_locale4,_this_locale5,_this_$body_querySelector1,todayStr=distExports$1.DateTime.format(new Date,"YYYY-MM-DD"),year=this._renderCurrent.getFullYear(),month=this._renderCurrent.getMonth()+1,dayGroupArray=Util.chunkBySize(Util.generateWeeksByYearMonth(year,month,this.options.startOfWeek),7),allowMonthClick="function"==typeof this.options.onMonth,allowYearClick="function"==typeof this.options.onYear;if(null==(_this_header=this.header)?void 0:_this_header.$header)this.header.renderContent("\n "+("zh"!==this.options.language?'<span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale=this.locale)||null==(_this_locale_months=_this_locale.months)?void 0:_this_locale_months[+(month-1)])+((null==(_this_locale1=this.locale)?void 0:_this_locale1.month)||"")+'</span> <span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale2=this.locale)?void 0:_this_locale2.year)||"")+"</span>":'<span class="ecalendar-header-year-btn '+(allowYearClick?"edate-header-title-hover":"")+'">'+year+((null==(_this_locale3=this.locale)?void 0:_this_locale3.year)||"")+'</span> <span class="ecalendar-header-month-btn '+(allowMonthClick?"edate-header-title-hover":"")+'">'+(null==(_this_locale4=this.locale)||null==(_this_locale_months1=_this_locale4.months)?void 0:_this_locale_months1[+(month-1)])+((null==(_this_locale5=this.locale)?void 0:_this_locale5.month)||"")+"</span>"));if(null==(_this_$body_querySelector=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector.querySelector("tbody"))(null==(_this_$body_querySelector1=this.$body.querySelector(".ecalendar-content"))?void 0:_this_$body_querySelector1.querySelector("tbody")).innerHTML="\n "+dayGroupArray.slice(0,7).map(function(dates){return"<tr>\n "+dates.map(function(dateStr){var _this_options,_dateStr_split=dateStr.split("-"),y=_dateStr_split[0],m=_dateStr_split[1],d=_dateStr_split[2],date=new Date(+y,+m,+d),classNames=[month===+m?"ecalendar-cell-in-view":"",todayStr===dateStr?"ecalendar-cell-today":"",_this._current&&distExports$1.DateTime.format(_this._current,"YYYY-MM-DD")===dateStr?"ecalendar-cell-selected":"","function"==typeof(null==(_this_options=_this.options)?void 0:_this_options.disabledDate)&&_this.options.disabledDate(distExports$1.DateTime.toDate(dateStr),dateStr)?"edate-disabled":""].filter(Boolean),badgeHtml=_this._renderBadge(date,dateStr);return'<td title="'+dateStr+'" class="ecalendar-cell '+classNames.join(" ")+'">\n '+("function"==typeof _this.options.renderDate?_this.options.renderDate(date,dateStr):'<span class="ecalendar-cell-inner">'+Util.fillZero(+d)+"</span>")+"\n "+badgeHtml+"\n </td>"}).join("")+"\n </tr>"}).join("")}},_proto._renderBadge=function(date,dateStr){var badgeHtml="";badgeHtml="function"==typeof this.options.renderBadge?this.options.renderBadge(date,dateStr):"string"==typeof this.options.renderBadge?this.options.renderBadge:"";var showBadge="function"==typeof this.options.showBadge&&this.options.showBadge(date,dateStr);return this.badges.includes(dateStr)||showBadge||(badgeHtml=""),badgeHtml},_create_class$3(Calendar,[{key:"current",get:function(){return this._current}}]),Calendar}(Container);function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}Calendar.DateTime=distExports$1.DateTime;var _Month_DEFAULT_OPTIONS_={showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return(_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:!1,showNextIcon:!1,prefixCls:"emonth"}],{clone:!1}))||this)._render(),_this.setCurrent(_this.options.current,!1),_this._onHeaderTitle(),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$2(subClass,superClass)}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){void 0===change&&(change=!0),this._setCurrent(date,change)},_proto._setCurrent=function(date,change){if("string"==typeof date||(left=date,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right))try{var d=date;"string"==typeof d&&(d=distExports$1.DateTime.toDate(d));var current=d;this._current&&distExports$1.DateTime.format(current,"YYYY-MM-DD")===distExports$1.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=current,"function"==typeof this.options.onChange&&change&&(null==this.options.onChange||this.options.onChange.call(this.options,current,distExports$1.DateTime.format(current,"YYYY-MM")))),this._setRenderCurrent(current)}catch(error){this._setRenderCurrent(new Date)}else this._setRenderCurrent(new Date);var left,right},_proto._setRenderCurrent=function(date){if((!this._renderCurrent||this._renderCurrent&&distExports$1.DateTime.format(date,"YYYY")!==distExports$1.DateTime.format(this._renderCurrent,"YYYY"))&&(this._renderCurrent=date,this._renderMonths(date.getFullYear())),this._current){var _this_$body_querySelector,_this_$body_querySelector1;null==(_this_$body_querySelector=this.$body.querySelector(".emonth-cell-selected"))||_this_$body_querySelector.classList.remove("emonth-cell-selected");var selectedTitle=distExports$1.DateTime.format(this._current,"YYYY-MM");null==(_this_$body_querySelector1=this.$body.querySelector(".emonth-cell-in-view[title='"+selectedTitle+"']"))||_this_$body_querySelector1.classList.add("emonth-cell-selected")}this._setHeader()},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._onCell=function(){var _this=this;delegate(this.$body,".emonth-cell","click",function(e){e.stopPropagation(),e.preventDefault();var month=+e.delegateTarget.getAttribute("data-month"),newDate=distExports$1.DateTime.toDate(distExports$1.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setMonth(month-1);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this.setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$1.DateTime.format(newDate,"YYYY-MM"),disabled)})},_proto._onSuperPrev=function(){var year=this._renderCurrent.getFullYear()-1,date=distExports$1.DateTime.toDate(year+distExports$1.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperPrev||this.options.onSuperPrev.call(this.options,this._current,this._renderCurrent)},_proto._onSuperNext=function(){var year=this._renderCurrent.getFullYear()+1,date=distExports$1.DateTime.toDate(year+distExports$1.DateTime.format(this._renderCurrent,"-MM-DDTHH:mm:ss"));this._setRenderCurrent(date),null==this.options.onSuperNext||this.options.onSuperNext.call(this.options,this._current,this._renderCurrent)},_proto._onHeaderTitle=function(){var _this=this;delegate(this.$panel,".edate-header-title-hover","click",function(){null==_this.options.onYear||_this.options.onYear.call(_this.options,_this._current,_this._renderCurrent)})},_proto._setHeader=function(){if(this.$panel.querySelector(".emonth-header-view")){var allowClick="function"==typeof this.options.onYear;this.$panel.querySelector(".emonth-header-view").innerHTML='<span class="'+(allowClick?"edate-header-title-hover":"")+'">'+this._renderCurrent.getFullYear()+this.locale.year+"</span>"}},_proto._setDisabled=function(){for(var year=this._renderCurrent.getFullYear(),i=0;i<12;i++){var $cell=this.$body.querySelector(".emonth-cell[title='"+year+"-"+Util.fillZero(i+1)+"']");if($cell){var date=distExports$1.DateTime.toDate(year+"-"+Util.fillZero(i+1)+"-"+distExports$1.DateTime.format(this._renderCurrent,"DDTHH:mm:ss"));"function"==typeof this.options.disabledMonth&&this.options.disabledMonth(date,distExports$1.DateTime.format(date,"YYYY-MM"))?$cell.classList.add("edate-disabled"):$cell.classList.remove("edate-disabled")}}},_proto._render=function(){this.$body.innerHTML='<table class="emonth-content"></table>',this.$panel.appendChild(this.$body)},_proto._renderMonths=function(year){var _this=this;this.$body.querySelector(".emonth-content")&&(this.$body.querySelector(".emonth-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(this.locale.months,3).slice(0,4).map(function(month,index){return"<tr>\n "+month.map(function(m,i){return'<td title="'+year+"-"+Util.fillZero(3*index+i+1)+'" data-month="'+Util.fillZero(3*index+i+1)+'" class="emonth-cell emonth-cell-in-view">\n <span class="emonth-cell-inner">'+(_this.options.monthRender&&"function"==typeof _this.options.monthRender?_this.options.monthRender(distExports$1.DateTime.toDate(year+"-"+Util.fillZero(3*index+i+1)),year+"-"+Util.fillZero(3*index+i+1))||"":m)+"</span>\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>"),this._setDisabled()},_create_class$2(Month,[{key:"current",get:function(){return this._current}}]),Month}(Container);function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var dist,hasRequiredDist,_YEAR_DEFAULT_OPTIONS_={showHeader:!0,showSuperPrevIcon:!0,showSuperNextIcon:!0,language:"zh",prefixCls:"eyear"},Year=function(Container){function Year(popupContainer,options){var _this;return(_this=Container.call(this,popupContainer,deepmerge.all([{},_YEAR_DEFAULT_OPTIONS_,options||{},{showPrevIcon:!1,showNextIcon:!1,renderPrevIcon:"",renderNextIcon:""}],{clone:!1}))||this)._render(),_this._setCurrent(_this.options.current,!1),_this._onCell(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$1(subClass,superClass)}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){void 0===change&&(change=!0),this._setCurrent(year,change)},_proto._setCurrent=function(year,change){void 0===change&&(change=!0);var left,right,_year="number"==typeof year?distExports$1.DateTime.toDate(year):(left=year,(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?year:new Date);this._current&&distExports$1.DateTime.format(_year,"YYYY-MM-DD")===distExports$1.DateTime.format(this._current,"YYYY-MM-DD")||(this._current=_year,"function"==typeof this.options.onChange&&change&&this.options.onChange(_year)),this._renderTenYear=(this._current||new Date).getFullYear(),this._renderYearList()},_proto._onOk=function(){null==this.options.onOk||this.options.onOk.call(this.options,this.current)},_proto._onClose=function(){null==this.options.onClose||this.options.onClose.call(this.options,this.current)},_proto._onCell=function(){var _this=this;delegate(this.$body,".eyear-cell","click",function(e){var yearStr=+e.delegateTarget.getAttribute("title"),newDate=distExports$1.DateTime.toDate(distExports$1.DateTime.format(_this._current,"yyyy-MM-dd HH:mm:ss"));newDate.setFullYear(yearStr);var disabled=e.delegateTarget.classList.contains("edate-disabled");disabled||_this._setCurrent(newDate),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate,distExports$1.DateTime.format(newDate,"YYYY"),disabled),e.stopPropagation(),e.preventDefault()})},_proto._onSuperPrev=function(){this._renderTenYear=this._renderTenYear-10,null==this.options.onPrevYear||this.options.onPrevYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList()},_proto._onSuperNext=function(){this._renderTenYear=this._renderTenYear+10,null==this.options.onNextYear||this.options.onNextYear.call(this.options,this._current,Util.generateYears(this._renderTenYear)),this._renderYearList()},_proto._render=function(){this.$body.innerHTML='<table class="eyear-content"></table>',this.$panel.appendChild(this.$body)},_proto._renderYearList=function(){var _this_header,_this=this,list=Util.generateYears(this._renderTenYear);null==(_this_header=this.header)||_this_header.renderContent(list[1]+" - "+list[list.length-2]),this.$body.querySelector(".eyear-content")&&(this.$body.querySelector(".eyear-content").innerHTML="\n <tbody>\n "+Util.chunkBySize(list,3).slice(0,4).map(function(years,i){return"<tr>\n "+years.map(function(y,j){var classNames=0===i&&0===j||3===i&&2===j?"eyear-cell":"eyear-cell eyear-cell-in-view";return+y===+_this._current.getFullYear()&&(classNames+=" eyear-cell-selected"),"function"==typeof _this.options.disabledYear&&_this.options.disabledYear(distExports$1.DateTime.toDate(y),y)&&(classNames+=" edate-disabled"),'<td title="'+y+'" class="'+classNames+'">\n '+(_this.options.yearRender&&"function"==typeof _this.options.yearRender?_this.options.yearRender(distExports$1.DateTime.toDate(y),y):'<span class="eyear-cell-inner">'+ +y+"</span>")+"\n </td>"}).join("")+"\n </tr>"}).join("")+"\n </tbody>\n ")},_create_class$1(Year,[{key:"current",get:function(){return this._current}}]),Year}(Container);var distExports=function(){if(hasRequiredDist)return dist;function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}hasRequiredDist=1;var pickerProvider=function(){function PickerProvider(){this.pickers=[]}var _proto=PickerProvider.prototype;return _proto.add=function(picker){this.pickers.push(picker)},_proto.remove=function(picker){var index=this.pickers.indexOf(picker);index>-1&&this.pickers.splice(index,1)},_proto.closeOther=function(e){for(var _step,_iterator=_create_for_of_iterator_helper_loose(this.pickers);!(_step=_iterator()).done;){var _p_$container_contains,_p_$container,_p_$wrapperContent_contains,_p_$wrapperContent,p=_step.value;!p||e.target===p.$container||(null==(_p_$container=p.$container)||null==(_p_$container_contains=_p_$container.contains)?void 0:_p_$container_contains.call(_p_$container,e.target))||e.target===p.$wrapperContent||(null==(_p_$wrapperContent=p.$wrapperContent)||null==(_p_$wrapperContent_contains=_p_$wrapperContent.contains)?void 0:_p_$wrapperContent_contains.call(_p_$wrapperContent,e.target))||(p.open=!1)}},PickerProvider.getInstance=function(){return PickerProvider.instance||(PickerProvider.instance=new PickerProvider),PickerProvider.instance},PickerProvider}().getInstance();function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}var _$PICKER_PLACEMENT$_=["top","tl","tr","bottom","bl","br"],__$PICKER_DEFAULT_OPTIONS$__={getPopupContainer:function(){return document.body},wrapClassName:"",open:!1,placement:"br",offset:[0,0],zIndex:1e3,content:"",trigger:"click",mouseLeaveDelay:.1,mouseEnterDelay:.1,isMobile:!1,triggerClose:!1},Picker=function(){function Picker(container,options){var _this__$popupContainer,_this__$popupContainer1;this._open=!1,this._OpenChange=!1,this._animationTimer=null,this._disabled=!1,this._timer=null,this._options=Object.assign({},__$PICKER_DEFAULT_OPTIONS$__,options||{}),this._options.isMobile&&(this._options.trigger="click"),pickerProvider.add(this),this.$container="function"==typeof container?container():container,this.$wrapperContent=document.createElement("div"),this._initContentStyle(),"function"==typeof this._options.getPopupContainer?this._$popupContainer=this._options.getPopupContainer():this._$popupContainer=document.body,["INPUT","CANVAS","VIDEO","IMG"].includes(null==(_this__$popupContainer=this._$popupContainer)?void 0:_this__$popupContainer.tagName)&&(this._$popupContainer=document.body),this._$popupContainer!==document.body&&(this._$popupContainer.style.position="relative"),null==(_this__$popupContainer1=this._$popupContainer)||_this__$popupContainer1.appendChild(this.$wrapperContent),this._onContentClick=this._onContentClick.bind(this),this._onShow=this._onShow.bind(this),this._onContainerClick=this._onContainerClick.bind(this),this._onWrapperShow=this._onWrapperShow.bind(this),this._onHide=this._onHide.bind(this),this._onDocumentClick=this._onDocumentClick.bind(this),this._eventListener(),this.open=!!this._options.open}var _proto=Picker.prototype;return _proto.setPlacement=function(placement){this._disabled||(_$PICKER_PLACEMENT$_.includes(placement)&&(this._options.placement=placement),this._setPlacement())},_proto.destroy=function(){this._animationTimerClear(),this._removeHtml(),pickerProvider.remove(this)},_proto.innerHTML=function(html){this.$body&&(this.$body.innerHTML=html||"",this._setPlacement())},_proto._onOpenChange=function(open){null==this._options.onOpenChange||this._options.onOpenChange.call(this._options,!!open)},_proto._animationTimerClear=function(){this._animationTimer&&(clearTimeout(this._animationTimer),this._animationTimer=null)},_proto._removeHtml=function(){var _this_$wrapperContent,_this_$container_removeEventListener,_this_$container,_this_$container_removeEventListener1,_this_$container1,_this_$container_removeEventListener2,_this_$container2,_this_$container_removeEventListener3,_this_$container3,_this_$container_removeEventListener4,_this_$container4,_this_$wrapperContent1,_this_$wrapperContent2;(null==(_this_$wrapperContent=this.$wrapperContent)||_this_$wrapperContent.removeEventListener("click",this._onContentClick),null==(_this_$container=this.$container)||null==(_this_$container_removeEventListener=_this_$container.removeEventListener)||_this_$container_removeEventListener.call(_this_$container,"click",this._onContentClick),"click"===this._options.trigger&&(null==(_this_$container1=this.$container)||null==(_this_$container_removeEventListener1=_this_$container1.removeEventListener)||_this_$container_removeEventListener1.call(_this_$container1,"click",this._onContainerClick)),"hover"===this._options.trigger)&&(null==(_this_$container2=this.$container)||null==(_this_$container_removeEventListener2=_this_$container2.removeEventListener)||_this_$container_removeEventListener2.call(_this_$container2,"mouseenter",this._onShow),null==(_this_$container3=this.$container)||null==(_this_$container_removeEventListener3=_this_$container3.removeEventListener)||_this_$container_removeEventListener3.call(_this_$container3,"mouseover",this._onShow),null==(_this_$container4=this.$container)||null==(_this_$container_removeEventListener4=_this_$container4.removeEventListener)||_this_$container_removeEventListener4.call(_this_$container4,"mouseleave",this._onHide),null==(_this_$wrapperContent1=this.$wrapperContent)||_this_$wrapperContent1.removeEventListener("mouseenter",this._onWrapperShow),null==(_this_$wrapperContent2=this.$wrapperContent)||_this_$wrapperContent2.removeEventListener("mouseleave",this._onHide));this._options.isMobile||(window.removeEventListener("blur",this._onHide),document.removeEventListener("visibilitychange",this._onHide),window.removeEventListener("resize",this._onHide),document.removeEventListener("click",this._onDocumentClick)),this._$mask&&(this._$mask.removeEventListener("click",this._onHide),this._$mask.remove(),this._$mask=null),this._options.isMobile&&document.body.classList.remove("epicker-body-noscroll"),this.$wrapperContent&&(this.$wrapperContent.remove(),this.$wrapperContent=null)},_proto._setPlacement=function(){var _this_$container_getBoundingClientRect,_this_$container;if(this._open&&!this._options.isMobile&&this.$container){var right,$containerRect=null==(_this_$container=this.$container)||null==(_this_$container_getBoundingClientRect=_this_$container.getBoundingClientRect)?void 0:_this_$container_getBoundingClientRect.call(_this_$container),$wrapperContentRect=this.$wrapperContent.getBoundingClientRect(),$popupContainerRect=this._$popupContainer.getBoundingClientRect(),containerLeft=Math.ceil($containerRect.left)-Math.ceil($popupContainerRect.left),containerRight=-(Math.ceil($containerRect.right)-Math.ceil($popupContainerRect.right)),containerTop=Math.ceil($containerRect.y)-Math.ceil($popupContainerRect.y),left=containerLeft+(Math.ceil($containerRect.width)-Math.ceil($wrapperContentRect.width))/2,top=containerTop-Math.ceil($wrapperContentRect.height),bottom=containerTop+Math.ceil($containerRect.height);if(/^t/.test(this._options.placement)){var _this__options_offset,_this__options_offset1,_this__options_offset2;switch(this._options.placement){case"top":right=void 0;break;case"tl":right=void 0,left=containerLeft;break;case"tr":left=void 0,right=containerRight}this.$wrapperContent.style.cssText+="\n "+(void 0!==right?"right: "+(right+((null==(_this__options_offset=this._options.offset)?void 0:_this__options_offset[0])||0))+"px;":"")+"\n "+(void 0!==left?"left: "+(left+((null==(_this__options_offset1=this._options.offset)?void 0:_this__options_offset1[0])||0))+"px;":"")+"\n top: "+(top+((null==(_this__options_offset2=this._options.offset)?void 0:_this__options_offset2[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n "}else if(/^b/.test(this._options.placement)){var _this__options_offset3,_this__options_offset4,_this__options_offset5;switch(this._options.placement){case"bottom":right=void 0;break;case"bl":right=void 0,left=containerLeft;break;case"br":left=void 0,right=containerRight}this.$wrapperContent&&(this.$wrapperContent.style.cssText+="\n "+(void 0!==right?"right: "+(right+((null==(_this__options_offset3=this._options.offset)?void 0:_this__options_offset3[0])||0))+"px;":"")+"\n "+(void 0!==left?"left: "+(left+((null==(_this__options_offset4=this._options.offset)?void 0:_this__options_offset4[0])||0))+"px;":"")+"\n top: "+(bottom+((null==(_this__options_offset5=this._options.offset)?void 0:_this__options_offset5[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n ")}}},_proto._initContentStyle=function(){if(this.$wrapperContent&&(this.$wrapperContent.classList.add("epicker","epicker-wrapper","epicker-"+this._options.placement),this.$wrapperContent.style.display="none",this._options.isMobile&&(this.$wrapperContent.classList.add("epicker-mobile"),this._$mask=document.createElement("div"),this._$mask.classList.add("epicker-mask"),this.$wrapperContent.appendChild(this._$mask)),this.$body=document.createElement("div"),this.$body.classList.add("epicker-body"),this.$wrapperContent.appendChild(this.$body),"string"==typeof this._options.content?this.innerHTML(this._options.content):"function"==typeof this._options.content&&this.innerHTML(null==this._options.content?void 0:this._options.content.call(this._options)),"string"==typeof this._options.wrapClassName))try{var _this_$wrapperContent_classList,_this_$wrapperContent;null==(_this_$wrapperContent=this.$wrapperContent)||(_this_$wrapperContent_classList=_this_$wrapperContent.classList).add.apply(_this_$wrapperContent_classList,[].concat(this._options.wrapClassName.split(" ")))}catch(_error){}},_proto._eventListener=function(){var _this_$container_addEventListener,_this_$container,_this_$container_addEventListener1,_this_$container1,_this_$container_addEventListener2,_this_$container2,_this_$container_addEventListener3,_this_$container3,_this_$container_addEventListener4,_this_$container4;(this.$wrapperContent.addEventListener("click",this._onContentClick),null==(_this_$container=this.$container)||null==(_this_$container_addEventListener=_this_$container.addEventListener)||_this_$container_addEventListener.call(_this_$container,"click",this._onContentClick),"click"===this._options.trigger&&(null==(_this_$container1=this.$container)||null==(_this_$container_addEventListener1=_this_$container1.addEventListener)||_this_$container_addEventListener1.call(_this_$container1,"click",this._onContainerClick)),"hover"===this._options.trigger)&&(null==(_this_$container2=this.$container)||null==(_this_$container_addEventListener2=_this_$container2.addEventListener)||_this_$container_addEventListener2.call(_this_$container2,"mouseenter",this._onShow),null==(_this_$container3=this.$container)||null==(_this_$container_addEventListener3=_this_$container3.addEventListener)||_this_$container_addEventListener3.call(_this_$container3,"mouseover",this._onShow),null==(_this_$container4=this.$container)||null==(_this_$container_addEventListener4=_this_$container4.addEventListener)||_this_$container_addEventListener4.call(_this_$container4,"mouseleave",this._onHide),this.$wrapperContent.addEventListener("mouseenter",this._onWrapperShow),this.$wrapperContent.addEventListener("mouseleave",this._onHide));this._$mask&&this._$mask.addEventListener("click",this._onHide),this._options.isMobile||(window.addEventListener("blur",this._onHide),document.addEventListener("visibilitychange",this._onHide),window.addEventListener("resize",this._onHide),document.addEventListener("click",this._onDocumentClick))},_proto._onContentClick=function(e){pickerProvider.closeOther(e)},_proto._onContainerClick=function(event){var _this_$wrapperContent_contains,_this_$wrapperContent;if(!this._disabled){var contain=(null==(_this_$wrapperContent=this.$wrapperContent)||null==(_this_$wrapperContent_contains=_this_$wrapperContent.contains)?void 0:_this_$wrapperContent_contains.call(_this_$wrapperContent,event.target))||this.$wrapperContent===event.target;this._options.triggerClose&&"click"===this._options.trigger&&!contain?this.open=!this.open:this.open=!0}},_proto._onShow=function(){this._disabled||(this.open=!0)},_proto._onWrapperShow=function(){this._disabled||this._onShow()},_proto._onHide=function(e){this._open&&!this._disabled&&((null==e?void 0:e.target)===this._$mask&&(null==e||e.stopPropagation()),this.open=!1)},_proto._onDocumentClick=function(event){var _this_$container;if(!this.$wrapperContent.contains(event.target)&&this.$wrapperContent!==event.target&&!(null==(_this_$container=this.$container)?void 0:_this_$container.contains(event.target))&&this.$container!==event.target){if(this._disabled)return;this._onHide()}},_create_class(Picker,[{key:"open",get:function(){return this._open},set:function(open){var _this=this;this._disabled||this._open!==!!open&&(this._animationTimerClear(),this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer=open?setTimeout(function(){_this.$wrapperContent&&(_this.$wrapperContent.style.display="inline-flex",_this.$wrapperContent.style.pointerEvents="",_this._options.isMobile&&document.body.classList.add("epicker-body-noscroll"),_this._animationTimer=setTimeout(function(){_this._animationTimerClear(),_this.$wrapperContent.style.opacity="1"},0),requestAnimationFrame(function(){_this._setPlacement()}),_this._OpenChange=open,_this._onOpenChange(open))},1e3*(this._options.mouseEnterDelay<0?0:this._options.mouseEnterDelay)):setTimeout(function(){_this.$wrapperContent&&(_this.$wrapperContent.style.opacity="0",_this.$wrapperContent.style.pointerEvents="none",_this._options.isMobile&&document.body.classList.remove("epicker-body-noscroll"),_this._animationTimer=setTimeout(function(){_this._animationTimerClear(),_this.$wrapperContent.style.display="none"},301),_this._OpenChange=open,_this._onOpenChange(open))},1e3*(this._options.mouseLeaveDelay<0?0:this._options.mouseLeaveDelay)),this._OpenChange===open&&this._timer&&(clearTimeout(this._timer),this._timer=null),this._open=!!open)}},{key:"disabled",get:function(){return this._disabled},set:function(disabled){var _this_$container_classList_add,_this_$container_classList,_this_$container,_this_$container_classList_remove,_this_$container_classList1,_this_$container1;disabled?null==(_this_$container=this.$container)||null==(_this_$container_classList=_this_$container.classList)||null==(_this_$container_classList_add=_this_$container_classList.add)||_this_$container_classList_add.call(_this_$container_classList,"epicker-disabled"):null==(_this_$container1=this.$container)||null==(_this_$container_classList1=_this_$container1.classList)||null==(_this_$container_classList_remove=_this_$container_classList1.remove)||_this_$container_classList_remove.call(_this_$container_classList1,"epicker-disabled");this._disabled=disabled}}]),Picker}();return Picker.VERSION="1.1.7",dist=Picker}(),Picker=getDefaultExportFromCjs(distExports);function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _DATEPICKER_MODE_ARRAY=["date","month","year"],_DATEPICKER_DEFAULT_OPTIONS_={getPopupContainer:function(){return document.body},language:"zh",isMobile:!1,mode:_DATEPICKER_MODE_ARRAY[0]},DatePicker=function(Picker){function DatePicker(container,options){var _this;return(_this=Picker.call(this,container,deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{},{wrapClassName:("edate-picker-container "+((null==options?void 0:options.wrapClassName)||"")).trim()}],{clone:!1}))||this).current=null,_this._current=null,_this._calendar=null,_this._month=null,_this._year=null,_this._currentMode="date",_this.options=deepmerge.all([{},_DATEPICKER_DEFAULT_OPTIONS_,options||{}],{clone:!1}),_this.options.current&&(_this.current=_this.options.current,_this._current=_this.options.current),_this._currentMode=_this.options.mode,_this._switchMode(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){void 0===change&&(change=!0),this._setCurrent(date,change)},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)>=0&&(null==(_this__calendar=this._calendar)||_this__calendar.updateBadges(badges))},_proto.destroy=function(){var _this__calendar,_this__month,_this__year;null==(_this__calendar=this._calendar)||_this__calendar.destroy(),this._calendar=null,null==(_this__month=this._month)||_this__month.destroy(),this._month=null,null==(_this__year=this._year)||_this__year.destroy(),this._year=null,Picker.prototype.destroy.call(this)},_proto._setCurrent=function(date,change){var _this__calendar,_this__month,_this__year;void 0===change&&(change=!0),this._current=date,null==(_this__calendar=this._calendar)||_this__calendar.setCurrent(date,change),null==(_this__month=this._month)||_this__month.setCurrent(date,change),null==(_this__year=this._year)||_this__year.setCurrent(date,change)},_proto._switchMode=function(){this.$body.classList.add("edate-picker-"+this._currentMode),"date"===this._currentMode?this._initCalendar():"month"===this._currentMode?this._initMonth():"year"===this._currentMode&&this._initYear(),this.setPlacement(this.options.placement||"top")},_proto.hide=function(){this.open=!1},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode(),this._setCurrent(this.current,!1)),open||null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode)},_proto._initCalendar=function(){var _this=this;this._calendar||(this._calendar=new Calendar(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),onMonth:this._onMonth.bind(this),onYear:this._onYear.bind(this),onChange:function(date){var _this__calendar;_this._current&&distExports$1.DateTime.format(_this._current,"YYYY-MM-DD")===distExports$1.DateTime.format(date,"YYYY-MM-DD")||_this._onChange(date,null==(_this__calendar=_this._calendar)?void 0:_this__calendar.options.showHeaderOk)}})))},_proto._initMonth=function(){var _this=this;this._month||(this._month=new Month(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__month;_this._current&&distExports$1.DateTime.format(_this._current,"YYYY-MM")===distExports$1.DateTime.format(date,"YYYY-MM")||_this._onChange(date,null==(_this__month=_this._month)?void 0:_this__month.options.showHeaderOk)},onYear:this._onYear.bind(this)})))},_proto._initYear=function(){var _this=this;this._year||(this._year=new Year(this.$body,_extends({},this.options,{current:this._current||new Date,onCell:this._onCell.bind(this),onOk:this._onOk.bind(this),onClose:this._onClose.bind(this),showHeaderOk:this.options.isMobile,showHeaderClose:this.options.isMobile,onChange:function(date){var _this__year;_this._current&&distExports$1.DateTime.format(_this._current,"YYYY")===distExports$1.DateTime.format(date,"YYYY")||_this._onChange(date,null==(_this__year=_this._year)?void 0:_this__year.options.showHeaderOk)}})))},_proto._onOk=function(date){this.current=date||this._current,this._setCurrent(date||this._current),null==this.options.onOk||this.options.onOk.call(this.options,this.current,this._currentMode),this.hide()},_proto._onClose=function(){this.hide()},_proto._onChange=function(date,_showHeaderOk){this._setCurrent(date,!0)},_proto._onCell=function(date,_renderDate,disabled){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode),this.options.isMobile||this._currentMode!==this.options.mode||disabled||this._current&&distExports$1.DateTime.format(date,"YYYY-MM-DD")!==distExports$1.DateTime.format(this._current,"YYYY-MM-DD")||(this.current=date,null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode)),disabled||this._prvMode()},_proto._prvMode=function(){this._currentMode!==this.options.mode||this.options.isMobile||this.hide();var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);index>=1&&(index--,this._removeCurrentTypeClass(),this._currentMode=_DATEPICKER_MODE_ARRAY[index],this._switchMode())},_proto._onYear=function(){this._removeCurrentTypeClass(),this._currentMode="year",this._switchMode()},_proto._onMonth=function(){this._removeCurrentTypeClass(),this._currentMode="month",this._switchMode()},_proto._removeCurrentTypeClass=function(){this.$body.classList.remove("edate-picker-"+this._currentMode)},_create_class(DatePicker,[{key:"_minModeIndex",get:function(){return _DATEPICKER_MODE_ARRAY.indexOf(this.options.mode)}}]),DatePicker}(Picker);exports.Calendar=Calendar,exports.DatePicker=DatePicker,exports.Month=Month,exports.Year=Year});
@@ -0,0 +1,138 @@
1
+ @use '../style/_style.scss' as common;
2
+ @use '~@skax/picker/dist/style/_style.scss' as picker;
3
+
4
+ .#{common.$ecalendar-prefix-cls} {
5
+ line-height: normal;
6
+ cursor: unset;
7
+ box-sizing: border-box;
8
+ padding-left: 0;
9
+ margin: 0;
10
+ text-align: left;
11
+
12
+ &-panel {
13
+ display: flex;
14
+ flex-direction: column;
15
+ border: 1px solid var(--edate-border-color, rgba(5, 5, 5, 0.06));
16
+ width: 100%;
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ // ---------------------------- start body ---------------------------------
21
+ &-body {
22
+ flex: 1 1 auto;
23
+ padding: 6px 10px;
24
+ color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ &-content {
29
+ width: 100%;
30
+ box-sizing: border-box;
31
+
32
+ th {
33
+ height: 30px;
34
+ }
35
+
36
+ tr td {
37
+ padding: 3px 0px;
38
+ &::before {
39
+ content: '';
40
+ display: block;
41
+ position: absolute;
42
+ height: var(--edate-calendar-cell-height, 24px);
43
+ width: 100%;
44
+ }
45
+ }
46
+ }
47
+
48
+ &-cell {
49
+ position: relative;
50
+ padding: 0px 0;
51
+ cursor: pointer;
52
+ text-align: center;
53
+ color: rgba(0, 0, 0, 0.25);
54
+ box-sizing: border-box;
55
+
56
+ &:not(.#{common.$disabled}):hover &-inner {
57
+ background-color: var(--edate-hover-bg-color, rgba(0, 0, 0, 0.04));
58
+ }
59
+
60
+ &-in-view {
61
+ color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
62
+
63
+ &.#{common.$ecalendar-prefix-cls}-cell-selected:not(.#{common.$disabled}) {
64
+ .#{common.$ecalendar-prefix-cls}-cell-inner {
65
+ background-color: var(--edate-primary-color, #1677ff) !important;
66
+ color: #fff;
67
+ }
68
+
69
+ .#{common.$ecalendar-prefix-cls}-badge {
70
+ background-color: #fff;
71
+ }
72
+ }
73
+
74
+ &.#{common.$ecalendar-prefix-cls}-cell-selected.#{common.$disabled} {
75
+ .#{common.$ecalendar-prefix-cls}-cell-inner {
76
+ background-color: var(--edate-disabled-bg-color, rgba(0, 0, 0, 0.25));
77
+ }
78
+ }
79
+
80
+ &.#{common.$ecalendar-prefix-cls}-cell-today .#{common.$ecalendar-prefix-cls}-cell-inner {
81
+ border-color: var(--edate-primary-color, #1677ff);
82
+ }
83
+
84
+ &.#{common.$ecalendar-prefix-cls}-cell-today.#{common.$disabled} .#{common.$ecalendar-prefix-cls}-cell-inner {
85
+ border-color: var(--edate-disabled-bg-color, rgba(0, 0, 0, 0.25));
86
+ }
87
+ }
88
+
89
+ &-inner {
90
+ position: relative;
91
+ z-index: 2;
92
+ padding: 0;
93
+ line-height: var(--edate-calendar-cell-height, 26px);
94
+ display: inline-flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ border-radius: var(--edate-calendar-border-radius, 2px);
98
+ border: 1px solid transparent;
99
+ inset-inline-end: 0;
100
+ inset-inline-start: 0;
101
+ width: var(--edate-calendar-cell-width, 26px);
102
+ height: var(--edate-calendar-cell-height, 26px);
103
+ transition:
104
+ background 0.2s,
105
+ border 0.2s;
106
+ }
107
+
108
+ .#{common.$ecalendar-prefix-cls}-badge {
109
+ position: absolute;
110
+ width: 3px;
111
+ height: 3px;
112
+ border-radius: 50%;
113
+ background-color: var(--edate-primary-color, #1677ff);
114
+ top: 50%;
115
+ left: 50%;
116
+ z-index: 3;
117
+ transform: translateX(-50%) translateY(8px);
118
+ }
119
+
120
+ &.#{common.$disabled} {
121
+ .#{common.$ecalendar-prefix-cls}-badge {
122
+ background-color: var(--edate-disabled-color, rgba(0, 0, 0, 0.25));
123
+ }
124
+ }
125
+ }
126
+
127
+ // ------------------------- end body -----------------------
128
+ }
129
+
130
+ .epicker-mobile {
131
+ .#{common.$ecalendar-prefix-cls} {
132
+ &-content {
133
+ tr td {
134
+ padding: 8px 0px;
135
+ }
136
+ }
137
+ }
138
+ }
@@ -0,0 +1,321 @@
1
+ @use '../style/_style.scss' as common;
2
+ @use '~@skax/picker/dist/style/_style.scss' as picker;
3
+
4
+ .epicker-mobile .edate-mobile {
5
+ --edate-hover-bg-color: transparent; // 移动端不需要hover 背景 不然有问题
6
+ }
7
+
8
+ // edate
9
+ .#{common.$edate-prefix-cls} {
10
+ &-container {
11
+ font-size: 14px;
12
+ display: flex;
13
+ background-color: #fff;
14
+ width: 100%;
15
+ box-sizing: border-box;
16
+ text-align: center;
17
+ max-height: 80%;
18
+ min-width: 246px;
19
+
20
+ & * {
21
+ margin: 0;
22
+ padding: 0;
23
+ box-sizing: border-box;
24
+ border: none;
25
+ outline: none;
26
+ -webkit-tap-highlight-color: transparent;
27
+ }
28
+
29
+ & ul,
30
+ & li {
31
+ list-style: none;
32
+ margin: 0;
33
+ border: 0;
34
+ padding: 0;
35
+ box-sizing: border-box;
36
+ user-select: none;
37
+ }
38
+
39
+ table,
40
+ thead,
41
+ tbody,
42
+ th,
43
+ tr,
44
+ td {
45
+ border: 0;
46
+ box-sizing: border-box;
47
+ margin: 0;
48
+ padding: 0;
49
+ user-select: none;
50
+ border-spacing: 0px;
51
+ border-color: transparent;
52
+
53
+ &:active,
54
+ &:focus,
55
+ &:focus-visible {
56
+ background-color: transparent;
57
+ }
58
+ }
59
+
60
+ table {
61
+ height: 100%;
62
+ }
63
+ }
64
+
65
+ &-panel {
66
+ display: flex;
67
+ flex-direction: column;
68
+ width: 100%;
69
+ }
70
+
71
+ &-header {
72
+ height: var(--edate-header-height, 34px);
73
+ line-height: var(--edate-header-height, 34px);
74
+ color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
75
+ font-weight: 600;
76
+ display: flex;
77
+ align-items: center;
78
+ justify-content: space-between;
79
+ box-sizing: border-box;
80
+ border-bottom: 1px solid var(--edate-border-color, rgba(5, 5, 5, 0.06));
81
+ user-select: none;
82
+ padding: 2px 15px;
83
+
84
+ &-view {
85
+ text-align: center;
86
+ width: 40%;
87
+ }
88
+
89
+ &-title-hover {
90
+ cursor: pointer;
91
+ transition: color 0.2s ease-in-out;
92
+ &:hover {
93
+ color: var(--edate-primary-color, #1677ff);
94
+ }
95
+ }
96
+ }
97
+
98
+ &-prev-btns,
99
+ &-next-btns {
100
+ display: inline-flex;
101
+ height: var(--edate-header-height, 34px);
102
+ line-height: var(--edate-header-height, 34px);
103
+ }
104
+
105
+ &-super-prev-btn,
106
+ &-prev-btn,
107
+ &-super-next-btn,
108
+ &-next-btn {
109
+ min-width: 1.6em;
110
+ font-size: var(--edate-font-size, 14px);
111
+ padding: 0;
112
+ color: var(--edate-arrow-color, rgba(0, 0, 0, 0.45));
113
+ line-height: var(--edate-header-height, 34px);
114
+ background: 0 0;
115
+ border: 0;
116
+ cursor: pointer;
117
+ transition: color 0.2s;
118
+ box-sizing: border-box;
119
+ display: inline-flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ height: 100%;
123
+
124
+ &:not(.#{common.$edate-prefix-cls}-disabled):active {
125
+ color: var(--edate-arrow-hover-color, rgba(0, 0, 0, 0.88));
126
+ }
127
+ }
128
+
129
+ $icon-width: 6px;
130
+
131
+ &-super-prev-icon,
132
+ &-prev-icon,
133
+ &-super-next-icon,
134
+ &-next-icon {
135
+ position: relative;
136
+ display: inline-flex;
137
+ width: $icon-width;
138
+ height: $icon-width;
139
+ transform: rotate(-45deg);
140
+ user-select: none;
141
+
142
+ &::before {
143
+ position: absolute;
144
+ top: 0;
145
+ inset-inline-start: 0;
146
+ display: inline-block;
147
+ width: $icon-width;
148
+ height: $icon-width;
149
+ border: 0 solid currentcolor;
150
+ border-block-start-width: 1.5px;
151
+ border-block-end-width: 0;
152
+ border-inline-start-width: 1.5px;
153
+ border-inline-end-width: 0;
154
+ content: '';
155
+ }
156
+ }
157
+
158
+ &-super-prev-icon::after,
159
+ &-super-next-icon::after {
160
+ position: absolute;
161
+ display: inline-block;
162
+ width: $icon-width;
163
+ height: $icon-width;
164
+ border: 0 solid currentcolor;
165
+ border-block-start-width: 1.5px;
166
+ border-block-end-width: 0;
167
+ border-inline-start-width: 1.5px;
168
+ border-inline-end-width: 0;
169
+ content: '';
170
+ top: -4px;
171
+ left: -4px;
172
+ }
173
+
174
+ &-super-next-icon,
175
+ &-next-icon {
176
+ transform: rotate(135deg);
177
+ }
178
+
179
+ &-footer {
180
+ box-sizing: border-box;
181
+ display: flex;
182
+ align-items: center;
183
+ justify-content: space-between;
184
+ padding: 4px 5px;
185
+ height: var(--edate-footer-height, 34px);
186
+ border-left: 1px solid var(--edate-border-color, rgba(5, 5, 5, 0.06));
187
+ border-right: 1px solid var(--edate-border-color, rgba(5, 5, 5, 0.06));
188
+ border-bottom: 1px solid var(--edate-border-color, rgba(5, 5, 5, 0.06));
189
+ }
190
+
191
+ &-today,
192
+ &-now,
193
+ &-btn-text {
194
+ cursor: pointer;
195
+ color: var(--edate-primary-color, #1677ff);
196
+ user-select: none;
197
+
198
+ &:not(.#{common.$disabled}):active {
199
+ opacity: 0.75;
200
+ }
201
+ }
202
+
203
+ &-close-btn {
204
+ font-size: 24px;
205
+ cursor: pointer;
206
+ display: inline-flex;
207
+ align-items: center;
208
+
209
+ .#{common.$edate-prefix-cls}-close-icon {
210
+ display: inline-flex;
211
+ }
212
+
213
+ &:active {
214
+ color: var(--edate-close-color, rgba(240, 87, 87, 1));
215
+ }
216
+ }
217
+
218
+ &-btn-text {
219
+ padding: 2px 4px;
220
+ &.#{common.$edate-prefix-cls}-disabled {
221
+ color: var(--edate-disabled-color, rgba(0, 0, 0, 0.25)) !important;
222
+ }
223
+ }
224
+
225
+ &-btn {
226
+ outline: none;
227
+ position: relative;
228
+ display: inline-block;
229
+ font-weight: 400;
230
+ white-space: nowrap;
231
+ text-align: center;
232
+ background-image: none;
233
+ background: transparent;
234
+ border: 1px solid #d9d9d9;
235
+ cursor: pointer;
236
+ transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
237
+ user-select: none;
238
+ touch-action: manipulation;
239
+ color: var(--edate-primary-color, #1677ff);
240
+ border-radius: 2px;
241
+ padding: 0px 4px;
242
+ height: 20px;
243
+ line-height: 19px;
244
+ user-select: none;
245
+ min-width: 32px;
246
+
247
+ &.#{common.$edate-prefix-cls}-disabled {
248
+ background-color: var(--edate-disabled-bg-color, rgba(0, 0, 0, 0.04)) !important ;
249
+ color: var(--edate-disabled-color, rgba(0, 0, 0, 0.25)) !important;
250
+ cursor: not-allowed !important;
251
+ border-color: var(--edate-disabled-color, rgba(0, 0, 0, 0.25)) !important;
252
+ }
253
+ }
254
+
255
+ &-btn-primary {
256
+ border-color: var(--edate-primary-color, #1677ff);
257
+ color: #fff;
258
+ background-color: var(--edate-primary-color, #1677ff);
259
+
260
+ &:not(.#{common.$disabled}):active {
261
+ opacity: 0.75;
262
+ }
263
+ }
264
+
265
+ &-disabled {
266
+ cursor: not-allowed !important;
267
+
268
+ &::before {
269
+ background-color: var(--edate-disabled-bg-color, rgba(0, 0, 0, 0.04)) !important ;
270
+ color: var(--edate-disabled-color, rgba(0, 0, 0, 0.25)) !important;
271
+ cursor: not-allowed !important;
272
+ }
273
+
274
+ & > * {
275
+ color: var(--edate-disabled-color, rgba(0, 0, 0, 0.25)) !important;
276
+ cursor: not-allowed !important;
277
+ }
278
+ }
279
+ }
280
+
281
+ .#{common.$edate-prefix-cls}-picker-date {
282
+ .#{common.$emonth-prefix-cls}-container,
283
+ .#{common.$eyear-prefix-cls}-container {
284
+ display: none;
285
+ }
286
+ }
287
+
288
+ .#{common.$edate-prefix-cls}-picker-month {
289
+ .#{common.$ecalendar-prefix-cls}-container,
290
+ .#{common.$eyear-prefix-cls}-container {
291
+ display: none;
292
+ }
293
+ }
294
+
295
+ .#{common.$edate-prefix-cls}-picker-year {
296
+ .#{common.$emonth-prefix-cls}-container,
297
+ .#{common.$ecalendar-prefix-cls}-container {
298
+ display: none;
299
+ }
300
+ }
301
+
302
+ // picker-mobile
303
+ .#{picker.$picker-prefix}-mobile.#{common.$edate-prefix-cls}-picker-container {
304
+ border-radius: 10px;
305
+ overflow: hidden;
306
+ .#{picker.$picker-prefix}-body {
307
+ border-top-left-radius: 10px;
308
+ border-top-right-radius: 10px;
309
+ padding-bottom: 15px;
310
+ background-color: #fff;
311
+ overflow: hidden;
312
+
313
+ .#{common.$edate-prefix-cls}-panel {
314
+ border: none;
315
+ }
316
+ .#{common.$edate-prefix-cls}-header {
317
+ height: 44px;
318
+ border-bottom: none;
319
+ }
320
+ }
321
+ }
@@ -0,0 +1,16 @@
1
+ @use '../style/_style.scss' as common;
2
+ @use '~@skax/picker/dist/style/_style.scss' as picker;
3
+
4
+ .#{$edate-prefix-cls}-picker-container {
5
+ .#{$edate-prefix-cls}-container {
6
+ min-width: 246px;
7
+ }
8
+
9
+ &.epicker-mobile {
10
+ .#{$edate-prefix-cls}-container {
11
+ max-height: 100%;
12
+ padding-bottom: #{'constant(safe-area-inset-bottom)'}; /*兼容 IOS<11.2*/
13
+ padding-bottom: env(safe-area-inset-bottom); /*兼容 IOS>11.2*/
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,5 @@
1
+ import '@skax/picker/dist/style/css';
2
+ import './components/index.scss';
3
+ import './calendar/index.scss';
4
+ import './month/index.scss';
5
+ import './year/index.scss';
@@ -0,0 +1,92 @@
1
+ @use '../style/_style.scss' as common;
2
+
3
+ .#{common.$emonth-prefix-cls} {
4
+ line-height: normal;
5
+ cursor: unset;
6
+
7
+ // year month
8
+ &-panel {
9
+ display: flex;
10
+ flex-direction: column;
11
+ border: 1px solid var(--edate-border-color, rgba(5, 5, 5, 0.06));
12
+ background-color: #fff;
13
+
14
+ & .#{common.$emonth-prefix-cls}-body {
15
+ padding: 1px 8px;
16
+ }
17
+
18
+ & table {
19
+ width: 100%;
20
+ }
21
+
22
+ & .#{common.$emonth-prefix-cls}-cell {
23
+ height: 52px;
24
+ }
25
+
26
+ & .#{common.$emonth-prefix-cls}-cell-inner {
27
+ padding: 0px 8px;
28
+ }
29
+ }
30
+
31
+ // ---------------------------- start body ---------------------------------
32
+
33
+ &-body {
34
+ padding: 0px 10px;
35
+ color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
36
+ }
37
+
38
+ &-content {
39
+ width: 100%;
40
+ }
41
+
42
+ &-cell {
43
+ position: relative;
44
+ padding: 0px 0;
45
+ cursor: pointer;
46
+ text-align: center;
47
+ color: rgba(0, 0, 0, 0.25);
48
+ box-sizing: border-box;
49
+
50
+ &:not(.#{common.$disabled}):hover &-inner {
51
+ background-color: var(--edate-hover-bg-color, rgba(0, 0, 0, 0.04));
52
+ }
53
+
54
+ &::before {
55
+ position: absolute;
56
+ top: 50%;
57
+ inset-inline-start: 0;
58
+ inset-inline-end: 0;
59
+ z-index: 1;
60
+ height: 22px;
61
+ transform: translateY(-50%);
62
+ transition: all 0.3s;
63
+ content: '';
64
+ }
65
+
66
+ &-in-view {
67
+ color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
68
+
69
+ &.#{common.$emonth-prefix-cls}-cell-selected:not(.#{common.$disabled}) .#{common.$emonth-prefix-cls}-cell-inner {
70
+ background-color: var(--edate-primary-color, #1677ff) !important;
71
+ color: #fff;
72
+ }
73
+ &.#{common.$emonth-prefix-cls}-cell-selected.#{common.$disabled} .#{common.$emonth-prefix-cls}-cell-inner {
74
+ background-color: var(--edate-disabled-bg-color, rgba(0, 0, 0, 0.04)) !important;
75
+ }
76
+ }
77
+
78
+ &-inner {
79
+ position: relative;
80
+ z-index: 2;
81
+ display: inline-block;
82
+ min-width: 22px;
83
+ height: 22px;
84
+ line-height: 22px;
85
+ border-radius: var(--edate-border-radius, 2px);
86
+ transition:
87
+ background 0.2s,
88
+ border 0.2s;
89
+ }
90
+ }
91
+ // ------------------------- end body -----------------------
92
+ }
@@ -0,0 +1,33 @@
1
+ $edate-prefix-cls: edate;
2
+ $ecalendar-prefix-cls: ecalendar;
3
+ $emonth-prefix-cls: emonth;
4
+ $eyear-prefix-cls: eyear;
5
+ $disabled: #{$edate-prefix-cls}-disabled;
6
+
7
+ :root {
8
+ --edate-header-height: 34px;
9
+ --edate-footer-height: var(--edate-header-height, 34px);
10
+ --edate-font-size: 14px;
11
+ --edate-default-color: rgba(0, 0, 0, 0.88);
12
+ --edate-primary-color: #648ffc;
13
+ --edate-hover-color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
14
+ --edate-hover-bg-color: rgba(0, 0, 0, 0.04);
15
+ --edate-active-color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
16
+ --edate-active-bg-color: #e6f4ff;
17
+ --edate-disabled-color: rgba(0, 0, 0, 0.25);
18
+ --edate-disabled-bg-color: rgba(0, 0, 0, 0.04);
19
+ --edate-disabled-active-bg-color: rgba(0, 0, 0, 0.25);
20
+ --edate-border-color: rgba(5, 5, 5, 0.06);
21
+ --edate-border-radius: 2px;
22
+ --edate-close-color: rgba(240, 87, 87, 1);
23
+
24
+ //
25
+ --edate-calendar-border-radius: 50%;
26
+ --edate-calendar-cell-width: 26px;
27
+ --edate-calendar-cell-height: 26px;
28
+
29
+ //
30
+ --edate-badge-color: var(--edate-primary-color, #648ffc);
31
+ --edate-arrow-color: rgba(0, 0, 0, 0.45);
32
+ --edate-arrow-hover-color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
33
+ }
@@ -0,0 +1,98 @@
1
+ @use '../style/_style.scss' as common;
2
+
3
+ .#{common.$eyear-prefix-cls} {
4
+ line-height: normal;
5
+ cursor: unset;
6
+
7
+ &-layout {
8
+ display: flex;
9
+ flex-wrap: nowrap;
10
+ align-items: stretch;
11
+ }
12
+
13
+ // year panel
14
+ &-panel {
15
+ display: flex;
16
+ flex-direction: column;
17
+ border: 1px solid var(--edate-border-color, rgba(5, 5, 5, 0.06));
18
+ background-color: #fff;
19
+
20
+ & .#{common.$eyear-prefix-cls}-body {
21
+ padding: 1px 8px;
22
+ }
23
+
24
+ & table {
25
+ width: 100%;
26
+ }
27
+
28
+ & .#{common.$eyear-prefix-cls}-cell {
29
+ height: 52px;
30
+ }
31
+
32
+ & .#{common.$eyear-prefix-cls}-cell-inner {
33
+ padding: 0px 8px;
34
+ }
35
+ }
36
+
37
+ // ---------------------------- start body ---------------------------------
38
+
39
+ &-body {
40
+ padding: 0px 10px;
41
+ }
42
+
43
+ // &-content {
44
+ // min-width: 210px;
45
+ // }
46
+
47
+ &-cell {
48
+ position: relative;
49
+ padding: 0px 0;
50
+ cursor: pointer;
51
+ text-align: center;
52
+ color: rgba(0, 0, 0, 0.25);
53
+ box-sizing: border-box;
54
+
55
+ &:not(.#{common.$disabled}):hover &-inner {
56
+ background-color: var(--edate-hover-bg-color, rgba(0, 0, 0, 0.04));
57
+ }
58
+
59
+ &::before {
60
+ position: absolute;
61
+ top: 50%;
62
+ inset-inline-start: 0;
63
+ inset-inline-end: 0;
64
+ z-index: 1;
65
+ height: 22px;
66
+ transform: translateY(-50%);
67
+ transition: all 0.3s;
68
+ content: '';
69
+ }
70
+
71
+ &-in-view {
72
+ color: var(--edate-default-color, rgba(0, 0, 0, 0.88));
73
+
74
+ &.#{common.$eyear-prefix-cls}-cell-selected:not(.#{common.$disabled}) .#{common.$eyear-prefix-cls}-cell-inner {
75
+ background-color: var(--edate-primary-color, #1677ff);
76
+ color: #fff;
77
+ }
78
+ &.#{common.$eyear-prefix-cls}-cell-selected.#{common.$disabled} .#{common.$eyear-prefix-cls}-cell-inner {
79
+ background-color: var(--edate-disabled-bg-color, rgba(0, 0, 0, 0.04));
80
+ }
81
+ }
82
+
83
+ &-inner {
84
+ position: relative;
85
+ z-index: 2;
86
+ display: inline-block;
87
+ min-width: 22px;
88
+ height: 22px;
89
+ line-height: 22px;
90
+ border-radius: var(--data-picker-border-radius, 2px);
91
+ transition:
92
+ background 0.2s,
93
+ border 0.2s;
94
+ }
95
+ }
96
+
97
+ // ------------------------- end body -----------------------
98
+ }
package/dist/style.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/control-date-picker v1.0.4
3
- * Copyright (c) 2026-01-01 Ezviz-OpenBiz
2
+ * @ezuikit/control-date-picker v1.0.5
3
+ * Copyright (c) 2026-03-15 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  require("./style.css");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ezuikit/control-date-picker",
3
- "version": "1.0.5-beta.2",
3
+ "version": "2.0.0-alpha.0",
4
4
  "description": "date picker control for ezviz",
5
5
  "title": "date-picker",
6
6
  "main": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "author": "Ezviz-OpenBiz",
19
19
  "license": "",
20
20
  "dependencies": {
21
- "@ezuikit/utils-tools": "2.0.1",
21
+ "@ezuikit/utils-tools": "2.0.3",
22
22
  "deepmerge": "^4.3.1",
23
23
  "@skax/picker": "1.1.7",
24
24
  "@ezuikit/utils-i18n": "2.0.0",