@foxy.io/elements 1.15.0-beta.5 → 1.15.0-beta.6
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/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +2 -2
- 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-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.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-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +2 -2
- package/dist/cdn/foxy-customer.js +1 -1
- 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 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-pagination.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-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 +1 -1
- 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 -1
- 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-4cc1da27.js → shared-06e64d75.js} +1 -1
- package/dist/cdn/shared-11708514.js +1 -0
- package/dist/cdn/{shared-5639389e.js → shared-20b9ce70.js} +1 -1
- package/dist/cdn/{shared-0032dc09.js → shared-25e67340.js} +2 -2
- package/dist/cdn/shared-3be96355.js +1 -0
- package/dist/cdn/shared-5272c758.js +1 -0
- package/dist/cdn/shared-805d18a2.js +1 -0
- package/dist/cdn/shared-940a4826.js +1 -0
- package/dist/cdn/{shared-67ca44d2.js → shared-a7095b6a.js} +1 -1
- package/dist/cdn/{shared-b30bc42d.js → shared-ffb27563.js} +1 -1
- package/dist/cdn/translations/shared/en.json +3 -1
- package/dist/elements/public/CouponCard/CouponCard.js +3 -3
- package/dist/elements/public/CouponCard/CouponCard.js.map +1 -1
- package/dist/elements/public/CouponCodesForm/types.d.ts +3 -2
- package/dist/elements/public/CouponCodesForm/types.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js +3 -1
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.d.ts +4 -0
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +32 -0
- package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -1
- package/dist/elements/public/GiftCardCard/GiftCardCard.js +6 -29
- package/dist/elements/public/GiftCardCard/GiftCardCard.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.d.ts +6 -0
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js +45 -1
- package/dist/elements/public/GiftCardCodesForm/GiftCardCodesForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/index.d.ts +1 -0
- package/dist/elements/public/GiftCardCodesForm/index.js +1 -0
- package/dist/elements/public/GiftCardCodesForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardCodesForm/types.d.ts +3 -2
- package/dist/elements/public/GiftCardCodesForm/types.js.map +1 -1
- package/dist/elements/public/GiftCardForm/GiftCardForm.d.ts +3 -2
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +29 -13
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/I18n/format/index.js +2 -0
- package/dist/elements/public/I18n/format/index.js.map +1 -1
- package/dist/elements/public/I18n/format/relative.d.ts +6 -0
- package/dist/elements/public/I18n/format/relative.js +15 -0
- package/dist/elements/public/I18n/format/relative.js.map +1 -0
- package/package.json +2 -2
- package/dist/cdn/shared-05488216.js +0 -1
- package/dist/cdn/shared-0e4d19e2.js +0 -1
- package/dist/cdn/shared-43abbdd9.js +0 -1
- package/dist/cdn/shared-8a5ec3cf.js +0 -1
- package/dist/cdn/shared-cf6751d3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiftCardForm.js","sourceRoot":"","sources":["../../../../src/elements/public/GiftCardForm/GiftCardForm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAIlF,OAAO,EAAE,IAAI,EAAwC,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAA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AC,GAAgB,EAAE,EAAE;YAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAA0B,CAAC;YACnF,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,aAA8B,CAAC,CAAC;QACnD,CAAC;;0BAEe,IAAI,CAAC,EAAE,sBAAsB,IAAI,CAAC,IAAI;;;UAGtD,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC;;KAE9C,CAAC;IACJ,CAAC;;AAthBuB,gCAAmB,GAAa;IACtD,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IAClD,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACxE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;IACxD,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;IAChE,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;CACnE,CAAC","sourcesContent":["import { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { ComboBoxElement } from '@vaadin/vaadin-combo-box';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\nimport { html, PropertyDeclarations, TemplateResult } from 'lit-element';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { FrequencyInput } from '../../private/FrequencyInput/FrequencyInput';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { EditableList } from '../../private/EditableList/EditableList';\nimport { FrequencyInputChangeEvent } from '../../private/FrequencyInput/FrequencyInputChangeEvent';\nimport { Group } from '../../private/Group/Group';\nimport { PropertyTable } from '../../private/PropertyTable/PropertyTable';\nimport { FormDialog } from '../FormDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { QueryBuilder } from '../QueryBuilder/QueryBuilder';\nimport { Option, Type } from '../QueryBuilder/types';\nimport { Column } from '../Table/types';\nimport { currencies } from './currencies';\nimport { CategoryRestrictionsPage } from './private/CategoryRestrictionsPage';\nimport { Data, GiftCardCodes } from './types';\n\nconst NS = 'gift-card-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(ResponsiveMixin(TranslatableMixin(NucleonElement, NS))))\n);\n\n/**\n * Form element for creating or editing gift cards (`fx:gift_card`).\n *\n * @slot name:before\n * @slot name:after\n *\n * @slot currency:before\n * @slot currency:after\n *\n * @slot expires:before\n * @slot expires:after\n *\n * @slot codes:before\n * @slot codes:after\n *\n * @slot product-restrictions:before\n * @slot product-restrictions:after\n *\n * @slot category-restrictions:before\n * @slot category-restrictions:after\n *\n * @slot timestamps:before\n * @slot timestamps:after\n *\n * @slot delete:before\n * @slot delete:after\n *\n * @slot create:before\n * @slot create:after\n *\n * @element foxy-gift-card-form\n * @since 1.15.0\n */\nexport class GiftCardForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'vaadin-button': customElements.get('vaadin-button'),\n\n 'iron-icon': customElements.get('iron-icon'),\n\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-query-builder': customElements.get('foxy-query-builder'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'foxy-pagination': customElements.get('foxy-pagination'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-table': customElements.get('foxy-table'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n\n 'x-category-restrictions-page': CategoryRestrictionsPage,\n 'x-frequency-input': FrequencyInput,\n 'x-property-table': PropertyTable,\n 'x-editable-list': EditableList,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __codesTableQuery: { attribute: false },\n __itemCategories: { attribute: false },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name_required',\n ({ name: v }) => !v || v.length <= 50 || 'name_too_long',\n ];\n }\n\n private __codesTableColumns: Column<GiftCardCodes>[] = [\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"code\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <vaadin-button\n theme=\"tertiary contrast\"\n class=\"p-0\"\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#code-dialog')!;\n const button = evt.currentTarget as ButtonElement;\n\n dialog.href = ctx.data._links.self.href;\n dialog.show(button);\n }}\n >\n <span class=\"font-tnum\">${ctx.data.code}</span>\n </vaadin-button>\n `,\n },\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"date_created\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.date_created })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n hideBelow: 'sm',\n header: c => html`<foxy-i18n lang=${c.lang} key=\"date_modified\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.date_modified })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n header: c => html`<foxy-i18n lang=${c.lang} key=\"used_codes\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`${ctx.data.current_balance}`,\n },\n ];\n\n private static readonly __codesQueryOptions: Option[] = [\n { label: 'code', path: 'code', type: Type.String },\n { label: 'current_balance', path: 'current_balance', type: Type.Number },\n { label: 'end_date', path: 'end_date', type: Type.Date },\n { label: 'date_created', path: 'date_created', type: Type.Date },\n { label: 'date_modified', path: 'date_modified', type: Type.Date },\n ];\n\n private __codesTableQuery: string | null = null;\n\n private __itemCategories = '';\n\n render(): TemplateResult {\n const hidden = this.hiddenSelector;\n const isNameHidden = hidden.matches('name', true);\n const isCurrencyHidden = hidden.matches('currency', true);\n const isExpiresHidden = hidden.matches('expires', true);\n\n return html`\n <div class=\"relative space-y-l\">\n ${isNameHidden && isCurrencyHidden && isExpiresHidden\n ? ''\n : html`\n <div class=\"grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m\">\n ${isNameHidden ? '' : html`<div class=\"md-col-span-2\">${this.__renderName()}</div>`}\n ${isCurrencyHidden ? '' : this.__renderCurrency()}\n ${isExpiresHidden ? '' : this.__renderExpires()}\n </div>\n `}\n ${hidden.matches('codes', true) || !this.data ? '' : this.__renderCodes()}\n ${hidden.matches('product-restrictions', true) ? '' : this.__renderProductRestrictions()}\n ${hidden.matches('category-restrictions', true) || !this.data\n ? ''\n : this.__renderCategoryRestrictions()}\n ${hidden.matches('timestamps', true) ? '' : this.__renderTimestamps()}\n ${hidden.matches('create', true) || !!this.data ? '' : this.__renderCreate()}\n ${hidden.matches('delete', true) || !this.data ? '' : this.__renderDelete()}\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !this.in('busy') && !this.in('fail'),\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : this.in('busy') ? 'busy' : 'empty'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n protected async _sendGet(): Promise<Data> {\n type Store = Resource<Rels.Store>;\n\n const giftCard = await super._sendGet();\n const store = await super._fetch<Store>(giftCard._links['fx:store'].href);\n const categoriesURL = new URL(store._links['fx:item_categories'].href);\n\n categoriesURL.searchParams.set('limit', '5');\n this.__itemCategories = categoriesURL.toString();\n\n return giftCard;\n }\n\n private __getErrorMessage(prefix: string) {\n const error = this.errors.find(err => err.startsWith(prefix));\n return error ? this.t(error.replace(prefix, 'v8n')).toString() : '';\n }\n\n private __getValidator(prefix: string) {\n return () => !this.errors.some(err => err.startsWith(prefix));\n }\n\n private __renderName() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('name:before')}\n\n <vaadin-text-field\n error-message=${this.__getErrorMessage('name')}\n helper-text=${this.t('gift_card_name_helper_text')}\n data-testid=\"name\"\n class=\"w-full\"\n label=${this.t('name')}\n .checkValidity=${this.__getValidator('name')}\n .value=${this.form.name ?? ''}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('name', true)}\n ?readonly=${this.readonlySelector.matches('name', true)}\n required\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: CustomEvent) => {\n const newName = (evt.currentTarget as TextFieldElement).value;\n this.edit({ name: newName });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('name:after')}\n </div>\n `;\n }\n\n private __renderCurrency() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('currency:before')}\n\n <vaadin-combo-box\n item-label-path=\"label\"\n item-value-path=\"value\"\n item-id-path=\"value\"\n class=\"w-full\"\n label=${this.t('currency')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('currency', true)}\n ?readonly=${this.readonlySelector.matches('currency', true)}\n .value=${this.form.currency_code?.toLowerCase() ?? ''}\n .items=${currencies.map(code => ({\n label: `${this.t(`currency_${code}`)} (${code.toUpperCase()})`,\n value: code,\n }))}\n @change=${(evt: CustomEvent) => {\n const comboBox = evt.currentTarget as ComboBoxElement;\n this.edit({ currency_code: comboBox.value });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('currency:after')}\n </div>\n `;\n }\n\n private __renderExpires() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('expires:before')}\n\n <x-frequency-input\n class=\"w-full\"\n label=${this.t('expires_after')}\n placeholder=${this.t('select')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('expires', true)}\n ?readonly=${this.readonlySelector.matches('expires', true)}\n .value=${this.form.expires_after ?? ''}\n @change=${(evt: FrequencyInputChangeEvent) => {\n const input = evt.currentTarget as FrequencyInput;\n this.edit({ expires_after: input.value });\n }}\n >\n </x-frequency-input>\n\n ${this.renderTemplateOrSlot('expires:after')}\n </div>\n `;\n }\n\n private __renderCodes() {\n const { disabledSelector, group, data, lang, ns } = this;\n\n const isDisabled = !this.in('idle') || disabledSelector.matches('codes', true);\n const filters = this.__codesTableQuery;\n const url = new URL(data!._links['fx:gift_card_codes'].href);\n\n new URLSearchParams(filters ?? '').forEach((value, name) => url.searchParams.set(name, value));\n url.searchParams.set('limit', '5');\n\n const filterButtonLabel = filters === null ? 'filter' : 'clear_filters';\n const filterButtonIcon = `icons:${filters === null ? 'filter-list' : 'clear'}`;\n\n return html`\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:generate:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:generate:form').toString()}\n hiddencontrols=\"save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}\"\n header=\"generate\"\n parent=${data?._links['fx:generate_codes'].href ?? ''}\n group=${group}\n lang=${lang}\n form=\"foxy-generate-codes-form\"\n ns=${ns}\n id=\"generate-codes-dialog\"\n alert\n .related=${[url.toString()]}\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:form').toString()}\n hiddencontrols=${this.hiddenSelector.zoom('codes:form').toString()}\n header=\"code\"\n parent=${url.toString()}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-code-form\"\n ns=${ns}\n id=\"code-dialog\"\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:import:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:import:form').toString()}\n hiddencontrols=\"save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}\"\n header=\"import\"\n parent=${data!._links['fx:gift_card_codes'].href}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-codes-form\"\n ns=${ns}\n id=\"import-dialog\"\n >\n </foxy-form-dialog>\n\n <div>\n ${this.renderTemplateOrSlot('codes:before')}\n\n <div class=\"flex items-center justify-between mb-xs space-x-s\">\n <foxy-i18n\n class=\"text-s font-medium text-secondary leading-none flex-1\"\n lang=${lang}\n key=\"code_plural\"\n ns=${ns}\n >\n </foxy-i18n>\n\n <vaadin-button\n theme=\"success tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#generate-codes-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"generate\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n theme=\"contrast tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#import-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"import\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:open-in-browser\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n theme=\"contrast ${filters === null ? 'tertiary' : ''} small\"\n ?disabled=${isDisabled}\n @click=${() => (this.__codesTableQuery = filters === null ? '' : null)}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=${filterButtonLabel} ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=${filterButtonIcon}></iron-icon>\n </vaadin-button>\n </div>\n\n <foxy-query-builder\n class=\"bg-contrast-5 rounded-tl-l rounded-tr-s rounded-b-l p-m mb-s\"\n lang=${lang}\n ns=${ns}\n ?disabled=${isDisabled}\n ?hidden=${filters === null}\n .options=${GiftCardForm.__codesQueryOptions}\n .value=${filters ?? ''}\n @change=${(evt: CustomEvent) => {\n const queryBuilder = evt.currentTarget as QueryBuilder;\n this.__codesTableQuery = queryBuilder.value;\n }}\n >\n </foxy-query-builder>\n\n <foxy-pagination first=${url.toString()} lang=${lang} ns=${ns} ?disabled=${isDisabled}>\n <foxy-table\n class=\"px-m mb-s border border-contrast-10 rounded-t-l rounded-b-l\"\n group=${group}\n lang=${lang}\n ns=${ns}\n .columns=${this.__codesTableColumns}\n >\n </foxy-table>\n </foxy-pagination>\n\n ${this.renderTemplateOrSlot('codes:after')}\n </div>\n `;\n }\n\n private __renderProductRestrictions() {\n const scope = 'product-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n const restrictions = this.form.product_code_restrictions ?? '';\n\n const groups = [\n { header: 'allow', items: [] as { label?: string; value: string }[] },\n { header: 'block', items: [] as { label?: string; value: string }[] },\n ];\n\n if (restrictions) {\n restrictions.split(',').forEach(value => {\n const isBlocklistValue = value.startsWith('-');\n const target = isBlocklistValue ? 1 : 0;\n const label = isBlocklistValue ? value.substring(1) : value;\n\n groups[target].items.push({ label, value });\n });\n }\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('product-restrictions:before')}\n\n <div class=\"space-y-s\">\n <x-group frame>\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-secondary'}\n slot=\"header\"\n lang=${this.lang}\n key=\"product_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div class=\"grid sm-grid-cols-2 bg-contrast-10\" style=\"gap: 1px\">\n ${groups.map((group, index) => {\n return html`\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-tertiary'}\n slot=\"header\"\n lang=${this.lang}\n key=${group.header}\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-editable-list\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n .items=${group.items}\n @change=${(evt: CustomEvent) => {\n const newItemsByGroup = [\n index === 0 ? (evt.currentTarget as EditableList).items : groups[0].items,\n index === 1 ? (evt.currentTarget as EditableList).items : groups[1].items,\n ];\n\n const newSanitizedItemsByGroup = newItemsByGroup\n .map(list => list.map(v => v.value.replace(/^[\\s-]*/, '').trimEnd()))\n .map(list => list.filter(v => !!v))\n .map(list => Array.from(new Set(list)));\n\n const newRestrictions = newSanitizedItemsByGroup[0]\n .concat(newSanitizedItemsByGroup[1].map(v => `-${v}`))\n .join(',');\n\n this.edit({ product_code_restrictions: newRestrictions });\n }}\n >\n </x-editable-list>\n </x-group>\n `;\n })}\n </div>\n </x-group>\n\n <foxy-i18n\n class=${classMap({\n 'block text-xs leading-s transition-colors': true,\n 'text-secondary': !isDisabled,\n 'text-disabled': isDisabled,\n })}\n lang=${this.lang}\n key=\"gift_card_product_restrictions_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('product-restrictions:after')}\n </div>\n `;\n }\n\n private __renderCategoryRestrictions() {\n const scope = 'category-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n\n return html`\n ${this.renderTemplateOrSlot('category-restrictions:before')}\n\n <div class=\"space-y-xs\">\n <foxy-pagination\n first=${this.__itemCategories}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n >\n <foxy-i18n\n class=\"block text-s font-medium text-secondary leading-none mb-s\"\n lang=${this.lang}\n key=\"category_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-category-restrictions-page\n gift-card-item-categories=${ifDefined(\n this.data?._links['fx:gift_card_item_categories'].href\n )}\n gift-card=${this.href}\n class=\"border border-contrast-10 rounded-t-l rounded-b-l mb-s\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n >\n </x-category-restrictions-page>\n </foxy-pagination>\n\n <foxy-i18n\n class=\"block text-xs leading-s text-secondary\"\n lang=${this.lang}\n key=\"gift_card_category_restrictions_helper_text\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('category-restrictions:after')}\n `;\n }\n\n private __renderTimestamps() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n\n <x-property-table\n data-testid=\"timestamps\"\n .items=${(['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data?.[field]\n ? this.t('date', { value: new Date(this.data[field] as string) })\n : '',\n }))}\n >\n </x-property-table>\n\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n }\n\n private __renderCreate() {\n const isCleanTemplateInvalid = this.in({ idle: { template: { clean: 'invalid' } } });\n const isDirtyTemplateInvalid = this.in({ idle: { template: { dirty: 'invalid' } } });\n const isCleanSnapshotInvalid = this.in({ idle: { snapshot: { clean: 'invalid' } } });\n const isDirtySnapshotInvalid = this.in({ idle: { snapshot: { dirty: 'invalid' } } });\n const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;\n const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;\n const isInvalid = isTemplateInvalid || isSnaphotInvalid;\n const isBusy = this.in('busy');\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('create:before')}\n\n <vaadin-button\n data-testid=\"create\"\n class=\"w-full\"\n theme=\"primary success\"\n ?disabled=${isBusy || isInvalid || this.disabledSelector.matches('create', true)}\n @click=${this.submit}\n >\n <foxy-i18n ns=${this.ns} key=\"create\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n }\n\n private __renderDelete() {\n return html`\n <div>\n <foxy-internal-confirm-dialog\n data-testid=\"confirm\"\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"confirm\"\n @hide=${(evt: DialogHideEvent) => !evt.detail.cancelled && this.delete()}\n >\n </foxy-internal-confirm-dialog>\n\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n data-testid=\"delete\"\n theme=\"primary error\"\n class=\"w-full\"\n ?disabled=${this.in('busy') || this.disabledSelector.matches('delete', true)}\n @click=${(evt: CustomEvent) => {\n const confirm = this.renderRoot.querySelector('#confirm') as InternalConfirmDialog;\n confirm.show(evt.currentTarget as ButtonElement);\n }}\n >\n <foxy-i18n ns=${this.ns} key=\"delete\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GiftCardForm.js","sourceRoot":"","sources":["../../../../src/elements/public/GiftCardForm/GiftCardForm.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,IAAI,EAAE,iCAA8B;AACrD,OAAO,EAAwC,IAAI,EAAE,MAAM,aAAa,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,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;CACnE,CAAC","sourcesContent":["import { Data, GiftCardCodes } from './types';\nimport { Option, Type } from '../QueryBuilder/types';\nimport { PropertyDeclarations, TemplateResult, html } from 'lit-element';\nimport { ScopedElementsMap, ScopedElementsMixin } from '@open-wc/scoped-elements';\n\nimport { ButtonElement } from '@vaadin/vaadin-button';\nimport { CategoryRestrictionsPage } from './private/CategoryRestrictionsPage';\nimport { Column } from '../Table/types';\nimport { ComboBoxElement } from '@vaadin/vaadin-combo-box';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport { EditableList } from '../../private/EditableList/EditableList';\nimport { FormDialog } from '../FormDialog';\nimport { FrequencyInput } from '../../private/FrequencyInput/FrequencyInput';\nimport { FrequencyInputChangeEvent } from '../../private/FrequencyInput/FrequencyInputChangeEvent';\nimport { Group } from '../../private/Group/Group';\nimport { InternalConfirmDialog } from '../../internal/InternalConfirmDialog/InternalConfirmDialog';\nimport { NucleonElement } from '../NucleonElement/NucleonElement';\nimport { NucleonV8N } from '../NucleonElement/types';\nimport { PropertyTable } from '../../private/PropertyTable/PropertyTable';\nimport { QueryBuilder } from '../QueryBuilder/QueryBuilder';\nimport { Rels } from '@foxy.io/sdk/backend';\nimport { Resource } from '@foxy.io/sdk/core';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { TextFieldElement } from '@vaadin/vaadin-text-field';\nimport { ThemeableMixin } from '../../../mixins/themeable';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { classMap } from '../../../utils/class-map';\nimport { currencies } from './currencies';\nimport { ifDefined } from 'lit-html/directives/if-defined';\n\nconst NS = 'gift-card-form';\nconst Base = ScopedElementsMixin(\n ThemeableMixin(ConfigurableMixin(ResponsiveMixin(TranslatableMixin(NucleonElement, NS))))\n);\n\n/**\n * Form element for creating or editing gift cards (`fx:gift_card`).\n *\n * @slot name:before\n * @slot name:after\n *\n * @slot currency:before\n * @slot currency:after\n *\n * @slot expires:before\n * @slot expires:after\n *\n * @slot codes:before\n * @slot codes:after\n *\n * @slot product-restrictions:before\n * @slot product-restrictions:after\n *\n * @slot category-restrictions:before\n * @slot category-restrictions:after\n *\n * @slot timestamps:before\n * @slot timestamps:after\n *\n * @slot delete:before\n * @slot delete:after\n *\n * @slot create:before\n * @slot create:after\n *\n * @element foxy-gift-card-form\n * @since 1.15.0\n */\nexport class GiftCardForm extends Base<Data> {\n static get scopedElements(): ScopedElementsMap {\n return {\n 'vaadin-text-field': customElements.get('vaadin-text-field'),\n 'vaadin-combo-box': customElements.get('vaadin-combo-box'),\n 'vaadin-button': customElements.get('vaadin-button'),\n\n 'iron-icon': customElements.get('iron-icon'),\n\n 'foxy-internal-confirm-dialog': customElements.get('foxy-internal-confirm-dialog'),\n 'foxy-internal-sandbox': customElements.get('foxy-internal-sandbox'),\n 'foxy-query-builder': customElements.get('foxy-query-builder'),\n 'foxy-form-dialog': customElements.get('foxy-form-dialog'),\n 'foxy-pagination': customElements.get('foxy-pagination'),\n 'foxy-spinner': customElements.get('foxy-spinner'),\n 'foxy-table': customElements.get('foxy-table'),\n 'foxy-i18n': customElements.get('foxy-i18n'),\n\n 'x-category-restrictions-page': CategoryRestrictionsPage,\n 'x-frequency-input': FrequencyInput,\n 'x-property-table': PropertyTable,\n 'x-editable-list': EditableList,\n 'x-group': Group,\n };\n }\n\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n __codesTableQuery: { attribute: false },\n __itemCategories: { attribute: false },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name_required',\n ({ name: v }) => !v || v.length <= 50 || 'name_too_long',\n ];\n }\n\n private __codesTableColumns: Column<GiftCardCodes>[] = [\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"code\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <vaadin-button\n theme=\"tertiary contrast\"\n class=\"p-0\"\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#code-dialog')!;\n const button = evt.currentTarget as ButtonElement;\n\n dialog.href = ctx.data._links.self.href;\n dialog.show(button);\n }}\n >\n <span class=\"font-tnum\">${ctx.data.code}</span>\n </vaadin-button>\n `,\n },\n {\n header: ctx => html`<foxy-i18n lang=${ctx.lang} key=\"date_created\" ns=${ctx.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.date_created })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n hideBelow: 'sm',\n header: c => html`<foxy-i18n lang=${c.lang} key=\"end_date\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({ value: ctx.data.end_date })}\n class=\"text-tertiary\"\n lang=${ctx.lang}\n key=\"date\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n {\n header: c => html`<foxy-i18n lang=${c.lang} key=\"current_balance\" ns=${c.ns}></foxy-i18n>`,\n cell: ctx => html`\n <foxy-i18n\n options=${JSON.stringify({\n amount: `${ctx.data.current_balance} ${this.data?.currency_code}`,\n currencyDisplay: this.__currencyDisplay,\n })}\n lang=${ctx.lang}\n key=\"price\"\n ns=${ctx.ns}\n >\n </foxy-i18n>\n `,\n },\n ];\n\n private static readonly __codesQueryOptions: Option[] = [\n { label: 'code', path: 'code', type: Type.String },\n { label: 'current_balance', path: 'current_balance', type: Type.Number },\n { label: 'end_date', path: 'end_date', type: Type.Date },\n { label: 'date_created', path: 'date_created', type: Type.Date },\n { label: 'date_modified', path: 'date_modified', type: Type.Date },\n ];\n\n private __codesTableQuery: string | null = null;\n\n private __currencyDisplay = '';\n\n private __itemCategories = '';\n\n render(): TemplateResult {\n const hidden = this.hiddenSelector;\n const isNameHidden = hidden.matches('name', true);\n const isCurrencyHidden = hidden.matches('currency', true);\n const isExpiresHidden = hidden.matches('expires', true);\n\n return html`\n <div class=\"relative space-y-l\">\n ${isNameHidden && isCurrencyHidden && isExpiresHidden\n ? ''\n : html`\n <div class=\"grid grid-cols-1 sm-grid-cols-3 md-grid-cols-4 gap-m\">\n ${isNameHidden ? '' : html`<div class=\"md-col-span-2\">${this.__renderName()}</div>`}\n ${isCurrencyHidden ? '' : this.__renderCurrency()}\n ${isExpiresHidden ? '' : this.__renderExpires()}\n </div>\n `}\n ${hidden.matches('codes', true) || !this.data ? '' : this.__renderCodes()}\n ${hidden.matches('product-restrictions', true) ? '' : this.__renderProductRestrictions()}\n ${hidden.matches('category-restrictions', true) || !this.data\n ? ''\n : this.__renderCategoryRestrictions()}\n ${hidden.matches('timestamps', true) ? '' : this.__renderTimestamps()}\n ${hidden.matches('create', true) || !!this.data ? '' : this.__renderCreate()}\n ${hidden.matches('delete', true) || !this.data ? '' : this.__renderDelete()}\n\n <div\n data-testid=\"spinner\"\n class=${classMap({\n 'transition duration-500 ease-in-out absolute inset-0 flex': true,\n 'opacity-0 pointer-events-none': !this.in('busy') && !this.in('fail'),\n })}\n >\n <foxy-spinner\n layout=\"vertical\"\n class=\"m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l\"\n state=${this.in('fail') ? 'error' : this.in('busy') ? 'busy' : 'empty'}\n lang=${this.lang}\n ns=\"${this.ns} ${customElements.get('foxy-spinner')?.defaultNS ?? ''}\"\n >\n </foxy-spinner>\n </div>\n </div>\n `;\n }\n\n protected async _sendGet(): Promise<Data> {\n type Store = Resource<Rels.Store>;\n\n const giftCard = await super._sendGet();\n const store = await super._fetch<Store>(giftCard._links['fx:store'].href);\n const categoriesURL = new URL(store._links['fx:item_categories'].href);\n\n categoriesURL.searchParams.set('limit', '5');\n this.__currencyDisplay = store.use_international_currency_symbol ? 'code' : 'symbol';\n this.__itemCategories = categoriesURL.toString();\n\n return giftCard;\n }\n\n private __getErrorMessage(prefix: string) {\n const error = this.errors.find(err => err.startsWith(prefix));\n return error ? this.t(error.replace(prefix, 'v8n')).toString() : '';\n }\n\n private __getValidator(prefix: string) {\n return () => !this.errors.some(err => err.startsWith(prefix));\n }\n\n private __renderName() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('name:before')}\n\n <vaadin-text-field\n error-message=${this.__getErrorMessage('name')}\n helper-text=${this.t('gift_card_name_helper_text')}\n data-testid=\"name\"\n class=\"w-full\"\n label=${this.t('name')}\n .checkValidity=${this.__getValidator('name')}\n .value=${this.form.name ?? ''}\n ?disabled=${this.in('busy') || this.disabledSelector.matches('name', true)}\n ?readonly=${this.readonlySelector.matches('name', true)}\n required\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.submit()}\n @input=${(evt: CustomEvent) => {\n const newName = (evt.currentTarget as TextFieldElement).value;\n this.edit({ name: newName });\n }}\n >\n </vaadin-text-field>\n\n ${this.renderTemplateOrSlot('name:after')}\n </div>\n `;\n }\n\n private __renderCurrency() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('currency:before')}\n\n <vaadin-combo-box\n item-label-path=\"label\"\n item-value-path=\"value\"\n item-id-path=\"value\"\n class=\"w-full\"\n label=${this.t('currency')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('currency', true)}\n ?readonly=${this.readonlySelector.matches('currency', true)}\n .value=${this.form.currency_code?.toLowerCase() ?? ''}\n .items=${currencies.map(code => ({\n label: `${this.t(`currency_${code}`)} (${code.toUpperCase()})`,\n value: code,\n }))}\n @change=${(evt: CustomEvent) => {\n const comboBox = evt.currentTarget as ComboBoxElement;\n this.edit({ currency_code: comboBox.value });\n }}\n >\n </vaadin-combo-box>\n\n ${this.renderTemplateOrSlot('currency:after')}\n </div>\n `;\n }\n\n private __renderExpires() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('expires:before')}\n\n <x-frequency-input\n class=\"w-full\"\n label=${this.t('expires_after')}\n placeholder=${this.t('select')}\n ?disabled=${!this.in('idle') || this.disabledSelector.matches('expires', true)}\n ?readonly=${this.readonlySelector.matches('expires', true)}\n .value=${this.form.expires_after ?? ''}\n @change=${(evt: FrequencyInputChangeEvent) => {\n const input = evt.currentTarget as FrequencyInput;\n this.edit({ expires_after: input.value });\n }}\n >\n </x-frequency-input>\n\n ${this.renderTemplateOrSlot('expires:after')}\n </div>\n `;\n }\n\n private __renderCodes() {\n const { disabledSelector, group, data, lang, ns } = this;\n\n const isDisabled = !this.in('idle') || disabledSelector.matches('codes', true);\n const filters = this.__codesTableQuery;\n const url = new URL(data!._links['fx:gift_card_codes'].href);\n\n new URLSearchParams(filters ?? '').forEach((value, name) => url.searchParams.set(name, value));\n url.searchParams.set('limit', '5');\n\n const filterButtonLabel = filters === null ? 'filter' : 'clear_filters';\n const filterButtonIcon = `icons:${filters === null ? 'filter-list' : 'clear'}`;\n\n return html`\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:generate:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:generate:form').toString()}\n hiddencontrols=\"save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}\"\n header=\"generate\"\n parent=${data?._links['fx:generate_codes'].href ?? ''}\n group=${group}\n lang=${lang}\n form=\"foxy-generate-codes-form\"\n ns=${ns}\n id=\"generate-codes-dialog\"\n alert\n .related=${[url.toString()]}\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:form').toString()}\n hiddencontrols=${this.hiddenSelector.zoom('codes:form').toString()}\n header=\"code\"\n parent=${url.toString()}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-code-form\"\n ns=${ns}\n id=\"code-dialog\"\n >\n </foxy-form-dialog>\n\n <foxy-form-dialog\n disabledcontrols=${disabledSelector.zoom('codes:import:form').toString()}\n readonlycontrols=${this.readonlySelector.zoom('codes:import:form').toString()}\n hiddencontrols=\"save-button ${this.hiddenSelector.zoom('codes:generate:form').toString()}\"\n header=\"import\"\n parent=${data!._links['fx:gift_card_codes'].href}\n group=${group}\n lang=${lang}\n form=\"foxy-gift-card-codes-form\"\n ns=${ns}\n id=\"import-dialog\"\n >\n </foxy-form-dialog>\n\n <div>\n ${this.renderTemplateOrSlot('codes:before')}\n\n <div class=\"flex items-center justify-between mb-xs space-x-s\">\n <foxy-i18n\n class=\"text-s font-medium text-secondary leading-none flex-1\"\n lang=${lang}\n key=\"code_plural\"\n ns=${ns}\n >\n </foxy-i18n>\n\n <vaadin-button\n theme=\"success tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#generate-codes-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"generate\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:add\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n theme=\"contrast tertiary small\"\n ?disabled=${isDisabled}\n @click=${(evt: CustomEvent) => {\n const dialog = this.renderRoot.querySelector<FormDialog>('#import-dialog');\n const button = evt.currentTarget as ButtonElement;\n dialog?.show(button);\n }}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=\"import\" ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=\"icons:open-in-browser\"></iron-icon>\n </vaadin-button>\n\n <vaadin-button\n theme=\"contrast ${filters === null ? 'tertiary' : ''} small\"\n ?disabled=${isDisabled}\n @click=${() => (this.__codesTableQuery = filters === null ? '' : null)}\n >\n <foxy-i18n class=\"text-s\" lang=${lang} key=${filterButtonLabel} ns=${ns}></foxy-i18n>\n <iron-icon class=\"icon-inline text-s\" icon=${filterButtonIcon}></iron-icon>\n </vaadin-button>\n </div>\n\n <foxy-query-builder\n class=\"bg-contrast-5 rounded-tl-l rounded-tr-s rounded-b-l p-m mb-s\"\n lang=${lang}\n ns=${ns}\n ?disabled=${isDisabled}\n ?hidden=${filters === null}\n .options=${GiftCardForm.__codesQueryOptions}\n .value=${filters ?? ''}\n @change=${(evt: CustomEvent) => {\n const queryBuilder = evt.currentTarget as QueryBuilder;\n this.__codesTableQuery = queryBuilder.value;\n }}\n >\n </foxy-query-builder>\n\n <foxy-pagination first=${url.toString()} lang=${lang} ns=${ns} ?disabled=${isDisabled}>\n <foxy-table\n class=\"px-m mb-s border border-contrast-10 rounded-t-l rounded-b-l\"\n group=${group}\n lang=${lang}\n ns=${ns}\n .columns=${this.__codesTableColumns}\n >\n </foxy-table>\n </foxy-pagination>\n\n ${this.renderTemplateOrSlot('codes:after')}\n </div>\n `;\n }\n\n private __renderProductRestrictions() {\n const scope = 'product-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n const restrictions = this.form.product_code_restrictions ?? '';\n\n const groups = [\n { header: 'allow', items: [] as { label?: string; value: string }[] },\n { header: 'block', items: [] as { label?: string; value: string }[] },\n ];\n\n if (restrictions) {\n restrictions.split(',').forEach(value => {\n const isBlocklistValue = value.startsWith('-');\n const target = isBlocklistValue ? 1 : 0;\n const label = isBlocklistValue ? value.substring(1) : value;\n\n groups[target].items.push({ label, value });\n });\n }\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('product-restrictions:before')}\n\n <div class=\"space-y-s\">\n <x-group frame>\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-secondary'}\n slot=\"header\"\n lang=${this.lang}\n key=\"product_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <div class=\"grid sm-grid-cols-2 bg-contrast-10\" style=\"gap: 1px\">\n ${groups.map((group, index) => {\n return html`\n <x-group class=\"bg-base pt-m\">\n <foxy-i18n\n class=${isDisabled ? 'text-disabled' : 'text-tertiary'}\n slot=\"header\"\n lang=${this.lang}\n key=${group.header}\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-editable-list\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n .items=${group.items}\n @change=${(evt: CustomEvent) => {\n const newItemsByGroup = [\n index === 0 ? (evt.currentTarget as EditableList).items : groups[0].items,\n index === 1 ? (evt.currentTarget as EditableList).items : groups[1].items,\n ];\n\n const newSanitizedItemsByGroup = newItemsByGroup\n .map(list => list.map(v => v.value.replace(/^[\\s-]*/, '').trimEnd()))\n .map(list => list.filter(v => !!v))\n .map(list => Array.from(new Set(list)));\n\n const newRestrictions = newSanitizedItemsByGroup[0]\n .concat(newSanitizedItemsByGroup[1].map(v => `-${v}`))\n .join(',');\n\n this.edit({ product_code_restrictions: newRestrictions });\n }}\n >\n </x-editable-list>\n </x-group>\n `;\n })}\n </div>\n </x-group>\n\n <foxy-i18n\n class=${classMap({\n 'block text-xs leading-s transition-colors': true,\n 'text-secondary': !isDisabled,\n 'text-disabled': isDisabled,\n })}\n lang=${this.lang}\n key=\"gift_card_product_restrictions_explainer\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('product-restrictions:after')}\n </div>\n `;\n }\n\n private __renderCategoryRestrictions() {\n const scope = 'category-restrictions';\n const isDisabled = !this.in('idle') || this.disabledSelector.matches(scope, true);\n const isReadonly = this.readonlySelector.matches(scope, true);\n\n return html`\n ${this.renderTemplateOrSlot('category-restrictions:before')}\n\n <div class=\"space-y-xs\">\n <foxy-pagination\n first=${this.__itemCategories}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n >\n <foxy-i18n\n class=\"block text-s font-medium text-secondary leading-none mb-s\"\n lang=${this.lang}\n key=\"category_restrictions\"\n ns=${this.ns}\n >\n </foxy-i18n>\n\n <x-category-restrictions-page\n gift-card-item-categories=${ifDefined(\n this.data?._links['fx:gift_card_item_categories'].href\n )}\n gift-card=${this.href}\n class=\"border border-contrast-10 rounded-t-l rounded-b-l mb-s\"\n group=${this.group}\n lang=${this.lang}\n ns=${this.ns}\n ?disabled=${isDisabled}\n ?readonly=${isReadonly}\n >\n </x-category-restrictions-page>\n </foxy-pagination>\n\n <foxy-i18n\n class=\"block text-xs leading-s text-secondary\"\n lang=${this.lang}\n key=\"gift_card_category_restrictions_helper_text\"\n ns=${this.ns}\n >\n </foxy-i18n>\n </div>\n\n ${this.renderTemplateOrSlot('category-restrictions:after')}\n `;\n }\n\n private __renderTimestamps() {\n return html`\n <div>\n ${this.renderTemplateOrSlot('timestamps:before')}\n\n <x-property-table\n data-testid=\"timestamps\"\n .items=${(['date_modified', 'date_created'] as const).map(field => ({\n name: this.t(field),\n value: this.data?.[field]\n ? this.t('date', { value: new Date(this.data[field] as string) })\n : '',\n }))}\n >\n </x-property-table>\n\n ${this.renderTemplateOrSlot('timestamps:after')}\n </div>\n `;\n }\n\n private __renderCreate() {\n const isCleanTemplateInvalid = this.in({ idle: { template: { clean: 'invalid' } } });\n const isDirtyTemplateInvalid = this.in({ idle: { template: { dirty: 'invalid' } } });\n const isCleanSnapshotInvalid = this.in({ idle: { snapshot: { clean: 'invalid' } } });\n const isDirtySnapshotInvalid = this.in({ idle: { snapshot: { dirty: 'invalid' } } });\n const isTemplateInvalid = isCleanTemplateInvalid || isDirtyTemplateInvalid;\n const isSnaphotInvalid = isCleanSnapshotInvalid || isDirtySnapshotInvalid;\n const isInvalid = isTemplateInvalid || isSnaphotInvalid;\n const isBusy = this.in('busy');\n\n return html`\n <div>\n ${this.renderTemplateOrSlot('create:before')}\n\n <vaadin-button\n data-testid=\"create\"\n class=\"w-full\"\n theme=\"primary success\"\n ?disabled=${isBusy || isInvalid || this.disabledSelector.matches('create', true)}\n @click=${this.submit}\n >\n <foxy-i18n ns=${this.ns} key=\"create\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('create:after')}\n </div>\n `;\n }\n\n private __renderDelete() {\n return html`\n <div>\n <foxy-internal-confirm-dialog\n data-testid=\"confirm\"\n message=\"delete_prompt\"\n confirm=\"delete\"\n cancel=\"cancel\"\n header=\"delete\"\n theme=\"primary error\"\n lang=${this.lang}\n ns=${this.ns}\n id=\"confirm\"\n @hide=${(evt: DialogHideEvent) => !evt.detail.cancelled && this.delete()}\n >\n </foxy-internal-confirm-dialog>\n\n ${this.renderTemplateOrSlot('delete:before')}\n\n <vaadin-button\n data-testid=\"delete\"\n theme=\"primary error\"\n class=\"w-full\"\n ?disabled=${this.in('busy') || this.disabledSelector.matches('delete', true)}\n @click=${(evt: CustomEvent) => {\n const confirm = this.renderRoot.querySelector('#confirm') as InternalConfirmDialog;\n confirm.show(evt.currentTarget as ButtonElement);\n }}\n >\n <foxy-i18n ns=${this.ns} key=\"delete\" lang=${this.lang}></foxy-i18n>\n </vaadin-button>\n\n ${this.renderTemplateOrSlot('delete:after')}\n </div>\n `;\n }\n}\n"]}
|
|
@@ -3,9 +3,11 @@ import { discount } from "./discount.js";
|
|
|
3
3
|
import { ordinal } from "./ordinal.js";
|
|
4
4
|
import { percent } from "./percent.js";
|
|
5
5
|
import { price } from "./price.js";
|
|
6
|
+
import { relative } from "./relative.js";
|
|
6
7
|
import { time } from "./time.js";
|
|
7
8
|
const formatters = {
|
|
8
9
|
discount,
|
|
10
|
+
relative,
|
|
9
11
|
percent,
|
|
10
12
|
ordinal,
|
|
11
13
|
price,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/elements/public/I18n/format/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,sBAAmB;AACtC,OAAO,EAAE,OAAO,EAAE,qBAAkB;AACpC,OAAO,EAAE,OAAO,EAAE,qBAAkB;AACpC,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAChC,OAAO,EAAE,IAAI,EAAE,kBAAe;AAE9B,MAAM,UAAU,GAAmC;IACjD,QAAQ;IACR,OAAO;IACP,OAAO;IACP,KAAK;IACL,IAAI;IACJ,IAAI;CACL,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,EAAU,EAAE;IAC1F,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;;QACnD,mBAAO,UAAU,CAAC,IAAI,CAAC,+CAAhB,UAAU,EAAS,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,oCAAK,MAAM,CAAC;IAChE,CAAC,CAAC;IAEF,OAAO,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC","sourcesContent":["import { FormatFunction } from 'i18next';\nimport { date } from './date';\nimport { discount } from './discount';\nimport { ordinal } from './ordinal';\nimport { percent } from './percent';\nimport { price } from './price';\nimport { time } from './time';\n\nconst formatters: Record<string, FormatFunction> = {\n discount,\n percent,\n ordinal,\n price,\n date,\n time,\n};\n\n/**\n * Chooses the right i18next formatter for the given template.\n * @see https://www.i18next.com/translation-function/formatting\n */\nexport const format: FormatFunction = (value, names = '', lang = 'en', opts = {}): string => {\n const parsedNames = names.split(' ').filter(v => !!v.trim());\n const applyFormat = (result: string, name: string) => {\n return formatters[name]?.(result, name, lang, opts) ?? result;\n };\n\n return parsedNames.reduce(applyFormat, value);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/elements/public/I18n/format/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,QAAQ,EAAE,sBAAmB;AACtC,OAAO,EAAE,OAAO,EAAE,qBAAkB;AACpC,OAAO,EAAE,OAAO,EAAE,qBAAkB;AACpC,OAAO,EAAE,KAAK,EAAE,mBAAgB;AAChC,OAAO,EAAE,QAAQ,EAAE,sBAAmB;AACtC,OAAO,EAAE,IAAI,EAAE,kBAAe;AAE9B,MAAM,UAAU,GAAmC;IACjD,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,KAAK;IACL,IAAI;IACJ,IAAI;CACL,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,EAAE,EAAU,EAAE;IAC1F,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;;QACnD,mBAAO,UAAU,CAAC,IAAI,CAAC,+CAAhB,UAAU,EAAS,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,oCAAK,MAAM,CAAC;IAChE,CAAC,CAAC;IAEF,OAAO,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC","sourcesContent":["import { FormatFunction } from 'i18next';\nimport { date } from './date';\nimport { discount } from './discount';\nimport { ordinal } from './ordinal';\nimport { percent } from './percent';\nimport { price } from './price';\nimport { relative } from './relative';\nimport { time } from './time';\n\nconst formatters: Record<string, FormatFunction> = {\n discount,\n relative,\n percent,\n ordinal,\n price,\n date,\n time,\n};\n\n/**\n * Chooses the right i18next formatter for the given template.\n * @see https://www.i18next.com/translation-function/formatting\n */\nexport const format: FormatFunction = (value, names = '', lang = 'en', opts = {}): string => {\n const parsedNames = names.split(' ').filter(v => !!v.trim());\n const applyFormat = (result: string, name: string) => {\n return formatters[name]?.(result, name, lang, opts) ?? result;\n };\n\n return parsedNames.reduce(applyFormat, value);\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { parseDuration } from "../../../../utils/parse-duration.js";
|
|
2
|
+
/**
|
|
3
|
+
* i18next formatter that presents duration as relative time.
|
|
4
|
+
* @see https://www.i18next.com/translation-function/formatting
|
|
5
|
+
*/
|
|
6
|
+
export const relative = (value, format, lang) => {
|
|
7
|
+
const rtf = new Intl.RelativeTimeFormat(lang);
|
|
8
|
+
let { count, units } = parseDuration(value, true);
|
|
9
|
+
if (count === 0.5 && units === 'month') {
|
|
10
|
+
count = 2;
|
|
11
|
+
units = 'week';
|
|
12
|
+
}
|
|
13
|
+
return rtf.format(count, units);
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=relative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relative.js","sourceRoot":"","sources":["../../../../../src/elements/public/I18n/format/relative.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,4CAAyC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAU,EAAE;IACtE,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAElD,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,OAAO,EAAE;QACtC,KAAK,GAAG,CAAC,CAAC;QACV,KAAK,GAAG,MAAM,CAAC;KAChB;IAED,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAoC,CAAC,CAAC;AACjE,CAAC,CAAC","sourcesContent":["import { FormatFunction } from 'i18next';\nimport { parseDuration } from '../../../../utils/parse-duration';\n\n/**\n * i18next formatter that presents duration as relative time.\n * @see https://www.i18next.com/translation-function/formatting\n */\nexport const relative: FormatFunction = (value, format, lang): string => {\n const rtf = new Intl.RelativeTimeFormat(lang);\n let { count, units } = parseDuration(value, true);\n\n if (count === 0.5 && units === 'month') {\n count = 2;\n units = 'week';\n }\n\n return rtf.format(count, units as Intl.RelativeTimeFormatUnit);\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxy.io/elements",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.15.0-beta.
|
|
4
|
+
"version": "1.15.0-beta.6",
|
|
5
5
|
"description": "E-commerce web components by Foxy.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"prepack": "npm run lint && rimraf dist && node ./.build/compile-for-npm.js && rollup -c"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@foxy.io/sdk": "^1.8.
|
|
29
|
+
"@foxy.io/sdk": "^1.8.1",
|
|
30
30
|
"@open-wc/lit-helpers": "^0.3.11",
|
|
31
31
|
"@open-wc/scoped-elements": "1.2.1",
|
|
32
32
|
"@polymer/iron-icons": "^3.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./shared-bb824ab4.js";import"./shared-0ced76a0.js";import"./shared-cf6751d3.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{C as e}from"./shared-40b5267a.js";import"./shared-0032dc09.js";import"./shared-66633ff7.js";import"./shared-4cc1da27.js";import{s,h as t}from"./shared-63eaded9.js";import{S as i,T as r,a}from"./shared-e68b9c83.js";import"./shared-36629ded.js";import"./shared-ec861f31.js";import{m as n}from"./shared-5535f38f.js";import{G as l}from"./shared-02945b27.js";import"./shared-df573cea.js";import"./shared-46ee137f.js";import"./shared-f0a83bd6.js";import{c as o}from"./shared-4e709717.js";import{C as d}from"./shared-df730f90.js";import{N as h}from"./shared-39e3ae67.js";import{i as m}from"./shared-6d45a07b.js";import{v as c}from"./shared-b738ee96.js";let C,f,p,g,u=e=>e;const y=[{property:"is_merchant",icon:s(C||(C=u`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.8961 8.89L21.7932 4.52C21.5622 3.62 20.7429 3 19.7871 3H5.1979C4.25259 3 3.42283 3.63 3.20225 4.52L2.0994 8.89C1.84732 9.91 2.07839 10.95 2.75061 11.77C2.83464 11.88 2.95017 11.96 3.0447 12.06V19C3.0447 20.1 3.99001 21 5.14538 21H19.8501C21.0055 21 21.9508 20.1 21.9508 19V12.06C22.0453 11.97 22.1609 11.88 22.2449 11.78C22.9171 10.96 23.1587 9.91 22.8961 8.89ZM19.7556 4.99L20.8584 9.36C20.9635 9.78 20.8689 10.2 20.5958 10.53C20.4488 10.71 20.1337 11 19.6085 11C18.9678 11 18.4111 10.51 18.3376 9.86L17.7284 5L19.7556 4.99ZM13.5481 5H15.6067L16.1739 9.52C16.2264 9.91 16.1004 10.3 15.8273 10.59C15.5962 10.85 15.2601 11 14.8295 11C14.1258 11 13.5481 10.41 13.5481 9.69V5ZM8.81106 9.52L9.38874 5H11.4474V9.69C11.4474 10.41 10.8697 11 10.0925 11C9.73536 11 9.40975 10.85 9.15767 10.59C8.89509 10.3 8.76905 9.91 8.81106 9.52ZM4.13705 9.36L5.1979 5H7.26706L6.65787 9.86C6.57384 10.51 6.02766 11 5.38696 11C4.87229 11 4.54669 10.71 4.41014 10.53C4.12655 10.21 4.03202 9.78 4.13705 9.36ZM5.14538 19V12.97C5.22941 12.98 5.30293 13 5.38696 13C6.30075 13 7.13052 12.64 7.73971 12.05C8.36992 12.65 9.21019 13 10.166 13C11.0798 13 11.8991 12.64 12.5082 12.07C13.1279 12.64 13.9682 13 14.9135 13C15.7958 13 16.6361 12.65 17.2663 12.05C17.8755 12.64 18.7052 13 19.619 13C19.7031 13 19.7766 12.98 19.8606 12.97V19H5.14538Z" /></svg>`)),key:"merchant"},{property:"is_programmer",icon:s(f||(f=u`<svg class="fill-current h-full w-full" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 3C0 1.34315 1.34315 0 3 0H17C18.6569 0 20 1.34315 20 3V15C20 16.6569 18.6569 18 17 18H3C1.34315 18 0 16.6569 0 15V3ZM3 2C2.44772 2 2 2.44772 2 3V15C2 15.5523 2.44772 16 3 16H17C17.5523 16 18 15.5523 18 15V3C18 2.44772 17.5523 2 17 2H3ZM4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C9.89464 8.48043 10 8.73478 10 9C10 9.26522 9.89464 9.51957 9.70711 9.70711L5.70711 13.7071C5.31658 14.0976 4.68342 14.0976 4.29289 13.7071C3.90237 13.3166 3.90237 12.6834 4.29289 12.2929L7.58579 9L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289ZM9 13C9 12.4477 9.44771 12 10 12H15C15.5523 12 16 12.4477 16 13C16 13.5523 15.5523 14 15 14H10C9.44771 14 9 13.5523 9 13Z"/></svg>`)),key:"backend_developer"},{property:"is_front_end_developer",icon:s(p||(p=u`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.2747 4.03847C14.8058 4.1902 15.1132 4.74368 14.9615 5.27472L10.9615 19.2747C10.8098 19.8058 10.2563 20.1132 9.72528 19.9615C9.19424 19.8098 8.88675 19.2563 9.03848 18.7253L13.0385 4.72528C13.1902 4.19424 13.7437 3.88675 14.2747 4.03847ZM6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.7071L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289ZM17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C22.8946 11.4804 23 11.7348 23 12C23 12.2652 22.8946 12.5196 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z" /></svg>`)),key:"frontend_developer"},{property:"is_designer",icon:s(g||(g=u`<svg class="fill-current h-full w-full" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 20C4.49 20 0 15.51 0 10C0 4.49 4.49 0 10 0C15.51 0 20 4.04 20 9C20 12.31 17.31 15 14 15H12.23C11.95 15 11.73 15.22 11.73 15.5C11.73 15.62 11.78 15.73 11.86 15.83C12.27 16.3 12.5 16.89 12.5 17.5C12.5 18.88 11.38 20 10 20ZM10 2C5.59 2 2 5.59 2 10C2 14.41 5.59 18 10 18C10.28 18 10.5 17.78 10.5 17.5C10.5 17.34 10.42 17.22 10.36 17.15C9.95 16.69 9.73 16.1 9.73 15.5C9.73 14.12 10.85 13 12.23 13H14C16.21 13 18 11.21 18 9C18 5.14 14.41 2 10 2Z" /><path d="M4.5 11C5.32843 11 6 10.3284 6 9.5C6 8.67157 5.32843 8 4.5 8C3.67157 8 3 8.67157 3 9.5C3 10.3284 3.67157 11 4.5 11Z" /><path d="M7.5 7C8.32843 7 9 6.32843 9 5.5C9 4.67157 8.32843 4 7.5 4C6.67157 4 6 4.67157 6 5.5C6 6.32843 6.67157 7 7.5 7Z" /><path d="M12.5 7C13.3284 7 14 6.32843 14 5.5C14 4.67157 13.3284 4 12.5 4C11.6716 4 11 4.67157 11 5.5C11 6.32843 11.6716 7 12.5 7Z" /><path d="M15.5 11C16.3284 11 17 10.3284 17 9.5C17 8.67157 16.3284 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11Z" /></svg>`)),key:"designer"}];let v,x,_,$=e=>e;const b=i(r(d(a(h,"user-form"))));class w extends b{constructor(){super(...arguments),this.__getValidator=n((e=>()=>!this.errors.some((s=>s.startsWith(e))))),this.__bindField=n((e=>s=>{const t=s.target;this.edit({[e]:t.value})}))}static get scopedElements(){return{"foxy-internal-confirm-dialog":customElements.get("foxy-internal-confirm-dialog"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"x-checkbox":e,"foxy-i18n":customElements.get("foxy-i18n"),"x-group":l}}static get v8n(){return[({first_name:e})=>!e||e.length<=50||"first_name_too_long",({last_name:e})=>!e||e.length<=50||"last_name_too_long",({email:e})=>e&&e.length>0||"email_required",({email:e})=>e&&e.length<=100||"email_too_long",({email:e})=>e&&c(e)||"email_invalid_email",({phone:e})=>!e||e.length<=50||"phone_too_long"]}render(){const e=this.in({idle:{template:{dirty:"valid"}}}),s=this.in({idle:{snapshot:{dirty:"valid"}}}),i=e||s,r=this.in("busy"),a=this.in("fail"),n=r||a||this.disabled;return t(v||(v=$` <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <div data-testid="wrapper" aria-busy="${0}" aria-live="polite" class="space-y-l relative"> <div class="grid grid-cols-1 sm-grid-cols-2 gap-m"> ${0} </div> <x-group frame> ${0} </x-group> <vaadin-button data-testid="action" theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </vaadin-button> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0}"> </foxy-spinner> </div> </div> `),this.lang,this.ns,this.__handleConfirmHide,this.in("busy"),["first_name","last_name","email","phone"].map((e=>t(x||(x=$` <vaadin-text-field error-message="${0}" data-testid="${0}" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" @input="${0}" @keydown="${0}"> </vaadin-text-field> `),this.__getErrorMessage(e),e,n,this.readonly,this.t(e),m(this.form[e]),this.__getValidator(e),this.__bindField(e),this.__handleKeyDown))),y.map(((e,s)=>t(_||(_=$` <hr class="${0}" style="margin-left:calc((var(--lumo-space-m) * 2) + 1.125rem)"> <x-checkbox class="w-full p-m" ?readonly="${0}" ?disabled="${0}" ?checked="${0}" @change="${0}"> <div class="flex items-start leading-s"> <div class="flex-1 flex flex-col"> <foxy-i18n key="${0}" lang="${0}" ns="${0}"></foxy-i18n> <foxy-i18n class="text-s text-secondary" lang="${0}" key="${0}_explainer" ns="${0}"> </foxy-i18n> </div> <div class="mt-xs" style="width:1.125rem;height:1.125rem">${0}</div> </div> </x-checkbox> `),s>0?"border-contrast-10":"hidden",this.readonly,n,this.form[e.property],(s=>{const t=s.target;this.edit({[e.property]:t.checked})}),e.key,this.lang,this.ns,this.lang,e.key,this.ns,e.icon))),this.in("idle")?"primary "+(this.href?"error":"success"):"",this.in({idle:"template"})&&!i||n,this.__handleActionClick,this.lang,this.href?"delete":"create",this.ns,o({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!r&&!a}),a?"error":r?"busy":"empty",this.lang,this.ns)}__getErrorMessage(e){const s=this.errors.find((s=>s.startsWith(e)));return s?this.t(s.replace(e,"v8n")):""}__handleActionClick(e){if(this.in({idle:"snapshot"})){this.renderRoot.querySelector("#confirm").show(e.currentTarget)}else this.submit()}__handleConfirmHide(e){e.detail.cancelled||this.delete()}__handleKeyDown(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-user-form",w);export{w as U,y as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,n=!1){var r;const t=e.replace(/(y|m|w|d)/,""),a=e.replace(/\.?\d+/,"");return{count:".5"===t?.5:parseInt(t),units:n&&null!==(r={y:"year",m:"month",w:"week",d:"day"}[a])&&void 0!==r?r:a}}export{e as p};
|
|
@@ -1 +0,0 @@
|
|
|
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-0e4d19e2.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-e68b9c83.js";import"./shared-0032dc09.js";import"./shared-66633ff7.js";import{I as l,D as c}from"./shared-4cc1da27.js";import{E as h}from"./shared-67ca44d2.js";import"./shared-36629ded.js";import"./shared-bb824ab4.js";import"./shared-ec861f31.js";import"./foxy-i18n.js";import"./shared-60126eee.js";import{s as d}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"),i.addEventListener("error",(()=>i.src=f.placeholder)),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(" ")}}f.placeholder='data:image/svg+xml,%3Csvg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="40" height="40" fill="%23E8E8E8"/%3E%3Cpath d="M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z" fill="white"/%3E%3Cpath d="M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z" fill="white"/%3E%3Cpath d="M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z" fill="white"/%3E%3Cpath d="M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z" fill="white"/%3E%3Cpath d="M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z" fill="white"/%3E%3Cpath d="M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z" fill="white"/%3E%3Cpath d="M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z" fill="white"/%3E%3Cpath d="M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z" fill="white"/%3E%3Cpath d="M40 40H34.8333L40 34.8333V40Z" fill="white"/%3E%3Cpath d="M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z" fill="white"/%3E%3Cpath d="M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z" fill="white"/%3E%3Cpath d="M0 0H6.37152L0 6.37151V0Z" fill="white"/%3E%3Cpath d="M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z" fill="white"/%3E%3Cpath d="M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z" fill="white"/%3E%3C/svg%3E';let v,b,w,x,q,I,E,$,C=t=>t;class S 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=C`.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=d({exportparts:"picture",class:"w-full h-full",".empty":this.empty}),[o,l,c,h]=this.data;return s(b||(b=C` <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=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,o):"",i,r,l?s(x||(x=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,l):"",i,r,c?s(q||(q=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,c):"",i,r,e,t>102?s(I||(I=C`<iron-icon icon="icons:more-horiz" class="m-auto w-xl h-xl"></iron-icon>`)):s(E||(E=C`<div class="m-auto text-xxxl">+${0}</div>`),t-3),h?s($||($=C`<x-pic ...="${0}" .data="${0}"></x-pic>`),n,h):"",i,e,i,e)}}let D,k,L=t=>t;class A extends S{static get scopedElements(){return{"x-pic":f}}}class N extends S{static get scopedElements(){return{"x-pic":A}}}class P extends(n(t)){constructor(){super(...arguments),this.quantity=0,this.items=[]}static get scopedElements(){return{"x-picture":f,"x-bundle-grid":N}}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=d({class:"w-full h-full",exportparts:"picture"});if(0===this.items.length)return s(D||(D=L`<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(k||(k=L`<x-bundle-grid ...="${0}" .empty="${0}" .data="${0}"></x-bundle-grid>`),r,i,e)}}}class j 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 F,T,O,V,M,H,B,Z=t=>t;class R extends j{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=R.__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(F||(F=Z`: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":h,"x-preview":P,"x-i18n":l}}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(T||(T=Z`<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(O||(O=Z` <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(V||(V=Z` <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(M||(M=Z` <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(H||(H=Z`<div class="font-medium price text-l">${0}</div>`),a):"",this.__handleQuantity,this.quantity,this.readonly,this.quantity>1?s(B||(B=Z` <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=R.__existingIds.reduce(((t,e)=>e>t?e:t),0)+1;return R.__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)}}R.__existingIds=[];let z,Q,W,J,U,X,G=t=>t;class K extends j{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/,"");K.__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":h,"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":c,"x-item":R}}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=>K.__validDate(t)?t:(console.error("Invalid start date",t),"")},sub_enddate:{type:String,converter:t=>K.__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(!K.__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(K.__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(Q||(Q=G` <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(W||(W=G` ${0}`),[...this.__data.entries()].map((([t,e])=>s(J||(J=G`<input type="hidden" name="${0}" value="${0}">`),t,e)))):"",this.readonly?"":s(U||(U=G` <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(X||(X=G` <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(z||(z=G`<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/)||!K.__validFrequency(t)))}static __validDateFuture(t){let e=!1;if(K.__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",K),customElements.define("foxy-item",R);export{K as I,P,R as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./shared-63eaded9.js";import{p as r}from"./shared-0e4d19e2.js";function s(s){var t;const a=r(s),n=null!==(t={y:"yearly",m:"monthly",w:"weekly",d:"daily"}[a.units])&&void 0!==t?t:a.units;return e(e({},a),{},{units:n})}export{s as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./shared-0ced76a0.js";import"./foxy-i18n.js";import{_ as t,h as e}from"./shared-63eaded9.js";import{D as i}from"./shared-66633ff7.js";let s,n=t=>t;customElements.define("foxy-internal-confirm-dialog",class extends i{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.alert=!0,this.confirm="confirm",this.message="message",this.cancel="cancel",this.theme="primary"}static get properties(){return t(t({},super.properties),{},{confirm:{type:String},message:{type:String},cancel:{type:String},theme:{type:String}})}render(){return super.render((()=>e(s||(s=n` <foxy-i18n class="block font-lumo text-m text-body text-center mb-m" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> <vaadin-button data-testid="cancelButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> <vaadin-button theme="${0}" data-testid="confirmButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> </div> `),this.lang,this.message,this.ns,this.__handleCancel,this.ns,this.lang,this.cancel,this.theme,this.__handleConfirm,this.ns,this.lang,this.confirm)))}async __handleCancel(){await this.hide(!0)}async __handleConfirm(){await this.hide()}});
|