@foxy.io/elements 1.15.0-beta.8 → 1.15.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 (199) 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-applied-tax-card.js +1 -1
  5. package/dist/cdn/foxy-attribute-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-form.js +1 -1
  7. package/dist/cdn/foxy-cancellation-form.js +1 -1
  8. package/dist/cdn/foxy-collection-page.js +1 -1
  9. package/dist/cdn/foxy-collection-pages.js +1 -1
  10. package/dist/cdn/foxy-coupon-card.js +1 -1
  11. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  12. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  13. package/dist/cdn/foxy-coupon-form.js +1 -1
  14. package/dist/cdn/foxy-custom-field-card.js +1 -1
  15. package/dist/cdn/foxy-custom-field-form.js +1 -1
  16. package/dist/cdn/foxy-customer-card.js +1 -1
  17. package/dist/cdn/foxy-customer-form.js +1 -1
  18. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  19. package/dist/cdn/foxy-customer-portal.js +13 -13
  20. package/dist/cdn/foxy-customer.js +2 -2
  21. package/dist/cdn/foxy-customers-table.js +1 -1
  22. package/dist/cdn/foxy-discount-card.js +1 -1
  23. package/dist/cdn/foxy-donation.js +1 -1
  24. package/dist/cdn/foxy-email-template-form.js +1 -1
  25. package/dist/cdn/foxy-error-entry-card.js +1 -1
  26. package/dist/cdn/foxy-form-dialog.js +1 -1
  27. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  28. package/dist/cdn/foxy-gift-card-card.js +1 -1
  29. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  30. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  31. package/dist/cdn/foxy-gift-card-form.js +1 -1
  32. package/dist/cdn/foxy-i18n.js +1 -1
  33. package/dist/cdn/foxy-items-form.js +1 -1
  34. package/dist/cdn/foxy-pagination.js +1 -1
  35. package/dist/cdn/foxy-payment-card.js +1 -1
  36. package/dist/cdn/foxy-payment-method-card.js +1 -1
  37. package/dist/cdn/foxy-query-builder.js +1 -1
  38. package/dist/cdn/foxy-sign-in-form.js +1 -1
  39. package/dist/cdn/foxy-spinner.js +1 -1
  40. package/dist/cdn/foxy-subscription-card.js +1 -1
  41. package/dist/cdn/foxy-subscription-form.js +3 -3
  42. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  43. package/dist/cdn/foxy-table.js +1 -1
  44. package/dist/cdn/foxy-tax-card.js +1 -1
  45. package/dist/cdn/foxy-tax-form.js +1 -1
  46. package/dist/cdn/foxy-template-config-form.js +1 -1
  47. package/dist/cdn/foxy-template-form.js +1 -1
  48. package/dist/cdn/foxy-transaction-card.js +1 -1
  49. package/dist/cdn/foxy-transactions-table.js +1 -1
  50. package/dist/cdn/foxy-user-form.js +1 -1
  51. package/dist/cdn/foxy-users-table.js +1 -1
  52. package/dist/cdn/{shared-c5de42f7.js → shared-00d6a968.js} +1 -1
  53. package/dist/cdn/{shared-223508ae.js → shared-023a97c2.js} +7 -7
  54. package/dist/cdn/{shared-02945b27.js → shared-027c537d.js} +1 -1
  55. package/dist/cdn/{shared-4dc6d228.js → shared-09c5f9f1.js} +1 -1
  56. package/dist/cdn/{shared-e2c878c7.js → shared-340f7584.js} +1 -1
  57. package/dist/cdn/{shared-66633ff7.js → shared-3f0a9c2c.js} +1 -1
  58. package/dist/cdn/{shared-09069d7c.js → shared-3f965dce.js} +1 -1
  59. package/dist/cdn/{shared-b5754a42.js → shared-5e2fd1c7.js} +1 -1
  60. package/dist/cdn/{shared-dcc9c325.js → shared-60d43523.js} +1 -1
  61. package/dist/cdn/{shared-08c63028.js → shared-625c1272.js} +1 -1
  62. package/dist/cdn/shared-84d2d490.js +1 -0
  63. package/dist/cdn/{shared-a7b6feb2.js → shared-8c8a910c.js} +1 -1
  64. package/dist/cdn/{shared-b9f18aaa.js → shared-9cd49a3e.js} +4 -4
  65. package/dist/cdn/{shared-20b9ce70.js → shared-9fc4a896.js} +5 -5
  66. package/dist/cdn/{shared-e209cb55.js → shared-ab71552b.js} +1 -1
  67. package/dist/cdn/{shared-e68b9c83.js → shared-ae8cd227.js} +1 -1
  68. package/dist/cdn/{shared-07049bfe.js → shared-ba39823e.js} +1 -1
  69. package/dist/cdn/{shared-1934524e.js → shared-d58c947c.js} +1 -1
  70. package/dist/cdn/{shared-a23cf7c8.js → shared-e55088b4.js} +1 -1
  71. package/dist/cdn/{shared-253e59d2.js → shared-ecfd3539.js} +1 -1
  72. package/dist/cdn/shared-f2a69797.js +1 -0
  73. package/dist/cdn/translations/access-recovery-form/en.json +12 -0
  74. package/dist/cdn/translations/address-card/en.json +11 -0
  75. package/dist/cdn/translations/address-form/en.json +27 -0
  76. package/dist/cdn/translations/applied-tax-card/en.json +9 -0
  77. package/dist/cdn/translations/attribute-card/en.json +7 -0
  78. package/dist/cdn/translations/attribute-form/en.json +22 -0
  79. package/dist/cdn/translations/cancellation-form/en.json +10 -0
  80. package/dist/cdn/translations/country/pl.json +251 -0
  81. package/dist/cdn/translations/coupon-card/en.json +36 -0
  82. package/dist/cdn/translations/coupon-code-form/en.json +17 -0
  83. package/dist/cdn/translations/coupon-codes-form/en.json +20 -0
  84. package/dist/cdn/translations/coupon-form/en.json +186 -0
  85. package/dist/cdn/translations/custom-field-card/en.json +7 -0
  86. package/dist/cdn/translations/custom-field-form/en.json +19 -0
  87. package/dist/cdn/translations/customer/en.json +247 -0
  88. package/dist/cdn/translations/customer-card/en.json +7 -0
  89. package/dist/cdn/translations/customer-form/en.json +21 -0
  90. package/dist/cdn/translations/customer-portal/de.json +202 -14
  91. package/dist/cdn/translations/customer-portal/en.json +202 -14
  92. package/dist/cdn/translations/customer-portal/es.json +202 -14
  93. package/dist/cdn/translations/customer-portal/pl.json +223 -0
  94. package/dist/cdn/translations/customer-portal/zh-hk.json +202 -14
  95. package/dist/cdn/translations/customers-table/en.json +9 -0
  96. package/dist/cdn/translations/discount-card/en.json +8 -0
  97. package/dist/cdn/translations/email-template-form/en.json +25 -0
  98. package/dist/cdn/translations/error-entry-card/en.json +7 -0
  99. package/dist/cdn/translations/generate-codes-form/en.json +19 -0
  100. package/dist/cdn/translations/gift-card-card/en.json +9 -0
  101. package/dist/cdn/translations/gift-card-code-form/en.json +19 -0
  102. package/dist/cdn/translations/gift-card-codes-form/en.json +25 -0
  103. package/dist/cdn/translations/gift-card-form/en.json +314 -0
  104. package/dist/cdn/translations/pagination/en.json +7 -0
  105. package/dist/cdn/translations/payment-card/en.json +12 -0
  106. package/dist/cdn/translations/payment-method-card/en.json +13 -0
  107. package/dist/cdn/translations/query-builder/en.json +32 -0
  108. package/dist/cdn/translations/sign-in-form/en.json +21 -0
  109. package/dist/cdn/translations/spinner/en.json +7 -0
  110. package/dist/cdn/translations/subscription-card/en.json +26 -0
  111. package/dist/cdn/translations/subscription-form/en.json +76 -0
  112. package/dist/cdn/translations/subscriptions-table/en.json +26 -0
  113. package/dist/cdn/translations/tax-card/en.json +11 -0
  114. package/dist/cdn/translations/tax-form/en.json +38 -0
  115. package/dist/cdn/translations/template-config-form/en.json +107 -0
  116. package/dist/cdn/translations/template-form/en.json +23 -0
  117. package/dist/cdn/translations/transaction-card/en.json +25 -0
  118. package/dist/cdn/translations/transactions-table/en.json +22 -0
  119. package/dist/cdn/translations/user-form/en.json +26 -0
  120. package/dist/cdn/translations/users-table/en.json +44 -0
  121. package/dist/elements/private/Choice/Choice.js +1 -0
  122. package/dist/elements/private/Choice/Choice.js.map +1 -1
  123. package/dist/elements/private/FrequencyInput/FrequencyInput.d.ts +5 -5
  124. package/dist/elements/private/FrequencyInput/FrequencyInput.js +7 -22
  125. package/dist/elements/private/FrequencyInput/FrequencyInput.js.map +1 -1
  126. package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js +1 -1
  127. package/dist/elements/public/AccessRecoveryForm/AccessRecoveryForm.js.map +1 -1
  128. package/dist/elements/public/AttributeCard/types.d.ts +3 -3
  129. package/dist/elements/public/AttributeCard/types.js.map +1 -1
  130. package/dist/elements/public/AttributeForm/AttributeForm.js +2 -1
  131. package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
  132. package/dist/elements/public/AttributeForm/types.d.ts +3 -3
  133. package/dist/elements/public/AttributeForm/types.js.map +1 -1
  134. package/dist/elements/public/CouponCard/CouponCard.js +2 -1
  135. package/dist/elements/public/CouponCard/CouponCard.js.map +1 -1
  136. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +5 -5
  137. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
  138. package/dist/elements/public/CouponForm/CouponForm.js +199 -164
  139. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
  140. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +4 -3
  141. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +5 -4
  142. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -1
  143. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +3 -4
  144. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +3 -4
  145. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -1
  146. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +3 -4
  147. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +3 -2
  148. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
  149. package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +2 -1
  150. package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
  151. package/dist/elements/public/Customer/Customer.js +1 -1
  152. package/dist/elements/public/Customer/Customer.js.map +1 -1
  153. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +6 -2
  154. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  155. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js +20 -6
  156. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedOutView.js.map +1 -1
  157. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +2 -1
  158. package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
  159. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +6 -6
  160. package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
  161. package/dist/elements/public/GiftCardForm/GiftCardForm.js +103 -85
  162. package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
  163. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.d.ts +1 -1
  164. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js +3 -3
  165. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPage.js.map +1 -1
  166. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.d.ts +1 -3
  167. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js +2 -4
  168. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItem.js.map +1 -1
  169. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.d.ts +1 -3
  170. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js +2 -2
  171. package/dist/elements/public/GiftCardForm/private/CategoryRestrictionsPageItemContent.js.map +1 -1
  172. package/dist/elements/public/I18n/format/discount.js +2 -2
  173. package/dist/elements/public/I18n/format/discount.js.map +1 -1
  174. package/dist/elements/public/Pagination/Pagination.js +4 -0
  175. package/dist/elements/public/Pagination/Pagination.js.map +1 -1
  176. package/dist/elements/public/SignInForm/SignInForm.js +1 -1
  177. package/dist/elements/public/SignInForm/SignInForm.js.map +1 -1
  178. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +1 -1
  179. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
  180. package/dist/elements/public/TaxForm/TaxForm.js +16 -14
  181. package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
  182. package/dist/elements/public/TemplateForm/TemplateForm.js +1 -1
  183. package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
  184. package/dist/elements/public/UserForm/UserForm.js +2 -1
  185. package/dist/elements/public/UserForm/UserForm.js.map +1 -1
  186. package/dist/elements/public/UsersTable/UsersTable.d.ts +5 -1
  187. package/dist/elements/public/UsersTable/UsersTable.js +2 -1
  188. package/dist/elements/public/UsersTable/UsersTable.js.map +1 -1
  189. package/dist/mixins/themeable.js +4 -0
  190. package/dist/mixins/themeable.js.map +1 -1
  191. package/dist/mixins/translatable.js +1 -1
  192. package/dist/mixins/translatable.js.map +1 -1
  193. package/package.json +2 -2
  194. package/dist/cdn/shared-11708514.js +0 -1
  195. package/dist/cdn/shared-805d18a2.js +0 -1
  196. package/dist/cdn/translations/shared/de.json +0 -271
  197. package/dist/cdn/translations/shared/en.json +0 -557
  198. package/dist/cdn/translations/shared/es.json +0 -272
  199. package/dist/cdn/translations/shared/zh-hk.json +0 -179
