@aquera/nile-elements 0.0.111 → 0.0.113

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 (395) hide show
  1. package/README.md +10 -0
  2. package/demo/filenames.txt +1 -1
  3. package/demo/variables.css +2 -0
  4. package/dist/index.cjs.js +1 -1
  5. package/dist/index.esm.js +1 -1
  6. package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
  7. package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
  8. package/dist/nile-accordion/nile-accordion.esm.js +1 -1
  9. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  10. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  11. package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
  12. package/dist/nile-avatar/nile-avatar.cjs.js +1 -1
  13. package/dist/nile-avatar/nile-avatar.cjs.js.map +1 -1
  14. package/dist/nile-avatar/nile-avatar.esm.js +1 -1
  15. package/dist/nile-badge/index.cjs.js +1 -1
  16. package/dist/nile-badge/index.esm.js +1 -1
  17. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  18. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  19. package/dist/nile-badge/nile-badge.esm.js +1 -1
  20. package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
  21. package/dist/nile-badge/nile-badge.test.cjs.js.map +1 -1
  22. package/dist/nile-badge/nile-badge.test.esm.js +1 -1
  23. package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js +1 -1
  24. package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js.map +1 -1
  25. package/dist/nile-breadcrumb/nile-breadcrumb.esm.js +1 -1
  26. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js +1 -1
  27. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js.map +1 -1
  28. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.esm.js +2 -2
  29. package/dist/nile-button/index.cjs.js +1 -1
  30. package/dist/nile-button/index.esm.js +1 -1
  31. package/dist/nile-button/nile-button.cjs.js +1 -1
  32. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  33. package/dist/nile-button/nile-button.esm.js +1 -1
  34. package/dist/nile-button/nile-button.test.cjs.js +1 -1
  35. package/dist/nile-button/nile-button.test.cjs.js.map +1 -1
  36. package/dist/nile-button/nile-button.test.esm.js +1 -1
  37. package/dist/nile-button-toggle/nile-button-toggle.cjs.js +1 -1
  38. package/dist/nile-button-toggle/nile-button-toggle.cjs.js.map +1 -1
  39. package/dist/nile-button-toggle/nile-button-toggle.esm.js +1 -1
  40. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js +1 -1
  41. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js.map +1 -1
  42. package/dist/nile-button-toggle-group/nile-button-toggle-group.esm.js +1 -1
  43. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  44. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  45. package/dist/nile-calendar/nile-calendar.esm.js +7 -7
  46. package/dist/nile-card/nile-card.cjs.js +1 -1
  47. package/dist/nile-card/nile-card.cjs.js.map +1 -1
  48. package/dist/nile-card/nile-card.esm.js +1 -1
  49. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  50. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  51. package/dist/nile-checkbox/nile-checkbox.esm.js +1 -1
  52. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  53. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  54. package/dist/nile-chip/nile-chip.esm.js +1 -1
  55. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  56. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  57. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  58. package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
  59. package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
  60. package/dist/nile-content-editor/nile-content-editor.esm.js +5 -5
  61. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  62. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  63. package/dist/nile-date-picker/nile-date-picker.esm.js +5 -3
  64. package/dist/nile-dialog/index.cjs.js +1 -1
  65. package/dist/nile-dialog/index.esm.js +1 -1
  66. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  67. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  68. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  69. package/dist/nile-drawer/index.cjs.js +1 -1
  70. package/dist/nile-drawer/index.esm.js +1 -1
  71. package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
  72. package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
  73. package/dist/nile-drawer/nile-drawer.esm.js +1 -1
  74. package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
  75. package/dist/nile-drawer/nile-drawer.test.cjs.js.map +1 -1
  76. package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
  77. package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
  78. package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
  79. package/dist/nile-empty-state/nile-empty-state.esm.js +1 -1
  80. package/dist/nile-highlighter/index.cjs.js +1 -1
  81. package/dist/nile-highlighter/index.esm.js +1 -1
  82. package/dist/nile-highlighter/nile-highlighter.cjs.js +1 -1
  83. package/dist/nile-highlighter/nile-highlighter.cjs.js.map +1 -1
  84. package/dist/nile-highlighter/nile-highlighter.esm.js +2 -2
  85. package/dist/nile-highlighter/theme-list.cjs.js +1 -1
  86. package/dist/nile-highlighter/theme-list.cjs.js.map +1 -1
  87. package/dist/nile-highlighter/theme-list.esm.js +1 -1
  88. package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
  89. package/dist/nile-icon/icons/svg/index.esm.js +1 -1
  90. package/dist/nile-icon/icons/svg/insert-at-cursor.cjs.js +2 -0
  91. package/dist/nile-icon/icons/svg/insert-at-cursor.cjs.js.map +1 -0
  92. package/dist/nile-icon/icons/svg/insert-at-cursor.esm.js +1 -0
  93. package/dist/nile-icon/icons/svg/warning-01.cjs.js +2 -0
  94. package/dist/nile-icon/icons/svg/warning-01.cjs.js.map +1 -0
  95. package/dist/nile-icon/icons/svg/warning-01.esm.js +1 -0
  96. package/dist/nile-icon/index.cjs.js +1 -1
  97. package/dist/nile-icon/index.cjs.js.map +1 -1
  98. package/dist/nile-icon/index.esm.js +2 -2
  99. package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
  100. package/dist/nile-icon/nile-icon.test.cjs.js.map +1 -1
  101. package/dist/nile-icon/nile-icon.test.esm.js +1 -1
  102. package/dist/nile-icon-button/index.cjs.js +1 -1
  103. package/dist/nile-icon-button/index.esm.js +1 -1
  104. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  105. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  106. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  107. package/dist/nile-input/index.cjs.js +1 -1
  108. package/dist/nile-input/index.esm.js +1 -1
  109. package/dist/nile-input/nile-input.cjs.js +1 -1
  110. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  111. package/dist/nile-input/nile-input.esm.js +1 -1
  112. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  113. package/dist/nile-input/nile-input.test.cjs.js.map +1 -1
  114. package/dist/nile-input/nile-input.test.esm.js +1 -1
  115. package/dist/nile-link/nile-link.cjs.js +1 -1
  116. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  117. package/dist/nile-link/nile-link.esm.js +1 -1
  118. package/dist/nile-list/nile-list.cjs.js +1 -1
  119. package/dist/nile-list/nile-list.cjs.js.map +1 -1
  120. package/dist/nile-list/nile-list.esm.js +1 -1
  121. package/dist/nile-list-item/nile-list-item.cjs.js +1 -1
  122. package/dist/nile-list-item/nile-list-item.cjs.js.map +1 -1
  123. package/dist/nile-list-item/nile-list-item.esm.js +1 -1
  124. package/dist/nile-menu/nile-menu.cjs.js +1 -1
  125. package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
  126. package/dist/nile-menu/nile-menu.esm.js +1 -1
  127. package/dist/nile-menu-item/index.cjs.js +1 -1
  128. package/dist/nile-menu-item/index.esm.js +1 -1
  129. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  130. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  131. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  132. package/dist/nile-option/index.cjs.js +1 -1
  133. package/dist/nile-option/index.esm.js +1 -1
  134. package/dist/nile-option/nile-option.cjs.js +1 -1
  135. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  136. package/dist/nile-option/nile-option.esm.js +1 -1
  137. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  138. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  139. package/dist/nile-popover/nile-popover.esm.js +2 -2
  140. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  141. package/dist/nile-popup/nile-popup.cjs.js.map +1 -1
  142. package/dist/nile-popup/nile-popup.esm.js +1 -1
  143. package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
  144. package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
  145. package/dist/nile-radio-group/nile-radio-group.esm.js +1 -1
  146. package/dist/nile-select/index.cjs.js +1 -1
  147. package/dist/nile-select/index.esm.js +1 -1
  148. package/dist/nile-select/nile-select.cjs.js +1 -1
  149. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  150. package/dist/nile-select/nile-select.esm.js +1 -1
  151. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
  152. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
  153. package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +1 -1
  154. package/dist/nile-split-panel/nile-split-panel.cjs.js +1 -1
  155. package/dist/nile-split-panel/nile-split-panel.cjs.js.map +1 -1
  156. package/dist/nile-split-panel/nile-split-panel.esm.js +1 -1
  157. package/dist/nile-stepper/nile-stepper.cjs.js +1 -1
  158. package/dist/nile-stepper/nile-stepper.cjs.js.map +1 -1
  159. package/dist/nile-stepper/nile-stepper.esm.js +1 -1
  160. package/dist/nile-tab/index.cjs.js +1 -1
  161. package/dist/nile-tab/index.esm.js +1 -1
  162. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  163. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  164. package/dist/nile-tab/nile-tab.esm.js +1 -1
  165. package/dist/nile-tab-group/index.cjs.js +1 -1
  166. package/dist/nile-tab-group/index.esm.js +1 -1
  167. package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
  168. package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
  169. package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
  170. package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
  171. package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
  172. package/dist/nile-table-body/nile-table-body.esm.js +1 -1
  173. package/dist/nile-table-header-item/nile-table-header-item.cjs.js +1 -1
  174. package/dist/nile-table-header-item/nile-table-header-item.cjs.js.map +1 -1
  175. package/dist/nile-table-header-item/nile-table-header-item.esm.js +1 -1
  176. package/dist/nile-tag/index.cjs.js +1 -1
  177. package/dist/nile-tag/index.esm.js +1 -1
  178. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  179. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  180. package/dist/nile-tag/nile-tag.esm.js +1 -1
  181. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  182. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  183. package/dist/nile-textarea/nile-textarea.esm.js +1 -1
  184. package/dist/nile-toast/index.cjs.js +1 -1
  185. package/dist/nile-toast/index.esm.js +1 -1
  186. package/dist/nile-toast/nile-toast.cjs.js +1 -1
  187. package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
  188. package/dist/nile-toast/nile-toast.esm.js +1 -1
  189. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  190. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  191. package/dist/nile-tooltip/nile-tooltip.esm.js +1 -1
  192. package/dist/nile-tree/index.cjs.js +1 -1
  193. package/dist/nile-tree/index.esm.js +1 -1
  194. package/dist/nile-tree/nile-tree.cjs.js +1 -1
  195. package/dist/nile-tree/nile-tree.cjs.js.map +1 -1
  196. package/dist/nile-tree/nile-tree.esm.js +1 -1
  197. package/dist/nile-tree-item/index.cjs.js +1 -1
  198. package/dist/nile-tree-item/index.esm.js +1 -1
  199. package/dist/nile-tree-item/nile-tree-item.cjs.js +1 -1
  200. package/dist/nile-tree-item/nile-tree-item.cjs.js.map +1 -1
  201. package/dist/nile-tree-item/nile-tree-item.esm.js +1 -1
  202. package/dist/src/nile-accordion/nile-accordion.d.ts +0 -1
  203. package/dist/src/nile-accordion/nile-accordion.js +0 -1
  204. package/dist/src/nile-accordion/nile-accordion.js.map +1 -1
  205. package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +0 -1
  206. package/dist/src/nile-auto-complete/nile-auto-complete.js +0 -1
  207. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  208. package/dist/src/nile-avatar/nile-avatar.d.ts +0 -1
  209. package/dist/src/nile-avatar/nile-avatar.js +0 -1
  210. package/dist/src/nile-avatar/nile-avatar.js.map +1 -1
  211. package/dist/src/nile-badge/nile-badge.d.ts +0 -1
  212. package/dist/src/nile-badge/nile-badge.js +0 -1
  213. package/dist/src/nile-badge/nile-badge.js.map +1 -1
  214. package/dist/src/nile-breadcrumb/nile-breadcrumb.d.ts +0 -1
  215. package/dist/src/nile-breadcrumb/nile-breadcrumb.js +0 -5
  216. package/dist/src/nile-breadcrumb/nile-breadcrumb.js.map +1 -1
  217. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.d.ts +0 -1
  218. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +0 -1
  219. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -1
  220. package/dist/src/nile-button/nile-button.d.ts +0 -1
  221. package/dist/src/nile-button/nile-button.js +0 -1
  222. package/dist/src/nile-button/nile-button.js.map +1 -1
  223. package/dist/src/nile-button-toggle/nile-button-toggle.d.ts +0 -1
  224. package/dist/src/nile-button-toggle/nile-button-toggle.js +0 -1
  225. package/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -1
  226. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +0 -1
  227. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +0 -1
  228. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -1
  229. package/dist/src/nile-calendar/nile-calendar.d.ts +4 -6
  230. package/dist/src/nile-calendar/nile-calendar.js +7 -18
  231. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  232. package/dist/src/nile-card/nile-card.d.ts +0 -1
  233. package/dist/src/nile-card/nile-card.js +0 -1
  234. package/dist/src/nile-card/nile-card.js.map +1 -1
  235. package/dist/src/nile-checkbox/nile-checkbox.d.ts +0 -1
  236. package/dist/src/nile-checkbox/nile-checkbox.js +0 -1
  237. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  238. package/dist/src/nile-chip/nile-chip.d.ts +0 -1
  239. package/dist/src/nile-chip/nile-chip.js +0 -1
  240. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  241. package/dist/src/nile-code-editor/nile-code-editor.d.ts +0 -1
  242. package/dist/src/nile-code-editor/nile-code-editor.js +0 -1
  243. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  244. package/dist/src/nile-content-editor/nile-content-editor.d.ts +0 -1
  245. package/dist/src/nile-content-editor/nile-content-editor.js +0 -1
  246. package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
  247. package/dist/src/nile-date-picker/nile-date-picker.d.ts +0 -1
  248. package/dist/src/nile-date-picker/nile-date-picker.js +4 -2
  249. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  250. package/dist/src/nile-dialog/nile-dialog.d.ts +0 -1
  251. package/dist/src/nile-dialog/nile-dialog.js +0 -1
  252. package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  253. package/dist/src/nile-drawer/nile-drawer.d.ts +0 -1
  254. package/dist/src/nile-drawer/nile-drawer.js +0 -1
  255. package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
  256. package/dist/src/nile-empty-state/nile-empty-state.d.ts +0 -1
  257. package/dist/src/nile-empty-state/nile-empty-state.js +0 -1
  258. package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
  259. package/dist/src/nile-highlighter/nile-highlighter.d.ts +2 -1
  260. package/dist/src/nile-highlighter/nile-highlighter.js +16 -11
  261. package/dist/src/nile-highlighter/nile-highlighter.js.map +1 -1
  262. package/dist/src/nile-icon/icons/svg/index.d.ts +2 -0
  263. package/dist/src/nile-icon/icons/svg/index.js +2 -0
  264. package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
  265. package/dist/src/nile-icon/icons/svg/insert-at-cursor.d.ts +5 -0
  266. package/dist/src/nile-icon/icons/svg/insert-at-cursor.js +5 -0
  267. package/dist/src/nile-icon/icons/svg/insert-at-cursor.js.map +1 -0
  268. package/dist/src/nile-icon/icons/svg/warning-01.d.ts +5 -0
  269. package/dist/src/nile-icon/icons/svg/warning-01.js +5 -0
  270. package/dist/src/nile-icon/icons/svg/warning-01.js.map +1 -0
  271. package/dist/src/nile-icon-button/nile-icon-button.d.ts +0 -1
  272. package/dist/src/nile-icon-button/nile-icon-button.js +0 -1
  273. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  274. package/dist/src/nile-input/nile-input.d.ts +0 -1
  275. package/dist/src/nile-input/nile-input.js +0 -1
  276. package/dist/src/nile-input/nile-input.js.map +1 -1
  277. package/dist/src/nile-link/nile-link.d.ts +0 -1
  278. package/dist/src/nile-link/nile-link.js +0 -1
  279. package/dist/src/nile-link/nile-link.js.map +1 -1
  280. package/dist/src/nile-list/nile-list.d.ts +0 -1
  281. package/dist/src/nile-list/nile-list.js +0 -5
  282. package/dist/src/nile-list/nile-list.js.map +1 -1
  283. package/dist/src/nile-list-item/nile-list-item.d.ts +0 -1
  284. package/dist/src/nile-list-item/nile-list-item.js +0 -1
  285. package/dist/src/nile-list-item/nile-list-item.js.map +1 -1
  286. package/dist/src/nile-menu/nile-menu.d.ts +0 -1
  287. package/dist/src/nile-menu/nile-menu.js +0 -1
  288. package/dist/src/nile-menu/nile-menu.js.map +1 -1
  289. package/dist/src/nile-menu-item/nile-menu-item.d.ts +0 -2
  290. package/dist/src/nile-menu-item/nile-menu-item.js +0 -2
  291. package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
  292. package/dist/src/nile-option/nile-option.d.ts +0 -2
  293. package/dist/src/nile-option/nile-option.js +0 -2
  294. package/dist/src/nile-option/nile-option.js.map +1 -1
  295. package/dist/src/nile-popover/nile-popover.d.ts +0 -1
  296. package/dist/src/nile-popover/nile-popover.js +0 -1
  297. package/dist/src/nile-popover/nile-popover.js.map +1 -1
  298. package/dist/src/nile-popup/nile-popup.d.ts +0 -2
  299. package/dist/src/nile-popup/nile-popup.js +0 -2
  300. package/dist/src/nile-popup/nile-popup.js.map +1 -1
  301. package/dist/src/nile-radio-group/nile-radio-group.d.ts +0 -1
  302. package/dist/src/nile-radio-group/nile-radio-group.js +0 -1
  303. package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  304. package/dist/src/nile-select/nile-select.d.ts +0 -1
  305. package/dist/src/nile-select/nile-select.js +0 -1
  306. package/dist/src/nile-select/nile-select.js.map +1 -1
  307. package/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +0 -1
  308. package/dist/src/nile-slide-toggle/nile-slide-toggle.js +0 -1
  309. package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  310. package/dist/src/nile-split-panel/nile-split-panel.d.ts +0 -1
  311. package/dist/src/nile-split-panel/nile-split-panel.js +0 -1
  312. package/dist/src/nile-split-panel/nile-split-panel.js.map +1 -1
  313. package/dist/src/nile-stepper/nile-stepper.d.ts +0 -1
  314. package/dist/src/nile-stepper/nile-stepper.js +0 -1
  315. package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
  316. package/dist/src/nile-tab/nile-tab.d.ts +0 -1
  317. package/dist/src/nile-tab/nile-tab.js +0 -1
  318. package/dist/src/nile-tab/nile-tab.js.map +1 -1
  319. package/dist/src/nile-tab-group/nile-tab-group.d.ts +0 -1
  320. package/dist/src/nile-tab-group/nile-tab-group.js +0 -1
  321. package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
  322. package/dist/src/nile-table-body/nile-table-body.d.ts +0 -1
  323. package/dist/src/nile-table-body/nile-table-body.js +0 -1
  324. package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
  325. package/dist/src/nile-table-header-item/nile-table-header-item.d.ts +0 -1
  326. package/dist/src/nile-table-header-item/nile-table-header-item.js +0 -1
  327. package/dist/src/nile-table-header-item/nile-table-header-item.js.map +1 -1
  328. package/dist/src/nile-tag/nile-tag.d.ts +0 -1
  329. package/dist/src/nile-tag/nile-tag.js +0 -1
  330. package/dist/src/nile-tag/nile-tag.js.map +1 -1
  331. package/dist/src/nile-textarea/nile-textarea.d.ts +0 -1
  332. package/dist/src/nile-textarea/nile-textarea.js +0 -1
  333. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  334. package/dist/src/nile-toast/nile-toast.d.ts +0 -1
  335. package/dist/src/nile-toast/nile-toast.js +0 -1
  336. package/dist/src/nile-toast/nile-toast.js.map +1 -1
  337. package/dist/src/nile-tooltip/nile-tooltip.d.ts +0 -1
  338. package/dist/src/nile-tooltip/nile-tooltip.js +0 -1
  339. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  340. package/dist/src/nile-tree/nile-tree.d.ts +0 -1
  341. package/dist/src/nile-tree/nile-tree.js +0 -1
  342. package/dist/src/nile-tree/nile-tree.js.map +1 -1
  343. package/dist/src/nile-tree-item/nile-tree-item.d.ts +0 -1
  344. package/dist/src/nile-tree-item/nile-tree-item.js +0 -1
  345. package/dist/src/nile-tree-item/nile-tree-item.js.map +1 -1
  346. package/dist/tsconfig.tsbuildinfo +1 -1
  347. package/package.json +1 -1
  348. package/src/nile-accordion/nile-accordion.ts +0 -1
  349. package/src/nile-auto-complete/nile-auto-complete.ts +0 -2
  350. package/src/nile-avatar/nile-avatar.ts +0 -2
  351. package/src/nile-badge/nile-badge.ts +0 -2
  352. package/src/nile-breadcrumb/nile-breadcrumb.ts +0 -2
  353. package/src/nile-breadcrumb-item/nile-breadcrumb-item.ts +0 -2
  354. package/src/nile-button/nile-button.ts +0 -2
  355. package/src/nile-button-toggle/nile-button-toggle.ts +0 -2
  356. package/src/nile-button-toggle-group/nile-button-toggle-group.ts +0 -2
  357. package/src/nile-calendar/nile-calendar.ts +10 -20
  358. package/src/nile-card/nile-card.ts +0 -2
  359. package/src/nile-checkbox/nile-checkbox.ts +0 -2
  360. package/src/nile-chip/nile-chip.ts +0 -2
  361. package/src/nile-code-editor/nile-code-editor.ts +0 -2
  362. package/src/nile-content-editor/nile-content-editor.ts +0 -2
  363. package/src/nile-date-picker/nile-date-picker.ts +4 -3
  364. package/src/nile-dialog/nile-dialog.ts +0 -2
  365. package/src/nile-drawer/nile-drawer.ts +0 -2
  366. package/src/nile-empty-state/nile-empty-state.ts +0 -2
  367. package/src/nile-highlighter/nile-highlighter.ts +20 -13
  368. package/src/nile-icon/icons/svg/index.ts +2 -0
  369. package/src/nile-icon/icons/svg/insert-at-cursor.ts +5 -0
  370. package/src/nile-icon/icons/svg/warning-01.ts +5 -0
  371. package/src/nile-icon-button/nile-icon-button.ts +0 -2
  372. package/src/nile-input/nile-input.ts +0 -2
  373. package/src/nile-link/nile-link.ts +0 -2
  374. package/src/nile-list/nile-list.ts +0 -2
  375. package/src/nile-list-item/nile-list-item.ts +0 -2
  376. package/src/nile-menu/nile-menu.ts +0 -3
  377. package/src/nile-menu-item/nile-menu-item.ts +0 -3
  378. package/src/nile-option/nile-option.ts +0 -3
  379. package/src/nile-popover/nile-popover.ts +0 -2
  380. package/src/nile-popup/nile-popup.ts +0 -3
  381. package/src/nile-radio-group/nile-radio-group.ts +0 -2
  382. package/src/nile-select/nile-select.ts +0 -2
  383. package/src/nile-slide-toggle/nile-slide-toggle.ts +0 -2
  384. package/src/nile-split-panel/nile-split-panel.ts +0 -2
  385. package/src/nile-stepper/nile-stepper.ts +0 -2
  386. package/src/nile-tab/nile-tab.ts +0 -2
  387. package/src/nile-tab-group/nile-tab-group.ts +0 -2
  388. package/src/nile-table-body/nile-table-body.ts +0 -2
  389. package/src/nile-table-header-item/nile-table-header-item.ts +0 -2
  390. package/src/nile-tag/nile-tag.ts +0 -2
  391. package/src/nile-textarea/nile-textarea.ts +0 -2
  392. package/src/nile-toast/nile-toast.ts +0 -2
  393. package/src/nile-tooltip/nile-tooltip.ts +0 -2
  394. package/src/nile-tree/nile-tree.ts +0 -2
  395. package/src/nile-tree-item/nile-tree-item.ts +0 -2
