@foxy.io/elements 1.17.0 → 1.18.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 (200) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +3 -85
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-api-browser.js +1 -1
  5. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-card.js +1 -1
  7. package/dist/cdn/foxy-attribute-form.js +1 -1
  8. package/dist/cdn/foxy-cancellation-form.js +1 -1
  9. package/dist/cdn/foxy-collection-page.js +1 -1
  10. package/dist/cdn/foxy-collection-pages.js +1 -1
  11. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  12. package/dist/cdn/foxy-coupon-card.js +1 -1
  13. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  14. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  15. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  16. package/dist/cdn/foxy-coupon-form.js +1 -1
  17. package/dist/cdn/foxy-custom-field-card.js +1 -1
  18. package/dist/cdn/foxy-custom-field-form.js +1 -1
  19. package/dist/cdn/foxy-customer-api.js +1 -1
  20. package/dist/cdn/foxy-customer-card.js +1 -1
  21. package/dist/cdn/foxy-customer-form.js +1 -1
  22. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  23. package/dist/cdn/foxy-customer-portal.js +15 -15
  24. package/dist/cdn/foxy-customer.js +6 -6
  25. package/dist/cdn/foxy-customers-table.js +1 -1
  26. package/dist/cdn/foxy-discount-builder.js +1 -1
  27. package/dist/cdn/foxy-discount-card.js +1 -1
  28. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  29. package/dist/cdn/foxy-donation.js +1 -1
  30. package/dist/cdn/foxy-email-template-form.js +1 -1
  31. package/dist/cdn/foxy-error-entry-card.js +1 -1
  32. package/dist/cdn/foxy-form-dialog.js +1 -1
  33. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  34. package/dist/cdn/foxy-gift-card-card.js +1 -1
  35. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  36. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  37. package/dist/cdn/foxy-gift-card-form.js +1 -1
  38. package/dist/cdn/foxy-i18n.js +1 -1
  39. package/dist/cdn/foxy-item-card.js +1 -1
  40. package/dist/cdn/foxy-item-form.js +1 -1
  41. package/dist/cdn/foxy-item-option-card.js +1 -1
  42. package/dist/cdn/foxy-item-option-form.js +1 -1
  43. package/dist/cdn/foxy-items-form.js +1 -1
  44. package/dist/cdn/foxy-nucleon-element.js +1 -1
  45. package/dist/cdn/foxy-pagination.js +1 -1
  46. package/dist/cdn/foxy-payment-card.js +1 -1
  47. package/dist/cdn/foxy-payment-method-card.js +1 -1
  48. package/dist/cdn/foxy-query-builder.js +1 -1
  49. package/dist/cdn/foxy-report-form.js +4 -4
  50. package/dist/cdn/foxy-reports-table.js +5 -5
  51. package/dist/cdn/foxy-shipment-card.js +1 -1
  52. package/dist/cdn/foxy-sign-in-form.js +1 -1
  53. package/dist/cdn/foxy-spinner.js +1 -1
  54. package/dist/cdn/foxy-store-shipping-method-form.js +150 -0
  55. package/dist/cdn/foxy-subscription-card.js +1 -1
  56. package/dist/cdn/foxy-subscription-form.js +4 -4
  57. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  58. package/dist/cdn/foxy-table.js +1 -1
  59. package/dist/cdn/foxy-tax-card.js +1 -1
  60. package/dist/cdn/foxy-tax-form.js +1 -1
  61. package/dist/cdn/foxy-template-config-form.js +1 -1
  62. package/dist/cdn/foxy-template-form.js +1 -1
  63. package/dist/cdn/foxy-transaction-card.js +1 -1
  64. package/dist/cdn/foxy-transaction.js +1 -1
  65. package/dist/cdn/foxy-transactions-table.js +1 -1
  66. package/dist/cdn/foxy-user-form.js +1 -1
  67. package/dist/cdn/foxy-users-table.js +1 -1
  68. package/dist/cdn/foxy-webhook-card.js +1 -1
  69. package/dist/cdn/foxy-webhook-form.js +1 -1
  70. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  71. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  72. package/dist/cdn/{shared-26ce8d23.js → shared-023c287a.js} +1 -1
  73. package/dist/cdn/{shared-195fd5af.js → shared-084b6372.js} +1 -1
  74. package/dist/cdn/shared-11f0daea.js +169 -0
  75. package/dist/cdn/{shared-6d104622.js → shared-189dfb49.js} +1 -1
  76. package/dist/cdn/shared-23fd456c.js +134 -0
  77. package/dist/cdn/{shared-baf79b0b.js → shared-2ca6d676.js} +1 -1
  78. package/dist/cdn/{shared-c309e0ef.js → shared-2f0efb2c.js} +1 -1
  79. package/dist/cdn/{shared-dda2a74d.js → shared-37b61010.js} +1 -1
  80. package/dist/cdn/shared-381aa7fe.js +1 -0
  81. package/dist/cdn/shared-3a7cf739.js +15 -0
  82. package/dist/cdn/{shared-2188d5f7.js → shared-3e3c07ac.js} +1 -1
  83. package/dist/cdn/{shared-8e9a3bbb.js → shared-412670b8.js} +1 -1
  84. package/dist/cdn/{shared-31c43743.js → shared-4560425c.js} +1 -1
  85. package/dist/cdn/shared-4773b634.js +1 -0
  86. package/dist/cdn/{shared-7c8bb60c.js → shared-4c0520f6.js} +1 -1
  87. package/dist/cdn/{shared-5c3a88d2.js → shared-5482630e.js} +1 -1
  88. package/dist/cdn/{shared-322e7efb.js → shared-5e43b817.js} +1 -1
  89. package/dist/cdn/{shared-a0836fa5.js → shared-60c862aa.js} +1 -1
  90. package/dist/cdn/shared-619adfad.js +1 -0
  91. package/dist/cdn/{shared-b3df4f38.js → shared-68ab037d.js} +1 -1
  92. package/dist/cdn/{shared-7c612495.js → shared-6af95088.js} +1 -1
  93. package/dist/cdn/shared-6ce2acfa.js +1 -0
  94. package/dist/cdn/{shared-c8677ba3.js → shared-6f89d2e0.js} +1 -1
  95. package/dist/cdn/{shared-c5c60417.js → shared-71acf673.js} +1 -1
  96. package/dist/cdn/{shared-c89ba319.js → shared-74a27421.js} +1 -1
  97. package/dist/cdn/{shared-d699348f.js → shared-80b90eec.js} +2 -2
  98. package/dist/cdn/{shared-98497473.js → shared-85d45495.js} +1 -1
  99. package/dist/cdn/{shared-a5e52b8f.js → shared-872ceacf.js} +3 -3
  100. package/dist/cdn/{shared-4e201e09.js → shared-901ca702.js} +1 -1
  101. package/dist/cdn/{shared-ae415a98.js → shared-91b86bae.js} +1 -1
  102. package/dist/cdn/shared-9b392ba8.js +1 -0
  103. package/dist/cdn/{shared-1bbd9b73.js → shared-9be1a70f.js} +1 -1
  104. package/dist/cdn/{shared-8d4fef94.js → shared-9ef13805.js} +1 -1
  105. package/dist/cdn/{shared-bb686fc6.js → shared-9ef81b37.js} +1 -1
  106. package/dist/cdn/{shared-3b2dedf9.js → shared-a2a1193d.js} +1 -1
  107. package/dist/cdn/shared-a48a9dfc.js +82 -0
  108. package/dist/cdn/{shared-8d937ae4.js → shared-c0fb5a33.js} +3 -3
  109. package/dist/cdn/{shared-a052131e.js → shared-c63ba384.js} +1 -1
  110. package/dist/cdn/{shared-d28ac9dc.js → shared-c7280a24.js} +1 -1
  111. package/dist/cdn/{shared-e9a4a204.js → shared-c7c8d1b6.js} +1 -1
  112. package/dist/cdn/{shared-fadcb2e1.js → shared-ca0f14c1.js} +1 -1
  113. package/dist/cdn/{shared-7474af47.js → shared-d91ed0a8.js} +1 -1
  114. package/dist/cdn/{shared-39f2c345.js → shared-daa454bf.js} +1 -1
  115. package/dist/cdn/{shared-2bdd4f74.js → shared-ec7cfc23.js} +1 -1
  116. package/dist/cdn/{shared-bf6fb415.js → shared-f2639daf.js} +1 -1
  117. package/dist/cdn/{shared-62169210.js → shared-f31044b8.js} +1 -1
  118. package/dist/cdn/{shared-f84686a8.js → shared-fcbf9a41.js} +1 -1
  119. package/dist/cdn/{shared-dd6d3c18.js → shared-fd595d0a.js} +1 -1
  120. package/dist/cdn/{shared-dc23b751.js → shared-fe68657a.js} +1 -1
  121. package/dist/cdn/{shared-f1317609.js → shared-ff1d9854.js} +1 -1
  122. package/dist/cdn/translations/store-shipping-method-form/en.json +90 -0
  123. package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.d.ts +3 -0
  124. package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js +22 -0
  125. package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js.map +1 -1
  126. package/dist/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.d.ts +17 -0
  127. package/dist/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.js +51 -0
  128. package/dist/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.js.map +1 -0
  129. package/dist/elements/internal/InternalCheckboxGroupControl/index.d.ts +6 -0
  130. package/dist/elements/internal/InternalCheckboxGroupControl/index.js +8 -0
  131. package/dist/elements/internal/InternalCheckboxGroupControl/index.js.map +1 -0
  132. package/dist/elements/internal/InternalCheckboxGroupControl/types.d.ts +6 -0
  133. package/dist/elements/internal/InternalCheckboxGroupControl/types.js +2 -0
  134. package/dist/elements/internal/InternalCheckboxGroupControl/types.js.map +1 -0
  135. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.d.ts +2 -0
  136. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +6 -4
  137. package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
  138. package/dist/elements/internal/InternalTextAreaControl/InternalTextAreaControl.d.ts +13 -0
  139. package/dist/elements/internal/InternalTextAreaControl/InternalTextAreaControl.js +40 -0
  140. package/dist/elements/internal/InternalTextAreaControl/InternalTextAreaControl.js.map +1 -0
  141. package/dist/elements/internal/InternalTextAreaControl/index.d.ts +4 -0
  142. package/dist/elements/internal/InternalTextAreaControl/index.js +6 -0
  143. package/dist/elements/internal/InternalTextAreaControl/index.js.map +1 -0
  144. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +10 -23
  145. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  146. package/dist/elements/public/NucleonElement/NucleonElement.d.ts +2 -1
  147. package/dist/elements/public/NucleonElement/NucleonElement.js +12 -10
  148. package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
  149. package/dist/elements/public/ShipmentCard/ShipmentCard.js +1 -1
  150. package/dist/elements/public/ShipmentCard/ShipmentCard.js.map +1 -1
  151. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.d.ts +25 -0
  152. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +201 -0
  153. package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -0
  154. package/dist/elements/public/StoreShippingMethodForm/index.d.ts +11 -0
  155. package/dist/elements/public/StoreShippingMethodForm/index.js +13 -0
  156. package/dist/elements/public/StoreShippingMethodForm/index.js.map +1 -0
  157. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/InternalStoreShippingMethodFormServicesControl.d.ts +5 -0
  158. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/InternalStoreShippingMethodFormServicesControl.js +33 -0
  159. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/InternalStoreShippingMethodFormServicesControl.js.map +1 -0
  160. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/index.d.ts +6 -0
  161. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/index.js +8 -0
  162. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/index.js.map +1 -0
  163. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/InternalStoreShippingMethodFormServicesPage.d.ts +19 -0
  164. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/InternalStoreShippingMethodFormServicesPage.js +96 -0
  165. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/InternalStoreShippingMethodFormServicesPage.js.map +1 -0
  166. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/index.d.ts +5 -0
  167. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/index.js +7 -0
  168. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/index.js.map +1 -0
  169. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/InternalStoreShippingMethodFormServicesPageItem.d.ts +17 -0
  170. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/InternalStoreShippingMethodFormServicesPageItem.js +45 -0
  171. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/InternalStoreShippingMethodFormServicesPageItem.js.map +1 -0
  172. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/index.d.ts +3 -0
  173. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/index.js +5 -0
  174. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/index.js.map +1 -0
  175. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/InternalStoreShippingMethodFormServicesPageItemContent.d.ts +16 -0
  176. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/InternalStoreShippingMethodFormServicesPageItemContent.js +49 -0
  177. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/InternalStoreShippingMethodFormServicesPageItemContent.js.map +1 -0
  178. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/index.d.ts +3 -0
  179. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/index.js +5 -0
  180. package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/index.js.map +1 -0
  181. package/dist/elements/public/StoreShippingMethodForm/types.d.ts +5 -0
  182. package/dist/elements/public/StoreShippingMethodForm/types.js +2 -0
  183. package/dist/elements/public/StoreShippingMethodForm/types.js.map +1 -0
  184. package/dist/elements/public/index.d.ts +1 -0
  185. package/dist/elements/public/index.defined.d.ts +1 -0
  186. package/dist/elements/public/index.defined.js +1 -0
  187. package/dist/elements/public/index.defined.js.map +1 -1
  188. package/dist/elements/public/index.js +1 -0
  189. package/dist/elements/public/index.js.map +1 -1
  190. package/dist/mixins/configurable.js +16 -8
  191. package/dist/mixins/configurable.js.map +1 -1
  192. package/dist/mixins/inferrable.js +25 -23
  193. package/dist/mixins/inferrable.js.map +1 -1
  194. package/package.json +2 -2
  195. package/dist/cdn/shared-45feee83.js +0 -1
  196. package/dist/cdn/shared-63685d2e.js +0 -302
  197. package/dist/cdn/shared-92327224.js +0 -15
  198. package/dist/cdn/shared-ac44429d.js +0 -1
  199. package/dist/cdn/shared-dc1c6edd.js +0 -1
  200. package/dist/cdn/shared-dc3ffd38.js +0 -1
