@xplortech/apollo-core 2.7.0 → 2.7.1

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 (263) hide show
  1. package/.typings/apollo-components.html-data.json +97 -180
  2. package/build/style.css +220 -951
  3. package/dist/apollo-core/apollo-core.css +5 -35
  4. package/dist/apollo-core/apollo-core.esm.js +1 -1
  5. package/dist/apollo-core/{p-6c956d4e.entry.js → p-0bf50890.entry.js} +1 -1
  6. package/dist/apollo-core/p-1947e7a8.entry.js +1 -0
  7. package/dist/apollo-core/p-27928cb0.entry.js +1 -0
  8. package/dist/apollo-core/p-34438721.entry.js +1 -0
  9. package/dist/apollo-core/p-35c2f72d.entry.js +1 -0
  10. package/dist/apollo-core/p-368c81f1.entry.js +1 -0
  11. package/dist/apollo-core/p-36ba29da.entry.js +1 -0
  12. package/dist/apollo-core/p-406b27a8.entry.js +1 -0
  13. package/dist/apollo-core/p-5d63b4ce.entry.js +1 -0
  14. package/dist/apollo-core/{p-7eb86c63.entry.js → p-6a15f1e0.entry.js} +1 -1
  15. package/dist/apollo-core/p-8d692d05.entry.js +1 -0
  16. package/dist/apollo-core/{p-28d12fd3.entry.js → p-b61d7952.entry.js} +1 -1
  17. package/dist/apollo-core/{p-084d26ed.entry.js → p-ca127ee8.entry.js} +1 -1
  18. package/dist/apollo-core/p-d1c9c233.entry.js +1 -0
  19. package/dist/apollo-core/p-dc205893.entry.js +1 -0
  20. package/dist/apollo-core/p-e2a5d41c.entry.js +1 -0
  21. package/dist/cjs/apollo-core.cjs.js +1 -1
  22. package/dist/cjs/index-BQ97-AWw.js +10 -2
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/cjs/xpl-accordion.cjs.entry.js +2 -2
  25. package/dist/cjs/xpl-application-shell.cjs.entry.js +1 -1
  26. package/dist/cjs/{xpl-avatar_61.cjs.entry.js → xpl-avatar_54.cjs.entry.js} +238 -1683
  27. package/dist/cjs/xpl-button-row.cjs.entry.js +1 -1
  28. package/dist/cjs/xpl-calendar.cjs.entry.js +1 -1
  29. package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +2 -2
  30. package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +2 -2
  31. package/dist/cjs/xpl-dynamic-table.cjs.entry.js +1 -1
  32. package/dist/cjs/xpl-grid-item.cjs.entry.js +1 -1
  33. package/dist/cjs/xpl-grid.cjs.entry.js +1 -1
  34. package/dist/cjs/xpl-large-card.cjs.entry.js +1 -1
  35. package/dist/cjs/xpl-main-nav.cjs.entry.js +1 -1
  36. package/dist/cjs/xpl-table-header-cell.cjs.entry.js +57 -0
  37. package/dist/cjs/xpl-table-header.cjs.entry.js +14 -0
  38. package/dist/cjs/xpl-toggle.cjs.entry.js +3 -3
  39. package/dist/cjs/xpl-toolbar.cjs.entry.js +2 -2
  40. package/dist/collection/collection-manifest.json +2 -7
  41. package/dist/collection/components/xpl-accordion/xpl-accordion.js +2 -2
  42. package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +1 -1
  43. package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
  44. package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
  45. package/dist/collection/components/xpl-banner/xpl-banner.js +2 -2
  46. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +1 -1
  47. package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +1 -1
  48. package/dist/collection/components/xpl-button/xpl-button.js +1 -1
  49. package/dist/collection/components/xpl-button-row/xpl-button-row.js +1 -1
  50. package/dist/collection/components/xpl-calendar/xpl-calendar.js +1 -1
  51. package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +25 -25
  52. package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
  53. package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
  54. package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
  55. package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
  56. package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
  57. package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
  58. package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
  59. package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
  60. package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +77 -7
  61. package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +1 -1
  62. package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +2 -2
  63. package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +2 -2
  64. package/dist/collection/components/xpl-grid/xpl-grid.js +1 -1
  65. package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
  66. package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +53 -46
  67. package/dist/collection/components/xpl-icon/xpl-icon.js +2 -2
  68. package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +8 -8
  69. package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +3 -3
  70. package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +4 -4
  71. package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +5 -5
  72. package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +1 -1
  73. package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
  74. package/dist/collection/components/xpl-input/xpl-input.js +2 -2
  75. package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
  76. package/dist/collection/components/xpl-list/xpl-list.js +2 -2
  77. package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
  78. package/dist/collection/components/xpl-modal/xpl-modal.js +1 -1
  79. package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
  80. package/dist/collection/components/xpl-pagination/pagination.stories.js +18 -0
  81. package/dist/collection/components/xpl-pagination/xpl-pagination.js +7 -3
  82. package/dist/collection/components/xpl-panel/xpl-panel.js +2 -2
  83. package/dist/collection/components/xpl-popover/xpl-popover.js +4 -4
  84. package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +2 -2
  85. package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +1 -1
  86. package/dist/collection/components/xpl-radio/xpl-radio.js +3 -3
  87. package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +1 -1
  88. package/dist/collection/components/xpl-select/xpl-select.js +58 -6
  89. package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +2 -2
  90. package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +2 -2
  91. package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +1 -1
  92. package/dist/collection/components/xpl-slideout/xpl-slideout.js +1 -1
  93. package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +2 -2
  94. package/dist/collection/components/xpl-table/table.stories.js +67 -319
  95. package/dist/collection/components/xpl-table/xpl-table.js +151 -1456
  96. package/dist/collection/components/xpl-table-header/table-header.stories.js +126 -0
  97. package/dist/collection/components/xpl-table-header/xpl-table-header.js +7 -0
  98. package/dist/collection/components/xpl-table-header-cell/table-header-cell.stories.js +75 -0
  99. package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +188 -0
  100. package/dist/collection/components/xpl-tabs/xpl-tabs.js +5 -5
  101. package/dist/collection/components/xpl-tag/xpl-tag.js +2 -2
  102. package/dist/collection/components/xpl-toast/xpl-toast.js +2 -2
  103. package/dist/collection/components/xpl-toggle/xpl-toggle.js +3 -3
  104. package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +2 -2
  105. package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +1 -1
  106. package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +2 -2
  107. package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +2 -2
  108. package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +5 -5
  109. package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
  110. package/dist/components/index.js +1 -1
  111. package/dist/components/xpl-accordion.js +1 -1
  112. package/dist/components/xpl-application-shell.js +1 -1
  113. package/dist/components/xpl-backdrop2.js +1 -1
  114. package/dist/components/xpl-badge2.js +1 -1
  115. package/dist/components/xpl-banner.js +1 -1
  116. package/dist/components/xpl-breadcrumb-item.js +1 -1
  117. package/dist/components/xpl-breadcrumbs.js +1 -1
  118. package/dist/components/xpl-button-row.js +1 -1
  119. package/dist/components/xpl-button2.js +1 -1
  120. package/dist/components/xpl-calendar.js +1 -1
  121. package/dist/components/xpl-checkbox2.js +1 -1
  122. package/dist/components/xpl-choicelist.js +1 -1
  123. package/dist/components/xpl-content-area.js +1 -1
  124. package/dist/components/xpl-dashboard.js +1 -1
  125. package/dist/components/xpl-data-card.js +1 -1
  126. package/dist/components/xpl-divider2.js +1 -1
  127. package/dist/components/xpl-dropdown-group2.js +1 -1
  128. package/dist/components/xpl-dropdown-heading2.js +1 -1
  129. package/dist/components/xpl-dropdown-option2.js +1 -1
  130. package/dist/components/xpl-dropdown2.js +1 -1
  131. package/dist/components/xpl-dynamic-table-cell.js +1 -1
  132. package/dist/components/xpl-dynamic-table-row.js +1 -1
  133. package/dist/components/xpl-dynamic-table.js +1 -1
  134. package/dist/components/xpl-grid-item.js +1 -1
  135. package/dist/components/xpl-grid.js +1 -1
  136. package/dist/components/xpl-header-accordion.js +1 -1
  137. package/dist/components/xpl-icon2.js +1 -1
  138. package/dist/components/xpl-input-date2.js +1 -1
  139. package/dist/components/xpl-input-file2.js +1 -1
  140. package/dist/components/xpl-input-search2.js +1 -1
  141. package/dist/components/xpl-input2.js +1 -1
  142. package/dist/components/xpl-large-card.js +1 -1
  143. package/dist/components/xpl-list.js +1 -1
  144. package/dist/components/xpl-main-nav.js +1 -1
  145. package/dist/components/xpl-modal.js +1 -1
  146. package/dist/components/xpl-nav-header-menu.js +1 -1
  147. package/dist/components/xpl-nav-item.js +1 -1
  148. package/dist/components/xpl-pagination.js +1 -1
  149. package/dist/components/xpl-panel.js +1 -1
  150. package/dist/components/xpl-popover2.js +1 -1
  151. package/dist/components/xpl-progress-bar.js +1 -1
  152. package/dist/components/xpl-progress-indicator.js +1 -1
  153. package/dist/components/xpl-radio2.js +1 -1
  154. package/dist/components/xpl-secondary-nav.js +1 -1
  155. package/dist/components/xpl-select2.js +1 -1
  156. package/dist/components/xpl-side-nav-item.js +1 -1
  157. package/dist/components/xpl-side-nav.js +1 -1
  158. package/dist/components/xpl-skeleton.js +1 -1
  159. package/dist/components/xpl-slideout.js +1 -1
  160. package/dist/components/xpl-tab-panel.js +1 -1
  161. package/dist/components/xpl-table-header-cell.js +1 -1
  162. package/dist/components/xpl-table-header.js +1 -1
  163. package/dist/components/xpl-table.js +1 -1
  164. package/dist/components/xpl-tabs.js +1 -1
  165. package/dist/components/xpl-tag2.js +1 -1
  166. package/dist/components/xpl-toast.js +1 -1
  167. package/dist/components/xpl-toggle.js +1 -1
  168. package/dist/components/xpl-toolbar.js +1 -1
  169. package/dist/components/xpl-tooltip2.js +1 -1
  170. package/dist/components/xpl-top-nav-item2.js +1 -1
  171. package/dist/components/xpl-top-nav.js +1 -1
  172. package/dist/components/xpl-utility-bar.js +1 -1
  173. package/dist/docs/xpl-checkbox/readme.md +5 -7
  174. package/dist/docs/xpl-dropdown/readme.md +13 -11
  175. package/dist/docs/xpl-dynamic-table/readme.md +19 -22
  176. package/dist/docs/xpl-dynamic-table-cell/readme.md +18 -20
  177. package/dist/docs/xpl-dynamic-table-row/readme.md +19 -21
  178. package/dist/docs/xpl-icon/readme.md +1 -1
  179. package/dist/docs/xpl-select/readme.md +17 -15
  180. package/dist/docs/xpl-table/readme.md +46 -110
  181. package/dist/docs/{xpl-table/xpl-table-header → xpl-table-header}/readme.md +13 -13
  182. package/dist/docs/xpl-table-header-cell/readme.md +47 -0
  183. package/dist/esm/apollo-core.js +1 -1
  184. package/dist/esm/index-C7bgJs6C.js +10 -2
  185. package/dist/esm/loader.js +1 -1
  186. package/dist/esm/xpl-accordion.entry.js +2 -2
  187. package/dist/esm/xpl-application-shell.entry.js +1 -1
  188. package/dist/esm/{xpl-avatar_61.entry.js → xpl-avatar_54.entry.js} +239 -1677
  189. package/dist/esm/xpl-button-row.entry.js +1 -1
  190. package/dist/esm/xpl-calendar.entry.js +1 -1
  191. package/dist/esm/xpl-dynamic-table-cell.entry.js +2 -2
  192. package/dist/esm/xpl-dynamic-table-row.entry.js +2 -2
  193. package/dist/esm/xpl-dynamic-table.entry.js +1 -1
  194. package/dist/esm/xpl-grid-item.entry.js +1 -1
  195. package/dist/esm/xpl-grid.entry.js +1 -1
  196. package/dist/esm/xpl-large-card.entry.js +1 -1
  197. package/dist/esm/xpl-main-nav.entry.js +1 -1
  198. package/dist/esm/xpl-table-header-cell.entry.js +55 -0
  199. package/dist/esm/xpl-table-header.entry.js +12 -0
  200. package/dist/esm/xpl-toggle.entry.js +3 -3
  201. package/dist/esm/xpl-toolbar.entry.js +2 -2
  202. package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +2 -2
  203. package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +5 -0
  204. package/dist/types/components/xpl-header-accordion/xpl-header-accordion.d.ts +10 -9
  205. package/dist/types/components/xpl-pagination/pagination.stories.d.ts +13 -0
  206. package/dist/types/components/xpl-select/xpl-select.d.ts +3 -0
  207. package/dist/types/components/xpl-table/table.stories.d.ts +19 -161
  208. package/dist/types/components/xpl-table/xpl-table.d.ts +21 -123
  209. package/dist/types/components/{xpl-table/xpl-table-header → xpl-table-header}/table-header.stories.d.ts +16 -13
  210. package/dist/types/components/{xpl-table/xpl-table-header-cell → xpl-table-header-cell}/table-header-cell.stories.d.ts +20 -24
  211. package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +13 -0
  212. package/dist/types/components.d.ts +89 -391
  213. package/package.json +10 -1
  214. package/dist/apollo-core/p-146d5d55.entry.js +0 -1
  215. package/dist/apollo-core/p-16742606.entry.js +0 -1
  216. package/dist/apollo-core/p-3eb5eb7c.entry.js +0 -1
  217. package/dist/apollo-core/p-4882f0bd.entry.js +0 -1
  218. package/dist/apollo-core/p-64b34268.entry.js +0 -1
  219. package/dist/apollo-core/p-71b75f36.entry.js +0 -1
  220. package/dist/apollo-core/p-84254a24.entry.js +0 -1
  221. package/dist/apollo-core/p-9f2a0321.entry.js +0 -1
  222. package/dist/apollo-core/p-cde83ab0.entry.js +0 -1
  223. package/dist/apollo-core/p-e7363036.entry.js +0 -1
  224. package/dist/collection/components/xpl-table/utils/move-row-dom.js +0 -50
  225. package/dist/collection/components/xpl-table/utils/table-internal.js +0 -58
  226. package/dist/collection/components/xpl-table/xpl-table-body/xpl-table-body.js +0 -7
  227. package/dist/collection/components/xpl-table/xpl-table-cell/xpl-table-cell.js +0 -155
  228. package/dist/collection/components/xpl-table/xpl-table-footer/xpl-table-footer.js +0 -7
  229. package/dist/collection/components/xpl-table/xpl-table-footer-cell/xpl-table-footer-cell.js +0 -37
  230. package/dist/collection/components/xpl-table/xpl-table-header/table-header.stories.js +0 -131
  231. package/dist/collection/components/xpl-table/xpl-table-header/xpl-table-header.js +0 -7
  232. package/dist/collection/components/xpl-table/xpl-table-header-cell/table-header-cell.stories.js +0 -105
  233. package/dist/collection/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.js +0 -402
  234. package/dist/collection/components/xpl-table/xpl-table-row/xpl-table-row.js +0 -121
  235. package/dist/components/lifecycle.js +0 -1
  236. package/dist/components/xpl-table-body.d.ts +0 -11
  237. package/dist/components/xpl-table-body.js +0 -1
  238. package/dist/components/xpl-table-cell.d.ts +0 -11
  239. package/dist/components/xpl-table-cell.js +0 -1
  240. package/dist/components/xpl-table-cell2.js +0 -1
  241. package/dist/components/xpl-table-footer-cell.d.ts +0 -11
  242. package/dist/components/xpl-table-footer-cell.js +0 -1
  243. package/dist/components/xpl-table-footer-cell2.js +0 -1
  244. package/dist/components/xpl-table-footer.d.ts +0 -11
  245. package/dist/components/xpl-table-footer.js +0 -1
  246. package/dist/components/xpl-table-header-cell2.js +0 -1
  247. package/dist/components/xpl-table-row.d.ts +0 -11
  248. package/dist/components/xpl-table-row.js +0 -1
  249. package/dist/docs/xpl-table/xpl-table-body/readme.md +0 -10
  250. package/dist/docs/xpl-table/xpl-table-cell/readme.md +0 -33
  251. package/dist/docs/xpl-table/xpl-table-footer/readme.md +0 -10
  252. package/dist/docs/xpl-table/xpl-table-footer-cell/readme.md +0 -30
  253. package/dist/docs/xpl-table/xpl-table-header-cell/readme.md +0 -66
  254. package/dist/docs/xpl-table/xpl-table-row/readme.md +0 -19
  255. package/dist/types/components/xpl-table/utils/move-row-dom.d.ts +0 -3
  256. package/dist/types/components/xpl-table/utils/table-internal.d.ts +0 -8
  257. package/dist/types/components/xpl-table/xpl-table-body/xpl-table-body.d.ts +0 -3
  258. package/dist/types/components/xpl-table/xpl-table-cell/xpl-table-cell.d.ts +0 -11
  259. package/dist/types/components/xpl-table/xpl-table-footer/xpl-table-footer.d.ts +0 -3
  260. package/dist/types/components/xpl-table/xpl-table-footer-cell/xpl-table-footer-cell.d.ts +0 -4
  261. package/dist/types/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.d.ts +0 -32
  262. package/dist/types/components/xpl-table/xpl-table-row/xpl-table-row.d.ts +0 -13
  263. /package/dist/types/components/{xpl-table/xpl-table-header → xpl-table-header}/xpl-table-header.d.ts +0 -0