@@ -1,4 +1,4 @@
1
- import{__decorate as t}from"tslib";import{classMap as e}from"lit/directives/class-map.js";import{query as n,property as i,customElement as o}from"lit/decorators.js";import{html as r}from"lit";import{N as a}from"../internal/nile-element.esm.js";import{s}from"./nile-popup.css.esm.js";import"../index-0a3007c5.esm.js";const l=Math.min,c=Math.max,u=Math.round,f=Math.floor,h=t=>({x:t,y:t}),d={left:"right",right:"left",bottom:"top",top:"bottom"},p={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function b(t){return t.split("-")[0]}function g(t){return t.split("-")[1]}function v(t){return"x"===t?"y":"x"}function w(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(b(t))?"y":"x"}function A(t){return v(x(t))}function z(t){return t.replace(/start|end/g,(t=>p[t]))}function S(t){return t.replace(/left|right|bottom|top/g,(t=>d[t]))}function k(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function P(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function $(t,e,n){let{reference:i,floating:o}=t;const r=x(e),a=A(e),s=w(a),l=b(e),c="y"===r,u=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,h=i[s]/2-o[s]/2;let d;switch(l){case"top":d={x:u,y:i.y-o.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-o.width,y:f};break;default:d={x:i.x,y:i.y}}switch(g(e)){case"start":d[a]-=h*(n&&c?-1:1);break;case"end":d[a]+=h*(n&&c?-1:1)}return d}async function O(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=y(e,t),p=k(d),m=s[h?"floating"===f?"reference":"floating":f],b=P(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===f?{x:i,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),w=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},x=P(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(b.top-x.top+p.top)/w.y,bottom:(x.bottom-b.bottom+p.bottom)/w.y,left:(b.left-x.left+p.left)/w.x,right:(x.right-b.right+p.right)/w.x}}function F(t){return C(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function B(t){var e;return null==(e=(C(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function C(t){return t instanceof Node||t instanceof R(t).Node}function j(t){return t instanceof Element||t instanceof R(t).Element}function E(t){return t instanceof HTMLElement||t instanceof R(t).HTMLElement}function N(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof R(t).ShadowRoot)}function D(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=_(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function T(t){return["table","td","th"].includes(F(t))}function M(t){const e=L(),n=_(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function L(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function H(t){return["html","body","#document"].includes(F(t))}function _(t){return R(t).getComputedStyle(t)}function I(t){return j(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(t){if("html"===F(t))return t;const e=t.assignedSlot||t.parentNode||N(t)&&t.host||B(t);return N(e)?e.host:e}function W(t){const e=q(t);return H(e)?t.ownerDocument?t.ownerDocument.body:t.body:E(e)&&D(e)?e:W(e)}function Y(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=W(t),r=o===(null==(i=t.ownerDocument)?void 0:i.body),a=R(o);return r?e.concat(a,a.visualViewport||[],D(o)?o:[],a.frameElement&&n?Y(a.frameElement):[]):e.concat(o,Y(o,[],n))}function V(t){const e=_(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=E(t),r=o?t.offsetWidth:n,a=o?t.offsetHeight:i,s=u(n)!==r||u(i)!==a;return s&&(n=r,i=a),{width:n,height:i,$:s}}function X(t){return j(t)?t:t.contextElement}function G(t){const e=X(t);if(!E(e))return h(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=V(e);let a=(r?u(n.width):n.width)/i,s=(r?u(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const J=h(0);function K(t){const e=R(t);return L()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:J}function Q(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),r=X(t);let a=h(1);e&&(i?j(i)&&(a=G(i)):a=G(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==R(t))&&e}(r,n,i)?K(r):h(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(r){const t=R(r),e=i&&j(i)?R(i):i;let n=t,o=n.frameElement;for(;o&&i&&e!==n;){const t=G(o),e=o.getBoundingClientRect(),i=_(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,a=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,f*=t.y,l+=r,c+=a,n=R(o),o=n.frameElement}}return P({width:u,height:f,x:l,y:c})}const U=[":popover-open",":modal"];function Z(t){return U.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function tt(t){return Q(B(t)).left+I(t).scrollLeft}function et(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=R(t),i=B(t),o=n.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,l=0;if(o){r=o.width,a=o.height;const t=L();(!t||t&&"fixed"===e)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)i=function(t){const e=B(t),n=I(t),i=t.ownerDocument.body,o=c(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=c(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+tt(t);const s=-n.scrollTop;return"rtl"===_(i).direction&&(a+=c(e.clientWidth,i.clientWidth)-o),{width:o,height:r,x:a,y:s}}(B(t));else if(j(e))i=function(t,e){const n=Q(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=E(t)?G(t):h(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:i*r.y}}(e,n);else{const n=K(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return P(i)}function nt(t,e){const n=q(t);return!(n===e||!j(n)||H(n))&&("fixed"===_(n).position||nt(n,e))}function it(t,e,n){const i=E(e),o=B(e),r="fixed"===n,a=Q(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=h(0);if(i||!i&&!r)if(("body"!==F(e)||D(o))&&(s=I(e)),i){const t=Q(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&(l.x=tt(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function ot(t){return"static"===_(t).position}function rt(t,e){return E(t)&&"fixed"!==_(t).position?e?e(t):t.offsetParent:null}function at(t,e){const n=R(t);if(Z(t))return n;if(!E(t)){let e=q(t);for(;e&&!H(e);){if(j(e)&&!ot(e))return e;e=q(e)}return n}let i=rt(t,e);for(;i&&T(i)&&ot(i);)i=rt(i,e);return i&&H(i)&&ot(i)&&!M(i)?n:i||function(t){let e=q(t);for(;E(e)&&!H(e);){if(M(e))return e;e=q(e)}return null}(t)||n}const st={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r="fixed"===o,a=B(i),s=!!e&&Z(e.floating);if(i===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=h(1);const u=h(0),f=E(i);if((f||!f&&!r)&&(("body"!==F(i)||D(a))&&(l=I(i)),E(i))){const t=Q(i);c=G(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:B,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[..."clippingAncestors"===n?Z(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=Y(t,[],!1).filter((t=>j(t)&&"body"!==F(t))),o=null;const r="fixed"===_(t).position;let a=r?q(t):t;for(;j(a)&&!H(a);){const e=_(a),n=M(a);n||"fixed"!==e.position||(o=null),(r?!n&&!o:!n&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||D(a)&&!n&&nt(t,a))?i=i.filter((t=>t!==a)):o=e,a=q(a)}return e.set(t,i),i}(e,this._c):[].concat(n),i],a=r[0],s=r.reduce(((t,n)=>{const i=et(e,n,o);return t.top=c(i.top,t.top),t.right=l(i.right,t.right),t.bottom=l(i.bottom,t.bottom),t.left=c(i.left,t.left),t}),et(e,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:at,getElementRects:async function(t){const e=this.getOffsetParent||at,n=this.getDimensions,i=await n(t.floating);return{reference:it(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=V(t);return{width:e,height:n}},getScale:G,isElement:j,isRTL:function(t){return"rtl"===_(t).direction}};function lt(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=i,h=X(t),d=o||r?[...h?Y(h):[],...Y(e)]:[];d.forEach((t=>{o&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const p=h&&s?function(t,e){let n,i=null;const o=B(t);function r(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}return function a(s,u){void 0===s&&(s=!1),void 0===u&&(u=1),r();const{left:h,top:d,width:p,height:m}=t.getBoundingClientRect();if(s||e(),!p||!m)return;const y={rootMargin:-f(d)+"px "+-f(o.clientWidth-(h+p))+"px "+-f(o.clientHeight-(d+m))+"px "+-f(h)+"px",threshold:c(0,l(1,u))||1};let b=!0;function g(t){const e=t[0].intersectionRatio;if(e!==u){if(!b)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}b=!1}try{i=new IntersectionObserver(g,{...y,root:o.ownerDocument})}catch(t){i=new IntersectionObserver(g,y)}i.observe(t)}(!0),r}(h,n):null;let m,y=-1,b=null;a&&(b=new ResizeObserver((t=>{let[i]=t;i&&i.target===h&&b&&(b.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{var t;null==(t=b)||t.observe(e)}))),n()})),h&&!u&&b.observe(h),b.observe(e));let g=u?Q(t):null;return u&&function e(){const i=Q(t);!g||i.x===g.x&&i.y===g.y&&i.width===g.width&&i.height===g.height||n();g=i,m=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach((t=>{o&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==p||p(),null==(t=b)||t.disconnect(),b=null,u&&cancelAnimationFrame(m)}}const ct=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:r,placement:a,middlewareData:s}=e,l=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),a=b(n),s=g(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,u=r&&l?-1:1,f=y(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof p&&(d="end"===s?-1*p:p),l?{x:d*u,y:h*c}:{x:h*c,y:d*u}}(e,t);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:a}}}}},ut=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:i},u=await O(e,l),f=x(b(o)),h=v(f);let d=c[h],p=c[f];if(r){const t="y"===h?"bottom":"right";d=m(d+u["y"===h?"top":"left"],d,d-u[t])}if(a){const t="y"===f?"bottom":"right";p=m(p+u["y"===f?"top":"left"],p,p-u[t])}const g=s.fn({...e,[h]:d,[f]:p});return{...g,data:{x:g.x-n,y:g.y-i}}}}},ft=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=y(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=b(o),k=b(s)===s,P=await(null==l.isRTL?void 0:l.isRTL(c.floating)),$=h||(k||!m?[S(s)]:function(t){const e=S(t);return[z(t),e,z(e)]}(s));h||"none"===p||$.push(...function(t,e,n,i){const o=g(t);let r=function(t,e,n){const i=["left","right"],o=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?r:a;default:return[]}}(b(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(z)))),r}(s,m,p,P));const F=[s,...$],R=await O(e,v),B=[];let C=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&B.push(R[x]),f){const t=function(t,e,n){void 0===n&&(n=!1);const i=g(t),o=A(t),r=w(o);let a="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=S(a)),[a,S(a)]}(o,a,P);B.push(R[t[0]],R[t[1]])}if(C=[...C,{placement:o,overflows:B}],!B.every((t=>t<=0))){var j,E;const t=((null==(j=r.flip)?void 0:j.index)||0)+1,e=F[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(E=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:E.placement;if(!n)switch(d){case"bestFit":{var N;const t=null==(N=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:N[0];t&&(n=t);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},ht=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:i,platform:o,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),u=await O(e,s),f=b(n),h=g(n),d="y"===x(n),{width:p,height:m}=i.floating;let v,w;"top"===f||"bottom"===f?(v=f,w=h===(await(null==o.isRTL?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(w=f,v="end"===h?"top":"bottom");const A=m-u[v],z=p-u[w],S=!e.middlewareData.shift;let k=A,P=z;if(d){const t=p-u.left-u.right;P=h||S?l(z,t):t}else{const t=m-u.top-u.bottom;k=h||S?l(A,t):t}if(S&&!h){const t=c(u.left,0),e=c(u.right,0),n=c(u.top,0),i=c(u.bottom,0);d?P=p-2*(0!==t||0!==e?t+e:c(u.left,u.right)):k=m-2*(0!==n||0!==i?n+i:c(u.top,u.bottom))}await a({...e,availableWidth:P,availableHeight:k});const $=await o.getDimensions(r.floating);return p!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}},dt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:r,platform:a,elements:s,middlewareData:c}=e,{element:u,padding:f=0}=y(t,e)||{};if(null==u)return{};const h=k(f),d={x:n,y:i},p=A(o),b=w(p),v=await a.getDimensions(u),x="y"===p,z=x?"top":"left",S=x?"bottom":"right",P=x?"clientHeight":"clientWidth",$=r.reference[b]+r.reference[p]-d[p]-r.floating[b],O=d[p]-r.reference[p],F=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let R=F?F[P]:0;R&&await(null==a.isElement?void 0:a.isElement(F))||(R=s.floating[P]||r.floating[b]);const B=$/2-O/2,C=R/2-v[b]/2-1,j=l(h[z],C),E=l(h[S],C),N=j,D=R-v[b]-E,T=R/2-v[b]/2+B,M=m(N,T,D),L=!c.arrow&&null!=g(o)&&T!==M&&r.reference[b]/2-(T<N?j:E)-v[b]/2<0,H=L?T<N?T-N:T-D:0;return{[p]:d[p]+H,data:{[p]:M,centerOffset:T-M-H,...L&&{alignmentOffset:H}},reset:L}}}),pt=(t,e,n)=>{const i=new Map,o={platform:st,...n},r={...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:f}=$(c,i,l),h=i,d={},p=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:b,data:g,reset:v}=await m({x:u,y:f,initialPlacement:i,placement:h,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:t,floating:e}});u=null!=y?y:u,f=null!=b?b:f,d={...d,[r]:{...d[r],...g}},v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:e,strategy:o}):v.rects),({x:u,y:f}=$(c,h,l))),n=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:d}})(t,e,{...o,platform:r})};function mt(t){return function(t){for(let e=t;e;e=yt(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=yt(t);e;e=yt(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function yt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}let bt=class extends a{constructor(){super(...arguments),this.BUBBLES=!1,this.COMPOSED=!1,this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=lt(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[ct({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(ht({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(ft({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(ut({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(ht({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(dt({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>st.getOffsetParent(t,mt):st.getOffsetParent;pt(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:{...st,getOffsetParent:e}}).then((({x:t,y:e,middlewareData:n,placement:i})=>{const o="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];if(this.setAttribute("data-current-placement",i),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let i="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=o?n:"",l=o?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=o?"":n,l=o?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",i="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",i="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:i,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("reposition")}render(){return r`
1
+ import{__decorate as t}from"tslib";import{classMap as e}from"lit/directives/class-map.js";import{query as n,property as i,customElement as o}from"lit/decorators.js";import{html as r}from"lit";import{N as a}from"../internal/nile-element.esm.js";import{s}from"./nile-popup.css.esm.js";import"../index-0a3007c5.esm.js";const l=Math.min,c=Math.max,u=Math.round,f=Math.floor,h=t=>({x:t,y:t}),d={left:"right",right:"left",bottom:"top",top:"bottom"},p={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function b(t){return t.split("-")[0]}function g(t){return t.split("-")[1]}function v(t){return"x"===t?"y":"x"}function w(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(b(t))?"y":"x"}function A(t){return v(x(t))}function z(t){return t.replace(/start|end/g,(t=>p[t]))}function S(t){return t.replace(/left|right|bottom|top/g,(t=>d[t]))}function k(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function P(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function $(t,e,n){let{reference:i,floating:o}=t;const r=x(e),a=A(e),s=w(a),l=b(e),c="y"===r,u=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,h=i[s]/2-o[s]/2;let d;switch(l){case"top":d={x:u,y:i.y-o.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-o.width,y:f};break;default:d={x:i.x,y:i.y}}switch(g(e)){case"start":d[a]-=h*(n&&c?-1:1);break;case"end":d[a]+=h*(n&&c?-1:1)}return d}async function O(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=y(e,t),p=k(d),m=s[h?"floating"===f?"reference":"floating":f],b=P(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===f?{x:i,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),w=await(null==r.isElement?void 0:r.isElement(v))&&await(null==r.getScale?void 0:r.getScale(v))||{x:1,y:1},x=P(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(b.top-x.top+p.top)/w.y,bottom:(x.bottom-b.bottom+p.bottom)/w.y,left:(b.left-x.left+p.left)/w.x,right:(x.right-b.right+p.right)/w.x}}function F(t){return C(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function B(t){var e;return null==(e=(C(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function C(t){return t instanceof Node||t instanceof R(t).Node}function j(t){return t instanceof Element||t instanceof R(t).Element}function E(t){return t instanceof HTMLElement||t instanceof R(t).HTMLElement}function N(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof R(t).ShadowRoot)}function D(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=_(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function T(t){return["table","td","th"].includes(F(t))}function M(t){const e=L(),n=_(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function L(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function H(t){return["html","body","#document"].includes(F(t))}function _(t){return R(t).getComputedStyle(t)}function I(t){return j(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(t){if("html"===F(t))return t;const e=t.assignedSlot||t.parentNode||N(t)&&t.host||B(t);return N(e)?e.host:e}function W(t){const e=q(t);return H(e)?t.ownerDocument?t.ownerDocument.body:t.body:E(e)&&D(e)?e:W(e)}function Y(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=W(t),r=o===(null==(i=t.ownerDocument)?void 0:i.body),a=R(o);return r?e.concat(a,a.visualViewport||[],D(o)?o:[],a.frameElement&&n?Y(a.frameElement):[]):e.concat(o,Y(o,[],n))}function V(t){const e=_(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=E(t),r=o?t.offsetWidth:n,a=o?t.offsetHeight:i,s=u(n)!==r||u(i)!==a;return s&&(n=r,i=a),{width:n,height:i,$:s}}function X(t){return j(t)?t:t.contextElement}function G(t){const e=X(t);if(!E(e))return h(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=V(e);let a=(r?u(n.width):n.width)/i,s=(r?u(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const J=h(0);function K(t){const e=R(t);return L()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:J}function Q(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),r=X(t);let a=h(1);e&&(i?j(i)&&(a=G(i)):a=G(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==R(t))&&e}(r,n,i)?K(r):h(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(r){const t=R(r),e=i&&j(i)?R(i):i;let n=t,o=n.frameElement;for(;o&&i&&e!==n;){const t=G(o),e=o.getBoundingClientRect(),i=_(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,a=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,u*=t.x,f*=t.y,l+=r,c+=a,n=R(o),o=n.frameElement}}return P({width:u,height:f,x:l,y:c})}const U=[":popover-open",":modal"];function Z(t){return U.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function tt(t){return Q(B(t)).left+I(t).scrollLeft}function et(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=R(t),i=B(t),o=n.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,l=0;if(o){r=o.width,a=o.height;const t=L();(!t||t&&"fixed"===e)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)i=function(t){const e=B(t),n=I(t),i=t.ownerDocument.body,o=c(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=c(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+tt(t);const s=-n.scrollTop;return"rtl"===_(i).direction&&(a+=c(e.clientWidth,i.clientWidth)-o),{width:o,height:r,x:a,y:s}}(B(t));else if(j(e))i=function(t,e){const n=Q(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=E(t)?G(t):h(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:i*r.y}}(e,n);else{const n=K(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return P(i)}function nt(t,e){const n=q(t);return!(n===e||!j(n)||H(n))&&("fixed"===_(n).position||nt(n,e))}function it(t,e,n){const i=E(e),o=B(e),r="fixed"===n,a=Q(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=h(0);if(i||!i&&!r)if(("body"!==F(e)||D(o))&&(s=I(e)),i){const t=Q(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&(l.x=tt(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function ot(t){return"static"===_(t).position}function rt(t,e){return E(t)&&"fixed"!==_(t).position?e?e(t):t.offsetParent:null}function at(t,e){const n=R(t);if(Z(t))return n;if(!E(t)){let e=q(t);for(;e&&!H(e);){if(j(e)&&!ot(e))return e;e=q(e)}return n}let i=rt(t,e);for(;i&&T(i)&&ot(i);)i=rt(i,e);return i&&H(i)&&ot(i)&&!M(i)?n:i||function(t){let e=q(t);for(;E(e)&&!H(e);){if(M(e))return e;e=q(e)}return null}(t)||n}const st={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r="fixed"===o,a=B(i),s=!!e&&Z(e.floating);if(i===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=h(1);const u=h(0),f=E(i);if((f||!f&&!r)&&(("body"!==F(i)||D(a))&&(l=I(i)),E(i))){const t=Q(i);c=G(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:B,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[..."clippingAncestors"===n?Z(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=Y(t,[],!1).filter((t=>j(t)&&"body"!==F(t))),o=null;const r="fixed"===_(t).position;let a=r?q(t):t;for(;j(a)&&!H(a);){const e=_(a),n=M(a);n||"fixed"!==e.position||(o=null),(r?!n&&!o:!n&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||D(a)&&!n&&nt(t,a))?i=i.filter((t=>t!==a)):o=e,a=q(a)}return e.set(t,i),i}(e,this._c):[].concat(n),i],a=r[0],s=r.reduce(((t,n)=>{const i=et(e,n,o);return t.top=c(i.top,t.top),t.right=l(i.right,t.right),t.bottom=l(i.bottom,t.bottom),t.left=c(i.left,t.left),t}),et(e,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:at,getElementRects:async function(t){const e=this.getOffsetParent||at,n=this.getDimensions,i=await n(t.floating);return{reference:it(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=V(t);return{width:e,height:n}},getScale:G,isElement:j,isRTL:function(t){return"rtl"===_(t).direction}};function lt(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=i,h=X(t),d=o||r?[...h?Y(h):[],...Y(e)]:[];d.forEach((t=>{o&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const p=h&&s?function(t,e){let n,i=null;const o=B(t);function r(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}return function a(s,u){void 0===s&&(s=!1),void 0===u&&(u=1),r();const{left:h,top:d,width:p,height:m}=t.getBoundingClientRect();if(s||e(),!p||!m)return;const y={rootMargin:-f(d)+"px "+-f(o.clientWidth-(h+p))+"px "+-f(o.clientHeight-(d+m))+"px "+-f(h)+"px",threshold:c(0,l(1,u))||1};let b=!0;function g(t){const e=t[0].intersectionRatio;if(e!==u){if(!b)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}b=!1}try{i=new IntersectionObserver(g,{...y,root:o.ownerDocument})}catch(t){i=new IntersectionObserver(g,y)}i.observe(t)}(!0),r}(h,n):null;let m,y=-1,b=null;a&&(b=new ResizeObserver((t=>{let[i]=t;i&&i.target===h&&b&&(b.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{var t;null==(t=b)||t.observe(e)}))),n()})),h&&!u&&b.observe(h),b.observe(e));let g=u?Q(t):null;return u&&function e(){const i=Q(t);!g||i.x===g.x&&i.y===g.y&&i.width===g.width&&i.height===g.height||n();g=i,m=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach((t=>{o&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==p||p(),null==(t=b)||t.disconnect(),b=null,u&&cancelAnimationFrame(m)}}const ct=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:r,placement:a,middlewareData:s}=e,l=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),a=b(n),s=g(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,u=r&&l?-1:1,f=y(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof p&&(d="end"===s?-1*p:p),l?{x:d*u,y:h*c}:{x:h*c,y:d*u}}(e,t);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:a}}}}},ut=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:i},u=await O(e,l),f=x(b(o)),h=v(f);let d=c[h],p=c[f];if(r){const t="y"===h?"bottom":"right";d=m(d+u["y"===h?"top":"left"],d,d-u[t])}if(a){const t="y"===f?"bottom":"right";p=m(p+u["y"===f?"top":"left"],p,p-u[t])}const g=s.fn({...e,[h]:d,[f]:p});return{...g,data:{x:g.x-n,y:g.y-i}}}}},ft=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=y(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=b(o),k=b(s)===s,P=await(null==l.isRTL?void 0:l.isRTL(c.floating)),$=h||(k||!m?[S(s)]:function(t){const e=S(t);return[z(t),e,z(e)]}(s));h||"none"===p||$.push(...function(t,e,n,i){const o=g(t);let r=function(t,e,n){const i=["left","right"],o=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?r:a;default:return[]}}(b(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(z)))),r}(s,m,p,P));const F=[s,...$],R=await O(e,v),B=[];let C=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&B.push(R[x]),f){const t=function(t,e,n){void 0===n&&(n=!1);const i=g(t),o=A(t),r=w(o);let a="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=S(a)),[a,S(a)]}(o,a,P);B.push(R[t[0]],R[t[1]])}if(C=[...C,{placement:o,overflows:B}],!B.every((t=>t<=0))){var j,E;const t=((null==(j=r.flip)?void 0:j.index)||0)+1,e=F[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(E=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:E.placement;if(!n)switch(d){case"bestFit":{var N;const t=null==(N=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:N[0];t&&(n=t);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},ht=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:i,platform:o,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),u=await O(e,s),f=b(n),h=g(n),d="y"===x(n),{width:p,height:m}=i.floating;let v,w;"top"===f||"bottom"===f?(v=f,w=h===(await(null==o.isRTL?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(w=f,v="end"===h?"top":"bottom");const A=m-u[v],z=p-u[w],S=!e.middlewareData.shift;let k=A,P=z;if(d){const t=p-u.left-u.right;P=h||S?l(z,t):t}else{const t=m-u.top-u.bottom;k=h||S?l(A,t):t}if(S&&!h){const t=c(u.left,0),e=c(u.right,0),n=c(u.top,0),i=c(u.bottom,0);d?P=p-2*(0!==t||0!==e?t+e:c(u.left,u.right)):k=m-2*(0!==n||0!==i?n+i:c(u.top,u.bottom))}await a({...e,availableWidth:P,availableHeight:k});const $=await o.getDimensions(r.floating);return p!==$.width||m!==$.height?{reset:{rects:!0}}:{}}}},dt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:r,platform:a,elements:s,middlewareData:c}=e,{element:u,padding:f=0}=y(t,e)||{};if(null==u)return{};const h=k(f),d={x:n,y:i},p=A(o),b=w(p),v=await a.getDimensions(u),x="y"===p,z=x?"top":"left",S=x?"bottom":"right",P=x?"clientHeight":"clientWidth",$=r.reference[b]+r.reference[p]-d[p]-r.floating[b],O=d[p]-r.reference[p],F=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let R=F?F[P]:0;R&&await(null==a.isElement?void 0:a.isElement(F))||(R=s.floating[P]||r.floating[b]);const B=$/2-O/2,C=R/2-v[b]/2-1,j=l(h[z],C),E=l(h[S],C),N=j,D=R-v[b]-E,T=R/2-v[b]/2+B,M=m(N,T,D),L=!c.arrow&&null!=g(o)&&T!==M&&r.reference[b]/2-(T<N?j:E)-v[b]/2<0,H=L?T<N?T-N:T-D:0;return{[p]:d[p]+H,data:{[p]:M,centerOffset:T-M-H,...L&&{alignmentOffset:H}},reset:L}}}),pt=(t,e,n)=>{const i=new Map,o={platform:st,...n},r={...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:f}=$(c,i,l),h=i,d={},p=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:b,data:g,reset:v}=await m({x:u,y:f,initialPlacement:i,placement:h,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:t,floating:e}});u=null!=y?y:u,f=null!=b?b:f,d={...d,[r]:{...d[r],...g}},v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:e,strategy:o}):v.rects),({x:u,y:f}=$(c,h,l))),n=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:d}})(t,e,{...o,platform:r})};function mt(t){return function(t){for(let e=t;e;e=yt(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=yt(t);e;e=yt(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function yt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}let bt=class extends a{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=lt(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[ct({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(ht({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(ft({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(ut({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(ht({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(dt({element:this.arrowEl,padding:this.arrowPadding}));const e="absolute"===this.strategy?t=>st.getOffsetParent(t,mt):st.getOffsetParent;pt(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy,platform:{...st,getOffsetParent:e}}).then((({x:t,y:e,middlewareData:n,placement:i})=>{const o="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];if(this.setAttribute("data-current-placement",i),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let i="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";i="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=o?n:"",l=o?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=o?"":n,l=o?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",i="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",i="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:i,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("reposition")}render(){return r`
2
2
  <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
3
3
 
4
4
  <div
@@ -1,2 +1,2 @@
1
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","lit","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-group.css.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,l,o,r,a,n,h,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.state;l=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_lit){a=_lit.html;},function(_internalWatchCjsJs){n=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_nileRadioGroupCssCjsJs){d=_nileRadioGroupCssCjsJs.s;}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_h){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.BUBBLES=!1,_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.customValidityMessage="",_this.hasButtonGroup=!1,_this.defaultValue="",_this.label="",_this.name="option",_this.value="",_this.form="",_this.required=!1,_this.labelInline=!1,_this.disabled=!1,_this.helpText="",_this.errorMessage="",_this.islabelborder=!1;return _this;}_inherits(c,_h);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.defaultValue=this.value,this.handleInitialDisabledState(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(c.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"getAllRadios",value:function getAllRadios(){return _toConsumableArray(this.querySelectorAll("nile-radio"));}},{key:"handleRadioClick",value:function handleRadioClick(t){var e=t.target.closest("nile-radio"),i=this.getAllRadios(),s=this.value;e.disabled||this.disabled||(this.value=e.value,i.forEach(function(t){return t.checked=t===e;}),this.value!==s&&(this.emit("change",{value:this.value}),this.emit("input")));}},{key:"handleDisabledChange",value:function handleDisabledChange(){var _this2=this;this.getAllRadios().forEach(function(t){t.disabled=_this2.disabled;});}},{key:"handleInitialDisabledState",value:function handleInitialDisabledState(){var _this3=this;this.getAllRadios().forEach(function(t){t.disabled=t.hasAttribute("disabled")?t.disabled:_this3.disabled;});}},{key:"handleKeyDown",value:function handleKeyDown(t){var _e$find,_this4=this;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;var e=this.getAllRadios().filter(function(t){return!t.disabled;}),i=(_e$find=e.find(function(t){return t.checked;}))!==null&&_e$find!==void 0?_e$find:e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,l=this.value;var o=e.indexOf(i)+s;o<0&&(o=e.length-1),o>e.length-1&&(o=0),this.getAllRadios().forEach(function(t){t.checked=!1,_this4.hasButtonGroup||(t.tabIndex=-1);}),this.value=e[o].value,e[o].checked=!0,this.hasButtonGroup?e[o].shadowRoot.querySelector("button").focus():(e[o].tabIndex=0,e[o].focus()),this.value!==l&&(this.emit("change"),this.emit("input")),t.preventDefault();}},{key:"handleLabelClick",value:function handleLabelClick(){var t=this.getAllRadios(),e=t.find(function(t){return t.checked;})||t[0];e&&e.focus();}},{key:"handleSlotChange",value:function handleSlotChange(){var _this5=this,_this$shadowRoot;var t=this.getAllRadios();t.forEach(function(t){t.checked=t.value===_this5.value,_this5.islabelborder&&(t.islabelborder=!0);});if(this.hasButtonGroup=t.some(function(t){return"nile-radio-button"===t.tagName.toLowerCase();}),!t.some(function(t){return t.checked;}))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0;}else t[0].tabIndex=0;this.hasButtonGroup&&((_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector("nile-button-group"));}},{key:"updateCheckedRadio",value:function updateCheckedRadio(){var _this6=this;this.getAllRadios().forEach(function(t){return t.checked=t.value===_this6.value;});}},{key:"handleValueChange",value:function handleValueChange(){this.hasUpdated&&this.updateCheckedRadio();}},{key:"render",value:function render(){var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var i=this.hasSlotController.test("label-suffix"),s=!!this.label||!!t,l=!!this.helpText,o=!!this.errorMessage,r=a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <slot\n @click=","\n @keydown=","\n @slotchange=","\n role=\"presentation\"\n ></slot>\n "])),this.handleRadioClick,this.handleKeyDown,this.handleSlotChange);return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <fieldset\n part=\"form-control\"\n class=","\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=","\n @click=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n ","\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=","\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ","\n </div>\n\n ","\n\n ","\n\n </fieldset>\n "])),e({"form-control":!0,"form-control--medium":!0,"form-control--radio-group":!0,"form-control--has-label":s,"form-control--has-help-text":l}),s?"false":"true",this.handleLabelClick,this.label,i?a(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot name=\"label-suffix\"></slot> "]))):"",this.required,this.hasButtonGroup?a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n ","\n "])),r):a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div part=\"options-base\" class=\"","\"> ","</div> "])),this.labelInline?"form-control--inline-radio":"",r),l?a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?a(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);}(h));c.styles=d,t([i("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([s()],c.prototype,"hasButtonGroup",void 0),t([s()],c.prototype,"defaultValue",void 0),t([l()],c.prototype,"label",void 0),t([l()],c.prototype,"name",void 0),t([l({reflect:!0})],c.prototype,"value",void 0),t([l({reflect:!0})],c.prototype,"form",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([l({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([l({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"islabelborder",void 0),t([n("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),t([n("value")],c.prototype,"handleValueChange",null),_export("N",c=t([o("nile-radio-group")],c));}};});
1
+ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","lit","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-group.css.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,l,o,r,a,n,h,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.state;l=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_lit){a=_lit.html;},function(_internalWatchCjsJs){n=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_nileRadioGroupCssCjsJs){d=_nileRadioGroupCssCjsJs.s;}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_h){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.customValidityMessage="",_this.hasButtonGroup=!1,_this.defaultValue="",_this.label="",_this.name="option",_this.value="",_this.form="",_this.required=!1,_this.labelInline=!1,_this.disabled=!1,_this.helpText="",_this.errorMessage="",_this.islabelborder=!1;return _this;}_inherits(c,_h);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.defaultValue=this.value,this.handleInitialDisabledState(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_get(_getPrototypeOf(c.prototype),"disconnectedCallback",this).call(this),this.emit("nile-destroy");}},{key:"getAllRadios",value:function getAllRadios(){return _toConsumableArray(this.querySelectorAll("nile-radio"));}},{key:"handleRadioClick",value:function handleRadioClick(t){var e=t.target.closest("nile-radio"),i=this.getAllRadios(),s=this.value;e.disabled||this.disabled||(this.value=e.value,i.forEach(function(t){return t.checked=t===e;}),this.value!==s&&(this.emit("change",{value:this.value}),this.emit("input")));}},{key:"handleDisabledChange",value:function handleDisabledChange(){var _this2=this;this.getAllRadios().forEach(function(t){t.disabled=_this2.disabled;});}},{key:"handleInitialDisabledState",value:function handleInitialDisabledState(){var _this3=this;this.getAllRadios().forEach(function(t){t.disabled=t.hasAttribute("disabled")?t.disabled:_this3.disabled;});}},{key:"handleKeyDown",value:function handleKeyDown(t){var _e$find,_this4=this;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;var e=this.getAllRadios().filter(function(t){return!t.disabled;}),i=(_e$find=e.find(function(t){return t.checked;}))!==null&&_e$find!==void 0?_e$find:e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,l=this.value;var o=e.indexOf(i)+s;o<0&&(o=e.length-1),o>e.length-1&&(o=0),this.getAllRadios().forEach(function(t){t.checked=!1,_this4.hasButtonGroup||(t.tabIndex=-1);}),this.value=e[o].value,e[o].checked=!0,this.hasButtonGroup?e[o].shadowRoot.querySelector("button").focus():(e[o].tabIndex=0,e[o].focus()),this.value!==l&&(this.emit("change"),this.emit("input")),t.preventDefault();}},{key:"handleLabelClick",value:function handleLabelClick(){var t=this.getAllRadios(),e=t.find(function(t){return t.checked;})||t[0];e&&e.focus();}},{key:"handleSlotChange",value:function handleSlotChange(){var _this5=this,_this$shadowRoot;var t=this.getAllRadios();t.forEach(function(t){t.checked=t.value===_this5.value,_this5.islabelborder&&(t.islabelborder=!0);});if(this.hasButtonGroup=t.some(function(t){return"nile-radio-button"===t.tagName.toLowerCase();}),!t.some(function(t){return t.checked;}))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0;}else t[0].tabIndex=0;this.hasButtonGroup&&((_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector("nile-button-group"));}},{key:"updateCheckedRadio",value:function updateCheckedRadio(){var _this6=this;this.getAllRadios().forEach(function(t){return t.checked=t.value===_this6.value;});}},{key:"handleValueChange",value:function handleValueChange(){this.hasUpdated&&this.updateCheckedRadio();}},{key:"render",value:function render(){var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var i=this.hasSlotController.test("label-suffix"),s=!!this.label||!!t,l=!!this.helpText,o=!!this.errorMessage,r=a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <slot\n @click=","\n @keydown=","\n @slotchange=","\n role=\"presentation\"\n ></slot>\n "])),this.handleRadioClick,this.handleKeyDown,this.handleSlotChange);return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <fieldset\n part=\"form-control\"\n class=","\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=","\n @click=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n ","\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=","\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ","\n </div>\n\n ","\n\n ","\n\n </fieldset>\n "])),e({"form-control":!0,"form-control--medium":!0,"form-control--radio-group":!0,"form-control--has-label":s,"form-control--has-help-text":l}),s?"false":"true",this.handleLabelClick,this.label,i?a(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot name=\"label-suffix\"></slot> "]))):"",this.required,this.hasButtonGroup?a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n ","\n "])),r):a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div part=\"options-base\" class=\"","\"> ","</div> "])),this.labelInline?"form-control--inline-radio":"",r),l?a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?a(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);}(h));c.styles=d,t([i("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([s()],c.prototype,"hasButtonGroup",void 0),t([s()],c.prototype,"defaultValue",void 0),t([l()],c.prototype,"label",void 0),t([l()],c.prototype,"name",void 0),t([l({reflect:!0})],c.prototype,"value",void 0),t([l({reflect:!0})],c.prototype,"form",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([l({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([l({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"islabelborder",void 0),t([n("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),t([n("value")],c.prototype,"handleValueChange",null),_export("N",c=t([o("nile-radio-group")],c));}};});
2
2
  //# sourceMappingURL=nile-radio-group.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-radio-group.cjs.js","sources":["../../../src/nile-radio-group/nile-radio-group.ts"],"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"],"names":["NileRadioGroup","c","constructor","this","BUBBLES","hasSlotController","HasSlotController","customValidityMessage","hasButtonGroup","defaultValue","label","name","value","form","required","labelInline","disabled","helpText","errorMessage","islabelborder","_this","_inherits","_h","_createClass","key","connectedCallback","super","handleInitialDisabledState","emit","disconnectedCallback","getAllRadios","_toConsumableArray","querySelectorAll","handleRadioClick","event","target","closest","radios","oldValue","forEach","radio","checked","handleDisabledChange","hasAttribute","handleKeyDown","includes","filter","checkedRadio","find","incr","index","indexOf","length","tabIndex","shadowRoot","querySelector","focus","preventDefault","handleLabelClick","radioToFocus","handleSlotChange","some","tagName","toLowerCase","updateCheckedRadio","handleValueChange","hasUpdated","render","hasLabelSlot","test","hasLabelSuffixSlot","hasLabel","hasHelpText","hasErrorMessage","defaultSlot","html","_templateObject","_taggedTemplateLiteral","_templateObject2","classMap","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"0mLA2BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAGcC,EAAAA,KAAAA,CAAOC,SAAU,CAEnBD,CAAAA,KAAAA,CAAiBE,kBAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAAA,CAAa,OACtEH,CAAAA,CAAAA,KAAAA,CAAqBI,sBAAG,EAIfJ,CAAAA,KAAAA,CAAcK,gBAAG,CAEzBL,CAAAA,KAAAA,CAAYM,aAAG,EAMZN,CAAAA,KAAAA,CAAKO,KAAG,CAAA,EAAA,CAGRP,KAAAA,CAAIQ,IAAAA,CAAG,SAGUR,KAAAA,CAAKS,KAAAA,CAAG,GAORT,KAAAA,CAAIU,IAAAA,CAAG,GAGQV,KAAAA,CAAQW,QAAAA,CAAAA,CAAG,CAIXX,CAAAA,KAAAA,CAAWY,WAAG,CAAA,CAAA,CAAA,CAGdZ,KAAAA,CAAQa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CAAS,KAA0B5F,CAAAyF,CAAAA,SAAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAG/BF,EAAA,CAA3CI,CAAAA,CAAS,CAAEE,IAAAA,CAAMC,QAASF,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B5F,CAAAyF,CAAAA,SAAAA,CAAA,oBAAA,EAqClEF,CAAAA,CAAAA,CAAAA,CAAA,CADCS,CAAAA,CAAM,WAAY,CAAEC,oBAAAA,CAAAA,CAAsB,CAK1CjG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,UAAA,sBAAA,CAAA,IAAA,CAAA,CAgGDF,CAAA,CAAA,CADCS,EAAM,OAKNhG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,SAAA,CAAA,mBAAA,CAAA,kBA7LUzF,CAAcuF,CAAAA,CAAAA,CAAA,CAD1BW,CAAAA,CAAc,qBACFlG"}
1
+ {"version":3,"file":"nile-radio-group.cjs.js","sources":["../../../src/nile-radio-group/nile-radio-group.ts"],"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"],"names":["NileRadioGroup","c","constructor","this","hasSlotController","HasSlotController","customValidityMessage","hasButtonGroup","defaultValue","label","name","value","form","required","labelInline","disabled","helpText","errorMessage","islabelborder","_this","_inherits","_h","_createClass","key","connectedCallback","super","handleInitialDisabledState","emit","disconnectedCallback","getAllRadios","_toConsumableArray","querySelectorAll","handleRadioClick","event","target","closest","radios","oldValue","forEach","radio","checked","handleDisabledChange","hasAttribute","handleKeyDown","_e$find","_this4","includes","filter","checkedRadio","find","incr","index","indexOf","length","tabIndex","shadowRoot","querySelector","focus","preventDefault","handleLabelClick","radioToFocus","handleSlotChange","_this5","_this$shadowRoot","some","tagName","toLowerCase","updateCheckedRadio","handleValueChange","hasUpdated","render","hasLabelSlot","test","hasLabelSuffixSlot","hasLabel","hasHelpText","hasErrorMessage","defaultSlot","html","_templateObject","_taggedTemplateLiteral","_templateObject2","classMap","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"0mLA2BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAGYC,EAAAA,KAAAA,CAAiBC,kBAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAAa,CAAA,OAAA,CAAA,CACtEF,KAAAA,CAAqBG,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AA,CAAA,CAApDI,CAAS,CAAA,CAAEI,UAAW,WAAaH,CAAAA,OAAAA,CAAAA,CAAS,CAAsB/F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4F,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEVF,CAAA,CAAA,CAAxDI,EAAS,CAAEI,SAAAA,CAAW,eAAiBH,CAAAA,OAAAA,CAAAA,CAAS,KAA0B/F,CAAA4F,CAAAA,SAAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAG/BF,EAAA,CAA3CI,CAAAA,CAAS,CAAEE,IAAAA,CAAMC,QAASF,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B/F,CAAA4F,CAAAA,SAAAA,CAAA,oBAAA,EAqClEF,CAAAA,CAAAA,CAAAA,CAAA,CADCS,CAAAA,CAAM,WAAY,CAAEC,oBAAAA,CAAAA,CAAsB,CAK1CpG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4F,UAAA,sBAAA,CAAA,IAAA,CAAA,CAgGDF,CAAA,CAAA,CADCS,EAAM,OAKNnG,CAAAA,CAAAA,CAAAA,CAAAA,CAAA4F,SAAA,CAAA,mBAAA,CAAA,kBA3LU5F,CAAc0F,CAAAA,CAAAA,CAAA,CAD1BW,CAAAA,CAAc,qBACFrG"}
@@ -1,4 +1,4 @@
1
- import{__decorate as t}from"tslib";import{classMap as e}from"lit/directives/class-map.js";import{query as i,state as s,property as l,customElement as o}from"lit/decorators.js";import{H as r}from"../internal/slot.esm.js";import{html as a}from"lit";import{w as n}from"../internal/watch.esm.js";import{N as h}from"../internal/nile-element.esm.js";import{s as d}from"./nile-radio-group.css.esm.js";let c=class extends h{constructor(){super(...arguments),this.BUBBLES=!1,this.hasSlotController=new r(this,"help-text","label"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.label="",this.name="option",this.value="",this.form="",this.required=!1,this.labelInline=!1,this.disabled=!1,this.helpText="",this.errorMessage="",this.islabelborder=!1}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value,this.handleInitialDisabledState(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}getAllRadios(){return[...this.querySelectorAll("nile-radio")]}handleRadioClick(t){const e=t.target.closest("nile-radio"),i=this.getAllRadios(),s=this.value;e.disabled||this.disabled||(this.value=e.value,i.forEach((t=>t.checked=t===e)),this.value!==s&&(this.emit("change",{value:this.value}),this.emit("input")))}handleDisabledChange(){this.getAllRadios().forEach((t=>{t.disabled=this.disabled}))}handleInitialDisabledState(){this.getAllRadios().forEach((t=>{t.disabled=t.hasAttribute("disabled")?t.disabled:this.disabled}))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const e=this.getAllRadios().filter((t=>!t.disabled)),i=e.find((t=>t.checked))??e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,l=this.value;let o=e.indexOf(i)+s;o<0&&(o=e.length-1),o>e.length-1&&(o=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=e[o].value,e[o].checked=!0,this.hasButtonGroup?e[o].shadowRoot.querySelector("button").focus():(e[o].tabIndex=0,e[o].focus()),this.value!==l&&(this.emit("change"),this.emit("input")),t.preventDefault()}handleLabelClick(){const t=this.getAllRadios(),e=t.find((t=>t.checked))||t[0];e&&e.focus()}handleSlotChange(){const t=this.getAllRadios();t.forEach((t=>{t.checked=t.value===this.value,this.islabelborder&&(t.islabelborder=!0)}));if(this.hasButtonGroup=t.some((t=>"nile-radio-button"===t.tagName.toLowerCase())),!t.some((t=>t.checked)))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0}else t[0].tabIndex=0;this.hasButtonGroup&&this.shadowRoot?.querySelector("nile-button-group")}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value))}handleValueChange(){this.hasUpdated&&this.updateCheckedRadio()}render(){const t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");const i=this.hasSlotController.test("label-suffix"),s=!!this.label||!!t,l=!!this.helpText,o=!!this.errorMessage,r=a`
1
+ import{__decorate as t}from"tslib";import{classMap as e}from"lit/directives/class-map.js";import{query as i,state as s,property as l,customElement as o}from"lit/decorators.js";import{H as r}from"../internal/slot.esm.js";import{html as a}from"lit";import{w as n}from"../internal/watch.esm.js";import{N as h}from"../internal/nile-element.esm.js";import{s as d}from"./nile-radio-group.css.esm.js";let c=class extends h{constructor(){super(...arguments),this.hasSlotController=new r(this,"help-text","label"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.label="",this.name="option",this.value="",this.form="",this.required=!1,this.labelInline=!1,this.disabled=!1,this.helpText="",this.errorMessage="",this.islabelborder=!1}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value,this.handleInitialDisabledState(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}getAllRadios(){return[...this.querySelectorAll("nile-radio")]}handleRadioClick(t){const e=t.target.closest("nile-radio"),i=this.getAllRadios(),s=this.value;e.disabled||this.disabled||(this.value=e.value,i.forEach((t=>t.checked=t===e)),this.value!==s&&(this.emit("change",{value:this.value}),this.emit("input")))}handleDisabledChange(){this.getAllRadios().forEach((t=>{t.disabled=this.disabled}))}handleInitialDisabledState(){this.getAllRadios().forEach((t=>{t.disabled=t.hasAttribute("disabled")?t.disabled:this.disabled}))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const e=this.getAllRadios().filter((t=>!t.disabled)),i=e.find((t=>t.checked))??e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,l=this.value;let o=e.indexOf(i)+s;o<0&&(o=e.length-1),o>e.length-1&&(o=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=e[o].value,e[o].checked=!0,this.hasButtonGroup?e[o].shadowRoot.querySelector("button").focus():(e[o].tabIndex=0,e[o].focus()),this.value!==l&&(this.emit("change"),this.emit("input")),t.preventDefault()}handleLabelClick(){const t=this.getAllRadios(),e=t.find((t=>t.checked))||t[0];e&&e.focus()}handleSlotChange(){const t=this.getAllRadios();t.forEach((t=>{t.checked=t.value===this.value,this.islabelborder&&(t.islabelborder=!0)}));if(this.hasButtonGroup=t.some((t=>"nile-radio-button"===t.tagName.toLowerCase())),!t.some((t=>t.checked)))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0}else t[0].tabIndex=0;this.hasButtonGroup&&this.shadowRoot?.querySelector("nile-button-group")}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value))}handleValueChange(){this.hasUpdated&&this.updateCheckedRadio()}render(){const t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");const i=this.hasSlotController.test("label-suffix"),s=!!this.label||!!t,l=!!this.helpText,o=!!this.errorMessage,r=a`
2
2
  <slot
3
3
  @click=${this.handleRadioClick}
4
4
  @keydown=${this.handleKeyDown}