@ezuikit/player-theme 2.0.0-beta.6 → 2.0.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * @ezuikit/player-theme v2.0.0-beta.6
3
- * Copyright (c) 2025-11-18 Ezviz-OpenBiz
2
+ * @ezuikit/player-theme v2.0.1-beta.2
3
+ * Copyright (c) 2025-12-03 Ezviz-OpenBiz
4
4
  * Released under the MIT License.
5
5
  */
6
6
  (function (global, factory) {
@@ -2178,7 +2178,7 @@
2178
2178
  }
2179
2179
 
2180
2180
  var distExports$7 = requireDist$9();
2181
- var delegate = /*@__PURE__*/getDefaultExportFromCjs(distExports$7);
2181
+ var delegate$2 = /*@__PURE__*/getDefaultExportFromCjs(distExports$7);
2182
2182
 
2183
2183
  var cjs;
2184
2184
  var hasRequiredCjs;
@@ -2327,9 +2327,9 @@
2327
2327
  var dist$8 = {};
2328
2328
 
2329
2329
  /*
2330
- * @ezuikit/utils-tools v2.0.1-beta.1
2330
+ * @ezuikit/utils-tools v2.0.1
2331
2331
  * tools utils
2332
- * Copyright (c) 2025-11-16 Ezviz-OpenBiz
2332
+ * Copyright (c) 2025-12-02 Ezviz-OpenBiz
2333
2333
  * Released under the MIT License.
2334
2334
  */
2335
2335
 
@@ -2338,7 +2338,7 @@
2338
2338
  function requireDist$8 () {
2339
2339
  if (hasRequiredDist$8) return dist$8;
2340
2340
  hasRequiredDist$8 = 1;
2341
- 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};dist$8.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 query=(query||"").split("&").filter((function(item){return !/^vc=\d?/.test(item)})).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$8.getQuery=getQuery,dist$8.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$8.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$8.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$8.parseEzopenUrl=parseEzopenUrl,dist$8.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$8.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};
2341
+ 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}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:true}:{done:false,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.")}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=_create_for_of_iterator_helper_loose([[/(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}();dist$8.DateTime=DateTime,dist$8.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 query=(query||"").split("&").filter((function(item){return !/^vc=\d?/.test(item)})).join("&"),host+"?"+(query+=(query?"&":"")+"vc="+vc)},dist$8.getQuery=getQuery,dist$8.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$8.isHttp=function(url){return /^http[s]?:\/\//.test(url)},dist$8.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$8.parseEzopenUrl=parseEzopenUrl,dist$8.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$8.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};
2342
2342
  return dist$8;
2343
2343
  }
2344
2344
 
@@ -2739,7 +2739,7 @@
2739
2739
  var _this = this;
2740
2740
  var mousedownName = window.PointerEvent ? 'pointerdown' : 'mousedown';
2741
2741
  // prettier-ignore