@@ -59,6 +59,7 @@ export class GiftCardForm extends Base {
59
59
  <vaadin-button
60
60
  theme="tertiary contrast"
61
61
  class="p-0"
62
+ ?disabled=${!this.in('idle') || this.disabledSelector.matches('codes', true)}
62
63
  @click=${(evt) => {
63
64
  const dialog = this.renderRoot.querySelector('#code-dialog');
64
65
  const button = evt.currentTarget;
@@ -229,7 +230,7 @@ export class GiftCardForm extends Base {
229
230
  label=${this.t('name')}
230
231
  .checkValidity=${this.__getValidator('name')}
231
232
  .value=${(_a = this.form.name) !== null && _a !== void 0 ? _a : ''}
232
- ?disabled=${this.in('busy') || this.disabledSelector.matches('name', true)}
233
+ ?disabled=${!this.in('idle') || this.disabledSelector.matches('name', true)}
233
234
  ?readonly=${this.readonlySelector.matches('name', true)}
234
235
  required
235
236
  @keydown=${(evt) => evt.key === 'Enter' && this.submit()}
@@ -254,6 +255,7 @@ export class GiftCardForm extends Base {
254
255
  item-label-path="label"
255
256
  item-value-path="value"
256
257
  item-id-path="value"
258
+ data-testid="currency"
257
259
  class="w-full"
258
260
  label=${this.t('currency')}
259
261
  ?disabled=${!this.in('idle') || this.disabledSelector.matches('currency', true)}
@@ -281,9 +283,12 @@ export class GiftCardForm extends Base {
281
283
  ${this.renderTemplateOrSlot('expires:before')}
282
284
 
283
285
  <x-frequency-input
284
- class="w-full"
285
- label=${this.t('expires_after')}
286
286
  placeholder=${this.t('select')}
287
+ data-testid="expires"
288
+ label=${this.t('expires_after')}
289
+ class="w-full"
290
+ lang=${this.lang}
291
+ ns=${this.ns}
287
292
  ?disabled=${!this.in('idle') || this.disabledSelector.matches('expires', true)}
288
293
  ?readonly=${this.readonlySelector.matches('expires', true)}
289
294
  .value=${(_a = this.form.expires_after) !== null && _a !== void 0 ? _a : ''}
@@ -299,8 +304,8 @@ export class GiftCardForm extends Base {
299
304
  `;
300
305
  }
301
306
  __renderCodes() {
302
- var _a;
303
- const { disabledSelector, group, data, lang, ns } = this;
307
+ var _a, _b, _c, _d, _e;
308
+ const { disabledSelector, readonlySelector, hiddenSelector, group, data, lang, ns } = this;
304
309
  const isDisabled = !this.in('idle') || disabledSelector.matches('codes', true);
305
310
  const filters = this.__codesTableQuery;
306
311
  const url = new URL(data._links['fx:gift_card_codes'].href);
@@ -309,51 +314,51 @@ export class GiftCardForm extends Base {
309
314
  const filterButtonLabel = filters === null ? 'filter' : 'clear_filters';
310
315
  const filterButtonIcon = `icons:${filters === null ? 'filter-list' : 'clear'}`;
311
316
  return html `
312
- <foxy-form-dialog
313
- disabledcontrols=${disabledSelector.zoom('codes:generate:form').toString()}
314
- readonlycontrols=${this.readonlySelector.zoom('codes:generate:form').toString()}
315
- hiddencontrols="save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}"
316
- header="generate"
317
- parent=${(_a = data === null || data === void 0 ? void 0 : data._links['fx:generate_codes'].href) !== null && _a !== void 0 ? _a : ''}
318
- group=${group}
319
- lang=${lang}
320
- form="foxy-generate-codes-form"
321
- ns=${ns}
322
- id="generate-codes-dialog"
323
- alert
324
- .related=${[url.toString()]}
325
- >
326
- </foxy-form-dialog>
327
-
328
- <foxy-form-dialog
329
- disabledcontrols=${disabledSelector.zoom('codes:form').toString()}
330
- readonlycontrols=${this.readonlySelector.zoom('codes:form').toString()}
331
- hiddencontrols=${this.hiddenSelector.zoom('codes:form').toString()}
332
- header="code"
333
- parent=${url.toString()}
334
- group=${group}
335
- lang=${lang}
336
- form="foxy-gift-card-code-form"
337
- ns=${ns}
338
- id="code-dialog"
339
- >
340
- </foxy-form-dialog>
341
-
342
- <foxy-form-dialog
343
- disabledcontrols=${disabledSelector.zoom('codes:import:form').toString()}
344
- readonlycontrols=${this.readonlySelector.zoom('codes:import:form').toString()}
345
- hiddencontrols="save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}"
346
- header="import"
347
- parent=${data._links['fx:gift_card_codes'].href}
348
- group=${group}
349
- lang=${lang}
350
- form="foxy-gift-card-codes-form"
351
- ns=${ns}
352
- id="import-dialog"
353
- >
354
- </foxy-form-dialog>
317
+ <div data-testid="codes">
318
+ <foxy-form-dialog
319
+ disabledcontrols=${disabledSelector.zoom('codes:generate:form').toString()}
320
+ readonlycontrols=${readonlySelector.zoom('codes:generate:form').toString()}
321
+ hiddencontrols="save-button ${hiddenSelector.zoom('codes:generate:form').toString()}"
322
+ header="generate"
323
+ parent=${(_a = data === null || data === void 0 ? void 0 : data._links['fx:generate_codes'].href) !== null && _a !== void 0 ? _a : ''}
324
+ group=${group}
325
+ lang=${lang}
326
+ form="foxy-generate-codes-form"
327
+ ns=${ns}
328
+ id="generate-codes-dialog"
329
+ alert
330
+ .related=${[url.toString()]}
331
+ >
332
+ </foxy-form-dialog>
333
+
334
+ <foxy-form-dialog
335
+ disabledcontrols=${disabledSelector.zoom('codes:form').toString()}
336
+ readonlycontrols=${readonlySelector.zoom('codes:form').toString()}
337
+ hiddencontrols=${hiddenSelector.zoom('codes:form').toString()}
338
+ header="code"
339
+ parent=${url.toString()}
340
+ group=${group}
341
+ lang=${lang}
342
+ form="foxy-gift-card-code-form"
343
+ ns=${ns}
344
+ id="code-dialog"
345
+ >
346
+ </foxy-form-dialog>
347
+
348
+ <foxy-form-dialog
349
+ disabledcontrols=${disabledSelector.zoom('codes:import:form').toString()}
350
+ readonlycontrols=${readonlySelector.zoom('codes:import:form').toString()}
351
+ hiddencontrols="save-button ${hiddenSelector.zoom('codes:import:form').toString()}"
352
+ header="import"
353
+ parent=${data._links['fx:gift_card_codes'].href}
354
+ group=${group}
355
+ lang=${lang}
356
+ form="foxy-gift-card-codes-form"
357
+ ns=${ns}
358
+ id="import-dialog"
359
+ >
360
+ </foxy-form-dialog>
355
361
 
356
- <div>
357
362
  ${this.renderTemplateOrSlot('codes:before')}
358
363
 
359
364
  <div class="flex items-center justify-between mb-xs space-x-s">
@@ -366,6 +371,7 @@ export class GiftCardForm extends Base {
366
371
  </foxy-i18n>
367
372
 
368
373
  <vaadin-button
374
+ data-testid="codes:generate-button"
369
375
  theme="success tertiary small"
370
376
  ?disabled=${isDisabled}
371
377
  @click=${(evt) => {
@@ -379,6 +385,7 @@ export class GiftCardForm extends Base {
379
385
  </vaadin-button>
380
386
 
381
387
  <vaadin-button
388
+ data-testid="codes:import-button"
382
389
  theme="contrast tertiary small"
383
390
  ?disabled=${isDisabled}
384
391
  @click=${(evt) => {
@@ -392,6 +399,7 @@ export class GiftCardForm extends Base {
392
399
  </vaadin-button>
393
400
 
394
401
  <vaadin-button
402
+ data-testid="codes:filter-button"
395
403
  theme="contrast ${filters === null ? 'tertiary' : ''} small"
396
404
  ?disabled=${isDisabled}
397
405
  @click=${() => (this.__codesTableQuery = filters === null ? '' : null)}
@@ -404,7 +412,7 @@ export class GiftCardForm extends Base {
404
412
  <foxy-query-builder
405
413
  class="bg-contrast-5 rounded-tl-l rounded-tr-s rounded-b-l p-m mb-s"
406
414
  lang=${lang}
407
- ns=${ns}
415
+ ns="${ns} ${(_c = (_b = customElements.get('foxy-query-builder')) === null || _b === void 0 ? void 0 : _b.defaultNS) !== null && _c !== void 0 ? _c : ''}"
408
416
  ?disabled=${isDisabled}
409
417
  ?hidden=${filters === null}
410
418
  .options=${GiftCardForm.__codesQueryOptions}
@@ -416,7 +424,12 @@ export class GiftCardForm extends Base {
416
424
  >
417
425
  </foxy-query-builder>
418
426
 
419
- <foxy-pagination first=${url.toString()} lang=${lang} ns=${ns} ?disabled=${isDisabled}>
427
+ <foxy-pagination
428
+ first=${url.toString()}
429
+ lang=${lang}
430
+ ns="${ns} ${(_e = (_d = customElements.get('foxy-pagination')) === null || _d === void 0 ? void 0 : _d.defaultNS) !== null && _e !== void 0 ? _e : ''}"
431
+ ?disabled=${isDisabled}
432
+ >
420
433
  <foxy-table
421
434
  class="px-m mb-s border border-contrast-10 rounded-t-l rounded-b-l"
422
435
  group=${group}
@@ -450,7 +463,7 @@ export class GiftCardForm extends Base {
450
463
  });
451
464
  }
452
465
  return html `
453
- <div>
466
+ <div data-testid="product-restrictions">
454
467
  ${this.renderTemplateOrSlot('product-restrictions:before')}
455
468
 
456
469
  <div class="space-y-s">
@@ -478,6 +491,7 @@ export class GiftCardForm extends Base {
478
491
  </foxy-i18n>
479
492
 
480
493
  <x-editable-list
494
+ data-testid="product-restrictions:${group.header}"
481
495
  lang=${this.lang}
482
496
  ns=${this.ns}
483
497
  ?disabled=${isDisabled}
@@ -523,51 +537,55 @@ export class GiftCardForm extends Base {
523
537
  `;
524
538
  }
525
539
  __renderCategoryRestrictions() {
526
- var _a;
540
+ var _a, _b, _c;
527
541
  const scope = 'category-restrictions';
528
542
  const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);
529
543
  const isReadonly = this.readonlySelector.matches(scope, true);
544
+ const giftCardItemCategories = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links['fx:gift_card_item_categories'].href;
530
545
  return html `
531
- ${this.renderTemplateOrSlot('category-restrictions:before')}
546
+ <div data-testid="category-restrictions">
547
+ ${this.renderTemplateOrSlot(`${scope}:before`)}
532
548
 
533
- <div class="space-y-xs">
534
- <foxy-pagination
535
- first=${this.__itemCategories}
536
- lang=${this.lang}
537
- ns=${this.ns}
538
- ?disabled=${isDisabled}
539
- >
540
- <foxy-i18n
541
- class="block text-s font-medium text-secondary leading-none mb-s"
549
+ <div class="space-y-xs">
550
+ <foxy-pagination
551
+ first=${this.__itemCategories}
542
552
  lang=${this.lang}
543
- key="category_restrictions"
544
- ns=${this.ns}
553
+ ns="${this.ns} ${(_c = (_b = customElements.get('foxy-pagination')) === null || _b === void 0 ? void 0 : _b.defaultNS) !== null && _c !== void 0 ? _c : ''}"
554
+ ?disabled=${isDisabled}
545
555
  >
546
- </foxy-i18n>
556
+ <foxy-i18n
557
+ class="block text-s font-medium text-secondary leading-none mb-s"
558
+ lang=${this.lang}
559
+ key="category_restrictions"
560
+ ns=${this.ns}
561
+ >
562
+ </foxy-i18n>
563
+
564
+ <x-category-restrictions-page
565
+ gift-card-item-categories=${ifDefined(giftCardItemCategories)}
566
+ data-testid="category-restrictions:page"
567
+ gift-card=${this.href}
568
+ class="border border-contrast-10 rounded-t-l rounded-b-l mb-s"
569
+ group=${this.group}
570
+ lang=${this.lang}
571
+ ns=${this.ns}
572
+ ?disabled=${isDisabled}
573
+ ?readonly=${isReadonly}
574
+ >
575
+ </x-category-restrictions-page>
576
+ </foxy-pagination>
547
577
 
548
- <x-category-restrictions-page
549
- gift-card-item-categories=${ifDefined((_a = this.data) === null || _a === void 0 ? void 0 : _a._links['fx:gift_card_item_categories'].href)}
550
- gift-card=${this.href}
551
- class="border border-contrast-10 rounded-t-l rounded-b-l mb-s"
552
- group=${this.group}
578
+ <foxy-i18n
579
+ class="block text-xs leading-s text-secondary"
553
580
  lang=${this.lang}
581
+ key="gift_card_category_restrictions_helper_text"
554
582
  ns=${this.ns}
555
- ?disabled=${isDisabled}
556
- ?readonly=${isReadonly}
557
583
  >
558
- </x-category-restrictions-page>
559
- </foxy-pagination>
584
+ </foxy-i18n>
585
+ </div>
560
586
 
561
- <foxy-i18n
562
- class="block text-xs leading-s text-secondary"
563
- lang=${this.lang}
564
- key="gift_card_category_restrictions_helper_text"
565
- ns=${this.ns}
566
- >
567
- </foxy-i18n>
587
+ ${this.renderTemplateOrSlot(`${scope}:after`)}
568
588
  </div>
569
-
570
- ${this.renderTemplateOrSlot('category-restrictions:after')}
571
589
  `;
572
590
  }
573
591
  __renderTimestamps() {
@@ -642,7 +660,7 @@ export class GiftCardForm extends Base {
642
660
  data-testid="delete"
643
661
  theme="primary error"
644
662
  class="w-full"
645
- ?disabled=${this.in('busy') || this.disabledSelector.matches('delete', true)}
663
+ ?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}
646
664
  @click=${(evt) => {
647
665
  const confirm = this.renderRoot.querySelector('#confirm');
648
666
  confirm.show(evt.currentTarget);
@@ -1 +1 @@
1
- {"version":3,"file":"GiftCardForm.js","sourceRoot":"","sources":["../../../../src/elements/public/GiftCardForm/GiftCardForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,IAAI,EAAE,iCAA8B;AACrD,OAAO,EAAwC,IAAI,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGlF,OAAO,EAAE,wBAAwB,EAAE,8CAA2C;AAG9E,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAEjE,OAAO,EAAE,YAAY,EAAE,mDAAgD;AAEvE,OAAO,EAAE,cAAc,EAAE,uDAAoD;AAE7E,OAAO,EAAE,KAAK,EAAE,qCAAkC;AAElD,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAElE,OAAO,EAAE,aAAa,EAAE,qDAAkD;AAI1E,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAE7D,OAAO,EAAE,cAAc,EAAE,qCAAkC;A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AC,QAAQ,EAAE,IAAI,CAAC;mBACnE,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;;0BAEe,IAAI,CAAC,EAAE,sBAAsB,IAAI,CAAC,IAAI;;;UAGtD,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC;;KAE9C,CAAC;IACJ,CAAC;;AAzhBuB,gCAAmB,GAAa;IACtD,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IAClD,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACxE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;IACxD,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;IAChE,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;CACnE,CAAC","sourcesContent":["import { Data, GiftCardCodes } from './types';\nimport { Option, Type } from '../QueryBuilder/types';\nimport { PropertyDeclarations, TemplateResult, html } from 'lit-element';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\n\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { CategoryRestrictionsPage } from './private/CategoryRestrictionsPage';\nimport { Column } from '../Table/types';\nimport { ComboBoxElement } from '@vaadin/vaadin-combo-box';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { EditableList } from '../../private/EditableList/EditableList';\nimport { FormDialog } from '../FormDialog';\nimport { FrequencyInput } from '../../private/FrequencyInput/FrequencyInput';\nimport { FrequencyInputChangeEvent } from '../../private/FrequencyInput/FrequencyInputChangeEvent';\nimport { Group } from '../../private/Group/Group';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { PropertyTable } from '../../private/PropertyTable/PropertyTable';\nimport { QueryBuilder } from '../QueryBuilder/QueryBuilder';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { currencies } from './currencies';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nconst NS = 'gift-card-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(ResponsiveMixin(TranslatableMixin(NucleonElement, NS))))\n);\n\n/**\n * Form element for creating or editing gift cards (`fx:gift_card`).\n *\n * @slot name:before\n * @slot name:after\n *\n * @slot currency:before\n * @slot currency:after\n *\n * @slot expires:before\n * @slot expires:after\n *\n * @slot codes:before\n * @slot codes:after\n *\n * @slot product-restrictions:before\n * @slot product-restrictions:after\n *\n * @slot category-restrictions:before\n * @slot category-restrictions:after\n *\n * @slot timestamps:before\n * @slot timestamps:after\n *\n * @slot delete:before\n * @slot delete:after\n *\n * @slot create:before\n * @slot create:after\n *\n * @element foxy-gift-card-form\n * @since 1.15.0\n */\nexport class GiftCardForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'vaadin-button': customElements.get('vaadin-button'),\n\n 'iron-icon': customElements.get('iron-icon'),\n\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-query-builder': customElements.get('foxy-query-builder'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'foxy-pagination': customElements.get('foxy-pagination'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-table': customElements.get('foxy-table'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n\n 'x-category-restrictions-page': CategoryRestrictionsPage,\n 'x-frequency-input': FrequencyInput,\n 'x-property-table': PropertyTable,\n 'x-editable-list': EditableList,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __codesTableQuery: { attribute: false },\n __itemCategories: { attribute: false },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name_required',\n ({ name: v }) => !v || v.length <= 50 || 'name_too_long',\n ];\n }\n\n private __codesTableColumns: Column<GiftCardCodes>[] = [\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"code\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <vaadin-button\n theme=\"tertiary contrast\"\n class=\"p-0\"\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#code-dialog')!;\n const button = evt.currentTarget as ButtonElement;\n\n dialog.href = ctx.data._links.self.href;\n dialog.show(button);\n }}\n >\n <span class=\"font-tnum\">${ctx.data.code}</span>\n </vaadin-button>\n `,\n },\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"date_created\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.date_created })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n hideBelow: 'sm',\n header: c => html`<foxy-i18n lang=${c.lang} key=\"end_date\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.end_date })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n header: c => html`<foxy-i18n lang=${c.lang} key=\"current_balance\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({\n amount: `${ctx.data.current_balance} ${this.data?.currency_code}`,\n currencyDisplay: this.__currencyDisplay,\n })}\n lang=${ctx.lang}\n key=\"price\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n ];\n\n private static readonly __codesQueryOptions: Option[] = [\n { label: 'code', path: 'code', type: Type.String },\n { label: 'current_balance', path: 'current_balance', type: Type.Number },\n { label: 'end_date', path: 'end_date', type: Type.Date },\n { label: 'date_created', path: 'date_created', type: Type.Date },\n { label: 'date_modified', path: 'date_modified', type: Type.Date },\n ];\n\n private __codesTableQuery: string | null = null;\n\n private __currencyDisplay = '';\n\n private __itemCategories = '';\n\n render(): TemplateResult {\n const hidden = this.hiddenSelector;\n const isNameHidden = hidden.matches('name', true);\n const isCurrencyHidden = hidden.matches('currency', true);\n const isExpiresHidden = hidden.matches('expires', true);\n\n return html`\n <div class=\"relative space-y-l\">\n ${isNameHidden && isCurrencyHidden && isExpiresHidden\n ? ''\n : html`\n <div class=\"grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m\">\n ${isNameHidden ? '' : html`<div class=\"md-col-span-2\">${this.__renderName()}</div>`}\n ${isCurrencyHidden ? '' : this.__renderCurrency()}\n ${isExpiresHidden ? '' : this.__renderExpires()}\n </div>\n `}\n ${hidden.matches('codes', true) || !this.data ? '' : this.__renderCodes()}\n ${hidden.matches('product-restrictions', true) ? '' : this.__renderProductRestrictions()}\n ${hidden.matches('category-restrictions', true) || !this.data\n ? ''\n : this.__renderCategoryRestrictions()}\n ${hidden.matches('timestamps', true) ? '' : this.__renderTimestamps()}\n ${hidden.matches('create', true) || !!this.data ? '' : this.__renderCreate()}\n ${hidden.matches('delete', true) || !this.data ? '' : this.__renderDelete()}\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !this.in('busy') && !this.in('fail'),\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : this.in('busy') ? 'busy' : 'empty'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n protected async _sendGet(): Promise<Data> {\n type Store = Resource<Rels.Store>;\n\n const giftCard = await super._sendGet();\n const store = await super._fetch<Store>(giftCard._links['fx:store'].href);\n const categoriesURL = new URL(store._links['fx:item_categories'].href);\n\n categoriesURL.searchParams.set('limit', '5');\n this.__currencyDisplay = store.use_international_currency_symbol ? 'code' : 'symbol';\n this.__itemCategories = categoriesURL.toString();\n\n return giftCard;\n }\n\n private __getErrorMessage(prefix: string) {\n const error = this.errors.find(err => err.startsWith(prefix));\n return error ? this.t(error.replace(prefix, 'v8n')).toString() : '';\n }\n\n private __getValidator(prefix: string) {\n return () => !this.errors.some(err => err.startsWith(prefix));\n }\n\n private __renderName() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('name:before')}\n\n <vaadin-text-field\n error-message=${this.__getErrorMessage('name')}\n helper-text=${this.t('gift_card_name_helper_text')}\n data-testid=\"name\"\n class=\"w-full\"\n label=${this.t('name')}\n .checkValidity=${this.__getValidator('name')}\n .value=${this.form.name ?? ''}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('name', true)}\n ?readonly=${this.readonlySelector.matches('name', true)}\n required\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: CustomEvent) => {\n const newName = (evt.currentTarget as TextFieldElement).value;\n this.edit({ name: newName });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('name:after')}\n </div>\n `;\n }\n\n private __renderCurrency() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('currency:before')}\n\n <vaadin-combo-box\n item-label-path=\"label\"\n item-value-path=\"value\"\n item-id-path=\"value\"\n class=\"w-full\"\n label=${this.t('currency')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('currency', true)}\n ?readonly=${this.readonlySelector.matches('currency', true)}\n .value=${this.form.currency_code?.toLowerCase() ?? ''}\n .items=${currencies.map(code => ({\n label: `${this.t(`currency_${code}`)} (${code.toUpperCase()})`,\n value: code,\n }))}\n @change=${(evt: CustomEvent) => {\n const comboBox = evt.currentTarget as ComboBoxElement;\n this.edit({ currency_code: comboBox.value });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('currency:after')}\n </div>\n `;\n }\n\n private __renderExpires() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('expires:before')}\n\n <x-frequency-input\n class=\"w-full\"\n label=${this.t('expires_after')}\n placeholder=${this.t('select')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('expires', true)}\n ?readonly=${this.readonlySelector.matches('expires', true)}\n .value=${this.form.expires_after ?? ''}\n @change=${(evt: FrequencyInputChangeEvent) => {\n const input = evt.currentTarget as FrequencyInput;\n this.edit({ expires_after: input.value });\n }}\n >\n </x-frequency-input>\n\n ${this.renderTemplateOrSlot('expires:after')}\n </div>\n `;\n }\n\n private __renderCodes() {\n const { disabledSelector, group, data, lang, ns } = this;\n\n const isDisabled = !this.in('idle') || disabledSelector.matches('codes', true);\n const filters = this.__codesTableQuery;\n const url = new URL(data!._links['fx:gift_card_codes'].href);\n\n new URLSearchParams(filters ?? '').forEach((value, name) => url.searchParams.set(name, value));\n url.searchParams.set('limit', '5');\n\n const filterButtonLabel = filters === null ? 'filter' : 'clear_filters';\n const filterButtonIcon = `icons:${filters === null ? 'filter-list' : 'clear'}`;\n\n return html`\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:generate:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:generate:form').toString()}\n hiddencontrols=\"save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}\"\n header=\"generate\"\n parent=${data?._links['fx:generate_codes'].href ?? ''}\n group=${group}\n lang=${lang}\n form=\"foxy-generate-codes-form\"\n ns=${ns}\n id=\"generate-codes-dialog\"\n alert\n .related=${[url.toString()]}\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:form').toString()}\n hiddencontrols=${this.hiddenSelector.zoom('codes:form').toString()}\n header=\"code\"\n parent=${url.toString()}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-code-form\"\n ns=${ns}\n id=\"code-dialog\"\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:import:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:import:form').toString()}\n hiddencontrols=\"save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}\"\n header=\"import\"\n parent=${data!._links['fx:gift_card_codes'].href}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-codes-form\"\n ns=${ns}\n id=\"import-dialog\"\n >\n </foxy-form-dialog>\n\n <div>\n ${this.renderTemplateOrSlot('codes:before')}\n\n <div class=\"flex items-center justify-between mb-xs space-x-s\">\n <foxy-i18n\n class=\"text-s font-medium text-secondary leading-none flex-1\"\n lang=${lang}\n key=\"code_plural\"\n ns=${ns}\n >\n </foxy-i18n>\n\n <vaadin-button\n theme=\"success tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#generate-codes-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"generate\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n theme=\"contrast tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#import-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"import\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:open-in-browser\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n theme=\"contrast ${filters === null ? 'tertiary' : ''} small\"\n ?disabled=${isDisabled}\n @click=${() => (this.__codesTableQuery = filters === null ? '' : null)}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=${filterButtonLabel} ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=${filterButtonIcon}></iron-icon>\n </vaadin-button>\n </div>\n\n <foxy-query-builder\n class=\"bg-contrast-5 rounded-tl-l rounded-tr-s rounded-b-l p-m mb-s\"\n lang=${lang}\n ns=${ns}\n ?disabled=${isDisabled}\n ?hidden=${filters === null}\n .options=${GiftCardForm.__codesQueryOptions}\n .value=${filters ?? ''}\n @change=${(evt: CustomEvent) => {\n const queryBuilder = evt.currentTarget as QueryBuilder;\n this.__codesTableQuery = queryBuilder.value;\n }}\n >\n </foxy-query-builder>\n\n <foxy-pagination first=${url.toString()} lang=${lang} ns=${ns} ?disabled=${isDisabled}>\n <foxy-table\n class=\"px-m mb-s border border-contrast-10 rounded-t-l rounded-b-l\"\n group=${group}\n lang=${lang}\n ns=${ns}\n .columns=${this.__codesTableColumns}\n >\n </foxy-table>\n </foxy-pagination>\n\n ${this.renderTemplateOrSlot('codes:after')}\n </div>\n `;\n }\n\n private __renderProductRestrictions() {\n const scope = 'product-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n const restrictions = this.form.product_code_restrictions ?? '';\n\n const groups = [\n { header: 'allow', items: [] as { label?: string; value: string }[] },\n { header: 'block', items: [] as { label?: string; value: string }[] },\n ];\n\n if (restrictions) {\n restrictions.split(',').forEach(value => {\n const isBlocklistValue = value.startsWith('-');\n const target = isBlocklistValue ? 1 : 0;\n const label = isBlocklistValue ? value.substring(1) : value;\n\n groups[target].items.push({ label, value });\n });\n }\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('product-restrictions:before')}\n\n <div class=\"space-y-s\">\n <x-group frame>\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-secondary'}\n slot=\"header\"\n lang=${this.lang}\n key=\"product_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div class=\"grid sm-grid-cols-2 bg-contrast-10\" style=\"gap: 1px\">\n ${groups.map((group, index) => {\n return html`\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-tertiary'}\n slot=\"header\"\n lang=${this.lang}\n key=${group.header}\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-editable-list\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n .items=${group.items}\n @change=${(evt: CustomEvent) => {\n const newItemsByGroup = [\n index === 0 ? (evt.currentTarget as EditableList).items : groups[0].items,\n index === 1 ? (evt.currentTarget as EditableList).items : groups[1].items,\n ];\n\n const newSanitizedItemsByGroup = newItemsByGroup\n .map(list => list.map(v => v.value.replace(/^[\\s-]*/, '').trimEnd()))\n .map(list => list.filter(v => !!v))\n .map(list => Array.from(new Set(list)));\n\n const newRestrictions = newSanitizedItemsByGroup[0]\n .concat(newSanitizedItemsByGroup[1].map(v => `-${v}`))\n .join(',');\n\n this.edit({ product_code_restrictions: newRestrictions });\n }}\n >\n </x-editable-list>\n </x-group>\n `;\n })}\n </div>\n </x-group>\n\n <foxy-i18n\n class=${classMap({\n 'block text-xs leading-s transition-colors': true,\n 'text-secondary': !isDisabled,\n 'text-disabled': isDisabled,\n })}\n lang=${this.lang}\n key=\"gift_card_product_restrictions_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('product-restrictions:after')}\n </div>\n `;\n }\n\n private __renderCategoryRestrictions() {\n const scope = 'category-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n\n return html`\n ${this.renderTemplateOrSlot('category-restrictions:before')}\n\n <div class=\"space-y-xs\">\n <foxy-pagination\n first=${this.__itemCategories}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n >\n <foxy-i18n\n class=\"block text-s font-medium text-secondary leading-none mb-s\"\n lang=${this.lang}\n key=\"category_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-category-restrictions-page\n gift-card-item-categories=${ifDefined(\n this.data?._links['fx:gift_card_item_categories'].href\n )}\n gift-card=${this.href}\n class=\"border border-contrast-10 rounded-t-l rounded-b-l mb-s\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n >\n </x-category-restrictions-page>\n </foxy-pagination>\n\n <foxy-i18n\n class=\"block text-xs leading-s text-secondary\"\n lang=${this.lang}\n key=\"gift_card_category_restrictions_helper_text\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('category-restrictions:after')}\n `;\n }\n\n private __renderTimestamps() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n\n <x-property-table\n data-testid=\"timestamps\"\n .items=${(['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data?.[field]\n ? this.t('date', { value: new Date(this.data[field] as string) })\n : '',\n }))}\n >\n </x-property-table>\n\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n }\n\n private __renderCreate() {\n const isCleanTemplateInvalid = this.in({ idle: { template: { clean: 'invalid' } } });\n const isDirtyTemplateInvalid = this.in({ idle: { template: { dirty: 'invalid' } } });\n const isCleanSnapshotInvalid = this.in({ idle: { snapshot: { clean: 'invalid' } } });\n const isDirtySnapshotInvalid = this.in({ idle: { snapshot: { dirty: 'invalid' } } });\n const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;\n const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;\n const isInvalid = isTemplateInvalid || isSnaphotInvalid;\n const isBusy = this.in('busy');\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('create:before')}\n\n <vaadin-button\n data-testid=\"create\"\n class=\"w-full\"\n theme=\"primary success\"\n ?disabled=${isBusy || isInvalid || this.disabledSelector.matches('create', true)}\n @click=${this.submit}\n >\n <foxy-i18n ns=${this.ns} key=\"create\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n }\n\n private __renderDelete() {\n return html`\n <div>\n <foxy-internal-confirm-dialog\n data-testid=\"confirm\"\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"confirm\"\n @hide=${(evt: DialogHideEvent) => !evt.detail.cancelled && this.delete()}\n >\n </foxy-internal-confirm-dialog>\n\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n data-testid=\"delete\"\n theme=\"primary error\"\n class=\"w-full\"\n ?disabled=${this.in('busy') || this.disabledSelector.matches('delete', true)}\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 ns=${this.ns} key=\"delete\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"GiftCardForm.js","sourceRoot":"","sources":["../../../../src/elements/public/GiftCardForm/GiftCardForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,IAAI,EAAE,iCAA8B;AACrD,OAAO,EAAwC,IAAI,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGlF,OAAO,EAAE,wBAAwB,EAAE,8CAA2C;AAG9E,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AAEjE,OAAO,EAAE,YAAY,EAAE,mDAAgD;AAEvE,OAAO,EAAE,cAAc,EAAE,uDAAoD;AAE7E,OAAO,EAAE,KAAK,EAAE,qCAAkC;AAElD,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAElE,OAAO,EAAE,aAAa,EAAE,qDAAkD;AAI1E,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAE7D,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,UAAU,EAAE,wBAAqB;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,EAAE,GAAG,gBAAgB,CAAC;AAC5B,MAAM,IAAI,GAAG,mBAAmB,CAC9B,cAAc,CAAC,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAC1F,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,YAAa,SAAQ,IAAU;IAA5C;;QAyCU,wBAAmB,GAA4B;YACrD;gBACE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAA,mBAAmB,GAAG,CAAC,IAAI,kBAAk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,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAA0B,CAAC;YACnF,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,aAA8B,CAAC,CAAC;QACnD,CAAC;;0BAEe,IAAI,CAAC,EAAE,sBAAsB,IAAI,CAAC,IAAI;;;UAGtD,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC;;KAE9C,CAAC;IACJ,CAAC;;AAxiBuB,gCAAmB,GAAa;IACtD,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IAClD,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACxE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;IACxD,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;IAChE,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;CACnE,CAAC","sourcesContent":["import { Data, GiftCardCodes } from './types';\nimport { Option, Type } from '../QueryBuilder/types';\nimport { PropertyDeclarations, TemplateResult, html } from 'lit-element';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\n\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { CategoryRestrictionsPage } from './private/CategoryRestrictionsPage';\nimport { Column } from '../Table/types';\nimport { ComboBoxElement } from '@vaadin/vaadin-combo-box';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { EditableList } from '../../private/EditableList/EditableList';\nimport { FormDialog } from '../FormDialog';\nimport { FrequencyInput } from '../../private/FrequencyInput/FrequencyInput';\nimport { FrequencyInputChangeEvent } from '../../private/FrequencyInput/FrequencyInputChangeEvent';\nimport { Group } from '../../private/Group/Group';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { PropertyTable } from '../../private/PropertyTable/PropertyTable';\nimport { QueryBuilder } from '../QueryBuilder/QueryBuilder';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { currencies } from './currencies';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nconst NS = 'gift-card-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(ResponsiveMixin(TranslatableMixin(NucleonElement, NS))))\n);\n\n/**\n * Form element for creating or editing gift cards (`fx:gift_card`).\n *\n * @slot name:before\n * @slot name:after\n *\n * @slot currency:before\n * @slot currency:after\n *\n * @slot expires:before\n * @slot expires:after\n *\n * @slot codes:before\n * @slot codes:after\n *\n * @slot product-restrictions:before\n * @slot product-restrictions:after\n *\n * @slot category-restrictions:before\n * @slot category-restrictions:after\n *\n * @slot timestamps:before\n * @slot timestamps:after\n *\n * @slot delete:before\n * @slot delete:after\n *\n * @slot create:before\n * @slot create:after\n *\n * @element foxy-gift-card-form\n * @since 1.15.0\n */\nexport class GiftCardForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'vaadin-button': customElements.get('vaadin-button'),\n\n 'iron-icon': customElements.get('iron-icon'),\n\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-query-builder': customElements.get('foxy-query-builder'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'foxy-pagination': customElements.get('foxy-pagination'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-table': customElements.get('foxy-table'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n\n 'x-category-restrictions-page': CategoryRestrictionsPage,\n 'x-frequency-input': FrequencyInput,\n 'x-property-table': PropertyTable,\n 'x-editable-list': EditableList,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __codesTableQuery: { attribute: false },\n __itemCategories: { attribute: false },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name_required',\n ({ name: v }) => !v || v.length <= 50 || 'name_too_long',\n ];\n }\n\n private __codesTableColumns: Column<GiftCardCodes>[] = [\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"code\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <vaadin-button\n theme=\"tertiary contrast\"\n class=\"p-0\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('codes', true)}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#code-dialog')!;\n const button = evt.currentTarget as ButtonElement;\n\n dialog.href = ctx.data._links.self.href;\n dialog.show(button);\n }}\n >\n <span class=\"font-tnum\">${ctx.data.code}</span>\n </vaadin-button>\n `,\n },\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"date_created\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.date_created })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n hideBelow: 'sm',\n header: c => html`<foxy-i18n lang=${c.lang} key=\"end_date\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.end_date })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n header: c => html`<foxy-i18n lang=${c.lang} key=\"current_balance\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({\n amount: `${ctx.data.current_balance} ${this.data?.currency_code}`,\n currencyDisplay: this.__currencyDisplay,\n })}\n lang=${ctx.lang}\n key=\"price\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n ];\n\n private static readonly __codesQueryOptions: Option[] = [\n { label: 'code', path: 'code', type: Type.String },\n { label: 'current_balance', path: 'current_balance', type: Type.Number },\n { label: 'end_date', path: 'end_date', type: Type.Date },\n { label: 'date_created', path: 'date_created', type: Type.Date },\n { label: 'date_modified', path: 'date_modified', type: Type.Date },\n ];\n\n private __codesTableQuery: string | null = null;\n\n private __currencyDisplay = '';\n\n private __itemCategories = '';\n\n render(): TemplateResult {\n const hidden = this.hiddenSelector;\n const isNameHidden = hidden.matches('name', true);\n const isCurrencyHidden = hidden.matches('currency', true);\n const isExpiresHidden = hidden.matches('expires', true);\n\n return html`\n <div class=\"relative space-y-l\">\n ${isNameHidden && isCurrencyHidden && isExpiresHidden\n ? ''\n : html`\n <div class=\"grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m\">\n ${isNameHidden ? '' : html`<div class=\"md-col-span-2\">${this.__renderName()}</div>`}\n ${isCurrencyHidden ? '' : this.__renderCurrency()}\n ${isExpiresHidden ? '' : this.__renderExpires()}\n </div>\n `}\n ${hidden.matches('codes', true) || !this.data ? '' : this.__renderCodes()}\n ${hidden.matches('product-restrictions', true) ? '' : this.__renderProductRestrictions()}\n ${hidden.matches('category-restrictions', true) || !this.data\n ? ''\n : this.__renderCategoryRestrictions()}\n ${hidden.matches('timestamps', true) ? '' : this.__renderTimestamps()}\n ${hidden.matches('create', true) || !!this.data ? '' : this.__renderCreate()}\n ${hidden.matches('delete', true) || !this.data ? '' : this.__renderDelete()}\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !this.in('busy') && !this.in('fail'),\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : this.in('busy') ? 'busy' : 'empty'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n protected async _sendGet(): Promise<Data> {\n type Store = Resource<Rels.Store>;\n\n const giftCard = await super._sendGet();\n const store = await super._fetch<Store>(giftCard._links['fx:store'].href);\n const categoriesURL = new URL(store._links['fx:item_categories'].href);\n\n categoriesURL.searchParams.set('limit', '5');\n this.__currencyDisplay = store.use_international_currency_symbol ? 'code' : 'symbol';\n this.__itemCategories = categoriesURL.toString();\n\n return giftCard;\n }\n\n private __getErrorMessage(prefix: string) {\n const error = this.errors.find(err => err.startsWith(prefix));\n return error ? this.t(error.replace(prefix, 'v8n')).toString() : '';\n }\n\n private __getValidator(prefix: string) {\n return () => !this.errors.some(err => err.startsWith(prefix));\n }\n\n private __renderName() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('name:before')}\n\n <vaadin-text-field\n error-message=${this.__getErrorMessage('name')}\n helper-text=${this.t('gift_card_name_helper_text')}\n data-testid=\"name\"\n class=\"w-full\"\n label=${this.t('name')}\n .checkValidity=${this.__getValidator('name')}\n .value=${this.form.name ?? ''}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('name', true)}\n ?readonly=${this.readonlySelector.matches('name', true)}\n required\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: CustomEvent) => {\n const newName = (evt.currentTarget as TextFieldElement).value;\n this.edit({ name: newName });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('name:after')}\n </div>\n `;\n }\n\n private __renderCurrency() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('currency:before')}\n\n <vaadin-combo-box\n item-label-path=\"label\"\n item-value-path=\"value\"\n item-id-path=\"value\"\n data-testid=\"currency\"\n class=\"w-full\"\n label=${this.t('currency')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('currency', true)}\n ?readonly=${this.readonlySelector.matches('currency', true)}\n .value=${this.form.currency_code?.toLowerCase() ?? ''}\n .items=${currencies.map(code => ({\n label: `${this.t(`currency_${code}`)} (${code.toUpperCase()})`,\n value: code,\n }))}\n @change=${(evt: CustomEvent) => {\n const comboBox = evt.currentTarget as ComboBoxElement;\n this.edit({ currency_code: comboBox.value });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('currency:after')}\n </div>\n `;\n }\n\n private __renderExpires() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('expires:before')}\n\n <x-frequency-input\n placeholder=${this.t('select')}\n data-testid=\"expires\"\n label=${this.t('expires_after')}\n class=\"w-full\"\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('expires', true)}\n ?readonly=${this.readonlySelector.matches('expires', true)}\n .value=${this.form.expires_after ?? ''}\n @change=${(evt: FrequencyInputChangeEvent) => {\n const input = evt.currentTarget as FrequencyInput;\n this.edit({ expires_after: input.value });\n }}\n >\n </x-frequency-input>\n\n ${this.renderTemplateOrSlot('expires:after')}\n </div>\n `;\n }\n\n private __renderCodes() {\n const { disabledSelector, readonlySelector, hiddenSelector, group, data, lang, ns } = this;\n\n const isDisabled = !this.in('idle') || disabledSelector.matches('codes', true);\n const filters = this.__codesTableQuery;\n const url = new URL(data!._links['fx:gift_card_codes'].href);\n\n new URLSearchParams(filters ?? '').forEach((value, name) => url.searchParams.set(name, value));\n url.searchParams.set('limit', '5');\n\n const filterButtonLabel = filters === null ? 'filter' : 'clear_filters';\n const filterButtonIcon = `icons:${filters === null ? 'filter-list' : 'clear'}`;\n\n return html`\n <div data-testid=\"codes\">\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:generate:form').toString()}\n readonlycontrols=${readonlySelector.zoom('codes:generate:form').toString()}\n hiddencontrols=\"save-button ${hiddenSelector.zoom('codes:generate:form').toString()}\"\n header=\"generate\"\n parent=${data?._links['fx:generate_codes'].href ?? ''}\n group=${group}\n lang=${lang}\n form=\"foxy-generate-codes-form\"\n ns=${ns}\n id=\"generate-codes-dialog\"\n alert\n .related=${[url.toString()]}\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:form').toString()}\n readonlycontrols=${readonlySelector.zoom('codes:form').toString()}\n hiddencontrols=${hiddenSelector.zoom('codes:form').toString()}\n header=\"code\"\n parent=${url.toString()}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-code-form\"\n ns=${ns}\n id=\"code-dialog\"\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:import:form').toString()}\n readonlycontrols=${readonlySelector.zoom('codes:import:form').toString()}\n hiddencontrols=\"save-button ${hiddenSelector.zoom('codes:import:form').toString()}\"\n header=\"import\"\n parent=${data!._links['fx:gift_card_codes'].href}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-codes-form\"\n ns=${ns}\n id=\"import-dialog\"\n >\n </foxy-form-dialog>\n\n ${this.renderTemplateOrSlot('codes:before')}\n\n <div class=\"flex items-center justify-between mb-xs space-x-s\">\n <foxy-i18n\n class=\"text-s font-medium text-secondary leading-none flex-1\"\n lang=${lang}\n key=\"code_plural\"\n ns=${ns}\n >\n </foxy-i18n>\n\n <vaadin-button\n data-testid=\"codes:generate-button\"\n theme=\"success tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#generate-codes-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"generate\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n data-testid=\"codes:import-button\"\n theme=\"contrast tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#import-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"import\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:open-in-browser\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n data-testid=\"codes:filter-button\"\n theme=\"contrast ${filters === null ? 'tertiary' : ''} small\"\n ?disabled=${isDisabled}\n @click=${() => (this.__codesTableQuery = filters === null ? '' : null)}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=${filterButtonLabel} ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=${filterButtonIcon}></iron-icon>\n </vaadin-button>\n </div>\n\n <foxy-query-builder\n class=\"bg-contrast-5 rounded-tl-l rounded-tr-s rounded-b-l p-m mb-s\"\n lang=${lang}\n ns=\"${ns} ${customElements.get('foxy-query-builder')?.defaultNS ?? ''}\"\n ?disabled=${isDisabled}\n ?hidden=${filters === null}\n .options=${GiftCardForm.__codesQueryOptions}\n .value=${filters ?? ''}\n @change=${(evt: CustomEvent) => {\n const queryBuilder = evt.currentTarget as QueryBuilder;\n this.__codesTableQuery = queryBuilder.value;\n }}\n >\n </foxy-query-builder>\n\n <foxy-pagination\n first=${url.toString()}\n lang=${lang}\n ns=\"${ns} ${customElements.get('foxy-pagination')?.defaultNS ?? ''}\"\n ?disabled=${isDisabled}\n >\n <foxy-table\n class=\"px-m mb-s border border-contrast-10 rounded-t-l rounded-b-l\"\n group=${group}\n lang=${lang}\n ns=${ns}\n .columns=${this.__codesTableColumns}\n >\n </foxy-table>\n </foxy-pagination>\n\n ${this.renderTemplateOrSlot('codes:after')}\n </div>\n `;\n }\n\n private __renderProductRestrictions() {\n const scope = 'product-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n const restrictions = this.form.product_code_restrictions ?? '';\n\n const groups = [\n { header: 'allow', items: [] as { label?: string; value: string }[] },\n { header: 'block', items: [] as { label?: string; value: string }[] },\n ];\n\n if (restrictions) {\n restrictions.split(',').forEach(value => {\n const isBlocklistValue = value.startsWith('-');\n const target = isBlocklistValue ? 1 : 0;\n const label = isBlocklistValue ? value.substring(1) : value;\n\n groups[target].items.push({ label, value });\n });\n }\n\n return html`\n <div data-testid=\"product-restrictions\">\n ${this.renderTemplateOrSlot('product-restrictions:before')}\n\n <div class=\"space-y-s\">\n <x-group frame>\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-secondary'}\n slot=\"header\"\n lang=${this.lang}\n key=\"product_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div class=\"grid sm-grid-cols-2 bg-contrast-10\" style=\"gap: 1px\">\n ${groups.map((group, index) => {\n return html`\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-tertiary'}\n slot=\"header\"\n lang=${this.lang}\n key=${group.header}\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-editable-list\n data-testid=\"product-restrictions:${group.header}\"\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n .items=${group.items}\n @change=${(evt: CustomEvent) => {\n const newItemsByGroup = [\n index === 0 ? (evt.currentTarget as EditableList).items : groups[0].items,\n index === 1 ? (evt.currentTarget as EditableList).items : groups[1].items,\n ];\n\n const newSanitizedItemsByGroup = newItemsByGroup\n .map(list => list.map(v => v.value.replace(/^[\\s-]*/, '').trimEnd()))\n .map(list => list.filter(v => !!v))\n .map(list => Array.from(new Set(list)));\n\n const newRestrictions = newSanitizedItemsByGroup[0]\n .concat(newSanitizedItemsByGroup[1].map(v => `-${v}`))\n .join(',');\n\n this.edit({ product_code_restrictions: newRestrictions });\n }}\n >\n </x-editable-list>\n </x-group>\n `;\n })}\n </div>\n </x-group>\n\n <foxy-i18n\n class=${classMap({\n 'block text-xs leading-s transition-colors': true,\n 'text-secondary': !isDisabled,\n 'text-disabled': isDisabled,\n })}\n lang=${this.lang}\n key=\"gift_card_product_restrictions_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('product-restrictions:after')}\n </div>\n `;\n }\n\n private __renderCategoryRestrictions() {\n const scope = 'category-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n const giftCardItemCategories = this.data?._links['fx:gift_card_item_categories'].href;\n\n return html`\n <div data-testid=\"category-restrictions\">\n ${this.renderTemplateOrSlot(`${scope}:before`)}\n\n <div class=\"space-y-xs\">\n <foxy-pagination\n first=${this.__itemCategories}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-pagination')?.defaultNS ?? ''}\"\n ?disabled=${isDisabled}\n >\n <foxy-i18n\n class=\"block text-s font-medium text-secondary leading-none mb-s\"\n lang=${this.lang}\n key=\"category_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-category-restrictions-page\n gift-card-item-categories=${ifDefined(giftCardItemCategories)}\n data-testid=\"category-restrictions:page\"\n gift-card=${this.href}\n class=\"border border-contrast-10 rounded-t-l rounded-b-l mb-s\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n >\n </x-category-restrictions-page>\n </foxy-pagination>\n\n <foxy-i18n\n class=\"block text-xs leading-s text-secondary\"\n lang=${this.lang}\n key=\"gift_card_category_restrictions_helper_text\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot(`${scope}:after`)}\n </div>\n `;\n }\n\n private __renderTimestamps() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n\n <x-property-table\n data-testid=\"timestamps\"\n .items=${(['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data?.[field]\n ? this.t('date', { value: new Date(this.data[field] as string) })\n : '',\n }))}\n >\n </x-property-table>\n\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n }\n\n private __renderCreate() {\n const isCleanTemplateInvalid = this.in({ idle: { template: { clean: 'invalid' } } });\n const isDirtyTemplateInvalid = this.in({ idle: { template: { dirty: 'invalid' } } });\n const isCleanSnapshotInvalid = this.in({ idle: { snapshot: { clean: 'invalid' } } });\n const isDirtySnapshotInvalid = this.in({ idle: { snapshot: { dirty: 'invalid' } } });\n const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;\n const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;\n const isInvalid = isTemplateInvalid || isSnaphotInvalid;\n const isBusy = this.in('busy');\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('create:before')}\n\n <vaadin-button\n data-testid=\"create\"\n class=\"w-full\"\n theme=\"primary success\"\n ?disabled=${isBusy || isInvalid || this.disabledSelector.matches('create', true)}\n @click=${this.submit}\n >\n <foxy-i18n ns=${this.ns} key=\"create\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n }\n\n private __renderDelete() {\n return html`\n <div>\n <foxy-internal-confirm-dialog\n data-testid=\"confirm\"\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"confirm\"\n @hide=${(evt: DialogHideEvent) => !evt.detail.cancelled && this.delete()}\n >\n </foxy-internal-confirm-dialog>\n\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n data-testid=\"delete\"\n theme=\"primary error\"\n class=\"w-full\"\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('delete', true)}\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 ns=${this.ns} key=\"delete\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n }\n}\n"]}
@@ -1,9 +1,9 @@
1
+ import { ScopedElementsMap } from '@open-wc/scoped-elements';
1
2
  import { TemplateResult } from 'lit-html';
2
3
  import { NucleonElement } from '../../NucleonElement/NucleonElement';
3
4
  import { PropertyDeclarations } from 'lit-element';
4
5
  import { Rels } from '@foxy.io/sdk/backend';
5
6
  import { Resource } from '@foxy.io/sdk/core';
6
- import { ScopedElementsMap } from '@open-wc/scoped-elements/src/types';
7
7
  declare type Data = Resource<Rels.ItemCategories>;
8
8
  declare const Base: typeof NucleonElement & import("lit-element").Constructor<import("../../../../mixins/translatable").TranslatableMixinHost> & {
9
9
  defaultNS: string;
@@ -1,8 +1,8 @@
1
+ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
1
2
  import { html } from 'lit-html';
2
3
  import { CategoryRestrictionsPageItem } from "./CategoryRestrictionsPageItem.js";
3
4
  import { ConfigurableMixin } from "../../../../mixins/configurable.js";
4
5
  import { NucleonElement } from "../../NucleonElement/NucleonElement.js";
5
- import { ScopedElementsMixin } from '@open-wc/scoped-elements';
6
6
  import { ThemeableMixin } from "../../../../mixins/themeable.js";
7
7
  import { TranslatableMixin } from "../../../../mixins/translatable.js";
8
8
  import { classMap } from "../../../../utils/class-map.js";
@@ -61,13 +61,12 @@ export class CategoryRestrictionsPage extends Base {
61
61
  return html `<div class="h-l"></div>`;
62
62
  return html `
63
63
  <x-category-restrictions-page-item
64
+ data-testclass="item"
64
65
  item-category=${category._links.self.href}
65
66
  gift-card=${this.giftCard}
66
67
  class="h-l"
67
68
  group=${this.group}
68
69
  href=${href}
69
- lang=${this.lang}
70
- ns=${this.ns}
71
70
  ?disabled=${!this.in('idle') || this.disabled}
72
71
  ?readonly=${this.readonly}
73
72
  >
@@ -78,6 +77,7 @@ export class CategoryRestrictionsPage extends Base {
78
77
  </div>
79
78
 
80
79
  <div
80
+ data-testid="spinner"
81
81
  class=${classMap({
82
82
  'pointer-events-none absolute inset-0 flex transition-opacity': true,
83
83
  'opacity-0': !!this.data,
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryRestrictionsPage.js","sourceRoot":"","sources":["../../../../../src/elements/public/GiftCardForm/private/CategoryRestrictionsPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,4BAA4B,EAAE,0CAAuC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,2CAAwC;AACpE,OAAO,EAAE,cAAc,EAAE,+CAA4C;AAKrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,wCAAqC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,2CAAwC;AACpE,OAAO,EAAE,QAAQ,EAAE,uCAAoC;AAGvD,MAAM,IAAI,GAAG,iBAAiB,CAC5B,mBAAmB,CAAC,cAAc,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,CACvE,CAAC;AAEF,MAAM,OAAO,wBAAyB,SAAQ,IAAU;IAAxD;;QAgBE,2BAAsB,GAAG,EAAE,CAAC;QAE5B,aAAQ,GAAG,EAAE,CAAC;IAyEhB,CAAC;IA1FC,MAAM,KAAK,cAAc;QACvB,OAAO;YACL,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC;YAClD,mCAAmC,EAAE,4BA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estrictionsPageItem';\nimport { ConfigurableMixin } from '../../../../mixins/configurable';\nimport { NucleonElement } from '../../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ScopedElementsMap } from '@open-wc/scoped-elements/src/types';\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { ThemeableMixin } from '../../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../../mixins/translatable';\nimport { classMap } from '../../../../utils/class-map';\n\ntype Data = Resource<Rels.ItemCategories>;\nconst Base = ConfigurableMixin(\n ScopedElementsMixin(ThemeableMixin(TranslatableMixin(NucleonElement)))\n);\n\nexport class CategoryRestrictionsPage extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'x-category-restrictions-page-item': CategoryRestrictionsPageItem,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n giftCardItemCategories: { type: String, attribute: 'gift-card-item-categories' },\n giftCard: { type: String, attribute: 'gift-card' },\n };\n }\n\n giftCardItemCategories = '';\n\n giftCard = '';\n\n render(): TemplateResult {\n const categories = this.data?._embedded['fx:item_categories'] ?? [];\n let limit = 20;\n\n try {\n const limitFromHref = parseInt(new URL(this.href).searchParams.get('limit') ?? '');\n if (!isNaN(limitFromHref)) limit = limitFromHref;\n } catch {\n // invalid URL, use the default\n }\n\n return html`\n <div class=\"relative\">\n <div class=\"relative divide-y divide-contrast-10 ml-m\">\n ${new Array(limit).fill(0).map((_, index) => {\n const category = categories[index];\n let href: string | undefined = undefined;\n\n if (category) {\n try {\n const giftCardCategoryURL = new URL(this.giftCardItemCategories);\n const categoryURL = new URL(category._links.self.href);\n const categoryID = categoryURL.pathname.split('/').pop() as string;\n\n giftCardCategoryURL.searchParams.set('item_category_id', categoryID);\n giftCardCategoryURL.searchParams.set('limit', '1');\n\n href = giftCardCategoryURL.toString();\n } catch {\n // invalid URL, ignore\n }\n }\n\n if (!href) return html`<div class=\"h-l\"></div>`;\n\n return html`\n <x-category-restrictions-page-item\n item-category=${category._links.self.href}\n gift-card=${this.giftCard}\n class=\"h-l\"\n group=${this.group}\n href=${href}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${!this.in('idle') || this.disabled}\n ?readonly=${this.readonly}\n >\n ${category?.name}\n </x-category-restrictions-page-item>\n `;\n })}\n </div>\n\n <div\n class=${classMap({\n 'pointer-events-none absolute inset-0 flex transition-opacity': true,\n 'opacity-0': !!this.data,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n state=${this.in('fail') ? 'error' : this.in({ idle: 'template' }) ? 'empty' : 'busy'}\n class=\"m-auto p-m bg-base rounded-t-l rounded-b-l shadow-xs\"\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"CategoryRestrictionsPage.js","sourceRoot":"","sources":["../../../../../src/elements/public/GiftCardForm/private/CategoryRestrictionsPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAkB,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,4BAA4B,EAAE,0CAAuC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,2CAAwC;AACpE,OAAO,EAAE,cAAc,EAAE,+CAA4C;AAIrE,OAAO,EAAE,cAAc,EAAE,wCAAqC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,2CAAwC;AACpE,OAAO,EAAE,QAAQ,EAAE,uCAAoC;AAGvD,MAAM,IAAI,GAAG,iBAAiB,CAC5B,mBAAmB,CAAC,cAAc,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,CACvE,CAAC;AAEF,MAAM,OAAO,wBAAyB,SAAQ,IAAU;IAAxD;;QA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CAAC,cAAc,CAAC,0CAAE,SAAS,mCAAI,EAAE;;;;;KAK3E,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { TemplateResult, html } from 'lit-html';\n\nimport { CategoryRestrictionsPageItem } from './CategoryRestrictionsPageItem';\nimport { ConfigurableMixin } from '../../../../mixins/configurable';\nimport { NucleonElement } from '../../NucleonElement/NucleonElement';\nimport { PropertyDeclarations } from 'lit-element';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ThemeableMixin } from '../../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../../mixins/translatable';\nimport { classMap } from '../../../../utils/class-map';\n\ntype Data = Resource<Rels.ItemCategories>;\nconst Base = ConfigurableMixin(\n ScopedElementsMixin(ThemeableMixin(TranslatableMixin(NucleonElement)))\n);\n\nexport class CategoryRestrictionsPage extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'x-category-restrictions-page-item': CategoryRestrictionsPageItem,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n giftCardItemCategories: { type: String, attribute: 'gift-card-item-categories' },\n giftCard: { type: String, attribute: 'gift-card' },\n };\n }\n\n giftCardItemCategories = '';\n\n giftCard = '';\n\n render(): TemplateResult {\n const categories = this.data?._embedded['fx:item_categories'] ?? [];\n let limit = 20;\n\n try {\n const limitFromHref = parseInt(new URL(this.href).searchParams.get('limit') ?? '');\n if (!isNaN(limitFromHref)) limit = limitFromHref;\n } catch {\n // invalid URL, use the default\n }\n\n return html`\n <div class=\"relative\">\n <div class=\"relative divide-y divide-contrast-10 ml-m\">\n ${new Array(limit).fill(0).map((_, index) => {\n const category = categories[index];\n let href: string | undefined = undefined;\n\n if (category) {\n try {\n const giftCardCategoryURL = new URL(this.giftCardItemCategories);\n const categoryURL = new URL(category._links.self.href);\n const categoryID = categoryURL.pathname.split('/').pop() as string;\n\n giftCardCategoryURL.searchParams.set('item_category_id', categoryID);\n giftCardCategoryURL.searchParams.set('limit', '1');\n\n href = giftCardCategoryURL.toString();\n } catch {\n // invalid URL, ignore\n }\n }\n\n if (!href) return html`<div class=\"h-l\"></div>`;\n\n return html`\n <x-category-restrictions-page-item\n data-testclass=\"item\"\n item-category=${category._links.self.href}\n gift-card=${this.giftCard}\n class=\"h-l\"\n group=${this.group}\n href=${href}\n ?disabled=${!this.in('idle') || this.disabled}\n ?readonly=${this.readonly}\n >\n ${category?.name}\n </x-category-restrictions-page-item>\n `;\n })}\n </div>\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'pointer-events-none absolute inset-0 flex transition-opacity': true,\n 'opacity-0': !!this.data,\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n state=${this.in('fail') ? 'error' : this.in({ idle: 'template' }) ? 'empty' : 'busy'}\n class=\"m-auto p-m bg-base rounded-t-l rounded-b-l shadow-xs\"\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n}\n"]}
@@ -5,9 +5,7 @@ import { Rels } from '@foxy.io/sdk/backend';
5
5
  import { Resource } from '@foxy.io/sdk/core';
6
6
  import { ScopedElementsMap } from '@open-wc/scoped-elements/src/types';
7
7
  declare type Data = Resource<Rels.GiftCardItemCategories>;
8
- declare const Base: typeof NucleonElement & import("lit-element").Constructor<import("../../../../mixins/translatable").TranslatableMixinHost> & {
9
- defaultNS: string;
10
- } & {
8
+ declare const Base: typeof NucleonElement & {
11
9
  styles: import("lit-element").CSSResultArray;
12
10
  } & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/src/types").ScopedElementsHost> & import("lit-element").Constructor<import("../../../../mixins/configurable").ConfigurableMixinHost>;
13
11
  export declare class CategoryRestrictionsPageItem extends Base<Data> {