@aquera/nile-elements 0.0.5-8 → 0.0.6

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 (214) hide show
  1. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
  2. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
  3. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
  4. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.js +2 -0
  5. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button/nile-button.js.map +1 -1
  6. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
  7. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js +5 -0
  8. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  9. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.d.ts +1 -0
  10. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.js +5 -0
  11. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  12. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.d.ts +1 -0
  13. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.js +5 -0
  14. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-chip/nile-chip.js.map +1 -1
  15. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.d.ts +1 -0
  16. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js +5 -0
  17. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  18. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dropdown/nile-dropdown.js +2 -0
  19. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  20. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.d.ts +1 -0
  21. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js +1 -0
  22. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  23. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/stringinput.d.ts +5 -0
  24. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/stringinput.js +5 -0
  25. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/stringinput.js.map +1 -0
  26. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.d.ts +2 -0
  27. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +8 -0
  28. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
  29. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js +2 -0
  30. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js.map +1 -1
  31. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio/nile-radio.js +2 -0
  32. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio/nile-radio.js.map +1 -1
  33. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.d.ts +1 -0
  34. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js +5 -0
  35. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  36. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +1 -0
  37. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +5 -0
  38. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
  39. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +4 -2
  40. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js +11 -2
  41. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  42. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/index.d.ts +1 -0
  43. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/index.js +2 -0
  44. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/index.js.map +1 -0
  45. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.d.ts +12 -0
  46. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +35 -0
  47. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -0
  48. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +60 -0
  49. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +124 -0
  50. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -0
  51. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js +2 -0
  52. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  53. package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
  54. package/demo/filenames.txt +1 -1
  55. package/dist/index.cjs.js +1 -1
  56. package/dist/index.esm.js +1 -1
  57. package/dist/index.iife.js +71 -15
  58. package/dist/nile-button/index.cjs.js +1 -1
  59. package/dist/nile-button/index.esm.js +1 -1
  60. package/dist/nile-button/nile-button.cjs.js +1 -1
  61. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  62. package/dist/nile-button/nile-button.esm.js +1 -1
  63. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  64. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  65. package/dist/nile-calendar/nile-calendar.esm.js +2 -2
  66. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  67. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  68. package/dist/nile-checkbox/nile-checkbox.esm.js +1 -1
  69. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  70. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  71. package/dist/nile-chip/nile-chip.esm.js +1 -1
  72. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  73. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  74. package/dist/nile-date-picker/nile-date-picker.esm.js +1 -1
  75. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  76. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  77. package/dist/nile-dropdown/nile-dropdown.esm.js +1 -1
  78. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  79. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  80. package/dist/nile-icon/icons/svg/stringinput.cjs.js +2 -0
  81. package/dist/nile-icon/icons/svg/stringinput.cjs.js.map +1 -0
  82. package/dist/nile-icon/icons/svg/stringinput.esm.js +1 -0
  83. package/dist/nile-icon/index.cjs.js +1 -1
  84. package/dist/nile-icon/index.cjs.js.map +1 -1
  85. package/dist/nile-icon/index.esm.js +2 -2
  86. package/dist/nile-icon-button/index.cjs.js +1 -1
  87. package/dist/nile-icon-button/index.esm.js +1 -1
  88. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  89. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  90. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  91. package/dist/nile-input/index.cjs.js +1 -1
  92. package/dist/nile-input/index.esm.js +1 -1
  93. package/dist/nile-input/nile-input.cjs.js +1 -1
  94. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  95. package/dist/nile-input/nile-input.esm.js +1 -1
  96. package/dist/nile-link/nile-link.cjs.js +1 -1
  97. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  98. package/dist/nile-link/nile-link.esm.js +2 -2
  99. package/dist/nile-menu-item/index.cjs.js +1 -1
  100. package/dist/nile-menu-item/index.esm.js +1 -1
  101. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  102. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  103. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  104. package/dist/nile-option/index.cjs.js +1 -1
  105. package/dist/nile-option/index.esm.js +1 -1
  106. package/dist/nile-option/nile-option.cjs.js +1 -1
  107. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  108. package/dist/nile-option/nile-option.esm.js +1 -1
  109. package/dist/nile-radio/nile-radio.cjs.js +1 -1
  110. package/dist/nile-radio/nile-radio.cjs.js.map +1 -1
  111. package/dist/nile-radio/nile-radio.esm.js +1 -1
  112. package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
  113. package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
  114. package/dist/nile-radio-group/nile-radio-group.esm.js +2 -2
  115. package/dist/nile-select/index.cjs.js +1 -1
  116. package/dist/nile-select/index.esm.js +1 -1
  117. package/dist/nile-select/nile-select.cjs.js +1 -1
  118. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  119. package/dist/nile-select/nile-select.esm.js +1 -1
  120. package/dist/nile-slide-toggle/index.cjs.js +1 -1
  121. package/dist/nile-slide-toggle/index.esm.js +1 -1
  122. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
  123. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
  124. package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +4 -4
  125. package/dist/nile-switcher/index.cjs.js +2 -0
  126. package/dist/nile-switcher/index.cjs.js.map +1 -0
  127. package/dist/nile-switcher/index.esm.js +1 -0
  128. package/dist/nile-switcher/nile-switcher.cjs.js +2 -0
  129. package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -0
  130. package/dist/nile-switcher/nile-switcher.css.cjs.js +2 -0
  131. package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -0
  132. package/dist/nile-switcher/nile-switcher.css.esm.js +23 -0
  133. package/dist/nile-switcher/nile-switcher.esm.js +30 -0
  134. package/dist/nile-tag/index.cjs.js +1 -1
  135. package/dist/nile-tag/index.esm.js +1 -1
  136. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  137. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  138. package/dist/nile-tag/nile-tag.esm.js +1 -1
  139. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  140. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  141. package/dist/nile-textarea/nile-textarea.esm.js +1 -1
  142. package/dist/src/index.d.ts +1 -0
  143. package/dist/src/index.js +1 -0
  144. package/dist/src/index.js.map +1 -1
  145. package/dist/src/nile-button/nile-button.js +2 -0
  146. package/dist/src/nile-button/nile-button.js.map +1 -1
  147. package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
  148. package/dist/src/nile-calendar/nile-calendar.js +5 -0
  149. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  150. package/dist/src/nile-checkbox/nile-checkbox.d.ts +1 -0
  151. package/dist/src/nile-checkbox/nile-checkbox.js +5 -0
  152. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  153. package/dist/src/nile-chip/nile-chip.d.ts +1 -0
  154. package/dist/src/nile-chip/nile-chip.js +5 -0
  155. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  156. package/dist/src/nile-date-picker/nile-date-picker.d.ts +1 -0
  157. package/dist/src/nile-date-picker/nile-date-picker.js +5 -0
  158. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  159. package/dist/src/nile-dropdown/nile-dropdown.js +2 -0
  160. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  161. package/dist/src/nile-icon/icons/svg/index.d.ts +1 -0
  162. package/dist/src/nile-icon/icons/svg/index.js +1 -0
  163. package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  164. package/dist/src/nile-icon/icons/svg/stringinput.d.ts +5 -0
  165. package/dist/src/nile-icon/icons/svg/stringinput.js +5 -0
  166. package/dist/src/nile-icon/icons/svg/stringinput.js.map +1 -0
  167. package/dist/src/nile-input/nile-input.d.ts +2 -0
  168. package/dist/src/nile-input/nile-input.js +8 -0
  169. package/dist/src/nile-input/nile-input.js.map +1 -1
  170. package/dist/src/nile-link/nile-link.js +2 -0
  171. package/dist/src/nile-link/nile-link.js.map +1 -1
  172. package/dist/src/nile-radio/nile-radio.js +2 -0
  173. package/dist/src/nile-radio/nile-radio.js.map +1 -1
  174. package/dist/src/nile-radio-group/nile-radio-group.d.ts +1 -0
  175. package/dist/src/nile-radio-group/nile-radio-group.js +5 -0
  176. package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  177. package/dist/src/nile-select/nile-select.d.ts +1 -0
  178. package/dist/src/nile-select/nile-select.js +5 -0
  179. package/dist/src/nile-select/nile-select.js.map +1 -1
  180. package/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +4 -2
  181. package/dist/src/nile-slide-toggle/nile-slide-toggle.js +11 -2
  182. package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  183. package/dist/src/nile-switcher/index.d.ts +1 -0
  184. package/dist/src/nile-switcher/index.js +2 -0
  185. package/dist/src/nile-switcher/index.js.map +1 -0
  186. package/dist/src/nile-switcher/nile-switcher.css.d.ts +12 -0
  187. package/dist/src/nile-switcher/nile-switcher.css.js +35 -0
  188. package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -0
  189. package/dist/src/nile-switcher/nile-switcher.d.ts +60 -0
  190. package/dist/src/nile-switcher/nile-switcher.js +124 -0
  191. package/dist/src/nile-switcher/nile-switcher.js.map +1 -0
  192. package/dist/src/nile-textarea/nile-textarea.js +2 -0
  193. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  194. package/dist/tsconfig.tsbuildinfo +1 -1
  195. package/package.json +1 -1
  196. package/src/index.ts +2 -1
  197. package/src/nile-button/nile-button.ts +2 -0
  198. package/src/nile-calendar/nile-calendar.ts +6 -0
  199. package/src/nile-checkbox/nile-checkbox.ts +6 -0
  200. package/src/nile-chip/nile-chip.ts +6 -0
  201. package/src/nile-date-picker/nile-date-picker.ts +5 -2
  202. package/src/nile-dropdown/nile-dropdown.ts +2 -0
  203. package/src/nile-icon/icons/svg/index.ts +1 -0
  204. package/src/nile-icon/icons/svg/stringinput.ts +5 -0
  205. package/src/nile-input/nile-input.ts +11 -0
  206. package/src/nile-link/nile-link.ts +2 -0
  207. package/src/nile-radio/nile-radio.ts +2 -0
  208. package/src/nile-radio-group/nile-radio-group.ts +6 -0
  209. package/src/nile-select/nile-select.ts +6 -0
  210. package/src/nile-slide-toggle/nile-slide-toggle.ts +14 -1
  211. package/src/nile-switcher/index.ts +1 -0
  212. package/src/nile-switcher/nile-switcher.css.ts +37 -0
  213. package/src/nile-switcher/nile-switcher.ts +185 -0
  214. package/src/nile-textarea/nile-textarea.ts +2 -0