@@ -132,7 +132,6 @@ export const ConfigurableMixin = (BaseElement) => {
132
132
  return nestedTemplates;
133
133
  }
134
134
  applyInferredProperties(context) {
135
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
136
135
  super.applyInferredProperties(context);
137
136
  if (this.infer === null)
138
137
  return;
@@ -144,14 +143,23 @@ export const ConfigurableMixin = (BaseElement) => {
144
143
  const hidden = context.get('hidden');
145
144
  const templates = context.get('templates');
146
145
  const mode = context.get('mode');
147
- this.disabledControls = (_a = disabledSelector === null || disabledSelector === void 0 ? void 0 : disabledSelector.zoom(this.infer)) !== null && _a !== void 0 ? _a : BooleanSelector.False;
148
- this.disabled = (_c = (_b = disabledSelector === null || disabledSelector === void 0 ? void 0 : disabledSelector.matches(this.infer, true)) !== null && _b !== void 0 ? _b : disabled) !== null && _c !== void 0 ? _c : false;
149
- this.readonlyControls = (_d = readonlySelector === null || readonlySelector === void 0 ? void 0 : readonlySelector.zoom(this.infer)) !== null && _d !== void 0 ? _d : BooleanSelector.False;
150
- this.readonly = (_f = (_e = readonlySelector === null || readonlySelector === void 0 ? void 0 : readonlySelector.matches(this.infer, true)) !== null && _e !== void 0 ? _e : readonly) !== null && _f !== void 0 ? _f : false;
151
- this.hiddenControls = (_g = hiddenSelector === null || hiddenSelector === void 0 ? void 0 : hiddenSelector.zoom(this.infer)) !== null && _g !== void 0 ? _g : BooleanSelector.False;
152
- this.hidden = (_j = (_h = hiddenSelector === null || hiddenSelector === void 0 ? void 0 : hiddenSelector.matches(this.infer, true)) !== null && _h !== void 0 ? _h : hidden) !== null && _j !== void 0 ? _j : false;
146
+ const trueAsString = BooleanSelector.True.toString();
147
+ const simplify = (selector, fallback) => {
148
+ return selector.toString() === trueAsString || (fallback !== null && fallback !== void 0 ? fallback : false);
149
+ };
150
+ const zoomIfNested = (selector) => {
151
+ var _a;
152
+ return (_a = (this.infer ? selector === null || selector === void 0 ? void 0 : selector.zoom(this.infer) : selector)) !== null && _a !== void 0 ? _a : BooleanSelector.False;
153
+ };
154
+ this.disabledControls = zoomIfNested(disabledSelector);
155
+ this.disabled = simplify(this.disabledControls, disabled);
156
+ this.readonlyControls = zoomIfNested(readonlySelector);
157
+ this.readonly = simplify(this.readonlyControls, readonly);
158
+ this.hiddenControls = zoomIfNested(hiddenSelector);
159
+ this.hidden = simplify(this.hiddenControls, hidden);
153
160
  this.templates = templates !== null && templates !== void 0 ? templates : {};
154
- this.templates = this.getNestedTemplates(this.infer);
161
+ if (this.infer)
162
+ this.templates = this.getNestedTemplates(this.infer);
155
163
  this.mode = mode !== null && mode !== void 0 ? mode : 'production';
156
164
  }
157
165
  __observe() {
@@ -1 +1 @@
1
- {"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../src/mix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I;aACd,CAAC;YAEF,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;YAC7B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAEtC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACxC,IAAI,KAAK,CAAC,SAAS,KAAK,UAAU,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;oBAAE,OAAO;gBAC1E,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,KAA6B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC1E,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport { Constructor, LitElement, PropertyDeclarations, TemplateResult, html } from 'lit-element';\n\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { InferrableMixinHost } from './inferrable';\n\nexport declare class ConfigurableMixinHost {\n /** Template render functions mapped to their name. */\n templates: Partial<Record<string, Renderer<any>>>;\n\n /**\n * Toggles additional functionality for developers on and off. In particular,\n * setting this property (or attribute with the same name) to \"development\" will\n * start tracking changes in templates, allowing developers to edit HTML in the browser\n * and see results without having to refresh the page every time.\n */\n mode: 'development' | 'production';\n\n /**\n * If true, makes every editable control inside of this element read-only.\n * This property is reflected to the `readonly` boolean attribute.\n *\n * @since 1.4.0\n */\n readonly: boolean;\n\n /**\n * [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) selecting\n * controls to render as read-only. Parsed version of the `readonlycontrols` attribute value.\n *\n * @type {BooleanSelector}\n * @since 1.4.0\n * @default BooleanSelector.False\n */\n readonlyControls: BooleanSelector;\n\n /**\n * If true, disables every interactive control inside of this element.\n * This property is reflected to the `disabled` boolean attribute.\n *\n * @since 1.4.0\n */\n disabled: boolean;\n\n /**\n * [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) selecting\n * controls to render as disabled. Parsed version of the `disabledcontrols` attribute value.\n *\n * @type {BooleanSelector}\n * @since 1.4.0\n * @default BooleanSelector.False\n */\n disabledControls: BooleanSelector;\n\n /**\n * If true, hides every configurable control inside of this element.\n * This property is reflected to the `hidden` boolean attribute.\n *\n * @since 1.4.0\n */\n hidden: boolean;\n\n /**\n * [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) selecting\n * controls to hide. Parsed version of the `hiddencontrols` attribute value.\n *\n * @type {BooleanSelector}\n * @since 1.4.0\n * @default BooleanSelector.False\n */\n hiddenControls: BooleanSelector;\n\n /**\n * Combined [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) for `readonlyControls`\n * and `readonly` properties. If `readonly` is true, this selector will match any control,\n * otherwise it will match the same controls as in `readonlyControls`.\n *\n * @since 1.4.0\n */\n get readonlySelector(): BooleanSelector;\n\n /**\n * Combined [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) for `disabledControls`\n * and `disabled` properties. If `disabled` is true, this selector will match any control,\n * otherwise it will match the same controls as in `disabledControls`.\n *\n * @since 1.4.0\n */\n get disabledSelector(): BooleanSelector;\n\n /**\n * Combined [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) for `hiddenControls`\n * and `hidden` properties. If `hidden` is true, this selector will match any control,\n * otherwise it will match the same controls as in `hiddenControls`.\n *\n * @since 1.4.0\n */\n get hiddenSelector(): BooleanSelector;\n\n /**\n * Looks for templates in element's children and compiles them to render functions.\n *\n * @param replace If true, all existing templates will be removed.\n */\n compileTemplates(replace?: boolean): void;\n\n /**\n * Renders a template with the given name if available and a slot otherwise.\n * For empty name looks for a \"default\" template first and renders it if found – otherwise renders a default slot.\n *\n * @param name Name of the template/slot to render.\n * @param context Context to provide template renderer with.\n */\n renderTemplateOrSlot(name?: string, context?: any): void;\n\n /**\n * Zooms into templates with complex names. For example, zooming on `customer` in `customer:header:before`\n * will return `header:before`.\n *\n * @param id Name to zoom on.\n */\n getNestedTemplates<T extends Partial<Record<string, Renderer<any>>>>(id: string): T;\n}\n\ntype Base = Constructor<InferrableMixinHost> &\n Constructor<LitElement> & { properties?: PropertyDeclarations; inferredProperties: string[] };\n\ntype TemplateFunction = typeof html;\n\nexport type Renderer<THost> = (html: TemplateFunction, host: THost) => TemplateResult;\n\nexport const ConfigurableMixin = <TBase extends Base>(\n BaseElement: TBase\n): TBase & Constructor<ConfigurableMixinHost> => {\n return class ConfigurableElement extends BaseElement {\n static get inferredProperties(): string[] {\n return [\n ...super.inferredProperties,\n 'disabledSelector',\n 'readonlySelector',\n 'hiddenSelector',\n 'templates',\n 'disabled',\n 'readonly',\n 'hidden',\n 'mode',\n ];\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n\n templates: { attribute: false },\n mode: { type: String },\n\n readonly: { type: Boolean, reflect: true },\n readonlyControls: {\n attribute: 'readonlycontrols',\n converter: { fromAttribute: value => new BooleanSelector(value ?? '') },\n },\n\n disabled: { type: Boolean, reflect: true },\n disabledControls: {\n attribute: 'disabledcontrols',\n converter: { fromAttribute: value => new BooleanSelector(value ?? '') },\n },\n\n hidden: { type: Boolean, reflect: true },\n hiddenControls: {\n attribute: 'hiddencontrols',\n converter: { fromAttribute: value => new BooleanSelector(value ?? '') },\n },\n };\n }\n\n templates = {} as Partial<Record<string, Renderer<any>>>;\n\n mode: 'development' | 'production' = 'production';\n\n readonly = false;\n\n readonlyControls: BooleanSelector = BooleanSelector.False;\n\n disabled = false;\n\n disabledControls: BooleanSelector = BooleanSelector.False;\n\n hidden = false;\n\n hiddenControls: BooleanSelector = BooleanSelector.False;\n\n private readonly __observer = new MutationObserver(() => this.__onMutation());\n\n get readonlySelector(): BooleanSelector {\n return this.readonly ? BooleanSelector.True : this.readonlyControls;\n }\n\n get disabledSelector(): BooleanSelector {\n return this.disabled ? BooleanSelector.True : this.disabledControls;\n }\n\n get hiddenSelector(): BooleanSelector {\n return this.hidden ? BooleanSelector.True : this.hiddenControls;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n if (this.mode === 'development') this.__observe();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.__observer.disconnect();\n }\n\n protected firstUpdated(...args: Parameters<LitElement['firstUpdated']>): void {\n super.firstUpdated(...args);\n if (this.mode === 'production') this.compileTemplates();\n }\n\n protected updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n\n this.style.display = this.hidden ? 'none' : '';\n\n if (changes.has('mode')) {\n this.__observer.disconnect();\n if (this.mode === 'development') this.__observe();\n }\n }\n\n compileTemplates(replace = false): void {\n const templates = replace ? {} : { ...this.templates };\n\n Array.from(this.children).forEach(child => {\n if (child.localName !== 'template') return;\n const slot = child.getAttribute('slot') ?? 'default';\n\n try {\n const script = `return html\\`${child.innerHTML}\\``;\n templates[slot] = new Function('html', 'host', script) as () => TemplateResult;\n } catch (err) {\n console.error(err);\n }\n });\n\n this.templates = templates;\n }\n\n renderTemplateOrSlot(name?: string, context?: any) {\n const templateName = name ?? 'default';\n const template = this.templates[templateName];\n\n if (!template) return html`<slot name=${ifDefined(name)}></slot>`;\n\n const renderer = () => {\n try {\n const target = {} as unknown as this;\n const resolvedContext = context ?? this;\n const proxy = new Proxy(target, { get: (_, key) => resolvedContext[key] });\n\n return template?.(html, proxy);\n } catch (err) {\n console.error(err);\n }\n };\n\n return html`\n <foxy-internal-sandbox data-testid=${templateName} .render=${renderer}>\n </foxy-internal-sandbox>\n `;\n }\n\n getNestedTemplates<T extends Partial<Record<string, Renderer<any>>>>(id: string): T {\n const nestedTemplates = {} as T;\n\n Object.entries(this.templates).forEach(([key, value]) => {\n if (key.startsWith(`${id}:`)) {\n const zoomedKey = key.replace(`${id}:`, '');\n nestedTemplates[zoomedKey as keyof T] = value as T[keyof T];\n }\n });\n\n return nestedTemplates;\n }\n\n applyInferredProperties(context: Map<string, unknown>): void {\n super.applyInferredProperties(context);\n\n type Templates = ConfigurableMixinHost['templates'];\n type Mode = ConfigurableMixinHost['mode'];\n\n if (this.infer === null) return;\n\n const disabledSelector = context.get('disabledSelector') as BooleanSelector | undefined;\n const disabled = context.get('disabled') as boolean | undefined;\n\n const readonlySelector = context.get('readonlySelector') as BooleanSelector | undefined;\n const readonly = context.get('readonly') as boolean | undefined;\n\n const hiddenSelector = context.get('hiddenSelector') as BooleanSelector | undefined;\n const hidden = context.get('hidden') as boolean | undefined;\n\n const templates = context.get('templates') as Templates | undefined;\n const mode = context.get('mode') as Mode | undefined;\n\n this.disabledControls = disabledSelector?.zoom(this.infer) ?? BooleanSelector.False;\n this.disabled = disabledSelector?.matches(this.infer, true) ?? disabled ?? false;\n\n this.readonlyControls = readonlySelector?.zoom(this.infer) ?? BooleanSelector.False;\n this.readonly = readonlySelector?.matches(this.infer, true) ?? readonly ?? false;\n\n this.hiddenControls = hiddenSelector?.zoom(this.infer) ?? BooleanSelector.False;\n this.hidden = hiddenSelector?.matches(this.infer, true) ?? hidden ?? false;\n\n this.templates = templates ?? {};\n this.templates = this.getNestedTemplates(this.infer);\n\n this.mode = mode ?? 'production';\n }\n\n private __observe() {\n this.__observer.observe(this, {\n characterData: true,\n attributes: true,\n childList: true,\n subtree: true,\n });\n\n this.__onMutation();\n }\n\n private __onMutation() {\n const config: MutationObserverInit = {\n characterData: true,\n attributes: true,\n childList: true,\n subtree: true,\n };\n\n this.__observer.disconnect();\n this.__observer.observe(this, config);\n\n Array.from(this.children).forEach(child => {\n if (child.localName !== 'template' || !child.hasAttribute('slot')) return;\n this.__observer.observe((child as HTMLTemplateElement).content, config);\n });\n\n this.compileTemplates(true);\n }\n };\n};\n"]}
1
+ {"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../src/mixins/configurable.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAA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AAyB;gBACnC,aAAa,EAAE,IAAI;gBACnB,UAAU,EAAE,IAAI;gBAChB,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,IAAI;aACd,CAAC;YAEF,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;YAC7B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAEtC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACxC,IAAI,KAAK,CAAC,SAAS,KAAK,UAAU,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC;oBAAE,OAAO;gBAC1E,IAAI,CAAC,UAAU,CAAC,OAAO,CAAE,KAA6B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC1E,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport { Constructor, LitElement, PropertyDeclarations, TemplateResult, html } from 'lit-element';\n\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { InferrableMixinHost } from './inferrable';\n\nexport declare class ConfigurableMixinHost {\n /** Template render functions mapped to their name. */\n templates: Partial<Record<string, Renderer<any>>>;\n\n /**\n * Toggles additional functionality for developers on and off. In particular,\n * setting this property (or attribute with the same name) to \"development\" will\n * start tracking changes in templates, allowing developers to edit HTML in the browser\n * and see results without having to refresh the page every time.\n */\n mode: 'development' | 'production';\n\n /**\n * If true, makes every editable control inside of this element read-only.\n * This property is reflected to the `readonly` boolean attribute.\n *\n * @since 1.4.0\n */\n readonly: boolean;\n\n /**\n * [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) selecting\n * controls to render as read-only. Parsed version of the `readonlycontrols` attribute value.\n *\n * @type {BooleanSelector}\n * @since 1.4.0\n * @default BooleanSelector.False\n */\n readonlyControls: BooleanSelector;\n\n /**\n * If true, disables every interactive control inside of this element.\n * This property is reflected to the `disabled` boolean attribute.\n *\n * @since 1.4.0\n */\n disabled: boolean;\n\n /**\n * [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) selecting\n * controls to render as disabled. Parsed version of the `disabledcontrols` attribute value.\n *\n * @type {BooleanSelector}\n * @since 1.4.0\n * @default BooleanSelector.False\n */\n disabledControls: BooleanSelector;\n\n /**\n * If true, hides every configurable control inside of this element.\n * This property is reflected to the `hidden` boolean attribute.\n *\n * @since 1.4.0\n */\n hidden: boolean;\n\n /**\n * [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) selecting\n * controls to hide. Parsed version of the `hiddencontrols` attribute value.\n *\n * @type {BooleanSelector}\n * @since 1.4.0\n * @default BooleanSelector.False\n */\n hiddenControls: BooleanSelector;\n\n /**\n * Combined [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) for `readonlyControls`\n * and `readonly` properties. If `readonly` is true, this selector will match any control,\n * otherwise it will match the same controls as in `readonlyControls`.\n *\n * @since 1.4.0\n */\n get readonlySelector(): BooleanSelector;\n\n /**\n * Combined [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) for `disabledControls`\n * and `disabled` properties. If `disabled` is true, this selector will match any control,\n * otherwise it will match the same controls as in `disabledControls`.\n *\n * @since 1.4.0\n */\n get disabledSelector(): BooleanSelector;\n\n /**\n * Combined [BooleanSelector](https://sdk.foxy.dev/classes/_core_index_.booleanselector.html) for `hiddenControls`\n * and `hidden` properties. If `hidden` is true, this selector will match any control,\n * otherwise it will match the same controls as in `hiddenControls`.\n *\n * @since 1.4.0\n */\n get hiddenSelector(): BooleanSelector;\n\n /**\n * Looks for templates in element's children and compiles them to render functions.\n *\n * @param replace If true, all existing templates will be removed.\n */\n compileTemplates(replace?: boolean): void;\n\n /**\n * Renders a template with the given name if available and a slot otherwise.\n * For empty name looks for a \"default\" template first and renders it if found – otherwise renders a default slot.\n *\n * @param name Name of the template/slot to render.\n * @param context Context to provide template renderer with.\n */\n renderTemplateOrSlot(name?: string, context?: any): void;\n\n /**\n * Zooms into templates with complex names. For example, zooming on `customer` in `customer:header:before`\n * will return `header:before`.\n *\n * @param id Name to zoom on.\n */\n getNestedTemplates<T extends Partial<Record<string, Renderer<any>>>>(id: string): T;\n}\n\ntype Base = Constructor<InferrableMixinHost> &\n Constructor<LitElement> & { properties?: PropertyDeclarations; inferredProperties: string[] };\n\ntype TemplateFunction = typeof html;\n\nexport type Renderer<THost> = (html: TemplateFunction, host: THost) => TemplateResult;\n\nexport const ConfigurableMixin = <TBase extends Base>(\n BaseElement: TBase\n): TBase & Constructor<ConfigurableMixinHost> => {\n return class ConfigurableElement extends BaseElement {\n static get inferredProperties(): string[] {\n return [\n ...super.inferredProperties,\n 'disabledSelector',\n 'readonlySelector',\n 'hiddenSelector',\n 'templates',\n 'disabled',\n 'readonly',\n 'hidden',\n 'mode',\n ];\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n\n templates: { attribute: false },\n mode: { type: String },\n\n readonly: { type: Boolean, reflect: true },\n readonlyControls: {\n attribute: 'readonlycontrols',\n converter: { fromAttribute: value => new BooleanSelector(value ?? '') },\n },\n\n disabled: { type: Boolean, reflect: true },\n disabledControls: {\n attribute: 'disabledcontrols',\n converter: { fromAttribute: value => new BooleanSelector(value ?? '') },\n },\n\n hidden: { type: Boolean, reflect: true },\n hiddenControls: {\n attribute: 'hiddencontrols',\n converter: { fromAttribute: value => new BooleanSelector(value ?? '') },\n },\n };\n }\n\n templates = {} as Partial<Record<string, Renderer<any>>>;\n\n mode: 'development' | 'production' = 'production';\n\n readonly = false;\n\n readonlyControls: BooleanSelector = BooleanSelector.False;\n\n disabled = false;\n\n disabledControls: BooleanSelector = BooleanSelector.False;\n\n hidden = false;\n\n hiddenControls: BooleanSelector = BooleanSelector.False;\n\n private readonly __observer = new MutationObserver(() => this.__onMutation());\n\n get readonlySelector(): BooleanSelector {\n return this.readonly ? BooleanSelector.True : this.readonlyControls;\n }\n\n get disabledSelector(): BooleanSelector {\n return this.disabled ? BooleanSelector.True : this.disabledControls;\n }\n\n get hiddenSelector(): BooleanSelector {\n return this.hidden ? BooleanSelector.True : this.hiddenControls;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n if (this.mode === 'development') this.__observe();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.__observer.disconnect();\n }\n\n protected firstUpdated(...args: Parameters<LitElement['firstUpdated']>): void {\n super.firstUpdated(...args);\n if (this.mode === 'production') this.compileTemplates();\n }\n\n protected updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n\n this.style.display = this.hidden ? 'none' : '';\n\n if (changes.has('mode')) {\n this.__observer.disconnect();\n if (this.mode === 'development') this.__observe();\n }\n }\n\n compileTemplates(replace = false): void {\n const templates = replace ? {} : { ...this.templates };\n\n Array.from(this.children).forEach(child => {\n if (child.localName !== 'template') return;\n const slot = child.getAttribute('slot') ?? 'default';\n\n try {\n const script = `return html\\`${child.innerHTML}\\``;\n templates[slot] = new Function('html', 'host', script) as () => TemplateResult;\n } catch (err) {\n console.error(err);\n }\n });\n\n this.templates = templates;\n }\n\n renderTemplateOrSlot(name?: string, context?: any) {\n const templateName = name ?? 'default';\n const template = this.templates[templateName];\n\n if (!template) return html`<slot name=${ifDefined(name)}></slot>`;\n\n const renderer = () => {\n try {\n const target = {} as unknown as this;\n const resolvedContext = context ?? this;\n const proxy = new Proxy(target, { get: (_, key) => resolvedContext[key] });\n\n return template?.(html, proxy);\n } catch (err) {\n console.error(err);\n }\n };\n\n return html`\n <foxy-internal-sandbox data-testid=${templateName} .render=${renderer}>\n </foxy-internal-sandbox>\n `;\n }\n\n getNestedTemplates<T extends Partial<Record<string, Renderer<any>>>>(id: string): T {\n const nestedTemplates = {} as T;\n\n Object.entries(this.templates).forEach(([key, value]) => {\n if (key.startsWith(`${id}:`)) {\n const zoomedKey = key.replace(`${id}:`, '');\n nestedTemplates[zoomedKey as keyof T] = value as T[keyof T];\n }\n });\n\n return nestedTemplates;\n }\n\n applyInferredProperties(context: Map<string, unknown>): void {\n super.applyInferredProperties(context);\n\n type Templates = ConfigurableMixinHost['templates'];\n type Mode = ConfigurableMixinHost['mode'];\n\n if (this.infer === null) return;\n\n const disabledSelector = context.get('disabledSelector') as BooleanSelector | undefined;\n const disabled = context.get('disabled') as boolean | undefined;\n\n const readonlySelector = context.get('readonlySelector') as BooleanSelector | undefined;\n const readonly = context.get('readonly') as boolean | undefined;\n\n const hiddenSelector = context.get('hiddenSelector') as BooleanSelector | undefined;\n const hidden = context.get('hidden') as boolean | undefined;\n\n const templates = context.get('templates') as Templates | undefined;\n const mode = context.get('mode') as Mode | undefined;\n\n const trueAsString = BooleanSelector.True.toString();\n const simplify = (selector: BooleanSelector, fallback?: boolean) => {\n return selector.toString() === trueAsString || (fallback ?? false);\n };\n\n const zoomIfNested = (selector?: BooleanSelector) => {\n return (this.infer ? selector?.zoom(this.infer) : selector) ?? BooleanSelector.False;\n };\n\n this.disabledControls = zoomIfNested(disabledSelector);\n this.disabled = simplify(this.disabledControls, disabled);\n\n this.readonlyControls = zoomIfNested(readonlySelector);\n this.readonly = simplify(this.readonlyControls, readonly);\n\n this.hiddenControls = zoomIfNested(hiddenSelector);\n this.hidden = simplify(this.hiddenControls, hidden);\n\n this.templates = templates ?? {};\n if (this.infer) this.templates = this.getNestedTemplates(this.infer);\n\n this.mode = mode ?? 'production';\n }\n\n private __observe() {\n this.__observer.observe(this, {\n characterData: true,\n attributes: true,\n childList: true,\n subtree: true,\n });\n\n this.__onMutation();\n }\n\n private __onMutation() {\n const config: MutationObserverInit = {\n characterData: true,\n attributes: true,\n childList: true,\n subtree: true,\n };\n\n this.__observer.disconnect();\n this.__observer.observe(this, config);\n\n Array.from(this.children).forEach(child => {\n if (child.localName !== 'template' || !child.hasAttribute('slot')) return;\n this.__observer.observe((child as HTMLTemplateElement).content, config);\n });\n\n this.compileTemplates(true);\n }\n };\n};\n"]}
@@ -19,30 +19,32 @@ export const InferrableMixin = (BaseElement) => {
19
19
  return element[key];
20
20
  }
