@aquera/nile-elements 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js +12 -10
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +3 -3
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js +32 -22
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js +1 -0
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.d.ts +1 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js +15 -8
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js +10 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -1
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.d.ts +8 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js +56 -6
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.d.ts +5 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.js +5 -0
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array-loop.js.map +1 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js +2 -0
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.d.ts +5 -0
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.js +5 -0
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/integer.js.map +1 -0
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js +7 -0
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-option/nile-option.js.map +1 -1
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +11 -0
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +10 -1
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +2 -1
  34. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +31 -18
  35. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  36. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  37. package/demo/filenames.txt +1 -1
  38. package/dist/index.cjs.js +1 -1
  39. package/dist/index.esm.js +1 -1
  40. package/dist/index.iife.js +112 -64
  41. package/dist/nile-badge/index.cjs.js +1 -1
  42. package/dist/nile-badge/index.esm.js +1 -1
  43. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  44. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  45. package/dist/nile-badge/nile-badge.esm.js +1 -1
  46. package/dist/nile-button/index.cjs.js +1 -1
  47. package/dist/nile-button/index.esm.js +1 -1
  48. package/dist/nile-button/nile-button.cjs.js +1 -1
  49. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  50. package/dist/nile-button/nile-button.esm.js +1 -1
  51. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  52. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  53. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  54. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  55. package/dist/nile-calendar/nile-calendar.css.esm.js +14 -12
  56. package/dist/nile-calendar/nile-calendar.esm.js +3 -3
  57. package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
  58. package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
  59. package/dist/nile-content-editor/nile-content-editor.esm.js +3 -3
  60. package/dist/nile-dialog/index.cjs.js +1 -1
  61. package/dist/nile-dialog/index.esm.js +1 -1
  62. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  63. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  64. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  65. package/dist/nile-error-message/nile-error-message.cjs.js +1 -1
  66. package/dist/nile-error-message/nile-error-message.cjs.js.map +1 -1
  67. package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
  68. package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
  69. package/dist/nile-error-message/nile-error-message.css.esm.js +1 -0
  70. package/dist/nile-error-message/nile-error-message.esm.js +13 -10
  71. package/dist/nile-form-help-text/index.cjs.js +1 -1
  72. package/dist/nile-form-help-text/index.esm.js +1 -1
  73. package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
  74. package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
  75. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js +1 -1
  76. package/dist/nile-form-help-text/nile-form-help-text.css.cjs.js.map +1 -1
  77. package/dist/nile-form-help-text/nile-form-help-text.css.esm.js +10 -0
  78. package/dist/nile-form-help-text/nile-form-help-text.esm.js +16 -5
  79. package/dist/nile-icon/icons/svg/array-loop.cjs.js +2 -0
  80. package/dist/nile-icon/icons/svg/array-loop.cjs.js.map +1 -0
  81. package/dist/nile-icon/icons/svg/array-loop.esm.js +1 -0
  82. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  83. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  84. package/dist/nile-icon/icons/svg/integer.cjs.js +2 -0
  85. package/dist/nile-icon/icons/svg/integer.cjs.js.map +1 -0
  86. package/dist/nile-icon/icons/svg/integer.esm.js +1 -0
  87. package/dist/nile-icon/index.cjs.js +1 -1
  88. package/dist/nile-icon/index.cjs.js.map +1 -1
  89. package/dist/nile-icon/index.esm.js +2 -2
  90. package/dist/nile-icon-button/index.cjs.js +1 -1
  91. package/dist/nile-icon-button/index.esm.js +1 -1
  92. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  93. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  94. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  95. package/dist/nile-input/index.cjs.js +1 -1
  96. package/dist/nile-input/index.esm.js +1 -1
  97. package/dist/nile-input/nile-input.cjs.js +1 -1
  98. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  99. package/dist/nile-input/nile-input.esm.js +1 -1
  100. package/dist/nile-menu-item/index.cjs.js +1 -1
  101. package/dist/nile-menu-item/index.esm.js +1 -1
  102. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  103. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  104. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  105. package/dist/nile-option/index.cjs.js +1 -1
  106. package/dist/nile-option/index.esm.js +1 -1
  107. package/dist/nile-option/nile-option.cjs.js +1 -1
  108. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  109. package/dist/nile-option/nile-option.esm.js +1 -1
  110. package/dist/nile-select/index.cjs.js +1 -1
  111. package/dist/nile-select/index.esm.js +1 -1
  112. package/dist/nile-select/nile-select.cjs.js +1 -1
  113. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  114. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  115. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  116. package/dist/nile-select/nile-select.css.esm.js +11 -0
  117. package/dist/nile-select/nile-select.esm.js +8 -2
  118. package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
  119. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
  120. package/dist/nile-switcher/nile-switcher.esm.js +42 -38
  121. package/dist/nile-tag/index.cjs.js +1 -1
  122. package/dist/nile-tag/index.esm.js +1 -1
  123. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  124. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  125. package/dist/nile-tag/nile-tag.esm.js +1 -1
  126. package/dist/src/nile-calendar/nile-calendar.css.js +12 -10
  127. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  128. package/dist/src/nile-calendar/nile-calendar.js +3 -3
  129. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  130. package/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
  131. package/dist/src/nile-content-editor/nile-content-editor.js +32 -22
  132. package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
  133. package/dist/src/nile-error-message/nile-error-message.css.js +1 -0
  134. package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
  135. package/dist/src/nile-error-message/nile-error-message.d.ts +1 -0
  136. package/dist/src/nile-error-message/nile-error-message.js +15 -8
  137. package/dist/src/nile-error-message/nile-error-message.js.map +1 -1
  138. package/dist/src/nile-form-help-text/nile-form-help-text.css.js +10 -0
  139. package/dist/src/nile-form-help-text/nile-form-help-text.css.js.map +1 -1
  140. package/dist/src/nile-form-help-text/nile-form-help-text.d.ts +8 -0
  141. package/dist/src/nile-form-help-text/nile-form-help-text.js +56 -6
  142. package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  143. package/dist/src/nile-icon/icons/svg/array-loop.d.ts +5 -0
  144. package/dist/src/nile-icon/icons/svg/array-loop.js +5 -0
  145. package/dist/src/nile-icon/icons/svg/array-loop.js.map +1 -0
  146. package/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  147. package/dist/src/nile-icon/icons/svg/index.js +2 -0
  148. package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  149. package/dist/src/nile-icon/icons/svg/integer.d.ts +5 -0
  150. package/dist/src/nile-icon/icons/svg/integer.js +5 -0
  151. package/dist/src/nile-icon/icons/svg/integer.js.map +1 -0
  152. package/dist/src/nile-option/nile-option.js +7 -0
  153. package/dist/src/nile-option/nile-option.js.map +1 -1
  154. package/dist/src/nile-select/nile-select.css.js +11 -0
  155. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  156. package/dist/src/nile-select/nile-select.js +10 -1
  157. package/dist/src/nile-select/nile-select.js.map +1 -1
  158. package/dist/src/nile-switcher/nile-switcher.d.ts +2 -1
  159. package/dist/src/nile-switcher/nile-switcher.js +31 -18
  160. package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
  161. package/dist/tsconfig.tsbuildinfo +1 -1
  162. package/package.json +1 -1
  163. package/src/nile-calendar/nile-calendar.css.ts +12 -10
  164. package/src/nile-calendar/nile-calendar.ts +3 -3
  165. package/src/nile-content-editor/nile-content-editor.ts +37 -23
  166. package/src/nile-error-message/nile-error-message.css.ts +1 -0
  167. package/src/nile-error-message/nile-error-message.ts +17 -9
  168. package/src/nile-form-help-text/nile-form-help-text.css.ts +10 -0
  169. package/src/nile-form-help-text/nile-form-help-text.ts +73 -26
  170. package/src/nile-icon/icons/svg/array-loop.ts +5 -0
  171. package/src/nile-icon/icons/svg/index.ts +2 -0
  172. package/src/nile-icon/icons/svg/integer.ts +5 -0
  173. package/src/nile-option/nile-option.ts +9 -0
  174. package/src/nile-select/nile-select.css.ts +11 -0
  175. package/src/nile-select/nile-select.ts +10 -1
  176. package/src/nile-switcher/nile-switcher.ts +48 -23
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-calendar.css.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","../property-0f6a51ec.cjs.js","lit","lit/directives/class-map.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,n,a,h,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,r;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.customElement;},function(_nileCalendarCssCjsJs){n=_nileCalendarCssCjsJs.s;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_property002CjsJs){l=_property002CjsJs.n;},function(_lit){},function(_litDirectivesClassMapJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function(){_export("N",r=/*#__PURE__*/function(_h){_inherits(r,_h);var _super=_createSuper(r);function r(){var _this;_classCallCheck(this,r);_this=_super.apply(this,arguments),_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.dropDownOpened=!1,_this.valueAttribute=null,_this.formattedDate=null,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.range=!1;return _this;}_createClass(r,[{key:"valueChanged",value:function valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){var _t=this.value.getTimezoneOffset(),_i=new Date(this.value.getTime()-60*_t*1e3);isNaN(_i.getTime())||(this.valueAttribute=_i.toISOString().split("T")[0],this.formattedDate="".concat(String(_i.getDate()).padStart(2,"0"),"/").concat(String(_i.getMonth()+1).padStart(2,"0"),"/").concat(_i.getFullYear()));}}},{key:"updated",value:function updated(t){if(_get(_getPrototypeOf(r.prototype),"updated",this).call(this,t),t.has("valueAttribute")){var _t2=new Date(this.valueAttribute||"");if(!isNaN(_t2.getTime())){var _i2=_t2.getTimezoneOffset();this.value=new Date(_t2.getTime()-60*_i2*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}}}},{key:"attributeChangedCallback",value:function attributeChangedCallback(t,i,s){"value"===t?(this.valueAttribute=s,this.initializeValue()):"range"===t&&(this.range=null!==s);}},{key:"initializeValue",value:function initializeValue(){if(this.range)try{var _t3=JSON.parse(this.valueAttribute||"");this.startDate=new Date(_t3.startDate),this.endDate=new Date(_t3.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null;}catch(t){}else if(this.valueAttribute){var _t4;_t4=new Date(this.valueAttribute),_t4=new Date(_t4.getTime()-6e4*_t4.getTimezoneOffset()),isNaN(_t4.getTime())||(this.value=_t4,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null);}this.requestUpdate();}},{key:"connectedCallback",value:function connectedCallback(){if(_get(_getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.initializeValue(),this.valueAttribute){var _t5=new Date(this.valueAttribute);isNaN(_t5.getTime())||(this.value=_t5,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear());}this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(r.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"getDaysArray",value:function getDaysArray(t,i){var s=new Date(t,i+1,0).getDate();return Array.from({length:s},function(t,i){return i+1;});}},{key:"nextMonth",value:function nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate();}},{key:"prevMonth",value:function prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate();}},{key:"selectDate",value:function selectDate(t,i,s){var e=new Date(s,i,t);this.range?(this.startDate&&this.endDate&&(this.startDate=null,this.endDate=null),this.isSelectingStart?(this.startDate=e,this.endDate&&e>this.endDate&&(this.endDate=null),this.isSelectingStart=!1):(this.isSelectingStart=!0,this.startDate&&e<this.startDate?(this.startDate=e,this.endDate=null,this.isSelectingStart=!1):this.endDate=e)):(this.value=e,this.emit("nile-changed",{value:this.value}),this.dropdown&&this.dropdown.hide()),this.requestUpdate();}},{key:"confimRange",value:function confimRange(){this.startDate&&this.endDate&&(this.emit("nile-changed",{startDate:this.startDate,endDate:this.endDate}),this.dropdown&&this.dropdown.hide(),this.rangeValue={startDate:this.startDate,endDate:this.endDate});}},{key:"renderMonth",value:function renderMonth(t,s,e){var _this2=this;var n=new Date(t,s,1).getDay(),a=new Date(t,s+1,0).getDay(),h=this.getDaysArray(0===s?t-1:t,0===s?11:s-1),l=this.getDaysArray(11===s?t+1:t,11===s?0:s+1),_r=h.slice(h.length-n),d=l.slice(0,6-a),c=[].concat(_toConsumableArray(_r),_toConsumableArray(e),_toConsumableArray(d)),u=function u(t,i,s,e){if(!e)return"";if(!_this2.range&&_this2.value){if(t===_this2.value.getDate()&&i===_this2.value.getMonth()&&s===_this2.value.getFullYear())return"selected-date";}var n=_this2.startDate&&t===_this2.startDate.getDate()&&i===_this2.startDate.getMonth()&&s===_this2.startDate.getFullYear(),a=_this2.endDate&&t===_this2.endDate.getDate()&&i===_this2.endDate.getMonth()&&s===_this2.endDate.getFullYear();return n?"range-start":a?"range-end":"";},o=function o(t,i,s,e){if(!e)return!1;if(_this2.startDate&&_this2.endDate){var _e=new Date(s,i,t);return _e>=_this2.startDate&&_e<=_this2.endDate;}return!1;};return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowleft\" color=\"black\" @click=\"","\">\n </nile-icon>\n <span\n >","\n ","</span\n >\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowright\" color=\"black\" @click=\"","\">\n </nile-icon>\n </div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ","\n </div>\n </div>\n "])),this.prevMonth,new Date(t,s).toLocaleString("default",{month:"long"}),t,this.nextMonth,c.map(function(n,a){var h=a>=_r.length&&a<_r.length+e.length;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <div\n class=\"day "," "," ","\"\n @click=\"","\"\n >\n ","\n </div>"])),u(n,s,t,h),o(n,s,t,h)?"in-range":"",h?"":"filler",function(){h&&_this2.selectDate(n,s,t);},n);}));}},{key:"formatDate",value:function formatDate(t){if(!t)return"";return"".concat(String(t.getDate()).padStart(2,"0"),"/").concat(String(t.getMonth()+1).padStart(2,"0"),"/").concat(t.getFullYear());}},{key:"formatDateRange",value:function formatDateRange(t){return t?t.startDate&&t.endDate?"".concat(this.formatDate(t.startDate)," - ").concat(this.formatDate(t.endDate)):"":t;}},{key:"handleStartDateInput",value:function handleStartDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.startDate=null),i&&(!this.endDate||i<=this.endDate)?this.startDate=i:(this.startDate=null,this.endDate=null),this.requestUpdate();}},{key:"handleEndDateInput",value:function handleEndDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.endDate=null),i&&(!this.startDate||i>=this.startDate)?this.endDate=i:this.endDate=null,this.requestUpdate();}},{key:"parseDate",value:function parseDate(t){var _t$split$map=t.split("/").map(Number),_t$split$map2=_slicedToArray(_t$split$map,3),i=_t$split$map2[0],s=_t$split$map2[1],e=_t$split$map2[2],n=new Date(e,s-1,i);return isNaN(n.getTime())?null:n;}},{key:"isValidDateInput",value:function isValidDateInput(t){return /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/.test(t);}},{key:"formatTime",value:function formatTime(t){if(!t)return"";return"".concat(String(t.getHours()).padStart(2,"0"),":").concat(String(t.getMinutes()).padStart(2,"0"),":").concat(String(t.getSeconds()).padStart(2,"0"));}},{key:"isValidTimeInput",value:function isValidTimeInput(t){return /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/.test(t);}},{key:"parseTime",value:function parseTime(t,i){if(!this.isValidTimeInput(t))return null;var _t$split$map3=t.split(":").map(Number),_t$split$map4=_slicedToArray(_t$split$map3,3),s=_t$split$map4[0],e=_t$split$map4[1],n=_t$split$map4[2],a=new Date(i.getTime());return a.setHours(s,e,n),a;}},{key:"handleStartTimeInput",value:function handleStartTimeInput(t){if(!this.startDate)return void(this.startDate=null);var i=this.parseTime(t.detail.value,this.startDate);i?this.startDate=i:this.startDate.setHours(0,0,0),this.requestUpdate();}},{key:"handleEndTimeInput",value:function handleEndTimeInput(t){if(!this.endDate)return void(this.endDate=null);var i=this.parseTime(t.detail.value,this.endDate);i?this.endDate=i:this.endDate.setHours(0,0,0),this.requestUpdate();}},{key:"render",value:function render(){this.getDaysArray(this.currentYear,this.currentMonth);var t=(this.currentMonth+1)%12,s=11===this.currentMonth?this.currentYear+1:this.currentYear;return this.getDaysArray(s,t),i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n\n <div class=\"base","\">\n <div class=\"calendar-wrapper\" >\n <div class=\"calendar-container ","\">\n ","\n </div>\n ","\n\n </div>\n ","\n </div>\n "])),this.range?"__range":"",this.range?"with-margin":"",this.renderMonth(this.currentYear,this.currentMonth,this.getDaysArray(this.currentYear,this.currentMonth)),this.range?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div class=\"calendar-container\">\n ","\n </div>\n "])),this.renderMonth(this.currentYear,(this.currentMonth+1)%12,this.getDaysArray(this.currentYear,(this.currentMonth+1)%12))):"",this.range?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div class=\"calender-input\">\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\"></nile-input>\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n\n </div>\n<br>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\"></nile-input>\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n </div>\n <div class=\"button-contaner\">\n <nile-button class=\"apply-button\" ?disabled=\"","\" @click=\"","\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n "])),this.formatDate(this.startDate),this.handleStartDateInput,this.formatTime(this.startDate),this.handleStartTimeInput,this.formatDate(this.endDate),this.handleEndDateInput,this.formatTime(this.endDate),this.handleEndTimeInput,!this.startDate||!this.endDate,this.confimRange):"");}}],[{key:"styles",get:function get(){return[n];}},{key:"observedAttributes",get:function get(){return["value","range"];}}]);return r;}(h));t([s("nile-dropdown")],r.prototype,"dropdown",void 0),t([l({type:Boolean,reflect:!0})],r.prototype,"dropDownOpened",void 0),t([l({type:Object})],r.prototype,"value",void 0),t([l({type:Object})],r.prototype,"rangeValue",void 0),t([l({type:String,attribute:"value"})],r.prototype,"valueAttribute",void 0),t([l({type:String,attribute:"value"})],r.prototype,"formattedDate",void 0),t([l({type:Object})],r.prototype,"startDate",void 0),t([l({type:Object})],r.prototype,"endDate",void 0),t([l({type:Boolean})],r.prototype,"isSelectingStart",void 0),t([l({type:Boolean})],r.prototype,"range",void 0),t([a("value")],r.prototype,"valueChanged",null),_export("N",r=t([e("nile-calendar")],r));}};});
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-calendar.css.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","../property-0f6a51ec.cjs.js","lit","lit/directives/class-map.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,n,a,h,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,r;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.customElement;},function(_nileCalendarCssCjsJs){n=_nileCalendarCssCjsJs.s;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_property002CjsJs){l=_property002CjsJs.n;},function(_lit){},function(_litDirectivesClassMapJs){},function(_nilePopupNilePopupCssCjsJs){}],execute:function(){_export("N",r=/*#__PURE__*/function(_h){_inherits(r,_h);var _super=_createSuper(r);function r(){var _this;_classCallCheck(this,r);_this=_super.apply(this,arguments),_this.currentMonth=new Date().getMonth(),_this.currentYear=new Date().getFullYear(),_this.dropDownOpened=!1,_this.valueAttribute=null,_this.formattedDate=null,_this.startDate=null,_this.endDate=null,_this.isSelectingStart=!0,_this.range=!1;return _this;}_createClass(r,[{key:"valueChanged",value:function valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){var _t=this.value.getTimezoneOffset(),_i=new Date(this.value.getTime()-60*_t*1e3);isNaN(_i.getTime())||(this.valueAttribute=_i.toISOString().split("T")[0],this.formattedDate="".concat(String(_i.getDate()).padStart(2,"0"),"/").concat(String(_i.getMonth()+1).padStart(2,"0"),"/").concat(_i.getFullYear()));}}},{key:"updated",value:function updated(t){if(_get(_getPrototypeOf(r.prototype),"updated",this).call(this,t),t.has("valueAttribute")){var _t2=new Date(this.valueAttribute||"");if(!isNaN(_t2.getTime())){var _i2=_t2.getTimezoneOffset();this.value=new Date(_t2.getTime()-60*_i2*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear();}}}},{key:"attributeChangedCallback",value:function attributeChangedCallback(t,i,s){"value"===t?(this.valueAttribute=s,this.initializeValue()):"range"===t&&(this.range=null!==s);}},{key:"initializeValue",value:function initializeValue(){if(this.range)try{var _t3=JSON.parse(this.valueAttribute||"");this.startDate=new Date(_t3.startDate),this.endDate=new Date(_t3.endDate),this.startDate=new Date(this.startDate.getTime()),this.endDate=new Date(this.endDate.getTime()),this.rangeValue={startDate:this.startDate,endDate:this.endDate},this.value=null;}catch(t){}else if(this.valueAttribute){var _t4;_t4=new Date(this.valueAttribute),_t4=new Date(_t4.getTime()-6e4*_t4.getTimezoneOffset()),isNaN(_t4.getTime())||(this.value=_t4,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null);}this.requestUpdate();}},{key:"connectedCallback",value:function connectedCallback(){if(_get(_getPrototypeOf(r.prototype),"connectedCallback",this).call(this),this.initializeValue(),this.valueAttribute){var _t5=new Date(this.valueAttribute);isNaN(_t5.getTime())||(this.value=_t5,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear());}this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(r.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"getDaysArray",value:function getDaysArray(t,i){var s=new Date(t,i+1,0).getDate();return Array.from({length:s},function(t,i){return i+1;});}},{key:"nextMonth",value:function nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate();}},{key:"prevMonth",value:function prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate();}},{key:"selectDate",value:function selectDate(t,i,s){var e=new Date(s,i,t);this.range?(this.startDate&&this.endDate&&(this.startDate=null,this.endDate=null),this.isSelectingStart?(this.startDate=e,this.endDate&&e>this.endDate&&(this.endDate=null),this.isSelectingStart=!1):(this.isSelectingStart=!0,this.startDate&&e<this.startDate?(this.startDate=e,this.endDate=null,this.isSelectingStart=!1):this.endDate=e)):(this.value=e,this.emit("nile-changed",{value:this.value}),this.dropdown&&this.dropdown.hide()),this.requestUpdate();}},{key:"confimRange",value:function confimRange(){this.startDate&&this.endDate&&(this.emit("nile-changed",{startDate:this.startDate,endDate:this.endDate}),this.dropdown&&this.dropdown.hide(),this.rangeValue={startDate:this.startDate,endDate:this.endDate});}},{key:"renderMonth",value:function renderMonth(t,s,e){var _this2=this;var n=new Date(t,s,1).getDay(),a=new Date(t,s+1,0).getDay(),h=this.getDaysArray(0===s?t-1:t,0===s?11:s-1),l=this.getDaysArray(11===s?t+1:t,11===s?0:s+1),_r=h.slice(h.length-n),d=l.slice(0,6-a),c=[].concat(_toConsumableArray(_r),_toConsumableArray(e),_toConsumableArray(d)),u=function u(t,i,s,e){if(!e)return"";if(!_this2.range&&_this2.value){if(t===_this2.value.getDate()&&i===_this2.value.getMonth()&&s===_this2.value.getFullYear())return"selected-date";}var n=_this2.startDate&&t===_this2.startDate.getDate()&&i===_this2.startDate.getMonth()&&s===_this2.startDate.getFullYear(),a=_this2.endDate&&t===_this2.endDate.getDate()&&i===_this2.endDate.getMonth()&&s===_this2.endDate.getFullYear();return n?"range-start":a?"range-end":"";},o=function o(t,i,s,e){if(!e)return!1;if(_this2.startDate&&_this2.endDate){var _e=new Date(s,i,t);return _e>=_this2.startDate&&_e<=_this2.endDate;}return!1;};return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowleft\" color=\"black\" @click=\"","\">\n </nile-icon>\n <span\n >","\n ","</span\n >\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowright\" color=\"black\" @click=\"","\">\n </nile-icon>\n </div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ","\n </div>\n </div>\n "])),this.prevMonth,new Date(t,s).toLocaleString("default",{month:"long"}),t,this.nextMonth,c.map(function(n,a){var h=a>=_r.length&&a<_r.length+e.length;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <div\n class=\"day "," "," ","\"\n @click=\"","\"\n >\n ","\n </div>"])),u(n,s,t,h),o(n,s,t,h)?"in-range":"",h?"":"filler",function(){h&&_this2.selectDate(n,s,t);},n);}));}},{key:"formatDate",value:function formatDate(t){if(!t)return"";return"".concat(String(t.getDate()).padStart(2,"0"),"/").concat(String(t.getMonth()+1).padStart(2,"0"),"/").concat(t.getFullYear());}},{key:"formatDateRange",value:function formatDateRange(t){return t?t.startDate&&t.endDate?"".concat(this.formatDate(t.startDate)," - ").concat(this.formatDate(t.endDate)):"":t;}},{key:"handleStartDateInput",value:function handleStartDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.startDate=null),i&&(!this.endDate||i<=this.endDate)?this.startDate=i:(this.startDate=null,this.endDate=null),this.requestUpdate();}},{key:"handleEndDateInput",value:function handleEndDateInput(t){var i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.endDate=null),i&&(!this.startDate||i>=this.startDate)?this.endDate=i:this.endDate=null,this.requestUpdate();}},{key:"parseDate",value:function parseDate(t){var _t$split$map=t.split("/").map(Number),_t$split$map2=_slicedToArray(_t$split$map,3),i=_t$split$map2[0],s=_t$split$map2[1],e=_t$split$map2[2],n=new Date(e,s-1,i);return isNaN(n.getTime())?null:n;}},{key:"isValidDateInput",value:function isValidDateInput(t){return /^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/.test(t);}},{key:"formatTime",value:function formatTime(t){if(!t)return"";return"".concat(String(t.getHours()).padStart(2,"0"),":").concat(String(t.getMinutes()).padStart(2,"0"),":").concat(String(t.getSeconds()).padStart(2,"0"));}},{key:"isValidTimeInput",value:function isValidTimeInput(t){return /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/.test(t);}},{key:"parseTime",value:function parseTime(t,i){if(!this.isValidTimeInput(t))return null;var _t$split$map3=t.split(":").map(Number),_t$split$map4=_slicedToArray(_t$split$map3,3),s=_t$split$map4[0],e=_t$split$map4[1],n=_t$split$map4[2],a=new Date(i.getTime());return a.setHours(s,e,n),a;}},{key:"handleStartTimeInput",value:function handleStartTimeInput(t){if(!this.startDate)return void(this.startDate=null);var i=this.parseTime(t.detail.value,this.startDate);i?this.startDate=i:this.startDate.setHours(0,0,0),this.requestUpdate();}},{key:"handleEndTimeInput",value:function handleEndTimeInput(t){if(!this.endDate)return void(this.endDate=null);var i=this.parseTime(t.detail.value,this.endDate);i?this.endDate=i:this.endDate.setHours(0,0,0),this.requestUpdate();}},{key:"render",value:function render(){this.getDaysArray(this.currentYear,this.currentMonth);var t=(this.currentMonth+1)%12,s=11===this.currentMonth?this.currentYear+1:this.currentYear;return this.getDaysArray(s,t),i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n\n <div class=\"base ","\">\n <div class=\"calendar-wrapper\" >\n <div class=\"calendar-container ","\">\n ","\n </div>\n <!-- "," -->\n\n </div>\n ","\n </div>\n "])),this.range?"base__range":"",this.range?"with-margin":"",this.renderMonth(this.currentYear,this.currentMonth,this.getDaysArray(this.currentYear,this.currentMonth)),this.range?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <div class=\"calendar-container\">\n ","\n </div>\n "])),this.renderMonth(this.currentYear,(this.currentMonth+1)%12,this.getDaysArray(this.currentYear,(this.currentMonth+1)%12))):"",this.range?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div class=\"calender-input\">\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\"></nile-input>\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n\n </div>\n<br>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"DD/MM/YYYY\" @nile-change=\"","\"></nile-input>\n <nile-input class=\"manual-input\" value=\"","\" placeholder=\"HH:MM:SS\" @nile-change=\"","\"> </nile-input>\n </div>\n <div class=\"button-contaner\">\n <nile-button class=\"apply-button\" ?disabled=\"","\" @click=\"","\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n "])),this.formatDate(this.startDate),this.handleStartDateInput,this.formatTime(this.startDate),this.handleStartTimeInput,this.formatDate(this.endDate),this.handleEndDateInput,this.formatTime(this.endDate),this.handleEndTimeInput,!this.startDate||!this.endDate,this.confimRange):"");}}],[{key:"styles",get:function get(){return[n];}},{key:"observedAttributes",get:function get(){return["value","range"];}}]);return r;}(h));t([s("nile-dropdown")],r.prototype,"dropdown",void 0),t([l({type:Boolean,reflect:!0})],r.prototype,"dropDownOpened",void 0),t([l({type:Object})],r.prototype,"value",void 0),t([l({type:Object})],r.prototype,"rangeValue",void 0),t([l({type:String,attribute:"value"})],r.prototype,"valueAttribute",void 0),t([l({type:String,attribute:"value"})],r.prototype,"formattedDate",void 0),t([l({type:Object})],r.prototype,"startDate",void 0),t([l({type:Object})],r.prototype,"endDate",void 0),t([l({type:Boolean})],r.prototype,"isSelectingStart",void 0),t([l({type:Boolean})],r.prototype,"range",void 0),t([a("value")],r.prototype,"valueChanged",null),_export("N",r=t([e("nile-calendar")],r));}};});
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 LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-calendar.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\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 private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\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 }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\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.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\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;\n\n 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 this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n\n\n\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\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 private nextMonth(): void {\n\n if (this.currentMonth === 11) {\n this.currentMonth = 0;\n this.currentYear++;\n } else {\n this.currentMonth++;\n }\n this.requestUpdate();\n }\n\n private prevMonth(): void {\n\n if (this.currentMonth === 0) {\n this.currentMonth = 11;\n this.currentYear--;\n } else {\n this.currentMonth--;\n }\n this.requestUpdate();\n }\n\n private 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 this.endDate = selectedDate;\n }\n }\n } else {\n this.value = selectedDate;\n this.emit('nile-changed', { value: this.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n this.requestUpdate();\n }\n\n private confimRange() {\n if (this.startDate && this.endDate) {\n this.emit('nile-changed', {\n startDate: this.startDate,\n endDate: this.endDate,\n });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n }\n }\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 return html`\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowleft\" color=\"black\" @click=\"${this.prevMonth}\">\n </nile-icon>\n <span\n >${new Date(year, month).toLocaleString('default', {\n month: 'long',\n })}\n ${year}</span\n >\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowright\" color=\"black\" @click=\"${this.nextMonth}\">\n </nile-icon>\n </div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ${allDays.map((day, index) => {\n const isCurrentMonth =\n index >= fillerDaysBefore.length &&\n index < fillerDaysBefore.length + daysArray.length;\n return html` <div\n class=\"day ${isSelectedDate(\n day,\n month,\n year,\n isCurrentMonth\n )} ${isInRange(day, month, year, isCurrentMonth)\n ? 'in-range'\n : ''} ${!isCurrentMonth ? 'filler' : ''}\"\n @click=\"${() => {\n if (isCurrentMonth) {\n this.selectDate(day, month, year);\n }\n }}\"\n >\n ${day}\n </div>`;\n })}\n </div>\n </div>\n `;\n }\n\n private formatDate(date: Date | null): string {\n if (!date) return '';\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n return `${day}/${month}/${year}`;\n }\n\n private formatDateRange(value: { startDate: Date | null, endDate: Date | null }): string {\n if(!value){\n return value;\n }\n if (!value.startDate || !value.endDate) return '';\n return `${this.formatDate(value.startDate)} - ${this.formatDate(value.endDate)}`;\n }\n\n private handleStartDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.startDate = null;\n }\n if (date && (!this.endDate || date <= this.endDate)) {\n this.startDate = date;\n } else {\n this.startDate = null;\n this.endDate = null;\n }\n this.requestUpdate();\n }\n\n private handleEndDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.endDate = null;\n }\n if (date && (!this.startDate || date >= this.startDate)) {\n this.endDate = date;\n } else {\n this.endDate = null;\n\n }\n this.requestUpdate();\n }\n\n private parseDate(dateString: string): Date | null {\n const [day, month, year] = dateString.split('/').map(Number);\n const date = new Date(year, month - 1, day);\n return !isNaN(date.getTime()) ? date : null;\n }\n\n private isValidDateInput(input: any): boolean {\n const regex = /^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[0-2])\\/\\d{4}$/;\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 // 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// Parse time string to a Date object\nprivate 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\nprivate handleStartTimeInput(event: CustomEvent): void {\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\nprivate handleEndTimeInput(event: CustomEvent): void {\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\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n const daysArray = this.getDaysArray(this.currentYear, this.currentMonth);\n const nextMonth = (this.currentMonth + 1) % 12;\n const nextYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n const nextMonthDaysArray = this.getDaysArray(nextYear, nextMonth);\n\n return html`\n\n <div class=\"base${this.range ? '__range' : ''}\">\n <div class=\"calendar-wrapper\" >\n <div class=\"calendar-container ${this.range ? 'with-margin' : ''}\">\n ${this.renderMonth(\n this.currentYear,\n this.currentMonth,\n this.getDaysArray(this.currentYear, this.currentMonth)\n )}\n </div>\n ${this.range\n ? html`\n <div class=\"calendar-container\">\n ${this.renderMonth(\n this.currentYear,\n (this.currentMonth + 1) % 12,\n this.getDaysArray(\n this.currentYear,\n (this.currentMonth + 1) % 12\n )\n )}\n </div>\n `\n : ''}\n\n </div>\n ${this.range\n ? html`\n <div class=\"calender-input\">\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.startDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleStartDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.startDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleStartTimeInput}\"> </nile-input>\n\n </div>\n<br>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.endDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleEndDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.endDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleEndTimeInput}\"> </nile-input>\n </div>\n <div class=\"button-contaner\">\n <nile-button class=\"apply-button\" ?disabled=\"${\n !this.startDate || !this.endDate\n }\" @click=\"${this.confimRange}\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n `\n : ''}\n </div>\n `;\n }\n}\n\nexport default NileCalendar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-calendar': NileCalendar;\n }\n}\n"],"names":["NileCalendar","_h","_inherits","r","_super","_createSuper","constructor","this","currentMonth","Date","getMonth","currentYear","getFullYear","dropDownOpened","valueAttribute","formattedDate","startDate","endDate","isSelectingStart","range","_this","_createClass","key","value","valueChanged","rangeValue","isNaN","getTime","offset","getTimezoneOffset","localDate","toISOString","split","String","getDate","padStart","concat","updated","changedProperties","super","has","date","attributeChangedCallback","name","oldValue","newValue","initializeValue","JSON","parse","e","requestUpdate","connectedCallback","emit","disconnectedCallback","getDaysArray","year","month","daysInMonth","Array","from","length","_","i","nextMonth","prevMonth","selectDate","day","selectedDate","dropdown","hide","confimRange","renderMonth","daysArray","_this2","firstDay","getDay","lastDay","prevMonthDays","nextMonthDays","fillerDaysBefore","slice","fillerDaysAfter","allDays","isSelectedDate","isCurrentMonth","isStartDate","isEndDate","isInRange","html","_templateObject","_taggedTemplateLiteral","toLocaleString","map","index","_templateObject2","formatDate","formatDateRange","handleStartDateInput","event","parseDate","detail","isValidDateInput","handleEndDateInput","dateString","_t$split$map","Number","input","test","formatTime","getHours","getMinutes","getSeconds","isValidTimeInput","parseTime","_t$split$map3","newDate","hour","minute","second","setHours","handleStartTimeInput","time","handleEndTimeInput","render","nextYear","_templateObject3","_templateObject4","_templateObject5","__decorate","get","styles","NileElement","query","prototype","property","type","Boolean","reflect","Object","attribute","watch","customElement"],"mappings":"qjNA0CaA,CAAN,uBAAAC,EAA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ar.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 LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-calendar.css';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { getTabbableBoundary } from '../internal/tabbable';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileButton from '../nile-button/nile-button';\nimport type NileIconButton from '../nile-icon-button/nile-icon-button';\nimport type { NileMenu } from '../nile-menu';\nimport type { NilePopup } from '../nile-popup';\nimport '../nile-popup';\nimport { NileDropdown } from '../nile-dropdown';\n\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 private currentMonth: number = new Date().getMonth();\n private currentYear: number = new Date().getFullYear();\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n @property({ type: Boolean, reflect: true }) dropDownOpened = false;\n\n @property({ type: Object }) value : any;\n\n @property({ type: Object }) rangeValue : any;\n\n @property({ type: String, attribute: 'value' }) valueAttribute:\n | string\n | null = null;\n\n @property({ type: String, attribute: 'value' }) formattedDate: string | null =\n null;\n\n @property({ type: Object }) startDate: Date | null = null;\n @property({ type: Object }) endDate: Date | null = null;\n @property({ type: Boolean }) isSelectingStart = true; // flag to indicate what we're selecting\n\n @property({ type: Boolean }) range = false;\n\n @watch('value')\n valueChanged() {\n\n if (this.range && this.value) {\n this.rangeValue = this.value;\n this.value = null;\n return;\n }\n\n if (this.value && !isNaN(this.value.getTime())) {\n const offset = this.value.getTimezoneOffset();\n const localDate = new Date(this.value.getTime() - offset * 60 * 1000);\n if (!isNaN(localDate.getTime())) {\n this.valueAttribute = localDate.toISOString().split('T')[0];\n this.formattedDate = `${String(localDate.getDate()).padStart(\n 2,\n '0'\n )}/${String(localDate.getMonth() + 1).padStart(\n 2,\n '0'\n )}/${localDate.getFullYear()}`;\n }\n }\n }\n\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n\n if (changedProperties.has('valueAttribute')) {\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 }\n }\n\n static get observedAttributes() {\n return ['value', 'range'];\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n if (name === 'value') {\n this.valueAttribute = newValue;\n this.initializeValue();\n } else if (name === 'range') {\n this.range = newValue !== null;\n }\n }\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.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\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;\n\n 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 this.rangeValue = null;\n }\n }\n }\n this.requestUpdate();\n }\n\n\n\n\n\n connectedCallback() {\n super.connectedCallback();\n this.initializeValue();\n\n if (this.valueAttribute) {\n const date = new Date(this.valueAttribute);\n if (!isNaN(date.getTime())) {\n this.value = date;\n this.currentMonth = this.value.getMonth();\n this.currentYear = this.value.getFullYear();\n }\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\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 private nextMonth(): void {\n\n if (this.currentMonth === 11) {\n this.currentMonth = 0;\n this.currentYear++;\n } else {\n this.currentMonth++;\n }\n this.requestUpdate();\n }\n\n private prevMonth(): void {\n\n if (this.currentMonth === 0) {\n this.currentMonth = 11;\n this.currentYear--;\n } else {\n this.currentMonth--;\n }\n this.requestUpdate();\n }\n\n private 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 this.endDate = selectedDate;\n }\n }\n } else {\n this.value = selectedDate;\n this.emit('nile-changed', { value: this.value });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n this.requestUpdate();\n }\n\n private confimRange() {\n if (this.startDate && this.endDate) {\n this.emit('nile-changed', {\n startDate: this.startDate,\n endDate: this.endDate,\n });\n if (this.dropdown) {\n this.dropdown.hide();\n }\n\n this.rangeValue = {\n startDate: this.startDate,\n endDate: this.endDate,\n };\n }\n }\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 return html`\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowleft\" color=\"black\" @click=\"${this.prevMonth}\">\n </nile-icon>\n <span\n >${new Date(year, month).toLocaleString('default', {\n month: 'long',\n })}\n ${year}</span\n >\n <nile-icon class=\"calendar-header__month-navigation\" name=\"arrowright\" color=\"black\" @click=\"${this.nextMonth}\">\n </nile-icon>\n </div>\n <div class=\"day-names\">\n <div class=\"day\">Sun</div>\n <div class=\"day\">Mon</div>\n <div class=\"day\">Tue</div>\n <div class=\"day\">Wed</div>\n <div class=\"day\">Thu</div>\n <div class=\"day\">Fri</div>\n <div class=\"day\">Sat</div>\n </div>\n <div class=\"days\">\n ${allDays.map((day, index) => {\n const isCurrentMonth =\n index >= fillerDaysBefore.length &&\n index < fillerDaysBefore.length + daysArray.length;\n return html` <div\n class=\"day ${isSelectedDate(\n day,\n month,\n year,\n isCurrentMonth\n )} ${isInRange(day, month, year, isCurrentMonth)\n ? 'in-range'\n : ''} ${!isCurrentMonth ? 'filler' : ''}\"\n @click=\"${() => {\n if (isCurrentMonth) {\n this.selectDate(day, month, year);\n }\n }}\"\n >\n ${day}\n </div>`;\n })}\n </div>\n </div>\n `;\n }\n\n private formatDate(date: Date | null): string {\n if (!date) return '';\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n return `${day}/${month}/${year}`;\n }\n\n private formatDateRange(value: { startDate: Date | null, endDate: Date | null }): string {\n if(!value){\n return value;\n }\n if (!value.startDate || !value.endDate) return '';\n return `${this.formatDate(value.startDate)} - ${this.formatDate(value.endDate)}`;\n }\n\n private handleStartDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.startDate = null;\n }\n if (date && (!this.endDate || date <= this.endDate)) {\n this.startDate = date;\n } else {\n this.startDate = null;\n this.endDate = null;\n }\n this.requestUpdate();\n }\n\n private handleEndDateInput(event: CustomEvent): void {\n const date = this.parseDate(event.detail.value);\n if (!this.isValidDateInput(date)) {\n this.endDate = null;\n }\n if (date && (!this.startDate || date >= this.startDate)) {\n this.endDate = date;\n } else {\n this.endDate = null;\n\n }\n this.requestUpdate();\n }\n\n private parseDate(dateString: string): Date | null {\n const [day, month, year] = dateString.split('/').map(Number);\n const date = new Date(year, month - 1, day);\n return !isNaN(date.getTime()) ? date : null;\n }\n\n private isValidDateInput(input: any): boolean {\n const regex = /^(0[1-9]|[12][0-9]|3[01])\\/(0[1-9]|1[0-2])\\/\\d{4}$/;\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 // 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// Parse time string to a Date object\nprivate 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\nprivate handleStartTimeInput(event: CustomEvent): void {\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\nprivate handleEndTimeInput(event: CustomEvent): void {\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\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n render(): TemplateResult {\n const daysArray = this.getDaysArray(this.currentYear, this.currentMonth);\n const nextMonth = (this.currentMonth + 1) % 12;\n const nextYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n const nextMonthDaysArray = this.getDaysArray(nextYear, nextMonth);\n\n return html`\n\n <div class=\"base ${this.range ? 'base__range' : ''}\">\n <div class=\"calendar-wrapper\" >\n <div class=\"calendar-container ${this.range ? 'with-margin' : ''}\">\n ${this.renderMonth(\n this.currentYear,\n this.currentMonth,\n this.getDaysArray(this.currentYear, this.currentMonth)\n )}\n </div>\n <!-- ${this.range\n ? html`\n <div class=\"calendar-container\">\n ${this.renderMonth(\n this.currentYear,\n (this.currentMonth + 1) % 12,\n this.getDaysArray(\n this.currentYear,\n (this.currentMonth + 1) % 12\n )\n )}\n </div>\n `\n : ''} -->\n\n </div>\n ${this.range\n ? html`\n <div class=\"calender-input\">\n <span class=\"manual-input-label\">From </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.startDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleStartDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.startDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleStartTimeInput}\"> </nile-input>\n\n </div>\n<br>\n <span class=\"manual-input-label\">To </span>\n <div class=\"from\">\n <nile-input class=\"manual-input\" value=\"${this.formatDate(this.endDate)}\" placeholder=\"DD/MM/YYYY\" @nile-change=\"${this.handleEndDateInput}\"></nile-input>\n <nile-input class=\"manual-input\" value=\"${this.formatTime(this.endDate)}\" placeholder=\"HH:MM:SS\" @nile-change=\"${this.handleEndTimeInput}\"> </nile-input>\n </div>\n <div class=\"button-contaner\">\n <nile-button class=\"apply-button\" ?disabled=\"${\n !this.startDate || !this.endDate\n }\" @click=\"${this.confimRange}\"> Apply</nile-button>\n </div>\n\n\n </div>\n </div>\n `\n : ''}\n </div>\n `;\n }\n}\n\nexport default NileCalendar;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-calendar': NileCalendar;\n }\n}\n"],"names":["NileCalendar","_h","_inherits","r","_super","_createSuper","constructor","this","currentMonth","Date","getMonth","currentYear","getFullYear","dropDownOpened","valueAttribute","formattedDate","startDate","endDate","isSelectingStart","range","_this","_createClass","key","value","valueChanged","rangeValue","isNaN","getTime","offset","getTimezoneOffset","localDate","toISOString","split","String","getDate","padStart","concat","updated","changedProperties","super","has","date","attributeChangedCallback","name","oldValue","newValue","initializeValue","JSON","parse","e","requestUpdate","connectedCallback","emit","disconnectedCallback","getDaysArray","year","month","daysInMonth","Array","from","length","_","i","nextMonth","prevMonth","selectDate","day","selectedDate","dropdown","hide","confimRange","renderMonth","daysArray","_this2","firstDay","getDay","lastDay","prevMonthDays","nextMonthDays","fillerDaysBefore","slice","fillerDaysAfter","allDays","isSelectedDate","isCurrentMonth","isStartDate","isEndDate","isInRange","html","_templateObject","_taggedTemplateLiteral","toLocaleString","map","index","_templateObject2","formatDate","formatDateRange","handleStartDateInput","event","parseDate","detail","isValidDateInput","handleEndDateInput","dateString","_t$split$map","Number","input","test","formatTime","getHours","getMinutes","getSeconds","isValidTimeInput","parseTime","_t$split$map3","newDate","hour","minute","second","setHours","handleStartTimeInput","time","handleEndTimeInput","render","nextYear","_templateObject3","_templateObject4","_templateObject5","__decorate","get","styles","NileElement","query","prototype","property","type","Boolean","reflect","Object","attribute","watch","customElement"],"mappings":"qjNA0CaA,CAAN,uBAAAC,EAAA,EAAAC,SAAA,CAAAC,CAAA,CAAAF,EAAA,MAAAG,MAAA,CAAAC,YAAA,CAAAF,CAAA,EAAA,SAAAA,EAAA,CAAAG,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCASGC,KAAAA,CAAAC,YAAuB,CAAA,GAAIC,CAAAA,IAAOC,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA,CAClCH,KAAAA,CAAAI,WAAsB,CAAA,GAAIF,CAAAA,OAAOG,WAIGL,CAAAA,CAAAA,CAAAA,KAAAA,CAAcM,gBAAG,CAMbN,CAAAA,KAAAA,CAAcO,cAEnD,CAAA,IAAA,CAEqCP,KAAAA,CAAaQ,aAC3D,CAAA,IAAA,CAE0BR,KAAAA,CAASS,SAAAA,CAAgB,KACzBT,KAAAA,CAAOU,OAAAA,CAAgB,IACtBV,CAAAA,KAAAA,CAAAW,kBAAmB,CAEnBX,CAAAA,KAAAA,CAAKY,OAAG,CA+etC,QAAAC,KAAA,EAzgBQC,YAAA,CAAAlB,CAAA,GAAAmB,GAAA,gBAAAC,KAAA,CA6BP,SAAAC,aAAA,C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I,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqI,SAAA,CAAA,kBAAA,CAAA,IAAA,EAExBL,CAAAA,CAAAA,CAAAA,CAAA,CAA5BM,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,OAAyBxI,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqI,SAAA,CAAA,OAAA,CAAA,IAAA,EAG3CL,CAAAA,CAAAA,CAAAA,CAAA,CADCY,CAAAA,CAAM,OAuBN5I,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqI,SAAA,CAAA,cAAA,CAAA,IAxDUrI,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAYgI,CAAA,CAAA,CADxBa,CAAc,CAAA,eAAA,CAAA,CAAA,CACF7I"}
@@ -1,2 +1,2 @@
1
- System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){e=_index001CjsJs.i;}],execute:function(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .calendar-container {\n font-family: Colfax-regular;\n width: 365px;\n height: auto;\n text-align: center;\n background: white;\n }\n\n .calendar-container.with-margin {\n margin-right: 20px;\n }\n\n .calendar-header {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n padding: 22px 20px;\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .calendar-header__month-navigation {\n cursor: pointer;\n }\n\n .divider {\n width: 100%;\n height: 1px;\n background: #c7ced4;\n }\n\n .day-names {\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n height: 50px;\n margin-top: 10px;\n }\n\n .day-names,\n .days {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n height: auto;\n align-items: center;\n }\n\n .days {\n height: auto;\n }\n\n .day {\n flex-basis: calc(100% / 7);\n box-sizing: border-box;\n width: 48px;\n align-items: center;\n padding: 10px;\n height: 32px;\n margin-top: 6px;\n margin-bottom: 6px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n }\n\n .filler {\n color: grey;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .calendar-wrapper {\n background: white;\n display: flex;\n justify-content: space-between;\n width: auto;\n }\n\n .selected-date,\n .range-start,\n .range-end {\n border-radius: 4px;\n background: #a5d3f3;\n color: white;\n }\n\n .range-start {\n background: #a5d3f3;\n border-radius: 4px 0 0 4px;\n color: white;\n }\n\n .range-end {\n background: #a5d3f3;\n border-radius: 0 4px 4px 0;\n color: white;\n }\n\n .range-middle {\n background: #a5d3f3;\n color: white;\n border-radius: 0;\n }\n\n .day.selected {\n background: #a5d3f3;\n color: white;\n border-radius: 4px;\n }\n\n .day.in-range {\n background: #a5d3f3;\n color: white;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .base {\n background-color: white;\n border-radius: 4px;\n padding-bottom: 20px;\n width: 365px;\n }\n\n .base__range {\n width: 730px;\n }\n\n .calender-input {\n padding: 20px;\n padding-bottom: 0px;\n background: white;\n }\n\n .from {\n display: flex;\n justify-content: space-between;\n gap: 20px;\n }\n\n .manual-input {\n width: 100%;\n }\n\n .manual-input-label {\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n margin-bottom: 10px;\n }\n\n .button-contaner {\n width: 100%;\n text-align: right;\n padding: 10px 0;\n }\n"]))));}};});
1
+ System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var e,_templateObject,a;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){e=_index001CjsJs.i;}],execute:function(){_export("s",a=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .calendar-container {\n font-family: Colfax-regular;\n width: 365px;\n height: auto;\n text-align: center;\n background: white;\n }\n\n .calendar-container.with-margin {\n margin-right: 20px;\n }\n\n .calendar-header {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n padding: 22px 20px;\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .calendar-header__month-navigation {\n cursor: pointer;\n }\n\n .divider {\n width: 100%;\n height: 1px;\n background: #c7ced4;\n }\n\n .day-names {\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n height: 50px;\n }\n\n .day-names,\n .days {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n height: auto;\n align-items: center;\n }\n\n .days {\n height: auto;\n }\n\n .day {\n flex-basis: calc(100% / 7);\n box-sizing: border-box;\n width: 48px;\n align-items: center;\n padding: 10px;\n height: 32px;\n margin-top: 6px;\n margin-bottom: 6px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n }\n\n .filler {\n color: grey;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .calendar-wrapper {\n background: white;\n display: flex;\n justify-content: space-between;\n width: 365px;\n box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);\n }\n\n .selected-date,\n .range-start,\n .range-end {\n border-radius: 4px;\n background: #a5d3f3;\n color: white;\n }\n\n .range-start {\n background: #a5d3f3;\n border-radius: 4px 0 0 4px;\n color: white;\n }\n\n .range-end {\n background: #a5d3f3;\n border-radius: 0 4px 4px 0;\n color: white;\n }\n\n .range-middle {\n background: #a5d3f3;\n color: white;\n border-radius: 0;\n }\n\n .day.selected {\n background: #a5d3f3;\n color: white;\n border-radius: 4px;\n }\n\n .day.in-range {\n background: #a5d3f3;\n color: white;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .base {\n background-color: white;\n border-radius: 4px;\n width: 365px;\n }\n\n .base__range {\n padding: 24px;\n }\n\n .calender-input {\n margin-top: 6px;\n padding-bottom: 0px;\n width: 365px;\n }\n\n .from {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n margin-top: 12px;\n }\n\n .manual-input {\n width: 100%;\n }\n\n .manual-input-label {\n color: #7f7f7f;\n font-family: Colfax-regular;\n font-size: 12px;\n font-weight: 500;\n line-height: 12px;\n letter-spacing: 0.2px;\n }\n\n .button-contaner {\n width: 100%;\n text-align: right;\n padding: 12px 0 0 0;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-calendar.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-calendar.css.cjs.js","sources":["../../../src/nile-calendar/nile-calendar.css.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 { css } from 'lit-element';\n\n/**\n * DatePicker CSS\n */\nexport const styles = css`\n :host {\n }\n\n .calendar-container {\n font-family: Colfax-regular;\n width: 365px;\n height: auto;\n text-align: center;\n background: white;\n }\n\n .calendar-container.with-margin {\n margin-right: 20px;\n }\n\n .calendar-header {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n padding: 22px 20px;\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .calendar-header__month-navigation {\n cursor: pointer;\n }\n\n .divider {\n width: 100%;\n height: 1px;\n background: #c7ced4;\n }\n\n .day-names {\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n height: 50px;\n margin-top: 10px;\n }\n\n .day-names,\n .days {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n height: auto;\n align-items: center;\n }\n\n .days {\n height: auto;\n }\n\n .day {\n flex-basis: calc(100% / 7);\n box-sizing: border-box;\n width: 48px;\n align-items: center;\n padding: 10px;\n height: 32px;\n margin-top: 6px;\n margin-bottom: 6px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n }\n\n .filler {\n color: grey;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .calendar-wrapper {\n background: white;\n display: flex;\n justify-content: space-between;\n width: auto;\n }\n\n .selected-date,\n .range-start,\n .range-end {\n border-radius: 4px;\n background: #a5d3f3;\n color: white;\n }\n\n .range-start {\n background: #a5d3f3;\n border-radius: 4px 0 0 4px;\n color: white;\n }\n\n .range-end {\n background: #a5d3f3;\n border-radius: 0 4px 4px 0;\n color: white;\n }\n\n .range-middle {\n background: #a5d3f3;\n color: white;\n border-radius: 0;\n }\n\n .day.selected {\n background: #a5d3f3;\n color: white;\n border-radius: 4px;\n }\n\n .day.in-range {\n background: #a5d3f3;\n color: white;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .base {\n background-color: white;\n border-radius: 4px;\n padding-bottom: 20px;\n width: 365px;\n }\n\n .base__range {\n width: 730px;\n }\n\n .calender-input {\n padding: 20px;\n padding-bottom: 0px;\n background: white;\n }\n\n .from {\n display: flex;\n justify-content: space-between;\n gap: 20px;\n }\n\n .manual-input {\n width: 100%;\n }\n\n .manual-input-label {\n font-size: 12px;\n font-style: normal;\n font-weight: 500;\n margin-bottom: 10px;\n }\n\n .button-contaner {\n width: 100%;\n text-align: right;\n padding: 10px 0;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-calendar.css.cjs.js","sources":["../../../src/nile-calendar/nile-calendar.css.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 { css } from 'lit-element';\n\n/**\n * DatePicker CSS\n */\nexport const styles = css`\n :host {\n }\n\n .calendar-container {\n font-family: Colfax-regular;\n width: 365px;\n height: auto;\n text-align: center;\n background: white;\n }\n\n .calendar-container.with-margin {\n margin-right: 20px;\n }\n\n .calendar-header {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n padding: 22px 20px;\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n }\n\n .calendar-header__month-navigation {\n cursor: pointer;\n }\n\n .divider {\n width: 100%;\n height: 1px;\n background: #c7ced4;\n }\n\n .day-names {\n font-size: 14px;\n font-weight: 600;\n line-height: 14px;\n letter-spacing: 0.2px;\n height: 50px;\n }\n\n .day-names,\n .days {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n height: auto;\n align-items: center;\n }\n\n .days {\n height: auto;\n }\n\n .day {\n flex-basis: calc(100% / 7);\n box-sizing: border-box;\n width: 48px;\n align-items: center;\n padding: 10px;\n height: 32px;\n margin-top: 6px;\n margin-bottom: 6px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n }\n\n .filler {\n color: grey;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .calendar-wrapper {\n background: white;\n display: flex;\n justify-content: space-between;\n width: 365px;\n box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);\n }\n\n .selected-date,\n .range-start,\n .range-end {\n border-radius: 4px;\n background: #a5d3f3;\n color: white;\n }\n\n .range-start {\n background: #a5d3f3;\n border-radius: 4px 0 0 4px;\n color: white;\n }\n\n .range-end {\n background: #a5d3f3;\n border-radius: 0 4px 4px 0;\n color: white;\n }\n\n .range-middle {\n background: #a5d3f3;\n color: white;\n border-radius: 0;\n }\n\n .day.selected {\n background: #a5d3f3;\n color: white;\n border-radius: 4px;\n }\n\n .day.in-range {\n background: #a5d3f3;\n color: white;\n }\n\n .selected-date {\n color: white;\n border-radius: 4px;\n background: #a5d3f3;\n }\n\n .base {\n background-color: white;\n border-radius: 4px;\n width: 365px;\n }\n\n .base__range {\n padding: 24px;\n }\n\n .calender-input {\n margin-top: 6px;\n padding-bottom: 0px;\n width: 365px;\n }\n\n .from {\n display: flex;\n justify-content: space-between;\n gap: 8px;\n margin-top: 12px;\n }\n\n .manual-input {\n width: 100%;\n }\n\n .manual-input-label {\n color: #7f7f7f;\n font-family: Colfax-regular;\n font-size: 12px;\n font-weight: 500;\n line-height: 12px;\n letter-spacing: 0.2px;\n }\n\n .button-contaner {\n width: 100%;\n text-align: right;\n padding: 12px 0 0 0;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -1,4 +1,4 @@
1
- import{i as e}from"../index-cd2f9c12.esm.js";const t=e`
1
+ import{i as e}from"../index-cd2f9c12.esm.js";const a=e`
2
2
  :host {
3
3
  }
4
4
 
@@ -41,7 +41,6 @@ import{i as e}from"../index-cd2f9c12.esm.js";const t=e`
41
41
  line-height: 14px;
42
42
  letter-spacing: 0.2px;
43
43
  height: 50px;
44
- margin-top: 10px;
45
44
  }
46
45
 
47
46
  .day-names,
@@ -86,7 +85,8 @@ import{i as e}from"../index-cd2f9c12.esm.js";const t=e`
86
85
  background: white;
87
86
  display: flex;
88
87
  justify-content: space-between;
89
- width: auto;
88
+ width: 365px;
89
+ box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
90
90
  }
91
91
 
92
92
  .selected-date,
@@ -135,24 +135,24 @@ import{i as e}from"../index-cd2f9c12.esm.js";const t=e`
135
135
  .base {
136
136
  background-color: white;
137
137
  border-radius: 4px;
138
- padding-bottom: 20px;
139
138
  width: 365px;
140
139
  }
141
140
 
142
141
  .base__range {
143
- width: 730px;
142
+ padding: 24px;
144
143
  }
145
144
 
146
145
  .calender-input {
147
- padding: 20px;
146
+ margin-top: 6px;
148
147
  padding-bottom: 0px;
149
- background: white;
148
+ width: 365px;
150
149
  }
151
150
 
152
151
  .from {
153
152
  display: flex;
154
153
  justify-content: space-between;
155
- gap: 20px;
154
+ gap: 8px;
155
+ margin-top: 12px;
156
156
  }
157
157
 
158
158
  .manual-input {
@@ -160,15 +160,17 @@ import{i as e}from"../index-cd2f9c12.esm.js";const t=e`
160
160
  }
161
161
 
162
162
  .manual-input-label {
163
+ color: #7f7f7f;
164
+ font-family: Colfax-regular;
163
165
  font-size: 12px;
164
- font-style: normal;
165
166
  font-weight: 500;
166
- margin-bottom: 10px;
167
+ line-height: 12px;
168
+ letter-spacing: 0.2px;
167
169
  }
168
170
 
169
171
  .button-contaner {
170
172
  width: 100%;
171
173
  text-align: right;
172
- padding: 10px 0;
174
+ padding: 12px 0 0 0;
173
175
  }
174
- `;export{t as s};
176
+ `;export{a as s};
@@ -30,16 +30,16 @@ import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
30
30
  </div>
31
31
  `}formatDate(t){if(!t)return"";return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear()}`}formatDateRange(t){return t?t.startDate&&t.endDate?`${this.formatDate(t.startDate)} - ${this.formatDate(t.endDate)}`:"":t}handleStartDateInput(t){const i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.startDate=null),i&&(!this.endDate||i<=this.endDate)?this.startDate=i:(this.startDate=null,this.endDate=null),this.requestUpdate()}handleEndDateInput(t){const i=this.parseDate(t.detail.value);this.isValidDateInput(i)||(this.endDate=null),i&&(!this.startDate||i>=this.startDate)?this.endDate=i:this.endDate=null,this.requestUpdate()}parseDate(t){const[i,s,e]=t.split("/").map(Number),n=new Date(e,s-1,i);return isNaN(n.getTime())?null:n}isValidDateInput(t){return/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/\d{4}$/.test(t)}formatTime(t){if(!t)return"";return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}:${String(t.getSeconds()).padStart(2,"0")}`}isValidTimeInput(t){return/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$/.test(t)}parseTime(t,i){if(!this.isValidTimeInput(t))return null;const[s,e,n]=t.split(":").map(Number),a=new Date(i.getTime());return a.setHours(s,e,n),a}handleStartTimeInput(t){if(!this.startDate)return void(this.startDate=null);const i=this.parseTime(t.detail.value,this.startDate);i?this.startDate=i:this.startDate.setHours(0,0,0),this.requestUpdate()}handleEndTimeInput(t){if(!this.endDate)return void(this.endDate=null);const i=this.parseTime(t.detail.value,this.endDate);i?this.endDate=i:this.endDate.setHours(0,0,0),this.requestUpdate()}render(){this.getDaysArray(this.currentYear,this.currentMonth);const t=(this.currentMonth+1)%12,s=11===this.currentMonth?this.currentYear+1:this.currentYear;return this.getDaysArray(s,t),i`
32
32
 
33
- <div class="base${this.range?"__range":""}">
33
+ <div class="base ${this.range?"base__range":""}">
34
34
  <div class="calendar-wrapper" >
35
35
  <div class="calendar-container ${this.range?"with-margin":""}">
36
36
  ${this.renderMonth(this.currentYear,this.currentMonth,this.getDaysArray(this.currentYear,this.currentMonth))}
37
37
  </div>
38
- ${this.range?i`
38
+ <!-- ${this.range?i`
39
39
  <div class="calendar-container">
40
40
  ${this.renderMonth(this.currentYear,(this.currentMonth+1)%12,this.getDaysArray(this.currentYear,(this.currentMonth+1)%12))}
41
41
  </div>
42
- `:""}
42
+ `:""} -->
43
43
 
44
44
  </div>
45
45
  ${this.range?i`
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-content-editor.css.cjs.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","../internal/enum.cjs.js","lit/directives/live.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var t,i,s,e,o,n,h,r,a,l,d,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(typeof e+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw new Error("illegal catch attempt");},delegateYield:function(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.state;o=_litDecoratorsJs.customElement;},function(_nileContentEditorCssCjsJs){n=_nileContentEditorCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalEnumCjsJs){l=_internalEnumCjsJs.K;},function(_litDirectivesLiveJs){d=_litDirectivesLiveJs.live;},function(_property002CjsJs){p=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",c=/*#__PURE__*/function(_r){_inherits(c,_r);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.value="",_this.showLabel=!0,_this.labelText="",_this.type="text|text-area",_this.required=!0,_this.openDropdown=!1,_this.tagIdentifier="$",_this.filteredValue="",_this.helpText="",_this.readonly=!1,_this.errorMessage="",_this.error=!1;return _this;}_createClass(c,[{key:"connectedCallback",value:function connectedCallback(){this.handleOutsideClick=this.handleOutsideClick.bind(this),this.handleClipboardEvent=this.handleClipboardEvent.bind(this),_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.emit("nile-init"),this.addOpenListeners(),this.setInitialValues();}},{key:"setInitialValues",value:function setInitialValues(){var _this2=this;this.updateComplete.then(function(t){t&&_this2.value&&(_this2.contentEditor.innerHTML=_this2.generateHTMLTagsWithValues(_this2.value));});}},{key:"addOpenListeners",value:function addOpenListeners(){window.addEventListener("click",this.handleOutsideClick),window.addEventListener("cut",this.handleClipboardEvent),window.addEventListener("copy",this.handleClipboardEvent),window.addEventListener("paste",this.handleClipboardEvent);}},{key:"removeOpenListeners",value:function removeOpenListeners(){window.removeEventListener("click",this.handleOutsideClick),window.removeEventListener("cut",this.handleClipboardEvent),window.removeEventListener("copy",this.handleClipboardEvent),window.removeEventListener("paste",this.handleClipboardEvent);}},{key:"handleClipboardEvent",value:function(){var _handleClipboardEvent=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var _window,_this3=this;var i,_s;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:i=(_window=window)===null||_window===void 0||(_window=_window.getSelection())===null||_window===void 0?void 0:_window.toString();if(!i){_context2.next=13;break;}_context2.t0=t.type;_context2.next=_context2.t0==="cut"?5:_context2.t0==="copy"?5:_context2.t0==="paste"?9:13;break;case 5:_context2.next=7;return navigator.clipboard.writeText(i);case 7:document.execCommand(t.type);return _context2.abrupt("break",13);case 9:_context2.next=11;return navigator.clipboard.readText();case 11:_s=_context2.sent;document.execCommand("insertText",!1,_s);case 13:setTimeout(function(){_this3.emitInputChange();});case 14:case"end":return _context2.stop();}},_callee);}));function handleClipboardEvent(_x){return _handleClipboardEvent.apply(this,arguments);}return handleClipboardEvent;}()},{key:"toggleDropdown",value:function toggleDropdown(t){this.openDropdown=t;}},{key:"handleOutsideClick",value:function handleOutsideClick(t){t&&t.target&&this.toggleDropdown(!1);}},{key:"handleTypeChange",value:function handleTypeChange(){this.contentEditor.innerHTML=this.generateHTMLTagsWithValues(this.value);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(c.prototype),"disconnectedCallback",this).call(this),this.removeOpenListeners(),this.emit("nile-destroy");}},{key:"handlekeyDown",value:function handlekeyDown(t){var _this4=this;if(t.code!==l.ENTER||"text"!==this.type){if(![l.CUT,l.COPY,l.PASTE].includes(t.code))return t.code===l.ESCAPE?(t.preventDefault(),void this.toggleDropdown(!1)):void setTimeout(function(){var t=_this4.contentEditor.innerText;_this4.emitInputChange(),t.includes(_this4.tagIdentifier)?(_this4.insertNodes(_this4.contentEditor,_this4.contentEditor.childNodes),_this4.filterOptions(),_this4.toggleDropdown(!0)):_this4.toggleDropdown(!1);});}else t.preventDefault();}},{key:"filterOptions",value:function filterOptions(){var _this5=this;this.filteredOptions=this.options,this.options.length&&this.filteredValue?this.filteredOptions=this.options.filter(function(t){return t.startsWith(_this5.filteredValue);}):this.filteredOptions=this.options;}},{key:"generateValuesFromHTMLTags",value:function generateValuesFromHTMLTags(t){return t.replace(/<span class="chips(?: chip-error)?" contenteditable="false">(.*?)<\/span>/g,function(t,i){return"{{"+i+"}}";});}},{key:"generateHTMLTagsWithValues",value:function generateHTMLTagsWithValues(t){var _this6=this;return t.replace(/{{(.*?)}}/g,function(t,i){return _this6.options.includes(i)?'<span class="chips" contenteditable="false">'+i+"</span>":'<span class="chips chip-error" contenteditable="false">'+i+"</span>";});}},{key:"emitInputChange",value:function emitInputChange(){if(this.contentEditor){var _t2;var _t=this.contentEditor.innerHTML;""!==this.contentEditor.innerText&&(_t=this.generateValuesFromHTMLTags(_t)),_t=_t.replace(/&nbsp;/g," "),_t="<br>"===_t?"":(_t2=_t)===null||_t2===void 0?void 0:_t2.trim(),this.emit("nile-change",{value:this.generateValuesFromHTMLTags(_t)});}}},{key:"insertNodes",value:function insertNodes(t,i,s){var _this7=this;_toConsumableArray(i).forEach(function(i,e){var _i$nodeValue,_i$nodeValue2,_t$childNodes$e;if(i.hasChildNodes())s?_this7.insertNodes(i,i.childNodes,s):_this7.insertNodes(i,i.childNodes);else if((_i$nodeValue=i.nodeValue)!==null&&_i$nodeValue!==void 0&&_i$nodeValue.includes(_this7.tagIdentifier))return s&&(t.childNodes[e].nodeValue=(_i$nodeValue2=i.nodeValue)===null||_i$nodeValue2===void 0?void 0:_i$nodeValue2.replace(_this7.tagIdentifier+_this7.filteredValue,""),t.childNodes[e].after(s)),void(_this7.filteredValue=(t===null||t===void 0||(_t$childNodes$e=t.childNodes[e])===null||_t$childNodes$e===void 0||(_t$childNodes$e=_t$childNodes$e.nodeValue)===null||_t$childNodes$e===void 0?void 0:_t$childNodes$e.split(_this7.tagIdentifier).slice(1).join())||"");});}},{key:"handleOptions",value:function handleOptions(t){this.toggleDropdown(!1);var i=document.createElement("span");i.setAttribute("class","chips"),i.setAttribute("contentEditable","false"),i.innerText=t,this.insertNodes(this.contentEditor,this.contentEditor.childNodes,i),this.filteredOptions=this.options,this.filteredValue="",this.emitInputChange();}},{key:"renderAutoOptions",value:function renderAutoOptions(){var _this8=this;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<div\n class=\"","\"\n >\n ","\n </div>"])),h({"nile-options-container":!0,"dropdown-position":"text-area"===this.type}),this.filteredOptions&&this.filteredOptions.map(function(t){return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <nile-option\n .value=\"","\"\n @click=\"","\"\n >","\n </nile-option>"])),t,function(i){_this8.handleOptions(t);},t);}));}},{key:"render",value:function render(){var t=!!this.helpText,s=!!this.error,e=!!this.errorMessage,o=!!this.readonly,n=this.type;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-popup\n .active=\"","\"\n sync=\"width\"\n strategy=\"fixed\"\n placement=\"bottom\"\n class=","\n >\n <div class=\"content-editable-wrapper\" slot=\"anchor\">\n ","\n <div\n contenteditable=\"","\"\n class=","\n @keydown=","\n ></div>\n ","\n ","\n </div>\n\n ","\n </nile-popup>\n "])),d(this.openDropdown),h({dropdown:!0,"dropdown--open":!0,popup:!0}),this.showLabel&&this.labelText?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<label class=\"ods-label\">"," </label> ",""])),this.labelText,this.required?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<span class=\"asterik\">*</span>"]))):""):"",!o,h({"content-editable-input":!0,error:s||e,"read-only":o,"text-area":"text-area"===n}),this.handlekeyDown,t?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",e?i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"",this.renderAutoOptions());}}]);return c;}(r));c.styles=n,t([p()],c.prototype,"value",void 0),t([p()],c.prototype,"options",void 0),t([p()],c.prototype,"filteredOptions",void 0),t([p()],c.prototype,"showLabel",void 0),t([p()],c.prototype,"labelText",void 0),t([p()],c.prototype,"type",void 0),t([p()],c.prototype,"required",void 0),t([s(".content-editable-input")],c.prototype,"contentEditor",void 0),t([s(".nile-options-container")],c.prototype,"autoOptions",void 0),t([e()],c.prototype,"openDropdown",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({attribute:"readonly"})],c.prototype,"readonly",void 0),t([p({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([p({attribute:"error"})],c.prototype,"error",void 0),t([a("type",{waitUntilFirstUpdate:!0})],c.prototype,"handleTypeChange",null),_export("N",c=t([o("nile-content-editor")],c));}};});
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-content-editor.css.cjs.js","lit/directives/class-map.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","../internal/enum.cjs.js","lit/directives/live.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var t,i,s,e,o,n,h,r,a,l,d,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw new Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(typeof e+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw new Error("illegal catch attempt");},delegateYield:function(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.state;o=_litDecoratorsJs.customElement;},function(_nileContentEditorCssCjsJs){n=_nileContentEditorCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalEnumCjsJs){l=_internalEnumCjsJs.K;},function(_litDirectivesLiveJs){d=_litDirectivesLiveJs.live;},function(_property002CjsJs){p=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",c=/*#__PURE__*/function(_r){_inherits(c,_r);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.value="",_this.showLabel=!0,_this.labelText="",_this.type="text|text-area",_this.required=!0,_this.openDropdown=!1,_this.tagIdentifier="$",_this.filteredValue="",_this.helpText="",_this.readonly=!1,_this.errorMessage="",_this.error=!1;return _this;}_createClass(c,[{key:"connectedCallback",value:function connectedCallback(){this.handleOutsideClick=this.handleOutsideClick.bind(this),this.handleClipboardEvent=this.handleClipboardEvent.bind(this),_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.emit("nile-init"),this.addOpenListeners(),this.setInitialValues();}},{key:"setInitialValues",value:function setInitialValues(){var _this2=this;this.updateComplete.then(function(t){t&&_this2.value&&(_this2.contentEditor.innerHTML=_this2.generateHTMLTagsWithValues(_this2.value));});}},{key:"addOpenListeners",value:function addOpenListeners(){window.addEventListener("click",this.handleOutsideClick),window.addEventListener("cut",this.handleClipboardEvent),window.addEventListener("copy",this.handleClipboardEvent),window.addEventListener("paste",this.handleClipboardEvent);}},{key:"removeOpenListeners",value:function removeOpenListeners(){window.removeEventListener("click",this.handleOutsideClick),window.removeEventListener("cut",this.handleClipboardEvent),window.removeEventListener("copy",this.handleClipboardEvent),window.removeEventListener("paste",this.handleClipboardEvent);}},{key:"handleClipboardEvent",value:function(){var _handleClipboardEvent=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var _window,_this3=this;var i,_s;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:i=(_window=window)===null||_window===void 0||(_window=_window.getSelection())===null||_window===void 0?void 0:_window.toString();_context2.t0=t.type;_context2.next=_context2.t0==="cut"?4:_context2.t0==="copy"?4:_context2.t0==="paste"?10:15;break;case 4:_context2.t1=i;if(!_context2.t1){_context2.next=8;break;}_context2.next=8;return navigator.clipboard.writeText(i);case 8:document.execCommand(t.type);return _context2.abrupt("break",15);case 10:t.preventDefault();_context2.next=13;return navigator.clipboard.readText();case 13:_s=_context2.sent;_s=_s.replace(/<(|\/)(html|body|meta|span)[^>]*?>/gi,"").trim(),document.execCommand("insertText",!1,_s);case 15:setTimeout(function(){_this3.emitInputChange();});case 16:case"end":return _context2.stop();}},_callee);}));function handleClipboardEvent(_x){return _handleClipboardEvent.apply(this,arguments);}return handleClipboardEvent;}()},{key:"toggleDropdown",value:function toggleDropdown(t){this.openDropdown=t;}},{key:"handleOutsideClick",value:function handleOutsideClick(t){t&&t.target&&this.toggleDropdown(!1);}},{key:"handleTypeChange",value:function handleTypeChange(){this.contentEditor.innerHTML=this.generateHTMLTagsWithValues(this.value);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(c.prototype),"disconnectedCallback",this).call(this),this.removeOpenListeners(),this.emit("nile-destroy");}},{key:"handlekeyDown",value:function handlekeyDown(t){var _this4=this;if(t.code!==l.ENTER||"text"!==this.type){if(![l.CUT,l.COPY,l.PASTE].includes(t.code)||!t.ctrlKey&&!t.metaKey)return t.code===l.ESCAPE?(t.preventDefault(),void this.toggleDropdown(!1)):void setTimeout(function(){var t=_this4.contentEditor.innerText;_this4.emitInputChange(),t.includes(_this4.tagIdentifier)?(_this4.insertNodes(_this4.contentEditor,_this4.contentEditor.childNodes),_this4.filterOptions(),_this4.toggleDropdown(!0)):_this4.toggleDropdown(!1);},10);}else t.preventDefault();}},{key:"filterOptions",value:function filterOptions(){var _this5=this;this.filteredOptions=this.options,this.options.length&&this.filteredValue?this.filteredOptions=this.options.filter(function(t){return t.includes(_this5.filteredValue);}):this.filteredOptions=this.options;}},{key:"generateValuesFromHTMLTags",value:function generateValuesFromHTMLTags(t){return t.replace(/<span class="chips(?: chip-error)?" contenteditable="false">(.*?)<\/span>/g,function(t,i){return"{{"+i+"}}";});}},{key:"generateHTMLTagsWithValues",value:function generateHTMLTagsWithValues(t){var _this6=this;return t.replace(/{{(.*?)}}/g,function(t,i){return _this6.options.includes(i)?'<span class="chips" contenteditable="false">'+i+"</span>":_this6.setError(i);});}},{key:"setError",value:function setError(t){return this.error=!0,'<span class="chips chip-error" contenteditable="false">'+t+"</span>";}},{key:"emitInputChange",value:function emitInputChange(){if(this.contentEditor){var _t=this.contentEditor.innerHTML;""!==this.contentEditor.innerText&&(_t=this.generateValuesFromHTMLTags(_t)),_t=_t.replace(/&nbsp;/g," "),_t=_t.replace("<br>",""),this.emit("nile-change",{value:this.generateValuesFromHTMLTags(_t)});}}},{key:"insertNodes",value:function insertNodes(t,i,s){var _this7=this;_toConsumableArray(i).forEach(function(i,e){var _i$nodeValue,_i$nodeValue2,_t$childNodes$e;if(i.hasChildNodes())s?_this7.insertNodes(i,i.childNodes,s):_this7.insertNodes(i,i.childNodes);else if((_i$nodeValue=i.nodeValue)!==null&&_i$nodeValue!==void 0&&_i$nodeValue.includes(_this7.tagIdentifier))return s&&(t.childNodes[e].nodeValue=(_i$nodeValue2=i.nodeValue)===null||_i$nodeValue2===void 0?void 0:_i$nodeValue2.replace(_this7.tagIdentifier+_this7.filteredValue,""),t.childNodes[e].after(s)),void(_this7.filteredValue=(t===null||t===void 0||(_t$childNodes$e=t.childNodes[e])===null||_t$childNodes$e===void 0||(_t$childNodes$e=_t$childNodes$e.nodeValue)===null||_t$childNodes$e===void 0?void 0:_t$childNodes$e.split(_this7.tagIdentifier).slice(1).join())||"");});}},{key:"handleOptions",value:function handleOptions(t){this.toggleDropdown(!1);var i=document.createElement("span");i.setAttribute("class","chips"),i.setAttribute("contentEditable","false"),i.innerText=t,this.insertNodes(this.contentEditor,this.contentEditor.childNodes,i),this.filteredOptions=this.options,this.filteredValue="",this.emitInputChange();}},{key:"renderAutoOptions",value:function renderAutoOptions(){var _this8=this;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["<div\n class=\"","\"\n >\n ","\n </div>"])),h({"nile-options-container":!0,"dropdown-position":"text-area"===this.type}),this.filteredOptions&&this.filteredOptions.map(function(t){return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <nile-option\n .value=\"","\"\n @click=\"","\"\n >","\n </nile-option>"])),t,function(i){_this8.handleOptions(t);},t);}));}},{key:"render",value:function render(){var t=!!this.helpText,s=!!this.error,e=!!this.errorMessage,o=!!this.readonly,n=this.type;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-popup\n .active=\"","\"\n sync=\"width\"\n strategy=\"fixed\"\n placement=\"bottom\"\n class=","\n >\n <div class=\"content-editable-wrapper\" slot=\"anchor\">\n ","\n <div\n contenteditable=\"","\"\n spellcheck=\"false\"\n class=","\n @keydown=","\n ></div>\n ","\n ","\n </div>\n ","\n </nile-popup>\n "])),d(this.openDropdown),h({dropdown:!0,"dropdown--open":!0,popup:!0}),this.showLabel&&this.labelText?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<label class=\"ods-label\">"," </label> ",""])),this.labelText,this.required?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<span class=\"asterik\">*</span>"]))):""):"",!o,h({"content-editable-input":!0,error:s||e,"read-only":o,"text-area":"text-area"===n}),this.handlekeyDown,t?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",e?i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"",this.filteredOptions&&this.filteredOptions.length?this.renderAutoOptions():null);}}]);return c;}(r));c.styles=n,t([p()],c.prototype,"value",void 0),t([p()],c.prototype,"options",void 0),t([p()],c.prototype,"filteredOptions",void 0),t([p()],c.prototype,"showLabel",void 0),t([p()],c.prototype,"labelText",void 0),t([p()],c.prototype,"type",void 0),t([p()],c.prototype,"required",void 0),t([s(".content-editable-input")],c.prototype,"contentEditor",void 0),t([s(".nile-options-container")],c.prototype,"autoOptions",void 0),t([e()],c.prototype,"openDropdown",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({attribute:"readonly"})],c.prototype,"readonly",void 0),t([p({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([p({attribute:"error"})],c.prototype,"error",void 0),t([a("type",{waitUntilFirstUpdate:!0})],c.prototype,"handleTypeChange",null),_export("N",c=t([o("nile-content-editor")],c));}};});
2
2
  //# sourceMappingURL=nile-content-editor.cjs.js.map