t-fighting-design
Version:
Fighting design can quickly build interactive interfaces in vue3 applications, which looks good.
2 lines (1 loc) • 3.4 kB
JavaScript
;var z=Object.defineProperty;var H=(N,t,e)=>t in N?z(N,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):N[t]=e;var c=(N,t,e)=>(H(N,typeof t!="symbol"?t+"":t,e),e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./index10.js"),r=class{constructor(){c(this,"getLunarDetail",(t,e,u)=>{let s=parseInt(t.toString()),n=parseInt(e.toString()),l=parseInt(u.toString());if(s<1900||s>2100||s===1900&&n===1&&l<31)return-1;let A;s?A=new Date(s,parseInt(n.toString())-1,l):A=new Date;let i,h=0,g=0;s=A.getFullYear(),n=A.getMonth()+1,l=A.getDate();let D=(Date.UTC(A.getFullYear(),A.getMonth(),A.getDate())-Date.UTC(1900,0,31))/864e5;for(i=1900;i<2101&&D>0;i++)g=r.getLunarYearDays(i),D-=g;D<0&&(D+=g,i--);const F=new Date;let S=!1;F.getFullYear()===s&&F.getMonth()+1===n&&F.getDate()===l&&(S=!0);let T=A.getDay();const O=a.CONVERT_DIGIT_CHINES[T];T===0&&(T=7);const C=i;h=r.leapMonth(i);let f=!1;for(i=1;i<13&&D>0;i++)h>0&&i===h+1&&f===!1?(--i,f=!0,g=r.leapDays(C)):g=r.monthDays(C,i),f===!0&&i===h+1&&(f=!1),D-=g;D===0&&h>0&&i===h+1&&(f?f=!1:(f=!0,--i)),D<0&&(D+=g,--i);const E=i,I=D+1,Y=n-1,m=r.toGanZhiYear(C),p=r.getTerm(s,n*2-1),b=r.getTerm(s,n*2);let _=r.toGanZhi((s-1900)*12+n+11);l>=p&&(_=r.toGanZhi((s-1900)*12+n+12));let R=!1,y=null;p===l&&(R=!0,y=a.SOLAR_TERM[n*2-2]),b===l&&(R=!0,y=a.SOLAR_TERM[n*2-1]);const G=Date.UTC(s,Y,1,0,0,0,0)/864e5+25567+10,U=r.toGanZhi(G+l-1),L=r.toConstellation(n,l),Z=s+"-"+n+"-"+l,k=C+"-"+E+"-"+I,d=n+"-"+l;let M=E+"-"+I;return E===12&&I===29&&r.monthDays(C,E)===29&&(M="12-30"),{date:Z,lunarDate:k,festival:a.SOLAR_CALENDAR_FESTIVE[d]?a.SOLAR_CALENDAR_FESTIVE[d].title:"",lunarFestival:a.LUNAR_FESTIVE[M]?a.LUNAR_FESTIVE[M].title:"",lYear:C,lMonth:E,lDay:I,animal:r.getAnimal(C),IMonthCn:(f?"\u95F0":"")+r.toChinaMonth(E),IDayCn:r.toChinaDay(I),cYear:s,cMonth:n,cDay:l,gzYear:m,gzMonth:_,gzDay:U,isToday:S,isLeap:f,nWeek:T,ncWeek:"\u661F\u671F"+O,isTerm:R,Term:y,constellation:L}})}};let o=r;c(o,"getLunarYearDays",t=>{let e,u=348;for(e=32768;e>8;e>>=1)u+=a.LUNAR_INFO[t-1900]&e?1:0;return u+r.leapDays(t)}),c(o,"leapMonth",t=>a.LUNAR_INFO[t-1900]&15),c(o,"leapDays",t=>r.leapMonth(t)?a.LUNAR_INFO[t-1900]&65536?30:29:0),c(o,"monthDays",(t,e)=>e>12||e<1?-1:a.LUNAR_INFO[t-1900]&65536>>e?30:29),c(o,"toGanZhiYear",t=>{let e=(t-3)%10,u=(t-3)%12;return e===0&&(e=10),u===0&&(u=12),a.DAY_GAN[e-1]+a.DAY_ZHI[u-1]}),c(o,"toConstellation",(t,e)=>{const u="\u9B54\u7FAF\u6C34\u74F6\u53CC\u9C7C\u767D\u7F8A\u91D1\u725B\u53CC\u5B50\u5DE8\u87F9\u72EE\u5B50\u5904\u5973\u5929\u79E4\u5929\u874E\u5C04\u624B\u9B54\u7FAF",s=[20,19,21,21,21,22,23,23,23,23,22,22];return u.substr(t*2-(e<s[t-1]?2:0),2)+"\u5EA7"}),c(o,"toGanZhi",t=>a.DAY_GAN[t%10]+a.DAY_ZHI[t%12]),c(o,"getTerm",(t,e)=>{if(t<1900||t>2100||e<1||e>24)return-1;const u=a.SOLAR_TERM_LIST[t-1900],s=[];for(let n=0;n<u.length;n+=5){const l=parseInt("0x"+u.substr(n,5)).toString();s.push(l[0],l.substr(1,2),l[3],l.substr(4,2))}return parseInt(s[e-1])}),c(o,"toChinaMonth",t=>{if(t>12||t<1)return-1;let e=a.CHANG_MONTH_LUNAR_CALENDAR[t-1];return e+="\u6708",e}),c(o,"toChinaDay",t=>{let e;switch(t){case 10:e="\u521D\u5341";break;case 20:e="\u4E8C\u5341";break;case 30:e="\u4E09\u5341";break;default:e=a.DATE_CHANG_LUNAR_CALENDAR[Math.floor(t/10)],e+=a.CONVERT_DIGIT_CHINES[t%10]}return e}),c(o,"getAnimal",t=>a.ANIMALS[(t-4)%12]);exports.Lunar=o;