@aquera/nile-elements 1.5.5 → 1.5.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 (216) hide show
  1. package/README.md +4 -0
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.js +465 -238
  5. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +13 -2
  8. package/dist/nile-button/nile-button.cjs.js +1 -1
  9. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  10. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  11. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  12. package/dist/nile-button/nile-button.css.esm.js +89 -33
  13. package/dist/nile-button/nile-button.esm.js +2 -2
  14. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  15. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  16. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  17. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  18. package/dist/nile-calendar/nile-calendar.css.esm.js +59 -2
  19. package/dist/nile-calendar/nile-calendar.esm.js +16 -10
  20. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  21. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  22. package/dist/nile-checkbox/nile-checkbox.css.esm.js +4 -5
  23. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  24. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  25. package/dist/nile-chip/nile-chip.css.esm.js +37 -23
  26. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  27. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  28. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
  29. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
  30. package/dist/nile-code-editor/nile-code-editor.css.esm.js +7 -6
  31. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  32. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  33. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  34. package/dist/nile-date-picker/nile-date-picker.esm.js +4 -4
  35. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  36. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  37. package/dist/nile-dropdown/nile-dropdown.esm.js +1 -1
  38. package/dist/nile-file-upload/utils/file-validation.util.cjs.js +2 -2
  39. package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
  40. package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
  41. package/dist/nile-filter-chip/nile-filter-chip.cjs.js +1 -1
  42. package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
  43. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
  44. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
  45. package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +24 -2
  46. package/dist/nile-filter-chip/nile-filter-chip.esm.js +2 -2
  47. package/dist/nile-inline-edit/nile-inline-edit.cjs.js +1 -1
  48. package/dist/nile-inline-edit/nile-inline-edit.cjs.js.map +1 -1
  49. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js +1 -1
  50. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js.map +1 -1
  51. package/dist/nile-inline-edit/nile-inline-edit.css.esm.js +15 -6
  52. package/dist/nile-inline-edit/nile-inline-edit.esm.js +2 -2
  53. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  54. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  55. package/dist/nile-input/nile-input.css.esm.js +4 -4
  56. package/dist/nile-link/nile-link.cjs.js +1 -1
  57. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  58. package/dist/nile-link/nile-link.css.cjs.js +1 -1
  59. package/dist/nile-link/nile-link.css.cjs.js.map +1 -1
  60. package/dist/nile-link/nile-link.css.esm.js +3 -4
  61. package/dist/nile-link/nile-link.esm.js +2 -2
  62. package/dist/nile-qr-code/index.cjs.js +2 -0
  63. package/dist/nile-qr-code/index.cjs.js.map +1 -0
  64. package/dist/nile-qr-code/index.esm.js +1 -0
  65. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js +2 -0
  66. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js.map +1 -0
  67. package/dist/nile-qr-code/nile-qr-code-utils.esm.js +1 -0
  68. package/dist/nile-qr-code/nile-qr-code.cjs.js +2 -0
  69. package/dist/nile-qr-code/nile-qr-code.cjs.js.map +1 -0
  70. package/dist/nile-qr-code/nile-qr-code.css.cjs.js +2 -0
  71. package/dist/nile-qr-code/nile-qr-code.css.cjs.js.map +1 -0
  72. package/dist/nile-qr-code/nile-qr-code.css.esm.js +12 -0
  73. package/dist/nile-qr-code/nile-qr-code.esm.js +9 -0
  74. package/dist/nile-radio/nile-radio.css.cjs.js +1 -1
  75. package/dist/nile-radio/nile-radio.css.cjs.js.map +1 -1
  76. package/dist/nile-radio/nile-radio.css.esm.js +1 -1
  77. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
  78. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
  79. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
  80. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
  81. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +25 -6
  82. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
  83. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js +1 -1
  84. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js.map +1 -1
  85. package/dist/nile-rich-text-editor/nile-rte-select.esm.js +4 -3
  86. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  87. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  88. package/dist/nile-select/nile-select.css.esm.js +7 -4
  89. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  90. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  91. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +5 -1
  92. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  93. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  94. package/dist/nile-textarea/nile-textarea.css.esm.js +10 -5
  95. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +1 -1
  96. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -1
  97. package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +5 -3
  98. package/dist/src/index.d.ts +1 -0
  99. package/dist/src/index.js +1 -0
  100. package/dist/src/index.js.map +1 -1
  101. package/dist/src/nile-auto-complete/nile-auto-complete.css.js +11 -0
  102. package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
  103. package/dist/src/nile-button/nile-button.css.js +89 -33
  104. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  105. package/dist/src/nile-button/nile-button.js +5 -5
  106. package/dist/src/nile-button/nile-button.js.map +1 -1
  107. package/dist/src/nile-calendar/nile-calendar.css.js +57 -0
  108. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  109. package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
  110. package/dist/src/nile-calendar/nile-calendar.js +24 -6
  111. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  112. package/dist/src/nile-checkbox/nile-checkbox.css.js +4 -5
  113. package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  114. package/dist/src/nile-chip/nile-chip.css.js +35 -21
  115. package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  116. package/dist/src/nile-code-editor/nile-code-editor.css.js +7 -6
  117. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  118. package/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -1
  119. package/dist/src/nile-code-editor/nile-code-editor.js +7 -1
  120. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  121. package/dist/src/nile-date-picker/nile-date-picker.d.ts +3 -0
  122. package/dist/src/nile-date-picker/nile-date-picker.js +22 -2
  123. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  124. package/dist/src/nile-dropdown/nile-dropdown.d.ts +1 -0
  125. package/dist/src/nile-dropdown/nile-dropdown.js +11 -0
  126. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  127. package/dist/src/nile-file-upload/utils/file-validation.util.js +11 -6
  128. package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
  129. package/dist/src/nile-filter-chip/nile-filter-chip.css.js +22 -0
  130. package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
  131. package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +1 -0
  132. package/dist/src/nile-filter-chip/nile-filter-chip.js +6 -0
  133. package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
  134. package/dist/src/nile-inline-edit/nile-inline-edit.css.js +15 -6
  135. package/dist/src/nile-inline-edit/nile-inline-edit.css.js.map +1 -1
  136. package/dist/src/nile-inline-edit/nile-inline-edit.d.ts +2 -0
  137. package/dist/src/nile-inline-edit/nile-inline-edit.js +7 -0
  138. package/dist/src/nile-inline-edit/nile-inline-edit.js.map +1 -1
  139. package/dist/src/nile-input/nile-input.css.js +4 -4
  140. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  141. package/dist/src/nile-link/nile-link.css.js +1 -2
  142. package/dist/src/nile-link/nile-link.css.js.map +1 -1
  143. package/dist/src/nile-link/nile-link.js +1 -0
  144. package/dist/src/nile-link/nile-link.js.map +1 -1
  145. package/dist/src/nile-qr-code/index.d.ts +1 -0
  146. package/dist/src/nile-qr-code/index.js +2 -0
  147. package/dist/src/nile-qr-code/index.js.map +1 -0
  148. package/dist/src/nile-qr-code/nile-qr-code-utils.d.ts +15 -0
  149. package/dist/src/nile-qr-code/nile-qr-code-utils.js +678 -0
  150. package/dist/src/nile-qr-code/nile-qr-code-utils.js.map +1 -0
  151. package/dist/src/nile-qr-code/nile-qr-code.css.d.ts +12 -0
  152. package/dist/src/nile-qr-code/nile-qr-code.css.js +24 -0
  153. package/dist/src/nile-qr-code/nile-qr-code.css.js.map +1 -0
  154. package/dist/src/nile-qr-code/nile-qr-code.d.ts +127 -0
  155. package/dist/src/nile-qr-code/nile-qr-code.js +381 -0
  156. package/dist/src/nile-qr-code/nile-qr-code.js.map +1 -0
  157. package/dist/src/nile-qr-code/nile-qr-code.test.d.ts +1 -0
  158. package/dist/src/nile-qr-code/nile-qr-code.test.js +719 -0
  159. package/dist/src/nile-qr-code/nile-qr-code.test.js.map +1 -0
  160. package/dist/src/nile-radio/nile-radio.css.js +1 -1
  161. package/dist/src/nile-radio/nile-radio.css.js.map +1 -1
  162. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +25 -6
  163. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
  164. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +1 -0
  165. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +17 -6
  166. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
  167. package/dist/src/nile-rich-text-editor/nile-rte-select.d.ts +1 -0
  168. package/dist/src/nile-rich-text-editor/nile-rte-select.js +7 -2
  169. package/dist/src/nile-rich-text-editor/nile-rte-select.js.map +1 -1
  170. package/dist/src/nile-select/nile-select.css.js +7 -4
  171. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  172. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +5 -1
  173. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  174. package/dist/src/nile-textarea/nile-textarea.css.js +10 -5
  175. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  176. package/dist/src/nile-virtual-select/nile-virtual-select.css.js +5 -3
  177. package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -1
  178. package/dist/src/version.js +1 -1
  179. package/dist/src/version.js.map +1 -1
  180. package/dist/tsconfig.tsbuildinfo +1 -1
  181. package/package.json +3 -2
  182. package/src/index.ts +2 -1
  183. package/src/nile-auto-complete/nile-auto-complete.css.ts +11 -0
  184. package/src/nile-button/nile-button.css.ts +89 -33
  185. package/src/nile-button/nile-button.ts +6 -5
  186. package/src/nile-calendar/nile-calendar.css.ts +57 -0
  187. package/src/nile-calendar/nile-calendar.ts +17 -6
  188. package/src/nile-checkbox/nile-checkbox.css.ts +4 -5
  189. package/src/nile-chip/nile-chip.css.ts +35 -21
  190. package/src/nile-code-editor/nile-code-editor.css.ts +7 -6
  191. package/src/nile-code-editor/nile-code-editor.ts +7 -1
  192. package/src/nile-date-picker/nile-date-picker.ts +22 -2
  193. package/src/nile-dropdown/nile-dropdown.ts +11 -0
  194. package/src/nile-file-upload/utils/file-validation.util.ts +10 -5
  195. package/src/nile-filter-chip/nile-filter-chip.css.ts +22 -0
  196. package/src/nile-filter-chip/nile-filter-chip.ts +2 -0
  197. package/src/nile-inline-edit/nile-inline-edit.css.ts +15 -6
  198. package/src/nile-inline-edit/nile-inline-edit.ts +4 -0
  199. package/src/nile-input/nile-input.css.ts +4 -4
  200. package/src/nile-link/nile-link.css.ts +1 -2
  201. package/src/nile-link/nile-link.ts +1 -0
  202. package/src/nile-qr-code/index.ts +1 -0
  203. package/src/nile-qr-code/nile-qr-code-utils.ts +733 -0
  204. package/src/nile-qr-code/nile-qr-code.css.ts +26 -0
  205. package/src/nile-qr-code/nile-qr-code.test.ts +879 -0
  206. package/src/nile-qr-code/nile-qr-code.ts +431 -0
  207. package/src/nile-radio/nile-radio.css.ts +1 -1
  208. package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +25 -6
  209. package/src/nile-rich-text-editor/nile-rich-text-editor.ts +14 -6
  210. package/src/nile-rich-text-editor/nile-rte-select.ts +5 -2
  211. package/src/nile-select/nile-select.css.ts +7 -4
  212. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +5 -1
  213. package/src/nile-textarea/nile-textarea.css.ts +10 -5
  214. package/src/nile-virtual-select/nile-virtual-select.css.ts +5 -3
  215. package/vscode-html-custom-data.json +108 -6
  216. package/web-test-runner.config.mjs +1 -1
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,r;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;}],execute:function execute(){_export("s",r=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n *{\n box-sizing:border-box;\n }\n\n :host {\n display: block;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .code__editor__container {\n display: flex;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n position: relative;\n }\n\n .no-scroller .cm-scroller{\n scrollbar-width: none;\n }\n\n .error {\n border-color: var(--nile-colors-red-500, var(--ng-componentcolors-utility-error-600));\n }\n\n .disabled {\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .disabled .cm-editor {\n cursor: not-allowed;\n }\n\n .noborder {\n border: none;\n }\n\n .cm-editor {\n flex: 1;\n min-width: 0;\n }\n\n .\u037C1.cm-focused {\n outline: none;\n }\n\n .cm-gutters{\n border-top-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n border-bottom-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n }\n\n .expand__icon__container{\n display: none;\n position: absolute;\n border-radius: var(--nile-radius-base-standard, var(--ng-radius-none));\n cursor: pointer;\n right: var(--nile-spacing-none, var(--ng-spacing-1-5));\n top: 5px;\n z-index: 1;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n }\n \n .code__editor__container:hover > .expand__icon__container{\n display: flex;\n }\n\n .code__editor__container.disabled .expand__icon__container{\n display: none;\n }\n"]))));}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var o,_templateObject,r;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){o=_lit.css;}],execute:function execute(){_export("s",r=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n *{\n box-sizing:border-box;\n }\n\n :host {\n display: block;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .code__editor__container {\n display: flex;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n position: relative;\n }\n\n .no-scroller .cm-scroller{\n scrollbar-width: none;\n }\n\n .error {\n border-color: var(--nile-colors-red-500, var(--ng-componentcolors-utility-error-600));\n }\n\n .disabled {\n background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n cursor: not-allowed;\n opacity: var(--nile-opacity-50, var(--ng-opacity-50));\n}\n\n .disabled .cm-editor {\n cursor: not-allowed;\n }\n\n .noborder {\n border: none;\n }\n\n .cm-editor {\n flex: 1;\n min-width: 0;\n }\n\n .\u037C1.cm-focused {\n outline: none;\n }\n\n .cm-gutters{\n border-top-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n border-bottom-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n }\n\n .expand__icon__container{\n display: none;\n position: absolute;\n border-radius: var(--nile-radius-base-standard, var(--ng-radius-none));\n cursor: pointer;\n right: var(--nile-spacing-none, var(--ng-spacing-1-5));\n top: 5px;\n z-index: 1;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n }\n \n .code__editor__container:hover > .expand__icon__container{\n display: flex;\n }\n\n .code__editor__container.disabled .expand__icon__container{\n display: none;\n }\n"]))));}};});
2
2
  //# sourceMappingURL=nile-code-editor.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-code-editor.css.cjs.js","sources":["../../../src/nile-code-editor/nile-code-editor.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * CodeEditor CSS\n */\nexport const styles = css`\n *{\n box-sizing:border-box;\n }\n\n :host {\n display: block;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .code__editor__container {\n display: flex;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n position: relative;\n }\n\n .no-scroller .cm-scroller{\n scrollbar-width: none;\n }\n\n .error {\n border-color: var(--nile-colors-red-500, var(--ng-componentcolors-utility-error-600));\n }\n\n .disabled {\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .disabled .cm-editor {\n cursor: not-allowed;\n }\n\n .noborder {\n border: none;\n }\n\n .cm-editor {\n flex: 1;\n min-width: 0;\n }\n\n .ͼ1.cm-focused {\n outline: none;\n }\n\n .cm-gutters{\n border-top-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n border-bottom-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n }\n\n .expand__icon__container{\n display: none;\n position: absolute;\n border-radius: var(--nile-radius-base-standard, var(--ng-radius-none));\n cursor: pointer;\n right: var(--nile-spacing-none, var(--ng-spacing-1-5));\n top: 5px;\n z-index: 1;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n }\n \n .code__editor__container:hover > .expand__icon__container{\n display: flex;\n }\n\n .code__editor__container.disabled .expand__icon__container{\n display: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
