@aquera/nile-elements 1.2.8-beta-1.9 → 1.2.8

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 (183) hide show
  1. package/README.md +4 -0
  2. package/demo/index.html +14 -70
  3. package/dist/index.js +10 -10
  4. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  5. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.esm.js +8 -8
  7. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  8. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  9. package/dist/nile-chip/nile-chip.esm.js +1 -1
  10. package/dist/src/nile-auto-complete/nile-auto-complete.js +22 -10
  11. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  12. package/dist/src/nile-chip/nile-chip.js +14 -2
  13. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  14. package/dist/src/version.js +1 -1
  15. package/dist/src/version.js.map +1 -1
  16. package/dist/tsconfig.tsbuildinfo +1 -1
  17. package/package.json +1 -1
  18. package/src/nile-auto-complete/nile-auto-complete.ts +32 -18
  19. package/src/nile-chip/nile-chip.ts +17 -3
  20. package/dist/assets/nile-elements-4b5c262d.css +0 -1
  21. package/dist/fixture-d1470b58.cjs.js +0 -395
  22. package/dist/fixture-d1470b58.cjs.js.map +0 -1
  23. package/dist/nile-grid/nile-grid.types.cjs.js +0 -2
  24. package/dist/nile-grid/nile-grid.types.cjs.js.map +0 -1
  25. package/dist/nile-grid/nile-grid.types.esm.js +0 -1
  26. package/dist/nile-grid-body/index.cjs.js +0 -2
  27. package/dist/nile-grid-body/index.cjs.js.map +0 -1
  28. package/dist/nile-grid-body/index.esm.js +0 -1
  29. package/dist/nile-grid-body/nile-grid-body.cjs.js +0 -2
  30. package/dist/nile-grid-body/nile-grid-body.cjs.js.map +0 -1
  31. package/dist/nile-grid-body/nile-grid-body.css.cjs.js +0 -2
  32. package/dist/nile-grid-body/nile-grid-body.css.cjs.js.map +0 -1
  33. package/dist/nile-grid-body/nile-grid-body.css.esm.js +0 -10
  34. package/dist/nile-grid-body/nile-grid-body.esm.js +0 -5
  35. package/dist/nile-grid-cell-item/index.cjs.js +0 -2
  36. package/dist/nile-grid-cell-item/index.cjs.js.map +0 -1
  37. package/dist/nile-grid-cell-item/index.esm.js +0 -1
  38. package/dist/nile-grid-cell-item/nile-grid-cell-item.cjs.js +0 -2
  39. package/dist/nile-grid-cell-item/nile-grid-cell-item.cjs.js.map +0 -1
  40. package/dist/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js +0 -2
  41. package/dist/nile-grid-cell-item/nile-grid-cell-item.css.cjs.js.map +0 -1
  42. package/dist/nile-grid-cell-item/nile-grid-cell-item.css.esm.js +0 -35
  43. package/dist/nile-grid-cell-item/nile-grid-cell-item.esm.js +0 -12
  44. package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js +0 -2
  45. package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.cjs.js.map +0 -1
  46. package/dist/nile-grid-cell-item/nile-grid-cell-item.utils.esm.js +0 -1
  47. package/dist/nile-grid-head/index.cjs.js +0 -2
  48. package/dist/nile-grid-head/index.cjs.js.map +0 -1
  49. package/dist/nile-grid-head/index.esm.js +0 -1
  50. package/dist/nile-grid-head/nile-grid-head.cjs.js +0 -2
  51. package/dist/nile-grid-head/nile-grid-head.cjs.js.map +0 -1
  52. package/dist/nile-grid-head/nile-grid-head.css.cjs.js +0 -2
  53. package/dist/nile-grid-head/nile-grid-head.css.cjs.js.map +0 -1
  54. package/dist/nile-grid-head/nile-grid-head.css.esm.js +0 -7
  55. package/dist/nile-grid-head/nile-grid-head.esm.js +0 -5
  56. package/dist/nile-grid-head-item/index.cjs.js +0 -2
  57. package/dist/nile-grid-head-item/index.cjs.js.map +0 -1
  58. package/dist/nile-grid-head-item/index.esm.js +0 -1
  59. package/dist/nile-grid-head-item/nile-grid-head-item.cjs.js +0 -2
  60. package/dist/nile-grid-head-item/nile-grid-head-item.cjs.js.map +0 -1
  61. package/dist/nile-grid-head-item/nile-grid-head-item.css.cjs.js +0 -2
  62. package/dist/nile-grid-head-item/nile-grid-head-item.css.cjs.js.map +0 -1
  63. package/dist/nile-grid-head-item/nile-grid-head-item.css.esm.js +0 -34
  64. package/dist/nile-grid-head-item/nile-grid-head-item.esm.js +0 -12
  65. package/dist/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +0 -2
  66. package/dist/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +0 -1
  67. package/dist/nile-grid-head-item/nile-grid-head-item.utils.esm.js +0 -1
  68. package/dist/nile-grid-row/index.cjs.js +0 -2
  69. package/dist/nile-grid-row/index.cjs.js.map +0 -1
  70. package/dist/nile-grid-row/index.esm.js +0 -1
  71. package/dist/nile-grid-row/nile-grid-row.cjs.js +0 -2
  72. package/dist/nile-grid-row/nile-grid-row.cjs.js.map +0 -1
  73. package/dist/nile-grid-row/nile-grid-row.css.cjs.js +0 -2
  74. package/dist/nile-grid-row/nile-grid-row.css.cjs.js.map +0 -1
  75. package/dist/nile-grid-row/nile-grid-row.css.esm.js +0 -15
  76. package/dist/nile-grid-row/nile-grid-row.esm.js +0 -7
  77. package/dist/nile-light-tooltip/index.esm.js +0 -1
  78. package/dist/nile-light-tooltip/nile-light-tooltip.css.esm.js +0 -6
  79. package/dist/nile-light-tooltip/nile-light-tooltip.esm.js +0 -1
  80. package/dist/nile-rich-text-editor/utils.cjs.js +0 -2
  81. package/dist/nile-rich-text-editor/utils.cjs.js.map +0 -1
  82. package/dist/nile-rich-text-editor/utils.esm.js +0 -1
  83. package/dist/scopedElementsWrapper-c815042c.cjs.js +0 -2
  84. package/dist/scopedElementsWrapper-c815042c.cjs.js.map +0 -1
  85. package/dist/src/nile-grid/nile-grid.types.d.ts +0 -3
  86. package/dist/src/nile-grid/nile-grid.types.js +0 -2
  87. package/dist/src/nile-grid/nile-grid.types.js.map +0 -1
  88. package/dist/src/nile-grid-body/index.d.ts +0 -1
  89. package/dist/src/nile-grid-body/index.js +0 -2
  90. package/dist/src/nile-grid-body/index.js.map +0 -1
  91. package/dist/src/nile-grid-body/nile-grid-body.css.d.ts +0 -12
  92. package/dist/src/nile-grid-body/nile-grid-body.css.js +0 -22
  93. package/dist/src/nile-grid-body/nile-grid-body.css.js.map +0 -1
  94. package/dist/src/nile-grid-body/nile-grid-body.d.ts +0 -29
  95. package/dist/src/nile-grid-body/nile-grid-body.js +0 -43
  96. package/dist/src/nile-grid-body/nile-grid-body.js.map +0 -1
  97. package/dist/src/nile-grid-cell-item/index.d.ts +0 -1
  98. package/dist/src/nile-grid-cell-item/index.js +0 -2
  99. package/dist/src/nile-grid-cell-item/index.js.map +0 -1
  100. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.d.ts +0 -12
  101. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.js +0 -47
  102. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.css.js.map +0 -1
  103. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.d.ts +0 -36
  104. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.js +0 -93
  105. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.js.map +0 -1
  106. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.d.ts +0 -10
  107. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.js +0 -34
  108. package/dist/src/nile-grid-cell-item/nile-grid-cell-item.utils.js.map +0 -1
  109. package/dist/src/nile-grid-head/index.d.ts +0 -1
  110. package/dist/src/nile-grid-head/index.js +0 -2
  111. package/dist/src/nile-grid-head/index.js.map +0 -1
  112. package/dist/src/nile-grid-head/nile-grid-head.css.d.ts +0 -12
  113. package/dist/src/nile-grid-head/nile-grid-head.css.js +0 -19
  114. package/dist/src/nile-grid-head/nile-grid-head.css.js.map +0 -1
  115. package/dist/src/nile-grid-head/nile-grid-head.d.ts +0 -28
  116. package/dist/src/nile-grid-head/nile-grid-head.js +0 -41
  117. package/dist/src/nile-grid-head/nile-grid-head.js.map +0 -1
  118. package/dist/src/nile-grid-head-item/index.d.ts +0 -1
  119. package/dist/src/nile-grid-head-item/index.js +0 -2
  120. package/dist/src/nile-grid-head-item/index.js.map +0 -1
  121. package/dist/src/nile-grid-head-item/nile-grid-head-item.css.d.ts +0 -12
  122. package/dist/src/nile-grid-head-item/nile-grid-head-item.css.js +0 -46
  123. package/dist/src/nile-grid-head-item/nile-grid-head-item.css.js.map +0 -1
  124. package/dist/src/nile-grid-head-item/nile-grid-head-item.d.ts +0 -37
  125. package/dist/src/nile-grid-head-item/nile-grid-head-item.js +0 -100
  126. package/dist/src/nile-grid-head-item/nile-grid-head-item.js.map +0 -1
  127. package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.d.ts +0 -10
  128. package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.js +0 -34
  129. package/dist/src/nile-grid-head-item/nile-grid-head-item.utils.js.map +0 -1
  130. package/dist/src/nile-grid-row/index.d.ts +0 -1
  131. package/dist/src/nile-grid-row/index.js +0 -2
  132. package/dist/src/nile-grid-row/index.js.map +0 -1
  133. package/dist/src/nile-grid-row/nile-grid-row.css.d.ts +0 -12
  134. package/dist/src/nile-grid-row/nile-grid-row.css.js +0 -27
  135. package/dist/src/nile-grid-row/nile-grid-row.css.js.map +0 -1
  136. package/dist/src/nile-grid-row/nile-grid-row.d.ts +0 -29
  137. package/dist/src/nile-grid-row/nile-grid-row.js +0 -45
  138. package/dist/src/nile-grid-row/nile-grid-row.js.map +0 -1
  139. package/dist/src/nile-light-tooltip/index.d.ts +0 -1
  140. package/dist/src/nile-light-tooltip/index.js +0 -2
  141. package/dist/src/nile-light-tooltip/index.js.map +0 -1
  142. package/dist/src/nile-light-tooltip/nile-light-tooltip.css.d.ts +0 -12
  143. package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js +0 -18
  144. package/dist/src/nile-light-tooltip/nile-light-tooltip.css.js.map +0 -1
  145. package/dist/src/nile-light-tooltip/nile-light-tooltip.d.ts +0 -40
  146. package/dist/src/nile-light-tooltip/nile-light-tooltip.js +0 -101
  147. package/dist/src/nile-light-tooltip/nile-light-tooltip.js.map +0 -1
  148. package/dist/src/nile-menu/virtual-menu-search-manager.d.ts +0 -11
  149. package/dist/src/nile-menu/virtual-menu-search-manager.js +0 -43
  150. package/dist/src/nile-menu/virtual-menu-search-manager.js.map +0 -1
  151. package/dist/src/nile-rich-text-editor/utils.d.ts +0 -13
  152. package/dist/src/nile-rich-text-editor/utils.js +0 -538
  153. package/dist/src/nile-rich-text-editor/utils.js.map +0 -1
  154. package/dist/src/nile-sidebar/index.d.ts +0 -28
  155. package/dist/src/nile-sidebar/index.js +0 -116
  156. package/dist/src/nile-sidebar/index.js.map +0 -1
  157. package/dist/src/nile-sidebar-menu/index.d.ts +0 -1
  158. package/dist/src/nile-sidebar-menu/index.js +0 -2
  159. package/dist/src/nile-sidebar-menu/index.js.map +0 -1
  160. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.d.ts +0 -12
  161. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js +0 -47
  162. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js.map +0 -1
  163. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.d.ts +0 -37
  164. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js +0 -84
  165. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js.map +0 -1
  166. package/dist/src/nile-sidebar-menu-items/index.d.ts +0 -1
  167. package/dist/src/nile-sidebar-menu-items/index.js +0 -2
  168. package/dist/src/nile-sidebar-menu-items/index.js.map +0 -1
  169. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.d.ts +0 -12
  170. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js +0 -45
  171. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js.map +0 -1
  172. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.d.ts +0 -35
  173. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js +0 -78
  174. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js.map +0 -1
  175. package/dist/src/nile-sidebar-wrapper/index.d.ts +0 -1
  176. package/dist/src/nile-sidebar-wrapper/index.js +0 -2
  177. package/dist/src/nile-sidebar-wrapper/index.js.map +0 -1
  178. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.d.ts +0 -12
  179. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js +0 -114
  180. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js.map +0 -1
  181. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.d.ts +0 -35
  182. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js +0 -89
  183. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js.map +0 -1
