@aquera/nile-elements 1.1.5-beta-1.1 → 1.1.5

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 (273) hide show
  1. package/README.md +3 -0
  2. package/dist/index.js +43 -47
  3. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  4. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  5. package/dist/nile-chip/nile-chip.esm.js +42 -46
  6. package/dist/src/nile-chip/nile-chip.js +42 -46
  7. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  8. package/dist/src/version.js +1 -1
  9. package/dist/src/version.js.map +1 -1
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/package.json +1 -1
  12. package/src/nile-chip/nile-chip.ts +49 -57
  13. package/dist/axe.min-140df6c2.cjs.js +0 -2
  14. package/dist/axe.min-140df6c2.cjs.js.map +0 -1
  15. package/dist/axe.min-591c52c3.esm.js +0 -1
  16. package/dist/css-tag-3c4464f5.esm.js +0 -6
  17. package/dist/css-tag-b6258454.cjs.js +0 -6
  18. package/dist/css-tag-b6258454.cjs.js.map +0 -1
  19. package/dist/fixture-ba65262e.esm.js +0 -569
  20. package/dist/fixture-e3592de4.cjs.js +0 -395
  21. package/dist/fixture-e3592de4.cjs.js.map +0 -1
  22. package/dist/flow-3e83b6f4.esm.js +0 -17
  23. package/dist/flow-ca47f938.cjs.js +0 -14
  24. package/dist/flow-ca47f938.cjs.js.map +0 -1
  25. package/dist/lit-html-21bc9a48.cjs.js +0 -6
  26. package/dist/lit-html-21bc9a48.cjs.js.map +0 -1
  27. package/dist/lit-html-82603fd0.esm.js +0 -6
  28. package/dist/nile-inline-sidebar/index.cjs.js +0 -2
  29. package/dist/nile-inline-sidebar/index.cjs.js.map +0 -1
  30. package/dist/nile-inline-sidebar/index.esm.js +0 -1
  31. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js +0 -2
  32. package/dist/nile-inline-sidebar/nile-inline-sidebar.cjs.js.map +0 -1
  33. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js +0 -2
  34. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.cjs.js.map +0 -1
  35. package/dist/nile-inline-sidebar/nile-inline-sidebar.css.esm.js +0 -58
  36. package/dist/nile-inline-sidebar/nile-inline-sidebar.esm.js +0 -48
  37. package/dist/nile-inline-sidebar-group/index.cjs.js +0 -2
  38. package/dist/nile-inline-sidebar-group/index.cjs.js.map +0 -1
  39. package/dist/nile-inline-sidebar-group/index.esm.js +0 -1
  40. package/dist/nile-inline-sidebar-group/nile-inline-sidebar-group.cjs.js +0 -2
  41. package/dist/nile-inline-sidebar-group/nile-inline-sidebar-group.cjs.js.map +0 -1
  42. package/dist/nile-inline-sidebar-group/nile-inline-sidebar-group.css.cjs.js +0 -2
  43. package/dist/nile-inline-sidebar-group/nile-inline-sidebar-group.css.cjs.js.map +0 -1
  44. package/dist/nile-inline-sidebar-group/nile-inline-sidebar-group.css.esm.js +0 -33
  45. package/dist/nile-inline-sidebar-group/nile-inline-sidebar-group.esm.js +0 -12
  46. package/dist/nile-inline-sidebar-item/index.cjs.js +0 -2
  47. package/dist/nile-inline-sidebar-item/index.cjs.js.map +0 -1
  48. package/dist/nile-inline-sidebar-item/index.esm.js +0 -1
  49. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js +0 -2
  50. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js.map +0 -1
  51. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.cjs.js +0 -2
  52. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.cjs.js.map +0 -1
  53. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.css.esm.js +0 -37
  54. package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.esm.js +0 -5
  55. package/dist/nile-inlinesidebar/index.cjs.js +0 -2
  56. package/dist/nile-inlinesidebar/index.cjs.js.map +0 -1
  57. package/dist/nile-inlinesidebar/index.esm.js +0 -1
  58. package/dist/nile-inlinesidebar/nile-inlinesidebar.cjs.js +0 -2
  59. package/dist/nile-inlinesidebar/nile-inlinesidebar.cjs.js.map +0 -1
  60. package/dist/nile-inlinesidebar/nile-inlinesidebar.css.cjs.js +0 -2
  61. package/dist/nile-inlinesidebar/nile-inlinesidebar.css.cjs.js.map +0 -1
  62. package/dist/nile-inlinesidebar/nile-inlinesidebar.css.esm.js +0 -62
  63. package/dist/nile-inlinesidebar/nile-inlinesidebar.esm.js +0 -46
  64. package/dist/nile-inlinesidebar-group/index.cjs.js +0 -2
  65. package/dist/nile-inlinesidebar-group/index.cjs.js.map +0 -1
  66. package/dist/nile-inlinesidebar-group/index.esm.js +0 -1
  67. package/dist/nile-inlinesidebar-group/nile-inlinesidebar-group.cjs.js +0 -2
  68. package/dist/nile-inlinesidebar-group/nile-inlinesidebar-group.cjs.js.map +0 -1
  69. package/dist/nile-inlinesidebar-group/nile-inlinesidebar-group.css.cjs.js +0 -2
  70. package/dist/nile-inlinesidebar-group/nile-inlinesidebar-group.css.cjs.js.map +0 -1
  71. package/dist/nile-inlinesidebar-group/nile-inlinesidebar-group.css.esm.js +0 -33
  72. package/dist/nile-inlinesidebar-group/nile-inlinesidebar-group.esm.js +0 -12
  73. package/dist/nile-inlinesidebar-item/index.cjs.js +0 -2
  74. package/dist/nile-inlinesidebar-item/index.cjs.js.map +0 -1
  75. package/dist/nile-inlinesidebar-item/index.esm.js +0 -1
  76. package/dist/nile-inlinesidebar-item/nile-inlinesidebar-item.cjs.js +0 -2
  77. package/dist/nile-inlinesidebar-item/nile-inlinesidebar-item.cjs.js.map +0 -1
  78. package/dist/nile-inlinesidebar-item/nile-inlinesidebar-item.css.cjs.js +0 -2
  79. package/dist/nile-inlinesidebar-item/nile-inlinesidebar-item.css.cjs.js.map +0 -1
  80. package/dist/nile-inlinesidebar-item/nile-inlinesidebar-item.css.esm.js +0 -37
  81. package/dist/nile-inlinesidebar-item/nile-inlinesidebar-item.esm.js +0 -5
  82. package/dist/nile-side-bar-content/index.cjs.js +0 -2
  83. package/dist/nile-side-bar-content/index.cjs.js.map +0 -1
  84. package/dist/nile-side-bar-content/index.esm.js +0 -1
  85. package/dist/nile-side-bar-content/nile-side-bar-content.cjs.js +0 -2
  86. package/dist/nile-side-bar-content/nile-side-bar-content.cjs.js.map +0 -1
  87. package/dist/nile-side-bar-content/nile-side-bar-content.css.cjs.js +0 -2
  88. package/dist/nile-side-bar-content/nile-side-bar-content.css.cjs.js.map +0 -1
  89. package/dist/nile-side-bar-content/nile-side-bar-content.css.esm.js +0 -5
  90. package/dist/nile-side-bar-content/nile-side-bar-content.esm.js +0 -3
  91. package/dist/nile-side-bar-footer-icon/index.cjs.js +0 -2
  92. package/dist/nile-side-bar-footer-icon/index.cjs.js.map +0 -1
  93. package/dist/nile-side-bar-footer-icon/index.esm.js +0 -1
  94. package/dist/nile-side-bar-footer-icon/nile-side-bar-footer-icon.cjs.js +0 -2
  95. package/dist/nile-side-bar-footer-icon/nile-side-bar-footer-icon.cjs.js.map +0 -1
  96. package/dist/nile-side-bar-footer-icon/nile-side-bar-footer-icon.css.cjs.js +0 -2
  97. package/dist/nile-side-bar-footer-icon/nile-side-bar-footer-icon.css.cjs.js.map +0 -1
  98. package/dist/nile-side-bar-footer-icon/nile-side-bar-footer-icon.css.esm.js +0 -5
  99. package/dist/nile-side-bar-footer-icon/nile-side-bar-footer-icon.esm.js +0 -3
  100. package/dist/nile-side-bar-group-item-content/index.cjs.js +0 -2
  101. package/dist/nile-side-bar-group-item-content/index.cjs.js.map +0 -1
  102. package/dist/nile-side-bar-group-item-content/index.esm.js +0 -1
  103. package/dist/nile-side-bar-group-item-content/nile-side-bar-group-item-content.cjs.js +0 -2
  104. package/dist/nile-side-bar-group-item-content/nile-side-bar-group-item-content.cjs.js.map +0 -1
  105. package/dist/nile-side-bar-group-item-content/nile-side-bar-group-item-content.css.cjs.js +0 -2
  106. package/dist/nile-side-bar-group-item-content/nile-side-bar-group-item-content.css.cjs.js.map +0 -1
  107. package/dist/nile-side-bar-group-item-content/nile-side-bar-group-item-content.css.esm.js +0 -5
  108. package/dist/nile-side-bar-group-item-content/nile-side-bar-group-item-content.esm.js +0 -3
  109. package/dist/nile-sidebar/index.cjs.js +0 -2
  110. package/dist/nile-sidebar/index.cjs.js.map +0 -1
  111. package/dist/nile-sidebar/index.esm.js +0 -75
  112. package/dist/nile-sidebar-menu/index.cjs.js +0 -2
  113. package/dist/nile-sidebar-menu/index.cjs.js.map +0 -1
  114. package/dist/nile-sidebar-menu/index.esm.js +0 -1
  115. package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js +0 -2
  116. package/dist/nile-sidebar-menu/nile-sidebar-menu.cjs.js.map +0 -1
  117. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js +0 -2
  118. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.cjs.js.map +0 -1
  119. package/dist/nile-sidebar-menu/nile-sidebar-menu.css.esm.js +0 -38
  120. package/dist/nile-sidebar-menu/nile-sidebar-menu.esm.js +0 -10
  121. package/dist/nile-sidebar-menu-items/index.cjs.js +0 -2
  122. package/dist/nile-sidebar-menu-items/index.cjs.js.map +0 -1
  123. package/dist/nile-sidebar-menu-items/index.esm.js +0 -1
  124. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js +0 -2
  125. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.cjs.js.map +0 -1
  126. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js +0 -2
  127. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.cjs.js.map +0 -1
  128. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.css.esm.js +0 -36
  129. package/dist/nile-sidebar-menu-items/nile-sidebar-menu-items.esm.js +0 -15
  130. package/dist/nile-sidebar-wrapper/index.cjs.js +0 -2
  131. package/dist/nile-sidebar-wrapper/index.cjs.js.map +0 -1
  132. package/dist/nile-sidebar-wrapper/index.esm.js +0 -1
  133. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js +0 -2
  134. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.cjs.js.map +0 -1
  135. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js +0 -2
  136. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.cjs.js.map +0 -1
  137. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.css.esm.js +0 -105
  138. package/dist/nile-sidebar-wrapper/nile-sidebar-wrapper.esm.js +0 -16
  139. package/dist/scopedElementsWrapper-abad3c53.cjs.js +0 -2
  140. package/dist/scopedElementsWrapper-abad3c53.cjs.js.map +0 -1
  141. package/dist/scopedElementsWrapper-ef11f868.esm.js +0 -1
  142. package/dist/sinon-esm-283dcc9b.cjs.js +0 -2
  143. package/dist/sinon-esm-283dcc9b.cjs.js.map +0 -1
  144. package/dist/sinon-esm-abe9b0ec.esm.js +0 -1
  145. package/dist/src/nile-inline-sidebar/index.d.ts +0 -1
  146. package/dist/src/nile-inline-sidebar/index.js +0 -2
  147. package/dist/src/nile-inline-sidebar/index.js.map +0 -1
  148. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.d.ts +0 -7
  149. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js +0 -66
  150. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.css.js.map +0 -1
  151. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.d.ts +0 -51
  152. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js +0 -199
  153. package/dist/src/nile-inline-sidebar/nile-inline-sidebar.js.map +0 -1
  154. package/dist/src/nile-inline-sidebar-group/index.d.ts +0 -1
  155. package/dist/src/nile-inline-sidebar-group/index.js +0 -2
  156. package/dist/src/nile-inline-sidebar-group/index.js.map +0 -1
  157. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.css.d.ts +0 -9
  158. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.css.js +0 -42
  159. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.css.js.map +0 -1
  160. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.d.ts +0 -32
  161. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.js +0 -64
  162. package/dist/src/nile-inline-sidebar-group/nile-inline-sidebar-group.js.map +0 -1
  163. package/dist/src/nile-inline-sidebar-item/index.d.ts +0 -1
  164. package/dist/src/nile-inline-sidebar-item/index.js +0 -2
  165. package/dist/src/nile-inline-sidebar-item/index.js.map +0 -1
  166. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.d.ts +0 -10
  167. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.js +0 -48
  168. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.css.js.map +0 -1
  169. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.d.ts +0 -36
  170. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +0 -80
  171. package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +0 -1
  172. package/dist/src/nile-inlinesidebar/index.d.ts +0 -1
  173. package/dist/src/nile-inlinesidebar/index.js +0 -2
  174. package/dist/src/nile-inlinesidebar/index.js.map +0 -1
  175. package/dist/src/nile-inlinesidebar/nile-inlinesidebar.css.d.ts +0 -1
  176. package/dist/src/nile-inlinesidebar/nile-inlinesidebar.css.js +0 -64
  177. package/dist/src/nile-inlinesidebar/nile-inlinesidebar.css.js.map +0 -1
  178. package/dist/src/nile-inlinesidebar/nile-inlinesidebar.d.ts +0 -28
  179. package/dist/src/nile-inlinesidebar/nile-inlinesidebar.js +0 -97
  180. package/dist/src/nile-inlinesidebar/nile-inlinesidebar.js.map +0 -1
  181. package/dist/src/nile-inlinesidebar-group/index.d.ts +0 -1
  182. package/dist/src/nile-inlinesidebar-group/index.js +0 -2
  183. package/dist/src/nile-inlinesidebar-group/index.js.map +0 -1
  184. package/dist/src/nile-inlinesidebar-group/nile-inlinesidebar-group.css.d.ts +0 -3
  185. package/dist/src/nile-inlinesidebar-group/nile-inlinesidebar-group.css.js +0 -36
  186. package/dist/src/nile-inlinesidebar-group/nile-inlinesidebar-group.css.js.map +0 -1
  187. package/dist/src/nile-inlinesidebar-group/nile-inlinesidebar-group.d.ts +0 -34
  188. package/dist/src/nile-inlinesidebar-group/nile-inlinesidebar-group.js +0 -67
  189. package/dist/src/nile-inlinesidebar-group/nile-inlinesidebar-group.js.map +0 -1
  190. package/dist/src/nile-inlinesidebar-item/index.d.ts +0 -1
  191. package/dist/src/nile-inlinesidebar-item/index.js +0 -2
  192. package/dist/src/nile-inlinesidebar-item/index.js.map +0 -1
  193. package/dist/src/nile-inlinesidebar-item/nile-inlinesidebar-item.css.d.ts +0 -4
  194. package/dist/src/nile-inlinesidebar-item/nile-inlinesidebar-item.css.js +0 -42
  195. package/dist/src/nile-inlinesidebar-item/nile-inlinesidebar-item.css.js.map +0 -1
  196. package/dist/src/nile-inlinesidebar-item/nile-inlinesidebar-item.d.ts +0 -37
  197. package/dist/src/nile-inlinesidebar-item/nile-inlinesidebar-item.js +0 -68
  198. package/dist/src/nile-inlinesidebar-item/nile-inlinesidebar-item.js.map +0 -1
  199. package/dist/src/nile-nile-side-bar-expand/index.d.ts +0 -1
  200. package/dist/src/nile-nile-side-bar-expand/index.js +0 -2
  201. package/dist/src/nile-nile-side-bar-expand/index.js.map +0 -1
  202. package/dist/src/nile-nile-side-bar-expand/nile-nile-side-bar-expand.css.d.ts +0 -12
  203. package/dist/src/nile-nile-side-bar-expand/nile-nile-side-bar-expand.css.js +0 -17
  204. package/dist/src/nile-nile-side-bar-expand/nile-nile-side-bar-expand.css.js.map +0 -1
  205. package/dist/src/nile-nile-side-bar-expand/nile-nile-side-bar-expand.d.ts +0 -32
  206. package/dist/src/nile-nile-side-bar-expand/nile-nile-side-bar-expand.js +0 -43
  207. package/dist/src/nile-nile-side-bar-expand/nile-nile-side-bar-expand.js.map +0 -1
  208. package/dist/src/nile-side-bar-content/index.d.ts +0 -1
  209. package/dist/src/nile-side-bar-content/index.js +0 -2
  210. package/dist/src/nile-side-bar-content/index.js.map +0 -1
  211. package/dist/src/nile-side-bar-content/nile-side-bar-content.css.d.ts +0 -12
  212. package/dist/src/nile-side-bar-content/nile-side-bar-content.css.js +0 -17
  213. package/dist/src/nile-side-bar-content/nile-side-bar-content.css.js.map +0 -1
  214. package/dist/src/nile-side-bar-content/nile-side-bar-content.d.ts +0 -32
  215. package/dist/src/nile-side-bar-content/nile-side-bar-content.js +0 -43
  216. package/dist/src/nile-side-bar-content/nile-side-bar-content.js.map +0 -1
  217. package/dist/src/nile-side-bar-footer-icon/index.d.ts +0 -1
  218. package/dist/src/nile-side-bar-footer-icon/index.js +0 -2
  219. package/dist/src/nile-side-bar-footer-icon/index.js.map +0 -1
  220. package/dist/src/nile-side-bar-footer-icon/nile-side-bar-footer-icon.css.d.ts +0 -12
  221. package/dist/src/nile-side-bar-footer-icon/nile-side-bar-footer-icon.css.js +0 -17
  222. package/dist/src/nile-side-bar-footer-icon/nile-side-bar-footer-icon.css.js.map +0 -1
  223. package/dist/src/nile-side-bar-footer-icon/nile-side-bar-footer-icon.d.ts +0 -32
  224. package/dist/src/nile-side-bar-footer-icon/nile-side-bar-footer-icon.js +0 -43
  225. package/dist/src/nile-side-bar-footer-icon/nile-side-bar-footer-icon.js.map +0 -1
  226. package/dist/src/nile-side-bar-group-item-content/index.d.ts +0 -1
  227. package/dist/src/nile-side-bar-group-item-content/index.js +0 -2
  228. package/dist/src/nile-side-bar-group-item-content/index.js.map +0 -1
  229. package/dist/src/nile-side-bar-group-item-content/nile-side-bar-group-item-content.css.d.ts +0 -12
  230. package/dist/src/nile-side-bar-group-item-content/nile-side-bar-group-item-content.css.js +0 -17
  231. package/dist/src/nile-side-bar-group-item-content/nile-side-bar-group-item-content.css.js.map +0 -1
  232. package/dist/src/nile-side-bar-group-item-content/nile-side-bar-group-item-content.d.ts +0 -32
  233. package/dist/src/nile-side-bar-group-item-content/nile-side-bar-group-item-content.js +0 -43
  234. package/dist/src/nile-side-bar-group-item-content/nile-side-bar-group-item-content.js.map +0 -1
  235. package/dist/src/nile-sidebar/index.d.ts +0 -28
  236. package/dist/src/nile-sidebar/index.js +0 -116
  237. package/dist/src/nile-sidebar/index.js.map +0 -1
  238. package/dist/src/nile-sidebar/nile-sidebar.css.d.ts +0 -12
  239. package/dist/src/nile-sidebar/nile-sidebar.css.js +0 -17
  240. package/dist/src/nile-sidebar/nile-sidebar.css.js.map +0 -1
  241. package/dist/src/nile-sidebar/nile-sidebar.d.ts +0 -32
  242. package/dist/src/nile-sidebar/nile-sidebar.js +0 -43
  243. package/dist/src/nile-sidebar/nile-sidebar.js.map +0 -1
  244. package/dist/src/nile-sidebar-menu/index.d.ts +0 -1
  245. package/dist/src/nile-sidebar-menu/index.js +0 -2
  246. package/dist/src/nile-sidebar-menu/index.js.map +0 -1
  247. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.d.ts +0 -12
  248. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js +0 -47
  249. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.css.js.map +0 -1
  250. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.d.ts +0 -37
  251. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js +0 -84
  252. package/dist/src/nile-sidebar-menu/nile-sidebar-menu.js.map +0 -1
  253. package/dist/src/nile-sidebar-menu-items/index.d.ts +0 -1
  254. package/dist/src/nile-sidebar-menu-items/index.js +0 -2
  255. package/dist/src/nile-sidebar-menu-items/index.js.map +0 -1
  256. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.d.ts +0 -12
  257. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js +0 -45
  258. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.css.js.map +0 -1
  259. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.d.ts +0 -35
  260. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js +0 -78
  261. package/dist/src/nile-sidebar-menu-items/nile-sidebar-menu-items.js.map +0 -1
  262. package/dist/src/nile-sidebar-wrapper/index.d.ts +0 -1
  263. package/dist/src/nile-sidebar-wrapper/index.js +0 -2
  264. package/dist/src/nile-sidebar-wrapper/index.js.map +0 -1
  265. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.d.ts +0 -12
  266. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js +0 -114
  267. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.css.js.map +0 -1
  268. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.d.ts +0 -35
  269. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js +0 -89
  270. package/dist/src/nile-sidebar-wrapper/nile-sidebar-wrapper.js.map +0 -1
  271. package/dist/virtualize-73f68d08.esm.js +0 -22
  272. package/dist/virtualize-eb33a9a0.cjs.js +0 -18
  273. package/dist/virtualize-eb33a9a0.cjs.js.map +0 -1
