@aquera/nile-elements 0.0.119 → 0.0.121

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 (365) hide show
  1. package/README.md +11 -0
  2. package/dist/nile-accordion/nile-accordion.cjs.js +1 -1
  3. package/dist/nile-accordion/nile-accordion.cjs.js.map +1 -1
  4. package/dist/nile-accordion/nile-accordion.esm.js +1 -1
  5. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.esm.js +15 -6
  8. package/dist/nile-avatar/nile-avatar.cjs.js +1 -1
  9. package/dist/nile-avatar/nile-avatar.cjs.js.map +1 -1
  10. package/dist/nile-avatar/nile-avatar.esm.js +1 -1
  11. package/dist/nile-badge/nile-badge.cjs.js +1 -1
  12. package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
  13. package/dist/nile-badge/nile-badge.esm.js +1 -1
  14. package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js +1 -1
  15. package/dist/nile-breadcrumb/nile-breadcrumb.cjs.js.map +1 -1
  16. package/dist/nile-breadcrumb/nile-breadcrumb.esm.js +1 -1
  17. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js +1 -1
  18. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.cjs.js.map +1 -1
  19. package/dist/nile-breadcrumb-item/nile-breadcrumb-item.esm.js +2 -2
  20. package/dist/nile-button/nile-button.cjs.js +1 -1
  21. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  22. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  23. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  24. package/dist/nile-button/nile-button.css.esm.js +24 -28
  25. package/dist/nile-button/nile-button.esm.js +1 -1
  26. package/dist/nile-button-toggle/nile-button-toggle.cjs.js +1 -1
  27. package/dist/nile-button-toggle/nile-button-toggle.cjs.js.map +1 -1
  28. package/dist/nile-button-toggle/nile-button-toggle.esm.js +1 -1
  29. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js +1 -1
  30. package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js.map +1 -1
  31. package/dist/nile-button-toggle-group/nile-button-toggle-group.esm.js +1 -1
  32. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  33. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  34. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  35. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  36. package/dist/nile-calendar/nile-calendar.css.esm.js +4 -1
  37. package/dist/nile-calendar/nile-calendar.esm.js +10 -3
  38. package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
  39. package/dist/nile-calendar/nile-calendar.test.cjs.js.map +1 -1
  40. package/dist/nile-calendar/nile-calendar.test.esm.js +5 -5
  41. package/dist/nile-card/nile-card.cjs.js +1 -1
  42. package/dist/nile-card/nile-card.cjs.js.map +1 -1
  43. package/dist/nile-card/nile-card.esm.js +1 -1
  44. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  45. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  46. package/dist/nile-checkbox/nile-checkbox.esm.js +1 -1
  47. package/dist/nile-chip/nile-chip.cjs.js +1 -1
  48. package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
  49. package/dist/nile-chip/nile-chip.esm.js +6 -2
  50. package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
  51. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  52. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  53. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  54. package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
  55. package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
  56. package/dist/nile-content-editor/nile-content-editor.esm.js +5 -5
  57. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  58. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  59. package/dist/nile-date-picker/nile-date-picker.esm.js +17 -6
  60. package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
  61. package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
  62. package/dist/nile-dialog/nile-dialog.esm.js +1 -1
  63. package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
  64. package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
  65. package/dist/nile-drawer/nile-drawer.esm.js +1 -1
  66. package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
  67. package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
  68. package/dist/nile-empty-state/nile-empty-state.esm.js +1 -1
  69. package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
  70. package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
  71. package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
  72. package/dist/nile-input/nile-input.cjs.js +1 -1
  73. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  74. package/dist/nile-input/nile-input.esm.js +1 -1
  75. package/dist/nile-input/nile-input.test.cjs.js +1 -1
  76. package/dist/nile-input/nile-input.test.cjs.js.map +1 -1
  77. package/dist/nile-input/nile-input.test.esm.js +1 -1
  78. package/dist/nile-link/nile-link.cjs.js +1 -1
  79. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  80. package/dist/nile-link/nile-link.esm.js +1 -1
  81. package/dist/nile-list/nile-list.cjs.js +1 -1
  82. package/dist/nile-list/nile-list.cjs.js.map +1 -1
  83. package/dist/nile-list/nile-list.esm.js +1 -1
  84. package/dist/nile-list-item/nile-list-item.cjs.js +1 -1
  85. package/dist/nile-list-item/nile-list-item.cjs.js.map +1 -1
  86. package/dist/nile-list-item/nile-list-item.esm.js +1 -1
  87. package/dist/nile-menu/nile-menu.cjs.js +1 -1
  88. package/dist/nile-menu/nile-menu.cjs.js.map +1 -1
  89. package/dist/nile-menu/nile-menu.esm.js +5 -2
  90. package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
  91. package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
  92. package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
  93. package/dist/nile-option/nile-option.cjs.js +1 -1
  94. package/dist/nile-option/nile-option.cjs.js.map +1 -1
  95. package/dist/nile-option/nile-option.esm.js +1 -1
  96. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  97. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  98. package/dist/nile-popover/nile-popover.esm.js +2 -2
  99. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  100. package/dist/nile-popup/nile-popup.cjs.js.map +1 -1
  101. package/dist/nile-popup/nile-popup.esm.js +1 -1
  102. package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
  103. package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
  104. package/dist/nile-radio-group/nile-radio-group.esm.js +1 -1
  105. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +2 -0
  106. package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +1 -0
  107. package/dist/nile-radio-group/nile-radio-group.test.esm.js +57 -0
  108. package/dist/nile-select/nile-select.cjs.js +1 -1
  109. package/dist/nile-select/nile-select.cjs.js.map +1 -1
  110. package/dist/nile-select/nile-select.esm.js +6 -4
  111. package/dist/nile-select/nile-select.test.cjs.js +2 -0
  112. package/dist/nile-select/nile-select.test.cjs.js.map +1 -0
  113. package/dist/nile-select/nile-select.test.esm.js +55 -0
  114. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
  115. package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
  116. package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +3 -3
  117. package/dist/nile-split-panel/nile-split-panel.cjs.js +1 -1
  118. package/dist/nile-split-panel/nile-split-panel.cjs.js.map +1 -1
  119. package/dist/nile-split-panel/nile-split-panel.esm.js +1 -1
  120. package/dist/nile-split-panel/nile-split-panel.test.cjs.js +2 -0
  121. package/dist/nile-split-panel/nile-split-panel.test.cjs.js.map +1 -0
  122. package/dist/nile-split-panel/nile-split-panel.test.esm.js +1 -0
  123. package/dist/nile-stepper/nile-stepper.cjs.js +1 -1
  124. package/dist/nile-stepper/nile-stepper.cjs.js.map +1 -1
  125. package/dist/nile-stepper/nile-stepper.esm.js +1 -1
  126. package/dist/nile-stepper/nile-stepper.test.cjs.js +1 -1
  127. package/dist/nile-stepper/nile-stepper.test.cjs.js.map +1 -1
  128. package/dist/nile-stepper/nile-stepper.test.esm.js +1 -1
  129. package/dist/nile-tab/nile-tab.cjs.js +1 -1
  130. package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
  131. package/dist/nile-tab/nile-tab.esm.js +1 -1
  132. package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
  133. package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
  134. package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
  135. package/dist/nile-table-body/nile-table-body.cjs.js +1 -1
  136. package/dist/nile-table-body/nile-table-body.cjs.js.map +1 -1
  137. package/dist/nile-table-body/nile-table-body.esm.js +1 -1
  138. package/dist/nile-tag/nile-tag.cjs.js +1 -1
  139. package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
  140. package/dist/nile-tag/nile-tag.esm.js +1 -1
  141. package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
  142. package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
  143. package/dist/nile-textarea/nile-textarea.esm.js +1 -1
  144. package/dist/nile-textarea/nile-textarea.test.cjs.js.map +1 -1
  145. package/dist/nile-toast/nile-toast.cjs.js +1 -1
  146. package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
  147. package/dist/nile-toast/nile-toast.esm.js +1 -1
  148. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  149. package/dist/nile-tooltip/nile-tooltip.cjs.js.map +1 -1
  150. package/dist/nile-tooltip/nile-tooltip.esm.js +1 -1
  151. package/dist/nile-tree/nile-tree.cjs.js +1 -1
  152. package/dist/nile-tree/nile-tree.cjs.js.map +1 -1
  153. package/dist/nile-tree/nile-tree.esm.js +1 -1
  154. package/dist/nile-tree/nile-tree.test.cjs.js +2 -0
  155. package/dist/nile-tree/nile-tree.test.cjs.js.map +1 -0
  156. package/dist/nile-tree/nile-tree.test.esm.js +1 -0
  157. package/dist/src/nile-accordion/nile-accordion.d.ts +1 -0
  158. package/dist/src/nile-accordion/nile-accordion.js +1 -0
  159. package/dist/src/nile-accordion/nile-accordion.js.map +1 -1
  160. package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +1 -0
  161. package/dist/src/nile-auto-complete/nile-auto-complete.js +12 -2
  162. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  163. package/dist/src/nile-avatar/nile-avatar.d.ts +1 -0
  164. package/dist/src/nile-avatar/nile-avatar.js +1 -0
  165. package/dist/src/nile-avatar/nile-avatar.js.map +1 -1
  166. package/dist/src/nile-badge/nile-badge.d.ts +1 -0
  167. package/dist/src/nile-badge/nile-badge.js +1 -0
  168. package/dist/src/nile-badge/nile-badge.js.map +1 -1
  169. package/dist/src/nile-breadcrumb/nile-breadcrumb.d.ts +1 -0
  170. package/dist/src/nile-breadcrumb/nile-breadcrumb.js +5 -0
  171. package/dist/src/nile-breadcrumb/nile-breadcrumb.js.map +1 -1
  172. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.d.ts +1 -0
  173. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js +1 -0
  174. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.js.map +1 -1
  175. package/dist/src/nile-button/nile-button.css.js +24 -28
  176. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  177. package/dist/src/nile-button/nile-button.d.ts +1 -0
  178. package/dist/src/nile-button/nile-button.js +1 -0
  179. package/dist/src/nile-button/nile-button.js.map +1 -1
  180. package/dist/src/nile-button-toggle/nile-button-toggle.d.ts +1 -0
  181. package/dist/src/nile-button-toggle/nile-button-toggle.js +1 -0
  182. package/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -1
  183. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +1 -0
  184. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +1 -0
  185. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -1
  186. package/dist/src/nile-calendar/nile-calendar.css.js +4 -1
  187. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  188. package/dist/src/nile-calendar/nile-calendar.d.ts +5 -3
  189. package/dist/src/nile-calendar/nile-calendar.js +43 -23
  190. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  191. package/dist/src/nile-calendar/nile-calendar.test.d.ts +6 -0
  192. package/dist/src/nile-calendar/nile-calendar.test.js +6 -0
  193. package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
  194. package/dist/src/nile-card/nile-card.d.ts +1 -0
  195. package/dist/src/nile-card/nile-card.js +1 -0
  196. package/dist/src/nile-card/nile-card.js.map +1 -1
  197. package/dist/src/nile-checkbox/nile-checkbox.d.ts +1 -0
  198. package/dist/src/nile-checkbox/nile-checkbox.js +1 -0
  199. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  200. package/dist/src/nile-chip/nile-chip.d.ts +1 -0
  201. package/dist/src/nile-chip/nile-chip.js +5 -0
  202. package/dist/src/nile-chip/nile-chip.js.map +1 -1
  203. package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
  204. package/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -0
  205. package/dist/src/nile-code-editor/nile-code-editor.js +1 -0
  206. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  207. package/dist/src/nile-content-editor/nile-content-editor.d.ts +1 -0
  208. package/dist/src/nile-content-editor/nile-content-editor.js +1 -0
  209. package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
  210. package/dist/src/nile-date-picker/nile-date-picker.d.ts +3 -0
  211. package/dist/src/nile-date-picker/nile-date-picker.js +24 -5
  212. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  213. package/dist/src/nile-dialog/nile-dialog.d.ts +1 -0
  214. package/dist/src/nile-dialog/nile-dialog.js +1 -0
  215. package/dist/src/nile-dialog/nile-dialog.js.map +1 -1
  216. package/dist/src/nile-drawer/nile-drawer.d.ts +1 -0
  217. package/dist/src/nile-drawer/nile-drawer.js +1 -0
  218. package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
  219. package/dist/src/nile-empty-state/nile-empty-state.d.ts +1 -0
  220. package/dist/src/nile-empty-state/nile-empty-state.js +1 -0
  221. package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
  222. package/dist/src/nile-icon-button/nile-icon-button.d.ts +1 -0
  223. package/dist/src/nile-icon-button/nile-icon-button.js +1 -0
  224. package/dist/src/nile-icon-button/nile-icon-button.js.map +1 -1
  225. package/dist/src/nile-input/nile-input.d.ts +1 -0
  226. package/dist/src/nile-input/nile-input.js +1 -0
  227. package/dist/src/nile-input/nile-input.js.map +1 -1
  228. package/dist/src/nile-input/nile-input.test.js +5 -1
  229. package/dist/src/nile-input/nile-input.test.js.map +1 -1
  230. package/dist/src/nile-link/nile-link.d.ts +1 -0
  231. package/dist/src/nile-link/nile-link.js +1 -0
  232. package/dist/src/nile-link/nile-link.js.map +1 -1
  233. package/dist/src/nile-list/nile-list.d.ts +1 -0
  234. package/dist/src/nile-list/nile-list.js +5 -0
  235. package/dist/src/nile-list/nile-list.js.map +1 -1
  236. package/dist/src/nile-list-item/nile-list-item.d.ts +1 -0
  237. package/dist/src/nile-list-item/nile-list-item.js +1 -0
  238. package/dist/src/nile-list-item/nile-list-item.js.map +1 -1
  239. package/dist/src/nile-menu/nile-menu.d.ts +1 -0
  240. package/dist/src/nile-menu/nile-menu.js +4 -0
  241. package/dist/src/nile-menu/nile-menu.js.map +1 -1
  242. package/dist/src/nile-menu-item/nile-menu-item.d.ts +2 -0
  243. package/dist/src/nile-menu-item/nile-menu-item.js +2 -0
  244. package/dist/src/nile-menu-item/nile-menu-item.js.map +1 -1
  245. package/dist/src/nile-option/nile-option.d.ts +2 -0
  246. package/dist/src/nile-option/nile-option.js +2 -0
  247. package/dist/src/nile-option/nile-option.js.map +1 -1
  248. package/dist/src/nile-popover/nile-popover.d.ts +2 -0
  249. package/dist/src/nile-popover/nile-popover.js +6 -1
  250. package/dist/src/nile-popover/nile-popover.js.map +1 -1
  251. package/dist/src/nile-popup/nile-popup.d.ts +2 -0
  252. package/dist/src/nile-popup/nile-popup.js +2 -0
  253. package/dist/src/nile-popup/nile-popup.js.map +1 -1
  254. package/dist/src/nile-radio-group/nile-radio-group.d.ts +1 -0
  255. package/dist/src/nile-radio-group/nile-radio-group.js +1 -0
  256. package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
  257. package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +2 -0
  258. package/dist/src/nile-radio-group/nile-radio-group.test.js +174 -0
  259. package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -0
  260. package/dist/src/nile-select/nile-select.d.ts +1 -0
  261. package/dist/src/nile-select/nile-select.js +6 -37
  262. package/dist/src/nile-select/nile-select.js.map +1 -1
  263. package/dist/src/nile-select/nile-select.test.d.ts +6 -0
  264. package/dist/src/nile-select/nile-select.test.js +247 -0
  265. package/dist/src/nile-select/nile-select.test.js.map +1 -0
  266. package/dist/src/nile-slide-toggle/nile-slide-toggle.d.ts +1 -0
  267. package/dist/src/nile-slide-toggle/nile-slide-toggle.js +3 -2
  268. package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
  269. package/dist/src/nile-split-panel/nile-split-panel.d.ts +1 -0
  270. package/dist/src/nile-split-panel/nile-split-panel.js +1 -0
  271. package/dist/src/nile-split-panel/nile-split-panel.js.map +1 -1
  272. package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
  273. package/dist/src/nile-split-panel/nile-split-panel.test.js +4 -0
  274. package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
  275. package/dist/src/nile-stepper/nile-stepper.d.ts +1 -0
  276. package/dist/src/nile-stepper/nile-stepper.js +1 -0
  277. package/dist/src/nile-stepper/nile-stepper.js.map +1 -1
  278. package/dist/src/nile-stepper/nile-stepper.test.d.ts +4 -0
  279. package/dist/src/nile-stepper/nile-stepper.test.js +6 -164
  280. package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -1
  281. package/dist/src/nile-tab/nile-tab.d.ts +1 -0
  282. package/dist/src/nile-tab/nile-tab.js +1 -0
  283. package/dist/src/nile-tab/nile-tab.js.map +1 -1
  284. package/dist/src/nile-tab-group/nile-tab-group.d.ts +1 -0
  285. package/dist/src/nile-tab-group/nile-tab-group.js +1 -0
  286. package/dist/src/nile-tab-group/nile-tab-group.js.map +1 -1
  287. package/dist/src/nile-table-body/nile-table-body.d.ts +1 -0
  288. package/dist/src/nile-table-body/nile-table-body.js +1 -0
  289. package/dist/src/nile-table-body/nile-table-body.js.map +1 -1
  290. package/dist/src/nile-tag/nile-tag.d.ts +1 -0
  291. package/dist/src/nile-tag/nile-tag.js +1 -0
  292. package/dist/src/nile-tag/nile-tag.js.map +1 -1
  293. package/dist/src/nile-textarea/nile-textarea.d.ts +1 -0
  294. package/dist/src/nile-textarea/nile-textarea.js +1 -0
  295. package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
  296. package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
  297. package/dist/src/nile-toast/nile-toast.d.ts +1 -0
  298. package/dist/src/nile-toast/nile-toast.js +1 -0
  299. package/dist/src/nile-toast/nile-toast.js.map +1 -1
  300. package/dist/src/nile-tooltip/nile-tooltip.d.ts +1 -0
  301. package/dist/src/nile-tooltip/nile-tooltip.js +1 -0
  302. package/dist/src/nile-tooltip/nile-tooltip.js.map +1 -1
  303. package/dist/src/nile-tree/nile-tree.d.ts +1 -0
  304. package/dist/src/nile-tree/nile-tree.js +1 -0
  305. package/dist/src/nile-tree/nile-tree.js.map +1 -1
  306. package/dist/src/nile-tree/nile-tree.test.d.ts +2 -0
  307. package/dist/src/nile-tree/nile-tree.test.js +5 -0
  308. package/dist/src/nile-tree/nile-tree.test.js.map +1 -0
  309. package/dist/tsconfig.tsbuildinfo +1 -1
  310. package/package.json +1 -1
  311. package/rollup.config.js +1 -0
  312. package/src/nile-accordion/nile-accordion.ts +1 -0
  313. package/src/nile-auto-complete/nile-auto-complete.ts +13 -2
  314. package/src/nile-avatar/nile-avatar.ts +2 -0
  315. package/src/nile-badge/nile-badge.ts +2 -0
  316. package/src/nile-breadcrumb/nile-breadcrumb.ts +2 -0
  317. package/src/nile-breadcrumb-item/nile-breadcrumb-item.ts +2 -0
  318. package/src/nile-button/nile-button.css.ts +24 -28
  319. package/src/nile-button/nile-button.ts +2 -0
  320. package/src/nile-button-toggle/nile-button-toggle.ts +2 -0
  321. package/src/nile-button-toggle-group/nile-button-toggle-group.ts +2 -0
  322. package/src/nile-calendar/nile-calendar.css.ts +4 -1
  323. package/src/nile-calendar/nile-calendar.test.ts +7 -0
  324. package/src/nile-calendar/nile-calendar.ts +43 -26
  325. package/src/nile-card/nile-card.ts +2 -0
  326. package/src/nile-checkbox/nile-checkbox.ts +2 -0
  327. package/src/nile-chip/nile-chip.test.ts +0 -1
  328. package/src/nile-chip/nile-chip.ts +6 -0
  329. package/src/nile-code-editor/nile-code-editor.ts +2 -0
  330. package/src/nile-content-editor/nile-content-editor.ts +2 -0
  331. package/src/nile-date-picker/nile-date-picker.ts +21 -5
  332. package/src/nile-dialog/nile-dialog.ts +2 -0
  333. package/src/nile-drawer/nile-drawer.ts +2 -0
  334. package/src/nile-empty-state/nile-empty-state.ts +2 -0
  335. package/src/nile-icon-button/nile-icon-button.ts +2 -0
  336. package/src/nile-input/nile-input.test.ts +7 -1
  337. package/src/nile-input/nile-input.ts +2 -0
  338. package/src/nile-link/nile-link.ts +2 -0
  339. package/src/nile-list/nile-list.ts +2 -0
  340. package/src/nile-list-item/nile-list-item.ts +2 -0
  341. package/src/nile-menu/nile-menu.ts +6 -0
  342. package/src/nile-menu-item/nile-menu-item.ts +3 -0
  343. package/src/nile-option/nile-option.ts +3 -0
  344. package/src/nile-popover/nile-popover.ts +5 -1
  345. package/src/nile-popup/nile-popup.ts +3 -0
  346. package/src/nile-radio-group/nile-radio-group.test.ts +215 -0
  347. package/src/nile-radio-group/nile-radio-group.ts +2 -0
  348. package/src/nile-select/nile-select.test.ts +309 -0
  349. package/src/nile-select/nile-select.ts +7 -38
  350. package/src/nile-slide-toggle/nile-slide-toggle.ts +4 -2
  351. package/src/nile-split-panel/nile-split-panel.test.ts +7 -0
  352. package/src/nile-split-panel/nile-split-panel.ts +2 -0
  353. package/src/nile-stepper/nile-stepper.test.ts +12 -174
  354. package/src/nile-stepper/nile-stepper.ts +2 -0
  355. package/src/nile-tab/nile-tab.ts +2 -0
  356. package/src/nile-tab-group/nile-tab-group.ts +2 -0
  357. package/src/nile-table-body/nile-table-body.ts +2 -0
  358. package/src/nile-tag/nile-tag.ts +2 -0
  359. package/src/nile-textarea/nile-textarea.test.ts +1 -1
  360. package/src/nile-textarea/nile-textarea.ts +2 -0
  361. package/src/nile-toast/nile-toast.ts +2 -0
  362. package/src/nile-tooltip/nile-tooltip.ts +2 -0
  363. package/src/nile-tree/nile-tree.test.ts +9 -0
  364. package/src/nile-tree/nile-tree.ts +2 -0
  365. package/web-test-runner.config.mjs +6 -1