package/README.md CHANGED
@@ -79,6 +79,10 @@ To run a local development server that serves the basic demo located in `demo/in
79
79
 
80
80
  In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
81
81
 
82
+ #### Version 1.2.8
83
+ - Nile autocomplete & Chip: Portal feature added (UIF-1008)
84
+ - Nile Chip: Tooltip added to Tags and Menu (UIF-1009)
85
+
82
86
  #### Version 1.2.7
83
87
  - Nile Popover: Portal feature added (UIF-1004)
84
88
  - New Component: Nile Lite Tooltip (UIF-1002)
package/demo/index.html CHANGED
@@ -1,90 +1,34 @@
1
-
2
-
3
-
4
1
  <!DOCTYPE html>
5
2
  <html lang="en-GB">
6
3
  <head>
7
4
  <meta charset="utf-8" />
8
- <title>Nile Chip Tooltip Demo</title>
9
5
  <link rel="stylesheet" href="nxtgen.css" id="stylesheet" />
6
+ <!-- <link rel="stylesheet" href="variables.css" id="stylesheet" /> -->
7
+ <link rel="stylesheet" href="index.css" />
10
8
 
11
- <script type="module" src="index.js"></script>
12
9
  <style>
13
- body {
14
- font-family: Arial, sans-serif;
15
- padding: 2rem;
16
- }
17
-
18
10
 
19
11
  </style>
12
+ <script type="module" src="index.js"></script>
20
13
  </head>
21
-
22
- <body>
23
-
24
- <nile-lite-tooltip content=" Tooltip on SVG" followCursor="true">
25
- <svg height="150" width="150"><line x1="0" y1="0" x2="150" y2="150" style="stroke: blue; stroke-width: 5;"></line></svg>
26
- </nile-lite-tooltip>
27
-
28
-
29
- <nile-lite-tooltip singleton placement="top">
30
- <div class="variant-example" style=" display: flex; flex-direction: row; gap: 16px;">
31
- <div content="Tooltip 1" class="square">Tooltip 1</div>
32
- <div content="Tooltip 2" class="square">Tooltip 2</div>
33
- <div content="Tooltip 3" class="square">Tooltip 3</div>
34
- </div>
35
- </nile-lite-tooltip>
36
-
37
- <div id="toolbar" style="display: flex; flex-direction: row; gap: 16px;">
38
- <nile-button content="Copy">Copy</nile-button>
39
- <nile-button content="Paste">Paste</nile-button>
40
- <nile-button content="Delete">Delete</nile-button>
41
- </div>
42
-
43
- <nile-lite-tooltip for="toolbar" singleton></nile-lite-tooltip>
14
+ <body>
44
15
 
45
16
 
46
- <nile-button class="toolbar2" content="Copy1">Copy1</nile-button>
47
- <nile-button class="toolbar2" content="Paste1">Paste1</nile-button>
48
- <nile-button class="toolbar2" content="Delete1">Delete1</nile-button>
49
-
50
-
51
- <nile-lite-tooltip for="toolbar2" singleton></nile-lite-tooltip>
52
-
53
-
54
- <nile-chip id="chip-with-tooltips" acceptUserInput showTooltip></nile-chip>
55
- <nile-chip id="chip-without-tooltips" acceptUserInput></nile-chip>
56
-
57
- <nile-auto-complete showTooltips allMenuItems='["Apple", "Banana", "Grapes", "Mango", "Orange"]' placeholder="Type a fruit"></nile-auto-complete>
58
-
59
- <script>
60
17
 
61
- const optionsWithTooltips = [
62
- { id: 1, name: "<span style='color: red;'> Birat </span>", tooltip: { content: "<b>React</b> — UI library by Meta", for: "menu" } },
63
- { id: 2, name: "Angular", tooltip: { content: "<b>Angular</b> — Framework by Google", for: "tag" } },
64
- { id: 3, name: "Vue", tooltip: { content: "<b>Vue</b> — Lightweight & reactive" } },
65
- { id: 4, name: "Tailwind", tooltip: { content: "<b>Tailwind</b> — Utility-first CSS", for: "menu" } },
66
- ];
67
18
 
68
-
69
-
70
- document.addEventListener ("nile-chip-change", (event) => {
71
- console.log(event.detail);
72
- });
73
19
 
74
- const chipWithTooltips = document.querySelector("#chip-with-tooltips");
75
- chipWithTooltips.autoCompleteOptions = optionsWithTooltips;
76
20
 
21
+ <!-- <nile-input
22
+ type="password"
23
+ canSavePassword>
24
+ </nile-input>
25
+ -->
77
26
 
78
- chipWithTooltips.renderItemFunction = (item) => item.name;
79
27
 
80
-
81
- chipWithTooltips.filterFunction = (item, search) =>
82
- item.name.toLowerCase().includes(search.toLowerCase());
28
+ <nile-chip
29
+ autoCompleteOptions='["React", "Angular", "Vue", "Tailwind"]'
30
+ acceptUserInput
31
+ ></nile-chip>
83
32
 
84
-
85
- const chipWithoutTooltips = document.querySelector("#chip-without-tooltips");
86
- chipWithoutTooltips.autoCompleteOptions = ["React", "Angular", "Vue", "Tailwind"];
87
- </script>
88
33
  </body>
89
- </html>
90
-
34
+ </html>
package/dist/index.js CHANGED
@@ -5766,15 +5766,15 @@ class wM{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
5766
5766
  `}getContent(){return R`
5767
5767
  <nile-menu id="content-menu" @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper" style=${this.portal?"display: none;":""}>
5768
5768
  ${this.menuItems.map((e=>this.getItemRenderFunction(e)))}
5769
- </nile-menu>`}getItemRenderFunction(e){const t=this.renderItemFunction(e),i=!!e.tooltip,M=i&&(!e.tooltip.for||"menu"===e.tooltip.for),n=i?e.tooltip.content:t;return M?R`
5770
- <nile-menu-item value=${t}>
5771
- <nile-lite-tooltip allowHTML .content=${n}>
5772
- <span class="menu-item-text">${pe(t)}</span>
5773
- </nile-lite-tooltip>
5774
- </nile-menu-item>
5775
- `:R`
5769
+ </nile-menu>`}getItemRenderFunction(e){const t=this.renderItemFunction(e);if(!(!!e.tooltip&&(!e.tooltip.for||"menu"===e.tooltip.for)))return R`
5776
5770
  <nile-menu-item value=${t}>${pe(t)}</nile-menu-item>
5777
- `}handleSelect(e){this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const e=this.menuItems.reduce(((e,t)=>{const i=this.renderItemFunction(t).length;return e>i?e:i}),0),t=9.5*e<110?110:9.5*e;this.style.setProperty("--virtual-scroll-container-width",t+"px")}handleSearch(e){this.value=e.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&(this.dropdownElement?.show(),this.portal&&this.portalManager.updatePortalOptions())}handleFocus(){this.openOnFocus&&(this.portal&&this.inputElement?.focus(),setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300))}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(e,t){if("object"!=typeof e)return[];const i=[];return e.forEach((e=>t(e,this.value)&&i.push(e))),i}};an.styles=Mn,e([Ie("nile-dropdown")],an.prototype,"dropdownElement",void 0),e([Ie("nile-input")],an.prototype,"inputElement",void 0),e([De({type:Boolean})],an.prototype,"disabled",void 0),e([De({type:Boolean})],an.prototype,"isDropdownOpen",void 0),e([De({type:Boolean,reflect:!0})],an.prototype,"portal",void 0),e([De({type:Boolean})],an.prototype,"enableVirtualScroll",void 0),e([De({type:Boolean})],an.prototype,"openOnFocus",void 0),e([De({type:String})],an.prototype,"value",void 0),e([De({type:String})],an.prototype,"placeholder",void 0),e([De({type:Boolean})],an.prototype,"noBorder",void 0),e([De({type:Boolean})],an.prototype,"noOutline",void 0),e([De({type:Boolean})],an.prototype,"noPadding",void 0),e([De({type:Boolean})],an.prototype,"loading",void 0),e([De({attribute:!1})],an.prototype,"filterFunction",void 0),e([De({attribute:!1})],an.prototype,"renderItemFunction",void 0),e([De({type:Array})],an.prototype,"allMenuItems",void 0),e([ce()],an.prototype,"menuItems",void 0),e([We("portal",{waitUntilFirstUpdate:!0})],an.prototype,"handlePortalChange",null),an=e([Ne("nile-auto-complete")],an);const ln=r`
5771
+ `;let i=null;const M=e.tooltip.content;return M instanceof Promise?(i="Loading...",M.then((t=>{e.tooltip.content=t,this.requestUpdate()}))):i=M,R`
5772
+ <nile-menu-item value=${t}>
5773
+ <nile-lite-tooltip allowHTML .content=${i}>
5774
+ <span class="menu-item-text">${pe(t)}</span>
5775
+ </nile-lite-tooltip>
5776
+ </nile-menu-item>
5777
+ `}handleSelect(e){this.value=e.detail.value,this.emit("nile-complete",{value:e.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const e=this.menuItems.reduce(((e,t)=>{const i=this.renderItemFunction(t).length;return e>i?e:i}),0),t=9.5*e<110?110:9.5*e;this.style.setProperty("--virtual-scroll-container-width",t+"px")}handleSearch(e){this.value=e.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&(this.dropdownElement?.show(),this.portal&&this.portalManager.updatePortalOptions())}handleFocus(){this.openOnFocus&&(this.portal&&this.inputElement?.focus(),setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300))}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(e,t){if("object"!=typeof e)return[];const i=[];return e.forEach((e=>t(e,this.value)&&i.push(e))),i}};an.styles=Mn,e([Ie("nile-dropdown")],an.prototype,"dropdownElement",void 0),e([Ie("nile-input")],an.prototype,"inputElement",void 0),e([De({type:Boolean})],an.prototype,"disabled",void 0),e([De({type:Boolean})],an.prototype,"isDropdownOpen",void 0),e([De({type:Boolean,reflect:!0})],an.prototype,"portal",void 0),e([De({type:Boolean})],an.prototype,"enableVirtualScroll",void 0),e([De({type:Boolean})],an.prototype,"openOnFocus",void 0),e([De({type:String})],an.prototype,"value",void 0),e([De({type:String})],an.prototype,"placeholder",void 0),e([De({type:Boolean})],an.prototype,"noBorder",void 0),e([De({type:Boolean})],an.prototype,"noOutline",void 0),e([De({type:Boolean})],an.prototype,"noPadding",void 0),e([De({type:Boolean})],an.prototype,"loading",void 0),e([De({attribute:!1})],an.prototype,"filterFunction",void 0),e([De({attribute:!1})],an.prototype,"renderItemFunction",void 0),e([De({type:Array})],an.prototype,"allMenuItems",void 0),e([ce()],an.prototype,"menuItems",void 0),e([We("portal",{waitUntilFirstUpdate:!0})],an.prototype,"handlePortalChange",null),an=e([Ne("nile-auto-complete")],an);const ln=r`
5778
5778
  :host {
5779
5779
  box-sizing: border-box;
5780
5780
  -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));
@@ -6028,7 +6028,7 @@ box-shadow: none;
6028
6028
  >
6029
6029
  `:""}
6030
6030
  </div>
