@aquera/nile-elements 0.0.72 → 0.0.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.iife.js +60 -50
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.esm.js +8 -5
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.css.esm.js +5 -0
- package/dist/nile-checkbox/nile-checkbox.esm.js +47 -45
- package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
- package/dist/src/nile-calendar/nile-calendar.js +11 -3
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.css.js +5 -0
- package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.d.ts +2 -0
- package/dist/src/nile-checkbox/nile-checkbox.js +52 -43
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-calendar/nile-calendar.ts +12 -6
- package/src/nile-checkbox/nile-checkbox.css.ts +5 -0
- package/src/nile-checkbox/nile-checkbox.ts +57 -50
package/README.md
CHANGED
@@ -79,6 +79,11 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
79
79
|
|
80
80
|
In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
81
81
|
|
82
|
+
#### Version 0.0.73
|
83
|
+
- Nile calendar - Now we can hide inputs
|
84
|
+
- Nile checkbox - Alignment issue fixed
|
85
|
+
- dependency: @aquera/nile@0.3.24
|
86
|
+
|
82
87
|
#### Version 0.0.72
|
83
88
|
- Nile hero - icon, collapse bug fix
|
84
89
|
- Nile icon - new icons added (trash-03, download-01, calendar-01, folder-01, workflow-01)
|
package/dist/index.iife.js
CHANGED
@@ -2216,6 +2216,11 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2216
2216
|
box-sizing: border-box;
|
2217
2217
|
}
|
2218
2218
|
|
2219
|
+
.checkbox__icon__container{
|
2220
|
+
display:flex;
|
2221
|
+
align-items:center;
|
2222
|
+
}
|
2223
|
+
|
2219
2224
|
.checkbox__label__text {
|
2220
2225
|
display: block;
|
2221
2226
|
font-size: 14px;
|
@@ -2249,53 +2254,55 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2249
2254
|
cursor: pointer;
|
2250
2255
|
margin-right: 12px;
|
2251
2256
|
}
|
2252
|
-
`;M.NileCheckbox=class extends kN{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.subLabel="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.errorMessage="",this.showHelpText=!1,this.form="",this.required=!1}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}))}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(M){this.input.focus(M)}blur(){this.input.blur()}connectedCallback(){super.connectedCallback(),this.updateHostClass(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}updated(M){super.updated(M),M.has("helpText")&&this.updateHostClass()}updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width")}render(){const M=!!this.helpText,N=!!this.errorMessage;return EM`
|
2257
|
+
`;M.NileCheckbox=class extends kN{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.subLabel="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.errorMessage="",this.showHelpText=!1,this.form="",this.required=!1}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}))}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(M){this.input.focus(M)}blur(){this.input.blur()}connectedCallback(){super.connectedCallback(),this.updateHostClass(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}updated(M){super.updated(M),M.has("helpText")&&this.updateHostClass(),this.checkboxIconContainer.style.height=this.labelContainer.scrollHeight+"px"}updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width")}render(){const M=!!this.helpText,N=!!this.errorMessage;return EM`
|
2253
2258
|
<label
|
2254
2259
|
part="base"
|
2255
|
-
class=${uN({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate})}
|
2260
|
+
class=${uN({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate})}
|
2256
2261
|
>
|
2257
|
-
<
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
|
2263
|
-
|
2264
|
-
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
|
2290
|
-
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
|
2262
|
+
<div class="checkbox__icon__container">
|
2263
|
+
<span
|
2264
|
+
part="control${this.checked?" control--checked":""}${this.indeterminate?" control--indeterminate":""}"
|
2265
|
+
class="checkbox__control"
|
2266
|
+
>
|
2267
|
+
<!-- An empty title prevents browser validation tooltips from appearing on hover -->
|
2268
|
+
<input
|
2269
|
+
class="checkbox__input"
|
2270
|
+
type="checkbox"
|
2271
|
+
title=${this.title}
|
2272
|
+
name=${this.name}
|
2273
|
+
value=${SN(this.value)}
|
2274
|
+
.indeterminate=${vN(this.indeterminate)}
|
2275
|
+
.checked=${vN(this.checked)}
|
2276
|
+
.disabled=${this.disabled}
|
2277
|
+
.required=${this.required}
|
2278
|
+
aria-checked=${this.checked?"true":"false"}
|
2279
|
+
@click=${this.handleClick}
|
2280
|
+
@input=${this.handleInput}
|
2281
|
+
@blur=${this.handleBlur}
|
2282
|
+
@focus=${this.handleFocus}
|
2283
|
+
/>
|
2284
|
+
${this.checked?EM`
|
2285
|
+
<nile-icon
|
2286
|
+
part="checked-icon"
|
2287
|
+
class="checkbox__checked-icon"
|
2288
|
+
color="white"
|
2289
|
+
library="system"
|
2290
|
+
name="tick"
|
2291
|
+
size="12"
|
2292
|
+
></nile-icon>
|
2293
|
+
`:""}
|
2294
|
+
${!this.checked&&this.indeterminate?EM`
|
2295
|
+
<nile-icon
|
2296
|
+
part="indeterminate-icon"
|
2297
|
+
class="checkbox__indeterminate-icon"
|
2298
|
+
library="system"
|
2299
|
+
color="white"
|
2300
|
+
name="minus"
|
2301
|
+
size="12"
|
2302
|
+
></nile-icon>
|
2303
|
+
`:""}
|
2304
|
+
</span>
|
2305
|
+
</div>
|
2299
2306
|
|
2300
2307
|
<div part="label" class="checkbox__label" style="${this.label||this.subLabel?"":"margin-left:0;"}">
|
2301
2308
|
${this.label?EM`<span class="checkbox__label__text">${this.label}</span>`:""}
|
@@ -2313,7 +2320,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
2313
2320
|
</nile-tooltip>
|
2314
2321
|
`:hM}
|
2315
2322
|
${N?EM`<nile-form-error-message>${this.errorMessage}</nile-form-error-message>`:hM}
|
2316
|
-
`}},M.NileCheckbox.styles=gD,N([KM('input[type="checkbox"]')],M.NileCheckbox.prototype,"input",void 0),N([_M()],M.NileCheckbox.prototype,"hasFocus",void 0),N([$M()],M.NileCheckbox.prototype,"title",void 0),N([$M()],M.NileCheckbox.prototype,"name",void 0),N([$M()],M.NileCheckbox.prototype,"value",void 0),N([$M({reflect:!0})],M.NileCheckbox.prototype,"size",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"disabled",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"checked",void 0),N([$M({type:String,reflect:!0})],M.NileCheckbox.prototype,"label",void 0),N([$M({type:String,reflect:!0,attribute:"sub-label"})],M.NileCheckbox.prototype,"subLabel",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"indeterminate",void 0),N([UN("checked")],M.NileCheckbox.prototype,"defaultChecked",void 0),N([$M({attribute:"help-text",reflect:!0})],M.NileCheckbox.prototype,"helpText",void 0),N([$M({attribute:"error-message",reflect:!0})],M.NileCheckbox.prototype,"errorMessage",void 0),N([$M({type:Boolean})],M.NileCheckbox.prototype,"showHelpText",void 0),N([$M({reflect:!0})],M.NileCheckbox.prototype,"form",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"required",void 0),N([hN(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],M.NileCheckbox.prototype,"handleStateChange",null),M.NileCheckbox=N([FM("nile-checkbox")],M.NileCheckbox);const eD=z`
|
2323
|
+
`}},M.NileCheckbox.styles=gD,N([KM('input[type="checkbox"]')],M.NileCheckbox.prototype,"input",void 0),N([_M()],M.NileCheckbox.prototype,"hasFocus",void 0),N([$M()],M.NileCheckbox.prototype,"title",void 0),N([$M()],M.NileCheckbox.prototype,"name",void 0),N([$M()],M.NileCheckbox.prototype,"value",void 0),N([$M({reflect:!0})],M.NileCheckbox.prototype,"size",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"disabled",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"checked",void 0),N([$M({type:String,reflect:!0})],M.NileCheckbox.prototype,"label",void 0),N([$M({type:String,reflect:!0,attribute:"sub-label"})],M.NileCheckbox.prototype,"subLabel",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"indeterminate",void 0),N([UN("checked")],M.NileCheckbox.prototype,"defaultChecked",void 0),N([$M({attribute:"help-text",reflect:!0})],M.NileCheckbox.prototype,"helpText",void 0),N([$M({attribute:"error-message",reflect:!0})],M.NileCheckbox.prototype,"errorMessage",void 0),N([$M({type:Boolean})],M.NileCheckbox.prototype,"showHelpText",void 0),N([$M({reflect:!0})],M.NileCheckbox.prototype,"form",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCheckbox.prototype,"required",void 0),N([KM(".checkbox__label__text")],M.NileCheckbox.prototype,"labelContainer",void 0),N([KM("div.checkbox__icon__container")],M.NileCheckbox.prototype,"checkboxIconContainer",void 0),N([hN(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],M.NileCheckbox.prototype,"handleStateChange",null),M.NileCheckbox=N([FM("nile-checkbox")],M.NileCheckbox);const eD=z`
|
2317
2324
|
:host {
|
2318
2325
|
display: block;
|
2319
2326
|
}
|
@@ -5367,7 +5374,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
5367
5374
|
pointer-events: none;
|
5368
5375
|
color: var(--nile-colors-dark-500);
|
5369
5376
|
}
|
5370
|
-
`;M.NileCalendar=class extends kN{constructor(){super(...arguments),this.currentMonth=(new Date).getMonth(),this.currentYear=(new Date).getFullYear(),this.dropDownOpened=!1,this.allowedDates={},this.valueAttribute=null,this.formattedDate=null,this.startDate=null,this.endDate=null,this.isSelectingStart=!0,this.range=!1,this.type="absolute",this.selectedTimeZone="local",this.validAllowedDates=!0,this.hideTimeInput=!1,this.hideDurationFields=[],this.hideTimeZone=!1}static get styles(){return[Wi]}firstUpdated(){const M=this.getAttribute("allowed-dates");if(null!==M)try{this.allowedDates=JSON.parse(M)}catch(M){console.error("Error parsing allowed-dates attribute:",M)}else this.validAllowedDates=!1}checkValidAllowedDate(){if(0==Object.keys(this.allowedDates).length)return void(this.validAllowedDates=!1);new Date(Date.UTC(this.allowedDates?.startDate?.slice(0,4),this.allowedDates?.startDate?.slice(5,7)-1,this.allowedDates?.startDate?.slice(8,10)))>new Date(Date.UTC(this.allowedDates?.endDate?.slice(0,4),this.allowedDates?.endDate?.slice(5,7)-1,this.allowedDates?.endDate?.slice(8,10)))?(console.error("StartDate must be greater than endDate"),this.validAllowedDates=!1):this.validAllowedDates=!0}valueChanged(){if("object"==typeof this.value&&null!==this.value&&(this.value=JSON.stringify(this.value)),this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){const M=this.value.getTimezoneOffset(),N=new Date(this.value.getTime()-60*M*1e3);isNaN(N.getTime())||(this.valueAttribute=N.toISOString().split("T")[0],this.formattedDate=`${String(N.getDate()).padStart(2,"0")}/${String(N.getMonth()+1).padStart(2,"0")}/${N.getFullYear()}`)}}updated(M){if(super.updated(M),M.has("valueAttribute")){const M=new Date(this.valueAttribute||"");if(!isNaN(M.getTime())){const N=M.getTimezoneOffset();this.value=new Date(M.getTime()-60*N*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear()}}}static get observedAttributes(){return["value","range"]}attributeChangedCallback(M,N,D){"value"===M?(this.valueAttribute=D,this.initializeValue()):"range"===M&&(this.range=null!==D)}initializeValue(){if(this.range)try{const M=JSON.parse(this.valueAttribute||"");this.startDate=new Date(M.startDate),this.endDate=new Date(M.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null}catch(M){}else if(this.valueAttribute){let M;M=new Date(this.valueAttribute),M=new Date(M.getTime()-6e4*M.getTimezoneOffset()),isNaN(M.getTime())||(this.value=M,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null)}this.requestUpdate()}connectedCallback(){if(super.connectedCallback(),this.initializeValue(),this.valueAttribute){const M=new Date(this.valueAttribute);isNaN(M.getTime())||(this.value=M,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear())}this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}getDaysArray(M,N){const D=new Date(M,N+1,0).getDate();return Array.from({length:D},((M,N)=>N+1))}nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate()}prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate()}selectDate(M,N,D){const i=new Date(D,N,M);if(this.range)if(this.startDate&&this.endDate&&(this.startDate=null,this.endDate=null),this.isSelectingStart)this.startDate=i,this.endDate&&i>this.endDate&&(this.endDate=null),this.isSelectingStart=!1;else if(this.isSelectingStart=!0,this.startDate&&i<this.startDate)this.startDate=i,this.endDate=null,this.isSelectingStart=!1;else{const M=i;M.setHours(23,59,59,999),this.endDate=M}else this.value=i,this.emit("nile-changed",{value:this.value}),this.dropdown&&this.dropdown.hide();this.requestUpdate()}confimRange(){this.startDate&&this.endDate&&("local"!==this.selectedTimeZone&&(this.startDate=this.convertTZ(this.startDate,this.selectedTimeZone),this.endDate=this.convertTZ(this.endDate,this.selectedTimeZone)),this.emit("nile-changed",{startDate:this.startDate,endDate:this.endDate}),this.dropdown&&this.dropdown.hide(),this.rangeValue={startDate:this.startDate,endDate:this.endDate})}convertTZ(M,N){return new Date(("string"==typeof M?new Date(M):M).toLocaleString("en-US",{timeZone:N}))}isCurrentDate(M,N,D){const i=new Date;return M===i.getDate()&&N+1===i.getMonth()+1&&D===i.getFullYear()}isAllowedDate(M,N,D){if(!this.validAllowedDates)return!0;const i=new Date(Date.UTC(D,N,M)),j=new Date(Date.UTC(this.allowedDates?.startDate?.slice(0,4),this.allowedDates?.startDate?.slice(5,7)-1,this.allowedDates?.startDate?.slice(8,10))),t=new Date(Date.UTC(this.allowedDates?.endDate?.slice(0,4),this.allowedDates?.endDate?.slice(5,7)-1,this.allowedDates?.endDate?.slice(8,10)));t.setUTCHours(23,59,59,999);return i>=j&&i<=t}renderMonth(M,N,D){const i=new Date(M,N,1).getDay(),j=new Date(M,N+1,0).getDay(),t=this.getDaysArray(0===N?M-1:M,0===N?11:N-1),I=this.getDaysArray(11===N?M+1:M,11===N?0:N+1),z=t.slice(t.length-i),u=I.slice(0,6-j),g=[...z,...D,...u],e=(M,N,D,i)=>{if(!i)return"";if(!this.range&&this.value){if(M===this.value.getDate()&&N===this.value.getMonth()&&D===this.value.getFullYear())return"selected-date"}const j=this.startDate&&M===this.startDate.getDate()&&N===this.startDate.getMonth()&&D===this.startDate.getFullYear(),t=this.endDate&&M===this.endDate.getDate()&&N===this.endDate.getMonth()&&D===this.endDate.getFullYear();return j?"range-start":t?"range-end":""},T=(M,N,D,i)=>{if(!i)return!1;if(this.startDate&&this.endDate){const i=new Date(D,N,M);return i>=this.startDate&&i<=this.endDate}return!1};return EM`
|
5377
|
+
`;M.NileCalendar=class extends kN{constructor(){super(...arguments),this.currentMonth=(new Date).getMonth(),this.currentYear=(new Date).getFullYear(),this.dropDownOpened=!1,this.allowedDates={},this.valueAttribute=null,this.formattedDate=null,this.startDate=null,this.endDate=null,this.isSelectingStart=!0,this.range=!1,this.type="absolute",this.selectedTimeZone="local",this.validAllowedDates=!0,this.hideInput=!1,this.hideTimeInput=!1,this.hideDurationFields=[],this.hideTimeZone=!1}static get styles(){return[Wi]}firstUpdated(){const M=this.getAttribute("allowed-dates");if(null!==M)try{this.allowedDates=JSON.parse(M)}catch(M){console.error("Error parsing allowed-dates attribute:",M)}else this.validAllowedDates=!1}checkValidAllowedDate(){if(0==Object.keys(this.allowedDates).length)return void(this.validAllowedDates=!1);this.hideInput=!0;new Date(Date.UTC(this.allowedDates?.startDate?.slice(0,4),this.allowedDates?.startDate?.slice(5,7)-1,this.allowedDates?.startDate?.slice(8,10)))>new Date(Date.UTC(this.allowedDates?.endDate?.slice(0,4),this.allowedDates?.endDate?.slice(5,7)-1,this.allowedDates?.endDate?.slice(8,10)))?(console.error("StartDate must be greater than endDate"),this.validAllowedDates=!1):this.validAllowedDates=!0}valueChanged(){if("object"==typeof this.value&&null!==this.value&&(this.value=JSON.stringify(this.value)),this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){const M=this.value.getTimezoneOffset(),N=new Date(this.value.getTime()-60*M*1e3);isNaN(N.getTime())||(this.valueAttribute=N.toISOString().split("T")[0],this.formattedDate=`${String(N.getDate()).padStart(2,"0")}/${String(N.getMonth()+1).padStart(2,"0")}/${N.getFullYear()}`)}}updated(M){if(super.updated(M),M.has("valueAttribute")){const M=new Date(this.valueAttribute||"");if(!isNaN(M.getTime())){const N=M.getTimezoneOffset();this.value=new Date(M.getTime()-60*N*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear()}}}static get observedAttributes(){return["value","range"]}attributeChangedCallback(M,N,D){"value"===M?(this.valueAttribute=D,this.initializeValue()):"range"===M&&(this.range=null!==D)}initializeValue(){if(this.range)try{const M=JSON.parse(this.valueAttribute||"");this.startDate=new Date(M.startDate),this.endDate=new Date(M.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null}catch(M){}else if(this.valueAttribute){let M;M=new Date(this.valueAttribute),M=new Date(M.getTime()-6e4*M.getTimezoneOffset()),isNaN(M.getTime())||(this.value=M,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null)}this.requestUpdate()}connectedCallback(){if(super.connectedCallback(),this.initializeValue(),this.valueAttribute){const M=new Date(this.valueAttribute);isNaN(M.getTime())||(this.value=M,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear())}this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}getDaysArray(M,N){const D=new Date(M,N+1,0).getDate();return Array.from({length:D},((M,N)=>N+1))}nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate()}prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate()}selectDate(M,N,D){const i=new Date(D,N,M);if(this.range)if(this.startDate&&this.endDate&&(this.startDate=null,this.endDate=null),this.isSelectingStart)this.startDate=i,this.endDate&&i>this.endDate&&(this.endDate=null),this.isSelectingStart=!1;else if(this.isSelectingStart=!0,this.startDate&&i<this.startDate)this.startDate=i,this.endDate=null,this.isSelectingStart=!1;else{const M=i;M.setHours(23,59,59,999),this.endDate=M}else this.value=i,this.emit("nile-changed",{value:this.value}),this.dropdown&&this.dropdown.hide();this.requestUpdate()}confimRange(){this.startDate&&this.endDate&&("local"!==this.selectedTimeZone&&(this.startDate=this.convertTZ(this.startDate,this.selectedTimeZone),this.endDate=this.convertTZ(this.endDate,this.selectedTimeZone)),this.emit("nile-changed",{startDate:this.startDate,endDate:this.endDate}),this.dropdown&&this.dropdown.hide(),this.rangeValue={startDate:this.startDate,endDate:this.endDate})}convertTZ(M,N){return new Date(("string"==typeof M?new Date(M):M).toLocaleString("en-US",{timeZone:N}))}isCurrentDate(M,N,D){const i=new Date;return M===i.getDate()&&N+1===i.getMonth()+1&&D===i.getFullYear()}isAllowedDate(M,N,D){if(!this.validAllowedDates)return!0;const i=new Date(Date.UTC(D,N,M)),j=new Date(Date.UTC(this.allowedDates?.startDate?.slice(0,4),this.allowedDates?.startDate?.slice(5,7)-1,this.allowedDates?.startDate?.slice(8,10))),t=new Date(Date.UTC(this.allowedDates?.endDate?.slice(0,4),this.allowedDates?.endDate?.slice(5,7)-1,this.allowedDates?.endDate?.slice(8,10)));t.setUTCHours(23,59,59,999);return i>=j&&i<=t}renderMonth(M,N,D){const i=new Date(M,N,1).getDay(),j=new Date(M,N+1,0).getDay(),t=this.getDaysArray(0===N?M-1:M,0===N?11:N-1),I=this.getDaysArray(11===N?M+1:M,11===N?0:N+1),z=t.slice(t.length-i),u=I.slice(0,6-j),g=[...z,...D,...u],e=(M,N,D,i)=>{if(!i)return"";if(!this.range&&this.value){if(M===this.value.getDate()&&N===this.value.getMonth()&&D===this.value.getFullYear())return"selected-date"}const j=this.startDate&&M===this.startDate.getDate()&&N===this.startDate.getMonth()&&D===this.startDate.getFullYear(),t=this.endDate&&M===this.endDate.getDate()&&N===this.endDate.getMonth()&&D===this.endDate.getFullYear();return j?"range-start":t?"range-end":""},T=(M,N,D,i)=>{if(!i)return!1;if(this.startDate&&this.endDate){const i=new Date(D,N,M);return i>=this.startDate&&i<=this.endDate}return!1};return EM`
|
5371
5378
|
<div class="calendar">
|
5372
5379
|
<div class="calendar-header">
|
5373
5380
|
<nile-icon
|
@@ -5528,8 +5535,10 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
5528
5535
|
<div class="calender-input">
|
5529
5536
|
<div>
|
5530
5537
|
<span class="manual-input-label">From </span>
|
5531
|
-
<div class="from">
|
5532
|
-
|
5538
|
+
<div class="from">
|
5539
|
+
${this.hideInput?EM``:EM`<nile-input class="manual-input" value="${this.formatDate(this.startDate)}" placeholder="DD/MM/YYYY" @nile-change="${this.handleStartDateInput}">
|
5540
|
+
</nile-input>`}
|
5541
|
+
|
5533
5542
|
<nile-input class="manual-input ${this.hideTimeInput?"hidden":""}" value="${this.formatTime(this.startDate)}" placeholder="HH:MM:SS" @nile-change="${this.handleStartTimeInput}"> </nile-input>
|
5534
5543
|
</div>
|
5535
5544
|
</div>
|
@@ -5537,7 +5546,8 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
5537
5546
|
<div>
|
5538
5547
|
<span class="manual-input-label">To </span>
|
5539
5548
|
<div class="from">
|
5540
|
-
|
5549
|
+
${this.hideInput?EM``:EM`<nile-input class="manual-input" value="${this.formatDate(this.endDate)}" placeholder="DD/MM/YYYY" @nile-change="${this.handleEndDateInput}"></nile-input>`}
|
5550
|
+
|
5541
5551
|
<nile-input class="manual-input ${this.hideTimeInput?"hidden":""} " value="${this.formatTime(this.endDate)}" placeholder="HH:MM:SS" @nile-change="${this.handleEndTimeInput}"> </nile-input>
|
5542
5552
|
</div>
|
5543
5553
|
</div>
|
@@ -5549,7 +5559,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
|
|
5549
5559
|
</div>
|
5550
5560
|
`:""}
|
5551
5561
|
</div>
|
5552
|
-
`}},N([KM("nile-dropdown")],M.NileCalendar.prototype,"dropdown",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCalendar.prototype,"dropDownOpened",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"value",void 0),N([$M({type:Object,attribute:"allowed-dates"})],M.NileCalendar.prototype,"allowedDates",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"rangeValue",void 0),N([$M({type:String,attribute:"value"})],M.NileCalendar.prototype,"valueAttribute",void 0),N([$M({type:String,attribute:"value"})],M.NileCalendar.prototype,"formattedDate",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"startDate",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"endDate",void 0),N([$M({type:Boolean})],M.NileCalendar.prototype,"isSelectingStart",void 0),N([$M({type:Boolean})],M.NileCalendar.prototype,"range",void 0),N([$M({type:String})],M.NileCalendar.prototype,"type",void 0),N([$M({type:String})],M.NileCalendar.prototype,"selectedUnit",void 0),N([$M({type:Number})],M.NileCalendar.prototype,"selectedValue",void 0),N([$M({type:String})],M.NileCalendar.prototype,"selectedTimeZone",void 0),N([_M()],M.NileCalendar.prototype,"validAllowedDates",void 0),N([hN("allowedDates")],M.NileCalendar.prototype,"checkValidAllowedDate",null),N([$M({type:Boolean,attribute:"hide-time-input"})],M.NileCalendar.prototype,"hideTimeInput",void 0),N([$M({type:Array,attribute:"hide-duration-fields"})],M.NileCalendar.prototype,"hideDurationFields",void 0),N([$M({type:Boolean,attribute:"hide-time-zone"})],M.NileCalendar.prototype,"hideTimeZone",void 0),N([hN("value")],M.NileCalendar.prototype,"valueChanged",null),M.NileCalendar=N([FM("nile-calendar")],M.NileCalendar);const Vi=z`
|
5562
|
+
`}},N([KM("nile-dropdown")],M.NileCalendar.prototype,"dropdown",void 0),N([$M({type:Boolean,reflect:!0})],M.NileCalendar.prototype,"dropDownOpened",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"value",void 0),N([$M({type:Object,attribute:"allowed-dates"})],M.NileCalendar.prototype,"allowedDates",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"rangeValue",void 0),N([$M({type:String,attribute:"value"})],M.NileCalendar.prototype,"valueAttribute",void 0),N([$M({type:String,attribute:"value"})],M.NileCalendar.prototype,"formattedDate",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"startDate",void 0),N([$M({type:Object})],M.NileCalendar.prototype,"endDate",void 0),N([$M({type:Boolean})],M.NileCalendar.prototype,"isSelectingStart",void 0),N([$M({type:Boolean})],M.NileCalendar.prototype,"range",void 0),N([$M({type:String})],M.NileCalendar.prototype,"type",void 0),N([$M({type:String})],M.NileCalendar.prototype,"selectedUnit",void 0),N([$M({type:Number})],M.NileCalendar.prototype,"selectedValue",void 0),N([$M({type:String})],M.NileCalendar.prototype,"selectedTimeZone",void 0),N([_M()],M.NileCalendar.prototype,"validAllowedDates",void 0),N([hN("allowedDates")],M.NileCalendar.prototype,"checkValidAllowedDate",null),N([_M()],M.NileCalendar.prototype,"hideInput",void 0),N([$M({type:Boolean,attribute:"hide-time-input"})],M.NileCalendar.prototype,"hideTimeInput",void 0),N([$M({type:Array,attribute:"hide-duration-fields"})],M.NileCalendar.prototype,"hideDurationFields",void 0),N([$M({type:Boolean,attribute:"hide-time-zone"})],M.NileCalendar.prototype,"hideTimeZone",void 0),N([hN("value")],M.NileCalendar.prototype,"valueChanged",null),M.NileCalendar=N([FM("nile-calendar")],M.NileCalendar);const Vi=z`
|
5553
5563
|
:host {
|
5554
5564
|
}
|
5555
5565
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-calendar.css.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","../property-217fe924.cjs.js","lit","lit/directives/class-map.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,a,h,l,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,r;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){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}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){e=_litDecoratorsJs.query;s=_litDecoratorsJs.state;n=_litDecoratorsJs.customElement;},function(_nileCalendarCssCjsJs){a=_nileCalendarCssCjsJs.s;},function(_internalWatchCjsJs){h=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_property002CjsJs){d=_property002CjsJs.n;},function(_lit){},function(_litDirectivesClassMapJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){_export("N",r=/*#__PURE__*/function(_l){function r(){var _this;_classCallCheck(this,r);_this=_callSuper(this,r,arguments),_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.dropDownOpened=!1,_this.allowedDates={},_this.valueAttribute=null,_this.formattedDate=null,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.range=!1,_this.type="absolute",_this.selectedTimeZone="local",_this.validAllowedDates=!0,_this.hideTimeInput=!1,_this.hideDurationFields=[],_this.hideTimeZone=!1;return _this;}_inherits(r,_l);return _createClass(r,[{key:"firstUpdated",value:function firstUpdated(){var t=this.getAttribute("allowed-dates");if(null!==t)try{this.allowedDates=JSON.parse(t);}catch(t){console.error("Error parsing allowed-dates attribute:",t);}else this.validAllowedDates=!1;}},{key:"checkValidAllowedDate",value:function checkValidAllowedDate(){var _this$allowedDates,_this$allowedDates2,_this$allowedDates3,_this$allowedDates4,_this$allowedDates5,_this$allowedDates6;if(0==Object.keys(this.allowedDates).length)return void(this.validAllowedDates=!1);new Date(Date.UTC((_this$allowedDates=this.allowedDates)===null||_this$allowedDates===void 0||(_this$allowedDates=_this$allowedDates.startDate)===null||_this$allowedDates===void 0?void 0:_this$allowedDates.slice(0,4),((_this$allowedDates2=this.allowedDates)===null||_this$allowedDates2===void 0||(_this$allowedDates2=_this$allowedDates2.startDate)===null||_this$allowedDates2===void 0?void 0:_this$allowedDates2.slice(5,7))-1,(_this$allowedDates3=this.allowedDates)===null||_this$allowedDates3===void 0||(_this$allowedDates3=_this$allowedDates3.startDate)===null||_this$allowedDates3===void 0?void 0:_this$allowedDates3.slice(8,10)))>new Date(Date.UTC((_this$allowedDates4=this.allowedDates)===null||_this$allowedDates4===void 0||(_this$allowedDates4=_this$allowedDates4.endDate)===null||_this$allowedDates4===void 0?void 0:_this$allowedDates4.slice(0,4),((_this$allowedDates5=this.allowedDates)===null||_this$allowedDates5===void 0||(_this$allowedDates5=_this$allowedDates5.endDate)===null||_this$allowedDates5===void 0?void 0:_this$allowedDates5.slice(5,7))-1,(_this$allowedDates6=this.allowedDates)===null||_this$allowedDates6===void 0||(_this$allowedDates6=_this$allowedDates6.endDate)===null||_this$allowedDates6===void 0?void 0:_this$allowedDates6.slice(8,10)))?(console.error("StartDate must be greater than endDate"),this.validAllowedDates=!1):this.validAllowedDates=!0;}},{key:"valueChanged",value:function valueChanged(){if("object"==_typeof(this.value)&&null!==this.value&&(this.value=JSON.stringify(this.value)),this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){var _t=this.value.getTimezoneOffset(),_i=new Date(this.value.getTime()-60*_t*1e3);isNaN(_i.getTime())||(this.valueAttribute=_i.toISOString().split("T")[0],this.formattedDate="".concat(String(_i.getDate()).padStart(2,"0"),"/").concat(String(_i.getMonth()+1).padStart(2,"0"),"/").concat(_i.getFullYear()));}}},{key:"updated",value:function updated(t){if(_get(_getPrototypeOf(r.prototype),"updated",this).call(this,t),t.has("valueAttribute")){var _t2=new Date(this.valueAttribute||"");if(!isNaN(_t2.getTime())){var _i2=_t2.getTimezoneOffset();this.value=new Date(_t2.getTime()-60*_i2*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}}}},{key:"attributeChangedCallback",value:function attributeChangedCallback(t,i,e){"value"===t?(this.valueAttribute=e,this.initializeValue()):"range"===t&&(this.range=null!==e);}},{key:"initializeValue",value:function initializeValue(){if(this.range)try{var _t3=JSON.parse(this.valueAttribute||"");this.startDate=new Date(_t3.startDate),this.endDate=new Date(_t3.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null;}catch(t){}else if(this.valueAttribute){var _t4;_t4=new Date(this.valueAttribute),_t4=new Date(_t4.getTime()-6e4*_t4.getTimezoneOffset()),isNaN(_t4.getTime())||(this.value=_t4,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null);}this.requestUpdate();}},{key:"connectedCallback",value:function connectedCallback(){if(_get(_getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.initializeValue(),this.valueAttribute){var _t5=new Date(this.valueAttribute);isNaN(_t5.getTime())||(this.value=_t5,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear());}this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(r.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"getDaysArray",value:function getDaysArray(t,i){var e=new Date(t,i+1,0).getDate();return Array.from({length:e},function(t,i){return i+1;});}},{key:"nextMonth",value:function nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate();}},{key:"prevMonth",value:function prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate();}},{key:"selectDate",value:function selectDate(t,i,e){var s=new Date(e,i,t);if(this.range){if(this.startDate&&this.endDate&&(this.startDate=null,this.endDate=null),this.isSelectingStart)this.startDate=s,this.endDate&&s>this.endDate&&(this.endDate=null),this.isSelectingStart=!1;else if(this.isSelectingStart=!0,this.startDate&&s<this.startDate)this.startDate=s,this.endDate=null,this.isSelectingStart=!1;else{var _t6=s;_t6.setHours(23,59,59,999),this.endDate=_t6;}}else this.value=s,this.emit("nile-changed",{value:this.value}),this.dropdown&&this.dropdown.hide();this.requestUpdate();}},{key:"confimRange",value:function confimRange(){this.startDate&&this.endDate&&("local"!==this.selectedTimeZone&&(this.startDate=this.convertTZ(this.startDate,this.selectedTimeZone),this.endDate=this.convertTZ(this.endDate,this.selectedTimeZone)),this.emit("nile-changed",{startDate:this.startDate,endDate:this.endDate}),this.dropdown&&this.dropdown.hide(),this.rangeValue={startDate:this.startDate,endDate:this.endDate});}},{key:"convertTZ",value:function convertTZ(t,i){return new Date(("string"==typeof t?new Date(t):t).toLocaleString("en-US",{timeZone:i}));}},{key:"isCurrentDate",value:function isCurrentDate(t,i,e){var s=new Date();return t===s.getDate()&&i+1===s.getMonth()+1&&e===s.getFullYear();}},{key:"isAllowedDate",value:function isAllowedDate(t,i,e){var _this$allowedDates7,_this$allowedDates8,_this$allowedDates9,_this$allowedDates10,_this$allowedDates11,_this$allowedDates12;if(!this.validAllowedDates)return!0;var s=new Date(Date.UTC(e,i,t)),n=new Date(Date.UTC((_this$allowedDates7=this.allowedDates)===null||_this$allowedDates7===void 0||(_this$allowedDates7=_this$allowedDates7.startDate)===null||_this$allowedDates7===void 0?void 0:_this$allowedDates7.slice(0,4),((_this$allowedDates8=this.allowedDates)===null||_this$allowedDates8===void 0||(_this$allowedDates8=_this$allowedDates8.startDate)===null||_this$allowedDates8===void 0?void 0:_this$allowedDates8.slice(5,7))-1,(_this$allowedDates9=this.allowedDates)===null||_this$allowedDates9===void 0||(_this$allowedDates9=_this$allowedDates9.startDate)===null||_this$allowedDates9===void 0?void 0:_this$allowedDates9.slice(8,10))),a=new Date(Date.UTC((_this$allowedDates10=this.allowedDates)===null||_this$allowedDates10===void 0||(_this$allowedDates10=_this$allowedDates10.endDate)===null||_this$allowedDates10===void 0?void 0:_this$allowedDates10.slice(0,4),((_this$allowedDates11=this.allowedDates)===null||_this$allowedDates11===void 0||(_this$allowedDates11=_this$allowedDates11.endDate)===null||_this$allowedDates11===void 0?void 0:_this$allowedDates11.slice(5,7))-1,(_this$allowedDates12=this.allowedDates)===null||_this$allowedDates12===void 0||(_this$allowedDates12=_this$allowedDates12.endDate)===null||_this$allowedDates12===void 0?void 0:_this$allowedDates12.slice(8,10)));a.setUTCHours(23,59,59,999);return s>=n&&s<=a;}},{key:"renderMonth",value:function renderMonth(t,e,s){var _this2=this;var n=new Date(t,e,1).getDay(),a=new Date(t,e+1,0).getDay(),h=this.getDaysArray(0===e?t-1:t,0===e?11:e-1),l=this.getDaysArray(11===e?t+1:t,11===e?0:e+1),d=h.slice(h.length-n),_r=l.slice(0,6-a),o=[].concat(_toConsumableArray(d),_toConsumableArray(s),_toConsumableArray(_r)),u=function u(t,i,e,s){if(!s)return"";if(!_this2.range&&_this2.value){if(t===_this2.value.getDate()&&i===_this2.value.getMonth()&&e===_this2.value.getFullYear())return"selected-date";}var n=_this2.startDate&&t===_this2.startDate.getDate()&&i===_this2.startDate.getMonth()&&e===_this2.startDate.getFullYear(),a=_this2.endDate&&t===_this2.endDate.getDate()&&i===_this2.endDate.getMonth()&&e===_this2.endDate.getFullYear();return n?"range-start":a?"range-end":"";},c=function c(t,i,e,s){if(!s)return!1;if(_this2.startDate&&_this2.endDate){var _s=new Date(e,i,t);return _s>=_this2.startDate&&_s<=_this2.endDate;}return!1;};return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowleft\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n <span\n >","\n ","</span\n >\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowright\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n </div>\n <div class=\"header-divider\"></div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ","\n </div>\n </div>\n "])),this.prevMonth,new Date(t,e).toLocaleString("default",{month:"long"}),t,this.nextMonth,o.map(function(n,a){var h=a>=d.length&&a<d.length+s.length;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <div\n class=\"day\n ","\n "," "," "," ","\n ","\n \"\n @click=\"","\"\n >\n ","\n </div>"])),_this2.isAllowedDate(n,e,t)?"":"not-allowed",u(n,e,t,h),c(n,e,t,h),c(n,e,t,h)?"in-range":"",h?"":"filler",_this2.isCurrentDate(n,e,t)&&h?"current-date":"",function(){h&&_this2.selectDate(n,e,t);},n);}));}},{key:"formatDate",value:function formatDate(t){if(!t)return"";return"".concat(String(t.getDate()).padStart(2,"0"),"/").concat(String(t.getMonth()+1).padStart(2,"0"),"/").concat(t.getFullYear());}},{key:"formatDateRange",value:function formatDateRange(t){return t?t.startDate&&t.endDate?"".concat(this.formatDate(t.startDate)," - ").concat(this.formatDate(t.endDate)):"":t;}},{key:"handleStartDateInput",value:function handleStartDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.startDate=null),i&&(!this.endDate||i<=this.endDate)?this.startDate=i:(this.startDate=null,this.endDate=null),this.requestUpdate();}},{key:"handleEndDateInput",value:function handleEndDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.endDate=null),i&&(!this.startDate||i>=this.startDate)?this.endDate=i:this.endDate=null,this.requestUpdate();}},{key:"parseDate",value:function parseDate(t){var _t$split$map=t.split("/").map(Number),_t$split$map2=_slicedToArray(_t$split$map,3),i=_t$split$map2[0],e=_t$split$map2[1],s=_t$split$map2[2],n=new Date(s,e-1,i);return isNaN(n.getTime())?null:n;}},{key:"isValidDateInput",value:function isValidDateInput(t){return /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/.test(t);}},{key:"formatTime",value:function formatTime(t){if(!t)return"";return"".concat(String(t.getHours()).padStart(2,"0"),":").concat(String(t.getMinutes()).padStart(2,"0"),":").concat(String(t.getSeconds()).padStart(2,"0"));}},{key:"isValidTimeInput",value:function isValidTimeInput(t){return /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/.test(t);}},{key:"parseTime",value:function parseTime(t,i){if(!this.isValidTimeInput(t))return null;var _t$split$map3=t.split(":").map(Number),_t$split$map4=_slicedToArray(_t$split$map3,3),e=_t$split$map4[0],s=_t$split$map4[1],n=_t$split$map4[2],a=new Date(i.getTime());return a.setHours(e,s,n),a;}},{key:"handleStartTimeInput",value:function handleStartTimeInput(t){if(!this.startDate)return void(this.startDate=null);var i=this.parseTime(t.detail.value,this.startDate);i?this.startDate=i:this.startDate.setHours(0,0,0),this.requestUpdate();}},{key:"handleEndTimeInput",value:function handleEndTimeInput(t){if(!this.endDate)return void(this.endDate=null);var i=this.parseTime(t.detail.value,this.endDate);i?this.endDate=i:this.endDate.setHours(0,0,0),this.requestUpdate();}},{key:"setType",value:function setType(t){this.type=t;}},{key:"createRelativePeriod",value:function createRelativePeriod(t,i){var e=new Date(),s=new Date();switch(t){case"minutes":s.setMinutes(s.getMinutes()-i);break;case"hours":s.setHours(s.getHours()-i);break;case"days":s.setDate(s.getDate()-i);break;case"weeks":s.setDate(s.getDate()-7*i);break;case"months":s.setMonth(s.getMonth()-i);}return this.startDate=new Date(s.getTime()),this.endDate=new Date(e.getTime()),this.requestUpdate(),{startDate:this.startDate,endDate:this.endDate};}},{key:"handleTimeValueClick",value:function handleTimeValueClick(t,i,e){this.createRelativePeriod(t,i),this.selectedUnit=t,this.selectedValue=i,this.requestUpdate();}},{key:"renderTimeValues",value:function renderTimeValues(t,e){var _this3=this;return e.map(function(e){return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <div\n class=\"time-value ","\"\n @click=","\n >\n ","\n </div>\n "])),_this3.selectedUnit===t&&_this3.selectedValue===e?"time-value--selected":"",function(i){return _this3.handleTimeValueClick(t,e,i);},e);});}},{key:"handleDurationChange",value:function handleDurationChange(t){this.selectedValue=Number(t.detail.value),this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t);}},{key:"handleUnitChange",value:function handleUnitChange(t){this.selectedUnit=t.detail.value,this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t);}},{key:"handleTimeZoneChange",value:function handleTimeZoneChange(t){this.selectedTimeZone=t.detail.value,this.requestUpdate();}},{key:"onTypeChange",value:function onTypeChange(t){this.type=t.detail.value;}},{key:"render",value:function render(){var _this$hideDurationFie,_this$hideDurationFie2,_this$hideDurationFie3,_this$hideDurationFie4,_this$hideDurationFie5,_this$hideDurationFie6,_this$hideDurationFie7,_this$hideDurationFie8,_this$hideDurationFie9,_this$hideDurationFie10;this.getDaysArray(this.currentYear,this.currentMonth);var t=(this.currentMonth+1)%12,e=11===this.currentMonth?this.currentYear+1:this.currentYear;return this.getDaysArray(e,t),i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div\n class=\"base "," ","\"\n >\n <div class=\"calendar-config ","\">\n <div class=\"calendar-switcher\">\n <nile-tab-group centered @nile-tab-show=\"","\">\n <nile-tab slot=\"nav\" panel=\"absolute\">Absolute</nile-tab>\n <nile-tab slot=\"nav\" panel=\"relative\">Relative</nile-tab>\n </nile-tab-group>\n </div>\n </div>\n\n <div class=\"calendar-timezone ","\">\n <nile-select\n hoist\n value=","\n @nile-change=","\n >\n <nile-option value=\"local\">Local Time Zone</nile-option>\n <nile-option value=\"UTC\">UTC</nile-option>\n </nile-select>\n </div>\n\n <div\n class=\"calendar-wrapper ","\"\n >\n <div class=\"calendar-container ","\">\n ","\n </div>\n </div>\n\n <div class=\"unit-container ","\">\n <div\n class=\"time-unit-group "," \"\n >\n <div class=\"time-unit-name\"><span>Minutes</span></div>\n <div class=\"time-unit-value minute-values\">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Hours</span></div>\n <div class=\"time-unit-value hours-values\">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Days</span></div>\n <div class=\"time-unit-value\">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Weeks</span></div>\n <div class=\"time-unit-value weeks-values \">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Months:</span></div>\n <div class=\"time-unit-value months-values \">\n ","\n </div>\n </div>\n </div>\n\n ","\n ","\n </div>\n "])),this.range?"base__range":"","relative"===this.type?"base__relative":"",this.range?"":"hidden",this.onTypeChange,!this.range||this.hideTimeZone?"hidden":"",this.selectedTimeZone,this.handleTimeZoneChange,"absolute"!==this.type?"hidden":"",this.range?"with-margin":"",this.renderMonth(this.currentYear,this.currentMonth,this.getDaysArray(this.currentYear,this.currentMonth)),"relative"!==this.type?"hidden":"",(_this$hideDurationFie=this.hideDurationFields)!==null&&_this$hideDurationFie!==void 0&&_this$hideDurationFie.includes("minutes")?"hidden":"",this.renderTimeValues("minutes",[1,5,15,30,45]),(_this$hideDurationFie2=this.hideDurationFields)!==null&&_this$hideDurationFie2!==void 0&&_this$hideDurationFie2.includes("hours")?"hidden":"",this.renderTimeValues("hours",[1,2,3,6,8,12]),(_this$hideDurationFie3=this.hideDurationFields)!==null&&_this$hideDurationFie3!==void 0&&_this$hideDurationFie3.includes("days")?"hidden":"",this.renderTimeValues("days",[1,2,3,4,5,6]),(_this$hideDurationFie4=this.hideDurationFields)!==null&&_this$hideDurationFie4!==void 0&&_this$hideDurationFie4.includes("weeks")?"hidden":"",this.renderTimeValues("weeks",[1,2,4,6]),(_this$hideDurationFie5=this.hideDurationFields)!==null&&_this$hideDurationFie5!==void 0&&_this$hideDurationFie5.includes("months")?"hidden":"",this.renderTimeValues("months",[3,6,12,15]),this.range&&"relative"===this.type?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div class=\"calender-input calender-input--relative\">\n <div class=\"unit-input-container\">\n <nile-input class=\"manual-input duration-input\" label=\"Duration\" value=\"","\"\n @nile-input=\"","\"\n placeholder=\"Enter Value\" ></nile-input>\n <nile-select class=\"manual-input time-input\" label=\"Unit of time\" style=\"margin-top:3px\" value=\"","\"\n @nile-change=\"","\"\n >\n <nile-option value=\"minutes\" class=\"","\"> Minutes </nile-option>\n <nile-option value=\"hours\" class=\"","\"> Hours </nile-option>\n <nile-option value=\"days\" class=\"","\"> Days </nile-option>\n <nile-option value=\"weeks\" class=\"","\"> Weeks </nile-option>\n <nile-option value=\"months\" class=\"","\"> Months </nile-option>\n </nile-select>\n\n </div>\n\n <div class=\"button-container--relative\">\n <nile-button class=\"apply-button\" variant=\"primary\" ?disabled=\"","\" @click=\"","\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n "])),this.selectedValue,this.handleDurationChange,this.selectedUnit,this.handleUnitChange,(_this$hideDurationFie6=this.hideDurationFields)!==null&&_this$hideDurationFie6!==void 0&&_this$hideDurationFie6.includes("minutes")?"hidden":"",(_this$hideDurationFie7=this.hideDurationFields)!==null&&_this$hideDurationFie7!==void 0&&_this$hideDurationFie7.includes("hours")?"hidden":"",(_this$hideDurationFie8=this.hideDurationFields)!==null&&_this$hideDurationFie8!==void 0&&_this$hideDurationFie8.includes("days")?"hidden":"",(_this$hideDurationFie9=this.hideDurationFields)!==null&&_this$hideDurationFie9!==void 0&&_this$hideDurationFie9.includes("weeks")?"hidden":"",(_this$hideDurationFie10=this.hideDurationFields)!==null&&_this$hideDurationFie10!==void 0&&_this$hideDurationFie10.includes("months")?"hidden":"",!this.startDate||!this.endDate,this.confimRange):"",this.range&&"absolute"===this.type?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <div class=\"calender-input\">\n <div>\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\"></nile-input>\n <nile-input class=\"manual-input ","\" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n </div>\n </div>\n\n <div>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\"></nile-input>\n <nile-input class=\"manual-input "," \" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n </div>\n </div>\n\n </div>\n <div class=\"button-container\">\n <nile-button class=\"apply-button\" ?disabled=\"","\" @click=\"","\"> Apply</nile-button>\n </div>\n </div>\n "])),this.formatDate(this.startDate),this.handleStartDateInput,this.hideTimeInput?"hidden":"",this.formatTime(this.startDate),this.handleStartTimeInput,this.formatDate(this.endDate),this.handleEndDateInput,this.hideTimeInput?"hidden":"",this.formatTime(this.endDate),this.handleEndTimeInput,!this.startDate||!this.endDate,this.confimRange):"");}}],[{key:"styles",get:function get(){return[a];}},{key:"observedAttributes",get:function get(){return["value","range"];}}]);}(l));t([e("nile-dropdown")],r.prototype,"dropdown",void 0),t([d({type:Boolean,reflect:!0})],r.prototype,"dropDownOpened",void 0),t([d({type:Object})],r.prototype,"value",void 0),t([d({type:Object,attribute:"allowed-dates"})],r.prototype,"allowedDates",void 0),t([d({type:Object})],r.prototype,"rangeValue",void 0),t([d({type:String,attribute:"value"})],r.prototype,"valueAttribute",void 0),t([d({type:String,attribute:"value"})],r.prototype,"formattedDate",void 0),t([d({type:Object})],r.prototype,"startDate",void 0),t([d({type:Object})],r.prototype,"endDate",void 0),t([d({type:Boolean})],r.prototype,"isSelectingStart",void 0),t([d({type:Boolean})],r.prototype,"range",void 0),t([d({type:String})],r.prototype,"type",void 0),t([d({type:String})],r.prototype,"selectedUnit",void 0),t([d({type:Number})],r.prototype,"selectedValue",void 0),t([d({type:String})],r.prototype,"selectedTimeZone",void 0),t([s()],r.prototype,"validAllowedDates",void 0),t([h("allowedDates")],r.prototype,"checkValidAllowedDate",null),t([d({type:Boolean,attribute:"hide-time-input"})],r.prototype,"hideTimeInput",void 0),t([d({type:Array,attribute:"hide-duration-fields"})],r.prototype,"hideDurationFields",void 0),t([d({type:Boolean,attribute:"hide-time-zone"})],r.prototype,"hideTimeZone",void 0),t([h("value")],r.prototype,"valueChanged",null),_export("N",r=t([n("nile-calendar")],r));}};});
|
1
|
+
System.register(["tslib","../index-c7ad3b47.cjs.js","lit/decorators.js","./nile-calendar.css.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","../property-217fe924.cjs.js","lit","lit/directives/class-map.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,a,h,l,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,r;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){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}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){e=_litDecoratorsJs.query;s=_litDecoratorsJs.state;n=_litDecoratorsJs.customElement;},function(_nileCalendarCssCjsJs){a=_nileCalendarCssCjsJs.s;},function(_internalWatchCjsJs){h=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_property002CjsJs){d=_property002CjsJs.n;},function(_lit){},function(_litDirectivesClassMapJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){_export("N",r=/*#__PURE__*/function(_l){function r(){var _this;_classCallCheck(this,r);_this=_callSuper(this,r,arguments),_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.dropDownOpened=!1,_this.allowedDates={},_this.valueAttribute=null,_this.formattedDate=null,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.range=!1,_this.type="absolute",_this.selectedTimeZone="local",_this.validAllowedDates=!0,_this.hideInput=!1,_this.hideTimeInput=!1,_this.hideDurationFields=[],_this.hideTimeZone=!1;return _this;}_inherits(r,_l);return _createClass(r,[{key:"firstUpdated",value:function firstUpdated(){var t=this.getAttribute("allowed-dates");if(null!==t)try{this.allowedDates=JSON.parse(t);}catch(t){console.error("Error parsing allowed-dates attribute:",t);}else this.validAllowedDates=!1;}},{key:"checkValidAllowedDate",value:function checkValidAllowedDate(){var _this$allowedDates,_this$allowedDates2,_this$allowedDates3,_this$allowedDates4,_this$allowedDates5,_this$allowedDates6;if(0==Object.keys(this.allowedDates).length)return void(this.validAllowedDates=!1);this.hideInput=!0;new Date(Date.UTC((_this$allowedDates=this.allowedDates)===null||_this$allowedDates===void 0||(_this$allowedDates=_this$allowedDates.startDate)===null||_this$allowedDates===void 0?void 0:_this$allowedDates.slice(0,4),((_this$allowedDates2=this.allowedDates)===null||_this$allowedDates2===void 0||(_this$allowedDates2=_this$allowedDates2.startDate)===null||_this$allowedDates2===void 0?void 0:_this$allowedDates2.slice(5,7))-1,(_this$allowedDates3=this.allowedDates)===null||_this$allowedDates3===void 0||(_this$allowedDates3=_this$allowedDates3.startDate)===null||_this$allowedDates3===void 0?void 0:_this$allowedDates3.slice(8,10)))>new Date(Date.UTC((_this$allowedDates4=this.allowedDates)===null||_this$allowedDates4===void 0||(_this$allowedDates4=_this$allowedDates4.endDate)===null||_this$allowedDates4===void 0?void 0:_this$allowedDates4.slice(0,4),((_this$allowedDates5=this.allowedDates)===null||_this$allowedDates5===void 0||(_this$allowedDates5=_this$allowedDates5.endDate)===null||_this$allowedDates5===void 0?void 0:_this$allowedDates5.slice(5,7))-1,(_this$allowedDates6=this.allowedDates)===null||_this$allowedDates6===void 0||(_this$allowedDates6=_this$allowedDates6.endDate)===null||_this$allowedDates6===void 0?void 0:_this$allowedDates6.slice(8,10)))?(console.error("StartDate must be greater than endDate"),this.validAllowedDates=!1):this.validAllowedDates=!0;}},{key:"valueChanged",value:function valueChanged(){if("object"==_typeof(this.value)&&null!==this.value&&(this.value=JSON.stringify(this.value)),this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){var _t=this.value.getTimezoneOffset(),_i=new Date(this.value.getTime()-60*_t*1e3);isNaN(_i.getTime())||(this.valueAttribute=_i.toISOString().split("T")[0],this.formattedDate="".concat(String(_i.getDate()).padStart(2,"0"),"/").concat(String(_i.getMonth()+1).padStart(2,"0"),"/").concat(_i.getFullYear()));}}},{key:"updated",value:function updated(t){if(_get(_getPrototypeOf(r.prototype),"updated",this).call(this,t),t.has("valueAttribute")){var _t2=new Date(this.valueAttribute||"");if(!isNaN(_t2.getTime())){var _i2=_t2.getTimezoneOffset();this.value=new Date(_t2.getTime()-60*_i2*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}}}},{key:"attributeChangedCallback",value:function attributeChangedCallback(t,i,e){"value"===t?(this.valueAttribute=e,this.initializeValue()):"range"===t&&(this.range=null!==e);}},{key:"initializeValue",value:function initializeValue(){if(this.range)try{var _t3=JSON.parse(this.valueAttribute||"");this.startDate=new Date(_t3.startDate),this.endDate=new Date(_t3.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null;}catch(t){}else if(this.valueAttribute){var _t4;_t4=new Date(this.valueAttribute),_t4=new Date(_t4.getTime()-6e4*_t4.getTimezoneOffset()),isNaN(_t4.getTime())||(this.value=_t4,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null);}this.requestUpdate();}},{key:"connectedCallback",value:function connectedCallback(){if(_get(_getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.initializeValue(),this.valueAttribute){var _t5=new Date(this.valueAttribute);isNaN(_t5.getTime())||(this.value=_t5,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear());}this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(r.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"getDaysArray",value:function getDaysArray(t,i){var e=new Date(t,i+1,0).getDate();return Array.from({length:e},function(t,i){return i+1;});}},{key:"nextMonth",value:function nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate();}},{key:"prevMonth",value:function prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate();}},{key:"selectDate",value:function selectDate(t,i,e){var s=new Date(e,i,t);if(this.range){if(this.startDate&&this.endDate&&(this.startDate=null,this.endDate=null),this.isSelectingStart)this.startDate=s,this.endDate&&s>this.endDate&&(this.endDate=null),this.isSelectingStart=!1;else if(this.isSelectingStart=!0,this.startDate&&s<this.startDate)this.startDate=s,this.endDate=null,this.isSelectingStart=!1;else{var _t6=s;_t6.setHours(23,59,59,999),this.endDate=_t6;}}else this.value=s,this.emit("nile-changed",{value:this.value}),this.dropdown&&this.dropdown.hide();this.requestUpdate();}},{key:"confimRange",value:function confimRange(){this.startDate&&this.endDate&&("local"!==this.selectedTimeZone&&(this.startDate=this.convertTZ(this.startDate,this.selectedTimeZone),this.endDate=this.convertTZ(this.endDate,this.selectedTimeZone)),this.emit("nile-changed",{startDate:this.startDate,endDate:this.endDate}),this.dropdown&&this.dropdown.hide(),this.rangeValue={startDate:this.startDate,endDate:this.endDate});}},{key:"convertTZ",value:function convertTZ(t,i){return new Date(("string"==typeof t?new Date(t):t).toLocaleString("en-US",{timeZone:i}));}},{key:"isCurrentDate",value:function isCurrentDate(t,i,e){var s=new Date();return t===s.getDate()&&i+1===s.getMonth()+1&&e===s.getFullYear();}},{key:"isAllowedDate",value:function isAllowedDate(t,i,e){var _this$allowedDates7,_this$allowedDates8,_this$allowedDates9,_this$allowedDates10,_this$allowedDates11,_this$allowedDates12;if(!this.validAllowedDates)return!0;var s=new Date(Date.UTC(e,i,t)),n=new Date(Date.UTC((_this$allowedDates7=this.allowedDates)===null||_this$allowedDates7===void 0||(_this$allowedDates7=_this$allowedDates7.startDate)===null||_this$allowedDates7===void 0?void 0:_this$allowedDates7.slice(0,4),((_this$allowedDates8=this.allowedDates)===null||_this$allowedDates8===void 0||(_this$allowedDates8=_this$allowedDates8.startDate)===null||_this$allowedDates8===void 0?void 0:_this$allowedDates8.slice(5,7))-1,(_this$allowedDates9=this.allowedDates)===null||_this$allowedDates9===void 0||(_this$allowedDates9=_this$allowedDates9.startDate)===null||_this$allowedDates9===void 0?void 0:_this$allowedDates9.slice(8,10))),a=new Date(Date.UTC((_this$allowedDates10=this.allowedDates)===null||_this$allowedDates10===void 0||(_this$allowedDates10=_this$allowedDates10.endDate)===null||_this$allowedDates10===void 0?void 0:_this$allowedDates10.slice(0,4),((_this$allowedDates11=this.allowedDates)===null||_this$allowedDates11===void 0||(_this$allowedDates11=_this$allowedDates11.endDate)===null||_this$allowedDates11===void 0?void 0:_this$allowedDates11.slice(5,7))-1,(_this$allowedDates12=this.allowedDates)===null||_this$allowedDates12===void 0||(_this$allowedDates12=_this$allowedDates12.endDate)===null||_this$allowedDates12===void 0?void 0:_this$allowedDates12.slice(8,10)));a.setUTCHours(23,59,59,999);return s>=n&&s<=a;}},{key:"renderMonth",value:function renderMonth(t,e,s){var _this2=this;var n=new Date(t,e,1).getDay(),a=new Date(t,e+1,0).getDay(),h=this.getDaysArray(0===e?t-1:t,0===e?11:e-1),l=this.getDaysArray(11===e?t+1:t,11===e?0:e+1),d=h.slice(h.length-n),_r=l.slice(0,6-a),o=[].concat(_toConsumableArray(d),_toConsumableArray(s),_toConsumableArray(_r)),u=function u(t,i,e,s){if(!s)return"";if(!_this2.range&&_this2.value){if(t===_this2.value.getDate()&&i===_this2.value.getMonth()&&e===_this2.value.getFullYear())return"selected-date";}var n=_this2.startDate&&t===_this2.startDate.getDate()&&i===_this2.startDate.getMonth()&&e===_this2.startDate.getFullYear(),a=_this2.endDate&&t===_this2.endDate.getDate()&&i===_this2.endDate.getMonth()&&e===_this2.endDate.getFullYear();return n?"range-start":a?"range-end":"";},c=function c(t,i,e,s){if(!s)return!1;if(_this2.startDate&&_this2.endDate){var _s=new Date(e,i,t);return _s>=_this2.startDate&&_s<=_this2.endDate;}return!1;};return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowleft\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n <span\n >","\n ","</span\n >\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowright\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n </div>\n <div class=\"header-divider\"></div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ","\n </div>\n </div>\n "])),this.prevMonth,new Date(t,e).toLocaleString("default",{month:"long"}),t,this.nextMonth,o.map(function(n,a){var h=a>=d.length&&a<d.length+s.length;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <div\n class=\"day\n ","\n "," "," "," ","\n ","\n \"\n @click=\"","\"\n >\n ","\n </div>"])),_this2.isAllowedDate(n,e,t)?"":"not-allowed",u(n,e,t,h),c(n,e,t,h),c(n,e,t,h)?"in-range":"",h?"":"filler",_this2.isCurrentDate(n,e,t)&&h?"current-date":"",function(){h&&_this2.selectDate(n,e,t);},n);}));}},{key:"formatDate",value:function formatDate(t){if(!t)return"";return"".concat(String(t.getDate()).padStart(2,"0"),"/").concat(String(t.getMonth()+1).padStart(2,"0"),"/").concat(t.getFullYear());}},{key:"formatDateRange",value:function formatDateRange(t){return t?t.startDate&&t.endDate?"".concat(this.formatDate(t.startDate)," - ").concat(this.formatDate(t.endDate)):"":t;}},{key:"handleStartDateInput",value:function handleStartDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.startDate=null),i&&(!this.endDate||i<=this.endDate)?this.startDate=i:(this.startDate=null,this.endDate=null),this.requestUpdate();}},{key:"handleEndDateInput",value:function handleEndDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.endDate=null),i&&(!this.startDate||i>=this.startDate)?this.endDate=i:this.endDate=null,this.requestUpdate();}},{key:"parseDate",value:function parseDate(t){var _t$split$map=t.split("/").map(Number),_t$split$map2=_slicedToArray(_t$split$map,3),i=_t$split$map2[0],e=_t$split$map2[1],s=_t$split$map2[2],n=new Date(s,e-1,i);return isNaN(n.getTime())?null:n;}},{key:"isValidDateInput",value:function isValidDateInput(t){return /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/.test(t);}},{key:"formatTime",value:function formatTime(t){if(!t)return"";return"".concat(String(t.getHours()).padStart(2,"0"),":").concat(String(t.getMinutes()).padStart(2,"0"),":").concat(String(t.getSeconds()).padStart(2,"0"));}},{key:"isValidTimeInput",value:function isValidTimeInput(t){return /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/.test(t);}},{key:"parseTime",value:function parseTime(t,i){if(!this.isValidTimeInput(t))return null;var _t$split$map3=t.split(":").map(Number),_t$split$map4=_slicedToArray(_t$split$map3,3),e=_t$split$map4[0],s=_t$split$map4[1],n=_t$split$map4[2],a=new Date(i.getTime());return a.setHours(e,s,n),a;}},{key:"handleStartTimeInput",value:function handleStartTimeInput(t){if(!this.startDate)return void(this.startDate=null);var i=this.parseTime(t.detail.value,this.startDate);i?this.startDate=i:this.startDate.setHours(0,0,0),this.requestUpdate();}},{key:"handleEndTimeInput",value:function handleEndTimeInput(t){if(!this.endDate)return void(this.endDate=null);var i=this.parseTime(t.detail.value,this.endDate);i?this.endDate=i:this.endDate.setHours(0,0,0),this.requestUpdate();}},{key:"setType",value:function setType(t){this.type=t;}},{key:"createRelativePeriod",value:function createRelativePeriod(t,i){var e=new Date(),s=new Date();switch(t){case"minutes":s.setMinutes(s.getMinutes()-i);break;case"hours":s.setHours(s.getHours()-i);break;case"days":s.setDate(s.getDate()-i);break;case"weeks":s.setDate(s.getDate()-7*i);break;case"months":s.setMonth(s.getMonth()-i);}return this.startDate=new Date(s.getTime()),this.endDate=new Date(e.getTime()),this.requestUpdate(),{startDate:this.startDate,endDate:this.endDate};}},{key:"handleTimeValueClick",value:function handleTimeValueClick(t,i,e){this.createRelativePeriod(t,i),this.selectedUnit=t,this.selectedValue=i,this.requestUpdate();}},{key:"renderTimeValues",value:function renderTimeValues(t,e){var _this3=this;return e.map(function(e){return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <div\n class=\"time-value ","\"\n @click=","\n >\n ","\n </div>\n "])),_this3.selectedUnit===t&&_this3.selectedValue===e?"time-value--selected":"",function(i){return _this3.handleTimeValueClick(t,e,i);},e);});}},{key:"handleDurationChange",value:function handleDurationChange(t){this.selectedValue=Number(t.detail.value),this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t);}},{key:"handleUnitChange",value:function handleUnitChange(t){this.selectedUnit=t.detail.value,this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t);}},{key:"handleTimeZoneChange",value:function handleTimeZoneChange(t){this.selectedTimeZone=t.detail.value,this.requestUpdate();}},{key:"onTypeChange",value:function onTypeChange(t){this.type=t.detail.value;}},{key:"render",value:function render(){var _this$hideDurationFie,_this$hideDurationFie2,_this$hideDurationFie3,_this$hideDurationFie4,_this$hideDurationFie5,_this$hideDurationFie6,_this$hideDurationFie7,_this$hideDurationFie8,_this$hideDurationFie9,_this$hideDurationFie10;this.getDaysArray(this.currentYear,this.currentMonth);var t=(this.currentMonth+1)%12,e=11===this.currentMonth?this.currentYear+1:this.currentYear;return this.getDaysArray(e,t),i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div\n class=\"base "," ","\"\n >\n <div class=\"calendar-config ","\">\n <div class=\"calendar-switcher\">\n <nile-tab-group centered @nile-tab-show=\"","\">\n <nile-tab slot=\"nav\" panel=\"absolute\">Absolute</nile-tab>\n <nile-tab slot=\"nav\" panel=\"relative\">Relative</nile-tab>\n </nile-tab-group>\n </div>\n </div>\n\n <div class=\"calendar-timezone ","\">\n <nile-select\n hoist\n value=","\n @nile-change=","\n >\n <nile-option value=\"local\">Local Time Zone</nile-option>\n <nile-option value=\"UTC\">UTC</nile-option>\n </nile-select>\n </div>\n\n <div\n class=\"calendar-wrapper ","\"\n >\n <div class=\"calendar-container ","\">\n ","\n </div>\n </div>\n\n <div class=\"unit-container ","\">\n <div\n class=\"time-unit-group "," \"\n >\n <div class=\"time-unit-name\"><span>Minutes</span></div>\n <div class=\"time-unit-value minute-values\">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Hours</span></div>\n <div class=\"time-unit-value hours-values\">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Days</span></div>\n <div class=\"time-unit-value\">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Weeks</span></div>\n <div class=\"time-unit-value weeks-values \">\n ","\n </div>\n </div>\n\n <div\n class=\"time-unit-group ","\"\n >\n <div class=\"time-unit-name\"><span>Months:</span></div>\n <div class=\"time-unit-value months-values \">\n ","\n </div>\n </div>\n </div>\n\n ","\n ","\n </div>\n "])),this.range?"base__range":"","relative"===this.type?"base__relative":"",this.range?"":"hidden",this.onTypeChange,!this.range||this.hideTimeZone?"hidden":"",this.selectedTimeZone,this.handleTimeZoneChange,"absolute"!==this.type?"hidden":"",this.range?"with-margin":"",this.renderMonth(this.currentYear,this.currentMonth,this.getDaysArray(this.currentYear,this.currentMonth)),"relative"!==this.type?"hidden":"",(_this$hideDurationFie=this.hideDurationFields)!==null&&_this$hideDurationFie!==void 0&&_this$hideDurationFie.includes("minutes")?"hidden":"",this.renderTimeValues("minutes",[1,5,15,30,45]),(_this$hideDurationFie2=this.hideDurationFields)!==null&&_this$hideDurationFie2!==void 0&&_this$hideDurationFie2.includes("hours")?"hidden":"",this.renderTimeValues("hours",[1,2,3,6,8,12]),(_this$hideDurationFie3=this.hideDurationFields)!==null&&_this$hideDurationFie3!==void 0&&_this$hideDurationFie3.includes("days")?"hidden":"",this.renderTimeValues("days",[1,2,3,4,5,6]),(_this$hideDurationFie4=this.hideDurationFields)!==null&&_this$hideDurationFie4!==void 0&&_this$hideDurationFie4.includes("weeks")?"hidden":"",this.renderTimeValues("weeks",[1,2,4,6]),(_this$hideDurationFie5=this.hideDurationFields)!==null&&_this$hideDurationFie5!==void 0&&_this$hideDurationFie5.includes("months")?"hidden":"",this.renderTimeValues("months",[3,6,12,15]),this.range&&"relative"===this.type?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div class=\"calender-input calender-input--relative\">\n <div class=\"unit-input-container\">\n <nile-input class=\"manual-input duration-input\" label=\"Duration\" value=\"","\"\n @nile-input=\"","\"\n placeholder=\"Enter Value\" ></nile-input>\n <nile-select class=\"manual-input time-input\" label=\"Unit of time\" style=\"margin-top:3px\" value=\"","\"\n @nile-change=\"","\"\n >\n <nile-option value=\"minutes\" class=\"","\"> Minutes </nile-option>\n <nile-option value=\"hours\" class=\"","\"> Hours </nile-option>\n <nile-option value=\"days\" class=\"","\"> Days </nile-option>\n <nile-option value=\"weeks\" class=\"","\"> Weeks </nile-option>\n <nile-option value=\"months\" class=\"","\"> Months </nile-option>\n </nile-select>\n\n </div>\n\n <div class=\"button-container--relative\">\n <nile-button class=\"apply-button\" variant=\"primary\" ?disabled=\"","\" @click=\"","\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n "])),this.selectedValue,this.handleDurationChange,this.selectedUnit,this.handleUnitChange,(_this$hideDurationFie6=this.hideDurationFields)!==null&&_this$hideDurationFie6!==void 0&&_this$hideDurationFie6.includes("minutes")?"hidden":"",(_this$hideDurationFie7=this.hideDurationFields)!==null&&_this$hideDurationFie7!==void 0&&_this$hideDurationFie7.includes("hours")?"hidden":"",(_this$hideDurationFie8=this.hideDurationFields)!==null&&_this$hideDurationFie8!==void 0&&_this$hideDurationFie8.includes("days")?"hidden":"",(_this$hideDurationFie9=this.hideDurationFields)!==null&&_this$hideDurationFie9!==void 0&&_this$hideDurationFie9.includes("weeks")?"hidden":"",(_this$hideDurationFie10=this.hideDurationFields)!==null&&_this$hideDurationFie10!==void 0&&_this$hideDurationFie10.includes("months")?"hidden":"",!this.startDate||!this.endDate,this.confimRange):"",this.range&&"absolute"===this.type?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <div class=\"calender-input\">\n <div>\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\"> \n ","\n \n <nile-input class=\"manual-input ","\" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n </div>\n </div>\n\n <div>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n ","\n \n <nile-input class=\"manual-input "," \" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n </div>\n </div>\n\n </div>\n <div class=\"button-container\">\n <nile-button class=\"apply-button\" ?disabled=\"","\" @click=\"","\"> Apply</nile-button>\n </div>\n </div>\n "])),this.hideInput?i(_templateObject7||(_templateObject7=_taggedTemplateLiteral([""]))):i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\">\n </nile-input>"])),this.formatDate(this.startDate),this.handleStartDateInput),this.hideTimeInput?"hidden":"",this.formatTime(this.startDate),this.handleStartTimeInput,this.hideInput?i(_templateObject9||(_templateObject9=_taggedTemplateLiteral([""]))):i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\"></nile-input>"])),this.formatDate(this.endDate),this.handleEndDateInput),this.hideTimeInput?"hidden":"",this.formatTime(this.endDate),this.handleEndTimeInput,!this.startDate||!this.endDate,this.confimRange):"");}}],[{key:"styles",get:function get(){return[a];}},{key:"observedAttributes",get:function get(){return["value","range"];}}]);}(l));t([e("nile-dropdown")],r.prototype,"dropdown",void 0),t([d({type:Boolean,reflect:!0})],r.prototype,"dropDownOpened",void 0),t([d({type:Object})],r.prototype,"value",void 0),t([d({type:Object,attribute:"allowed-dates"})],r.prototype,"allowedDates",void 0),t([d({type:Object})],r.prototype,"rangeValue",void 0),t([d({type:String,attribute:"value"})],r.prototype,"valueAttribute",void 0),t([d({type:String,attribute:"value"})],r.prototype,"formattedDate",void 0),t([d({type:Object})],r.prototype,"startDate",void 0),t([d({type:Object})],r.prototype,"endDate",void 0),t([d({type:Boolean})],r.prototype,"isSelectingStart",void 0),t([d({type:Boolean})],r.prototype,"range",void 0),t([d({type:String})],r.prototype,"type",void 0),t([d({type:String})],r.prototype,"selectedUnit",void 0),t([d({type:Number})],r.prototype,"selectedValue",void 0),t([d({type:String})],r.prototype,"selectedTimeZone",void 0),t([s()],r.prototype,"validAllowedDates",void 0),t([h("allowedDates")],r.prototype,"checkValidAllowedDate",null),t([s()],r.prototype,"hideInput",void 0),t([d({type:Boolean,attribute:"hide-time-input"})],r.prototype,"hideTimeInput",void 0),t([d({type:Array,attribute:"hide-duration-fields"})],r.prototype,"hideDurationFields",void 0),t([d({type:Boolean,attribute:"hide-time-zone"})],r.prototype,"hideTimeZone",void 0),t([h("value")],r.prototype,"valueChanged",null),_export("N",r=t([n("nile-calendar")],r));}};});
|
2
2
|
//# sourceMappingURL=nile-calendar.cjs.js.map
|