21
21
  inferProperties() {
22
- var _a;
23
- const context = new Map();
24
- const constructor = this.constructor;
25
- const contextKeysToInfer = new Set(constructor.inferredProperties);
26
- const processNode = (node) => {
27
- if (node) {
28
- if (node instanceof ShadowRoot) {
29
- processNode(node.host);
22
+ this.updateComplete.then(() => {
23
+ var _a;
24
+ const context = new Map();
25
+ const constructor = this.constructor;
26
+ const contextKeysToInfer = new Set(constructor.inferredProperties);
27
+ const processNode = (node) => {
28
+ if (node) {
29
+ if (node instanceof ShadowRoot) {
30
+ processNode(node.host);
31
+ }
32
+ else if (node instanceof HTMLElement) {
33
+ contextKeysToInfer.forEach(key => {
34
+ const value = this.inferFromElement(key, node);
35
+ if (value !== undefined) {
36
+ context.set(key, value);
37
+ contextKeysToInfer.delete(key);
38
+ }
39
+ });
40
+ if (contextKeysToInfer.size > 0)
41
+ processNode(node.parentNode);
42
+ }
30
43
  }
31
- else if (node instanceof HTMLElement) {
32
- contextKeysToInfer.forEach(key => {
33
- const value = this.inferFromElement(key, node);
34
- if (value !== undefined) {
35
- context.set(key, value);
36
- contextKeysToInfer.delete(key);
37
- }
38
- });
39
- if (contextKeysToInfer.size > 0)
40
- processNode(node.parentNode);
41
- }
42
- }
43
- };
44
- processNode(this.parentNode);
45
- (_a = this.applyInferredProperties) === null || _a === void 0 ? void 0 : _a.call(this, context);
44
+ };
45
+ processNode(this.parentNode);
46
+ (_a = this.applyInferredProperties) === null || _a === void 0 ? void 0 : _a.call(this, context);
47
+ });
46
48
  }
47
49
  inferPropertiesInDescendants() {
48
50
  const roots = this.renderRoot === this ? [this.renderRoot] : [this.renderRoot, this];
@@ -1 +1 @@
1
- {"version":3,"file":"inferrable.js","sourceRoot":"","sources":["../../src/mixins/inferrable.ts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C;wBACH,CAAC,CAAC,CAAC;wBAEH,IAAI,kBAAkB,CAAC,IAAI,GAAG,CAAC;4BAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;qBAC/D;iBACF;YACH,CAAC,CAAC;YAEF,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC7B,MAAA,IAAI,CAAC,uBAAuB,+CAA5B,IAAI,EAA2B,OAAO,EAAE;QAC1C,CAAC;QAED,4BAA4B;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAErF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CACnB,IAAI;iBACD,gBAAgB,CAAoC,SAAS,CAAC;iBAC9D,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CACvD,CAAC;QACJ,CAAC;QAED,6DAA6D;QAC7D,uBAAuB,CAAC,OAA6B;YACnD,EAAE;QACJ,CAAC;QAED,iBAAiB;YACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACtC,CAAC;QAED,OAAO,CAAC,OAAiC;YACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACvB,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Constructor, LitElement, PropertyDeclarations } from 'lit-element';\n\ntype Base = Constructor<LitElement> & { properties?: PropertyDeclarations };\n\nexport declare class InferrableMixinHost {\n infer: string | null;\n\n inferProperties(): void;\n\n inferFromElement(key: string, element: HTMLElement): unknown | undefined;\n\n inferPropertiesInDescendants(): void;\n\n applyInferredProperties(context: Map<string, unknown>): void;\n}\n\nexport const InferrableMixin = <TBase extends Base>(\n BaseElement: TBase\n): TBase & Constructor<InferrableMixinHost> & { inferredProperties: string[] } => {\n return class InferrableElement extends BaseElement {\n static get inferredProperties(): string[] {\n return [];\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n infer: { type: String, reflect: true },\n };\n }\n\n /** Set a name for this element here to enable property inference. Set to `null` to disable. */\n infer: string | null = null;\n\n inferFromElement(key: string, element: HTMLElement): unknown | undefined {\n if (key in element) return (element as any)[key];\n }\n\n inferProperties(): void {\n const context = new Map<string, unknown>();\n const constructor = this.constructor as typeof InferrableElement;\n const contextKeysToInfer = new Set(constructor.inferredProperties);\n\n const processNode = (node: Node | null): void => {\n if (node) {\n if (node instanceof ShadowRoot) {\n processNode(node.host);\n } else if (node instanceof HTMLElement) {\n contextKeysToInfer.forEach(key => {\n const value = this.inferFromElement(key, node);\n if (value !== undefined) {\n context.set(key, value);\n contextKeysToInfer.delete(key);\n }\n });\n\n if (contextKeysToInfer.size > 0) processNode(node.parentNode);\n }\n }\n };\n\n processNode(this.parentNode);\n this.applyInferredProperties?.(context);\n }\n\n inferPropertiesInDescendants(): void {\n const roots = this.renderRoot === this ? [this.renderRoot] : [this.renderRoot, this];\n\n roots.forEach(root =>\n root\n .querySelectorAll<InferrableMixinHost & HTMLElement>('[infer]')\n .forEach(inferrable => inferrable.inferProperties())\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n applyInferredProperties(context: Map<string, unknown>): void {\n //\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.inferPropertiesInDescendants();\n }\n\n updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n this.inferPropertiesInDescendants();\n }\n };\n};\n"]}
1
+ {"version":3,"file":"inferrable.js","sourceRoot":"","sources":["../../src/mixins/inferrable.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,WAAkB,EAC2D,EAAE;IAC/E,OAAO,MAAM,iBAAkB,SAAQ,WAAW;Q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AAG,CAAC;gCAAE,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;yBAC/D;qBACF;gBACH,CAAC,CAAC;gBAEF,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAC7B,MAAA,IAAI,CAAC,uBAAuB,+CAA5B,IAAI,EAA2B,OAAO,EAAE;YAC1C,CAAC,CAAC,CAAC;QACL,CAAC;QAED,4BAA4B;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAErF,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CACnB,IAAI;iBACD,gBAAgB,CAAoC,SAAS,CAAC;iBAC9D,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC,CACvD,CAAC;QACJ,CAAC;QAED,6DAA6D;QAC7D,uBAAuB,CAAC,OAA6B;YACnD,EAAE;QACJ,CAAC;QAED,iBAAiB;YACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC1B,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACtC,CAAC;QAED,OAAO,CAAC,OAAiC;YACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACvB,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Constructor, LitElement, PropertyDeclarations } from 'lit-element';\n\ntype Base = Constructor<LitElement> & { properties?: PropertyDeclarations };\n\nexport declare class InferrableMixinHost {\n infer: string | null;\n\n inferProperties(): void;\n\n inferFromElement(key: string, element: HTMLElement): unknown | undefined;\n\n inferPropertiesInDescendants(): void;\n\n applyInferredProperties(context: Map<string, unknown>): void;\n}\n\nexport const InferrableMixin = <TBase extends Base>(\n BaseElement: TBase\n): TBase & Constructor<InferrableMixinHost> & { inferredProperties: string[] } => {\n return class InferrableElement extends BaseElement {\n static get inferredProperties(): string[] {\n return [];\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n infer: { type: String, reflect: true },\n };\n }\n\n /** Set a name for this element here to enable property inference. Set to `null` to disable. */\n infer: string | null = null;\n\n inferFromElement(key: string, element: HTMLElement): unknown | undefined {\n if (key in element) return (element as any)[key];\n }\n\n inferProperties(): void {\n this.updateComplete.then(() => {\n const context = new Map<string, unknown>();\n const constructor = this.constructor as typeof InferrableElement;\n const contextKeysToInfer = new Set(constructor.inferredProperties);\n\n const processNode = (node: Node | null): void => {\n if (node) {\n if (node instanceof ShadowRoot) {\n processNode(node.host);\n } else if (node instanceof HTMLElement) {\n contextKeysToInfer.forEach(key => {\n const value = this.inferFromElement(key, node);\n if (value !== undefined) {\n context.set(key, value);\n contextKeysToInfer.delete(key);\n }\n });\n\n if (contextKeysToInfer.size > 0) processNode(node.parentNode);\n }\n }\n };\n\n processNode(this.parentNode);\n this.applyInferredProperties?.(context);\n });\n }\n\n inferPropertiesInDescendants(): void {\n const roots = this.renderRoot === this ? [this.renderRoot] : [this.renderRoot, this];\n\n roots.forEach(root =>\n root\n .querySelectorAll<InferrableMixinHost & HTMLElement>('[infer]')\n .forEach(inferrable => inferrable.inferProperties())\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n applyInferredProperties(context: Map<string, unknown>): void {\n //\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.inferPropertiesInDescendants();\n }\n\n updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n this.inferPropertiesInDescendants();\n }\n };\n};\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/elements",
3
3
  "type": "module",
4
- "version": "1.17.0",
4
+ "version": "1.18.0-beta.3",
5
5
  "description": "E-commerce web components by Foxy.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "prepack": "npm run lint && rimraf dist && node ./.build/compile-for-npm.js && rollup -c"
27
27
  },
28
28
  "dependencies": {
29
- "@foxy.io/sdk": "^1.9.1",
29
+ "@foxy.io/sdk": "^1.9.2",
30
30
  "@open-wc/lit-helpers": "^0.3.11",
31
31
  "@open-wc/scoped-elements": "1.2.1",
32
32
  "@polymer/iron-icons": "^3.0.1",
@@ -1 +0,0 @@
1
- import{F as e,A as t}from"./shared-92327224.js";class s extends t{constructor(t){super({base:new URL(document.baseURI),fetch:(...n)=>new Promise(((c,a)=>{const o="string"==typeof n[0]?new s.WHATWGRequest(...n):n[0];o.headers.set("Content-Type","application/json"),o.headers.set("FOXY-API-VERSION","1");const r=new e("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:o,resolve:c,reject:a});t.dispatchEvent(r),r.defaultPrevented||fetch(o).then(c).catch(a)}))})}}s.FetchEvent=e;export{s as A};
@@ -1,302 +0,0 @@
1
- import{I as e,_ as t}from"./shared-fadcb2e1.js";import{F as a}from"./shared-2188d5f7.js";import{E as s,C as i,T as r}from"./shared-195fd5af.js";import"./shared-31c43743.js";import"./shared-4e201e09.js";import{a as l}from"./shared-d28ac9dc.js";import"./shared-dc23b751.js";import{h as n,P as o}from"./shared-ae415a98.js";import{d,P as h,A as u,L as c,c as p,h as m}from"./shared-dc73b9a5.js";import"./shared-a052131e.js";import{p as v}from"./shared-c309e0ef.js";import{a as g,y as b}from"./shared-62169210.js";import{T as _,U as f,V as y,W as x,X as w,Y as E,Z as T,$ as k,b as S,a0 as $,a1 as A,a2 as V,a3 as C,a4 as I,a5 as M,a6 as z,m as F,a7 as L}from"./shared-92327224.js";import{s as j}from"./shared-99940888.js";import{i as q}from"./shared-7c8bb60c.js";var P={raise:_,send:f,sendParent:y,sendUpdate:x,log:w,cancel:E,start:T,stop:k,assign:S,after:$,done:A,respond:V,forwardTo:C,escalate:I,choose:M,pure:z};const H=d((e=>t=>{const{element:a,name:s,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof h)a[s]!==e&&t.setValue(e);else{if(!(t instanceof u))throw new Error("live directive can only be used on attributes or properties");a.getAttribute(s)!==e&&t.setValue(e)}})),O=n`<dom-module id="lumo-text-area" theme-for="vaadin-text-area">
2
- <template>
3
- <style include="lumo-text-field">
4
- [part="input-field"],
5
- [part="input-field"] ::slotted(textarea) {
6
- /* Equal to the implicit padding in vaadin-text-field */
7
- padding-top: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
8
- padding-bottom: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
9
- height: auto;
10
- box-sizing: border-box;
11
- transition: background-color 0.1s;
12
- line-height: var(--lumo-line-height-s);
13
- }
14
-
15
- :host(:not([readonly])) [part="input-field"]::after {
16
- display: none;
17
- }
18
-
19
- :host([readonly]) [part="input-field"] {
20
- border: 1px dashed var(--lumo-contrast-30pct);
21
- }
22
-
23
- :host([readonly]) [part="input-field"]::after {
24
- border: none;
25
- }
26
-
27
- :host(:hover:not([readonly]):not([focused]):not([invalid])) [part="input-field"] {
28
- background-color: var(--lumo-contrast-20pct);
29
- }
30
-
31
- @media (pointer: coarse) {
32
- :host(:hover:not([readonly]):not([focused]):not([invalid])) [part="input-field"] {
33
- background-color: var(--lumo-contrast-10pct);
34
- }
35
-
36
- :host(:active:not([readonly]):not([focused])) [part="input-field"] {
37
- background-color: var(--lumo-contrast-20pct);
38
- }
39
- }
40
-
41
- [part="value"],
42
- [part="input-field"] ::slotted(textarea) {
43
- line-height: inherit;
44
- --_lumo-text-field-overflow-mask-image: none;
45
- }
46
-
47
- /* Vertically align icon prefix/suffix with the first line of text */
48
- [part="input-field"] ::slotted(iron-icon) {
49
- margin-top: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);
50
- }
51
-
52
- [part="input-field"] [part="value"],
53
- [part="input-field"] ::slotted(textarea) {
54
- white-space: pre-wrap; /* override \`nowrap\` from <vaadin-text-field> */
55
- align-self: stretch; /* override \`baseline\` from <vaadin-text-field> */
56
- }
57
- </style>
58
- </template>
59
- </dom-module>`;document.head.appendChild(O.content);
60
- /**
61
- @license
62
- Copyright (c) 2017 Vaadin Ltd.
63
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
64
- */
65
- class U extends(s(l(i(r(o))))){static get template(){return n`
66
- <style include="vaadin-text-field-shared-styles">
67
- .vaadin-text-area-container {
68
- flex: auto;
69
- max-height: inherit; /* MSIE 11 */
70
- min-height: inherit; /* MSIE 11 */
71
- }
72
-
73
- /* The label, helper text and the error message should neither grow nor shrink. */
74
- [part="label"],
75
- [part="helper-text"],
76
- [part="error-message"] {
77
- flex: none;
78
- }
79
-
80
- [part="input-field"] {
81
- overflow: auto;
82
- -webkit-overflow-scrolling: touch;
83
- }
84
-
85
- [part="value"] {
86
- resize: none;
87
- }
88
-
89
- [part="value"],
90
- [part="input-field"] ::slotted(*) {
91
- align-self: flex-start;
92
- }
93
-
94
- @keyframes vaadin-text-area-appear {
95
- to {
96
- opacity: 1;
97
- }
98
- }
99
-
100
- :host {
101
- animation: 1ms vaadin-text-area-appear;
102
- }
103
-
104
- /* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */
105
- :host([disabled]) [part='value'] {
106
- user-select: none;
107
- }
108
- </style>
109
-
110
- <div class="vaadin-text-area-container">
111
-
112
- <label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
113
-
114
- <div part="input-field" id="[[_inputId]]" on-scroll="__scrollPositionUpdated">
115
-
116
- <slot name="prefix"></slot>
117
-
118
- <slot name="textarea">
119
- <textarea part="value"></textarea>
120
- </slot>
121
-
122
- <div part="clear-button" id="clearButton" role="button" aria-label\$="[[i18n.clear]]"></div>
123
- <slot name="suffix"></slot>
124
-
125
- </div>
126
-
127
- <div part="helper-text" id="[[_helperTextId]]">
128
- <slot name="helper">[[helperText]]</slot>
129
- </div>
130
-
131
- <div part="error-message" id="[[_errorId]]" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]">[[errorMessage]]</div>
132
-
133
- </div>
134
- `}static get is(){return"vaadin-text-area"}static get version(){return"2.9.2"}static get properties(){return{pattern:{type:String}}}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd),this._inputField=this.root.querySelector("[part=input-field]"),this._inputField.addEventListener("wheel",(e=>{const t=this._inputField.scrollTop;this._inputField.scrollTop+=e.deltaY,t!==this._inputField.scrollTop&&(e.preventDefault(),this.__scrollPositionUpdated())})),this.__scrollPositionUpdated()}__scrollPositionUpdated(){this.updateStyles({"--_text-area-vertical-scroll-position":this._inputField.scrollTop+"px"})}_onAnimationEnd(e){0===e.animationName.indexOf("vaadin-text-area-appear")&&this._updateHeight()}get _slottedTagName(){return"textarea"}_textAreaValueChanged(e){this._updateHeight()}_updateHeight(){const e=this.root.querySelector("[part=input-field]"),t=e.scrollTop,a=this.inputElement,s=this.value?this.value.length:0;if(this._oldValueLength>=s){const t=getComputedStyle(e).height,s=getComputedStyle(a).width;e.style.display="block",e.style.height=t,a.style.maxWidth=s,a.style.height="auto"}this._oldValueLength=s;const i=a.scrollHeight;i>a.clientHeight&&(a.style.height=i+"px"),a.style.removeProperty("max-width"),e.style.removeProperty("display"),e.style.removeProperty("height"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",i)}checkValidity(){if(!super.checkValidity())return!1;if(!this.pattern||!this.inputElement.value)return!0;try{const e=this.inputElement.value.match(this.pattern);return!!e&&e[0]===e.input}catch(e){return!0}}}customElements.define(U.is,U);class N extends CustomEvent{constructor(e){super("change",{detail:e})}}const D=n`<dom-module id="lumo-custom-field" theme-for="vaadin-custom-field">
135
- <template>
136
- <style include="lumo-required-field">
137
- :host {
138
- --lumo-text-field-size: var(--lumo-size-m);
139
- color: var(--lumo-body-text-color);
140
- font-size: var(--lumo-font-size-m);
141
- /* align with text-field height + vertical paddings */
142
- line-height: calc(var(--lumo-text-field-size) + 2 * var(--lumo-space-xs));
143
- font-family: var(--lumo-font-family);
144
- -webkit-font-smoothing: antialiased;
145
- -moz-osx-font-smoothing: grayscale;
146
- -webkit-tap-highlight-color: transparent;
147
- padding: 0;
148
- }
149
-
150
- :host::before {
151
- margin-top: var(--lumo-space-xs);
152
- height: var(--lumo-text-field-size);
153
- box-sizing: border-box;
154
- display: inline-flex;
155
- align-items: center;
156
- }
157
-
158
- /* align with text-field label */
159
- :host([has-label]) [part="label"] {
160
- padding-bottom: calc(0.5em - var(--lumo-space-xs));
161
- }
162
-
163
- :host(:not([has-label])) [part="label"],
164
- :host(:not([has-label]))::before {
165
- display: none;
166
- }
167
-
168
- /* align with text-field error message */
169
- :host([invalid]) [part="error-message"]:not(:empty)::before {
170
- height: calc(0.4em - var(--lumo-space-xs));
171
- }
172
-
173
- :host([focused]:not([readonly]):not([disabled])) [part="label"] {
174
- color: var(--lumo-primary-text-color);
175
- }
176
-
177
- :host(:hover:not([readonly]):not([disabled]):not([focused])) [part="label"],
178
- :host(:hover:not([readonly]):not([disabled]):not([focused])) [part="helper-text"],
179
- :host(:hover:not([readonly]):not([disabled]):not([focused])) [part="helper-text"] ::slotted(*) {
180
- color: var(--lumo-body-text-color);
181
- }
182
-
183
- :host([has-helper]) [part="helper-text"]::before {
184
- content: "";
185
- display: block;
186
- height: 0.4em;
187
- }
188
-
189
- [part="helper-text"],
190
- [part="helper-text"] ::slotted(*) {
191
- display: block;
192
- color: var(--lumo-secondary-text-color);
193
- font-size: var(--lumo-font-size-xs);
194
- line-height: var(--lumo-line-height-xs);
195
- margin-left: calc(var(--lumo-border-radius-m) / 4);
196
- transition: color 0.2s;
197
- }
198
-
199
- /* helper-text position */
200
-
201
- :host([has-helper][theme~="helper-above-field"]) [part="helper-text"]::before {
202
- display: none;
203
- }
204
-
205
- :host([has-helper][theme~="helper-above-field"]) [part="helper-text"]::after {
206
- content: "";
207
- display: block;
208
- height: 0.4em;
209
- }
210
-
211
- :host([has-helper][theme~="helper-above-field"]) [part="label"] {
212
- order: 0;
213
- padding-bottom: 0.4em;
214
- }
215
-
216
- :host([has-helper][theme~="helper-above-field"]) [part="helper-text"] {
217
- order: 1;
218
- }
219
-
220
- :host([has-helper][theme~="helper-above-field"]) .inputs-wrapper {
221
- order: 2;
222
- }
223
-
224
- :host([has-helper][theme~="helper-above-field"]) [part="error-message"] {
225
- order: 3;
226
- }
227
-
228
- /* Touch device adjustment */
229
- @media (pointer: coarse) {
230
- :host(:hover:not([readonly]):not([disabled]):not([focused])) [part="label"] {
231
- color: var(--lumo-secondary-text-color);
232
- }
233
- }
234
-
235
- /* Disabled style */
236
-
237
- :host([disabled]) [part="label"] {
238
- color: var(--lumo-disabled-text-color);
239
- -webkit-text-fill-color: var(--lumo-disabled-text-color);
240
- }
241
-
242
- /* Small theme */
243
-
244
- :host([theme~="small"]) {
245
- font-size: var(--lumo-font-size-s);
246
- --lumo-text-field-size: var(--lumo-size-s);
247
- }
248
-
249
- :host([theme~="small"][has-label]) [part="label"] {
250
- font-size: var(--lumo-font-size-xs);
251
- }
252
-
253
- :host([theme~="small"][has-label]) [part="error-message"] {
254
- font-size: var(--lumo-font-size-xxs);
255
- }
256
- </style>
257
- </template>
258
- </dom-module>`;document.head.appendChild(D.content);const B=e=>class extends e{static get properties(){return{inputs:{type:Array,readOnly:!0},i18n:{type:Object,value:()=>({parseValue:function(e){return e.split("\t")},formatValue:function(e){return e.join("\t")}})},__errorId:String,__labelId:String,__helperTextId:String,__hasSlottedHelper:Boolean}}connectedCallback(){super.connectedCallback(),this.__observer&&this.__observer.connect()}disconnectedCallback(){super.disconnectedCallback(),this.__observer&&this.__observer.disconnect()}ready(){super.ready(),this.__setInputsFromSlot(),this.__observer=new a(this.$.slot,(()=>{this.__setInputsFromSlot()})),this.$.helperSlot.addEventListener("slotchange",this.__onHelperSlotChange.bind(this)),this.__onHelperSlotChange();const e=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor);this.addEventListener("keydown",(t=>{if(9===t.keyCode){if("slot"===t.target.parentElement.localName&&!t.defaultPrevented&&e){const e=t.target.parentElement;e.setAttribute("tabindex",-1),setTimeout((()=>e.removeAttribute("tabindex")))}this.inputs.indexOf(t.target)<this.inputs.length-1&&!t.shiftKey||this.inputs.indexOf(t.target)>0&&t.shiftKey?this.dispatchEvent(new CustomEvent("internal-tab")):this.__setValue()}})),this.addEventListener("focusin",(()=>this.setAttribute("focused",""))),this.addEventListener("focusout",(e=>{const t=this.getRootNode().activeElement;this.inputs.some((e=>t===e||e.shadowRoot&&e.shadowRoot.contains(t)))||this.removeAttribute("focused")}));var t=B._uniqueId=1+B._uniqueId||1;this.__errorId=`${this.constructor.is}-error-${t}`,this.__labelId=`${this.constructor.is}-label-${t}`,this.__helperTextId=`${this.constructor.is}-helper-${t}`}focus(){this.inputs&&this.inputs[0]&&this.inputs[0].focus()}__updateValue(e){e&&e.stopPropagation(),this.__setValue(),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))}__setValue(){this.__settingValue=!0,this.value=this.i18n.formatValue.apply(this,[this.inputs.map((e=>e.value))]),this.__settingValue=!1}__queryAllAssignedElements(e){const t=[];let a;return"SLOT"===e.tagName?a=e.assignedNodes({flatten:!0}).filter((e=>e.nodeType===Node.ELEMENT_NODE)):(t.push(e),a=Array.from(e.children)),a.forEach((e=>t.push(...this.__queryAllAssignedElements(e)))),t}__getInputsFromSlot(){return this.__queryAllAssignedElements(this.$.slot).filter((e=>e.validate||e.checkValidity))}__setInputsFromSlot(){this._setInputs(this.__getInputsFromSlot()),this.__setValue()}__valueChanged(e,t){if(this.__settingValue||!this.inputs)return;const a=this.i18n.parseValue(e);a&&0!=a.length?(this.inputs.forEach(((e,t)=>e.value=a[t])),void 0!==t&&this.validate()):console.warn("Value parser has not provided values array")}__onHelperSlotChange(){const e=this.$.helperSlot.assignedNodes({flatten:!0});this.__hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length>0,this.__hasSlottedHelper?this.setAttribute("has-helper","slotted"):""!==this.helperText&&null!==this.helperText||this.removeAttribute("has-helper")}}
259
- /**
260
- @license
261
- Copyright (c) 2018 Vaadin Ltd.
262
- This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
263
- */;class R extends(s(B(r(o)))){static get template(){return n`
264
- <style>
265
- :host {
266
- display: inline-flex;
267
- }
268
-
269
- :host::before {
270
- content: "\\2003";
271
- width: 0;
272
- display: inline-block;
273
- /* Size and position this element on the same vertical position as the input-field element
274
- to make vertical align for the host element work as expected */
275
- }
276
-
277
- :host([hidden]) {
278
- display: none !important;
279
- }
280
-
281
- .container {
282
- width: 100%;
283
- display: flex;
284
- flex-direction: column;
285
- }
286
-
287
- .inputs-wrapper {
288
- flex: none;
289
- }
290
- </style>
291
-
292
- <div class="container">
293
- <label part="label" on-click="focus" id="[[__labelId]]">[[label]]</label>
294
- <div class="inputs-wrapper" on-change="__updateValue">
295
- <slot id="slot"></slot>
296
- </div>
297
- <div part="helper-text" id="[[__helperTextId]]">
298
- <slot name="helper" id="helperSlot">[[helperText]]</slot>
299
- </div>
300
- <div part="error-message" id="[[__errorId]]" aria-live="assertive" aria-hidden\$="[[__getErrorMessageAriaHidden(invalid, errorMessage, __errorId)]]">[[errorMessage]]</div>
301
- </div>
302
- `}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,a){e&&a&&a.hasAttribute(e)===!t&&(t?a.setAttribute(e,"boolean"==typeof t?"":t):a.removeAttribute(e))}__getActiveErrorId(e,t,a,s,i,r){const l=[];(s||r)&&l.push(i),t&&e&&l.push(a),l.length>0?this.setAttribute("aria-describedby",l.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,a){return(!(t&&e?a:void 0)).toString()}}customElements.define(R.is,R);class Y extends CustomEvent{constructor(e){super("change",{detail:e})}}class W extends Y{}let X,K,G=e=>e;class Z extends(g(e(c))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:a}=v(e);return[t.toString(),a]}},this.__getItems=F((e=>{const t=v(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return t(t({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return p(X||(X=G`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return m(K||(K=G` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,H(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new W(this.value))}}const J=L({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:P.assign({defaultCustomValue:(e,t)=>t.data}),setValue:P.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:P.assign({custom:(e,t)=>t.data}),setItems:P.assign({items:(e,t)=>t.data}),setType:P.assign({type:(e,t)=>t.data}),setMin:P.assign({min:(e,t)=>t.data}),setMax:P.assign({max:(e,t)=>t.data})}});let Q,ee,te,ae,se,ie,re,le,ne,oe,de,he,ue,ce=e=>e;const pe=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class me extends b{constructor(){super(...arguments),this.getText=e=>e,this.__service=q(J).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":Z,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,p(te||(te=ce`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return t(t({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,pe]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),s=m(ae||(ae=ce` ${0} `),e.map(((e,s,i)=>{var r;const l=this.custom&&s===i.length-1,n=l?a:t?!!(null===(r=this.value)||void 0===r?void 0:r.includes(e)):e===String(this.value),o=this.disabled||!this._isI18nReady,d=j({value:l?pe:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":o,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,s=e===pe?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===pe?a?[...i,s]:i.slice(0,i.length-1):a?[s,...i]:i.filter((e=>e!==s)):this.value=a?s:null,this.dispatchEvent(new N(this.value))}}),h=m(se||(se=ce` <div> ${0} </div> `),e===pe?this._t("choice.other").toString():m(ie||(ie=ce`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return m(re||(re=ce` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,a,s,i){const r="transition ease-in-out duration-200",l=`${r} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return m(ee||(ee=ce` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,n,d,h):function(e,t,a,s,i){const r="transition ease-in-out duration-200",l=`${r} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return m(Q||(Q=ce` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",l,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,o,n,d,h),e===pe&&a?this.__field:"",e!==pe?m(le||(le=ce`<slot name="${0}"></slot>`),e):"")})));return m(ne||(ne=ce`<form>${0}</form> `),s)}get __field(){const e=j({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new N(this.value))}});return"frequency"===this.type?m(oe||(oe=ce`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?m(de||(de=ce`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?m(he||(he=ce`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):m(ue||(ue=ce`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{me as C,Y as D,Z as F,R as a,N as b,P as c};