2742
- this._delegateSliderMouseDown = delegate(this.$content, "." + PREFIX_CLASS + "-progress-slider", mousedownName, function(e) {
2742
+ this._delegateSliderMouseDown = delegate$2(this.$content, "." + PREFIX_CLASS + "-progress-slider", mousedownName, function(e) {
2743
2743
  var // 垂直方向Y轴是反的,所以用高度减去点击位置
2744
2744
  _this_options_onProgressClick, _this_options;
2745
2745
  e.stopPropagation();
@@ -2764,7 +2764,7 @@
2764
2764
  _this.percent = percent;
2765
2765
  });
2766
2766
  // prettier-ignore
2767
- this._delegateSliderHandleMouseDown = delegate(this.$content, "." + PREFIX_CLASS + "-progress-slider-handle", mousedownName, function(e) {
2767
+ this._delegateSliderHandleMouseDown = delegate$2(this.$content, "." + PREFIX_CLASS + "-progress-slider-handle", mousedownName, function(e) {
2768
2768
  e.stopPropagation();
2769
2769
  if (!_this.options.draggable) {
2770
2770
  return;
@@ -2804,7 +2804,7 @@
2804
2804
  // plug
2805
2805
  if (this.options.showPlus) {
2806
2806
  var clickName = window.PointerEvent ? 'pointerdown' : 'click';
2807
- this._delegatePlusClick = delegate(this.$content, "." + PREFIX_CLASS + "-progress-plus", clickName, function(e) {
2807
+ this._delegatePlusClick = delegate$2(this.$content, "." + PREFIX_CLASS + "-progress-plus", clickName, function(e) {
2808
2808
  e.stopPropagation();
2809
2809
  if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
2810
2810
  return;
@@ -2822,7 +2822,7 @@
2822
2822
  if (this.options.showMinus) {
2823
2823
  var clickName1 = window.PointerEvent ? 'pointerdown' : 'click';
2824
2824
  // prettier-ignore
2825
- this._delegateMinusClick = delegate(this.$content, "." + PREFIX_CLASS + "-progress-minus", clickName1, function(e) {
2825
+ this._delegateMinusClick = delegate$2(this.$content, "." + PREFIX_CLASS + "-progress-minus", clickName1, function(e) {
2826
2826
  e.stopPropagation();
2827
2827
  if (e.delegateTarget.classList.contains("" + PREFIX_CLASS + "-disabled") || _this._disabled) {
2828
2828
  return;
@@ -2842,7 +2842,7 @@
2842
2842
  'touchmove',
2843
2843
  'dblclick'
2844
2844
  ].forEach(function(name) {
2845
- delegate(_this.$container, "." + PREFIX_CLASS + "-progress", name, function(e) {
2845
+ delegate$2(_this.$container, "." + PREFIX_CLASS + "-progress", name, function(e) {
2846
2846
  e.stopPropagation();
2847
2847
  e.preventDefault(); // 阻止默认的触摸行为
2848
2848
  });
@@ -3094,7 +3094,7 @@
3094
3094
  var _this = this;
3095
3095
  // 这里不要用 click 事件,因为拖动音量大小时鼠标移动到图标上会触发 click
3096
3096
  // prettier-ignore
3097
- delegate(this.$container, "." + PREFIX_CLASS + "-control-volume", "mousedown", function() {
3097
+ delegate$2(this.$container, "." + PREFIX_CLASS + "-control-volume", "mousedown", function() {
3098
3098
  if (!_this.$container.classList.contains("" + PREFIX_CLASS + "-disabled")) {
3099
3099
  _this._toggleMute();
3100
3100
  }
@@ -4037,7 +4037,7 @@
4037
4037
  };
4038
4038
  _proto._onClickIcon = function _onClickIcon() {
4039
4039
  var _this = this;
4040
- this._delegation = delegate(this.$container, "." + PREFIX_CLASS + "-icon", 'click', function(e) {
4040
+ this._delegation = delegate$2(this.$container, "." + PREFIX_CLASS + "-icon", 'click', function(e) {
4041
4041
  var target = e.delegateTarget;
4042
4042
  if (!target.classList.contains("" + PREFIX_CLASS + "-disabled")) {
4043
4043
  var type = target.getAttribute('data-type');
@@ -9859,7 +9859,7 @@
9859
9859
  var _this__options_fieldNames;
9860
9860
  var _this__options_fieldNames_value;
9861
9861
  var valueKey = (_this__options_fieldNames_value = (_this__options_fieldNames = this._options.fieldNames) == null ? void 0 : _this__options_fieldNames.value) != null ? _this__options_fieldNames_value : 'value';
9862
- this._delegationOption = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-option", 'click', function(e) {
9862
+ this._delegationOption = delegate$2(this._picker.$body, "." + PREFIX_CLASS + "-select-option", 'click', function(e) {
9863
9863
  var target = e.delegateTarget;
9864
9864
  e.stopPropagation();
9865
9865
  if (!target.classList.contains("" + PREFIX_CLASS + "-disabled")) {
@@ -9874,11 +9874,11 @@
9874
9874
  }
9875
9875
  }
9876
9876
  });
9877
- this._delegationClose = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-close", 'click', function(e) {
9877
+ this._delegationClose = delegate$2(this._picker.$body, "." + PREFIX_CLASS + "-select-close", 'click', function(e) {
9878
9878
  e.stopPropagation();
9879
9879
  _this._picker.open = false;
9880
9880
  });
9881
- this._delegationCancel = delegate(this._picker.$body, "." + PREFIX_CLASS + "-select-cancel", 'click', function(e) {
9881
+ this._delegationCancel = delegate$2(this._picker.$body, "." + PREFIX_CLASS + "-select-cancel", 'click', function(e) {
9882
9882
  e.stopPropagation();
9883
9883
  _this._picker.open = false;
9884
9884
  });
@@ -9982,6 +9982,10 @@
9982
9982
  };
9983
9983
  return _set_prototype_of$8(o, p);
9984
9984
  }
9985
+ function _type_of(obj) {
9986
+ "@swc/helpers - typeof";
9987
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
9988
+ }
9985
9989
  var DEFINITION_LEVELS_LOCALE = [
9986
9990
  'VIDEO_LEVEL_FLUENT',
9987
9991
  'VIDEO_LEVEL_STANDARD',
@@ -10075,7 +10079,7 @@
10075
10079
  Select.prototype.updateOptions.call(_assert_this_initialized$1(_this), __filter(list, _this.locale));
10076
10080
  });
10077
10081
  _this.on(EVENTS.currentVideoLevel, function(item, realLevel) {
10078
- var l = typeof item === 'object' ? item.level : item;
10082
+ var l = (typeof item === "undefined" ? "undefined" : _type_of(item)) === 'object' ? item.level : item;
10079
10083
  _this._level = realLevel + '';
10080
10084
  if (l === 'auto') {
10081
10085
  var _options_locales_options_language;
@@ -10204,393 +10208,160 @@
10204
10208
  return Speed;
10205
10209
  }(Select);
10206
10210
 
10211
+ var dist$2 = {};
10212
+
10213
+ var delegate$1 = {exports: {}};
10214
+
10207
10215
  /*
10208
- * @ezuikit/control-date-picker v0.0.1-alpha.2
10209
- * Copyright (c) 2025-11-12 Ezviz-OpenBiz
10216
+ * delegate.js v4.0.1
10217
+ * Copyright (c) 2025-11-23
10218
+ * Released under the MIT License.
10219
+ */
10220
+ var delegate = delegate$1.exports;
10221
+
10222
+ var hasRequiredDelegate;
10223
+
10224
+ function requireDelegate () {
10225
+ if (hasRequiredDelegate) return delegate$1.exports;
10226
+ hasRequiredDelegate = 1;
10227
+ (function (module, exports) {
10228
+ (function (global, factory) {
10229
+ module.exports = factory() ;
10230
+ })(delegate, (function () {
10231
+ var DOCUMENT_NODE_TYPE = 9;
10232
+ /**
10233
+ * A polyfill for Element.matches()
10234
+ */ if (typeof Element !== "undefined" && !Element.prototype.matches) {
10235
+ var proto = Element.prototype;
10236
+ proto.matches = (proto == null ? void 0 : proto.matchesSelector) || (proto == null ? void 0 : proto.mozMatchesSelector) || (proto == null ? void 0 : proto.msMatchesSelector) || (proto == null ? void 0 : proto.oMatchesSelector) || (proto == null ? void 0 : proto.webkitMatchesSelector);
10237
+ }
10238
+ /**
10239
+ * Finds the closest parent that matches a selector.
10240
+ *
10241
+ * @param {Element} element
10242
+ * @param {string} selector
10243
+ * @return {Element}
10244
+ */ function closest(element, selector) {
10245
+ while(element && element.nodeType !== DOCUMENT_NODE_TYPE){
10246
+ if (typeof element.matches === "function" && element.matches(selector)) {
10247
+ return element;
10248
+ }
10249
+ element = element.parentNode;
10250
+ }
10251
+ return null;
10252
+ }
10253
+ /**
10254
+ * Finds the closest parent that matches a selector.
10255
+ *
10256
+ * @param {Element} element
10257
+ * @param {string} selector
10258
+ * @return {Element}
10259
+ */ function closestNative(element, selector) {
10260
+ return element && element.closest(selector);
10261
+ }
10262
+ var closest$1 = typeof Element.prototype.closest === "function" ? closestNative : closest;
10263
+
10264
+ /**
10265
+ * Delegates event to a selector.
10266
+ *
10267
+ * @param {Element} element
10268
+ * @param {string} selector
10269
+ * @param {string} type
10270
+ * @param {Function} callback
10271
+ * @param {boolean} useCapture
10272
+ * @return {Object}
10273
+ */ // prettier-ignore
10274
+ function _delegate(element, selector, type, callback, useCapture) {
10275
+ // prettier-ignore
10276
+ var listenerFn = listener.apply(this, arguments);
10277
+ element.addEventListener(type, listenerFn, useCapture);
10278
+ return {
10279
+ destroy: function destroy() {
10280
+ element.removeEventListener(type, listenerFn, useCapture);
10281
+ }
10282
+ };
10283
+ }
10284
+ /**
10285
+ * Delegates event to a selector.
10286
+ *
10287
+ * @param {Element|string|Array} [elements]
10288
+ * @param {string | Element} selector
10289
+ * @param {string} type
10290
+ * @param {Function} callback
10291
+ * @param {boolean} useCapture
10292
+ * @return {Object}
10293
+ * @example
10294
+ * ```ts
10295
+ * const delegation = delegate(document.body, 'a', 'click', function (e) {})
10296
+ * // destroy (removeEventListener)
10297
+ * delegation.destroy();
10298
+ *
10299
+ * const delegation1 = delegate(".btn", "click", function (e) { console.log(e.delegateTarget)},false);
10300
+ * // destroy (removeEventListener)
10301
+ * delegation1.destroy();
10302
+ * ```
10303
+ */ // prettier-ignore
10304
+ function delegate(elements, selector, type, callback, useCapture) {
10305
+ // Handle the regular Element usage
10306
+ if (typeof elements.addEventListener === "function") {
10307
+ return _delegate.apply(null, arguments);
10308
+ }
10309
+ // Handle Element-less usage, it defaults to global delegation
10310
+ if (typeof type === "function") {
10311
+ // Use `document` as the first parameter, then apply arguments
10312
+ // This is a short way to .unshift `arguments` without running into deoptimizations
10313
+ return _delegate.bind(null, document).apply(null, arguments);
10314
+ }
10315
+ // Handle Selector-based usage
10316
+ if (typeof elements === "string") {
10317
+ elements = document.querySelectorAll(elements);
10318
+ }
10319
+ // Handle Array-like based usage
10320
+ return Array.prototype.map.call(elements, function(element) {
10321
+ return _delegate(element, selector, type, callback, useCapture);
10322
+ });
10323
+ }
10324
+ /**
10325
+ * Finds closest match and invokes callback.
10326
+ *
10327
+ * @param {Element} element
10328
+ * @param {string} selector
10329
+ * @param {string} type
10330
+ * @param {Function} callback
10331
+ * @return {Function}
10332
+ */ // prettier-ignore
10333
+ function listener(element, selector, type, callback) {
10334
+ return function(e) {
10335
+ e.delegateTarget = closest$1(e.target, selector);
10336
+ if (e.delegateTarget) {
10337
+ callback.call(element, e);
10338
+ }
10339
+ };
10340
+ }
10341
+
10342
+ return delegate;
10343
+
10344
+ }));
10345
+ } (delegate$1));
10346
+ return delegate$1.exports;
10347
+ }
10348
+
10349
+ /*
10350
+ * @ezuikit/control-date-picker v1.0.0-beta.6
10351
+ * Copyright (c) 2025-12-03 Ezviz-OpenBiz
10210
10352
  * Released under the MIT License.
10211
10353
  */
10212
10354
 
10213
- var dist$2;
10214
10355
  var hasRequiredDist$2;
10215
10356
 
10216
10357
  function requireDist$2 () {
10217
10358
  if (hasRequiredDist$2) return dist$2;
10218
10359
  hasRequiredDist$2 = 1;
10219
-
10220
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10221
- try {
10222
- var info = gen[key](arg);
10223
- var value = info.value;
10224
- } catch (error) {
10225
- reject(error);
10226
- return;
10227
- }
10228
- if (info.done) {
10229
- resolve(value);
10230
- } else {
10231
- Promise.resolve(value).then(_next, _throw);
10232
- }
10233
- }
10234
- function _async_to_generator(fn) {
10235
- return function() {
10236
- var self = this, args = arguments;
10237
- return new Promise(function(resolve, reject) {
10238
- var gen = fn.apply(self, args);
10239
- function _next(value) {
10240
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
10241
- }
10242
- function _throw(err) {
10243
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
10244
- }
10245
- _next(undefined);
10246
- });
10247
- };
10248
- }
10249
- function _ts_generator(thisArg, body) {
10250
- var f, y, t, _ = {
10251
- label: 0,
10252
- sent: function() {
10253
- if (t[0] & 1) throw t[1];
10254
- return t[1];
10255
- },
10256
- trys: [],
10257
- ops: []
10258
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
10259
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
10260
- return this;
10261
- }), g;
10262
- function verb(n) {
10263
- return function(v) {
10264
- return step([
10265
- n,
10266
- v
10267
- ]);
10268
- };
10269
- }
10270
- function step(op) {
10271
- if (f) throw new TypeError("Generator is already executing.");
10272
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
10273
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
10274
- if (y = 0, t) op = [
10275
- op[0] & 2,
10276
- t.value
10277
- ];
10278
- switch(op[0]){
10279
- case 0:
10280
- case 1:
10281
- t = op;
10282
- break;
10283
- case 4:
10284
- _.label++;
10285
- return {
10286
- value: op[1],
10287
- done: false
10288
- };
10289
- case 5:
10290
- _.label++;
10291
- y = op[1];
10292
- op = [
10293
- 0
10294
- ];
10295
- continue;
10296
- case 7:
10297
- op = _.ops.pop();
10298
- _.trys.pop();
10299
- continue;
10300
- default:
10301
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
10302
- _ = 0;
10303
- continue;
10304
- }
10305
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
10306
- _.label = op[1];
10307
- break;
10308
- }
10309
- if (op[0] === 6 && _.label < t[1]) {
10310
- _.label = t[1];
10311
- t = op;
10312
- break;
10313
- }
10314
- if (t && _.label < t[2]) {
10315
- _.label = t[2];
10316
- _.ops.push(op);
10317
- break;
10318
- }
10319
- if (t[2]) _.ops.pop();
10320
- _.trys.pop();
10321
- continue;
10322
- }
10323
- op = body.call(thisArg, _);
10324
- } catch (e) {
10325
- op = [
10326
- 6,
10327
- e
10328
- ];
10329
- y = 0;
10330
- } finally{
10331
- f = t = 0;
10332
- }
10333
- if (op[0] & 5) throw op[1];
10334
- return {
10335
- value: op[0] ? op[1] : void 0,
10336
- done: true
10337
- };
10338
- }
10339
- }
10340
- var AppendJS = /*#__PURE__*/ function() {
10341
- function AppendJS() {}
10342
- AppendJS.loadScript = function loadScript(src) {
10343
- return _async_to_generator(function() {
10344
- return _ts_generator(this, function(_state) {
10345
- switch(_state.label){
10346
- case 0:
10347
- return [
10348
- 4,
10349
- new Promise(function(resolve, reject) {
10350
- if (AppendJS.LoadedScr.includes(src)) {
10351
- return resolve(src);
10352
- }
10353
- if (AppendJS.LoadingScrQueue[src]) {
10354
- return AppendJS.LoadingScrQueue[src].push(resolve);
10355
- } else {
10356
- AppendJS.LoadingScrQueue[src] = [
10357
- resolve
10358
- ];
10359
- }
10360
- var link;
10361
- if (src.includes('.js')) {
10362
- link = document.createElement('script');
10363
- link.src = src;
10364
- link.async = true;
10365
- } else if (src.includes('.css')) {
10366
- link = document.createElement('link');
10367
- link.rel = 'stylesheet';
10368
- link.href = src;
10369
- }
10370
- link.onload = function() {
10371
- AppendJS.LoadedScr.push(src);
10372
- AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
10373
- return resolve(src);
10374
- });
10375
- AppendJS.LoadingScrQueue[src] = [];
10376
- };
10377
- link.onerror = function() {
10378
- return reject(new Error('Failed to load ' + src));
10379
- };
10380
- document.head.appendChild(link);
10381
- })
10382
- ];
10383
- case 1:
10384
- return [
10385
- 2,
10386
- _state.sent()
10387
- ];
10388
- }
10389
- });
10390
- })();
10391
- };
10392
- AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
10393
- return _async_to_generator(function() {
10394
- return _ts_generator(this, function(_state) {
10395
- switch(_state.label){
10396
- case 0:
10397
- return [
10398
- 4,
10399
- Promise.all(srcArr.map(AppendJS.loadScript))
10400
- ];
10401
- case 1:
10402
- return [
10403
- 2,
10404
- _state.sent()
10405
- ];
10406
- }
10407
- });
10408
- })();
10409
- };
10410
- AppendJS.remove = function remove(src) {
10411
- src.forEach(function(item) {
10412
- var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
10413
- if (link) {
10414
- link.remove();
10415
- }
10416
- });
10417
- };
10418
- AppendJS.clear = function clear() {
10419
- AppendJS.remove(AppendJS.LoadedScr);
10420
- };
10421
- return AppendJS;
10422
- }();
10423
- /** 已经加载完的js/css */ AppendJS.LoadedScr = [];
10424
- /** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
10425
-
10426
- function _defineProperties(target, props) {
10427
- for(var i = 0; i < props.length; i++){
10428
- var descriptor = props[i];
10429
- descriptor.enumerable = descriptor.enumerable || false;
10430
- descriptor.configurable = true;
10431
- if ("value" in descriptor) descriptor.writable = true;
10432
- Object.defineProperty(target, descriptor.key, descriptor);
10433
- }
10434
- }
10435
- function _create_class(Constructor, protoProps, staticProps) {
10436
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
10437
- return Constructor;
10438
- }
10439
- var DEFAULT_OPTIONS = {
10440
- staticPath: '.',
10441
- place: 'top-right',
10442
- language: 'zh-CN',
10443
- current: new Date(),
10444
- maxDate: new Date()
10445
- };
10446
- /**
10447
- * 日期选择器
10448
- */ var DatePicker = /*#__PURE__*/ function() {
10449
- function DatePicker(container, options) {
10450
- var _this = this;
10451
- this._open = false;
10452
- this._change = true;
10453
- this.$container = container;
10454
- this.options = Object.assign({}, DEFAULT_OPTIONS, options);
10455
- this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
10456
- if (this.options.current) {
10457
- this._date = this.options.current;
10458
- }
10459
- this._init();
10460
- this.$container.addEventListener('click', function() {
10461
- if (_this._open) _this.hide();
10462
- else _this.show();
10463
- });
10464
- document.body.addEventListener('click', function(e) {
10465
- if (!_this.$container.contains(e.target)) {
10466
- _this.hide();
10467
- }
10468
- });
10469
- }
10470
- var _proto = DatePicker.prototype;
10471
- _proto._init = function _init() {
10472
- var _this = this;
10473
- // 因为挂载在行内,需要父标签设置 position: relative;
10474
- this.$container.style.cssText += ";position: relative;";
10475
- this.$container.classList.add("datepicker-inline-" + this.options.place);
10476
- AppendJS.loadScriptsBatch([
10477
- "" + this.options.staticPath + "/rec/jquery.min.js",
10478
- "" + this.options.staticPath + "/rec/datepicker.min.css"
10479
- ]).then(function() {
10480
- AppendJS.loadScriptsBatch([
10481
- "" + _this.options.staticPath + "/rec/datepicker.js"
10482
- ]).then(function() {
10483
- AppendJS.loadScriptsBatch([
10484
- "" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
10485
- "" + _this.options.staticPath + "/rec/datepicker.en-US.js"
10486
- ]).then(function() {
10487
- window.$(_this.$container).datepicker({
10488
- date: _this.options.current,
10489
- language: _this.options.language,
10490
- endDate: _this.options.maxDate,
10491
- inline: true
10492
- });
10493
- _this.hide();
10494
- window.$(_this.$container).on('pick.datepicker', function(e) {
10495
- var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
10496
- if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
10497
- _this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
10498
- } else if (e.view === 'month' && (((_this__date1 = _this._date) == null ? void 0 : _this__date1.getMonth()) !== e.date.getMonth() || ((_this__date2 = _this._date) == null ? void 0 : _this__date2.getFullYear()) !== e.date.getFullYear())) {
10499
- _this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
10500
- } else if ([
10501
- 'day',
10502
- 'pick'
10503
- ].includes(e.view || e.type) && (((_this__date3 = _this._date) == null ? void 0 : _this__date3.getDate()) !== e.date.getDate() || ((_this__date4 = _this._date) == null ? void 0 : _this__date4.getMonth()) !== e.date.getMonth() || ((_this__date5 = _this._date) == null ? void 0 : _this__date5.getFullYear()) !== e.date.getFullYear())) {
10504
- if (_this._change) {
10505
- _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
10506
- }
10507
- _this._date = new Date(e.date.getTime());
10508
- }
10509
- if (e.view === 'day') _this.hide();
10510
- _this._change = true;
10511
- });
10512
- });
10513
- });
10514
- });
10515
- };
10516
- /**
10517
- * 设置日期, change = true 时触发 onChange 事件
10518
- *
10519
- * @param date 设置的日期
10520
- * @param change 是否触发 onChange 事件
10521
- */ _proto.setDate = function setDate(date, change) {
10522
- if (change === void 0) change = true;
10523
- var $datepicker = this.$container.querySelector(".datepicker-inline");
10524
- if ($datepicker) {
10525
- this._change = change;
10526
- window.$(this.$container).datepicker('setDate', date);
10527
- }
10528
- };
10529
- /**
10530
- * 隐藏面板, 会触发 onPanelChange 事件
10531
- */ _proto.hide = function hide() {
10532
- var $datepicker = this.$container.querySelector(".datepicker-inline");
10533
- if ($datepicker) {
10534
- if (this._open) {
10535
- this._open = false;
10536
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
10537
- }
10538
- $datepicker.classList.add('datepicker-hide');
10539
- }
10540
- };
10541
- /**
10542
- * 显示面板, 会触发 onPanelChange 事件
10543
- */ _proto.show = function show() {
10544
- var $datepicker = this.$container.querySelector(".datepicker-inline");
10545
- if ($datepicker) {
10546
- var _window_$_datepicker, _window_$;
10547
- if (!this._open) {
10548
- this._open = true;
10549
- this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
10550
- }
10551
- if (this._date) this.setDate(this._date, false);
10552
- (_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
10553
- if (this.options.place === 'bottom-left') {
10554
- $datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
10555
- } else {
10556
- $datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
10557
- }
10558
- $datepicker.classList.remove('datepicker-hide');
10559
- }
10560
- };
10561
- /**
10562
- * 销毁
10563
- */ _proto.destroy = function destroy() {
10564
- this.hide();
10565
- this._date = undefined;
10566
- window.$(this.$container).datepicker('destroy');
10567
- // AppendJS.remove([
10568
- // `${this.options.staticPath}/rec/jquery.min.js`,
10569
- // `${this.options.staticPath}/rec/datepicker.min.css`,
10570
- // `${this.options.staticPath}/rec/datepicker.js`,
10571
- // `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
10572
- // `${this.options.staticPath}/rec/datepicker.en-US.js`,
10573
- // ]);
10574
- };
10575
- _create_class(DatePicker, [
10576
- {
10577
- key: "date",
10578
- get: /**
10579
- * 获取日期
10580
- */ function get() {
10581
- return this._date;
10582
- }
10583
- }
10584
- ]);
10585
- return DatePicker;
10586
- }();
10587
-
10588
- dist$2 = DatePicker;
10360
+ var delegate=requireDelegate(),utilsTools=requireDist$8(),deepmerge=requireCjs(),Picker=requireDist$a(),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:false,showSuperNextIcon:false,showPrevIcon:false,showNextIcon:false,showHeaderClose:false,showHeaderOk:false,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:false}),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);}),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);}));},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:true},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:false}),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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),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:true,showSuperPrevIcon:true,showSuperNextIcon:true,showPrevIcon:true,showNextIcon:true,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,false),(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,false),_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:true,configurable:true}}),superClass&&_set_prototype_of$3(subClass,superClass);}(Calendar,Container);var _proto=Calendar.prototype;return _proto.setCurrent=function(date,change){if(void 0===change&&(change=true),"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=true),(null==badges?void 0:badges.length)&&(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,"/"));null==_this.options.onCell||_this.options.onCell.call(_this.options,date,_this._renderCurrent),event.delegateTarget.classList.contains("edate-disabled")||(_this.setCurrent(date),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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),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:true,showSuperPrevIcon:true,showSuperNextIcon:true,language:"zh"},Month=function(Container){function Month(popupContainer,options){var _this;return (_this=Container.call(this,popupContainer,deepmerge.all([{},_Month_DEFAULT_OPTIONS_,options||{},{showPrevIcon:false,showNextIcon:false,prefixCls:"emonth"}],{clone:false}))||this)._render(),_this.setCurrent(_this.options.current,false),_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:true,configurable:true}}),superClass&&_set_prototype_of$2(subClass,superClass);}(Month,Container);var _proto=Month.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),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&&current||utilsTools.DateTime.format(current,"YYYY-MM")!==utilsTools.DateTime.format(this._current,"YYYY-MM"))&&(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("title"),date=utilsTools.DateTime.toDate(month+utilsTools.DateTime.format(_this._renderCurrent,"-DDTHH:mm:ss"));null==_this.options.onCell||_this.options.onCell.call(_this.options,date,utilsTools.DateTime.format(date,"YYYY-MM")),e.delegateTarget.classList.contains("edate-disabled")||_this.setCurrent(date);});},_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)+'" 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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),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:true,showSuperPrevIcon:true,showSuperNextIcon:true,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:false,showNextIcon:false,renderPrevIcon:"",renderNextIcon:""}],{clone:false}))||this)._render(),_this._setCurrent(_this.options.current,false),_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:true,configurable:true}}),superClass&&_set_prototype_of$1(subClass,superClass);}(Year,Container);var _proto=Year.prototype;return _proto.setCurrent=function(year,change){ void 0===change&&(change=true),this._setCurrent(year,change);},_proto._setCurrent=function(year,change){var _this__current;void 0===change&&(change=true);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);_year.getFullYear()!==(null==(_this__current=this._current)?void 0:_this__current.getFullYear())&&(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),null==_this.options.onCell||_this.options.onCell.call(_this.options,newDate),e.delegateTarget.classList.contains("edate-disabled")||(_this._setCurrent(newDate),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||false,descriptor.configurable=true,"value"in descriptor&&(descriptor.writable=true),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:false,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:false}))||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:false}),_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:true,configurable:true}}),superClass&&_set_prototype_of(subClass,superClass);}(DatePicker,Picker);var _proto=DatePicker.prototype;return _proto.setCurrent=function(date,change){ void 0===change&&(change=true),this._setCurrent(date,change);},_proto.updateBadges=function(badges){var _this__calendar;(null==badges?void 0:badges.length)&&(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=true),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=false;},_proto._onOpenChange=function(open){Picker.prototype._onOpenChange.call(this,open),open&&(this._removeCurrentTypeClass(),this._currentMode=this.options.mode||"date",this._switchMode()),open||(null==this.options.onClose||this.options.onClose.call(this.options,this.current,this._currentMode),this._setCurrent(this.current,false));},_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),_this._minModeIndex<1&&(_this._removeCurrentTypeClass(),_this._currentMode="date",_this._switchMode());},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),_this._minModeIndex<2&&(_this._removeCurrentTypeClass(),_this._currentMode="month",_this._switchMode());}})));},_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){var index=_DATEPICKER_MODE_ARRAY.indexOf(this._currentMode);showHeaderOk||this._minModeIndex!==index||this._hide(),null==this.options.onChange||this.options.onChange.call(this.options,date,this._currentMode),this._setCurrent(date);},_proto._onCell=function(date){null==this.options.onCell||this.options.onCell.call(this.options,date,this._currentMode);},_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);dist$2.Calendar=Calendar,dist$2.DatePicker=DatePicker,dist$2.Header=Header,dist$2.Month=Month,dist$2.Year=Year;
10589
10361
  return dist$2;
