@xplortech/apollo-core 2.8.1 → 2.10.0

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 (310) hide show
  1. package/.typings/apollo-components.html-data.json +20 -12
  2. package/build/style.css +2086 -1875
  3. package/dist/apollo-core/apollo-core.css +20 -18
  4. package/dist/apollo-core/apollo-core.esm.js +1 -1
  5. package/dist/apollo-core/p-0e45f332.entry.js +1 -0
  6. package/dist/apollo-core/p-0f251f98.entry.js +1 -0
  7. package/dist/apollo-core/p-1691c4f3.entry.js +1 -0
  8. package/dist/apollo-core/p-172ac720.entry.js +1 -0
  9. package/dist/apollo-core/p-23870463.entry.js +1 -0
  10. package/dist/apollo-core/{p-36ba29da.entry.js → p-3b8639b7.entry.js} +1 -1
  11. package/dist/apollo-core/p-44a16751.entry.js +1 -0
  12. package/dist/apollo-core/p-4efecab2.entry.js +1 -0
  13. package/dist/apollo-core/p-5094dd97.entry.js +1 -0
  14. package/dist/apollo-core/p-70e7facc.entry.js +1 -0
  15. package/dist/apollo-core/{p-6a15f1e0.entry.js → p-728341d2.entry.js} +1 -1
  16. package/dist/apollo-core/p-910be81f.entry.js +1 -0
  17. package/dist/apollo-core/{p-b61d7952.entry.js → p-9adf3694.entry.js} +1 -1
  18. package/dist/apollo-core/p-CK3_k8jD.js +1 -0
  19. package/dist/apollo-core/p-CXkZUm1c.js +2 -0
  20. package/dist/apollo-core/p-c17b6351.entry.js +1 -0
  21. package/dist/apollo-core/p-e08b434c.entry.js +1 -0
  22. package/dist/apollo-core/{p-ca127ee8.entry.js → p-e9e7577f.entry.js} +1 -1
  23. package/dist/cjs/apollo-core.cjs.js +3 -3
  24. package/dist/cjs/{index-BQ97-AWw.js → index-BaXVr8ux.js} +36 -9
  25. package/dist/cjs/loader.cjs.js +2 -2
  26. package/dist/cjs/package.json +3 -0
  27. package/dist/cjs/v4-_2BfiRUa.js +52 -0
  28. package/dist/cjs/xpl-accordion.cjs.entry.js +3 -3
  29. package/dist/cjs/xpl-application-shell.cjs.entry.js +2 -2
  30. package/dist/cjs/xpl-avatar_54.cjs.entry.js +709 -177
  31. package/dist/cjs/xpl-button-row.cjs.entry.js +2 -2
  32. package/dist/cjs/xpl-calendar.cjs.entry.js +3 -3
  33. package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +3 -3
  34. package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +3 -3
  35. package/dist/cjs/xpl-dynamic-table.cjs.entry.js +2 -2
  36. package/dist/cjs/xpl-grid-item.cjs.entry.js +2 -2
  37. package/dist/cjs/xpl-grid.cjs.entry.js +2 -2
  38. package/dist/cjs/xpl-large-card.cjs.entry.js +2 -2
  39. package/dist/cjs/xpl-main-nav.cjs.entry.js +2 -2
  40. package/dist/cjs/xpl-table-header-cell.cjs.entry.js +1 -1
  41. package/dist/cjs/xpl-table-header.cjs.entry.js +2 -2
  42. package/dist/cjs/xpl-toggle.cjs.entry.js +5 -5
  43. package/dist/cjs/xpl-toolbar.cjs.entry.js +3 -3
  44. package/dist/collection/collection-manifest.json +5 -5
  45. package/dist/collection/components/xpl-accordion/xpl-accordion.js +2 -2
  46. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +1 -1
  47. package/dist/collection/components/xpl-avatar/xpl-avatar.js +4 -4
  48. package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
  49. package/dist/collection/components/xpl-badge/xpl-badge.js +2 -2
  50. package/dist/collection/components/xpl-banner/banner.stories.js +5 -0
  51. package/dist/collection/components/xpl-banner/xpl-banner.js +2 -2
  52. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +1 -1
  53. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +1 -1
  54. package/dist/collection/components/xpl-button/button.stories.js +5 -0
  55. package/dist/collection/components/xpl-button/xpl-button.js +16 -1
  56. package/dist/collection/components/xpl-button-row/button-row.stories.js +1 -11
  57. package/dist/collection/components/xpl-button-row/xpl-button-row.js +1 -1
  58. package/dist/collection/components/xpl-calendar/xpl-calendar.js +1 -1
  59. package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +4 -4
  60. package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
  61. package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
  62. package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
  63. package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
  64. package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
  65. package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
  66. package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
  67. package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
  68. package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +208 -31
  69. package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +1 -1
  70. package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +2 -2
  71. package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +2 -2
  72. package/dist/collection/components/xpl-grid/xpl-grid.js +1 -1
  73. package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
  74. package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +1 -1
  75. package/dist/collection/components/xpl-icon/xpl-icon.js +2 -2
  76. package/dist/collection/components/xpl-input/input.stories.js +1 -1
  77. package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +11 -9
  78. package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +3 -3
  79. package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +4 -4
  80. package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +25 -6
  81. package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +1 -1
  82. package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
  83. package/dist/collection/components/xpl-input/xpl-input.js +3 -3
  84. package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
  85. package/dist/collection/components/xpl-list/xpl-list.js +2 -2
  86. package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
  87. package/dist/collection/components/xpl-modal/xpl-modal.js +4 -1
  88. package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
  89. package/dist/collection/components/xpl-pagination/xpl-pagination.js +26 -8
  90. package/dist/collection/components/xpl-panel/xpl-panel.js +2 -2
  91. package/dist/collection/components/xpl-popover/popover.stories.js +3 -7
  92. package/dist/collection/components/xpl-popover/xpl-popover.js +5 -5
  93. package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +2 -2
  94. package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +1 -1
  95. package/dist/collection/components/xpl-radio/radio.stories.js +19 -17
  96. package/dist/collection/components/xpl-radio/xpl-radio.js +3 -3
  97. package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +1 -1
  98. package/dist/collection/components/xpl-select/xpl-select.js +16 -11
  99. package/dist/collection/components/xpl-side-nav/side-nav-constants.js +2 -0
  100. package/dist/collection/components/xpl-side-nav/side-nav.stories.js +301 -186
  101. package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +80 -14
  102. package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +284 -3
  103. package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +1 -1
  104. package/dist/collection/components/xpl-slideout/xpl-slideout.js +1 -1
  105. package/dist/collection/components/xpl-spotlight/xpl-spotlight.js +16 -6
  106. package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +2 -2
  107. package/dist/collection/components/xpl-table/xpl-table.js +13 -22
  108. package/dist/collection/components/xpl-table-header/xpl-table-header.js +1 -1
  109. package/dist/collection/components/xpl-tabs/xpl-tabs.js +5 -5
  110. package/dist/collection/components/xpl-tag/xpl-tag.js +4 -4
  111. package/dist/collection/components/xpl-toast/xpl-toast.js +2 -2
  112. package/dist/collection/components/xpl-toggle/xpl-toggle.js +3 -3
  113. package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +2 -2
  114. package/dist/collection/components/xpl-tooltip/tooltip-arrow.js +1 -1
  115. package/dist/collection/components/xpl-tooltip/tooltip.stories.js +6 -37
  116. package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +1 -1
  117. package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +2 -2
  118. package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +2 -2
  119. package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +5 -5
  120. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
  121. package/dist/components/index.d.ts +141 -12
  122. package/dist/components/index.js +1 -1
  123. package/dist/components/p-3qMYyqTe.js +1 -0
  124. package/dist/components/p-B1PBAEzg.js +1 -0
  125. package/dist/components/p-BG0-6Xek.js +1 -0
  126. package/dist/components/p-BT_Lq3Vd.js +1 -0
  127. package/dist/components/p-BWyAzrwu.js +1 -0
  128. package/dist/components/p-B_Wi--Ov.js +1 -0
  129. package/dist/components/p-Bd6JweBt.js +1 -0
  130. package/dist/components/p-Bn-27-xj.js +1 -0
  131. package/dist/components/{xpl-top-nav-item2.js → p-Bs6vq0C6.js} +1 -1
  132. package/dist/components/{xpl-input-file2.js → p-C9BO2vL-.js} +1 -1
  133. package/dist/components/p-CFW_w5Wj.js +1 -0
  134. package/dist/components/{floating-ui.dom.js → p-CFpsSZyr.js} +1 -1
  135. package/dist/components/p-CGNq3DyC.js +1 -0
  136. package/dist/components/p-CK3_k8jD.js +1 -0
  137. package/dist/components/p-CVqbA9op.js +1 -0
  138. package/dist/components/p-CtIUusUL.js +1 -0
  139. package/dist/components/p-CzwViN3U.js +1 -0
  140. package/dist/components/p-D97c0GjM.js +1 -0
  141. package/dist/components/p-DBWV65V-.js +1 -0
  142. package/dist/components/{xpl-tag2.js → p-DEl4Rvzs.js} +1 -1
  143. package/dist/components/p-DPTHmitJ.js +1 -0
  144. package/dist/components/{xpl-input-search2.js → p-DllC7F-H.js} +1 -1
  145. package/dist/components/p-Ds28UyUR.js +1 -0
  146. package/dist/components/p-U5dPMCXE.js +1 -0
  147. package/dist/components/p-hPUzON4O.js +1 -0
  148. package/dist/components/p-kPHfCq1d.js +1 -0
  149. package/dist/components/xpl-accordion.js +1 -1
  150. package/dist/components/xpl-application-shell.js +1 -1
  151. package/dist/components/xpl-avatar.js +1 -1
  152. package/dist/components/xpl-backdrop.js +1 -1
  153. package/dist/components/xpl-badge.js +1 -1
  154. package/dist/components/xpl-banner.js +1 -1
  155. package/dist/components/xpl-breadcrumb-item.js +1 -1
  156. package/dist/components/xpl-breadcrumbs.js +1 -1
  157. package/dist/components/xpl-button-row.js +1 -1
  158. package/dist/components/xpl-button.js +1 -1
  159. package/dist/components/xpl-calendar.js +1 -1
  160. package/dist/components/xpl-checkbox.js +1 -1
  161. package/dist/components/xpl-choicelist.js +1 -1
  162. package/dist/components/xpl-content-area.js +1 -1
  163. package/dist/components/xpl-dashboard.js +1 -1
  164. package/dist/components/xpl-data-card.js +1 -1
  165. package/dist/components/xpl-divider.js +1 -1
  166. package/dist/components/xpl-dropdown-group.js +1 -1
  167. package/dist/components/xpl-dropdown-heading.js +1 -1
  168. package/dist/components/xpl-dropdown-option.js +1 -1
  169. package/dist/components/xpl-dropdown.js +1 -1
  170. package/dist/components/xpl-dynamic-table-cell.js +1 -1
  171. package/dist/components/xpl-dynamic-table-row.js +1 -1
  172. package/dist/components/xpl-dynamic-table.js +1 -1
  173. package/dist/components/xpl-grid-item.js +1 -1
  174. package/dist/components/xpl-grid.js +1 -1
  175. package/dist/components/xpl-header-accordion.js +1 -1
  176. package/dist/components/xpl-icon.js +1 -1
  177. package/dist/components/xpl-input-color.js +1 -1
  178. package/dist/components/xpl-input-date.js +1 -1
  179. package/dist/components/xpl-input-file.js +1 -1
  180. package/dist/components/xpl-input-phone.js +1 -1
  181. package/dist/components/xpl-input-search.js +1 -1
  182. package/dist/components/xpl-input-time.js +1 -1
  183. package/dist/components/xpl-input.js +1 -1
  184. package/dist/components/xpl-large-card.js +1 -1
  185. package/dist/components/xpl-list-item.js +1 -1
  186. package/dist/components/xpl-list.js +1 -1
  187. package/dist/components/xpl-main-nav.js +1 -1
  188. package/dist/components/xpl-modal.js +1 -1
  189. package/dist/components/xpl-nav-header-menu.js +1 -1
  190. package/dist/components/xpl-nav-item.js +1 -1
  191. package/dist/components/xpl-pagination.js +1 -1
  192. package/dist/components/xpl-panel.js +1 -1
  193. package/dist/components/xpl-popover.js +1 -1
  194. package/dist/components/xpl-progress-bar.js +1 -1
  195. package/dist/components/xpl-progress-indicator.js +1 -1
  196. package/dist/components/xpl-radio.js +1 -1
  197. package/dist/components/xpl-secondary-nav.js +1 -1
  198. package/dist/components/xpl-select.js +1 -1
  199. package/dist/components/xpl-side-nav-item.js +1 -1
  200. package/dist/components/xpl-side-nav.js +1 -1
  201. package/dist/components/xpl-skeleton.js +1 -1
  202. package/dist/components/xpl-slideout.js +1 -1
  203. package/dist/components/xpl-spotlight.js +1 -1
  204. package/dist/components/xpl-tab-panel.js +1 -1
  205. package/dist/components/xpl-tab.js +1 -1
  206. package/dist/components/xpl-table-header-cell.js +1 -1
  207. package/dist/components/xpl-table-header.js +1 -1
  208. package/dist/components/xpl-table.js +1 -1
  209. package/dist/components/xpl-tabs.js +1 -1
  210. package/dist/components/xpl-tag.js +1 -1
  211. package/dist/components/xpl-toast.js +1 -1
  212. package/dist/components/xpl-toggle.js +1 -1
  213. package/dist/components/xpl-toolbar.js +1 -1
  214. package/dist/components/xpl-tooltip.js +1 -1
  215. package/dist/components/xpl-top-nav-item.js +1 -1
  216. package/dist/components/xpl-top-nav.js +1 -1
  217. package/dist/components/xpl-utility-bar.js +1 -1
  218. package/dist/docs/xpl-backdrop/readme.md +2 -0
  219. package/dist/docs/xpl-badge/readme.md +34 -0
  220. package/dist/docs/xpl-button/readme.md +2 -0
  221. package/dist/docs/xpl-button-row/readme.md +13 -0
  222. package/dist/docs/xpl-checkbox/readme.md +23 -1
  223. package/dist/docs/xpl-divider/readme.md +22 -4
  224. package/dist/docs/xpl-input/readme.md +51 -0
  225. package/dist/docs/xpl-input/xpl-input-date/readme.md +7 -0
  226. package/dist/docs/xpl-input/xpl-input-phone/readme.md +21 -0
  227. package/dist/docs/xpl-popover/readme.md +24 -0
  228. package/dist/docs/xpl-radio/readme.md +21 -4
  229. package/dist/docs/xpl-side-nav/readme.md +153 -5
  230. package/dist/docs/xpl-side-nav/xpl-side-nav-item/readme.md +165 -32
  231. package/dist/docs/xpl-table/readme.md +2 -0
  232. package/dist/docs/xpl-tooltip/readme.md +29 -1
  233. package/dist/esm/apollo-core.js +4 -4
  234. package/dist/esm/{index-C7bgJs6C.js → index-CXkZUm1c.js} +36 -9
  235. package/dist/esm/loader.js +3 -3
  236. package/dist/esm/v4-CK3_k8jD.js +50 -0
  237. package/dist/esm/xpl-accordion.entry.js +3 -3
  238. package/dist/esm/xpl-application-shell.entry.js +2 -2
  239. package/dist/esm/xpl-avatar_54.entry.js +709 -177
  240. package/dist/esm/xpl-button-row.entry.js +2 -2
  241. package/dist/esm/xpl-calendar.entry.js +3 -3
  242. package/dist/esm/xpl-dynamic-table-cell.entry.js +3 -3
  243. package/dist/esm/xpl-dynamic-table-row.entry.js +3 -3
  244. package/dist/esm/xpl-dynamic-table.entry.js +2 -2
  245. package/dist/esm/xpl-grid-item.entry.js +2 -2
  246. package/dist/esm/xpl-grid.entry.js +2 -2
  247. package/dist/esm/xpl-large-card.entry.js +2 -2
  248. package/dist/esm/xpl-main-nav.entry.js +2 -2
  249. package/dist/esm/xpl-table-header-cell.entry.js +1 -1
  250. package/dist/esm/xpl-table-header.entry.js +2 -2
  251. package/dist/esm/xpl-toggle.entry.js +5 -5
  252. package/dist/esm/xpl-toolbar.entry.js +3 -3
  253. package/dist/types/components/xpl-banner/banner.stories.d.ts +2 -0
  254. package/dist/types/components/xpl-button/button.stories.d.ts +2 -0
  255. package/dist/types/components/xpl-button/xpl-button.d.ts +1 -0
  256. package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +16 -0
  257. package/dist/types/components/xpl-input/xpl-input-phone/xpl-input-phone.d.ts +1 -0
  258. package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +4 -0
  259. package/dist/types/components/xpl-radio/radio.stories.d.ts +11 -10
  260. package/dist/types/components/xpl-side-nav/side-nav-constants.d.ts +2 -0
  261. package/dist/types/components/xpl-side-nav/side-nav.stories.d.ts +53 -32
  262. package/dist/types/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.d.ts +10 -0
  263. package/dist/types/components/xpl-side-nav/xpl-side-nav.d.ts +31 -0
  264. package/dist/types/components/xpl-spotlight/xpl-spotlight.d.ts +1 -0
  265. package/dist/types/components.d.ts +223 -20
  266. package/dist/types/stencil-public-runtime.d.ts +1 -0
  267. package/package.json +39 -38
  268. package/dist/apollo-core/p-0bf50890.entry.js +0 -1
  269. package/dist/apollo-core/p-1947e7a8.entry.js +0 -1
  270. package/dist/apollo-core/p-27928cb0.entry.js +0 -1
  271. package/dist/apollo-core/p-34438721.entry.js +0 -1
  272. package/dist/apollo-core/p-35c2f72d.entry.js +0 -1
  273. package/dist/apollo-core/p-368c81f1.entry.js +0 -1
  274. package/dist/apollo-core/p-406b27a8.entry.js +0 -1
  275. package/dist/apollo-core/p-5d63b4ce.entry.js +0 -1
  276. package/dist/apollo-core/p-689f1dae.entry.js +0 -1
  277. package/dist/apollo-core/p-8d692d05.entry.js +0 -1
  278. package/dist/apollo-core/p-C7bgJs6C.js +0 -2
  279. package/dist/apollo-core/p-Cqlsd6nf.js +0 -1
  280. package/dist/apollo-core/p-cd56a3d5.entry.js +0 -1
  281. package/dist/apollo-core/p-dc205893.entry.js +0 -1
  282. package/dist/cjs/v4-D4KzFnn8.js +0 -67
  283. package/dist/components/index3.js +0 -1
  284. package/dist/components/v4.js +0 -1
  285. package/dist/components/xpl-avatar2.js +0 -1
  286. package/dist/components/xpl-backdrop2.js +0 -1
  287. package/dist/components/xpl-badge2.js +0 -1
  288. package/dist/components/xpl-button2.js +0 -1
  289. package/dist/components/xpl-checkbox2.js +0 -1
  290. package/dist/components/xpl-divider2.js +0 -1
  291. package/dist/components/xpl-dropdown-group2.js +0 -1
  292. package/dist/components/xpl-dropdown-heading2.js +0 -1
  293. package/dist/components/xpl-dropdown-option2.js +0 -1
  294. package/dist/components/xpl-dropdown2.js +0 -1
  295. package/dist/components/xpl-icon2.js +0 -1
  296. package/dist/components/xpl-input-date2.js +0 -1
  297. package/dist/components/xpl-input2.js +0 -1
  298. package/dist/components/xpl-list-item2.js +0 -1
  299. package/dist/components/xpl-popover2.js +0 -1
  300. package/dist/components/xpl-radio2.js +0 -1
  301. package/dist/components/xpl-select2.js +0 -1
  302. package/dist/components/xpl-tooltip2.js +0 -1
  303. package/dist/esm/v4-Cqlsd6nf.js +0 -65
  304. /package/dist/components/{_commonjsHelpers.js → p-BFTU3MAI.js} +0 -0
  305. /package/dist/components/{index2.js → p-CH4yJ6Qx.js} +0 -0
  306. /package/dist/components/{tab-a11y-ids.js → p-Yj_QFaRn.js} +0 -0
  307. /package/dist/{index.cjs.js → index.cjs} +0 -0
  308. /package/dist/types/{Users/roc/Sites → home/runner/work/apollo}/apollo/packages/apollo-core/.stencil/css/typography.stories.d.ts +0 -0
  309. /package/loader/{cdn.js → cdn.cjs} +0 -0
  310. /package/loader/{index.cjs.js → index.cjs} +0 -0
