UNPKG

quarkd

Version:

Mobile UI Components built on Web Components.

2 lines (1 loc) 22.1 kB
import{_ as e}from"../slicedToArray.js";import{_ as t}from"../toConsumableArray.js";import{_ as n,a as r}from"../typeof.js";import{_ as a,a as o,b as i,c as l,P as d,H as s,d as c,N as u,O as f,B as h}from"../index2.js";import{_ as p}from"../defineProperty.js";import"../popup/index.js";import"../button/index.js";import{Local as y}from"../locale/index.js";import v from"../toast/index.js";import"../unsupportedIterableToArray.js";import"../bodyScrollLock.esm.js";import"../index4.js";import"../index22.js";import"../loading/index.js";import"../util.js";import"../overlay/index.js";function m(e,t){var n=e.getFullYear(),r=t.getFullYear();if(n===r){var a=e.getMonth(),o=t.getMonth();return a===o?0:a>o?1:-1}return n>r?1:-1}function g(e,t){var n=m(e,t);if(0===n){var r=e.getDate(),a=t.getDate();return r===a?0:r>a?1:-1}return n}var D=function(e){return new Date(e)},b=function(e){return Array.isArray(e)?e.map(D):D(e)};function k(e,t){var n=D(e);return n.setDate(n.getDate()+t),n}var w=function(e){return k(e,-1)},q=function(e){return k(e,1)},x=function(){var e=new Date;return e.setHours(0,0,0,0),e};function R(e){var t=e[0].getTime();return(e[1].getTime()-t)/864e5+1}var M=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime())};function T(e){var t="scrollTop"in e?e.scrollTop:e.pageYOffset;return Math.max(t,0)}function B(e,t){"scrollTop"in e?e.scrollTop=t:e.scrollTo(e.scrollX,t)}function C(e){return"undefined"!=typeof window?requestAnimationFrame(e):-1}var j=function(e){var t=e;return t&&t.getBoundingClientRect?t.getBoundingClientRect():{top:0,left:0,right:0,bottom:0,width:0,height:0}},z=function(e,t){return 32-new Date(e,t-1,32).getDate()},A=function(){return new Date},F=function(){return new Date(A().getTime()+15552e6)},I=':host {\n width: 100%;\n display: block;\n font-family: var(--calendar-font-family, PingFangSC-Regular, PingFang SC);\n -webkit-tap-highlight-color: transparent;\n}\n\n:host .quark-calendar {\n display: flex;\n flex-direction: column;\n height: var(--calendar-height, 80vh);\n background: var(--calendar-background-color, #ffffff);\n}\n\n:host([position="left"]) .quark-calendar {\n height: var(--calendar-height, 100%);\n}\n\n:host([position="right"]) .quark-calendar {\n height: var(--calendar-height, 100%);\n}\n\n:host([tiled]) .quark-calendar {\n height: var(--calendar-height, auto);\n}\n\n:host .quark-calendar-header {\n flex-shrink: 0;\n z-index: 2;\n position: relative;\n box-shadow: 0 0.53333vw 2.66667vw rgba(125, 126, 128, 0.16);\n}\n\n:host .quark-calendar-month-title {\n color: var(--calendar-month-title-color, #242729); \n height: var(--calendar-month-title-row-height, 11.73333vw);\n line-height: var(--calendar-month-title-row-height, 11.73333vw);\n font-weight: var(--calendar-month-title-font-weight, 500);\n font-size: var(--calendar-month-title-font-size, 3.73333vw);\n text-align: center;\n}\n\n:host .quark-calendar-header-title {\n color: var(--calendar-title-color, #242729); \n height: var(--calendar-title-row-height, 11.73333vw);\n line-height: var(--calendar-title-row-height, 11.73333vw);\n font-weight: var(--calendar-title-font-weight, 500);\n font-size: var(--calendar-title-font-size, 4.26667vw);\n text-align: center;\n}\n\n:host .quark-calendar-header-subtitle {\n color: var(--calendar-subtitle-color, #242729); \n height: var(--calendar-subtitle-row-height, 11.73333vw);\n line-height: var(--calendar-subtitle-row-height, 11.73333vw);\n font-weight: var(--calendar-subtitle-font-weight, 500);\n font-size: var(--calendar-subtitle-font-size, 3.73333vw);\n text-align: center;\n}\n\n:host .quark-calendar-weekdays {\n display: flex;\n}\n\n:host .quark-calendar-weekday {\n flex: 1;\n font-size: var(--calendar-weekday-font-size, 3.2vw);\n line-height: 8vw;\n text-align: center;\n}\n\n:host .quark-calendar-body {\n flex: 1;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n:host .quark-calendar-body::-webkit-scrollbar {\n display: none;\n}\n\n:host .quark-calendar-days {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n user-select: none;\n}\n\n:host .quark-calendar-month-mark {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 0;\n color: rgba(242, 243, 245, 0.8);;\n font-size: 42.66667vw;\n transform: translate(-50%, -50%);\n pointer-events: none;\n}\n\n:host .quark-calendar-day,\n:host .quark-calendar-selected-day {\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\n:host .quark-calendar-day {\n position: relative;\n width: 14.285%;\n height: var(--calendar-day-row-height, 17.06667vw);\n font-size: var(--calendar-day-font-size, 4.26667vw);\n margin-bottom: 1.06667vw;\n cursor: pointer;\n}\n\n:host .quark-calendar-day-end,\n:host .quark-calendar-day-start,\n:host .quark-calendar-day-start-end,\n:host .quark-calendar-day-multiple-middle,\n:host .quark-calendar-day-multiple-selected {\n color: var(--calendar-day-selected-color, #fff);\n background: var(--calendar-theme-color, #0088ff);\n}\n\n:host .quark-calendar-day-start {\n border-radius: var(--calendar-day-border-radius, 1.6vw) 0 0 var(--calendar-day-border-radius, 1.6vw);\n}\n\n:host .quark-calendar-day-end {\n border-radius: 0 var(--calendar-day-border-radius, 1.6vw) var(--calendar-day-border-radius, 1.6vw) 0;\n}\n\n:host .quark-calendar-day-start-end,\n:host .quark-calendar-day-multiple-selected {\n border-radius: var(--calendar-day-border-radius, 1.6vw);\n}\n\n:host .quark-calendar-day-middle {\n color: var(--calendar-theme-color, #0088ff);\n}\n\n:host .quark-calendar-day-middle::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: currentColor;\n opacity: 0.1;\n content: \'\';\n}\n\n:host .quark-calendar-day-disabled {\n color: var(--calendar-day-disabled-color, #bbbbbb);\n cursor: default;\n}\n\n:host .quark-calendar-top-info,\n:host .quark-calendar-bottom-info {\n position: absolute;\n right: 0;\n left: 0;\n font-size: 2.66667vw;\n line-height: 3.73333vw;\n overflow:hidden;\n text-overflow:ellipsis;\n white-space:nowrap;\n @media (max-width: 350px) {\n font-size: 2.4vw;\n }\n}\n\n:host .quark-calendar-top-info {\n top: 1.6vw;\n}\n\n:host .quark-calendar-bottom-info {\n bottom: 1.6vw;\n}\n\n:host .quark-calendar-selected-day {\n width: 14.4vw;\n height: 14.4vw;\n color: var(--calendar-day-selected-color, #fff);\n background: var(--calendar-theme-color, #0088ff);\n border-radius: var(--calendar-day-border-radius, 1.6vw);\n}\n\n:host .quark-calendar-footer {\n flex-shrink: 0;\n margin: 2.13333vw 0;\n padding-left: var(--calendar-footer-padding, 4.26667vw);\n padding-right: var(--calendar-footer-padding, 4.26667vw);\n}\n\n:host .quark-calendar-button {\n --quark-theme-color: var(--calendar-theme-color, #0088ff);\n}\n\n:host .quark-calendar-pop-up {\n --popup-max-width: 100%;\n}';function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}var S=function(t){i(o,s);var a=O(o);function o(){var t;n(this,o);for(var r=arguments.length,i=new Array(r),c=0;c<r;c++)i[c]=arguments[c];return t=a.call.apply(a,[this].concat(i)),p(l(t),"title",""),p(l(t),"offset",0),p(l(t),"shouldRender",!1),p(l(t),"placeholders",[]),p(l(t),"days",[]),p(l(t),"daysRef",d()),p(l(t),"monthRef",d()),p(l(t),"setValue",(function(e){t.currentDate=e,t.setDays()})),p(l(t),"setFormatter",(function(e){t.formatter=e})),p(l(t),"setVisible",(function(e){e!==t.visible&&(t.visible=e,t.setShouldRender())})),p(l(t),"getTitle",(function(){return t.title})),p(l(t),"getDisabledDays",(function(){return t.days.filter((function(e){return"disabled"===e.type}))})),p(l(t),"setTitle",(function(){t.title=y.current.calendar.monthTitle(t.innerDate.getFullYear(),t.innerDate.getMonth()+1)})),p(l(t),"setTotalDay",(function(){var e=l(t).innerDate;t.totalDay=z(e.getFullYear(),e.getMonth()+1)})),p(l(t),"setShouldRender",(function(){var e=t.visible||!t.lazyrender;e!==t.shouldRender&&(t.shouldRender=e)})),p(l(t),"setOffset",(function(){var e=l(t),n=e.innerDate,r=e.weekfirstday,a=n.getDay();if(r)return(a+7-r)%7;t.offset=a})),p(l(t),"setPlaceholders",(function(){t.placeholders=Array(Math.ceil((t.totalDay+(t.offset||0))/7)).fill({type:"placeholder"})})),p(l(t),"setDays",(function(){for(var e=l(t),n=e.innerDate,r=e.totalDay,a=[],o=n.getFullYear(),i=n.getMonth(),d=1;d<=r;d++){var s=new Date(o,i,d),c=t.getDayType(s),u={date:s,type:c,text:d,bottomInfo:t.getBottomInfo(c)};t.formatter&&(u=t.formatter(u)),a.push(u)}t.days=a})),p(l(t),"getMultipleDayType",(function(e){var n=function(e){return t.currentDate.some((function(t){return 0===g(t,e)}))};if(n(e)){var r=w(e),a=q(e),o=n(r),i=n(a);return o&&i?"multiple-middle":o?"end":i?"start":"multiple-selected"}return""})),p(l(t),"getRangeDayType",(function(n){var r=e(t.currentDate,2),a=r[0],o=r[1];if(!a)return"";var i=g(n,a);if(!o)return 0===i?"start":"";var l=g(n,o);return t.allowsameday&&0===i&&0===l?"start-end":0===i?"start":0===l?"end":i>0&&l<0?"middle":""})),p(l(t),"getDayType",(function(e){var n=l(t),r=n.type,a=n.innerMinDate,o=n.innerMaxDate,i=n.currentDate;if(a&&o){if(g(e,a)<0||g(e,o)>0)return"disabled";if(!i)return"";if(Array.isArray(i)){if("multiple"===r)return t.getMultipleDayType(e);if("range"===r)return t.getRangeDayType(e)}else if("single"===r)return 0===g(e,i)?"selected":"";return""}})),p(l(t),"getBottomInfo",(function(e){var n=y.current.calendar;if("range"===t.type){if("start"===e||"end"===e)return n[e];if("start-end"===e)return"".concat(n.start,"/").concat(n.end)}})),p(l(t),"onClickDay",(function(e){"disabled"!==e.type&&t.$emit("clickday",{detail:{item:e}})})),p(l(t),"scrollToDate",(function(e,n){var r=l(t),a=r.daysRef,o=r.placeholders,i=r.offset;if(a){var d=j(a.current),s=o.length,c=(Math.ceil((n.getDate()+i)/7)-1)*d.height/s;B(e,d.top+c+e.scrollTop-j(e).top)}})),p(l(t),"renderDay",(function(e,n){var r,a=l(t).offset,o={};"placeholder"===e.type?o.width="100%":(0===n&&(o.marginLeft="".concat(100*a/7,"%")),a+((null===(r=e.date)||void 0===r?void 0:r.getDate())||1)>28&&(o.marginBottom=0));var i=e.type,d=e.text,c=e.topInfo,u=e.bottomInfo;if("placeholder"===i)return s.h("div",{class:"quark-calendar-day",style:o});var f=[s.h("div",{class:"quark-calendar-top-info"},c),d,s.h("div",{class:"quark-calendar-bottom-info"},u)],h="quark-calendar-day";return i&&(h+=" quark-calendar-day-".concat(i)),s.h("div",{role:"gridcell",style:o,class:h,tabindex:"disabled"===i?void 0:-1,onClick:function(){return t.onClickDay(e)}},"selected"===i?s.h("div",{class:"quark-calendar-selected-day"},f):f)})),t}return r(o,[{key:"componentDidUpdate",value:function(e,t,n){"maxdate"===e&&t!==n&&(this.innerMaxDate=new Date(n),this.setDays()),"mindate"===e&&t!==n&&(this.innerMinDate=new Date(n),this.setDays()),"date"===e&&t!==n&&(this.innerDate=new Date(n),this.setTitle(),this.setTotalDay(),this.setOffset(),this.setPlaceholders(),this.setDays())}},{key:"render",value:function(){var e=this,t=this.showmonthtitle,n=this.hidemark,r=this.shouldRender,a=this.days,o=this.placeholders,i=this.innerDate,l=this.daysRef;return s.h("div",{class:"quark-calendar-month"},t&&s.h("div",{class:"quark-calendar-month-title"},this.title),s.h("div",{ref:l,role:"grid",class:"quark-calendar-days"},!n&&r&&s.h("div",{class:"quark-calendar-month-mark"},i&&i.getMonth()+1),(r?a:o).map((function(t,n){return e.renderDay(t,n)}))))}}]),o}();c([u({type:Number})],S.prototype,"date",void 0),c([u({type:Number})],S.prototype,"maxdate",void 0),c([u({type:Number})],S.prototype,"mindate",void 0),c([u()],S.prototype,"type",void 0),c([u({type:Number})],S.prototype,"weekfirstday",void 0),c([u({type:Boolean})],S.prototype,"hidemark",void 0),c([u({type:Boolean})],S.prototype,"lazyrender",void 0),c([u({type:Boolean})],S.prototype,"allowsameday",void 0),c([u({type:Boolean})],S.prototype,"showmonthtitle",void 0),c([f()],S.prototype,"visible",void 0),c([f()],S.prototype,"title",void 0),c([f()],S.prototype,"offset",void 0),c([f()],S.prototype,"totalDay",void 0),c([f()],S.prototype,"shouldRender",void 0),c([f()],S.prototype,"placeholders",void 0),c([f()],S.prototype,"days",void 0);S=c([h({tag:"quark-calendar-month",style:I})],S);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}var V=function(a){i(c,s);var o=P(c);function c(){var r;n(this,c);for(var a=arguments.length,i=new Array(a),u=0;u<a;u++)i[u]=arguments[u];return r=o.call.apply(o,[this].concat(i)),p(l(r),"open",!1),p(l(r),"type","single"),p(l(r),"title",y.current.calendar.title),p(l(r),"square",!1),p(l(r),"readonly",!1),p(l(r),"tiled",!1),p(l(r),"position","bottom"),p(l(r),"hidemark",!1),p(l(r),"hidetitle",!1),p(l(r),"hidesubtitle",!1),p(l(r),"hiderangeprompt",!1),p(l(r),"allowsameday",!1),p(l(r),"hideconfirm",!1),p(l(r),"forbidmaskclick",!1),p(l(r),"eagerrender",!1),p(l(r),"weekfirstday",0),p(l(r),"dayOffset",0),p(l(r),"subtitle",""),p(l(r),"months",[]),p(l(r),"btnDisabled",!0),p(l(r),"innerMinDate",A()),p(l(r),"innerMaxDate",F()),p(l(r),"bodyRef",d()),p(l(r),"monthRefs",[]),p(l(r),"init",(function(){(r.tiled||r.open)&&(C((function(){var e=r.bodyRef.current;if(e){var t=j(e).height;r.bodyHeight=Math.floor(t)}})),r.scrollToCurrentDate())})),p(l(r),"setValue",(function(e){var t=r.getInitialDate(e);t!==r.currentDate&&(r.currentDate=t,r.scrollToCurrentDate())})),p(l(r),"initInnerData",(function(){r.maxdate&&(r.innerMaxDate=new Date(r.maxdate)),r.mindate&&(r.innerMinDate=new Date(r.mindate)),r.dayOffset=(r.weekfirstday||0)%7,r.setMonths(),r.setBtnDisabled()})),p(l(r),"setMonths",(function(){var e=[],t=new Date(r.innerMinDate);t.setDate(1);do{e.push(new Date(t)),t.setMonth(t.getMonth()+1)}while(1!==m(t,r.innerMaxDate));r.months=e})),p(l(r),"setBtnDisabled",(function(){var e=!r.currentDate;r.currentDate&&("range"===r.type?e=!r.currentDate[0]||!r.currentDate[1]:"multiple"===r.type&&(e=!r.currentDate.length)),e!==r.btnDisabled&&(r.btnDisabled=e)})),p(l(r),"limitDateRange",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.innerMinDate,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.innerMaxDate;return-1===g(e,t)?t:1===g(e,n)?n:e})),p(l(r),"getInitialDate",(function(e){var t=l(r),n=t.type,a=t.allowsameday,o=t.innerMinDate,i=t.innerMaxDate;if(!e)return null;var d=x();return"range"===n?(Array.isArray(e)||(e=[]),[r.limitDateRange(e[0]||d,o,a?i:w(i)),r.limitDateRange(e[1]||d,a?o:q(o))]):"multiple"===n?Array.isArray(e)?e.map((function(e){return r.limitDateRange(e)})):[r.limitDateRange(d)]:(e&&!Array.isArray(e)||(e=d),r.limitDateRange(e))})),p(l(r),"onScroll",(function(){var e=T(r.bodyRef.current),t=e+r.bodyHeight,n=r.getMonthHeights();if(!(t>n.reduce((function(e,t){return e+t}),0)&&e>0)){for(var a=0,o=null,i=[-1,-1],l=0;l<r.months.length;l++){a<=t&&a+n[l]>=e&&(i[1]=l,null===o&&(o=l,i[0]=l)),a+=n[l]}if(r.months.forEach((function(e,t){var n=t>=i[0]-1&&t<=i[1]+1;r.monthRefs[t].current.setVisible(n)})),null!==o){var d=r.monthRefs[o].current.getTitle();d!==r.subtitle&&(r.subtitle=d)}}})),p(l(r),"scrollToDate",(function(e){C((function(){r.months.some((function(t,n){return 0===m(t,e)&&(r.bodyRef.current&&r.monthRefs[n].current.scrollToDate(r.bodyRef.current,e),!0)})),r.onScroll()}))})),p(l(r),"scrollToCurrentDate",(function(){if(r.tiled||r.open)if(r.currentDate){var e="single"===r.type?r.currentDate:r.currentDate[0];M(e)&&r.scrollToDate(e)}else C(r.onScroll)})),p(l(r),"checkRange",(function(e){var t=l(r),n=t.maxrange,a=t.rangeprompt,o=t.hiderangeprompt;return!(n&&R(e)>+n)||(o||v.text(a||y.current.calendar.rangePrompt(n)),r.$emit("overrange"),!1)})),p(l(r),"onConfirm",(function(){return r.$emit("confirm",{detail:{value:b(r.currentDate)}})})),p(l(r),"select",(function(e,t){var n=function(e){r.currentDate=e,r.$emit("select",{detail:{value:b(e)}})};if(t&&"range"===r.type&&!r.checkRange(e))return void n([e[0],k(e[0],+r.maxrange-1)]);n(e),t&&r.hideconfirm&&r.onConfirm()})),p(l(r),"getDisabledDate",(function(e,n){var a;return null===(a=r.months.reduce((function(e,n,a){var o;return e.push.apply(e,t(null!==(o=r.monthRefs[a].current.getDisabledDays())&&void 0!==o?o:[])),e}),[]).find((function(t){return-1===g(e,t.date)&&-1===g(t.date,n)})))||void 0===a?void 0:a.date})),p(l(r),"onClickDay",(function(n){var a=n.detail.item;if(!r.readonly&&a.date){var o=a.date,i=l(r).type;if("range"===i){if(!r.currentDate)return void r.select([o]);var d=e(r.currentDate,2),s=d[0],c=d[1];if(s&&!c){var u=g(o,s);if(1===u){var f=r.getDisabledDate(s,o);if(f){var h=w(f);-1===g(s,h)?r.select([s,h]):r.select([o])}else r.select([s,o],!0)}else-1===u?r.select([o]):r.allowsameday&&r.select([o,o],!0)}else r.select([o])}else if("multiple"===i){if(!r.currentDate)return void r.select([o]);var p=r.currentDate,y=p.findIndex((function(e){return 0===g(e,o)}));if(-1!==y){var m=p.splice(y,1),b=e(m,1)[0];r.$emit("unselect",{detail:{value:D(b)}})}else r.maxrange&&p.length>=+r.maxrange?v.text(r.rangeprompt):r.select([].concat(t(p),[o]))}else r.select(o,!0)}})),p(l(r),"setMonthRef",(function(e){return r.monthRefs[e]||(r.monthRefs[e]=d()),r.monthRefs[e]})),p(l(r),"renderMonth",(function(e,t){var n=0!==t||r.hidesubtitle;return s.h("quark-calendar-month",{ref:r.setMonthRef(t),date:e.getTime(),maxdate:r.innerMaxDate.getTime(),mindate:r.innerMinDate.getTime(),weekfirstday:r.dayOffset,type:r.type,hidemark:r.hidemark,lazyrender:!r.eagerrender,allowsameday:r.allowsameday,showmonthtitle:n,onclickday:r.onClickDay})})),p(l(r),"getMonthHeights",(function(){return r.months.map((function(e,t){return j(r.monthRefs[t].current).height}))})),p(l(r),"renderFooterButton",(function(){if(!r.hideconfirm){var e=r.btnDisabled,t=e?r.confirmdisabledtext:r.confirmtext;return s.h("slot",{name:"footer"},s.h("quark-button",{class:"quark-calendar-button",type:"primary",size:"big",disabled:e,nativeType:"button",onClick:r.onConfirm},t||y.current.confirm))}})),p(l(r),"renderFooter",(function(){return s.h("div",{class:"quark-calendar-footer",part:"footer"},r.renderFooterButton())})),p(l(r),"renderHeader",(function(){var e=l(r).weekfirstday,n=y.current.calendar.weekdays,a=[].concat(t(n.slice(e,7)),t(n.slice(0,e)));return s.h("div",{class:"quark-calendar-header",part:"header"},!r.hidetitle&&s.h("div",{class:"quark-calendar-header-title",part:"title"},s.h("slot",{name:"title"},r.title)),!r.hidesubtitle&&s.h("div",{class:"quark-calendar-header-subtitle",part:"sub-title"},s.h("slot",{name:"subtitle"},r.subtitle)),s.h("div",{class:"quark-calendar-weekdays",part:"weekdays"},a.map((function(e){return s.h("span",{class:"quark-calendar-weekday",part:"weekday"},e)}))))})),p(l(r),"renderCalendar",(function(){return s.h("div",{class:"quark-calendar",part:"calendar"},r.renderHeader(),s.h("div",{ref:r.bodyRef,class:"quark-calendar-body",part:"body",onScroll:r.onScroll},r.months.map(r.renderMonth)),r.renderFooter())})),p(l(r),"closePop",(function(){r.$emit("close")})),r}return r(c,[{key:"componentDidMount",value:function(){this.initInnerData(),this.init()}},{key:"componentDidUpdate",value:function(e,t,n){var r=this;"mindate"===e&&t!==n&&(this.innerMinDate=n?new Date(n):A(),this.setValue(this.currentDate),this.setMonths()),"maxdate"===e&&t!==n&&(this.innerMaxDate=n?new Date(n):F(),this.setValue(this.currentDate),this.setMonths()),"type"===e&&t!==n&&this.setValue(this.currentDate),"weekfirstday"===e&&t!==n&&(this.dayOffset=(n||0)%7),"open"===e&&t!==n&&n&&this.init(),"currentDate"===e&&t!==n&&(this.months.forEach((function(e,t){r.monthRefs[t].current.setValue(n)})),this.setBtnDisabled())}},{key:"getValue",value:function(){return this.currentDate}},{key:"setFormatter",value:function(e){var t=this;this.months.forEach((function(n,r){t.monthRefs[r].current.setFormatter(e)}))}},{key:"render",value:function(){return this.tiled?this.renderCalendar():s.h("quark-popup",{class:"quark-calendar-pop-up",position:this.position,round:!this.square,closeable:!this.hidetitle||!this.hidesubtitle,safearea:!0,forbidmaskclick:this.forbidmaskclick,open:this.open,onClose:this.closePop,part:"root"},this.renderCalendar())}}]),c}();c([u({type:Boolean})],V.prototype,"open",void 0),c([u()],V.prototype,"type",void 0),c([u()],V.prototype,"title",void 0),c([u({type:Boolean})],V.prototype,"square",void 0),c([u({type:Boolean})],V.prototype,"readonly",void 0),c([u({type:Boolean})],V.prototype,"tiled",void 0),c([u()],V.prototype,"maxrange",void 0),c([u()],V.prototype,"position",void 0),c([u()],V.prototype,"mindate",void 0),c([u()],V.prototype,"maxdate",void 0),c([u({type:Boolean})],V.prototype,"hidemark",void 0),c([u({type:Boolean})],V.prototype,"hidetitle",void 0),c([u({type:Boolean})],V.prototype,"hidesubtitle",void 0),c([u()],V.prototype,"rangeprompt",void 0),c([u({type:Boolean})],V.prototype,"hiderangeprompt",void 0),c([u({type:Boolean})],V.prototype,"allowsameday",void 0),c([u({type:Boolean})],V.prototype,"hideconfirm",void 0),c([u({type:Boolean})],V.prototype,"forbidmaskclick",void 0),c([u({type:Boolean})],V.prototype,"eagerrender",void 0),c([u()],V.prototype,"confirmtext",void 0),c([u()],V.prototype,"confirmdisabledtext",void 0),c([u({type:Number})],V.prototype,"weekfirstday",void 0),c([f()],V.prototype,"currentDate",void 0),c([f()],V.prototype,"dayOffset",void 0),c([f()],V.prototype,"subtitle",void 0),c([f()],V.prototype,"months",void 0),c([f()],V.prototype,"btnDisabled",void 0),c([f()],V.prototype,"innerMinDate",void 0),c([f()],V.prototype,"innerMaxDate",void 0);var N=V=c([h({tag:"quark-calendar",style:I})],V);export{N as default};