@aquera/nile-elements 0.0.120 → 0.0.122

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 (524) hide show
  1. package/README.md +10 -0
  2. package/dist/abap-511af2a5.cjs.js +2 -0
  3. package/dist/abap-511af2a5.cjs.js.map +1 -0
  4. package/dist/abap-f2ab40d0.esm.js +1 -0
  5. package/dist/{angular-ts-32bbcd01.cjs.js → angular-ts-a70761c6.cjs.js} +2 -2
  6. package/dist/{angular-ts-32bbcd01.cjs.js.map → angular-ts-a70761c6.cjs.js.map} +1 -1
  7. package/dist/cairo-014ad724.cjs.js +2 -0
  8. package/dist/cairo-014ad724.cjs.js.map +1 -0
  9. package/dist/cairo-9be40999.esm.js +1 -0
  10. package/dist/catppuccin-frappe-52a52bb1.cjs.js +2 -0
  11. package/dist/catppuccin-frappe-52a52bb1.cjs.js.map +1 -0
  12. package/dist/catppuccin-frappe-dbc3161e.esm.js +1 -0
  13. package/dist/catppuccin-latte-d8a0f6a8.cjs.js +2 -0
  14. package/dist/catppuccin-latte-d8a0f6a8.cjs.js.map +1 -0
  15. package/dist/catppuccin-latte-e7591143.esm.js +1 -0
  16. package/dist/catppuccin-macchiato-19a7795e.cjs.js +2 -0
  17. package/dist/catppuccin-macchiato-19a7795e.cjs.js.map +1 -0
  18. package/dist/catppuccin-macchiato-283b424a.esm.js +1 -0
  19. package/dist/catppuccin-mocha-165e830c.esm.js +1 -0
  20. package/dist/catppuccin-mocha-9f9ec5f6.cjs.js +2 -0
  21. package/dist/catppuccin-mocha-9f9ec5f6.cjs.js.map +1 -0
  22. package/dist/cobol-8517cfc1.esm.js +1 -0
  23. package/dist/cobol-922d57ed.cjs.js +2 -0
  24. package/dist/cobol-922d57ed.cjs.js.map +1 -0
  25. package/dist/{cpp-c2442fe2.cjs.js → cpp-8812199e.cjs.js} +2 -2
  26. package/dist/{cpp-c2442fe2.cjs.js.map → cpp-8812199e.cjs.js.map} +1 -1
  27. package/dist/{crystal-1913e34d.cjs.js → crystal-5458e62a.cjs.js} +2 -2
  28. package/dist/{crystal-1913e34d.cjs.js.map → crystal-5458e62a.cjs.js.map} +1 -1
  29. package/dist/{edge-ef9e682b.cjs.js → edge-cb04b11b.cjs.js} +2 -2
  30. package/dist/{edge-ef9e682b.cjs.js.map → edge-cb04b11b.cjs.js.map} +1 -1
  31. package/dist/{elm-7fd07d47.cjs.js → elm-53a0b5b4.cjs.js} +2 -2
  32. package/dist/{elm-7fd07d47.cjs.js.map → elm-53a0b5b4.cjs.js.map} +1 -1
  33. package/dist/{erb-c813c1f2.cjs.js → erb-1bc4721c.cjs.js} +2 -2
  34. package/dist/{erb-c813c1f2.cjs.js.map → erb-1bc4721c.cjs.js.map} +1 -1
  35. package/dist/{fortran-fixed-form-c39bf051.cjs.js → fortran-fixed-form-00a9d08f.cjs.js} +2 -2
  36. package/dist/{fortran-fixed-form-c39bf051.cjs.js.map → fortran-fixed-form-00a9d08f.cjs.js.map} +1 -1
  37. package/dist/{fsharp-ba007c9c.cjs.js → fsharp-661f4f18.cjs.js} +2 -2
  38. package/dist/{fsharp-ba007c9c.cjs.js.map → fsharp-661f4f18.cjs.js.map} +1 -1
  39. package/dist/{gdresource-f3068367.cjs.js → gdresource-8fb6a6ad.cjs.js} +2 -2
  40. package/dist/{gdresource-f3068367.cjs.js.map → gdresource-8fb6a6ad.cjs.js.map} +1 -1
  41. package/dist/{git-commit-372b638c.cjs.js → git-commit-9373b48b.cjs.js} +2 -2
  42. package/dist/{git-commit-372b638c.cjs.js.map → git-commit-9373b48b.cjs.js.map} +1 -1
  43. package/dist/{git-rebase-2cc6f2a3.cjs.js → git-rebase-c3fa2bb9.cjs.js} +2 -2
  44. package/dist/{git-rebase-2cc6f2a3.cjs.js.map → git-rebase-c3fa2bb9.cjs.js.map} +1 -1
  45. package/dist/go-85139440.esm.js +1 -0
  46. package/dist/go-d5ed1b82.cjs.js +2 -0
  47. package/dist/go-d5ed1b82.cjs.js.map +1 -0
  48. package/dist/{graphql-74f146e1.cjs.js → graphql-1541cb3c.cjs.js} +2 -2
  49. package/dist/{graphql-74f146e1.cjs.js.map → graphql-1541cb3c.cjs.js.map} +1 -1
  50. package/dist/{handlebars-864fcb12.cjs.js → handlebars-39ab86cd.cjs.js} +2 -2
  51. package/dist/{handlebars-864fcb12.cjs.js.map → handlebars-39ab86cd.cjs.js.map} +1 -1
  52. package/dist/{http-08501497.cjs.js → http-1cf9a3de.cjs.js} +2 -2
  53. package/dist/{http-08501497.cjs.js.map → http-1cf9a3de.cjs.js.map} +1 -1
  54. package/dist/{hxml-bbac80e4.cjs.js → hxml-6d54d760.cjs.js} +2 -2
  55. package/dist/{hxml-bbac80e4.cjs.js.map → hxml-6d54d760.cjs.js.map} +1 -1
  56. package/dist/hy-33aa9c6f.cjs.js +2 -0
  57. package/dist/hy-33aa9c6f.cjs.js.map +1 -0
  58. package/dist/hy-a7a6e9c3.esm.js +1 -0
  59. package/dist/{julia-689ac552.cjs.js → julia-0152d8b9.cjs.js} +2 -2
  60. package/dist/{julia-689ac552.cjs.js.map → julia-0152d8b9.cjs.js.map} +1 -1
  61. package/dist/{latex-4d76e817.cjs.js → latex-33ebd2ce.cjs.js} +2 -2
  62. package/dist/{latex-4d76e817.cjs.js.map → latex-33ebd2ce.cjs.js.map} +1 -1
  63. package/dist/luau-19444703.cjs.js +2 -0
  64. package/dist/luau-19444703.cjs.js.map +1 -0
  65. package/dist/luau-b564b070.esm.js +1 -0
  66. package/dist/{marko-2880d4ee.cjs.js → marko-23ca6223.cjs.js} +2 -2
  67. package/dist/{marko-2880d4ee.cjs.js.map → marko-23ca6223.cjs.js.map} +1 -1
  68. package/dist/mdc-05d87356.esm.js +1 -0
  69. package/dist/mdc-56aefda2.cjs.js +2 -0
  70. package/dist/mdc-56aefda2.cjs.js.map +1 -0
  71. package/dist/{mdx-a859ee84.cjs.js → mdx-01dab0d1.cjs.js} +2 -2
  72. package/dist/{mdx-a859ee84.cjs.js.map → mdx-01dab0d1.cjs.js.map} +1 -1
  73. package/dist/{mdx-bf2a8fe9.esm.js → mdx-0782bcd8.esm.js} +1 -1
  74. package/dist/nextflow-11e4899f.esm.js +1 -0
  75. package/dist/nextflow-2a4bf0cc.cjs.js +2 -0
  76. package/dist/nextflow-2a4bf0cc.cjs.js.map +1 -0
  77. package/dist/{nginx-7bc0fc82.cjs.js → nginx-1aabec59.cjs.js} +2 -2
  78. package/dist/{nginx-7bc0fc82.cjs.js.map → nginx-1aabec59.cjs.js.map} +1 -1
  79. package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
  80. package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
  81. package/dist/nile-accordion/nile-accordion.esm.js +1 -1
  82. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  83. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  84. package/dist/nile-auto-complete/nile-auto-complete.esm.js +6 -15
  85. package/dist/nile-avatar/nile-avatar.cjs.js +1 -1
  86. package/dist/nile-avatar/nile-avatar.cjs.js.map +1 -1
  87. package/dist/nile-avatar/nile-avatar.esm.js +1 -1
  88. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  89. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  90. package/dist/nile-badge/nile-badge.esm.js +1 -1
  91. package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js +1 -1
  92. package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js.map +1 -1
  93. package/dist/nile-breadcrumb/nile-breadcrumb.esm.js +1 -1
  94. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js +1 -1
  95. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js.map +1 -1
  96. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.esm.js +2 -2
  97. package/dist/nile-button/nile-button.cjs.js +1 -1
  98. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  99. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  100. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  101. package/dist/nile-button/nile-button.css.esm.js +24 -28
  102. package/dist/nile-button/nile-button.esm.js +1 -1
  103. package/dist/nile-button-toggle/nile-button-toggle.cjs.js +1 -1
  104. package/dist/nile-button-toggle/nile-button-toggle.cjs.js.map +1 -1
  105. package/dist/nile-button-toggle/nile-button-toggle.esm.js +1 -1
  106. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js +1 -1
  107. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js.map +1 -1
  108. package/dist/nile-button-toggle-group/nile-button-toggle-group.esm.js +1 -1
  109. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  110. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  111. package/dist/nile-calendar/nile-calendar.esm.js +4 -4
  112. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  113. package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
  114. package/dist/nile-calendar/nile-calendar.test.esm.js +9 -5
  115. package/dist/nile-card/nile-card.cjs.js +1 -1
  116. package/dist/nile-card/nile-card.cjs.js.map +1 -1
  117. package/dist/nile-card/nile-card.esm.js +1 -1
  118. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  119. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  120. package/dist/nile-checkbox/nile-checkbox.esm.js +1 -1
  121. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  122. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  123. package/dist/nile-chip/nile-chip.esm.js +2 -6
  124. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  125. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  126. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  127. package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
  128. package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
  129. package/dist/nile-content-editor/nile-content-editor.esm.js +5 -5
  130. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  131. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  132. package/dist/nile-date-picker/nile-date-picker.esm.js +8 -15
  133. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  134. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  135. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  136. package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
  137. package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
  138. package/dist/nile-drawer/nile-drawer.esm.js +1 -1
  139. package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
  140. package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
  141. package/dist/nile-empty-state/nile-empty-state.esm.js +1 -1
  142. package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
  143. package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
  144. package/dist/nile-form-help-text/nile-form-help-text.esm.js +5 -4
  145. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +2 -0
  146. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +1 -0
  147. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -0
  148. package/dist/nile-highlighter/nile-highlighter.cjs.js +1 -1
  149. package/dist/nile-highlighter/nile-highlighter.cjs.js.map +1 -1
  150. package/dist/nile-highlighter/nile-highlighter.esm.js +1 -1
  151. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  152. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  153. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  154. package/dist/nile-input/nile-input.cjs.js +1 -1
  155. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  156. package/dist/nile-input/nile-input.esm.js +1 -1
  157. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  158. package/dist/nile-input/nile-input.test.cjs.js.map +1 -1
  159. package/dist/nile-input/nile-input.test.esm.js +1 -1
  160. package/dist/nile-link/nile-link.cjs.js +1 -1
  161. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  162. package/dist/nile-link/nile-link.esm.js +1 -1
  163. package/dist/nile-list/nile-list.cjs.js +1 -1
  164. package/dist/nile-list/nile-list.cjs.js.map +1 -1
  165. package/dist/nile-list/nile-list.esm.js +1 -1
  166. package/dist/nile-list-item/nile-list-item.cjs.js +1 -1
  167. package/dist/nile-list-item/nile-list-item.cjs.js.map +1 -1
  168. package/dist/nile-list-item/nile-list-item.esm.js +1 -1
  169. package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
  170. package/dist/nile-loader/nile-loader.test.cjs.js.map +1 -1
  171. package/dist/nile-loader/nile-loader.test.esm.js +1 -1
  172. package/dist/nile-menu/nile-menu.cjs.js +1 -1
  173. package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
  174. package/dist/nile-menu/nile-menu.esm.js +2 -5
  175. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  176. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  177. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  178. package/dist/nile-option/nile-option.cjs.js +1 -1
  179. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  180. package/dist/nile-option/nile-option.esm.js +1 -1
  181. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  182. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  183. package/dist/nile-popover/nile-popover.esm.js +4 -4
  184. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  185. package/dist/nile-popup/nile-popup.cjs.js.map +1 -1
  186. package/dist/nile-popup/nile-popup.esm.js +1 -1
  187. package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
  188. package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
  189. package/dist/nile-radio-group/nile-radio-group.esm.js +1 -1
  190. package/dist/nile-select/nile-select.cjs.js +1 -1
  191. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  192. package/dist/nile-select/nile-select.esm.js +4 -6
  193. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
  194. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
  195. package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +1 -1
  196. package/dist/nile-split-panel/nile-split-panel.cjs.js +1 -1
  197. package/dist/nile-split-panel/nile-split-panel.cjs.js.map +1 -1
  198. package/dist/nile-split-panel/nile-split-panel.esm.js +1 -1
  199. package/dist/nile-stepper/nile-stepper.cjs.js +1 -1
  200. package/dist/nile-stepper/nile-stepper.cjs.js.map +1 -1
  201. package/dist/nile-stepper/nile-stepper.esm.js +1 -1
  202. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  203. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  204. package/dist/nile-tab/nile-tab.esm.js +1 -1
  205. package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
  206. package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
  207. package/dist/nile-tab-group/nile-tab-group.esm.js +4 -4
  208. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
  209. package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +1 -1
  210. package/dist/nile-tab-group/nile-tab-group.test.esm.js +13 -5
  211. package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
  212. package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
  213. package/dist/nile-table-body/nile-table-body.esm.js +1 -1
  214. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  215. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  216. package/dist/nile-tag/nile-tag.esm.js +1 -1
  217. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  218. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  219. package/dist/nile-textarea/nile-textarea.esm.js +1 -1
  220. package/dist/nile-toast/nile-toast.cjs.js +1 -1
  221. package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
  222. package/dist/nile-toast/nile-toast.esm.js +1 -1
  223. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  224. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  225. package/dist/nile-tooltip/nile-tooltip.esm.js +1 -1
  226. package/dist/nile-tree/nile-tree.cjs.js +1 -1
  227. package/dist/nile-tree/nile-tree.cjs.js.map +1 -1
  228. package/dist/nile-tree/nile-tree.esm.js +1 -1
  229. package/dist/{nim-1cf0460c.cjs.js → nim-55b3acf7.cjs.js} +2 -2
  230. package/dist/{nim-1cf0460c.cjs.js.map → nim-55b3acf7.cjs.js.map} +1 -1
  231. package/dist/one-dark-pro-3bcc58f7.cjs.js +2 -0
  232. package/dist/one-dark-pro-3bcc58f7.cjs.js.map +1 -0
  233. package/dist/one-dark-pro-4fce25f8.esm.js +1 -0
  234. package/dist/{razor-0acc551a.cjs.js → razor-57f13c4a.cjs.js} +2 -2
  235. package/dist/{razor-0acc551a.cjs.js.map → razor-57f13c4a.cjs.js.map} +1 -1
  236. package/dist/{rst-6b792481.cjs.js → rst-4226018b.cjs.js} +2 -2
  237. package/dist/{rst-6b792481.cjs.js.map → rst-4226018b.cjs.js.map} +1 -1
  238. package/dist/{ruby-578b1ee6.cjs.js → ruby-4306ddd1.cjs.js} +2 -2
  239. package/dist/{ruby-578b1ee6.cjs.js.map → ruby-4306ddd1.cjs.js.map} +1 -1
  240. package/dist/{shaderlab-606f022b.cjs.js → shaderlab-2234cd06.cjs.js} +2 -2
  241. package/dist/{shaderlab-606f022b.cjs.js.map → shaderlab-2234cd06.cjs.js.map} +1 -1
  242. package/dist/{shellsession-cb0df007.cjs.js → shellsession-cd95727e.cjs.js} +2 -2
  243. package/dist/{shellsession-cb0df007.cjs.js.map → shellsession-cd95727e.cjs.js.map} +1 -1
  244. package/dist/{sparql-589e0308.cjs.js → sparql-197a828d.cjs.js} +2 -2
  245. package/dist/{sparql-589e0308.cjs.js.map → sparql-197a828d.cjs.js.map} +1 -1
  246. package/dist/src/nile-accordion/nile-accordion.d.ts +0 -1
  247. package/dist/src/nile-accordion/nile-accordion.js +0 -1
  248. package/dist/src/nile-accordion/nile-accordion.js.map +1 -1
  249. package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +0 -1
  250. package/dist/src/nile-auto-complete/nile-auto-complete.js +2 -12
  251. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  252. package/dist/src/nile-avatar/nile-avatar.d.ts +0 -1
  253. package/dist/src/nile-avatar/nile-avatar.js +0 -1
  254. package/dist/src/nile-avatar/nile-avatar.js.map +1 -1
  255. package/dist/src/nile-badge/nile-badge.d.ts +0 -1
  256. package/dist/src/nile-badge/nile-badge.js +0 -1
  257. package/dist/src/nile-badge/nile-badge.js.map +1 -1
  258. package/dist/src/nile-breadcrumb/nile-breadcrumb.d.ts +0 -1
  259. package/dist/src/nile-breadcrumb/nile-breadcrumb.js +0 -5
  260. package/dist/src/nile-breadcrumb/nile-breadcrumb.js.map +1 -1
  261. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.d.ts +0 -1
  262. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +0 -1
  263. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -1
  264. package/dist/src/nile-button/nile-button.css.js +24 -28
  265. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  266. package/dist/src/nile-button/nile-button.d.ts +0 -1
  267. package/dist/src/nile-button/nile-button.js +0 -1
  268. package/dist/src/nile-button/nile-button.js.map +1 -1
  269. package/dist/src/nile-button-toggle/nile-button-toggle.d.ts +0 -1
  270. package/dist/src/nile-button-toggle/nile-button-toggle.js +0 -1
  271. package/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -1
  272. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +0 -1
  273. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +0 -1
  274. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -1
  275. package/dist/src/nile-calendar/nile-calendar.d.ts +1 -11
  276. package/dist/src/nile-calendar/nile-calendar.js +12 -80
  277. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  278. package/dist/src/nile-calendar/nile-calendar.test.js +50 -5
  279. package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
  280. package/dist/src/nile-card/nile-card.d.ts +0 -1
  281. package/dist/src/nile-card/nile-card.js +0 -1
  282. package/dist/src/nile-card/nile-card.js.map +1 -1
  283. package/dist/src/nile-checkbox/nile-checkbox.d.ts +0 -1
  284. package/dist/src/nile-checkbox/nile-checkbox.js +0 -1
  285. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  286. package/dist/src/nile-chip/nile-chip.d.ts +0 -1
  287. package/dist/src/nile-chip/nile-chip.js +0 -5
  288. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  289. package/dist/src/nile-code-editor/nile-code-editor.d.ts +0 -1
  290. package/dist/src/nile-code-editor/nile-code-editor.js +0 -1
  291. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  292. package/dist/src/nile-content-editor/nile-content-editor.d.ts +0 -1
  293. package/dist/src/nile-content-editor/nile-content-editor.js +0 -1
  294. package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
  295. package/dist/src/nile-date-picker/nile-date-picker.d.ts +0 -1
  296. package/dist/src/nile-date-picker/nile-date-picker.js +7 -14
  297. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  298. package/dist/src/nile-dialog/nile-dialog.d.ts +0 -1
  299. package/dist/src/nile-dialog/nile-dialog.js +0 -1
  300. package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  301. package/dist/src/nile-drawer/nile-drawer.d.ts +0 -1
  302. package/dist/src/nile-drawer/nile-drawer.js +0 -1
  303. package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
  304. package/dist/src/nile-empty-state/nile-empty-state.d.ts +0 -1
  305. package/dist/src/nile-empty-state/nile-empty-state.js +0 -1
  306. package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
  307. package/dist/src/nile-form-help-text/nile-form-help-text.d.ts +2 -0
  308. package/dist/src/nile-form-help-text/nile-form-help-text.js +14 -6
  309. package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
  310. package/dist/src/nile-form-help-text/nile-form-help-text.test.d.ts +1 -0
  311. package/dist/src/nile-form-help-text/nile-form-help-text.test.js +67 -0
  312. package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -0
  313. package/dist/src/nile-icon-button/nile-icon-button.d.ts +0 -1
  314. package/dist/src/nile-icon-button/nile-icon-button.js +0 -1
  315. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  316. package/dist/src/nile-input/nile-input.d.ts +0 -1
  317. package/dist/src/nile-input/nile-input.js +0 -1
  318. package/dist/src/nile-input/nile-input.js.map +1 -1
  319. package/dist/src/nile-input/nile-input.test.js +5 -1
  320. package/dist/src/nile-input/nile-input.test.js.map +1 -1
  321. package/dist/src/nile-link/nile-link.d.ts +0 -1
  322. package/dist/src/nile-link/nile-link.js +0 -1
  323. package/dist/src/nile-link/nile-link.js.map +1 -1
  324. package/dist/src/nile-list/nile-list.d.ts +0 -1
  325. package/dist/src/nile-list/nile-list.js +0 -5
  326. package/dist/src/nile-list/nile-list.js.map +1 -1
  327. package/dist/src/nile-list-item/nile-list-item.d.ts +0 -1
  328. package/dist/src/nile-list-item/nile-list-item.js +0 -1
  329. package/dist/src/nile-list-item/nile-list-item.js.map +1 -1
  330. package/dist/src/nile-loader/nile-loader.test.js +5 -0
  331. package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
  332. package/dist/src/nile-menu/nile-menu.d.ts +0 -1
  333. package/dist/src/nile-menu/nile-menu.js +0 -4
  334. package/dist/src/nile-menu/nile-menu.js.map +1 -1
  335. package/dist/src/nile-menu-item/nile-menu-item.d.ts +0 -2
  336. package/dist/src/nile-menu-item/nile-menu-item.js +0 -2
  337. package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
  338. package/dist/src/nile-option/nile-option.d.ts +0 -2
  339. package/dist/src/nile-option/nile-option.js +0 -2
  340. package/dist/src/nile-option/nile-option.js.map +1 -1
  341. package/dist/src/nile-popover/nile-popover.d.ts +1 -1
  342. package/dist/src/nile-popover/nile-popover.js +5 -2
  343. package/dist/src/nile-popover/nile-popover.js.map +1 -1
  344. package/dist/src/nile-popup/nile-popup.d.ts +0 -2
  345. package/dist/src/nile-popup/nile-popup.js +0 -2
  346. package/dist/src/nile-popup/nile-popup.js.map +1 -1
  347. package/dist/src/nile-radio-group/nile-radio-group.d.ts +0 -1
  348. package/dist/src/nile-radio-group/nile-radio-group.js +0 -1
  349. package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  350. package/dist/src/nile-select/nile-select.d.ts +0 -1
  351. package/dist/src/nile-select/nile-select.js +3 -6
  352. package/dist/src/nile-select/nile-select.js.map +1 -1
  353. package/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +0 -1
  354. package/dist/src/nile-slide-toggle/nile-slide-toggle.js +0 -1
  355. package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  356. package/dist/src/nile-split-panel/nile-split-panel.d.ts +0 -1
  357. package/dist/src/nile-split-panel/nile-split-panel.js +0 -1
  358. package/dist/src/nile-split-panel/nile-split-panel.js.map +1 -1
  359. package/dist/src/nile-stepper/nile-stepper.d.ts +0 -1
  360. package/dist/src/nile-stepper/nile-stepper.js +0 -1
  361. package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
  362. package/dist/src/nile-tab/nile-tab.d.ts +0 -1
  363. package/dist/src/nile-tab/nile-tab.js +0 -1
  364. package/dist/src/nile-tab/nile-tab.js.map +1 -1
  365. package/dist/src/nile-tab-group/nile-tab-group.d.ts +1 -2
  366. package/dist/src/nile-tab-group/nile-tab-group.js +5 -10
  367. package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
  368. package/dist/src/nile-tab-group/nile-tab-group.test.js +56 -22
  369. package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
  370. package/dist/src/nile-table-body/nile-table-body.d.ts +0 -1
  371. package/dist/src/nile-table-body/nile-table-body.js +0 -1
  372. package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
  373. package/dist/src/nile-tag/nile-tag.d.ts +0 -1
  374. package/dist/src/nile-tag/nile-tag.js +0 -1
  375. package/dist/src/nile-tag/nile-tag.js.map +1 -1
  376. package/dist/src/nile-textarea/nile-textarea.d.ts +0 -1
  377. package/dist/src/nile-textarea/nile-textarea.js +0 -1
  378. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  379. package/dist/src/nile-toast/nile-toast.d.ts +0 -1
  380. package/dist/src/nile-toast/nile-toast.js +0 -1
  381. package/dist/src/nile-toast/nile-toast.js.map +1 -1
  382. package/dist/src/nile-tooltip/nile-tooltip.d.ts +0 -1
  383. package/dist/src/nile-tooltip/nile-tooltip.js +0 -1
  384. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  385. package/dist/src/nile-tree/nile-tree.d.ts +0 -1
  386. package/dist/src/nile-tree/nile-tree.js +0 -1
  387. package/dist/src/nile-tree/nile-tree.js.map +1 -1
  388. package/dist/{svelte-2ae868b6.cjs.js → svelte-5a90df12.cjs.js} +2 -2
  389. package/dist/{svelte-2ae868b6.cjs.js.map → svelte-5a90df12.cjs.js.map} +1 -1
  390. package/dist/{svelte-ac03a3ac.esm.js → svelte-cb8564e6.esm.js} +1 -1
  391. package/dist/{system-verilog-7d2d7268.cjs.js → system-verilog-b3e652eb.cjs.js} +2 -2
  392. package/dist/{system-verilog-7d2d7268.cjs.js.map → system-verilog-b3e652eb.cjs.js.map} +1 -1
  393. package/dist/{system-verilog-2d49210f.esm.js → system-verilog-c1c6377f.esm.js} +1 -1
  394. package/dist/{templ-f2d0dadd.esm.js → templ-13492ead.esm.js} +1 -1
  395. package/dist/{templ-2a2d64b7.cjs.js → templ-4425132d.cjs.js} +2 -2
  396. package/dist/{templ-2a2d64b7.cjs.js.map → templ-4425132d.cjs.js.map} +1 -1
  397. package/dist/{tex-8addc455.cjs.js → tex-d609b400.cjs.js} +2 -2
  398. package/dist/{tex-8addc455.cjs.js.map → tex-d609b400.cjs.js.map} +1 -1
  399. package/dist/{ts-tags-e56ee3ee.cjs.js → ts-tags-ba7eb9e3.cjs.js} +2 -2
  400. package/dist/{ts-tags-e56ee3ee.cjs.js.map → ts-tags-ba7eb9e3.cjs.js.map} +1 -1
  401. package/dist/tsconfig.tsbuildinfo +1 -1
  402. package/dist/{twig-911808dc.cjs.js → twig-e9bb57f2.cjs.js} +2 -2
  403. package/dist/{twig-911808dc.cjs.js.map → twig-e9bb57f2.cjs.js.map} +1 -1
  404. package/dist/{vue-9b06428b.cjs.js → vue-16d91bfa.cjs.js} +2 -2
  405. package/dist/{vue-9b06428b.cjs.js.map → vue-16d91bfa.cjs.js.map} +1 -1
  406. package/dist/{vue-html-ca1dd5bf.cjs.js → vue-html-432cdd7f.cjs.js} +2 -2
  407. package/dist/{vue-html-ca1dd5bf.cjs.js.map → vue-html-432cdd7f.cjs.js.map} +1 -1
  408. package/dist/wikitext-2748811a.cjs.js +2 -0
  409. package/dist/wikitext-2748811a.cjs.js.map +1 -0
  410. package/dist/wikitext-c9071578.esm.js +1 -0
  411. package/package.json +2 -2
  412. package/rollup.config.js +1 -0
  413. package/src/nile-accordion/nile-accordion.ts +0 -1
  414. package/src/nile-auto-complete/nile-auto-complete.ts +2 -13
  415. package/src/nile-avatar/nile-avatar.ts +0 -2
  416. package/src/nile-badge/nile-badge.ts +0 -2
  417. package/src/nile-breadcrumb/nile-breadcrumb.ts +0 -2
  418. package/src/nile-breadcrumb-item/nile-breadcrumb-item.ts +0 -2
  419. package/src/nile-button/nile-button.css.ts +24 -28
  420. package/src/nile-button/nile-button.ts +0 -2
  421. package/src/nile-button-toggle/nile-button-toggle.ts +0 -2
  422. package/src/nile-button-toggle-group/nile-button-toggle-group.ts +0 -2
  423. package/src/nile-calendar/nile-calendar.test.ts +64 -5
  424. package/src/nile-calendar/nile-calendar.ts +14 -96
  425. package/src/nile-card/nile-card.ts +0 -2
  426. package/src/nile-checkbox/nile-checkbox.ts +0 -2
  427. package/src/nile-chip/nile-chip.ts +0 -6
  428. package/src/nile-code-editor/nile-code-editor.ts +0 -2
  429. package/src/nile-content-editor/nile-content-editor.ts +0 -2
  430. package/src/nile-date-picker/nile-date-picker.ts +7 -15
  431. package/src/nile-dialog/nile-dialog.ts +0 -2
  432. package/src/nile-drawer/nile-drawer.ts +0 -2
  433. package/src/nile-empty-state/nile-empty-state.ts +0 -2
  434. package/src/nile-form-help-text/nile-form-help-text.test.ts +86 -0
  435. package/src/nile-form-help-text/nile-form-help-text.ts +17 -15
  436. package/src/nile-icon-button/nile-icon-button.ts +0 -2
  437. package/src/nile-input/nile-input.test.ts +7 -1
  438. package/src/nile-input/nile-input.ts +0 -2
  439. package/src/nile-link/nile-link.ts +0 -2
  440. package/src/nile-list/nile-list.ts +0 -2
  441. package/src/nile-list-item/nile-list-item.ts +0 -2
  442. package/src/nile-loader/nile-loader.test.ts +6 -0
  443. package/src/nile-menu/nile-menu.ts +0 -6
  444. package/src/nile-menu-item/nile-menu-item.ts +0 -3
  445. package/src/nile-option/nile-option.ts +0 -3
  446. package/src/nile-popover/nile-popover.ts +3 -3
  447. package/src/nile-popup/nile-popup.ts +0 -3
  448. package/src/nile-radio-group/nile-radio-group.ts +0 -2
  449. package/src/nile-select/nile-select.ts +3 -7
  450. package/src/nile-slide-toggle/nile-slide-toggle.ts +0 -2
  451. package/src/nile-split-panel/nile-split-panel.ts +0 -2
  452. package/src/nile-stepper/nile-stepper.ts +0 -2
  453. package/src/nile-tab/nile-tab.ts +0 -2
  454. package/src/nile-tab-group/nile-tab-group.test.ts +71 -29
  455. package/src/nile-tab-group/nile-tab-group.ts +6 -14
  456. package/src/nile-table-body/nile-table-body.ts +0 -2
  457. package/src/nile-tag/nile-tag.ts +0 -2
  458. package/src/nile-textarea/nile-textarea.ts +0 -2
  459. package/src/nile-toast/nile-toast.ts +0 -2
  460. package/src/nile-tooltip/nile-tooltip.ts +0 -2
  461. package/src/nile-tree/nile-tree.ts +0 -2
  462. package/tsconfig.json +1 -0
  463. package/vscode-html-custom-data.json +3717 -60
  464. package/web-test-runner.config.mjs +6 -1
  465. package/dist/abap-1e9762d1.esm.js +0 -1
  466. package/dist/abap-3b3fe406.cjs.js +0 -2
  467. package/dist/abap-3b3fe406.cjs.js.map +0 -1
  468. package/dist/catppuccin-frappe-c0734345.esm.js +0 -1
  469. package/dist/catppuccin-frappe-eb77e95d.cjs.js +0 -2
  470. package/dist/catppuccin-frappe-eb77e95d.cjs.js.map +0 -1
  471. package/dist/catppuccin-latte-471f76fc.cjs.js +0 -2
  472. package/dist/catppuccin-latte-471f76fc.cjs.js.map +0 -1
  473. package/dist/catppuccin-latte-d798493f.esm.js +0 -1
  474. package/dist/catppuccin-macchiato-7ac78e7e.cjs.js +0 -2
  475. package/dist/catppuccin-macchiato-7ac78e7e.cjs.js.map +0 -1
  476. package/dist/catppuccin-macchiato-d78b2ec2.esm.js +0 -1
  477. package/dist/catppuccin-mocha-3b00f8d6.cjs.js +0 -2
  478. package/dist/catppuccin-mocha-3b00f8d6.cjs.js.map +0 -1
  479. package/dist/catppuccin-mocha-6a189a57.esm.js +0 -1
  480. package/dist/cobol-4ed2b235.esm.js +0 -1
  481. package/dist/cobol-c428fca2.cjs.js +0 -2
  482. package/dist/cobol-c428fca2.cjs.js.map +0 -1
  483. package/dist/go-4c55ae2b.esm.js +0 -1
  484. package/dist/go-9bee484b.cjs.js +0 -2
  485. package/dist/go-9bee484b.cjs.js.map +0 -1
  486. package/dist/hy-431f15f8.cjs.js +0 -2
  487. package/dist/hy-431f15f8.cjs.js.map +0 -1
  488. package/dist/hy-5e43d6c1.esm.js +0 -1
  489. package/dist/luau-0b166b7a.cjs.js +0 -2
  490. package/dist/luau-0b166b7a.cjs.js.map +0 -1
  491. package/dist/luau-7d7eaa97.esm.js +0 -1
  492. package/dist/mdc-13285ad6.esm.js +0 -1
  493. package/dist/mdc-a3fe82c5.cjs.js +0 -2
  494. package/dist/mdc-a3fe82c5.cjs.js.map +0 -1
  495. package/dist/nextflow-35e5a63d.esm.js +0 -1
  496. package/dist/nextflow-c666e91b.cjs.js +0 -2
  497. package/dist/nextflow-c666e91b.cjs.js.map +0 -1
  498. package/dist/nile-split-panel/nile-split-panel.test.cjs.js +0 -2
  499. package/dist/nile-split-panel/nile-split-panel.test.cjs.js.map +0 -1
  500. package/dist/nile-split-panel/nile-split-panel.test.esm.js +0 -1
  501. package/dist/nile-stepper/nile-stepper.test.cjs.js +0 -2
  502. package/dist/nile-stepper/nile-stepper.test.cjs.js.map +0 -1
  503. package/dist/nile-stepper/nile-stepper.test.esm.js +0 -1
  504. package/dist/nile-tree/nile-tree.test.cjs.js +0 -2
  505. package/dist/nile-tree/nile-tree.test.cjs.js.map +0 -1
  506. package/dist/nile-tree/nile-tree.test.esm.js +0 -1
  507. package/dist/one-dark-pro-9477257e.cjs.js +0 -2
  508. package/dist/one-dark-pro-9477257e.cjs.js.map +0 -1
  509. package/dist/one-dark-pro-deb4f5e9.esm.js +0 -1
  510. package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +0 -1
  511. package/dist/src/nile-split-panel/nile-split-panel.test.js +0 -4
  512. package/dist/src/nile-split-panel/nile-split-panel.test.js.map +0 -1
  513. package/dist/src/nile-stepper/nile-stepper.test.d.ts +0 -4
  514. package/dist/src/nile-stepper/nile-stepper.test.js +0 -7
  515. package/dist/src/nile-stepper/nile-stepper.test.js.map +0 -1
  516. package/dist/src/nile-tree/nile-tree.test.d.ts +0 -2
  517. package/dist/src/nile-tree/nile-tree.test.js +0 -5
  518. package/dist/src/nile-tree/nile-tree.test.js.map +0 -1
  519. package/dist/wikitext-b9a7e67b.cjs.js +0 -2
  520. package/dist/wikitext-b9a7e67b.cjs.js.map +0 -1
  521. package/dist/wikitext-c06489b3.esm.js +0 -1
  522. package/src/nile-split-panel/nile-split-panel.test.ts +0 -7
  523. package/src/nile-stepper/nile-stepper.test.ts +0 -12
  524. package/src/nile-tree/nile-tree.test.ts +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"nile-menu-item.js","sourceRoot":"","sources":["../../../src/nile-menu-item/nile-menu-item.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAGT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,WAAW;IAAtC;;QAGc,YAAO,GAAU,KAAK,CAAC;QACvB,aAAQ,GAAU,KAAK,CAAC;QAQ3C,+FAA+F;QACnF,SAAI,GAA0B,QAAQ,CAAC;QAEnD,yCAAyC;QACG,YAAO,GAAG,KAAK,CAAC;QAE5D,gHAAgH;QACpG,UAAK,GAAG,EAAE,CAAC;QAEvB,qEAAqE;QACzB,aAAQ,GAAG,KAAK,CAAC;QAE7D,yCAAyC;QACG,eAAU,GAAG,KAAK,CAAC;IA2HjE,CAAC;IAzHC,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,gBAAgB,CAAC,OAAO,EA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AAGP;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAAiB;AAGhD;IAAX,QAAQ,EAAE;2CAAY;AAGqB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAkB;AAGjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAoB;AAsC/D;IADC,KAAK,CAAC,SAAS,CAAC;uDAkBhB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;wDAGjB;AAGD;IADC,KAAK,CAAC,MAAM,CAAC;oDASb;AAhGU,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAoJxB;SApJY,YAAY;AAsJzB,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-menu-item.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { getTextContent } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-menu-item\n *\n * @summary Menu items provide options for the user to pick from in a menu.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n *\n * @slot - The menu item's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart base - The component's base wrapper.\n * @csspart checked-icon - The checked icon, which is only visible when the menu item is checked.\n * @csspart prefix - The prefix container.\n * @csspart label - The menu item label.\n * @csspart suffix - The suffix container.\n * @csspart submenu-icon - The submenu icon, visible only when the menu item has a submenu (not yet implemented).\n */\n\n@customElement('nile-menu-item')\nexport class NileMenuItem extends NileElement {\n static styles: CSSResultGroup = styles;\n\n protected override BUBBLES: boolean=false;\n protected override COMPOSED: boolean=false;\n\n private cachedTextLabel: string;\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @query('.menu-item') menuItem: HTMLElement;\n\n /** The type of menu item to render. To use `checked`, this value must be set to `checkbox`. */\n @property() type: 'normal' | 'checkbox' = 'normal';\n\n /** Draws the item in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */\n @property() value = '';\n\n /** Draws the menu item in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the item in a checked state. */\n @property({ type: Boolean, reflect: true }) hasSubMenu = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange');\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n @watch('checked')\n handleCheckedChange() {\n // For proper accessibility, users have to use type=\"checkbox\" to use the checked attribute\n if (this.checked && this.type !== 'checkbox') {\n this.checked = false;\n console.error(\n 'The checked attribute can only be used on menu items with type=\"checkbox\"',\n this\n );\n return;\n }\n\n // Only checkbox types can receive the aria-checked attribute\n if (this.type === 'checkbox') {\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-checked');\n }\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('type')\n handleTypeChange() {\n if (this.type === 'checkbox') {\n this.setAttribute('role', 'menuitemcheckbox');\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.setAttribute('role', 'menuitem');\n this.removeAttribute('aria-checked');\n }\n }\n\n /** Returns a text label based on the contents of the menu item's default slot. */\n getTextLabel() {\n return getTextContent(this.defaultSlot);\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n 'menu-item': true,\n 'menu-item--checked': this.checked,\n 'menu-item--disabled': this.disabled,\n 'menu-item--has-submenu': this.hasSubMenu, // reserved for future use\n })}\n >\n ${this.checked\n ? html`\n <span part=\"checked-icon\" class=\"menu-item__check\">\n <nile-icon\n name=\"tick\"\n library=\"system\"\n aria-hidden=\"true\"\n ></nile-icon>\n </span>\n `\n : ``}\n\n <slot name=\"prefix\" part=\"prefix\" class=\"menu-item__prefix\"></slot>\n\n <slot\n part=\"label\"\n class=\"menu-item__label\"\n @slotchange=${this.handleDefaultSlotChange}\n ></slot>\n\n <slot name=\"suffix\" part=\"suffix\" class=\"menu-item__suffix\"></slot>\n\n ${this.hasSubMenu\n ? html` <span part=\"submenu-icon\" class=\"menu-item__chevron\">\n <nile-icon\n name=\"arrowright\"\n library=\"system\"\n aria-hidden=\"true\"\n ></nile-icon>\n </span>`\n : ``}\n </div>\n `;\n }\n}\n\nexport default NileMenuItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-menu-item': NileMenuItem;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-menu-item.js","sourceRoot":"","sources":["../../../src/nile-menu-item/nile-menu-item.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,Q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gDAAoB;AAsC/D;IADC,KAAK,CAAC,SAAS,CAAC;uDAkBhB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;wDAGjB;AAGD;IADC,KAAK,CAAC,MAAM,CAAC;oDASb;AA7FU,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAiJxB;SAjJY,YAAY;AAmJzB,eAAe,YAAY,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement } from 'lit/decorators.js';\nimport { styles } from './nile-menu-item.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { query } from 'lit/decorators.js';\nimport { getTextContent } from '../internal/slot';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-menu-item\n *\n * @summary Menu items provide options for the user to pick from in a menu.\n * @status stable\n * @since 2.0\n *\n * @dependency nile-icon\n *\n * @slot - The menu item's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart base - The component's base wrapper.\n * @csspart checked-icon - The checked icon, which is only visible when the menu item is checked.\n * @csspart prefix - The prefix container.\n * @csspart label - The menu item label.\n * @csspart suffix - The suffix container.\n * @csspart submenu-icon - The submenu icon, visible only when the menu item has a submenu (not yet implemented).\n */\n\n@customElement('nile-menu-item')\nexport class NileMenuItem extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private cachedTextLabel: string;\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @query('.menu-item') menuItem: HTMLElement;\n\n /** The type of menu item to render. To use `checked`, this value must be set to `checkbox`. */\n @property() type: 'normal' | 'checkbox' = 'normal';\n\n /** Draws the item in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** A unique value to store in the menu item. This can be used as a way to identify menu items when selected. */\n @property() value = '';\n\n /** Draws the menu item in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Draws the item in a checked state. */\n @property({ type: Boolean, reflect: true }) hasSubMenu = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleHostClick = this.handleHostClick.bind(this);\n this.addEventListener('click', this.handleHostClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.handleHostClick);\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange');\n }\n }\n\n private handleHostClick(event: MouseEvent) {\n // Prevent the click event from being emitted when the button is disabled or loading\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n\n @watch('checked')\n handleCheckedChange() {\n // For proper accessibility, users have to use type=\"checkbox\" to use the checked attribute\n if (this.checked && this.type !== 'checkbox') {\n this.checked = false;\n console.error(\n 'The checked attribute can only be used on menu items with type=\"checkbox\"',\n this\n );\n return;\n }\n\n // Only checkbox types can receive the aria-checked attribute\n if (this.type === 'checkbox') {\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-checked');\n }\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('type')\n handleTypeChange() {\n if (this.type === 'checkbox') {\n this.setAttribute('role', 'menuitemcheckbox');\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n } else {\n this.setAttribute('role', 'menuitem');\n this.removeAttribute('aria-checked');\n }\n }\n\n /** Returns a text label based on the contents of the menu item's default slot. */\n getTextLabel() {\n return getTextContent(this.defaultSlot);\n }\n\n render() {\n return html`\n <div\n part=\"base\"\n class=${classMap({\n 'menu-item': true,\n 'menu-item--checked': this.checked,\n 'menu-item--disabled': this.disabled,\n 'menu-item--has-submenu': this.hasSubMenu, // reserved for future use\n })}\n >\n ${this.checked\n ? html`\n <span part=\"checked-icon\" class=\"menu-item__check\">\n <nile-icon\n name=\"tick\"\n library=\"system\"\n aria-hidden=\"true\"\n ></nile-icon>\n </span>\n `\n : ``}\n\n <slot name=\"prefix\" part=\"prefix\" class=\"menu-item__prefix\"></slot>\n\n <slot\n part=\"label\"\n class=\"menu-item__label\"\n @slotchange=${this.handleDefaultSlotChange}\n ></slot>\n\n <slot name=\"suffix\" part=\"suffix\" class=\"menu-item__suffix\"></slot>\n\n ${this.hasSubMenu\n ? html` <span part=\"submenu-icon\" class=\"menu-item__chevron\">\n <nile-icon\n name=\"arrowright\"\n library=\"system\"\n aria-hidden=\"true\"\n ></nile-icon>\n </span>`\n : ``}\n </div>\n `;\n }\n}\n\nexport default NileMenuItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-menu-item': NileMenuItem;\n }\n}\n"]}