@@ -1 +0,0 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,Host as a,transformTag as n}from"@stencil/core/internal/client";import{f as r}from"./index2.js";import{d as o}from"./xpl-icon2.js";function l(t){let e=t.parentElement;for(;e&&e!==document.body&&e!==document.documentElement;){const t=getComputedStyle(e);if(/auto|scroll/.test(t.overflow+t.overflowX+t.overflowY))return e;e=e.parentElement}}const d=(t=!1)=>`<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${t?"M0.557948 5.6813L6.06209 0.132167C6.23831 -0.0440556 6.52327 -0.0440556 6.69949 0.132167L7.44187 0.874551C7.61809 1.05077 7.61809 1.33573 7.44187 1.51195L2.99882 6L7.44187 10.488C7.61809 10.6643 7.61809 10.9492 7.44187 11.1254L6.69949 11.8678C6.52327 12.0441 6.23831 12.0441 6.06209 11.8678L0.557948 6.3187C0.381726 6.14248 0.381726 5.85752 0.557948 5.6813Z":"M7.44187 6.3187L1.93773 11.8678C1.76151 12.0441 1.47655 12.0441 1.30033 11.8678L0.557948 11.1254C0.381726 10.9492 0.381726 10.6643 0.557948 10.488L5.001 6L0.557948 1.51195C0.381726 1.33573 0.381726 1.05077 0.557948 0.874551L1.30033 0.132167C1.47655 -0.0440556 1.76151 -0.0440556 1.93773 0.132167L7.44187 5.6813C7.6181 5.85752 7.6181 6.14248 7.44187 6.3187Z"}" /></svg>`,h=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.rangeSelected=i(this,"rangeSelected",7),this.dateFormat="Y-m-d",this.mode="single",this.flatpickrStaticLayout=!1,this.valueChanged=t=>{this.valueChange.emit(t.target.value)}}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValueChanged(t){var e;null===(e=this.flatpickrInstance)||void 0===e||e.setDate(t)}connectedCallback(){queueMicrotask((()=>this.ensureFlatpickr()))}disconnectedCallback(){var t;null===(t=this.flatpickrInstance)||void 0===t||t.destroy(),this.flatpickrInstance=void 0,this.flatpickrStaticLayout=!1,this.unwrapStaleFlatpickrWrapper()}componentDidRender(){this.ensureFlatpickr()}ensureFlatpickr(){!this.flatpickrInstance&&this.input&&this.el.isConnected&&(this.unwrapStaleFlatpickrWrapper(),this.initFlatpickr())}initFlatpickr(){const t=function(t){let e=t.parentElement;for(;e&&e!==document.body&&e!==document.documentElement;){if("fixed"===getComputedStyle(e).position)return!0;e=e.parentElement}return!1}(this.el);this.flatpickrInstance=r(this.input,Object.assign(Object.assign({allowInput:!0},t?{static:!0}:{appendTo:l(this.el)}),{dateFormat:this.dateFormat,defaultDate:this.value,maxDate:this.max,minDate:this.min,mode:this.mode,nextArrow:d(),prevArrow:d(!0),onClose:t=>{if(this.hasErrorState=t.length<(this.required?"single"===this.mode?1:2:0)?"required":null,2===t.length){const[e,i]=t;this.rangeSelected.emit({start:e,end:i})}}})),queueMicrotask((()=>{this.flatpickrStaticLayout!==t&&(this.flatpickrStaticLayout=t)}))}unwrapStaleFlatpickrWrapper(){const{input:t}=this,e=null==t?void 0:t.parentElement;if(!(null==e?void 0:e.classList.contains("flatpickr-wrapper")))return;const i=e.parentElement;if(i){for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}}render(){return s(a,{key:"35b39ed37afa33603772cdd0dce79cf7533d36ec",class:{"xpl-input-date":!0,[`xpl-input-date--mode-${this.mode}`]:!0,"xpl-input-date--error":!!this.hasErrorState,"xpl-input-date--flatpickr-static":this.flatpickrStaticLayout}},s("div",{key:"14940421a3f9fb4e7a5acbd5abb222d927a701cf",class:"xpl-input-wrapper"},this.pre&&s("label",{key:"108b33b4f0a87bacff90480633327dd221f6b1d4",class:"xpl-input-pre",htmlFor:this.inputId},this.pre),s("input",{key:"00633c5b69d25a94d7cd8501bde70459e8ebf2ce",type:"date",id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,ref:t=>{this.input=t},onChange:t=>{this.valueChanged(t)}}),s("xpl-icon",{key:"ba0d694b7ace1359d6901c0110dce40a78805f74",class:"xpl-input-calendar",icon:"calendar-month",size:24}),this.post&&s("label",{key:"5ca7564e2096b697a75ebfb573654c0c23125245",class:"xpl-input-post",htmlFor:this.inputId},this.post)))}get el(){return this}static get watchers(){return{hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChanged:0}]}}},[0,"xpl-input-date",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],dateFormat:[1,"date-format"],mode:[1],flatpickrStaticLayout:[32],hasErrorState:[32]},void 0,{hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChanged:0}]}]);function c(){"undefined"!=typeof customElements&&["xpl-input-date","xpl-icon"].forEach((t=>{switch(t){case"xpl-input-date":customElements.get(n(t))||customElements.define(n(t),h);break;case"xpl-icon":customElements.get(n(t))||o()}}))}export{h as I,c as d}
@@ -1 +0,0 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,Host as n,transformTag as a}from"@stencil/core/internal/client";import{d as o}from"./xpl-dropdown2.js";import{d as r}from"./xpl-dropdown-group2.js";import{d as l}from"./xpl-dropdown-heading2.js";import{d as h}from"./xpl-dropdown-option2.js";import{d as c}from"./xpl-icon2.js";import{d}from"./xpl-input-date2.js";import{d as u}from"./xpl-input-file2.js";import{d as p}from"./xpl-input-search2.js";import{v as m}from"./v4.js";import{d as b}from"./xpl-popover2.js";const f=(t,e,i)=>{const s=(i/=100)*(e/=100),n=s*(1-Math.abs(t/60%2-1)),a=i-s;let o=0,r=0,l=0;return t<60?(o=s,r=n,l=0):t<120?(o=n,r=s,l=0):t<180?(o=0,r=s,l=n):t<240?(o=0,r=n,l=s):t<300?(o=n,r=0,l=s):(o=s,r=0,l=n),{r:Math.round(255*(o+a)),g:Math.round(255*(r+a)),b:Math.round(255*(l+a))}},x=(t,e,i)=>[t,e,i].map((t=>t.toString(16).padStart(2,"0"))).join(""),g=t=>{var e,i;if(t.startsWith("#")){if(!/^#([a-fA-F\d]{6})$/.test(t))throw new Error("Only 6-digit hex format supported (e.g. #aabbcc)");const e=t.toLowerCase().slice(1),i=parseInt(e.slice(0,2),16),s=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return{hex:e,r:i,g:s,b:n,a:1}}if(t.startsWith("rgba")||t.startsWith("rgb")){const i=null===(e=t.match(/[\d.]+/g))||void 0===e?void 0:e.map(Number);if(!i||i.length<3)throw new Error("Invalid rgba/rgb format");const[s,n,a,o=1]=i,r=t=>t.toString(16).padStart(2,"0");return{hex:`${r(s)}${r(n)}${r(a)}`.toLowerCase(),r:s,g:n,b:a,a:o}}if(t.startsWith("hsla")||t.startsWith("hsl")){const e=null===(i=t.match(/[\d.]+/g))||void 0===i?void 0:i.map(Number);if(!e||e.length<3)throw new Error("Invalid hsla/hsl format");const[s,n,a,o=1]=e,r=((t,e,i,s)=>{i/=100;const n=e=>(e+t/30)%12,a=(e/=100)*Math.min(i,1-i),o=t=>i-a*Math.max(-1,Math.min(n(t)-3,Math.min(9-n(t),1)));return`rgba(${Math.round(255*o(0))}, ${Math.round(255*o(8))}, ${Math.round(255*o(4))}, ${s})`})(s,n,a,o),[l,h,c]=r.match(/[\d.]+/g).map(Number);return{hex:x(l,h,c).toLowerCase(),r:l,g:h,b:c,a:o}}throw new Error("Unsupported color format")},v=t=>t.a&&1!==t.a?`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`:`#${t.hex}`,C=[{countryCode:"US",dialCode:"+1",name:"United States"},{countryCode:"CA",dialCode:"+1",name:"Canada"},{countryCode:"GB",dialCode:"+44",name:"United Kingdom"},{countryCode:"AU",dialCode:"+61",name:"Australia"},{countryCode:"DE",dialCode:"+49",name:"Germany"},{countryCode:"FR",dialCode:"+33",name:"France"},{countryCode:"ES",dialCode:"+34",name:"Spain"},{countryCode:"IT",dialCode:"+39",name:"Italy"},{countryCode:"NL",dialCode:"+31",name:"Netherlands"},{countryCode:"BE",dialCode:"+32",name:"Belgium"},{countryCode:"AT",dialCode:"+43",name:"Austria"},{countryCode:"CH",dialCode:"+41",name:"Switzerland"},{countryCode:"PL",dialCode:"+48",name:"Poland"},{countryCode:"IE",dialCode:"+353",name:"Ireland"},{countryCode:"PT",dialCode:"+351",name:"Portugal"},{countryCode:"SE",dialCode:"+46",name:"Sweden"},{countryCode:"NO",dialCode:"+47",name:"Norway"},{countryCode:"DK",dialCode:"+45",name:"Denmark"},{countryCode:"FI",dialCode:"+358",name:"Finland"},{countryCode:"NZ",dialCode:"+64",name:"New Zealand"},{countryCode:"JP",dialCode:"+81",name:"Japan"},{countryCode:"CN",dialCode:"+86",name:"China"},{countryCode:"IN",dialCode:"+91",name:"India"},{countryCode:"BR",dialCode:"+55",name:"Brazil"},{countryCode:"MX",dialCode:"+52",name:"Mexico"},{countryCode:"ZA",dialCode:"+27",name:"South Africa"},{countryCode:"SG",dialCode:"+65",name:"Singapore"},{countryCode:"HK",dialCode:"+852",name:"Hong Kong"},{countryCode:"KR",dialCode:"+82",name:"South Korea"}];function y(t){return C.find((e=>e.countryCode===t))}function $(t){return(t||"").replace(/\D/g,"")}function k(t){switch(t){case"US":case"CA":case"MX":case"JP":case"IN":case"KR":return 10;case"GB":case"DE":case"AT":case"CH":case"BR":case"CN":return 11;case"AU":case"FR":return 9;default:return 15}}function w(t,e){if(!t)return"";const i=t.replace(/\D/g,"");switch(e){case"US":case"CA":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=6?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,6)} ${t.slice(6,e)}`}(i);case"GB":return function(t){const e=Math.min(t.length,11);return e<=4?t.slice(0,e):e<=7?`${t.slice(0,4)} ${t.slice(4,e)}`:`${t.slice(0,4)} ${t.slice(4,7)} ${t.slice(7,e)}`}(i);case"AU":return function(t){const e=Math.min(t.length,9);return e<=1?t.slice(0,e):e<=4?`${t.slice(0,1)} ${t.slice(1,e)}`:e<=7?`${t.slice(0,1)} ${t.slice(1,4)} ${t.slice(4,e)}`:`${t.slice(0,1)} ${t.slice(1,4)} ${t.slice(4,7)} ${t.slice(7,e)}`}(i);case"DE":case"AT":case"CH":return function(t){const e=Math.min(t.length,11);return e<=3?t.slice(0,e):`${t.slice(0,3)} ${t.slice(3,e)}`}(i);case"FR":return function(t){const e=Math.min(t.length,9),i=[];let s=0;for(e>0&&(i.push(t.slice(0,1)),s=1);s<e&&s+2<=e;)i.push(t.slice(s,s+2)),s+=2;return s<e&&i.push(t.slice(s)),i.join(" ")}(i);case"BR":return function(t){const e=Math.min(t.length,11);return e<=2?e?`(${t}`:"":e<=6||7===e?`(${t.slice(0,2)}) ${t.slice(2,e)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7,e)}`}(i);case"MX":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=6?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,6)} ${t.slice(6,e)}`}(i);case"JP":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)}-${t.slice(3,e)}`:`${t.slice(0,3)}-${t.slice(3,7)}-${t.slice(7,e)}`}(i);case"CN":return function(t){const e=Math.min(t.length,11);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,7)} ${t.slice(7,e)}`}(i);case"IN":return function(t){const e=Math.min(t.length,10);return e<=5?t.slice(0,e):`${t.slice(0,5)} ${t.slice(5,e)}`}(i);case"KR":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,7)} ${t.slice(7,e)}`}(i);default:return function(t){const e=t.length;if(e<=3)return t;const i=[];let s=0;for(;s<e;){const n=e-s>=4?4:3;i.push(t.slice(s,s+n)),s+=n}return i.join(" ")}(i)}}function E(t){const[e,i]=t.split(":"),s=Number(e)>=12?"PM":"AM";return[(Number(e)%12||12).toString(),i,s]}const _=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.max="23:59",this.min="00:00",this.step=30,this.mode="single",this.timeFormat="24h",this.allowCustomOption=!1,this.showOptions=!1,this.options=[],this.handleInput=t=>{var e;const i=null===(e=t.target.value)||void 0===e?void 0:e.replace(/[^0-9:apmAPM]/g,"");this.value=i},this.handleFocus=()=>{this.showOptions=!0},this.handleBlur=()=>{this.value=function(t){if(!t||""===t.trim()||0===t.replace(/[^0-9]/g,"").length)return null;let e=t.trim().toLowerCase();e=e.replace(/(\d)\s+(am|pm)/g,"$1$2"),/^\d{1,2}(am|pm)?$/.test(e)&&(e=e.replace(/(am|pm)?$/,":00$1")),/^\d{1,2}$/.test(e)&&(e=`${e}:00`),/^\d{1,2}:\d{1}$/.test(e)&&(e=`${e}0`);const[i,s]=e.split(":"),n=s.replace(/[^0-9]/g,""),a=e.includes("am");return e.includes("pm")||a?a?`${(Number(i)%12).toString().padStart(2,"0")}:${n}`:`${Number(i)%12+12}:${n}`:`${i.padStart(2,"0")}:${n}`}(this.value)},this.handleClick=()=>{this.showOptions=!0}}onValueChange(t){this.valueChange.emit(t),this.updateState(t)}updateState(t){this.formattedValue=this.formatDisplayedTime(t),this.amPm=this.formatDisplayedAmPm(t),this.validateValue()}formatDisplayedTime(t){if(!t)return"";if("12h"===this.timeFormat&&t.includes(":")){const[e,i]=E(t);return`${e}:${i}`}return t}formatDisplayedAmPm(t){if(!t||"12h"!==this.timeFormat)return"";const[,,e]=E(t);return e}validateValue(){this.hasErrorState=this.value?!this.value.includes(":")||this.value.trim().length<4||this.value.trim().length>5?"Invalid time format, must be HH:MM":this.value<this.min||this.value>this.max?"Out of range":this.allowCustomOption||this.options.some((t=>t.value===this.value))?null:"Invalid option":this.required?"required":null}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}componentDidLoad(){var t;"range"===this.mode&&console.warn("Range mode is not supported for time inputs at this time."),null===(t=this.dropdown)||void 0===t||t.addEventListener("isOpenChange",(t=>{this.showOptions=t.detail}))}componentWillLoad(){this.options=this.getOptions(),this.value&&this.updateState(this.value)}getOptions(){return function(t,e,i,s){const n=t=>{const[e,i]=t.split(":").map(Number);return 60*e+i},a=n(e.toString()),o=n(i.toString()),r=[];for(let e=a;e<=o;e+=t)r.push((l=e,`${Math.floor(l/60).toString().padStart(2,"0")}:${(l%60).toString().padStart(2,"0")}`));var l;return r.map((t=>({label:"12h"===s?function(t){const[e,i,s]=E(t);return`${e}:${i} ${s}`}(t):t,value:t})))}(this.step,this.min.toString(),this.max.toString(),this.timeFormat).map((({label:t,value:e})=>({label:t,value:e,onClick:()=>{this.value=e,this.showOptions=!1}})))}render(){return s(n,{key:"a48ebfd7cd0578b33bd11059f9bebb342bf954f7",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},s("xpl-input",{key:"68089e0bd5b0ed7d88917094eafe529637947380",pre:s("xpl-icon",{class:"xpl-input-time__clock-icon",icon:"clock",size:24}),post:"12h"===this.timeFormat?this.amPm||"AM":null,type:"text",_id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,onInput:this.handleInput,value:this.formattedValue,onFocusEvent:this.handleFocus,onBlurEvent:this.handleBlur,onClick:this.handleClick}),!this.readonly&&!this.disabled&&s("xpl-dropdown",{key:"1bbe4a3a42c02ff985a26e7547c54f0bbdc92ce0",options:this.options,isOpen:this.showOptions,ref:t=>{this.dropdown=t},class:"xpl-input-time__dropdown"}))}static get watchers(){return{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}}},[0,"xpl-input-time",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1537],placeholder:[1],max:[8],min:[8],step:[2],mode:[1],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],formattedValue:[32],hasErrorState:[32],showOptions:[32],options:[32],amPm:[32]},void 0,{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}]);function M(){"undefined"!=typeof customElements&&["xpl-input-time","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-time":customElements.get(a(t))||customElements.define(a(t),_);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||l();break;case"xpl-dropdown-option":customElements.get(a(t))||h();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||V();break;case"xpl-input-color":customElements.get(a(t))||N();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||D();break;case"xpl-input-search":customElements.get(a(t))||p();break;case"xpl-input-time":customElements.get(a(t))||M()}}))}function S(t){return t.toLowerCase().replace(/ /g,"-")}const I=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.valueChange=i(this,"valueChange",7),this.lastCursorRef=0,this.lastFormattedRef="",this.dropdownOpen=!1,this.hasErrorState=null,this.nationalNumber="",this.searchQuery="",this.triggerId=`xpl-input-phone-trigger-${m()}`,this.defaultCountry="US",this.isInternational=!0,this.handleTriggerClick=()=>{this.isEditable&&(this.dropdownOpen=!this.dropdownOpen)},this.handleNumberInput=t=>{var e;const i=t.target,s=i.value||"";let n;if(this.lastCursorRef=null!==(e=i.selectionStart)&&void 0!==e?e:0,this.lastFormattedRef=s,this.isInternational&&s.startsWith("+")){const t=$(s),e=this.effectiveDialCode.slice(1).replace(/\D/g,"");n=e&&t.startsWith(e)?t.slice(e.length):t}else n=$(s);const a=k(this.effectiveCountryCode);n.length>a&&(n=n.slice(0,a)),this.nationalNumber=n,this.emitValue(),i.value=this.displayValue},this.handleClear=()=>{var t;this.nationalNumber="",this.emitValue(),null===(t=this.inputEl)||void 0===t||t.focus()},this.handleDropdownUpdate=(t,{component:e})=>{var i;const s=null!=e?e:this.dropdownRef;if(!s)return;const{options:n}=s;if(null==n?void 0:n.length){const t=n.reduce(((t,e)=>{var i;return[...t,...e.groupName?null!==(i=e.options)&&void 0!==i?i:[]:[e]]}),[]),e=t.find((t=>t.isSelected));if(null==e?void 0:e.value){const t=y(e.value);t&&(this.selectedCountry=t,this.emitValue(),null===(i=this.inputEl)||void 0===i||i.focus())}}}}onDropdownOpenChange(t){t&&(this.searchQuery="")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValueChange(t){var e,i;if(null==t||""===t){const t=y(this.defaultCountry)||C[0];return this.selectedCountry=t,void(this.nationalNumber="")}const s=function(t){if(!t||!t.startsWith("+"))return null;const e=t.slice(1).replace(/\D/g,"");if(!e.length)return null;const i=[...C].sort(((t,e)=>e.dialCode.replace(/\D/g,"").length-t.dialCode.replace(/\D/g,"").length)).find((t=>{const i=t.dialCode.slice(1).replace(/\D/g,"");return e.startsWith(i)}));if(!i)return null;const s=i.dialCode.slice(1).replace(/\D/g,""),n=e.slice(s.length);return{dialCode:i.dialCode,nationalNumber:n}}(t);if(s)if((null===(e=this.selectedCountry)||void 0===e?void 0:e.dialCode)===s.dialCode)this.nationalNumber=s.nationalNumber;else{const t=y(this.defaultCountry),e=null!==(i=(null==t?void 0:t.dialCode)===s.dialCode?t:void 0)&&void 0!==i?i:(n=s.dialCode,C.find((t=>t.dialCode===n)));e&&(this.selectedCountry=e,this.nationalNumber=s.nationalNumber)}else this.selectedCountry||(this.selectedCountry=y(this.defaultCountry)||C[0]);var n}componentWillLoad(){this.value?this.onValueChange(this.value):this.selectedCountry=y(this.defaultCountry)||C[0]}componentDidUpdate(){if(this.inputEl&&this.lastFormattedRef&&"function"==typeof this.inputEl.setSelectionRange){const t=function(t,e,i){if(i>=t.length)return e.length;const s=$(t.slice(0,i)).length;let n=0,a=0;for(let t=0;t<e.length;t+=1){if(/\d/.test(e[t])&&(a+=1,a>=s)){n=t+(a===s?1:0);break}n=t+1}return Math.min(n,e.length)}(this.lastFormattedRef,this.displayValue,this.lastCursorRef);this.inputEl.setSelectionRange(t,t),this.lastFormattedRef=""}else this.inputEl&&this.lastFormattedRef&&(this.lastFormattedRef="")}get effectiveCountryCode(){var t,e,i;return null!==(i=null!==(e=null===(t=this.selectedCountry)||void 0===t?void 0:t.countryCode)&&void 0!==e?e:this.defaultCountry)&&void 0!==i?i:"US"}get effectiveDialCode(){var t,e;return null!==(e=null===(t=this.selectedCountry)||void 0===t?void 0:t.dialCode)&&void 0!==e?e:"+1"}get isEditable(){return!this.disabled&&!this.readonly}get orderedCountries(){const t=this.preferredCountries||[],e=C.filter((e=>!t.includes(e.countryCode)));return[...t.map((t=>y(t))).filter(Boolean),...e]}get filteredCountries(){const t=this.searchQuery.trim().toLowerCase();return t?this.orderedCountries.filter((e=>e.name.toLowerCase().includes(t)||e.dialCode.includes(t)||e.countryCode.toLowerCase().includes(t))):this.orderedCountries}get displayValue(){return this.nationalNumber?w(this.nationalNumber,this.effectiveCountryCode):""}get effectivePlaceholder(){if(this.placeholder)return this.placeholder;const t=this.selectedCountry;return t?function(t){switch(t){case"US":case"CA":case"MX":default:return"000 000 0000";case"GB":return"0000 000 0000";case"AU":return"0 000 000 000";case"DE":case"AT":case"CH":return"000 0000000";case"FR":return"0 00 00 00 00";case"BR":return"00 00000 0000";case"JP":case"CN":case"KR":return"000 0000 0000";case"IN":return"00000 00000"}}(t.countryCode):""}get dropdownOptions(){return this.filteredCountries.map((t=>{var e;return{icon:S(t.name),label:`${t.name} (${t.dialCode})`,value:t.countryCode,isSelected:(null===(e=this.selectedCountry)||void 0===e?void 0:e.countryCode)===t.countryCode}}))}get maxInputLength(){const t=k(this.effectiveCountryCode);return w("9".repeat(t),this.effectiveCountryCode).length}emitValue(){const t=this.nationalNumber?function(t,e){const i=(t.slice(1)+e).replace(/\D/g,"");return i.length?`+${i}`:""}(this.effectiveDialCode,this.nationalNumber):"";this.value=t||void 0,this.valueChange.emit(t||""),this.validate()}validate(){this.hasErrorState=!this.required||this.nationalNumber.trim()?null:"required"}render(){var t;return s(n,{key:"4a55afb3d85dc5882eca2cab0a23b11374cc053e",class:{"xpl-input-phone":!0,"xpl-input-phone--error":!!this.hasErrorState,"xpl-input-phone--open":this.dropdownOpen,"xpl-input-phone--domestic":!this.isInternational}},s("div",{key:"c7e46df1b58b6e76dda47b3b32f5a6abe29f048c",class:"xpl-input-wrapper"},this.isInternational&&s("button",{key:"ef1bedb4bad96760c81ad4dbf2cadb5a29d4abb9",type:"button",id:this.triggerId,class:"xpl-input-phone__trigger",disabled:this.disabled,"aria-haspopup":"listbox","aria-expanded":this.dropdownOpen?"true":"false","aria-label":"Select country",onClick:this.handleTriggerClick},(null===(t=this.selectedCountry)||void 0===t?void 0:t.name)&&s("xpl-icon",{key:"a307f620c2815d63b17dbeb6c270d2972884e9d9",class:"xpl-input-phone__flag",icon:S(this.selectedCountry.name),size:24,"aria-hidden":"true"}),s("xpl-icon",{key:"c16e66d315877cec35e322a1164f765cd387931f",class:"xpl-input-phone__trigger-icon",icon:"chevron-down",size:20,"aria-hidden":"true"})),s("div",{key:"7a33b994588e4c5ea868a4e092709b8acd50a36f",class:"xpl-input-phone__input-wrap"},this.isInternational&&s("span",{key:"5a39cfd472f5287fc8cf0648ce618e21dabf5e97",class:"xpl-input-phone__dial-code"},this.effectiveDialCode),s("input",{key:"dfb25910769594bc9b9d1c861049605d7bdd9d0e",ref:t=>{this.inputEl=t},type:"tel",id:this.inputId,class:"xpl-input-phone__input",name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required,"aria-invalid":this.hasErrorState?"true":"false",placeholder:this.effectivePlaceholder,autocomplete:this.isInternational?"tel-national":"tel",inputmode:"numeric",maxlength:this.maxInputLength,value:this.displayValue,onInput:this.handleNumberInput}),this.nationalNumber&&this.isEditable&&s("button",{key:"8db932d94550aa6d947e2564d8a94a12bef43bce",type:"button",class:"xpl-input-phone__clear","aria-label":"Clear phone number",onClick:this.handleClear},s("xpl-icon",{key:"87e55c3a5ae6b8774d3ce64af843b7e63448fe25",icon:"x-circle",size:16})))),this.isInternational&&this.isEditable&&s("xpl-dropdown",{key:"467b0e2fde23a45b2c36138affa26467e0b6c9d0",ref:t=>{this.dropdownRef=t},isOpen:this.dropdownOpen,triggerId:this.triggerId,anchorToTrigger:!0,closeOnSelect:!0,mode:"single",options:this.dropdownOptions,update:this.handleDropdownUpdate,onIsOpenChange:t=>{this.dropdownOpen=t.detail},"aria-label":"Country"},s("div",{key:"f4f3665ab8286faed45c3a3a510bd247c7a31842",slot:"header",class:"xpl-input-phone__search-wrap"},s("xpl-input",{key:"659875e60e85bac085deb8f6648623eccc76d560",class:"xpl-input-phone__search",type:"text",label:"",placeholder:"Search",value:this.searchQuery,autocomplete:"off",onInputEvent:t=>{var e;this.searchQuery=null!==(e=t.detail)&&void 0!==e?e:""}},s("xpl-icon",{key:"987941768e8494d9c898fc93e531da03bd57ad71",slot:"pre",class:"xpl-input-phone__search-icon",icon:"magnifier",size:20})))))}get el(){return this}static get watchers(){return{dropdownOpen:[{onDropdownOpenChange:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChange:0}]}}},[0,"xpl-input-phone",{defaultCountry:[1,"default-country"],disabled:[4],inputId:[1,"input-id"],isInternational:[4,"is-international"],name:[1],placeholder:[1],preferredCountries:[16],readonly:[4],required:[4],value:[1537],dropdownOpen:[32],hasErrorState:[32],nationalNumber:[32],searchQuery:[32],selectedCountry:[32],triggerId:[32]},void 0,{dropdownOpen:[{onDropdownOpenChange:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChange:0}]}]);function D(){"undefined"!=typeof customElements&&["xpl-input-phone","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-phone":customElements.get(a(t))||customElements.define(a(t),I);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||l();break;case"xpl-dropdown-option":customElements.get(a(t))||h();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||V();break;case"xpl-input-color":customElements.get(a(t))||N();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||D();break;case"xpl-input-search":customElements.get(a(t))||p();break;case"xpl-input-time":customElements.get(a(t))||M()}}))}const O={hex:"",r:0,g:0,b:0,a:1},F=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.inputChange=i(this,"inputChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.placeholder="Select color",this.eyeDropperSupported="EyeDropper"in window,this.colorInputElements={hex:null,r:null,g:null,b:null,a:null,hue:null,slGrid:null,alpha:null},this.handleMove=t=>{const e=this.colorInputElements.slGrid.getBoundingClientRect(),i="touches"in t?t.touches[0].clientY:t.clientY,s=Math.max(0,Math.min(("touches"in t?t.touches[0].clientX:t.clientX)-e.left,e.width)),n=Math.max(0,Math.min(i-e.top,e.height)),a=s/e.width,o=n/e.height,r=f(this.hue,100,100),l=(255*(1-a)+a*r.r)*(1-o),h=(255*(1-a)+a*r.g)*(1-o),c=(255*(1-a)+a*r.b)*(1-o),d={r:Math.round(l),g:Math.round(h),b:Math.round(c),hex:x(Math.round(l),Math.round(h),Math.round(c)),a:this.colorValues.a};this.colorValues=d},this.startDrag=t=>{t.preventDefault(),this.handleMove(t),window.addEventListener("mousemove",this.handleMove),window.addEventListener("mouseup",this.stopDrag),window.addEventListener("touchmove",this.handleMove),window.addEventListener("touchend",this.stopDrag)},this.stopDrag=()=>{window.removeEventListener("mousemove",this.handleMove),window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("touchmove",this.handleMove),window.removeEventListener("touchend",this.stopDrag)},this.onHexInputChange=t=>{var e;const i=t.detail;if(i){const[t,s,n]=(t=>t?t.match(/\w\w/g).map((t=>parseInt(t,16))):[0,0,0])(i);this.colorValues={hex:i,r:t,g:s,b:n,a:null!==(e=this.colorValues.a)&&void 0!==e?e:1}}else this.colorValues=Object.assign({},O)},this.onRgbaInputChange=(t,e)=>{const i=parseFloat(e.detail);if(Number.isNaN(i))return void(this.hasErrorState=`invalid value from ${t.name}: ${i}`);const s=Object.assign({},this.colorValues);switch(t.name){case"color-r-input":s.r=i;break;case"color-g-input":s.g=i;break;case"color-b-input":s.b=i;break;case"color-a-input":s.a=i;break;default:this.hasErrorState=`unhandled input: ${t.name}`}s.hex=x(s.r,s.g,s.b),this.colorValues=s},this.onSliderInputChange=t=>{const e=parseFloat(t.value);if(Number.isNaN(e))this.hasErrorState=`invalid value from ${t.name}: ${e}`;else switch(t.name){case"color-hue-slider":this.colorValues=g(`hsla(${e}, 100%, 50%, 1)`),this.hue=e;break;case"color-alpha-slider":this.colorValues=Object.assign(Object.assign({},this.colorValues),{a:e});break;default:this.hasErrorState=`unhandled input: ${t.name}`}}}valueChanged(t){this.hasErrorState=this.required&&!t.hex?"required":null,this.inputChange.emit(t.hex?v(t):"")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValuePropChange(t){this.syncColorFromValue(t)}syncColorFromValue(t){if(t)try{this.colorValues=g(t),this.hue=(()=>{const t=this.colorValues.r/255,e=this.colorValues.g/255,i=this.colorValues.b/255,s=Math.max(t,e,i),n=Math.min(t,e,i),a=s-n;let o=0,r=0;const l=(s+n)/2;if(0!==a){switch(r=a/(1-Math.abs(2*l-1)),s){case t:o=(e-i)/a%6;break;case e:o=(i-t)/a+2;break;case i:o=(t-e)/a+4}o*=60,o<0&&(o+=360)}return{hue:Math.round(o),saturation:Math.round(100*r),lightness:Math.round(100*l)}})().hue}catch(t){this.hasErrorState="invalid color format",this.hue=0}else this.colorValues=Object.assign({},O),this.hasErrorState=null,this.hue=0}componentWillLoad(){this.syncColorFromValue(this.value)}componentDidLoad(){const{r:t,g:e,b:i,a:s,hue:n,alpha:a,hex:o}=this.colorInputElements;o.addEventListener("valueChange",(t=>{this.onHexInputChange(t)})),[t,e,i,s].forEach((t=>{t.addEventListener("valueChange",(e=>{this.onRgbaInputChange(t,e)}))})),[n,a].forEach((t=>{t.addEventListener("input",(()=>{this.onSliderInputChange(t)}))}))}async openEyeDropper(){try{const t=new window.EyeDropper,e=await t.open();this.colorValues=g(e.sRGBHex)}catch(t){this.hasErrorState=`eyedropper cancelled or failed: ${t}`}}render(){const{r:t,g:e,b:i,a}=this.colorValues,o=f(this.hue,100,100),{x:r,y:l}=((t,e,i,s)=>{const{s:n,v:a}=((t,e,i,s)=>{t/=255,e/=255,i/=255;const n=Math.max(t,e,i),a=n-Math.min(t,e,i);let o=0;return o=0===a?0:n===t?(e-i)/a%6:n===e?(i-t)/a+2:(t-e)/a+4,o=Math.round(60*o),o<0&&(o+=360),{h:null!=s?s:o,s:0===n?0:a/n,v:n}})(e.r,e.g,e.b,t);return{x:Math.round(n*i),y:Math.round((1-a)*s)}})(this.hue,{r:t,g:e,b:i},288,160),h={left:`${r}px`,top:`${l}px`,background:`rgb(${t}, ${e}, ${i})`};return s(n,{key:"f665a747f8938212d0c9ada4f251a9fc880ba82c",class:"xpl-input-color"},s("xpl-popover",{key:"eac77d1e9f350b3b0dd66001a7a596d156a75a53",disabled:this.disabled,display:"menu"},s("div",{key:"73d1468c4261fd9a8e957189129cc660757d849f",slot:"trigger"},s("div",{key:"fa098788863247a7c87e4efe628b5b47f0bb3113",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},s("span",{key:"d471146ff3ba7b026dba1424599361d0aa0fe49c",class:"xpl-input-color__color",style:{background:v(this.colorValues)}}),this.colorValues.hex?s("span",{class:"xpl-input-color__value"},v(this.colorValues)):s("span",{class:"xpl-input-color__placeholder"},this.placeholder),this.eyeDropperSupported&&!this.hideEyeDropper&&s("xpl-icon",{key:"5cd87456ef093611b6be8906c24b235ea7f19524",size:20,icon:"eye-dropper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),s("div",{key:"df7bdf567c9a697f8a5e737e5a8cb1b1b962dbb9",class:"xpl-input-color__menu"},s("div",{key:"ae630752b48e9d211273da6f3dadda8ace603ba2",class:"xpl-input-color__sl-grid",ref:t=>{this.colorInputElements.slGrid=t},style:{background:["linear-gradient(to top, #000, #0000)","linear-gradient(to right, #fff, #fff0)",`rgb(${o.r} ${o.g} ${o.b})`].join(", ")},onMouseDown:this.startDrag,onTouchStart:this.startDrag},s("div",{key:"25ffc6bb94f0e861a3bc5a6da5c01e0901d1779e",class:"xpl-input-color__sl-thumb",style:h})),s("div",{key:"7d256baab084f96c56724b4eede835a13bee7055",class:"xpl-input-color__grid"},s("input",{key:"227309d4590722c24c2d053c013a6d473e44a3ee",type:"range",min:"0",max:"360",value:this.hue,class:"xpl-input-color__slider xpl-input-color__hue",name:"color-hue-slider",ref:t=>{this.colorInputElements.hue=t}}),s("input",{key:"2d43e7c9f98fd5cdcccde7206c0cf4e5ae6bde6d",type:"range",min:"0",max:"1",step:"0.01",value:a,class:"xpl-input-color__slider xpl-input-color__alpha",name:"color-alpha-slider",ref:t=>{this.colorInputElements.alpha=t},style:{backgroundImage:[`linear-gradient(to right, rgb(${t} ${e} ${i} / 0) 0%, rgb(${t} ${e} ${i} / 1) 100%)`,"linear-gradient(45deg, #ccc 25%, transparent 25%)","linear-gradient(-45deg, #ccc 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #ccc 75%)","linear-gradient(-45deg, transparent 75%, #ccc 75%)"].join(", ")}}),s("div",{key:"26a562a220b2458e0ee99906d27d8a11e38f2d02",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${e}, ${i}, ${a})`}})),s("div",{key:"a77a7325f72ef73e6aa2d6968ae4afd1e010cf2c",class:"xpl-input-color__inputs"},Object.entries(this.colorInputElements).filter((([t])=>["hex","r","g","b","a"].includes(t))).map((([t])=>s("xpl-input",{key:t,label:t.toLocaleUpperCase(),name:`color-${t}-input`,placeholder:"hex"===t?"793EF7":"0",value:this.colorValues[t],ref:e=>{this.colorInputElements[t]=e}})))))))}static get watchers(){return{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}}},[0,"xpl-input-color",{value:[1],placeholder:[1],disabled:[4],required:[4],hideEyeDropper:[4,"hide-eye-dropper"],hasErrorState:[32],colorValues:[32],eyeDropperSupported:[32],hue:[32]},void 0,{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}]);function N(){"undefined"!=typeof customElements&&["xpl-input-color","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input-color":customElements.get(a(t))||customElements.define(a(t),F);break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||V();break;case"xpl-input-color":customElements.get(a(t))||N();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||D();break;case"xpl-input-search":customElements.get(a(t))||p();break;case"xpl-input-time":customElements.get(a(t))||M();break;case"xpl-popover":customElements.get(a(t))||b()}}))}const A=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.blurEvent=i(this,"blurEvent",7),this.focusEvent=i(this,"focusEvent",7),this.inputEvent=i(this,"inputEvent",7),this.search=i(this,"search",7),this.valueChange=i(this,"valueChange",7),this.multiline=!1,this.dateFormat="Y-m-d",this.timeFormat="24h",this.allowCustomOption=!1,this.mode="single",this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.defaultCountry="US",this.isInternational=!0,this.ariaLabel="",this.type="text",this.handleChildValueChange=t=>{t.stopPropagation(),this.valueChange.emit(t.detail)},this.valueChanged=t=>{this.valueChange.emit(t.target.value)},this.characterCount=0,this.passwordVisible=!1,this.hasPreSlotContent=!1,this.handleBlur=t=>{this.blurEvent.emit(t)},this.handleFocus=t=>{this.focusEvent.emit(t)},this.handleInput=t=>{this.multiline&&this.updateCharacterCount();const{value:e}=t.target;this.inputEvent.emit(e)},this.syncPreSlotContent=()=>{const t=this.hasDirectPreSlotChild();t!==this.hasPreSlotContent&&(this.hasPreSlotContent=t)},this.handleSearchBlurForward=t=>{const{detail:e}=t;e&&(t.stopPropagation(),this.blurEvent.emit(e))},this.handleSearchCommit=t=>{t.stopPropagation(),this.search.emit(t.detail)},this.handleSearchFocusForward=t=>{const{detail:e}=t;e&&(t.stopPropagation(),this.focusEvent.emit(e))}}hasDirectPreSlotChild(){return Array.from(this.el.children).some((t=>"pre"===t.getAttribute("slot")))}updateCharacterCount(){this.characterCount=this.input.value.length}componentWillLoad(){null!=this._id&&""!==this._id||(this._id=m()),this.multiline&&void 0!==this.maxCharacterCount&&(this.characterCount=void 0!==this.value?this.value.length:0),this.multiline||(this.hasPreSlotContent=this.hasDirectPreSlotChild())}componentDidLoad(){this.multiline||"search"===this.type||"undefined"!=typeof MutationObserver&&(this.preSlotObserver=new MutationObserver(this.syncPreSlotContent),this.preSlotObserver.observe(this.el,{childList:!0}))}disconnectedCallback(){var t;null===(t=this.preSlotObserver)||void 0===t||t.disconnect()}async setFocus(){var t,e;"search"!==this.type?null===(e=this.input)||void 0===e||e.focus():await(null===(t=this.searchInputRef)||void 0===t?void 0:t.setFocus())}renderInput(){var t,e,i,n,a,o;switch(this.type){case"file":return s("xpl-input-file",{accept:this.accept,disabled:this.disabled,hideAcceptText:this.hideAcceptText,hideFileNames:this.hideFileNames,hideTriggerOnSelect:this.hideTriggerOnSelect,multiple:this.multiple,name:this.name,onInputChange:this.handleChildValueChange,_id:this._id},s("slot",{name:"trigger"}));case"color":return s("xpl-input-color",{disabled:this.disabled,value:this.value,placeholder:this.placeholder,required:this.required,hideEyeDropper:this.hideEyeDropper,onInputChange:this.handleChildValueChange});case"date":return s("xpl-input-date",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,post:this.post,pre:this.pre,max:this.max,min:this.min,dateFormat:this.dateFormat,mode:this.mode,onValueChange:this.handleChildValueChange});case"time":return s("xpl-input-time",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,max:this.max,min:this.min,step:this.step,mode:this.mode,timeFormat:this.timeFormat,allowCustomOption:this.allowCustomOption,onValueChange:this.handleChildValueChange});case"phone":return s("xpl-input-phone",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,defaultCountry:this.defaultCountry,preferredCountries:this.preferredCountries,isInternational:this.isInternational,onValueChange:this.handleChildValueChange});case"search":{const r=Boolean((null!==(t=this.label)&&void 0!==t?t:"").trim()),l=Boolean(this.error&&this.error.length>0);return s("xpl-input-search",{ariaLabel:(null!==(e=this.ariaLabel)&&void 0!==e?e:"").trim()||"Search",autocomplete:null!==(i=this.autocomplete)&&void 0!==i?i:"off",disabled:this.disabled,errorMessageId:l?`${this._id}-error`:void 0,hasError:l,hasVisibleLabel:r,inputId:this._id,name:this.name,onBlurEvent:this.handleSearchBlurForward,onFocusEvent:this.handleSearchFocusForward,onSearch:this.handleSearchCommit,onValueChange:this.handleChildValueChange,placeholder:null!==(n=this.placeholder)&&void 0!==n?n:"Search",readonly:this.readonly,ref:t=>{this.searchInputRef=null!=t?t:void 0},required:this.required,shape:null!==(a=this.shape)&&void 0!==a?a:"rounded",value:null!==(o=this.value)&&void 0!==o?o:""})}default:return s("div",{class:"xpl-input-wrapper"},!this.multiline&&s("label",{class:{"xpl-input-pre":!0,"xpl-input-pre--hidden":!this.pre&&!this.hasPreSlotContent},htmlFor:this._id},s("slot",{name:"pre"},this.pre)),this.multiline?s("textarea",{disabled:this.disabled,id:this._id,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput},this.value):s("input",{autocomplete:this.autocomplete,disabled:this.disabled,id:this._id,max:this.max,min:this.min,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,step:this.step,type:this.type,value:this.value,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput}),"password"===this.type&&s("button",{"aria-label":"Toggle password visibility",class:"xpl-input-password",onClick:()=>{this.passwordVisible=!this.passwordVisible},role:"presentation"},s("xpl-icon",{icon:this.passwordVisible?"eye-closed":"eye",size:24})),this.post&&!this.multiline&&s("label",{class:"xpl-input-post",htmlFor:this._id},this.post),this.multiline&&void 0!==this.maxCharacterCount&&s("span",{class:"xpl-input-characters"},this.characterCount,"/",this.maxCharacterCount))}}render(){var t;let e=!1;return(this.error||this.multiline&&void 0!==this.maxCharacterCount&&this.characterCount>this.maxCharacterCount)&&(e=!0),s(n,{key:"406ab6d1b4d43ceb06cdb819cec8699d2d3322b3",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":e,"xpl-input--readonly":this.readonly,[`xpl-input--${this.type}`]:!0}},this.label&&s("label",{key:"ab7ea9eb5cb82e6b602ce93ab3da482c12f59078",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&s("small",{key:"37435c5f1d3d8a30acba7788a7d215921e679327"},this.description)),this.renderInput(),(null===(t=this.error)||void 0===t?void 0:t.length)>0&&s("label",{key:"57b66daa234d93d9f6d7ad582380960013596919",class:"xpl-input-error",htmlFor:this._id,id:`${this._id}-error`},s("xpl-icon",{key:"9a14b46934a8d7edc5f5e48c3fecf87441e741ca",icon:"alert-circle",size:16}),s("span",{key:"badecb1aba3b3ff35cbcf6d7cb4d5355844951e6"},this.error)))}get el(){return this}},[260,"xpl-input",{_id:[1],description:[1],disabled:[4],error:[1],label:[1],name:[1],required:[4],readonly:[4],value:[1],autocomplete:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],step:[2],multiline:[4],maxCharacterCount:[2,"max-character-count"],dateFormat:[1,"date-format"],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],mode:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],hideEyeDropper:[4,"hide-eye-dropper"],defaultCountry:[1,"default-country"],preferredCountries:[16],isInternational:[4,"is-international"],ariaLabel:[1,"aria-label"],shape:[1],type:[1],characterCount:[32],passwordVisible:[32],hasPreSlotContent:[32],setFocus:[64]}]);function V(){"undefined"!=typeof customElements&&["xpl-input","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input":customElements.get(a(t))||customElements.define(a(t),A);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||l();break;case"xpl-dropdown-option":customElements.get(a(t))||h();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||V();break;case"xpl-input-color":customElements.get(a(t))||N();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||D();break;case"xpl-input-search":customElements.get(a(t))||p();break;case"xpl-input-time":customElements.get(a(t))||M();break;case"xpl-popover":customElements.get(a(t))||b()}}))}export{A as I,F as a,N as b,I as c,V as d,D as e,_ as f,M as g}
@@ -1 +0,0 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,Host as a,Fragment as l,transformTag as r}from"@stencil/core/internal/client";import{d as n}from"./xpl-avatar2.js";import{d}from"./xpl-badge2.js";import{d as h}from"./xpl-button2.js";import{d as o}from"./xpl-divider2.js";import{d as c}from"./xpl-icon2.js";import{d as m}from"./xpl-radio2.js";const p=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.itemDragEnd=i(this,"itemDragEnd",7),this.itemDragStart=i(this,"itemDragStart",7),this.itemDrop=i(this,"itemDrop",7),this.itemSelect=i(this,"itemSelect",7),this.dragFromHandle=!1,this.slotPresence={actions:!1,avatar:!1,badges:!1,details:!1,errorText:!1,metadata:!1,stackedExtra1:!1,stackedExtra2:!1,stackedExtra3:!1,titleBadge:!1,title:!1},this.isKeyboardMode=!1,this.disabled=!1,this.error=!1,this.hidden=!1,this.keyboardActive=!1,this.reorderable=!1,this.selectable=!1,this.selected=!1,this.showDivider=!1,this.handleDragStart=t=>{if(this.disabled)return void t.preventDefault();if(!this.dragFromHandle)return void t.preventDefault();this.detachDragHandlePointerReleaseListeners(),t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",this.itemId||this.el.id||""));const e=this.el.querySelector(".xpl-list-item__wrapper");null==e||e.classList.add("dragging"),this.itemDragStart.emit({itemId:this.itemId,item:this.el})},this.handleDrop=t=>{this.disabled||(t.preventDefault(),this.detachDragHandlePointerReleaseListeners(),this.dragFromHandle=!1,this.itemDrop.emit({itemId:this.itemId,item:this.el}))},this.handleDragOver=t=>{this.disabled||(t.preventDefault(),t.dataTransfer&&this.reorderable&&(t.dataTransfer.dropEffect="move"))},this.handleDragEnter=t=>{if(this.disabled)return;t.preventDefault();const e=this.el.querySelector(".xpl-list-item__wrapper");null==e||e.classList.add("drag-over")},this.handleDragLeave=t=>{if(this.disabled)return;const e=this.el.querySelector(".xpl-list-item__wrapper");e&&!e.contains(t.relatedTarget)&&e.classList.remove("drag-over")},this.handleDragEnd=()=>{this.detachDragHandlePointerReleaseListeners(),this.dragFromHandle=!1;const t=this.el.querySelector(".xpl-list-item__wrapper");null==t||t.classList.remove("dragging","drag-over");const e=this.el.parentElement;e&&Array.from(e.children).forEach((t=>{if("xpl-list-item"!==t.tagName.toLowerCase())return;const e=t.querySelector(".xpl-list-item__wrapper");null==e||e.classList.remove("drag-over")})),this.itemDragEnd.emit({itemId:this.itemId,item:this.el})},this.handleDragHandleMouseDown=()=>{if(this.disabled)return;this.detachDragHandlePointerReleaseListeners(),this.dragFromHandle=!0;const t=()=>{this.detachDragHandlePointerReleaseListeners(),this.dragFromHandle=!1};document.addEventListener("pointerup",t,!0),document.addEventListener("pointercancel",t,!0),this.dragHandlePointerReleaseCleanup=()=>{document.removeEventListener("pointerup",t,!0),document.removeEventListener("pointercancel",t,!0)},this.el.dispatchEvent(new CustomEvent("xplListItemReorder",{bubbles:!0,composed:!0,detail:{exitKeyboardMode:!0}}))},this.preventRowLinkNavigation=t=>{this.href&&(t.preventDefault(),t.stopPropagation())},this.handleMouseDown=()=>{this.isKeyboardMode&&this.el.dispatchEvent(new CustomEvent("xplListItemReorder",{bubbles:!0,composed:!0,detail:{itemId:this.itemId,exitKeyboardMode:!0}}))},this.handleDragHandleKeyDown=t=>{this.disabled?"Escape"===t.key&&this.isKeyboardMode&&(t.preventDefault(),this.el.dispatchEvent(new CustomEvent("xplListItemReorder",{bubbles:!0,composed:!0,detail:{itemId:this.itemId,exitKeyboardMode:!0}}))):"Escape"!==t.key?this.isKeyboardMode?"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),this.el.dispatchEvent(new CustomEvent("xplListItemReorder",{bubbles:!0,composed:!0,detail:{direction:"ArrowUp"===t.key?"up":"down",item:this.el,itemId:this.itemId,keyboardMode:!0}}))):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.el.dispatchEvent(new CustomEvent("xplListItemReorder",{bubbles:!0,composed:!0,detail:{item:this.el,itemId:this.itemId,keyboardMode:!0}}))):this.isKeyboardMode&&(t.preventDefault(),this.el.dispatchEvent(new CustomEvent("xplListItemReorder",{bubbles:!0,composed:!0,detail:{itemId:this.itemId,exitKeyboardMode:!0}})))},this.handleRadioChange=()=>{this.disabled||this.itemSelect.emit({itemId:this.itemId})},this.handleRadioClick=t=>{this.href&&t.stopPropagation()}}handleItemChange(){this.updateSlotPresence()}handleKeyboardActiveChange(t){this.isKeyboardMode=t}handleSelectedChange(t){const e=this.el.querySelector('.xpl-list-item__selectable input[type="radio"]');e instanceof HTMLInputElement&&e.checked!==t&&(e.checked=t)}handleTitleBadgeVariantChange(){this.updateSlotPresence()}connectedCallback(){this.el.addEventListener("mousedown",this.handleMouseDown,!0)}disconnectedCallback(){this.el.removeEventListener("mousedown",this.handleMouseDown,!0),this.detachDragHandlePointerReleaseListeners()}componentWillLoad(){this.updateSlotPresence(),this.isKeyboardMode=!!this.keyboardActive;const t=this.el.getAttribute("item-id");t&&!this.itemId&&(this.itemId=t),this.el.id&&!this.itemId&&(this.itemId=this.el.id)}componentDidRender(){this.syncReorderDragHandleA11y()}handleSlotChange(){this.updateSlotPresence()}updateSlotPresence(){const t=this.el.getAttribute("title-badge-variant")||this.el.getAttribute("titlebadgevariant");this.slotPresence={actions:this.hasSlot("actions"),avatar:this.hasSlot("avatar"),badges:this.hasSlot("badges"),details:this.hasSlot("details"),errorText:this.hasSlot("error-text"),metadata:this.hasSlot("metadata"),stackedExtra1:this.hasSlot("stacked-extra-1"),stackedExtra2:this.hasSlot("stacked-extra-2"),stackedExtra3:this.hasSlot("stacked-extra-3"),title:this.hasSlot("title"),titleBadge:!!(this.titleBadgeVariant&&String(this.titleBadgeVariant).length>0||t&&t.length>0)}}detachDragHandlePointerReleaseListeners(){this.dragHandlePointerReleaseCleanup&&(this.dragHandlePointerReleaseCleanup(),this.dragHandlePointerReleaseCleanup=void 0)}hasSlot(t){if(Array.from(this.el.children).some((e=>e.getAttribute("slot")===t)))return!0;const e=Array.from(this.el.querySelectorAll(`slot[name="${t}"]`)).find((t=>t.closest("xpl-list-item")===this.el));return!(!e||"function"!=typeof e.assignedNodes)&&e.assignedNodes({flatten:!0}).length>0}getTitleSlotAccessibleText(){var t;const e=Array.from(this.el.children).find((t=>"title"===t.getAttribute("slot")));if(e)return null!==(t=e.textContent)&&void 0!==t?t:void 0;const i=Array.from(this.el.querySelectorAll('slot[name="title"]')).find((t=>t.closest("xpl-list-item")===this.el));if(i&&"function"==typeof i.assignedNodes){const t=i.assignedNodes({flatten:!0}).map((t=>{var e,i;return t.nodeType===Node.TEXT_NODE?null!==(e=t.textContent)&&void 0!==e?e:"":t.nodeType===Node.ELEMENT_NODE&&null!==(i=t.textContent)&&void 0!==i?i:""})).join("").trim();return t||void 0}}getRowIdForAccessibleLabel(){var t,e,i;const s=null===(t=this.itemId)||void 0===t?void 0:t.trim();if(s)return s;const a=null===(e=this.el.getAttribute("item-id"))||void 0===e?void 0:e.trim();if(a)return a;return(null===(i=this.el.id)||void 0===i?void 0:i.trim())||""}getSelectableRadioLabel(){var t;const e=this.getRowIdForAccessibleLabel();if(this.slotPresence.title){return(null===(t=this.getTitleSlotAccessibleText())||void 0===t?void 0:t.trim())||(e?`Select ${e}`:"Select list item")}return e?`Select ${e}`:"Select list item"}renderLegacyAvatarCell(){return this.item.avatar&&"string"==typeof this.item.avatar?"/"===this.item.avatar.slice(0,1)||"http"===this.item.avatar.slice(0,4)?s("xpl-avatar",{src:this.item.avatar,name:this.item.title}):s("xpl-avatar",{name:this.item.title},this.item.avatar):null}renderPropBasedItem(){const{item:t}=this,e=t.avatars||t.badges||t.subtext,i=t.href?"a":"div",l=t.href?{href:t.href}:{};return s(a,{role:"listitem",class:{"xpl-list-item":!0,"xpl-list-item--error":this.error,"xpl-list-item--disabled":this.disabled},hidden:this.hidden},this.renderLegacyAvatarCell(),s(i,Object.assign({class:"xpl-list-item-content"},l),s("div",{class:"xpl-list-left"},s("div",null,s("h4",null,t.title),t.metadata&&s("ul",{class:"xpl-list-item-metadata"},t.metadata.map((t=>"string"==typeof t?s("li",null,t):s("li",null,s("xpl-icon",{icon:t.icon})," ",t.text)))))),e&&s("div",{class:"xpl-list-right"},t.subtext&&s("div",{class:"xpl-list-item-subtext"},t.subtext),t.avatars&&s("div",{class:"xpl-avatar-group xpl-avatar-group--s"},t.avatars.map((t=>s("img",{src:t,alt:""})))),t.badges&&t.badges.map((t=>"string"==typeof t?s("xpl-badge",null,t):s("xpl-badge",{dot:t.dot,variant:t.variant},t.text)))),t.href?s("span",{class:"xpl-list-item__link-chevron","aria-hidden":"true"},s("xpl-icon",{icon:"chevron-right",size:12})):null))}renderTitleBadge(){if(!this.slotPresence.titleBadge)return null;const t=this.titleBadgeVariant||this.el.getAttribute("title-badge-variant")||this.el.getAttribute("titlebadgevariant")||"purple";return s("div",{class:"xpl-list-item__title-badge"},s("xpl-badge",{dotOnly:!0,size:"small",variant:t}))}renderSlotBasedItem(){var t;const e=this.slotPresence.details||this.slotPresence.badges||this.slotPresence.actions,i=this.slotPresence.title||this.slotPresence.metadata||this.slotPresence.stackedExtra1||this.slotPresence.stackedExtra2||this.slotPresence.stackedExtra3,r=this.radioName||this.el.getAttribute("radio-name")||"",n=this.reorderable&&!this.disabled,d="xpl-list-item__wrapper",h={draggable:n,onDragStart:this.handleDragStart,onDragOver:this.handleDragOver,onDragEnter:this.handleDragEnter,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop,onDragEnd:this.handleDragEnd},o=s(l,null,n&&s("div",{class:"xpl-list-item__reorderable"},s("xpl-button",{class:{"xpl-list-item__drag-handle":!0,"xpl-list-item__drag-handle--keyboard-mode":this.isKeyboardMode},type:"button",variant:"tertiary",sentiment:"neutral",iconOnly:!0,icon:this.isKeyboardMode?"caret-expand-y":"grip-dots-vertical",disabled:this.disabled,onClick:this.preventRowLinkNavigation,onMouseDown:this.handleDragHandleMouseDown,onKeyDown:this.handleDragHandleKeyDown})),this.selectable&&r?s("div",{class:"xpl-list-item__selectable",onClick:this.handleRadioClick},s("xpl-radio",{checked:this.selected,disabled:this.disabled,name:r,value:null!==(t=this.itemId)&&void 0!==t?t:"",onRadioChange:this.handleRadioChange},this.getSelectableRadioLabel())):null,this.slotPresence.avatar&&s("div",{class:"xpl-list-item__avatar",onClick:this.preventRowLinkNavigation},s("slot",{name:"avatar"})),i&&s("div",{class:"xpl-list-item__stacked"},(this.slotPresence.title||this.slotPresence.titleBadge)&&s("div",{class:"xpl-list-item__title-row"},s("div",{class:"xpl-list-item__title-wrapper"},this.renderTitleBadge(),s("slot",{name:"title"}))),this.showDivider&&s("xpl-divider",null),this.slotPresence.metadata&&s("div",{class:"xpl-list-item__metadata-row"},s("slot",{name:"metadata"})),this.slotPresence.stackedExtra1&&s("div",{class:"xpl-list-item__stacked-extra-1"},s("slot",{name:"stacked-extra-1"})),this.slotPresence.stackedExtra2&&s("div",{class:"xpl-list-item__stacked-extra-2"},s("slot",{name:"stacked-extra-2"})),this.slotPresence.stackedExtra3&&s("div",{class:"xpl-list-item__stacked-extra-3"},s("slot",{name:"stacked-extra-3"}))),e&&s("div",{class:"xpl-list-item__right"},this.slotPresence.details&&s("div",{class:"xpl-list-item__details"},s("slot",{name:"details"})),this.slotPresence.badges&&s("div",{class:"xpl-list-item__badges"},s("slot",{name:"badges"})),this.slotPresence.actions&&s("div",{class:"xpl-list-item__actions",onClick:this.preventRowLinkNavigation},s("slot",{name:"actions"}))),this.href?s("span",{class:"xpl-list-item__link-chevron","aria-hidden":"true"},s("xpl-icon",{icon:"chevron-right",size:12})):null);return s(a,{class:{"xpl-list-item":!0,"xpl-list-item--error":this.error||this.slotPresence.errorText,"xpl-list-item--disabled":this.disabled,"xpl-list-item--slot-based":!0,"xpl-list-item--selected":this.selected},hidden:this.hidden},this.href?s("div",{role:"listitem",class:"xpl-list-item__listitem-shell"},s("a",Object.assign({class:d,href:this.href},h),o)):s("div",Object.assign({role:"listitem",class:d},h),o),this.slotPresence.errorText&&s("div",{class:"xpl-list-item__error-text"},s("xpl-icon",{icon:"circle-warning",size:16}),s("slot",{name:"error-text"})))}syncReorderDragHandleA11y(){if(!this.reorderable||this.disabled)return;const t=this.el.querySelector("xpl-button.xpl-list-item__drag-handle"),e=null==t?void 0:t.querySelector("button");e&&(e.setAttribute("aria-label",this.isKeyboardMode?"Press arrow up or down to reorder, Escape to exit":"Press Enter or Space to activate keyboard reorder mode, or drag to reorder"),e.setAttribute("aria-pressed",this.isKeyboardMode?"true":"false"))}render(){return this.hidden?s(a,{hidden:!0}):this.item?this.renderPropBasedItem():this.renderSlotBasedItem()}get el(){return this}static get watchers(){return{item:[{handleItemChange:0}],keyboardActive:[{handleKeyboardActiveChange:0}],selected:[{handleSelectedChange:0}],titleBadgeVariant:[{handleTitleBadgeVariantChange:0}]}}},[260,"xpl-list-item",{disabled:[4],error:[4],hidden:[4],href:[1],item:[16],itemId:[1025,"item-id"],keyboardActive:[4,"keyboard-active"],radioName:[1,"radio-name"],reorderable:[4],selectable:[4],selected:[4],showDivider:[4,"show-divider"],titleBadgeVariant:[1,"title-badge-variant"],slotPresence:[32],isKeyboardMode:[32]},[[0,"slotchange","handleSlotChange"]],{item:[{handleItemChange:0}],keyboardActive:[{handleKeyboardActiveChange:0}],selected:[{handleSelectedChange:0}],titleBadgeVariant:[{handleTitleBadgeVariantChange:0}]}]);function x(){"undefined"!=typeof customElements&&["xpl-list-item","xpl-avatar","xpl-badge","xpl-button","xpl-divider","xpl-icon","xpl-radio"].forEach((t=>{switch(t){case"xpl-list-item":customElements.get(r(t))||customElements.define(r(t),p);break;case"xpl-avatar":customElements.get(r(t))||n();break;case"xpl-badge":customElements.get(r(t))||d();break;case"xpl-button":customElements.get(r(t))||h();break;case"xpl-divider":customElements.get(r(t))||o();break;case"xpl-icon":customElements.get(r(t))||c();break;case"xpl-radio":customElements.get(r(t))||m()}}))}export{p as X,x as d}
@@ -1 +0,0 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as i,Host as s,transformTag as d}from"@stencil/core/internal/client";import{t as r}from"./index3.js";const n=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.isOpenChange=o(this,"isOpenChange",7),this.isOpen=!1,this.disabled=!1,this.position="bottom-middle",this.display="arrow",this.isOpenState=this.isOpen,this.actualPosition=this.position,this.togglePopover=()=>{this.disabled||(this.isOpenState=!this.isOpenState)},this.handleKeyDown=t=>{"Escape"===t.key&&this.isOpenState&&(this.isOpenState=!1)},this.handleClickOutside=({target:t})=>{!this.el.contains(t)&&this.isOpenState&&(this.isOpenState=!1)}}onIsOpenPropChange(t){this.isOpenState=t}onIsOpenStateChange(t){this.updateActualPosition(t),this.isOpenChange.emit(t)}updateActualPosition(t){if(!this.triggerRef||!this.contentRef||!t)return;const e={"top-left":["top-left","bottom-left","top-right","bottom-right","top-middle","bottom-middle"],"bottom-left":["bottom-left","top-left","bottom-right","top-right","bottom-middle","top-middle"],"top-right":["top-right","bottom-right","top-left","bottom-left","top-middle","bottom-middle"],"bottom-right":["bottom-right","top-right","bottom-left","top-left","bottom-middle","top-middle"],"middle-left":["middle-left","middle-right","bottom-left","top-left","bottom-middle","top-middle"],"middle-right":["middle-right","middle-left","bottom-right","top-right","bottom-middle","top-middle"],"top-middle":["top-middle","top-start","top-end","bottom-middle","top-left","top-right"],"bottom-middle":["bottom-middle","bottom-start","bottom-end","top-middle","bottom-left","bottom-right"],"top-start":["top-start","bottom-start","top-end","bottom-end","top-middle","bottom-middle"],"top-end":["top-end","bottom-end","top-start","bottom-start","top-middle","bottom-middle"],"bottom-start":["bottom-start","top-start","bottom-end","top-end","bottom-middle","top-middle"],"bottom-end":["bottom-end","top-end","bottom-start","top-start","bottom-middle","top-middle"]}[this.position].find((t=>{const{top:e,left:o,bottom:i,right:s}=this.triggerRef.getBoundingClientRect(),{width:d,height:r}=this.contentRef.getBoundingClientRect(),{innerWidth:n,innerHeight:a}=window,p=i+r<a,l=e-r>=0,m=o-d>=0,h=s+d<n,b=(e+i)/2,c=t=>t&&b-r/2>=0&&b+r/2<=a,f=(o+s)/2,g=t=>t&&f-d/2>=0&&f+d/2<=n,u=o+d<n,w=s-d>=0;switch(t){case"top-left":return p&&m;case"middle-left":return c(m);case"bottom-left":return l&&m;case"top-right":return p&&h;case"middle-right":return c(h);case"bottom-right":return l&&h;case"top-middle":return g(l);case"bottom-middle":return g(p);case"top-start":return l&&u;case"top-end":return l&&w;case"bottom-start":return p&&u;case"bottom-end":return p&&w;default:return!1}}))||this.position;this.actualPosition=e}connectedCallback(){document.addEventListener("mousedown",this.handleClickOutside.bind(this)),document.addEventListener("keydown",this.handleKeyDown),this.updateListener=r((()=>{this.updateActualPosition(this.isOpenState)})),["resize","scroll"].forEach((t=>{window.addEventListener(t,this.updateListener,{passive:!0})}))}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleKeyDown),["resize","scroll"].forEach((t=>{window.removeEventListener(t,this.updateListener)}))}render(){return i(s,{key:"6fe479a39ee565772785c7b540c4e0915c5403e4"},i("div",{key:"350452ca097bab13e7f06b3d1aa5e2774d80104b",class:{"xpl-popover":!0,[`xpl-popover--${this.actualPosition}`]:!0,"xpl-popover--is-open":this.isOpenState}},i("span",{key:"0a9365be21ef70855bd7d304a77fc80d19ba16d3",role:"button",tabindex:"0","aria-haspopup":"dialog","aria-expanded":this.isOpenState?"true":"false",onClick:this.togglePopover,ref:t=>{this.triggerRef=t}},i("slot",{key:"df227b5bb7683599b4f82ef2a8c9d840b4920a61",name:"trigger"})),"arrow"===this.display&&i("div",{key:"dbf0b6998b3aa6ae40089e13bef86878037bbe24",class:"xpl-popover__arrow"},i("svg",{key:"2bf57b69abc556ba9a86b59f6347a2c8d81a67c3",width:"17",height:"14",xmlns:"http://www.w3.org/2000/svg"},i("path",{key:"36fef83ea3e2d3d4b388f5bdfe74d0bdc034be9d",d:"M0 5h15l-7.5 7.5L0 5Z",fill:"white",stroke:"none",class:"arrow-fill"}),i("path",{key:"1187a6ec22457ab6086753cf199398705541b1b4",d:"M0 5 L7.5 12.5 L15 5",fill:"none",stroke:"black","stroke-width":"1",class:"arrow-stroke"}))),i("div",{key:"7c6f063094de1462629a0db380597374c4231855",class:{"xpl-popover__content":!0,[`xpl-popover__content--display-${this.display}`]:!0},ref:t=>this.contentRef=t},i("slot",{key:"41062b776eed58b98452bb5a8d3b7099ac1138d2"}))))}get el(){return this}static get watchers(){return{isOpen:[{onIsOpenPropChange:0}],isOpenState:[{onIsOpenStateChange:0}]}}},[260,"xpl-popover",{isOpen:[4,"is-open"],disabled:[4],position:[1],display:[1],isOpenState:[32],actualPosition:[32],updateListener:[32]},void 0,{isOpen:[{onIsOpenPropChange:0}],isOpenState:[{onIsOpenStateChange:0}]}]);function a(){"undefined"!=typeof customElements&&["xpl-popover"].forEach((t=>{"xpl-popover"===t&&(customElements.get(d(t))||customElements.define(d(t),n))}))}export{n as P,a as d}
@@ -1 +0,0 @@
1
- import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as a,transformTag as d}from"@stencil/core/internal/client";import{v as l}from"./v4.js";const c=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.radioChange=i(this,"radioChange",7),this.id=l(),this.onChange=e=>{this.radioChange.emit(this.value?this.value:e.target.checked)}}get isChecked(){return void 0!==this.selectedValue&&void 0!==this.value?this.selectedValue===this.value:Boolean(this.checked)}render(){return t(a,{key:"1cda65b10ee03e06c30b2c501d7f2ec4153619f6",class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},t("input",{key:"b19a87e42feb5953ace4b8bd049427959c40a7e6",class:"xpl-radio",type:"radio",checked:this.isChecked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,onChange:this.onChange,value:this.value}),t("label",{key:"d07051460f7503a182b969eeafcb8eba5d61bef2",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},t("slot",{key:"06835704869d514a0d3eb01d671b6bec42524e89"}),this.description&&t("small",{key:"3e798a699fa53ca6c932e6466b438ed47aa46148",class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)))}},[260,"xpl-radio",{checked:[4],description:[1],disabled:[4],name:[1],value:[1],required:[4],selectedValue:[1,"selected-value"],styled:[4],id:[32]}]);function h(){"undefined"!=typeof customElements&&["xpl-radio"].forEach((e=>{"xpl-radio"===e&&(customElements.get(d(e))||customElements.define(d(e),c))}))}export{c as R,h as d}
@@ -1 +0,0 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as i,Host as l,Fragment as o,transformTag as n}from"@stencil/core/internal/client";import{t as a}from"./index3.js";import{d}from"./xpl-dropdown2.js";import{d as h}from"./xpl-dropdown-group2.js";import{d as c}from"./xpl-dropdown-heading2.js";import{d as r}from"./xpl-dropdown-option2.js";import{d as p}from"./xpl-icon2.js";import{d as u}from"./xpl-tag2.js";import{v as m}from"./v4.js";function v(e){return e.label||e.value}function b(e){return e.reduce(((e,t)=>[...e,...t.groupName?t.options:[t]]),[])}const g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectChange=s(this,"selectChange",7),this.changeEvent=s(this,"changeEvent",7),this.dropdownStateChange=s(this,"dropdownStateChange",7),this.triggerDropdown=s(this,"triggerDropdown",7),this.choices=[],this.selectIcon="chevron-down",this.dropdownPlacement="bottom-start",this.mode="single",this.truncate=!0,this.active=!1,this.id=m(),this.keepFocus=!1,this.visibleChoices=1/0,this.choicesState=[],this.value=this.calculateValue(),this.dropdownOpenState=!1,this.container=null,this.dropdown=null,this.handleResizeThrottled=a((()=>{this.maybeTruncateChoices()}),250),this.handleTabKeyDown=e=>{"Tab"===e.key&&(this.keepFocus=!0)},this.handleTagRemove=e=>{const t=t=>(null==e?void 0:e.value)&&t.value===e.value||(null==e?void 0:e.label)&&t.label===e.label;this.choicesState=this.choicesState.map((e=>{var s;return Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected,options:null===(s=e.options)||void 0===s?void 0:s.map((e=>Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected})))})}))},this.handleDropdownScroll=e=>{const{scrollTop:t,scrollHeight:s,clientHeight:i}=this.dropdown.querySelector(".xpl-dropdown-list");(0===t&&e.deltaY<0||t+i>=s&&e.deltaY>0)&&e.preventDefault()}}onChoicesPropChanged(e){this.choicesState=this.initializeChoicesState()}onSelectedValuesPropChanged(){this.choicesState=this.initializeChoicesState()}onChoicesStateChanged(){this.update()}handleValueStateChange(e){this.selectChange.emit(e),this.changeEvent.emit("single"===this.mode?e:(null==e?void 0:e.length)?e.split("|"):[]),this.customDisplayValue&&null!==this.container&&(this.container.querySelectorAll(".custom-display-value").forEach((t=>{t.classList.toggle("display-active",e.length>0),t.classList.toggle("display-inactive",0===e.length)})),this.container.querySelectorAll(".placeholder").forEach((t=>{t.classList.toggle("placeholder-hidden",e.length>0)})))}onDropdownOpenStateChanged(e){this.dropdownStateChange.emit(e)}initializeChoicesState(){return this.choices.map((e=>{var t;const s="string"==typeof this.selectedValues?[this.selectedValues]:this.selectedValues;return Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label)),options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label))})))})}))}maybeTruncateChoices(){var e,t;if("single"===this.mode||!this.truncate)return;const s=null===(e=this.container)||void 0===e?void 0:e.getBoundingClientRect().width;let i=0,l=0;const o=null===(t=b(this.choicesState))||void 0===t?void 0:t.filter((e=>e.isSelected));if(!o.length)return;const n=o.length;o.forEach(((e,t)=>(l+=function(e){const t=document.createElement("canvas").getContext("2d");return t.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",t.measureText(e).width+44}(v(o[t])),l>s-140||(i+=1),null))),i>=n&&(i=1/0),i<1&&(i=1),this.visibleChoices=i}closeDropdown(){var e;(null===(e=this.dropdown)||void 0===e?void 0:e.isOpen)&&(this.dropdown.isOpen=!1,this.active=!1)}calculateValue(){const e=b(this.choicesState).filter((e=>e.isSelected));return e.length?"single"===this.mode?e[0].value||e[0].label:e.map((e=>e.value||e.label)).join("|"):""}update(){this.value=this.calculateValue(),this.maybeTruncateChoices()}renderLabel(){return this.label||this.description?i("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.label,this.description&&i("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)):null}renderSelectedTags(){let e=0;const t=b(this.choicesState).filter((e=>e.isSelected));return t.length?t.map(((s,l)=>e>=this.visibleChoices?null:(e+=1,i("xpl-tag",{onClose:()=>this.handleTagRemove(t[l])},v(t[l]))))):null}renderError(){return this.error?i("label",{class:"xpl-input-error",htmlFor:this.id},i("xpl-icon",{icon:"alert-circle"}),this.error):null}componentWillLoad(){this.choicesState=this.initializeChoicesState()}handleClickEvent(e){const t=e.target.closest(".xpl-select");null!==t&&t===this.container||this.closeDropdown()}handleKeyDown(e){var t;"Escape"===e.key&&(this.active||(null===(t=this.container)||void 0===t?void 0:t.contains(document.activeElement)))&&this.closeDropdown()}handleResize(){this.handleResizeThrottled()}componentDidLoad(){requestAnimationFrame((()=>{this.maybeTruncateChoices()}))}disconnectedCallback(){var e;null===(e=this.handleResizeThrottled)||void 0===e||e.cancel()}handleDropdownTrigger(){var e;const t=null!==(e=this.dropdown.isOpen)&&void 0!==e&&e,s=!t;this.triggerDropdown.emit({prevState:t,nextState:s}).defaultPrevented||this.disabled||(this.dropdownOpenState=s,this.dropdown.isOpen=s)}async reset(){this.closeDropdown(),this.choicesState=this.choicesState.map((e=>{var t;return Object.assign(Object.assign({},e),{isSelected:!1,options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:!1})))})}))}render(){var e,t,s,n;const a=b(this.choicesState).filter((e=>e.isSelected)),d=(null===(e=a[0])||void 0===e?void 0:e.label)||(null===(t=a[0])||void 0===t?void 0:t.value),h=a.length>1&&this.visibleChoices<1/0&&this.truncate&&!this.customDisplayValue,c=`+ ${Math.abs(this.choicesState.filter((e=>e.isSelected)).length-this.visibleChoices)} more`;return i(l,{key:"09d3587fa268cb0621ea293d246e23cde93d75df",class:{"xpl-select":!0,"xpl-select--disabled":this.disabled,"xpl-select--no-truncate":!this.truncate,[null!==(s=this.classNames)&&void 0!==s?s:""]:!!this.classNames},onKeyDown:this.handleTabKeyDown,ref:e=>{this.container=e}},this.renderLabel(),i("div",{key:"007a61cc60c948d0691d6983cb197652084e417d",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":(null===(n=this.error)||void 0===n?void 0:n.length)>=0}},i("div",{key:"e1edfe6e4b205bd6332f07031ee51ef7f9f6ac91",class:"xpl-input-wrapper"},i("button",{key:"53d079f28b8a1bcdd5498287dfd88bb7a3ba7b50",class:"xpl-select__trigger",disabled:this.disabled,id:this.id,onKeyDown:this.handleTabKeyDown,onClick:e=>{e.preventDefault(),this.handleDropdownTrigger()},type:"button"},i("div",{key:"5cfec98b2e829ea48e96b373e09e740d5bf02ef6",class:{"xpl-select-value":!0,"xpl-select-value--active":"multi"===this.mode&&this.value.length>0,"has-value":this.value.length>0}},(()=>this.customDisplayValue?i(o,null,i("div",{class:{"custom-display-value":!0,"custom-display-value--inactive":0===this.value.length}},i("slot",{name:"custom-display-value"})),i("span",{class:{"xpl-placeholder--hidden":this.value.length>0}},this.placeholder)):"single"===this.mode?d||this.placeholder:this.value.length>0?this.renderSelectedTags():this.placeholder)(),h&&c),i("xpl-icon",{key:"8bb01d1e8b206fb3c1963cdebcd293eeb2277e05",class:"xpl-select__chevron-down",icon:this.selectIcon}))),!this.disabled&&i("xpl-dropdown",{key:"f5e770c4b26449f3025d172d768d6df69bd0ae03",ref:e=>{this.dropdown=e},isOpen:this.dropdownOpenState,options:this.choicesState,selectedValues:this.selectedValues,mode:this.mode,triggerId:this.id,update:(e,{component:t})=>{const{options:s}=t;s&&s.length>0&&(this.choicesState=s)},onIsOpenChange:e=>{this.dropdownOpenState=e.detail},onWheel:this.handleDropdownScroll,anchorToTrigger:!0,flipFallbackPlacements:this.dropdownFlipFallbackPlacements,placement:this.dropdownPlacement}),this.renderError()),i("input",{key:"fe84c16780622e730100a58a948fc4fe27f6ddb5",type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}}},[260,"xpl-select",{choices:[16],selectIcon:[1,"select-icon"],description:[1],disabled:[4],dropdownFlipFallbackPlacements:[16],dropdownPlacement:[1,"dropdown-placement"],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],customDisplayValue:[4,"custom-display-value"],selectedValues:[1,"selected-values"],classNames:[1,"class-names"],active:[32],id:[32],keepFocus:[32],visibleChoices:[32],choicesState:[32],value:[32],dropdownOpenState:[32],reset:[64]},[[8,"click","handleClickEvent"],[8,"keydown","handleKeyDown"],[9,"resize","handleResize"]],{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["xpl-select","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-tag"].forEach((e=>{switch(e){case"xpl-select":customElements.get(n(e))||customElements.define(n(e),g);break;case"xpl-dropdown":customElements.get(n(e))||d();break;case"xpl-dropdown-group":customElements.get(n(e))||h();break;case"xpl-dropdown-heading":customElements.get(n(e))||c();break;case"xpl-dropdown-option":customElements.get(n(e))||r();break;case"xpl-icon":customElements.get(n(e))||p();break;case"xpl-tag":customElements.get(n(e))||u()}}))}export{g as S,x as d}
@@ -1 +0,0 @@
1
- import{h as e,proxyCustomElement as t,HTMLElement as o,Host as a,transformTag as i}from"@stencil/core/internal/client";const l=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"14"},e("g",{filter:"url(#a)"},e("path",{d:"M0 5h15l-7.5 7.5L0 5Z"})),e("defs",null,e("filter",{id:"a",width:"20",height:"8.171",x:".5",y:"5","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse"},e("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),e("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e("feOffset",{dy:"1"}),e("feComposite",{in2:"hardAlpha",operator:"out"}),e("feColorMatrix",{values:"0 0 0 0 0.882353 0 0 0 0 0.886275 0 0 0 0 0.909804 0 0 0 1 0"}),e("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_20073_3067"}),e("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_20073_3067",result:"shape"})))),r=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.position="top-middle",this.hideArrow=!1}render(){return e(a,{key:"a118d629923a433680360f746e063ca94d5f1c6a"},e("div",{key:"cfd9742ee2cebd56994480bd2a601cb4e93b12a9",class:"xpl-tooltip-container"},e("slot",{key:"8aae99e1a187f8f737e896ccfd00d67f1cfeb3b3"}),e("div",{key:"4b418074b2ac7f8760f09e3af033ea93f7a0012e",class:`xpl-tooltip xpl-tooltip--${this.position}`},this.text),!this.hideArrow&&e("div",{key:"ef6a166f78250f1f98eae41661fd7020b36eeaae",class:"xpl-tooltip-arrow"},e(l,{key:"7baecae00ab178f715c89443d250b068861afe5f"}))))}},[260,"xpl-tooltip",{text:[1],position:[1],hideArrow:[4,"hide-arrow"]}]);function s(){"undefined"!=typeof customElements&&["xpl-tooltip"].forEach((e=>{"xpl-tooltip"===e&&(customElements.get(i(e))||customElements.define(i(e),r))}))}export{r as T,s as d}
@@ -1,65 +0,0 @@
1
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
2
- // require the crypto API and do not support built-in fallback to lower quality random number
3
- // generators (like Math.random()).
4
- var getRandomValues;
5
- var rnds8 = new Uint8Array(16);
6
- function rng() {
7
- // lazy load so that environments that need to polyfill have a chance to do so
8
- if (!getRandomValues) {
9
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
10
- // find the complete implementation of crypto (msCrypto) on IE11.
11
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
12
-
13
- if (!getRandomValues) {
14
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
15
- }
16
- }
17
-
18
- return getRandomValues(rnds8);
19
- }
20
-
21
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
22
-
23
- function validate(uuid) {
24
- return typeof uuid === 'string' && REGEX.test(uuid);
25
- }
26
-
27
- /**
28
- * Convert array of 16 byte values to UUID string format of the form:
29
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
30
- */
31
-
32
- var byteToHex = [];
33
-
34
- for (var i = 0; i < 256; ++i) {
35
- byteToHex.push((i + 0x100).toString(16).substr(1));
36
- }
37
-
38
- function stringify(arr) {
39
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
40
- // Note: Be careful editing this code! It's been tuned for performance
41
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
42
- var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
43
- // of the following:
44
- // - One or more input array values don't map to a hex octet (leading to
45
- // "undefined" in the uuid)
46
- // - Invalid input values for the RFC `version` or `variant` fields
47
-
48
- if (!validate(uuid)) {
49
- throw TypeError('Stringified UUID is invalid');
50
- }
51
-
52
- return uuid;
53
- }
54
-
55
- function v4(options, buf, offset) {
56
- options = options || {};
57
- var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
58
-
59
- rnds[6] = rnds[6] & 0x0f | 0x40;
60
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
61
-
62
- return stringify(rnds);
63
- }
64
-
65
- export { v4 as v };
File without changes
File without changes
File without changes
File without changes