package/README.md CHANGED
@@ -79,6 +79,9 @@ 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.1.5
83
+ - Nile Chip: noAutoComplete Property added. (UIF-988)
84
+
82
85
  #### Version 1.1.4
83
86
  - New Component: Nile Sidebar (UIF-987)
84
87
  - Dependency Nile 1.0.7
package/dist/index.js CHANGED
@@ -5803,54 +5803,50 @@ class wi{constructor(e){this._element=null;const t=e??window;this._node=t,e&&(th
5803
5803
  ${e}
5804
5804
  </nile-tag>
5805
5805
  `))}
5806
- <div class="nile-chip__auto-complete">
5807
- ${this.noAutoComplete?R`
5808
- <nile-input
5809
- .value=${this.inputValue}
5810
- .placeholder=${this.placeholder}
5811
- .disabled=${this.disabled}
5812
- ?no-border=${!0}
5813
- ?no-outline=${!0}
5814
- ?no-padding=${!0}
5815
- @nile-input=${this.handleInputChange}
5816
- @keydown=${this.handleInputKeydown}
5817
- @focus=${this.handleFocus}
5818
- exportparts="input"
5819
- ></nile-input>
5820
- `:R`
5821
- <nile-auto-complete
5822
- .enableVirtualScroll=${this.enableVirtualScroll}
5823
- .allMenuItems=${this.filteredAutoCompleteOptions}
5824
- .filterFunction=${this.filterFunction}
5825
- .renderItemFunction=${this.renderItemFunction}
5826
- .loading="${this.loading}"
5827
- .value=${this.inputValue}
5828
- ?isDropdownOpen=${this.isDropdownOpen}
5829
- .noBorder=${!0}
5830
- .noOutline=${!0}
5831
- .noPadding=${!0}
5832
- .disabled=${this.disabled}
5833
- openOnFocus
5834
- exportparts="options__wrapper, input"
5835
- .placeholder=${this.placeholder}
5836
- @nile-input=${this.handleInputChange}
5837
- @keydown=${this.handleInputKeydown}
5838
- @nile-focus=${this.handleFocus}
5839
- @nile-complete=${this.handleSelect}
5840
- ></nile-auto-complete>
5841
- `}
5842
- </div>
5843
-
5806
+ <div class="nile-chip__auto-complete">
5807
+ ${this.noAutoComplete?R`
5808
+ <nile-input
5809
+ .value=${this.inputValue}
5810
+ .placeholder=${this.placeholder}
5811
+ .disabled=${this.disabled}
5812
+ ?no-border=${!0}
5813
+ ?no-outline=${!0}
5814
+ ?no-padding=${!0}
5815
+ @nile-input=${this.handleInputChange}
5816
+ @keydown=${this.handleInputKeydown}
5817
+ @focus=${this.handleFocus}
5818
+ exportparts="input"
5819
+ ></nile-input>
5820
+ `:R`
5821
+ <nile-auto-complete
5822
+ .enableVirtualScroll=${this.enableVirtualScroll}
5823
+ .allMenuItems=${this.filteredAutoCompleteOptions}
5824
+ .filterFunction=${this.filterFunction}
5825
+ .renderItemFunction=${this.renderItemFunction}
5826
+ .loading="${this.loading}"
5827
+ .value=${this.inputValue}
5828
+ ?isDropdownOpen=${this.isDropdownOpen}
5829
+ .noBorder=${!0}
5830
+ .noOutline=${!0}
5831
+ .noPadding=${!0}
5832
+ .disabled=${this.disabled}
5833
+ openOnFocus
5834
+ exportparts="options__wrapper, input"
5835
+ .placeholder=${this.placeholder}
5836
+ @nile-input=${this.handleInputChange}
5837
+ @keydown=${this.handleInputKeydown}
5838
+ @nile-focus=${this.handleFocus}
5839
+ @nile-complete=${this.handleSelect}
5840
+ ></nile-auto-complete>
5841
+ `}
5842
+ </div>
5844
5843
  </div>
5845
- ${M?R`
5846
- <nile-form-help-text>${this.helpText}</nile-form-help-text>
5847
- `:""}
5848
-
5844
+ ${M?R` <nile-form-help-text>${this.helpText}</nile-form-help-text> `:""}
5849
5845
  ${i?R`
5850
- <nile-form-error-message
5851
- >${this.errorMessage}</nile-form-error-message
5852
- >
5853
- `:""}
5846
+ <nile-form-error-message
5847
+ >${this.errorMessage}</nile-form-error-message
5848
+ >
5849
+ `:""}
5854
5850
  </div>
5855
5851
  `}handleSelect(e){this.noDuplicates&&this.tags.includes(e.detail.value)||(this.tags=[...this.tags,e.detail.value],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.autoComplete.value="",this.autoComplete.handleFocus()}};e([ce()],en.prototype,"tags",void 0),e([ce()],en.prototype,"inputValue",void 0),e([ce()],en.prototype,"isDropdownOpen",void 0),e([Ie("nile-auto-complete")],en.prototype,"autoComplete",void 0),e([ue({type:Boolean})],en.prototype,"warning",void 0),e([ue({type:Boolean})],en.prototype,"noAutoComplete",void 0),e([ue({type:Boolean})],en.prototype,"error",void 0),e([ue({type:Boolean})],en.prototype,"success",void 0),e([ue({type:Boolean})],en.prototype,"noDuplicates",void 0),e([ue()],en.prototype,"label",void 0),e([ue({type:String})],en.prototype,"tagVariant",void 0),e([ue({type:Boolean})],en.prototype,"acceptUserInput",void 0),e([ue({type:Boolean})],en.prototype,"clearable",void 0),e([ue()],en.prototype,"placeholder",void 0),e([ue({type:Boolean,reflect:!0})],en.prototype,"readonly",void 0),e([ue({type:Boolean,reflect:!0})],en.prototype,"disabled",void 0),e([ue({type:Boolean})],en.prototype,"enableVirtualScroll",void 0),e([ue({type:Array})],en.prototype,"autoCompleteOptions",void 0),e([ue({type:Array})],en.prototype,"filteredAutoCompleteOptions",void 0),e([ue({type:Array})],en.prototype,"value",void 0),e([ue({type:Boolean})],en.prototype,"noWrap",void 0),e([ue({type:Boolean})],en.prototype,"loading",void 0),e([ue({type:Array})],en.prototype,"errorIndexes",void 0),e([ue({attribute:"help-text",reflect:!0})],en.prototype,"helpText",void 0),e([ue({attribute:"error-message",reflect:!0})],en.prototype,"errorMessage",void 0),e([ue({attribute:!1})],en.prototype,"filterFunction",void 0),e([ue({attribute:!1})],en.prototype,"renderItemFunction",void 0),en=e([le("nile-chip")],en);const tn=r`
5856
5852
  .form-control .form-control__label {
@@ -14012,7 +14008,7 @@ nile-rte-toolbar-item nile-button[data-active]::part(base):hover {
14012
14008
 
14013
14009
 
14014
14010
 
14015
- `,tS={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 MS=class extends Ne{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,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(),Fp(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 M=t.getRangeAt(0);if(e.shiftKey){if(M.collapsed&&M.startContainer.nodeType===Node.TEXT_NODE){const e=M.startContainer,i=M.startOffset,n=e.data.slice(0,i),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(i);const M=document.createRange();M.setStart(e,o.length),M.collapse(!0),t.removeAllRanges(),t.addRange(M),this.updateContent(),this.updateToolbarState()}}return}M.deleteContents();const i=document.createTextNode("\t");M.insertNode(i);const n=document.createRange();n.setStartAfter(i),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(eS.cssText),this.ensureStructure(),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.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const M=e.parentNode;if(!M)return;const i=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(i);M.insertBefore(n,e),M.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,M=t.getAttribute("data-mention-key"),i=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!M&&!!i&&o.length>0&&o.startsWith(n)&&o.includes(i);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 M=e.getAttribute("name")||"",i=e.getAttribute("label")||M,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="${i}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=tS[M];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${i}"></nile-icon>`:t.textContent=i||M,e.innerHTML=""}if(!t.isConnected){const M=document.createElement("nile-tooltip");M.setAttribute("content",i),M.appendChild(t),e.appendChild(M)}t.setAttribute("aria-label",i),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(M)));const r=this.buttonMap.get(M)??[];return r.push(t),void this.buttonMap.set(M,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:M}=e.detail;"backColor"===t?$p(this.editorEl,"backgroundColor",M,"data-rte-bg"):function(e,t){$p(e,"color",t,"data-rte-color")}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const M=e.detail;"heading"===t?function(e,t){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=Pp(M.getRangeAt(0).startContainer,e);if(!i)return;if(i.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;i.firstChild;)n.appendChild(i.firstChild);i.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),M.removeAllRanges(),M.addRange(o)}(this.editorEl,M):"font"===t&&function(e,t){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);if(i.collapsed){const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(document.createTextNode("​")),i.insertNode(e);const n=document.createRange();return n.setStart(e.firstChild,1),n.collapse(!0),M.removeAllRanges(),void M.addRange(n)}Bp(i,"span",{style:`font-family:${t}`})}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;Jp(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),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),Array.from(i.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const M=document.createElement("li");M.appendChild(e),t.appendChild(M)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.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":Fp(this.editorEl,"strong");break;case"italic":Fp(this.editorEl,"em");break;case"underline":Fp(this.editorEl,"u");break;case"left":Jp(this.editorEl,"left");break;case"center":Jp(this.editorEl,"center");break;case"right":Jp(this.editorEl,"right");break;case"justify":Jp(this.editorEl,"justify");break;case"ul":Kp(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":Kp(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 M=e.currentNode;M.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(M.tagName)&&t.push(M)}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 M=this.buttonMap.get(e);if(M)for(const e of M)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 M=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,i=getComputedStyle(M),n=Pp(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=M;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const M=getComputedStyle(e).fontWeight;if(parseInt(M,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=M;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=M;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})(),N=!!M.closest("a"),a=n.style.textAlign||getComputedStyle(n).textAlign||"start",l="start"===a?"left":a,g=!!M.closest("li")&&M.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",N),this.setBtnActive("left","left"===l&&!["center","right","justify"].includes(l)),this.setBtnActive("center","center"===l),this.setBtnActive("right","right"===l),this.setBtnActive("justify","justify"===l),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=(i.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=Rp(i.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(M).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=Rp(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.cloneNode(!0);if(this.noStyles)e.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const t=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),M=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i=["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(;t.nextNode()&&M.nextNode();){const e=t.currentNode,n=M.currentNode,o=window.getComputedStyle(e),r=i.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=e.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ue({type:String,attribute:!0,reflect:!0})],MS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],MS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],MS.prototype,"singleLineEditor",void 0),e([ue({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),M={};for(const e of Object.keys(t)){const i=t[e];Array.isArray(i)&&(M[e]=i.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return M}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],MS.prototype,"mentions",void 0),e([ce()],MS.prototype,"content",void 0),MS=e([le("nile-rich-text-editor")],MS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.1.5-beta-1.1"',window.nileVersion="__NILE_VERSION__");const iS=r`
14011
+ `,tS={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 MS=class extends Ne{constructor(){super(...arguments),this.value="",this.noStyles=!1,this.singleLineEditor=!1,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(),Fp(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 M=t.getRangeAt(0);if(e.shiftKey){if(M.collapsed&&M.startContainer.nodeType===Node.TEXT_NODE){const e=M.startContainer,i=M.startOffset,n=e.data.slice(0,i),o=n.replace(/(\t|[ \u00a0]{2})$/,"");if(o.length!==n.length){e.data=o+e.data.slice(i);const M=document.createRange();M.setStart(e,o.length),M.collapse(!0),t.removeAllRanges(),t.addRange(M),this.updateContent(),this.updateToolbarState()}}return}M.deleteContents();const i=document.createTextNode("\t");M.insertNode(i);const n=document.createRange();n.setStartAfter(i),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(eS.cssText),this.ensureStructure(),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.editorEl.innerHTML.trim()||(this.editorEl.innerHTML="<p><br></p>")}unwrapMention(e,t=!0){const M=e.parentNode;if(!M)return;const i=t?(e.textContent??"").replace(/\u200B/g,""):"",n=document.createTextNode(i);M.insertBefore(n,e),M.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,M=t.getAttribute("data-mention-key"),i=t.getAttribute("data-mention-label"),n=t.getAttribute("data-mention-trigger")||"",o=(t.textContent??"").replace(/\u200B/g,"").trim(),r=!!M&&!!i&&o.length>0&&o.startsWith(n)&&o.includes(i);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 M=e.getAttribute("name")||"",i=e.getAttribute("label")||M,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="${i}"></nile-icon>`,e.innerHTML="";else if(o)t.innerHTML=e.innerHTML,e.innerHTML="";else{const n=tS[M];n?t.innerHTML=`<nile-icon name="${n}" size="20" color="black" aria-label="${i}"></nile-icon>`:t.textContent=i||M,e.innerHTML=""}if(!t.isConnected){const M=document.createElement("nile-tooltip");M.setAttribute("content",i),M.appendChild(t),e.appendChild(M)}t.setAttribute("aria-label",i),t.addEventListener("mousedown",(e=>e.preventDefault())),t.addEventListener("click",(()=>this.onToolbarCommand(M)));const r=this.buttonMap.get(M)??[];return r.push(t),void this.buttonMap.set(M,r)}if("nile-rte-select"!==t)"nile-rte-color"!==t||e.addEventListener("change",(e=>{this.focusAndRestore();const{mode:t,value:M}=e.detail;"backColor"===t?$p(this.editorEl,"backgroundColor",M,"data-rte-bg"):function(e,t){$p(e,"color",t,"data-rte-color")}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}));else{const t=e.getAttribute("type")||"";e.addEventListener("change",(e=>{this.focusAndRestore();const M=e.detail;"heading"===t?function(e,t){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=Pp(M.getRangeAt(0).startContainer,e);if(!i)return;if(i.tagName.toLowerCase()===t)return;const n=document.createElement(t);for(;i.firstChild;)n.appendChild(i.firstChild);i.replaceWith(n);const o=document.createRange();o.selectNodeContents(n),o.collapse(!0),M.removeAllRanges(),M.addRange(o)}(this.editorEl,M):"font"===t&&function(e,t){const M=document.getSelection();if(!M||0===M.rangeCount)return;const i=M.getRangeAt(0);if(i.collapsed){const e=document.createElement("span");e.style.fontFamily=t,e.appendChild(document.createTextNode("​")),i.insertNode(e);const n=document.createRange();return n.setStart(e.firstChild,1),n.collapse(!0),M.removeAllRanges(),void M.addRange(n)}Bp(i,"span",{style:`font-family:${t}`})}(this.editorEl,M),this.updateContent(),this.updateToolbarState()}))}}else e.addEventListener("change",(e=>{this.focusAndRestore();const t=e.detail;Jp(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),M=this.lastRange.extractContents(),i=document.createElement("div");i.appendChild(M),Array.from(i.childNodes).forEach((e=>{if(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())return;const M=document.createElement("li");M.appendChild(e),t.appendChild(M)})),this.lastRange.insertNode(t),this.afterListEdit(t)}afterListEdit(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const M=window.getSelection();M?.removeAllRanges(),M?.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":Fp(this.editorEl,"strong");break;case"italic":Fp(this.editorEl,"em");break;case"underline":Fp(this.editorEl,"u");break;case"left":Jp(this.editorEl,"left");break;case"center":Jp(this.editorEl,"center");break;case"right":Jp(this.editorEl,"right");break;case"justify":Jp(this.editorEl,"justify");break;case"ul":Kp(this.editorEl,"ul"),this.updateContent(),this.updateToolbarState();break;case"ol":Kp(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 M=e.currentNode;M.removeAttribute("style"),["B","STRONG","I","EM","U","SPAN","FONT"].includes(M.tagName)&&t.push(M)}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 M=this.buttonMap.get(e);if(M)for(const e of M)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 M=function(e){for(;e&&!(e instanceof HTMLElement);)e=e.parentNode;return e}(t.startContainer)||this.editorEl,i=getComputedStyle(M),n=Pp(t.startContainer,this.editorEl)||this.editorEl,o=(()=>{let e=M;for(;e&&e!==this.editorEl;){if(e instanceof HTMLElement){const t=e.tagName.toLowerCase();if("strong"===t||"b"===t)return!0;const M=getComputedStyle(e).fontWeight;if(parseInt(M,10)>=600)return!0}e=e.parentNode}return!1})(),r=(()=>{let e=M;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=M;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})(),N=!!M.closest("a"),a=n.style.textAlign||getComputedStyle(n).textAlign||"start",l="start"===a?"left":a,g=!!M.closest("li")&&M.closest("ul,ol")?.tagName.toLowerCase()||"";if(this.setBtnActive("bold",o),this.setBtnActive("italic",r),this.setBtnActive("underline",s),this.setBtnActive("link",N),this.setBtnActive("left","left"===l&&!["center","right","justify"].includes(l)),this.setBtnActive("center","center"===l),this.setBtnActive("right","right"===l),this.setBtnActive("justify","justify"===l),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=(i.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=Rp(i.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(M).backgroundColor;if(e&&!/transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(e)){const t=Rp(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.cloneNode(!0);if(this.noStyles)e.querySelectorAll("[style]").forEach((e=>e.removeAttribute("style")));else{const t=document.createTreeWalker(this.editorEl,NodeFilter.SHOW_ELEMENT),M=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i=["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(;t.nextNode()&&M.nextNode();){const e=t.currentNode,n=M.currentNode,o=window.getComputedStyle(e),r=i.map((e=>`${e}:${o.getPropertyValue(e)}`)).join(";");r.trim()&&n.setAttribute("style",r)}}this.content=e.innerHTML,this.previewEl&&(this.previewEl.innerHTML=this.content),this.dispatchEvent(new CustomEvent("nile-change",{detail:{content:this.content},bubbles:!0,composed:!0}))}};e([ue({type:String,attribute:!0,reflect:!0})],MS.prototype,"value",void 0),e([ue({type:Boolean,attribute:!0,reflect:!0})],MS.prototype,"noStyles",void 0),e([ue({type:Boolean,attribute:"singlelineeditor",reflect:!0})],MS.prototype,"singleLineEditor",void 0),e([ue({attribute:"mentions",reflect:!0,converter:{fromAttribute:e=>{try{const t=JSON.parse(e),M={};for(const e of Object.keys(t)){const i=t[e];Array.isArray(i)&&(M[e]=i.filter((e=>e&&"string"==typeof e.key&&"string"==typeof e.label)).map((e=>({key:e.key,label:e.label}))))}return M}catch{return{}}},toAttribute:e=>JSON.stringify(e)}})],MS.prototype,"mentions",void 0),e([ce()],MS.prototype,"content",void 0),MS=e([le("nile-rich-text-editor")],MS);"undefined"!=typeof window&&(window.nileElementsVersion='"1.1.5"',window.nileVersion="__NILE_VERSION__");const iS=r`
14016
14012
  :host {
14017
14013
  --sidebar-width: 240px;
14018
14014
  --sidebar-collapsed-width: 70px;
@@ -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"],function(_export,_context){"use strict";var t,i,e,s,o,l,h,n,r,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,p;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;}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_a){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_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.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;};return _this;}_inherits(p,_a);return _createClass(p,[{key:"updated",value:function updated(t){var _this2=this;if(_superPropGet(p,"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(p,"connectedCallback",this,3)([]),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.value.includes(t);})),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(p,"disconnectedCallback",this,3)([]),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 <div class=\"nile-chip__auto-complete\">\n ","\n</div>\n\n </div>\n ","\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}),this.tags.map(function(t,e){return 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,t);}),this.noAutoComplete?i(_templateObject3||(_templateObject3=_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(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete\n .enableVirtualScroll=","\n .allMenuItems=","\n .filterFunction=","\n .renderItemFunction=","\n .loading=\"","\"\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n .noOutline=","\n .noPadding=","\n .disabled=","\n openOnFocus\n exportparts=\"options__wrapper, input\"\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.loading,this.inputValue,this.isDropdownOpen,!0,!0,!0,this.disabled,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect),s?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(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.autoComplete.value="",this.autoComplete.handleFocus();}}],[{key:"styles",get:function get(){return[h];}}]);}(a));t([e()],p.prototype,"tags",void 0),t([e()],p.prototype,"inputValue",void 0),t([e()],p.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],p.prototype,"autoComplete",void 0),t([o({type:Boolean})],p.prototype,"warning",void 0),t([o({type:Boolean})],p.prototype,"noAutoComplete",void 0),t([o({type:Boolean})],p.prototype,"error",void 0),t([o({type:Boolean})],p.prototype,"success",void 0),t([o({type:Boolean})],p.prototype,"noDuplicates",void 0),t([o()],p.prototype,"label",void 0),t([o({type:String})],p.prototype,"tagVariant",void 0),t([o({type:Boolean})],p.prototype,"acceptUserInput",void 0),t([o({type:Boolean})],p.prototype,"clearable",void 0),t([o()],p.prototype,"placeholder",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"readonly",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),t([o({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([o({type:Array})],p.prototype,"autoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"filteredAutoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"value",void 0),t([o({type:Boolean})],p.prototype,"noWrap",void 0),t([o({type:Boolean})],p.prototype,"loading",void 0),t([o({type:Array})],p.prototype,"errorIndexes",void 0),t([o({attribute:"help-text",reflect:!0})],p.prototype,"helpText",void 0),t([o({attribute:"error-message",reflect:!0})],p.prototype,"errorMessage",void 0),t([o({attribute:!1})],p.prototype,"filterFunction",void 0),t([o({attribute:!1})],p.prototype,"renderItemFunction",void 0),_export("N",p=t([l("nile-chip")],p));}};});
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"],function(_export,_context){"use strict";var t,i,e,s,o,l,h,n,r,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,p;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;}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_a){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.tags=[],_this.inputValue="",_this.isDropdownOpen=!1,_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.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;};return _this;}_inherits(p,_a);return _createClass(p,[{key:"updated",value:function updated(t){var _this2=this;if(_superPropGet(p,"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(p,"connectedCallback",this,3)([]),this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter(function(t){return!_this3.value.includes(t);})),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(p,"disconnectedCallback",this,3)([]),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 <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}),this.tags.map(function(t,e){return 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,t);}),this.noAutoComplete?i(_templateObject3||(_templateObject3=_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(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-auto-complete\n .enableVirtualScroll=","\n .allMenuItems=","\n .filterFunction=","\n .renderItemFunction=","\n .loading=\"","\"\n .value=","\n ?isDropdownOpen=","\n .noBorder=","\n .noOutline=","\n .noPadding=","\n .disabled=","\n openOnFocus\n exportparts=\"options__wrapper, input\"\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.loading,this.inputValue,this.isDropdownOpen,!0,!0,!0,this.disabled,this.placeholder,this.handleInputChange,this.handleInputKeydown,this.handleFocus,this.handleSelect),s?i(_templateObject5||(_templateObject5=_taggedTemplateLiteral([" <nile-form-help-text>","</nile-form-help-text> "])),this.helpText):"",o?i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}},{key:"handleSelect",value:function handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[].concat(_toConsumableArray(this.tags),[t.detail.value]),this.emit("nile-chip-change",{value:this.tags}),this.resetInput());}},{key:"handleRemove",value:function handleRemove(t){this.tags=this.tags.filter(function(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.autoComplete.value="",this.autoComplete.handleFocus();}}],[{key:"styles",get:function get(){return[h];}}]);}(a));t([e()],p.prototype,"tags",void 0),t([e()],p.prototype,"inputValue",void 0),t([e()],p.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],p.prototype,"autoComplete",void 0),t([o({type:Boolean})],p.prototype,"warning",void 0),t([o({type:Boolean})],p.prototype,"noAutoComplete",void 0),t([o({type:Boolean})],p.prototype,"error",void 0),t([o({type:Boolean})],p.prototype,"success",void 0),t([o({type:Boolean})],p.prototype,"noDuplicates",void 0),t([o()],p.prototype,"label",void 0),t([o({type:String})],p.prototype,"tagVariant",void 0),t([o({type:Boolean})],p.prototype,"acceptUserInput",void 0),t([o({type:Boolean})],p.prototype,"clearable",void 0),t([o()],p.prototype,"placeholder",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"readonly",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),t([o({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([o({type:Array})],p.prototype,"autoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"filteredAutoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"value",void 0),t([o({type:Boolean})],p.prototype,"noWrap",void 0),t([o({type:Boolean})],p.prototype,"loading",void 0),t([o({type:Array})],p.prototype,"errorIndexes",void 0),t([o({attribute:"help-text",reflect:!0})],p.prototype,"helpText",void 0),t([o({attribute:"error-message",reflect:!0})],p.prototype,"errorMessage",void 0),t([o({attribute:!1})],p.prototype,"filterFunction",void 0),t([o({attribute:!1})],p.prototype,"renderItemFunction",void 0),_export("N",p=t([l("nile-chip")],p));}};});
2
2
  //# sourceMappingURL=nile-chip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n@property({ type: Boolean }) noAutoComplete = false;\n\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n @property({ type: String }) tagVariant: string = ''; // can be '', 'normal', 'success', etc.\n\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n // AUTO-COMPLETE-OPTIONS\n\n /** Virtual scroll in dropdown options. */\n @property({ type: Boolean }) enableVirtualScroll = false;\n\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ type: Array }) errorIndexes: number[] = [];\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\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 protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('autoCompleteOptions')) {\n let options = this.autoCompleteOptions;\n if (typeof options === 'string') {\n try {\n options = JSON.parse(options);\n } catch (e) {\n options = [];\n }\n }\n this.filteredAutoCompleteOptions = Array.isArray(options) ? [...options] : [];\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n if (changedProperties.has('value')){\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n if (changedProperties.has('tags')){\n this.onTagsChanged();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n part='base' \n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n (tag, index) => html`\n <nile-tag\n class=${classMap({\n 'nile-chip__tags': true,\n })}\n .variant=${this.errorIndexes.includes(index) ? 'error' : 'normal'}\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n ?pill=${this.tagVariant !== 'normal'}\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n ${this.noAutoComplete\n ? html`\n <nile-input\n .value=${this.inputValue}\n .placeholder=${this.placeholder}\n .disabled=${this.disabled}\n ?no-border=${true}\n ?no-outline=${true}\n ?no-padding=${true}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @focus=${this.handleFocus}\n exportparts=\"input\"\n ></nile-input>\n `\n : html`\n <nile-auto-complete\n .enableVirtualScroll=${this.enableVirtualScroll}\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .filterFunction=${this.filterFunction}\n .renderItemFunction=${this.renderItemFunction}\n .loading=\"${this.loading}\"\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n .noOutline=${true}\n .noPadding=${true}\n .disabled=${this.disabled}\n openOnFocus\n exportparts=\"options__wrapper, input\"\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n `}\n</div>\n\n </div>\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n </div>\n `;\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if(event.key === 'Tab'){\n event.preventDefault()\n }\n \n if (\n (event.key === 'Enter' || event.key === 'Tab' ) \n && this.inputValue \n && (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n event.preventDefault()\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n if(\n (event.key === 'Enter'|| event.key === 'Tab' ) \n && this.inputValue \n && (this.noDuplicates || this.tags.includes(this.inputValue))\n ){\n this.emit('nile-duplicates-blocked');\n }\n }\n\n private handleFocus() {\n if (this.noAutoComplete) {\n return;\n }\n this.isDropdownOpen = true;\n }\n\n onTagsChanged() {\n if (this.noDuplicates)\n this.filteredAutoCompleteOptions = this.filteredAutoCompleteOptions.filter(option => !this.tags.includes(option));\n }\n\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","p","constructor","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","warning","noAutoComplete","error","success","noDuplicates","label","tagVariant","acceptUserInput","clearable","placeholder","readonly","disabled","enableVirtualScroll","autoCompleteOptions","filteredAutoCompleteOptions","value","noWrap","loading","errorIndexes","helpText","errorMessage","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","_this","_inherits","_a","_createClass","key","updated","changedProperties","_this2","super","has","options","JSON","parse","e","Array","isArray","filter","option","_toConsumableArray","onTagsChanged","connectedCallback","emit","disconnectedCallback","render","hasLabelSlot","test","hasLabel","hasHelpText","hasErrorMessage","html","_templateObject","_taggedTemplateLiteral","classMap","map","tag","index","_templateObject2","handleRemove","_templateObject3","handleInputChange","handleInputKeydown","handleFocus","_templateObject4","handleSelect","_templateObject5","_templateObject6","event","detail","concat","resetInput","preventDefault","autoComplete","get","styles","NileElement","__decorate","state","prototype","query","property","type","Boolean","String","reflect","attribute","_export","customElement"],"mappings":"+5JAyBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAKYC,KAAAA,CAAiBC,iBAAAA,CAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAEvC,WACA,CAAA,OAA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CACFtG"}
1
+ {"version":3,"file":"nile-chip.cjs.js","sources":["../../../src/nile-chip/nile-chip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit';\nimport { customElement, query, state, property } from 'lit/decorators.js';\nimport { styles } from './nile-chip.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../internal/slot';\nimport NileElement, { NileFormControl } from '../internal/nile-element';\n\ninterface CustomEventDetail {\n value: string;\n}\n\n@customElement('nile-chip')\nexport class NileChip extends NileElement {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n\n @state() tags: string[] = [];\n\n @state() inputValue: string = '';\n\n @state() isDropdownOpen: boolean = false;\n\n @query('nile-auto-complete') autoComplete!: any;\n\n /** Sets the input to a warning state, changing its visual appearance. */\n @property({ type: Boolean }) warning = false;\n\n@property({ type: Boolean }) noAutoComplete = false;\n\n\n /** Sets the input to an error state, changing its visual appearance. */\n @property({ type: Boolean }) error = false;\n\n /** Sets the input to a success state, changing its visual appearance. */\n @property({ type: Boolean }) success = false;\n\n /** Disables the duplicate entries. */\n @property({ type: Boolean }) noDuplicates = false;\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n @property({ type: String }) tagVariant: string = ''; // can be '', 'normal', 'success', etc.\n\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) acceptUserInput = false;\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = 'type here...';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n // AUTO-COMPLETE-OPTIONS\n\n /** Virtual scroll in dropdown options. */\n @property({ type: Boolean }) enableVirtualScroll = false;\n\n @property({ type: Array }) autoCompleteOptions: any[] = [];\n\n @property({ type: Array }) filteredAutoCompleteOptions: any[] = [];\n\n @property({ type: Array }) value: any[] = [];\n\n @property({ type: Boolean }) noWrap: boolean = false;\n\n @property({ type: Boolean }) loading: boolean = false;\n\n @property({ type: Array }) errorIndexes: number[] = [];\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\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 protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n if (changedProperties.has('autoCompleteOptions')) {\n let options = this.autoCompleteOptions;\n if (typeof options === 'string') {\n try {\n options = JSON.parse(options);\n } catch (e) {\n options = [];\n }\n }\n this.filteredAutoCompleteOptions = Array.isArray(options) ? [...options] : [];\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n }\n if (changedProperties.has('value')){\n this.tags = [...this.value];\n this.onTagsChanged();\n }\n if (changedProperties.has('tags')){\n this.onTagsChanged();\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (this.noDuplicates) {\n this.filteredAutoCompleteOptions =\n this.filteredAutoCompleteOptions.filter(\n option => !this.value.includes(option)\n );\n }\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n render() {\n // Check if slots are present\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n\n // Check if label and help text are present\n const hasLabel = this.label ? true : !!hasLabelSlot;\n\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'nile-chip--disabled': this.disabled,\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div\n part='base' \n class=${classMap({\n 'nile-chip': true,\n 'nile-chip--warning': this.warning,\n 'nile-chip--error': this.error,\n 'nile-chip--success': this.success,\n 'nile-chip--no-wrap': this.noWrap,\n })}\n >\n ${this.tags.map(\n (tag, index) => html`\n <nile-tag\n class=${classMap({\n 'nile-chip__tags': true,\n })}\n .variant=${this.errorIndexes.includes(index) ? 'error' : 'normal'}\n @nile-remove=${() => this.handleRemove(tag)}\n removable\n ?pill=${this.tagVariant !== 'normal'}\n >\n ${tag}\n </nile-tag>\n `\n )}\n <div class=\"nile-chip__auto-complete\">\n ${this.noAutoComplete\n ? html`\n <nile-input\n .value=${this.inputValue}\n .placeholder=${this.placeholder}\n .disabled=${this.disabled}\n ?no-border=${true}\n ?no-outline=${true}\n ?no-padding=${true}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @focus=${this.handleFocus}\n exportparts=\"input\"\n ></nile-input>\n `\n : html`\n <nile-auto-complete\n .enableVirtualScroll=${this.enableVirtualScroll}\n .allMenuItems=${this.filteredAutoCompleteOptions}\n .filterFunction=${this.filterFunction}\n .renderItemFunction=${this.renderItemFunction}\n .loading=\"${this.loading}\"\n .value=${this.inputValue}\n ?isDropdownOpen=${this.isDropdownOpen}\n .noBorder=${true}\n .noOutline=${true}\n .noPadding=${true}\n .disabled=${this.disabled}\n openOnFocus\n exportparts=\"options__wrapper, input\"\n .placeholder=${this.placeholder}\n @nile-input=${this.handleInputChange}\n @keydown=${this.handleInputKeydown}\n @nile-focus=${this.handleFocus}\n @nile-complete=${this.handleSelect}\n ></nile-auto-complete>\n `}\n </div>\n </div>\n ${hasHelpText\n ? html` <nile-form-help-text>${this.helpText}</nile-form-help-text> `\n : ``}\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n </div>\n `;\n }\n\n private handleSelect(event: CustomEvent<CustomEventDetail>) {\n // Add the selected value to the tags array only if it doesn't already exist\n if (!this.noDuplicates || !this.tags.includes(event.detail.value)) {\n this.tags = [...this.tags, event.detail.value];\n this.emit('nile-chip-change', { value: this.tags });\n this.resetInput();\n }\n }\n\n private handleRemove(value: string) {\n // Remove the tag from the tags array\n this.tags = this.tags.filter(tag => tag !== value);\n\n if (this.noDuplicates && this.autoCompleteOptions.includes(value)) {\n this.filteredAutoCompleteOptions = [\n ...this.filteredAutoCompleteOptions,\n value,\n ];\n }\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n private handleInputChange(event: CustomEvent<CustomEventDetail>) {\n // Update the input value\n this.inputValue = event.detail.value;\n }\n\n private handleInputKeydown(event: KeyboardEvent) {\n if (!this.acceptUserInput) {\n return;\n }\n\n if(event.key === 'Tab'){\n event.preventDefault()\n }\n \n if (\n (event.key === 'Enter' || event.key === 'Tab' ) \n && this.inputValue \n && (!this.noDuplicates || !this.tags.includes(this.inputValue))\n ) {\n event.preventDefault()\n this.tags = [...this.tags, this.inputValue];\n this.resetInput();\n this.emit('nile-chip-change', { value: this.tags });\n }\n\n if(\n (event.key === 'Enter'|| event.key === 'Tab' ) \n && this.inputValue \n && (this.noDuplicates || this.tags.includes(this.inputValue))\n ){\n this.emit('nile-duplicates-blocked');\n }\n }\n\n private handleFocus() {\n if (this.noAutoComplete) {\n return;\n }\n this.isDropdownOpen = true;\n }\n\n onTagsChanged() {\n if (this.noDuplicates)\n this.filteredAutoCompleteOptions = this.filteredAutoCompleteOptions.filter(option => !this.tags.includes(option));\n }\n\n\n private resetInput() {\n // Reset the input-related properties\n this.inputValue = '';\n this.isDropdownOpen = false;\n this.autoComplete.value = '';\n this.autoComplete.handleFocus();\n }\n}\n\nexport default NileChip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-chip': NileChip;\n }\n}\n"],"names":["NileChip","p","constructor","this","hasSlotController","HasSlotController","tags","inputValue","isDropdownOpen","warning","noAutoComplete","error","success","noDuplicates","label","tagVariant","acceptUserInput","clearable","placeholder","readonly","disabled","enableVirtualScroll","autoCompleteOptions","filteredAutoCompleteOptions","value","noWrap","loading","errorIndexes","helpText","errorMessage","filterFunction","item","searchedValue","toLowerCase","includes","renderItemFunction","_this","_inherits","_a","_createClass","key","updated","changedProperties","_this2","super","has","options","JSON","parse","e","Array","isArray","filter","option","_toConsumableArray","onTagsChanged","connectedCallback","emit","disconnectedCallback","render","hasLabelSlot","test","hasLabel","hasHelpText","hasErrorMessage","html","_templateObject","_taggedTemplateLiteral","classMap","map","tag","index","_templateObject2","handleRemove","_templateObject3","handleInputChange","handleInputKeydown","handleFocus","_templateObject4","handleSelect","_templateObject5","_templateObject6","event","detail","concat","resetInput","preventDefault","autoComplete","get","styles","NileElement","__decorate","state","prototype","query","property","type","Boolean","String","reflect","attribute","_export","customElement"],"mappings":"+5JAyBaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAKYC,KAAAA,CAAiBC,iBAAAA,CAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAEvC,WACA,CAAA,OAAA,CAAA,CAGOF,KAAAA,CAAIG,IAAAA,CAAa,EAEjBH,CAAAA,KAAAA,CAAUI,UAAW,CAAA,EAAA,CAErBJ,KAAAA,CAAcK,cAAAA,CAAAA,CAAY,CAKNL,CAAAA,KAAAA,CAAOM,OAAG,CAAA,CAAA,CAAA,CAEZN,KAAAA,CAAcO,cAAAA,CAAAA,CAAG,CAIfP,CAAAA,KAAAA,CAAKQ,KAAG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A,CAAAA,CAAAA,CAAAA,CAAAA,CAAA6F,SAAA,CAAA,SAAA,CAAA,IAAA,IAE3BF,CAAA,CAAA,CAA1BI,CAAS,CAAA,CAAEC,IAAM9C,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAqClD,EAAA6F,SAAA,CAAA,cAAA,CAAA,IAAA,IAEFF,CAAA,CAAA,CAApDI,EAAS,CAAEK,SAAAA,CAAW,WAAaD,CAAAA,OAAAA,CAAAA,CAAS,CAAsBnG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA6F,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEVF,CAAA,CAAA,CAAxDI,CAAS,CAAA,CAAEK,UAAW,eAAiBD,CAAAA,OAAAA,CAAAA,CAAS,CAA0BnG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA6F,SAAA,CAAA,cAAA,CAAA,IAAA,IAE7CF,CAAA,CAAA,CAA7BI,CAAS,CAAA,CAAEK,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmKpG,EAAA6F,SAAA,CAAA,gBAAA,CAAA,IAAA,EAE3JF,CAAAA,CAAAA,CAAAA,CAAA,CAA7BI,CAAAA,CAAS,CAAEK,SAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkEpG,CAAA6F,CAAAA,SAAAA,CAAA,oBAAA,CAAA,IAAA,EAAA,CAAA,CAAAQ,OAAA,KA9E7ErG,EAAQ2F,CAAA,CAAA,CADpBW,CAAc,CAAA,WAAA,CAAA,CAAA,CACFtG"}
@@ -27,53 +27,49 @@ import{__decorate as t}from"tslib";import{html as i}from"lit";import{state as e,
27
27
  ${t}
28
28
  </nile-tag>
29
29
  `))}
30
- <div class="nile-chip__auto-complete">
31
- ${this.noAutoComplete?i`
32
- <nile-input
33
- .value=${this.inputValue}
34
- .placeholder=${this.placeholder}
35
- .disabled=${this.disabled}
36
- ?no-border=${!0}
37
- ?no-outline=${!0}
38
- ?no-padding=${!0}
39
- @nile-input=${this.handleInputChange}
40
- @keydown=${this.handleInputKeydown}
41
- @focus=${this.handleFocus}
42
- exportparts="input"
43
- ></nile-input>
44
- `:i`
45
- <nile-auto-complete
46
- .enableVirtualScroll=${this.enableVirtualScroll}
47
- .allMenuItems=${this.filteredAutoCompleteOptions}
48
- .filterFunction=${this.filterFunction}
49
- .renderItemFunction=${this.renderItemFunction}
50
- .loading="${this.loading}"
51
- .value=${this.inputValue}
52
- ?isDropdownOpen=${this.isDropdownOpen}
53
- .noBorder=${!0}
54
- .noOutline=${!0}
55
- .noPadding=${!0}
56
- .disabled=${this.disabled}
57
- openOnFocus
58
- exportparts="options__wrapper, input"
59
- .placeholder=${this.placeholder}
60
- @nile-input=${this.handleInputChange}
61
- @keydown=${this.handleInputKeydown}
62
- @nile-focus=${this.handleFocus}
63
- @nile-complete=${this.handleSelect}
64
- ></nile-auto-complete>
65
- `}
66
- </div>
67
-
30
+ <div class="nile-chip__auto-complete">
31
+ ${this.noAutoComplete?i`
32
+ <nile-input
33
+ .value=${this.inputValue}
34
+ .placeholder=${this.placeholder}
35
+ .disabled=${this.disabled}
36
+ ?no-border=${!0}
37
+ ?no-outline=${!0}
38
+ ?no-padding=${!0}
39
+ @nile-input=${this.handleInputChange}
40
+ @keydown=${this.handleInputKeydown}
41
+ @focus=${this.handleFocus}
42
+ exportparts="input"
43
+ ></nile-input>
44
+ `:i`
45
+ <nile-auto-complete
46
+ .enableVirtualScroll=${this.enableVirtualScroll}
47
+ .allMenuItems=${this.filteredAutoCompleteOptions}
48
+ .filterFunction=${this.filterFunction}
49
+ .renderItemFunction=${this.renderItemFunction}
50
+ .loading="${this.loading}"
51
+ .value=${this.inputValue}
52
+ ?isDropdownOpen=${this.isDropdownOpen}
53
+ .noBorder=${!0}
54
+ .noOutline=${!0}
55
+ .noPadding=${!0}
56
+ .disabled=${this.disabled}
57
+ openOnFocus
58
+ exportparts="options__wrapper, input"
59
+ .placeholder=${this.placeholder}
60
+ @nile-input=${this.handleInputChange}
61
+ @keydown=${this.handleInputKeydown}
62
+ @nile-focus=${this.handleFocus}
63
+ @nile-complete=${this.handleSelect}
64
+ ></nile-auto-complete>
65
+ `}
66
+ </div>
68
67
  </div>
69
- ${s?i`
70
- <nile-form-help-text>${this.helpText}</nile-form-help-text>
71
- `:""}
72
-
68
+ ${s?i` <nile-form-help-text>${this.helpText}</nile-form-help-text> `:""}
73
69
  ${o?i`
74
- <nile-form-error-message
75
- >${this.errorMessage}</nile-form-error-message
76
- >
77
- `:""}
70
+ <nile-form-error-message
71
+ >${this.errorMessage}</nile-form-error-message
72
+ >
73
+ `:""}
78
74
  </div>
