genus-ui 2.60.60 → 2.60.61
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.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1382,7 +1382,7 @@ var Yr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, it = (i, t
|
|
|
1382
1382
|
};
|
|
1383
1383
|
let q = class extends V {
|
|
1384
1384
|
constructor() {
|
|
1385
|
-
super(...arguments), this.labelText = "", this.inputValue = "", this.inputName = "", this.inputIcon = "", this.leftArrowIcon = "", this.rightArrowIcon = "", this.placeholderText = "", this.withoutLabel = !1, this.displayPosition = "bottom", this.enableRange = !1, this.disablePastDates = !
|
|
1385
|
+
super(...arguments), this.labelText = "", this.inputValue = "", this.inputName = "", this.inputIcon = "", this.leftArrowIcon = "", this.rightArrowIcon = "", this.placeholderText = "", this.withoutLabel = !1, this.displayPosition = "bottom", this.enableRange = !1, this.disablePastDates = !1, this.dropDownIcon = "", this._monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], this._currentMonth = (/* @__PURE__ */ new Date()).getMonth(), this._currentYear = (/* @__PURE__ */ new Date()).getFullYear(), this._showCalenderCssClass = "", this._rangeStartDate = null, this._rangeEndDate = null, this.isLeapYear = (i) => i % 4 === 0 && i % 100 !== 0 && i % 400 !== 0 || i % 100 === 0 && i % 400 === 0, this.getFebDays = (i) => this.isLeapYear(i) ? 29 : 28, this.toggleCalendar = () => {
|
|
1386
1386
|
this._showCalenderCssClass = this._showCalenderCssClass ? "" : `calendar-${this.displayPosition}--show`;
|
|
1387
1387
|
}, this.isDateDisabled = (i, t, e) => {
|
|
1388
1388
|
if (!this.disablePastDates) return !1;
|
package/dist/index.umd.js
CHANGED
|
@@ -1024,7 +1024,7 @@
|
|
|
1024
1024
|
<li class='options__list-item' option-value=${this.optionValue}>
|
|
1025
1025
|
<slot></slot>
|
|
1026
1026
|
</li>
|
|
1027
|
-
`}};ye.styles=[U,Pn,Sn],Tn([m.property({attribute:"option-value"})],ye.prototype,"optionValue",2),ye=Tn([m.customElement("genus-dropdown-option")],ye);var ar=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,X=(i,t,e,n)=>{for(var s=n>1?void 0:n?rr(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&ar(t,e,s),s};f.GenusDatePicker=class extends u.LitElement{constructor(){super(...arguments),this.labelText="",this.inputValue="",this.inputName="",this.inputIcon="",this.leftArrowIcon="",this.rightArrowIcon="",this.placeholderText="",this.withoutLabel=!1,this.displayPosition="bottom",this.enableRange=!1,this.disablePastDates=!
|
|
1027
|
+
`}};ye.styles=[U,Pn,Sn],Tn([m.property({attribute:"option-value"})],ye.prototype,"optionValue",2),ye=Tn([m.customElement("genus-dropdown-option")],ye);var ar=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,X=(i,t,e,n)=>{for(var s=n>1?void 0:n?rr(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(n?a(t,e,s):a(s))||s);return n&&s&&ar(t,e,s),s};f.GenusDatePicker=class extends u.LitElement{constructor(){super(...arguments),this.labelText="",this.inputValue="",this.inputName="",this.inputIcon="",this.leftArrowIcon="",this.rightArrowIcon="",this.placeholderText="",this.withoutLabel=!1,this.displayPosition="bottom",this.enableRange=!1,this.disablePastDates=!1,this.dropDownIcon="",this._monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],this._currentMonth=new Date().getMonth(),this._currentYear=new Date().getFullYear(),this._showCalenderCssClass="",this._rangeStartDate=null,this._rangeEndDate=null,this.isLeapYear=t=>t%4===0&&t%100!==0&&t%400!==0||t%100===0&&t%400===0,this.getFebDays=t=>this.isLeapYear(t)?29:28,this.toggleCalendar=()=>{this._showCalenderCssClass=this._showCalenderCssClass?"":`calendar-${this.displayPosition}--show`},this.isDateDisabled=(t,e,n)=>{if(!this.disablePastDates)return!1;const s=new Date(n,e,t);s.setHours(0,0,0,0);const o=new Date;return o.setHours(0,0,0,0),s<o},this.selectDate=t=>{const e=new Date(t);this.enableRange?!this._rangeStartDate||this._rangeStartDate&&this._rangeEndDate?(this._rangeStartDate=e,this._rangeEndDate=null,this.inputValue=`${this.formatDate(e)}`):this._rangeStartDate&&!this._rangeEndDate&&(e<this._rangeStartDate?(this._rangeStartDate=e,this.inputValue=`${this.formatDate(e)}`):(this._rangeEndDate=e,this.inputValue=`${this.formatDate(this._rangeStartDate)} - ${this.formatDate(this._rangeEndDate)}`,this.closeCalendar())):(this._rangeStartDate=e,this._rangeEndDate=null,this.inputValue=`${e.toLocaleString("default",{weekday:"long"})}, ${t.getDate()} ${this._monthNames[t.getMonth()]} ${t.getFullYear()}`,this.closeCalendar()),this._internals.setFormValue(e.toString()),this.dispatchEvent(new CustomEvent("selected",{detail:{chosenDate:e,startDate:this._rangeStartDate,endDate:this._rangeEndDate,formattedDate:this.inputValue}}))},this.getDaysArray=(t,e)=>{const n=[31,this.getFebDays(e),31,30,31,30,31,31,30,31,30,31],s=new Date(e,t,1),o=n[t];let a=s.getDay()-1;a===-1&&(a=6);const r=[],l=t===0?11:t-1,c=t===0?e-1:e,A=((D,M)=>D===1?this.isLeapYear(M)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][D])(l,c);for(let D=0;D<a;D++){const M=A-a+D+1,x=new Date(c,l,M),y=this.isDateDisabled(M,l,c);let v=["date","date--sibling-month"];y&&v.push("date--disabled"),this.enableRange?(this._rangeStartDate&&this.isSameDate(x,this._rangeStartDate)&&v.push("date--range-start"),this._rangeEndDate&&this.isSameDate(x,this._rangeEndDate)&&v.push("date--range-end"),this._rangeStartDate&&this._rangeEndDate&&x>this._rangeStartDate&&x<this._rangeEndDate&&v.push("date--range-intermediate")):this._rangeStartDate&&this.isSameDate(x,this._rangeStartDate)&&v.push("date--selected"),r.push({day:M,classes:v.join(" "),disabled:y,date:x})}for(let D=1;D<=o;D++){const M=D,x=this.isDateDisabled(M,t,e),y=new Date(e,t,M);let v=["date"];this.isSameDate(y,new Date)&&v.push("current-date"),x&&v.push("date--disabled"),this.enableRange?(this._rangeStartDate&&this.isSameDate(y,this._rangeStartDate)&&v.push("date--range-start"),this._rangeEndDate&&this.isSameDate(y,this._rangeEndDate)&&v.push("date--range-end"),this._rangeStartDate&&this._rangeEndDate&&y>this._rangeStartDate&&y<this._rangeEndDate&&v.push("date--range-intermediate")):this._rangeStartDate&&this.isSameDate(y,this._rangeStartDate)&&v.push("date--selected"),r.push({day:M,classes:v.join(" "),disabled:x,date:y})}const d=r.length,p=(d<=35?35:42)-d,w=t===11?0:t+1,b=t===11?e+1:e;for(let D=1;D<=p;D++){const M=D,x=new Date(b,w,M),y=this.isDateDisabled(M,w,b);let v=["date","date--sibling-month"];y&&v.push("date--disabled"),this.enableRange?(this._rangeStartDate&&this.isSameDate(x,this._rangeStartDate)&&v.push("date--range-start"),this._rangeEndDate&&this.isSameDate(x,this._rangeEndDate)&&v.push("date--range-end"),this._rangeStartDate&&this._rangeEndDate&&x>this._rangeStartDate&&x<this._rangeEndDate&&v.push("date--range-intermediate")):this._rangeStartDate&&this.isSameDate(x,this._rangeStartDate)&&v.push("date--selected"),r.push({day:M,classes:v.join(" "),disabled:y,date:x})}return r},this.setYear=t=>{const e=parseInt(t.detail);this._currentYear=e},this.setMonth=t=>{const e=parseInt(t.detail);this._currentMonth=e},this.previousMonth=()=>{this._currentMonth===0?(this._currentMonth=11,this._currentYear--):this._currentMonth--},this.nextMonth=()=>{this._currentMonth===11?(this._currentMonth=0,this._currentYear++):this._currentMonth++}}isSameDate(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}formatDate(t){return`${t.getDate()} ${this._monthNames[t.getMonth()].substring(0,3)} ${t.getFullYear()}`}closeCalendar(){this._showCalenderCssClass=""}getYearList(){const t=new Date().getFullYear(),e=[];for(let n=t-50;n<=t+50;n++)e.push(n);return e}render(){const t=u.html`
|
|
1028
1028
|
<div class='calendar calendar-${this.displayPosition} ${this._showCalenderCssClass}'>
|
|
1029
1029
|
<div class='calendar__header'>
|
|
1030
1030
|
|