@aquera/nile-elements 0.1.57-beta-1.1 → 0.1.57-beta-1.2

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/demo/index.html CHANGED
@@ -8,58 +8,42 @@
8
8
  <script type="module" src="index.js"></script>
9
9
  </head>
10
10
  <style>
11
- /* nile-calendar::part(calendar-root) {
12
- border: 2px solid #2196f3;
13
- border-radius: 8px;
14
- padding: 1rem;
15
- background: #061bd6;
16
- }
11
+
17
12
 
18
- nile-calendar::part(calendar-header) {
19
- background: #000000;
20
- }
13
+
21
14
 
22
- nile-calendar::part(calendar-wrapper) {
23
- background: #d6d206;
24
- }
15
+
25
16
 
26
- nile-calendar::part(calendar-container) {
27
- background: #d40ad1;
28
- }
29
- nile-calendar::part(calendar-config) {
30
- background: #ce0606;
31
- padding: 0.5rem;
32
- }
17
+
33
18
 
34
- nile-calendar::part(calendar-tab-group) {
35
- border-bottom: 1px solid #09b723;
36
- background: #09b723;
37
- }
19
+
38
20
 
39
- nile-calendar::part(calendar-tab-absolute),
40
- nile-calendar::part(calendar-tab-relative) {
41
- font-weight: bold;
42
- background: #091ab7;
21
+
43
22
 
44
- }
23
+
45
24
 
46
- nile-calendar::part(calendar-footer) {
47
- display: flex;
48
- justify-content: flex-end;
49
- gap: 0.5rem;
50
- padding-top: 1rem;
51
- background: #a6ce06
52
- }
25
+
53
26
 
54
- nile-calendar::part(calendar-apply) {
55
- background-color: #4caf50;
56
- color: white;
57
- }
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
58
43
 
59
- nile-calendar::part(calendar-reset) {
60
- background-color: #dc35e5;
61
- color: white;
62
- } */
44
+
45
+
46
+
63
47
  </style>
64
48
 
65
49
  <body>
@@ -71,27 +55,63 @@
71
55
  <nile-circular-progressbar value="80" size="60"></nile-circular-progressbar>
72
56
  <nile-circular-progressbar></nile-circular-progressbar>
73
57
  <nile-circular-progressbar value="30" content=" "></nile-circular-progressbar>
74
-
75
- <nile-calendar range hideTypes></nile-calendar>
76
- <nile-calendar range ></nile-calendar>
77
-
58
+ <!-- <nile-calendar range hideTypes></nile-calendar> -->
59
+ <!-- <nile-calendar range ></nile-calendar> -->
60
+ <nile-calendar range type='relative'></nile-calendar>
61
+ <!--
78
62
  <nile-calendar startYear="2010" endYear="2030"></nile-calendar>
79
63
 
80
64
  <nile-calendar range allowclear></nile-calendar>
81
65
 
82
- <nile-calendar range allowClear showManualInputs></nile-calendar>
66
+ <nile-calendar range allowClear showManualInputs></nile-calendar> -->
67
+
83
68
 
84
69
 
85
- <div class="component-viewer">
86
- <div class="form-element">
87
- <nile-calendar range id="myCalendar3"></nile-calendar>
88
- </div>
89
- </div>
90
70
 
91
71
 
92
72
  <script>
93
- const myCalendar3 = document.querySelector('#myCalendar3');
94
- myCalendar3.hideDurationFields=['hours','days'];
73
+
74
+
75
+
76
+ const calendar = document.querySelector('nile-calendar');
77
+
78
+ if (calendar) {
79
+ calendar.addEventListener('nile-init', (e) => {
80
+ console.log('[nile-init]', e);
81
+ });
82
+
83
+ calendar.addEventListener('nile-destroy', (e) => {
84
+ console.log('[nile-destroy]', e);
85
+ });
86
+
87
+ calendar.addEventListener('nile-change', (e) => {
88
+ console.log('[nile-change]', e.detail);
89
+ });
90
+
91
+ calendar.addEventListener('nile-changed', (e) => {
92
+ console.log('[nile-changed]', e.detail);
93
+ });
94
+
95
+ calendar.addEventListener('nile-clear', (e) => {
96
+ console.log('[nile-clear]', e);
97
+ });
98
+
99
+ calendar.addEventListener('nile-month-change', (e) => {
100
+ console.log('[nile-month-change]', `Month index: ${e.detail.month}`);
101
+ });
102
+
103
+ calendar.addEventListener('nile-year-change', (e) => {
104
+ console.log('[nile-year-change]', `Year: ${e.detail.year}`);
105
+ });
106
+
107
+ calendar.addEventListener('nile-type-change', (e) => {
108
+ console.log('[nile-type-change]', `Type: ${e.detail.value}`);
109
+ });
110
+ } else {
111
+ console.warn('nile-calendar element not found.');
112
+ }
113
+
114
+
95
115
  </script>
96
116
 
97
117
 