10590
10362
  }
10591
10363
 
10592
10364
  var distExports$1 = requireDist$2();
10593
- var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
10594
10365
 
10595
10366
  /**
10596
10367
  * @description 时间操作
@@ -10781,7 +10552,9 @@
10781
10552
  function DatePickerControl(options) {
10782
10553
  var _this;
10783
10554
  var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
10784
- _this = Control.call(this, _extends$5({}, options, {
10555
+ _this = Control.call(this, _extends$5({
10556
+ maxDate: new Date()
10557
+ }, options, {
10785
10558
  tagName: 'span',
10786
10559
  controlType: 'button',
10787
10560
  classNameSuffix: 'date'
@@ -10794,7 +10567,8 @@
10794
10567
  var _proto = DatePickerControl.prototype;
10795
10568
  _proto._render = function _render() {
10796
10569
  var _this = this;
10797
- if (distExports$6.isMobile()) {
10570
+ var isMobile1 = distExports$6.isMobile();
10571
+ if (isMobile1) {
10798
10572
  var _this_locale;
10799
10573
  this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + '-mobile-date-filter" title="' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CALENDAR) || '') + '">\n <span class="' + PREFIX_CLASS + '-mobile-date-filter-value">' + this._getDateStr() + "</span>\n " + IconComponents.filter() + "\n <span>";
10800
10574
  } else {
@@ -10803,14 +10577,25 @@
10803
10577
  title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
10804
10578
  });
10805
10579
  }
10806
- this.dataPickerUtil = new DatePickerUtil(this.$container, {
10807
- staticPath: this.options.staticPath,
10808
- language: this.options.language === 'zh' ? 'zh-CN' : 'en-US',
10580
+ this.dataPicker = new distExports$1.DatePicker(this.$container, {
10581
+ isMobile: isMobile1,
10582
+ getPopupContainer: function() {
10583
+ return _this.$container;
10584
+ },
10585
+ mode: 'date',
10586
+ offset: [
10587
+ 0,
10588
+ -10
10589
+ ],
10590
+ badges: this.options.badges || [],
10591
+ language: this.options.language === 'zh' ? 'zh' : 'en',
10809
10592
  current: new Date(this._value + ' 00:00:00'),
10810
- maxDate: this.options.maxDate || new Date(),
10811
- place: distExports$6.isMobile() ? 'bottom-left' : 'top-right',
10812
- onChange: function(date) {
10813
- if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
10593
+ disabledDate: function(date) {
10594
+ return date.getTime() > (_this.options.maxDate || new Date()).getTime();
10595
+ },
10596
+ placement: 'tr',
10597
+ onOk: function(date, mode) {
10598
+ if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD') && isMobile1) {
10814
10599
  _this._value = DateTime.formate(date, 'YYYY-MM-DD');
10815
10600
  _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
10816
10601
  _this.emit(EVENTS.control.dateChange, date);
@@ -10819,9 +10604,16 @@
10819
10604
  }
10820
10605
  }
10821
10606
  },
10822
- onPanelChange: function(open, date) {
10823
- _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, date);
10824
- _this.emit(EVENTS.control.datePanelOpenChange, open, date);
10607
+ onChange: function(date, mode) {
10608
+ if (date && _this._value !== DateTime.formate(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
10609
+ _this._value = DateTime.formate(date, 'YYYY-MM-DD');
10610
+ _this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
10611
+ _this.emit(EVENTS.control.dateChange, date);
10612
+ }
10613
+ },
10614
+ onOpenChange: function(open) {
10615
+ _this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.dataPicker.current);
10616
+ _this.emit(EVENTS.control.datePanelOpenChange, open, _this.dataPicker.current);
10825
10617
  }
10826
10618
  });
10827
10619
  };
@@ -10831,8 +10623,8 @@
10831
10623
  * @param change 是否触发 onChange 事件
10832
10624
  */ _proto.setDate = function setDate(date, change) {
10833
10625
  if (change === void 0) change = true;
10834
- var _this_dataPickerUtil;
10835
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.setDate(date, change);
10626
+ var _this_dataPicker;
10627
+ (_this_dataPicker = this.dataPicker) == null ? void 0 : _this_dataPicker.setCurrent(date, change);
10836
10628
  if (date && !change && this._value !== DateTime.formate(date, 'YYYY-MM-DD')) {
10837
10629
  this._value = DateTime.formate(date, 'YYYY-MM-DD');
10838
10630
  if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
@@ -10841,18 +10633,17 @@
10841
10633
  }
10842
10634
  };