6031
- `}handleSelect(e){const t=e.detail.value,i=this.autoCompleteOptions.find((e=>e.name===t||e.id===t));let M=null;if(i?.tooltip){const{content:e,for:t}=i.tooltip;t&&"tag"!==t||(M=e)}this.noDuplicates&&this.tags.includes(t)||(this.tags=[...this.tags,t],this.tooltips=[...this.tooltips,M],this.emit("nile-chip-change",{value:this.tags}),this.resetInput())}handleRemove(e){this.tags=this.tags.filter((t=>t!==e)),this.noDuplicates&&this.autoCompleteOptions.includes(e)&&(this.filteredAutoCompleteOptions=[...this.filteredAutoCompleteOptions,e]),this.emit("nile-chip-change",{value:this.tags})}handleInputChange(e){this.inputValue=e.detail.value}handleInputKeydown(e){this.acceptUserInput&&("Tab"===e.key&&e.preventDefault(),"Enter"!==e.key&&"Tab"!==e.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(e.preventDefault(),this.tags=[...this.tags,this.inputValue],this.resetInput(),this.emit("nile-chip-change",{value:this.tags})),"Enter"!==e.key&&"Tab"!==e.key||!this.inputValue||!this.noDuplicates&&!this.tags.includes(this.inputValue)||this.emit("nile-duplicates-blocked"))}handleFocus(){this.noAutoComplete||(this.isDropdownOpen=!0)}onTagsChanged(){this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter((e=>!this.tags.includes(e))))}resetInput(){this.inputValue="",this.isDropdownOpen=!1,!this.noAutoComplete&&this.autoComplete&&(this.autoComplete.value="",this.autoComplete.handleFocus())}};e([ce()],Nn.prototype,"tags",void 0),e([ce()],Nn.prototype,"inputValue",void 0),e([ce()],Nn.prototype,"isDropdownOpen",void 0),e([ce()],Nn.prototype,"tooltips",void 0),e([Ie("nile-auto-complete")],Nn.prototype,"autoComplete",void 0),e([De({type:Boolean})],Nn.prototype,"warning",void 0),e([De({type:Boolean})],Nn.prototype,"noAutoComplete",void 0),e([De({type:Boolean})],Nn.prototype,"error",void 0),e([De({type:Boolean})],Nn.prototype,"success",void 0),e([De({type:Boolean})],Nn.prototype,"noDuplicates",void 0),e([De()],Nn.prototype,"label",void 0),e([De({type:String})],Nn.prototype,"tagVariant",void 0),e([De({type:Boolean})],Nn.prototype,"acceptUserInput",void 0),e([De({type:Boolean})],Nn.prototype,"clearable",void 0),e([De()],Nn.prototype,"placeholder",void 0),e([De({type:Boolean,reflect:!0})],Nn.prototype,"readonly",void 0),e([De({type:Boolean,reflect:!0})],Nn.prototype,"disabled",void 0),e([De({type:Boolean,reflect:!0})],Nn.prototype,"portal",void 0),e([De({type:Boolean})],Nn.prototype,"enableVirtualScroll",void 0),e([De({type:Array})],Nn.prototype,"autoCompleteOptions",void 0),e([De({type:Array})],Nn.prototype,"filteredAutoCompleteOptions",void 0),e([De({type:Array})],Nn.prototype,"value",void 0),e([De({type:Boolean})],Nn.prototype,"noWrap",void 0),e([De({type:Boolean})],Nn.prototype,"loading",void 0),e([De({type:Array})],Nn.prototype,"errorIndexes",void 0),e([De({attribute:"help-text",reflect:!0})],Nn.prototype,"helpText",void 0),e([De({attribute:"error-message",reflect:!0})],Nn.prototype,"errorMessage",void 0),e([De({attribute:!1})],Nn.prototype,"filterFunction",void 0),e([De({attribute:!1})],Nn.prototype,"renderItemFunction",void 0),e([De({type:Boolean})],Nn.prototype,"showTooltip",void 0),Nn=e([Ne("nile-chip")],Nn);const gn=r`
6031
+ `}handleSelect(e){const t=e.detail.value,i=this.autoCompleteOptions.find((e=>e.name===t||e.id===t));let M=null;if(i?.tooltip){const{content:e,for:t}=i.tooltip;if(!t||"tag"===t)if(e instanceof Promise){this.tooltips=[...this.tooltips,"Loading..."];const t=this.tooltips.length-1;e.then((e=>{this.tooltips[t]=e,this.requestUpdate()}))}else M=e}this.noDuplicates&&this.tags.includes(t)||(this.tags=[...this.tags,t],i?.tooltip?.content instanceof Promise||(this.tooltips=[...this.tooltips,M]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput())}handleRemove(e){this.tags=this.tags.filter((t=>t!==e)),this.noDuplicates&&this.autoCompleteOptions.includes(e)&&(this.filteredAutoCompleteOptions=[...this.filteredAutoCompleteOptions,e]),this.emit("nile-chip-change",{value:this.tags})}handleInputChange(e){this.inputValue=e.detail.value}handleInputKeydown(e){this.acceptUserInput&&("Tab"===e.key&&e.preventDefault(),"Enter"!==e.key&&"Tab"!==e.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(e.preventDefault(),this.tags=[...this.tags,this.inputValue],this.resetInput(),this.emit("nile-chip-change",{value:this.tags})),"Enter"!==e.key&&"Tab"!==e.key||!this.inputValue||!this.noDuplicates&&!this.tags.includes(this.inputValue)||this.emit("nile-duplicates-blocked"))}handleFocus(){this.noAutoComplete||(this.isDropdownOpen=!0)}onTagsChanged(){this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter((e=>!this.tags.includes(e))))}resetInput(){this.inputValue="",this.isDropdownOpen=!1,!this.noAutoComplete&&this.autoComplete&&(this.autoComplete.value="",this.autoComplete.handleFocus())}};e([ce()],Nn.prototype,"tags",void 0),e([ce()],Nn.prototype,"inputValue",void 0),e([ce()],Nn.prototype,"isDropdownOpen",void 0),e([ce()],Nn.prototype,"tooltips",void 0),e([Ie("nile-auto-complete")],Nn.prototype,"autoComplete",void 0),e([De({type:Boolean})],Nn.prototype,"warning",void 0),e([De({type:Boolean})],Nn.prototype,"noAutoComplete",void 0),e([De({type:Boolean})],Nn.prototype,"error",void 0),e([De({type:Boolean})],Nn.prototype,"success",void 0),e([De({type:Boolean})],Nn.prototype,"noDuplicates",void 0),e([De()],Nn.prototype,"label",void 0),e([De({type:String})],Nn.prototype,"tagVariant",void 0),e([De({type:Boolean})],Nn.prototype,"acceptUserInput",void 0),e([De({type:Boolean})],Nn.prototype,"clearable",void 0),e([De()],Nn.prototype,"placeholder",void 0),e([De({type:Boolean,reflect:!0})],Nn.prototype,"readonly",void 0),e([De({type:Boolean,reflect:!0})],Nn.prototype,"disabled",void 0),e([De({type:Boolean,reflect:!0})],Nn.prototype,"portal",void 0),e([De({type:Boolean})],Nn.prototype,"enableVirtualScroll",void 0),e([De({type:Array})],Nn.prototype,"autoCompleteOptions",void 0),e([De({type:Array})],Nn.prototype,"filteredAutoCompleteOptions",void 0),e([De({type:Array})],Nn.prototype,"value",void 0),e([De({type:Boolean})],Nn.prototype,"noWrap",void 0),e([De({type:Boolean})],Nn.prototype,"loading",void 0),e([De({type:Array})],Nn.prototype,"errorIndexes",void 0),e([De({attribute:"help-text",reflect:!0})],Nn.prototype,"helpText",void 0),e([De({attribute:"error-message",reflect:!0})],Nn.prototype,"errorMessage",void 0),e([De({attribute:!1})],Nn.prototype,"filterFunction",void 0),e([De({attribute:!1})],Nn.prototype,"renderItemFunction",void 0),e([De({type:Boolean})],Nn.prototype,"showTooltip",void 0),Nn=e([Ne("nile-chip")],Nn);const gn=r`
6032
6032
  .form-control .form-control__label {
6033
6033
  display: none;
6034
6034
  }
@@ -14317,7 +14317,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
14317
14317
 
14318
14318
 
14319
14319
 