@@ -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());}}},{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?"__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 }\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","updated","changedProperties","super","has","date","attributeChangedCallback","name","oldValue","newValue","initializeValue","JSON","parse","e","requestUpdate","connectedCallback","getDaysArray","year","month","daysInMonth","Array","from","length","_","i","nextMonth","prevMonth","selectDate","day","selectedDate","emit","dropdown","hide","confimRange","renderMonth","daysArray","firstDay","getDay","lastDay","prevMonthDays","nextMonthDays","fillerDaysBefore","slice","fillerDaysAfter","allDays","isSelectedDate","isCurrentMonth","isStartDate","isEndDate","isInRange","html","_templateObject","_taggedTemplateLiteral","toLocaleString","map","index","_templateObject2","formatDate","concat","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,CAyetC,QAAAC,KAAA,EAngBQC,YAAA,CAAAlB,CAAA,GAAAmB,GAAA,gBAAAC,KAAA,CA6BP,SA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AAS,CAAEC,IAAAA,CAAMC,OAAyBtI,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmI,SAAA,CAAA,OAAA,CAAA,IAAA,EAG3CL,CAAAA,CAAAA,CAAAA,CAAA,CADCY,CAAAA,CAAM,OAuBN1I,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmI,SAAA,CAAA,cAAA,CAAA,IAxDUnI,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAY8H,CAAA,CAAA,CADxBa,CAAc,CAAA,eAAA,CAAA,CAAA,CACF3I"}
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,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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A,IAAA,EAEqBL,CAAAA,CAAAA,CAAAA,CAAA,CAA3BM,CAAAA,CAAS,CAAEC,IAAAA,CAAMG,MAAwC1I,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAqI,SAAA,CAAA,WAAA,CAAA,IAAA,IAC9BL,CAAA,CAAA,CAA3BM,CAAS,CAAA,CAAEC,IAAMG,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAsC1I,CAAAqI,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAC3BL,CAAA,CAAA,CAA5BM,CAAS,CAAA,CAAEC,KAAMC,OAAmCxI,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,4 +1,4 @@
1
- import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{query as s,customElement as e}from"lit/decorators.js";import{s as n}from"./nile-calendar.css.esm.js";import{w as a}from"../internal/watch.esm.js";import{N as h}from"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.esm.js";import{n as l}from"../property-09139d3c.esm.js";import"lit";import"lit/directives/class-map.js";import"../nile-popup/nile-popup.css.esm.js";let r=class extends h{constructor(){super(...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}static get styles(){return[n]}valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){const 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=`${String(i.getDate()).padStart(2,"0")}/${String(i.getMonth()+1).padStart(2,"0")}/${i.getFullYear()}`)}}updated(t){if(super.updated(t),t.has("valueAttribute")){const t=new Date(this.valueAttribute||"");if(!isNaN(t.getTime())){const i=t.getTimezoneOffset();this.value=new Date(t.getTime()-60*i*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear()}}}static get observedAttributes(){return["value","range"]}attributeChangedCallback(t,i,s){"value"===t?(this.valueAttribute=s,this.initializeValue()):"range"===t&&(this.range=null!==s)}initializeValue(){if(this.range)try{const t=JSON.parse(this.valueAttribute||"");this.startDate=new Date(t.startDate),this.endDate=new Date(t.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){let t;t=new Date(this.valueAttribute),t=new Date(t.getTime()-6e4*t.getTimezoneOffset()),isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null)}this.requestUpdate()}connectedCallback(){if(super.connectedCallback(),this.initializeValue(),this.valueAttribute){const t=new Date(this.valueAttribute);isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear())}}getDaysArray(t,i){const s=new Date(t,i+1,0).getDate();return Array.from({length:s},((t,i)=>i+1))}nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate()}prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate()}selectDate(t,i,s){const 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()}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})}renderMonth(t,s,e){const 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),u=[...r,...e,...d],o=(t,i,s,e)=>{if(!e)return"";if(!this.range&&this.value){if(t===this.value.getDate()&&i===this.value.getMonth()&&s===this.value.getFullYear())return"selected-date"}const n=this.startDate&&t===this.startDate.getDate()&&i===this.startDate.getMonth()&&s===this.startDate.getFullYear(),a=this.endDate&&t===this.endDate.getDate()&&i===this.endDate.getMonth()&&s===this.endDate.getFullYear();return n?"range-start":a?"range-end":""},c=(t,i,s,e)=>{if(!e)return!1;if(this.startDate&&this.endDate){const e=new Date(s,i,t);return e>=this.startDate&&e<=this.endDate}return!1};return i`
1
+ import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{query as s,customElement as e}from"lit/decorators.js";import{s as n}from"./nile-calendar.css.esm.js";import{w as a}from"../internal/watch.esm.js";import{N as h}from"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.esm.js";import{n as l}from"../property-09139d3c.esm.js";import"lit";import"lit/directives/class-map.js";import"../nile-popup/nile-popup.css.esm.js";let r=class extends h{constructor(){super(...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}static get styles(){return[n]}valueChanged(){if(this.range&&this.value)return this.rangeValue=this.value,void(this.value=null);if(this.value&&!isNaN(this.value.getTime())){const 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=`${String(i.getDate()).padStart(2,"0")}/${String(i.getMonth()+1).padStart(2,"0")}/${i.getFullYear()}`)}}updated(t){if(super.updated(t),t.has("valueAttribute")){const t=new Date(this.valueAttribute||"");if(!isNaN(t.getTime())){const i=t.getTimezoneOffset();this.value=new Date(t.getTime()-60*i*1e3),this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear()}}}static get observedAttributes(){return["value","range"]}attributeChangedCallback(t,i,s){"value"===t?(this.valueAttribute=s,this.initializeValue()):"range"===t&&(this.range=null!==s)}initializeValue(){if(this.range)try{const t=JSON.parse(this.valueAttribute||"");this.startDate=new Date(t.startDate),this.endDate=new Date(t.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){let t;t=new Date(this.valueAttribute),t=new Date(t.getTime()-6e4*t.getTimezoneOffset()),isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear(),this.rangeValue=null)}this.requestUpdate()}connectedCallback(){if(super.connectedCallback(),this.initializeValue(),this.valueAttribute){const t=new Date(this.valueAttribute);isNaN(t.getTime())||(this.value=t,this.currentMonth=this.value.getMonth(),this.currentYear=this.value.getFullYear())}this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}getDaysArray(t,i){const s=new Date(t,i+1,0).getDate();return Array.from({length:s},((t,i)=>i+1))}nextMonth(){11===this.currentMonth?(this.currentMonth=0,this.currentYear++):this.currentMonth++,this.requestUpdate()}prevMonth(){0===this.currentMonth?(this.currentMonth=11,this.currentYear--):this.currentMonth--,this.requestUpdate()}selectDate(t,i,s){const 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()}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})}renderMonth(t,s,e){const 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),u=[...r,...e,...d],c=(t,i,s,e)=>{if(!e)return"";if(!this.range&&this.value){if(t===this.value.getDate()&&i===this.value.getMonth()&&s===this.value.getFullYear())return"selected-date"}const n=this.startDate&&t===this.startDate.getDate()&&i===this.startDate.getMonth()&&s===this.startDate.getFullYear(),a=this.endDate&&t===this.endDate.getDate()&&i===this.endDate.getMonth()&&s===this.endDate.getFullYear();return n?"range-start":a?"range-end":""},o=(t,i,s,e)=>{if(!e)return!1;if(this.startDate&&this.endDate){const e=new Date(s,i,t);return e>=this.startDate&&e<=this.endDate}return!1};return i`
2
2
  <div class="calendar">