79
75
  `}handleSelect(t){this.noDuplicates&&this.tags.includes(t.detail.value)||(this.tags=[...this.tags,t.detail.value],this.emit("nile-chip-change",{value:this.tags}),this.resetInput())}handleRemove(t){this.tags=this.tags.filter((i=>i!==t)),this.noDuplicates&&this.autoCompleteOptions.includes(t)&&(this.filteredAutoCompleteOptions=[...this.filteredAutoCompleteOptions,t]),this.emit("nile-chip-change",{value:this.tags})}handleInputChange(t){this.inputValue=t.detail.value}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=[...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"))}handleFocus(){this.noAutoComplete||(this.isDropdownOpen=!0)}onTagsChanged(){this.noDuplicates&&(this.filteredAutoCompleteOptions=this.filteredAutoCompleteOptions.filter((t=>!this.tags.includes(t))))}resetInput(){this.inputValue="",this.isDropdownOpen=!1,this.autoComplete.value="",this.autoComplete.handleFocus()}};t([e()],p.prototype,"tags",void 0),t([e()],p.prototype,"inputValue",void 0),t([e()],p.prototype,"isDropdownOpen",void 0),t([s("nile-auto-complete")],p.prototype,"autoComplete",void 0),t([o({type:Boolean})],p.prototype,"warning",void 0),t([o({type:Boolean})],p.prototype,"noAutoComplete",void 0),t([o({type:Boolean})],p.prototype,"error",void 0),t([o({type:Boolean})],p.prototype,"success",void 0),t([o({type:Boolean})],p.prototype,"noDuplicates",void 0),t([o()],p.prototype,"label",void 0),t([o({type:String})],p.prototype,"tagVariant",void 0),t([o({type:Boolean})],p.prototype,"acceptUserInput",void 0),t([o({type:Boolean})],p.prototype,"clearable",void 0),t([o()],p.prototype,"placeholder",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"readonly",void 0),t([o({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),t([o({type:Boolean})],p.prototype,"enableVirtualScroll",void 0),t([o({type:Array})],p.prototype,"autoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"filteredAutoCompleteOptions",void 0),t([o({type:Array})],p.prototype,"value",void 0),t([o({type:Boolean})],p.prototype,"noWrap",void 0),t([o({type:Boolean})],p.prototype,"loading",void 0),t([o({type:Array})],p.prototype,"errorIndexes",void 0),t([o({attribute:"help-text",reflect:!0})],p.prototype,"helpText",void 0),t([o({attribute:"error-message",reflect:!0})],p.prototype,"errorMessage",void 0),t([o({attribute:!1})],p.prototype,"filterFunction",void 0),t([o({attribute:!1})],p.prototype,"renderItemFunction",void 0),p=t([l("nile-chip")],p);export{p as N};
@@ -146,59 +146,55 @@ let NileChip = class NileChip extends NileElement {
146
146
  ${tag}
147
147
  </nile-tag>
148
148
  `)}