@@ -1 +1 @@
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 h=(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>`,d=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:h(),prevArrow:h(!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:"c2707549e3285693ce4c7e0449e047be90640504",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:"e6ac05a6d58d92570331489b8a317d17c0726873",class:"xpl-input-wrapper"},this.pre&&s("label",{key:"ef746e91506c2bd2c2bc9986bfbb7f0b82a0f079",class:"xpl-input-pre",htmlFor:this.inputId},this.pre),s("input",{key:"125e566456a2de4d75fe38fee50a78de886b8009",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:"399495edb8791cda73084dcef21663a3d207da2f",class:"xpl-input-calendar",icon:"calendar-month",size:24}),this.post&&s("label",{key:"6570bf947a23280b04389ed591f7ea401f14f1a5",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),d);break;case"xpl-icon":customElements.get(n(t))||o()}}))}export{d as I,c as d}
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 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as s,Host as l,transformTag as n}from"@stencil/core/internal/client";import{d as c}from"./xpl-icon2.js";const a=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.inputChange=t(this,"inputChange",7),this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.files=null,this.openFileDialog=()=>{var e;this.disabled||null===(e=this.fileInput)||void 0===e||e.click()},this.handleFileChange=e=>{this.files=Array.from(e.target.files)},this.onRemoveFileByIndex=e=>{this.files=this.files.filter(((i,t)=>t!==e))}}onFilesChange(e){this.inputChange.emit({type:"file",value:e})}async removeFileByIndex(e){this.onRemoveFileByIndex(e)}render(){var e,i;return s(l,{key:"579d1ec1094bc5b1aeec622996694728fb1facca",class:{"xpl-input-file":!0,"xpl-input-file--hide-trigger-on-select":this.hideTriggerOnSelect,"xpl-input-file--disabled":this.disabled}},s("span",{key:"66b3cc31f1e2bfa4ee1896e64a667e2a26166b50",class:{"xpl-input-file__trigger-wrapper":!0,"xpl-input-file__trigger-wrapper--hidden":this.hideTriggerOnSelect&&(null===(e=this.files)||void 0===e?void 0:e.length)>0},role:"button",tabIndex:0,onClick:this.openFileDialog},s("slot",{key:"53b23be4e2a5b0f920e650c14e591cb1de3b8bac",name:"trigger"})),(null===(i=this.files)||void 0===i?void 0:i.length)>0&&!this.hideFileNames&&s("ul",{key:"53a294c3765d5b6229f5ed79023095538a1c5edf",class:"xpl-input-file__file-list"},this.files.map(((e,i)=>s("li",{class:"xpl-input-file__file-item"},s("span",{class:"xpl-text-callout"},e.name),s("xpl-icon",{icon:"x-circle",size:24,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.onRemoveFileByIndex(i)},class:"xpl-input-file__remove-icon"}))))),this.accept&&!this.hideAcceptText&&s("span",{key:"afcd0be79ed4ffa5696990eb76d8615f61c430f9",class:"xpl-input-file__accept xpl-text-caption"},"Accepted file types: ",this.accept),s("input",{key:"08ffdfed6e25b11363e664abe7bdb66ae6b96bb7",onChange:this.handleFileChange,type:"file",ref:e=>{this.fileInput=e},hidden:!0,accept:this.accept,multiple:this.multiple,name:this.name}))}get el(){return this}static get watchers(){return{files:[{onFilesChange:0}]}}},[260,"xpl-input-file",{disabled:[4],name:[1],_id:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],files:[32],removeFileByIndex:[64]},void 0,{files:[{onFilesChange:0}]}]);function p(){"undefined"!=typeof customElements&&["xpl-input-file","xpl-icon"].forEach((e=>{switch(e){case"xpl-input-file":customElements.get(n(e))||customElements.define(n(e),a);break;case"xpl-icon":customElements.get(n(e))||c()}}))}export{a as I,p as d}
1
+ import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as s,Host as l,transformTag as n}from"@stencil/core/internal/client";import{d as c}from"./xpl-icon2.js";const a=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.inputChange=t(this,"inputChange",7),this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.files=null,this.openFileDialog=()=>{var e;this.disabled||null===(e=this.fileInput)||void 0===e||e.click()},this.handleFileChange=e=>{this.files=Array.from(e.target.files)},this.onRemoveFileByIndex=e=>{this.files=this.files.filter(((i,t)=>t!==e))}}onFilesChange(e){this.inputChange.emit({type:"file",value:e})}async removeFileByIndex(e){this.onRemoveFileByIndex(e)}render(){var e,i;return s(l,{key:"ec1645e7d48cf2b146727a6c131dbd7572468f17",class:{"xpl-input-file":!0,"xpl-input-file--hide-trigger-on-select":this.hideTriggerOnSelect,"xpl-input-file--disabled":this.disabled}},s("span",{key:"8dc3e290dcddba706316ec41443e2e87aa82f79f",class:{"xpl-input-file__trigger-wrapper":!0,"xpl-input-file__trigger-wrapper--hidden":this.hideTriggerOnSelect&&(null===(e=this.files)||void 0===e?void 0:e.length)>0},role:"button",tabIndex:0,onClick:this.openFileDialog},s("slot",{key:"2d2391a2ccca22170bfa0b9ace50a42fdba54284",name:"trigger"})),(null===(i=this.files)||void 0===i?void 0:i.length)>0&&!this.hideFileNames&&s("ul",{key:"c302bbbb5c1977c513dba82db70da1615f39a217",class:"xpl-input-file__file-list"},this.files.map(((e,i)=>s("li",{class:"xpl-input-file__file-item"},s("span",{class:"xpl-text-callout"},e.name),s("xpl-icon",{icon:"x-circle",size:24,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.onRemoveFileByIndex(i)},class:"xpl-input-file__remove-icon"}))))),this.accept&&!this.hideAcceptText&&s("span",{key:"9252c5450f32e8d2ed478af9f84eef4a26cee49f",class:"xpl-input-file__accept xpl-text-caption"},"Accepted file types: ",this.accept),s("input",{key:"d44213b6fd075bfb12c7857d3a56e06f78ef0fdc",onChange:this.handleFileChange,type:"file",ref:e=>{this.fileInput=e},hidden:!0,accept:this.accept,multiple:this.multiple,name:this.name}))}get el(){return this}static get watchers(){return{files:[{onFilesChange:0}]}}},[260,"xpl-input-file",{disabled:[4],name:[1],_id:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],files:[32],removeFileByIndex:[64]},void 0,{files:[{onFilesChange:0}]}]);function p(){"undefined"!=typeof customElements&&["xpl-input-file","xpl-icon"].forEach((e=>{switch(e){case"xpl-input-file":customElements.get(n(e))||customElements.define(n(e),a);break;case"xpl-icon":customElements.get(n(e))||c()}}))}export{a as I,p as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as s,HTMLElement as t,createEvent as i,h as e,Host as h,transformTag as r}from"@stencil/core/internal/client";import{d as a}from"./xpl-icon2.js";const n=s(class extends t{constructor(s){super(),!1!==s&&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.hasAncestorForm=!1,this.ariaLabel="Search",this.autocomplete="off",this.disabled=!1,this.hasError=!1,this.hasVisibleLabel=!1,this.placeholder="Search",this.readonly=!1,this.required=!1,this.shape="rounded",this.value="",this.handleInnerFormSubmit=s=>{s.preventDefault(),this.disabled||this.readonly||this.emitSearchCommit(this.value.trim())},this.handleClear=s=>{var t;s.preventDefault(),this.disabled||this.readonly||(this.value="",this.valueChange.emit(""),this.inputEvent.emit(""),null===(t=this.inputEl)||void 0===t||t.focus())},this.handleInput=s=>{const t=s.target;this.value=t.value,this.valueChange.emit(t.value),this.inputEvent.emit(t.value)},this.handleKeyDown=s=>{"Enter"===s.key&&(this.disabled||this.readonly||s.target.form||(s.preventDefault(),this.emitSearchCommit(this.value.trim())))},this.handleFocus=s=>{this.focusEvent.emit(s)},this.handleBlur=s=>{this.blurEvent.emit(s)}}connectedCallback(){this.syncAncestorFormFlag()}async setFocus(){var s;null===(s=this.inputEl)||void 0===s||s.focus()}syncAncestorFormFlag(){const s=this.el,t=Boolean(s&&"function"==typeof s.closest&&s.closest("form"));this.hasAncestorForm!==t&&(this.hasAncestorForm=t)}get hasValue(){return void 0!==this.value&&this.value.length>0}get resolvedInputAriaLabel(){var s;if(!this.hasVisibleLabel)return(null!==(s=this.ariaLabel)&&void 0!==s?s:"").trim()||"Search"}get rendersInnerSearchForm(){return!this.hasAncestorForm}emitSearchCommit(s){this.search.emit(s)}renderShell(){const s=e("div",{class:"xpl-input-search__shell"},e("span",{class:"xpl-input-search__icon","aria-hidden":"true"},e("xpl-icon",{icon:"magnifier",size:20})),e("input",{"aria-describedby":this.hasError?this.errorMessageId:void 0,"aria-invalid":this.hasError?"true":void 0,"aria-label":this.resolvedInputAriaLabel,autocomplete:this.autocomplete,class:"xpl-input-search__input",disabled:this.disabled,id:this.inputId,name:this.name,onBlur:this.handleBlur,onFocus:this.handleFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,placeholder:this.placeholder,readonly:this.readonly,ref:s=>{this.inputEl=null!=s?s:void 0},required:this.required,role:"searchbox",type:"text",value:this.value}),e("button",{"aria-hidden":this.hasValue?void 0:"true","aria-label":"Clear search",class:"xpl-input-search__clear",disabled:this.disabled||this.readonly,onClick:this.handleClear,type:"button"},e("xpl-icon",{icon:"circle-xmark",size:16})));return this.rendersInnerSearchForm?e("form",{class:"xpl-input-search__form",onSubmit:this.handleInnerFormSubmit},s):s}render(){return e(h,{key:"ac235500df2d6958d9070535f922a018bce14906",class:{"xpl-input-search":!0,"xpl-input-search--disabled":this.disabled,"xpl-input-search--error":this.hasError,"xpl-input-search--has-value":this.hasValue,"xpl-input-search--readonly":this.readonly,"xpl-input-search--shape-box":"box"===this.shape}},this.renderShell())}get el(){return this}},[0,"xpl-input-search",{ariaLabel:[1,"aria-label"],autocomplete:[1],disabled:[4],errorMessageId:[1,"error-message-id"],hasError:[4,"has-error"],hasVisibleLabel:[4,"has-visible-label"],inputId:[1,"input-id"],name:[1],placeholder:[1],readonly:[4],required:[4],shape:[1],value:[1025],hasAncestorForm:[32],setFocus:[64]}]);function l(){"undefined"!=typeof customElements&&["xpl-input-search","xpl-icon"].forEach((s=>{switch(s){case"xpl-input-search":customElements.get(r(s))||customElements.define(r(s),n);break;case"xpl-icon":customElements.get(r(s))||a()}}))}export{n as I,l as d}
1
+ import{proxyCustomElement as s,HTMLElement as t,createEvent as i,h as e,Host as h,transformTag as r}from"@stencil/core/internal/client";import{d as a}from"./xpl-icon2.js";const n=s(class extends t{constructor(s){super(),!1!==s&&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.hasAncestorForm=!1,this.ariaLabel="Search",this.autocomplete="off",this.disabled=!1,this.hasError=!1,this.hasVisibleLabel=!1,this.placeholder="Search",this.readonly=!1,this.required=!1,this.shape="rounded",this.value="",this.handleInnerFormSubmit=s=>{s.preventDefault(),this.disabled||this.readonly||this.emitSearchCommit(this.value.trim())},this.handleClear=s=>{var t;s.preventDefault(),this.disabled||this.readonly||(this.value="",this.valueChange.emit(""),this.inputEvent.emit(""),null===(t=this.inputEl)||void 0===t||t.focus())},this.handleInput=s=>{const t=s.target;this.value=t.value,this.valueChange.emit(t.value),this.inputEvent.emit(t.value)},this.handleKeyDown=s=>{"Enter"===s.key&&(this.disabled||this.readonly||s.target.form||(s.preventDefault(),this.emitSearchCommit(this.value.trim())))},this.handleFocus=s=>{this.focusEvent.emit(s)},this.handleBlur=s=>{this.blurEvent.emit(s)}}connectedCallback(){this.syncAncestorFormFlag()}async setFocus(){var s;null===(s=this.inputEl)||void 0===s||s.focus()}syncAncestorFormFlag(){const s=this.el,t=Boolean(s&&"function"==typeof s.closest&&s.closest("form"));this.hasAncestorForm!==t&&(this.hasAncestorForm=t)}get hasValue(){return void 0!==this.value&&this.value.length>0}get resolvedInputAriaLabel(){var s;if(!this.hasVisibleLabel)return(null!==(s=this.ariaLabel)&&void 0!==s?s:"").trim()||"Search"}get rendersInnerSearchForm(){return!this.hasAncestorForm}emitSearchCommit(s){this.search.emit(s)}renderShell(){const s=e("div",{class:"xpl-input-search__shell"},e("span",{class:"xpl-input-search__icon","aria-hidden":"true"},e("xpl-icon",{icon:"magnifier",size:20})),e("input",{"aria-describedby":this.hasError?this.errorMessageId:void 0,"aria-invalid":this.hasError?"true":void 0,"aria-label":this.resolvedInputAriaLabel,autocomplete:this.autocomplete,class:"xpl-input-search__input",disabled:this.disabled,id:this.inputId,name:this.name,onBlur:this.handleBlur,onFocus:this.handleFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,placeholder:this.placeholder,readonly:this.readonly,ref:s=>{this.inputEl=null!=s?s:void 0},required:this.required,role:"searchbox",type:"text",value:this.value}),e("button",{"aria-hidden":this.hasValue?void 0:"true","aria-label":"Clear search",class:"xpl-input-search__clear",disabled:this.disabled||this.readonly,onClick:this.handleClear,type:"button"},e("xpl-icon",{icon:"circle-xmark",size:16})));return this.rendersInnerSearchForm?e("form",{class:"xpl-input-search__form",onSubmit:this.handleInnerFormSubmit},s):s}render(){return e(h,{key:"c8f0c2b1c96cc8c6d9a2c390e791977b031adb9b",class:{"xpl-input-search":!0,"xpl-input-search--disabled":this.disabled,"xpl-input-search--error":this.hasError,"xpl-input-search--has-value":this.hasValue,"xpl-input-search--readonly":this.readonly,"xpl-input-search--shape-box":"box"===this.shape}},this.renderShell())}get el(){return this}},[0,"xpl-input-search",{ariaLabel:[1,"aria-label"],autocomplete:[1],disabled:[4],errorMessageId:[1,"error-message-id"],hasError:[4,"has-error"],hasVisibleLabel:[4,"has-visible-label"],inputId:[1,"input-id"],name:[1],placeholder:[1],readonly:[4],required:[4],shape:[1],value:[1025],hasAncestorForm:[32],setFocus:[64]}]);function l(){"undefined"!=typeof customElements&&["xpl-input-search","xpl-icon"].forEach((s=>{switch(s){case"xpl-input-search":customElements.get(r(s))||customElements.define(r(s),n);break;case"xpl-icon":customElements.get(r(s))||a()}}))}export{n as I,l as d}
@@ -1 +1 @@
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 f}from"./xpl-popover2.js";const b=(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:"6ed0e8da81a96e0e4e7078a7477c9a4ee92532ba",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},s("xpl-input",{key:"bae0f7e9b9e3f14b5d780a0300ef672da9301596",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:"cd8ae7e4c7d130bdbf44aeb2f806b3c9a490d8bb",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:"79d8146efc51fb1fba4e595655274beff9e2f09a",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:"f617abbc8656f0d9418e3bb87f0fdcd8b1646138",class:"xpl-input-wrapper"},this.isInternational&&s("button",{key:"133d07a3d70e8c9e3c3a6690ae2296f176a409f7",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:"20928aee771232962454e469210a31718922286c",class:"xpl-input-phone__flag",icon:S(this.selectedCountry.name),size:24,"aria-hidden":"true"}),s("xpl-icon",{key:"22078ac403d3965ba72ee9164520778f3f65cc56",class:"xpl-input-phone__trigger-icon",icon:"chevron-down",size:20,"aria-hidden":"true"})),s("div",{key:"29cab6a655c36fd5add277b6d3c0f06c498a742d",class:"xpl-input-phone__input-wrap"},this.isInternational&&s("span",{key:"e83457a14cd689f43082afb611c7641f1353da36",class:"xpl-input-phone__dial-code"},this.effectiveDialCode),s("input",{key:"ee747daab159986e319599ec6705c8f5edc78c3e",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:"ddb1bb6cf9ab3fb4bc3295db64fc986fe5dbf69b",type:"button",class:"xpl-input-phone__clear","aria-label":"Clear phone number",onClick:this.handleClear},s("xpl-icon",{key:"c0f3201d0b34f9cbe5af9247540199db0c184514",icon:"x-circle",size:16})))),this.isInternational&&this.isEditable&&s("xpl-dropdown",{key:"8d4e50ee17d880272eaccf08cf8c84fc4400c36d",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:"5808ecb917ee94ba31c8ab106152d2d61feae74a",slot:"header",class:"xpl-input-phone__search-wrap"},s("xpl-input",{key:"76a2477f0e039e390dd26a0c34cdab758d3c10d6",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:"0a6b49b3a0df0769fb5dfa59f97c40adeaee8dd1",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=b(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=b(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:"6f03535db1b5f451c74a0f1a1abc586605e5c9ca",class:"xpl-input-color"},s("xpl-popover",{key:"dae1f3a3b7afdd9231b6feba2d3711fbd1d6716e",disabled:this.disabled,display:"menu"},s("div",{key:"a8402cf534186d06f940c3e3436db17afb0152e8",slot:"trigger"},s("div",{key:"e9e775229df2a4f8afa252ef03c0a0cd15a93aa4",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},s("span",{key:"9abe3e899192f4f08e682f8d7a9a9af9adf5982f",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:"9e6832ca2ca1b91c9bf91b1816c1f7c8169202f3",size:20,icon:"eye-dropper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),s("div",{key:"86643ca93847cff19653ebb54160588f2764ae17",class:"xpl-input-color__menu"},s("div",{key:"40f43b769954163f0d22ff8dc80bcd2e0df4777e",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:"29f42021c1e55827f1fffcdd416608f01b6bda81",class:"xpl-input-color__sl-thumb",style:h})),s("div",{key:"e727c66cd44ff40c672f58ae9264485cda3698b7",class:"xpl-input-color__grid"},s("input",{key:"899cdc6cf61d1452809850dbc847c9df8265437b",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:"3e72ef16b142fe44bebbcbbd2686fcfa3fb958bc",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:"c389627f5c0fa8878ead7d6765ecbe9b2f82debb",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${e}, ${i}, ${a})`}})),s("div",{key:"efd8daf09c022fdc19a6373f0bcd1d32b7548fd2",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))||f()}}))}const A=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.focusEvent=i(this,"focusEvent",7),this.blurEvent=i(this,"blurEvent",7),this.valueChange=i(this,"valueChange",7),this.inputEvent=i(this,"inputEvent",7),this.search=i(this,"search",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.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,_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});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});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});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});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,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:"21535bfebdb899ef3bf28ae4ac252ffcc8b03388",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:"f72b35d866295451cf74832dd191853e77190590",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&s("small",{key:"712910cd0e7a1db84add0f1483fdc0da6c38a07d"},this.description)),this.renderInput(),(null===(t=this.error)||void 0===t?void 0:t.length)>0&&s("label",{key:"d8fcab92ea7f4989e9d2db1117e689ad9a26ced8",class:"xpl-input-error",htmlFor:this._id,id:`${this._id}-error`},s("xpl-icon",{key:"cbe4f7792ea586c78b7bc0f34d277bfa5977d50e",icon:"alert-circle",size:16}),s("span",{key:"91f88da21c48f0bf069e4c20205a81cfbb30fb1e"},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))||f()}}))}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
+ 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.focusEvent=i(this,"focusEvent",7),this.blurEvent=i(this,"blurEvent",7),this.valueChange=i(this,"valueChange",7),this.inputEvent=i(this,"inputEvent",7),this.search=i(this,"search",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.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,_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});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});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});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});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,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:"4b60d50e8b88f905777d76197afe181026ae5a94",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:"8b0dc01150607c2943ccc541b9acd3a7fa5d2143",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&s("small",{key:"8d1f988983fd54e3bc231c0a8091b4fe83ed8ab8"},this.description)),this.renderInput(),(null===(t=this.error)||void 0===t?void 0:t.length)>0&&s("label",{key:"349492ed192e6105dd549634da1ce2c0371f5b9d",class:"xpl-input-error",htmlFor:this._id,id:`${this._id}-error`},s("xpl-icon",{key:"7903d2f35033ceefcf94eff8081997b4aec3c1a9",icon:"alert-circle",size:16}),s("span",{key:"e3d557f705647eb304b4bf38151dcf01c17fce15"},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 +1 @@
1
- import{proxyCustomElement as c,HTMLElement as e,h as a,Host as d,transformTag as t}from"@stencil/core/internal/client";import{d as s}from"./xpl-icon2.js";const r=c(class extends e{constructor(c){super(),!1!==c&&this.__registerHost()}componentDidLoad(){if(this.link){const c=this.el.getElementsByTagName("a")[0]||this.el.getElementsByTagName("button")[0],e=document.createTextNode(this.name),a=document.createElement("span");a.appendChild(e),c.setAttribute("class","xpl-large-card__anchor"),c.appendChild(a)}}render(){const c="graph-content",e=this.el.querySelector(`[slot="${c}"]`);return a(d,{key:"886078965cb1ca87fd9c4f45a8b06f089a4b2e04",role:"group",class:"xpl-large-card "+(this.link?"xpl-large-card__link":""),tabindex:"0"},a("dt",{key:"1c2006c9167b2d46262b222ace3c5e9135863783",class:"xpl-large-card__header"},a("header",{key:"21ba4629c7e3d0d9dff98f9dde2ac4bc9f1f494e"},a("slot",{key:"d50991dc4fcca6c56c04c7cc9a401f0894035aa2",name:"title"},this.name),this.link&&a("span",{key:"35b1b15786c1674f6d1797ec3b04da81b27d5d3a",class:"xpl-data-card__header-arrow"},a("xpl-icon",{key:"f52a7a39b3d044341296d88adb9d2bc07cdec9ab",icon:"chevron-right",size:16}))),this.description&&a("div",{key:"bac9d6cec27272d277c991c81e651714603066a2",class:"xpl-large-card__description"},this.description)),a("dd",{key:"9da3ca8ec575a6755f1f47065299ec3ab3e5169b",class:"xpl-large-card__body"},e&&a("slot",{key:"022da3c1e07c264441c58f7d42d6edca109a504d",name:c})))}get el(){return this}},[260,"xpl-large-card",{link:[4],name:[1],description:[1]}]),l=r,n=function(){"undefined"!=typeof customElements&&["xpl-large-card","xpl-icon"].forEach((c=>{switch(c){case"xpl-large-card":customElements.get(t(c))||customElements.define(t(c),r);break;case"xpl-icon":customElements.get(t(c))||s()}}))};export{l as XplLargeCard,n as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as a,h as c,Host as t,transformTag as s}from"@stencil/core/internal/client";import{d}from"./xpl-icon2.js";const r=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost()}componentDidLoad(){if(this.link){const e=this.el.getElementsByTagName("a")[0]||this.el.getElementsByTagName("button")[0],a=document.createTextNode(this.name),c=document.createElement("span");c.appendChild(a),e.setAttribute("class","xpl-large-card__anchor"),e.appendChild(c)}}render(){const e="graph-content",a=this.el.querySelector(`[slot="${e}"]`);return c(t,{key:"9b45179112de8d1ac309520425a1a5c340493487",role:"group",class:"xpl-large-card "+(this.link?"xpl-large-card__link":""),tabindex:"0"},c("dt",{key:"4838c93a72df9ea794b3bbbd7f78f3e84a606109",class:"xpl-large-card__header"},c("header",{key:"eb4b2e8515be1e0763595e1cf646dc2b25bfb739"},c("slot",{key:"62fdafe4b8ce03af5ff353c3ffa377fa547b572b",name:"title"},this.name),this.link&&c("span",{key:"ac0086a3402af5f12668a560ad418aaf40a56357",class:"xpl-data-card__header-arrow"},c("xpl-icon",{key:"74eaffc571098a88d69d7248166889671ba441a2",icon:"chevron-right",size:16}))),this.description&&c("div",{key:"d7d2499b7d8da9c09062ea5a456b588e52df2d82",class:"xpl-large-card__description"},this.description)),c("dd",{key:"652e32e8b200e783f03608f97cbbcc70f59421e3",class:"xpl-large-card__body"},a&&c("slot",{key:"9d9f285d34bd8e2b6666577bd2023ae474636c4c",name:e})))}get el(){return this}},[260,"xpl-large-card",{link:[4],name:[1],description:[1]}]),l=r,n=function(){"undefined"!=typeof customElements&&["xpl-large-card","xpl-icon"].forEach((e=>{switch(e){case"xpl-large-card":customElements.get(s(e))||customElements.define(s(e),r);break;case"xpl-icon":customElements.get(s(e))||d()}}))};export{l as XplLargeCard,n as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as l,transformTag as n}from"@stencil/core/internal/client";import{T as r}from"./lifecycle.js";import{d as o}from"./xpl-avatar2.js";import{d as a}from"./xpl-badge2.js";import{d}from"./xpl-button2.js";import{d as h}from"./xpl-divider2.js";import{d as c}from"./xpl-icon2.js";import{d as m}from"./xpl-list-item2.js";import{d as u}from"./xpl-radio2.js";let p=!1;const b=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.itemSelect=i(this,"itemSelect",7),this.orderChange=i(this,"orderChange",7),this.draggedItem=null,this.listItems=[],this.nextAutoItemIdSeq=0,this.radioName="xpl-list-radio-"+Math.random().toString(36).slice(2,11),this.timers=new r,this.keyboardReorderItemId=null,this.reorderLiveMessage="",this.items=[],this.reorderable=!1,this.selectable=!1}handleKeyboardReorderItemIdChange(){this.collectListItems()}handleItemsChange(){this.collectListItems()}handleReorderableChange(){this.collectListItems()}handleSelectableChange(){this.collectListItems()}componentWillLoad(){this.collectListItems(),this.items.length>0&&!p&&(p=!0,console.warn('[xpl-list] The "items" prop is deprecated. Use slot-based xpl-list-item children instead.'))}componentDidLoad(){this.collectListItems()}disconnectedCallback(){this.timers.dispose()}handleKeyDown(e){if(!this.selectable||"Escape"!==e.key||e.defaultPrevented)return;const i=function(e){var i,s;const l=(null!==(s=null===(i=e.composedPath)||void 0===i?void 0:i.call(e))&&void 0!==s?s:[]).find((e=>e instanceof t&&"xpl-list-item"===e.tagName.toLowerCase()));return null!=l?l:null}(e);if(!i||i.parentElement!==this.el)return;const s=i.querySelector('.xpl-list-item__selectable input[type="radio"]');(s instanceof HTMLInputElement&&s.checked||i.selected)&&(e.preventDefault(),this.clearSelection())}handleChildItemSelect(e){if(!this.selectable)return;const t=e.target;"XPL-LIST-ITEM"===t.tagName&&t.parentElement===this.el&&this.syncSelectionFromChildDetail(e.detail)}handleSlotChange(){this.collectListItems()}handleItemDragStart(e){var t;const i=null===(t=e.detail)||void 0===t?void 0:t.item;if(!i||i.parentElement!==this.el)return;null!==this.keyboardReorderItemId&&(this.keyboardReorderItemId=null),this.draggedItem=i;const s=this.draggedItem.querySelector(".xpl-list-item__wrapper");null==s||s.classList.add("dragging")}handleItemDragEnd(e){var t;const i=null===(t=e.detail)||void 0===t?void 0:t.item;if(i&&i.parentElement===this.el){if(this.draggedItem){const e=this.draggedItem.querySelector(".xpl-list-item__wrapper");null==e||e.classList.remove("dragging")}this.draggedItem=null}}handleItemDrop(e){var t;const i=null===(t=e.detail)||void 0===t?void 0:t.item;if(i&&i.parentElement===this.el)if(this.draggedItem&&this.draggedItem.parentElement!==this.el)this.draggedItem=null;else{if(this.draggedItem){const e=this.draggedItem.querySelector(".xpl-list-item__wrapper");null==e||e.classList.remove("dragging")}if(this.draggedItem&&i&&this.draggedItem!==i){const e=this.getVisibleListItemElements(),t=e.indexOf(this.draggedItem),s=e.indexOf(i);if(-1!==t&&-1!==s){const e=t>s?"up":"down",l=this.getItemRowId(this.draggedItem);if("up"===e)this.el.insertBefore(this.draggedItem,i);else{const e=this.getNextVisibleListItemAfter(i);e?this.el.insertBefore(this.draggedItem,e):this.el.appendChild(this.draggedItem)}const n=this.getOrderedItemIds();this.orderChange.emit({itemId:l,direction:e,orderedItemIds:n}),this.announceReorder(l,n),this.el.dispatchEvent(new CustomEvent("xplListReorder",{bubbles:!0,composed:!0,detail:{itemId:l,direction:e,fromIndex:t,toIndex:s,orderedItemIds:n}}))}}this.draggedItem=null,e.preventDefault()}}handleItemReorder(e){e.stopPropagation();const{direction:t,itemId:i,keyboardMode:s,exitKeyboardMode:l}=e.detail;void 0!==s&&(this.keyboardReorderItemId=s?i:null),l&&(this.keyboardReorderItemId=null),t&&i&&this.performReorder(i,t)&&this.el.dispatchEvent(new CustomEvent("xplListReorder",{bubbles:!0,composed:!0,detail:Object.assign(Object.assign({},e.detail),{orderedItemIds:this.getOrderedItemIds()})}))}async clearSelection(){if(!this.selectable)return;this.collectListItems();const e=[];this.listItems.forEach((t=>{const i=t.querySelector('.xpl-list-item__selectable input[type="radio"]');if(i instanceof HTMLInputElement&&i.checked||t.selected){const i=this.getItemRowId(t);i&&e.push(i)}}));const t=[...new Set(e)];this.listItems.forEach((e=>{const t=e.querySelector('.xpl-list-item__selectable input[type="radio"]');t instanceof HTMLInputElement&&(t.checked=!1)})),this.listItems.forEach((e=>{e.selected&&(e.selected=!1)})),t.forEach((e=>{this.itemSelect.emit({itemId:e})}))}syncSelectionFromChildDetail(e){this.collectListItems();const t=e.itemId,i=null!=t&&""!==t;this.listItems.forEach((e=>{const s=this.getItemRowId(e);e.selected=i&&s===t}))}performReorder(e,i){this.listItems=this.getVisibleListItemElements();const s=this.listItems.findIndex((t=>this.getItemRowId(t)===e));if(-1===s)return!1;const l="up"===i?s-1:s+1;if(l<0||l>=this.listItems.length)return!1;const n=this.listItems[s],r=this.listItems[l];if("up"===i)this.el.insertBefore(n,r);else{const e=this.getNextVisibleListItemAfter(r);e?this.el.insertBefore(n,e):this.el.appendChild(n)}const o=this.getOrderedItemIds();return this.orderChange.emit({itemId:e,direction:i,orderedItemIds:o}),this.announceReorder(e,o),this.timers.requestAnimationFrame((()=>{var i;if(!this.el.isConnected)return;const s=this.getDirectChildListItems().find((t=>this.getItemRowId(t)===e)),l=null==s?void 0:s.querySelector(".xpl-list-item__drag-handle"),n=(null===(i=null==l?void 0:l.querySelector)||void 0===i?void 0:i.call(l,"button"))instanceof t?l.querySelector("button"):l;n instanceof t&&n.focus()})),!0}getOrderedItemIds(){return this.getVisibleListItemElements().map((e=>this.getItemRowId(e)))}announceReorder(e,t){if(!this.reorderable||!e)return;const i=t.indexOf(e);if(i<0)return;const s=i+1,l=t.length;this.reorderLiveMessage="",this.timers.requestAnimationFrame((()=>{this.el.isConnected&&(this.reorderLiveMessage=`Item ${e}, now position ${s} of ${l}`)}))}getDirectChildListItems(){return Array.from(this.el.children).filter((e=>"xpl-list-item"===e.tagName.toLowerCase()))}getVisibleListItemElements(){return this.getDirectChildListItems().filter((e=>!e.hasAttribute("hidden")))}isLegacyPropBasedRow(e){return null!=e.item}getNextVisibleListItemAfter(e){let i=e.nextElementSibling;for(;i;){if(i instanceof t&&"xpl-list-item"===i.tagName.toLowerCase()&&!i.hasAttribute("hidden"))return i;i=i.nextElementSibling}return null}collectListItems(){this.listItems=this.getDirectChildListItems();const e=new Set;this.listItems.forEach((t=>{const i=t.getAttribute("item-id")||t.id||(t.itemId?t.itemId+"":"");i&&e.add(i)})),this.listItems.forEach((t=>{if(!t.hasAttribute("item-id")&&!t.id)if(t.itemId)t.setAttribute("item-id",t.itemId),e.add(t.itemId);else{let i;do{i="item-"+this.nextAutoItemIdSeq,this.nextAutoItemIdSeq+=1}while(e.has(i));t.setAttribute("item-id",i),e.add(i)}this.isLegacyPropBasedRow(t)?(t.removeAttribute("selectable"),t.removeAttribute("radio-name"),t.removeAttribute("reorderable")):(this.selectable?(t.setAttribute("selectable","true"),t.setAttribute("radio-name",this.radioName)):(t.removeAttribute("selectable"),t.removeAttribute("radio-name")),this.reorderable?t.setAttribute("reorderable","true"):t.removeAttribute("reorderable"));const i=this.getItemRowId(t);this.isLegacyPropBasedRow(t)?t.removeAttribute("keyboard-active"):this.keyboardReorderItemId&&i===this.keyboardReorderItemId?t.setAttribute("keyboard-active","true"):t.removeAttribute("keyboard-active")}))}getItemRowId(e){return e.getAttribute("item-id")||e.id||e.itemId||""}render(){var e,t,i;const n=(null===(e=this.labelledBy)||void 0===e?void 0:e.trim())?this.labelledBy.trim():void 0,r=!n&&(null===(t=this.label)||void 0===t?void 0:t.trim())?this.label.trim():void 0;return s(l,{key:"4290084c30b164abb653943a81783c35531d6316",role:"list",class:{"xpl-list":!0},"aria-label":r,"aria-labelledby":n},null===(i=this.items)||void 0===i?void 0:i.map(((e,t)=>{var i;const l=null!==(i=e.id)&&void 0!==i?i:"item-"+t;return s("xpl-list-item",{key:"legacy-item-"+l,item:e,href:e.href,itemId:l})})),s("slot",{key:"55ce7202269eab851c0d753fd87ef2d5bf9f59a8"}),this.reorderable?s("div",{class:"xpl-list__reorder-live","aria-live":"assertive","aria-atomic":"true"},this.reorderLiveMessage):null)}get el(){return this}static get watchers(){return{keyboardReorderItemId:[{handleKeyboardReorderItemIdChange:0}],items:[{handleItemsChange:0}],reorderable:[{handleReorderableChange:0}],selectable:[{handleSelectableChange:0}]}}},[260,"xpl-list",{items:[16],label:[1],labelledBy:[1,"labelled-by"],reorderable:[4],selectable:[4],keyboardReorderItemId:[32],reorderLiveMessage:[32],clearSelection:[64]},[[0,"keydown","handleKeyDown"],[0,"itemSelect","handleChildItemSelect"],[0,"slotchange","handleSlotChange"],[0,"itemDragStart","handleItemDragStart"],[0,"itemDragEnd","handleItemDragEnd"],[0,"itemDrop","handleItemDrop"],[0,"xplListItemReorder","handleItemReorder"]],{keyboardReorderItemId:[{handleKeyboardReorderItemIdChange:0}],items:[{handleItemsChange:0}],reorderable:[{handleReorderableChange:0}],selectable:[{handleSelectableChange:0}]}]),I=b,f=function(){"undefined"!=typeof customElements&&["xpl-list","xpl-avatar","xpl-badge","xpl-button","xpl-divider","xpl-icon","xpl-list-item","xpl-radio"].forEach((e=>{switch(e){case"xpl-list":customElements.get(n(e))||customElements.define(n(e),b);break;case"xpl-avatar":customElements.get(n(e))||o();break;case"xpl-badge":customElements.get(n(e))||a();break;case"xpl-button":customElements.get(n(e))||d();break;case"xpl-divider":customElements.get(n(e))||h();break;case"xpl-icon":customElements.get(n(e))||c();break;case"xpl-list-item":customElements.get(n(e))||m();break;case"xpl-radio":customElements.get(n(e))||u()}}))};export{I as XplList,f as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as s,Host as l,transformTag as n}from"@stencil/core/internal/client";import{d as r}from"./xpl-avatar2.js";import{d as a}from"./xpl-badge2.js";import{d as o}from"./xpl-button2.js";import{d}from"./xpl-divider2.js";import{d as h}from"./xpl-icon2.js";import{d as c}from"./xpl-list-item2.js";import{d as m}from"./xpl-radio2.js";class u{constructor(){this.timeouts=new Set,this.intervals=new Set,this.rafs=new Set}setTimeout(e,t){const i=setTimeout((()=>{this.timeouts.delete(i),e()}),t);return this.timeouts.add(i),i}clearTimeout(e){clearTimeout(e),this.timeouts.delete(e)}setInterval(e,t){const i=setInterval(e,t);return this.intervals.add(i),i}clearInterval(e){clearInterval(e),this.intervals.delete(e)}requestAnimationFrame(e){const t=requestAnimationFrame((i=>{this.rafs.delete(t),e(i)}));return this.rafs.add(t),t}cancelAnimationFrame(e){cancelAnimationFrame(e),this.rafs.delete(e)}dispose(){this.timeouts.forEach((e=>clearTimeout(e))),this.timeouts.clear(),this.intervals.forEach((e=>clearInterval(e))),this.intervals.clear(),this.rafs.forEach((e=>cancelAnimationFrame(e))),this.rafs.clear()}}let p=!1;const b=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.itemSelect=i(this,"itemSelect",7),this.orderChange=i(this,"orderChange",7),this.draggedItem=null,this.listItems=[],this.nextAutoItemIdSeq=0,this.radioName="xpl-list-radio-"+Math.random().toString(36).slice(2,11),this.timers=new u,this.keyboardReorderItemId=null,this.reorderLiveMessage="",this.items=[],this.reorderable=!1,this.selectable=!1}handleKeyboardReorderItemIdChange(){this.collectListItems()}handleItemsChange(){this.collectListItems()}handleReorderableChange(){this.collectListItems()}handleSelectableChange(){this.collectListItems()}componentWillLoad(){this.collectListItems(),this.items.length>0&&!p&&(p=!0,console.warn('[xpl-list] The "items" prop is deprecated. Use slot-based xpl-list-item children instead.'))}componentDidLoad(){this.collectListItems()}disconnectedCallback(){this.timers.dispose()}handleKeyDown(e){if(!this.selectable||"Escape"!==e.key||e.defaultPrevented)return;const i=function(e){var i,s;const l=(null!==(s=null===(i=e.composedPath)||void 0===i?void 0:i.call(e))&&void 0!==s?s:[]).find((e=>e instanceof t&&"xpl-list-item"===e.tagName.toLowerCase()));return null!=l?l:null}(e);if(!i||i.parentElement!==this.el)return;const s=i.querySelector('.xpl-list-item__selectable input[type="radio"]');(s instanceof HTMLInputElement&&s.checked||i.selected)&&(e.preventDefault(),this.clearSelection())}handleChildItemSelect(e){if(!this.selectable)return;const t=e.target;"XPL-LIST-ITEM"===t.tagName&&t.parentElement===this.el&&this.syncSelectionFromChildDetail(e.detail)}handleSlotChange(){this.collectListItems()}handleItemDragStart(e){var t;const i=null===(t=e.detail)||void 0===t?void 0:t.item;if(!i||i.parentElement!==this.el)return;null!==this.keyboardReorderItemId&&(this.keyboardReorderItemId=null),this.draggedItem=i;const s=this.draggedItem.querySelector(".xpl-list-item__wrapper");null==s||s.classList.add("dragging")}handleItemDragEnd(e){var t;const i=null===(t=e.detail)||void 0===t?void 0:t.item;if(i&&i.parentElement===this.el){if(this.draggedItem){const e=this.draggedItem.querySelector(".xpl-list-item__wrapper");null==e||e.classList.remove("dragging")}this.draggedItem=null}}handleItemDrop(e){var t;const i=null===(t=e.detail)||void 0===t?void 0:t.item;if(i&&i.parentElement===this.el)if(this.draggedItem&&this.draggedItem.parentElement!==this.el)this.draggedItem=null;else{if(this.draggedItem){const e=this.draggedItem.querySelector(".xpl-list-item__wrapper");null==e||e.classList.remove("dragging")}if(this.draggedItem&&i&&this.draggedItem!==i){const e=this.getVisibleListItemElements(),t=e.indexOf(this.draggedItem),s=e.indexOf(i);if(-1!==t&&-1!==s){const e=t>s?"up":"down",l=this.getItemRowId(this.draggedItem);if("up"===e)this.el.insertBefore(this.draggedItem,i);else{const e=this.getNextVisibleListItemAfter(i);e?this.el.insertBefore(this.draggedItem,e):this.el.appendChild(this.draggedItem)}const n=this.getOrderedItemIds();this.orderChange.emit({itemId:l,direction:e,orderedItemIds:n}),this.announceReorder(l,n),this.el.dispatchEvent(new CustomEvent("xplListReorder",{bubbles:!0,composed:!0,detail:{itemId:l,direction:e,fromIndex:t,toIndex:s,orderedItemIds:n}}))}}this.draggedItem=null,e.preventDefault()}}handleItemReorder(e){e.stopPropagation();const{direction:t,itemId:i,keyboardMode:s,exitKeyboardMode:l}=e.detail;void 0!==s&&(this.keyboardReorderItemId=s?i:null),l&&(this.keyboardReorderItemId=null),t&&i&&this.performReorder(i,t)&&this.el.dispatchEvent(new CustomEvent("xplListReorder",{bubbles:!0,composed:!0,detail:Object.assign(Object.assign({},e.detail),{orderedItemIds:this.getOrderedItemIds()})}))}async clearSelection(){if(!this.selectable)return;this.collectListItems();const e=[];this.listItems.forEach((t=>{const i=t.querySelector('.xpl-list-item__selectable input[type="radio"]');if(i instanceof HTMLInputElement&&i.checked||t.selected){const i=this.getItemRowId(t);i&&e.push(i)}}));const t=[...new Set(e)];this.listItems.forEach((e=>{const t=e.querySelector('.xpl-list-item__selectable input[type="radio"]');t instanceof HTMLInputElement&&(t.checked=!1)})),this.listItems.forEach((e=>{e.selected&&(e.selected=!1)})),t.forEach((e=>{this.itemSelect.emit({itemId:e})}))}syncSelectionFromChildDetail(e){this.collectListItems();const t=e.itemId,i=null!=t&&""!==t;this.listItems.forEach((e=>{const s=this.getItemRowId(e);e.selected=i&&s===t}))}performReorder(e,i){this.listItems=this.getVisibleListItemElements();const s=this.listItems.findIndex((t=>this.getItemRowId(t)===e));if(-1===s)return!1;const l="up"===i?s-1:s+1;if(l<0||l>=this.listItems.length)return!1;const n=this.listItems[s],r=this.listItems[l];if("up"===i)this.el.insertBefore(n,r);else{const e=this.getNextVisibleListItemAfter(r);e?this.el.insertBefore(n,e):this.el.appendChild(n)}const a=this.getOrderedItemIds();return this.orderChange.emit({itemId:e,direction:i,orderedItemIds:a}),this.announceReorder(e,a),this.timers.requestAnimationFrame((()=>{var i;if(!this.el.isConnected)return;const s=this.getDirectChildListItems().find((t=>this.getItemRowId(t)===e)),l=null==s?void 0:s.querySelector(".xpl-list-item__drag-handle"),n=(null===(i=null==l?void 0:l.querySelector)||void 0===i?void 0:i.call(l,"button"))instanceof t?l.querySelector("button"):l;n instanceof t&&n.focus()})),!0}getOrderedItemIds(){return this.getVisibleListItemElements().map((e=>this.getItemRowId(e)))}announceReorder(e,t){if(!this.reorderable||!e)return;const i=t.indexOf(e);if(i<0)return;const s=i+1,l=t.length;this.reorderLiveMessage="",this.timers.requestAnimationFrame((()=>{this.el.isConnected&&(this.reorderLiveMessage=`Item ${e}, now position ${s} of ${l}`)}))}getDirectChildListItems(){return Array.from(this.el.children).filter((e=>"xpl-list-item"===e.tagName.toLowerCase()))}getVisibleListItemElements(){return this.getDirectChildListItems().filter((e=>!e.hasAttribute("hidden")))}isLegacyPropBasedRow(e){return null!=e.item}getNextVisibleListItemAfter(e){let i=e.nextElementSibling;for(;i;){if(i instanceof t&&"xpl-list-item"===i.tagName.toLowerCase()&&!i.hasAttribute("hidden"))return i;i=i.nextElementSibling}return null}collectListItems(){this.listItems=this.getDirectChildListItems();const e=new Set;this.listItems.forEach((t=>{const i=t.getAttribute("item-id")||t.id||(t.itemId?t.itemId+"":"");i&&e.add(i)})),this.listItems.forEach((t=>{if(!t.hasAttribute("item-id")&&!t.id)if(t.itemId)t.setAttribute("item-id",t.itemId),e.add(t.itemId);else{let i;do{i="item-"+this.nextAutoItemIdSeq,this.nextAutoItemIdSeq+=1}while(e.has(i));t.setAttribute("item-id",i),e.add(i)}this.isLegacyPropBasedRow(t)?(t.removeAttribute("selectable"),t.removeAttribute("radio-name"),t.removeAttribute("reorderable")):(this.selectable?(t.setAttribute("selectable","true"),t.setAttribute("radio-name",this.radioName)):(t.removeAttribute("selectable"),t.removeAttribute("radio-name")),this.reorderable?t.setAttribute("reorderable","true"):t.removeAttribute("reorderable"));const i=this.getItemRowId(t);this.isLegacyPropBasedRow(t)?t.removeAttribute("keyboard-active"):this.keyboardReorderItemId&&i===this.keyboardReorderItemId?t.setAttribute("keyboard-active","true"):t.removeAttribute("keyboard-active")}))}getItemRowId(e){return e.getAttribute("item-id")||e.id||e.itemId||""}render(){var e,t,i;const n=(null===(e=this.labelledBy)||void 0===e?void 0:e.trim())?this.labelledBy.trim():void 0,r=!n&&(null===(t=this.label)||void 0===t?void 0:t.trim())?this.label.trim():void 0;return s(l,{key:"aaa6e1cfa2d87e61b239d9aa59c9e4647f05aade",role:"list",class:{"xpl-list":!0},"aria-label":r,"aria-labelledby":n},null===(i=this.items)||void 0===i?void 0:i.map(((e,t)=>{var i;const l=null!==(i=e.id)&&void 0!==i?i:"item-"+t;return s("xpl-list-item",{key:"legacy-item-"+l,item:e,href:e.href,itemId:l})})),s("slot",{key:"89eb57b654baf9efbfd021e8c8db1fe074daa6d1"}),this.reorderable?s("div",{class:"xpl-list__reorder-live","aria-live":"assertive","aria-atomic":"true"},this.reorderLiveMessage):null)}get el(){return this}static get watchers(){return{keyboardReorderItemId:[{handleKeyboardReorderItemIdChange:0}],items:[{handleItemsChange:0}],reorderable:[{handleReorderableChange:0}],selectable:[{handleSelectableChange:0}]}}},[260,"xpl-list",{items:[16],label:[1],labelledBy:[1,"labelled-by"],reorderable:[4],selectable:[4],keyboardReorderItemId:[32],reorderLiveMessage:[32],clearSelection:[64]},[[0,"keydown","handleKeyDown"],[0,"itemSelect","handleChildItemSelect"],[0,"slotchange","handleSlotChange"],[0,"itemDragStart","handleItemDragStart"],[0,"itemDragEnd","handleItemDragEnd"],[0,"itemDrop","handleItemDrop"],[0,"xplListItemReorder","handleItemReorder"]],{keyboardReorderItemId:[{handleKeyboardReorderItemIdChange:0}],items:[{handleItemsChange:0}],reorderable:[{handleReorderableChange:0}],selectable:[{handleSelectableChange:0}]}]),I=b,f=function(){"undefined"!=typeof customElements&&["xpl-list","xpl-avatar","xpl-badge","xpl-button","xpl-divider","xpl-icon","xpl-list-item","xpl-radio"].forEach((e=>{switch(e){case"xpl-list":customElements.get(n(e))||customElements.define(n(e),b);break;case"xpl-avatar":customElements.get(n(e))||r();break;case"xpl-badge":customElements.get(n(e))||a();break;case"xpl-button":customElements.get(n(e))||o();break;case"xpl-divider":customElements.get(n(e))||d();break;case"xpl-icon":customElements.get(n(e))||h();break;case"xpl-list-item":customElements.get(n(e))||c();break;case"xpl-radio":customElements.get(n(e))||m()}}))};export{I as XplList,f as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as a,createEvent as d,h as n,Host as c,transformTag as t}from"@stencil/core/internal/client";const i=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.navWidth=d(this,"navWidth",7),this.width="default"}navWidthHandler(){this.navWidth.emit(this.width)}connectedCallback(){this.navWidthHandler()}componentDidUpdate(){this.navWidthHandler()}render(){return n(c,{key:"12ad41e2631d3cbab84b0bf536ffaf4fc31e7f8b",class:"xpl-main-nav xpl-main-nav--"+this.width,"aria-label":"Sidebar"},n("nav",{key:"54c0fcc49ddda8846279b8efc4afe0244e054211"},n("header",{key:"a1803d0c15541eb7d8b84d17d6e8c5613472dd7e","aria-label":"Sidebar Header"},n("slot",{key:"cee7321f97dc59f7d7e844ecd8fab6ba656b92e9",name:"logo"}),n("slot",{key:"f33cd91b4ad2e7dad79f89401477c7c2cc7636aa",name:"brand-name"})),n("div",{key:"d7951aa7282d7be3107b15196679f2e55c76d847",class:"xpl-main-nav__main_section"},n("slot",{key:"716d5be941f65ce57c2a9f12e4eeaedef83c0dd0",name:"navigation"})),n("footer",{key:"880b9fb98c5d0d2b4133cacb73a7c339590bf8bb",class:"xpl-main-nav__footer","aria-label":"Sidebar Footer"},n("slot",{key:"005c2efc4a3490e50a2b692d0e9dc7e2ce76d938",name:"footer"}))))}},[260,"xpl-main-nav",{width:[1]}]),s=i,l=function(){"undefined"!=typeof customElements&&["xpl-main-nav"].forEach((e=>{"xpl-main-nav"===e&&(customElements.get(t(e))||customElements.define(t(e),i))}))};export{s as XplMainNav,l as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as a,createEvent as n,h as t,Host as c,transformTag as i}from"@stencil/core/internal/client";const b=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.navWidth=n(this,"navWidth",7),this.width="default"}navWidthHandler(){this.navWidth.emit(this.width)}connectedCallback(){this.navWidthHandler()}componentDidUpdate(){this.navWidthHandler()}render(){return t(c,{key:"122bf1f28c4fb1e460185989b2d517f1ddbfb22b",class:"xpl-main-nav xpl-main-nav--"+this.width,"aria-label":"Sidebar"},t("nav",{key:"4ed8ce484b394adee98ac16056ebbabcadd31625"},t("header",{key:"829b7904323aeea21922a8d4a8fa33141cfa7913","aria-label":"Sidebar Header"},t("slot",{key:"8a6ea72fa4a1b26f9825a36b4ac7e64c9dbf476c",name:"logo"}),t("slot",{key:"bf049e9ee7b83af1c4ebfef21681edcb35de9364",name:"brand-name"})),t("div",{key:"a0ce70ccf5e4bac6346711127fba5278963910c1",class:"xpl-main-nav__main_section"},t("slot",{key:"bce360027342a1ef3e009bad6bc28e44c64dbd04",name:"navigation"})),t("footer",{key:"0b5f2e6cc890e4257f5e5503302492a236950f87",class:"xpl-main-nav__footer","aria-label":"Sidebar Footer"},t("slot",{key:"01dbe4d3834e1bc67b51108600688544e549ecde",name:"footer"}))))}},[260,"xpl-main-nav",{width:[1]}]),d=b,s=function(){"undefined"!=typeof customElements&&["xpl-main-nav"].forEach((e=>{"xpl-main-nav"===e&&(customElements.get(i(e))||customElements.define(i(e),b))}))};export{d as XplMainNav,s as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as a,h as s,Host as c,transformTag as l}from"@stencil/core/internal/client";import{d as i}from"./xpl-backdrop2.js";import{d}from"./xpl-button2.js";import{d as o}from"./xpl-icon2.js";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.modalClosed=a(this,"modalClosed",7),this.isOpen=!1,this.size="medium",this.variant="default",this.handleDialogClose=()=>{this.isOpen=!1,this.modalClosed.emit()},this.handleNativeBackdropClick=e=>{const t=this.dialogElement.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&this.handleDialogClose()}}componentDidLoad(){this.dialogElement=this.element.querySelector("dialog"),this.updateModalState(),this.dialogElement.addEventListener("cancel",this.handleDialogClose),this.dialogElement.addEventListener("click",this.handleNativeBackdropClick)}disconnectedCallback(){this.dialogElement&&(this.dialogElement.removeEventListener("cancel",this.handleDialogClose),this.dialogElement.removeEventListener("click",this.handleNativeBackdropClick))}updateModalState(){var e,t;this.isOpen?null===(t=null===(e=this.dialogElement)||void 0===e?void 0:e.showModal)||void 0===t||t.call(e):this.dialogElement&&"function"==typeof this.dialogElement.close&&setTimeout((()=>{var e;null===(e=this.dialogElement)||void 0===e||e.close()}),250)}render(){return s(c,{key:"1014ca8cb29f3cfeb7f2cf580127b8fe61e7bcbd",class:"xpl-modal"},this.isOpen&&s("xpl-backdrop",{key:"0085b008fb42a998c2b27690102b8ae7f0e49c67"}),s("dialog",{key:"9e2d23304e10872ed3dc9a7520537e36bf8b8f5b",class:`xpl-modal__dialog xpl-modal-size--${this.size} xpl-modal--${this.isOpen?"is-open":"is-closed"}`},s("div",{key:"f55a9d85fc271183e0a6b7e60fb4ad5ed623b010",class:"xpl-modal__header"},s("div",{key:"ac105d7ee88148e4b10b26522f93fea70b8d6c06",class:"xpl-modal__title"},"warning"===this.variant&&s("xpl-icon",{key:"89ff5fda063dc98628c409ee51c124f17f9e7553",size:20,icon:"alert-triangle",class:"xpl-modal__alert-icon"}),s("slot",{key:"03e05d28ca6449859ac58f0b0efaf3d8e24c1d62",name:"title"}),s("xpl-button",{key:"ff132fcbaf91ab6922b12f667255594673e21bd5",type:"button",class:"xpl-modal__close-button","icon-only":!0,size:"sm",variant:"tertiary",onClick:this.handleDialogClose},s("xpl-icon",{key:"6d712ffc1de66d43591ccf71b08ed5e823fc4c8f",icon:"x"}))),s("div",{key:"ff5f20b209f6d704d0d20561818ca3ea5b353fce",class:"xpl-modal__subtitle"},s("slot",{key:"de25d1ab35729ad5ee0e279311285eab20fb7669",name:"subtitle"}))),s("div",{key:"286f34b54309527c836cb7cc06018ffc577c500f",class:"xpl-modal__body"},s("slot",{key:"960036c7d3da774ad0f59ccf2c859d7ba3ec3a98",name:"body"})),s("div",{key:"24f7db0e4153d9f4105d787abdc1fe491ba6633c",class:"xpl-modal__footer"},s("slot",{key:"4f096e57455b20caec555a008a14d411f40b53d7",name:"tertiary"}),s("slot",{key:"1fee8182d892c3460fe30c20456e1b9139bafaec",name:"secondary"}),s("slot",{key:"e2b91a7af9f34c297d6c311823c91f9a0ab4059c",name:"primary"}))))}get element(){return this}static get watchers(){return{isOpen:[{updateModalState:0}]}}},[260,"xpl-modal",{isOpen:[1540,"is-open"],size:[1],variant:[1]},void 0,{isOpen:[{updateModalState:0}]}]),f=n,b=function(){"undefined"!=typeof customElements&&["xpl-modal","xpl-backdrop","xpl-button","xpl-icon"].forEach((e=>{switch(e){case"xpl-modal":customElements.get(l(e))||customElements.define(l(e),n);break;case"xpl-backdrop":customElements.get(l(e))||i();break;case"xpl-button":customElements.get(l(e))||d();break;case"xpl-icon":customElements.get(l(e))||o()}}))};export{f as XplModal,b as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as a,h as c,Host as s,transformTag as d}from"@stencil/core/internal/client";import{d as l}from"./xpl-backdrop2.js";import{d as i}from"./xpl-button2.js";import{d as o}from"./xpl-icon2.js";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.modalClosed=a(this,"modalClosed",7),this.isOpen=!1,this.size="medium",this.variant="default",this.handleDialogClose=()=>{this.isOpen=!1,this.modalClosed.emit()},this.handleNativeBackdropClick=e=>{const t=this.dialogElement.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&this.handleDialogClose()}}componentDidLoad(){this.dialogElement=this.element.querySelector("dialog"),this.updateModalState(),this.dialogElement.addEventListener("cancel",this.handleDialogClose),this.dialogElement.addEventListener("click",this.handleNativeBackdropClick)}disconnectedCallback(){this.dialogElement&&(this.dialogElement.removeEventListener("cancel",this.handleDialogClose),this.dialogElement.removeEventListener("click",this.handleNativeBackdropClick))}updateModalState(){var e,t;this.isOpen?null===(t=null===(e=this.dialogElement)||void 0===e?void 0:e.showModal)||void 0===t||t.call(e):this.dialogElement&&"function"==typeof this.dialogElement.close&&setTimeout((()=>{var e;null===(e=this.dialogElement)||void 0===e||e.close()}),250)}render(){return c(s,{key:"310913d620acf72531ecb06aa6cd2180bb58d13b",class:"xpl-modal"},this.isOpen&&c("xpl-backdrop",{key:"d95693fd09c2f0a8024f3cb69a021f0bd79f7916"}),c("dialog",{key:"5cffd3cfdcc6033baa1d9e3e5fdf56b8411a8975",class:`xpl-modal__dialog xpl-modal-size--${this.size} xpl-modal--${this.isOpen?"is-open":"is-closed"}`},c("div",{key:"2d0be8e91065d464797d85cd1b98272292eacb09",class:"xpl-modal__header"},c("div",{key:"cb7d8594ed217599bcf0e2efa88d72afe0fff758",class:"xpl-modal__title"},"warning"===this.variant&&c("xpl-icon",{key:"fb7dd69369accc0c98ef8762ca457b6368ca0036",size:20,icon:"alert-triangle",class:"xpl-modal__alert-icon"}),c("slot",{key:"36a6d3d38d35064f81740504090fbbcdf2125097",name:"title"}),c("xpl-button",{key:"db84ecf685afec8d0d783b433f8aa030acc436bb",type:"button",class:"xpl-modal__close-button","icon-only":!0,size:"sm",variant:"tertiary",onClick:this.handleDialogClose},c("xpl-icon",{key:"bf241c6636ace6e182bf259bd24754646dc7f151",icon:"x"}))),c("div",{key:"105fa1a5b9d927bda5ca5521bbb8211cb07ab8e8",class:"xpl-modal__subtitle"},c("slot",{key:"d25d6d8bb95cd51f075dd7f9b5e1e199dac3efb0",name:"subtitle"}))),c("div",{key:"3b194a36ad0f4446149027544c16a25ba27f2cec",class:"xpl-modal__body"},c("slot",{key:"077e5b70115e3e906cd9ea7181c51615799c77e8",name:"body"})),c("div",{key:"687bd9ca45af20945ab5461ceb68ec099a30c50b",class:"xpl-modal__footer"},c("slot",{key:"73d5884708efd296a701c37e02663668fcfd37d8",name:"tertiary"}),c("slot",{key:"bad90d2355b8c015e19b1e450b5a2ce96e5ad55d",name:"secondary"}),c("slot",{key:"c601b66edc9fb2c082ccc713d6df95f15bd604ef",name:"primary"}))))}get element(){return this}static get watchers(){return{isOpen:[{updateModalState:0}]}}},[260,"xpl-modal",{isOpen:[1540,"is-open"],size:[1],variant:[1]},void 0,{isOpen:[{updateModalState:0}]}]),b=n,f=function(){"undefined"!=typeof customElements&&["xpl-modal","xpl-backdrop","xpl-button","xpl-icon"].forEach((e=>{switch(e){case"xpl-modal":customElements.get(d(e))||customElements.define(d(e),n);break;case"xpl-backdrop":customElements.get(d(e))||l();break;case"xpl-button":customElements.get(d(e))||i();break;case"xpl-icon":customElements.get(d(e))||o()}}))};export{b as XplModal,f as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,h as i,Host as s,transformTag as d}from"@stencil/core/internal/client";const a=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.rightAsideMobilePresent=!1}connectedCallback(){this.syncRightAsideMobileSlotPresent(),this.connectRightAsideMobileSlotObserver()}disconnectedCallback(){void 0!==this.deferredRightAsideSlotWorkTimeoutId&&(clearTimeout(this.deferredRightAsideSlotWorkTimeoutId),this.deferredRightAsideSlotWorkTimeoutId=void 0),this.disconnectRightAsideMobileSlotObserver()}componentWillLoad(){this.syncRightAsideMobileSlotPresent()}componentWillRender(){this.disconnectRightAsideMobileSlotObserver()}componentDidRender(){this.scheduleDeferredRightAsideSlotWork()}scheduleDeferredRightAsideSlotWork(){void 0!==this.deferredRightAsideSlotWorkTimeoutId&&clearTimeout(this.deferredRightAsideSlotWorkTimeoutId),this.deferredRightAsideSlotWorkTimeoutId=setTimeout((()=>{this.deferredRightAsideSlotWorkTimeoutId=void 0,this.el.isConnected&&(this.syncRightAsideMobileSlotPresent(),this.connectRightAsideMobileSlotObserver())}),0)}connectRightAsideMobileSlotObserver(){this.disconnectRightAsideMobileSlotObserver(),"undefined"!=typeof MutationObserver&&(this.rightAsideMobileSlotObserver=new MutationObserver((()=>{this.scheduleDeferredRightAsideSlotWork()})),this.rightAsideMobileSlotObserver.observe(this.el,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}))}disconnectRightAsideMobileSlotObserver(){var e;null===(e=this.rightAsideMobileSlotObserver)||void 0===e||e.disconnect(),this.rightAsideMobileSlotObserver=void 0}syncRightAsideMobileSlotPresent(){const e=null!=this.el.querySelector('[slot="right-aside-mobile"]');e!==this.rightAsideMobilePresent&&(this.rightAsideMobilePresent=e)}render(){return i(s,{key:"677e0ab10d9bb5578f472101c677222e038c2b4a",class:{"xpl-nav-header-menu":!0,"xpl-nav-header-menu--has-right-aside-mobile":this.rightAsideMobilePresent,dark:!0}},(!!this.username||!!this.email)&&i("div",{key:"fa3898bd0b2aa4726d44ad991a2c6272d4f323de",class:"xpl-nav-header-menu__profile"},i("div",{key:"354ff7d001e5b545cc7c4310ee10cae7d72c6159",class:"xpl-nav-header-menu__info"},this.username&&i("div",{key:"92b6486692879a602e87062820d7cbf175bf15d2",class:"xpl-nav-header-menu__username"},this.username),this.email&&i("div",{key:"a228df8215ffd68c36631e11184ba38c790bc560",class:"xpl-nav-header-menu__email"},this.email))),i("div",{key:"0ee2394e784f6efb43f04ec65765481203dda954",class:"xpl-nav-header-menu__right-aside-mobile"},i("slot",{key:"f551acc13c6e6f2611e78d04de72987048011318",name:"right-aside-mobile"})),i("div",{key:"b90709dea7e169df42acaf8125a9359321c979ff",class:"xpl-nav-header-menu__slot",role:"list"},i("slot",{key:"c35efb10d04d4d4b0bbf832d8541ba6d4b9782c0"})))}get el(){return this}},[260,"xpl-nav-header-menu",{email:[1],username:[1],rightAsideMobilePresent:[32]}]),n=a,l=function(){"undefined"!=typeof customElements&&["xpl-nav-header-menu"].forEach((e=>{"xpl-nav-header-menu"===e&&(customElements.get(d(e))||customElements.define(d(e),a))}))};export{n as XplNavHeaderMenu,l as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,h as i,Host as s,transformTag as a}from"@stencil/core/internal/client";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.rightAsideMobilePresent=!1}connectedCallback(){this.syncRightAsideMobileSlotPresent(),this.connectRightAsideMobileSlotObserver()}disconnectedCallback(){void 0!==this.deferredRightAsideSlotWorkTimeoutId&&(clearTimeout(this.deferredRightAsideSlotWorkTimeoutId),this.deferredRightAsideSlotWorkTimeoutId=void 0),this.disconnectRightAsideMobileSlotObserver()}componentWillLoad(){this.syncRightAsideMobileSlotPresent()}componentWillRender(){this.disconnectRightAsideMobileSlotObserver()}componentDidRender(){this.scheduleDeferredRightAsideSlotWork()}scheduleDeferredRightAsideSlotWork(){void 0!==this.deferredRightAsideSlotWorkTimeoutId&&clearTimeout(this.deferredRightAsideSlotWorkTimeoutId),this.deferredRightAsideSlotWorkTimeoutId=setTimeout((()=>{this.deferredRightAsideSlotWorkTimeoutId=void 0,this.el.isConnected&&(this.syncRightAsideMobileSlotPresent(),this.connectRightAsideMobileSlotObserver())}),0)}connectRightAsideMobileSlotObserver(){this.disconnectRightAsideMobileSlotObserver(),"undefined"!=typeof MutationObserver&&(this.rightAsideMobileSlotObserver=new MutationObserver((()=>{this.scheduleDeferredRightAsideSlotWork()})),this.rightAsideMobileSlotObserver.observe(this.el,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}))}disconnectRightAsideMobileSlotObserver(){var e;null===(e=this.rightAsideMobileSlotObserver)||void 0===e||e.disconnect(),this.rightAsideMobileSlotObserver=void 0}syncRightAsideMobileSlotPresent(){const e=null!=this.el.querySelector('[slot="right-aside-mobile"]');e!==this.rightAsideMobilePresent&&(this.rightAsideMobilePresent=e)}render(){return i(s,{key:"451149dc9d73f705492fc65bf4f014b8efa4ee8a",class:{"xpl-nav-header-menu":!0,"xpl-nav-header-menu--has-right-aside-mobile":this.rightAsideMobilePresent,dark:!0}},(!!this.username||!!this.email)&&i("div",{key:"f42b560492c110644d52b10f708a3ed650833861",class:"xpl-nav-header-menu__profile"},i("div",{key:"6d98f720af85cbf8164bea7500175d6bfbb9465b",class:"xpl-nav-header-menu__info"},this.username&&i("div",{key:"9d52880dc41c11e71ac3cc107d8009eccb787bac",class:"xpl-nav-header-menu__username"},this.username),this.email&&i("div",{key:"d1b71ac2c4f6aaf5efd7b1910b8848f97ab08bf0",class:"xpl-nav-header-menu__email"},this.email))),i("div",{key:"e1b298c39ccbe0f68b8d60fa82714572f656ab1e",class:"xpl-nav-header-menu__right-aside-mobile"},i("slot",{key:"fbb8d26c38a4a50568e8836ac3af4409fe6c93c0",name:"right-aside-mobile"})),i("div",{key:"cbe858338ec04cdd3b74285f95b0466432924be2",class:"xpl-nav-header-menu__slot",role:"list"},i("slot",{key:"b47ccc7f955a30d8b9d9b884fa3d920d45958f7c"})))}get el(){return this}},[260,"xpl-nav-header-menu",{email:[1],username:[1],rightAsideMobilePresent:[32]}]),d=n,c=function(){"undefined"!=typeof customElements&&["xpl-nav-header-menu"].forEach((e=>{"xpl-nav-header-menu"===e&&(customElements.get(a(e))||customElements.define(a(e),n))}))};export{d as XplNavHeaderMenu,c as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as n,h as s,Host as o,transformTag as i}from"@stencil/core/internal/client";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.navOpen=n(this,"navOpen",7),this.navControl=!1}onNavToggle(){window.innerWidth<=640&&this.navOpen.emit(!1)}render(){return s(o,{key:"5e0a171c719802e96d48f7d635c189563387fade",class:"xpl-nav-item",role:"listitem",onClick:()=>{this.navControl&&this.onNavToggle()}},s("slot",{key:"aff0155598a1b64d50168552ff251b824d00a86f",name:"link"},s("slot",{key:"28da4593d2302b2867b0792562dc5b7b3ddd6983",name:"icon"}),s("slot",{key:"93e12751d2320608ee7a10d73eef67a1c1bb5443"})))}},[260,"xpl-nav-item",{navControl:[4,"nav-control"]}]),a=l,c=function(){"undefined"!=typeof customElements&&["xpl-nav-item"].forEach((e=>{"xpl-nav-item"===e&&(customElements.get(i(e))||customElements.define(i(e),l))}))};export{a as XplNavItem,c as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as n,h as a,Host as c,transformTag as s}from"@stencil/core/internal/client";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.navOpen=n(this,"navOpen",7),this.navControl=!1}onNavToggle(){window.innerWidth<=640&&this.navOpen.emit(!1)}render(){return a(c,{key:"b3a214a57ad57e9db1bbfd6a1809999ce0575a82",class:"xpl-nav-item",role:"listitem",onClick:()=>{this.navControl&&this.onNavToggle()}},a("slot",{key:"0f2a74dc4fd6f419a01106d872a5f6b5066a21a8",name:"link"},a("slot",{key:"234b41ca18d65ec3423ff580d983d24b483641cf",name:"icon"}),a("slot",{key:"cdb0ac59997cd1c557b05c6c8d8f60ae78d28a4d"})))}},[260,"xpl-nav-item",{navControl:[4,"nav-control"]}]),i=o,l=function(){"undefined"!=typeof customElements&&["xpl-nav-item"].forEach((e=>{"xpl-nav-item"===e&&(customElements.get(s(e))||customElements.define(s(e),o))}))};export{i as XplNavItem,l as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as a,Host as o,transformTag as i}from"@stencil/core/internal/client";import{d as n}from"./xpl-dropdown2.js";import{d as c}from"./xpl-dropdown-group2.js";import{d as l}from"./xpl-dropdown-heading2.js";import{d as p}from"./xpl-dropdown-option2.js";import{d as r}from"./xpl-icon2.js";import{d}from"./xpl-select2.js";import{d as h}from"./xpl-tag2.js";const g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.pageChange=s(this,"pageChange",7),this.rowsPerPageChange=s(this,"rowsPerPageChange",7),this.totalPages=1,this.withPageControl=!1,this.currentPage=1,this.rowsPerPageOptions="10,25,50,100,150",this.selectedRowsPerPage=10,this.rowsPerPageSelectRef=null,this.pageSelectRef=null,this.handleNextPage=()=>{this.currentPage<this.totalPages&&(this.currentPage+=1)},this.handlePrevPage=()=>{this.currentPage>1&&(this.currentPage-=1)},this.handlePageChange=e=>{const t=parseInt(e.detail,10);Number.isNaN(t)||(this.currentPage=t)},this.handleRowsChange=e=>{const t=parseInt(e.detail,10);Number.isNaN(t)||(this.selectedRowsPerPage=t)}}get rowsPerPageOptionsArray(){return this.rowsPerPageOptions.split(",").map(Number)}onPageUpdate(e){e<1?this.currentPage=1:e>this.totalPages&&(this.currentPage=this.totalPages),this.pageChange.emit(this.currentPage)}onRowsPerPageUpdate(e){this.rowsPerPageChange.emit(e)}componentDidLoad(){var e,t;null===(e=this.rowsPerPageSelectRef)||void 0===e||e.addEventListener("changeEvent",this.handleRowsChange),null===(t=this.pageSelectRef)||void 0===t||t.addEventListener("changeEvent",this.handlePageChange)}disconnectedCallback(){var e,t;null===(e=this.rowsPerPageSelectRef)||void 0===e||e.removeEventListener("changeEvent",this.handleRowsChange),null===(t=this.pageSelectRef)||void 0===t||t.removeEventListener("changeEvent",this.handlePageChange)}render(){const e=this.currentPage<=1,t=this.currentPage>=this.totalPages;return a(o,{key:"cb9e0db1008dfadcfb48ae308d8e595dc751a6ee",class:`xpl-pagination xpl-pagination__${this.withPageControl?"with":"no"}-page-control`},this.withPageControl&&a("div",{key:"30d272307c28e0b50d78b036ec63f4d2a120aaa0",class:"xpl-pagination__rows-per-page"},a("label",{key:"cc5969dbc2685aff198f03ef593dd714570225dd",class:"xpl-pagination__rows-label"},"Rows per page:"),a("xpl-select",{key:"447ee86d134c70f51c4a756c499bb6766d10ed7f",class:"xpl-pagination__rows-per-page-select",choices:this.rowsPerPageOptionsArray.map((e=>({label:""+e,value:""+e,isSelected:e===this.selectedRowsPerPage}))),ref:e=>{this.rowsPerPageSelectRef=e}})),a("div",{key:"ac10b2efa235b3a065c7089bfb8674d6e015ee0c",class:"xpl-pagination__pager"},a("button",{key:"83e9cc02336b94fe3cc8b16ba52d01ab70c50eb1",class:"xpl-pagination__pager-button xpl-pagination__pager-button-prev",disabled:e,onClick:this.handlePrevPage,"aria-label":"Previous Page",tabindex:"0"},a("xpl-icon",{key:"12a92187d96ad9c2973fd73c2b61c1c04cce589b",icon:"arrow-left",size:20})),a("xpl-select",{key:"79324205919048c207044ca7916a276675463d25",class:"xpl-pagination__page-select",choices:Array.from({length:this.totalPages},((e,t)=>({label:"Page "+(t+1),value:""+(t+1),isSelected:t+1===this.currentPage}))),"custom-display-value":!0,ref:e=>{this.pageSelectRef=e}},a("div",{key:"73674015b0e1f8c9175c2af2a409cf1beb57fb9d",slot:"custom-display-value"},`${this.currentPage} of ${this.totalPages}`)),a("button",{key:"6cecec44e8dfe62b9c6c94b33bad64473e0660a7",class:"xpl-pagination__pager-button xpl-pagination__pager-button-next",disabled:t,onClick:this.handleNextPage,"aria-label":"Next Page",tabindex:"0"},a("xpl-icon",{key:"9d21370837ee23434c94d790c7e300358d352e93",icon:"arrow-right",size:20}))))}static get watchers(){return{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}}},[0,"xpl-pagination",{totalPages:[2,"total-pages"],withPageControl:[4,"with-page-control"],currentPage:[1026,"current-page"],rowsPerPageOptions:[1,"rows-per-page-options"],selectedRowsPerPage:[1026,"selected-rows-per-page"]},void 0,{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}]),b=g,u=function(){"undefined"!=typeof customElements&&["xpl-pagination","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-select","xpl-tag"].forEach((e=>{switch(e){case"xpl-pagination":customElements.get(i(e))||customElements.define(i(e),g);break;case"xpl-dropdown":customElements.get(i(e))||n();break;case"xpl-dropdown-group":customElements.get(i(e))||c();break;case"xpl-dropdown-heading":customElements.get(i(e))||l();break;case"xpl-dropdown-option":customElements.get(i(e))||p();break;case"xpl-icon":customElements.get(i(e))||r();break;case"xpl-select":customElements.get(i(e))||d();break;case"xpl-tag":customElements.get(i(e))||h()}}))};export{b as XplPagination,u as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as a,h as s,Host as o,transformTag as i}from"@stencil/core/internal/client";import{d as n}from"./xpl-dropdown2.js";import{d as l}from"./xpl-dropdown-group2.js";import{d as p}from"./xpl-dropdown-heading2.js";import{d as c}from"./xpl-dropdown-option2.js";import{d as r}from"./xpl-icon2.js";import{d}from"./xpl-select2.js";import{d as h}from"./xpl-tag2.js";const g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.pageChange=a(this,"pageChange",7),this.rowsPerPageChange=a(this,"rowsPerPageChange",7),this.totalPages=1,this.withPageControl=!1,this.currentPage=1,this.rowsPerPageOptions="10,25,50,100,150",this.selectedRowsPerPage=10,this.rowsPerPageSelectRef=null,this.pageSelectRef=null,this.handleNextPage=()=>{this.currentPage<this.totalPages&&(this.currentPage+=1)},this.handlePrevPage=()=>{this.currentPage>1&&(this.currentPage-=1)},this.handlePageChange=e=>{const t=parseInt(e.detail,10);Number.isNaN(t)||(this.currentPage=t)},this.handleRowsChange=e=>{const t=parseInt(e.detail,10);Number.isNaN(t)||(this.selectedRowsPerPage=t)}}get rowsPerPageOptionsArray(){return this.rowsPerPageOptions.split(",").map(Number)}onPageUpdate(e){e<1?this.currentPage=1:e>this.totalPages&&(this.currentPage=this.totalPages),this.pageChange.emit(this.currentPage)}onRowsPerPageUpdate(e){this.rowsPerPageChange.emit(e)}componentDidLoad(){var e,t;null===(e=this.rowsPerPageSelectRef)||void 0===e||e.addEventListener("changeEvent",this.handleRowsChange),null===(t=this.pageSelectRef)||void 0===t||t.addEventListener("changeEvent",this.handlePageChange)}disconnectedCallback(){var e,t;null===(e=this.rowsPerPageSelectRef)||void 0===e||e.removeEventListener("changeEvent",this.handleRowsChange),null===(t=this.pageSelectRef)||void 0===t||t.removeEventListener("changeEvent",this.handlePageChange)}render(){const e=this.currentPage<=1,t=this.currentPage>=this.totalPages;return s(o,{key:"fad9cdff4010b4b5ac842633bf7daf09b4dbd5d4",class:{"xpl-pagination":!0,"xpl-pagination__with-page-control":this.withPageControl,"xpl-pagination__no-page-control":!this.withPageControl}},this.withPageControl&&s("div",{key:"eb125851b89aa1422ec3e5d5e336fcbecd07489e",class:"xpl-pagination__rows-per-page"},s("label",{key:"5f2aa4c45d183827317a74cf4700981b6b0e7f2b",class:"xpl-pagination__rows-label"},"Rows per page:"),s("xpl-select",{key:"7ba2987a24b3228d9b59320f29b22b5819f85546",class:"xpl-pagination__rows-per-page-select",dropdownFlipFallbackPlacements:["bottom-start"],dropdownPlacement:"top-start",choices:this.rowsPerPageOptionsArray.map((e=>({label:""+e,value:""+e,isSelected:e===this.selectedRowsPerPage}))),ref:e=>{this.rowsPerPageSelectRef=e}})),s("div",{key:"8bab9db1cecfdaeeb760b0e4e1afb393ff3a3fe7",class:"xpl-pagination__pager"},s("button",{key:"19efd8a9aee2b05f875d2db34c7cdd174c845f60",class:"xpl-pagination__pager-button xpl-pagination__pager-button-prev",disabled:e,onClick:this.handlePrevPage,"aria-label":"Previous Page",tabindex:"0"},s("xpl-icon",{key:"a77a15c649a6f2c86b100d1687b4a099acc18602",icon:"arrow-left",size:20})),s("xpl-select",{key:"5778cad67d3a4b930b1f89b0e49c30e941e23259",class:"xpl-pagination__page-select",dropdownFlipFallbackPlacements:["bottom-start"],dropdownPlacement:"top-start",choices:Array.from({length:this.totalPages},((e,t)=>({label:"Page "+(t+1),value:""+(t+1),isSelected:t+1===this.currentPage}))),"custom-display-value":!0,ref:e=>{this.pageSelectRef=e}},s("div",{key:"d0ae655a0100c2e81c8f7bdc2c8d3072f00cc7c9",slot:"custom-display-value"},`${this.currentPage} of ${this.totalPages}`)),s("button",{key:"ca6c7eb4fd277344f340b83673f1e43cb0c9fe99",class:"xpl-pagination__pager-button xpl-pagination__pager-button-next",disabled:t,onClick:this.handleNextPage,"aria-label":"Next Page",tabindex:"0"},s("xpl-icon",{key:"d18efdcb7e67ab908fbf79fc475993cf656b150c",icon:"arrow-right",size:20}))))}static get watchers(){return{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}}},[0,"xpl-pagination",{totalPages:[2,"total-pages"],withPageControl:[4,"with-page-control"],currentPage:[1026,"current-page"],rowsPerPageOptions:[1,"rows-per-page-options"],selectedRowsPerPage:[1026,"selected-rows-per-page"]},void 0,{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}]),b=g,m=function(){"undefined"!=typeof customElements&&["xpl-pagination","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-select","xpl-tag"].forEach((e=>{switch(e){case"xpl-pagination":customElements.get(i(e))||customElements.define(i(e),g);break;case"xpl-dropdown":customElements.get(i(e))||n();break;case"xpl-dropdown-group":customElements.get(i(e))||l();break;case"xpl-dropdown-heading":customElements.get(i(e))||p();break;case"xpl-dropdown-option":customElements.get(i(e))||c();break;case"xpl-icon":customElements.get(i(e))||r();break;case"xpl-select":customElements.get(i(e))||d();break;case"xpl-tag":customElements.get(i(e))||h()}}))};export{b as XplPagination,m as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as n,h as a,Host as t,transformTag as c}from"@stencil/core/internal/client";const l=e(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.accent="none",this.padding="default"}render(){const e="none"!==this.accent;return a(t,{key:"a9618f21b7aba5804881ec509d47909b87ad9aa5",class:{"xpl-panel":!0,["xpl-panel--accent-"+this.accent]:e,["xpl-panel--padding-"+this.padding]:!0}},e&&a("div",{key:"5b92aa4395658996de2736941d6c0d0262903013","aria-hidden":"true",class:"xpl-panel__accent"}),a("div",{key:"5b22eb3d1911ce2d68876c0bc0bc61f947c830f9",class:"xpl-panel__content"},a("slot",{key:"b2f331aa8ea4328b0e50736d97361a7bfcde60ed"})))}},[260,"xpl-panel",{accent:[1],padding:[1]}]),s=l,d=function(){"undefined"!=typeof customElements&&["xpl-panel"].forEach((e=>{"xpl-panel"===e&&(customElements.get(c(e))||customElements.define(c(e),l))}))};export{s as XplPanel,d as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as n,h as t,Host as a,transformTag as c}from"@stencil/core/internal/client";const l=e(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.accent="none",this.padding="default"}render(){const e="none"!==this.accent;return t(a,{key:"e9a747ba679f6f9f907d13217f329947bff93e31",class:{"xpl-panel":!0,["xpl-panel--accent-"+this.accent]:e,["xpl-panel--padding-"+this.padding]:!0}},e&&t("div",{key:"b777fd4a81574ff9276582b256b673cccfc63a34","aria-hidden":"true",class:"xpl-panel__accent"}),t("div",{key:"5fa5ba4c2bfa13d7dcaee603e96ec9b77d103b13",class:"xpl-panel__content"},t("slot",{key:"c99b797e076c2641ae205181479dabb38f9ea009"})))}},[260,"xpl-panel",{accent:[1],padding:[1]}]),s=l,p=function(){"undefined"!=typeof customElements&&["xpl-panel"].forEach((e=>{"xpl-panel"===e&&(customElements.get(c(e))||customElements.define(c(e),l))}))};export{s as XplPanel,p as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as i,Host as d,transformTag as s}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:d}=this.triggerRef.getBoundingClientRect(),{width:s,height:r}=this.contentRef.getBoundingClientRect(),{innerWidth:n,innerHeight:a}=window,p=i+r<a,l=e-r>=0,m=o-s>=0,h=d+s<n,b=(e+i)/2,c=t=>t&&b-r/2>=0&&b+r/2<=a,f=(o+d)/2,g=t=>t&&f-s/2>=0&&f+s/2<=n,u=o+s<n,w=d-s>=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(d,{key:"67ecd18580166f1582c29e33f1485bf67590b9f5"},i("div",{key:"bba42a3474432557bfc71705c2d5206493fed64b",class:{"xpl-popover":!0,[`xpl-popover--${this.actualPosition}`]:!0,"xpl-popover--is-open":this.isOpenState}},i("span",{key:"7960b727b609da6b0e949e4889e217b0f3efb6c9",role:"button",tabindex:"0","aria-haspopup":"dialog","aria-expanded":this.isOpenState?"true":"false",onClick:this.togglePopover,ref:t=>{this.triggerRef=t}},i("slot",{key:"08d2034f7559ce12f948252cf62bded94ab7666a",name:"trigger"})),"arrow"===this.display&&i("div",{key:"1c51e2f96884da9828cf5d94fc1639a63580a0c7",class:"xpl-popover__arrow"},i("svg",{key:"bbf85fdaa6385724f8ce55001a5d9d2e2471dfc5",width:"17",height:"14",xmlns:"http://www.w3.org/2000/svg"},i("path",{key:"4ba2c4805e65b776af7bd313f575866f134fb778",d:"M0 5h15l-7.5 7.5L0 5Z",fill:"white",stroke:"none",class:"arrow-fill"}),i("path",{key:"21fab6334d8106940a3e5c49acc70b80a7d61326",d:"M0 5 L7.5 12.5 L15 5",fill:"none",stroke:"black","stroke-width":"1",class:"arrow-stroke"}))),i("div",{key:"fb0eeedab71c9d10fcab8f9277af919efd94f202",class:{"xpl-popover__content":!0,[`xpl-popover__content--display-${this.display}`]:!0},ref:t=>this.contentRef=t},i("slot",{key:"4bd22aa19dedb6fb77355caafcd009413c8ad7d9"}))))}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(s(t))||customElements.define(s(t),n))}))}export{n as P,a as d}
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 +1 @@
1
- import{proxyCustomElement as s,HTMLElement as e,h as r,Host as t,transformTag as a}from"@stencil/core/internal/client";import{d as c}from"./xpl-icon2.js";const i=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.max=100,this.size="lg",this.value=0,this.variant="default"}get clampedValue(){return Math.max(0,Math.min(this.max,this.value))}get isComplete(){return this.value>=this.max&&"default"===this.variant}get isError(){return"error"===this.variant}get isSuccess(){return"success"===this.variant||this.isComplete}get showStatusIcon(){return this.isSuccess||this.isError}get isIndeterminate(){return"indeterminate"===this.variant}render(){return r(t,{key:"4161cfe080a629f1c69c14a0e0a553df950d57a8",class:{"xpl-progress-bar":!0,["xpl-progress-bar--"+this.size]:!0,["xpl-progress-bar--"+this.variant]:!0,"xpl-progress-bar--complete":this.isComplete}},r("div",{key:"c3ec83eb50771a91c543da1c9ec204e03b402c98",class:"xpl-progress-bar__wrapper"},(this.label||this.showStatusIcon)&&r("div",{key:"9bb66a54388c8d24d9c737d8736536fc47285bc9",class:"xpl-progress-bar__header"},this.label&&r("div",{key:"fb8160645a4c2ad56a276d5b85c5384d85b75b7e",class:"xpl-progress-bar__label"},this.label),this.showStatusIcon&&r("div",{key:"fb3cf9019e4ad18b0016219d44f3aa916ee5b4b2",class:"xpl-progress-bar__icon"},r("xpl-icon",this.isError?{icon:"circle-xmark-1"}:{icon:"circle-check-1"}))),r("div",{key:"cef864deff983bae01b9871ec17d6f6edccc327d",class:"xpl-progress-bar__row"},this.isIndeterminate?r("div",{class:"xpl-progress-bar__track xpl-progress-bar__track--indeterminate",role:"progressbar","aria-label":this.label||"Progress"},r("div",{class:"xpl-progress-bar__indeterminate"})):r("progress",{class:"xpl-progress-bar__progress",value:this.clampedValue,max:this.max,"aria-label":this.label||"Progress"})),this.helperText&&r("div",{key:"9f7a52c0527b0fccc2189f0485596fa2cf80d417",class:"xpl-progress-bar__helper"},this.helperText)))}},[0,"xpl-progress-bar",{helperText:[1,"helper-text"],label:[1],max:[2],size:[1],value:[2],variant:[1]}]),l=i,p=function(){"undefined"!=typeof customElements&&["xpl-progress-bar","xpl-icon"].forEach((s=>{switch(s){case"xpl-progress-bar":customElements.get(a(s))||customElements.define(a(s),i);break;case"xpl-icon":customElements.get(a(s))||c()}}))};export{l as XplProgressBar,p as defineCustomElement}
1
+ import{proxyCustomElement as s,HTMLElement as e,h as r,Host as t,transformTag as a}from"@stencil/core/internal/client";import{d as i}from"./xpl-icon2.js";const c=s(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.max=100,this.size="lg",this.value=0,this.variant="default"}get clampedValue(){return Math.max(0,Math.min(this.max,this.value))}get isComplete(){return this.value>=this.max&&"default"===this.variant}get isError(){return"error"===this.variant}get isSuccess(){return"success"===this.variant||this.isComplete}get showStatusIcon(){return this.isSuccess||this.isError}get isIndeterminate(){return"indeterminate"===this.variant}render(){return r(t,{key:"e5cc7a2231ed74242241723c9f0a57444a8000bb",class:{"xpl-progress-bar":!0,["xpl-progress-bar--"+this.size]:!0,["xpl-progress-bar--"+this.variant]:!0,"xpl-progress-bar--complete":this.isComplete}},r("div",{key:"3212fdea66e2cd3edffc36f99c9edc197f15bcee",class:"xpl-progress-bar__wrapper"},(this.label||this.showStatusIcon)&&r("div",{key:"004c0b9203df13c6818fdbb8c928a47d86e7388e",class:"xpl-progress-bar__header"},this.label&&r("div",{key:"ce735edff19cc004f979a582618c968260cd23c3",class:"xpl-progress-bar__label"},this.label),this.showStatusIcon&&r("div",{key:"3a9f143b79152aa3208593c9249a62d819c2967a",class:"xpl-progress-bar__icon"},r("xpl-icon",this.isError?{icon:"circle-xmark-1"}:{icon:"circle-check-1"}))),r("div",{key:"517787d0ff39c082a3d4763b78b16a9ce9235b4b",class:"xpl-progress-bar__row"},this.isIndeterminate?r("div",{class:"xpl-progress-bar__track xpl-progress-bar__track--indeterminate",role:"progressbar","aria-label":this.label||"Progress"},r("div",{class:"xpl-progress-bar__indeterminate"})):r("progress",{class:"xpl-progress-bar__progress",value:this.clampedValue,max:this.max,"aria-label":this.label||"Progress"})),this.helperText&&r("div",{key:"488c5092b96a1e9a5a08f9b090f94fe66f6f1490",class:"xpl-progress-bar__helper"},this.helperText)))}},[0,"xpl-progress-bar",{helperText:[1,"helper-text"],label:[1],max:[2],size:[1],value:[2],variant:[1]}]),l=c,p=function(){"undefined"!=typeof customElements&&["xpl-progress-bar","xpl-icon"].forEach((s=>{switch(s){case"xpl-progress-bar":customElements.get(a(s))||customElements.define(a(s),c);break;case"xpl-icon":customElements.get(a(s))||i()}}))};export{l as XplProgressBar,p as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as s,HTMLElement as t,h as e,Host as r,transformTag as i}from"@stencil/core/internal/client";import{d as o}from"./xpl-icon2.js";const c=s(class extends t{constructor(s){super(),!1!==s&&this.__registerHost(),this.currentStep=0,this.layout="horizontal",this.showLabels=!0,this.showNumbers=!0}validateCurrentStep(){if(!this.steps||0===this.steps.length)return;const s=this.steps.length;this.currentStep<0?this.currentStep=0:this.currentStep>s&&(this.currentStep=s)}renderStepContent(s,t){return t?e("xpl-icon",{icon:"check-2",size:20,class:"xpl-progress-indicator-step-checkmark"}):this.showNumbers?e("span",{class:"xpl-progress-indicator-step-number"},s+1):e("span",{class:"xpl-progress-indicator-step-dot"})}renderStep(s,t){const r=this.currentStep>t,i=this.currentStep===t,o="horizontal"===this.layout,c=e("div",{class:"xpl-progress-indicator-step-circle"},this.renderStepContent(t,r)),n=this.showLabels&&e("div",{class:"xpl-progress-indicator-step-text"},s),p=o?e("div",{class:"xpl-progress-indicator-step-content"},c,n):[c,n];return e("div",{class:{"xpl-progress-indicator-step":!0,"xpl-progress-indicator-step-active":i,"xpl-progress-indicator-step-finished":r},role:"listitem","aria-label":`${s}, ${r?"completed":i?"current":"upcoming"}`,"aria-current":i?"step":void 0},p)}render(){const s=this.steps||[],t=s.length;return e(r,{key:"44ac526c3954f688007573bf53c771b30518b9c7",class:{"xpl-progress-indicator":!0,"xpl-progress-indicator-horizontal":"horizontal"===this.layout,"xpl-progress-indicator-vertical":"vertical"===this.layout,"xpl-progress-indicator-no-labels":!this.showLabels},role:"group","aria-label":t>0?this.currentStep>=t?`Progress: all ${t} ${1===t?"step":"steps"} complete`:`Progress: step ${Math.min(this.currentStep+1,t)} of ${t}`:"Progress"},e("div",{key:"1ab86e3777ded2737ed5dd3c5ec759211a1087a7",class:"xpl-progress-indicator-container",role:"list"},s.map(((s,t)=>this.renderStep(s,t)))))}static get watchers(){return{steps:[{validateCurrentStep:0}],currentStep:[{validateCurrentStep:0}]}}},[0,"xpl-progress-indicator",{currentStep:[1026,"current-step"],layout:[1],showLabels:[4,"show-labels"],showNumbers:[4,"show-numbers"],steps:[16]},void 0,{steps:[{validateCurrentStep:0}],currentStep:[{validateCurrentStep:0}]}]),n=c,p=function(){"undefined"!=typeof customElements&&["xpl-progress-indicator","xpl-icon"].forEach((s=>{switch(s){case"xpl-progress-indicator":customElements.get(i(s))||customElements.define(i(s),c);break;case"xpl-icon":customElements.get(i(s))||o()}}))};export{n as XplProgressIndicator,p as defineCustomElement}
1
+ import{proxyCustomElement as s,HTMLElement as t,h as e,Host as r,transformTag as i}from"@stencil/core/internal/client";import{d as o}from"./xpl-icon2.js";const c=s(class extends t{constructor(s){super(),!1!==s&&this.__registerHost(),this.currentStep=0,this.layout="horizontal",this.showLabels=!0,this.showNumbers=!0}validateCurrentStep(){if(!this.steps||0===this.steps.length)return;const s=this.steps.length;this.currentStep<0?this.currentStep=0:this.currentStep>s&&(this.currentStep=s)}renderStepContent(s,t){return t?e("xpl-icon",{icon:"check-2",size:20,class:"xpl-progress-indicator-step-checkmark"}):this.showNumbers?e("span",{class:"xpl-progress-indicator-step-number"},s+1):e("span",{class:"xpl-progress-indicator-step-dot"})}renderStep(s,t){const r=this.currentStep>t,i=this.currentStep===t,o="horizontal"===this.layout,c=e("div",{class:"xpl-progress-indicator-step-circle"},this.renderStepContent(t,r)),n=this.showLabels&&e("div",{class:"xpl-progress-indicator-step-text"},s),p=o?e("div",{class:"xpl-progress-indicator-step-content"},c,n):[c,n];return e("div",{class:{"xpl-progress-indicator-step":!0,"xpl-progress-indicator-step-active":i,"xpl-progress-indicator-step-finished":r},role:"listitem","aria-label":`${s}, ${r?"completed":i?"current":"upcoming"}`,"aria-current":i?"step":void 0},p)}render(){const s=this.steps||[],t=s.length;return e(r,{key:"3a6f253693fd47f982541099a1729ca36d0ce64a",class:{"xpl-progress-indicator":!0,"xpl-progress-indicator-horizontal":"horizontal"===this.layout,"xpl-progress-indicator-vertical":"vertical"===this.layout,"xpl-progress-indicator-no-labels":!this.showLabels},role:"group","aria-label":t>0?this.currentStep>=t?`Progress: all ${t} ${1===t?"step":"steps"} complete`:`Progress: step ${Math.min(this.currentStep+1,t)} of ${t}`:"Progress"},e("div",{key:"c25b47994c43135ed3147ca579bdc3d8124d7c8a",class:"xpl-progress-indicator-container",role:"list"},s.map(((s,t)=>this.renderStep(s,t)))))}static get watchers(){return{steps:[{validateCurrentStep:0}],currentStep:[{validateCurrentStep:0}]}}},[0,"xpl-progress-indicator",{currentStep:[1026,"current-step"],layout:[1],showLabels:[4,"show-labels"],showNumbers:[4,"show-numbers"],steps:[16]},void 0,{steps:[{validateCurrentStep:0}],currentStep:[{validateCurrentStep:0}]}]),n=c,p=function(){"undefined"!=typeof customElements&&["xpl-progress-indicator","xpl-icon"].forEach((s=>{switch(s){case"xpl-progress-indicator":customElements.get(i(s))||customElements.define(i(s),c);break;case"xpl-icon":customElements.get(i(s))||o()}}))};export{n as XplProgressIndicator,p as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as d,transformTag as a}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)}}render(){return t(d,{key:"a96ab55137fedbfe00d68b660bd2d935208dc6c6",class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},t("input",{key:"ee385d0976d065fee4f72f75faea0ddbe33c0e81",class:"xpl-radio",type:"radio",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,onChange:this.onChange,value:this.value}),t("label",{key:"04e74e08a20b229f2d45b8fce80fa65ab3bf0954",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},t("slot",{key:"b9fe3e13de64776a9cc1afcd8f7c10f84be8c8bb"}),this.description&&t("small",{key:"6ecd217342fbfa9bb5022bb1298683ff87af1713",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],styled:[4],id:[32]}]);function r(){"undefined"!=typeof customElements&&["xpl-radio"].forEach((e=>{"xpl-radio"===e&&(customElements.get(a(e))||customElements.define(a(e),c))}))}export{c as R,r as d}
1
+ import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as c,transformTag as d}from"@stencil/core/internal/client";import{v as a}from"./v4.js";const l=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.radioChange=i(this,"radioChange",7),this.id=a(),this.onChange=e=>{this.radioChange.emit(this.value?this.value:e.target.checked)}}render(){return t(c,{key:"959940093b1988f6e362c17e463fe2139cd828c5",class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},t("input",{key:"cccccd581ee84a2c5c39a625565877cc080e9702",class:"xpl-radio",type:"radio",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,onChange:this.onChange,value:this.value}),t("label",{key:"3dd39b409818d7f2921c6dc7dc2c3d790a088833",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},t("slot",{key:"0e0af25e2b1679bef0aa053d20df8f0ec7390d18"}),this.description&&t("small",{key:"dcc8791c823ec66dcdb806ae4aeaf7daf6c72298",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],styled:[4],id:[32]}]);function r(){"undefined"!=typeof customElements&&["xpl-radio"].forEach((e=>{"xpl-radio"===e&&(customElements.get(d(e))||customElements.define(d(e),l))}))}export{l as R,r as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as n,h as a,Host as s,transformTag as c}from"@stencil/core/internal/client";const t=e(class extends n{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return a(s,{key:"bf9cbd4351297a28d6d98d3bf1e0612fac1f5136",class:"xpl-secondary-nav"},a("nav",{key:"764de50287c88f53f19005d50b177e85f71f7f43","aria-label":"Secondary Nav"},a("slot",{key:"d7fe629382a06f62dde9f08db082854e986ba406"})))}},[260,"xpl-secondary-nav"]),d=t,o=function(){"undefined"!=typeof customElements&&["xpl-secondary-nav"].forEach((e=>{"xpl-secondary-nav"===e&&(customElements.get(c(e))||customElements.define(c(e),t))}))};export{d as XplSecondaryNav,o as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as c,h as n,Host as a,transformTag as s}from"@stencil/core/internal/client";const d=e(class extends c{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return n(a,{key:"f4fdd93b13c1dc779c84e8b00b12caeff58df960",class:"xpl-secondary-nav"},n("nav",{key:"4092d23357761026ad5fddfbc32a221d957cce1e","aria-label":"Secondary Nav"},n("slot",{key:"c3ae9f1821a6d22babece27971cc1faf15037cdb"})))}},[260,"xpl-secondary-nav"]),t=d,o=function(){"undefined"!=typeof customElements&&["xpl-secondary-nav"].forEach((e=>{"xpl-secondary-nav"===e&&(customElements.get(s(e))||customElements.define(s(e),d))}))};export{t as XplSecondaryNav,o as defineCustomElement}