10843
10635
  _proto.reset = function reset() {
10844
- var _this_dataPickerUtil;
10845
- (_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
10636
+ if (this.dataPicker) this.dataPicker.open = false;
10846
10637
  Control.prototype.reset.call(this);
10847
10638
  };
10848
10639
  /**
10849
10640
  * 销毁控件
10850
10641
  * @override
10851
10642
  */ _proto.destroy = function destroy() {
10852
- if (this.dataPickerUtil) {
10853
- this.dataPickerUtil.destroy();
10643
+ if (this.dataPicker) {
10644
+ this.dataPicker.destroy();
10854
10645
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10855
- this.dataPickerUtil = null;
10646
+ this.dataPicker = null;
10856
10647
  }
10857
10648
  Control.prototype.destroy.call(this);
10858
10649
  };
@@ -10862,6 +10653,7 @@
10862
10653
  };
10863
10654
  /**
10864
10655
  * 点击 Control 会触发
10656
+ * @overload super._onControlClick(e: Event)
10865
10657
  */ _proto._onControlClick = function _onControlClick(e) {
10866
10658
  Control.prototype._onControlClick.call(this, e);
10867
10659
  };
@@ -13929,7 +13721,7 @@
13929
13721
  zh: zh,
13930
13722
  en: en
13931
13723
  };
13932
- /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.0-beta.6';
13724
+ /** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.1-beta.2';
13933
13725
 
13934
13726
  // 不要动这里的代码, 这个出口是为了编译成 umd 规范的文件
13935
13727