@foxy.io/elements 1.31.0-beta.1 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  6. package/dist/cdn/foxy-api-browser.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-form.js +1 -1
  12. package/dist/cdn/foxy-billing-address-card.js +1 -1
  13. package/dist/cdn/foxy-cancellation-form.js +1 -1
  14. package/dist/cdn/foxy-cart-card.js +1 -1
  15. package/dist/cdn/foxy-cart-form.js +2 -2
  16. package/dist/cdn/foxy-client-card.js +1 -1
  17. package/dist/cdn/foxy-client-form.js +1 -1
  18. package/dist/cdn/foxy-collection-page.js +1 -1
  19. package/dist/cdn/foxy-collection-pages.js +1 -1
  20. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  21. package/dist/cdn/foxy-coupon-card.js +1 -1
  22. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  24. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  26. package/dist/cdn/foxy-coupon-form.js +1 -1
  27. package/dist/cdn/foxy-custom-field-card.js +1 -1
  28. package/dist/cdn/foxy-custom-field-form.js +1 -1
  29. package/dist/cdn/foxy-customer-card.js +1 -1
  30. package/dist/cdn/foxy-customer-form.js +1 -1
  31. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  33. package/dist/cdn/foxy-customer-portal.js +1 -1
  34. package/dist/cdn/foxy-customer.js +1 -1
  35. package/dist/cdn/foxy-customers-table.js +1 -1
  36. package/dist/cdn/foxy-discount-builder.js +1 -1
  37. package/dist/cdn/foxy-discount-card.js +1 -1
  38. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  39. package/dist/cdn/foxy-donation.js +1 -1
  40. package/dist/cdn/foxy-downloadable-card.js +1 -1
  41. package/dist/cdn/foxy-downloadable-form.js +10 -10
  42. package/dist/cdn/foxy-email-template-card.js +1 -1
  43. package/dist/cdn/foxy-email-template-form.js +1 -1
  44. package/dist/cdn/foxy-error-entry-card.js +1 -1
  45. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  47. package/dist/cdn/foxy-form-dialog.js +1 -1
  48. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  49. package/dist/cdn/foxy-gift-card-card.js +1 -1
  50. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  54. package/dist/cdn/foxy-gift-card-form.js +1 -1
  55. package/dist/cdn/foxy-i18n-editor.js +1 -1
  56. package/dist/cdn/foxy-i18n.js +1 -1
  57. package/dist/cdn/foxy-integration-card.js +1 -1
  58. package/dist/cdn/foxy-integration-form.js +1 -1
  59. package/dist/cdn/foxy-item-card.js +1 -1
  60. package/dist/cdn/foxy-item-category-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-form.js +1 -1
  62. package/dist/cdn/foxy-item-form.js +1 -1
  63. package/dist/cdn/foxy-item-option-card.js +1 -1
  64. package/dist/cdn/foxy-item-option-form.js +1 -1
  65. package/dist/cdn/foxy-items-form.js +1 -1
  66. package/dist/cdn/foxy-native-integration-card.js +1 -1
  67. package/dist/cdn/foxy-native-integration-form.js +1 -1
  68. package/dist/cdn/foxy-pagination.js +1 -1
  69. package/dist/cdn/foxy-passkey-card.js +1 -1
  70. package/dist/cdn/foxy-passkey-form.js +1 -1
  71. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  72. package/dist/cdn/foxy-payment-card.js +1 -1
  73. package/dist/cdn/foxy-payment-method-card.js +1 -1
  74. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  76. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  80. package/dist/cdn/foxy-query-builder.js +2 -2
  81. package/dist/cdn/foxy-report-form.js +2 -2
  82. package/dist/cdn/foxy-reports-table.js +1 -1
  83. package/dist/cdn/foxy-shipment-card.js +1 -1
  84. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  85. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  88. package/dist/cdn/foxy-sign-in-form.js +1 -1
  89. package/dist/cdn/foxy-spinner.js +2 -2
  90. package/dist/cdn/foxy-store-card.js +1 -1
  91. package/dist/cdn/foxy-store-form.js +1 -1
  92. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  93. package/dist/cdn/foxy-subscription-card.js +1 -1
  94. package/dist/cdn/foxy-subscription-form.js +1 -1
  95. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  96. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  97. package/dist/cdn/foxy-table.js +1 -1
  98. package/dist/cdn/foxy-tax-card.js +1 -1
  99. package/dist/cdn/foxy-tax-form.js +1 -1
  100. package/dist/cdn/foxy-template-config-form.js +1 -1
  101. package/dist/cdn/foxy-template-form.js +1 -1
  102. package/dist/cdn/foxy-template-set-card.js +1 -1
  103. package/dist/cdn/foxy-template-set-form.js +1 -1
  104. package/dist/cdn/foxy-transaction-card.js +1 -1
  105. package/dist/cdn/foxy-transaction.js +1 -1
  106. package/dist/cdn/foxy-transactions-table.js +1 -1
  107. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  108. package/dist/cdn/foxy-user-card.js +1 -1
  109. package/dist/cdn/foxy-user-form.js +1 -1
  110. package/dist/cdn/foxy-users-table.js +1 -1
  111. package/dist/cdn/foxy-webhook-card.js +1 -1
  112. package/dist/cdn/foxy-webhook-form.js +1 -1
  113. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  114. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  115. package/dist/cdn/{shared-6be24929.js → shared-029d623b.js} +1 -1
  116. package/dist/cdn/{shared-cb3b9d8b.js → shared-0700fd80.js} +1 -1
  117. package/dist/cdn/shared-08e0a194.js +1 -0
  118. package/dist/cdn/{shared-2bd96ec7.js → shared-09b4185a.js} +1 -1
  119. package/dist/cdn/{shared-8fbebf38.js → shared-0a6a28ce.js} +1 -1
  120. package/dist/cdn/{shared-ea5ff8bc.js → shared-0cc5420d.js} +1 -1
  121. package/dist/cdn/{shared-97514fcb.js → shared-0e055562.js} +1 -1
  122. package/dist/cdn/{shared-2d75f154.js → shared-0f67d020.js} +1 -1
  123. package/dist/cdn/{shared-e47bd38e.js → shared-16c17e32.js} +1 -1
  124. package/dist/cdn/{shared-2c1dff50.js → shared-19884cf4.js} +1 -1
  125. package/dist/cdn/{shared-d75f83f8.js → shared-199e3870.js} +1 -1
  126. package/dist/cdn/{shared-77ef56aa.js → shared-1f0b8b7e.js} +1 -1
  127. package/dist/cdn/{shared-c5a0cdd7.js → shared-21bc5d5e.js} +1 -1
  128. package/dist/cdn/{shared-deff3eda.js → shared-245f8836.js} +1 -1
  129. package/dist/cdn/{shared-9bf7d9a7.js → shared-280f868d.js} +1 -1
  130. package/dist/cdn/{shared-fae08dfb.js → shared-28f74114.js} +1 -1
  131. package/dist/cdn/{shared-4a652d60.js → shared-2a5c89a4.js} +1 -1
  132. package/dist/cdn/{shared-49ecea83.js → shared-37efab30.js} +1 -1
  133. package/dist/cdn/{shared-6d11abd7.js → shared-388e9240.js} +2 -2
  134. package/dist/cdn/{shared-1d4fdfa8.js → shared-3c3497d6.js} +1 -1
  135. package/dist/cdn/shared-3ee151ce.js +1 -0
  136. package/dist/cdn/{shared-98ddb87c.js → shared-44ce656d.js} +1 -1
  137. package/dist/cdn/{shared-8cb35eb4.js → shared-453d8f75.js} +1 -1
  138. package/dist/cdn/{shared-ff7b2af6.js → shared-4b346553.js} +1 -1
  139. package/dist/cdn/{shared-6f877b15.js → shared-536a2d53.js} +1 -1
  140. package/dist/cdn/{shared-5bc86d84.js → shared-55e95bd2.js} +1 -1
  141. package/dist/cdn/{shared-fb1dd186.js → shared-56a559fd.js} +1 -1
  142. package/dist/cdn/{shared-59b7fcc0.js → shared-56bf05ef.js} +1 -1
  143. package/dist/cdn/{shared-73045804.js → shared-5a2f398c.js} +1 -1
  144. package/dist/cdn/{shared-f6573d25.js → shared-5be5874d.js} +1 -1
  145. package/dist/cdn/{shared-3cf043a7.js → shared-61b6ef6e.js} +1 -1
  146. package/dist/cdn/{shared-a8233033.js → shared-638468a5.js} +1 -1
  147. package/dist/cdn/{shared-09fc6fa0.js → shared-6918312e.js} +1 -1
  148. package/dist/cdn/{shared-9637a2de.js → shared-6e859df6.js} +1 -1
  149. package/dist/cdn/{shared-226dd830.js → shared-7d38cb8a.js} +1 -1
  150. package/dist/cdn/shared-8cd578ee.js +1 -0
  151. package/dist/cdn/{shared-0f00d4d8.js → shared-8f3398dc.js} +1 -1
  152. package/dist/cdn/{shared-887e1795.js → shared-90a47948.js} +1 -1
  153. package/dist/cdn/{shared-787e8da4.js → shared-937b497c.js} +1 -1
  154. package/dist/cdn/{shared-1729e19a.js → shared-9b2d6d62.js} +1 -1
  155. package/dist/cdn/{shared-77e15843.js → shared-a207423c.js} +1 -1
  156. package/dist/cdn/{shared-0c7f9c0c.js → shared-a49a2300.js} +1 -1
  157. package/dist/cdn/{shared-6f4fa343.js → shared-ac0368ec.js} +1 -1
  158. package/dist/cdn/{shared-fb1602a2.js → shared-b08ca8d0.js} +1 -1
  159. package/dist/cdn/{shared-19f46691.js → shared-b8198665.js} +1 -1
  160. package/dist/cdn/{shared-9b895561.js → shared-c2776a33.js} +1 -1
  161. package/dist/cdn/{shared-e7bff5de.js → shared-c388e926.js} +1 -1
  162. package/dist/cdn/{shared-8f74f5fc.js → shared-c8a6496c.js} +1 -1
  163. package/dist/cdn/{shared-a0efdc94.js → shared-ce172224.js} +1 -1
  164. package/dist/cdn/{shared-476827c7.js → shared-ce75e928.js} +1 -1
  165. package/dist/cdn/{shared-ad76e640.js → shared-d132bd37.js} +1 -1
  166. package/dist/cdn/{shared-b38762ef.js → shared-d1c10d58.js} +1 -1
  167. package/dist/cdn/{shared-5c4d786c.js → shared-d8c3067b.js} +1 -1
  168. package/dist/cdn/{shared-5721fb53.js → shared-da9e048f.js} +1 -1
  169. package/dist/cdn/shared-dfc33ff6.js +1 -0
  170. package/dist/cdn/{shared-e7232c2b.js → shared-e24da82e.js} +2 -2
  171. package/dist/cdn/{shared-d5ff9121.js → shared-e778071b.js} +1 -1
  172. package/dist/cdn/{shared-8fce283a.js → shared-edbf7378.js} +1 -1
  173. package/dist/cdn/{shared-e5098b19.js → shared-ef78d7d9.js} +1 -1
  174. package/dist/cdn/{shared-4d172731.js → shared-f11b2116.js} +1 -1
  175. package/dist/cdn/{shared-ea8f9a88.js → shared-f2968508.js} +1 -1
  176. package/dist/cdn/shared-f34aeb6c.js +1 -0
  177. package/dist/cdn/{shared-df42c94f.js → shared-f3773d62.js} +1 -1
  178. package/dist/cdn/{shared-471e77dd.js → shared-f407c2cb.js} +1 -1
  179. package/dist/cdn/{shared-63192750.js → shared-fb0ca5e2.js} +1 -1
  180. package/dist/cdn/{shared-25502f01.js → shared-fb34e84c.js} +1 -1
  181. package/dist/cdn/{shared-c11df800.js → shared-fc1dfa64.js} +1 -1
  182. package/dist/cdn/translations/store-form/en.json +321 -280
  183. package/dist/cdn/translations/store-shipping-method-form/en.json +1 -2
  184. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +2 -2
  185. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
  186. package/dist/elements/internal/InternalPasswordControl/vaadinStyles.js +1 -1
  187. package/dist/elements/internal/InternalPasswordControl/vaadinStyles.js.map +1 -1
  188. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +6 -7
  189. package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
  190. package/dist/elements/internal/InternalTextControl/InternalTextControl.js +4 -0
  191. package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
  192. package/dist/elements/public/StoreForm/StoreForm.d.ts +60 -36
  193. package/dist/elements/public/StoreForm/StoreForm.js +584 -715
  194. package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
  195. package/dist/elements/public/StoreForm/index.d.ts +2 -5
  196. package/dist/elements/public/StoreForm/index.js +2 -5
  197. package/dist/elements/public/StoreForm/index.js.map +1 -1
  198. package/dist/elements/public/StoreForm/types.d.ts +38 -0
  199. package/dist/elements/public/StoreForm/types.js.map +1 -1
  200. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.d.ts +1 -0
  201. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +26 -41
  202. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
  203. package/dist/elements/public/StoreShippingMethodForm/types.d.ts +1 -3
  204. package/dist/elements/public/StoreShippingMethodForm/types.js.map +1 -1
  205. package/dist/mixins/themeable.js +0 -36
  206. package/dist/mixins/themeable.js.map +1 -1
  207. package/package.json +1 -1
  208. package/dist/cdn/shared-01f18104.js +0 -1
  209. package/dist/cdn/shared-3b975a29.js +0 -1
  210. package/dist/cdn/shared-41e7554e.js +0 -1
  211. package/dist/cdn/shared-90706e10.js +0 -1
  212. package/dist/cdn/shared-c4124870.js +0 -1
  213. package/dist/cdn/shared-cc8b47c6.js +0 -1
  214. package/dist/cdn/shared-fcbf196e.js +0 -1
