@aquera/nile-elements 0.0.75 → 0.0.77

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.
Files changed (35) hide show
  1. package/README.md +9 -1
  2. package/dist/index.iife.js +35 -18
  3. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  4. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  5. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  6. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  7. package/dist/nile-calendar/nile-calendar.css.esm.js +11 -6
  8. package/dist/nile-calendar/nile-calendar.esm.js +2 -2
  9. package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
  10. package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
  11. package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
  12. package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
  13. package/dist/nile-drawer/nile-drawer.css.esm.js +7 -2
  14. package/dist/nile-drawer/nile-drawer.esm.js +15 -8
  15. package/dist/nile-tab-group/nile-tab-group.css.cjs.js +1 -1
  16. package/dist/nile-tab-group/nile-tab-group.css.cjs.js.map +1 -1
  17. package/dist/nile-tab-group/nile-tab-group.css.esm.js +2 -2
  18. package/dist/src/nile-calendar/nile-calendar.css.js +11 -6
  19. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  20. package/dist/src/nile-calendar/nile-calendar.js +6 -2
  21. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  22. package/dist/src/nile-drawer/nile-drawer.css.d.ts +5 -5
  23. package/dist/src/nile-drawer/nile-drawer.css.js +10 -5
  24. package/dist/src/nile-drawer/nile-drawer.css.js.map +1 -1
  25. package/dist/src/nile-drawer/nile-drawer.js +18 -9
  26. package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
  27. package/dist/src/nile-tab-group/nile-tab-group.css.js +2 -2
  28. package/dist/src/nile-tab-group/nile-tab-group.css.js.map +1 -1
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +1 -1
  31. package/src/nile-calendar/nile-calendar.css.ts +11 -6
  32. package/src/nile-calendar/nile-calendar.ts +6 -2
  33. package/src/nile-drawer/nile-drawer.css.ts +11 -6
  34. package/src/nile-drawer/nile-drawer.ts +18 -9
  35. package/src/nile-tab-group/nile-tab-group.css.ts +2 -2
package/README.md CHANGED
@@ -79,7 +79,15 @@ 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.74
82
+ #### Version 0.0.77
83
+ - Nile calendar - Fixed: Hide Input on Allowed Dates
84
+ - dependency: @aquera/nile@0.3.25
85
+
86
+ #### Version 0.0.76
87
+ - Nile drawer - fixed cross icon hover issue
88
+ - dependency: @aquera/nile@0.3.25
89
+
90
+ #### Version 0.0.75
83
91
  - Nile Checkbox - reverted facelift changes
84
92
  - Nile Calender - fixed days alignment issue in safari
85
93
  - Nile Card - fixed hover issue
