@foxy.io/elements 1.41.0-beta.1 → 1.41.0-beta.3

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 (215) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +5 -5
  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 +1 -1
  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 +1 -1
  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-experimental-add-to-cart-builder.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  47. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  48. package/dist/cdn/foxy-form-dialog.js +1 -1
  49. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  54. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  55. package/dist/cdn/foxy-gift-card-form.js +1 -1
  56. package/dist/cdn/foxy-i18n-editor.js +1 -1
  57. package/dist/cdn/foxy-i18n.js +1 -1
  58. package/dist/cdn/foxy-integration-card.js +1 -1
  59. package/dist/cdn/foxy-integration-form.js +1 -1
  60. package/dist/cdn/foxy-item-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-form.js +1 -1
  63. package/dist/cdn/foxy-item-form.js +1 -1
  64. package/dist/cdn/foxy-item-option-card.js +1 -1
  65. package/dist/cdn/foxy-item-option-form.js +1 -1
  66. package/dist/cdn/foxy-items-form.js +1 -1
  67. package/dist/cdn/foxy-native-integration-card.js +1 -1
  68. package/dist/cdn/foxy-native-integration-form.js +1 -1
  69. package/dist/cdn/foxy-pagination.js +1 -1
  70. package/dist/cdn/foxy-passkey-card.js +1 -1
  71. package/dist/cdn/foxy-passkey-form.js +1 -1
  72. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  73. package/dist/cdn/foxy-payment-card.js +1 -1
  74. package/dist/cdn/foxy-payment-method-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  81. package/dist/cdn/foxy-query-builder.js +1 -1
  82. package/dist/cdn/foxy-report-form.js +2 -2
  83. package/dist/cdn/foxy-reports-table.js +6 -6
  84. package/dist/cdn/foxy-shipment-card.js +1 -1
  85. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  89. package/dist/cdn/foxy-sign-in-form.js +1 -1
  90. package/dist/cdn/foxy-spinner.js +2 -2
  91. package/dist/cdn/foxy-store-card.js +1 -1
  92. package/dist/cdn/foxy-store-form.js +1 -1
  93. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  94. package/dist/cdn/foxy-subscription-card.js +1 -1
  95. package/dist/cdn/foxy-subscription-form.js +1 -1
  96. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  97. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  98. package/dist/cdn/foxy-table.js +1 -1
  99. package/dist/cdn/foxy-tax-card.js +1 -1
  100. package/dist/cdn/foxy-tax-form.js +1 -1
  101. package/dist/cdn/foxy-template-config-form.js +1 -1
  102. package/dist/cdn/foxy-template-form.js +1 -1
  103. package/dist/cdn/foxy-template-set-card.js +1 -1
  104. package/dist/cdn/foxy-template-set-form.js +1 -1
  105. package/dist/cdn/foxy-transaction-card.js +1 -1
  106. package/dist/cdn/foxy-transaction.js +1 -1
  107. package/dist/cdn/foxy-transactions-table.js +7 -7
  108. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  109. package/dist/cdn/foxy-user-card.js +1 -1
  110. package/dist/cdn/foxy-user-form.js +1 -1
  111. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  112. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  113. package/dist/cdn/foxy-users-table.js +1 -1
  114. package/dist/cdn/foxy-webhook-card.js +1 -1
  115. package/dist/cdn/foxy-webhook-form.js +1 -1
  116. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  117. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  118. package/dist/cdn/{shared-097635e6.js → shared-0179fbaa.js} +1 -1
  119. package/dist/cdn/{shared-c1e86ea4.js → shared-12ea5def.js} +1 -1
  120. package/dist/cdn/{shared-f1033d78.js → shared-1522e7b0.js} +3 -3
  121. package/dist/cdn/{shared-6be00444.js → shared-15f46bcc.js} +1 -1
  122. package/dist/cdn/{shared-243456aa.js → shared-1cd9967e.js} +1 -1
  123. package/dist/cdn/{shared-8b0f00fa.js → shared-2931ccbe.js} +1 -1
  124. package/dist/cdn/{shared-d807cb20.js → shared-29b0ef56.js} +1 -1
  125. package/dist/cdn/{shared-3fcf4feb.js → shared-2be606c3.js} +1 -1
  126. package/dist/cdn/{shared-8ef0ca65.js → shared-2fe84d72.js} +1 -1
  127. package/dist/cdn/{shared-360d6a20.js → shared-30829c7f.js} +1 -1
  128. package/dist/cdn/{shared-697d44e6.js → shared-313956af.js} +1 -1
  129. package/dist/cdn/{shared-63eef674.js → shared-32f04dd0.js} +1 -1
  130. package/dist/cdn/{shared-a03facdf.js → shared-34cbd863.js} +1 -1
  131. package/dist/cdn/shared-35dbfac1.js +1 -0
  132. package/dist/cdn/{shared-f9ac8763.js → shared-3ad093b5.js} +1 -1
  133. package/dist/cdn/{shared-11351c00.js → shared-3c0dcb9e.js} +2 -2
  134. package/dist/cdn/{shared-2d596f72.js → shared-3f381f99.js} +1 -1
  135. package/dist/cdn/{shared-84eb85dd.js → shared-43c39c6f.js} +1 -1
  136. package/dist/cdn/{shared-e41fced3.js → shared-4507220f.js} +1 -1
  137. package/dist/cdn/{shared-57a179b3.js → shared-49fef994.js} +1 -1
  138. package/dist/cdn/{shared-495860b4.js → shared-504d2acb.js} +1 -1
  139. package/dist/cdn/{shared-3556f4b7.js → shared-5231970e.js} +1 -1
  140. package/dist/cdn/{shared-6957b8e6.js → shared-535d1ec6.js} +1 -1
  141. package/dist/cdn/{shared-1c355fac.js → shared-54031a26.js} +2 -2
  142. package/dist/cdn/{shared-29f60d2f.js → shared-58a50b35.js} +5 -5
  143. package/dist/cdn/{shared-37348820.js → shared-58c0c5cc.js} +1 -1
  144. package/dist/cdn/{shared-c25538f1.js → shared-58f1f368.js} +2 -2
  145. package/dist/cdn/{shared-6199cae2.js → shared-59657e70.js} +1 -1
  146. package/dist/cdn/{shared-cf12f33b.js → shared-5988dd30.js} +1 -1
  147. package/dist/cdn/{shared-83c5e004.js → shared-619235ab.js} +1 -1
  148. package/dist/cdn/{shared-be442f26.js → shared-62a913ef.js} +1 -1
  149. package/dist/cdn/{shared-315d7620.js → shared-65763e6f.js} +1 -1
  150. package/dist/cdn/{shared-88220d9e.js → shared-678878ae.js} +1 -1
  151. package/dist/cdn/{shared-f69aacbc.js → shared-69943b4f.js} +1 -1
  152. package/dist/cdn/{shared-c46affa4.js → shared-72536261.js} +1 -1
  153. package/dist/cdn/{shared-4d32d19e.js → shared-72ebbdcd.js} +1 -1
  154. package/dist/cdn/{shared-230dee11.js → shared-75f0b4ce.js} +1 -1
  155. package/dist/cdn/{shared-9a64bf35.js → shared-7f25f727.js} +1 -1
  156. package/dist/cdn/{shared-bd5285ff.js → shared-8697a27e.js} +1 -1
  157. package/dist/cdn/{shared-35a49192.js → shared-86d308bf.js} +1 -1
  158. package/dist/cdn/{shared-86e9c57a.js → shared-8a380d5b.js} +1 -1
  159. package/dist/cdn/{shared-a587fd4b.js → shared-8ae33bf4.js} +1 -1
  160. package/dist/cdn/{shared-7097e2e1.js → shared-90a27f17.js} +1 -1
  161. package/dist/cdn/{shared-109ec474.js → shared-92f7ee94.js} +1 -1
  162. package/dist/cdn/{shared-67f73b81.js → shared-968df92b.js} +1 -1
  163. package/dist/cdn/{shared-c18f681b.js → shared-a146c6a5.js} +1 -1
  164. package/dist/cdn/{shared-0df46275.js → shared-a477b90e.js} +1 -1
  165. package/dist/cdn/{shared-f989c70e.js → shared-a4a847e4.js} +1 -1
  166. package/dist/cdn/{shared-8eeddc22.js → shared-a510a176.js} +1 -1
  167. package/dist/cdn/{shared-edeeb089.js → shared-acbcad2e.js} +1 -1
  168. package/dist/cdn/{shared-888018de.js → shared-be50c355.js} +1 -1
  169. package/dist/cdn/{shared-048d5cae.js → shared-c003fbf3.js} +1 -1
  170. package/dist/cdn/{shared-7dc9c80b.js → shared-c19d73fe.js} +1 -1
  171. package/dist/cdn/{shared-47d95cdd.js → shared-c5025eca.js} +1 -1
  172. package/dist/cdn/{shared-8b25a098.js → shared-c71fb90f.js} +1 -1
  173. package/dist/cdn/{shared-21e68b72.js → shared-cfea6000.js} +1 -1
  174. package/dist/cdn/{shared-f1a70f51.js → shared-d298bb95.js} +1 -1
  175. package/dist/cdn/{shared-43637d69.js → shared-df97fdc7.js} +1 -1
  176. package/dist/cdn/{shared-b65d169b.js → shared-e69c94bd.js} +1 -1
  177. package/dist/cdn/{shared-864ff856.js → shared-ec013722.js} +1 -1
  178. package/dist/cdn/{shared-18e3b778.js → shared-ee4757df.js} +1 -1
  179. package/dist/cdn/{shared-e3421ca1.js → shared-ef4d09da.js} +1 -1
  180. package/dist/cdn/{shared-1100bca8.js → shared-f2f81cda.js} +1 -1
  181. package/dist/cdn/{shared-6683daed.js → shared-fe56bcdb.js} +1 -1
  182. package/dist/cdn/{shared-77132fe8.js → shared-ffa49371.js} +1 -1
  183. package/dist/cdn/translations/admin-subscription-form/en.json +1 -0
  184. package/dist/cdn/translations/coupon-form/en.json +15 -0
  185. package/dist/cdn/translations/transaction/en.json +60 -35
  186. package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js +28 -8
  187. package/dist/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.js.map +1 -1
  188. package/dist/elements/public/CouponForm/CouponForm.js +16 -1
  189. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
  190. package/dist/elements/public/FilterAttributeForm/FilterAttributeForm.d.ts +2 -0
  191. package/dist/elements/public/FilterAttributeForm/FilterAttributeForm.js +22 -4
  192. package/dist/elements/public/FilterAttributeForm/FilterAttributeForm.js.map +1 -1
  193. package/dist/elements/public/Transaction/Transaction.js +5 -3
  194. package/dist/elements/public/Transaction/Transaction.js.map +1 -1
  195. package/dist/elements/public/Transaction/index.d.ts +1 -1
  196. package/dist/elements/public/Transaction/index.js +1 -1
  197. package/dist/elements/public/Transaction/index.js.map +1 -1
  198. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js +16 -14
  199. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/InternalTransactionActionsControl.js.map +1 -1
  200. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.d.ts +1 -1
  201. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js +1 -1
  202. package/dist/elements/public/Transaction/internal/InternalTransactionActionsControl/index.js.map +1 -1
  203. package/dist/mixins/themeable.js +12 -0
  204. package/dist/mixins/themeable.js.map +1 -1
  205. package/package.json +1 -1
  206. package/dist/cdn/shared-3661a086.js +0 -1
  207. package/dist/cdn/translations/country/zh-cn.json +0 -248
  208. package/dist/cdn/translations/country/zh-hk.json +0 -245
  209. package/dist/cdn/translations/customer-portal/zh-hk.json +0 -1182
  210. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.d.ts +0 -10
  211. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js +0 -60
  212. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.js.map +0 -1
  213. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.d.ts +0 -6
  214. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.js +0 -8
  215. package/dist/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.js.map +0 -1