3
3
  <div class="calendar-header">
4
4
  <nile-icon class="calendar-header__month-navigation" name="arrowleft" color="black" @click="${this.prevMonth}">
@@ -21,7 +21,7 @@ import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
21
21
  </div>
22
22
  <div class="days">
23
23
  ${u.map(((n,a)=>{const h=a>=r.length&&a<r.length+e.length;return i` <div
24
- class="day ${o(n,s,t,h)} ${c(n,s,t,h)?"in-range":""} ${h?"":"filler"}"
24
+ class="day ${c(n,s,t,h)} ${o(n,s,t,h)?"in-range":""} ${h?"":"filler"}"
25
25
  @click="${()=>{h&&this.selectDate(n,s,t)}}"
26
26
  >
27
27
  ${n}
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-checkbox.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,s,o,c,l,h,r,n,a,d,m,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,p;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}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){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.state;o=_litDecoratorsJs.customElement;},function(_nileCheckboxCssCjsJs){c=_nileCheckboxCssCjsJs.s;},function(_litDirectivesClassMapJs){l=_litDirectivesClassMapJs.classMap;},function(_internalDefaultValueCjsJs){h=_internalDefaultValueCjsJs.d;},function(_litDirectivesIfDefinedJs){r=_litDirectivesIfDefinedJs.ifDefined;},function(_litDirectivesLiveJs){n=_litDirectivesLiveJs.live;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){d=_internalNileElementCjsJs.N;},function(_property002CjsJs){m=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",p=/*#__PURE__*/function(_d){_inherits(p,_d);var _super=_createSuper(p);function p(){var _this;_classCallCheck(this,p);_this=_super.call(this),_this.hasFocus=!1,_this.title="",_this.name="",_this.size="medium",_this.disabled=!1,_this.checked=!1,_this.label="",_this.indeterminate=!1,_this.defaultChecked=!1,_this.helpText="",_this.showHelpText=!1,_this.errorMessage="",_this.form="",_this.required=!1;return _this;}_createClass(p,[{key:"toggleHelpText",value:function toggleHelpText(){this.showHelpText=!this.showHelpText;}},{key:"handleClick",value:function handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}));}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("blur");}},{key:"handleInput",value:function handleInput(){this.emit("input");}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("focus");}},{key:"handleStateChange",value:function handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate;}},{key:"click",value:function click(){this.input.click();}},{key:"focus",value:function focus(e){this.input.focus(e);}},{key:"blur",value:function blur(){this.input.blur();}},{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(p.prototype),"connectedCallback",this).call(this),this.updateHostClass();}},{key:"updated",value:function updated(e){_get(_getPrototypeOf(p.prototype),"updated",this).call(this,e),e.has("helpText")&&this.updateHostClass();}},{key:"updateHostClass",value:function updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width");}},{key:"render",value:function render(){var e=!!this.helpText,i=!!this.errorMessage;return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <label\n part=\"base\"\n class=","\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=","\n name=","\n value=","\n .indeterminate=","\n .checked=","\n .disabled=","\n .required=","\n aria-checked=","\n @click=","\n @input=","\n @blur=","\n @focus=","\n />\n\n <span\n part=\"control","","\"\n class=\"checkbox__control\"\n >\n ","\n ","\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ","\n <slot></slot>\n </div>\n </label>\n\n ","\n\n ","\n "])),l({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size}),this.title,this.name,r(this.value),n(this.indeterminate),n(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleInput,this.handleBlur,this.handleFocus,this.checked?" control--checked":"",this.indeterminate?" control--indeterminate":"",this.checked?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n "]))):"",!this.checked&&this.indeterminate?t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n "]))):"","boolean"==typeof this.label?"":this.label,e?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-tooltip content=\"","\" placement=\"bottom\">\n <nile-icon\n name=\"question\"\n class=\"checkbox__helptext-icon\"\n ></nile-icon>\n </nile-tooltip>\n "])),this.helpText):"",i?t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);return p;}(d));p.styles=c,e([i('input[type="checkbox"]')],p.prototype,"input",void 0),e([s()],p.prototype,"hasFocus",void 0),e([m()],p.prototype,"title",void 0),e([m()],p.prototype,"name",void 0),e([m()],p.prototype,"value",void 0),e([m({reflect:!0})],p.prototype,"size",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"checked",void 0),e([m({type:String,reflect:!0})],p.prototype,"label",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"indeterminate",void 0),e([h("checked")],p.prototype,"defaultChecked",void 0),e([m({attribute:"help-text"})],p.prototype,"helpText",void 0),e([m({type:Boolean})],p.prototype,"showHelpText",void 0),e([m({attribute:"error-message"})],p.prototype,"errorMessage",void 0),e([m({reflect:!0})],p.prototype,"form",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"required",void 0),e([a(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],p.prototype,"handleStateChange",null),_export("N",p=e([o("nile-checkbox")],p));}};});
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-checkbox.css.cjs.js","lit/directives/class-map.js","../internal/default-value.cjs.js","lit/directives/if-defined.js","lit/directives/live.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var e,t,i,s,o,c,l,h,r,n,a,d,m,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,p;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}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){e=_tslib.__decorate;},function(_index001CjsJs){t=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.state;o=_litDecoratorsJs.customElement;},function(_nileCheckboxCssCjsJs){c=_nileCheckboxCssCjsJs.s;},function(_litDirectivesClassMapJs){l=_litDirectivesClassMapJs.classMap;},function(_internalDefaultValueCjsJs){h=_internalDefaultValueCjsJs.d;},function(_litDirectivesIfDefinedJs){r=_litDirectivesIfDefinedJs.ifDefined;},function(_litDirectivesLiveJs){n=_litDirectivesLiveJs.live;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){d=_internalNileElementCjsJs.N;},function(_property002CjsJs){m=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",p=/*#__PURE__*/function(_d){_inherits(p,_d);var _super=_createSuper(p);function p(){var _this;_classCallCheck(this,p);_this=_super.call(this),_this.hasFocus=!1,_this.title="",_this.name="",_this.size="medium",_this.disabled=!1,_this.checked=!1,_this.label="",_this.indeterminate=!1,_this.defaultChecked=!1,_this.helpText="",_this.showHelpText=!1,_this.errorMessage="",_this.form="",_this.required=!1;return _this;}_createClass(p,[{key:"toggleHelpText",value:function toggleHelpText(){this.showHelpText=!this.showHelpText;}},{key:"handleClick",value:function handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}));}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("blur");}},{key:"handleInput",value:function handleInput(){this.emit("input");}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("focus");}},{key:"handleStateChange",value:function handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate;}},{key:"click",value:function click(){this.input.click();}},{key:"focus",value:function focus(e){this.input.focus(e);}},{key:"blur",value:function blur(){this.input.blur();}},{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(p.prototype),"connectedCallback",this).call(this),this.updateHostClass(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(p.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"updated",value:function updated(e){_get(_getPrototypeOf(p.prototype),"updated",this).call(this,e),e.has("helpText")&&this.updateHostClass();}},{key:"updateHostClass",value:function updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width");}},{key:"render",value:function render(){var e=!!this.helpText,i=!!this.errorMessage;return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <label\n part=\"base\"\n class=","\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=","\n name=","\n value=","\n .indeterminate=","\n .checked=","\n .disabled=","\n .required=","\n aria-checked=","\n @click=","\n @input=","\n @blur=","\n @focus=","\n />\n\n <span\n part=\"control","","\"\n class=\"checkbox__control\"\n >\n ","\n ","\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ","\n <slot></slot>\n </div>\n </label>\n\n ","\n\n ","\n "])),l({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size}),this.title,this.name,r(this.value),n(this.indeterminate),n(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleInput,this.handleBlur,this.handleFocus,this.checked?" control--checked":"",this.indeterminate?" control--indeterminate":"",this.checked?t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n "]))):"",!this.checked&&this.indeterminate?t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n "]))):"","boolean"==typeof this.label?"":this.label,e?t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-tooltip content=\"","\" placement=\"bottom\">\n <nile-icon\n name=\"question\"\n class=\"checkbox__helptext-icon\"\n ></nile-icon>\n </nile-tooltip>\n "])),this.helpText):"",i?t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);return p;}(d));p.styles=c,e([i('input[type="checkbox"]')],p.prototype,"input",void 0),e([s()],p.prototype,"hasFocus",void 0),e([m()],p.prototype,"title",void 0),e([m()],p.prototype,"name",void 0),e([m()],p.prototype,"value",void 0),e([m({reflect:!0})],p.prototype,"size",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"checked",void 0),e([m({type:String,reflect:!0})],p.prototype,"label",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"indeterminate",void 0),e([h("checked")],p.prototype,"defaultChecked",void 0),e([m({attribute:"help-text"})],p.prototype,"helpText",void 0),e([m({type:Boolean})],p.prototype,"showHelpText",void 0),e([m({attribute:"error-message"})],p.prototype,"errorMessage",void 0),e([m({reflect:!0})],p.prototype,"form",void 0),e([m({type:Boolean,reflect:!0})],p.prototype,"required",void 0),e([a(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],p.prototype,"handleStateChange",null),_export("N",p=e([o("nile-checkbox")],p));}};});
2
2
  //# sourceMappingURL=nile-checkbox.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-checkbox.cjs.js","sources":["../../../src/nile-checkbox/nile-checkbox.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-checkbox.css';\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Checkboxes allow the user to toggle an option on or off.\n *\n * @dependency nile-icon\n *\n * @slot - The checkbox's label.\n *\n * @event nile-blur - Emitted when the checkbox loses focus.\n * @event nile-change - Emitted when the checked state changes.\n * @event nile-focus - Emitted when the checkbox gains focus.\n * @event nile-input - Emitted when the checkbox receives input.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @csspart base - The component's base wrapper.\n * @csspart control - The square container that wraps the checkbox's checked state.\n * @csspart control--checked - Matches the control part when the checkbox is checked.\n * @csspart control--indeterminate - Matches the control part when the checkbox is indeterminate.\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart indeterminate-icon - The indeterminate icon, an `<nile-icon>` element.\n * @csspart label - The container that wraps the checkbox's label.\n */\n\n/**\n * Nile icon component.\n *\n * @tag nile-checkbox\n *\n */\n@customElement('nile-checkbox')\nexport class NileCheckbox extends NileElement {\n constructor() {\n super();\n }\n\n static styles: CSSResultGroup = styles;\n\n @query('input[type=\"checkbox\"]') input: HTMLInputElement;\n\n @state() private hasFocus = false;\n\n @property() title = ''; // make reactive to pass through\n\n /** The name of the checkbox, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the checkbox, submitted as a name/value pair with form data. */\n @property() value: boolean;\n\n /** The checkbox's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Disables the checkbox. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Label, declared this property for backward compatibility of old component */\n @property({ type: String, reflect: true }) label = '';\n\n /**\n * Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\n * all/none\" behavior when associated checkboxes have a mix of checked and unchecked states.\n */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue('checked') defaultChecked = false;\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ type: Boolean }) showHelpText = false;\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the checkbox a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n private toggleHelpText() {\n this.showHelpText = !this.showHelpText;\n }\n\n private handleClick() {\n this.checked = !this.checked;\n this.indeterminate = false;\n this.dispatchEvent(\n new CustomEvent('valueChange', {\n composed: true,\n bubbles: true,\n detail: {\n checked: this.checked,\n },\n })\n );\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('blur');\n }\n\n private handleInput() {\n this.emit('input');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('focus');\n }\n\n @watch(['checked', 'indeterminate'], { waitUntilFirstUpdate: true })\n handleStateChange() {\n this.input.checked = this.checked; // force a sync update\n this.input.indeterminate = this.indeterminate; // force a sync update\n }\n\n /** Simulates a click on the checkbox. */\n click() {\n this.input.click();\n }\n\n /** Sets focus on the checkbox. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n blur() {\n this.input.blur();\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.updateHostClass();\n }\n\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('helpText')) {\n this.updateHostClass();\n }\n }\n\n private updateHostClass() {\n if (this.helpText) {\n this.classList.add('full-width');\n } else {\n this.classList.remove('full-width');\n }\n }\n\n render() {\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <label\n part=\"base\"\n class=${classMap({\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--indeterminate': this.indeterminate,\n 'checkbox--medium': this.size === 'medium',\n })}\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=${\n this\n .title /* An empty title prevents browser validation tooltips from appearing on hover */\n }\n name=${this.name}\n value=${ifDefined(this.value)}\n .indeterminate=${live(this.indeterminate)}\n .checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n aria-checked=${this.checked ? 'true' : 'false'}\n @click=${this.handleClick}\n @input=${this.handleInput}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n />\n\n <span\n part=\"control${this.checked ? ' control--checked' : ''}${this\n .indeterminate\n ? ' control--indeterminate'\n : ''}\"\n class=\"checkbox__control\"\n >\n ${this.checked\n ? html`\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n ${!this.checked && this.indeterminate\n ? html`\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ${typeof this.label === 'boolean' ? '' : this.label}\n <slot></slot>\n </div>\n </label>\n\n ${hasHelpText\n ? html`\n <nile-tooltip content=\"${this.helpText}\" placement=\"bottom\">\n <nile-icon\n name=\"question\"\n class=\"checkbox__helptext-icon\"\n ></nile-icon>\n </nile-tooltip>\n `\n : ``}\n\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n `;\n }\n}\n\nexport default NileCheckbox;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-checkbox': NileCheckbox;\n }\n}\n"],"names":["NileCheckbox","_d","_inherits","p","_super","_createSuper","constructor","super","this","hasFocus","title","name","size","disabled","checked","label","indeterminate","defaultChecked","helpText","showHelpText","errorMessage","form","required","_this","_createClass","key","value","toggleHelpText","handleClick","dispatchEvent","CustomEvent","composed","bubbles","detail","handleBlur","emit","handleInput","handleFocus","handleStateChange","input","click","focus","options","blur","connectedCallback","updateHostClass","updated","changedProperties","has","classList","add","remove","render","hasHelpText","hasErrorMessage","html","_templateObject","_taggedTemplateLiteral","classMap","checkbox","ifDefined","live","_templateObject2","_templateObject3","_templateObject4","_templateObject5","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","String","defaultValue","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"g6JAuDaA,CAAN,uBAAAC,EAAA,EAAAC,SAAA,CAAAC,CAAA,CAAAF,EAAA,MAAAG,MAAA,CAAAC,YAAA,CAAAF,CAAA,EACL,SAAAA,EAAA,CAAAG,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,EACEC,KAAAA,C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,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAGKF,EAAA,CAA3CI,CAAAA,CAAS,CAAEE,IAAMC,CAAAA,OAAAA,CAASF,SAAS,CAAyBzE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAsE,SAAA,CAAA,UAAA,CAAA,IAAA,IAmC7DF,CAAA,CAAA,CADCW,EAAM,CAAC,SAAA,CAAW,iBAAkB,CAAEC,oBAAAA,CAAAA,CAAsB,KAI5DhF,CAAAsE,CAAAA,SAAAA,CAAA,oBAAA,IA5FUtE,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAYoE,EAAA,CADxBa,CAAAA,CAAc,kBACFjF"}
1
+ {"version":3,"file":"nile-checkbox.cjs.js","sources":["../../../src/nile-checkbox/nile-checkbox.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-checkbox.css';\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query, state } from 'lit/decorators.js';\nimport { defaultValue } from '../internal/default-value';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Checkboxes allow the user to toggle an option on or off.\n *\n * @dependency nile-icon\n *\n * @slot - The checkbox's label.\n *\n * @event nile-blur - Emitted when the checkbox loses focus.\n * @event nile-change - Emitted when the checked state changes.\n * @event nile-focus - Emitted when the checkbox gains focus.\n * @event nile-input - Emitted when the checkbox receives input.\n * @event nile-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @csspart base - The component's base wrapper.\n * @csspart control - The square container that wraps the checkbox's checked state.\n * @csspart control--checked - Matches the control part when the checkbox is checked.\n * @csspart control--indeterminate - Matches the control part when the checkbox is indeterminate.\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart indeterminate-icon - The indeterminate icon, an `<nile-icon>` element.\n * @csspart label - The container that wraps the checkbox's label.\n */\n\n/**\n * Nile icon component.\n *\n * @tag nile-checkbox\n *\n */\n@customElement('nile-checkbox')\nexport class NileCheckbox extends NileElement {\n constructor() {\n super();\n }\n\n static styles: CSSResultGroup = styles;\n\n @query('input[type=\"checkbox\"]') input: HTMLInputElement;\n\n @state() private hasFocus = false;\n\n @property() title = ''; // make reactive to pass through\n\n /** The name of the checkbox, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the checkbox, submitted as a name/value pair with form data. */\n @property() value: boolean;\n\n /** The checkbox's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Disables the checkbox. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** Label, declared this property for backward compatibility of old component */\n @property({ type: String, reflect: true }) label = '';\n\n /**\n * Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\n * all/none\" behavior when associated checkboxes have a mix of checked and unchecked states.\n */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue('checked') defaultChecked = false;\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ type: Boolean }) showHelpText = false;\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the checkbox a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n private toggleHelpText() {\n this.showHelpText = !this.showHelpText;\n }\n\n private handleClick() {\n this.checked = !this.checked;\n this.indeterminate = false;\n this.dispatchEvent(\n new CustomEvent('valueChange', {\n composed: true,\n bubbles: true,\n detail: {\n checked: this.checked,\n },\n })\n );\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('blur');\n }\n\n private handleInput() {\n this.emit('input');\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('focus');\n }\n\n @watch(['checked', 'indeterminate'], { waitUntilFirstUpdate: true })\n handleStateChange() {\n this.input.checked = this.checked; // force a sync update\n this.input.indeterminate = this.indeterminate; // force a sync update\n }\n\n /** Simulates a click on the checkbox. */\n click() {\n this.input.click();\n }\n\n /** Sets focus on the checkbox. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the checkbox. */\n blur() {\n this.input.blur();\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.updateHostClass();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('helpText')) {\n this.updateHostClass();\n }\n }\n\n private updateHostClass() {\n if (this.helpText) {\n this.classList.add('full-width');\n } else {\n this.classList.remove('full-width');\n }\n }\n\n render() {\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <label\n part=\"base\"\n class=${classMap({\n checkbox: true,\n 'checkbox--checked': this.checked,\n 'checkbox--disabled': this.disabled,\n 'checkbox--focused': this.hasFocus,\n 'checkbox--indeterminate': this.indeterminate,\n 'checkbox--medium': this.size === 'medium',\n })}\n >\n <input\n class=\"checkbox__input\"\n type=\"checkbox\"\n title=${\n this\n .title /* An empty title prevents browser validation tooltips from appearing on hover */\n }\n name=${this.name}\n value=${ifDefined(this.value)}\n .indeterminate=${live(this.indeterminate)}\n .checked=${live(this.checked)}\n .disabled=${this.disabled}\n .required=${this.required}\n aria-checked=${this.checked ? 'true' : 'false'}\n @click=${this.handleClick}\n @input=${this.handleInput}\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n />\n\n <span\n part=\"control${this.checked ? ' control--checked' : ''}${this\n .indeterminate\n ? ' control--indeterminate'\n : ''}\"\n class=\"checkbox__control\"\n >\n ${this.checked\n ? html`\n <nile-icon\n part=\"checked-icon\"\n class=\"checkbox__checked-icon\"\n color=\"white\"\n library=\"system\"\n name=\"tick\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n ${!this.checked && this.indeterminate\n ? html`\n <nile-icon\n part=\"indeterminate-icon\"\n class=\"checkbox__indeterminate-icon\"\n library=\"system\"\n color=\"white\"\n name=\"minus\"\n size=\"12\"\n ></nile-icon>\n `\n : ''}\n </span>\n\n <div part=\"label\" class=\"checkbox__label\">\n ${typeof this.label === 'boolean' ? '' : this.label}\n <slot></slot>\n </div>\n </label>\n\n ${hasHelpText\n ? html`\n <nile-tooltip content=\"${this.helpText}\" placement=\"bottom\">\n <nile-icon\n name=\"question\"\n class=\"checkbox__helptext-icon\"\n ></nile-icon>\n </nile-tooltip>\n `\n : ``}\n\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n `;\n }\n}\n\nexport default NileCheckbox;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-checkbox': NileCheckbox;\n }\n}\n"],"names":["NileCheckbox","p","constructor","super","this","hasFocus","title","name","size","disabled","checked","label","indeterminate","defaultChecked","helpText","showHelpText","errorMessage","form","required","_this","_createClass","key","value","toggleHelpText","handleClick","dispatchEvent","CustomEvent","composed","bubbles","detail","handleBlur","emit","handleInput","handleFocus","handleStateChange","input","click","focus","options","blur","connectedCallback","updateHostClass","disconnectedCallback","updated","changedProperties","has","classList","add","remove","render","hasHelpText","hasErrorMessage","html","_templateObject","_taggedTemplateLiteral","classMap","checkbox","ifDefined","live","_templateObject2","_templateObject3","_templateObject4","_templateObject5","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","String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AA,CAAA,CAAA,CAA6B3E,EAAAmE,SAAA,CAAA,UAAA,CAAA,IAAA,IAEvBF,CAAA,CAAA,CAA5BI,EAAS,CAAEE,IAAAA,CAAMC,WAAgCxE,CAAAmE,CAAAA,SAAAA,CAAA,mBAAA,EAERF,CAAAA,CAAAA,CAAAA,CAAA,CAAzCI,CAAS,CAAA,CAAEM,UAAW,eAAqC3E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmE,SAAA,CAAA,cAAA,CAAA,IAAA,IAO/BF,CAAA,CAAA,CAA5BI,EAAS,CAAEC,OAAAA,CAAAA,CAAS,KAAkBtE,CAAAmE,CAAAA,SAAAA,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAGKF,EAAA,CAA3CI,CAAAA,CAAS,CAAEE,IAAMC,CAAAA,OAAAA,CAASF,SAAS,CAAyBtE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmE,SAAA,CAAA,UAAA,CAAA,IAAA,IAmC7DF,CAAA,CAAA,CADCW,EAAM,CAAC,SAAA,CAAW,iBAAkB,CAAEC,oBAAAA,CAAAA,CAAsB,KAI5D7E,CAAAmE,CAAAA,SAAAA,CAAA,oBAAA,IA5FUnE,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAYiE,EAAA,CADxBa,CAAAA,CAAc,kBACF9E"}
@@ -1,4 +1,4 @@
1
- import{__decorate as e}from"tslib";import{x as t}from"../index-cd2f9c12.esm.js";import{query as i,state as s,customElement as o}from"lit/decorators.js";import{s as l}from"./nile-checkbox.css.esm.js";import{classMap as c}from"lit/directives/class-map.js";import{d as h}from"../internal/default-value.esm.js";import{ifDefined as r}from"lit/directives/if-defined.js";import{live as n}from"lit/directives/live.js";import{w as a}from"../internal/watch.esm.js";import{N as d}from"../internal/nile-element.esm.js";import{n as m}from"../property-09139d3c.esm.js";import"lit";let p=class extends d{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.showHelpText=!1,this.errorMessage="",this.form="",this.required=!1}toggleHelpText(){this.showHelpText=!this.showHelpText}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}))}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}connectedCallback(){super.connectedCallback(),this.updateHostClass()}updated(e){super.updated(e),e.has("helpText")&&this.updateHostClass()}updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width")}render(){const e=!!this.helpText,i=!!this.errorMessage;return t`
1
+ import{__decorate as e}from"tslib";import{x as t}from"../index-cd2f9c12.esm.js";import{query as i,state as s,customElement as o}from"lit/decorators.js";import{s as l}from"./nile-checkbox.css.esm.js";import{classMap as c}from"lit/directives/class-map.js";import{d as h}from"../internal/default-value.esm.js";import{ifDefined as r}from"lit/directives/if-defined.js";import{live as n}from"lit/directives/live.js";import{w as a}from"../internal/watch.esm.js";import{N as d}from"../internal/nile-element.esm.js";import{n as m}from"../property-09139d3c.esm.js";import"lit";let p=class extends d{constructor(){super(),this.hasFocus=!1,this.title="",this.name="",this.size="medium",this.disabled=!1,this.checked=!1,this.label="",this.indeterminate=!1,this.defaultChecked=!1,this.helpText="",this.showHelpText=!1,this.errorMessage="",this.form="",this.required=!1}toggleHelpText(){this.showHelpText=!this.showHelpText}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("valueChange",{composed:!0,bubbles:!0,detail:{checked:this.checked}}))}handleBlur(){this.hasFocus=!1,this.emit("blur")}handleInput(){this.emit("input")}handleFocus(){this.hasFocus=!0,this.emit("focus")}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}connectedCallback(){super.connectedCallback(),this.updateHostClass(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}updated(e){super.updated(e),e.has("helpText")&&this.updateHostClass()}updateHostClass(){this.helpText?this.classList.add("full-width"):this.classList.remove("full-width")}render(){const e=!!this.helpText,i=!!this.errorMessage;return t`
2
2
  <label
3
3
  part="base"
4
4
  class=${c({checkbox:!0,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--medium":"medium"===this.size})}
@@ -1,2 +1,2 @@
1
- System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,s,o,l,h,n,r,a,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,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 _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){e=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){l=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){n=_internalSlotCjsJs.H;},function(_internalWatchCjsJs){r=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_property002CjsJs){p=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",c=/*#__PURE__*/function(_a){_inherits(c,_a);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new n(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.warning=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1,_this.errorIndexes=[],_this.helpText="",_this.errorMessage="";return _this;}_createClass(c,[{key:"onAutoCompleteOptionsChanged",value:function onAutoCompleteOptionsChanged(){var _this2=this;this.filteredAutoCompleteOptions=_toConsumableArray(this.autoCompleteOptions),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}));}},{key:"onValueChanged",value:function onValueChanged(){this.tags=_toConsumableArray(this.value),this.onTagsChanged();}},{key:"onTagsChanged",value:function onTagsChanged(){var _this3=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.tags.includes(t);}));}},{key:"connectedCallback",value:function connectedCallback(){var _this4=this;_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this4.value.includes(t);}));}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(e){return e!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Enter"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}},{key:"render",value:function render(){var _this5=this;var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var i=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n class=","\n >\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=","\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=","\n >\n ","\n </slot>\n </div>\n ","\n\n ","\n </div>\n "])),h({"form-control":!0,"form-control--medium":!0,"form-control--has-label":i,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled}),i?"false":"true",this.label,h({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap}),this.tags.map(function(t,i){return e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n .variant=","\n @nile-remove=","\n removable\n pill\n >\n ","\n </nile-tag>\n "])),h({"nile-chip__tags":!0}),_this5.errorIndexes.includes(i)?"error":"normal",function(){return _this5.handleRemove(t);},t);}),this.filteredAutoCompleteOptions,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,s?"false":"true",this.helpText,s?e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}],[{key:"styles",get:function get(){return[l];}}]);return c;}(a));t([i()],c.prototype,"tags",void 0),t([i()],c.prototype,"inputValue",void 0),t([i()],c.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([p({type:Boolean})],c.prototype,"warning",void 0),t([p({type:Boolean})],c.prototype,"error",void 0),t([p({type:Boolean})],c.prototype,"success",void 0),t([p({type:Boolean})],c.prototype,"noDuplicates",void 0),t([p()],c.prototype,"label",void 0),t([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([p({type:Boolean})],c.prototype,"clearable",void 0),t([p()],c.prototype,"placeholder",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"filteredAutoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"value",void 0),t([p({type:Boolean})],c.prototype,"noWrap",void 0),t([p({type:Array})],c.prototype,"errorIndexes",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([r("autoCompleteOptions")],c.prototype,"onAutoCompleteOptionsChanged",null),t([r("value")],c.prototype,"onValueChanged",null),t([r("tags")],c.prototype,"onTagsChanged",null),_export("N",c=t([o("nile-chip")],c));}};});
1
+ System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var t,e,i,s,o,l,h,n,r,a,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,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 _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){e=_index001CjsJs.x;},function(_litDecoratorsJs){i=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){l=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){n=_internalSlotCjsJs.H;},function(_internalWatchCjsJs){r=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_property002CjsJs){p=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",c=/*#__PURE__*/function(_a){_inherits(c,_a);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new n(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.warning=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1,_this.errorIndexes=[],_this.helpText="",_this.errorMessage="";return _this;}_createClass(c,[{key:"onAutoCompleteOptionsChanged",value:function onAutoCompleteOptionsChanged(){var _this2=this;this.filteredAutoCompleteOptions=_toConsumableArray(this.autoCompleteOptions),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}));}},{key:"onValueChanged",value:function onValueChanged(){this.tags=_toConsumableArray(this.value),this.onTagsChanged();}},{key:"onTagsChanged",value:function onTagsChanged(){var _this3=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.tags.includes(t);}));}},{key:"connectedCallback",value:function connectedCallback(){var _this4=this;_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this4.value.includes(t);})),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(c.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(e){return e!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Enter"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})));}},{key:"handleFocus",value:function handleFocus(){this.isDropdownOpen=!0;}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus();}},{key:"render",value:function render(){var _this5=this;var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var i=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n class=","\n >\n ","\n <div class=\"nile-chip__auto-complete\">\n <nile-auto-complete\n .allMenuItems=","\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n openOnFocus\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n </div>\n <slot\n name=\"help-text\"\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=","\n >\n ","\n </slot>\n </div>\n ","\n\n ","\n </div>\n "])),h({"form-control":!0,"form-control--medium":!0,"form-control--has-label":i,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled}),i?"false":"true",this.label,h({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap}),this.tags.map(function(t,i){return e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n .variant=","\n @nile-remove=","\n removable\n pill\n >\n ","\n </nile-tag>\n "])),h({"nile-chip__tags":!0}),_this5.errorIndexes.includes(i)?"error":"normal",function(){return _this5.handleRemove(t);},t);}),this.filteredAutoCompleteOptions,this.inputValue,this.isDropdownOpen,!0,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect,s?"false":"true",this.helpText,s?e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?e(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}],[{key:"styles",get:function get(){return[l];}}]);return c;}(a));t([i()],c.prototype,"tags",void 0),t([i()],c.prototype,"inputValue",void 0),t([i()],c.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([p({type:Boolean})],c.prototype,"warning",void 0),t([p({type:Boolean})],c.prototype,"error",void 0),t([p({type:Boolean})],c.prototype,"success",void 0),t([p({type:Boolean})],c.prototype,"noDuplicates",void 0),t([p()],c.prototype,"label",void 0),t([p({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([p({type:Boolean})],c.prototype,"clearable",void 0),t([p()],c.prototype,"placeholder",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([p({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([p({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"filteredAutoCompleteOptions",void 0),t([p({type:Array})],c.prototype,"value",void 0),t([p({type:Boolean})],c.prototype,"noWrap",void 0),t([p({type:Array})],c.prototype,"errorIndexes",void 0),t([p({attribute:"help-text"})],c.prototype,"helpText",void 0),t([p({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([r("autoCompleteOptions")],c.prototype,"onAutoCompleteOptionsChanged",null),t([r("value")],c.prototype,"onValueChanged",null),t([r("tags")],c.prototype,"onTagsChanged",null),_export("N",c=t([o("nile-chip")],c));}};});
2
2
  //# sourceMappingURL=nile-chip.cjs.js.map