@@ -1,2 +1,2 @@
1
- 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);}System.register(["tslib","lit","lit/decorators.js","./nile-calendar.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,a,l,r,h,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,o;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_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(r){if(Array.isArray(r))return r;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_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(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;n=_litDecoratorsJs.state;a=_litDecoratorsJs.customElement;},function(_nileCalendarCssCjsJs){l=_nileCalendarCssCjsJs.s;},function(_litDirectivesClassMapJs){r=_litDirectivesClassMapJs.classMap;},function(_internalWatchCjsJs){h=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){d=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",o=/*#__PURE__*/function(_d){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.valueAttribute=null,_this.allowedDates=JSON.stringify({}),_this.range=!1,_this.hideTypes=!1,_this.doubleClickUnselect=!1,_this.allowClear=!1,_this.type="absolute",_this.hideDurationFields=[],_this.showManualInputs=!1,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.hideInput=!1,_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.allowedDatesLocal=null;return _this;}_inherits(o,_d);return _createClass(o,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(o,"connectedCallback",this,3)([]),this.initializeValue(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(o,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}},{key:"updated",value:function updated(t){if(_superPropGet(o,"updated",this,3)([t]),t.has("valueAttribute")){this.valueAttribute||(this.value=null,this.startDate=null,this.endDate=null,this.isSelectingStart=!0);var _t=new Date(this.valueAttribute||"");if(!isNaN(_t.getTime())){var _i=_t.getTimezoneOffset();this.value=new Date(_t.getTime()-60*_i*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}this.initializeValue();}}},{key:"monthNames",get:function get(){return Array.from({length:12},function(t,i){return new Date(0,i).toLocaleString("default",{month:"short"});});}},{key:"yearOptions",get:function get(){var _this$startYear,_this$endYear;var t=(_this$startYear=this.startYear)!==null&&_this$startYear!==void 0?_this$startYear:2e3,i=(_this$endYear=this.endYear)!==null&&_this$endYear!==void 0?_this$endYear:2050;return t>i?[]:Array.from({length:i-t+1},function(i,e){return t+e;});}},{key:"onMonthSelected",value:function onMonthSelected(t){this.currentMonth=t,this.emit("nile-month-change",{month:t});}},{key:"onYearSelected",value:function onYearSelected(t){this.currentYear=t,this.emit("nile-year-change",{year:t});}},{key:"checkValidAllowedDate",value:function checkValidAllowedDate(){var t;try{t=JSON.parse(this.allowedDates);}catch(i){t=null;}if(!t||0==Object.keys(t).length)return void(this.allowedDatesLocal=null);this.hideInput=!0;this.getUTCDate(t.startDate)>this.getUTCDate(t.endDate)?console.error("StartDate must be greater than endDate"):this.allowedDatesLocal=t;}},{key:"isPrevDisabled",value:function isPrevDisabled(){return 0===this.currentMonth&&void 0!==this.startYear&&this.currentYear<=this.startYear;}},{key:"isNextDisabled",value:function isNextDisabled(){return 11===this.currentMonth&&void 0!==this.endYear&&this.currentYear>=this.endYear;}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n class=","\n part=\"calendar-root\"\n >\n <div class="," part=\"calendar-config\">\n <div class=\"calendar-switcher\" part=\"calendar-switcher\">\n <nile-tab-group centered @nile-tab-show=\"","\" value=\"","\">\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 ","\n ","\n\n ","\n </div>\n "])),r({base:!0,base__range:this.range}),r({"calendar-config":!0,hidden:!this.range||this.range&&this.hideTypes}),this.onTypeChange,this.type,"relative"==this.type?this.renderRelativeCalendar():"","absolute"==this.type?this.renderAbsoluteCalendar():"",this.range?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div class=\"button-container\" part=\"calendar-footer\">\n ","\n <nile-button \n class=\"apply-button\" \n ?disabled=\"","\" \n @click=\"","\"\n > Apply</nile-button>\n </div>\n "])),this.allowClear?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-button \n class=\"clear-button\"\n variant=\"secondary\"\n ?disabled=\"","\"\n @click=\"","\"\n > Reset</nile-button>"])),!this.startDate||!this.endDate,this.clearDate):e,!this.startDate||!this.endDate,this.confimRange):"");}},{key:"renderAbsoluteCalendar",value:function renderAbsoluteCalendar(){return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div class=\"calendar-wrapper\" part=\"calendar-wrapper\">\n <div class=\"calendar-container\" part=\"calendar-container\">\n ","\n </div>\n </div>\n ","\n "])),this.renderMonth(this.currentYear,this.currentMonth,this.getDaysArray(this.currentYear,this.currentMonth)),this.range?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div class=\"calender-input ","\" >\n <div class=\"from\">\n <nile-input \n label=\"From\"\n class=\"manual-input\" \n value=\"","\" \n placeholder=\"HH:MM:SS\" @nile-change=\"","\"\n > </nile-input>\n </div>\n\n <div class=\"from\">\n <nile-input \n label=\"To\"\n class=\"manual-input\" \n value=\"","\" \n placeholder=\"HH:MM:SS\" @nile-change=\"","\"\n > </nile-input>\n </div>\n </div>\n "])),this.showManualInputs?"":"hidden",this.formatTime(this.startDate),this.handleStartTimeInput,this.formatTime(this.endDate),this.handleEndTimeInput):"");}},{key:"renderRelativeCalendar",value:function renderRelativeCalendar(){var _this$hideDurationFie,_this$hideDurationFie2,_this$hideDurationFie3,_this$hideDurationFie4,_this$hideDurationFie5,_this$hideDurationFie6,_this$hideDurationFie7,_this$hideDurationFie8,_this$hideDurationFie9,_this$hideDurationFie10;return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <div class=\"units-wrapper\">\n <div class=\"unit-container\">\n ","\n\n ","\n \n ","\n \n ","\n \n ","\n </div>\n </div>\n \n ","\n "])),(_this$hideDurationFie=this.hideDurationFields)!==null&&_this$hideDurationFie!==void 0&&_this$hideDurationFie.includes("minutes")?"":i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Minutes</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("minutes",[1,5,15,30,45])),(_this$hideDurationFie2=this.hideDurationFields)!==null&&_this$hideDurationFie2!==void 0&&_this$hideDurationFie2.includes("hours")?"":i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Hours</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("hours",[1,2,3,6,8,12])),(_this$hideDurationFie3=this.hideDurationFields)!==null&&_this$hideDurationFie3!==void 0&&_this$hideDurationFie3.includes("days")?"":i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Days</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("days",[1,2,3,4,5,6])),(_this$hideDurationFie4=this.hideDurationFields)!==null&&_this$hideDurationFie4!==void 0&&_this$hideDurationFie4.includes("weeks")?"":i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Weeks</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n \n "])),this.renderTimeValues("weeks",[1,2,4,6])),(_this$hideDurationFie5=this.hideDurationFields)!==null&&_this$hideDurationFie5!==void 0&&_this$hideDurationFie5.includes("months")?"":i(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Months</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("months",[3,6,12,15])),this.range?i(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div>\n <div class=\"unit-input-container\">\n <nile-input \n class=\"manual-input duration-input\" \n label=\"Duration\"\n inputmode=\"numeric\"\n type=\"number\"\n value=\"","\" \n @nile-change=\"","\"\n placeholder=\"Enter Value\"\n ></nile-input>\n\n <nile-select class=\"manual-input time-input\" \n label=\"Unit of time\" \n 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 </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":""):"");}},{key:"renderTimeValues",value:function renderTimeValues(t,e){var _this2=this;return e.map(function(e){return i(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n <div\n class=\"duration__value ","\"\n @click=","\n >","\n </div>"])),_this2.selectedUnit===t&&_this2.selectedValue===e?"duration__value--selected":"",function(i){return _this2.handleTimeValueClick(t,e,i);},e);});}},{key:"renderMonth",value:function renderMonth(t,s,n){var _this3=this;var a=new Date(t,s,1).getDay(),l=new Date(t,s+1,0).getDay(),h=this.getDaysArray(0===s?t-1:t,0===s?11:s-1),d=this.getDaysArray(11===s?t+1:t,11===s?0:s+1),_o=h.slice(h.length-a),c=d.slice(0,6-l),u=[].concat(_toConsumableArray(_o),_toConsumableArray(n),_toConsumableArray(c)),v=function v(t,i,e,s){if(!s)return"";if(!_this3.range&&_this3.value){if(t===_this3.value.getDate()&&i===_this3.value.getMonth()&&e===_this3.value.getFullYear())return"selected-date";}var n=_this3.startDate&&t===_this3.startDate.getDate()&&i===_this3.startDate.getMonth()&&e===_this3.startDate.getFullYear(),a=_this3.endDate&&t===_this3.endDate.getDate()&&i===_this3.endDate.getMonth()&&e===_this3.endDate.getFullYear();return n?"range-start":a?"range-end":"";},p=function p(t,i,e,s){if(!s)return!1;if(_this3.startDate&&_this3.endDate){var _s=new Date(e,i,t);return _s>=_this3.startDate&&_s<=_this3.endDate;}return!1;};return i(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n <div class=\"calendar\">\n <div class=\"calendar-header\" part=\"calendar-header\">\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowleft\"\n ?disabled=\"","\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n \n <!-- MONTH DROPDOWN -->\n <div class=\"calendar-header__center\">\n <nile-dropdown class=\"month-dropdown\">\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger month-trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"","\"\n >\n ","\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu >\n <div class=\"month-scroll-wrapper\">\n ","\n </div>\n</nile-menu>\n </nile-dropdown>\n\n <!-- YEAR DROPDOWN -->\n <nile-dropdown class=\"year-dropdown\" >\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"","\"\n >\n ","\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu>\n <div class=\"year-scroll-wrapper\">\n ","\n </div>\n </nile-menu>\n </nile-dropdown>\n </div>\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowright\"\n ?disabled=\"","\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n </div>\n <div class=\"days_container\">\n <div class=\"day_name\">Su</div>\n <div class=\"day_name\">Mo</div>\n <div class=\"day_name\">Tu</div>\n <div class=\"day_name\">We</div>\n <div class=\"day_name\">Th</div>\n <div class=\"day_name\">Fr</div>\n <div class=\"day_name\">Sa</div>\n\n ","\n </div>\n </div>\n "])),this.isPrevDisabled(),this.prevMonth,function(t){return t.currentTarget.click();},new Date(t,s).toLocaleString("default",{month:"long"}),this.monthNames.map(function(t,e){return i(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["\n <nile-menu-item\n class=\"month-menu-item\"\n ?selected=\"","\"\n id=\"","\"\n @click=\"","\"\n >\n ","\n </nile-menu-item>\n"])),e===s,e===s?"selected-month-item":"",function(){return _this3.onMonthSelected(e);},t);}),function(t){return t.currentTarget.click();},t,this.yearOptions.map(function(e){return i(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n <nile-menu-item\n class=\"year-menu-item\"\n ?selected=\"","\"\n @click=\"","\"\n >\n ","\n\n </nile-menu-item>\n "])),e===t,function(){return _this3.onYearSelected(e);},e);}),this.isNextDisabled(),this.nextMonth,u.map(function(a,l){var h=l>=_o.length&&l<_o.length+n.length,d=v(a,s,t,h),c={day_date:!0,"not-allowed":!_this3.isAllowedDate(a,s,t),"in-range":p(a,s,t,h),filler:!h};return d&&(c[d]=!0),i(_templateObject17||(_templateObject17=_taggedTemplateLiteral([" \n <div\n part=\"calendar-day\"\n class=","\n @click=\"","\"\n >\n <span style=\"position:relative;\">\n ","\n ","\n </span>\n </div>"])),r(c),function(){h&&_this3.selectDate(a,s,t);},a,function(t,i,e){var s=new Date();return t===s.getDate()&&i+1===s.getMonth()+1&&e===s.getFullYear();}(a,s,t)&&h?i(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["<div class=\"current__date__dot\" part=\"current-date-dot\"></div>"]))):e);}));}},{key:"isAllowedDate",value:function isAllowedDate(t,i,e){if(!this.allowedDatesLocal)return!0;var s=new Date(Date.UTC(e,i,t)),n=this.getUTCDate(this.allowedDatesLocal.startDate),a=this.getUTCDate(this.allowedDatesLocal.endDate);a.setUTCHours(23,59,59,999);return s>=n&&s<=a;}},{key:"clearDate",value:function clearDate(){this.range?(this.valueAttribute="",this.startDate=null,this.endDate=null):this.value=null,this.emit("nile-clear");}},{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 _t2=s;_t2.setHours(23,59,59,999),this.endDate=_t2;}}else{if(String(this.value)==String(s)&&this.doubleClickUnselect)return void this.clearDate();this.value=s,this.emitChangedData({value:this.value});}}},{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.value=null;}catch(t){}else if(this.valueAttribute){var _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());}}},{key:"handleDurationChange",value:function handleDurationChange(t){t.stopPropagation(),t.detail.value=t.detail.value.replace(/e/gi,"");var i=Number(t.detail.value);i&&(this.selectedValue=i,this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t));}},{key:"handleUnitChange",value:function handleUnitChange(t){t.stopPropagation(),this.selectedUnit=t.detail.value,this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t);}},{key:"handleTimeValueClick",value:function handleTimeValueClick(t,i,e){this.createRelativePeriod(t,i),this.selectedUnit=t,this.selectedValue=i;}},{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()),{startDate:this.startDate,endDate:this.endDate};}},{key:"handleStartTimeInput",value:function handleStartTimeInput(t){if(t.stopPropagation(),!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(t.stopPropagation(),!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:"parseTime",value:function parseTime(t,i){if(!this.isValidTimeInput(t))return null;var _t$split$map=t.split(":").map(Number),_t$split$map2=_slicedToArray(_t$split$map,3),e=_t$split$map2[0],s=_t$split$map2[1],n=_t$split$map2[2],a=new Date(i.getTime());return a.setHours(e,s,n),a;}},{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:"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:"nextMonth",value:function nextMonth(){if(11===this.currentMonth){var _t5=this.currentYear+1;if(void 0!==this.endYear&&_t5>this.endYear)return;this.currentMonth=0,this.currentYear=_t5;}else this.currentMonth++;}},{key:"prevMonth",value:function prevMonth(){if(0===this.currentMonth){var _t6=this.currentYear-1;if(void 0!==this.startYear&&_t6<this.startYear)return;this.currentMonth=11,this.currentYear=_t6;}else this.currentMonth--;}},{key:"confimRange",value:function confimRange(){this.startDate&&this.endDate&&this.emitChangedData({startDate:this.startDate,endDate:this.endDate});}},{key:"onTypeChange",value:function onTypeChange(t){this.type=t.detail.value,this.emit("nile-type-change",{value:this.type});}},{key:"getUTCDate",value:function getUTCDate(t){return new Date(Date.UTC(t.slice(0,4),t.slice(5,7)-1,t.slice(8,10)));}},{key:"emitChangedData",value:function emitChangedData(t){this.emit("nile-changed",t),this.emit("nile-change",t);}},{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:"styles",get:function get(){return[l];}}]);}(d));t([s({type:String,attribute:"value"})],o.prototype,"valueAttribute",void 0),t([s({type:String,attribute:!0,reflect:!0})],o.prototype,"allowedDates",void 0),t([s({type:Boolean,reflect:!0})],o.prototype,"range",void 0),t([s({type:Boolean,attribute:!0,reflect:!0})],o.prototype,"hideTypes",void 0),t([s({type:Boolean,reflect:!0})],o.prototype,"doubleClickUnselect",void 0),t([s({type:Boolean,reflect:!0})],o.prototype,"allowClear",void 0),t([s({type:String,reflect:!0})],o.prototype,"type",void 0),t([s({type:String})],o.prototype,"selectedUnit",void 0),t([s({type:Number})],o.prototype,"selectedValue",void 0),t([s({type:Array,attribute:"hide-duration-fields"})],o.prototype,"hideDurationFields",void 0),t([s({type:Boolean})],o.prototype,"showManualInputs",void 0),t([n()],o.prototype,"startDate",void 0),t([n()],o.prototype,"endDate",void 0),t([n()],o.prototype,"isSelectingStart",void 0),t([n()],o.prototype,"hideInput",void 0),t([n()],o.prototype,"value",void 0),t([n()],o.prototype,"currentMonth",void 0),t([n()],o.prototype,"currentYear",void 0),t([n()],o.prototype,"allowedDatesLocal",void 0),t([s({type:Number})],o.prototype,"startYear",void 0),t([s({type:Number})],o.prototype,"endYear",void 0),t([h("allowedDates")],o.prototype,"checkValidAllowedDate",null),_export("N",o=t([a("nile-calendar")],o));}};});
1
+ 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);}System.register(["tslib","lit","lit/decorators.js","./nile-calendar.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,a,l,r,h,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,o;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_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(r){if(Array.isArray(r))return r;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_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(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}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(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.property;n=_litDecoratorsJs.state;a=_litDecoratorsJs.customElement;},function(_nileCalendarCssCjsJs){l=_nileCalendarCssCjsJs.s;},function(_litDirectivesClassMapJs){r=_litDirectivesClassMapJs.classMap;},function(_internalWatchCjsJs){h=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){d=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",o=/*#__PURE__*/function(_d){function o(){var _this;_classCallCheck(this,o);_this=_callSuper(this,o,arguments),_this.valueAttribute=null,_this.allowedDates=JSON.stringify({}),_this.range=!1,_this.hideTypes=!1,_this.doubleClickUnselect=!1,_this.allowClear=!1,_this.type="absolute",_this.hideDurationFields=[],_this.showManualInputs=!1,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.hideInput=!1,_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.allowedDatesLocal=null;return _this;}_inherits(o,_d);return _createClass(o,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(o,"connectedCallback",this,3)([]),this.initializeValue(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(o,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}},{key:"updated",value:function updated(t){if(_superPropGet(o,"updated",this,3)([t]),t.has("valueAttribute")){this.valueAttribute||(this.value=null,this.startDate=null,this.endDate=null,this.isSelectingStart=!0);var _t=new Date(this.valueAttribute||"");if(!isNaN(_t.getTime())){var _i=_t.getTimezoneOffset();this.value=new Date(_t.getTime()-60*_i*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}this.initializeValue();}}},{key:"monthNames",get:function get(){return Array.from({length:12},function(t,i){return new Date(0,i).toLocaleString("default",{month:"short"});});}},{key:"yearOptions",get:function get(){var _this$startYear,_this$endYear;var t=(_this$startYear=this.startYear)!==null&&_this$startYear!==void 0?_this$startYear:2e3,i=(_this$endYear=this.endYear)!==null&&_this$endYear!==void 0?_this$endYear:2050;return t>i?[]:Array.from({length:i-t+1},function(i,e){return t+e;});}},{key:"onMonthSelected",value:function onMonthSelected(t){this.currentMonth=t,this.emit("nile-month-change",{month:t});}},{key:"onYearSelected",value:function onYearSelected(t){this.currentYear=t,this.emit("nile-year-change",{year:t});}},{key:"checkValidAllowedDate",value:function checkValidAllowedDate(){var t;try{t=JSON.parse(this.allowedDates);}catch(i){t=null;}if(!t||0==Object.keys(t).length)return void(this.allowedDatesLocal=null);this.hideInput=!0;this.getUTCDate(t.startDate)>this.getUTCDate(t.endDate)?console.error("StartDate must be greater than endDate"):this.allowedDatesLocal=t;}},{key:"isPrevDisabled",value:function isPrevDisabled(){return 0===this.currentMonth&&void 0!==this.startYear&&this.currentYear<=this.startYear;}},{key:"isNextDisabled",value:function isNextDisabled(){return 11===this.currentMonth&&void 0!==this.endYear&&this.currentYear>=this.endYear;}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n class=","\n part=\"calendar-root\"\n >\n <div class="," part=\"calendar-config\">\n <div class=\"calendar-switcher\" part=\"calendar-switcher\">\n <nile-tab-group centered @nile-tab-show=\"","\" value=\"","\">\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 ","\n ","\n\n ","\n </div>\n "])),r({base:!0,base__range:this.range}),r({"calendar-config":!0,hidden:!this.range||this.range&&this.hideTypes}),this.onTypeChange,this.type,"relative"==this.type?this.renderRelativeCalendar():"","absolute"==this.type?this.renderAbsoluteCalendar():"",this.range?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div class=\"button-container\" part=\"calendar-footer\">\n ","\n <nile-button \n class=\"apply-button\" \n ?disabled=\"","\" \n @click=\"","\"\n > Apply</nile-button>\n </div>\n "])),this.allowClear?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-button \n class=\"clear-button\"\n variant=\"secondary\"\n ?disabled=\"","\"\n @click=\"","\"\n > Reset</nile-button>"])),!this.startDate||!this.endDate,this.clearDate):e,!this.startDate||!this.endDate,this.confimRange):"");}},{key:"renderAbsoluteCalendar",value:function renderAbsoluteCalendar(){return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div class=\"calendar-wrapper\" part=\"calendar-wrapper\">\n <div class=\"calendar-container\" part=\"calendar-container\">\n ","\n </div>\n </div>\n ","\n "])),this.renderMonth(this.currentYear,this.currentMonth,this.getDaysArray(this.currentYear,this.currentMonth)),this.range?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div class=\"calender-input ","\" >\n <div class=\"from\">\n <nile-input \n label=\"From\"\n class=\"manual-input\" \n value=\"","\" \n placeholder=\"HH:MM:SS\" @nile-change=\"","\"\n > </nile-input>\n </div>\n\n <div class=\"from\">\n <nile-input \n label=\"To\"\n class=\"manual-input\" \n value=\"","\" \n placeholder=\"HH:MM:SS\" @nile-change=\"","\"\n > </nile-input>\n </div>\n </div>\n "])),this.showManualInputs?"":"hidden",this.formatTime(this.startDate),this.handleStartTimeInput,this.formatTime(this.endDate),this.handleEndTimeInput):"");}},{key:"renderRelativeCalendar",value:function renderRelativeCalendar(){var _this$hideDurationFie,_this$hideDurationFie2,_this$hideDurationFie3,_this$hideDurationFie4,_this$hideDurationFie5,_this$hideDurationFie6,_this$hideDurationFie7,_this$hideDurationFie8,_this$hideDurationFie9,_this$hideDurationFie10;return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <div class=\"units-wrapper\">\n <div class=\"unit-container\">\n ","\n\n ","\n \n ","\n \n ","\n \n ","\n </div>\n </div>\n \n ","\n "])),(_this$hideDurationFie=this.hideDurationFields)!==null&&_this$hideDurationFie!==void 0&&_this$hideDurationFie.includes("minutes")?"":i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Minutes</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("minutes",[1,5,15,30,45])),(_this$hideDurationFie2=this.hideDurationFields)!==null&&_this$hideDurationFie2!==void 0&&_this$hideDurationFie2.includes("hours")?"":i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Hours</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("hours",[1,2,3,6,8,12])),(_this$hideDurationFie3=this.hideDurationFields)!==null&&_this$hideDurationFie3!==void 0&&_this$hideDurationFie3.includes("days")?"":i(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Days</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("days",[1,2,3,4,5,6])),(_this$hideDurationFie4=this.hideDurationFields)!==null&&_this$hideDurationFie4!==void 0&&_this$hideDurationFie4.includes("weeks")?"":i(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Weeks</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n \n "])),this.renderTimeValues("weeks",[1,2,4,6])),(_this$hideDurationFie5=this.hideDurationFields)!==null&&_this$hideDurationFie5!==void 0&&_this$hideDurationFie5.includes("months")?"":i(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n <div class=\"unit-group\">\n <div class=\"duration-name\">Months</div>\n <div class=\"duration-units\">\n ","\n </div>\n </div>\n "])),this.renderTimeValues("months",[3,6,12,15])),this.range?i(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n <div>\n <div>\n <div class=\"unit-input-container\" part=\"unit-input-container\" style=\"display: flex; gap: 1rem; align-items: flex-end;\">\n \n <div class=\"input-wrapper\" part=\"input-wrapper\" style=\"flex: 1;\">\n <nile-input \n class=\"manual-input duration-input\" \n label=\"Duration\"\n inputmode=\"numeric\"\n type=\"number\"\n value=\"","\" \n @nile-change=\"","\"\n placeholder=\"Enter Value\"\n ></nile-input>\n </div>\n\n <div class=\"select-wrapper\" part=\"select-wrapper\" style=\"flex: 1;\">\n <nile-select \n class=\"manual-input time-input\" \n label=\"Unit of time\" \n 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 </div>\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":""):"");}},{key:"renderTimeValues",value:function renderTimeValues(t,e){var _this2=this;return e.map(function(e){return i(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n <div\n class=\"duration__value ","\"\n @click=","\n >","\n </div>"])),_this2.selectedUnit===t&&_this2.selectedValue===e?"duration__value--selected":"",function(i){return _this2.handleTimeValueClick(t,e,i);},e);});}},{key:"renderMonth",value:function renderMonth(t,s,n){var _this3=this;var a=new Date(t,s,1).getDay(),l=new Date(t,s+1,0).getDay(),h=this.getDaysArray(0===s?t-1:t,0===s?11:s-1),d=this.getDaysArray(11===s?t+1:t,11===s?0:s+1),_o=h.slice(h.length-a),c=d.slice(0,6-l),u=[].concat(_toConsumableArray(_o),_toConsumableArray(n),_toConsumableArray(c)),v=function v(t,i,e,s){if(!s)return"";if(!_this3.range&&_this3.value){if(t===_this3.value.getDate()&&i===_this3.value.getMonth()&&e===_this3.value.getFullYear())return"selected-date";}var n=_this3.startDate&&t===_this3.startDate.getDate()&&i===_this3.startDate.getMonth()&&e===_this3.startDate.getFullYear(),a=_this3.endDate&&t===_this3.endDate.getDate()&&i===_this3.endDate.getMonth()&&e===_this3.endDate.getFullYear();return n?"range-start":a?"range-end":"";},p=function p(t,i,e,s){if(!s)return!1;if(_this3.startDate&&_this3.endDate){var _s=new Date(e,i,t);return _s>=_this3.startDate&&_s<=_this3.endDate;}return!1;};return i(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n <div class=\"calendar\">\n <div class=\"calendar-header\" part=\"calendar-header\">\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowleft\"\n ?disabled=\"","\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n \n <!-- MONTH DROPDOWN -->\n <div class=\"calendar-header__center\">\n <nile-dropdown class=\"month-dropdown\">\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger month-trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"","\"\n >\n ","\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu >\n <div class=\"month-scroll-wrapper\">\n ","\n </div>\n</nile-menu>\n </nile-dropdown>\n\n <!-- YEAR DROPDOWN -->\n <nile-dropdown class=\"year-dropdown\" >\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"","\"\n >\n ","\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu>\n <div class=\"year-scroll-wrapper\">\n ","\n </div>\n </nile-menu>\n </nile-dropdown>\n </div>\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowright\"\n ?disabled=\"","\"\n color=\"black\"\n @click=\"","\"\n >\n </nile-icon>\n </div>\n <div class=\"days_container\">\n <div class=\"day_name\">Su</div>\n <div class=\"day_name\">Mo</div>\n <div class=\"day_name\">Tu</div>\n <div class=\"day_name\">We</div>\n <div class=\"day_name\">Th</div>\n <div class=\"day_name\">Fr</div>\n <div class=\"day_name\">Sa</div>\n\n ","\n </div>\n </div>\n "])),this.isPrevDisabled(),this.prevMonth,function(t){return t.currentTarget.click();},new Date(t,s).toLocaleString("default",{month:"long"}),this.monthNames.map(function(t,e){return i(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["\n <nile-menu-item\n class=\"month-menu-item\"\n ?selected=\"","\"\n id=\"","\"\n @click=\"","\"\n >\n ","\n </nile-menu-item>\n"])),e===s,e===s?"selected-month-item":"",function(){return _this3.onMonthSelected(e);},t);}),function(t){return t.currentTarget.click();},t,this.yearOptions.map(function(e){return i(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n <nile-menu-item\n class=\"year-menu-item\"\n ?selected=\"","\"\n @click=\"","\"\n >\n ","\n\n </nile-menu-item>\n "])),e===t,function(){return _this3.onYearSelected(e);},e);}),this.isNextDisabled(),this.nextMonth,u.map(function(a,l){var h=l>=_o.length&&l<_o.length+n.length,d=v(a,s,t,h),c={day_date:!0,"not-allowed":!_this3.isAllowedDate(a,s,t),"in-range":p(a,s,t,h),filler:!h};return d&&(c[d]=!0),i(_templateObject17||(_templateObject17=_taggedTemplateLiteral([" \n <div\n part=\"calendar-day\"\n class=","\n @click=\"","\"\n >\n <span style=\"position:relative;\">\n ","\n ","\n </span>\n </div>"])),r(c),function(){h&&_this3.selectDate(a,s,t);},a,function(t,i,e){var s=new Date();return t===s.getDate()&&i+1===s.getMonth()+1&&e===s.getFullYear();}(a,s,t)&&h?i(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["<div class=\"current__date__dot\" part=\"current-date-dot\"></div>"]))):e);}));}},{key:"isAllowedDate",value:function isAllowedDate(t,i,e){if(!this.allowedDatesLocal)return!0;var s=new Date(Date.UTC(e,i,t)),n=this.getUTCDate(this.allowedDatesLocal.startDate),a=this.getUTCDate(this.allowedDatesLocal.endDate);a.setUTCHours(23,59,59,999);return s>=n&&s<=a;}},{key:"clearDate",value:function clearDate(){this.range?(this.valueAttribute="",this.startDate=null,this.endDate=null):this.value=null,this.emit("nile-clear");}},{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 _t2=s;_t2.setHours(23,59,59,999),this.endDate=_t2;}}else{if(String(this.value)==String(s)&&this.doubleClickUnselect)return void this.clearDate();this.value=s,this.emitChangedData({value:this.value});}}},{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.value=null;}catch(t){}else if(this.valueAttribute){var _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());}}},{key:"handleDurationChange",value:function handleDurationChange(t){t.stopPropagation(),t.detail.value=t.detail.value.replace(/e/gi,"");var i=Number(t.detail.value);i&&(this.selectedValue=i,this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t));}},{key:"handleUnitChange",value:function handleUnitChange(t){t.stopPropagation(),this.selectedUnit=t.detail.value,this.selectedUnit&&this.selectedValue&&this.handleTimeValueClick(this.selectedUnit,this.selectedValue,t);}},{key:"handleTimeValueClick",value:function handleTimeValueClick(t,i,e){this.createRelativePeriod(t,i),this.selectedUnit=t,this.selectedValue=i;}},{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()),{startDate:this.startDate,endDate:this.endDate};}},{key:"handleStartTimeInput",value:function handleStartTimeInput(t){if(t.stopPropagation(),!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(t.stopPropagation(),!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:"parseTime",value:function parseTime(t,i){if(!this.isValidTimeInput(t))return null;var _t$split$map=t.split(":").map(Number),_t$split$map2=_slicedToArray(_t$split$map,3),e=_t$split$map2[0],s=_t$split$map2[1],n=_t$split$map2[2],a=new Date(i.getTime());return a.setHours(e,s,n),a;}},{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:"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:"nextMonth",value:function nextMonth(){if(11===this.currentMonth){var _t5=this.currentYear+1;if(void 0!==this.endYear&&_t5>this.endYear)return;this.currentMonth=0,this.currentYear=_t5;}else this.currentMonth++;}},{key:"prevMonth",value:function prevMonth(){if(0===this.currentMonth){var _t6=this.currentYear-1;if(void 0!==this.startYear&&_t6<this.startYear)return;this.currentMonth=11,this.currentYear=_t6;}else this.currentMonth--;}},{key:"confimRange",value:function confimRange(){this.startDate&&this.endDate&&this.emitChangedData({startDate:this.startDate,endDate:this.endDate});}},{key:"onTypeChange",value:function onTypeChange(t){this.type=t.detail.value,this.emit("nile-type-change",{value:this.type});}},{key:"getUTCDate",value:function getUTCDate(t){return new Date(Date.UTC(t.slice(0,4),t.slice(5,7)-1,t.slice(8,10)));}},{key:"emitChangedData",value:function emitChangedData(t){this.emit("nile-changed",t),this.emit("nile-change",t);}},{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:"styles",get:function get(){return[l];}}]);}(d));t([s({type:String,attribute:"value"})],o.prototype,"valueAttribute",void 0),t([s({type:String,attribute:!0,reflect:!0})],o.prototype,"allowedDates",void 0),t([s({type:Boolean,reflect:!0})],o.prototype,"range",void 0),t([s({type:Boolean,attribute:!0,reflect:!0})],o.prototype,"hideTypes",void 0),t([s({type:Boolean,reflect:!0})],o.prototype,"doubleClickUnselect",void 0),t([s({type:Boolean,reflect:!0})],o.prototype,"allowClear",void 0),t([s({type:String,reflect:!0})],o.prototype,"type",void 0),t([s({type:String})],o.prototype,"selectedUnit",void 0),t([s({type:Number})],o.prototype,"selectedValue",void 0),t([s({type:Array,attribute:"hide-duration-fields"})],o.prototype,"hideDurationFields",void 0),t([s({type:Boolean})],o.prototype,"showManualInputs",void 0),t([n()],o.prototype,"startDate",void 0),t([n()],o.prototype,"endDate",void 0),t([n()],o.prototype,"isSelectingStart",void 0),t([n()],o.prototype,"hideInput",void 0),t([n()],o.prototype,"value",void 0),t([n()],o.prototype,"currentMonth",void 0),t([n()],o.prototype,"currentYear",void 0),t([n()],o.prototype,"allowedDatesLocal",void 0),t([s({type:Number})],o.prototype,"startYear",void 0),t([s({type:Number})],o.prototype,"endYear",void 0),t([h("allowedDates")],o.prototype,"checkValidAllowedDate",null),_export("N",o=t([a("nile-calendar")],o));}};});
2
2
  //# sourceMappingURL=nile-calendar.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-calendar.cjs.js","sources":["../../../src/nile-calendar/nile-calendar.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n html,\n CSSResultArray,\n TemplateResult,\n nothing\n} from 'lit';\nimport { customElement, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-calendar.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { PropertyValueMap } from 'lit';\ntype NileCalendarDateRange={ startDate: string, endDate: string }\ntype TimeUnits= 'minutes'|'hours'|'days'|'weeks'|'months';\n/**\n * Nile icon component.\n *\n * @tag nile-calendar\n *\n */\n@customElement('nile-calendar')\nexport class NileCalendar extends NileElement {\n /**\n * The styles for NileCalendar\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n\n\n @property({ type: String, attribute: 'value' }) valueAttribute: | string | null = null;\n\n @property({ type: String, attribute:true, reflect:true }) allowedDates: string = JSON.stringify({});\n\n @property({ type: Boolean, reflect: true }) range = false;\n\n @property({ type: Boolean, attribute: true, reflect:true }) hideTypes = false;\n\n @property({ type: Boolean, reflect: true }) doubleClickUnselect = false;\n\n @property({ type: Boolean, reflect: true }) allowClear = false;\n\n @property({ type: String, reflect: true }) type :'absolute' | 'relative' = 'absolute';\n\n @property({ type: String }) selectedUnit: TimeUnits;\n\n @property({ type: Number }) selectedValue: number;\n\n @property({ type: Array, attribute: 'hide-duration-fields' }) hideDurationFields: String[] = [];\n \n @property({ type: Boolean}) showManualInputs :boolean=false;\n\n @state() startDate: Date | null = null;\n\n @state() endDate: Date | null = null;\n\n @state() isSelectingStart = true;\n\n @state() hideInput: Boolean = false;\n\n @state() value: Date | null;\n\n @state() currentMonth: number = new Date().getMonth();\n\n @state() currentYear: number = new Date().getFullYear();\n\n @state() allowedDatesLocal: NileCalendarDateRange | any = null;\n\n @property({ type: Number }) startYear?: number;\n @property({ type: Number }) endYear?: number;\n \n\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('valueAttribute')) {\n if(!this.valueAttribute){\n this.value=null;\n this.startDate=null;\n this.endDate=null;\n this.isSelectingStart=true;\n }\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n this.initializeValue();\n }\n }\n\n private get monthNames() {\n return Array.from({ length: 12 }, (_, i) =>\n new Date(0, i).toLocaleString('default', { month: 'short' })\n );\n }\n\n private get yearOptions(): number[] {\n const fallbackStart = 2000;\n const fallbackEnd = 2050;\n \n const start = this.startYear ?? fallbackStart;\n const end = this.endYear ?? fallbackEnd;\n \n if (start > end) return [];\n \n return Array.from({ length: end - start + 1 }, (_, i) => start + i);\n }\n \n private onMonthSelected(monthIndex: number) {\n this.currentMonth = monthIndex;\n this.emit('nile-month-change', { month: monthIndex });\n }\n\n private onYearSelected(year: number) {\n this.currentYear = year;\n this.emit('nile-year-change', { year });\n }\n\n @watch('allowedDates')\n checkValidAllowedDate() {\n let newDateRange: NileCalendarDateRange | null;\n try {\n newDateRange=JSON.parse(this.allowedDates);\n } catch (error) {\n newDateRange=null;\n }\n if (!newDateRange || Object.keys(newDateRange).length == 0) {\n this.allowedDatesLocal=null;\n return;\n }\n this.hideInput=true;\n const startDate = this.getUTCDate(newDateRange.startDate)\n const endDate = this.getUTCDate(newDateRange.endDate)\n\n if (startDate > endDate) {\n console.error('StartDate must be greater than endDate');\n }\n else\n {\n this.allowedDatesLocal=newDateRange;\n }\n }\n \n \n private isPrevDisabled(): boolean {\n return (\n this.currentMonth === 0 &&\n this.startYear !== undefined &&\n this.currentYear <= this.startYear\n );\n }\n \n private isNextDisabled(): boolean {\n return (\n this.currentMonth === 11 &&\n this.endYear !== undefined &&\n this.currentYear >= this.endYear\n );\n }\n \n\n /**\n * Render method\n */\n render(): TemplateResult {\n return html`\n <div\n class=${classMap({\n base:true,\n base__range:this.range,\n })}\n part=\"calendar-root\"\n >\n <div class=${classMap({\n \"calendar-config\":true,\n \"hidden\": !this.range || (this.range && this.hideTypes)\n })} part=\"calendar-config\">\n <div class=\"calendar-switcher\" part=\"calendar-switcher\">\n <nile-tab-group centered @nile-tab-show=\"${this.onTypeChange}\" value=\"${this.type}\">\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 ${this.type == 'relative' ? this.renderRelativeCalendar():''}\n ${this.type == 'absolute' ? this.renderAbsoluteCalendar():''}\n\n ${!this.range?'':html`\n <div class=\"button-container\" part=\"calendar-footer\">\n ${this.allowClear?\n html`\n <nile-button \n class=\"clear-button\"\n variant=\"secondary\"\n ?disabled=\"${ !this.startDate || !this.endDate }\"\n @click=\"${this.clearDate}\"\n > Reset</nile-button>`:nothing\n }\n <nile-button \n class=\"apply-button\" \n ?disabled=\"${ !this.startDate || !this.endDate }\" \n @click=\"${this.confimRange}\"\n > Apply</nile-button>\n </div>\n `}\n </div>\n `;\n }\n\n /**\n * @returns HTML content for absolute calendar\n */\n renderAbsoluteCalendar(){\n return html`\n <div class=\"calendar-wrapper\" part=\"calendar-wrapper\">\n <div class=\"calendar-container\" part=\"calendar-container\">\n ${this.renderMonth(\n this.currentYear,\n this.currentMonth,\n this.getDaysArray(this.currentYear, this.currentMonth)\n )}\n </div>\n </div>\n ${this.range ? html`\n <div class=\"calender-input ${this.showManualInputs ? '' : 'hidden'}\" >\n <div class=\"from\">\n <nile-input \n label=\"From\"\n class=\"manual-input\" \n value=\"${this.formatTime(this.startDate)}\" \n placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleStartTimeInput}\"\n > </nile-input>\n </div>\n\n <div class=\"from\">\n <nile-input \n label=\"To\"\n class=\"manual-input\" \n value=\"${this.formatTime(this.endDate)}\" \n placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleEndTimeInput}\"\n > </nile-input>\n </div>\n </div>\n `:''}\n `\n }\n\n /**\n * @returns HTML content for relative calendar\n */\n renderRelativeCalendar(){\n return html`\n <div class=\"units-wrapper\">\n <div class=\"unit-container\">\n ${this.hideDurationFields?.includes('minutes')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Minutes</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('minutes', [1, 5, 15, 30, 45])}\n </div>\n </div>\n `}\n\n ${this.hideDurationFields?.includes('hours')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Hours</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('hours', [1, 2, 3, 6, 8, 12])}\n </div>\n </div>\n `}\n \n ${this.hideDurationFields?.includes('days')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Days</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('days', [1, 2, 3, 4, 5, 6])}\n </div>\n </div>\n `}\n \n ${this.hideDurationFields?.includes('weeks')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Weeks</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('weeks', [1, 2, 4, 6])}\n </div>\n </div>\n \n `}\n \n ${this.hideDurationFields?.includes('months')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Months</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('months', [3, 6, 12, 15])}\n </div>\n </div>\n `}\n </div>\n </div>\n \n ${this.range ? html`\n <div>\n <div class=\"unit-input-container\">\n <nile-input \n class=\"manual-input duration-input\" \n label=\"Duration\"\n inputmode=\"numeric\"\n type=\"number\"\n value=\"${this.selectedValue}\" \n @nile-change=\"${this.handleDurationChange}\"\n placeholder=\"Enter Value\"\n ></nile-input>\n\n <nile-select class=\"manual-input time-input\" \n label=\"Unit of time\" \n value=\"${ this.selectedUnit }\"\n @nile-change=\"${this.handleUnitChange}\"\n >\n <nile-option value=\"minutes\" class=\"${this.hideDurationFields?.includes('minutes')?'hidden':''}\">Minutes</nile-option>\n <nile-option value=\"hours\" class=\"${this.hideDurationFields?.includes('hours')?'hidden':''}\"> Hours </nile-option>\n <nile-option value=\"days\" class=\"${this.hideDurationFields?.includes('days')?'hidden':''}\">Days</nile-option>\n <nile-option value=\"weeks\" class=\"${this.hideDurationFields?.includes('weeks')?'hidden':''}\">Weeks</nile-option>\n <nile-option value=\"months\" class=\"${this.hideDurationFields?.includes('months')?'hidden':''}\"> Months </nile-option>\n </nile-select>\n </div>\n </div>\n `:''}\n `\n }\n \n /**\n * \n * @param unit \n * @param values \n * @returns html for the option\n */\n renderTimeValues(unit: TimeUnits, values: any[]) {\n return values.map(\n value =>\n html`\n <div\n class=\"duration__value ${this.selectedUnit === unit && this.selectedValue === value ? 'duration__value--selected':''}\"\n @click=${(e: any) => this.handleTimeValueClick(unit, value, e)}\n >${value}\n </div>`\n );\n }\n\n /**\n * \n * @param year \n * @param month \n * @param daysArray \n * @returns HTML for rendered month\n */\n private renderMonth(\n year: number,\n month: number,\n daysArray: number[]\n ): TemplateResult {\n const firstDay = new Date(year, month, 1).getDay();\n const lastDay = new Date(year, month + 1, 0).getDay();\n const prevMonthDays = this.getDaysArray(\n month === 0 ? year - 1 : year,\n month === 0 ? 11 : month - 1\n );\n const nextMonthDays = this.getDaysArray(\n month === 11 ? year + 1 : year,\n month === 11 ? 0 : month + 1\n );\n const fillerDaysBefore = prevMonthDays.slice(\n prevMonthDays.length - firstDay\n );\n const fillerDaysAfter = nextMonthDays.slice(0, 6 - lastDay);\n const allDays = [...fillerDaysBefore, ...daysArray, ...fillerDaysAfter];\n\n const isSelectedDate = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return '';\n\n if (!this.range && this.value) {\n const isSelected =\n day === this.value.getDate() &&\n month === this.value.getMonth() &&\n year === this.value.getFullYear();\n if (isSelected) return 'selected-date';\n }\n\n const isStartDate =\n this.startDate &&\n day === this.startDate.getDate() &&\n month === this.startDate.getMonth() &&\n year === this.startDate.getFullYear();\n const isEndDate =\n this.endDate &&\n day === this.endDate.getDate() &&\n month === this.endDate.getMonth() &&\n year === this.endDate.getFullYear();\n\n return isStartDate ? 'range-start' : isEndDate ? 'range-end' : '';\n };\n\n const isInRange = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return false;\n if (this.startDate && this.endDate) {\n const date = new Date(year, month, day);\n return date >= this.startDate && date <= this.endDate;\n }\n return false;\n };\n\n const isCurrentDate = (day: number, month: number, year: number) => {\n const today = new Date();\n return (\n day === today.getDate() &&\n month + 1 === today.getMonth() + 1 &&\n year === today.getFullYear()\n );\n };\n\n \n return html`\n <div class=\"calendar\">\n <div class=\"calendar-header\" part=\"calendar-header\">\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowleft\"\n ?disabled=\"${this.isPrevDisabled()}\"\n color=\"black\"\n @click=\"${this.prevMonth}\"\n >\n </nile-icon>\n \n <!-- MONTH DROPDOWN -->\n <div class=\"calendar-header__center\">\n <nile-dropdown class=\"month-dropdown\">\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger month-trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"${(e: KeyboardEvent) =>\n (e.currentTarget as HTMLElement).click()}\"\n >\n ${new Date(year, month).toLocaleString('default', {\n month: 'long',\n })}\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu >\n <div class=\"month-scroll-wrapper\">\n ${this.monthNames.map((m, idx) => html`\n <nile-menu-item\n class=\"month-menu-item\"\n ?selected=\"${idx === month}\"\n id=\"${idx === month ? 'selected-month-item' : ''}\"\n @click=\"${() => this.onMonthSelected(idx)}\"\n >\n ${m}\n </nile-menu-item>\n`)}\n </div>\n</nile-menu>\n </nile-dropdown>\n\n <!-- YEAR DROPDOWN -->\n <nile-dropdown class=\"year-dropdown\" >\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"${(e: KeyboardEvent) =>\n (e.currentTarget as HTMLElement).click()}\"\n >\n ${year}\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu>\n <div class=\"year-scroll-wrapper\">\n ${this.yearOptions.map(\n y => html`\n <nile-menu-item\n class=\"year-menu-item\"\n ?selected=\"${y === year}\"\n @click=\"${() => this.onYearSelected(y)}\"\n >\n ${y}\n\n </nile-menu-item>\n `\n )}\n </div>\n </nile-menu>\n </nile-dropdown>\n </div>\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowright\"\n ?disabled=\"${this.isNextDisabled()}\"\n color=\"black\"\n @click=\"${this.nextMonth}\"\n >\n </nile-icon>\n </div>\n <div class=\"days_container\">\n <div class=\"day_name\">Su</div>\n <div class=\"day_name\">Mo</div>\n <div class=\"day_name\">Tu</div>\n <div class=\"day_name\">We</div>\n <div class=\"day_name\">Th</div>\n <div class=\"day_name\">Fr</div>\n <div class=\"day_name\">Sa</div>\n\n ${allDays.map((day, index) => {\n const isCurrentMonth =\n index >= fillerDaysBefore.length &&\n index < fillerDaysBefore.length + daysArray.length;\n const datePlacement:''|'selected-date'|'range-start'|'range-end' = isSelectedDate(day, month, year, isCurrentMonth)\n const classMapObj:any={\n 'day_date' : true,\n 'not-allowed' : !this.isAllowedDate(day, month, year),\n 'in-range' : isInRange(day, month, year, isCurrentMonth) ,\n 'filler' : !isCurrentMonth,\n }\n if(datePlacement) classMapObj[datePlacement]=true\n \n return html` \n <div\n part=\"calendar-day\"\n class=${classMap(classMapObj)}\n @click=\"${() => { if (isCurrentMonth) this.selectDate(day, month, year)}}\"\n >\n <span style=\"position:relative;\">\n ${day}\n ${isCurrentDate(day, month, year) && isCurrentMonth?html`<div class=\"current__date__dot\" part=\"current-date-dot\"></div>`:nothing}\n </span>\n </div>`;\n })}\n </div>\n </div>\n `;\n }\n\n /**\n * Function to validate if date is not in allowedDates range\n * @param day \n * @param month \n * @param year \n * @returns \n */\n isAllowedDate(day: number, month: number, year: number) {\n if (!this.allowedDatesLocal) {\n return true;\n }\n const dateToCheck = new Date(Date.UTC(year, month, day));\n const startDate = this.getUTCDate(this.allowedDatesLocal.startDate)\n const endDate = this.getUTCDate(this.allowedDatesLocal.endDate)\n endDate.setUTCHours(23, 59, 59, 999);\n const isWithinRange = dateToCheck >= startDate && dateToCheck <= endDate;\n return isWithinRange;\n }\n\n clearDate(){\n if(this.range){\n this.valueAttribute='';\n this.startDate=null;\n this.endDate=null;\n }\n else{\n this.value=null;\n }\n this.emit('nile-clear')\n }\n\n /**\n * @function handle_date-click/select\n * @param day \n * @param month \n * @param year \n */\n selectDate(day: number, month: number, year: number): void {\n const selectedDate = new Date(year, month, day);\n\n if (this.range) {\n if (this.startDate && this.endDate) {\n this.startDate = null;\n this.endDate = null;\n }\n\n if (this.isSelectingStart) {\n this.startDate = selectedDate;\n if (this.endDate && selectedDate > this.endDate) {\n this.endDate = null;\n }\n this.isSelectingStart = false;\n } else {\n this.isSelectingStart = true;\n\n if (this.startDate && selectedDate < this.startDate) {\n this.startDate = selectedDate;\n this.endDate = null;\n this.isSelectingStart = false;\n } else {\n const endDate = selectedDate;\n endDate.setHours(23, 59, 59, 999);\n this.endDate = endDate;\n }\n }\n } else {\n if(String(this.value)==String(selectedDate) && this.doubleClickUnselect){\n this.clearDate()\n return\n }\n this.value = selectedDate;\n this.emitChangedData({ value: this.value });\n }\n }\n\n /**\n * Function to be called on initialization to set all other properties\n */\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.value = null;\n } catch (e) {\n // console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n }\n\n /**\n * Function to handle relative date selection\n */\n handleDurationChange(event: CustomEvent) {\n event.stopPropagation()\n event.detail.value = event.detail.value.replace(/e/gi, \"\");\n const duration=Number(event.detail.value);\n if(!duration) {\n return\n };\n this.selectedValue = duration\n if (this.selectedUnit && this.selectedValue) {\n this.handleTimeValueClick(this.selectedUnit, this.selectedValue, event);\n }\n }\n\n handleUnitChange(event: CustomEvent) {\n event.stopPropagation()\n this.selectedUnit = event.detail.value;\n if (this.selectedUnit && this.selectedValue) {\n this.handleTimeValueClick(this.selectedUnit, this.selectedValue, event);\n }\n }\n\n handleTimeValueClick(unit: TimeUnits, value: number, event: any) {\n this.createRelativePeriod(unit, value)\n this.selectedUnit = unit;\n this.selectedValue = value;\n }\n\n createRelativePeriod(unit: String, value: number) {\n const endTime = new Date();\n const startTime = new Date();\n\n switch (unit) {\n case 'minutes':\n startTime.setMinutes(startTime.getMinutes() - value);\n break;\n case 'hours':\n startTime.setHours(startTime.getHours() - value);\n break;\n case 'days':\n startTime.setDate(startTime.getDate() - value);\n break;\n case 'weeks':\n startTime.setDate(startTime.getDate() - 7 * value); // Subtract weeks as days\n break;\n case 'months':\n startTime.setMonth(startTime.getMonth() - value);\n break;\n }\n\n this.startDate = new Date(startTime.getTime());\n this.endDate = new Date(endTime.getTime());\n\n return {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n }\n \n /**\n * Function to handle start time selecion\n */\n private handleStartTimeInput(event: CustomEvent): void {\n event.stopPropagation()\n if (!this.startDate) {\n this.startDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.startDate);\n if (time) {\n this.startDate = time;\n } else {\n this.startDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n }\n \n /**\n * Function to handle end time selecion\n */\n private handleEndTimeInput(event: CustomEvent): void {\n event.stopPropagation()\n if (!this.endDate) {\n this.endDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.endDate);\n if (time) {\n this.endDate = time;\n } else {\n this.endDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n }\n\n // Parse time string to a Date object\n private parseTime(input: string, date: Date): Date | null {\n if (!this.isValidTimeInput(input)) {\n return null;\n }\n const [hour, minute, second] = input.split(':').map(Number);\n const newDate = new Date(date.getTime());\n newDate.setHours(hour, minute, second);\n return newDate;\n }\n\n // Validate time in HH:MM:SS format\n private isValidTimeInput(input: string): boolean {\n const regex = /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/;\n return regex.test(input);\n }\n\n private formatTime(date: Date | null): string {\n if (!date) return '';\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n return `${hours}:${minutes}:${seconds}`;\n }\n\n private nextMonth(): void {\n if (this.currentMonth === 11) {\n const newYear = this.currentYear + 1;\n if (this.endYear !== undefined && newYear > this.endYear) return;\n this.currentMonth = 0;\n this.currentYear = newYear;\n } else {\n this.currentMonth++;\n }\n }\n \n private prevMonth(): void {\n if (this.currentMonth === 0) {\n const newYear = this.currentYear - 1;\n if (this.startYear !== undefined && newYear < this.startYear) return;\n this.currentMonth = 11;\n this.currentYear = newYear;\n } else {\n this.currentMonth--;\n }\n }\n \n\n private confimRange() {\n if (!(this.startDate && this.endDate)) return;\n this.emitChangedData( {\n startDate: this.startDate,\n endDate: this.endDate,\n });\n }\n\n onTypeChange(event: CustomEvent) {\n this.type = event.detail.value;\n this.emit('nile-type-change', { value: this.type })\n }\n getUTCDate(dateStr:any){\n return new Date(\n Date.UTC(\n dateStr.slice(0, 4),\n dateStr.slice(5, 7) - 1,\n dateStr.slice(8, 10)\n )\n )\n }\n\n emitChangedData(data:{startDate:Date,endDate:Date}|{value:any}|null){\n this.emit('nile-changed',data);\n this.emit('nile-change',data)\n }\n\n private getDaysArray(year: number, month: number): number[] {\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n return Array.from({ length: daysInMonth }, (_, i) => i + 1);\n }\n}\n\nexport default NileCalendar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-calendar': NileCalendar;\n }\n}"],"names":["NileCalendar","o","this","valueAttribute","allowedDates","JSON","stringify","range","hideTypes","doubleClickUnselect","allowClear","type","hideDurationFields","showManualInputs","startDate","endDate","isSelectingStart","hideInput","currentMonth","Date","getMonth","currentYear","getFullYear","allowedDatesLocal","_this","_inherits","_d","_createClass","key","value","connectedCallback","super","initializeValue","emit","disconnectedCallback","updated","changedProperties","has","date","isNaN","getTime","offset","getTimezoneOffset","get","monthNames","Array","from","length","_","i","toLocaleString","month","start","startYear","end","endYear","_this$endYear","onMonthSelected","monthIndex","onYearSelected","year","checkValidAllowedDate","newDateRange","parse","error","Object","keys","getUTCDate","console","isPrevDisabled","undefined","isNextDisabled","render","html","_templateObject","_taggedTemplateLiteral","classMap","base","base__range","hidden","onTypeChange","renderRelativeCalendar","renderAbsoluteCalendar","_templateObject2","_templateObject3","clearDate","nothing","confimRange","_templateObject4","renderMonth","getDaysArray","_templateObject5","formatTime","handleStartTimeInput","handleEndTimeInput","_this$hideDurationFie","_this$hideDurationFie2","_this$hideDurationFie3","_this$hideDurationFie4","_this$hideDurationFie5","_this$hideDurationFie6","_this$hideDurationFie7","_this$hideDurationFie8","_this$hideDurationFie9","_this$hideDurationFie10","_templateObject6","includes","_templateObject7","renderTimeValues","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","selectedValue","handleDurationChange","selectedUnit","handleUnitChange","unit","values","map","_templateObject13","e","handleTimeValueClick","daysArray","firstDay","getDay","lastDay","prevMonthDays","nextMonthDays","fillerDaysBefore","slice","fillerDaysAfter","allDays","isSelectedDate","day","isCurrentMonth","getDate","isStartDate","isEndDate","isInRange","_templateObject14","prevMonth","currentTarget","click","m","idx","_templateObject15","yearOptions","y","_templateObject16","nextMonth","index","datePlacement","classMapObj","day_date","isAllowedDate","filler","_templateObject17","selectDate","today","_templateObject18","dateToCheck","UTC","setUTCHours","selectedDate","setHours","String","emitChangedData","rangeValue","event","stopPropagation","detail","replace","duration","Number","createRelativePeriod","endTime","startTime","setMinutes","getMinutes","getHours","setDate","setMonth","time","parseTime","requestUpdate","input","isValidTimeInput","_t$split$map","split","hour","minute","second","newDate","test","concat","padStart","getSeconds","newYear","dateStr","data","daysInMonth","__decorate","styles","NileElement","property","attribute","prototype","reflect","Boolean","state","watch","customElement"],"mappings":"s6LA6BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAW2CC,EAAAA,KAAAA,CAAcC,eAAoB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A,CAAA,IAAA,IAEnCL,CAAA,CAAA,CAA3BG,CAAS,CAAA,CAAEnM,IAAMoK,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAA6B/K,EAAAgN,SAAA,CAAA,WAAA,CAAA,IAAA,EACnBL,CAAAA,CAAAA,CAAAA,CAAA,CAA3BG,CAAAA,CAAS,CAAEnM,IAAMoK,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAA2B/K,CAAAgN,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAgE7CL,EAAA,CADCS,CAAAA,CAAM,cAuBNpN,CAAAA,CAAAA,CAAAA,CAAAA,CAAAgN,SAAA,CAAA,uBAAA,CAAA,IAxIUhN,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAY2M,CAAA,CAAA,CADxBU,CAAc,CAAA,eAAA,CAAA,CAAA,CACFrN"}
1
+ {"version":3,"file":"nile-calendar.cjs.js","sources":["../../../src/nile-calendar/nile-calendar.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n html,\n CSSResultArray,\n TemplateResult,\n nothing\n} from 'lit';\nimport { customElement, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-calendar.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { PropertyValueMap } from 'lit';\ntype NileCalendarDateRange={ startDate: string, endDate: string }\ntype TimeUnits= 'minutes'|'hours'|'days'|'weeks'|'months';\n/**\n * Nile icon component.\n *\n * @tag nile-calendar\n *\n */\n@customElement('nile-calendar')\nexport class NileCalendar extends NileElement {\n /**\n * The styles for NileCalendar\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n\n\n @property({ type: String, attribute: 'value' }) valueAttribute: | string | null = null;\n\n @property({ type: String, attribute:true, reflect:true }) allowedDates: string = JSON.stringify({});\n\n @property({ type: Boolean, reflect: true }) range = false;\n\n @property({ type: Boolean, attribute: true, reflect:true }) hideTypes = false;\n\n @property({ type: Boolean, reflect: true }) doubleClickUnselect = false;\n\n @property({ type: Boolean, reflect: true }) allowClear = false;\n\n @property({ type: String, reflect: true }) type :'absolute' | 'relative' = 'absolute';\n\n @property({ type: String }) selectedUnit: TimeUnits;\n\n @property({ type: Number }) selectedValue: number;\n\n @property({ type: Array, attribute: 'hide-duration-fields' }) hideDurationFields: String[] = [];\n \n @property({ type: Boolean}) showManualInputs :boolean=false;\n\n @state() startDate: Date | null = null;\n\n @state() endDate: Date | null = null;\n\n @state() isSelectingStart = true;\n\n @state() hideInput: Boolean = false;\n\n @state() value: Date | null;\n\n @state() currentMonth: number = new Date().getMonth();\n\n @state() currentYear: number = new Date().getFullYear();\n\n @state() allowedDatesLocal: NileCalendarDateRange | any = null;\n\n @property({ type: Number }) startYear?: number;\n @property({ type: Number }) endYear?: number;\n \n\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('valueAttribute')) {\n if(!this.valueAttribute){\n this.value=null;\n this.startDate=null;\n this.endDate=null;\n this.isSelectingStart=true;\n }\n const date = new Date(this.valueAttribute || '');\n if (!isNaN(date.getTime())) {\n const offset = date.getTimezoneOffset();\n this.value = new Date(date.getTime() - offset * 60 * 1000);\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n this.initializeValue();\n }\n }\n\n private get monthNames() {\n return Array.from({ length: 12 }, (_, i) =>\n new Date(0, i).toLocaleString('default', { month: 'short' })\n );\n }\n\n private get yearOptions(): number[] {\n const fallbackStart = 2000;\n const fallbackEnd = 2050;\n \n const start = this.startYear ?? fallbackStart;\n const end = this.endYear ?? fallbackEnd;\n \n if (start > end) return [];\n \n return Array.from({ length: end - start + 1 }, (_, i) => start + i);\n }\n \n private onMonthSelected(monthIndex: number) {\n this.currentMonth = monthIndex;\n this.emit('nile-month-change', { month: monthIndex });\n }\n\n private onYearSelected(year: number) {\n this.currentYear = year;\n this.emit('nile-year-change', { year });\n }\n\n @watch('allowedDates')\n checkValidAllowedDate() {\n let newDateRange: NileCalendarDateRange | null;\n try {\n newDateRange=JSON.parse(this.allowedDates);\n } catch (error) {\n newDateRange=null;\n }\n if (!newDateRange || Object.keys(newDateRange).length == 0) {\n this.allowedDatesLocal=null;\n return;\n }\n this.hideInput=true;\n const startDate = this.getUTCDate(newDateRange.startDate)\n const endDate = this.getUTCDate(newDateRange.endDate)\n\n if (startDate > endDate) {\n console.error('StartDate must be greater than endDate');\n }\n else\n {\n this.allowedDatesLocal=newDateRange;\n }\n }\n \n \n private isPrevDisabled(): boolean {\n return (\n this.currentMonth === 0 &&\n this.startYear !== undefined &&\n this.currentYear <= this.startYear\n );\n }\n \n private isNextDisabled(): boolean {\n return (\n this.currentMonth === 11 &&\n this.endYear !== undefined &&\n this.currentYear >= this.endYear\n );\n }\n \n\n /**\n * Render method\n */\n render(): TemplateResult {\n return html`\n <div\n class=${classMap({\n base:true,\n base__range:this.range,\n })}\n part=\"calendar-root\"\n >\n <div class=${classMap({\n \"calendar-config\":true,\n \"hidden\": !this.range || (this.range && this.hideTypes)\n })} part=\"calendar-config\">\n <div class=\"calendar-switcher\" part=\"calendar-switcher\">\n <nile-tab-group centered @nile-tab-show=\"${this.onTypeChange}\" value=\"${this.type}\">\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 ${this.type == 'relative' ? this.renderRelativeCalendar():''}\n ${this.type == 'absolute' ? this.renderAbsoluteCalendar():''}\n\n ${!this.range?'':html`\n <div class=\"button-container\" part=\"calendar-footer\">\n ${this.allowClear?\n html`\n <nile-button \n class=\"clear-button\"\n variant=\"secondary\"\n ?disabled=\"${ !this.startDate || !this.endDate }\"\n @click=\"${this.clearDate}\"\n > Reset</nile-button>`:nothing\n }\n <nile-button \n class=\"apply-button\" \n ?disabled=\"${ !this.startDate || !this.endDate }\" \n @click=\"${this.confimRange}\"\n > Apply</nile-button>\n </div>\n `}\n </div>\n `;\n }\n\n /**\n * @returns HTML content for absolute calendar\n */\n renderAbsoluteCalendar(){\n return html`\n <div class=\"calendar-wrapper\" part=\"calendar-wrapper\">\n <div class=\"calendar-container\" part=\"calendar-container\">\n ${this.renderMonth(\n this.currentYear,\n this.currentMonth,\n this.getDaysArray(this.currentYear, this.currentMonth)\n )}\n </div>\n </div>\n ${this.range ? html`\n <div class=\"calender-input ${this.showManualInputs ? '' : 'hidden'}\" >\n <div class=\"from\">\n <nile-input \n label=\"From\"\n class=\"manual-input\" \n value=\"${this.formatTime(this.startDate)}\" \n placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleStartTimeInput}\"\n > </nile-input>\n </div>\n\n <div class=\"from\">\n <nile-input \n label=\"To\"\n class=\"manual-input\" \n value=\"${this.formatTime(this.endDate)}\" \n placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleEndTimeInput}\"\n > </nile-input>\n </div>\n </div>\n `:''}\n `\n }\n\n /**\n * @returns HTML content for relative calendar\n */\n renderRelativeCalendar(){\n return html`\n <div class=\"units-wrapper\">\n <div class=\"unit-container\">\n ${this.hideDurationFields?.includes('minutes')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Minutes</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('minutes', [1, 5, 15, 30, 45])}\n </div>\n </div>\n `}\n\n ${this.hideDurationFields?.includes('hours')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Hours</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('hours', [1, 2, 3, 6, 8, 12])}\n </div>\n </div>\n `}\n \n ${this.hideDurationFields?.includes('days')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Days</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('days', [1, 2, 3, 4, 5, 6])}\n </div>\n </div>\n `}\n \n ${this.hideDurationFields?.includes('weeks')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Weeks</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('weeks', [1, 2, 4, 6])}\n </div>\n </div>\n \n `}\n \n ${this.hideDurationFields?.includes('months')?'':html`\n <div class=\"unit-group\">\n <div class=\"duration-name\">Months</div>\n <div class=\"duration-units\">\n ${this.renderTimeValues('months', [3, 6, 12, 15])}\n </div>\n </div>\n `}\n </div>\n </div>\n \n ${this.range ? html`\n <div>\n <div>\n <div class=\"unit-input-container\" part=\"unit-input-container\" style=\"display: flex; gap: 1rem; align-items: flex-end;\">\n \n <div class=\"input-wrapper\" part=\"input-wrapper\" style=\"flex: 1;\">\n <nile-input \n class=\"manual-input duration-input\" \n label=\"Duration\"\n inputmode=\"numeric\"\n type=\"number\"\n value=\"${this.selectedValue}\" \n @nile-change=\"${this.handleDurationChange}\"\n placeholder=\"Enter Value\"\n ></nile-input>\n </div>\n\n <div class=\"select-wrapper\" part=\"select-wrapper\" style=\"flex: 1;\">\n <nile-select \n class=\"manual-input time-input\" \n label=\"Unit of time\" \n value=\"${this.selectedUnit}\"\n @nile-change=\"${this.handleUnitChange}\"\n >\n <nile-option value=\"minutes\" class=\"${this.hideDurationFields?.includes('minutes') ? 'hidden' : ''}\">Minutes</nile-option>\n <nile-option value=\"hours\" class=\"${this.hideDurationFields?.includes('hours') ? 'hidden' : ''}\">Hours</nile-option>\n <nile-option value=\"days\" class=\"${this.hideDurationFields?.includes('days') ? 'hidden' : ''}\">Days</nile-option>\n <nile-option value=\"weeks\" class=\"${this.hideDurationFields?.includes('weeks') ? 'hidden' : ''}\">Weeks</nile-option>\n <nile-option value=\"months\" class=\"${this.hideDurationFields?.includes('months') ? 'hidden' : ''}\">Months</nile-option>\n </nile-select>\n </div>\n\n </div>\n </div>\n `:''}\n `\n }\n \n /**\n * \n * @param unit \n * @param values \n * @returns html for the option\n */\n renderTimeValues(unit: TimeUnits, values: any[]) {\n return values.map(\n value =>\n html`\n <div\n class=\"duration__value ${this.selectedUnit === unit && this.selectedValue === value ? 'duration__value--selected':''}\"\n @click=${(e: any) => this.handleTimeValueClick(unit, value, e)}\n >${value}\n </div>`\n );\n }\n\n /**\n * \n * @param year \n * @param month \n * @param daysArray \n * @returns HTML for rendered month\n */\n private renderMonth(\n year: number,\n month: number,\n daysArray: number[]\n ): TemplateResult {\n const firstDay = new Date(year, month, 1).getDay();\n const lastDay = new Date(year, month + 1, 0).getDay();\n const prevMonthDays = this.getDaysArray(\n month === 0 ? year - 1 : year,\n month === 0 ? 11 : month - 1\n );\n const nextMonthDays = this.getDaysArray(\n month === 11 ? year + 1 : year,\n month === 11 ? 0 : month + 1\n );\n const fillerDaysBefore = prevMonthDays.slice(\n prevMonthDays.length - firstDay\n );\n const fillerDaysAfter = nextMonthDays.slice(0, 6 - lastDay);\n const allDays = [...fillerDaysBefore, ...daysArray, ...fillerDaysAfter];\n\n const isSelectedDate = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return '';\n\n if (!this.range && this.value) {\n const isSelected =\n day === this.value.getDate() &&\n month === this.value.getMonth() &&\n year === this.value.getFullYear();\n if (isSelected) return 'selected-date';\n }\n\n const isStartDate =\n this.startDate &&\n day === this.startDate.getDate() &&\n month === this.startDate.getMonth() &&\n year === this.startDate.getFullYear();\n const isEndDate =\n this.endDate &&\n day === this.endDate.getDate() &&\n month === this.endDate.getMonth() &&\n year === this.endDate.getFullYear();\n\n return isStartDate ? 'range-start' : isEndDate ? 'range-end' : '';\n };\n\n const isInRange = (\n day: number,\n month: number,\n year: number,\n isCurrentMonth: boolean\n ) => {\n if (!isCurrentMonth) return false;\n if (this.startDate && this.endDate) {\n const date = new Date(year, month, day);\n return date >= this.startDate && date <= this.endDate;\n }\n return false;\n };\n\n const isCurrentDate = (day: number, month: number, year: number) => {\n const today = new Date();\n return (\n day === today.getDate() &&\n month + 1 === today.getMonth() + 1 &&\n year === today.getFullYear()\n );\n };\n\n \n return html`\n <div class=\"calendar\">\n <div class=\"calendar-header\" part=\"calendar-header\">\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowleft\"\n ?disabled=\"${this.isPrevDisabled()}\"\n color=\"black\"\n @click=\"${this.prevMonth}\"\n >\n </nile-icon>\n \n <!-- MONTH DROPDOWN -->\n <div class=\"calendar-header__center\">\n <nile-dropdown class=\"month-dropdown\">\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger month-trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"${(e: KeyboardEvent) =>\n (e.currentTarget as HTMLElement).click()}\"\n >\n ${new Date(year, month).toLocaleString('default', {\n month: 'long',\n })}\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu >\n <div class=\"month-scroll-wrapper\">\n ${this.monthNames.map((m, idx) => html`\n <nile-menu-item\n class=\"month-menu-item\"\n ?selected=\"${idx === month}\"\n id=\"${idx === month ? 'selected-month-item' : ''}\"\n @click=\"${() => this.onMonthSelected(idx)}\"\n >\n ${m}\n </nile-menu-item>\n`)}\n </div>\n</nile-menu>\n </nile-dropdown>\n\n <!-- YEAR DROPDOWN -->\n <nile-dropdown class=\"year-dropdown\" >\n <span\n slot=\"trigger\"\n class=\"calendar-header__trigger\"\n role=\"button\"\n tabindex=\"0\"\n @keydown.enter=\"${(e: KeyboardEvent) =>\n (e.currentTarget as HTMLElement).click()}\"\n >\n ${year}\n <nile-icon name=\"arrowdropdown\" color=\"black\" class=\"calendar-header__caret\"></nile-icon>\n </span>\n <nile-menu>\n <div class=\"year-scroll-wrapper\">\n ${this.yearOptions.map(\n y => html`\n <nile-menu-item\n class=\"year-menu-item\"\n ?selected=\"${y === year}\"\n @click=\"${() => this.onYearSelected(y)}\"\n >\n ${y}\n\n </nile-menu-item>\n `\n )}\n </div>\n </nile-menu>\n </nile-dropdown>\n </div>\n <nile-icon\n class=\"calendar-header__month-navigation\"\n name=\"arrowright\"\n ?disabled=\"${this.isNextDisabled()}\"\n color=\"black\"\n @click=\"${this.nextMonth}\"\n >\n </nile-icon>\n </div>\n <div class=\"days_container\">\n <div class=\"day_name\">Su</div>\n <div class=\"day_name\">Mo</div>\n <div class=\"day_name\">Tu</div>\n <div class=\"day_name\">We</div>\n <div class=\"day_name\">Th</div>\n <div class=\"day_name\">Fr</div>\n <div class=\"day_name\">Sa</div>\n\n ${allDays.map((day, index) => {\n const isCurrentMonth =\n index >= fillerDaysBefore.length &&\n index < fillerDaysBefore.length + daysArray.length;\n const datePlacement:''|'selected-date'|'range-start'|'range-end' = isSelectedDate(day, month, year, isCurrentMonth)\n const classMapObj:any={\n 'day_date' : true,\n 'not-allowed' : !this.isAllowedDate(day, month, year),\n 'in-range' : isInRange(day, month, year, isCurrentMonth) ,\n 'filler' : !isCurrentMonth,\n }\n if(datePlacement) classMapObj[datePlacement]=true\n \n return html` \n <div\n part=\"calendar-day\"\n class=${classMap(classMapObj)}\n @click=\"${() => { if (isCurrentMonth) this.selectDate(day, month, year)}}\"\n >\n <span style=\"position:relative;\">\n ${day}\n ${isCurrentDate(day, month, year) && isCurrentMonth?html`<div class=\"current__date__dot\" part=\"current-date-dot\"></div>`:nothing}\n </span>\n </div>`;\n })}\n </div>\n </div>\n `;\n }\n\n /**\n * Function to validate if date is not in allowedDates range\n * @param day \n * @param month \n * @param year \n * @returns \n */\n isAllowedDate(day: number, month: number, year: number) {\n if (!this.allowedDatesLocal) {\n return true;\n }\n const dateToCheck = new Date(Date.UTC(year, month, day));\n const startDate = this.getUTCDate(this.allowedDatesLocal.startDate)\n const endDate = this.getUTCDate(this.allowedDatesLocal.endDate)\n endDate.setUTCHours(23, 59, 59, 999);\n const isWithinRange = dateToCheck >= startDate && dateToCheck <= endDate;\n return isWithinRange;\n }\n\n clearDate(){\n if(this.range){\n this.valueAttribute='';\n this.startDate=null;\n this.endDate=null;\n }\n else{\n this.value=null;\n }\n this.emit('nile-clear')\n }\n\n /**\n * @function handle_date-click/select\n * @param day \n * @param month \n * @param year \n */\n selectDate(day: number, month: number, year: number): void {\n const selectedDate = new Date(year, month, day);\n\n if (this.range) {\n if (this.startDate && this.endDate) {\n this.startDate = null;\n this.endDate = null;\n }\n\n if (this.isSelectingStart) {\n this.startDate = selectedDate;\n if (this.endDate && selectedDate > this.endDate) {\n this.endDate = null;\n }\n this.isSelectingStart = false;\n } else {\n this.isSelectingStart = true;\n\n if (this.startDate && selectedDate < this.startDate) {\n this.startDate = selectedDate;\n this.endDate = null;\n this.isSelectingStart = false;\n } else {\n const endDate = selectedDate;\n endDate.setHours(23, 59, 59, 999);\n this.endDate = endDate;\n }\n }\n } else {\n if(String(this.value)==String(selectedDate) && this.doubleClickUnselect){\n this.clearDate()\n return\n }\n this.value = selectedDate;\n this.emitChangedData({ value: this.value });\n }\n }\n\n /**\n * Function to be called on initialization to set all other properties\n */\n initializeValue() {\n if (this.range) {\n try {\n const rangeValue = JSON.parse(this.valueAttribute || '');\n this.startDate = new Date(rangeValue.startDate);\n this.endDate = new Date(rangeValue.endDate);\n\n // Convert to local time\n this.startDate = new Date(this.startDate.getTime());\n this.endDate = new Date(this.endDate.getTime());\n\n this.value = null;\n } catch (e) {\n // console.error('Invalid range value');\n }\n } else {\n if (this.valueAttribute) {\n let date: Date = new Date(this.valueAttribute);\n\n date = new Date(date.getTime() - date.getTimezoneOffset() * 60000);\n\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n }\n }\n\n /**\n * Function to handle relative date selection\n */\n handleDurationChange(event: CustomEvent) {\n event.stopPropagation()\n event.detail.value = event.detail.value.replace(/e/gi, \"\");\n const duration=Number(event.detail.value);\n if(!duration) {\n return\n };\n this.selectedValue = duration\n if (this.selectedUnit && this.selectedValue) {\n this.handleTimeValueClick(this.selectedUnit, this.selectedValue, event);\n }\n }\n\n handleUnitChange(event: CustomEvent) {\n event.stopPropagation()\n this.selectedUnit = event.detail.value;\n if (this.selectedUnit && this.selectedValue) {\n this.handleTimeValueClick(this.selectedUnit, this.selectedValue, event);\n }\n }\n\n handleTimeValueClick(unit: TimeUnits, value: number, event: any) {\n this.createRelativePeriod(unit, value)\n this.selectedUnit = unit;\n this.selectedValue = value;\n }\n\n createRelativePeriod(unit: String, value: number) {\n const endTime = new Date();\n const startTime = new Date();\n\n switch (unit) {\n case 'minutes':\n startTime.setMinutes(startTime.getMinutes() - value);\n break;\n case 'hours':\n startTime.setHours(startTime.getHours() - value);\n break;\n case 'days':\n startTime.setDate(startTime.getDate() - value);\n break;\n case 'weeks':\n startTime.setDate(startTime.getDate() - 7 * value); // Subtract weeks as days\n break;\n case 'months':\n startTime.setMonth(startTime.getMonth() - value);\n break;\n }\n\n this.startDate = new Date(startTime.getTime());\n this.endDate = new Date(endTime.getTime());\n\n return {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n }\n \n /**\n * Function to handle start time selecion\n */\n private handleStartTimeInput(event: CustomEvent): void {\n event.stopPropagation()\n if (!this.startDate) {\n this.startDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.startDate);\n if (time) {\n this.startDate = time;\n } else {\n this.startDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n }\n \n /**\n * Function to handle end time selecion\n */\n private handleEndTimeInput(event: CustomEvent): void {\n event.stopPropagation()\n if (!this.endDate) {\n this.endDate = null;\n return;\n }\n const time = this.parseTime(event.detail.value, this.endDate);\n if (time) {\n this.endDate = time;\n } else {\n this.endDate.setHours(0, 0, 0);\n }\n this.requestUpdate();\n }\n\n // Parse time string to a Date object\n private parseTime(input: string, date: Date): Date | null {\n if (!this.isValidTimeInput(input)) {\n return null;\n }\n const [hour, minute, second] = input.split(':').map(Number);\n const newDate = new Date(date.getTime());\n newDate.setHours(hour, minute, second);\n return newDate;\n }\n\n // Validate time in HH:MM:SS format\n private isValidTimeInput(input: string): boolean {\n const regex = /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/;\n return regex.test(input);\n }\n\n private formatTime(date: Date | null): string {\n if (!date) return '';\n const hours = String(date.getHours()).padStart(2, '0');\n const minutes = String(date.getMinutes()).padStart(2, '0');\n const seconds = String(date.getSeconds()).padStart(2, '0');\n return `${hours}:${minutes}:${seconds}`;\n }\n\n private nextMonth(): void {\n if (this.currentMonth === 11) {\n const newYear = this.currentYear + 1;\n if (this.endYear !== undefined && newYear > this.endYear) return;\n this.currentMonth = 0;\n this.currentYear = newYear;\n } else {\n this.currentMonth++;\n }\n }\n \n private prevMonth(): void {\n if (this.currentMonth === 0) {\n const newYear = this.currentYear - 1;\n if (this.startYear !== undefined && newYear < this.startYear) return;\n this.currentMonth = 11;\n this.currentYear = newYear;\n } else {\n this.currentMonth--;\n }\n }\n \n\n private confimRange() {\n if (!(this.startDate && this.endDate)) return;\n this.emitChangedData( {\n startDate: this.startDate,\n endDate: this.endDate,\n });\n }\n\n onTypeChange(event: CustomEvent) {\n this.type = event.detail.value;\n this.emit('nile-type-change', { value: this.type })\n }\n getUTCDate(dateStr:any){\n return new Date(\n Date.UTC(\n dateStr.slice(0, 4),\n dateStr.slice(5, 7) - 1,\n dateStr.slice(8, 10)\n )\n )\n }\n\n emitChangedData(data:{startDate:Date,endDate:Date}|{value:any}|null){\n \nthis.emit('nile-changed', data); // deprecated . Use nile-change instead.\n this.emit('nile-change',data)\n }\n\n private getDaysArray(year: number, month: number): number[] {\n const daysInMonth = new Date(year, month + 1, 0).getDate();\n return Array.from({ length: daysInMonth }, (_, i) => i + 1);\n }\n}\n\nexport default NileCalendar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-calendar': NileCalendar;\n }\n}"],"names":["NileCalendar","o","this","valueAttribute","allowedDates","JSON","stringify","range","hideTypes","doubleClickUnselect","allowClear","type","hideDurationFields","showManualInputs","startDate","endDate","isSelectingStart","hideInput","currentMonth","Date","getMonth","currentYear","getFullYear","allowedDatesLocal","_this","_inherits","_d","_createClass","key","value","connectedCallback","super","initializeValue","emit","disconnectedCallback","updated","changedProperties","has","date","isNaN","getTime","offset","getTimezoneOffset","get","monthNames","Array","from","length","_","i","toLocaleString","month","start","startYear","end","endYear","_this$endYear","onMonthSelected","monthIndex","onYearSelected","year","checkValidAllowedDate","newDateRange","parse","error","Object","keys","getUTCDate","console","isPrevDisabled","undefined","isNextDisabled","render","html","_templateObject","_taggedTemplateLiteral","classMap","base","base__range","hidden","onTypeChange","renderRelativeCalendar","renderAbsoluteCalendar","_templateObject2","_templateObject3","clearDate","nothing","confimRange","_templateObject4","renderMonth","getDaysArray","_templateObject5","formatTime","handleStartTimeInput","handleEndTimeInput","_this$hideDurationFie","_this$hideDurationFie2","_this$hideDurationFie3","_this$hideDurationFie4","_this$hideDurationFie5","_this$hideDurationFie6","_this$hideDurationFie7","_this$hideDurationFie8","_this$hideDurationFie9","_this$hideDurationFie10","_templateObject6","includes","_templateObject7","renderTimeValues","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","selectedValue","handleDurationChange","selectedUnit","handleUnitChange","unit","values","map","_templateObject13","e","handleTimeValueClick","daysArray","firstDay","getDay","lastDay","prevMonthDays","nextMonthDays","fillerDaysBefore","slice","fillerDaysAfter","allDays","isSelectedDate","day","isCurrentMonth","getDate","isStartDate","isEndDate","isInRange","_templateObject14","prevMonth","currentTarget","click","m","idx","_templateObject15","yearOptions","y","_templateObject16","nextMonth","index","datePlacement","classMapObj","day_date","isAllowedDate","filler","_templateObject17","selectDate","today","_templateObject18","dateToCheck","UTC","setUTCHours","selectedDate","setHours","String","emitChangedData","rangeValue","event","stopPropagation","detail","replace","duration","Number","createRelativePeriod","endTime","startTime","setMinutes","getMinutes","getHours","setDate","setMonth","time","parseTime","requestUpdate","input","isValidTimeInput","_t$split$map","split","hour","minute","second","newDate","test","concat","padStart","getSeconds","newYear","dateStr","data","daysInMonth","__decorate","styles","NileElement","property","attribute","prototype","reflect","Boolean","state","watch","customElement"],"mappings":"s6LA6BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEAW2CC,EAAAA,KAAAA,CAAcC,eAAoB,IAExBD,CAAAA,KAAAA,CAAAE,YAAuBC,CAAAA,IAAAA,CAAKC,UAAU,CAAE,CAAA,CAAA,CAEtDJ,KAAAA,CAAKK,KAAAA,CAAAA,CAAG,EAEQL,KAAAA,CAASM,SAAAA,CAAAA,CAAG,CAE5BN,CAAAA,KAAAA,CAAmBO,qBAAG,CAEtBP,CAAAA,KAAAA,CAAUQ,UAAG,CAAA,CAAA,CAAA,CAEdR,KAAAA,CAAIS,IAA4B,CAAA,UAAA,CAMbT,KAAAA,CAAkBU,kBAAAA,CAAa,GAEjEV,KAAAA,CAAgBW,gBAAAA,CAAAA,CAAU,CAE7CX,CAAAA,KAAAA,CAASY,UAAgB,IAEzBZ,CAAAA,KAAAA,CAAOa,OAAgB,CAAA,IAAA,CAEvBb,KAAAA,CAAgBc,gBAAG,CAAA,CAAA,CAAA,CAEnBd,KAAAA,CAASe,SAAAA,CAAAA,CAAY,EAIrBf,KAAAA,CAAAgB,YAAAA,CAAuB,GAAIC,CAAAA,IAAAA,CAAAA,CAAAA,CAAOC,WAElClB,KAAAA,CAAAmB,WAAAA,CAAsB,GAAIF,CAAAA,IAAAA,CAAAA,CAAAA,CAAOG,cAEjCpB,KAAAA,CAAiBqB,iBAAAA,CAAgC,IA6xB3D,QAAAC,KAAA,EAv0BQC,SAAA,CAAAxB,CAAA,CAAAyB,EAAA,SAAAC,YAAA,CAAA1B,CAAA,GAAA2B,GAAA,qBAAAC,KAAA,CAiDP,SAAAC,iBAAAA,CAAAA,CAAAA,CACEC,aAAAA,CAAAA,CAAAA,iCACA7B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