@@ -1 +1 @@
1
- import{_ as e}from"./shared-0f6e4584.js";import{c as t,L as s,h as i}from"./shared-dc73b9a5.js";import{A as o}from"./shared-c286c5ad.js";import{C as a}from"./shared-0b01f721.js";import{T as n,R as l,a as d}from"./shared-25502f01.js";import{I as r}from"./shared-f7a1193f.js";import{F as h}from"./shared-343d1fd7.js";import{c}from"./shared-4e709717.js";class u extends CustomEvent{constructor(e=!1){super("hide",{detail:{cancelled:e}})}}class p extends CustomEvent{constructor(){super("show")}}let m,v=e=>e;class b extends(a(n(l(d(r(s)))))){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{}})}static get styles(){return[super.styles,t(m||(m=v`:host{position:relative;z-index:200}`))]}}let _,g,y,f,w,x,$,C=e=>e;const D=d(a(n(r(s))));class k extends D{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.header="",this.group="",this.alert=!1,this.wide=!1,this.__handleKeyDown=e=>{"Escape"===e.key&&k.openDialogs[0]===this&&this.closable&&this.hide(this.editable)},this.__connected=!1,this.__visible=!1}static get properties(){return e(e({},super.properties),{},{__connected:{attribute:!1},__visible:{attribute:!1},centered:{type:Boolean},closable:{type:Boolean},editable:{type:Boolean},header:{type:String},group:{},alert:{type:Boolean},wide:{type:Boolean},open:{type:Boolean,noAccessor:!0}})}static get styles(){return[super.styles,t(_||(_=C`.grid-cols-header{grid-template-columns:1fr auto 1fr}.scale-85{--tw-scale-x:0.85;--tw-scale-y:0.85}.max-h-alert{max-height:calc(100dvh - var(--lumo-size-l) - var(--lumo-space-m) * 2)}`))]}get open(){return this.__visible&&this.__connected}set open(e){e===this.open||(e?this.show():this.hide(this.editable))}connectedCallback(){super.connectedCallback(),addEventListener("keydown",this.__handleKeyDown)}disconnectedCallback(){var e;super.disconnectedCallback(),removeEventListener("keydown",this.__handleKeyDown),null===(e=k.dialogWindows.get(this))||void 0===e||e.remove(),k.dialogWindows.delete(this)}createRenderRoot(){const e=new b,t=document.querySelectorAll(k.dialogWindowsHost),s=Array.from(t).pop();return e.addEventListener("fetch",(e=>{e instanceof h&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new o(this).fetch(e.request)))})),null==s||s.appendChild(e),k.dialogWindows.set(this,e),e.shadowRoot}render(e){if(!this.__connected)return i(g||(g=C``));const t=k.openDialogs[0]===this,s=k.openDialogs[1]===this,o=k.openDialogs[2]===this,a=!t&&!s&&!o;return i(y||(y=C` <div class="${0}"> <div id="backdrop" class="${0}" tabindex="-1" @click="${0}"></div> <div tabindex="0" role="dialog" aria-labelledby="dialog-title" class="${0}"> <div class="${0}"> <div class="h-l grid grid-cols-header text-m font-lumo font-medium border-b border-contrast-10"> ${0} <h1 id="dialog-title" class="truncate self-center text-center"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </h1> ${0} </div> <div class="${0}"> <div class="p-m relative">${0}</div> </div> </div> </div> </div> `),c({"z-50 fixed inset-0":!0,"pointer-events-none":!this.__visible}),c({"select-none ease-in-out transition duration-500 absolute inset-0 bg-shade-50 focus-outline-none":!0,"opacity-100":this.__visible,"opacity-0":!this.__visible}),(()=>this.closable&&this.hide(this.editable)),c({"transform ease-in-out transition duration-500 relative h-full ml-auto":!0,"origin-bottom sm-origin-center":!0,"focus-outline-none":!0,"sm-max-w-modal":!this.wide,"sm-max-w-modal-wide":this.wide,"flex justify-center items-end sm-items-center mr-auto":this.alert,"translate-y-full sm-translate-y-0":!this.__visible,"sm-translate-x-full":!this.alert&&!this.__visible,"sm-opacity-0 sm-scale-110":this.alert&&!this.__visible,"translate-y-0 translate-x-0":t&&this.__visible,"scale-95 -translate-y-s sm-translate-y-0":s&&this.__visible,"scale-90 -translate-y-m sm-translate-y-0":o&&this.__visible,"opacity-0 scale-85 -translate-y-l sm-translate-y-0":a&&this.__visible}),c({"overflow-hidden flex flex-col bg-base rounded-t-l sm-rounded-b-l":!0,"absolute inset-0 mt-xl sm-m-xl":!this.alert,"shadow-xxl":this.__visible,"flex-1":this.alert}),this.closable&&!this.hiddenSelector.matches("close-button",!0)?i(f||(f=C` <vaadin-button id="close-button" theme="tertiary-inline" class="mr-auto m-s px-s" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("close-button",!0),(()=>this.hide(this.editable)),this.lang,this.editable?"cancel":"close",this.ns):i(w||(w=C`<div></div>`)),this.ns,this.lang,this.header,this.editable&&!this.hiddenSelector.matches("save-button",!0)?i(x||(x=C` <vaadin-button data-testid="save-button" ?disabled="${0}" theme="primary" class="ml-auto h-auto min-h-0 min-w-0 m-xs px-m" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="save"></foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("save-button",!0),this.save,this.ns,this.lang):i($||($=C`<div></div>`)),c({"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain":!0,"max-h-alert":this.alert}),null==e?void 0:e())}updated(e){super.updated(e);const t=k.dialogWindows.get(this);t&&(t.disabledControls=this.disabledControls,t.disabled=this.disabled,t.readonlyControls=this.readonlyControls,t.readonly=this.readonly,t.hiddenControls=this.hiddenControls,t.hidden=this.hidden,t.group=this.group,t.lang=this.lang,t.ns=this.ns)}async hide(e=!1){var t;null===(t=this.__returnFocusTo)||void 0===t||t.focus(),await this.__setOpenDialogs(k.openDialogs.filter((e=>e!==this))),await this.__setConnected(!1),this.dispatchEvent(new k.HideEvent(!!e))}async show(e){var t;this.__returnFocusTo=e,await this.__setConnected(!0),await this.__setOpenDialogs([this,...k.openDialogs]),null===(t=this.renderRoot.querySelector('[role="dialog"]'))||void 0===t||t.focus(),this.dispatchEvent(new k.ShowEvent)}async save(){await this.hide(!1)}async __setOpenDialogs(e){k.openDialogs.length=0,k.openDialogs.push(...e),await Promise.all([Promise.all(k.openDialogs.map((e=>e.requestUpdate()))),new Promise((e=>{const t=this.renderRoot.querySelector("#backdrop");t?(t.addEventListener("transitionend",(()=>e()),{once:!0}),setTimeout((()=>e()),2e3)):e(),this.__visible=k.openDialogs.includes(this)}))])}async __setConnected(e){this.__connected=e,await this.updateComplete.then((()=>this.getBoundingClientRect()))}}k.dialogWindowsHost="#foxy-dialog-windows-host, body",k.dialogWindows=new WeakMap,k.openDialogs=[],k.ShowEvent=p,k.HideEvent=u,customElements.define("foxy-dialog-window",b);export{k as D};
1
+ import{_ as e}from"./shared-0f6e4584.js";import{c as t,L as s,h as i}from"./shared-dc73b9a5.js";import{A as o}from"./shared-c286c5ad.js";import{C as a}from"./shared-0b01f721.js";import{T as n,R as l,a as d}from"./shared-fb34e84c.js";import{I as r}from"./shared-f7a1193f.js";import{F as h}from"./shared-343d1fd7.js";import{c}from"./shared-4e709717.js";class u extends CustomEvent{constructor(e=!1){super("hide",{detail:{cancelled:e}})}}class p extends CustomEvent{constructor(){super("show")}}let m,v=e=>e;class b extends(a(n(l(d(r(s)))))){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{}})}static get styles(){return[super.styles,t(m||(m=v`:host{position:relative;z-index:200}`))]}}let _,g,y,f,w,x,$,C=e=>e;const D=d(a(n(r(s))));class k extends D{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.header="",this.group="",this.alert=!1,this.wide=!1,this.__handleKeyDown=e=>{"Escape"===e.key&&k.openDialogs[0]===this&&this.closable&&this.hide(this.editable)},this.__connected=!1,this.__visible=!1}static get properties(){return e(e({},super.properties),{},{__connected:{attribute:!1},__visible:{attribute:!1},centered:{type:Boolean},closable:{type:Boolean},editable:{type:Boolean},header:{type:String},group:{},alert:{type:Boolean},wide:{type:Boolean},open:{type:Boolean,noAccessor:!0}})}static get styles(){return[super.styles,t(_||(_=C`.grid-cols-header{grid-template-columns:1fr auto 1fr}.scale-85{--tw-scale-x:0.85;--tw-scale-y:0.85}.max-h-alert{max-height:calc(100dvh - var(--lumo-size-l) - var(--lumo-space-m) * 2)}`))]}get open(){return this.__visible&&this.__connected}set open(e){e===this.open||(e?this.show():this.hide(this.editable))}connectedCallback(){super.connectedCallback(),addEventListener("keydown",this.__handleKeyDown)}disconnectedCallback(){var e;super.disconnectedCallback(),removeEventListener("keydown",this.__handleKeyDown),null===(e=k.dialogWindows.get(this))||void 0===e||e.remove(),k.dialogWindows.delete(this)}createRenderRoot(){const e=new b,t=document.querySelectorAll(k.dialogWindowsHost),s=Array.from(t).pop();return e.addEventListener("fetch",(e=>{e instanceof h&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new o(this).fetch(e.request)))})),null==s||s.appendChild(e),k.dialogWindows.set(this,e),e.shadowRoot}render(e){if(!this.__connected)return i(g||(g=C``));const t=k.openDialogs[0]===this,s=k.openDialogs[1]===this,o=k.openDialogs[2]===this,a=!t&&!s&&!o;return i(y||(y=C` <div class="${0}"> <div id="backdrop" class="${0}" tabindex="-1" @click="${0}"></div> <div tabindex="0" role="dialog" aria-labelledby="dialog-title" class="${0}"> <div class="${0}"> <div class="h-l grid grid-cols-header text-m font-lumo font-medium border-b border-contrast-10"> ${0} <h1 id="dialog-title" class="truncate self-center text-center"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </h1> ${0} </div> <div class="${0}"> <div class="p-m relative">${0}</div> </div> </div> </div> </div> `),c({"z-50 fixed inset-0":!0,"pointer-events-none":!this.__visible}),c({"select-none ease-in-out transition duration-500 absolute inset-0 bg-shade-50 focus-outline-none":!0,"opacity-100":this.__visible,"opacity-0":!this.__visible}),(()=>this.closable&&this.hide(this.editable)),c({"transform ease-in-out transition duration-500 relative h-full ml-auto":!0,"origin-bottom sm-origin-center":!0,"focus-outline-none":!0,"sm-max-w-modal":!this.wide,"sm-max-w-modal-wide":this.wide,"flex justify-center items-end sm-items-center mr-auto":this.alert,"translate-y-full sm-translate-y-0":!this.__visible,"sm-translate-x-full":!this.alert&&!this.__visible,"sm-opacity-0 sm-scale-110":this.alert&&!this.__visible,"translate-y-0 translate-x-0":t&&this.__visible,"scale-95 -translate-y-s sm-translate-y-0":s&&this.__visible,"scale-90 -translate-y-m sm-translate-y-0":o&&this.__visible,"opacity-0 scale-85 -translate-y-l sm-translate-y-0":a&&this.__visible}),c({"overflow-hidden flex flex-col bg-base rounded-t-l sm-rounded-b-l":!0,"absolute inset-0 mt-xl sm-m-xl":!this.alert,"shadow-xxl":this.__visible,"flex-1":this.alert}),this.closable&&!this.hiddenSelector.matches("close-button",!0)?i(f||(f=C` <vaadin-button id="close-button" theme="tertiary-inline" class="mr-auto m-s px-s" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("close-button",!0),(()=>this.hide(this.editable)),this.lang,this.editable?"cancel":"close",this.ns):i(w||(w=C`<div></div>`)),this.ns,this.lang,this.header,this.editable&&!this.hiddenSelector.matches("save-button",!0)?i(x||(x=C` <vaadin-button data-testid="save-button" ?disabled="${0}" theme="primary" class="ml-auto h-auto min-h-0 min-w-0 m-xs px-m" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="save"></foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("save-button",!0),this.save,this.ns,this.lang):i($||($=C`<div></div>`)),c({"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain":!0,"max-h-alert":this.alert}),null==e?void 0:e())}updated(e){super.updated(e);const t=k.dialogWindows.get(this);t&&(t.disabledControls=this.disabledControls,t.disabled=this.disabled,t.readonlyControls=this.readonlyControls,t.readonly=this.readonly,t.hiddenControls=this.hiddenControls,t.hidden=this.hidden,t.group=this.group,t.lang=this.lang,t.ns=this.ns)}async hide(e=!1){var t;null===(t=this.__returnFocusTo)||void 0===t||t.focus(),await this.__setOpenDialogs(k.openDialogs.filter((e=>e!==this))),await this.__setConnected(!1),this.dispatchEvent(new k.HideEvent(!!e))}async show(e){var t;this.__returnFocusTo=e,await this.__setConnected(!0),await this.__setOpenDialogs([this,...k.openDialogs]),null===(t=this.renderRoot.querySelector('[role="dialog"]'))||void 0===t||t.focus(),this.dispatchEvent(new k.ShowEvent)}async save(){await this.hide(!1)}async __setOpenDialogs(e){k.openDialogs.length=0,k.openDialogs.push(...e),await Promise.all([Promise.all(k.openDialogs.map((e=>e.requestUpdate()))),new Promise((e=>{const t=this.renderRoot.querySelector("#backdrop");t?(t.addEventListener("transitionend",(()=>e()),{once:!0}),setTimeout((()=>e()),2e3)):e(),this.__visible=k.openDialogs.includes(this)}))])}async __setConnected(e){this.__connected=e,await this.updateComplete.then((()=>this.getBoundingClientRect()))}}k.dialogWindowsHost="#foxy-dialog-windows-host, body",k.dialogWindows=new WeakMap,k.openDialogs=[],k.ShowEvent=p,k.HideEvent=u,customElements.define("foxy-dialog-window",b);export{k as D};