1
+ {"version":3,"file":"nile-code-editor.css.cjs.js","sources":["../../../src/nile-code-editor/nile-code-editor.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * CodeEditor CSS\n */\nexport const styles = css`\n *{\n box-sizing:border-box;\n }\n\n :host {\n display: block;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n }\n\n .code__editor__container {\n display: flex;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n border: 1px solid var(--nile-colors-neutral-500, var(--ng-colors-border-secondary));\n position: relative;\n }\n\n .no-scroller .cm-scroller{\n scrollbar-width: none;\n }\n\n .error {\n border-color: var(--nile-colors-red-500, var(--ng-componentcolors-utility-error-600));\n }\n\n .disabled {\n background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));\n cursor: not-allowed;\n opacity: var(--nile-opacity-50, var(--ng-opacity-50));\n}\n\n .disabled .cm-editor {\n cursor: not-allowed;\n }\n\n .noborder {\n border: none;\n }\n\n .cm-editor {\n flex: 1;\n min-width: 0;\n }\n\n .ͼ1.cm-focused {\n outline: none;\n }\n\n .cm-gutters{\n border-top-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n border-bottom-left-radius:var(--nile-spacing-spacing-none, var(--ng-radius-md));\n }\n\n .expand__icon__container{\n display: none;\n position: absolute;\n border-radius: var(--nile-radius-base-standard, var(--ng-radius-none));\n cursor: pointer;\n right: var(--nile-spacing-none, var(--ng-spacing-1-5));\n top: 5px;\n z-index: 1;\n padding: var(--nile-spacing-5px, var(--ng-spacing-none));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n }\n \n .code__editor__container:hover > .expand__icon__container{\n display: flex;\n }\n\n .code__editor__container.disabled .expand__icon__container{\n display: none;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -27,11 +27,12 @@ import{css as o}from"lit";const r=o`
27
27
  }
28
28
 
29
29
  .disabled {
30
- background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle));
31
- border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));
32
- cursor: not-allowed;
33
- opacity: 0.5;
34
- }
30
+ background-color: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle));
31
+ border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled));
32
+ color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled));
33
+ cursor: not-allowed;
34
+ opacity: var(--nile-opacity-50, var(--ng-opacity-50));
35
+ }
35
36
 