@@ -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.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.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`
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.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.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));}};});
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 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,qBAAAA,CAAG,EAIfH,CAAAA,KAAAA,CAAcI,gBAAG,CAEzBJ,CAAAA,KAAAA,CAAYK,aAAG,EAMZL,CAAAA,KAAAA,CAAKM,MAAG,EAGRN,CAAAA,KAAAA,CAAIO,IAAG,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AA,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
+ {"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,C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4B5F,EAAAyF,SAAA,CAAA,aAAA,CAAA,IAAA,EAGpBF,CAAAA,CAAAA,CAAAA,CAAA,CAA3CI,CAAS,CAAA,CAAEE,IAAMC,CAAAA,OAAAA,CAASF,SAAS,CAAyB5F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,SAAA,CAAA,UAAA,CAAA,IAAA,IAERF,CAAA,CAAA,CAApDI,CAAS,CAAA,CAAEI,UAAW,WAAaH,CAAAA,OAAAA,CAAAA,CAAS,CAAsB5F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,UAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CAEVF,CAAA,CAAA,CAAxDI,EAAS,CAAEI,SAAAA,CAAW,eAAiBH,CAAAA,OAAAA,CAAAA,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,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.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.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`
2
2
  <slot
3
3
  @click=${this.handleRadioClick}