@@ -33,8 +33,6 @@ import '../nile-checkbox';
33
33
  */
34
34
  export declare class NileOption extends NileElement {
35
35
  static styles: CSSResultGroup;
36
- protected BUBBLES: boolean;
37
- protected COMPOSED: boolean;
38
36
  private cachedTextLabel;
39
37
  defaultSlot: HTMLSlotElement;
40
38
  current: boolean;
@@ -38,8 +38,6 @@ import '../nile-checkbox';
38
38
  let NileOption = class NileOption extends NileElement {
39
39
  constructor() {
40
40
  super(...arguments);
41
- this.BUBBLES = false;
42
- this.COMPOSED = false;
43
41
  this.current = false; // the user has keyed into the option, but hasn't selected it yet (shows a highlight)
44
42
  this.selected = false; // the option is selected and has aria-selected="true"
45
43
  this.hasHover = false; // we need this because Safari doesn't honor :hover styles while dragging
@@ -1 +1 @@
1
- {"version":3,"file":"nile-option.js","sourceRo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CAAC,gBAAgB,CAAC;+CAA8B;AAE7C;IAAR,KAAK,EAAE;2CAAiB;AAChB;IAAR,KAAK,EAAE;4CAAkB;AACjB;IAAR,KAAK,EAAE;4CAAkB;AACjB;IAAR,KAAK,EAAE;0CAAgB;AACf;IAAR,KAAK,EAAE;oDAA0B;AAOL;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAY;AAGI;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AA+C7D;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,OAAO,CAAC;mDAed;AA/FU,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA6ItB;SA7IY,UAAU;AA+IvB,eAAe,UAAU,CAAC","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 { LitElement, CSSResultArray, TemplateResult } from 'lit-element';\nimport { styles } from './nile-option.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport type { CSSResultGroup } from 'lit';\nimport NileElement from '../internal/nile-element';\nimport '../nile-checkbox';\n\n/**\n * Nile icon component.\n *\n * @tag nile-option\n *\n */\n\n/**\n * @summary Options define the selectable items within various form controls such as [select](/components/select).\n * @status stable\n *\n * @dependency nile-icon\n *\n * @slot - The option's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart base - The component's base wrapper.\n * @csspart label - The option's label.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart suffix - The container that wraps the suffix.\n */\n\n@customElement('nile-option')\nexport class NileOption extends NileElement {\n static styles: CSSResultGroup = styles;\n\n protected override BUBBLES: boolean=false;\n protected override COMPOSED: boolean=false;\n\n private cachedTextLabel: string;\n\n @query('.option__label') defaultSlot: HTMLSlotElement;\n\n @state() current = false; // the user has keyed into the option, but hasn't selected it yet (shows a highlight)\n @state() selected = false; // the option is selected and has aria-selected=\"true\"\n @state() hasHover = false; // we need this because Safari doesn't honor :hover styles while dragging\n @state() hidden = false; // the option is hidden\n @state() isMultipleSelect = false;\n\n /**\n * The option's value. When selected, the containing form control will receive this value. The value must be unique\n * from other options in the same group. Values may not contain spaces, as spaces are used as delimiters when listing\n * multiple values.\n */\n @property({ reflect: true }) value = '';\n\n /** Draws the option in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'option');\n this.setAttribute('aria-selected', 'false');\n\n // Find the closest parent 'nile-select' element\n const parentSelect = this.closest('nile-select');\n\n // Check if the parent has the 'multiple' attribute\n if (parentSelect && parentSelect.hasAttribute('multiple')) {\n let multipleValue = parentSelect.getAttribute('multiple');\n if (multipleValue !== 'false') {\n if(multipleValue === ''){\n multipleValue = 'true';\n }\n this.isMultipleSelect = Boolean(multipleValue);\n }\n }\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange');\n }\n }\n\n private handleMouseEnter() {\n this.hasHover = true;\n }\n\n private handleMouseLeave() {\n this.hasHover = false;\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('selected')\n handleSelectedChange() {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n }\n\n @watch('value')\n handleValueChange() {\n // Ensure the value is a string. This ensures the next line doesn't error and allows framework users to pass numbers\n // instead of requiring them to cast the value to a string.\n if (typeof this.value !== 'string') {\n this.value = String(this.value);\n }\n\n // if (this.value.includes(' ')) {\n // console.error(\n // `Option values cannot include a space. All spaces have been replaced with underscores.`,\n // this\n // );\n // this.value = this.value.replace(/ /g, '_');\n // }\n }\n\n /** Returns a plain text label based on the option's content. */\n getTextLabel() {\n // Search for a label element inside the component\n const labelElement = this.querySelector('label');\n\n // If a label element is found, return its text content\n if (labelElement) {\n return labelElement.textContent?.trim() ?? '';\n }\n\n // If no label element is found, return the existing behavior\n return (this.textContent ?? '').trim();\n }\n\n render() {\n return html`\n ${!this.hidden\n ? html` <div\n part=\"base\"\n class=${classMap({\n option: true,\n 'option--single-select': !this.isMultipleSelect,\n 'option--current': this.selected && !this.isMultipleSelect,\n 'option--disabled': this.disabled,\n 'option--selected': this.selected && !this.isMultipleSelect,\n 'option--hover': this.hasHover,\n })}\n @mouseenter=${this.handleMouseEnter}\n @mouseleave=${this.handleMouseLeave}\n >\n\n ${this.isMultipleSelect ? html`<nile-checkbox class=\"option--checkbox\" .checked=${this.selected}></nile-checkbox>` : ''}\n\n <slot part=\"prefix\" name=\"prefix\" class=\"option__prefix\"></slot>\n <slot\n part=\"label\"\n class=\"option__label\"\n @slotchange=${this.handleDefaultSlotChange}\n ></slot>\n <slot part=\"suffix\" name=\"suffix\" class=\"option__suffix\"></slot>\n </div>`\n : ''}\n `;\n }\n}\n\nexport default NileOption;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-option': NileOption;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-option.js","sourceRoot":"","sources":["../../../src/nile-option/nile-option.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE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AE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAY;AAGI;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AA+C7D;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;sDAGjB;AAGD;IADC,KAAK,CAAC,OAAO,CAAC;mDAed;AA5FU,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA0ItB;SA1IY,UAAU;AA4IvB,eAAe,UAAU,CAAC","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 { LitElement, CSSResultArray, TemplateResult } from 'lit-element';\nimport { styles } from './nile-option.css';\nimport '../nile-icon';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport type { CSSResultGroup } from 'lit';\nimport NileElement from '../internal/nile-element';\nimport '../nile-checkbox';\n\n/**\n * Nile icon component.\n *\n * @tag nile-option\n *\n */\n\n/**\n * @summary Options define the selectable items within various form controls such as [select](/components/select).\n * @status stable\n *\n * @dependency nile-icon\n *\n * @slot - The option's label.\n * @slot prefix - Used to prepend an icon or similar element to the menu item.\n * @slot suffix - Used to append an icon or similar element to the menu item.\n *\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart base - The component's base wrapper.\n * @csspart label - The option's label.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart suffix - The container that wraps the suffix.\n */\n\n@customElement('nile-option')\nexport class NileOption extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private cachedTextLabel: string;\n\n @query('.option__label') defaultSlot: HTMLSlotElement;\n\n @state() current = false; // the user has keyed into the option, but hasn't selected it yet (shows a highlight)\n @state() selected = false; // the option is selected and has aria-selected=\"true\"\n @state() hasHover = false; // we need this because Safari doesn't honor :hover styles while dragging\n @state() hidden = false; // the option is hidden\n @state() isMultipleSelect = false;\n\n /**\n * The option's value. When selected, the containing form control will receive this value. The value must be unique\n * from other options in the same group. Values may not contain spaces, as spaces are used as delimiters when listing\n * multiple values.\n */\n @property({ reflect: true }) value = '';\n\n /** Draws the option in a disabled state, preventing selection. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'option');\n this.setAttribute('aria-selected', 'false');\n\n // Find the closest parent 'nile-select' element\n const parentSelect = this.closest('nile-select');\n\n // Check if the parent has the 'multiple' attribute\n if (parentSelect && parentSelect.hasAttribute('multiple')) {\n let multipleValue = parentSelect.getAttribute('multiple');\n if (multipleValue !== 'false') {\n if(multipleValue === ''){\n multipleValue = 'true';\n }\n this.isMultipleSelect = Boolean(multipleValue);\n }\n }\n }\n\n private handleDefaultSlotChange() {\n const textLabel = this.getTextLabel();\n\n // Ignore the first time the label is set\n if (typeof this.cachedTextLabel === 'undefined') {\n this.cachedTextLabel = textLabel;\n return;\n }\n\n // When the label changes, emit a slotchange event so parent controls see it\n if (textLabel !== this.cachedTextLabel) {\n this.cachedTextLabel = textLabel;\n this.emit('slotchange');\n }\n }\n\n private handleMouseEnter() {\n this.hasHover = true;\n }\n\n private handleMouseLeave() {\n this.hasHover = false;\n }\n\n @watch('disabled')\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('selected')\n handleSelectedChange() {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n }\n\n @watch('value')\n handleValueChange() {\n // Ensure the value is a string. This ensures the next line doesn't error and allows framework users to pass numbers\n // instead of requiring them to cast the value to a string.\n if (typeof this.value !== 'string') {\n this.value = String(this.value);\n }\n\n // if (this.value.includes(' ')) {\n // console.error(\n // `Option values cannot include a space. All spaces have been replaced with underscores.`,\n // this\n // );\n // this.value = this.value.replace(/ /g, '_');\n // }\n }\n\n /** Returns a plain text label based on the option's content. */\n getTextLabel() {\n // Search for a label element inside the component\n const labelElement = this.querySelector('label');\n\n // If a label element is found, return its text content\n if (labelElement) {\n return labelElement.textContent?.trim() ?? '';\n }\n\n // If no label element is found, return the existing behavior\n return (this.textContent ?? '').trim();\n }\n\n render() {\n return html`\n ${!this.hidden\n ? html` <div\n part=\"base\"\n class=${classMap({\n option: true,\n 'option--single-select': !this.isMultipleSelect,\n 'option--current': this.selected && !this.isMultipleSelect,\n 'option--disabled': this.disabled,\n 'option--selected': this.selected && !this.isMultipleSelect,\n 'option--hover': this.hasHover,\n })}\n @mouseenter=${this.handleMouseEnter}\n @mouseleave=${this.handleMouseLeave}\n >\n\n ${this.isMultipleSelect ? html`<nile-checkbox class=\"option--checkbox\" .checked=${this.selected}></nile-checkbox>` : ''}\n\n <slot part=\"prefix\" name=\"prefix\" class=\"option__prefix\"></slot>\n <slot\n part=\"label\"\n class=\"option__label\"\n @slotchange=${this.handleDefaultSlotChange}\n ></slot>\n <slot part=\"suffix\" name=\"suffix\" class=\"option__suffix\"></slot>\n </div>`\n : ''}\n `;\n }\n}\n\nexport default NileOption;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-option': NileOption;\n }\n}\n"]}
@@ -18,7 +18,6 @@ export declare class NilePopover extends NileElement {
18
18
  * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
19
19
  */
20
20
  static get styles(): CSSResultArray;
21
- protected BUBBLES: boolean;
22
21
  /**
23
22
  * The preferred placement of the popover. Note that the actual placement may vary as needed to keep the tooltip
24
23
  * inside of the viewport.
@@ -26,6 +25,7 @@ export declare class NilePopover extends NileElement {
26
25
  placement: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
27
26
  /** The distance in pixels from which to offset the popover away from its target. */
28
27
  distance: number;
28
+ preventOverlayClose: boolean;
29
29
  arrow: boolean;
30
30
  /** Gives the title to the popover */
31
31
  title: string;
@@ -19,7 +19,6 @@ import { watch } from '../internal/watch';
19
19
  let NilePopover = class NilePopover extends NileElement {
20
20
  constructor() {
21
21
  super(...arguments);
22
- this.BUBBLES = false;
23
22
  /**
24
23
  * The preferred placement of the popover. Note that the actual placement may vary as needed to keep the tooltip
25
24
  * inside of the viewport.
@@ -27,6 +26,7 @@ let NilePopover = class NilePopover extends NileElement {
27
26
  this.placement = 'top';
28
27
  /** The distance in pixels from which to offset the popover away from its target. */
29
28
  this.distance = 18;
29
+ this.preventOverlayClose = false;
30
30
  this.arrow = true;
31
31
  /** Gives the title to the popover */
32
32
  this.title = '';
@@ -49,7 +49,7 @@ let NilePopover = class NilePopover extends NileElement {
49
49
  });
50
50
  };
51
51
  this.handleDocumentClick = () => {
52
- if (this.isShow) {
52
+ if (this.isShow && !this.preventOverlayClose) {
53
53
  this.isShow = false;
54
54
  }
55
55
  };
@@ -125,6 +125,9 @@ __decorate([
125
125
  __decorate([
126
126
  property({ type: Number })
127
127
  ], NilePopover.prototype, "distance", void 0);
128
+ __decorate([
129
+ property({ type: Boolean, reflect: true })
130
+ ], NilePopover.prototype, "preventOverlayClose", void 0);
128
131
  __decorate([
129
132
  property({ type: Boolean, attribute: 'arrow' })
130
133
  ], NilePopover.prototype, "arrow", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"nile-popover.js","sourceRoot":"","sources":["../../../src/nile-popover/nile-popover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAIT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;;;GAKG;AAEI,IAAM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AGlC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAY;AAEZ;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAC,OAAO,EAAE,CAAC;yCAAc;AAE/B;IAAR,KAAK,EAAE;2CAAwB;AAEY;IAA3C,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;mDAInB;AAMK;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CAAe;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCAAc;AA8B1C;IADC,KAAK,CAAC,QAAQ,CAAC;iDAIf;AAtFU,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwIvB;SAxIY,WAAW;AA0IxB,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport { styles } from './nile-popover.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-popover\n *\n */\n@customElement('nile-popover')\nexport class NilePopover extends NileElement {\n /**\n * The styles for Popover\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n protected override BUBBLES: boolean=false;\n\n /**\n * The preferred placement of the popover. Note that the actual placement may vary as needed to keep the tooltip\n * inside of the viewport.\n */\n @property() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** The distance in pixels from which to offset the popover away from its target. */\n @property({ type: Number }) distance = 18;\n\n @property({ type: Boolean, attribute: 'arrow' }) arrow = true;\n\n /** Gives the title to the popover */\n @property({ type: String }) title = '';\n\n @property({type:Boolean }) open = false;\n \n @state() isShow:boolean = false;\n\n @property({ attribute: 'arrow-placement' }) arrowPlacement:\n | 'start'\n | 'end'\n | 'center'\n | 'anchor' = 'anchor';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n @property({ type: Boolean }) flip = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n document.addEventListener('click', this.handleDocumentClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n document.removeEventListener('click', this.handleDocumentClick);\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if(_changedProperties.has('open')){\n this.isShow=this.open;\n }\n }\n\n @watch('isShow')\n handleShowHide(){\n if(this.isShow)this.emit('nile-show')\n else this.emit('nile-hide')\n }\n\n public render(): TemplateResult {\n return html`\n <nile-popup\n active\n .arrow=\"${this.arrow && this.isShow}\"\n distance=\"${this.distance}\"\n placement=\"${this.placement}\"\n @click=${(e: Event) => e.stopPropagation()}\n arrowPlacement=\"${this.arrowPlacement}\"\n .flip=\"${this.flip}\"\n shift\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n >\n <slot\n slot=\"anchor\"\n name=\"anchor\"\n aria-describedby=\"tooltip\"\n @click=${this.handleClick}\n ></slot>\n ${this.isShow\n ? html` <div part=\"popover\" class=\"popover__box\">\n <slot name=\"title\" class=\"popover__title\">${this.title}</slot>\n <slot part=\"base\"></slot>\n <slot name=\"action\" class=\"popover__action\"> </slot>\n </div>`\n : html``}\n </nile-popup>\n `;\n }\n\n private handleClick = () => {\n this.isShow = !this.isShow;\n const allPopovers = document.querySelectorAll('nile-popover');\n\n allPopovers.forEach(popover => {\n if (popover !== this) {\n popover.isShow = false;\n }\n });\n };\n\n private handleDocumentClick = () => {\n if (this.isShow) {\n this.isShow = false;\n }\n };\n\n /* #endregion */\n}\n\nexport default NilePopover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-popover': NilePopover;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-popover.js","sourceRoot":"","sources":["../../../src/nile-popover/nile-popover.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAEL,IAAI,EACJ,QAAQ,GAIT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;;;GAKG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,WAAW;IAArC;;QASL;;;WAGG;QACS,cAAS,GAYJ,KAAK,CAAC;QAEvB,oFAAoF;QACxD,aAAQ,GAAG,EAAE,CAAC;QAEE,wBAAmB,GAAG,KAAK,CAAC;QAEvB,UAAK,GAAG,IAAI,CAAC;QAE9D,qCAAqC;QACT,UAAK,GAAG,EAAE,CAAC;QAEZ,SAAI,GAAG,KAAK,CAAC;QAE/B,WAAM,GAAW,KAAK,CAAC;QAEY,mBAAc,GAI3C,QAAQ,CAAC;QAExB;;;WAGG;QAC0B,UAAK,GAAG,KAAK,CAAC;QAEd,SAAI,GAAG,KAAK,CAAC;QAiElC,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3B,MAAM,WAAW,GAAG,QAAQ,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;YA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B,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwIvB;SAxIY,WAAW;AA0IxB,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n PropertyValues,\n} from 'lit-element';\nimport { customElement, state } from 'lit/decorators.js';\nimport { styles } from './nile-popover.css';\nimport NileElement from '../internal/nile-element';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-popover\n *\n */\n@customElement('nile-popover')\nexport class NilePopover extends NileElement {\n /**\n * The styles for Popover\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n /**\n * The preferred placement of the popover. Note that the actual placement may vary as needed to keep the tooltip\n * inside of the viewport.\n */\n @property() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** The distance in pixels from which to offset the popover away from its target. */\n @property({ type: Number }) distance = 18;\n\n @property({ type: Boolean, reflect: true }) preventOverlayClose = false;\n\n @property({ type: Boolean, attribute: 'arrow' }) arrow = true;\n\n /** Gives the title to the popover */\n @property({ type: String }) title = '';\n\n @property({type:Boolean }) open = false;\n \n @state() isShow:boolean = false;\n\n @property({ attribute: 'arrow-placement' }) arrowPlacement:\n | 'start'\n | 'end'\n | 'center'\n | 'anchor' = 'anchor';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n @property({ type: Boolean }) flip = false;\n\n /* #endregion */\n\n /* #region Methods */\n\n /**\n * Render method\n * @slot This is a slot test\n */\n\n connectedCallback() {\n super.connectedCallback();\n this.emit('nile-init');\n document.addEventListener('click', this.handleDocumentClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n document.removeEventListener('click', this.handleDocumentClick);\n }\n\n protected updated(_changedProperties: PropertyValues): void {\n if(_changedProperties.has('open')){\n this.isShow=this.open;\n }\n }\n\n @watch('isShow')\n handleShowHide(){\n if(this.isShow)this.emit('nile-show')\n else this.emit('nile-hide')\n }\n\n public render(): TemplateResult {\n return html`\n <nile-popup\n active\n .arrow=\"${this.arrow && this.isShow}\"\n distance=\"${this.distance}\"\n placement=\"${this.placement}\"\n @click=${(e: Event) => e.stopPropagation()}\n arrowPlacement=\"${this.arrowPlacement}\"\n .flip=\"${this.flip}\"\n shift\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n >\n <slot\n slot=\"anchor\"\n name=\"anchor\"\n aria-describedby=\"tooltip\"\n @click=${this.handleClick}\n ></slot>\n ${this.isShow\n ? html` <div part=\"popover\" class=\"popover__box\">\n <slot name=\"title\" class=\"popover__title\">${this.title}</slot>\n <slot part=\"base\"></slot>\n <slot name=\"action\" class=\"popover__action\"> </slot>\n </div>`\n : html``}\n </nile-popup>\n `;\n }\n\n private handleClick = () => {\n this.isShow = !this.isShow;\n const allPopovers = document.querySelectorAll('nile-popover');\n\n allPopovers.forEach(popover => {\n if (popover !== this) {\n popover.isShow = false;\n }\n });\n };\n\n private handleDocumentClick = () => {\n if (this.isShow && !this.preventOverlayClose) {\n this.isShow = false;\n }\n };\n\n /* #endregion */\n}\n\nexport default NilePopover;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-popover': NilePopover;\n }\n}\n"]}
@@ -15,8 +15,6 @@ import type { CSSResultGroup } from 'lit';
15
15
  */
16
16
  export declare class NilePopup extends NileElement {
17
17
  static styles: CSSResultGroup;
18
- protected BUBBLES: boolean;
19
- protected COMPOSED: boolean;
20
18
  private anchorEl;
21
19
  private cleanup;
22
20
  /** A reference to the internal popup container. Useful for animating and styling the popup with JavaScript. */
@@ -21,8 +21,6 @@ import { styles } from './nile-popup.css';
21
21
  let NilePopup = class NilePopup extends NileElement {
22
22
  constructor() {
23
23
  super(...arguments);
24
- this.BUBBLES = false;
25
- this.COMPOSED = false;
26
24
  /**
27
25
  * Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn
28
26
  * down and the popup will be hidden.
@@ -1 +1 @@
1
- {"version":3,"file":"nile-popup.js","sourceRoot":"","sources":["../../../src/nile-popup/nile-popup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAGxC;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QAGc,YAAO,GAAU,KAAK,CAAC;QACvB,aAAQ,GAAU,KAAK,CAAC;QAe3C;;;WAGG;QACyC,WAAM,GAAG,KAAK,CAAC;QAE3D;;;WAGG;QAC0B,cAAS,GAYrB,KAAK,CAAC;QAEvB;;;WAGG;QAC0B,aAAQ,GAAyB,UAAU,CAAC;QAEzE,kFAAkF;QACtD,aAAQ,GAAG,CAAC,CAAC;QAEzC,8EAA8E;QAClD,aAAQ,GAAG,CAAC,CAAC;QAEzC;;;;WAIG;QAC0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eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAkB;AAGnC;IAArC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;2CAA8C;AAGvE;IAAX,QAAQ,EAAE;uCAAmC;AAOlB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAuC;AAGN;IAA3D,QAAQ,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAqB;AAlJrE,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA4arB;SA5aY,SAAS;AA8atB,eAAe,SAAS,CAAC","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 {LitElement, CSSResultArray, TemplateResult} from 'lit-element';\nimport { arrow, autoUpdate, computePosition, flip, offset, platform, shift, size } from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { offsetParent } from 'composed-offset-position';\nimport NileElement from '../internal/nile-element';\nimport {styles} from './nile-popup.css';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * Nile icon component.\n *\n * @tag nile-popup\n *\n */\n@customElement('nile-popup')\nexport class NilePopup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n protected override BUBBLES: boolean=false;\n protected override COMPOSED: boolean=false;\n\n private anchorEl: Element | null;\n private cleanup: ReturnType<typeof autoUpdate> | undefined;\n\n /** A reference to the internal popup container. Useful for animating and styling the popup with JavaScript. */\n @query('.popup') popup: HTMLElement;\n @query('.popup__arrow') private arrowEl: HTMLElement;\n\n /**\n * The element the popup will be anchored to. If the anchor lives outside of the popup, you can provide its `id` or a\n * reference to it here. If the anchor lives inside the popup, use the `anchor` slot instead.\n */\n @property() anchor: Element | string;\n\n /**\n * Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn\n * down and the popup will be hidden.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /**\n * The preferred placement of the popup. Note that the actual placement will vary as configured to keep the\n * panel inside of the viewport.\n */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /**\n * Determines how the popup is positioned. The `absolute` strategy works well in most cases, but if overflow is\n * clipped, using a `fixed` position strategy can often workaround it.\n */\n @property({ reflect: true }) strategy: 'absolute' | 'fixed' = 'absolute';\n\n /** The distance in pixels from which to offset the panel away from its anchor. */\n @property({ type: Number }) distance = 0;\n\n /** The distance in pixels from which to offset the panel along its anchor. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Attaches an arrow to the popup. The arrow's size and color can be customized using the `--arrow-size` and\n * `--arrow-color` custom properties. For additional customizations, you can also target the arrow using\n * `::part(arrow)` in your stylesheet.\n */\n @property({ type: Boolean }) arrow = false;\n\n /**\n * The placement of the arrow. The default is `anchor`, which will align the arrow as close to the center of the\n * anchor as possible, considering available space and `arrow-padding`. A value of `start`, `end`, or `center` will\n * align the arrow to the start, end, or center of the popover instead.\n */\n @property({ attribute: 'arrow-placement' }) arrowPlacement: 'start' | 'end' | 'center' | 'anchor' = 'anchor';\n\n /**\n * The amount of padding between the arrow and the edges of the popup. If the popup has a border-radius, for example,\n * this will prevent it from overflowing the corners.\n */\n @property({ attribute: 'arrow-padding', type: Number }) arrowPadding = 10;\n\n /**\n * When set, placement of the popup will flip to the opposite site to keep it in view. You can use\n * `flipFallbackPlacements` to further configure how the fallback placement is determined.\n */\n @property({ type: Boolean }) flip = false;\n\n /**\n * If the preferred placement doesn't fit, popup will be tested in these fallback placements until one fits. Must be a\n * string of any number of placements separated by a space, e.g. \"top bottom left\". If no placement fits, the flip\n * fallback strategy will be used instead.\n * */\n @property({\n attribute: 'flip-fallback-placements',\n converter: {\n fromAttribute: (value: string) => {\n return value\n .split(' ')\n .map(p => p.trim())\n .filter(p => p !== '');\n },\n toAttribute: (value: []) => {\n return value.join(' ');\n }\n }\n })\n flipFallbackPlacements = '';\n\n /**\n * When neither the preferred placement nor the fallback placements fit, this value will be used to determine whether\n * the popup should be positioned using the best available fit based on available space or as it was initially\n * preferred.\n */\n @property({ attribute: 'flip-fallback-strategy' }) flipFallbackStrategy: 'best-fit' | 'initial' = 'best-fit';\n\n /**\n * The flip boundary describes clipping element(s) that overflow will be checked relative to when flipping. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) flipBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the flip behavior will occur. */\n @property({ attribute: 'flip-padding', type: Number }) flipPadding = 0;\n\n /** Moves the popup along the axis to keep it in view when clipped. */\n @property({ type: Boolean }) shift = false;\n\n /**\n * The shift boundary describes clipping element(s) that overflow will be checked relative to when shifting. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) shiftBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the shift behavior will occur. */\n @property({ attribute: 'shift-padding', type: Number }) shiftPadding = 0;\n\n /** When set, this will cause the popup to automatically resize itself to prevent it from overflowing. */\n @property({ attribute: 'auto-size' }) autoSize: 'horizontal' | 'vertical' | 'both';\n\n /** Syncs the popup's width or height to that of the anchor element. */\n @property() sync: 'width' | 'height' | 'both';\n\n /**\n * The auto-size boundary describes clipping element(s) that overflow will be checked relative to when resizing. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) autoSizeBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the auto-size behavior will occur. */\n @property({ attribute: 'auto-size-padding', type: Number }) autoSizePadding = 0;\n\n async connectedCallback() {\n super.connectedCallback();\n\n // Start the positioner after the first update\n await this.updateComplete;\n this.start();\n }\n\n disconnectedCallback() {\n this.stop();\n }\n\n async updated(changedProps: Map<string, unknown>) {\n super.updated(changedProps);\n\n // Start or stop the positioner when active changes\n if (changedProps.has('active')) {\n if (this.active) {\n this.start();\n } else {\n this.stop();\n }\n }\n\n // Update the anchor when anchor changes\n if (changedProps.has('anchor')) {\n this.handleAnchorChange();\n }\n\n // All other properties will trigger a reposition when active\n if (this.active) {\n await this.updateComplete;\n this.reposition();\n }\n }\n\n private async handleAnchorChange() {\n await this.stop();\n\n if (this.anchor && typeof this.anchor === 'string') {\n // Locate the anchor by id\n const root = this.getRootNode() as Document | ShadowRoot;\n this.anchorEl = root.getElementById(this.anchor);\n } else if (this.anchor instanceof Element) {\n // Use the anchor's reference\n this.anchorEl = this.anchor;\n } else {\n // Look for a slotted anchor\n this.anchorEl = this.querySelector<HTMLElement>('[slot=\"anchor\"]');\n }\n\n // If the anchor is a <slot>, we'll use the first assigned element as the target since slots use `display: contents`\n // and positioning can't be calculated on them\n if (this.anchorEl instanceof HTMLSlotElement) {\n this.anchorEl = this.anchorEl.assignedElements({ flatten: true })[0] as HTMLElement;\n }\n\n if (!this.anchorEl) {\n throw new Error(\n 'Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.'\n );\n }\n\n this.start();\n }\n\n private start() {\n // We can't start the positioner without an anchor\n if (!this.anchorEl) {\n return;\n }\n\n this.cleanup = autoUpdate(this.anchorEl, this.popup, () => {\n this.reposition();\n });\n }\n\n private async stop(): Promise<void> {\n return new Promise(resolve => {\n if (this.cleanup) {\n this.cleanup();\n this.cleanup = undefined;\n this.removeAttribute('data-current-placement');\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n requestAnimationFrame(() => resolve());\n } else {\n resolve();\n }\n });\n }\n\n /** Forces the popup to recalculate and reposition itself. */\n reposition() {\n // Nothing to do if the popup is inactive or the anchor doesn't exist\n if (!this.active || !this.anchorEl) {\n return;\n }\n\n //\n // NOTE: Floating UI middlewares are order dependent: https://floating-ui.com/docs/middleware\n //\n const middleware = [\n // The offset middleware goes first\n offset({ mainAxis: this.distance, crossAxis: this.skidding })\n ];\n\n // First we sync width/height\n if (this.sync) {\n middleware.push(\n size({\n apply: ({ rects }) => {\n const syncWidth = this.sync === 'width' || this.sync === 'both';\n const syncHeight = this.sync === 'height' || this.sync === 'both';\n this.popup.style.width = syncWidth ? `${rects.reference.width}px` : '';\n this.popup.style.height = syncHeight ? `${rects.reference.height}px` : '';\n }\n })\n );\n } else {\n // Cleanup styles if we're not matching width/height\n this.popup.style.width = '';\n this.popup.style.height = '';\n }\n\n // Then we flip\n if (this.flip) {\n middleware.push(\n flip({\n boundary: this.flipBoundary,\n // @ts-expect-error - We're converting a string attribute to an array here\n fallbackPlacements: this.flipFallbackPlacements,\n fallbackStrategy: this.flipFallbackStrategy === 'best-fit' ? 'bestFit' : 'initialPlacement',\n padding: this.flipPadding\n })\n );\n }\n\n // Then we shift\n if (this.shift) {\n middleware.push(\n shift({\n boundary: this.shiftBoundary,\n padding: this.shiftPadding\n })\n );\n }\n\n // Now we adjust the size as needed\n if (this.autoSize) {\n middleware.push(\n size({\n boundary: this.autoSizeBoundary,\n padding: this.autoSizePadding,\n apply: ({ availableWidth, availableHeight }) => {\n if (this.autoSize === 'vertical' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-height', `${availableHeight}px`);\n } else {\n this.style.removeProperty('--auto-size-available-height');\n }\n\n if (this.autoSize === 'horizontal' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-width', `${availableWidth}px`);\n } else {\n this.style.removeProperty('--auto-size-available-width');\n }\n }\n })\n );\n } else {\n // Cleanup styles if we're no longer using auto-size\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n }\n\n // Finally, we add an arrow\n if (this.arrow) {\n middleware.push(\n arrow({\n element: this.arrowEl,\n padding: this.arrowPadding\n })\n );\n }\n\n //\n // Use custom positioning logic if the strategy is absolute. Otherwise, fall back to the default logic.\n //\n //\n const getOffsetParent =\n this.strategy === 'absolute'\n ? (element: Element) => platform.getOffsetParent(element, offsetParent)\n : platform.getOffsetParent;\n\n computePosition(this.anchorEl, this.popup, {\n placement: this.placement,\n middleware,\n strategy: this.strategy,\n platform: {\n ...platform,\n getOffsetParent\n }\n }).then(({ x, y, middlewareData, placement }) => {\n //\n // Even though we have our own localization utility, it uses different heuristics to determine RTL. Because of\n // that, we'll use the same approach that Floating UI uses.\n //\n // Source: https://github.com/floating-ui/floating-ui/blob/cb3b6ab07f95275730d3e6e46c702f8d4908b55c/packages/dom/src/utils/getDocumentRect.ts#L31\n //\n const isRtl = getComputedStyle(this).direction === 'rtl';\n const staticSide = { top: 'bottom', right: 'left', bottom: 'top', left: 'right' }[placement.split('-')[0]]!;\n\n this.setAttribute('data-current-placement', placement);\n\n Object.assign(this.popup.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n\n if (this.arrow) {\n const arrowX = middlewareData.arrow!.x;\n const arrowY = middlewareData.arrow!.y;\n let top = '';\n let right = '';\n let bottom = '';\n let left = '';\n\n if (this.arrowPlacement === 'start') {\n // Start\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n top = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? value : '';\n left = isRtl ? '' : value;\n } else if (this.arrowPlacement === 'end') {\n // End\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? '' : value;\n left = isRtl ? value : '';\n bottom = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n } else if (this.arrowPlacement === 'center') {\n // Center\n left = typeof arrowX === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n top = typeof arrowY === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n } else {\n // Anchor (default)\n left = typeof arrowX === 'number' ? `${arrowX}px` : '';\n top = typeof arrowY === 'number' ? `${arrowY}px` : '';\n }\n\n Object.assign(this.arrowEl.style, {\n top,\n right,\n bottom,\n left,\n [staticSide]: 'calc(var(--arrow-size-diagonal) * -1)'\n });\n }\n });\n\n this.emit('reposition');\n }\n\n render() {\n return html`\n <slot name=\"anchor\" @slotchange=${this.handleAnchorChange}></slot>\n\n <div\n part=\"popup\"\n class=${classMap({\n popup: true,\n 'popup--active': this.active,\n 'popup--fixed': this.strategy === 'fixed',\n 'popup--has-arrow': this.arrow\n })}\n >\n <slot></slot>\n ${this.arrow ? html`<div part=\"arrow\" class=\"popup__arrow\" role=\"presentation\"></div>` : ''}\n </div>\n `;\n }\n}\n\nexport default NilePopup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-popup': NilePopup;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-popup.js","sourceRoot":"","sources":["../../../src/nile-popup/nile-popup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAGH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAGxC;;;;;GAKG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,WAAW;IAAnC;;QAgBL;;;WAGG;QAC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AAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAiB;AAG1C;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAe;AAOf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAoC;AAGP;IAAvD,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAkB;AAGnC;IAArC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;2CAA8C;AAGvE;IAAX,QAAQ,EAAE;uCAAmC;AAOlB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAuC;AAGN;IAA3D,QAAQ,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAqB;AA/IrE,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAyarB;SAzaY,SAAS;AA2atB,eAAe,SAAS,CAAC","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 {LitElement, CSSResultArray, TemplateResult} from 'lit-element';\nimport { arrow, autoUpdate, computePosition, flip, offset, platform, shift, size } from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { offsetParent } from 'composed-offset-position';\nimport NileElement from '../internal/nile-element';\nimport {styles} from './nile-popup.css';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * Nile icon component.\n *\n * @tag nile-popup\n *\n */\n@customElement('nile-popup')\nexport class NilePopup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private anchorEl: Element | null;\n private cleanup: ReturnType<typeof autoUpdate> | undefined;\n\n /** A reference to the internal popup container. Useful for animating and styling the popup with JavaScript. */\n @query('.popup') popup: HTMLElement;\n @query('.popup__arrow') private arrowEl: HTMLElement;\n\n /**\n * The element the popup will be anchored to. If the anchor lives outside of the popup, you can provide its `id` or a\n * reference to it here. If the anchor lives inside the popup, use the `anchor` slot instead.\n */\n @property() anchor: Element | string;\n\n /**\n * Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn\n * down and the popup will be hidden.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /**\n * The preferred placement of the popup. Note that the actual placement will vary as configured to keep the\n * panel inside of the viewport.\n */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /**\n * Determines how the popup is positioned. The `absolute` strategy works well in most cases, but if overflow is\n * clipped, using a `fixed` position strategy can often workaround it.\n */\n @property({ reflect: true }) strategy: 'absolute' | 'fixed' = 'absolute';\n\n /** The distance in pixels from which to offset the panel away from its anchor. */\n @property({ type: Number }) distance = 0;\n\n /** The distance in pixels from which to offset the panel along its anchor. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Attaches an arrow to the popup. The arrow's size and color can be customized using the `--arrow-size` and\n * `--arrow-color` custom properties. For additional customizations, you can also target the arrow using\n * `::part(arrow)` in your stylesheet.\n */\n @property({ type: Boolean }) arrow = false;\n\n /**\n * The placement of the arrow. The default is `anchor`, which will align the arrow as close to the center of the\n * anchor as possible, considering available space and `arrow-padding`. A value of `start`, `end`, or `center` will\n * align the arrow to the start, end, or center of the popover instead.\n */\n @property({ attribute: 'arrow-placement' }) arrowPlacement: 'start' | 'end' | 'center' | 'anchor' = 'anchor';\n\n /**\n * The amount of padding between the arrow and the edges of the popup. If the popup has a border-radius, for example,\n * this will prevent it from overflowing the corners.\n */\n @property({ attribute: 'arrow-padding', type: Number }) arrowPadding = 10;\n\n /**\n * When set, placement of the popup will flip to the opposite site to keep it in view. You can use\n * `flipFallbackPlacements` to further configure how the fallback placement is determined.\n */\n @property({ type: Boolean }) flip = false;\n\n /**\n * If the preferred placement doesn't fit, popup will be tested in these fallback placements until one fits. Must be a\n * string of any number of placements separated by a space, e.g. \"top bottom left\". If no placement fits, the flip\n * fallback strategy will be used instead.\n * */\n @property({\n attribute: 'flip-fallback-placements',\n converter: {\n fromAttribute: (value: string) => {\n return value\n .split(' ')\n .map(p => p.trim())\n .filter(p => p !== '');\n },\n toAttribute: (value: []) => {\n return value.join(' ');\n }\n }\n })\n flipFallbackPlacements = '';\n\n /**\n * When neither the preferred placement nor the fallback placements fit, this value will be used to determine whether\n * the popup should be positioned using the best available fit based on available space or as it was initially\n * preferred.\n */\n @property({ attribute: 'flip-fallback-strategy' }) flipFallbackStrategy: 'best-fit' | 'initial' = 'best-fit';\n\n /**\n * The flip boundary describes clipping element(s) that overflow will be checked relative to when flipping. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) flipBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the flip behavior will occur. */\n @property({ attribute: 'flip-padding', type: Number }) flipPadding = 0;\n\n /** Moves the popup along the axis to keep it in view when clipped. */\n @property({ type: Boolean }) shift = false;\n\n /**\n * The shift boundary describes clipping element(s) that overflow will be checked relative to when shifting. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) shiftBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the shift behavior will occur. */\n @property({ attribute: 'shift-padding', type: Number }) shiftPadding = 0;\n\n /** When set, this will cause the popup to automatically resize itself to prevent it from overflowing. */\n @property({ attribute: 'auto-size' }) autoSize: 'horizontal' | 'vertical' | 'both';\n\n /** Syncs the popup's width or height to that of the anchor element. */\n @property() sync: 'width' | 'height' | 'both';\n\n /**\n * The auto-size boundary describes clipping element(s) that overflow will be checked relative to when resizing. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) autoSizeBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the auto-size behavior will occur. */\n @property({ attribute: 'auto-size-padding', type: Number }) autoSizePadding = 0;\n\n async connectedCallback() {\n super.connectedCallback();\n\n // Start the positioner after the first update\n await this.updateComplete;\n this.start();\n }\n\n disconnectedCallback() {\n this.stop();\n }\n\n async updated(changedProps: Map<string, unknown>) {\n super.updated(changedProps);\n\n // Start or stop the positioner when active changes\n if (changedProps.has('active')) {\n if (this.active) {\n this.start();\n } else {\n this.stop();\n }\n }\n\n // Update the anchor when anchor changes\n if (changedProps.has('anchor')) {\n this.handleAnchorChange();\n }\n\n // All other properties will trigger a reposition when active\n if (this.active) {\n await this.updateComplete;\n this.reposition();\n }\n }\n\n private async handleAnchorChange() {\n await this.stop();\n\n if (this.anchor && typeof this.anchor === 'string') {\n // Locate the anchor by id\n const root = this.getRootNode() as Document | ShadowRoot;\n this.anchorEl = root.getElementById(this.anchor);\n } else if (this.anchor instanceof Element) {\n // Use the anchor's reference\n this.anchorEl = this.anchor;\n } else {\n // Look for a slotted anchor\n this.anchorEl = this.querySelector<HTMLElement>('[slot=\"anchor\"]');\n }\n\n // If the anchor is a <slot>, we'll use the first assigned element as the target since slots use `display: contents`\n // and positioning can't be calculated on them\n if (this.anchorEl instanceof HTMLSlotElement) {\n this.anchorEl = this.anchorEl.assignedElements({ flatten: true })[0] as HTMLElement;\n }\n\n if (!this.anchorEl) {\n throw new Error(\n 'Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.'\n );\n }\n\n this.start();\n }\n\n private start() {\n // We can't start the positioner without an anchor\n if (!this.anchorEl) {\n return;\n }\n\n this.cleanup = autoUpdate(this.anchorEl, this.popup, () => {\n this.reposition();\n });\n }\n\n private async stop(): Promise<void> {\n return new Promise(resolve => {\n if (this.cleanup) {\n this.cleanup();\n this.cleanup = undefined;\n this.removeAttribute('data-current-placement');\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n requestAnimationFrame(() => resolve());\n } else {\n resolve();\n }\n });\n }\n\n /** Forces the popup to recalculate and reposition itself. */\n reposition() {\n // Nothing to do if the popup is inactive or the anchor doesn't exist\n if (!this.active || !this.anchorEl) {\n return;\n }\n\n //\n // NOTE: Floating UI middlewares are order dependent: https://floating-ui.com/docs/middleware\n //\n const middleware = [\n // The offset middleware goes first\n offset({ mainAxis: this.distance, crossAxis: this.skidding })\n ];\n\n // First we sync width/height\n if (this.sync) {\n middleware.push(\n size({\n apply: ({ rects }) => {\n const syncWidth = this.sync === 'width' || this.sync === 'both';\n const syncHeight = this.sync === 'height' || this.sync === 'both';\n this.popup.style.width = syncWidth ? `${rects.reference.width}px` : '';\n this.popup.style.height = syncHeight ? `${rects.reference.height}px` : '';\n }\n })\n );\n } else {\n // Cleanup styles if we're not matching width/height\n this.popup.style.width = '';\n this.popup.style.height = '';\n }\n\n // Then we flip\n if (this.flip) {\n middleware.push(\n flip({\n boundary: this.flipBoundary,\n // @ts-expect-error - We're converting a string attribute to an array here\n fallbackPlacements: this.flipFallbackPlacements,\n fallbackStrategy: this.flipFallbackStrategy === 'best-fit' ? 'bestFit' : 'initialPlacement',\n padding: this.flipPadding\n })\n );\n }\n\n // Then we shift\n if (this.shift) {\n middleware.push(\n shift({\n boundary: this.shiftBoundary,\n padding: this.shiftPadding\n })\n );\n }\n\n // Now we adjust the size as needed\n if (this.autoSize) {\n middleware.push(\n size({\n boundary: this.autoSizeBoundary,\n padding: this.autoSizePadding,\n apply: ({ availableWidth, availableHeight }) => {\n if (this.autoSize === 'vertical' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-height', `${availableHeight}px`);\n } else {\n this.style.removeProperty('--auto-size-available-height');\n }\n\n if (this.autoSize === 'horizontal' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-width', `${availableWidth}px`);\n } else {\n this.style.removeProperty('--auto-size-available-width');\n }\n }\n })\n );\n } else {\n // Cleanup styles if we're no longer using auto-size\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n }\n\n // Finally, we add an arrow\n if (this.arrow) {\n middleware.push(\n arrow({\n element: this.arrowEl,\n padding: this.arrowPadding\n })\n );\n }\n\n //\n // Use custom positioning logic if the strategy is absolute. Otherwise, fall back to the default logic.\n //\n //\n const getOffsetParent =\n this.strategy === 'absolute'\n ? (element: Element) => platform.getOffsetParent(element, offsetParent)\n : platform.getOffsetParent;\n\n computePosition(this.anchorEl, this.popup, {\n placement: this.placement,\n middleware,\n strategy: this.strategy,\n platform: {\n ...platform,\n getOffsetParent\n }\n }).then(({ x, y, middlewareData, placement }) => {\n //\n // Even though we have our own localization utility, it uses different heuristics to determine RTL. Because of\n // that, we'll use the same approach that Floating UI uses.\n //\n // Source: https://github.com/floating-ui/floating-ui/blob/cb3b6ab07f95275730d3e6e46c702f8d4908b55c/packages/dom/src/utils/getDocumentRect.ts#L31\n //\n const isRtl = getComputedStyle(this).direction === 'rtl';\n const staticSide = { top: 'bottom', right: 'left', bottom: 'top', left: 'right' }[placement.split('-')[0]]!;\n\n this.setAttribute('data-current-placement', placement);\n\n Object.assign(this.popup.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n\n if (this.arrow) {\n const arrowX = middlewareData.arrow!.x;\n const arrowY = middlewareData.arrow!.y;\n let top = '';\n let right = '';\n let bottom = '';\n let left = '';\n\n if (this.arrowPlacement === 'start') {\n // Start\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n top = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? value : '';\n left = isRtl ? '' : value;\n } else if (this.arrowPlacement === 'end') {\n // End\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? '' : value;\n left = isRtl ? value : '';\n bottom = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n } else if (this.arrowPlacement === 'center') {\n // Center\n left = typeof arrowX === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n top = typeof arrowY === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n } else {\n // Anchor (default)\n left = typeof arrowX === 'number' ? `${arrowX}px` : '';\n top = typeof arrowY === 'number' ? `${arrowY}px` : '';\n }\n\n Object.assign(this.arrowEl.style, {\n top,\n right,\n bottom,\n left,\n [staticSide]: 'calc(var(--arrow-size-diagonal) * -1)'\n });\n }\n });\n\n this.emit('reposition');\n }\n\n render() {\n return html`\n <slot name=\"anchor\" @slotchange=${this.handleAnchorChange}></slot>\n\n <div\n part=\"popup\"\n class=${classMap({\n popup: true,\n 'popup--active': this.active,\n 'popup--fixed': this.strategy === 'fixed',\n 'popup--has-arrow': this.arrow\n })}\n >\n <slot></slot>\n ${this.arrow ? html`<div part=\"arrow\" class=\"popup__arrow\" role=\"presentation\"></div>` : ''}\n </div>\n `;\n }\n}\n\nexport default NilePopup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-popup': NilePopup;\n }\n}\n"]}
@@ -17,7 +17,6 @@ import type { CSSResultGroup } from 'lit';
17
17
  */
18
18
  export declare class NileRadioGroup extends NileElement {
19
19
  static styles: CSSResultGroup;
20
- protected BUBBLES: boolean;
21
20
  private readonly hasSlotController;
22
21
  private customValidityMessage;
23
22
  defaultSlot: HTMLSlotElement;
@@ -24,7 +24,6 @@ import styles from './nile-radio-group.css';
24
24
  let NileRadioGroup = class NileRadioGroup extends NileElement {
25
25
  constructor() {
26
26
  super(...arguments);
27
- this.BUBBLES = false;
28
27
  this.hasSlotController = new HasSlotController(this, 'help-text', 'label');
29
28
  this.customValidityMessage = '';
30
29
  this.hasButtonGroup = false;
@@ -1 +1 @@
1
- {"version":3,"file":"nile-radio-group.js","sourceRoot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,EAAE,IAAI,EAAE,CAAC;qDAAuB;AAqClE;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;0DAKjD;AAgGD;IADC,KAAK,CAAC,OAAO,CAAC;uDAKd;AA7LU,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAqR1B;SArRY,cAAc;AAuR3B,eAAe,cAAc,CAAC","sourcesContent":["\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { HasSlotController } from '../internal/slot';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport styles from './nile-radio-group.css';\nimport type { CSSResultGroup } from 'lit';\nimport type NileRadio from '../nile-radio/nile-radio';\n\n/**\n * @summary Radio groups are used to group multiple [radios](/components/radio) or [radio buttons](/components/radio-button) so they function as a single form control.\n *\n * @dependency nile-button-group\n *\n * @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.\n * @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`\n * attribute.\n *\n * @event change - Emitted when the radio group's selected value changes.\n * @event input - Emitted when the radio group receives user input.\n * @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n * @csspart button-group - The button group that wraps radio buttons.\n * @csspart button-group__base - The button group's `base` part.\n */\n@customElement('nile-radio-group')\nexport class NileRadioGroup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n protected override BUBBLES: boolean=false;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private customValidityMessage = '';\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @state() private hasButtonGroup = false;\n\n @state() defaultValue = '';\n\n /**\n * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\n * instead.\n */\n @property() label = '';\n\n /** The name of the radio group, submitted as a name/value pair with form data. */\n @property() name = 'option';\n\n /** The current value of the radio group, submitted as a name/value pair with form data. */\n @property({ reflect: true }) value = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Ensures a child radio is checked before allowing the containing form to submit. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n\n /** Used to show radio in inline or not */\n @property({ type: Boolean, reflect: true }) labelInline = false;\n\n /** Used to disabled or not */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n /** The radio's labelborder for whole gp. */\n @property({ type: Boolean, reflect: true }) islabelborder = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.handleInitialDisabledState();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n private getAllRadios() {\n return [...this.querySelectorAll<NileRadio>('nile-radio')];\n }\n\n private handleRadioClick(event: MouseEvent) {\n const target = (event.target as HTMLElement).closest<NileRadio>('nile-radio')!;\n const radios = this.getAllRadios();\n const oldValue = this.value;\n\n if (target.disabled || this.disabled) {\n return;\n }\n\n this.value = target.value;\n radios.forEach(radio => (radio.checked = radio === target));\n\n if (this.value !== oldValue) {\n this.emit('change',{value: this.value });\n this.emit('input');\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = this.disabled;\n });\n }\n\n private handleInitialDisabledState() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = radio.hasAttribute('disabled') ? radio.disabled : this.disabled;\n });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(event.key)) {\n return;\n }\n\n const radios = this.getAllRadios().filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n const incr = event.key === ' ' ? 0 : ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1;\n const oldValue = this.value;\n let index = radios.indexOf(checkedRadio) + incr;\n\n if (index < 0) {\n index = radios.length - 1;\n }\n\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this.getAllRadios().forEach(radio => {\n radio.checked = false;\n\n if (!this.hasButtonGroup) {\n radio.tabIndex = -1;\n }\n });\n\n this.value = radios[index].value;\n radios[index].checked = true;\n\n if (!this.hasButtonGroup) {\n radios[index].tabIndex = 0;\n radios[index].focus();\n } else {\n radios[index].shadowRoot!.querySelector('button')!.focus();\n }\n\n if (this.value !== oldValue) {\n this.emit('change');\n this.emit('input');\n }\n\n event.preventDefault();\n }\n\n private handleLabelClick() {\n const radios = this.getAllRadios();\n const checked = radios.find(radio => radio.checked);\n const radioToFocus = checked || radios[0];\n\n // Move focus to the checked radio (or the first one if none are checked) when clicking the label\n if (radioToFocus) {\n radioToFocus.focus();\n }\n }\n\n private handleSlotChange() {\n const radios = this.getAllRadios();\n\n radios.forEach(radio => {\n radio.checked = radio.value === this.value;\n if (this.islabelborder) {\n radio.islabelborder=true;\n }\n });\n const nile_radio_check='nile-radio-button';\n this.hasButtonGroup = radios.some(radio => radio.tagName.toLowerCase() === nile_radio_check);\n\n if (!radios.some(radio => radio.checked)) {\n if (this.hasButtonGroup) {\n const buttonRadio = radios[0].shadowRoot!.querySelector('button')!;\n buttonRadio.tabIndex = 0;\n } else {\n radios[0].tabIndex = 0;\n }\n }\n\n if (this.hasButtonGroup) {\n const buttonGroup = this.shadowRoot?.querySelector('nile-button-group');\n }\n }\n\n private updateCheckedRadio() {\n const radios = this.getAllRadios();\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n @watch('value')\n handleValueChange() {\n if (this.hasUpdated) {\n this.updateCheckedRadio();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n const defaultSlot = html`\n <slot\n @click=${this.handleRadioClick}\n @keydown=${this.handleKeyDown}\n @slotchange=${this.handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n\n return html`\n <fieldset\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--radio-group': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n @click=${this.handleLabelClick}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n ${hasLabelSuffixSlot ? html` <slot name=\"label-suffix\"></slot> ` : ``}\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=${this.required}\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ${this.hasButtonGroup\n ? html`\n ${defaultSlot}\n `\n : html`\n <div part=\"options-base\" class=\"${this.labelInline ? `form-control--inline-radio`:``}\"> ${defaultSlot}</div> `}\n </div>\n\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\n </fieldset>\n `;\n }\n}\n\nexport default NileRadioGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-group': NileRadioGroup;\n }\n}\n"]}
1
+ {"version":3,"file":"nile-radio-group.js","sour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DAAuB;AAqClE;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;0DAKjD;AAgGD;IADC,KAAK,CAAC,OAAO,CAAC;uDAKd;AA3LU,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAmR1B;SAnRY,cAAc;AAqR3B,eAAe,cAAc,CAAC","sourcesContent":["\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { HasSlotController } from '../internal/slot';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport styles from './nile-radio-group.css';\nimport type { CSSResultGroup } from 'lit';\nimport type NileRadio from '../nile-radio/nile-radio';\n\n/**\n * @summary Radio groups are used to group multiple [radios](/components/radio) or [radio buttons](/components/radio-button) so they function as a single form control.\n *\n * @dependency nile-button-group\n *\n * @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.\n * @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`\n * attribute.\n *\n * @event change - Emitted when the radio group's selected value changes.\n * @event input - Emitted when the radio group receives user input.\n * @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n * @csspart button-group - The button group that wraps radio buttons.\n * @csspart button-group__base - The button group's `base` part.\n */\n@customElement('nile-radio-group')\nexport class NileRadioGroup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private customValidityMessage = '';\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @state() private hasButtonGroup = false;\n\n @state() defaultValue = '';\n\n /**\n * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\n * instead.\n */\n @property() label = '';\n\n /** The name of the radio group, submitted as a name/value pair with form data. */\n @property() name = 'option';\n\n /** The current value of the radio group, submitted as a name/value pair with form data. */\n @property({ reflect: true }) value = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Ensures a child radio is checked before allowing the containing form to submit. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n\n /** Used to show radio in inline or not */\n @property({ type: Boolean, reflect: true }) labelInline = false;\n\n /** Used to disabled or not */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n /** The radio's labelborder for whole gp. */\n @property({ type: Boolean, reflect: true }) islabelborder = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.handleInitialDisabledState();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n private getAllRadios() {\n return [...this.querySelectorAll<NileRadio>('nile-radio')];\n }\n\n private handleRadioClick(event: MouseEvent) {\n const target = (event.target as HTMLElement).closest<NileRadio>('nile-radio')!;\n const radios = this.getAllRadios();\n const oldValue = this.value;\n\n if (target.disabled || this.disabled) {\n return;\n }\n\n this.value = target.value;\n radios.forEach(radio => (radio.checked = radio === target));\n\n if (this.value !== oldValue) {\n this.emit('change',{value: this.value });\n this.emit('input');\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = this.disabled;\n });\n }\n\n private handleInitialDisabledState() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = radio.hasAttribute('disabled') ? radio.disabled : this.disabled;\n });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(event.key)) {\n return;\n }\n\n const radios = this.getAllRadios().filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n const incr = event.key === ' ' ? 0 : ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1;\n const oldValue = this.value;\n let index = radios.indexOf(checkedRadio) + incr;\n\n if (index < 0) {\n index = radios.length - 1;\n }\n\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this.getAllRadios().forEach(radio => {\n radio.checked = false;\n\n if (!this.hasButtonGroup) {\n radio.tabIndex = -1;\n }\n });\n\n this.value = radios[index].value;\n radios[index].checked = true;\n\n if (!this.hasButtonGroup) {\n radios[index].tabIndex = 0;\n radios[index].focus();\n } else {\n radios[index].shadowRoot!.querySelector('button')!.focus();\n }\n\n if (this.value !== oldValue) {\n this.emit('change');\n this.emit('input');\n }\n\n event.preventDefault();\n }\n\n private handleLabelClick() {\n const radios = this.getAllRadios();\n const checked = radios.find(radio => radio.checked);\n const radioToFocus = checked || radios[0];\n\n // Move focus to the checked radio (or the first one if none are checked) when clicking the label\n if (radioToFocus) {\n radioToFocus.focus();\n }\n }\n\n private handleSlotChange() {\n const radios = this.getAllRadios();\n\n radios.forEach(radio => {\n radio.checked = radio.value === this.value;\n if (this.islabelborder) {\n radio.islabelborder=true;\n }\n });\n const nile_radio_check='nile-radio-button';\n this.hasButtonGroup = radios.some(radio => radio.tagName.toLowerCase() === nile_radio_check);\n\n if (!radios.some(radio => radio.checked)) {\n if (this.hasButtonGroup) {\n const buttonRadio = radios[0].shadowRoot!.querySelector('button')!;\n buttonRadio.tabIndex = 0;\n } else {\n radios[0].tabIndex = 0;\n }\n }\n\n if (this.hasButtonGroup) {\n const buttonGroup = this.shadowRoot?.querySelector('nile-button-group');\n }\n }\n\n private updateCheckedRadio() {\n const radios = this.getAllRadios();\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n @watch('value')\n handleValueChange() {\n if (this.hasUpdated) {\n this.updateCheckedRadio();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n const defaultSlot = html`\n <slot\n @click=${this.handleRadioClick}\n @keydown=${this.handleKeyDown}\n @slotchange=${this.handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n\n return html`\n <fieldset\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--radio-group': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n @click=${this.handleLabelClick}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n ${hasLabelSuffixSlot ? html` <slot name=\"label-suffix\"></slot> ` : ``}\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=${this.required}\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ${this.hasButtonGroup\n ? html`\n ${defaultSlot}\n `\n : html`\n <div part=\"options-base\" class=\"${this.labelInline ? `form-control--inline-radio`:``}\"> ${defaultSlot}</div> `}\n </div>\n\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\n </fieldset>\n `;\n }\n}\n\nexport default NileRadioGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-group': NileRadioGroup;\n }\n}\n"]}
@@ -65,7 +65,6 @@ import type NilePopup from '../nile-popup/nile-popup';
65
65
  */
66
66
  export declare class NileSelect extends NileElement implements NileFormControl {
67
67
  static styles: CSSResultGroup;
68
- protected BUBBLES: boolean;
69
68
  private readonly formControlController;
70
69
  private readonly hasSlotController;
71
70
  private typeToSelectString;
@@ -77,7 +77,6 @@ import { ifDefined } from 'lit/directives/if-defined.js';
77
77
  let NileSelect = class NileSelect extends NileElement {
78
78
  constructor() {
79
79
  super(...arguments);
80
- this.BUBBLES = false;
81
80
  // protected override BUBBLES=false;
82
81
  this.formControlController = new FormControlController(this, {
83
82
  assumeInteractionOn: ['nile-blur', 'nile-input'],
@@ -1008,11 +1007,9 @@ let NileSelect = class NileSelect extends NileElement {
1008
1007
  clearable
1009
1008
  .value=${this.searchValue}
1010
1009
  placeholder="${this.internalSearchPlaceHolder}"
1011
- @nile-focus="${(e) => { this.handleSearchFocus(); this.emit('nile-focus', e.detail); }}"
1012
- @nile-blur="${(e) => { this.emit('nile-blur', e.detail); }}"
1013
- @nile-change="${(e) => { this.onInputChange(e); this.emit('nile-change', e.detail); }}"
1014
- @nile-input="${(e) => { this.handleSearchChange(e); this.emit('nile-input', e.detail); }}"
1015
- @nile-clear=${(e) => this.emit('nile-clear', e.detail)}
1010
+ @nile-input=${this.handleSearchChange}
1011
+ @nile-focus=${this.handleSearchFocus}
1012
+ @nile-change="${this.onInputChange}"
1016
1013
  >
1017
1014
  <nile-icon name="search" slot="suffix"> </nile-icon>
1018
1015
  </nile-input>