@foxy.io/elements 1.14.0-beta.1 → 1.14.0-beta.10
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.
- package/README.md +1 -1
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +18 -18
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +4 -4
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -0
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +26 -9
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -0
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/{shared-151ca103.js → shared-00070cc4.js} +1 -1
- package/dist/cdn/{shared-d4dad105.js → shared-00563cb0.js} +1 -1
- package/dist/cdn/shared-007c4e34.js +1 -0
- package/dist/cdn/shared-07134f93.js +14 -0
- package/dist/cdn/shared-0ced76a0.js +358 -0
- package/dist/cdn/shared-0f9809ab.js +1 -0
- package/dist/cdn/{shared-f4119f12.js → shared-16f72e27.js} +1 -1
- package/dist/cdn/shared-1761daef.js +15 -0
- package/dist/cdn/{shared-5fedf5e4.js → shared-200f613b.js} +2 -2
- package/dist/cdn/{shared-4059f633.js → shared-218ba06e.js} +1 -1
- package/dist/cdn/shared-31d03530.js +264 -0
- package/dist/cdn/{shared-e9920617.js → shared-34b2c1e2.js} +1 -1
- package/dist/cdn/{shared-cf248335.js → shared-44cfc617.js} +1 -1
- package/dist/cdn/{shared-45d647e4.js → shared-46ee137f.js} +1 -1
- package/dist/cdn/shared-4ba926ca.js +1 -0
- package/dist/cdn/{shared-f0199313.js → shared-593f7e2c.js} +1 -1
- package/dist/cdn/shared-59e44f29.js +1 -0
- package/dist/cdn/{shared-35415106.js → shared-5d94bacb.js} +1 -1
- package/dist/cdn/{shared-cd700eac.js → shared-60126eee.js} +1 -1
- package/dist/cdn/{shared-17968c53.js → shared-63eaded9.js} +3 -3
- package/dist/cdn/shared-6b7602c7.js +1 -0
- package/dist/cdn/{shared-98ee7fad.js → shared-6d45a07b.js} +1 -1
- package/dist/cdn/{shared-99f45065.js → shared-7007dedb.js} +1 -1
- package/dist/cdn/{shared-84fa75d9.js → shared-9221e6b2.js} +1 -1
- package/dist/cdn/{shared-2860a3d3.js → shared-94b0ae99.js} +2 -2
- package/dist/cdn/shared-a3d2c48e.js +314 -0
- package/dist/cdn/shared-a46edf4b.js +1 -0
- package/dist/cdn/{shared-54702b33.js → shared-b0f0e8b5.js} +1 -1
- package/dist/cdn/{shared-f2a4fd27.js → shared-b24377bf.js} +1 -1
- package/dist/cdn/{shared-ed4ed7a5.js → shared-b710881a.js} +2 -2
- package/dist/cdn/{shared-3ae39e52.js → shared-bb824ab4.js} +3 -3
- package/dist/cdn/{shared-6783c996.js → shared-c5ae5d33.js} +1 -1
- package/dist/cdn/shared-ca7c3b9a.js +1 -0
- package/dist/cdn/shared-d01035c5.js +1 -0
- package/dist/cdn/{shared-dbbe03f9.js → shared-d05c93a5.js} +1 -1
- package/dist/cdn/{shared-5d286626.js → shared-da787055.js} +1 -1
- package/dist/cdn/{shared-566252ac.js → shared-daf6b763.js} +1 -1
- package/dist/cdn/shared-df573cea.js +12 -0
- package/dist/cdn/{shared-e5de8675.js → shared-e7f8ffe9.js} +1 -1
- package/dist/cdn/{shared-54c485d2.js → shared-ec861f31.js} +21 -21
- package/dist/cdn/{shared-e0248713.js → shared-f0a83bd6.js} +1 -1
- package/dist/cdn/shared-fe8a7aa2.js +1 -0
- package/dist/cdn/{shared-747b0842.js → shared-ff79f3f9.js} +1 -1
- package/dist/cdn/translations/shared/en.json +87 -3
- package/dist/elements/private/Checkbox/Checkbox.d.ts +3 -1
- package/dist/elements/private/Checkbox/Checkbox.js +45 -12
- package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
- package/dist/elements/private/Choice/Choice.js +10 -8
- package/dist/elements/private/Choice/Choice.js.map +1 -1
- package/dist/elements/private/Group/Group.js +1 -1
- package/dist/elements/private/Group/Group.js.map +1 -1
- package/dist/elements/private/I18N/I18N.js +1 -1
- package/dist/elements/private/I18N/I18N.js.map +1 -1
- package/dist/elements/public/AddressForm/AddressForm.js +8 -4
- package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
- package/dist/elements/public/AttributeForm/AttributeForm.js +8 -4
- package/dist/elements/public/AttributeForm/AttributeForm.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +8 -4
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
- package/dist/elements/public/CustomerForm/CustomerForm.js +8 -4
- package/dist/elements/public/CustomerForm/CustomerForm.js.map +1 -1
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.d.ts +46 -0
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js +350 -0
- package/dist/elements/public/EmailTemplateForm/EmailTemplateForm.js.map +1 -0
- package/dist/elements/public/EmailTemplateForm/index.d.ts +9 -0
- package/dist/elements/public/EmailTemplateForm/index.js +11 -0
- package/dist/elements/public/EmailTemplateForm/index.js.map +1 -0
- package/dist/elements/public/EmailTemplateForm/types.d.ts +17 -0
- package/dist/elements/public/EmailTemplateForm/types.js +2 -0
- package/dist/elements/public/EmailTemplateForm/types.js.map +1 -0
- package/dist/elements/public/ItemsForm/ItemsForm.js +2 -2
- package/dist/elements/public/ItemsForm/ItemsForm.js.map +1 -1
- package/dist/elements/public/NucleonElement/serveFromCache.js +1 -0
- package/dist/elements/public/NucleonElement/serveFromCache.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.js +8 -4
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/CountriesList.d.ts +23 -0
- package/dist/elements/public/TemplateConfigForm/CountriesList.js +138 -0
- package/dist/elements/public/TemplateConfigForm/CountriesList.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/CountryCard.d.ts +22 -0
- package/dist/elements/public/TemplateConfigForm/CountryCard.js +157 -0
- package/dist/elements/public/TemplateConfigForm/CountryCard.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +88 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +1336 -0
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/defaults.d.ts +2 -0
- package/dist/elements/public/TemplateConfigForm/defaults.js +95 -0
- package/dist/elements/public/TemplateConfigForm/defaults.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/index.d.ts +9 -0
- package/dist/elements/public/TemplateConfigForm/index.js +11 -0
- package/dist/elements/public/TemplateConfigForm/index.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/types.d.ts +150 -0
- package/dist/elements/public/TemplateConfigForm/types.js +2 -0
- package/dist/elements/public/TemplateConfigForm/types.js.map +1 -0
- package/dist/elements/public/TemplateForm/TemplateForm.d.ts +23 -1
- package/dist/elements/public/TemplateForm/TemplateForm.js +102 -58
- package/dist/elements/public/TemplateForm/TemplateForm.js.map +1 -1
- package/dist/elements/public/TemplateForm/types.d.ts +14 -0
- package/dist/elements/public/TemplateForm/types.js.map +1 -1
- package/dist/elements/public/index.d.ts +2 -0
- package/dist/elements/public/index.defined.d.ts +2 -0
- package/dist/elements/public/index.defined.js +2 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +2 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +125 -16
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -7
- package/dist/cdn/shared-35502e88.js +0 -1
- package/dist/cdn/shared-50744508.js +0 -15
- package/dist/cdn/shared-5388f705.js +0 -1
- package/dist/cdn/shared-7f588649.js +0 -1
- package/dist/cdn/shared-9467cb31.js +0 -572
- package/dist/cdn/shared-b98f88c9.js +0 -369
- package/dist/cdn/shared-c0161e6a.js +0 -1
- package/dist/cdn/shared-dbcffd8e.js +0 -1
- package/dist/cdn/shared-e057788f.js +0 -1
- package/dist/cdn/shared-e21a2aac.js +0 -1
- package/dist/cdn/shared-ebbef842.js +0 -1
- package/dist/cdn/shared-fd5b81be.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-b98f88c9.js";import"./shared-45d647e4.js";const c=document.createElement("template");c.innerHTML='<iron-iconset-svg size="1000" name="lumo">\n<svg xmlns="http://www.w3.org/2000/svg">\n<defs>\n<g id="angle-down"><path d="M283 391c-18-16-46-15-63 4-16 18-15 46 3 63l244 224c17 15 43 15 60 0l250-229c18-16 20-45 3-63-16-18-45-20-63-4l-220 203-214-198z"></path></g>\n<g id="angle-left"><path d="M601 710c16 18 15 46-3 63-18 16-46 15-63-4l-224-244c-15-17-15-43 0-59l229-250c16-18 45-20 63-4 18 16 20 45 3 63l-203 220 198 215z"></path></g>\n<g id="angle-right"><path d="M399 275c-16-18-15-46 3-63 18-16 46-15 63 4l224 244c15 17 15 43 0 59l-229 250c-16 18-45 20-63 4-18-16-20-45-3-63l203-220-198-215z"></path></g>\n<g id="angle-up"><path d="M283 635c-18 16-46 15-63-3-16-18-15-46 3-63l244-224c17-15 43-15 60 0l250 229c18 16 20 45 3 63-16 18-45 20-63 3l-220-202L283 635z"></path></g>\n<g id="arrow-down"><path d="M538 646l125-112c15-14 39-12 53 4 14 15 12 39-4 53l-187 166c0 0 0 0 0 0-14 13-36 12-50 0l-187-166c-15-14-17-37-4-53 14-15 37-17 53-4L462 646V312c0-21 17-38 38-37s38 17 37 37v334z"></path></g>\n<g id="arrow-left"><path d="M375 538l111 125c14 15 12 39-3 53-15 14-39 12-53-4l-166-187c0 0 0 0 0 0-13-14-12-36 0-50l166-187c14-15 37-17 53-4 15 14 17 37 3 53L375 463h333c21 0 38 17 38 37 0 21-17 38-38 38h-333z"></path></g>\n<g id="arrow-right"><path d="M625 538h-333c-21 0-38-17-38-38 0-21 17-38 38-37h333l-111-126c-14-15-12-39 3-53 15-14 39-12 53 4l166 187c13 14 13 36 0 50 0 0 0 0 0 0l-166 187c-14 15-37 17-53 4-15-14-17-37-3-53l111-125z"></path></g>\n<g id="arrow-up"><path d="M538 354V688c0 21-17 38-38 37s-38-17-38-38V354l-125 112c-15 14-39 12-53-4-14-15-12-39 4-53l187-166c14-13 36-13 50 0 0 0 0 0 0 0l187 166c15 14 17 37 4 53-14 15-37 17-53 4L538 354z"></path></g>\n<g id="bar-chart"><path d="M175 500h108c28 0 50 22 50 50v233c0 28-22 50-50 50H175c-28 0-50-22-50-50v-233c0-28 22-50 50-50z m33 67c-9 0-17 7-16 16v167c0 9 7 17 16 17h42c9 0 17-7 17-17v-167c0-9-7-17-17-16H208zM446 167h108c28 0 50 22 50 50v566c0 28-22 50-50 50h-108c-28 0-50-22-50-50V217c0-28 22-50 50-50z m33 66c-9 0-17 7-17 17v500c0 9 7 17 17 17h42c9 0 17-7 16-17V250c0-9-7-17-16-17h-42zM717 333h108c28 0 50 22 50 50v400c0 28-22 50-50 50h-108c-28 0-50-22-50-50V383c0-28 22-50 50-50z m33 67c-9 0-17 7-17 17v333c0 9 7 17 17 17h42c9 0 17-7 16-17v-333c0-9-7-17-16-17h-42z"></path></g>\n<g id="bell"><path d="M367 675H292v-258C292 325 366 250 459 250H458V208c0-23 18-42 42-41 23 0 42 18 42 41v42h-1C634 250 708 325 708 417V675h-75v-258c0-51-41-92-91-92h-84C408 325 367 366 367 417V675z m-159 37c0-21 17-38 38-37h508c21 0 37 17 38 37 0 21-17 38-38 38H246C225 750 208 733 208 713z m230 71h125v32c0 17-14 31-32 31h-62c-17 0-32-14-31-31v-32z"></path></g>\n<g id="calendar"><path d="M375 208h250v-20C625 176 634 167 646 167h41C699 167 708 176 708 188V208h74c23 0 41 19 41 42v42C823 315 804 333 782 333H218C196 333 177 315 177 292V250C177 227 196 208 218 208H292v-20C292 176 301 167 313 167h41C366 167 375 176 375 188V208zM229 375h42C283 375 292 384 292 396v41C292 449 282 458 271 458h-42C217 458 208 449 208 437v-41C208 384 218 375 229 375z m125 0h42C408 375 417 384 417 396v41C417 449 407 458 396 458h-42C342 458 333 449 333 437v-41C333 384 343 375 354 375z m125 0h42C533 375 542 384 542 396v41C542 449 532 458 521 458h-42C467 458 458 449 458 437v-41C458 384 468 375 479 375z m-250 125h42C283 500 292 509 292 521v41C292 574 282 583 271 583h-42C217 583 208 574 208 562v-41C208 509 218 500 229 500z m125 0h42C408 500 417 509 417 521v41C417 574 407 583 396 583h-42C342 583 333 574 333 562v-41C333 509 343 500 354 500z m125 0h42c12 0 21 9 21 21v41C542 574 532 583 521 583h-42C467 583 458 574 458 562v-41C458 509 468 500 479 500z m-250 125h42C283 625 292 634 292 646v41C292 699 282 708 271 708h-42C217 708 208 699 208 687v-41C208 634 218 625 229 625z m125 0h42C408 625 417 634 417 646v41C417 699 407 708 396 708h-42C342 708 333 699 333 687v-41C333 634 343 625 354 625z m125 0h42c12 0 21 9 21 21v41C542 699 532 708 521 708h-42C467 708 458 699 458 687v-41C458 634 468 625 479 625z m125-250h42C658 375 667 384 667 396v41C667 449 657 458 646 458h-42C592 458 583 449 583 437v-41C583 384 593 375 604 375z m0 125h42c12 0 21 9 21 21v41C667 574 657 583 646 583h-42C592 583 583 574 583 562v-41C583 509 593 500 604 500z m0 125h42c12 0 21 9 21 21v41C667 699 657 708 646 708h-42C592 708 583 699 583 687v-41C583 634 593 625 604 625z m125 0h42c12 0 21 9 21 21v41C792 699 782 708 771 708h-42C717 708 708 699 708 687v-41C708 634 718 625 729 625z m-500 125h42C283 750 292 759 292 771v41C292 824 282 833 271 833h-42C217 833 208 824 208 812v-41C208 759 218 750 229 750z m125 0h42C408 750 417 759 417 771v41C417 824 407 833 396 833h-42C342 833 333 824 333 812v-41C333 759 343 750 354 750z m125 0h42c12 0 21 9 21 21v41C542 824 532 833 521 833h-42C467 833 458 824 458 812v-41C458 759 468 750 479 750z m125 0h42c12 0 21 9 21 21v41C667 824 657 833 646 833h-42C592 833 583 824 583 812v-41C583 759 593 750 604 750z m125 0h42c12 0 21 9 21 21v41C792 824 782 833 771 833h-42C717 833 708 824 708 812v-41C708 759 718 750 729 750z m0-250h42c12 0 21 9 21 21v41C792 574 782 583 771 583h-42C717 583 708 574 708 562v-41C708 509 718 500 729 500z m0-125h42C783 375 792 384 792 396v41C792 449 782 458 771 458h-42C717 458 708 449 708 437v-41C708 384 718 375 729 375z"></path></g>\n<g id="checkmark"><path d="M318 493c-15-15-38-15-53 0-15 15-15 38 0 53l136 136c15 15 38 15 53 0l323-322c15-15 15-38 0-53-15-15-38-15-54 0l-295 296-110-110z"></path></g>\n<g id="chevron-down"><path d="M533 654l210-199c9-9 9-23 0-32C739 419 733 417 726 417H274C261 417 250 427 250 439c0 6 2 12 7 16l210 199c18 17 48 17 66 0z"></path></g>\n<g id="chevron-left"><path d="M346 533l199 210c9 9 23 9 32 0 4-4 7-10 6-17V274C583 261 573 250 561 250c-6 0-12 2-16 7l-199 210c-17 18-17 48 0 66z"></path></g>\n<g id="chevron-right"><path d="M654 533L455 743c-9 9-23 9-32 0C419 739 417 733 417 726V274C417 261 427 250 439 250c6 0 12 2 16 7l199 210c17 18 17 48 0 66z"></path></g>\n<g id="chevron-up"><path d="M533 346l210 199c9 9 9 23 0 32-4 4-10 7-17 6H274C261 583 250 573 250 561c0-6 2-12 7-16l210-199c18-17 48-17 66 0z"></path></g>\n<g id="clock"><path d="M538 489l85 85c15 15 15 38 0 53-15 15-38 15-53 0l-93-93a38 38 0 0 1-2-2C467 525 462 515 462 504V308c0-21 17-38 38-37 21 0 38 17 37 37v181zM500 833c-184 0-333-149-333-333s149-333 333-333 333 149 333 333-149 333-333 333z m0-68c146 0 265-118 265-265 0-146-118-265-265-265-146 0-265 118-265 265 0 146 118 265 265 265z"></path></g>\n<g id="cog"><path d="M833 458l-81-18c-8-25-17-50-29-75L767 292 708 233l-72 49c-21-12-46-25-75-30L542 167h-84l-19 79c-25 8-50 17-71 30L296 233 233 296l47 69c-12 21-21 46-29 71L167 458v84l84 25c8 25 17 50 29 75L233 708 292 767l76-44c21 12 46 25 75 29L458 833h84l19-81c25-8 50-17 75-29L708 767l59-59-44-66c12-21 25-46 29-75L833 542v-84z m-333 217c-96 0-175-79-175-175 0-96 79-175 175-175 96 0 175 79 175 175 0 96-79 175-175 175z"></path></g>\n<g id="cross"><path d="M445 500l-142-141c-15-15-15-40 0-56 15-15 40-15 56 0L500 445l141-142c15-15 40-15 56 0 15 15 15 40 0 56L555 500l142 141c15 15 15 40 0 56-15 15-40 15-56 0L500 555l-141 142c-15 15-40 15-56 0-15-15-15-40 0-56L445 500z"></path></g>\n<g id="download"><path d="M538 521l125-112c15-14 39-12 53 4 14 15 12 39-4 53l-187 166a38 38 0 0 1 0 0c-14 13-36 12-50 0l-187-166c-15-14-17-37-4-53 14-15 37-17 53-4L462 521V188c0-21 17-38 38-38s38 17 37 38v333zM758 704c0-21 17-38 38-37 21 0 38 17 37 37v92c0 21-17 38-37 37H204c-21 0-38-17-37-37v-92c0-21 17-38 37-37s38 17 38 37v54h516v-54z"></path></g>\n<g id="dropdown"><path d="M317 393c-15-14-39-13-53 3-14 15-13 39 3 53l206 189c14 13 36 13 50 0l210-193c15-14 17-38 3-53-14-15-38-17-53-3l-185 171L317 393z"></path></g>\n<g id="edit"><path d="M673 281l62 56-205 233c-9 10-38 24-85 39a8 8 0 0 1-5 0c-4-1-7-6-6-10l0 0c14-47 25-76 35-86l204-232z m37-42l52-59c15-17 41-18 58-2 17 16 18 42 3 59L772 295l-62-56zM626 208l-67 75h-226C305 283 283 306 283 333v334C283 695 306 717 333 717h334c28 0 50-22 50-50v-185L792 398v269C792 736 736 792 667 792H333C264 792 208 736 208 667V333C208 264 264 208 333 208h293z"></path></g>\n<g id="error"><path d="M500 833c-184 0-333-149-333-333s149-333 333-333 333 149 333 333-149 333-333 333z m0-68c146 0 265-118 265-265 0-146-118-265-265-265-146 0-265 118-265 265 0 146 118 265 265 265zM479 292h42c12 0 21 9 20 20l-11 217c0 8-6 13-13 13h-34c-7 0-13-6-13-13l-11-217C459 301 468 292 479 292zM483 608h34c12 0 21 9 20 21v33c0 12-9 21-20 21h-34c-12 0-21-9-21-21v-33c0-12 9-21 21-21z"></path></g>\n<g id="eye"><path d="M500 750c-187 0-417-163-417-250s230-250 417-250 417 163 417 250-230 250-417 250z m-336-231c20 22 47 46 78 69C322 644 411 678 500 678s178-34 258-90c31-22 59-46 78-69 6-7 12-14 16-19-4-6-9-12-16-19-20-22-47-46-78-69C678 356 589 322 500 322s-178 34-258 90c-31 22-59 46-78 69-6 7-12 14-16 19 4 6 9 12 16 19zM500 646c-81 0-146-65-146-146s65-146 146-146 146 65 146 146-65 146-146 146z m0-75c39 0 71-32 71-71 0-39-32-71-71-71-39 0-71 32-71 71 0 39 32 71 71 71z"></path></g>\n<g id="eye-disabled"><path d="M396 735l60-60c15 2 30 3 44 3 89 0 178-34 258-90 31-22 59-46 78-69 6-7 12-14 16-19-4-6-9-12-16-19-20-22-47-46-78-69-8-5-15-11-23-15l50-51C862 397 917 458 917 500c0 87-230 250-417 250-34 0-69-5-104-15zM215 654C138 603 83 542 83 500c0-87 230-250 417-250 34 0 69 5 104 15l-59 60c-15-2-30-3-45-3-89 0-178 34-258 90-31 22-59 46-78 69-6 7-12 14-16 19 4 6 9 12 16 19 20 22 47 46 78 69 8 5 16 11 24 16L215 654z m271-9l159-159c0 5 1 9 1 14 0 81-65 146-146 146-5 0-9 0-14-1z m-131-131C354 510 354 505 354 500c0-81 65-146 146-146 5 0 10 0 14 1l-159 159z m-167 257L780 179c12-12 32-12 44 0 12 12 12 32 0 44L232 815c-12 12-32 12-44 0s-12-32 0-44z"></path></g>\n<g id="menu"><path d="M167 292c0-23 19-42 41-42h584C815 250 833 268 833 292c0 23-19 42-41 41H208C185 333 167 315 167 292z m0 208c0-23 19-42 41-42h584C815 458 833 477 833 500c0 23-19 42-41 42H208C185 542 167 523 167 500z m0 208c0-23 19-42 41-41h584C815 667 833 685 833 708c0 23-19 42-41 42H208C185 750 167 732 167 708z"></path></g>\n<g id="minus"><path d="M261 461c-22 0-39 18-39 39 0 22 18 39 39 39h478c22 0 39-18 39-39 0-22-18-39-39-39H261z"></path></g>\n<g id="ordered-list"><path d="M138 333V198H136l-43 28v-38l45-31h45V333H138z m-61 128c0-35 27-59 68-59 39 0 66 21 66 53 0 20-11 37-43 64l-29 27v2h74V583H80v-30l55-52c26-24 32-33 33-43 0-13-10-22-24-22-15 0-26 10-26 25v1h-41v-1zM123 759v-31h21c15 0 25-8 25-21 0-13-10-21-25-21-15 0-26 9-26 23h-41c1-34 27-56 68-57 39 0 66 20 66 49 0 20-14 36-33 39v3c24 3 40 19 39 41 0 32-30 54-73 54-41 0-69-22-70-57h43c1 13 11 22 28 22 16 0 27-9 27-22 0-14-10-22-28-22h-21zM333 258c0-18 15-33 34-33h516c18 0 33 15 34 33 0 18-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z"></path></g>\n<g id="phone"><path d="M296 208l42-37c17-15 44-13 58 4a42 42 0 0 1 5 7L459 282c12 20 5 45-15 57l-7 4c-17 10-25 30-19 48l20 66a420 420 0 0 0 93 157l41 45c13 14 35 17 51 8l7-5c20-12 45-5 57 16L745 777c12 20 5 45-15 57a42 42 0 0 1-8 4l-52 17c-61 21-129 4-174-43l-50-52c-81-85-141-189-175-302l-24-78c-19-62 0-129 49-172z"></path></g>\n<g id="photo"><path d="M208 167h584c69 0 125 56 125 125v416c0 69-56 125-125 125H208c-69 0-125-56-125-125V292c0-69 56-125 125-125z m584 75H208c-28 0-50 22-50 50v416c0 28 22 50 50 50h584c28 0 50-22 50-50V292c0-28-22-50-50-50zM239 740l167-167c12-12 31-14 45-6l73 43 172-201c13-15 34-18 50-7l95 67v92l-111-78-169 199c-12 14-32 17-47 8l-76-43-111 111H229c2-7 5-13 10-18zM458 427C458 490 407 542 344 542S229 490 229 427c0-63 51-115 115-115S458 364 458 427z m-62 0C396 398 373 375 344 375S292 398 292 427c0 29 23 52 52 52s52-23 52-52z"></path></g>\n<g id="play"><path d="M689 528l-298 175c-13 8-34 8-48 0-6-4-10-9-10-14V311C333 300 348 292 367 292c9 0 17 2 24 5l298 175c26 15 26 40 0 56z"></path></g>\n<g id="plus"><path d="M461 461H261c-22 0-39 18-39 39 0 22 18 39 39 39h200v200c0 22 18 39 39 39 22 0 39-18 39-39v-200h200c22 0 39-18 39-39 0-22-18-39-39-39h-200V261c0-22-18-39-39-39-22 0-39 18-39 39v200z"></path></g>\n<g id="redo"><path d="M290 614C312 523 393 458 491 458c55 0 106 22 144 57l-88 88c-3 3-5 7-5 11 0 8 6 15 15 15l193-5c17 0 31-15 31-32l5-192c0-4-1-8-4-11-6-6-16-6-22 0l-66 67C641 406 570 375 491 375c-136 0-248 90-281 215-1 2-1 5-1 8-8 44 45 68 73 32 4-5 7-11 8-16z"></path></g>\n<g id="reload"><path d="M500 233V137c0-9 7-16 15-16 4 0 8 2 10 4l133 140c12 12 12 32 0 45l-133 140c-6 6-15 6-21 0C502 447 500 443 500 438V308c-117 0-212 95-212 213 0 117 95 212 212 212 117 0 212-95 212-212 0-21 17-38 38-38s38 17 37 38c0 159-129 288-287 287-159 0-288-129-288-287 0-159 129-288 288-288z"></path></g>\n<g id="search"><path d="M662 603l131 131c16 16 16 42 0 59-16 16-43 16-59 0l-131-131C562 691 512 708 458 708c-138 0-250-112-250-250 0-138 112-250 250-250 138 0 250 112 250 250 0 54-17 104-46 145zM458 646c104 0 188-84 188-188S562 271 458 271 271 355 271 458s84 188 187 188z"></path></g>\n<g id="undo"><path d="M710 614C688 523 607 458 509 458c-55 0-106 22-144 57l88 88c3 3 5 7 5 11 0 8-6 15-15 15l-193-5c-17 0-31-15-31-32L214 400c0-4 1-8 4-11 6-6 16-6 22 0l66 67C359 406 430 375 509 375c136 0 248 90 281 215 1 2 1 5 1 8 8 44-45 68-73 32-4-5-7-11-8-16z"></path></g>\n<g id="unordered-list"><path d="M146 325c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63z m0 250c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63z m0 250c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63zM333 258c0-18 15-33 34-33h516c18 0 33 15 34 33 0 18-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z"></path></g>\n<g id="upload"><path d="M454 271V604c0 21-17 38-37 38s-38-17-38-38V271L254 382c-15 14-39 12-53-3-14-15-12-39 3-53L391 160c14-13 36-13 51-1 0 0 0 0 0 1l187 166c15 14 17 37 3 53-14 15-37 17-53 3L454 271zM675 704c0-21 17-38 37-37 21 0 38 17 38 37v92c0 21-17 38-38 37H121c-21 0-38-17-38-37v-92c0-21 17-38 38-37s38 17 37 37v54h517v-54z"></path></g>\n<g id="user"><path d="M500 500c-69 0-125-56-125-125s56-125 125-125 125 56 125 125-56 125-125 125z m-292 292c0-115 131-208 292-209s292 93 292 209H208z"></path></g>\n</defs>\n</svg>\n</iron-iconset-svg>',document.head.appendChild(c.content);
|
|
1
|
+
import"./shared-df573cea.js";import"./shared-46ee137f.js";const c=document.createElement("template");c.innerHTML='<iron-iconset-svg size="1000" name="lumo">\n<svg xmlns="http://www.w3.org/2000/svg">\n<defs>\n<g id="angle-down"><path d="M283 391c-18-16-46-15-63 4-16 18-15 46 3 63l244 224c17 15 43 15 60 0l250-229c18-16 20-45 3-63-16-18-45-20-63-4l-220 203-214-198z"></path></g>\n<g id="angle-left"><path d="M601 710c16 18 15 46-3 63-18 16-46 15-63-4l-224-244c-15-17-15-43 0-59l229-250c16-18 45-20 63-4 18 16 20 45 3 63l-203 220 198 215z"></path></g>\n<g id="angle-right"><path d="M399 275c-16-18-15-46 3-63 18-16 46-15 63 4l224 244c15 17 15 43 0 59l-229 250c-16 18-45 20-63 4-18-16-20-45-3-63l203-220-198-215z"></path></g>\n<g id="angle-up"><path d="M283 635c-18 16-46 15-63-3-16-18-15-46 3-63l244-224c17-15 43-15 60 0l250 229c18 16 20 45 3 63-16 18-45 20-63 3l-220-202L283 635z"></path></g>\n<g id="arrow-down"><path d="M538 646l125-112c15-14 39-12 53 4 14 15 12 39-4 53l-187 166c0 0 0 0 0 0-14 13-36 12-50 0l-187-166c-15-14-17-37-4-53 14-15 37-17 53-4L462 646V312c0-21 17-38 38-37s38 17 37 37v334z"></path></g>\n<g id="arrow-left"><path d="M375 538l111 125c14 15 12 39-3 53-15 14-39 12-53-4l-166-187c0 0 0 0 0 0-13-14-12-36 0-50l166-187c14-15 37-17 53-4 15 14 17 37 3 53L375 463h333c21 0 38 17 38 37 0 21-17 38-38 38h-333z"></path></g>\n<g id="arrow-right"><path d="M625 538h-333c-21 0-38-17-38-38 0-21 17-38 38-37h333l-111-126c-14-15-12-39 3-53 15-14 39-12 53 4l166 187c13 14 13 36 0 50 0 0 0 0 0 0l-166 187c-14 15-37 17-53 4-15-14-17-37-3-53l111-125z"></path></g>\n<g id="arrow-up"><path d="M538 354V688c0 21-17 38-38 37s-38-17-38-38V354l-125 112c-15 14-39 12-53-4-14-15-12-39 4-53l187-166c14-13 36-13 50 0 0 0 0 0 0 0l187 166c15 14 17 37 4 53-14 15-37 17-53 4L538 354z"></path></g>\n<g id="bar-chart"><path d="M175 500h108c28 0 50 22 50 50v233c0 28-22 50-50 50H175c-28 0-50-22-50-50v-233c0-28 22-50 50-50z m33 67c-9 0-17 7-16 16v167c0 9 7 17 16 17h42c9 0 17-7 17-17v-167c0-9-7-17-17-16H208zM446 167h108c28 0 50 22 50 50v566c0 28-22 50-50 50h-108c-28 0-50-22-50-50V217c0-28 22-50 50-50z m33 66c-9 0-17 7-17 17v500c0 9 7 17 17 17h42c9 0 17-7 16-17V250c0-9-7-17-16-17h-42zM717 333h108c28 0 50 22 50 50v400c0 28-22 50-50 50h-108c-28 0-50-22-50-50V383c0-28 22-50 50-50z m33 67c-9 0-17 7-17 17v333c0 9 7 17 17 17h42c9 0 17-7 16-17v-333c0-9-7-17-16-17h-42z"></path></g>\n<g id="bell"><path d="M367 675H292v-258C292 325 366 250 459 250H458V208c0-23 18-42 42-41 23 0 42 18 42 41v42h-1C634 250 708 325 708 417V675h-75v-258c0-51-41-92-91-92h-84C408 325 367 366 367 417V675z m-159 37c0-21 17-38 38-37h508c21 0 37 17 38 37 0 21-17 38-38 38H246C225 750 208 733 208 713z m230 71h125v32c0 17-14 31-32 31h-62c-17 0-32-14-31-31v-32z"></path></g>\n<g id="calendar"><path d="M375 208h250v-20C625 176 634 167 646 167h41C699 167 708 176 708 188V208h74c23 0 41 19 41 42v42C823 315 804 333 782 333H218C196 333 177 315 177 292V250C177 227 196 208 218 208H292v-20C292 176 301 167 313 167h41C366 167 375 176 375 188V208zM229 375h42C283 375 292 384 292 396v41C292 449 282 458 271 458h-42C217 458 208 449 208 437v-41C208 384 218 375 229 375z m125 0h42C408 375 417 384 417 396v41C417 449 407 458 396 458h-42C342 458 333 449 333 437v-41C333 384 343 375 354 375z m125 0h42C533 375 542 384 542 396v41C542 449 532 458 521 458h-42C467 458 458 449 458 437v-41C458 384 468 375 479 375z m-250 125h42C283 500 292 509 292 521v41C292 574 282 583 271 583h-42C217 583 208 574 208 562v-41C208 509 218 500 229 500z m125 0h42C408 500 417 509 417 521v41C417 574 407 583 396 583h-42C342 583 333 574 333 562v-41C333 509 343 500 354 500z m125 0h42c12 0 21 9 21 21v41C542 574 532 583 521 583h-42C467 583 458 574 458 562v-41C458 509 468 500 479 500z m-250 125h42C283 625 292 634 292 646v41C292 699 282 708 271 708h-42C217 708 208 699 208 687v-41C208 634 218 625 229 625z m125 0h42C408 625 417 634 417 646v41C417 699 407 708 396 708h-42C342 708 333 699 333 687v-41C333 634 343 625 354 625z m125 0h42c12 0 21 9 21 21v41C542 699 532 708 521 708h-42C467 708 458 699 458 687v-41C458 634 468 625 479 625z m125-250h42C658 375 667 384 667 396v41C667 449 657 458 646 458h-42C592 458 583 449 583 437v-41C583 384 593 375 604 375z m0 125h42c12 0 21 9 21 21v41C667 574 657 583 646 583h-42C592 583 583 574 583 562v-41C583 509 593 500 604 500z m0 125h42c12 0 21 9 21 21v41C667 699 657 708 646 708h-42C592 708 583 699 583 687v-41C583 634 593 625 604 625z m125 0h42c12 0 21 9 21 21v41C792 699 782 708 771 708h-42C717 708 708 699 708 687v-41C708 634 718 625 729 625z m-500 125h42C283 750 292 759 292 771v41C292 824 282 833 271 833h-42C217 833 208 824 208 812v-41C208 759 218 750 229 750z m125 0h42C408 750 417 759 417 771v41C417 824 407 833 396 833h-42C342 833 333 824 333 812v-41C333 759 343 750 354 750z m125 0h42c12 0 21 9 21 21v41C542 824 532 833 521 833h-42C467 833 458 824 458 812v-41C458 759 468 750 479 750z m125 0h42c12 0 21 9 21 21v41C667 824 657 833 646 833h-42C592 833 583 824 583 812v-41C583 759 593 750 604 750z m125 0h42c12 0 21 9 21 21v41C792 824 782 833 771 833h-42C717 833 708 824 708 812v-41C708 759 718 750 729 750z m0-250h42c12 0 21 9 21 21v41C792 574 782 583 771 583h-42C717 583 708 574 708 562v-41C708 509 718 500 729 500z m0-125h42C783 375 792 384 792 396v41C792 449 782 458 771 458h-42C717 458 708 449 708 437v-41C708 384 718 375 729 375z"></path></g>\n<g id="checkmark"><path d="M318 493c-15-15-38-15-53 0-15 15-15 38 0 53l136 136c15 15 38 15 53 0l323-322c15-15 15-38 0-53-15-15-38-15-54 0l-295 296-110-110z"></path></g>\n<g id="chevron-down"><path d="M533 654l210-199c9-9 9-23 0-32C739 419 733 417 726 417H274C261 417 250 427 250 439c0 6 2 12 7 16l210 199c18 17 48 17 66 0z"></path></g>\n<g id="chevron-left"><path d="M346 533l199 210c9 9 23 9 32 0 4-4 7-10 6-17V274C583 261 573 250 561 250c-6 0-12 2-16 7l-199 210c-17 18-17 48 0 66z"></path></g>\n<g id="chevron-right"><path d="M654 533L455 743c-9 9-23 9-32 0C419 739 417 733 417 726V274C417 261 427 250 439 250c6 0 12 2 16 7l199 210c17 18 17 48 0 66z"></path></g>\n<g id="chevron-up"><path d="M533 346l210 199c9 9 9 23 0 32-4 4-10 7-17 6H274C261 583 250 573 250 561c0-6 2-12 7-16l210-199c18-17 48-17 66 0z"></path></g>\n<g id="clock"><path d="M538 489l85 85c15 15 15 38 0 53-15 15-38 15-53 0l-93-93a38 38 0 0 1-2-2C467 525 462 515 462 504V308c0-21 17-38 38-37 21 0 38 17 37 37v181zM500 833c-184 0-333-149-333-333s149-333 333-333 333 149 333 333-149 333-333 333z m0-68c146 0 265-118 265-265 0-146-118-265-265-265-146 0-265 118-265 265 0 146 118 265 265 265z"></path></g>\n<g id="cog"><path d="M833 458l-81-18c-8-25-17-50-29-75L767 292 708 233l-72 49c-21-12-46-25-75-30L542 167h-84l-19 79c-25 8-50 17-71 30L296 233 233 296l47 69c-12 21-21 46-29 71L167 458v84l84 25c8 25 17 50 29 75L233 708 292 767l76-44c21 12 46 25 75 29L458 833h84l19-81c25-8 50-17 75-29L708 767l59-59-44-66c12-21 25-46 29-75L833 542v-84z m-333 217c-96 0-175-79-175-175 0-96 79-175 175-175 96 0 175 79 175 175 0 96-79 175-175 175z"></path></g>\n<g id="cross"><path d="M445 500l-142-141c-15-15-15-40 0-56 15-15 40-15 56 0L500 445l141-142c15-15 40-15 56 0 15 15 15 40 0 56L555 500l142 141c15 15 15 40 0 56-15 15-40 15-56 0L500 555l-141 142c-15 15-40 15-56 0-15-15-15-40 0-56L445 500z"></path></g>\n<g id="download"><path d="M538 521l125-112c15-14 39-12 53 4 14 15 12 39-4 53l-187 166a38 38 0 0 1 0 0c-14 13-36 12-50 0l-187-166c-15-14-17-37-4-53 14-15 37-17 53-4L462 521V188c0-21 17-38 38-38s38 17 37 38v333zM758 704c0-21 17-38 38-37 21 0 38 17 37 37v92c0 21-17 38-37 37H204c-21 0-38-17-37-37v-92c0-21 17-38 37-37s38 17 38 37v54h516v-54z"></path></g>\n<g id="dropdown"><path d="M317 393c-15-14-39-13-53 3-14 15-13 39 3 53l206 189c14 13 36 13 50 0l210-193c15-14 17-38 3-53-14-15-38-17-53-3l-185 171L317 393z"></path></g>\n<g id="edit"><path d="M673 281l62 56-205 233c-9 10-38 24-85 39a8 8 0 0 1-5 0c-4-1-7-6-6-10l0 0c14-47 25-76 35-86l204-232z m37-42l52-59c15-17 41-18 58-2 17 16 18 42 3 59L772 295l-62-56zM626 208l-67 75h-226C305 283 283 306 283 333v334C283 695 306 717 333 717h334c28 0 50-22 50-50v-185L792 398v269C792 736 736 792 667 792H333C264 792 208 736 208 667V333C208 264 264 208 333 208h293z"></path></g>\n<g id="error"><path d="M500 833c-184 0-333-149-333-333s149-333 333-333 333 149 333 333-149 333-333 333z m0-68c146 0 265-118 265-265 0-146-118-265-265-265-146 0-265 118-265 265 0 146 118 265 265 265zM479 292h42c12 0 21 9 20 20l-11 217c0 8-6 13-13 13h-34c-7 0-13-6-13-13l-11-217C459 301 468 292 479 292zM483 608h34c12 0 21 9 20 21v33c0 12-9 21-20 21h-34c-12 0-21-9-21-21v-33c0-12 9-21 21-21z"></path></g>\n<g id="eye"><path d="M500 750c-187 0-417-163-417-250s230-250 417-250 417 163 417 250-230 250-417 250z m-336-231c20 22 47 46 78 69C322 644 411 678 500 678s178-34 258-90c31-22 59-46 78-69 6-7 12-14 16-19-4-6-9-12-16-19-20-22-47-46-78-69C678 356 589 322 500 322s-178 34-258 90c-31 22-59 46-78 69-6 7-12 14-16 19 4 6 9 12 16 19zM500 646c-81 0-146-65-146-146s65-146 146-146 146 65 146 146-65 146-146 146z m0-75c39 0 71-32 71-71 0-39-32-71-71-71-39 0-71 32-71 71 0 39 32 71 71 71z"></path></g>\n<g id="eye-disabled"><path d="M396 735l60-60c15 2 30 3 44 3 89 0 178-34 258-90 31-22 59-46 78-69 6-7 12-14 16-19-4-6-9-12-16-19-20-22-47-46-78-69-8-5-15-11-23-15l50-51C862 397 917 458 917 500c0 87-230 250-417 250-34 0-69-5-104-15zM215 654C138 603 83 542 83 500c0-87 230-250 417-250 34 0 69 5 104 15l-59 60c-15-2-30-3-45-3-89 0-178 34-258 90-31 22-59 46-78 69-6 7-12 14-16 19 4 6 9 12 16 19 20 22 47 46 78 69 8 5 16 11 24 16L215 654z m271-9l159-159c0 5 1 9 1 14 0 81-65 146-146 146-5 0-9 0-14-1z m-131-131C354 510 354 505 354 500c0-81 65-146 146-146 5 0 10 0 14 1l-159 159z m-167 257L780 179c12-12 32-12 44 0 12 12 12 32 0 44L232 815c-12 12-32 12-44 0s-12-32 0-44z"></path></g>\n<g id="menu"><path d="M167 292c0-23 19-42 41-42h584C815 250 833 268 833 292c0 23-19 42-41 41H208C185 333 167 315 167 292z m0 208c0-23 19-42 41-42h584C815 458 833 477 833 500c0 23-19 42-41 42H208C185 542 167 523 167 500z m0 208c0-23 19-42 41-41h584C815 667 833 685 833 708c0 23-19 42-41 42H208C185 750 167 732 167 708z"></path></g>\n<g id="minus"><path d="M261 461c-22 0-39 18-39 39 0 22 18 39 39 39h478c22 0 39-18 39-39 0-22-18-39-39-39H261z"></path></g>\n<g id="ordered-list"><path d="M138 333V198H136l-43 28v-38l45-31h45V333H138z m-61 128c0-35 27-59 68-59 39 0 66 21 66 53 0 20-11 37-43 64l-29 27v2h74V583H80v-30l55-52c26-24 32-33 33-43 0-13-10-22-24-22-15 0-26 10-26 25v1h-41v-1zM123 759v-31h21c15 0 25-8 25-21 0-13-10-21-25-21-15 0-26 9-26 23h-41c1-34 27-56 68-57 39 0 66 20 66 49 0 20-14 36-33 39v3c24 3 40 19 39 41 0 32-30 54-73 54-41 0-69-22-70-57h43c1 13 11 22 28 22 16 0 27-9 27-22 0-14-10-22-28-22h-21zM333 258c0-18 15-33 34-33h516c18 0 33 15 34 33 0 18-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z"></path></g>\n<g id="phone"><path d="M296 208l42-37c17-15 44-13 58 4a42 42 0 0 1 5 7L459 282c12 20 5 45-15 57l-7 4c-17 10-25 30-19 48l20 66a420 420 0 0 0 93 157l41 45c13 14 35 17 51 8l7-5c20-12 45-5 57 16L745 777c12 20 5 45-15 57a42 42 0 0 1-8 4l-52 17c-61 21-129 4-174-43l-50-52c-81-85-141-189-175-302l-24-78c-19-62 0-129 49-172z"></path></g>\n<g id="photo"><path d="M208 167h584c69 0 125 56 125 125v416c0 69-56 125-125 125H208c-69 0-125-56-125-125V292c0-69 56-125 125-125z m584 75H208c-28 0-50 22-50 50v416c0 28 22 50 50 50h584c28 0 50-22 50-50V292c0-28-22-50-50-50zM239 740l167-167c12-12 31-14 45-6l73 43 172-201c13-15 34-18 50-7l95 67v92l-111-78-169 199c-12 14-32 17-47 8l-76-43-111 111H229c2-7 5-13 10-18zM458 427C458 490 407 542 344 542S229 490 229 427c0-63 51-115 115-115S458 364 458 427z m-62 0C396 398 373 375 344 375S292 398 292 427c0 29 23 52 52 52s52-23 52-52z"></path></g>\n<g id="play"><path d="M689 528l-298 175c-13 8-34 8-48 0-6-4-10-9-10-14V311C333 300 348 292 367 292c9 0 17 2 24 5l298 175c26 15 26 40 0 56z"></path></g>\n<g id="plus"><path d="M461 461H261c-22 0-39 18-39 39 0 22 18 39 39 39h200v200c0 22 18 39 39 39 22 0 39-18 39-39v-200h200c22 0 39-18 39-39 0-22-18-39-39-39h-200V261c0-22-18-39-39-39-22 0-39 18-39 39v200z"></path></g>\n<g id="redo"><path d="M290 614C312 523 393 458 491 458c55 0 106 22 144 57l-88 88c-3 3-5 7-5 11 0 8 6 15 15 15l193-5c17 0 31-15 31-32l5-192c0-4-1-8-4-11-6-6-16-6-22 0l-66 67C641 406 570 375 491 375c-136 0-248 90-281 215-1 2-1 5-1 8-8 44 45 68 73 32 4-5 7-11 8-16z"></path></g>\n<g id="reload"><path d="M500 233V137c0-9 7-16 15-16 4 0 8 2 10 4l133 140c12 12 12 32 0 45l-133 140c-6 6-15 6-21 0C502 447 500 443 500 438V308c-117 0-212 95-212 213 0 117 95 212 212 212 117 0 212-95 212-212 0-21 17-38 38-38s38 17 37 38c0 159-129 288-287 287-159 0-288-129-288-287 0-159 129-288 288-288z"></path></g>\n<g id="search"><path d="M662 603l131 131c16 16 16 42 0 59-16 16-43 16-59 0l-131-131C562 691 512 708 458 708c-138 0-250-112-250-250 0-138 112-250 250-250 138 0 250 112 250 250 0 54-17 104-46 145zM458 646c104 0 188-84 188-188S562 271 458 271 271 355 271 458s84 188 187 188z"></path></g>\n<g id="undo"><path d="M710 614C688 523 607 458 509 458c-55 0-106 22-144 57l88 88c3 3 5 7 5 11 0 8-6 15-15 15l-193-5c-17 0-31-15-31-32L214 400c0-4 1-8 4-11 6-6 16-6 22 0l66 67C359 406 430 375 509 375c136 0 248 90 281 215 1 2 1 5 1 8 8 44-45 68-73 32-4-5-7-11-8-16z"></path></g>\n<g id="unordered-list"><path d="M146 325c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63z m0 250c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63z m0 250c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63zM333 258c0-18 15-33 34-33h516c18 0 33 15 34 33 0 18-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z"></path></g>\n<g id="upload"><path d="M454 271V604c0 21-17 38-37 38s-38-17-38-38V271L254 382c-15 14-39 12-53-3-14-15-12-39 3-53L391 160c14-13 36-13 51-1 0 0 0 0 0 1l187 166c15 14 17 37 3 53-14 15-37 17-53 3L454 271zM675 704c0-21 17-38 37-37 21 0 38 17 38 37v92c0 21-17 38-38 37H121c-21 0-38-17-38-37v-92c0-21 17-38 38-37s38 17 37 37v54h517v-54z"></path></g>\n<g id="user"><path d="M500 500c-69 0-125-56-125-125s56-125 125-125 125 56 125 125-56 125-125 125z m-292 292c0-115 131-208 292-209s292 93 292 209H208z"></path></g>\n</defs>\n</svg>\n</iron-iconset-svg>',document.head.appendChild(c.content);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L as t,_ as e,j as i,h as s}from"./shared-63eaded9.js";import"./shared-0ced76a0.js";import{p as r}from"./shared-87ca7818.js";import"./shared-46ee137f.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import{b as a,S as n,c as o}from"./shared-d01035c5.js";import"./shared-31d03530.js";import"./shared-4ba926ca.js";import{I as c,D as l}from"./shared-a3d2c48e.js";import{E as d}from"./shared-5d94bacb.js";import"./shared-ec861f31.js";import"./shared-bb824ab4.js";import"./foxy-i18n.js";import"./shared-60126eee.js";import{s as h}from"./shared-b0f0e8b5.js";class u extends CustomEvent{constructor(t){super("change",{detail:t})}}class m extends CustomEvent{constructor(t){super("submit",{detail:t,cancelable:!0})}}let _,p,g=t=>t;var y;!function(t){t[t.Excluded=0]="Excluded",t[t.BeforeEnter=1]="BeforeEnter",t[t.Default=2]="Default",t[t.Previous=3]="Previous",t[t.BeforeExit=4]="BeforeExit"}(y||(y={}));class f extends t{constructor(){super(...arguments),this.quantity=0,this.image=""}static get properties(){return e(e({},super.properties),{},{quantity:{attribute:!1},image:{attribute:!1}})}static get styles(){return[a.styles,i(_||(_=g`.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.blur-1{filter:blur(1px)}.blur-2{filter:blur(2px)}.grayscale{filter:grayscale()}.rotate-12{--tw-rotate:12deg}.-rotate-12{--tw-rotate:-12deg}.-rotate-24{--tw-rotate:-24deg}.translate-y-half{--tw-translate-y:50%}`))]}set empty(t){this.updateComplete.then((()=>{if(t){const[,...t]=this.__stack;t.forEach((t=>t.remove()))}else this.quantity>1&&this.__stack.length<2&&this.__insertImage(y.Previous,this.__stack[0])}))}set data({quantity:t,image:e}){this.quantity=t,this.image=e}render(){return s(p||(p=g`<div id="image" class="w-full h-full relative"></div>`))}firstUpdated(){const t=this.__insertImage(y.Default);this.quantity>1&&this.__insertImage(y.Previous,t)}updated(t){if(t.has("quantity")){const e=t.get("quantity");void 0!==e&&(this.quantity>e?this.__add():this.__remove())}t.has("image")&&this.__stack.forEach((t=>t.src=this.image))}get __container(){return this.shadowRoot.getElementById("image")}get __stack(){var t,e;return[...null!==(e=null===(t=this.__container)||void 0===t?void 0:t.querySelectorAll(":not(.opacity-0)"))&&void 0!==e?e:[]].reverse()}__add(){const[t,e]=this.__stack;this.quantity>1?(t&&this.__setImageState(t,y.Previous),e&&(this.__setImageState(e,y.BeforeExit),e.ontransitionend=()=>e.remove()),this.__setImageState(this.__insertImage(y.BeforeEnter),y.Default)):t&&this.__setImageState(t,y.Default)}__remove(){const[t,e]=this.__stack;let i;if(this.quantity>0?(e&&this.__setImageState(e,y.Default),i=t):(t&&this.__setImageState(t,y.Excluded),i=e),i&&(this.__setImageState(i,y.BeforeEnter),i.ontransitionend=()=>i.remove()),this.quantity>1){const t=this.__insertImage(y.BeforeExit,this.__container.firstElementChild);this.__setImageState(t,y.Previous)}}__insertImage(t,e=null){const i=new Image;return i.src=this.image,i.setAttribute("part","picture"),this.__setImageState(i,t),this.__container.insertBefore(i,e),i}__setImageState(t,e){t.offsetHeight,t.className=["absolute inset-0 w-full h-full object-cover rounded transform transition duration-700 ease-out-back",["grayscale","shadow-m translate-y-half scale-110 rotate-12 opacity-0","shadow-m","blur-1 -rotate-12 opacity-25","blur-2 -rotate-24 opacity-0"][e]].join(" ")}}let v,b,w,x,q,I,$,E,S=t=>t;class D extends(n(t)){constructor(){super(...arguments),this.empty=!1,this.data=[]}static get properties(){return e(e({},super.properties),{},{empty:{attribute:!1},data:{attribute:!1}})}static get styles(){return[a.styles,i(v||(v=S`.w-preview{width:5.5rem}.h-preview{height:5.5rem}.ease-out-back{transition-timing-function:cubic-bezier(.34,1.56,.64,1)}.grayscale{filter:grayscale()}.grid-2>:nth-child(1),.grid-3>:nth-child(1),.grid-4-plus>:nth-child(1),.grid-4>:nth-child(1){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(2){opacity:0;--tw-translate-x:100%;--tw-translate-y:var(--tw-translate-x)}.grid-2>:nth-child(2),.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(2),.grid-4-plus>:nth-child(2),.grid-4>:nth-child(2){transform-origin:top right}.grid-1>:nth-child(3),.grid-2>:nth-child(3),.grid-3>:nth-child(3),.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(3),.grid-2>:nth-child(3){opacity:0;--tw-translate-y:100%}.grid-3>:nth-child(3){transform-origin:bottom right}.grid-4-plus>:nth-child(3),.grid-4>:nth-child(3){transform-origin:bottom left}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4),.grid-4-plus>:nth-child(4),.grid-4>:nth-child(4){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-1>:nth-child(4),.grid-2>:nth-child(4),.grid-3>:nth-child(4){opacity:0;transform-origin:bottom left;--tw-translate-x:100%}.grid-1>:nth-child(4)>:first-child,.grid-2>:nth-child(4)>:first-child,.grid-3>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:first-child{transform:perspective(250px) rotateX(-90deg)}.grid-4-plus>:nth-child(4)>:first-child,.grid-4>:nth-child(4)>:last-child{transition-delay:.15s;transition-timing-function:ease-out}.grid-4-plus>:nth-child(4)>:last-child,.grid-4>:nth-child(4)>:first-child{transition-timing-function:ease-in}.grid-4-plus>:nth-child(4)>:last-child{transform:perspective(250px) rotateX(90deg)}.grid-1>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){opacity:0}.grid-1>:nth-child(5){--tw-translate-x:100%}.grid-2>:nth-child(5),.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-3>:nth-child(5),.grid-4-plus>:nth-child(5),.grid-4>:nth-child(5){--tw-translate-y:-100%}.grid-1>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){opacity:0}.grid-1>:nth-child(6){--tw-translate-y:100%}.grid-2>:nth-child(6),.grid-3>:nth-child(6),.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-scale-x:calc(2.5 / 5.5);--tw-scale-y:var(--tw-scale-x)}.grid-4-plus>:nth-child(6),.grid-4>:nth-child(6){--tw-translate-x:-100%}`))]}render(){const t=this.data.length,e="rounded bg-contrast-10",i="transition-all duration-700 ease-out-back transform absolute inset-0",r=this.empty?"grayscale":"",a=t>4?"grid-4-plus":`grid-${Math.max(1,t)}`,n=h({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,c,l,d]=this.data;return s(b||(b=S` <div class="${0} w-preview h-preview relative font-lumo"> <div class="${0} ${0} origin-top-left"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> ${0} </div> <div class="${0} ${0} origin-top-right"> ${0} </div> <div class="${0} ${0} origin-bottom-right"> <div class="${0} flex text-body transition duration-150 absolute inset-0"> ${0} </div> <div class="transition duration-150 absolute inset-0"> ${0} </div> </div> <div class="${0} ${0} origin-top-right"></div> <div class="${0} ${0} origin-bottom-left"></div> </div> `),a,i,r,o?s(w||(w=S`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,c?s(x||(x=S`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,c):"",i,r,l?s(q||(q=S`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,e,t>102?s(I||(I=S`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s($||($=S`<div class="m-auto text-xxxl">+${0}</div>`),t-3),d?s(E||(E=S`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,d):"",i,e,i,e)}}let k,C,A=t=>t;class N extends D{static get scopedElements(){return{"x-pic":f}}}class P extends D{static get scopedElements(){return{"x-pic":N}}}class j extends(n(t)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":f,"x-bundle-grid":P}}static get properties(){return{quantity:{attribute:!1},image:{attribute:!1},items:{attribute:!1}}}static get styles(){return a.styles}render(){const{quantity:t,image:e=""}=this,i=0===t,r=h({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(k||(k=A`<x-picture ...="${0}" .data="${0}"></x-picture>`),r,{quantity:t,image:e});{const e=new Array(Math.max(1,t)).fill(this.items);return s(C||(C=A`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class F extends o{static get properties(){return e(e({},super.properties),{},{open:{type:Object},signatures:{type:Object,converter:t=>{const e=JSON.parse(t);for(const t of Object.keys(e))64!=e[t].length&&console.error("There is something wrong with the signature. It should have 64 characters.");return e}}})}signedName(t){return this.signatures&&this.signatures[t]?`${t}||${this.signatures[t]}${this.isOpen(t)?"||open":""}`:t}isOpen(t){return!(!this.open||!this.open[t])}}let T,O,B,L,R,z,V,M=t=>t;class Q extends F{constructor(){super("items-form"),this.rel="product_item",this.readonly=!1,this.quantity=0,this.total=this.__computeTotalPrice(),this.currency="",this.isItem=!0,this.isChildItem=!1,this.pid=Q.__newId(),this.__modified=!1,this.__childPrices=[],this.__images=[],this.__childrenCount=0,this.__itemDescription="",this.__handleQuantity={handleEvent:t=>{const e=Number(t.target.value);this.quantity=e,this.__modified=!0,this.__images=[this.getImageDescription()].concat(this.__images.slice(1,this.__images.length))}},this.__childItemsObserver=new MutationObserver(this.__observeItems.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__setCode(),this.__acknowledgeChildItems(),this.__changedChildItem(),this.__isValid()||console.error("Invalid item",this.value)}))}static get styles(){return[super.styles,i(T||(T=M`:host{--quantity-width:6.5rem;--preview-size:5.5rem;--threshold:20rem}.min-w-description::before{content:'';width:var(--threshold);display:block;overflow:hidden}.ml-description{--min-width:calc(var(--threshold) + var(--preview-size) + var(--lumo-space-l));--free-space:calc(100% - var(--min-width));--max-margin-left:calc(var(--preview-size) + var(--lumo-space-l));--final-margin-left:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-left));margin-left:var(--final-margin-left)}.mr-quantity{--min-width:var(--threshold);--free-space:calc(100% - var(--min-width));--max-margin-right:calc(var(--quantity-width) + var(--lumo-space-l));--final-margin-right:clamp(0rem, var(--free-space) * 999999999, var(--max-margin-right));margin-right:var(--final-margin-right)}:host([data-bundled]:not(:last-of-type)) .separator::after{content:' ';display:block;position:absolute;width:100vw;border-bottom:solid thin var(--lumo-shade-10pct);left:0;bottom:0}.w-quantity{width:var(--quantity-width)}.w-preview{width:var(--preview-size)}.h-preview{height:var(--preview-size)}`))]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"x-error-screen":d,"x-preview":j,"x-i18n":c}}static get properties(){return e(e({},super.properties),{},{__modified:{},readonly:{type:Boolean,reflect:!0},currency:{type:String},category:{type:String},code:{type:String,reflect:!0},expires:{type:String},height:{type:Number},image:{type:String},length:{type:Number},name:{type:String},parent_code:{type:String},price:{type:Number},quantity:{type:Number,reflect:!0},quantity_max:{type:Number},quantity_min:{type:String},shipto:{type:String},total:{type:Number,reflect:!0,attribute:"total"},url:{type:String},value:{type:Object},weight:{type:Number},width:{type:Number},__childPrices:{},__childrenCount:{},__images:{},alt:{type:String},isChildItem:{type:Boolean,reflect:!0,attribute:"data-bundled"},isItem:{type:Boolean,reflect:!0,attribute:"data-item"},open:{type:Object},pid:{type:Number,reflect:!0},items:{type:Array}})}get items(){const t=[];return this.__onEachChildItem([e=>t.push(e.value)]),t}set items(t){this.__createItems(t)}get value(){const t={};for(let e=0;e<this.attributes.length;e++)t[this.attributes[e].name]=this.attributes[e].value;return t.items=this.items,t}set value(t){this.__itemDescription="";for(const e in t){let i="";if("description"!=e){if("object"==typeof t[e])i=JSON.stringify(t[e]);else{const s=e;(t[s]&&"undefined"!==t[s]||0===t[s])&&(i=t[e].toString())}this.setAttribute(e,t[e]?i:"")}else this.__itemDescription=t[e]}}updated(t){t.forEach(((t,e)=>{"__itemDescription"!=e&&"isChildItem"!=e||this.__updateDescriptionEl()})),this.__setTotalPrice(),this.dispatchEvent(new Event("change"))}render(){var t;if(!this.__isValid())return s(O||(O=M`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`));const e=`font-lumo text-body text-s leading-m transition duration-100 ${this.quantity?"":"removed opacity-50"}`;if(this.isChildItem)return s(B||(B=M` <article part="item" class="py-s w-full relative separator item-summary flex justify-between ${0}"> <div class="description flex-1"> <h1 class="text-header font-medium">${0}</h1> <section class="description text-secondary"> <slot></slot> </section> </div> ${0} </article> `),e,this.name,this.quantity<2?"":s(L||(L=M` <section class="quantity font-medium text-tertiary whitespace-nowrap"> ${0} </section> `),this._t("item.items",{quantity:this.quantity})));{const i=(null!==(t=this.price)&&void 0!==t?t:0)+this.__childPrices.reduce(((t,e)=>t+e),0),r=this.__translateAmount(i*this.quantity),a=this.__translateAmount(i);return s(R||(R=M` <article part="item" class="p-l relative item ${0} ${0}"> <x-preview class="preview float-left w-preview h-preview mr-l mb-l" exportparts="picture" .image="${0}" .quantity="${0}" .items="${0}"> </x-preview> <section class="description min-w-description ml-description"> <h1 class="text-header font-medium text-l leading-none mr-quantity mb-s"> ${0} </h1> <div class="item-description text-secondary mr-quantity mb-s"> <slot></slot> </div> <div class="child-items mb-s"> <slot name="items"></slot> </div> ${0} </section> <section class="quantity w-quantity absolute top-0 right-0 m-l"> <vaadin-integer-field class="w-full p-0" name="quantity" @change="${0}" value="${0}" min="0" has-controls ?readonly="${0}"> </vaadin-integer-field> ${0} </section> </article> `),e,this.__modified?"modified":"",this.image,this.quantity,[...this.querySelectorAll("[data-bundled]")].map((t=>{var e;return{quantity:t.quantity,image:null!==(e=t.image)&&void 0!==e?e:""}})),this.name,a?s(z||(z=M`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(V||(V=M` <x-i18n .ns="${0}" .lang="${0}" .opts="${0}" class="price-total text-secondary text-xs text-center block mt-xs" key="price.total"> </x-i18n> `),this.ns,this.lang,{amount:r}):"")}}getImageDescription(){return{src:this.image,alt:this.alt,quantity:this.quantity}}signedName(t){const e=super.signedName(t);return`${this.pid.toString()}:${e}`}static __newId(){const t=Q.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return Q.__existingIds.push(t),t}__updateDescriptionEl(){if(this.__itemDescription){let t=this.shadowRoot.querySelector("data-item-description");t||(t=document.createElement("p"),t.dataset.itemDescription="true",this.__addSlottedEl(t)),t.innerText=this.__itemDescription}else{const t=this.shadowRoot.querySelector("data-item-description");t&&t.remove()}}__addSlottedEl(t){const e=this.shadowRoot.querySelector("article");e&&e.appendChild(t)}__setCode(){this.code||(this.code=`RAND${Math.random()}`)}__createItems(t){t.forEach((t=>{const e=document.createElement(this.tagName);e.value=t,e.currency=this.currency,e.__computeTotalPrice(),this.__acknowledgeItem(e),this.appendChild(e)}))}__setTotalPrice(){this.total=this.__computeTotalPrice()}__computeTotalPrice(){if(!this.__childPrices)return this.price?this.price*this.quantity:0;let t=0;return this.__childPrices.forEach((e=>{t+=e})),t+=this.price,t*=this.quantity,t}__isValid(){const t=[];return this.name&&this.name.length||t.push("The name attribute of an item is required."),this.price||0===this.price||t.push("The price attribute of an item is required."),this.price&&this.price<0&&t.push("Item added with negative price."),this.quantity_min&&this.quantity&&this.quantity<this.quantity_min&&t.push("Quantity amount is less than minimum quantity."),this.quantity_max&&this.quantity&&this.quantity>this.quantity_max&&t.push("Quantity amount is more than maximum quantity."),console.error(...t),!t.length}__translateAmount(t){return this.currency?t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"}):""}__observeItems(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.nodeType===Node.DOCUMENT_NODE&&this.__acknowledgeItem(t)}))})),this.__setTotalPrice()}__acknowledgeChildItems(){var t;null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t))),this.querySelectorAll("[data-item]").forEach((t=>this.__acknowledgeItem(t)))}__acknowledgeItem(t){t.addEventListener("change",this.__changedChildItem.bind(this)),t.currency=this.currency,t.isItem=!1,t.isChildItem=!0,this.code&&(t.parent_code=this.code)}__changedChildItem(){const t=[],e=[];let i=0;this.__onEachChildItem([e=>{void 0!==e.total&&t.push(e.total)},t=>{e.push(t.getImageDescription())},()=>i+=1]),this.image&&0===e.length&&e.push(this.getImageDescription()),this.__childPrices=t,this.__images=e,this.__childrenCount=i,this.__setTotalPrice()}__onEachChildItem(t){const e=this.querySelectorAll("[data-bundled]");for(const i of e)for(const e of t)e(i)}}Q.__existingIds=[];let W,J,U,X,H,G,K=t=>t;class Y extends F{constructor(){super("items-form"),this.readonly=!1,this.target="_top",this.cart="checkout",this.sub_modify="replace",this.sub_restart="auto",this.frequencies=[],this.handleSubmit={handleEvent:()=>{null!==this.__data&&this.dispatchEvent(new m(this.__data))&&this.shadowRoot.querySelector("form").submit()}},this.__hasValidItems=!1,this.__total=0,this.__handleFrequency={handleEvent:t=>{const e=t.detail.replace(/([wydm])\w*/,"$1").replace(/ /g,"").replace(/^0/,"");Y.__validFrequency(e)?this.sub_frequency=e:this.sub_frequency="",this.__updateData()}},this.__data=new FormData,this.__childItemsObserver=new MutationObserver(this.__observeChildren.bind(this)),this.__childItemsObserver.observe(this,{childList:!0,attributes:!1,subtree:!0}),this.updateComplete.then((()=>{this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}))}static get scopedElements(){return{"x-error-screen":d,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":l,"x-item":Q}}static get properties(){return e(e({},super.properties),{},{currency:{type:String},readonly:{type:Boolean},cart:{type:String,converter:t=>t&&!["checkout","add"].includes(t)?null:t},target:{type:String},store:{type:String,attribute:"store"},sub_frequency:{type:String},sub_startdate:{type:String,converter:t=>Y.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>Y.__validDateFuture(t)?t:(console.error("Invalid end date",t),"")},sub_token:{type:String},sub_modify:{type:String,converter:t=>""===t||"append"===t?"":"replace"},sub_restart:{type:String,converter:t=>"true"===t?t:"auto"},frequencies:{converter:t=>{if(!t)return[];const e=JSON.parse(t);if(!Array.isArray(e))return console.error("Invalid frequency","Frequency options must be an array."),[];for(const t of e)if(!Y.__validFrequency(t))return console.error("Invalid frequency","Invalid frequency option.\n Please, check https://wiki.foxycart.com/v/2.0/products#subscription_product_options for possible values.\n Each frequency must be a in the format:\n - 1d (a number followed by d, for day)\n - 1w (a number followed by w, for week)\n - 1m (a number followed by m, for month)\n - 1y (a number followed by y, for year)\n or .5m (no other decimals are allowed, and this is only for months)\n ",t),[];return e.filter(Y.__validFrequency)}},items:{type:Array},__hasValidItems:{attribute:!1},__total:{attribute:!1},__data:{attribute:!1}})}get items(){const t=[];return this.__itemElements.forEach((e=>{const i=new Proxy(e,{set:function(t,e,i){const s=Object.keys(t.value);return!("string"!=typeof e||!s.includes(e))&&(t[e]=i,!0)},get:function(t,e){return t.value[e]}});t.push(i)})),t}set items(t){this.__removeItems(),this.__createItemsFromItemArray(t)}get total(){return this.__total}render(){var t;return this.store&&this.currency?s(J||(J=K` <div> <form class="overflow-hidden" method="POST" target="${0}" action="https://${0}/cart" data-testid="form" class="hidden" hidden> ${0} </form> <section class="items"> <slot></slot> </section> ${0} </div> `),this.target,this.store,this.__data?s(U||(U=K` ${0}`),[...this.__data.entries()].map((([t,e])=>s(X||(X=K`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(H||(H=K` <section class="actions flex flex-wrap justify-end m-m"> ${0} <vaadin-button class="m-s w-full sm-w-auto" theme="primary" data-testid="submit" ?disabled="${0}" @click="${0}"> <span class="total"> ${0} </span> </vaadin-button> </section> `),this.frequencies&&this.frequencies.length?s(G||(G=K` <x-dropdown type="text" name="frequency" class="subscription m-s w-full sm-w-auto" lang="${0}" .value="${0}" .items="${0}" .getText="${0}" @change="${0}"> </x-dropdown> `),this.lang,null!==(t=this.sub_frequency)&&void 0!==t?t:"0",this.frequencies.concat(["0"]),this.__translateFrequency.bind(this),this.__handleFrequency):"",!this.__hasValidItems,this.handleSubmit,this.__submitBtnText(this.__translateAmount(this.total)))):s(W||(W=K`<x-error-screen type="setup_needed" class="relative"></x-error-screen>`))}addItems(t){for(const e of t){const t=this.createItem(e);this.appendChild(t),this.__acknowledgeItemElement(t)}}removeItems(t){this.__removeItems((e=>t.includes(e.pid)))}updated(){this.dispatchEvent(new u(this.__data))}createItem(t){const e=this.constructor.getScopedTagName("x-item"),i=document.createElement(e);return i.value=t,i.currency=this.currency,i.readonly=this.readonly,i}__submitBtnText(t){if(this.sub_frequency&&"0"!=this.sub_frequency){const e=r(this.sub_frequency);return 1===e.count?this._t("checkout.subscribe_single_unit",{value:t,period:this._t(e.units).toLowerCase()}):this._t("checkout.subscribe_muiltiple_units",{value:t,period:this.__translateFrequency(this.sub_frequency).toLowerCase()})}return this._t("checkout.buy",{value:t})}get __itemElements(){return this.querySelectorAll("[data-item]")}__createItemsFromItemArray(t){this.addItems(t)}__removeItems(t=(()=>!0)){this.__itemElements.forEach((e=>{t(e)&&e.remove()}))}__addSignature(t,e,i){return`${t}||${e}${i?"||open":""}`}__formDataFill(t){let e=0;return this.__itemElements.forEach((i=>{e+=this.__formDataAddItem(t,i)})),this.__formDataAddCartWideSubscriptionFields(t),e}__formDataCustomInputs(t){this.querySelectorAll("[name]").forEach((e=>{const i=e;"INPUT"==i.tagName&&["checkbox","radio"].includes(i.type)&&!i.checked||"OPTION"!=i.tagName&&i.value&&["number","string"].includes(typeof i.value)&&t.set(i.name,i.value)}))}__isAttributeReserved(t){return["alt","currency","description","isChildren","isItem","items","open","pid","signatures","slot","total"].includes(t)}__formDataAddItem(t,e,i=null){let s=0;if(this.__validItem(e)){if(!e.value.pid)throw new Error("Attempt to convert a item without a propper ID");i&&i.getAttribute("code")&&e.setAttribute("parent_code",i.getAttribute("code"));for(let s=0;s<e.attributes.length;s++){const r=e.attributes[s];if(!this.__isAttributeReserved(r.name)&&!r.name.startsWith("data-")){let s=e[r.name];e.code&&["string","number"].includes(typeof s)&&(i&&"quantity"==r.name&&(s=Number(r.value)*i.quantity),t.set(e.signedName(r.name),s.toString()))}}s+=1,this.__formDataAddSubscriptionFields(t,e)}const r=e.querySelectorAll("[data-bundled]");if(r&&e.quantity>0)for(const i of r)s+=this.__formDataAddItem(t,i,e);return s}__formDataAddSubscriptionFields(t,e){if(this.sub_frequency)for(const i of["sub_frequency","sub_startdate","sub_enddate"])this[i]&&t.set(e.signedName(i),this[i])}__formDataAddCartWideSubscriptionFields(t){this.sub_frequency&&(this.sub_token&&t.set(this.signedName("sub_token"),this.sub_token),t.set(this.signedName("sub_modify"),this.sub_modify),t.set(this.signedName("sub_restart"),this.sub_restart))}__formDataAddCartFields(t){this.cart?t.set("cart",this.cart):t.delete("cart")}static __validDate(t){return null!=t&&(t.match(/^(\d{1,2}|\d{8})$/)?!(t.match(/^\d{2}$/)&&Number(t)>31):!(t.match(/^\.5m/)||!Y.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(Y.__validDate(t))if(t.match(/^\d{8}/)){e=(new Date).toISOString().replace(/(-|T.*)/g,"")<=t}else e=!0;return e}static __validFrequency(t){return!!t&&!!t.match(/^(\.5m|\d+[dwmy])$/)}__observeChildren(t){t.forEach((t=>{"childList"==t.type&&t.addedNodes.forEach((t=>{t.addEventListener("change",this.__itemChange.bind(this))}))})),this.__acknowledgeItemElements(),this.__computeTotalPrice(),this.__updateData()}__itemChange(){this.__computeTotalPrice(),this.__updateData()}__computeTotalPrice(){let t=0;this.__itemElements.forEach((e=>{const i=e;i.total&&(t+=Number(i.total))})),this.__total=Number(t.toFixed(2))}__acknowledgeItemElements(){this.__itemElements.forEach((t=>{const e=t;this.__acknowledgeItemElement(e)}))}__acknowledgeItemElement(t){t.addEventListener("change",this.__itemChange.bind(this)),t.currency=this.currency}__validItem(t){const e=t.getAttribute("pid"),i=Number(t.getAttribute("quantity")),s=Number(t.getAttribute("price"));return!!(e&&i>0&&s>=0)}__translateFrequency(t){if(t.startsWith("0"))return this._t("frequency_once");if(".5m"===t)return this._t("frequency_0_5m");const{count:e,units:i}=r(t);return this._t("frequency",{units:this._t(i,{count:e}),count:e})}__translateAmount(t){return t.toLocaleString(this.lang,{minimumFractionDigits:2,currency:this.currency,style:"currency"})}__updateData(){this.__data=null;if(!this.shadowRoot.querySelector("form"))return;const t=new FormData,e=this.__formDataFill(t);this.__hasValidItems=!!e,this.__formDataAddCartFields(t),this.__formDataCustomInputs(t),this.__data=t}}customElements.define("foxy-items-form",Y),customElements.define("foxy-item",Q);export{Y as I,j as P,Q as a};
|
|
@@ -148,7 +148,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
148
148
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
149
149
|
Code distributed by Google as part of the polymer project is also
|
|
150
150
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
151
|
-
*/let Tt=0,Ot=0,At=[],Nt=0,xt=!1,It=document.createTextNode("");new window.MutationObserver((function(){xt=!1;const t=At.length;for(let e=0;e<t;e++){let t=At[e];if(t)try{t()}catch(t){setTimeout((()=>{throw t}))}}At.splice(0,t),Ot+=t})).observe(It,{characterData:!0});const Lt={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Mt={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},Rt={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},Dt={run:t=>(xt||(xt=!0,It.textContent=Nt++),At.push(t),Tt++),cancel(t){const e=t-Ot;if(e>=0){if(!At[e])throw new Error("invalid async handle: "+t);At[e]=null}}},kt=Dt,Ft=dt((t=>class extends t{static createProperties(t){const e=this.prototype;for(let n in t)n in e||e._createPropertyAccessor(n)}static attributeNameForProperty(t){return t.toLowerCase()}static typeForProperty(t){}_createPropertyAccessor(t,e){this._addPropertyToAttributeMap(t),this.hasOwnProperty(JSCompiler_renameProperty("__dataHasAccessor",this))||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[t]||(this.__dataHasAccessor[t]=!0,this._definePropertyAccessor(t,e))}_addPropertyToAttributeMap(t){this.hasOwnProperty(JSCompiler_renameProperty("__dataAttributes",this))||(this.__dataAttributes=Object.assign({},this.__dataAttributes));let e=this.__dataAttributes[t];return e||(e=this.constructor.attributeNameForProperty(t),this.__dataAttributes[e]=t),e}_definePropertyAccessor(t,e){Object.defineProperty(this,t,{get(){return this.__data[t]},set:e?function(){}:function(e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}})}constructor(){super(),this.__dataEnabled=!1,this.__dataReady=!1,this.__dataInvalid=!1,this.__data={},this.__dataPending=null,this.__dataOld=null,this.__dataInstanceProps=null,this.__dataCounter=0,this.__serializing=!1,this._initializeProperties()}ready(){this.__dataReady=!0,this._flushProperties()}_initializeProperties(){for(let t in this.__dataHasAccessor)this.hasOwnProperty(t)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[t]=this[t],delete this[t])}_initializeInstanceProperties(t){Object.assign(this,t)}_setProperty(t,e){this._setPendingProperty(t,e)&&this._invalidateProperties()}_getProperty(t){return this.__data[t]}_setPendingProperty(t,e,n){let r=this.__data[t],i=this._shouldPropertyChange(t,e,r);return i&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),this.__dataOld&&!(t in this.__dataOld)&&(this.__dataOld[t]=r),this.__data[t]=e,this.__dataPending[t]=e),i}_isPropertyPending(t){return!(!this.__dataPending||!this.__dataPending.hasOwnProperty(t))}_invalidateProperties(){!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,kt.run((()=>{this.__dataInvalid&&(this.__dataInvalid=!1,this._flushProperties())})))}_enableProperties(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}_flushProperties(){this.__dataCounter++;const t=this.__data,e=this.__dataPending,n=this.__dataOld;this._shouldPropertiesChange(t,e,n)&&(this.__dataPending=null,this.__dataOld=null,this._propertiesChanged(t,e,n)),this.__dataCounter--}_shouldPropertiesChange(t,e,n){return Boolean(e)}_propertiesChanged(t,e,n){}_shouldPropertyChange(t,e,n){return n!==e&&(n==n||e==e)}attributeChangedCallback(t,e,n,r){e!==n&&this._attributeToProperty(t,n),super.attributeChangedCallback&&super.attributeChangedCallback(t,e,n,r)}_attributeToProperty(t,e,n){if(!this.__serializing){const r=this.__dataAttributes,i=r&&r[t]||t;this[i]=this._deserializeValue(e,n||this.constructor.typeForProperty(i))}}_propertyToAttribute(t,e,n){this.__serializing=!0,n=arguments.length<3?this[t]:n,this._valueToNodeAttribute(this,n,e||this.constructor.attributeNameForProperty(t)),this.__serializing=!1}_valueToNodeAttribute(t,e,n){const r=this._serializeValue(e);"class"!==n&&"name"!==n&&"slot"!==n||(t=ct(t)),void 0===r?t.removeAttribute(n):t.setAttribute(n,r)}_serializeValue(t){
|
|
151
|
+
*/let Tt=0,Ot=0,At=[],Nt=0,xt=!1,It=document.createTextNode("");new window.MutationObserver((function(){xt=!1;const t=At.length;for(let e=0;e<t;e++){let t=At[e];if(t)try{t()}catch(t){setTimeout((()=>{throw t}))}}At.splice(0,t),Ot+=t})).observe(It,{characterData:!0});const Lt={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Mt={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},Rt={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},Dt={run:t=>(xt||(xt=!0,It.textContent=Nt++),At.push(t),Tt++),cancel(t){const e=t-Ot;if(e>=0){if(!At[e])throw new Error("invalid async handle: "+t);At[e]=null}}},kt=Dt,Ft=dt((t=>class extends t{static createProperties(t){const e=this.prototype;for(let n in t)n in e||e._createPropertyAccessor(n)}static attributeNameForProperty(t){return t.toLowerCase()}static typeForProperty(t){}_createPropertyAccessor(t,e){this._addPropertyToAttributeMap(t),this.hasOwnProperty(JSCompiler_renameProperty("__dataHasAccessor",this))||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[t]||(this.__dataHasAccessor[t]=!0,this._definePropertyAccessor(t,e))}_addPropertyToAttributeMap(t){this.hasOwnProperty(JSCompiler_renameProperty("__dataAttributes",this))||(this.__dataAttributes=Object.assign({},this.__dataAttributes));let e=this.__dataAttributes[t];return e||(e=this.constructor.attributeNameForProperty(t),this.__dataAttributes[e]=t),e}_definePropertyAccessor(t,e){Object.defineProperty(this,t,{get(){return this.__data[t]},set:e?function(){}:function(e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}})}constructor(){super(),this.__dataEnabled=!1,this.__dataReady=!1,this.__dataInvalid=!1,this.__data={},this.__dataPending=null,this.__dataOld=null,this.__dataInstanceProps=null,this.__dataCounter=0,this.__serializing=!1,this._initializeProperties()}ready(){this.__dataReady=!0,this._flushProperties()}_initializeProperties(){for(let t in this.__dataHasAccessor)this.hasOwnProperty(t)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[t]=this[t],delete this[t])}_initializeInstanceProperties(t){Object.assign(this,t)}_setProperty(t,e){this._setPendingProperty(t,e)&&this._invalidateProperties()}_getProperty(t){return this.__data[t]}_setPendingProperty(t,e,n){let r=this.__data[t],i=this._shouldPropertyChange(t,e,r);return i&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),this.__dataOld&&!(t in this.__dataOld)&&(this.__dataOld[t]=r),this.__data[t]=e,this.__dataPending[t]=e),i}_isPropertyPending(t){return!(!this.__dataPending||!this.__dataPending.hasOwnProperty(t))}_invalidateProperties(){!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,kt.run((()=>{this.__dataInvalid&&(this.__dataInvalid=!1,this._flushProperties())})))}_enableProperties(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}_flushProperties(){this.__dataCounter++;const t=this.__data,e=this.__dataPending,n=this.__dataOld;this._shouldPropertiesChange(t,e,n)&&(this.__dataPending=null,this.__dataOld=null,this._propertiesChanged(t,e,n)),this.__dataCounter--}_shouldPropertiesChange(t,e,n){return Boolean(e)}_propertiesChanged(t,e,n){}_shouldPropertyChange(t,e,n){return n!==e&&(n==n||e==e)}attributeChangedCallback(t,e,n,r){e!==n&&this._attributeToProperty(t,n),super.attributeChangedCallback&&super.attributeChangedCallback(t,e,n,r)}_attributeToProperty(t,e,n){if(!this.__serializing){const r=this.__dataAttributes,i=r&&r[t]||t;this[i]=this._deserializeValue(e,n||this.constructor.typeForProperty(i))}}_propertyToAttribute(t,e,n){this.__serializing=!0,n=arguments.length<3?this[t]:n,this._valueToNodeAttribute(this,n,e||this.constructor.attributeNameForProperty(t)),this.__serializing=!1}_valueToNodeAttribute(t,e,n){const r=this._serializeValue(e);"class"!==n&&"name"!==n&&"slot"!==n||(t=ct(t)),void 0===r?t.removeAttribute(n):t.setAttribute(n,r)}_serializeValue(t){return"boolean"==typeof t?t?"":void 0:null!=t?t.toString():void 0}_deserializeValue(t,e){switch(e){case Boolean:return null!==t;case Number:return Number(t);default:return t}}})),zt={};let Ht=HTMLElement.prototype;for(;Ht;){let t=Object.getOwnPropertyNames(Ht);for(let e=0;e<t.length;e++)zt[t[e]]=!0;Ht=Object.getPrototypeOf(Ht)}const Bt=dt((t=>{const e=Ft(t);return class extends e{static createPropertiesForAttributes(){let t=this.observedAttributes;for(let e=0;e<t.length;e++)this.prototype._createPropertyAccessor(Ct(t[e]))}static attributeNameForProperty(t){return Et(t)}_initializeProperties(){this.__dataProto&&(this._initializeProtoProperties(this.__dataProto),this.__dataProto=null),super._initializeProperties()}_initializeProtoProperties(t){for(let e in t)this._setProperty(e,t[e])}_ensureAttribute(t,e){const n=this;n.hasAttribute(t)||this._valueToNodeAttribute(n,e,t)}_serializeValue(t){if("object"==typeof t){if(t instanceof Date)return t.toString();if(t)try{return JSON.stringify(t)}catch(t){return""}}return super._serializeValue(t)}_deserializeValue(t,e){let n;switch(e){case Object:try{n=JSON.parse(t)}catch(e){n=t}break;case Array:try{n=JSON.parse(t)}catch(e){n=null,console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${t}`)}break;case Date:n=isNaN(t)?String(t):Number(t),n=new Date(n);break;default:n=super._deserializeValue(t,e)}return n}_definePropertyAccessor(t,e){!function(t,e){if(!zt[e]){let n=t[e];void 0!==n&&(t.__data?t._setPendingProperty(e,n):(t.__dataProto?t.hasOwnProperty(JSCompiler_renameProperty("__dataProto",t))||(t.__dataProto=Object.create(t.__dataProto)):t.__dataProto={},t.__dataProto[e]=n))}}(this,t),super._definePropertyAccessor(t,e)}_hasAccessor(t){return this.__dataHasAccessor&&this.__dataHasAccessor[t]}_isPropertyPending(t){return Boolean(this.__dataPending&&t in this.__dataPending)}}})),Yt={"dom-if":!0,"dom-repeat":!0};
|
|
152
152
|
/**
|
|
153
153
|
@license
|
|
154
154
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"frontend_developer_explainer": "Manages client-side code in JS, CSS, HTML, etc.",
|
|
48
48
|
"full_address": "{{address1}} {{address2}} {{city}} {{region}} {{postal_code}}",
|
|
49
49
|
"full_name": "{{first_name}} {{last_name}}",
|
|
50
|
+
"html_template": "HTML template",
|
|
50
51
|
"invalid_credential_error": "Incorrect email or password. Please check your credentials and try again.",
|
|
51
52
|
"is_defined_false": "Not defined",
|
|
52
53
|
"is_defined_true": "Defined",
|
|
@@ -133,11 +134,12 @@
|
|
|
133
134
|
"tax_use_origin_rates_explainer": "Check to use the tax rate of your country regardless of where customers are located.",
|
|
134
135
|
"template": "Template",
|
|
135
136
|
"template_clipboard": "From clipboard",
|
|
136
|
-
"template_clipboard_explainer": "
|
|
137
|
+
"template_clipboard_explainer": "Paste the template here to use it",
|
|
137
138
|
"template_default": "Default",
|
|
138
139
|
"template_default_explainer": "Use the default template",
|
|
139
140
|
"template_url": "From URL",
|
|
140
|
-
"template_url_explainer": "
|
|
141
|
+
"template_url_explainer": "Fetch the template from a public URL",
|
|
142
|
+
"text_template": "Text template",
|
|
141
143
|
"time": "{{value, time}}",
|
|
142
144
|
"transaction": "Transaction",
|
|
143
145
|
"transaction_approved": "Approved",
|
|
@@ -184,5 +186,87 @@
|
|
|
184
186
|
"year": "Year",
|
|
185
187
|
"year_plural": "Years",
|
|
186
188
|
"yearly": "Yearly",
|
|
187
|
-
"yearly_plural": "Every {{count}} years"
|
|
189
|
+
"yearly_plural": "Every {{count}} years",
|
|
190
|
+
"cart_type": "Cart display",
|
|
191
|
+
"cart_type_default": "Sidecart",
|
|
192
|
+
"cart_type_default_explainer": "Default cart appearance in version 2.0",
|
|
193
|
+
"cart_type_fullpage": "Full page",
|
|
194
|
+
"cart_type_fullpage_explainer": "Send all customers to a full page cart while still including minicart functionality",
|
|
195
|
+
"cart_type_custom": "Custom",
|
|
196
|
+
"cart_type_custom_explainer": "Build your own JSONP cart with included config",
|
|
197
|
+
"foxycomplete": "Location autocomplete",
|
|
198
|
+
"foxycomplete_combobox": "Combo Box",
|
|
199
|
+
"foxycomplete_combobox_explainer": "Expand to browse options, type to search",
|
|
200
|
+
"foxycomplete_search": "Search",
|
|
201
|
+
"foxycomplete_search_explainer": "Display a «search as you type» field",
|
|
202
|
+
"foxycomplete_disabled": "Disabled",
|
|
203
|
+
"foxycomplete_disabled_explainer": "Let customers pick an option from a list",
|
|
204
|
+
"open_icon": "Open icon",
|
|
205
|
+
"close_icon": "Close icon",
|
|
206
|
+
"show_country_flags": "Show country flags",
|
|
207
|
+
"enable_postcode_lookup": "Offer city and state suggestions based on postcode",
|
|
208
|
+
"location_plural": "Locations",
|
|
209
|
+
"shipping": "Shipping",
|
|
210
|
+
"billing": "Billing",
|
|
211
|
+
"allowlist": "Allow all except",
|
|
212
|
+
"blocklist": "Ban all except",
|
|
213
|
+
"same_as_shipping": "Same as shipping",
|
|
214
|
+
"add_region": "Add region",
|
|
215
|
+
"add_country": "Add country",
|
|
216
|
+
"hidden_fields": "Hidden fields",
|
|
217
|
+
"add_field": "Add field",
|
|
218
|
+
"product_weight": "Product weight",
|
|
219
|
+
"product_category": "Product category",
|
|
220
|
+
"product_code": "Product code",
|
|
221
|
+
"product_options": "Product options",
|
|
222
|
+
"sub_frequency": "Subscription frequency",
|
|
223
|
+
"sub_startdate": "Subscription start date",
|
|
224
|
+
"sub_nextdate": "Subscription next date",
|
|
225
|
+
"sub_enddate": "Subscription end date",
|
|
226
|
+
"custom_header": "Custom header",
|
|
227
|
+
"custom_header_helper_text": "Any CSS or JS you need to add to the header can be put here and will be inserted before the </head> tag of your templates. Keep in mind all script file references must be through https or run through the Foxy caching system. Twig syntax is not available in the header.",
|
|
228
|
+
"custom_footer": "Custom footer",
|
|
229
|
+
"custom_footer_helper_text": "Any JS snippets or conversion scripts you need to add to the footer can be put here and will be inserted before the </body> tag. You can use Twig syntax here. For conversion scripts you only want to display once on the receipt page, use {% if first_receipt_display %} {# conversion script content here #} {% endif %}.",
|
|
230
|
+
"ga_account_id": "Account ID",
|
|
231
|
+
"ga_account_id_explainer": "You can find the ID in the Admin section of your Analytics in Tracking info > Tracking code.",
|
|
232
|
+
"ga_include_on_site": "Include via loader.js",
|
|
233
|
+
"ga_include_on_site_explainer": "Enable Google Analytics on any page where the loader.js file is included.",
|
|
234
|
+
"sio_account_id": "Write Key",
|
|
235
|
+
"sio_account_id_explainer": "You can find the write key in your project set up guide or in the source’s settings.",
|
|
236
|
+
"troubleshooting": "Troubleshooting",
|
|
237
|
+
"troubleshooting_debug": "Log debug messages in the browser console",
|
|
238
|
+
"troubleshooting_debug_explainer": "Enable this option to trigger console.log() calls for our JS, which can assist with troubleshooting your store.",
|
|
239
|
+
"custom_config": "Custom config",
|
|
240
|
+
"custom_config_helper_text": "If you have any custom values you'd like to make available to your twig template, you can add them here as a valid JSON string.",
|
|
241
|
+
"custom_fields": "Custom fields",
|
|
242
|
+
"custom_fields_helper_text": "If you have information you'd like to collect from the customer on the checkout page, you can add custom form fields here which will be added to the checkout form. We recommend you follow the same HTML container structure used on other checkout fields for consistency. You can use Twig syntax here.",
|
|
243
|
+
"checkout_type": "Accounts",
|
|
244
|
+
"checkout_type_helper_text": "If you select $t(checkout_type_guest_only), your store will not be able to use subscriptions.",
|
|
245
|
+
"checkout_type_default_account": "Allow both, default to customer",
|
|
246
|
+
"checkout_type_default_guest": "Allow both, default to guest",
|
|
247
|
+
"checkout_type_account_only": "Allow customer accounts only",
|
|
248
|
+
"checkout_type_guest_only": "Allow guests only",
|
|
249
|
+
"supported_cards": "Cards",
|
|
250
|
+
"supported_cards_disclaimer": "Applies only to payment gateways where the customer enters their payment card information directly on the Foxy checkout. Exceptions: Adyen Embedded, Amazon Pay, Apple Pay, Klarna, Square and Stripe.",
|
|
251
|
+
"skip_csc_for_saved": "Skip CSC for saved cards",
|
|
252
|
+
"skip_csc_for_sso": "Skip CSC for single sign-on",
|
|
253
|
+
"consent": "Consent",
|
|
254
|
+
"display_tos_link": "Display a link to Terms & Conditions",
|
|
255
|
+
"display_tos_link_explainer": "Include a checkbox to ask your customers to agree to your Terms of Service.",
|
|
256
|
+
"location_url": "Location (URL)",
|
|
257
|
+
"require_consent": "Require consent to proceed",
|
|
258
|
+
"checked_by_default": "Checked by default",
|
|
259
|
+
"newsletter_subscribe": "Allow users to sign up for your newsletter",
|
|
260
|
+
"newsletter_subscribe_explainer": "This includes a checkbox on your checkout to allow customers to choose to sign up to your newsletter, available in the transaction reports, the API and webhooks.",
|
|
261
|
+
"display_sdta": "Display a Secure Data Transfer agreement to EU customers",
|
|
262
|
+
"display_sdta_explainer": "If you have customers in the European Union, enable this feature so they can opt in to sending their data to our secure servers in the United States.",
|
|
263
|
+
"cart_controls": "Quantity",
|
|
264
|
+
"coupon_entry": "Coupon code",
|
|
265
|
+
"enabled": "Enabled",
|
|
266
|
+
"disabled": "Disabled",
|
|
267
|
+
"required": "Required",
|
|
268
|
+
"default": "Default",
|
|
269
|
+
"optional": "Optional",
|
|
270
|
+
"hidden": "Hidden",
|
|
271
|
+
"field_plural": "Fields"
|
|
188
272
|
}
|
|
@@ -3,10 +3,12 @@ import '@vaadin/vaadin-lumo-styles/icons';
|
|
|
3
3
|
import { CSSResultArray, LitElement, PropertyDeclarations, TemplateResult } from 'lit-element';
|
|
4
4
|
declare const Checkbox_base: typeof LitElement & {
|
|
5
5
|
styles: CSSResultArray;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export declare class Checkbox extends Checkbox_base {
|
|
8
8
|
static get properties(): PropertyDeclarations;
|
|
9
9
|
static get styles(): CSSResultArray;
|
|
10
|
+
readonly: boolean;
|
|
11
|
+
disabled: boolean;
|
|
10
12
|
checked: boolean;
|
|
11
13
|
render(): TemplateResult;
|
|
12
14
|
}
|
|
@@ -2,16 +2,20 @@ import '@polymer/iron-icon';
|
|
|
2
2
|
import '@vaadin/vaadin-lumo-styles/icons';
|
|
3
3
|
import { LitElement, css, html, } from 'lit-element';
|
|
4
4
|
import { CheckboxChangeEvent } from "./CheckboxChangeEvent.js";
|
|
5
|
-
import { ConfigurableMixin } from "../../../mixins/configurable.js";
|
|
6
5
|
import { ThemeableMixin } from "../../../mixins/themeable.js";
|
|
7
|
-
|
|
6
|
+
import { classMap } from "../../../utils/class-map.js";
|
|
7
|
+
export class Checkbox extends ThemeableMixin(LitElement) {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
|
+
this.readonly = false;
|
|
11
|
+
this.disabled = false;
|
|
10
12
|
this.checked = false;
|
|
11
13
|
}
|
|
12
14
|
static get properties() {
|
|
13
15
|
return {
|
|
14
16
|
...super.properties,
|
|
17
|
+
readonly: { type: Boolean },
|
|
18
|
+
disabled: { type: Boolean },
|
|
15
19
|
checked: { type: Boolean },
|
|
16
20
|
};
|
|
17
21
|
}
|
|
@@ -30,23 +34,47 @@ export class Checkbox extends ConfigurableMixin(ThemeableMixin(LitElement)) {
|
|
|
30
34
|
];
|
|
31
35
|
}
|
|
32
36
|
render() {
|
|
33
|
-
const checked = this.checked;
|
|
34
|
-
const ease = 'transition-colors ease-in-out duration-200';
|
|
35
|
-
const box = `${ease} ${checked ? 'bg-primary' : 'bg-contrast-20 group-hover-bg-contrast-30'}`;
|
|
36
|
-
const dot = `${ease} transform ${checked ? 'scale-100' : 'scale-0'}`;
|
|
37
37
|
return html `
|
|
38
|
-
<label
|
|
38
|
+
<label
|
|
39
|
+
class=${classMap({
|
|
40
|
+
'flex group transition-colors': true,
|
|
41
|
+
'cursor-default': this.disabled || this.readonly,
|
|
42
|
+
'text-disabled': this.disabled,
|
|
43
|
+
'text-secondary': this.readonly,
|
|
44
|
+
'cursor-pointer': !this.disabled,
|
|
45
|
+
})}
|
|
46
|
+
>
|
|
39
47
|
<div
|
|
40
|
-
class
|
|
48
|
+
class=${classMap({
|
|
49
|
+
'flex-shrink-0 check transition-colors rounded-s border': true,
|
|
50
|
+
'focus-within-shadow-outline': true,
|
|
51
|
+
'bg-primary text-primary-contrast': !this.readonly && this.checked,
|
|
52
|
+
'border-dashed border-contrast-30': this.readonly,
|
|
53
|
+
'border-transparent': !this.readonly,
|
|
54
|
+
'opacity-50': this.disabled,
|
|
55
|
+
'text-secondary bg-contrast-20': !this.readonly && !this.checked,
|
|
56
|
+
'group-hover-bg-contrast-30': !this.readonly && !this.checked,
|
|
57
|
+
})}
|
|
41
58
|
>
|
|
42
|
-
<iron-icon
|
|
59
|
+
<iron-icon
|
|
60
|
+
icon="lumo:checkmark"
|
|
61
|
+
class=${classMap({
|
|
62
|
+
'block w-full h-full transition-transform transform': true,
|
|
63
|
+
'scale-100': this.checked,
|
|
64
|
+
'scale-0': !this.checked,
|
|
65
|
+
})}
|
|
66
|
+
>
|
|
67
|
+
</iron-icon>
|
|
68
|
+
|
|
43
69
|
<input
|
|
44
70
|
type="checkbox"
|
|
45
71
|
class="sr-only"
|
|
46
|
-
.checked=${checked}
|
|
72
|
+
.checked=${this.checked}
|
|
47
73
|
?disabled=${this.disabled}
|
|
48
74
|
data-testid="input"
|
|
49
75
|
@change=${(evt) => {
|
|
76
|
+
if (this.readonly)
|
|
77
|
+
return evt.preventDefault();
|
|
50
78
|
evt.stopPropagation();
|
|
51
79
|
this.checked = !this.checked;
|
|
52
80
|
this.dispatchEvent(new CheckboxChangeEvent(this.checked));
|
|
@@ -54,12 +82,17 @@ export class Checkbox extends ConfigurableMixin(ThemeableMixin(LitElement)) {
|
|
|
54
82
|
/>
|
|
55
83
|
</div>
|
|
56
84
|
|
|
57
|
-
<div class="flex-1 font-lumo
|
|
85
|
+
<div class="flex-1 font-lumo leading-m -mt-xs ml-m">
|
|
58
86
|
<slot></slot>
|
|
59
87
|
</div>
|
|
60
88
|
</label>
|
|
61
89
|
|
|
62
|
-
<div
|
|
90
|
+
<div
|
|
91
|
+
class=${classMap({
|
|
92
|
+
'font-lumo ml-xxl transition-colors': true,
|
|
93
|
+
'text-disabled': this.disabled,
|
|
94
|
+
})}
|
|
95
|
+
>
|
|
63
96
|
<slot name="content"></slot>
|
|
64
97
|
</div>
|
|
65
98
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/elements/private/Checkbox/Checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAEL,UAAU,EAGV,GAAG,EACH,IAAI,GACL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../../src/elements/private/Checkbox/Checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAEL,UAAU,EAGV,GAAG,EACH,IAAI,GACL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EAAE,cAAc,EAAE,qCAAkC;AAC3D,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,OAAO,QAAS,SAAQ,cAAc,CAAC,UAAU,CAAC;IAAxD;;QA0BE,aAAQ,GAAG,KAAK,CAAC;QAEjB,aAAQ,GAAG,KAAK,CAAC;QAEjB,YAAO,GAAG,KAAK,CAAC;IAkElB,CAAC;IA/FC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;YAC3B,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO;YACL,KAAK,CAAC,MAAM;YACZ,GAAG;;;;;;;;OASF;SACF,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AC5D,CAAC;;;;;;;;;;gBAUG,QAAQ,CAAC;YACf,oCAAoC,EAAE,IAAI;YAC1C,eAAe,EAAE,IAAI,CAAC,QAAQ;SAC/B,CAAC;;;;KAIL,CAAC;IACJ,CAAC;CACF","sourcesContent":["import '@polymer/iron-icon';\nimport '@vaadin/vaadin-lumo-styles/icons';\n\nimport {\n CSSResultArray,\n LitElement,\n PropertyDeclarations,\n TemplateResult,\n css,\n html,\n} from 'lit-element';\n\nimport { CheckboxChangeEvent } from './CheckboxChangeEvent';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { classMap } from '../../../utils/class-map';\n\nexport class Checkbox extends ThemeableMixin(LitElement) {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n readonly: { type: Boolean },\n disabled: { type: Boolean },\n checked: { type: Boolean },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n .ml-xxl {\n margin-left: calc(var(--lumo-space-m) + 1.125rem);\n }\n\n .check {\n height: 1.125rem;\n width: 1.125rem;\n }\n `,\n ];\n }\n\n readonly = false;\n\n disabled = false;\n\n checked = false;\n\n render(): TemplateResult {\n return html`\n <label\n class=${classMap({\n 'flex group transition-colors': true,\n 'cursor-default': this.disabled || this.readonly,\n 'text-disabled': this.disabled,\n 'text-secondary': this.readonly,\n 'cursor-pointer': !this.disabled,\n })}\n >\n <div\n class=${classMap({\n 'flex-shrink-0 check transition-colors rounded-s border': true,\n 'focus-within-shadow-outline': true,\n 'bg-primary text-primary-contrast': !this.readonly && this.checked,\n 'border-dashed border-contrast-30': this.readonly,\n 'border-transparent': !this.readonly,\n 'opacity-50': this.disabled,\n 'text-secondary bg-contrast-20': !this.readonly && !this.checked,\n 'group-hover-bg-contrast-30': !this.readonly && !this.checked,\n })}\n >\n <iron-icon\n icon=\"lumo:checkmark\"\n class=${classMap({\n 'block w-full h-full transition-transform transform': true,\n 'scale-100': this.checked,\n 'scale-0': !this.checked,\n })}\n >\n </iron-icon>\n\n <input\n type=\"checkbox\"\n class=\"sr-only\"\n .checked=${this.checked}\n ?disabled=${this.disabled}\n data-testid=\"input\"\n @change=${(evt: Event) => {\n if (this.readonly) return evt.preventDefault();\n\n evt.stopPropagation();\n this.checked = !this.checked;\n this.dispatchEvent(new CheckboxChangeEvent(this.checked));\n }}\n />\n </div>\n\n <div class=\"flex-1 font-lumo leading-m -mt-xs ml-m\">\n <slot></slot>\n </div>\n </label>\n\n <div\n class=${classMap({\n 'font-lumo ml-xxl transition-colors': true,\n 'text-disabled': this.disabled,\n })}\n >\n <slot name=\"content\"></slot>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -17,13 +17,13 @@ function radio(readonly, disabled, checked, attrs, label) {
|
|
|
17
17
|
const scale = checked ? 'scale-100' : 'scale-0';
|
|
18
18
|
const color = disabled ? 'text-disabled' : readonly ? 'text-secondary' : 'text-body';
|
|
19
19
|
const ease = 'transition ease-in-out duration-200';
|
|
20
|
-
const dotBg = readonly ? 'bg-contrast-
|
|
20
|
+
const dotBg = readonly ? 'bg-contrast-70' : 'bg-tint';
|
|
21
21
|
const dot = `${ease} ${disabled || readonly ? '' : 'shadow-xs'} transform ${scale} ${dotBg}`;
|
|
22
22
|
const bg = readonly ? '' : disabled ? disabledBg : enabledBg;
|
|
23
|
-
const border = `border ${readonly ? 'border-contrast-
|
|
23
|
+
const border = `border ${readonly ? 'border-dashed border-contrast-30' : 'border-transparent'}`;
|
|
24
24
|
return html `
|
|
25
|
-
<label class="group flex items-
|
|
26
|
-
<div class="item flex items-center justify-center">
|
|
25
|
+
<label class="group flex items-center ${disabled || readonly ? '' : 'cursor-pointer'}">
|
|
26
|
+
<div class="item flex items-center justify-center flex-shrink-0">
|
|
27
27
|
<div class="flex radio rounded-full ${border} ${ease} ${bg} focus-within-shadow-outline">
|
|
28
28
|
<div class="dot m-auto rounded-full ${dot}"></div>
|
|
29
29
|
<input type="radio" class="sr-only" .checked=${checked} ...=${attrs} />
|
|
@@ -39,12 +39,12 @@ function check(readonly, disabled, checked, attrs, label) {
|
|
|
39
39
|
const scale = checked ? 'scale-100' : 'scale-0';
|
|
40
40
|
const color = disabled ? 'text-disabled' : readonly ? 'text-secondary' : 'text-body';
|
|
41
41
|
const ease = 'transition ease-in-out duration-200';
|
|
42
|
-
const dot = `${ease} transform ${scale} ${readonly ? 'text-contrast-
|
|
42
|
+
const dot = `${ease} transform ${scale} ${readonly ? 'text-contrast-70' : 'text-tint'}`;
|
|
43
43
|
const bg = readonly ? '' : disabled ? disabledBg : enabledBg;
|
|
44
|
-
const border = `border ${readonly ? 'border-contrast-
|
|
44
|
+
const border = `border ${readonly ? 'border-dashed border-contrast-30' : 'border-transparent'}`;
|
|
45
45
|
return html `
|
|
46
46
|
<label class="group flex items-center ${disabled || readonly ? '' : 'cursor-pointer'}">
|
|
47
|
-
<div class="item flex items-center justify-center text-primary-contrast">
|
|
47
|
+
<div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast">
|
|
48
48
|
<div class="check rounded-s ${border} ${ease} ${bg} focus-within-shadow-outline">
|
|
49
49
|
<iron-icon icon="lumo:checkmark" class="block w-full h-full ${dot}"></iron-icon>
|
|
50
50
|
<input type="checkbox" class="sr-only" .checked=${checked} ...=${attrs} />
|
|
@@ -192,8 +192,10 @@ export class Choice extends Translatable {
|
|
|
192
192
|
'value': other ? VALUE_OTHER : item,
|
|
193
193
|
'name': multiple ? item : 'choice',
|
|
194
194
|
'data-testid': `item-${item}`,
|
|
195
|
-
'?disabled': disabled
|
|
195
|
+
'?disabled': disabled,
|
|
196
196
|
'@change': (evt) => {
|
|
197
|
+
if (this.readonly)
|
|
198
|
+
return evt.preventDefault();
|
|
197
199
|
const checked = evt.target.checked;
|
|
198
200
|
const newItem = item === VALUE_OTHER ? this.defaultCustomValue : item;
|
|
199
201
|
const value = this.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choice.js","sourceRoot":"","sources":["../../../../src/elements/private/Choice/Choice.ts"],"names":[],"mappings":"AAAA,OAA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C7E;iBAAM;gBACL,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;aAC1B;YAED,IAAI,CAAC,aAAa,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,MAAM,UAAU,GAAG,MAAM,CAAC;YACxB,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;YACjD,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW;YACjD,KAAK,EAAE,IAAI,CAAC,GAAG;YACf,KAAK,EAAE,IAAI,CAAC,GAAG;YACf,WAAW,EAAE,IAAI,CAAC,QAAQ;YAC1B,WAAW,EAAE,IAAI,CAAC,QAAQ;YAC1B,aAAa,EAAE,OAAO;YACtB,SAAS,EAAE,WAAW;SACvB,CAAC,CAAC;QAEH,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;YAC7B,OAAO,IAAI,CAAA,0BAA0B,UAAU,uBAAuB,CAAC;SACxE;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAClC,OAAO,IAAI,CAAA,6BAA6B,UAAU,uCAAuC,CAAC;SAC3F;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;YACnC,OAAO,IAAI,CAAA,yBAAyB,UAAU,sBAAsB,CAAC;SACtE;aAAM;YACL,OAAO,IAAI,CAAA,0BAA0B,UAAU,uBAAuB,CAAC;SACxE;IACH,CAAC;CACF","sourcesContent":["import '@polymer/iron-icon';\nimport '@vaadin/vaadin-lumo-styles/icons';\nimport '@vaadin/vaadin-text-field/vaadin-integer-field';\nimport '@vaadin/vaadin-text-field/vaadin-text-area';\nimport '@vaadin/vaadin-text-field/vaadin-text-field';\n\nimport { CSSResultArray, PropertyDeclarations, TemplateResult, css, html } from 'lit-element';\n\nimport { AttributePart } from 'lit-html';\nimport { ChoiceChangeEvent } from './ChoiceChangeEvent';\nimport { FrequencyInput } from '../FrequencyInput/FrequencyInput';\nimport { ScopedElementsMap } from '@open-wc/scoped-elements';\nimport { Translatable } from '../../../mixins/translatable';\nimport { interpret } from 'xstate';\nimport { machine } from './machine';\nimport { spread } from '@open-wc/lit-helpers/src/spread';\n\nconst VALUE_OTHER = `@foxy.io/elements::other[${(Math.pow(10, 10) * Math.random()).toFixed(0)}]`;\n\nfunction radio(\n readonly: boolean,\n disabled: boolean,\n checked: boolean,\n attrs: (part: AttributePart) => void,\n label: TemplateResult\n) {\n const enabledBg = checked ? 'bg-primary' : 'bg-contrast-20 group-hover-bg-contrast-30';\n const disabledBg = checked ? 'bg-primary-50' : 'bg-contrast-10';\n const scale = checked ? 'scale-100' : 'scale-0';\n const color = disabled ? 'text-disabled' : readonly ? 'text-secondary' : 'text-body';\n const ease = 'transition ease-in-out duration-200';\n const dotBg = readonly ? 'bg-contrast-20' : 'bg-tint';\n const dot = `${ease} ${disabled || readonly ? '' : 'shadow-xs'} transform ${scale} ${dotBg}`;\n const bg = readonly ? '' : disabled ? disabledBg : enabledBg;\n const border = `border ${readonly ? 'border-contrast-20' : 'border-transparent'}`;\n\n return html`\n <label class=\"group flex items-start ${disabled || readonly ? '' : 'cursor-pointer'}\">\n <div class=\"item flex items-center justify-center\">\n <div class=\"flex radio rounded-full ${border} ${ease} ${bg} focus-within-shadow-outline\">\n <div class=\"dot m-auto rounded-full ${dot}\"></div>\n <input type=\"radio\" class=\"sr-only\" .checked=${checked} ...=${attrs} />\n </div>\n </div>\n <div class=\"font-lumo leading-m ${color}\">${label}</div>\n </label>\n `;\n}\n\nfunction check(\n readonly: boolean,\n disabled: boolean,\n checked: boolean,\n attrs: (part: AttributePart) => void,\n label: TemplateResult\n) {\n const enabledBg = checked ? 'bg-primary' : 'bg-contrast-20 group-hover-bg-contrast-30';\n const disabledBg = checked ? 'bg-primary-50' : 'bg-contrast-10';\n const scale = checked ? 'scale-100' : 'scale-0';\n const color = disabled ? 'text-disabled' : readonly ? 'text-secondary' : 'text-body';\n const ease = 'transition ease-in-out duration-200';\n const dot = `${ease} transform ${scale} ${readonly ? 'text-contrast-20' : 'text-tint'}`;\n const bg = readonly ? '' : disabled ? disabledBg : enabledBg;\n const border = `border ${readonly ? 'border-contrast-20' : 'border-transparent'}`;\n\n return html`\n <label class=\"group flex items-center ${disabled || readonly ? '' : 'cursor-pointer'}\">\n <div class=\"item flex items-center justify-center text-primary-contrast\">\n <div class=\"check rounded-s ${border} ${ease} ${bg} focus-within-shadow-outline\">\n <iron-icon icon=\"lumo:checkmark\" class=\"block w-full h-full ${dot}\"></iron-icon>\n <input type=\"checkbox\" class=\"sr-only\" .checked=${checked} ...=${attrs} />\n </div>\n </div>\n <div class=\"font-lumo leading-m ${color}\">${label}</div>\n </label>\n `;\n}\n\nexport class Choice extends Translatable {\n public static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-integer-field': customElements.get('vaadin-integer-field'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'x-frequency-input': FrequencyInput,\n 'vaadin-text-area': customElements.get('vaadin-text-area'),\n 'iron-icon': customElements.get('iron-icon'),\n };\n }\n\n public static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n :host {\n --item-width: calc((var(--lumo-space-m) * 2) + 1.25rem);\n }\n .ml-xxl {\n margin-left: var(--item-width);\n }\n .item {\n height: var(--lumo-size-l);\n width: var(--item-width);\n }\n .radio {\n height: 1.25rem;\n width: 1.25rem;\n }\n .check {\n height: 1.125rem;\n width: 1.125rem;\n }\n .dot {\n height: 0.5rem;\n width: 0.5rem;\n }\n `,\n ];\n }\n\n public static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n defaultCustomValue: { type: String, attribute: 'default-custom-value' },\n disabled: { type: Boolean },\n readonly: { type: Boolean },\n custom: { type: Boolean },\n type: { type: String },\n min: { type: Number },\n max: { type: Number },\n value: { type: Array },\n items: { type: Array },\n getText: { attribute: false },\n };\n }\n\n public getText: (value: string) => string = v => v;\n\n private __service = interpret(machine)\n .onChange(() => this.requestUpdate())\n .onTransition(({ changed }) => changed && this.requestUpdate())\n .start();\n\n public get defaultCustomValue(): string {\n return this.__service.state.context.defaultCustomValue;\n }\n\n public set defaultCustomValue(data: string) {\n this.__service.send('SET_DEFAULT_CUSTOM_VALUE', { data });\n }\n\n public get readonly(): boolean {\n return this.__service.state.matches('mutability.readonly');\n }\n\n public set readonly(data: boolean) {\n this.__service.send('SET_READONLY', { data });\n }\n\n public get disabled(): boolean {\n return this.__service.state.matches('interactivity.disabled');\n }\n\n public set disabled(data: boolean) {\n this.__service.send('SET_DISABLED', { data });\n }\n\n public get custom(): boolean {\n return this.__service.state.matches('extension.present');\n }\n\n public set custom(data: boolean) {\n this.__service.send('SET_CUSTOM', { data });\n }\n\n public get type(): 'text' | 'textarea' | 'integer' | 'frequency' {\n return this.__service.state.context.type;\n }\n\n public set type(data: 'text' | 'textarea' | 'integer' | 'frequency') {\n this.__service.send('SET_TYPE', { data });\n }\n\n public get min(): number | null {\n return this.__service.state.context.min;\n }\n\n public set min(data: number | null) {\n this.__service.send('SET_MIN', { data });\n }\n\n public get max(): number | null {\n return this.__service.state.context.max;\n }\n\n public set max(data: number | null) {\n this.__service.send('SET_MAX', { data });\n }\n\n public get value(): null | string | string[] {\n return this.__service.state.context.value;\n }\n\n public set value(data: null | string | string[]) {\n this.__service.send('SET_VALUE', { data });\n }\n\n public get items(): string[] {\n return this.__service.state.context.items;\n }\n\n public set items(data: string[]) {\n this.__service.send('SET_ITEMS', { data });\n }\n\n public render(): TemplateResult {\n const items = this.custom ? [...this.items, VALUE_OTHER] : this.items;\n const multiple = Array.isArray(this.value);\n const otherChecked = this.__service.state.matches('extension.present.selected');\n\n const children = html`\n ${items.map((item, index, array) => {\n const other = this.custom && index === array.length - 1;\n const checked = other\n ? otherChecked\n : multiple\n ? !!this.value?.includes(item)\n : item === String(this.value);\n const disabled = this.disabled || !this._isI18nReady;\n const attributes = spread({\n 'value': other ? VALUE_OTHER : item,\n 'name': multiple ? item : 'choice',\n 'data-testid': `item-${item}`,\n '?disabled': disabled || this.readonly,\n '@change': (evt: Event) => {\n const checked = (evt.target as HTMLInputElement).checked;\n const newItem = item === VALUE_OTHER ? this.defaultCustomValue : item;\n const value = this.value;\n if (Array.isArray(value)) {\n if (item === VALUE_OTHER) {\n this.value = checked ? [...value, newItem] : value.slice(0, value.length - 1);\n } else {\n this.value = checked ? [newItem, ...value] : value.filter(v => v !== newItem);\n }\n } else {\n this.value = checked ? newItem : null;\n }\n this.dispatchEvent(new ChoiceChangeEvent(this.value));\n },\n });\n const label = html`\n <div>\n ${item === VALUE_OTHER\n ? this._t('choice.other').toString()\n : html`<slot name=${`${item}-label`}>${this.getText(item)}</slot>`}\n </div>\n `;\n return html`\n <div class=\"ml-xxl border-t border-contrast-10 ${index ? '' : 'hidden'}\"></div>\n ${multiple\n ? check(this.readonly, disabled, checked, attributes, label)\n : radio(this.readonly, disabled, checked, attributes, label)}\n <div class=\"mr-m ml-xxl\">\n ${item === VALUE_OTHER && otherChecked ? this.__field : ''}\n ${item !== VALUE_OTHER ? html`<slot name=${item}></slot>` : ''}\n </div>\n `;\n })}\n `;\n\n return html`<form>${children}</form> `;\n }\n\n private get __field() {\n const handleInput = (evt: Event) => {\n evt.stopPropagation();\n const customValue = (evt.target as HTMLInputElement).value;\n\n if (Array.isArray(this.value)) {\n this.value = this.value.slice(0, this.value.length - 1).concat(customValue);\n } else {\n this.value = customValue;\n }\n\n this.dispatchEvent(new ChoiceChangeEvent(this.value));\n };\n\n const attributes = spread({\n 'placeholder': this._t('choice.other').toString(),\n 'class': 'w-full mb-m',\n 'value': this.__service.state.context.customValue,\n 'max': this.max,\n 'min': this.min,\n '?disabled': this.disabled,\n '?readonly': this.readonly,\n 'data-testid': 'field',\n '@change': handleInput,\n });\n\n if (this.type === 'frequency') {\n return html`<x-frequency-input ...=${attributes}></x-frequency-input>`;\n } else if (this.type === 'integer') {\n return html`<vaadin-integer-field ...=${attributes} has-controls></vaadin-integer-field>`;\n } else if (this.type === 'textarea') {\n return html`<vaadin-text-area ...=${attributes}></vaadin-text-area>`;\n } else {\n return html`<vaadin-text-field ...=${attributes}></vaadin-text-field>`;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Choice.js","sourceRoot":"","sources":["../../../../src/elements/private/Choice/Choice.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gDAAgD,CAAC;AACxD,OAAO,4CAA4C,CAAC;AACpD,OAAO,6CAA6C,CAAC;AAErD,OAAO,EAAwD,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAG9F,OAAO,EAAE,iBAAiB,EAAE,+BAA4B;AACxD,OAAO,EAAE,cAAc,EAAE,4CAAyC;AAElE,OAAO,EAAE,YAAY,EAAE,wCAAqC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,qBAAkB;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEzD,MAAM,WAAW,GAAG,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AAEjG,SAAS,KAAK,CACZ,QAAiB,EACjB,QAAiB,EACjB,OAAgB,EAChB,KAAoC,EACpC,KAAqB;IAErB,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,2CAA2C,CAAC;IACvF,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IAChD,MAAM,K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AM;YACL,OAAO,IAAI,CAAA,0BAA0B,UAAU,uBAAuB,CAAC;SACxE;IACH,CAAC;CACF","sourcesContent":["import '@polymer/iron-icon';\nimport '@vaadin/vaadin-lumo-styles/icons';\nimport '@vaadin/vaadin-text-field/vaadin-integer-field';\nimport '@vaadin/vaadin-text-field/vaadin-text-area';\nimport '@vaadin/vaadin-text-field/vaadin-text-field';\n\nimport { CSSResultArray, PropertyDeclarations, TemplateResult, css, html } from 'lit-element';\n\nimport { AttributePart } from 'lit-html';\nimport { ChoiceChangeEvent } from './ChoiceChangeEvent';\nimport { FrequencyInput } from '../FrequencyInput/FrequencyInput';\nimport { ScopedElementsMap } from '@open-wc/scoped-elements';\nimport { Translatable } from '../../../mixins/translatable';\nimport { interpret } from 'xstate';\nimport { machine } from './machine';\nimport { spread } from '@open-wc/lit-helpers/src/spread';\n\nconst VALUE_OTHER = `@foxy.io/elements::other[${(Math.pow(10, 10) * Math.random()).toFixed(0)}]`;\n\nfunction radio(\n readonly: boolean,\n disabled: boolean,\n checked: boolean,\n attrs: (part: AttributePart) => void,\n label: TemplateResult\n) {\n const enabledBg = checked ? 'bg-primary' : 'bg-contrast-20 group-hover-bg-contrast-30';\n const disabledBg = checked ? 'bg-primary-50' : 'bg-contrast-10';\n const scale = checked ? 'scale-100' : 'scale-0';\n const color = disabled ? 'text-disabled' : readonly ? 'text-secondary' : 'text-body';\n const ease = 'transition ease-in-out duration-200';\n const dotBg = readonly ? 'bg-contrast-70' : 'bg-tint';\n const dot = `${ease} ${disabled || readonly ? '' : 'shadow-xs'} transform ${scale} ${dotBg}`;\n const bg = readonly ? '' : disabled ? disabledBg : enabledBg;\n const border = `border ${readonly ? 'border-dashed border-contrast-30' : 'border-transparent'}`;\n\n return html`\n <label class=\"group flex items-center ${disabled || readonly ? '' : 'cursor-pointer'}\">\n <div class=\"item flex items-center justify-center flex-shrink-0\">\n <div class=\"flex radio rounded-full ${border} ${ease} ${bg} focus-within-shadow-outline\">\n <div class=\"dot m-auto rounded-full ${dot}\"></div>\n <input type=\"radio\" class=\"sr-only\" .checked=${checked} ...=${attrs} />\n </div>\n </div>\n <div class=\"font-lumo leading-m ${color}\">${label}</div>\n </label>\n `;\n}\n\nfunction check(\n readonly: boolean,\n disabled: boolean,\n checked: boolean,\n attrs: (part: AttributePart) => void,\n label: TemplateResult\n) {\n const enabledBg = checked ? 'bg-primary' : 'bg-contrast-20 group-hover-bg-contrast-30';\n const disabledBg = checked ? 'bg-primary-50' : 'bg-contrast-10';\n const scale = checked ? 'scale-100' : 'scale-0';\n const color = disabled ? 'text-disabled' : readonly ? 'text-secondary' : 'text-body';\n const ease = 'transition ease-in-out duration-200';\n const dot = `${ease} transform ${scale} ${readonly ? 'text-contrast-70' : 'text-tint'}`;\n const bg = readonly ? '' : disabled ? disabledBg : enabledBg;\n const border = `border ${readonly ? 'border-dashed border-contrast-30' : 'border-transparent'}`;\n\n return html`\n <label class=\"group flex items-center ${disabled || readonly ? '' : 'cursor-pointer'}\">\n <div class=\"item flex items-center justify-center flex-shrink-0 text-primary-contrast\">\n <div class=\"check rounded-s ${border} ${ease} ${bg} focus-within-shadow-outline\">\n <iron-icon icon=\"lumo:checkmark\" class=\"block w-full h-full ${dot}\"></iron-icon>\n <input type=\"checkbox\" class=\"sr-only\" .checked=${checked} ...=${attrs} />\n </div>\n </div>\n <div class=\"font-lumo leading-m ${color}\">${label}</div>\n </label>\n `;\n}\n\nexport class Choice extends Translatable {\n public static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-integer-field': customElements.get('vaadin-integer-field'),\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'x-frequency-input': FrequencyInput,\n 'vaadin-text-area': customElements.get('vaadin-text-area'),\n 'iron-icon': customElements.get('iron-icon'),\n };\n }\n\n public static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n :host {\n --item-width: calc((var(--lumo-space-m) * 2) + 1.25rem);\n }\n .ml-xxl {\n margin-left: var(--item-width);\n }\n .item {\n height: var(--lumo-size-l);\n width: var(--item-width);\n }\n .radio {\n height: 1.25rem;\n width: 1.25rem;\n }\n .check {\n height: 1.125rem;\n width: 1.125rem;\n }\n .dot {\n height: 0.5rem;\n width: 0.5rem;\n }\n `,\n ];\n }\n\n public static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n defaultCustomValue: { type: String, attribute: 'default-custom-value' },\n disabled: { type: Boolean },\n readonly: { type: Boolean },\n custom: { type: Boolean },\n type: { type: String },\n min: { type: Number },\n max: { type: Number },\n value: { type: Array },\n items: { type: Array },\n getText: { attribute: false },\n };\n }\n\n public getText: (value: string) => string = v => v;\n\n private __service = interpret(machine)\n .onChange(() => this.requestUpdate())\n .onTransition(({ changed }) => changed && this.requestUpdate())\n .start();\n\n public get defaultCustomValue(): string {\n return this.__service.state.context.defaultCustomValue;\n }\n\n public set defaultCustomValue(data: string) {\n this.__service.send('SET_DEFAULT_CUSTOM_VALUE', { data });\n }\n\n public get readonly(): boolean {\n return this.__service.state.matches('mutability.readonly');\n }\n\n public set readonly(data: boolean) {\n this.__service.send('SET_READONLY', { data });\n }\n\n public get disabled(): boolean {\n return this.__service.state.matches('interactivity.disabled');\n }\n\n public set disabled(data: boolean) {\n this.__service.send('SET_DISABLED', { data });\n }\n\n public get custom(): boolean {\n return this.__service.state.matches('extension.present');\n }\n\n public set custom(data: boolean) {\n this.__service.send('SET_CUSTOM', { data });\n }\n\n public get type(): 'text' | 'textarea' | 'integer' | 'frequency' {\n return this.__service.state.context.type;\n }\n\n public set type(data: 'text' | 'textarea' | 'integer' | 'frequency') {\n this.__service.send('SET_TYPE', { data });\n }\n\n public get min(): number | null {\n return this.__service.state.context.min;\n }\n\n public set min(data: number | null) {\n this.__service.send('SET_MIN', { data });\n }\n\n public get max(): number | null {\n return this.__service.state.context.max;\n }\n\n public set max(data: number | null) {\n this.__service.send('SET_MAX', { data });\n }\n\n public get value(): null | string | string[] {\n return this.__service.state.context.value;\n }\n\n public set value(data: null | string | string[]) {\n this.__service.send('SET_VALUE', { data });\n }\n\n public get items(): string[] {\n return this.__service.state.context.items;\n }\n\n public set items(data: string[]) {\n this.__service.send('SET_ITEMS', { data });\n }\n\n public render(): TemplateResult {\n const items = this.custom ? [...this.items, VALUE_OTHER] : this.items;\n const multiple = Array.isArray(this.value);\n const otherChecked = this.__service.state.matches('extension.present.selected');\n\n const children = html`\n ${items.map((item, index, array) => {\n const other = this.custom && index === array.length - 1;\n const checked = other\n ? otherChecked\n : multiple\n ? !!this.value?.includes(item)\n : item === String(this.value);\n const disabled = this.disabled || !this._isI18nReady;\n const attributes = spread({\n 'value': other ? VALUE_OTHER : item,\n 'name': multiple ? item : 'choice',\n 'data-testid': `item-${item}`,\n '?disabled': disabled,\n '@change': (evt: Event) => {\n if (this.readonly) return evt.preventDefault();\n\n const checked = (evt.target as HTMLInputElement).checked;\n const newItem = item === VALUE_OTHER ? this.defaultCustomValue : item;\n const value = this.value;\n\n if (Array.isArray(value)) {\n if (item === VALUE_OTHER) {\n this.value = checked ? [...value, newItem] : value.slice(0, value.length - 1);\n } else {\n this.value = checked ? [newItem, ...value] : value.filter(v => v !== newItem);\n }\n } else {\n this.value = checked ? newItem : null;\n }\n\n this.dispatchEvent(new ChoiceChangeEvent(this.value));\n },\n });\n const label = html`\n <div>\n ${item === VALUE_OTHER\n ? this._t('choice.other').toString()\n : html`<slot name=${`${item}-label`}>${this.getText(item)}</slot>`}\n </div>\n `;\n return html`\n <div class=\"ml-xxl border-t border-contrast-10 ${index ? '' : 'hidden'}\"></div>\n ${multiple\n ? check(this.readonly, disabled, checked, attributes, label)\n : radio(this.readonly, disabled, checked, attributes, label)}\n <div class=\"mr-m ml-xxl\">\n ${item === VALUE_OTHER && otherChecked ? this.__field : ''}\n ${item !== VALUE_OTHER ? html`<slot name=${item}></slot>` : ''}\n </div>\n `;\n })}\n `;\n\n return html`<form>${children}</form> `;\n }\n\n private get __field() {\n const handleInput = (evt: Event) => {\n evt.stopPropagation();\n const customValue = (evt.target as HTMLInputElement).value;\n\n if (Array.isArray(this.value)) {\n this.value = this.value.slice(0, this.value.length - 1).concat(customValue);\n } else {\n this.value = customValue;\n }\n\n this.dispatchEvent(new ChoiceChangeEvent(this.value));\n };\n\n const attributes = spread({\n 'placeholder': this._t('choice.other').toString(),\n 'class': 'w-full mb-m',\n 'value': this.__service.state.context.customValue,\n 'max': this.max,\n 'min': this.min,\n '?disabled': this.disabled,\n '?readonly': this.readonly,\n 'data-testid': 'field',\n '@change': handleInput,\n });\n\n if (this.type === 'frequency') {\n return html`<x-frequency-input ...=${attributes}></x-frequency-input>`;\n } else if (this.type === 'integer') {\n return html`<vaadin-integer-field ...=${attributes} has-controls></vaadin-integer-field>`;\n } else if (this.type === 'textarea') {\n return html`<vaadin-text-area ...=${attributes}></vaadin-text-area>`;\n } else {\n return html`<vaadin-text-field ...=${attributes}></vaadin-text-field>`;\n }\n }\n}\n"]}
|
|
@@ -15,7 +15,7 @@ export class Group extends LitElement {
|
|
|
15
15
|
return Themeable.styles;
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
const frameClass = 'border border-contrast-10';
|
|
18
|
+
const frameClass = 'border border-contrast-10 overflow-hidden';
|
|
19
19
|
return html `
|
|
20
20
|
<section class="space-y-s font-lumo antialiased">
|
|
21
21
|
<h3 class=${`text-s font-medium text-secondary leading-none ${this.frame ? '' : 'pl-m'}`}>
|