4
4
  @keydown=${this.handleKeyDown}
@@ -0,0 +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(["../fixture-1a9fb5f1.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-radio-group.cjs.js","../nile-radio/nile-radio.cjs.js","tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-group.css.cjs.js","../index-c7ad3b47.cjs.js","../nile-radio/nile-radio.css.cjs.js","../property-217fe924.cjs.js"],function(_export,_context){"use strict";var e,i,a,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}return{setters:[function(_fixture004CjsJs){e=_fixture004CjsJs.f;i=_fixture004CjsJs.a;},function(_litStaticHtmlJs){a=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileRadioGroupCjsJs){},function(_nileRadioNileRadioCjsJs){},function(_tslib){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalSlotCjsJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){},function(_nileRadioGroupCssCjsJs){},function(_index001CjsJs){},function(_nileRadioNileRadioCssCjsJs){},function(_property002CjsJs){}],execute:function execute(){describe("nile-radio-group",function(){it("should render the radio group with radios",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var o,l;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return e(a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context2.sent;l=o.querySelectorAll("nile-radio");i(l.length).to.equal(3),i(o.label).to.equal("Select an option");case 5:case"end":return _context2.stop();}},_callee);}))),it("should select the correct radio based on value",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var o;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return e(a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context3.sent.querySelector('nile-radio[value="2"]');i(o===null||o===void 0?void 0:o.checked).to.be["true"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should emit change event when radio selection changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var o,l,n;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return e(a(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context4.sent;l=!1;o.addEventListener("change",function(){l=!0;});n=o.querySelector('nile-radio[value="2"]');n!==null&&n!==void 0&&n.click();_context4.next=9;return o.updateComplete;case 9:i(l).to.be["true"];i(o.value).to.equal("2");case 11:case"end":return _context4.stop();}},_callee3);}))),it("should handle disabled radios correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var o,l,n;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return e(a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled islabelborder>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\" disabled>Radio 3</nile-radio>\n <nile-radio name=\"test\" value=\"4\">Radio 4</nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context5.sent;l=o.querySelectorAll("nile-radio[disabled]");i(l.length).to.equal(2);n=o.querySelector('nile-radio[value="1"]');n!==null&&n!==void 0&&n.click();_context5.next=9;return o.updateComplete;case 9:i(o.value).to.equal("1");case 10:case"end":return _context5.stop();}},_callee4);}))),it("should not allow selection of disabled radio",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var o,l;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return e(a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\">Radio 3</nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context6.sent;l=o.querySelector('nile-radio[value="2"]');l!==null&&l!==void 0&&l.click();_context6.next=7;return o.updateComplete;case 7:i(o.value).to.equal("");case 8:case"end":return _context6.stop();}},_callee5);}))),it("should correctly handle the islabelborder property",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return e(a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Border Option\" name=\"options\" islabelborder>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:_context7.sent.querySelectorAll("nile-radio").forEach(function(e){i(e.islabelborder).to.be["true"];});case 3:case"end":return _context7.stop();}},_callee6);}))),it("should focus the first radio when the label is clicked",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _o$shadowRoot;var o,l,n;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return e(a(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Focus Test\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context8.sent;l=(_o$shadowRoot=o.shadowRoot)===null||_o$shadowRoot===void 0?void 0:_o$shadowRoot.querySelector("label");l!==null&&l!==void 0&&l.click();_context8.next=7;return o.updateComplete;case 7:n=o.querySelector('nile-radio[value="1"]');i(document.activeElement).to.equal(n);case 9:case"end":return _context8.stop();}},_callee7);}))),it("should set required attribute correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var _o$shadowRoot2;var o,l;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return e(a(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Required Test\" name=\"options\" required>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context9.sent;l=(_o$shadowRoot2=o.shadowRoot)===null||_o$shadowRoot2===void 0?void 0:_o$shadowRoot2.querySelector(".radio-group__validation-input");i(l===null||l===void 0?void 0:l.required).to.be["true"];case 5:case"end":return _context9.stop();}},_callee8);}))),it("should reflect the current value property correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var o,l;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return e(a(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n <nile-radio-group label=\"Reflect Test\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n "]))));case 2:o=_context10.sent;i(o.value).to.equal("1");o.value="2";_context10.next=7;return o.updateComplete;case 7:i(o.value).to.equal("2");l=o.querySelector('nile-radio[value="2"]');i(l===null||l===void 0?void 0:l.checked).to.be["true"];case 10:case"end":return _context10.stop();}},_callee9);}))),it("should toggle selection with arrow keys",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var _o$shadowRoot3;var o,l,n,t,r,d,s,u,c;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return e(a(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n\t\t\t<nile-radio-group label=\"Arrow Key Navigation\" name=\"options\">\n\t\t\t\t<nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n\t\t\t</nile-radio-group>\n\t\t"]))));case 2:o=_context11.sent;l=(_o$shadowRoot3=o.shadowRoot)===null||_o$shadowRoot3===void 0?void 0:_o$shadowRoot3.querySelector("fieldset > div > div:nth-child(2) > slot");n=o.querySelector('nile-radio[value="1"]');n!==null&&n!==void 0&&n.click();_context11.next=8;return o.updateComplete;case 8:t=new KeyboardEvent("keydown",{key:"ArrowRight"});l!==null&&l!==void 0&&l.dispatchEvent(t);_context11.next=12;return o.updateComplete;case 12:r=o.querySelector('nile-radio[value="2"]');i(r===null||r===void 0?void 0:r.checked).to.be["true"];l!==null&&l!==void 0&&l.dispatchEvent(t);_context11.next=17;return o.updateComplete;case 17:d=o.querySelector('nile-radio[value="3"]');i(d===null||d===void 0?void 0:d.checked).to.be["true"];s=new KeyboardEvent("keydown",{key:"ArrowLeft"});l!==null&&l!==void 0&&l.dispatchEvent(s);_context11.next=23;return o.updateComplete;case 23:i(r===null||r===void 0?void 0:r.checked).to.be["true"];l!==null&&l!==void 0&&l.dispatchEvent(s);_context11.next=27;return o.updateComplete;case 27:i(n===null||n===void 0?void 0:n.checked).to.be["true"];u=new KeyboardEvent("keydown",{key:"ArrowDown"});l!==null&&l!==void 0&&l.dispatchEvent(u);_context11.next=32;return o.updateComplete;case 32:i(r===null||r===void 0?void 0:r.checked).to.be["true"];c=new KeyboardEvent("keydown",{key:"ArrowUp"});l!==null&&l!==void 0&&l.dispatchEvent(c);_context11.next=37;return o.updateComplete;case 37:i(n===null||n===void 0?void 0:n.checked).to.be["true"];case 38:case"end":return _context11.stop();}},_callee10);})));});}};});
2
+ //# sourceMappingURL=nile-radio-group.test.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nile-radio-group.test.cjs.js","sources":["../../../src/nile-radio-group/nile-radio-group.test.ts"],"sourcesContent":["import { html, fixture, expect } from '@open-wc/testing';\nimport './nile-radio-group';\nimport NileRadioGroup from './nile-radio-group';\nimport NileRadio from '../nile-radio/nile-radio';\nimport'../nile-radio/nile-radio';\n\ndescribe('nile-radio-group', () => {\n it('should render the radio group with radios', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n `);\n\n const radios = element.querySelectorAll('nile-radio');\n expect(radios.length).to.equal(3);\n expect(element.label).to.equal('Select an option');\n });\n\n it('should select the correct radio based on value', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"2\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n <nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n </nile-radio-group>\n `);\n\n const selectedRadio = element.querySelector<NileRadio>('nile-radio[value=\"2\"]');\n expect(selectedRadio?.checked).to.be.true;\n });\n\n it('should emit change event when radio selection changes', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Select an option\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n <nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n </nile-radio-group>\n `);\n\n let changeEventFired = false;\n element.addEventListener('change', () => {\n changeEventFired = true;\n });\n\n const secondRadio = element.querySelector<NileRadio>('nile-radio[value=\"2\"]');\n secondRadio?.click(); // Simulate user clicking the second radio\n await element.updateComplete;\n\n expect(changeEventFired).to.be.true;\n expect(element.value).to.equal('2');\n });\n\n it('should handle disabled radios correctly', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled islabelborder>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\" disabled>Radio 3</nile-radio>\n <nile-radio name=\"test\" value=\"4\">Radio 4</nile-radio>\n </nile-radio-group>\n `);\n\n const disabledRadios = element.querySelectorAll('nile-radio[disabled]');\n expect(disabledRadios.length).to.equal(2);\n\n const enabledRadio = element.querySelector<NileRadio>('nile-radio[value=\"1\"]');\n enabledRadio?.click(); // Simulate clicking the enabled radio\n await element.updateComplete;\n\n expect(element.value).to.equal('1'); // Should select the enabled radio\n });\n\n it('should not allow selection of disabled radio', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Disabled Option\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\" disabled>Radio 2</nile-radio>\n <nile-radio name=\"test\" value=\"3\">Radio 3</nile-radio>\n </nile-radio-group>\n `);\n\n const disabledRadio = element.querySelector<NileRadio>('nile-radio[value=\"2\"]');\n disabledRadio?.click(); // Attempt to click the disabled radio\n await element.updateComplete;\n\n expect(element.value).to.equal(''); // Should not change selection\n });\n\n it('should correctly handle the islabelborder property', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Border Option\" name=\"options\" islabelborder>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n `);\n\n const radios = element.querySelectorAll('nile-radio');\n radios.forEach(radio => {\n expect(radio.islabelborder).to.be.true; // Ensure islabelborder is set\n });\n });\n\n it('should focus the first radio when the label is clicked', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Focus Test\" name=\"options\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n `);\n\n const label = element.shadowRoot?.querySelector<HTMLElement>('label');\n label?.click(); // Simulate clicking the label\n await element.updateComplete;\n\n const firstRadio = element.querySelector('nile-radio[value=\"1\"]');\n expect(document.activeElement).to.equal(firstRadio); // Should focus the first radio\n });\n\n it('should set required attribute correctly', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Required Test\" name=\"options\" required>\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n `);\n\n const validationInput = element.shadowRoot?.querySelector<HTMLInputElement>('.radio-group__validation-input');\n expect(validationInput?.required).to.be.true; // Should be marked as required\n });\n\n it('should reflect the current value property correctly', async () => {\n const element = await fixture<NileRadioGroup>(html`\n <nile-radio-group label=\"Reflect Test\" name=\"options\" value=\"1\">\n <nile-radio name=\"test\" value=\"1\"> Radio 1 </nile-radio>\n <nile-radio name=\"test\" value=\"2\"> Radio 2 </nile-radio>\n </nile-radio-group>\n `);\n\n expect(element.value).to.equal('1'); // Check initial value\n element.value = '2'; // Change value\n await element.updateComplete;\n\n expect(element.value).to.equal('2'); // Ensure value reflects the change\n const selectedRadio = element.querySelector<NileRadio>('nile-radio[value=\"2\"]');\n expect(selectedRadio?.checked).to.be.true; // Check if the correct radio is selected\n });\n\n\tit('should toggle selection with arrow keys', async () => {\n\t\tconst element = await fixture<NileRadioGroup>(html`\n\t\t\t<nile-radio-group label=\"Arrow Key Navigation\" name=\"options\">\n\t\t\t\t<nile-radio name=\"test\" value=\"1\" label=\"Radio 1\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"2\" label=\"Radio 2\"></nile-radio>\n\t\t\t\t<nile-radio name=\"test\" value=\"3\" label=\"Radio 3\"></nile-radio>\n\t\t\t</nile-radio-group>\n\t\t`);\n\t\tconst slot=element.shadowRoot?.querySelector(\"fieldset > div > div:nth-child(2) > slot\")\n\t\n\t\t// Start by selecting the first radio button\n\t\tconst firstRadio = element.querySelector<NileRadio>('nile-radio[value=\"1\"]');\n\t\tfirstRadio?.click();\n\t\tawait element.updateComplete;\n\t\n\t\t// Simulate Arrow Right key press\n\t\tconst rightEvent = new KeyboardEvent('keydown', { key: 'ArrowRight' });\n\t\tslot?.dispatchEvent(rightEvent);\n\t\tawait element.updateComplete;\n\t\n\t\t// Check if the second radio is selected\n\t\tconst secondRadio = element.querySelector<NileRadio>('nile-radio[value=\"2\"]');\n\t\texpect(secondRadio?.checked).to.be.true;\n\t\n\t\t// Simulate Arrow Right key press again\n\t\tslot?.dispatchEvent(rightEvent);\n\t\tawait element.updateComplete;\n\t\n\t\t// Check if the third radio is selected\n\t\tconst thirdRadio = element.querySelector<NileRadio>('nile-radio[value=\"3\"]');\n\t\texpect(thirdRadio?.checked).to.be.true;\n\t\n\t\t// Simulate Arrow Left key press\n\t\tconst leftEvent = new KeyboardEvent('keydown', { key: 'ArrowLeft' });\n\t\tslot?.dispatchEvent(leftEvent);\n\t\tawait element.updateComplete;\n\t\n\t\t// Check if the second radio is selected again\n\t\texpect(secondRadio?.checked).to.be.true;\n\t\n\t\t// Simulate Arrow Left key press again\n\t\tslot?.dispatchEvent(leftEvent);\n\t\tawait element.updateComplete;\n\t\n\t\t// Check if the first radio is selected again\n\t\texpect(firstRadio?.checked).to.be.true;\n\t\n\t\t// Simulate Arrow Down key press (assuming vertical layout)\n\t\tconst downEvent = new KeyboardEvent('keydown', { key: 'ArrowDown' });\n\t\tslot?.dispatchEvent(downEvent);\n\t\tawait element.updateComplete;\n\t\n\t\t// Check if the second radio is selected again (depending on your layout)\n\t\texpect(secondRadio?.checked).to.be.true;\n\t\n\t\t// Simulate Arrow Up key press (assuming vertical layout)\n\t\tconst upEvent = new KeyboardEvent('keydown', { key: 'ArrowUp' });\n\t\tslot?.dispatchEvent(upEvent);\n\t\tawait element.updateComplete;\n\t\n\t\t// Check if the first radio is selected again\n\t\texpect(firstRadio?.checked).to.be.true;\n\t});\n\t\n});\n"],"names":["describe","it","async","fixture","html","_templateObject","_taggedTemplateLiteral","element","radios","querySelectorAll","expect","length","to","equal","label","_context2","stop","_callee","_templateObject2","querySelector","selectedRadio","checked","be","true","_context3","_callee2","_templateObject3","changeEventFired","addEventListener","secondRadio","click","updateComplete","value","_context4","_callee3","_templateObject4","disabledRadios","enabledRadio","_context5","_callee4","_templateObject5","disabledRadio","_context6","_callee5","_templateObject6","forEach","radio","islabelborder","_context7","_callee6","_asyncToGenerator","_regeneratorRuntime","mark","_templateObject7","shadowRoot","firstRadio","document","activeElement","_context8","_callee7","_templateObject8","validationInput","required","_context9","_callee8","_templateObject9","_context10","_callee9","_templateObject10","slot","rightEvent","KeyboardEvent","key","dispatchEvent","thirdRadio","leftEvent","downEvent","upEvent","_context11","_callee10"],"mappings":"i7TAMAA,QAAS,CAAA,kBAAA,CAAoB,UAC3BC,CAAAA,EAAAA,CAAG,2CAA6CC,cAAAA,iBAAAA,cAAAA,mBAAAA,GAAAA,IAAAA,CAAAA,SAAAA,QAAAA,MAAAA,CAAAA,CAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,SAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SACxBC,CAAAA,EAAwBC,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,iXAA5CC,CAAAA,CAAAA,SAAAA,CAAAA,IAAAA,CAQAC,CAASD,CAAAA,CAAAA,CAAQE,iBAAiB,YACxCC,CAAAA,CAAAA,CAAAA,CAAOF,EAAOG,MAAQC,CAAAA,CAAAA,EAAAA,CAAGC,KAAM,CAAA,CAAA,CAAA,CAC/BH,CAAOH,CAAAA,CAAAA,CAAQO,OAAOF,EAAGC,CAAAA,KAAAA,CAAM,mBAAmB,yBAAAE,SAAA,CAAAC,IAAA,MAAAC,OAAA,GAGpDhB,EAAAA,CAAAA,CAAAA,EAAAA,CAAG,wHAAkDC,SAAAA,SAAAA,MAAAA,CAAAA,QAAAA,mBAAAA,GAAAA,IAAAA,UAAAA,UAAAA,SAAAA,iBAAAA,SAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAAAA,IAAAA,SAAAA,SAAAA,CAAAA,IAAAA,SAC7BC,CAAAA,CAAAA,C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,CAAAA,WAAAA,CAAAA,CAAMI,aAAcI,CAAAA,CAAAA,CAAAA,CAAAA,UAAAA,CAAAA,IAAAA,UACdtE,CAAAA,CAAQwB,CAAAA,cAAAA,SAGdrB,CAAO6C,CAAAA,CAAAA,SAAAA,CAAAA,iBAAAA,CAAAA,CAAYlC,OAAST,CAAAA,CAAAA,EAAAA,CAAGU,EAAGC,QAAI,0BAAAuD,UAAA,CAAA9D,IAAA,MAAA+D,SAAA,GACrC,EAAA,CAAA,EAAA,CAAA,CAAA"}
@@ -0,0 +1,57 @@
1
+ import{f as e,a as i}from"../fixture-81e5a936.esm.js";import{html as a}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-radio-group.esm.js";import"../nile-radio/nile-radio.esm.js";import"tslib";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/slot.esm.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";import"./nile-radio-group.css.esm.js";import"../index-0a3007c5.esm.js";import"../nile-radio/nile-radio.css.esm.js";import"../property-09139d3c.esm.js";describe("nile-radio-group",(()=>{it("should render the radio group with radios",(async()=>{const o=await e(a`
2
+ <nile-radio-group label="Select an option" name="options" value="2">
3
+ <nile-radio name="test" value="1" label="Radio 1"></nile-radio>
4
+ <nile-radio name="test" value="2" label="Radio 2"></nile-radio>
5
+ <nile-radio name="test" value="3" label="Radio 3"></nile-radio>
6
+ </nile-radio-group>
7
+ `),l=o.querySelectorAll("nile-radio");i(l.length).to.equal(3),i(o.label).to.equal("Select an option")})),it("should select the correct radio based on value",(async()=>{const o=(await e(a`
8
+ <nile-radio-group label="Select an option" name="options" value="2">
9
+ <nile-radio name="test" value="1" label="Radio 1"></nile-radio>
10
+ <nile-radio name="test" value="2" label="Radio 2"></nile-radio>
11
+ <nile-radio name="test" value="3" label="Radio 3"></nile-radio>
12
+ </nile-radio-group>
13
+ `)).querySelector('nile-radio[value="2"]');i(o?.checked).to.be.true})),it("should emit change event when radio selection changes",(async()=>{const o=await e(a`
14
+ <nile-radio-group label="Select an option" name="options" value="1">
15
+ <nile-radio name="test" value="1" label="Radio 1"></nile-radio>
16
+ <nile-radio name="test" value="2" label="Radio 2"></nile-radio>
17
+ </nile-radio-group>
18
+ `);let l=!1;o.addEventListener("change",(()=>{l=!0}));const n=o.querySelector('nile-radio[value="2"]');n?.click(),await o.updateComplete,i(l).to.be.true,i(o.value).to.equal("2")})),it("should handle disabled radios correctly",(async()=>{const o=await e(a`
19
+ <nile-radio-group label="Disabled Option" name="options">
20
+ <nile-radio name="test" value="1"> Radio 1 </nile-radio>
21
+ <nile-radio name="test" value="2" disabled islabelborder>Radio 2</nile-radio>
22
+ <nile-radio name="test" value="3" disabled>Radio 3</nile-radio>
23
+ <nile-radio name="test" value="4">Radio 4</nile-radio>
24
+ </nile-radio-group>
25
+ `),l=o.querySelectorAll("nile-radio[disabled]");i(l.length).to.equal(2);const n=o.querySelector('nile-radio[value="1"]');n?.click(),await o.updateComplete,i(o.value).to.equal("1")})),it("should not allow selection of disabled radio",(async()=>{const o=await e(a`
26
+ <nile-radio-group label="Disabled Option" name="options">
27
+ <nile-radio name="test" value="1"> Radio 1 </nile-radio>
28
+ <nile-radio name="test" value="2" disabled>Radio 2</nile-radio>
29
+ <nile-radio name="test" value="3">Radio 3</nile-radio>
30
+ </nile-radio-group>
31
+ `),l=o.querySelector('nile-radio[value="2"]');l?.click(),await o.updateComplete,i(o.value).to.equal("")})),it("should correctly handle the islabelborder property",(async()=>{(await e(a`
32
+ <nile-radio-group label="Border Option" name="options" islabelborder>
33
+ <nile-radio name="test" value="1"> Radio 1 </nile-radio>
34
+ <nile-radio name="test" value="2"> Radio 2 </nile-radio>
35
+ </nile-radio-group>
36
+ `)).querySelectorAll("nile-radio").forEach((e=>{i(e.islabelborder).to.be.true}))})),it("should focus the first radio when the label is clicked",(async()=>{const o=await e(a`
37
+ <nile-radio-group label="Focus Test" name="options">
38
+ <nile-radio name="test" value="1"> Radio 1 </nile-radio>
39
+ <nile-radio name="test" value="2"> Radio 2 </nile-radio>
40
+ </nile-radio-group>
41
+ `),l=o.shadowRoot?.querySelector("label");l?.click(),await o.updateComplete;const n=o.querySelector('nile-radio[value="1"]');i(document.activeElement).to.equal(n)})),it("should set required attribute correctly",(async()=>{const o=await e(a`
42
+ <nile-radio-group label="Required Test" name="options" required>
43
+ <nile-radio name="test" value="1"> Radio 1 </nile-radio>
44
+ <nile-radio name="test" value="2"> Radio 2 </nile-radio>
45
+ </nile-radio-group>
46
+ `),l=o.shadowRoot?.querySelector(".radio-group__validation-input");i(l?.required).to.be.true})),it("should reflect the current value property correctly",(async()=>{const o=await e(a`
47
+ <nile-radio-group label="Reflect Test" name="options" value="1">
48
+ <nile-radio name="test" value="1"> Radio 1 </nile-radio>
49
+ <nile-radio name="test" value="2"> Radio 2 </nile-radio>
50
+ </nile-radio-group>
51
+ `);i(o.value).to.equal("1"),o.value="2",await o.updateComplete,i(o.value).to.equal("2");const l=o.querySelector('nile-radio[value="2"]');i(l?.checked).to.be.true})),it("should toggle selection with arrow keys",(async()=>{const o=await e(a`
52
+ <nile-radio-group label="Arrow Key Navigation" name="options">
53
+ <nile-radio name="test" value="1" label="Radio 1"></nile-radio>
54
+ <nile-radio name="test" value="2" label="Radio 2"></nile-radio>
55
+ <nile-radio name="test" value="3" label="Radio 3"></nile-radio>
56
+ </nile-radio-group>
57
+ `),l=o.shadowRoot?.querySelector("fieldset > div > div:nth-child(2) > slot"),n=o.querySelector('nile-radio[value="1"]');n?.click(),await o.updateComplete;const t=new KeyboardEvent("keydown",{key:"ArrowRight"});l?.dispatchEvent(t),await o.updateComplete;const r=o.querySelector('nile-radio[value="2"]');i(r?.checked).to.be.true,l?.dispatchEvent(t),await o.updateComplete;const d=o.querySelector('nile-radio[value="3"]');i(d?.checked).to.be.true;const s=new KeyboardEvent("keydown",{key:"ArrowLeft"});l?.dispatchEvent(s),await o.updateComplete,i(r?.checked).to.be.true,l?.dispatchEvent(s),await o.updateComplete,i(n?.checked).to.be.true;const u=new KeyboardEvent("keydown",{key:"ArrowDown"});l?.dispatchEvent(u),await o.updateComplete,i(r?.checked).to.be.true;const m=new KeyboardEvent("keydown",{key:"ArrowUp"});l?.dispatchEvent(m),await o.updateComplete,i(n?.checked).to.be.true}))}));