36
37
  .disabled .cm-editor {
37
38
  cursor: not-allowed;
@@ -65,7 +66,7 @@ import{css as o}from"lit";const r=o`
65
66
  z-index: 1;
66
67
  padding: var(--nile-spacing-5px, var(--ng-spacing-none));
67
68
  background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
68
- }
69
+ }
69
70
 
70
71
  .code__editor__container:hover > .expand__icon__container{
71
72
  display: flex;
@@ -16,4 +16,4 @@ import{__decorate as O}from"tslib";import{html as e}from"lit";import{query as t,
16
16
  <nile-form-error-message
17
17
  >${this.errorMessage}</nile-form-error-message
18
18
  >
19
- `:""}`}createNewView(O=!0){this.view&&this.view.destroy(),this.createState(),this.view=new y({state:this.viewState,parent:this.codeEditor}),this.view.dom.addEventListener("keydown",(O=>{this.checkForSpaceKey(O),this.handleEscapeKey(O)}),!0),O&&this.emit("nile-after-update",{createNewView:this.createNewView,codeMirrorInstance:this.view},!1)}checkForSpaceKey(O){"Space"!==O.code||O.ctrlKey?this.isSpacePressed=!1:this.isSpacePressed=!0}closeCompletion(){this.view&&U(this.view)}handleEscapeKey(O){"Escape"===O.key&&this.view&&null!==G(this.view.state)&&(O.stopPropagation(),O.preventDefault(),U(this.view))}createState(){const O=this.lineNumbersComp.of(this.getLineNumbersExension()),e=this.readOnlyComp.of(this.getReadOnlyExtension()),t=this.restrictSingleLineComp.of(this.getSingleLineExtension()),i=this.placeholderComp.of(this.getPlaceholderExtension()),a=this.themeComp.of(this.getCustomThemeExtension()),r=this.defaultSyntaxHighlightingComp.of(this.getDefaultSyntaxHighlightingExtension()),l=this.autoCompleteStyleComp.of(this.getAutoCompleteStyleExtension()),s=this.getLanguageExtension(),n=this.customCompletionComp.of(IO.data.of({autocomplete:this.customAutocomplete}));return this.viewState=z.create({doc:this.multiline?this.value:Ti(this.value),extensions:[E({highlightActiveLine:!1,foldGutter:this.enableFoldGutters,enableSearch:this.enableSearch}),O,e,t,n,i,r,this.autoCompletionComp.of(W({aboveCursor:this.aboveCursor})),s,a,l,this.getTabCompletionKeymap(),y.updateListener.of((O=>{O.docChanged&&(this.debounce?this.emitAfterTimeout({value:this.view.state.doc.toString()}):this.emit("nile-change",{value:this.view.state.doc.toString()}))})),y.domEventHandlers({focus:()=>this.dispatchEvent(new Event("nile-focus")),blur:()=>this.dispatchEvent(new Event("nile-blur"))})]}),this.viewState}getNestedSuggestions(O,e,t){if(!function(O){return/^([a-zA-Z_$][\w$]*)(\.[a-zA-Z_$][\w$]*|\[\s*(['"]?[a-zA-Z0-9_$]*['"]?)\s*\])*([\.\[])?$/.test(O)}(e)||![".","["].includes(e.at(-1)))return null;const i=function(O){const e=/([a-zA-Z_$][\w$]*)(\[(?:[^\]]+)\]|\.[a-zA-Z_$][\w$]*)*/g,t=[...O.matchAll(e)];if(t.length>0){const e=[t[0][1]],i=O.match(/\[(.*?)\]|\.(\w+)/g)||[];for(const O of i)O.startsWith("[")?e.push(O.slice(1,-1).replace(/['"]/g,"")):O.startsWith(".")&&e.push(O.slice(1));return e}return null}(e);if(!i)return null;const a=t.replace(/["'\[]/g,""),r=a!==t,l="["===e.at(-1);if("."===e.at(-1)&&r)return null;let s=(n=this.customAutoCompletions,i.reduce(((O,e)=>O&&"object"==typeof O?O[e]:null),n));var n;return s&&"object"==typeof s?(a&&(s=Object.fromEntries(Object.entries(s).filter((([O])=>O.toLowerCase().startsWith(a.toLowerCase()))))),{from:O.pos-a.length,options:Object.keys(s).map((O=>({label:O,type:"property",info:`Key of ${i[i.length-1]}`,apply:this.allowVariableInCustomSuggestion||!l||r?O:`'${O}'`,boost:999})))}):null}getTopLevelSuggestions(O,e){const t=e.match(/([a-zA-Z_$][\w$]*)$/);if(!t){if(""===e.trim()&&!this.isSpacePressed){const e=Object.keys(this.customAutoCompletions).filter((O=>Object.keys(this.customAutoCompletions[O]).length)).map((O=>({label:O,type:"property",apply:O,boost:999})));return this.customCompletionsPaths.length&&this.customCompletionsPaths.forEach((O=>{e.push({label:""+O,type:"property",apply:""+O,boost:998})})),{from:O.pos,options:e}}return null}const i=Object.keys(this.customAutoCompletions).filter((O=>Object.keys(this.customAutoCompletions[O]).length&&O.toLowerCase().startsWith(e.toLowerCase()))).map((O=>({label:O,type:"property",apply:O,boost:999})));return this.customCompletionsPaths.length&&this.customCompletionsPaths.filter((O=>O.toLocaleLowerCase().includes(e.toLocaleLowerCase()))).forEach((O=>{i.push({label:""+O,type:"property",apply:""+O,boost:998})})),{from:O.pos-t[1].length,options:i}}emitAfterTimeout(O){this.timeOut&&clearTimeout(this.timeOut),this.timeOut=setTimeout((()=>this.emit("nile-change",O,!1)),this.debounceTimeout)}focusAtPosition(O=this.view.state.doc.toString().length){this.view&&(this.view.dispatch({selection:{anchor:O}}),this.view.focus())}singleLineMultiLineToggle(){this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.multiline?this.value:Ti(this.value)}})}getLineNumbersExension(){return!this.multiline&&this.lineNumbers||this.multiline&&this.lineNumbersMultiline?M():[]}getLanguageExtension(){switch(this.language){case"sql":return function(O={}){let e=O.dialect||Ve;return new m(e.language,[je(O),Ye(e,!!O.upperCaseKeywords)])}();case"json":return new m(Ge);case"html":return function(O={}){let e,t="";!1===O.matchClosingTags&&(t="noMatch"),!0===O.selfClosingTags&&(t=(t?t+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(e=ht((O.nestedLanguages||[]).concat(xi),(O.nestedAttributes||[]).concat(ki)));let i=e?vi.configure({wrap:e,dialect:t}):t?qi.configure({dialect:t}):qi;return new m(i,[qi.data.of({autocomplete:yi(O)}),!1!==O.autoCloseTags?Ri:[],ii().support,new m(Wt,Wt.data.of({autocomplete:Vt})).support])}();default:return function(O={}){let e=O.jsx?O.typescript?FO:KO:O.typescript?NO:IO,t=O.typescript?UO.concat(ee):WO.concat(Oe);return new m(e,[IO.data.of({autocomplete:g(BO,X(t))}),IO.data.of({autocomplete:DO}),O.jsx?ae:[]])}()}}getReadOnlyExtension(){return this.readonly||this.disabled?z.readOnly.of(!0):[]}getSingleLineExtension(){return this.multiline?[]:z.transactionFilter.of((O=>O.newDoc.lines>1?[]:O))}getPlaceholderExtension(){return this.placeholder?C(this.placeholder):[]}getDefaultSyntaxHighlightingExtension(){return this.disableSyntaxHighlighting?[]:A(B,{fallback:!0})}getCustomThemeExtension(){return this.customThemeCSS?this.defaultFont?[y.theme(this.customThemeCSS),y.theme(J),y.theme(N)]:[y.theme(this.customThemeCSS),y.theme(J)]:this.defaultFont?[y.theme(J),y.theme(N)]:[y.theme(J)]}getAutoCompleteStyleExtension(O){if(this.autoCompleteStyle?.width){const e=(O||(this.codeEditor?this.codeEditor.getBoundingClientRect().width:300))*parseFloat(this.autoCompleteStyle.width.replace("%",""))/100,t=this.autoCompleteStyle.multiline?{overflow:"visible",textOverflow:"unset",whiteSpace:"normal",wordWrap:"break-word"}:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return[L({position:"fixed",tooltipSpace:()=>{const O=this.codeEditor.getBoundingClientRect();return{left:O.left,top:0,right:O.right,bottom:1e3}}}),y.theme({".cm-tooltip.cm-tooltip-autocomplete":{maxWidth:e-15+"px !important"},".cm-tooltip.cm-tooltip-autocomplete > ul > li":{...t,maxWidth:"100%"},".cm-tooltip.cm-tooltip-autocomplete > ul":{minWidth:"unset !important"}})]}return[]}updateAutocompleteWidth(O){this.view&&this.view.dispatch({effects:this.autoCompleteStyleComp.reconfigure(this.getAutoCompleteStyleExtension(O))})}restrictSingleLine(){return z.transactionFilter.of((O=>O.newDoc.lines>1?[]:O))}};function Ti(O){return O?O.replace(/\s+/g," ").trim():""}O([t(".code__editor__container")],Yi.prototype,"codeEditor",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"value",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"expandIcon",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"placeholder",void 0),O([i({type:Object,reflect:!0,attribute:!0})],Yi.prototype,"customAutoCompletions",void 0),O([i({type:Array,reflect:!0,attribute:!0})],Yi.prototype,"customCompletionsPaths",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"language",void 0),O([i({type:String,reflect:!0,attribute:"error-message"})],Yi.prototype,"errorMessage",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"error",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"enableSearch",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"noborder",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"multiline",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"enableFoldGutters",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"allowVariableInCustomSuggestion",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"lineNumbers",void 0),O([i({type:Boolean,reflect:!0,attribute:!1})],Yi.prototype,"disableSyntaxHighlighting",void 0),O([i({type:Object,attribute:!1})],Yi.prototype,"customThemeCSS",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"lineNumbersMultiline",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"hasScroller",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"expandable",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"readonly",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"disabled",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"debounce",void 0),O([i({type:Number,reflect:!0,attribute:!0})],Yi.prototype,"debounceTimeout",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"aboveCursor",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"tabCompletion",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"defaultFont",void 0),O([i({type:Object,attribute:!1})],Yi.prototype,"autoCompleteStyle",void 0),Yi=O([a("nile-code-editor")],Yi);export{Yi as N};
19
+ `:""}`}createNewView(O=!0){this.view&&this.view.destroy(),this.createState(),this.view=new y({state:this.viewState,parent:this.codeEditor}),this.view.dom.addEventListener("keydown",(O=>{this.checkForSpaceKey(O),this.handleEscapeKey(O)}),!0),O&&this.emit("nile-after-update",{createNewView:this.createNewView,codeMirrorInstance:this.view},!1)}checkForSpaceKey(O){"Space"!==O.code||O.ctrlKey?this.isSpacePressed=!1:this.isSpacePressed=!0}closeCompletion(){this.view&&U(this.view)}handleEscapeKey(O){"Escape"===O.key&&this.view&&null!==G(this.view.state)&&(O.stopPropagation(),O.preventDefault(),U(this.view))}createState(){const O=this.lineNumbersComp.of(this.getLineNumbersExension()),e=this.readOnlyComp.of(this.getReadOnlyExtension()),t=this.restrictSingleLineComp.of(this.getSingleLineExtension()),i=this.placeholderComp.of(this.getPlaceholderExtension()),a=this.themeComp.of(this.getCustomThemeExtension()),r=this.defaultSyntaxHighlightingComp.of(this.getDefaultSyntaxHighlightingExtension()),l=this.autoCompleteStyleComp.of(this.getAutoCompleteStyleExtension()),s=this.getLanguageExtension(),n=this.customCompletionComp.of(IO.data.of({autocomplete:this.customAutocomplete}));return this.viewState=z.create({doc:this.multiline?this.value:Ti(this.value),extensions:[E({highlightActiveLine:!1,foldGutter:this.enableFoldGutters,enableSearch:this.enableSearch}),O,e,t,n,i,r,this.autoCompletionComp.of(W({aboveCursor:this.aboveCursor})),s,a,l,this.getTabCompletionKeymap(),y.updateListener.of((O=>{O.docChanged&&(this.debounce?this.emitAfterTimeout({value:this.view.state.doc.toString()}):this.emit("nile-change",{value:this.view.state.doc.toString()}))})),y.domEventHandlers({focus:()=>this.dispatchEvent(new Event("nile-focus")),blur:()=>this.dispatchEvent(new Event("nile-blur"))})]}),this.viewState}getNestedSuggestions(O,e,t){if(!function(O){return/^([a-zA-Z_$][\w$]*)(\.[a-zA-Z_$][\w$]*|\[\s*(['"]?[a-zA-Z0-9_$]*['"]?)\s*\])*([\.\[])?$/.test(O)}(e)||![".","["].includes(e.at(-1)))return null;const i=function(O){const e=/([a-zA-Z_$][\w$]*)(\[(?:[^\]]+)\]|\.[a-zA-Z_$][\w$]*)*/g,t=[...O.matchAll(e)];if(t.length>0){const e=[t[0][1]],i=O.match(/\[(.*?)\]|\.(\w+)/g)||[];for(const O of i)O.startsWith("[")?e.push(O.slice(1,-1).replace(/['"]/g,"")):O.startsWith(".")&&e.push(O.slice(1));return e}return null}(e);if(!i)return null;const a=t.replace(/["'\[]/g,""),r=a!==t,l="["===e.at(-1);if("."===e.at(-1)&&r)return null;let s=(n=this.customAutoCompletions,i.reduce(((O,e)=>O&&"object"==typeof O?O[e]:null),n));var n;return s&&"object"==typeof s?(a&&(s=Object.fromEntries(Object.entries(s).filter((([O])=>O.toLowerCase().startsWith(a.toLowerCase()))))),{from:O.pos-a.length,options:Object.keys(s).map((O=>({label:O,type:"property",info:`Key of ${i[i.length-1]}`,apply:this.allowVariableInCustomSuggestion||!l||r?O:`'${O}'`,boost:999})))}):null}getTopLevelSuggestions(O,e){const t=e.match(/([a-zA-Z_$][\w$]*)$/);if(!t){if(""===e.trim()&&!this.isSpacePressed){const e=Object.keys(this.customAutoCompletions).filter((O=>Object.keys(this.customAutoCompletions[O]).length)).map((O=>({label:O,type:"property",apply:O,boost:999})));return this.customCompletionsPaths.length&&this.customCompletionsPaths.forEach((O=>{e.push({label:""+O,type:"property",apply:""+O,boost:998})})),{from:O.pos,options:e}}return null}const i=Object.keys(this.customAutoCompletions).filter((O=>Object.keys(this.customAutoCompletions[O]).length&&O.toLowerCase().startsWith(e.toLowerCase()))).map((O=>({label:O,type:"property",apply:O,boost:999})));return this.customCompletionsPaths.length&&this.customCompletionsPaths.filter((O=>O.toLocaleLowerCase().includes(e.toLocaleLowerCase()))).forEach((O=>{i.push({label:""+O,type:"property",apply:""+O,boost:998})})),{from:O.pos-t[1].length,options:i}}emitAfterTimeout(O){this.timeOut&&clearTimeout(this.timeOut),this.timeOut=setTimeout((()=>this.emit("nile-change",O,!1)),this.debounceTimeout)}focusAtPosition(O=this.view.state.doc.toString().length){this.view&&(this.view.dispatch({selection:{anchor:O}}),this.view.focus())}singleLineMultiLineToggle(){this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:this.multiline?this.value:Ti(this.value)}})}getLineNumbersExension(){return!this.multiline&&this.lineNumbers||this.multiline&&this.lineNumbersMultiline?M():[]}getLanguageExtension(){switch(this.language){case"sql":return function(O={}){let e=O.dialect||Ve;return new m(e.language,[je(O),Ye(e,!!O.upperCaseKeywords)])}();case"json":return new m(Ge);case"html":return function(O={}){let e,t="";!1===O.matchClosingTags&&(t="noMatch"),!0===O.selfClosingTags&&(t=(t?t+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(e=ht((O.nestedLanguages||[]).concat(xi),(O.nestedAttributes||[]).concat(ki)));let i=e?vi.configure({wrap:e,dialect:t}):t?qi.configure({dialect:t}):qi;return new m(i,[qi.data.of({autocomplete:yi(O)}),!1!==O.autoCloseTags?Ri:[],ii().support,new m(Wt,Wt.data.of({autocomplete:Vt})).support])}();default:return function(O={}){let e=O.jsx?O.typescript?FO:KO:O.typescript?NO:IO,t=O.typescript?UO.concat(ee):WO.concat(Oe);return new m(e,[IO.data.of({autocomplete:g(BO,X(t))}),IO.data.of({autocomplete:DO}),O.jsx?ae:[]])}()}}getReadOnlyExtension(){return this.readonly||this.disabled?[z.readOnly.of(!0),y.editable.of(!1)]:[]}getSingleLineExtension(){return this.multiline?[]:z.transactionFilter.of((O=>O.newDoc.lines>1?[]:O))}getPlaceholderExtension(){return this.placeholder?C(this.placeholder):[]}getDefaultSyntaxHighlightingExtension(){return this.disableSyntaxHighlighting?[]:A(B,{fallback:!0})}getCustomThemeExtension(){return this.customThemeCSS?this.defaultFont?[y.theme(this.customThemeCSS),y.theme(J),y.theme(N)]:[y.theme(this.customThemeCSS),y.theme(J)]:this.defaultFont?[y.theme(J),y.theme(N)]:[y.theme(J)]}getAutoCompleteStyleExtension(O){if(this.autoCompleteStyle?.width){const e=(O||(this.codeEditor?this.codeEditor.getBoundingClientRect().width:300))*parseFloat(this.autoCompleteStyle.width.replace("%",""))/100,t=this.autoCompleteStyle.multiline?{overflow:"visible",textOverflow:"unset",whiteSpace:"normal",wordWrap:"break-word"}:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return[L({position:"fixed",tooltipSpace:()=>{const O=this.codeEditor.getBoundingClientRect();return{left:O.left,top:0,right:O.right,bottom:1e3}}}),y.theme({".cm-tooltip.cm-tooltip-autocomplete":{maxWidth:e-15+"px !important"},".cm-tooltip.cm-tooltip-autocomplete > ul > li":{...t,maxWidth:"100%"},".cm-tooltip.cm-tooltip-autocomplete > ul":{minWidth:"unset !important"}})]}return[]}updateAutocompleteWidth(O){this.view&&this.view.dispatch({effects:this.autoCompleteStyleComp.reconfigure(this.getAutoCompleteStyleExtension(O))})}restrictSingleLine(){return z.transactionFilter.of((O=>O.newDoc.lines>1?[]:O))}};function Ti(O){return O?O.replace(/\s+/g," ").trim():""}O([t(".code__editor__container")],Yi.prototype,"codeEditor",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"value",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"expandIcon",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"placeholder",void 0),O([i({type:Object,reflect:!0,attribute:!0})],Yi.prototype,"customAutoCompletions",void 0),O([i({type:Array,reflect:!0,attribute:!0})],Yi.prototype,"customCompletionsPaths",void 0),O([i({type:String,reflect:!0,attribute:!0})],Yi.prototype,"language",void 0),O([i({type:String,reflect:!0,attribute:"error-message"})],Yi.prototype,"errorMessage",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"error",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"enableSearch",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"noborder",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"multiline",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"enableFoldGutters",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"allowVariableInCustomSuggestion",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"lineNumbers",void 0),O([i({type:Boolean,reflect:!0,attribute:!1})],Yi.prototype,"disableSyntaxHighlighting",void 0),O([i({type:Object,attribute:!1})],Yi.prototype,"customThemeCSS",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"lineNumbersMultiline",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"hasScroller",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"expandable",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"readonly",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"disabled",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"debounce",void 0),O([i({type:Number,reflect:!0,attribute:!0})],Yi.prototype,"debounceTimeout",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"aboveCursor",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"tabCompletion",void 0),O([i({type:Boolean,reflect:!0,attribute:!0})],Yi.prototype,"defaultFont",void 0),O([i({type:Object,attribute:!1})],Yi.prototype,"autoCompleteStyle",void 0),Yi=O([a("nile-code-editor")],Yi);export{Yi as N};
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-date-picker.css.cjs.js","../internal/nile-element.cjs.js","./nile-date-picker-utils.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,n,o,a,r,l,h,_templateObject,d;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.html;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;s=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_nileDatePickerCssCjsJs){o=_nileDatePickerCssCjsJs.s;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_nileDatePickerUtilsCjsJs){r=_nileDatePickerUtilsCjsJs.p;l=_nileDatePickerUtilsCjsJs.n;h=_nileDatePickerUtilsCjsJs.f;}],execute:function execute(){_export("N",d=/*#__PURE__*/function(_a){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,arguments),_this.range=!1,_this.hideTypes=!1,_this.doubleClickUnselect=!1,_this.allowClear=!1,_this.open=!1,_this.hideTimeZone=!1,_this.type="absolute",_this.showManualInputs=!1,_this.hideDurationFields=[],_this.allowedDates="{}",_this.syncDatePicker=!1,_this.dateFormat="DD/MM/YYYY",_this.rangeSeparator=" - ",_this.showYearDropdown=!1,_this.showMonthDropdown=!1,_this.portal=!1;return _this;}_inherits(d,_a);return _createClass(d,[{key:"firstUpdated",value:function firstUpdated(){var _superPropGet2,_this2=this;if((_superPropGet2=_superPropGet(d,"firstUpdated",this,3))!==null&&_superPropGet2!==void 0&&_superPropGet2([new Map()]),!this.syncDatePicker)return;var t=this.querySelector("nile-input");t&&t.addEventListener("nile-input",function(t){var e=t.detail.value,_r=r(e,_this2.dateFormat,_this2.range,_this2.rangeSeparator),i=_r.first,s=_r.second;if(_this2.range){if(i&&!s&&(_this2.jumpTo(i),_this2.syncRangeCalendar(i,null)),i&&s){var _l=l(i,s),_l2=_slicedToArray(_l,2),_t=_l2[0],_e=_l2[1];_e&&_this2.jumpTo(_e),_this2.syncRangeCalendar(_t,_e);}}else i&&_this2.jumpTo(i);});}},{key:"jumpTo",value:function jumpTo(t){this.open=!0;var e=this.shadowRoot.querySelector("nile-calendar");e&&(e.currentYear=t.getFullYear(),e.currentMonth=t.getMonth(),e.value=t,e.valueAttribute=t.toISOString());}},{key:"syncRangeCalendar",value:function syncRangeCalendar(t,e){var i=this.shadowRoot.querySelector("nile-calendar");i&&this.range&&(t&&(i.startDate=t),e&&(i.endDate=e));}},{key:"render",value:function render(){var _this3=this;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown .open=\"","\" part=\"dd-base\" .hoist=\"","\" distance=\"6\" exportparts=\"base\" .portal=\"","\">\n <slot slot=\"trigger\" part=\"trigger\" name=\"trigger\"></slot>\n\n <nile-calendar\n .hideTypes=\"","\"\n .type=\"","\"\n value=\"","\"\n .range=\"","\"\n @nile-init=\"","\"\n @nile-destroy=\"","\"\n @nile-changed=\"","\"\n\n @nile-change=\"","\"\n\n .allowedDates=\"","\"\n\n @nile-type-change=\"","\"\n @nile-clear=\"","\"\n .hideDurationFields=\"","\"\n .showManualInputs=\"","\"\n .doubleClickUnselect=\"","\"\n .allowClear=\"","\"\n .startYear=\"","\"\n .endYear=\"","\"\n ?showYearDropdown=\"","\"\n ?showMonthDropdown=\"","\"\n .dateFormat=\"","\"\n ></nile-calendar>\n </nile-dropdown>\n "])),this.open,!0,this.portal,this.hideTypes,this.type,this.value,this.range,function(t){return t.stopPropagation();},function(t){return t.stopPropagation();},function(t){return t.stopPropagation();},this.handleChanged,this.allowedDates,function(t){t.stopPropagation(),_this3.emit("nile-type-change",t.detail);},function(t){t.stopPropagation(),_this3.emit("nile-clear");},this.hideDurationFields,this.showManualInputs,this.doubleClickUnselect,this.allowClear,this.startYear,this.endYear,this.showYearDropdown,this.showMonthDropdown,this.dateFormat);}},{key:"handleChanged",value:function handleChanged(t){t.stopPropagation();var e=t.detail,i=this.querySelector("nile-input");if(!this.range){var _this$dropdown;var _s=e.value;return _s&&i&&(i.value=h(new Date(_s),this.dateFormat),i.emit("nile-input",{value:i.value})),this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),void((_this$dropdown=this.dropdown)===null||_this$dropdown===void 0?void 0:_this$dropdown.hide());}var s=e.startDate,n=e.endDate;if(i){var _t2="";s&&(_t2+=h(new Date(s),this.dateFormat)),s&&n&&(_t2+=" - "+h(new Date(n),this.dateFormat)),i.value=_t2,i.emit("nile-input",{value:_t2});}this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),this.dropdown&&this.dropdown.hide();}},{key:"connectedCallback",value:function connectedCallback(){_superPropGet(d,"connectedCallback",this,3)([]),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(d,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}}],[{key:"styles",get:function get(){return[o];}}]);}(a));t([i({type:Boolean})],d.prototype,"range",void 0),t([i({type:Boolean})],d.prototype,"hideTypes",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"doubleClickUnselect",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"allowClear",void 0),t([i({type:Boolean})],d.prototype,"open",void 0),t([i({type:Boolean,attribute:"hide-time-zone"})],d.prototype,"hideTimeZone",void 0),t([i({type:String,reflect:!0})],d.prototype,"type",void 0),t([i({type:Boolean,attribute:"showManualInputs"})],d.prototype,"showManualInputs",void 0),t([i()],d.prototype,"value",void 0),t([i({type:Array,attribute:"hide-duration-fields"})],d.prototype,"hideDurationFields",void 0),t([i({attribute:"allowedDates"})],d.prototype,"allowedDates",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"syncDatePicker",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"dateFormat",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"rangeSeparator",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"startYear",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"endYear",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showYearDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showMonthDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"portal",void 0),t([s("nile-dropdown")],d.prototype,"dropdown",void 0),_export("N",d=t([n("nile-date-picker")],d));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-date-picker.css.cjs.js","../internal/nile-element.cjs.js","./nile-date-picker-utils.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,n,a,o,r,l,h,_templateObject,d;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.html;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;s=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_nileDatePickerCssCjsJs){a=_nileDatePickerCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_nileDatePickerUtilsCjsJs){r=_nileDatePickerUtilsCjsJs.p;l=_nileDatePickerUtilsCjsJs.n;h=_nileDatePickerUtilsCjsJs.f;}],execute:function execute(){_export("N",d=/*#__PURE__*/function(_o){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,arguments),_this.range=!1,_this.hideTypes=!1,_this.doubleClickUnselect=!1,_this.allowClear=!1,_this.open=!1,_this.hideTimeZone=!1,_this.type="absolute",_this.showManualInputs=!1,_this.hideDurationFields=[],_this.allowedDates="{}",_this.syncDatePicker=!1,_this.dateFormat="DD/MM/YYYY",_this.rangeSeparator=" - ",_this.showYearDropdown=!1,_this.showMonthDropdown=!1,_this.portal=!1,_this.disabled=!1;return _this;}_inherits(d,_o);return _createClass(d,[{key:"firstUpdated",value:function firstUpdated(){var _superPropGet2,_this2=this;if((_superPropGet2=_superPropGet(d,"firstUpdated",this,3))!==null&&_superPropGet2!==void 0&&_superPropGet2([new Map()]),!this.syncDatePicker)return;var t=this.querySelector("nile-input");t&&t.addEventListener("nile-input",function(t){var e=t.detail.value,_r=r(e,_this2.dateFormat,_this2.range,_this2.rangeSeparator),i=_r.first,s=_r.second;if(_this2.range){if(i&&!s&&(_this2.jumpTo(i),_this2.syncRangeCalendar(i,null)),i&&s){var _l=l(i,s),_l2=_slicedToArray(_l,2),_t=_l2[0],_e=_l2[1];_e&&_this2.jumpTo(_e),_this2.syncRangeCalendar(_t,_e);}}else i&&_this2.jumpTo(i);});}},{key:"updated",value:function updated(t){_superPropGet(d,"updated",this,3)([t]),t.has("disabled")&&this.updateTriggerDisabledState();}},{key:"updateTriggerDisabledState",value:function updateTriggerDisabledState(){var t=this.querySelector('[slot="trigger"]');t&&"disabled"in t&&(t.disabled=this.disabled);}},{key:"jumpTo",value:function jumpTo(t){this.open=!0;var e=this.shadowRoot.querySelector("nile-calendar");e&&(e.currentYear=t.getFullYear(),e.currentMonth=t.getMonth(),e.value=t,e.valueAttribute=t.toISOString());}},{key:"syncRangeCalendar",value:function syncRangeCalendar(t,e){var i=this.shadowRoot.querySelector("nile-calendar");i&&this.range&&(t&&(i.startDate=t),e&&(i.endDate=e));}},{key:"render",value:function render(){var _this3=this;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown ?disabled=\"","\" .open=\"","\" part=\"dd-base\" .hoist=\"","\" distance=\"6\" exportparts=\"base\" .portal=\"","\">\n <slot slot=\"trigger\" part=\"trigger\" name=\"trigger\"></slot> \n\n <nile-calendar\n .hideTypes=\"","\"\n .type=\"","\"\n value=\"","\"\n .range=\"","\"\n @nile-init=\"","\"\n @nile-destroy=\"","\"\n @nile-changed=\"","\"\n\n @nile-change=\"","\"\n\n .allowedDates=\"","\"\n\n @nile-type-change=\"","\"\n @nile-clear=\"","\"\n .hideDurationFields=\"","\"\n .showManualInputs=\"","\"\n .doubleClickUnselect=\"","\"\n .allowClear=\"","\"\n .startYear=\"","\"\n .endYear=\"","\"\n ?showYearDropdown=\"","\"\n ?showMonthDropdown=\"","\"\n .dateFormat=\"","\"\n ></nile-calendar>\n </nile-dropdown>\n "])),this.disabled,this.open,!0,this.portal,this.hideTypes,this.type,this.value,this.range,function(t){return t.stopPropagation();},function(t){return t.stopPropagation();},function(t){return t.stopPropagation();},this.handleChanged,this.allowedDates,function(t){t.stopPropagation(),_this3.emit("nile-type-change",t.detail);},function(t){t.stopPropagation(),_this3.emit("nile-clear");},this.hideDurationFields,this.showManualInputs,this.doubleClickUnselect,this.allowClear,this.startYear,this.endYear,this.showYearDropdown,this.showMonthDropdown,this.dateFormat);}},{key:"handleChanged",value:function handleChanged(t){t.stopPropagation();var e=t.detail,i=this.querySelector("nile-input");if(this.disabled)return;if(!this.range){var _this$dropdown;var _s=e.value;return _s&&i&&(i.value=h(new Date(_s),this.dateFormat),i.emit("nile-input",{value:i.value})),this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),void((_this$dropdown=this.dropdown)===null||_this$dropdown===void 0?void 0:_this$dropdown.hide());}var s=e.startDate,n=e.endDate;if(i){var _t2="";s&&(_t2+=h(new Date(s),this.dateFormat)),s&&n&&(_t2+=" - "+h(new Date(n),this.dateFormat)),i.value=_t2,i.emit("nile-input",{value:_t2});}this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),this.dropdown&&this.dropdown.hide();}},{key:"connectedCallback",value:function connectedCallback(){_superPropGet(d,"connectedCallback",this,3)([]),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(d,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}}],[{key:"styles",get:function get(){return[a];}}]);}(o));t([i({type:Boolean})],d.prototype,"range",void 0),t([i({type:Boolean})],d.prototype,"hideTypes",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"doubleClickUnselect",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"allowClear",void 0),t([i({type:Boolean})],d.prototype,"open",void 0),t([i({type:Boolean,attribute:"hide-time-zone"})],d.prototype,"hideTimeZone",void 0),t([i({type:String,reflect:!0})],d.prototype,"type",void 0),t([i({type:Boolean,attribute:"showManualInputs"})],d.prototype,"showManualInputs",void 0),t([i()],d.prototype,"value",void 0),t([i({type:Array,attribute:"hide-duration-fields"})],d.prototype,"hideDurationFields",void 0),t([i({attribute:"allowedDates"})],d.prototype,"allowedDates",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"syncDatePicker",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"dateFormat",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"rangeSeparator",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"startYear",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"endYear",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showYearDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showMonthDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"portal",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"disabled",void 0),t([s("nile-dropdown")],d.prototype,"dropdown",void 0),_export("N",d=t([n("nile-date-picker")],d));}};});
2
2
  //# sourceMappingURL=nile-date-picker.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-date-picker.cjs.js","sources":["../../../src/nile-date-picker/nile-date-picker.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 CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, query, property } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport NileElement from '../internal/nile-element';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n\nimport {\n parseDateFromFormat,\n formatDateToFormat,\n parseRangeFromFormat,\n normalizeDateRange\n} from './nile-date-picker-utils';\n\n\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\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 @property({ type: Boolean }) range = false;\n\n @property({ type: Boolean }) hideTypes = false;\n\n @property({ type: Boolean, reflect: true }) doubleClickUnselect = false;\n\n @property({ type: Boolean, reflect: true }) allowClear = false;\n\n @property({ type: Boolean }) open = false;\n\n @property({ type: Boolean, attribute: 'hide-time-zone' }) hideTimeZone = false;\n\n @property({ type: String, reflect: true }) type: 'absolute' | 'relative' = 'absolute';\n\n @property({ type: Boolean, attribute: 'showManualInputs' }) \n showManualInputs = false;\n\n @property() value: any;\n\n @property({ type: Array, attribute: 'hide-duration-fields' }) \n hideDurationFields: any = [];\n\n @property({ attribute: 'allowedDates' }) allowedDates: any = '{}';\n\n @property({ type: Boolean, attribute: true, reflect: true }) syncDatePicker = false;\n\n @property({ type: String, attribute: true, reflect: true }) dateFormat = \"DD/MM/YYYY\"; \n\n @property({ type: String, attribute: true, reflect: true }) rangeSeparator = \" - \";\n\n @property({ type: Number, attribute: true, reflect: true }) startYear: number;\n\n @property({ type: Number, attribute: true, reflect: true }) endYear: number;\n\n @property({ type: Boolean, attribute: true, reflect: true }) showYearDropdown = false;\n\n @property({ type: Boolean, attribute: true, reflect: true }) showMonthDropdown = false;\n\n @property({ type: Boolean, attribute: true, reflect: true }) portal = false;\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n /**\n * Render method\n * @slot This is a slot test\n */\n firstUpdated() {\n super.firstUpdated?.(new Map());\n\n if (!this.syncDatePicker) return;\n\n const input = this.querySelector(\"nile-input\");\n if (!input) return;\n\n input.addEventListener(\"nile-input\", (e: any) => {\n const text = e.detail.value;\n const { first, second } = parseRangeFromFormat(text, this.dateFormat, this.range, this.rangeSeparator);\n\n if (!this.range) {\n if (first) this.jumpTo(first);\n return;\n }\n\n if (first && !second) {\n this.jumpTo(first);\n this.syncRangeCalendar(first, null);\n }\n\n if (first && second) {\n const [start, end] = normalizeDateRange(first, second);\n if (end) this.jumpTo(end);\n this.syncRangeCalendar(start, end);\n }\n });\n }\n\n private jumpTo(date: Date) {\n this.open = true;\n const cal = this.shadowRoot!.querySelector(\"nile-calendar\") as any;\n if (!cal) return;\n\n cal.currentYear = date.getFullYear();\n cal.currentMonth = date.getMonth();\n cal.value = date;\n cal.valueAttribute = date.toISOString();\n }\n\n\n private syncRangeCalendar(first: Date | null, second: Date | null) {\n const cal = this.shadowRoot!.querySelector(\"nile-calendar\") as any;\n if (!cal) return;\n\n if (!this.range) return;\n\n if (first) cal.startDate = first;\n if (second) cal.endDate = second;\n }\n\n render(): TemplateResult {\n return html`\n <nile-dropdown .open=\"${this.open}\" part=\"dd-base\" .hoist=\"${true}\" distance=\"6\" exportparts=\"base\" .portal=\"${this.portal}\">\n <slot slot=\"trigger\" part=\"trigger\" name=\"trigger\"></slot>\n\n <nile-calendar\n .hideTypes=\"${this.hideTypes}\"\n .type=\"${this.type}\"\n value=\"${this.value}\"\n .range=\"${this.range}\"\n @nile-init=\"${(e:CustomEvent)=>e.stopPropagation()}\"\n @nile-destroy=\"${(e:CustomEvent)=>e.stopPropagation()}\"\n @nile-changed=\"${(e:CustomEvent)=>e.stopPropagation()}\"\n\n @nile-change=\"${this.handleChanged}\"\n\n .allowedDates=\"${this.allowedDates}\"\n\n @nile-type-change=\"${(e:CustomEvent)=>{e.stopPropagation();this.emit('nile-type-change',e.detail)}}\"\n @nile-clear=\"${(e:CustomEvent)=>{e.stopPropagation();this.emit('nile-clear')}}\"\n .hideDurationFields=\"${this.hideDurationFields}\"\n .showManualInputs=\"${this.showManualInputs}\"\n .doubleClickUnselect=\"${this.doubleClickUnselect}\"\n .allowClear=\"${this.allowClear}\"\n .startYear=\"${this.startYear}\"\n .endYear=\"${this.endYear}\"\n ?showYearDropdown=\"${this.showYearDropdown}\"\n ?showMonthDropdown=\"${this.showMonthDropdown}\"\n .dateFormat=\"${this.dateFormat}\"\n ></nile-calendar>\n </nile-dropdown>\n `;\n }\n\n\n handleChanged(event: CustomEvent) {\n event.stopPropagation();\n\n const detail = event.detail;\n const triggerInput = this.querySelector(\"nile-input\");\n\n if (!this.range) {\n const picked = detail.value;\n\n if (picked && triggerInput) {\n triggerInput.value = formatDateToFormat(new Date(picked), this.dateFormat);\n triggerInput.emit(\"nile-input\", { value: triggerInput.value });\n }\n\n this.emit('nile-changed', event.detail);\n this.emit('nile-change', event.detail);\n\n this.dropdown?.hide();\n return;\n }\n\n const start = detail.startDate;\n const end = detail.endDate;\n\n if (triggerInput) {\n let text = \"\";\n if (start) text += formatDateToFormat(new Date(start), this.dateFormat);\n if (start && end) text += \" - \" + formatDateToFormat(new Date(end), this.dateFormat);\n\n triggerInput.value = text;\n triggerInput.emit(\"nile-input\", { value: text });\n }\n\n this.emit('nile-changed', event.detail);\n this.emit('nile-change', event.detail);\n\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"],"names":["NileDatePicker","d","this","range","hideTypes","doubleClickUnselect","allowClear","open","hideTimeZone","type","showManualInputs","hideDurationFields","allowedDates","syncDatePicker","dateFormat","rangeSeparator","showYearDropdown","showMonthDropdown","portal","_this","_inherits","_a","_createClass","key","value","firstUpdated","super","Map","input","querySelector","addEventListener","e","text","detail","parseRangeFromFormat","first","second","jumpTo","syncRangeCalendar","_l","normalizeDateRange","end","start","date","cal","shadowRoot","currentYear","getFullYear","currentMonth","getMonth","valueAttribute","toISOString","startDate","endDate","render","_this3","html","_templateObject","_taggedTemplateLiteral","stopPropagation","handleChanged","emit","startYear","endYear","event","triggerInput","_this$dropdown","picked","formatDateToFormat","Date","dropdown","hide","connectedCallback","disconnectedCallback","get","styles","NileElement","__decorate","property","Boolean","prototype","reflect","attribute","String","Array","Number","query","customElement"],"mappings":"ukKAkCaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEASwBC,EAAAA,KAAAA,CAAKC,OAAG,CAERD,CAAAA,KAAAA,CAASE,WAAG,CAEGF,CAAAA,KAAAA,CAAmBG,qBAAG,CAEtBH,CAAAA,KAAAA,CAAUI,UAAG,CAAA,CAAA,CAAA,CAE5BJ,KAAAA,CAAIK,IAAAA,CAAAA,CAAG,EAEsBL,KAAAA,CAAYM,YAAAA,CAAAA,CAAG,EAE9BN,KAAAA,CAAIO,IAAAA,CAA4B,WAG3EP,KAAAA,CAAgBQ,gBAAAA,CAAAA,CAAG,CAKnBR,CAAAA,KAAAA,CAAkBS,kBAAQ,CAAA,EAAA,CAEeT,KAAAA,CAAYU,YAAQ,CAAA,IAAA,CAEAV,KAAAA,CAAcW,cAAG,CAAA,CAAA,CAAA,CAElBX,KAAAA,CAAUY,UAAG,CAAA,YAAA,CAEbZ,KAAAA,CAAca,cAAAA,CAAG,KAMhBb,CAAAA,KAAAA,CAAgBc,kBAAG,CAEnBd,CAAA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AErE,IAAAA,CAAM4E,OAAQH,SAAW,CAAA,CAAA,CAAA,CAAMD,SAAS,CAA0BjF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAgF,UAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CAElBH,EAAA,CAA3DC,CAAAA,CAAS,CAAErE,IAAM4E,CAAAA,MAAAA,CAAQH,WAAW,CAAMD,CAAAA,OAAAA,CAAAA,CAAS,KAAwBjF,CAAAgF,CAAAA,SAAAA,CAAA,cAAA,EAEfH,CAAAA,CAAAA,CAAAA,CAAA,CAA5DC,CAAS,CAAA,CAAErE,KAAMsE,OAASG,CAAAA,SAAAA,CAAAA,CAAW,EAAMD,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiCjF,CAAAgF,CAAAA,SAAAA,CAAA,uBAAA,EAEzBH,CAAAA,CAAAA,CAAAA,CAAA,CAA5DC,CAAS,CAAA,CAAErE,KAAMsE,OAASG,CAAAA,SAAAA,CAAAA,CAAW,EAAMD,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkCjF,EAAAgF,SAAA,CAAA,mBAAA,CAAA,IAAA,IAE1BH,CAAA,CAAA,CAA5DC,EAAS,CAAErE,IAAAA,CAAMsE,QAASG,SAAW,CAAA,CAAA,CAAA,CAAMD,SAAS,CAAuBjF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAgF,UAAA,QAAA,CAAA,IAAA,EAAA,CAAA,CAEpDH,EAAA,CAAvBS,CAAAA,CAAM,kBAAwCtF,CAAAgF,CAAAA,SAAAA,CAAA,eAAA,EAjDpChF,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAc6E,EAAA,CAD1BU,CAAAA,CAAc,qBACFvF"}