149
- <div class="nile-chip__auto-complete">
150
- ${this.noAutoComplete
149
+ <div class="nile-chip__auto-complete">
150
+ ${this.noAutoComplete
151
151
  ? html `
152
- <nile-input
153
- .value=${this.inputValue}
154
- .placeholder=${this.placeholder}
155
- .disabled=${this.disabled}
156
- ?no-border=${true}
157
- ?no-outline=${true}
158
- ?no-padding=${true}
159
- @nile-input=${this.handleInputChange}
160
- @keydown=${this.handleInputKeydown}
161
- @focus=${this.handleFocus}
162
- exportparts="input"
163
- ></nile-input>
164
- `
152
+ <nile-input
153
+ .value=${this.inputValue}
154
+ .placeholder=${this.placeholder}
155
+ .disabled=${this.disabled}
156
+ ?no-border=${true}
157
+ ?no-outline=${true}
158
+ ?no-padding=${true}
159
+ @nile-input=${this.handleInputChange}
160
+ @keydown=${this.handleInputKeydown}
161
+ @focus=${this.handleFocus}
162
+ exportparts="input"
163
+ ></nile-input>
164
+ `
165
165
  : html `
166
- <nile-auto-complete
167
- .enableVirtualScroll=${this.enableVirtualScroll}
168
- .allMenuItems=${this.filteredAutoCompleteOptions}
169
- .filterFunction=${this.filterFunction}
170
- .renderItemFunction=${this.renderItemFunction}
171
- .loading="${this.loading}"
172
- .value=${this.inputValue}
173
- ?isDropdownOpen=${this.isDropdownOpen}
174
- .noBorder=${true}
175
- .noOutline=${true}
176
- .noPadding=${true}
177
- .disabled=${this.disabled}
178
- openOnFocus
179
- exportparts="options__wrapper, input"
180
- .placeholder=${this.placeholder}
181
- @nile-input=${this.handleInputChange}
182
- @keydown=${this.handleInputKeydown}
183
- @nile-focus=${this.handleFocus}
184
- @nile-complete=${this.handleSelect}
185
- ></nile-auto-complete>
186
- `}
187
- </div>
188
-
166
+ <nile-auto-complete
167
+ .enableVirtualScroll=${this.enableVirtualScroll}
168
+ .allMenuItems=${this.filteredAutoCompleteOptions}
169
+ .filterFunction=${this.filterFunction}
170
+ .renderItemFunction=${this.renderItemFunction}
171
+ .loading="${this.loading}"
172
+ .value=${this.inputValue}
173
+ ?isDropdownOpen=${this.isDropdownOpen}
174
+ .noBorder=${true}
175
+ .noOutline=${true}
176
+ .noPadding=${true}
177
+ .disabled=${this.disabled}
178
+ openOnFocus
179
+ exportparts="options__wrapper, input"
180
+ .placeholder=${this.placeholder}
181
+ @nile-input=${this.handleInputChange}
182
+ @keydown=${this.handleInputKeydown}
183
+ @nile-focus=${this.handleFocus}
184
+ @nile-complete=${this.handleSelect}
185
+ ></nile-auto-complete>
186
+ `}
187
+ </div>
189
188
  </div>
190
189
  ${hasHelpText
191
- ? html `
192
- <nile-form-help-text>${this.helpText}</nile-form-help-text>
193
- `
190
+ ? html ` <nile-form-help-text>${this.helpText}</nile-form-help-text> `
194
191
  : ``}
195
-
196
192
  ${hasErrorMessage
197
193
  ? html `
198
- <nile-form-error-message
199
- >${this.errorMessage}</nile-form-error-message
200
- >
201
- `
194
+ <nile-form-error-message
195
+ >${this.errorMessage}</nile-form-error-message
196
+ >
197
+ `
202
198
  : ``}
203
199
  </div>
204
200
  `;