@@ -1894,6 +1894,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
1894
1894
  `}},M.NileBadge.styles=VN,N([$M({reflect:!0})],M.NileBadge.prototype,"variant",void 0),N([$M({type:Boolean,reflect:!0})],M.NileBadge.prototype,"rounded",void 0),N([$M({reflect:!0})],M.NileBadge.prototype,"pilltype",void 0),M.NileBadge=N([FM("nile-badge")],M.NileBadge);const FN=new Map,HN=new WeakMap;function XN(M,N){return"rtl"===N.toLowerCase()?{keyframes:M.rtlKeyframes||M.keyframes,options:M.options}:M}function $N(M,N){FN.set(M,function(M){return M??{keyframes:[],options:{duration:0}}}(N))}function _N(M,N,D){const i=HN.get(M);if(i?.[N])return XN(i[N],D.dir);const j=FN.get(N);return j?XN(j,D.dir):{keyframes:[],options:{duration:0}}}const qN=new Set;function KN(M){if(qN.add(M),!document.body.classList.contains("nile-scroll-lock")){const M=function(){const M=document.documentElement.clientWidth;return Math.abs(window.innerWidth-M)}();document.body.classList.add("nile-scroll-lock"),document.body.style.setProperty("--nile-scroll-lock-size",`${M}px`)}}function MD(M){qN.delete(M),0===qN.size&&(document.body.classList.remove("nile-scroll-lock"),document.body.style.removeProperty("--nile-scroll-lock-size"))}function ND(M,N,D="vertical",i="smooth"){const j=function(M,N){return{top:Math.round(M.getBoundingClientRect().top-N.getBoundingClientRect().top),left:Math.round(M.getBoundingClientRect().left-N.getBoundingClientRect().left)}}(M,N),t=j.top+N.scrollTop,I=j.left+N.scrollLeft,z=N.scrollLeft,u=N.scrollLeft+N.offsetWidth,g=N.scrollTop,e=N.scrollTop+N.offsetHeight;"horizontal"!==D&&"both"!==D||(I<z?N.scrollTo({left:I,behavior:i}):I+M.clientWidth>u&&N.scrollTo({left:I-N.offsetWidth+M.clientWidth,behavior:i})),"vertical"!==D&&"both"!==D||(t<g?N.scrollTo({top:t,behavior:i}):t+M.clientHeight>e&&N.scrollTo({top:t-N.offsetHeight+M.clientHeight,behavior:i}))}function DD(M){return M.charAt(0).toUpperCase()+M.slice(1)}function iD(M,N){return new Promise((D=>{M.addEventListener(N,(function i(j){j.target===M&&(M.removeEventListener(N,i),D())}))}))}function jD(M){const N=M.tagName.toLowerCase();return"-1"!==M.getAttribute("tabindex")&&(!M.hasAttribute("disabled")&&((!M.hasAttribute("aria-disabled")||"false"===M.getAttribute("aria-disabled"))&&(!("input"===N&&"radio"===M.getAttribute("type")&&!M.hasAttribute("checked"))&&(null!==M.offsetParent&&("hidden"!==window.getComputedStyle(M).visibility&&(!("audio"!==N&&"video"!==N||!M.hasAttribute("controls"))||(!!M.hasAttribute("tabindex")||(!(!M.hasAttribute("contenteditable")||"false"===M.getAttribute("contenteditable"))||["button","input","select","textarea","a","audio","video","summary"].includes(N)))))))))}function tD(M){const N=[];!function M(D){D instanceof HTMLElement&&(N.push(D),null!==D.shadowRoot&&"open"===D.shadowRoot.mode&&M(D.shadowRoot)),[...D.children].forEach((N=>M(N)))}(M);return{start:N.find((M=>jD(M)))??null,end:N.reverse().find((M=>jD(M)))??null}}let ID=[];class zD{constructor(M){this.tabDirection="forward",this.element=M,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){ID.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){ID=ID.filter((M=>M!==this.element)),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return ID[ID.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:M,end:N}=tD(this.element),D="forward"===this.tabDirection?M:N;"function"==typeof D?.focus&&D.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(M){"Tab"===M.key&&M.shiftKey&&(this.tabDirection="backward",requestAnimationFrame((()=>this.checkFocus())))}handleKeyUp(){this.tabDirection="forward"}}var uD=[z`
1895
1895
  :host {
1896
1896
  box-sizing: border-box;
1897
+ --nile-drawer-remove-icon-color:#000;
1897
1898
  }
1898
1899
 
1899
1900
  :host *,
@@ -2053,6 +2054,10 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
2053
2054
  display: none;
2054
2055
  }
2055
2056
 