14320
- `,xS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let pS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),IS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(LS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=xS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?hS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){hS(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=cS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&dS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;jS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":IS(this.editorEl,"strong");break;case"italic":IS(this.editorEl,"em");break;case"underline":IS(this.editorEl,"u");break;case"left":jS(this.editorEl,"left");break;case"center":jS(this.editorEl,"center");break;case"right":jS(this.editorEl,"right");break;case"justify":jS(this.editorEl,"justify");break;case"ul":OS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":OS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=cS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=zS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=zS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([De({type:String,attribute:!0,reflect:!0})],pS.prototype,"value",void 0),e([De({type:Boolean,attribute:!0,reflect:!0})],pS.prototype,"noStyles",void 0),e([De({type:Boolean,attribute:"singlelineeditor",reflect:!0})],pS.prototype,"singleLineEditor",void 0),e([De({type:String})],pS.prototype,"placeholder",void 0),e([De({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],pS.prototype,"mentions",void 0),e([ce()],pS.prototype,"content",void 0),pS=e([Ne("nile-rich-text-editor")],pS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.2.8-beta-1.9"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const SS=r`
14320
+ `,xS={bold:"format_bold",italic:"format_italic",underline:"format_underline",link:"link_2",left:"format_align_left",center:"format_align_middle",right:"format_align_right",justify:"format_align_justify",ul:"format_list_bulleted",ol:"format_list_numbered",clear:"format_clear"};let pS=class extends ae{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,this.placeholder="",this.mentions={},this.content="",this.previewEl=null,this.toolbarEl=null,this.lastRange=null,this.buttonMap=new Map,this.headingSelect=null,this.fontSelect=null,this.colorInput=null,this.bgColorInput=null,this.colorSwatchEl=null,this.bgSwatchEl=null,this.containerEl=null,this.mentionsEl=null,this.onEditorKeydown=e=>{if(this.singleLineEditor&&"Enter"===e.key&&e.shiftKey)return void e.preventDefault();if(e.ctrlKey&&"i"===e.key.toLowerCase()&&(e.preventDefault(),IS(this.editorEl,"em"),this.updateContent(),this.updateToolbarState()),this.singleLineEditor&&"Enter"===e.key)return void e.preventDefault();if("Tab"!==e.key)return;e.preventDefault(),this.focusAndRestore();const t=window.getSelection();if(!t||0===t.rangeCount)return;const i=t.getRangeAt(0);if(e.shiftKey){if(i.collapsed&&i.startContainer.nodeType===Node.TEXT_NODE){const e=i.startContainer,M=i.startOffset,n=e.data.slice(0,M),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(M);const i=document.createRange();i.setStart(e,o.length),i.collapse(!0),t.removeAllRanges(),t.addRange(i),this.updateContent(),this.updateToolbarState()}}return}i.deleteContents();const M=document.createTextNode("\t");i.insertNode(M);const n=document.createRange();n.setStartAfter(M),n.collapse(!0),t.removeAllRanges(),t.addRange(n),this.updateContent(),this.updateToolbarState()},this.onSelectionChange=()=>{if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);this.editorEl.contains(t.commonAncestorContainer)&&(this.lastRange=t.cloneRange(),this.updateToolbarState())}}createRenderRoot(){return this}injectCss(e){if(this.querySelector("style[data-rte-style]"))return;const t=document.createElement("style");t.setAttribute("data-rte-style","true"),t.textContent=e,this.insertBefore(t,this.firstChild)}connectedCallback(){super.connectedCallback(),this.injectCss(LS.cssText),this.ensureStructure(),this.placeholder&&this.editorEl&&(this.editorEl.dataset.placeholder=this.placeholder),this.value&&!this.editorEl.innerHTML.trim()&&(this.editorEl.innerHTML=this.value),this.content=this.editorEl.innerHTML,this.toolbarEl&&this.wireAuthoredToolbar(this.toolbarEl),this.mentionsEl=this.querySelector("nile-rte-mentions"),this.mentionsEl&&(this.mentionsEl.attach?.(this.editorEl,this),this.mentionsEl.setExternalConfig?.(this.mentions)),this.wireEditor(),document.addEventListener("selectionchange",this.onSelectionChange,{passive:!0}),this.updateToolbarState(),this.syncPreview()}ensureStructure(){this.toolbarEl=this.querySelector("nile-rte-toolbar"),this.previewEl=this.querySelector("nile-rte-preview"),this.containerEl=this.querySelector(".rte-container"),this.containerEl||(this.containerEl=document.createElement("div"),this.containerEl.className="rte-container",this.appendChild(this.containerEl)),this.ensureEditor(),this.toolbarEl&&this.toolbarEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.toolbarEl),this.editorEl.parentElement!==this.containerEl&&this.containerEl.appendChild(this.editorEl),this.previewEl&&(this.previewEl.parentElement!==this&&this.appendChild(this.previewEl),this.previewEl.previousElementSibling!==this.containerEl&&this.insertBefore(this.previewEl,this.containerEl.nextSibling))}updateContentWithMention(e){this.updateContent(),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content,mention:e},bubbles:!0,composed:!0}))}disconnectedCallback(){document.removeEventListener("selectionchange",this.onSelectionChange),this.mentionsEl&&this.mentionsEl.detach&&this.mentionsEl.detach(),super.disconnectedCallback()}updated(e){e.has("value")&&this.editorEl&&this.value!==this.editorEl.innerHTML&&(this.editorEl.innerHTML=this.value||"<p><br></p>",this.content=this.editorEl.innerHTML,this.syncPreview()),e.has("singleLineEditor")&&(this.editorEl&&this.editorEl.classList.toggle("single-line",this.singleLineEditor),this.previewEl&&this.previewEl.classList.toggle("single-line",this.singleLineEditor))}ensureEditor(){if(this.editorEl=this.querySelector(".editor"),!this.editorEl){const e=document.createElement("article");e.className="editor",e.setAttribute("contenteditable","true"),this.editorEl=e}this.placeholder&&(this.editorEl.dataset.placeholder=this.placeholder),this.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const i=e.parentNode;if(!i)return;const M=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(M);i.insertBefore(n,e),i.removeChild(e);const o=document.createRange();o.setStartAfter(n),o.collapse(!0);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(o)}scrubBrokenMentions(){if(!this.editorEl)return;this.editorEl.querySelectorAll("span.mention").forEach((e=>{const t=e,i=t.getAttribute("data-mention-key"),M=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!i&&!!M&&o.length>0&&o.startsWith(n)&&o.includes(M);o&&r||this.unwrapMention(t,!0)}))}wireEditor(){this.editorEl.addEventListener("input",(()=>{this.ensureAtLeastOneParagraph(),this.scrubBrokenMentions(),this.updateContent(),this.updateToolbarState()})),this.editorEl.addEventListener("mouseup",(()=>{this.saveSelection(),this.updateToolbarState()})),this.editorEl.addEventListener("keyup",(e=>{this.saveSelection(),["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)&&this.updateToolbarState()})),this.editorEl.addEventListener("keydown",this.onEditorKeydown)}wireAuthoredToolbar(e){this.buttonMap.clear(),this.headingSelect=null,this.fontSelect=null,this.colorInput=null,Array.from(e.children).forEach((e=>{const t=e.tagName.toLowerCase();if("nile-rte-select"!==t||"align"!==e.getAttribute("type")){if("nile-rte-link"===t)return e.editorEl=this.editorEl,void e.addEventListener("link-changed",(()=>{this.updateContent(),this.updateToolbarState()}));if("nile-rte-toolbar-item"===t){let t=e.querySelector(":scope > nile-button");const i=e.getAttribute("name")||"",M=e.getAttribute("label")||i,n=e.getAttribute("icon"),o=e.innerHTML.trim().length>0;if(t||(t=document.createElement("nile-button"),t.variant="tertiary",t.size="small"),n)t.innerHTML=`<nile-icon name="${n}" aria-label="${M}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=xS[i];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${M}"></nile-icon>`:t.textContent=M||i,e.innerHTML=""}if(!t.isConnected){const i=document.createElement("nile-tooltip");i.setAttribute("content",M),i.appendChild(t),e.appendChild(i)}t.setAttribute("aria-label",M),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(i)));const r=this.buttonMap.get(i)??[];return r.push(t),void this.buttonMap.set(i,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:i}=e.detail;"backColor"===t?hS(this.editorEl,"backgroundColor",i,"data-rte-bg"):function(e,t){hS(e,"color",t,"data-rte-color")}(this.editorEl,i),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const i=e.detail;"heading"===t?function(e,t){const i=document.getSelection();if(!i||0===i.rangeCount)return;const M=cS(i.getRangeAt(0).startContainer,e);if(!M)return;if(M.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;M.firstChild;)n.appendChild(M.firstChild);M.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),i.removeAllRanges(),i.addRange(o)}(this.editorEl,i):"font"===t&&dS(this.editorEl,i),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;jS(this.editorEl,t),this.updateContent(),this.updateToolbarState()}))}))}saveSelection(){const e=window.getSelection();e&&e.rangeCount&&(this.lastRange=e.getRangeAt(0).cloneRange())}restoreSelection(){if(!this.lastRange)return;const e=document.getSelection();e&&(e.removeAllRanges(),e.addRange(this.lastRange))}focusAndRestore(){this.editorEl?.focus(),this.restoreSelection()}getCleanContent(){const e=this.editorEl.cloneNode(!0);return e.querySelectorAll("*").forEach((e=>{e.removeAttribute("style")})),e.innerHTML}insertList(e){if(this.restoreSelection(),!this.lastRange)return;const t=document.createElement(e),i=this.lastRange.extractContents(),M=document.createElement("div");M.appendChild(i),Array.from(M.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const i=document.createElement("li");i.appendChild(e),t.appendChild(i)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(t),this.saveSelection(),this.updateContent(),this.updateToolbarState()}ensureAtLeastOneParagraph(){const e=this.editorEl;if(!e)return;const t=""===(e.textContent??"").replace(/\u200B/g,"").trim();if(0===e.childNodes.length||t)return void(e.innerHTML="<p><br></p>");if(!e.querySelector("p,h1,h2,h3,h4,h5,h6,ul,ol,table,blockquote,pre")){const t=document.createElement("p");for(;e.firstChild;)t.appendChild(e.firstChild);return t.hasChildNodes()||t.appendChild(document.createElement("br")),void e.appendChild(t)}e.querySelectorAll("p").forEach((e=>{""===(e.textContent??"").replace(/\u200B/g,"")&&(e.innerHTML.toLowerCase().includes("<br")||(e.innerHTML="<br>"))}))}onToolbarCommand(e){switch(this.focusAndRestore(),e){case"bold":IS(this.editorEl,"strong");break;case"italic":IS(this.editorEl,"em");break;case"underline":IS(this.editorEl,"u");break;case"left":jS(this.editorEl,"left");break;case"center":jS(this.editorEl,"center");break;case"right":jS(this.editorEl,"right");break;case"justify":jS(this.editorEl,"justify");break;case"ul":OS(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":OS(this.editorEl,"ol"),this.updateContent(),this.updateToolbarState();break;case"link":break;case"clear":const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),t=[];for(;e.nextNode();){const i=e.currentNode;i.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(i.tagName)&&t.push(i)}for(const e of t){for(;e.firstChild;)e.parentNode?.insertBefore(e.firstChild,e);e.remove()}this.ensureAtLeastOneParagraph()}this.updateContent(),this.updateToolbarState()}setBtnActive(e,t){const i=this.buttonMap.get(e);if(i)for(const e of i)e.toggleAttribute("data-active",!!t)}updateToolbarState(){if(!this.editorEl)return;const e=document.getSelection();if(!e||0===e.rangeCount)return;const t=e.getRangeAt(0);if(!this.editorEl.contains(t.commonAncestorContainer))return;const i=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,M=getComputedStyle(i),n=cS(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const i=getComputedStyle(e).fontWeight;if(parseInt(i,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("em"===t||"i"===t)return!0;if("italic"===getComputedStyle(e).fontStyle)return!0}e=e.parentNode}return!1})(),s=(()=>{let e=i;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=getComputedStyle(e).textDecorationLine;if(t&&t.includes("underline"))return!0;if("u"===e.tagName.toLowerCase())return!0}e=e.parentNode}return!1})(),a=!!i.closest("a"),l=n.style.textAlign||getComputedStyle(n).textAlign||"start",N="start"===l?"left":l,g=!!i.closest("li")&&i.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",a),this.setBtnActive("left","left"===N&&!["center","right","justify"].includes(N)),this.setBtnActive("center","center"===N),this.setBtnActive("right","right"===N),this.setBtnActive("justify","justify"===N),this.setBtnActive("ul","ul"===g),this.setBtnActive("ol","ol"===g),this.headingSelect){const e=n.tagName.toLowerCase(),t=["h1","h2","h3"].includes(e)?e:"p";this.headingSelect.value!==t&&(this.headingSelect.value=t)}if(this.fontSelect){const e=(M.fontFamily||"").replace(/["']/g,"").split(",")[0].trim().toLowerCase();if(e)for(const t of Array.from(this.fontSelect.options))if(t.value.toLowerCase()===e){this.fontSelect.value=t.value;break}}if(this.colorInput){const e=zS(M.color);e&&this.colorInput.value.toLowerCase()!==e.toLowerCase()&&(this.colorInput.value=e),this.colorSwatchEl&&(this.colorSwatchEl.style.backgroundColor=this.colorInput.value)}if(this.bgColorInput){const e=getComputedStyle(i).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=zS(e);t&&this.bgColorInput.value.toLowerCase()!==t.toLowerCase()&&(this.bgColorInput.value=t)}this.bgSwatchEl&&(this.bgSwatchEl.style.backgroundColor=this.bgColorInput.value)}}syncPreview(){this.updateContent()}updateContent(){if(!this.editorEl)return;this.ensureAtLeastOneParagraph();const e=""===(this.editorEl.textContent??"").trim();this.editorEl.classList.toggle("empty",e);const t=this.editorEl.cloneNode(!0);if(this.noStyles)t.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const e=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),M=["font-weight","font-style","text-decoration","color","background-color","font-size","font-family","text-align","line-height","letter-spacing","white-space","vertical-align","list-style-position","padding-inline-start"];for(;e.nextNode()&&i.nextNode();){const t=e.currentNode,n=i.currentNode,o=window.getComputedStyle(t),r=M.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=t.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([De({type:String,attribute:!0,reflect:!0})],pS.prototype,"value",void 0),e([De({type:Boolean,attribute:!0,reflect:!0})],pS.prototype,"noStyles",void 0),e([De({type:Boolean,attribute:"singlelineeditor",reflect:!0})],pS.prototype,"singleLineEditor",void 0),e([De({type:String})],pS.prototype,"placeholder",void 0),e([De({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),i={};for(const e of Object.keys(t)){const M=t[e];Array.isArray(M)&&(i[e]=M.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return i}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],pS.prototype,"mentions",void 0),e([ce()],pS.prototype,"content",void 0),pS=e([Ne("nile-rich-text-editor")],pS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.2.8"',window.nileVersion="__NILE_VERSION__",window.process=window.process||{env:{NODE_ENV:"production"}});const SS=r`
14321
14321
  :host {
14322
14322
  --sidebar-width: 240px;
14323
14323
  --sidebar-collapsed-width: 70px;
@@ -1,2 +1,2 @@
1
- System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directives/unsafe-html.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,h,l,r,a,p,d,u,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,c;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;h=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_portalManagerCjsJs){p=_portalManagerCjsJs.A;},function(_virtualize002CjsJs){d=_virtualize002CjsJs.v;},function(_litDirectivesUnsafeHtmlJs){u=_litDirectivesUnsafeHtmlJs.unsafeHTML;},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_r){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.portal=!1,_this.portalManager=new p(_assertThisInitialized(_this)),_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.menuItems=[],_this.handleWindowResize=function(){_this.portalManager.updatePortalAppendPosition();},_this.handleWindowScroll=function(){_this.portalManager.updatePortalAppendPosition();};return _this;}_inherits(c,_r);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(c,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;},this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),this.portalManager.cleanupPortalAppend();}},{key:"updated",value:function updated(t){_superPropGet(c,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("portal")&&this.handlePortalChange();}},{key:"handlePortalChange",value:function handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend());}},{key:"handleDropdownOpenChange",value:function handleDropdownOpenChange(){this.isDropdownOpen?(this.addOpenListeners(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),this.portal&&this.portalManager.cleanupPortalAppend());}},{key:"addOpenListeners",value:function addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0));}},{key:"removeOpenListeners",value:function removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0);}},{key:"handleDocumentFocusIn",value:function handleDocumentFocusIn(t){var _this$dropdownElement;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide());}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$dropdownElement2;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.hide());}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input, base\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this2=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.portal?"display: none;":"",d({items:this.menuItems,renderItem:function renderItem(t){return _this2.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this3=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>"])),this.handleSelect,this.portal?"display: none;":"",this.menuItems.map(function(t){return _this3.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var e=this.renderItemFunction(t),s=!!t.tooltip,n=s&&(!t.tooltip["for"]||"menu"===t.tooltip["for"]),o=s?t.tooltip.content:e;return n?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n <nile-lite-tooltip allowHTML .content=",">\n <span class=\"menu-item-text\">","</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n "])),e,o,u(e)):i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,u(e));}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement3;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this4=this;var t=this.menuItems.reduce(function(t,i){var e=_this4.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement4;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement4=this.dropdownElement)!==null&&_this$dropdownElement4!==void 0&&_this$dropdownElement4.show(),this.portal&&this.portalManager.updatePortalOptions());}},{key:"handleFocus",value:function handleFocus(){var _this$inputElement,_this5=this;this.openOnFocus&&(this.portal&&(_this$inputElement=this.inputElement)!==null&&_this$inputElement!==void 0&&_this$inputElement.focus(),setTimeout(function(){var _this5$dropdownElemen;_this5.isDropdownOpen=!0,(_this5$dropdownElemen=_this5.dropdownElement)===null||_this5$dropdownElemen===void 0?void 0:_this5$dropdownElemen.show();},300));}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement5;this.isDropdownOpen=!0,(_this$dropdownElement5=this.dropdownElement)===null||_this$dropdownElement5===void 0?void 0:_this$dropdownElement5.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this6=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this6.value)&&e.push(t);}),e;}}]);}(r));c.styles=l,t([s("nile-dropdown")],c.prototype,"dropdownElement",void 0),t([s("nile-input")],c.prototype,"inputElement",void 0),t([n({type:Boolean})],c.prototype,"disabled",void 0),t([n({type:Boolean})],c.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],c.prototype,"portal",void 0),t([n({type:Boolean})],c.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],c.prototype,"openOnFocus",void 0),t([n({type:String})],c.prototype,"value",void 0),t([n({type:String})],c.prototype,"placeholder",void 0),t([n({type:Boolean})],c.prototype,"noBorder",void 0),t([n({type:Boolean})],c.prototype,"noOutline",void 0),t([n({type:Boolean})],c.prototype,"noPadding",void 0),t([n({type:Boolean})],c.prototype,"loading",void 0),t([n({attribute:!1})],c.prototype,"filterFunction",void 0),t([n({attribute:!1})],c.prototype,"renderItemFunction",void 0),t([n({type:Array})],c.prototype,"allMenuItems",void 0),t([o()],c.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],c.prototype,"handlePortalChange",null),_export("N",c=t([h("nile-auto-complete")],c));}};});
1
+ System.register(["tslib","lit","lit/decorators.js","./nile-auto-complete.css.cjs.js","../internal/nile-element.cjs.js","../internal/watch.cjs.js","./portal-manager.cjs.js","../virtualize-b6a2fbe0.cjs.js","lit/directives/unsafe-html.js","../floating-ui.dom-007bbe96.cjs.js","./portal-utils.cjs.js","lit/directive.js","lit/async-directive.js","lit/directives/repeat.js"],function(_export,_context){"use strict";var t,i,e,s,n,o,h,l,r,a,p,d,u,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,c;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;e=_lit.nothing;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;n=_litDecoratorsJs.property;o=_litDecoratorsJs.state;h=_litDecoratorsJs.customElement;},function(_nileAutoCompleteCssCjsJs){l=_nileAutoCompleteCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalWatchCjsJs){a=_internalWatchCjsJs.w;},function(_portalManagerCjsJs){p=_portalManagerCjsJs.A;},function(_virtualize002CjsJs){d=_virtualize002CjsJs.v;},function(_litDirectivesUnsafeHtmlJs){u=_litDirectivesUnsafeHtmlJs.unsafeHTML;},function(_floatingUiDom001CjsJs){},function(_portalUtilsCjsJs){},function(_litDirectiveJs){},function(_litAsyncDirectiveJs){},function(_litDirectivesRepeatJs){}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_r){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.disabled=!1,_this.isDropdownOpen=!1,_this.portal=!1,_this.portalManager=new p(_assertThisInitialized(_this)),_this.enableVirtualScroll=!1,_this.openOnFocus=!1,_this.value="",_this.placeholder="Type here ..",_this.noBorder=!1,_this.noOutline=!1,_this.noPadding=!1,_this.loading=!1,_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.allMenuItems=[],_this.menuItems=[],_this.handleWindowResize=function(){_this.portalManager.updatePortalAppendPosition();},_this.handleWindowScroll=function(){_this.portalManager.updatePortalAppendPosition();};return _this;}_inherits(c,_r);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(c,"connectedCallback",this,3)([]),this.renderItemFunction=function(t){return t;},this.handleDocumentFocusIn=this.handleDocumentFocusIn.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.handleWindowScroll=this.handleWindowScroll.bind(this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),this.removeOpenListeners(),this.portalManager.cleanupPortalAppend();}},{key:"updated",value:function updated(t){_superPropGet(c,"updated",this,3)([t]),t.has("allMenuItems")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.setVirtualMenuWidth(),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("isDropdownOpen")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.handleDropdownOpenChange()),t.has("value")&&(this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.portal&&this.isDropdownOpen&&this.portalManager.updatePortalOptions()),t.has("portal")&&this.handlePortalChange();}},{key:"handlePortalChange",value:function handlePortalChange(){this.isDropdownOpen&&(this.portal?this.portalManager.setupPortalAppend():this.portalManager.cleanupPortalAppend());}},{key:"handleDropdownOpenChange",value:function handleDropdownOpenChange(){this.isDropdownOpen?(this.addOpenListeners(),this.portal&&this.portalManager.setupPortalAppend()):(this.removeOpenListeners(),this.portal&&this.portalManager.cleanupPortalAppend());}},{key:"addOpenListeners",value:function addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.portal&&(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("scroll",this.handleWindowScroll,!0));}},{key:"removeOpenListeners",value:function removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("scroll",this.handleWindowScroll,!0);}},{key:"handleDocumentFocusIn",value:function handleDocumentFocusIn(t){var _this$dropdownElement;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement=this.dropdownElement)===null||_this$dropdownElement===void 0?void 0:_this$dropdownElement.hide());}},{key:"handleDocumentMouseDown",value:function handleDocumentMouseDown(t){var _this$dropdownElement2;if(!this.isDropdownOpen)return;var i=t.composedPath(),e=i.includes(this),s=this.dropdownElement&&i.includes(this.dropdownElement),n=this.portal&&this.portalManager.portalContainerElement&&i.includes(this.portalManager.portalContainerElement);e||s||n||(this.isDropdownOpen=!1,(_this$dropdownElement2=this.dropdownElement)===null||_this$dropdownElement2===void 0?void 0:_this$dropdownElement2.hide());}},{key:"render",value:function render(){var t=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-dropdown class=\"nile-dropdown--input\" ?open="," noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n .disabled=","\n .value=","\n @nile-input=","\n @focus=","\n @click=","\n slot=\"trigger\"\n placeholder=","\n exportparts=\"input, base\"\n >\n ","\n </nile-input>\n ","\n </nile-dropdown>\n "])),this.isDropdownOpen,this.noBorder,this.noOutline,this.noPadding,this.disabled,this.value,this.handleSearch,this.handleFocus,this.handleClick,this.placeholder,this.loading?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>"]))):e,this.menuItems.length>0&&!this.loading?t:e);}},{key:"getVirtualizedContent",value:function getVirtualizedContent(){var _this2=this;return i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-menu class=\"virtualized__menu\" @nile-select="," id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>\n "])),this.handleSelect,this.portal?"display: none;":"",d({items:this.menuItems,renderItem:function renderItem(t){return _this2.getItemRenderFunction(t);},scroller:!0}));}},{key:"getContent",value:function getContent(){var _this3=this;return i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-menu id=\"content-menu\" @nile-select="," exportparts=\"menu__items-wrapper:options__wrapper\" style=",">\n ","\n </nile-menu>"])),this.handleSelect,this.portal?"display: none;":"",this.menuItems.map(function(t){return _this3.getItemRenderFunction(t);}));}},{key:"getItemRenderFunction",value:function getItemRenderFunction(t){var _this4=this;var e=this.renderItemFunction(t);if(!(!!t.tooltip&&(!t.tooltip["for"]||"menu"===t.tooltip["for"])))return i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-menu-item value=",">","</nile-menu-item>\n "])),e,u(e));var s=null;var n=t.tooltip.content;return n instanceof Promise?(s="Loading...",n.then(function(i){t.tooltip.content=i,_this4.requestUpdate();})):s=n,i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-menu-item value=",">\n <nile-lite-tooltip allowHTML .content=",">\n <span class=\"menu-item-text\">","</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n "])),e,s,u(e));}},{key:"handleSelect",value:function handleSelect(t){var _this$dropdownElement3;this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,(_this$dropdownElement3=this.dropdownElement)===null||_this$dropdownElement3===void 0?void 0:_this$dropdownElement3.hide();}},{key:"setVirtualMenuWidth",value:function setVirtualMenuWidth(){var _this5=this;var t=this.menuItems.reduce(function(t,i){var e=_this5.renderItemFunction(i).length;return t>e?t:e;},0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px");}},{key:"handleSearch",value:function handleSearch(t){var _this$dropdownElement4;this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&((_this$dropdownElement4=this.dropdownElement)!==null&&_this$dropdownElement4!==void 0&&_this$dropdownElement4.show(),this.portal&&this.portalManager.updatePortalOptions());}},{key:"handleFocus",value:function handleFocus(){var _this$inputElement,_this6=this;this.openOnFocus&&(this.portal&&(_this$inputElement=this.inputElement)!==null&&_this$inputElement!==void 0&&_this$inputElement.focus(),setTimeout(function(){var _this6$dropdownElemen;_this6.isDropdownOpen=!0,(_this6$dropdownElemen=_this6.dropdownElement)===null||_this6$dropdownElemen===void 0?void 0:_this6$dropdownElemen.show();},300));}},{key:"handleClick",value:function handleClick(){var _this$dropdownElement5;this.isDropdownOpen=!0,(_this$dropdownElement5=this.dropdownElement)===null||_this$dropdownElement5===void 0?void 0:_this$dropdownElement5.show();}},{key:"applyFilter",value:function applyFilter(t,i){var _this7=this;if("object"!=_typeof(t))return[];var e=[];return t.forEach(function(t){return i(t,_this7.value)&&e.push(t);}),e;}}]);}(r));c.styles=l,t([s("nile-dropdown")],c.prototype,"dropdownElement",void 0),t([s("nile-input")],c.prototype,"inputElement",void 0),t([n({type:Boolean})],c.prototype,"disabled",void 0),t([n({type:Boolean})],c.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],c.prototype,"portal",void 0),t([n({type:Boolean})],c.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],c.prototype,"openOnFocus",void 0),t([n({type:String})],c.prototype,"value",void 0),t([n({type:String})],c.prototype,"placeholder",void 0),t([n({type:Boolean})],c.prototype,"noBorder",void 0),t([n({type:Boolean})],c.prototype,"noOutline",void 0),t([n({type:Boolean})],c.prototype,"noPadding",void 0),t([n({type:Boolean})],c.prototype,"loading",void 0),t([n({attribute:!1})],c.prototype,"filterFunction",void 0),t([n({attribute:!1})],c.prototype,"renderItemFunction",void 0),t([n({type:Array})],c.prototype,"allMenuItems",void 0),t([o()],c.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],c.prototype,"handlePortalChange",null),_export("N",c=t([h("nile-auto-complete")],c));}};});
2
2
  //# sourceMappingURL=nile-auto-complete.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\nimport { watch } from '../internal/watch';\nimport { AutoCompletePortalManager } from './portal-manager';\nimport { NileInput } from '../nile-input';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n @query('nile-input') inputElement: NileInput;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n /** \n * When true, the dropdown menu will be appended to the document body instead of the parent container.\n * This is useful when the parent has overflow: hidden, clip-path, or transform applied.\n */\n @property({ type: Boolean, reflect: true }) portal = false;\n\n private readonly portalManager = new AutoCompletePortalManager(this);\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @state() menuItems: any = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n this.handleWindowResize = this.handleWindowResize.bind(this);\n this.handleWindowScroll = this.handleWindowScroll.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.portalManager.cleanupPortalAppend();\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('isDropdownOpen')) {\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.handleDropdownOpenChange();\n }\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('portal')) {\n this.handlePortalChange();\n }\n }\n\n @watch('portal', { waitUntilFirstUpdate: true })\n handlePortalChange(): void {\n if (this.isDropdownOpen) {\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n } else {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private handleDropdownOpenChange(): void {\n if (this.isDropdownOpen) {\n this.addOpenListeners();\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n }\n } else {\n this.removeOpenListeners();\n if (this.portal) {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private addOpenListeners(): void {\n document.addEventListener('focusin', this.handleDocumentFocusIn);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n \n if (this.portal) {\n window.addEventListener('resize', this.handleWindowResize);\n window.addEventListener('scroll', this.handleWindowScroll, true);\n }\n }\n\n private removeOpenListeners(): void {\n document.removeEventListener('focusin', this.handleDocumentFocusIn);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n window.removeEventListener('resize', this.handleWindowResize);\n window.removeEventListener('scroll', this.handleWindowScroll, true);\n }\n\n private handleDocumentFocusIn(event: FocusEvent) {\n if (!this.isDropdownOpen) return;\n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n\n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleDocumentMouseDown(event: MouseEvent) {\n if (!this.isDropdownOpen) return;\n \n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n \n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleWindowResize = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n private handleWindowScroll = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input, base\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item: any): TemplateResult {\n const value = this.renderItemFunction(item);\n const hasTooltip = !!item.tooltip;\n const shouldShowTooltip =\n hasTooltip && (!item.tooltip.for || item.tooltip.for === 'menu');\n const tooltipContent = hasTooltip ? item.tooltip.content : value;\n\n return shouldShowTooltip\n ? html`\n <nile-menu-item value=${value}>\n <nile-lite-tooltip allowHTML .content=${tooltipContent}>\n <span class=\"menu-item-text\">${unsafeHTML(value)}</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n `\n : html`\n <nile-menu-item value=${value}>${unsafeHTML(value)}</nile-menu-item>\n `;\n}\n\n \n\n handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) {\n this.dropdownElement?.show();\n if (this.portal) {\n this.portalManager.updatePortalOptions();\n }\n }\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n if(this.portal) {\n this.inputElement?.focus();\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","c","this","disabled","isDropdownOpen","portal","portalManager","AutoCompletePortalManager","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","menuItems","handleWindowResize","updatePortalAppendPosition","handleWindowScroll","_this","_inherits","_r","_createClass","key","connectedCallback","super","handleDocumentFocusIn","bind","handleDocumentMouseDown","disconnectedCallback","removeOpenListeners","cleanupPortalAppend","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","updatePortalOptions","handleDropdownOpenChange","handlePortalChange","setupPortalAppend","addOpenListeners","document","addEventListener","window","removeEventListener","event","path","composedPath","hitSelf","hitDropdown","dropdownElement","hitPortalAppend","portalContainerElement","_this$dropdownElement","hide","_this$dropdownElement2","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this2","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this3","_templateObject4","map","hasTooltip","tooltip","shouldShowTooltip","for","tooltipContent","_templateObject5","unsafeHTML","_templateObject6","detail","emit","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","inputElement","focus","setTimeout","_this5$dropdownElemen","list","filterFn","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","String","attribute","Array","state","watch","waitUntilFirstUpdate","customElement"],"mappings":"g9IAqBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,uEAUwBC,KAAAA,CAAQC,QAAY,CAAA,CAAA,CAAA,CAEpBD,KAAAA,CAAcE,cAAY,CAAA,CAAA,CAAA,CAMXF,KAAAA,CAAMG,MAAG,CAAA,CAAA,CAAA,CAEpCH,KAAAA,CAAAI,aAAAA,CAAgB,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,GAERL,KAAAA,CAAmBM,mBAAAA,CAAAA,CAAY,EAE/BN,KAAAA,CAAWO,WAAAA,CAAAA,CAAY,EAExBP,KAAAA,CAAKQ,KAAAA,CAAW,GAEhBR,KAAAA,CAAWS,WAAAA,CAAW,eAErBT,KAAAA,CAAQU,QAAAA,CAAAA,CAAY,EAEpBV,KAAAA,CAASW,S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U,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CASxCtI,CAAA4H,CAAAA,SAAAA,CAAA,qBAAA,IA9FU5H,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAgB0H,EAAA,CAD5Ba,CAAAA,CAAc,uBACFvI"}
1
+ {"version":3,"file":"nile-auto-complete.cjs.js","sources":["../../../src/nile-auto-complete/nile-auto-complete.ts"],"sourcesContent":["import {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-auto-complete.css';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport { NileDropdown } from '../nile-dropdown';\nimport { watch } from '../internal/watch';\nimport { AutoCompletePortalManager } from './portal-manager';\nimport { NileInput } from '../nile-input';\n\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\n// Define the custom element 'nile-auto-complete'\n@customElement('nile-auto-complete')\nexport class NileAutoComplete extends NileElement {\n\n static styles: CSSResultGroup = styles;\n\n @query('nile-dropdown') dropdownElement: NileDropdown;\n\n @query('nile-input') inputElement: NileInput;\n\n // Define component properties\n\n @property({ type: Boolean }) disabled: boolean = false;\n\n @property({ type: Boolean }) isDropdownOpen: boolean = false;\n\n /** \n * When true, the dropdown menu will be appended to the document body instead of the parent container.\n * This is useful when the parent has overflow: hidden, clip-path, or transform applied.\n */\n @property({ type: Boolean, reflect: true }) portal = false;\n\n private readonly portalManager = new AutoCompletePortalManager(this);\n\n @property({ type: Boolean }) enableVirtualScroll: boolean = false;\n\n @property({ type: Boolean }) openOnFocus: boolean = false;\n\n @property({ type: String }) value: string = '';\n\n @property({ type: String }) placeholder: string = 'Type here ..';\n\n @property({ type: Boolean }) noBorder: boolean = false;\n \n @property({ type: Boolean }) noOutline: boolean = false;\n\n @property({ type: Boolean }) noPadding: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ attribute:false}) filterFunction: (item:string,searchedValue:string)=>boolean=(item:string,searchedValue:string)=>item.toLowerCase().includes(searchedValue.toLowerCase());\n\n @property({ attribute:false}) renderItemFunction: (item:any)=>string = (item:any)=>item;\n\n @property({ type: Array }) allMenuItems: any = [];\n\n @state() menuItems: any = [];\n\n connectedCallback() {\n super.connectedCallback();\n this.renderItemFunction=(item:any)=>item;\n this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);\n this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);\n this.handleWindowResize = this.handleWindowResize.bind(this);\n this.handleWindowScroll = this.handleWindowScroll.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeOpenListeners();\n this.portalManager.cleanupPortalAppend();\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('allMenuItems')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.setVirtualMenuWidth();\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('isDropdownOpen')) {\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n this.handleDropdownOpenChange();\n }\n if (changedProperties.has('value')){\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n if (this.portal && this.isDropdownOpen) {\n this.portalManager.updatePortalOptions();\n }\n }\n if (changedProperties.has('portal')) {\n this.handlePortalChange();\n }\n }\n\n @watch('portal', { waitUntilFirstUpdate: true })\n handlePortalChange(): void {\n if (this.isDropdownOpen) {\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n } else {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private handleDropdownOpenChange(): void {\n if (this.isDropdownOpen) {\n this.addOpenListeners();\n if (this.portal) {\n this.portalManager.setupPortalAppend();\n }\n } else {\n this.removeOpenListeners();\n if (this.portal) {\n this.portalManager.cleanupPortalAppend();\n }\n }\n }\n\n private addOpenListeners(): void {\n document.addEventListener('focusin', this.handleDocumentFocusIn);\n document.addEventListener('mousedown', this.handleDocumentMouseDown);\n \n if (this.portal) {\n window.addEventListener('resize', this.handleWindowResize);\n window.addEventListener('scroll', this.handleWindowScroll, true);\n }\n }\n\n private removeOpenListeners(): void {\n document.removeEventListener('focusin', this.handleDocumentFocusIn);\n document.removeEventListener('mousedown', this.handleDocumentMouseDown);\n window.removeEventListener('resize', this.handleWindowResize);\n window.removeEventListener('scroll', this.handleWindowScroll, true);\n }\n\n private handleDocumentFocusIn(event: FocusEvent) {\n if (!this.isDropdownOpen) return;\n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n\n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleDocumentMouseDown(event: MouseEvent) {\n if (!this.isDropdownOpen) return;\n \n const path = event.composedPath();\n const hitSelf = path.includes(this);\n const hitDropdown = this.dropdownElement && path.includes(this.dropdownElement);\n const hitPortalAppend = this.portal && this.portalManager.portalContainerElement && path.includes(this.portalManager.portalContainerElement);\n \n if (!hitSelf && !hitDropdown && !hitPortalAppend) {\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n }\n\n private handleWindowResize = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n private handleWindowScroll = (): void => {\n this.portalManager.updatePortalAppendPosition();\n };\n\n public render(): TemplateResult {\n const content=this.enableVirtualScroll?this.getVirtualizedContent():this.getContent();\n return html`\n <nile-dropdown class=\"nile-dropdown--input\" ?open=${this.isDropdownOpen} noOpenOnCLick exportparts=\"input, base\">\n <nile-input class=\"nile-auto-complete--input\"\n ?no-border=${this.noBorder}\n ?no-outline=${this.noOutline}\n ?no-padding=${this.noPadding}\n .disabled=${this.disabled}\n .value=${this.value}\n @nile-input=${this.handleSearch}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n slot=\"trigger\"\n placeholder=${this.placeholder}\n exportparts=\"input, base\"\n >\n ${this.loading?html`<nile-icon slot=\"suffix\" color=\"var(--nile-colors-primary-600)\" name=\"var(--nile-icon-button-loading-blue-animated, var(--ng-icon-button-loading-blue-animated))\" method=\"var(--nile-svg-method-fill, var(--ng-svg-method-stroke))\" library=\"system\"></nile-icon>`:nothing}\n </nile-input>\n ${this.menuItems.length > 0 && !this.loading\n ? content\n : nothing}\n </nile-dropdown>\n `;\n } \n \n getVirtualizedContent():TemplateResult{\n return html`\n <nile-menu class=\"virtualized__menu\" @nile-select=${this.handleSelect} id=\"content-menu\" exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${virtualize({\n items: this.menuItems,\n renderItem: (item:any):TemplateResult=>this.getItemRenderFunction(item),\n\t\t\t\t\tscroller:true\n })}\n </nile-menu>\n `\n }\n\n getContent():TemplateResult{\n return html`\n <nile-menu id=\"content-menu\" @nile-select=${this.handleSelect} exportparts=\"menu__items-wrapper:options__wrapper\" style=${this.portal ? 'display: none;' : ''}>\n ${this.menuItems.map((item: any) => this.getItemRenderFunction(item))}\n </nile-menu>`\n }\n\n getItemRenderFunction(item: any): TemplateResult {\n const value = this.renderItemFunction(item);\n const hasTooltip = !!item.tooltip;\n const shouldShowTooltip =\n hasTooltip && (!item.tooltip.for || item.tooltip.for === 'menu');\n \n if (!shouldShowTooltip) {\n return html`\n <nile-menu-item value=${value}>${unsafeHTML(value)}</nile-menu-item>\n `;\n }\n \n let tooltipContent: string | null = null;\n \n const content = item.tooltip.content;\n if (content instanceof Promise) {\n tooltipContent = 'Loading...'; \n content.then((resolved: string) => {\n item.tooltip.content = resolved;\n this.requestUpdate(); \n });\n } else {\n tooltipContent = content;\n }\n \n return html`\n <nile-menu-item value=${value}>\n <nile-lite-tooltip allowHTML .content=${tooltipContent}>\n <span class=\"menu-item-text\">${unsafeHTML(value)}</span>\n </nile-lite-tooltip>\n </nile-menu-item>\n `;\n }\n \n \n\n handleSelect(event: CustomEvent) {\n this.value = event.detail.value;\n this.emit('nile-complete', { value: event.detail.value });\n this.isDropdownOpen = false;\n this.dropdownElement?.hide();\n }\n\n private setVirtualMenuWidth() {\n const maxLengthOption = this.menuItems\n .reduce((acc: number, curr: any) => {\n const currLength = this.renderItemFunction(curr).length\n return acc > currLength ? acc : currLength\n }, 0)\n const defaultWith = 110;\n const pixelMultiplier = 9.5;\n const menuWidth = maxLengthOption * pixelMultiplier < defaultWith ? defaultWith : maxLengthOption * pixelMultiplier;\n this.style.setProperty(\"--virtual-scroll-container-width\", menuWidth + \"px\");\n }\n\n private handleSearch(event: CustomEvent) {\n this.value = event.detail.value.toLowerCase();\n\n // Filter menu items based on the search value\n this.menuItems = this.applyFilter(this.allMenuItems,this.filterFunction);\n\n this.isDropdownOpen = this.menuItems.length > 0;\n if (this.isDropdownOpen) {\n this.dropdownElement?.show();\n if (this.portal) {\n this.portalManager.updatePortalOptions();\n }\n }\n }\n\n public handleFocus() {\n if (!this.openOnFocus) {\n return;\n }\n\n if(this.portal) {\n this.inputElement?.focus();\n }\n\n // Delay opening the dropdown to allow focus to take effect\n setTimeout(() => {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }, 300);\n }\n\n private handleClick() {\n this.isDropdownOpen = true;\n this.dropdownElement?.show();\n }\n\n applyFilter<T>(list: T[], filterFn: (item: T,searchValue?:string) => boolean): T[] {\n if(typeof(list)!=='object') return []\n const res:T[]=[]\n list.forEach( el=> filterFn(el,this.value) && res.push(el) )\n return res\n }\n\n}\n\nexport default NileAutoComplete;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-auto-complete': NileAutoComplete;\n }\n}\n"],"names":["NileAutoComplete","c","this","disabled","isDropdownOpen","portal","portalManager","AutoCompletePortalManager","enableVirtualScroll","openOnFocus","value","placeholder","noBorder","noOutline","noPadding","loading","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","allMenuItems","menuItems","handleWindowResize","updatePortalAppendPosition","handleWindowScroll","_this","_inherits","_r","_createClass","key","connectedCallback","super","handleDocumentFocusIn","bind","handleDocumentMouseDown","disconnectedCallback","removeOpenListeners","cleanupPortalAppend","updated","changedProperties","has","applyFilter","setVirtualMenuWidth","updatePortalOptions","handleDropdownOpenChange","handlePortalChange","setupPortalAppend","addOpenListeners","document","addEventListener","window","removeEventListener","event","path","composedPath","hitSelf","hitDropdown","dropdownElement","hitPortalAppend","portalContainerElement","_this$dropdownElement","hide","_this$dropdownElement2","render","content","getVirtualizedContent","getContent","html","_templateObject","_taggedTemplateLiteral","handleSearch","handleFocus","handleClick","_templateObject2","nothing","length","_this2","_templateObject3","handleSelect","virtualize","items","renderItem","getItemRenderFunction","scroller","_this3","_templateObject4","map","tooltip","for","_templateObject5","unsafeHTML","tooltipContent","Promise","then","resolved","requestUpdate","_templateObject6","detail","emit","maxLengthOption","reduce","acc","curr","currLength","menuWidth","style","setProperty","show","inputElement","focus","setTimeout","_this6$dropdownElemen","list","filterFn","_typeof","t","res","forEach","el","push","NileElement","styles","__decorate","query","prototype","property","type","Boolean","reflect","String","attribute","Array","state","watch","waitUntilFirstUpdate","customElement"],"mappings":"g9IAqBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,uEAUwBC,KAAAA,CAAQC,QAAY,CAAA,CAAA,CAAA,CAEpBD,KAAAA,CAAcE,cAAY,CAAA,CAAA,CAAA,CAMXF,KAAAA,CAAMG,MAAG,CAAA,CAAA,CAAA,CAEpCH,KAAAA,CAAAI,aAAAA,CAAgB,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,GAERL,KAAAA,CAAmBM,mBAAAA,CAAAA,CAAY,EAE/BN,KAAAA,CAAWO,WAAAA,CAAAA,CAAY,EAExBP,KAAAA,CAAKQ,KAAAA,CAAW,GAEhBR,KAAAA,CAAWS,WAAAA,CAAW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AA,IAAA,EAAA,CAAA,CAE7DF,EAAA,CAA1BG,CAAAA,CAAS,CAAEC,IAAAA,CAAMK,SAAgCrI,CAAA8H,CAAAA,SAAAA,CAAA,mBAAA,EAEzCF,CAAAA,CAAAA,CAAAA,CAAA,CAARU,CAA4BtI,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8H,SAAA,CAAA,WAAA,CAAA,IAAA,IA0C7BF,CAAA,CAAA,CADCW,CAAM,CAAA,QAAA,CAAU,CAAEC,oBAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CASxCxI,CAAA8H,CAAAA,SAAAA,CAAA,qBAAA,IA9FU9H,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAgB4H,EAAA,CAD5Ba,CAAAA,CAAc,uBACFzI"}
@@ -24,12 +24,12 @@ import{__decorate as t}from"tslib";import{html as i,nothing as e}from"lit";impor
24
24
  `}getContent(){return i`
25
25
  <nile-menu id="content-menu" @nile-select=${this.handleSelect} exportparts="menu__items-wrapper:options__wrapper" style=${this.portal?"display: none;":""}>
26
26
  ${this.menuItems.map((t=>this.getItemRenderFunction(t)))}
27
- </nile-menu>`}getItemRenderFunction(t){const e=this.renderItemFunction(t),s=!!t.tooltip,n=s&&(!t.tooltip.for||"menu"===t.tooltip.for),o=s?t.tooltip.content:e;return n?i`
28
- <nile-menu-item value=${e}>
29
- <nile-lite-tooltip allowHTML .content=${o}>
30
- <span class="menu-item-text">${u(e)}</span>
31
- </nile-lite-tooltip>
32
- </nile-menu-item>
33
- `:i`
27
+ </nile-menu>`}getItemRenderFunction(t){const e=this.renderItemFunction(t);if(!(!!t.tooltip&&(!t.tooltip.for||"menu"===t.tooltip.for)))return i`
34
28
  <nile-menu-item value=${e}>${u(e)}</nile-menu-item>
35
- `}handleSelect(t){this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const t=this.menuItems.reduce(((t,i)=>{const e=this.renderItemFunction(i).length;return t>e?t:e}),0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px")}handleSearch(t){this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&(this.dropdownElement?.show(),this.portal&&this.portalManager.updatePortalOptions())}handleFocus(){this.openOnFocus&&(this.portal&&this.inputElement?.focus(),setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300))}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(t,i){if("object"!=typeof t)return[];const e=[];return t.forEach((t=>i(t,this.value)&&e.push(t))),e}};m.styles=l,t([s("nile-dropdown")],m.prototype,"dropdownElement",void 0),t([s("nile-input")],m.prototype,"inputElement",void 0),t([n({type:Boolean})],m.prototype,"disabled",void 0),t([n({type:Boolean})],m.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],m.prototype,"portal",void 0),t([n({type:Boolean})],m.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],m.prototype,"openOnFocus",void 0),t([n({type:String})],m.prototype,"value",void 0),t([n({type:String})],m.prototype,"placeholder",void 0),t([n({type:Boolean})],m.prototype,"noBorder",void 0),t([n({type:Boolean})],m.prototype,"noOutline",void 0),t([n({type:Boolean})],m.prototype,"noPadding",void 0),t([n({type:Boolean})],m.prototype,"loading",void 0),t([n({attribute:!1})],m.prototype,"filterFunction",void 0),t([n({attribute:!1})],m.prototype,"renderItemFunction",void 0),t([n({type:Array})],m.prototype,"allMenuItems",void 0),t([o()],m.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],m.prototype,"handlePortalChange",null),m=t([h("nile-auto-complete")],m);export{m as N};
29
+ `;let s=null;const n=t.tooltip.content;return n instanceof Promise?(s="Loading...",n.then((i=>{t.tooltip.content=i,this.requestUpdate()}))):s=n,i`
30
+ <nile-menu-item value=${e}>
31
+ <nile-lite-tooltip allowHTML .content=${s}>
32
+ <span class="menu-item-text">${u(e)}</span>
33
+ </nile-lite-tooltip>
34
+ </nile-menu-item>
35
+ `}handleSelect(t){this.value=t.detail.value,this.emit("nile-complete",{value:t.detail.value}),this.isDropdownOpen=!1,this.dropdownElement?.hide()}setVirtualMenuWidth(){const t=this.menuItems.reduce(((t,i)=>{const e=this.renderItemFunction(i).length;return t>e?t:e}),0),i=9.5*t<110?110:9.5*t;this.style.setProperty("--virtual-scroll-container-width",i+"px")}handleSearch(t){this.value=t.detail.value.toLowerCase(),this.menuItems=this.applyFilter(this.allMenuItems,this.filterFunction),this.isDropdownOpen=this.menuItems.length>0,this.isDropdownOpen&&(this.dropdownElement?.show(),this.portal&&this.portalManager.updatePortalOptions())}handleFocus(){this.openOnFocus&&(this.portal&&this.inputElement?.focus(),setTimeout((()=>{this.isDropdownOpen=!0,this.dropdownElement?.show()}),300))}handleClick(){this.isDropdownOpen=!0,this.dropdownElement?.show()}applyFilter(t,i){if("object"!=typeof t)return[];const e=[];return t.forEach((t=>i(t,this.value)&&e.push(t))),e}};m.styles=l,t([s("nile-dropdown")],m.prototype,"dropdownElement",void 0),t([s("nile-input")],m.prototype,"inputElement",void 0),t([n({type:Boolean})],m.prototype,"disabled",void 0),t([n({type:Boolean})],m.prototype,"isDropdownOpen",void 0),t([n({type:Boolean,reflect:!0})],m.prototype,"portal",void 0),t([n({type:Boolean})],m.prototype,"enableVirtualScroll",void 0),t([n({type:Boolean})],m.prototype,"openOnFocus",void 0),t([n({type:String})],m.prototype,"value",void 0),t([n({type:String})],m.prototype,"placeholder",void 0),t([n({type:Boolean})],m.prototype,"noBorder",void 0),t([n({type:Boolean})],m.prototype,"noOutline",void 0),t([n({type:Boolean})],m.prototype,"noPadding",void 0),t([n({type:Boolean})],m.prototype,"loading",void 0),t([n({attribute:!1})],m.prototype,"filterFunction",void 0),t([n({attribute:!1})],m.prototype,"renderItemFunction",void 0),t([n({type:Array})],m.prototype,"allMenuItems",void 0),t([o()],m.prototype,"menuItems",void 0),t([a("portal",{waitUntilFirstUpdate:!0})],m.prototype,"handlePortalChange",null),m=t([h("nile-auto-complete")],m);export{m 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-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/nile-element.cjs.js","lit/directives/unsafe-html.js"],function(_export,_context){"use strict";var t,i,e,s,o,l,h,n,r,a,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _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){e=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){h=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_litDirectivesUnsafeHtmlJs){p=_litDirectivesUnsafeHtmlJs.unsafeHTML;}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_a){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.tooltips=[],_this.warning=!1,_this.noAutoComplete=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.tagVariant="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.portal=!1,_this.enableVirtualScroll=!1,_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1,_this.loading=!1,_this.errorIndexes=[],_this.helpText="",_this.errorMessage="",_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.showTooltip=!1,_this.handleDocumentClick=function(t){t.composedPath().includes(_assertThisInitialized(_this))||(_this.isDropdownOpen=!1);};return _this;}_inherits(c,_a);return _createClass(c,[{key:"updated",value:function updated(t){var _this2=this;if(_superPropGet(c,"updated",this,3)([t]),t.has("autoCompleteOptions")){var _t=this.autoCompleteOptions;if("string"==typeof _t)try{_t=JSON.parse(_t);}catch(i){_t=[];}this.filteredAutoCompleteOptions=Array.isArray(_t)?_toConsumableArray(_t):[],this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}));}t.has("value")&&(this.tags=_toConsumableArray(this.value),this.onTagsChanged()),t.has("tags")&&this.onTagsChanged();}},{key:"connectedCallback",value:function connectedCallback(){var _this3=this;_superPropGet(c,"connectedCallback",this,3)([]),document.addEventListener("click",this.handleDocumentClick),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.value.includes(t);})),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),document.removeEventListener("click",this.handleDocumentClick),this.emit("nile-destroy");}},{key:"render",value:function render(){var _this4=this;var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var e=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n part='base' \n class=","\n >\n ","\n\n <div class=\"nile-chip__auto-complete\">\n ","\n </div>\n </div>\n ","\n ","\n </div>\n "])),n({"form-control":!0,"form-control--medium":!0,"form-control--has-label":e,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled}),e?"false":"true",this.label,n({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap,"nile-chip--open":this.isDropdownOpen}),this.tags.map(function(t,e){var s=_this4.tooltips[e],o=i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n .variant=","\n @nile-remove=","\n removable\n ?pill=","\n >\n ","\n </nile-tag>\n "])),n({"nile-chip__tags":!0}),_this4.errorIndexes.includes(e)?"error":"normal",function(){return _this4.handleRemove(t);},"normal"!==_this4.tagVariant,p(t));return _this4.showTooltip&&s?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-lite-tooltip allowHTML .content=",">\n ","\n </nile-lite-tooltip>\n "])),s,o):o;}),this.noAutoComplete?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-input\n .value=","\n .placeholder=","\n .disabled=","\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n @nile-input=","\n @keydown=","\n @focus=","\n exportparts=\"input\"\n ></nile-input>\n "])),this.inputValue,this.placeholder,this.disabled,!0,!0,!0,this.handleInputChange,this.handleInputKeydown,this.handleFocus):i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete\n .enableVirtualScroll=","\n .allMenuItems=","\n .filterFunction=","\n .renderItemFunction=","\n .showTooltips=","\n .loading=\"","\"\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n .noOutline=","\n .noPadding=","\n .disabled=","\n .portal=","\n openOnFocus\n exportparts=\"options__wrapper, input, base\"\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n "])),this.enableVirtualScroll,this.filteredAutoCompleteOptions,this.filterFunction,this.renderItemFunction,this.showTooltip,this.loading,this.inputValue,this.isDropdownOpen,!0,!0,!0,this.disabled,this.portal,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect),s?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral([" <nile-form-help-text>","</nile-form-help-text> "])),this.helpText):"",o?i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"handleSelect",value:function handleSelect(t){var i=t.detail.value,e=this.autoCompleteOptions.find(function(t){return t.name===i||t.id===i;});var s=null;if(e!==null&&e!==void 0&&e.tooltip){var _e$tooltip=e.tooltip,_t2=_e$tooltip.content,_i=_e$tooltip["for"];_i&&"tag"!==_i||(s=_t2);}this.noDuplicates&&this.tags.includes(i)||(this.tags=[].concat(_toConsumableArray(this.tags),[i]),this.tooltips=[].concat(_toConsumableArray(this.tooltips),[s]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(i){return i!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Tab"===t.key&&t.preventDefault(),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(t.preventDefault(),this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||!this.noDuplicates&&!this.tags.includes(this.inputValue)||this.emit("nile-duplicates-blocked"));}},{key:"handleFocus",value:function handleFocus(){this.noAutoComplete||(this.isDropdownOpen=!0);}},{key:"onTagsChanged",value:function onTagsChanged(){var _this5=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this5.tags.includes(t);}));}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,!this.noAutoComplete&&this.autoComplete&&(this.autoComplete.value="",this.autoComplete.handleFocus());}}],[{key:"styles",get:function get(){return[h];}}]);}(a));t([e()],c.prototype,"tags",void 0),t([e()],c.prototype,"inputValue",void 0),t([e()],c.prototype,"isDropdownOpen",void 0),t([e()],c.prototype,"tooltips",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([o({type:Boolean})],c.prototype,"warning",void 0),t([o({type:Boolean})],c.prototype,"noAutoComplete",void 0),t([o({type:Boolean})],c.prototype,"error",void 0),t([o({type:Boolean})],c.prototype,"success",void 0),t([o({type:Boolean})],c.prototype,"noDuplicates",void 0),t([o()],c.prototype,"label",void 0),t([o({type:String})],c.prototype,"tagVariant",void 0),t([o({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([o({type:Boolean})],c.prototype,"clearable",void 0),t([o()],c.prototype,"placeholder",void 0),t([o({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([o({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([o({type:Boolean,reflect:!0})],c.prototype,"portal",void 0),t([o({type:Boolean})],c.prototype,"enableVirtualScroll",void 0),t([o({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([o({type:Array})],c.prototype,"filteredAutoCompleteOptions",void 0),t([o({type:Array})],c.prototype,"value",void 0),t([o({type:Boolean})],c.prototype,"noWrap",void 0),t([o({type:Boolean})],c.prototype,"loading",void 0),t([o({type:Array})],c.prototype,"errorIndexes",void 0),t([o({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([o({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([o({attribute:!1})],c.prototype,"filterFunction",void 0),t([o({attribute:!1})],c.prototype,"renderItemFunction",void 0),t([o({type:Boolean})],c.prototype,"showTooltip",void 0),_export("N",c=t([l("nile-chip")],c));}};});
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-chip.css.cjs.js","lit/directives/class-map.js","../internal/slot.cjs.js","../internal/nile-element.cjs.js","lit/directives/unsafe-html.js"],function(_export,_context){"use strict";var t,i,e,s,o,l,h,n,r,a,p,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _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){e=_litDecoratorsJs.state;s=_litDecoratorsJs.query;o=_litDecoratorsJs.property;l=_litDecoratorsJs.customElement;},function(_nileChipCssCjsJs){h=_nileChipCssCjsJs.s;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_litDirectivesUnsafeHtmlJs){p=_litDirectivesUnsafeHtmlJs.unsafeHTML;}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_a){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_this.tooltips=[],_this.warning=!1,_this.noAutoComplete=!1,_this.error=!1,_this.success=!1,_this.noDuplicates=!1,_this.label="",_this.tagVariant="",_this.acceptUserInput=!1,_this.clearable=!1,_this.placeholder="type here...",_this.readonly=!1,_this.disabled=!1,_this.portal=!1,_this.enableVirtualScroll=!1,_this.autoCompleteOptions=[],_this.filteredAutoCompleteOptions=[],_this.value=[],_this.noWrap=!1,_this.loading=!1,_this.errorIndexes=[],_this.helpText="",_this.errorMessage="",_this.filterFunction=function(t,i){return t.toLowerCase().includes(i.toLowerCase());},_this.renderItemFunction=function(t){return t;},_this.showTooltip=!1,_this.handleDocumentClick=function(t){t.composedPath().includes(_assertThisInitialized(_this))||(_this.isDropdownOpen=!1);};return _this;}_inherits(c,_a);return _createClass(c,[{key:"updated",value:function updated(t){var _this2=this;if(_superPropGet(c,"updated",this,3)([t]),t.has("autoCompleteOptions")){var _t=this.autoCompleteOptions;if("string"==typeof _t)try{_t=JSON.parse(_t);}catch(i){_t=[];}this.filteredAutoCompleteOptions=Array.isArray(_t)?_toConsumableArray(_t):[],this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this2.value.includes(t);}));}t.has("value")&&(this.tags=_toConsumableArray(this.value),this.onTagsChanged()),t.has("tags")&&this.onTagsChanged();}},{key:"connectedCallback",value:function connectedCallback(){var _this3=this;_superPropGet(c,"connectedCallback",this,3)([]),document.addEventListener("click",this.handleDocumentClick),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.value.includes(t);})),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),document.removeEventListener("click",this.handleDocumentClick),this.emit("nile-destroy");}},{key:"render",value:function render(){var _this4=this;var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var e=!!this.label||!!t,s=!!this.helpText,o=!!this.errorMessage;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n part=\"form-control\"\n class=","\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n <div\n part='base' \n class=","\n >\n ","\n\n <div class=\"nile-chip__auto-complete\">\n ","\n </div>\n </div>\n ","\n ","\n </div>\n "])),n({"form-control":!0,"form-control--medium":!0,"form-control--has-label":e,"form-control--has-help-text":s,"nile-chip--disabled":this.disabled}),e?"false":"true",this.label,n({"nile-chip":!0,"nile-chip--warning":this.warning,"nile-chip--error":this.error,"nile-chip--success":this.success,"nile-chip--no-wrap":this.noWrap,"nile-chip--open":this.isDropdownOpen}),this.tags.map(function(t,e){var s=_this4.tooltips[e],o=i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-tag\n class=","\n .variant=","\n @nile-remove=","\n removable\n ?pill=","\n >\n ","\n </nile-tag>\n "])),n({"nile-chip__tags":!0}),_this4.errorIndexes.includes(e)?"error":"normal",function(){return _this4.handleRemove(t);},"normal"!==_this4.tagVariant,p(t));return _this4.showTooltip&&s?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-lite-tooltip allowHTML .content=",">\n ","\n </nile-lite-tooltip>\n "])),s,o):o;}),this.noAutoComplete?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-input\n .value=","\n .placeholder=","\n .disabled=","\n ?no-border=","\n ?no-outline=","\n ?no-padding=","\n @nile-input=","\n @keydown=","\n @focus=","\n exportparts=\"input\"\n ></nile-input>\n "])),this.inputValue,this.placeholder,this.disabled,!0,!0,!0,this.handleInputChange,this.handleInputKeydown,this.handleFocus):i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-auto-complete\n .enableVirtualScroll=","\n .allMenuItems=","\n .filterFunction=","\n .renderItemFunction=","\n .showTooltips=","\n .loading=\"","\"\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n .noOutline=","\n .noPadding=","\n .disabled=","\n .portal=","\n openOnFocus\n exportparts=\"options__wrapper, input, base\"\n .placeholder=","\n @nile-input=","\n @keydown=","\n @nile-focus=","\n @nile-complete=","\n ></nile-auto-complete>\n "])),this.enableVirtualScroll,this.filteredAutoCompleteOptions,this.filterFunction,this.renderItemFunction,this.showTooltip,this.loading,this.inputValue,this.isDropdownOpen,!0,!0,!0,this.disabled,this.portal,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect),s?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral([" <nile-form-help-text>","</nile-form-help-text> "])),this.helpText):"",o?i(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"handleSelect",value:function handleSelect(t){var _this5=this,_e$tooltip2;var i=t.detail.value,e=this.autoCompleteOptions.find(function(t){return t.name===i||t.id===i;});var s=null;if(e!==null&&e!==void 0&&e.tooltip){var _e$tooltip=e.tooltip,_t2=_e$tooltip.content,_i=_e$tooltip["for"];if(!_i||"tag"===_i)if(_t2 instanceof Promise){this.tooltips=[].concat(_toConsumableArray(this.tooltips),["Loading..."]);var _i2=this.tooltips.length-1;_t2.then(function(t){_this5.tooltips[_i2]=t,_this5.requestUpdate();});}else s=_t2;}this.noDuplicates&&this.tags.includes(i)||(this.tags=[].concat(_toConsumableArray(this.tags),[i]),(e===null||e===void 0||(_e$tooltip2=e.tooltip)===null||_e$tooltip2===void 0?void 0:_e$tooltip2.content)instanceof Promise||(this.tooltips=[].concat(_toConsumableArray(this.tooltips),[s])),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(i){return i!==t;}),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[].concat(_toConsumableArray(this.filteredAutoCompleteOptions),[t])),this.emit("nile-chip-change",{value:this.tags});}},{key:"handleInputChange",value:function handleInputChange(t){this.inputValue=t.detail.value;}},{key:"handleInputKeydown",value:function handleInputKeydown(t){this.acceptUserInput&&("Tab"===t.key&&t.preventDefault(),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||this.noDuplicates&&this.tags.includes(this.inputValue)||(t.preventDefault(),this.tags=[].concat(_toConsumableArray(this.tags),[this.inputValue]),this.resetInput(),this.emit("nile-chip-change",{value:this.tags})),"Enter"!==t.key&&"Tab"!==t.key||!this.inputValue||!this.noDuplicates&&!this.tags.includes(this.inputValue)||this.emit("nile-duplicates-blocked"));}},{key:"handleFocus",value:function handleFocus(){this.noAutoComplete||(this.isDropdownOpen=!0);}},{key:"onTagsChanged",value:function onTagsChanged(){var _this6=this;this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this6.tags.includes(t);}));}},{key:"resetInput",value:function resetInput(){this.inputValue="",this.isDropdownOpen=!1,!this.noAutoComplete&&this.autoComplete&&(this.autoComplete.value="",this.autoComplete.handleFocus());}}],[{key:"styles",get:function get(){return[h];}}]);}(a));t([e()],c.prototype,"tags",void 0),t([e()],c.prototype,"inputValue",void 0),t([e()],c.prototype,"isDropdownOpen",void 0),t([e()],c.prototype,"tooltips",void 0),t([s("nile-auto-complete")],c.prototype,"autoComplete",void 0),t([o({type:Boolean})],c.prototype,"warning",void 0),t([o({type:Boolean})],c.prototype,"noAutoComplete",void 0),t([o({type:Boolean})],c.prototype,"error",void 0),t([o({type:Boolean})],c.prototype,"success",void 0),t([o({type:Boolean})],c.prototype,"noDuplicates",void 0),t([o()],c.prototype,"label",void 0),t([o({type:String})],c.prototype,"tagVariant",void 0),t([o({type:Boolean})],c.prototype,"acceptUserInput",void 0),t([o({type:Boolean})],c.prototype,"clearable",void 0),t([o()],c.prototype,"placeholder",void 0),t([o({type:Boolean,reflect:!0})],c.prototype,"readonly",void 0),t([o({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([o({type:Boolean,reflect:!0})],c.prototype,"portal",void 0),t([o({type:Boolean})],c.prototype,"enableVirtualScroll",void 0),t([o({type:Array})],c.prototype,"autoCompleteOptions",void 0),t([o({type:Array})],c.prototype,"filteredAutoCompleteOptions",void 0),t([o({type:Array})],c.prototype,"value",void 0),t([o({type:Boolean})],c.prototype,"noWrap",void 0),t([o({type:Boolean})],c.prototype,"loading",void 0),t([o({type:Array})],c.prototype,"errorIndexes",void 0),t([o({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([o({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([o({attribute:!1})],c.prototype,"filterFunction",void 0),t([o({attribute:!1})],c.prototype,"renderItemFunction",void 0),t([o({type:Boolean})],c.prototype,"showTooltip",void 0),_export("N",c=t([l("nile-chip")],c));}};});
2
2
  //# sourceMappingURL=nile-chip.cjs.js.map