@@ -1,10 +0,0 @@
1
- import { PropertyDeclarations, TemplateResult } from 'lit-element';
2
- import { InternalControl } from '../../../../internal/InternalControl/InternalControl';
3
- export declare class InternalTransactionPostActionControl extends InternalControl {
4
- static get properties(): PropertyDeclarations;
5
- theme: string | null;
6
- href: string | null;
7
- private __state;
8
- renderControl(): TemplateResult;
9
- private __submit;
10
- }
@@ -1,60 +0,0 @@
1
- import { html } from 'lit-element';
2
- import { InternalControl } from "../../../../internal/InternalControl/InternalControl.js";
3
- import { NucleonElement } from "../../../NucleonElement/NucleonElement.js";
4
- export class InternalTransactionPostActionControl extends InternalControl {
5
- constructor() {
6
- super(...arguments);
7
- this.theme = null;
8
- this.href = null;
9
- this.__state = 'idle';
10
- }
11
- static get properties() {
12
- return {
13
- ...super.properties,
14
- __state: { type: String },
15
- theme: { type: String },
16
- href: { type: String },
17
- };
18
- }
19
- renderControl() {
20
- const state = this.__state;
21
- const theme = state === 'fail' ? 'error' : state === 'idle' ? this.theme : '';
22
- return html `
23
- <foxy-internal-confirm-dialog
24
- header="header"
25
- infer="confirm"
26
- id="confirm"
27
- @hide=${(evt) => !evt.detail.cancelled && this.__submit()}
28
- >
29
- </foxy-internal-confirm-dialog>
30
-
31
- <vaadin-button
32
- theme="${theme} tertiary-inline"
33
- ?disabled=${state === 'busy' || this.disabled}
34
- @click=${(evt) => {
35
- const confirm = this.renderRoot.querySelector('#confirm');
36
- confirm.show(evt.currentTarget);
37
- }}
38
- >
39
- <foxy-i18n key=${state} infer=""></foxy-i18n>
40
- </vaadin-button>
41
- `;
42
- }
43
- async __submit() {
44
- var _a;
45
- if (this.__state === 'busy')
46
- return;
47
- try {
48
- this.__state = 'busy';
49
- const api = new NucleonElement.API(this);
50
- const response = await api.fetch((_a = this.href) !== null && _a !== void 0 ? _a : '', { method: 'POST' });
51
- this.__state = response.ok ? 'idle' : 'fail';
52
- if (response.ok)
53
- this.dispatchEvent(new CustomEvent('done'));
54
- }
55
- catch (_b) {
56
- this.__state = 'fail';
57
- }
58
- }
59
- }
60
- //# sourceMappingURL=InternalTransactionPostActionControl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InternalTransactionPostActionControl.js","sourceRoot":"","sources":["../../../../../../src/elements/public/Transaction/internal/InternalTransactionPostActionControl/InternalTransactionPostActionControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,IAAI,EAAkB,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,gEAA6D;AAEvF,OAAO,EAAE,cAAc,EAAE,kDAA+C;AAGxE,MAAM,OAAO,oCAAqC,SAAQ,eAAe;IAAzE;;QAUE,UAAK,GAAkB,IAAI,CAAC;QAE5B,SAAI,GAAkB,IAAI,CAAC;QAEnB,YAAO,GAAG,MAAM,CAAC;IA2C3B,CAAC;IAxDC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACvB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACvB,CAAC;IACJ,CAAC;IAQD,aAAa;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,MAAM,KAAK,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAE9E,OAAO,IAAI,CAAA;;;;;gBAKC,CAAC,GAAoB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,EAAE;;;;;iBAKjE,KAAK;oBACF,KAAK,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ;iBACpC,CAAC,GAAgB,EAAE,EAAE;YAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAA0B,CAAC;YACnF,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,aAA8B,CAAC,CAAC;QACnD,CAAC;;yBAEgB,KAAK;;KAEzB,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,QAAQ;;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,MAAM;YAAE,OAAO;QAEpC,IAAI;YACF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;YAEtB,MAAM,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACzC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,OAAC,IAAI,CAAC,IAAI,mCAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;YAEtE,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7C,IAAI,QAAQ,CAAC,EAAE;gBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;SAC9D;QAAC,WAAM;YACN,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;SACvB;IACH,CAAC;CACF","sourcesContent":["import { PropertyDeclarations, html, TemplateResult } from 'lit-element';\nimport { InternalConfirmDialog } from '../../../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { InternalControl } from '../../../../internal/InternalControl/InternalControl';\nimport { DialogHideEvent } from '../../../../private/Dialog/DialogHideEvent';\nimport { NucleonElement } from '../../../NucleonElement/NucleonElement';\nimport { ButtonElement } from '@vaadin/vaadin-button';\n\nexport class InternalTransactionPostActionControl extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __state: { type: String },\n theme: { type: String },\n href: { type: String },\n };\n }\n\n theme: string | null = null;\n\n href: string | null = null;\n\n private __state = 'idle';\n\n renderControl(): TemplateResult {\n const state = this.__state;\n const theme = state === 'fail' ? 'error' : state === 'idle' ? this.theme : '';\n\n return html`\n <foxy-internal-confirm-dialog\n header=\"header\"\n infer=\"confirm\"\n id=\"confirm\"\n @hide=${(evt: DialogHideEvent) => !evt.detail.cancelled && this.__submit()}\n >\n </foxy-internal-confirm-dialog>\n\n <vaadin-button\n theme=\"${theme} tertiary-inline\"\n ?disabled=${state === 'busy' || this.disabled}\n @click=${(evt: CustomEvent) => {\n const confirm = this.renderRoot.querySelector('#confirm') as InternalConfirmDialog;\n confirm.show(evt.currentTarget as ButtonElement);\n }}\n >\n <foxy-i18n key=${state} infer=\"\"></foxy-i18n>\n </vaadin-button>\n `;\n }\n\n private async __submit(): Promise<void> {\n if (this.__state === 'busy') return;\n\n try {\n this.__state = 'busy';\n\n const api = new NucleonElement.API(this);\n const response = await api.fetch(this.href ?? '', { method: 'POST' });\n\n this.__state = response.ok ? 'idle' : 'fail';\n if (response.ok) this.dispatchEvent(new CustomEvent('done'));\n } catch {\n this.__state = 'fail';\n }\n }\n}\n"]}
@@ -1,6 +0,0 @@
1
- import '@vaadin/vaadin-button';
2
- import '../../../../internal/InternalConfirmDialog/index';
3
- import '../../../../internal/InternalControl/index';
4
- import '../../../I18n/index';
5
- import { InternalTransactionPostActionControl as Control } from './InternalTransactionPostActionControl';
6
- export { Control as InternalTransactionPostActionControl };
@@ -1,8 +0,0 @@
1
- import '@vaadin/vaadin-button';
2
- import "../../../../internal/InternalConfirmDialog/index.js";
3
- import "../../../../internal/InternalControl/index.js";
4
- import "../../../I18n/index.js";
5
- import { InternalTransactionPostActionControl as Control } from "./InternalTransactionPostActionControl.js";
6
- customElements.define('foxy-internal-transaction-post-action-control', Control);
7
- export { Control as InternalTransactionPostActionControl };
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/elements/public/Transaction/internal/InternalTransactionPostActionControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,6DAA0D;AAC1D,uDAAoD;AACpD,gCAA6B;AAE7B,OAAO,EAAE,oCAAoC,IAAI,OAAO,EAAE,kDAA+C;AAEzG,cAAc,CAAC,MAAM,CAAC,+CAA+C,EAAE,OAAO,CAAC,CAAC;AAEhF,OAAO,EAAE,OAAO,IAAI,oCAAoC,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-button';\n\nimport '../../../../internal/InternalConfirmDialog/index';\nimport '../../../../internal/InternalControl/index';\nimport '../../../I18n/index';\n\nimport { InternalTransactionPostActionControl as Control } from './InternalTransactionPostActionControl';\n\ncustomElements.define('foxy-internal-transaction-post-action-control', Control);\n\nexport { Control as InternalTransactionPostActionControl };\n"]}