1
+ {"version":3,"file":"nile-date-picker.cjs.js","sources":["../../../src/nile-date-picker/nile-date-picker.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 CSSResultArray,\n TemplateResult,\n} from 'lit';\nimport { customElement, query, property } from 'lit/decorators.js';\nimport { styles } from './nile-date-picker.css';\nimport NileElement from '../internal/nile-element';\nimport { NileDropdown } from '../nile-dropdown';\n\n/**\n * Nile icon component.\n *\n * @tag nile-date-picker\n *\n */\n\nimport {\n parseDateFromFormat,\n formatDateToFormat,\n parseRangeFromFormat,\n normalizeDateRange\n} from './nile-date-picker-utils';\n\n\n@customElement('nile-date-picker')\nexport class NileDatePicker extends NileElement {\n /**\n * The styles for DatePicker\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 @property({ type: Boolean }) range = false;\n\n @property({ type: Boolean }) hideTypes = false;\n\n @property({ type: Boolean, reflect: true }) doubleClickUnselect = false;\n\n @property({ type: Boolean, reflect: true }) allowClear = false;\n\n @property({ type: Boolean }) open = false;\n\n @property({ type: Boolean, attribute: 'hide-time-zone' }) hideTimeZone = false;\n\n @property({ type: String, reflect: true }) type: 'absolute' | 'relative' = 'absolute';\n\n @property({ type: Boolean, attribute: 'showManualInputs' }) \n showManualInputs = false;\n\n @property() value: any;\n\n @property({ type: Array, attribute: 'hide-duration-fields' }) \n hideDurationFields: any = [];\n\n @property({ attribute: 'allowedDates' }) allowedDates: any = '{}';\n\n @property({ type: Boolean, attribute: true, reflect: true }) syncDatePicker = false;\n\n @property({ type: String, attribute: true, reflect: true }) dateFormat = \"DD/MM/YYYY\"; \n\n @property({ type: String, attribute: true, reflect: true }) rangeSeparator = \" - \";\n\n @property({ type: Number, attribute: true, reflect: true }) startYear: number;\n\n @property({ type: Number, attribute: true, reflect: true }) endYear: number;\n\n @property({ type: Boolean, attribute: true, reflect: true }) showYearDropdown = false;\n\n @property({ type: Boolean, attribute: true, reflect: true }) showMonthDropdown = false;\n\n @property({ type: Boolean, attribute: true, reflect: true }) portal = false;\n\n @property({ type: Boolean, attribute: true, reflect: true }) disabled = false;\n\n @query('nile-dropdown') dropdown: NileDropdown;\n\n /**\n * Render method\n * @slot This is a slot test\n */\n firstUpdated() {\n super.firstUpdated?.(new Map());\n\n if (!this.syncDatePicker) return;\n\n const input = this.querySelector(\"nile-input\");\n if (!input) return;\n\n input.addEventListener(\"nile-input\", (e: any) => {\n const text = e.detail.value;\n const { first, second } = parseRangeFromFormat(text, this.dateFormat, this.range, this.rangeSeparator);\n\n if (!this.range) {\n if (first) this.jumpTo(first);\n return;\n }\n\n if (first && !second) {\n this.jumpTo(first);\n this.syncRangeCalendar(first, null);\n }\n\n if (first && second) {\n const [start, end] = normalizeDateRange(first, second);\n if (end) this.jumpTo(end);\n this.syncRangeCalendar(start, end);\n }\n });\n }\n \n updated(changedProperties: Map<string, unknown>) {\n super.updated(changedProperties);\n if (changedProperties.has('disabled')) {\n this.updateTriggerDisabledState();\n }\n }\n \n\n private updateTriggerDisabledState() {\n const trigger = this.querySelector('[slot=\"trigger\"]') as HTMLElement | null;\n if (!trigger) return;\n if ('disabled' in trigger) {\n (trigger as any).disabled = this.disabled;\n }\n }\n \n\n private jumpTo(date: Date) {\n this.open = true;\n const cal = this.shadowRoot!.querySelector(\"nile-calendar\") as any;\n if (!cal) return;\n\n cal.currentYear = date.getFullYear();\n cal.currentMonth = date.getMonth();\n cal.value = date;\n cal.valueAttribute = date.toISOString();\n }\n\n\n private syncRangeCalendar(first: Date | null, second: Date | null) {\n const cal = this.shadowRoot!.querySelector(\"nile-calendar\") as any;\n if (!cal) return;\n\n if (!this.range) return;\n\n if (first) cal.startDate = first;\n if (second) cal.endDate = second;\n }\n\n render(): TemplateResult {\n return html`\n <nile-dropdown ?disabled=\"${this.disabled}\" .open=\"${this.open}\" part=\"dd-base\" .hoist=\"${true}\" distance=\"6\" exportparts=\"base\" .portal=\"${this.portal}\">\n <slot slot=\"trigger\" part=\"trigger\" name=\"trigger\"></slot> \n\n <nile-calendar\n .hideTypes=\"${this.hideTypes}\"\n .type=\"${this.type}\"\n value=\"${this.value}\"\n .range=\"${this.range}\"\n @nile-init=\"${(e:CustomEvent)=>e.stopPropagation()}\"\n @nile-destroy=\"${(e:CustomEvent)=>e.stopPropagation()}\"\n @nile-changed=\"${(e:CustomEvent)=>e.stopPropagation()}\"\n\n @nile-change=\"${this.handleChanged}\"\n\n .allowedDates=\"${this.allowedDates}\"\n\n @nile-type-change=\"${(e:CustomEvent)=>{e.stopPropagation();this.emit('nile-type-change',e.detail)}}\"\n @nile-clear=\"${(e:CustomEvent)=>{e.stopPropagation();this.emit('nile-clear')}}\"\n .hideDurationFields=\"${this.hideDurationFields}\"\n .showManualInputs=\"${this.showManualInputs}\"\n .doubleClickUnselect=\"${this.doubleClickUnselect}\"\n .allowClear=\"${this.allowClear}\"\n .startYear=\"${this.startYear}\"\n .endYear=\"${this.endYear}\"\n ?showYearDropdown=\"${this.showYearDropdown}\"\n ?showMonthDropdown=\"${this.showMonthDropdown}\"\n .dateFormat=\"${this.dateFormat}\"\n ></nile-calendar>\n </nile-dropdown>\n `;\n }\n\n\n handleChanged(event: CustomEvent) {\n event.stopPropagation();\n\n const detail = event.detail;\n const triggerInput = this.querySelector(\"nile-input\");\n if (this.disabled) return;\n\n if (!this.range) {\n const picked = detail.value;\n\n if (picked && triggerInput) {\n triggerInput.value = formatDateToFormat(new Date(picked), this.dateFormat);\n triggerInput.emit(\"nile-input\", { value: triggerInput.value });\n }\n\n this.emit('nile-changed', event.detail);\n this.emit('nile-change', event.detail);\n\n this.dropdown?.hide();\n return;\n }\n\n const start = detail.startDate;\n const end = detail.endDate;\n\n if (triggerInput) {\n let text = \"\";\n if (start) text += formatDateToFormat(new Date(start), this.dateFormat);\n if (start && end) text += \" - \" + formatDateToFormat(new Date(end), this.dateFormat);\n\n triggerInput.value = text;\n triggerInput.emit(\"nile-input\", { value: text });\n }\n\n this.emit('nile-changed', event.detail);\n this.emit('nile-change', event.detail);\n\n if (this.dropdown) {\n this.dropdown.hide();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n}\n\nexport default NileDatePicker;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-date-picker': NileDatePicker;\n }\n}\n"],"names":["NileDatePicker","_o","d","this","range","hideTypes","doubleClickUnselect","allowClear","open","hideTimeZone","type","showManualInputs","hideDurationFields","allowedDates","syncDatePicker","dateFormat","rangeSeparator","showYearDropdown","showMonthDropdown","portal","disabled","_this","_inherits","_createClass","key","value","firstUpdated","_superPropGet2","_this2","super","Map","input","querySelector","addEventListener","e","text","detail","parseRangeFromFormat","first","second","jumpTo","syncRangeCalendar","_l","normalizeDateRange","start","end","updated","changedProperties","has","updateTriggerDisabledState","trigger","date","cal","shadowRoot","currentYear","getFullYear","currentMonth","getMonth","valueAttribute","toISOString","startDate","endDate","render","_this3","html","_templateObject","_taggedTemplateLiteral","stopPropagation","handleChanged","emit","startYear","endYear","event","triggerInput","_this$dropdown","picked","formatDateToFormat","Date","dropdown","hide","connectedCallback","disconnectedCallback","get","styles","NileElement","__decorate","property","Boolean","prototype","reflect","attribute","String","Array","Number","query","_export","customElement"],"mappings":"ukKAkCaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEASwBC,EAAAA,KAAAA,CAAKC,KAAG,CAAA,CAAA,CAAA,CAERD,KAAAA,CAASE,SAAAA,CAAAA,CAAG,EAEGF,KAAAA,CAAmBG,mBAAAA,CAAAA,CAAG,CAEtBH,CAAAA,KAAAA,CAAUI,UAAG,CAAA,CAAA,CAAA,CAE5BJ,KAAAA,CAAIK,IAAAA,CAAAA,CAAG,CAEsBL,CAAAA,KAAAA,CAAYM,YAAG,CAAA,CAAA,CAAA,CAE9BN,KAAAA,CAAIO,IAAAA,CAA4B,WAG3EP,KAAAA,CAAgBQ,gBAAAA,CAAAA,CAAG,CAKnBR,CAAAA,KAAAA,CAAkBS,kBAAQ,CAAA,EAAA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F,OAAQH,SAAW,CAAA,CAAA,CAAA,CAAMD,SAAS,CAAwBzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,UAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAEfH,EAAA,CAA5DC,CAAAA,CAAS,CAAE5E,IAAM6E,CAAAA,OAAAA,CAASG,WAAW,CAAMD,CAAAA,OAAAA,CAAAA,CAAS,KAAiCzF,CAAAwF,CAAAA,SAAAA,CAAA,uBAAA,EAEzBH,CAAAA,CAAAA,CAAAA,CAAA,CAA5DC,CAAS,CAAA,CAAE5E,IAAM6E,CAAAA,OAAAA,CAASG,SAAW,CAAA,CAAA,CAAA,CAAMD,SAAS,CAAkCzF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,UAAA,mBAAA,CAAA,IAAA,EAAA,CAAA,CAE1BH,EAAA,CAA5DC,CAAAA,CAAS,CAAE5E,IAAM6E,CAAAA,OAAAA,CAASG,WAAW,CAAMD,CAAAA,OAAAA,CAAAA,CAAS,KAAuBzF,CAAAwF,CAAAA,SAAAA,CAAA,aAAA,EAEfH,CAAAA,CAAAA,CAAAA,CAAA,CAA5DC,CAAS,CAAA,CAAE5E,KAAM6E,OAASG,CAAAA,SAAAA,CAAAA,CAAW,EAAMD,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyBzF,EAAAwF,SAAA,CAAA,UAAA,CAAA,IAAA,IAEtDH,CAAA,CAAA,CAAvBS,EAAM,eAAwC9F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAwF,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAAAO,OAAA,KAnDpC/F,EAAcqF,CAAA,CAAA,CAD1BW,CAAc,CAAA,kBAAA,CAAA,CAAA,CACFhG"}
@@ -1,6 +1,6 @@
1
- import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as i,query as s,customElement as n}from"lit/decorators.js";import{s as o}from"./nile-date-picker.css.esm.js";import{N as a}from"../internal/nile-element.esm.js";import{p as r,n as l,f as h}from"./nile-date-picker-utils.esm.js";let d=class extends a{constructor(){super(...arguments),this.range=!1,this.hideTypes=!1,this.doubleClickUnselect=!1,this.allowClear=!1,this.open=!1,this.hideTimeZone=!1,this.type="absolute",this.showManualInputs=!1,this.hideDurationFields=[],this.allowedDates="{}",this.syncDatePicker=!1,this.dateFormat="DD/MM/YYYY",this.rangeSeparator=" - ",this.showYearDropdown=!1,this.showMonthDropdown=!1,this.portal=!1}static get styles(){return[o]}firstUpdated(){if(super.firstUpdated?.(new Map),!this.syncDatePicker)return;const t=this.querySelector("nile-input");t&&t.addEventListener("nile-input",(t=>{const e=t.detail.value,{first:i,second:s}=r(e,this.dateFormat,this.range,this.rangeSeparator);if(this.range){if(i&&!s&&(this.jumpTo(i),this.syncRangeCalendar(i,null)),i&&s){const[t,e]=l(i,s);e&&this.jumpTo(e),this.syncRangeCalendar(t,e)}}else i&&this.jumpTo(i)}))}jumpTo(t){this.open=!0;const e=this.shadowRoot.querySelector("nile-calendar");e&&(e.currentYear=t.getFullYear(),e.currentMonth=t.getMonth(),e.value=t,e.valueAttribute=t.toISOString())}syncRangeCalendar(t,e){const i=this.shadowRoot.querySelector("nile-calendar");i&&this.range&&(t&&(i.startDate=t),e&&(i.endDate=e))}render(){return e`
2
- <nile-dropdown .open="${this.open}" part="dd-base" .hoist="${!0}" distance="6" exportparts="base" .portal="${this.portal}">
3
- <slot slot="trigger" part="trigger" name="trigger"></slot>
1
+ import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as i,query as s,customElement as n}from"lit/decorators.js";import{s as a}from"./nile-date-picker.css.esm.js";import{N as o}from"../internal/nile-element.esm.js";import{p as r,n as l,f as h}from"./nile-date-picker-utils.esm.js";let d=class extends o{constructor(){super(...arguments),this.range=!1,this.hideTypes=!1,this.doubleClickUnselect=!1,this.allowClear=!1,this.open=!1,this.hideTimeZone=!1,this.type="absolute",this.showManualInputs=!1,this.hideDurationFields=[],this.allowedDates="{}",this.syncDatePicker=!1,this.dateFormat="DD/MM/YYYY",this.rangeSeparator=" - ",this.showYearDropdown=!1,this.showMonthDropdown=!1,this.portal=!1,this.disabled=!1}static get styles(){return[a]}firstUpdated(){if(super.firstUpdated?.(new Map),!this.syncDatePicker)return;const t=this.querySelector("nile-input");t&&t.addEventListener("nile-input",(t=>{const e=t.detail.value,{first:i,second:s}=r(e,this.dateFormat,this.range,this.rangeSeparator);if(this.range){if(i&&!s&&(this.jumpTo(i),this.syncRangeCalendar(i,null)),i&&s){const[t,e]=l(i,s);e&&this.jumpTo(e),this.syncRangeCalendar(t,e)}}else i&&this.jumpTo(i)}))}updated(t){super.updated(t),t.has("disabled")&&this.updateTriggerDisabledState()}updateTriggerDisabledState(){const t=this.querySelector('[slot="trigger"]');t&&"disabled"in t&&(t.disabled=this.disabled)}jumpTo(t){this.open=!0;const e=this.shadowRoot.querySelector("nile-calendar");e&&(e.currentYear=t.getFullYear(),e.currentMonth=t.getMonth(),e.value=t,e.valueAttribute=t.toISOString())}syncRangeCalendar(t,e){const i=this.shadowRoot.querySelector("nile-calendar");i&&this.range&&(t&&(i.startDate=t),e&&(i.endDate=e))}render(){return e`
2
+ <nile-dropdown ?disabled="${this.disabled}" .open="${this.open}" part="dd-base" .hoist="${!0}" distance="6" exportparts="base" .portal="${this.portal}">
3
+ <slot slot="trigger" part="trigger" name="trigger"></slot>
4
4
 
5
5
  <nile-calendar
6
6
  .hideTypes="${this.hideTypes}"
@@ -28,4 +28,4 @@ import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as
28
28
  .dateFormat="${this.dateFormat}"
29
29
  ></nile-calendar>
30
30
  </nile-dropdown>
31
- `}handleChanged(t){t.stopPropagation();const e=t.detail,i=this.querySelector("nile-input");if(!this.range){const s=e.value;return s&&i&&(i.value=h(new Date(s),this.dateFormat),i.emit("nile-input",{value:i.value})),this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),void this.dropdown?.hide()}const s=e.startDate,n=e.endDate;if(i){let t="";s&&(t+=h(new Date(s),this.dateFormat)),s&&n&&(t+=" - "+h(new Date(n),this.dateFormat)),i.value=t,i.emit("nile-input",{value:t})}this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),this.dropdown&&this.dropdown.hide()}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};t([i({type:Boolean})],d.prototype,"range",void 0),t([i({type:Boolean})],d.prototype,"hideTypes",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"doubleClickUnselect",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"allowClear",void 0),t([i({type:Boolean})],d.prototype,"open",void 0),t([i({type:Boolean,attribute:"hide-time-zone"})],d.prototype,"hideTimeZone",void 0),t([i({type:String,reflect:!0})],d.prototype,"type",void 0),t([i({type:Boolean,attribute:"showManualInputs"})],d.prototype,"showManualInputs",void 0),t([i()],d.prototype,"value",void 0),t([i({type:Array,attribute:"hide-duration-fields"})],d.prototype,"hideDurationFields",void 0),t([i({attribute:"allowedDates"})],d.prototype,"allowedDates",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"syncDatePicker",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"dateFormat",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"rangeSeparator",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"startYear",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"endYear",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showYearDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showMonthDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"portal",void 0),t([s("nile-dropdown")],d.prototype,"dropdown",void 0),d=t([n("nile-date-picker")],d);export{d as N};
31
+ `}handleChanged(t){t.stopPropagation();const e=t.detail,i=this.querySelector("nile-input");if(this.disabled)return;if(!this.range){const s=e.value;return s&&i&&(i.value=h(new Date(s),this.dateFormat),i.emit("nile-input",{value:i.value})),this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),void this.dropdown?.hide()}const s=e.startDate,n=e.endDate;if(i){let t="";s&&(t+=h(new Date(s),this.dateFormat)),s&&n&&(t+=" - "+h(new Date(n),this.dateFormat)),i.value=t,i.emit("nile-input",{value:t})}this.emit("nile-changed",t.detail),this.emit("nile-change",t.detail),this.dropdown&&this.dropdown.hide()}connectedCallback(){super.connectedCallback(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}};t([i({type:Boolean})],d.prototype,"range",void 0),t([i({type:Boolean})],d.prototype,"hideTypes",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"doubleClickUnselect",void 0),t([i({type:Boolean,reflect:!0})],d.prototype,"allowClear",void 0),t([i({type:Boolean})],d.prototype,"open",void 0),t([i({type:Boolean,attribute:"hide-time-zone"})],d.prototype,"hideTimeZone",void 0),t([i({type:String,reflect:!0})],d.prototype,"type",void 0),t([i({type:Boolean,attribute:"showManualInputs"})],d.prototype,"showManualInputs",void 0),t([i()],d.prototype,"value",void 0),t([i({type:Array,attribute:"hide-duration-fields"})],d.prototype,"hideDurationFields",void 0),t([i({attribute:"allowedDates"})],d.prototype,"allowedDates",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"syncDatePicker",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"dateFormat",void 0),t([i({type:String,attribute:!0,reflect:!0})],d.prototype,"rangeSeparator",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"startYear",void 0),t([i({type:Number,attribute:!0,reflect:!0})],d.prototype,"endYear",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showYearDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"showMonthDropdown",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"portal",void 0),t([i({type:Boolean,attribute:!0,reflect:!0})],d.prototype,"disabled",void 0),t([s("nile-dropdown")],d.prototype,"dropdown",void 0),d=t([n("nile-date-picker")],d);export{d as N};
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-dropdown.css.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","./portal-manager.cjs.js","../utilities/visibility-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,n,o,h,a,r,l,d,p,c,m,u,f,w,_templateObject,y;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_nileDropdownCssCjsJs){o=_nileDropdownCssCjsJs.s;},function(_internalAnimateCjsJs){h=_internalAnimateCjsJs.s;a=_internalAnimateCjsJs.a;},function(_litDirectivesClassMapJs){r=_litDirectivesClassMapJs.classMap;},function(_utilitiesAnimationRegistryCjsJs){l=_utilitiesAnimationRegistryCjsJs.s;d=_utilitiesAnimationRegistryCjsJs.g;},function(_internalTabbableCjsJs){p=_internalTabbableCjsJs.g;},function(_internalEventCjsJs){c=_internalEventCjsJs.w;},function(_internalWatchCjsJs){m=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){u=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_portalManagerCjsJs){f=_portalManagerCjsJs.D;},function(_utilitiesVisibilityManagerCjsJs){w=_utilitiesVisibilityManagerCjsJs.V;},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_portalUtilsCjsJs){}],execute:function execute(){_export("N",y=/*#__PURE__*/function(_u){function y(){var _this;_classCallCheck(this,y);_this=_callSuper(this,y,arguments),_this.open=!1,_this.placement="bottom-start",_this.disabled=!1,_this.stayOpenOnSelect=!1,_this.distance=0,_this.noOpenOnClick=!1,_this.skidding=0,_this.hoist=!1,_this.portal=!1,_this.enableVisibilityEffect=!1,_this.enableTabClose=!1,_this.portalManager=null;return _this;}_inherits(y,_u);return _createClass(y,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(y,"connectedCallback",this,3)([]),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame(function(){_this2.portal&&!_this2.portalManager&&(_this2.portalManager=new f(_this2));});}},{key:"firstUpdated",value:function(){var _firstUpdated=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var _this3=this;var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:this.panel.hidden=!this.open;this.open&&(this.addOpenListeners(),this.popup.active=!0);_context2.next=4;return this.updateComplete;case 4:i=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new w({host:this,target:i||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this3.open;},onAnchorOutOfView:function onAnchorOutOfView(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(t,i){return _this3.emit("nile-".concat(t),i);}});case 6:case"end":return _context2.stop();}},_callee,this);}));function firstUpdated(_x){return _firstUpdated.apply(this,arguments);}return firstUpdated;}()},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(y,"disconnectedCallback",this,3)([]),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null);}},{key:"focusOnTrigger",value:function focusOnTrigger(){var t=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(t===null||t===void 0?void 0:t.focus)&&t.focus();}},{key:"getMenu",value:function getMenu(){return this.panel.assignedElements({flatten:!0}).find(function(t){return"nile-menu"===t.tagName.toLowerCase();});}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide(),this.focusOnTrigger());}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(t){var _this4=this;if("Escape"===t.key&&this.open)return t.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===t.key){var _document$activeEleme;if(this.open&&"nile-menu-item"===((_document$activeEleme=document.activeElement)===null||_document$activeEleme===void 0?void 0:_document$activeEleme.tagName.toLowerCase()))return t.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout(function(){var _this4$containingElem,_document$activeEleme2,_this4$portalManager;var t=((_this4$containingElem=_this4.containingElement)===null||_this4$containingElem===void 0?void 0:_this4$containingElem.getRootNode())instanceof ShadowRoot?(_document$activeEleme2=document.activeElement)===null||_document$activeEleme2===void 0||(_document$activeEleme2=_document$activeEleme2.shadowRoot)===null||_document$activeEleme2===void 0?void 0:_document$activeEleme2.activeElement:document.activeElement,i=_this4.containingElement&&(t===null||t===void 0?void 0:t.closest(_this4.containingElement.tagName.toLowerCase()))===_this4.containingElement,s=_this4.portal&&((_this4$portalManager=_this4.portalManager)===null||_this4$portalManager===void 0?void 0:_this4$portalManager.portalContainerElement)&&(t===_this4.portalManager.portalContainerElement||(t===null||t===void 0?void 0:t.closest(".nile-dropdown-portal-append"))===_this4.portalManager.portalContainerElement);i||s||_this4.hide();});}}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$portalManager;var i=t.composedPath(),s=this.containingElement&&i.includes(this.containingElement),e=this.portal&&((_this$portalManager=this.portalManager)===null||_this$portalManager===void 0?void 0:_this$portalManager.portalContainerElement)&&i.includes(this.portalManager.portalContainerElement);s||e||this.hide();}},{key:"handlePanelSelect",value:function handlePanelSelect(t){var i=t.target;this.stayOpenOnSelect||"nile-menu"!==i.tagName.toLowerCase()?this.stayOpenOnSelect&&"nile-menu"===i.tagName.toLowerCase()&&(this.show(),this.focusOnTrigger()):(this.hide(),this.focusOnTrigger());}},{key:"handleTriggerClick",value:function handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()));}},{key:"handleTriggerKeyDown",value:function handleTriggerKeyDown(t){var i=this.getMenu();if(i){var _s=i.getAllItems(),_e=_s[0],_n=_s[_s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||this.show(),_s.length>0&&this.updateComplete.then(function(){"ArrowDown"!==t.key&&"Home"!==t.key||(i.setCurrentItem(_e),_e.focus()),"ArrowUp"!==t.key&&"End"!==t.key||(i.setCurrentItem(_n),_n.focus());}));}}},{key:"handleTriggerKeyUp",value:function handleTriggerKeyUp(t){" "===t.key&&t.preventDefault();}},{key:"handleTriggerSlotChange",value:function handleTriggerSlotChange(){this.updateAccessibleTrigger();}},{key:"updateAccessibleTrigger",value:function updateAccessibleTrigger(){var t=this.trigger.assignedElements({flatten:!0}).find(function(t){return p(t).start;});var i;if(t){switch(t.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":i=t.button;break;default:i=t;}i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded",this.open?"true":"false");}}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(this.open){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!0,c(this,"nile-after-show")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!this.open){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!1,c(this,"nile-after-hide")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"reposition",value:function reposition(){this.popup.reposition();}},{key:"addOpenListeners",value:function addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"removeOpenListeners",value:function removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"updated",value:function updated(t){_superPropGet(y,"updated",this,3)([t]),t.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new f(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null));}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _this$visibilityManag2;var _d,_t,_i,_this$visibilityManag3,_d2,_t2,_i2;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),this.disabled)){_context5.next=4;break;}this.open=!1;_context5.next=31;break;case 4:if(!(this.updateAccessibleTrigger(),this.open)){_context5.next=18;break;}this.emit("nile-show");this.addOpenListeners();this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new f(this),this.portalManager.setupPortalAppend());_context5.next=10;return h(this);case 10:if(this.portal){_context5.next=15;break;}this.panel.hidden=!1,this.popup.active=!0;_d=d(this,"dropdown.show",{dir:""}),_t=_d.keyframes,_i=_d.options;_context5.next=15;return a(this.popup.popup,_t,_i);case 15:this.emit("nile-after-show");_context5.next=31;break;case 18:this.emit("nile-hide");this.removeOpenListeners();(_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup();this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend();_context5.next=24;return h(this);case 24:if(this.portal){_context5.next=30;break;}_d2=d(this,"dropdown.hide",{dir:""}),_t2=_d2.keyframes,_i2=_d2.options;_context5.next=28;return a(this.popup.popup,_t2,_i2);case 28:this.panel.hidden=!0;this.popup.active=!1;case 30:this.emit("nile-after-hide");case 31:case"end":return _context5.stop();}},_callee4,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n id=\"dropdown\"\n placement=","\n distance=","\n skidding=","\n strategy=","\n sync=","\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=","\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=","\n @keydown=","\n @keyup=","\n @slotchange=","\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=","\n aria-labelledby=\"dropdown\"\n style=","\n ></slot>\n </nile-popup>\n "])),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",this.sync,r({dropdown:!0,"dropdown--open":this.open}),this.handleTriggerClick,this.handleTriggerKeyDown,this.handleTriggerKeyUp,this.handleTriggerSlotChange,this.open?"false":"true",this.portal&&this.portalManager?"display: none;":"");}}]);}(u));y.styles=o,t([s(".dropdown")],y.prototype,"popup",void 0),t([s(".dropdown__trigger")],y.prototype,"trigger",void 0),t([s(".dropdown__panel")],y.prototype,"panel",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"open",void 0),t([e({reflect:!0})],y.prototype,"placement",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"disabled",void 0),t([e({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],y.prototype,"stayOpenOnSelect",void 0),t([e({attribute:!1})],y.prototype,"containingElement",void 0),t([e({type:Number})],y.prototype,"distance",void 0),t([e({type:Boolean})],y.prototype,"noOpenOnClick",void 0),t([e({type:Number})],y.prototype,"skidding",void 0),t([e()],y.prototype,"sync",void 0),t([e({type:Boolean})],y.prototype,"hoist",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"portal",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"enableVisibilityEffect",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"enableTabClose",void 0),t([m("open",{waitUntilFirstUpdate:!0})],y.prototype,"handleOpenChange",null),_export("N",y=t([n("nile-dropdown")],y)),l("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),l("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-dropdown.css.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","../utilities/animation-registry.cjs.js","../internal/tabbable.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.cjs.js","./portal-manager.cjs.js","../utilities/visibility-manager.cjs.js","../floating-ui.dom-007bbe96.cjs.js","../nile-popup/nile-popup.css.cjs.js","./portal-utils.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,n,o,h,a,r,l,d,p,c,m,u,f,w,_templateObject,y;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_nileDropdownCssCjsJs){o=_nileDropdownCssCjsJs.s;},function(_internalAnimateCjsJs){h=_internalAnimateCjsJs.s;a=_internalAnimateCjsJs.a;},function(_litDirectivesClassMapJs){r=_litDirectivesClassMapJs.classMap;},function(_utilitiesAnimationRegistryCjsJs){l=_utilitiesAnimationRegistryCjsJs.s;d=_utilitiesAnimationRegistryCjsJs.g;},function(_internalTabbableCjsJs){p=_internalTabbableCjsJs.g;},function(_internalEventCjsJs){c=_internalEventCjsJs.w;},function(_internalWatchCjsJs){m=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){u=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCjsJs){},function(_portalManagerCjsJs){f=_portalManagerCjsJs.D;},function(_utilitiesVisibilityManagerCjsJs){w=_utilitiesVisibilityManagerCjsJs.V;},function(_floatingUiDom001CjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_portalUtilsCjsJs){}],execute:function execute(){_export("N",y=/*#__PURE__*/function(_u){function y(){var _this;_classCallCheck(this,y);_this=_callSuper(this,y,arguments),_this.open=!1,_this.placement="bottom-start",_this.disabled=!1,_this.stayOpenOnSelect=!1,_this.distance=0,_this.noOpenOnClick=!1,_this.skidding=0,_this.hoist=!1,_this.portal=!1,_this.enableVisibilityEffect=!1,_this.enableTabClose=!1,_this.portalManager=null;return _this;}_inherits(y,_u);return _createClass(y,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(y,"connectedCallback",this,3)([]),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this),this.emit("nile-init"),requestAnimationFrame(function(){_this2.portal&&!_this2.portalManager&&(_this2.portalManager=new f(_this2));});}},{key:"firstUpdated",value:function(){var _firstUpdated=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(t){var _this3=this;var i;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:this.panel.hidden=!this.open;this.open&&(this.addOpenListeners(),this.popup.active=!0);_context2.next=4;return this.updateComplete;case 4:i=this.trigger.assignedElements({flatten:!0})[0];this.visibilityManager=new w({host:this,target:i||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this3.open;},onAnchorOutOfView:function onAnchorOutOfView(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){_this3.hide(),_this3.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(t,i){return _this3.emit("nile-".concat(t),i);}});case 6:case"end":return _context2.stop();}},_callee,this);}));function firstUpdated(_x){return _firstUpdated.apply(this,arguments);}return firstUpdated;}()},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(y,"disconnectedCallback",this,3)([]),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.removeOpenListeners(),this.hide(),this.emit("nile-destroy"),this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null);}},{key:"focusOnTrigger",value:function focusOnTrigger(){var t=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(t===null||t===void 0?void 0:t.focus)&&t.focus();}},{key:"getMenu",value:function getMenu(){return this.panel.assignedElements({flatten:!0}).find(function(t){return"nile-menu"===t.tagName.toLowerCase();});}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide(),this.focusOnTrigger());}},{key:"handleDocumentKeyDown",value:function handleDocumentKeyDown(t){var _this4=this;if("Escape"===t.key&&this.open)return t.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===t.key){var _document$activeEleme;if(this.open&&"nile-menu-item"===((_document$activeEleme=document.activeElement)===null||_document$activeEleme===void 0?void 0:_document$activeEleme.tagName.toLowerCase()))return t.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout(function(){var _this4$containingElem,_document$activeEleme2,_this4$portalManager;var t=((_this4$containingElem=_this4.containingElement)===null||_this4$containingElem===void 0?void 0:_this4$containingElem.getRootNode())instanceof ShadowRoot?(_document$activeEleme2=document.activeElement)===null||_document$activeEleme2===void 0||(_document$activeEleme2=_document$activeEleme2.shadowRoot)===null||_document$activeEleme2===void 0?void 0:_document$activeEleme2.activeElement:document.activeElement,i=_this4.containingElement&&(t===null||t===void 0?void 0:t.closest(_this4.containingElement.tagName.toLowerCase()))===_this4.containingElement,s=_this4.portal&&((_this4$portalManager=_this4.portalManager)===null||_this4$portalManager===void 0?void 0:_this4$portalManager.portalContainerElement)&&(t===_this4.portalManager.portalContainerElement||(t===null||t===void 0?void 0:t.closest(".nile-dropdown-portal-append"))===_this4.portalManager.portalContainerElement);i||s||_this4.hide();});}}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$portalManager;var i=t.composedPath(),s=this.containingElement&&i.includes(this.containingElement),e=this.portal&&((_this$portalManager=this.portalManager)===null||_this$portalManager===void 0?void 0:_this$portalManager.portalContainerElement)&&i.includes(this.portalManager.portalContainerElement);s||e||this.hide();}},{key:"handlePanelSelect",value:function handlePanelSelect(t){var i=t.target;this.stayOpenOnSelect||"nile-menu"!==i.tagName.toLowerCase()?this.stayOpenOnSelect&&"nile-menu"===i.tagName.toLowerCase()&&(this.show(),this.focusOnTrigger()):(this.hide(),this.focusOnTrigger());}},{key:"handleTriggerClick",value:function handleTriggerClick(){this.noOpenOnClick||(this.open?this.hide():(this.show(),this.focusOnTrigger()));}},{key:"handleTriggerKeyDown",value:function handleTriggerKeyDown(t){var i=this.getMenu();if(i){var _s=i.getAllItems(),_e=_s[0],_n=_s[_s.length-1];["ArrowDown","ArrowUp","Home","End"].includes(t.key)&&(t.preventDefault(),this.open||this.show(),_s.length>0&&this.updateComplete.then(function(){"ArrowDown"!==t.key&&"Home"!==t.key||(i.setCurrentItem(_e),_e.focus()),"ArrowUp"!==t.key&&"End"!==t.key||(i.setCurrentItem(_n),_n.focus());}));}}},{key:"handleTriggerKeyUp",value:function handleTriggerKeyUp(t){" "===t.key&&t.preventDefault();}},{key:"handleTriggerSlotChange",value:function handleTriggerSlotChange(){this.updateAccessibleTrigger();}},{key:"updateAccessibleTrigger",value:function updateAccessibleTrigger(){var t=this.trigger.assignedElements({flatten:!0}).find(function(t){return p(t).start;});var i;if(t){switch(t.tagName.toLowerCase()){case"nile-button":case"nile-icon-button":i=t.button;break;default:i=t;}i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded",this.open?"true":"false");}}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(this.open){_context3.next=2;break;}return _context3.abrupt("return",(this.open=!0,c(this,"nile-after-show")));case 2:case"end":return _context3.stop();}},_callee2,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!this.open){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!1,c(this,"nile-after-hide")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"reposition",value:function reposition(){this.popup.reposition();}},{key:"addOpenListeners",value:function addOpenListeners(){this.panel.addEventListener("nile-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"removeOpenListeners",value:function removeOpenListeners(){this.panel&&(this.panel.removeEventListener("nile-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown);}},{key:"updated",value:function updated(t){_superPropGet(y,"updated",this,3)([t]),t.has("portal")&&(this.portal&&!this.portalManager?(this.portalManager=new f(this),this.open&&this.portalManager.setupPortalAppend()):!this.portal&&this.portalManager&&(this.portalManager.cleanupPortalAppend(),this.portalManager=null)),t.has("disabled")&&this.updateTriggerDisabledState();}},{key:"updateTriggerDisabledState",value:function updateTriggerDisabledState(){var t=this.querySelector('[slot="trigger"]');t&&"disabled"in t&&(t.disabled=this.disabled);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _this$visibilityManag2;var _d,_t,_i,_this$visibilityManag3,_d2,_t2,_i2;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),this.disabled)){_context5.next=4;break;}this.open=!1;_context5.next=31;break;case 4:if(!(this.updateAccessibleTrigger(),this.open)){_context5.next=18;break;}this.emit("nile-show");this.addOpenListeners();this.portal&&this.portalManager?this.portalManager.setupPortalAppend():this.portal&&!this.portalManager&&(this.portalManager=new f(this),this.portalManager.setupPortalAppend());_context5.next=10;return h(this);case 10:if(this.portal){_context5.next=15;break;}this.panel.hidden=!1,this.popup.active=!0;_d=d(this,"dropdown.show",{dir:""}),_t=_d.keyframes,_i=_d.options;_context5.next=15;return a(this.popup.popup,_t,_i);case 15:this.emit("nile-after-show");_context5.next=31;break;case 18:this.emit("nile-hide");this.removeOpenListeners();(_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup();this.portal&&this.portalManager&&this.portalManager.cleanupPortalAppend();_context5.next=24;return h(this);case 24:if(this.portal){_context5.next=30;break;}_d2=d(this,"dropdown.hide",{dir:""}),_t2=_d2.keyframes,_i2=_d2.options;_context5.next=28;return a(this.popup.popup,_t2,_i2);case 28:this.panel.hidden=!0;this.popup.active=!1;case 30:this.emit("nile-after-hide");case 31:case"end":return _context5.stop();}},_callee4,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n id=\"dropdown\"\n placement=","\n distance=","\n skidding=","\n strategy=","\n sync=","\n flip\n shift\n auto-size=\"both\"\n auto-size-padding=\"10\"\n class=","\n >\n <slot\n name=\"trigger\"\n slot=\"anchor\"\n part=\"trigger\"\n class=\"dropdown__trigger\"\n @click=","\n @keydown=","\n @keyup=","\n @slotchange=","\n ></slot>\n\n <slot\n part=\"panel\"\n class=\"dropdown__panel\"\n aria-hidden=","\n aria-labelledby=\"dropdown\"\n style=","\n ></slot>\n </nile-popup>\n "])),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",this.sync,r({dropdown:!0,"dropdown--open":this.open}),this.handleTriggerClick,this.handleTriggerKeyDown,this.handleTriggerKeyUp,this.handleTriggerSlotChange,this.open?"false":"true",this.portal&&this.portalManager?"display: none;":"");}}]);}(u));y.styles=o,t([s(".dropdown")],y.prototype,"popup",void 0),t([s(".dropdown__trigger")],y.prototype,"trigger",void 0),t([s(".dropdown__panel")],y.prototype,"panel",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"open",void 0),t([e({reflect:!0})],y.prototype,"placement",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"disabled",void 0),t([e({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],y.prototype,"stayOpenOnSelect",void 0),t([e({attribute:!1})],y.prototype,"containingElement",void 0),t([e({type:Number})],y.prototype,"distance",void 0),t([e({type:Boolean})],y.prototype,"noOpenOnClick",void 0),t([e({type:Number})],y.prototype,"skidding",void 0),t([e()],y.prototype,"sync",void 0),t([e({type:Boolean})],y.prototype,"hoist",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"portal",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"enableVisibilityEffect",void 0),t([e({type:Boolean,reflect:!0})],y.prototype,"enableTabClose",void 0),t([m("open",{waitUntilFirstUpdate:!0})],y.prototype,"handleOpenChange",null),_export("N",y=t([n("nile-dropdown")],y)),l("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),l("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});}};});
2
2
  //# sourceMappingURL=nile-dropdown.cjs.js.map