2057
+ .drawer__close:hover {
2058
+ cursor:pointer;
2059
+ }
2060
+
2056
2061
  @media (forced-colors: active) {
2057
2062
  .drawer__panel {
2058
2063
  border: solid 1px hsl(0, 0%, 100%);
@@ -2063,7 +2068,12 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
2063
2068
  part="base"
2064
2069
  class=${uN({drawer:!0,"drawer--open":this.open,"drawer--top":"top"===this.placement,"drawer--end":"end"===this.placement,"drawer--bottom":"bottom"===this.placement,"drawer--start":"start"===this.placement,"drawer--contained":this.contained,"drawer--fixed":!this.contained,"drawer--rtl":"rtl","drawer--has-footer":this.hasSlotController.test("footer")})}
2065
2070
  >
2066
- <div part="overlay" class="drawer__overlay" @click=${()=>this.requestClose("overlay")} tabindex="-1"></div>
2071
+ <div
2072
+ part="overlay"
2073
+ class="drawer__overlay"
2074
+ @click=${()=>this.requestClose("overlay")}
2075
+ tabindex="-1"
2076
+ ></div>
2067
2077
 
2068
2078
  <div
2069
2079
  part="panel"
@@ -2079,19 +2089,21 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
2079
2089
  <header part="header" class="drawer__header">
2080
2090
  <h2 part="title" class="drawer__title" id="title">
2081
2091
  <!-- If there's no label, use an invisible character to prevent the header from collapsing -->
2082
- <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(65279)} </slot>
2092
+ <slot name="label">
2093
+ ${this.label.length>0?this.label:String.fromCharCode(65279)}
2094
+ </slot>
2083
2095
  </h2>
2084
2096
  <div part="header-actions" class="drawer__header-actions">
2085
2097
  <slot name="header-actions"></slot>
2086
- <nile-icon-button
2087
- part="close-button"
2088
- exportparts="base:close-button__base"
2098
+ <nile-icon
2089
2099
  class="drawer__close"
2090
2100
  name="close"
2091
- label='close'
2092
- library="system"
2101
+ label="close"
2102
+ part="close-button"
2103
+ exportparts="base:close-button__base"
2104
+ color="var(--nile-drawer-remove-icon-color)"
2093
2105
  @click=${()=>this.requestClose("close-button")}
2094
- ></nile-icon-button>
2106
+ ></nile-icon>
2095
2107
  </div>
2096
2108
  </header>
2097
2109
  `}
@@ -5029,13 +5041,18 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
5029
5041
  align-items: center;
5030
5042
  gap: 4px 7px;
5031
5043
  }
5032
-
5033
- @media not all and (min-resolution: .001dpcm) {
5034
- @supports (-webkit-appearance:none)
5044
+
5045
+ .day-names {
5046
+ flex-wrap: nowrap;
5047
+ }
5048
+
5049
+
5050
+ @media not all and (min-resolution: .001dpcm) {
5051
+ @supports (-webkit-appearance:none)
5035
5052
  { .day-names, .days {
5036
- column-gap: 6px;
5037
- }
5038
- }
5053
+ column-gap: 6px;
5054
+ }
5055
+ }
5039
5056
  }
5040
5057
 
5041
5058
  .days {
@@ -5485,7 +5502,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
5485
5502
  ${this.range&&"absolute"===this.type?EM`
5486
5503
  <div class="calender-input">
5487
5504
  <div>
5488
- <span class="manual-input-label">From </span>
5505
+ <span class="manual-input-label ${this.hideInput&&this.hideTimeInput?"hidden":""}">From </span>
5489
5506
  <div class="from">
5490
5507
  ${this.hideInput?EM``:EM`<nile-input class="manual-input" value="${this.formatDate(this.startDate)}" placeholder="DD/MM/YYYY" @nile-change="${this.handleStartDateInput}">
5491
5508
  </nile-input>`}
@@ -5495,7 +5512,7 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
5495
5512
  </div>
5496
5513
 
5497
5514
  <div>
5498
- <span class="manual-input-label">To </span>
5515
+ <span class="manual-input-label ${this.hideInput&&this.hideTimeInput?"hidden":""}">To </span>
5499
5516
  <div class="from">
5500
5517
  ${this.hideInput?EM``:EM`<nile-input class="manual-input" value="${this.formatDate(this.endDate)}" placeholder="DD/MM/YYYY" @nile-change="${this.handleEndDateInput}"></nile-input>`}
5501
5518
 
@@ -6363,8 +6380,8 @@ const rN=Symbol.for(""),xN=M=>{if((null==M?void 0:M.r)===rN)return null==M?void
6363
6380
  }
6364
6381
 
6365
6382
  .tab-group--top .tab-group__indicator {
6366
- bottom: calc(-1 * var(--track-width));
6367
- border-bottom: 2px solid var(--nile-colors-brand-600);
6383
+ bottom: 2px;
6384
+ border-bottom: 2px solid var(--nile-colors-primary-600);
6368
6385
  }
6369
6386
 
6370
6387
  .tab-group--top .tab-group__body {
@@ -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,_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));}};});
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&&this.hideTimeInput?"hidden":"",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&&this.hideTimeInput?"hidden":"",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