@foxy.io/elements 1.38.0-beta.1 → 1.38.0-beta.2

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.
@@ -1 +1 @@
1
- import"./shared-4bcfe691.js";import"./shared-ccc91a5f.js";import"./shared-7c863df2.js";import"./shared-e1a6c036.js";import{b as r,I as o}from"./shared-6960ab99.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import"./shared-57c3f0e4.js";import"./foxy-copy-to-clipboard.js";import"./shared-5a08dbb0.js";import{_ as t,B as e}from"./shared-d1195c27.js";import{R as s,a as i}from"./shared-f61e5463.js";import{h as a,s as n}from"./shared-ba5c42c7.js";import{i as d}from"./shared-53e42a77.js";import"./shared-8e36bcc1.js";import"./shared-f2c4875b.js";import"./shared-893ead61.js";import"./shared-efecf1ca.js";import"./shared-6ef0392a.js";import"./shared-25a19cbe.js";import"./shared-1ba78e12.js";import"./shared-e6cd721f.js";import"./shared-d8cab6ab.js";import"./shared-a2a27012.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-dc6eb904.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-9f07fab6.js";import"./shared-2550f6d9.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-299543b6.js";import"./shared-d54b3216.js";import"./shared-13d65f57.js";import"./shared-a2693527.js";import"./shared-59e22bc6.js";import"./shared-aab278b5.js";import"./shared-1137b243.js";import"./shared-604261a0.js";import"./shared-3a446f14.js";import"./shared-651c44fa.js";import"./shared-166204e5.js";import"./shared-dea71762.js";import"./shared-2762e106.js";import"./shared-34119bbf.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-5212ef4f.js";import"./shared-bab2ea2c.js";import"./shared-a1f85307.js";import"./shared-f438f0f4.js";import"./shared-c27ee44e.js";import"./shared-12a553c2.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-1da49e3d.js";import"./foxy-custom-field-card.js";import"./shared-fcf6424c.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-641786b2.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-3691a26f.js";import"./shared-498ce88a.js";import"./shared-f6e9eda6.js";import"./shared-569db166.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./shared-674ba44d.js";import"./foxy-item-card.js";import"./shared-882a0fda.js";import"./foxy-item-form.js";import"./shared-812c706e.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./shared-71f3226f.js";import"./foxy-customer-card.js";let m,c,l=r=>r;class f extends(s(r)){constructor(){super(...arguments),this.search=null}static get properties(){return t(t({},super.properties),{},{search:{}})}renderControl(){var r,o;const t=this.nucleon;let e;try{const s=new URL(null!==(o=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==o?o:"");this.search&&(s.search=this.search),e=s.toString()}catch(r){e=void 0}return a(m||(m=l` <div class="leading-s sm-flex sm-items-center sm-gap-m"> <foxy-i18n class="block whitespace-nowrap text-s text-secondary sm-text-m sm-text-body sm-flex-1 sm-flex-shrink-0" infer="" key="label"> </foxy-i18n> <div class="flex items-center gap-xs min-w-0"> <a target="_blank" class="min-w-0 flex-1 truncate font-medium rounded cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> ${0} </a> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="text-s flex-shrink-0" text="${0}"> </foxy-copy-to-clipboard> <div class="transition-colors text-tertiary flex-shrink-0 cursor-pointer hover-text-body" id="trigger"> ${0} </div> <vcf-tooltip position="bottom" theme="light" style="--lumo-base-color:black;max-width:30rem" class="mt-s" for="trigger"> <foxy-i18n class="text-s" style="color:#fff" infer="" key="helper_text"></foxy-i18n> </vcf-tooltip> </div> </div> `),e,e,e,n(c||(c=l`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: calc(1em * var(--lumo-line-height-xs)); height: calc(1em * var(--lumo-line-height-xs)); margin-right: -0.12em"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)))}}customElements.define("foxy-internal-admin-subscription-form-link-control",f);let p,h,u=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends r{renderControl(){var r,o;return a(p||(p=u` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),n(h||(h=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(o=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===o?void 0:o.error_message)}});let y,x=r=>r;const j=i(o,"admin-subscription-form");class b extends j{get hiddenSelector(){var r,o;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(o=this.data)||void 0===o?void 0:o.is_active)||t.unshift("view-action","cancel-action"),new e(t.join(" ").trim())}get headerSubtitleOptions(){var r;return{context:(null===(r=this.data)||void 0===r?void 0:r.is_active)?"active":"inactive"}}renderBody(){var r,o,t,e,s;let i;try{const t=new URL(null!==(o=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==o?o:"");t.searchParams.set("zoom","items"),i=t.toString()}catch(r){i=void 0}return a(y||(y=x` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> ${0} <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <p class="text-s text-secondary"> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> <a target="_blank" class="inline-block rounded font-medium text-body transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="https://admin.foxycart.com"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> </p> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),d(null===(t=this.data)||void 0===t?void 0:t._embedded["fx:transaction_template"].currency_code),this.renderTemplateOrSlot(),d(null===(s=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===s?void 0:s["fx:attributes"].href),d(i),super.renderBody())}}customElements.define("foxy-admin-subscription-form",b);export{b as AdminSubscriptionForm};
1
+ import"./shared-4bcfe691.js";import"./shared-ccc91a5f.js";import"./shared-7c863df2.js";import"./shared-e1a6c036.js";import{b as r,I as e}from"./shared-6960ab99.js";import"./foxy-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import"./shared-57c3f0e4.js";import"./foxy-copy-to-clipboard.js";import"./shared-5a08dbb0.js";import{_ as t,B as o}from"./shared-d1195c27.js";import{R as s,a as i}from"./shared-f61e5463.js";import{h as a,s as n}from"./shared-ba5c42c7.js";import{i as d}from"./shared-53e42a77.js";import"./shared-8e36bcc1.js";import"./shared-f2c4875b.js";import"./shared-893ead61.js";import"./shared-efecf1ca.js";import"./shared-6ef0392a.js";import"./shared-25a19cbe.js";import"./shared-1ba78e12.js";import"./shared-e6cd721f.js";import"./shared-d8cab6ab.js";import"./shared-a2a27012.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-dc6eb904.js";import"./shared-17a61265.js";import"./shared-343d1fd7.js";import"./shared-eeb2bd18.js";import"./shared-d1dfac4d.js";import"./shared-7e9fdf64.js";import"./shared-cd96ff03.js";import"./shared-9cf15285.js";import"./shared-019348d7.js";import"./shared-1aff7995.js";import"./shared-fcdb896f.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-9f07fab6.js";import"./shared-2550f6d9.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-299543b6.js";import"./shared-d54b3216.js";import"./shared-13d65f57.js";import"./shared-a2693527.js";import"./shared-59e22bc6.js";import"./shared-aab278b5.js";import"./shared-1137b243.js";import"./shared-604261a0.js";import"./shared-3a446f14.js";import"./shared-651c44fa.js";import"./shared-166204e5.js";import"./shared-dea71762.js";import"./shared-2762e106.js";import"./shared-34119bbf.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-5212ef4f.js";import"./shared-bab2ea2c.js";import"./shared-a1f85307.js";import"./shared-f438f0f4.js";import"./shared-c27ee44e.js";import"./shared-12a553c2.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-1da49e3d.js";import"./foxy-custom-field-card.js";import"./shared-fcf6424c.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-641786b2.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-3691a26f.js";import"./shared-498ce88a.js";import"./shared-f6e9eda6.js";import"./shared-569db166.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./shared-674ba44d.js";import"./foxy-item-card.js";import"./shared-882a0fda.js";import"./foxy-item-form.js";import"./shared-812c706e.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./shared-71f3226f.js";import"./foxy-customer-card.js";let m,c,l=r=>r;class f extends(s(r)){constructor(){super(...arguments),this.search=null}static get properties(){return t(t({},super.properties),{},{search:{}})}renderControl(){var r,e;const t=this.nucleon;let o;try{const s=new URL(null!==(e=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r._links["fx:sub_token_url"].href)&&void 0!==e?e:"");if(this.search){const r=new URLSearchParams(s.search);s.search=this.search,r.forEach(((r,e)=>s.searchParams.set(e,r)))}o=s.toString()}catch(r){o=void 0}return a(m||(m=l` <div class="leading-s sm-flex sm-items-center sm-gap-m"> <foxy-i18n class="block whitespace-nowrap text-s text-secondary sm-text-m sm-text-body sm-flex-1 sm-flex-shrink-0" infer="" key="label"> </foxy-i18n> <div class="flex items-center gap-xs min-w-0"> <a target="_blank" class="min-w-0 flex-1 truncate font-medium rounded cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" style="max-width:25rem" href="${0}"> ${0} </a> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="text-s flex-shrink-0" text="${0}"> </foxy-copy-to-clipboard> <div class="transition-colors text-tertiary flex-shrink-0 cursor-pointer hover-text-body" id="trigger"> ${0} </div> <vcf-tooltip position="bottom" theme="light" style="--lumo-base-color:black;max-width:30rem" class="mt-s" for="trigger"> <foxy-i18n class="text-s" style="color:#fff" infer="" key="helper_text"></foxy-i18n> </vcf-tooltip> </div> </div> `),o,o,o,n(c||(c=l`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: calc(1em * var(--lumo-line-height-xs)); height: calc(1em * var(--lumo-line-height-xs)); margin-right: -0.12em"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)))}}customElements.define("foxy-internal-admin-subscription-form-link-control",f);let p,h,u=r=>r;customElements.define("foxy-internal-admin-subscription-form-error",class extends r{renderControl(){var r,e;return a(p||(p=u` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),n(h||(h=u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(e=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===e?void 0:e.error_message)}});let y,x,j=r=>r;const b=i(e,"admin-subscription-form");class v extends b{constructor(){super(...arguments),this.uoeSettingsPage=null}static get properties(){return t(t({},super.properties),{},{uoeSettingsPage:{attribute:"uoe-settings-page"}})}get hiddenSelector(){var r,e;const t=["delete",super.hiddenSelector.toString()];return(null===(r=this.data)||void 0===r?void 0:r.error_message)||t.unshift("error-message"),(null===(e=this.data)||void 0===e?void 0:e.is_active)||t.unshift("view-action","cancel-action"),new o(t.join(" ").trim())}get headerSubtitleOptions(){var r;return{context:(null===(r=this.data)||void 0===r?void 0:r.is_active)?"active":"inactive"}}renderBody(){var r,e,t,o,s;let i;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:transactions"].href)&&void 0!==e?e:"");t.searchParams.set("zoom","items"),i=t.toString()}catch(r){i=void 0}return a(y||(y=j` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <p class="text-s text-secondary"> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> ${0} </p> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),d(null===(t=this.data)||void 0===t?void 0:t._embedded["fx:transaction_template"].currency_code),this.uoeSettingsPage?a(x||(x=j` <a target="_blank" class="inline-block rounded font-medium text-body transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> `),this.uoeSettingsPage):"",this.renderTemplateOrSlot(),d(null===(s=null===(o=this.data)||void 0===o?void 0:o._links)||void 0===s?void 0:s["fx:attributes"].href),d(i),super.renderBody())}}customElements.define("foxy-admin-subscription-form",v);export{v as AdminSubscriptionForm};
@@ -2,10 +2,14 @@ import type { TemplateResult } from 'lit-html';
2
2
  import type { Data } from './types';
3
3
  import { BooleanSelector } from '@foxy.io/sdk/core';
4
4
  import { InternalForm } from '../../internal/InternalForm/InternalForm';
5
+ import { PropertyDeclarations } from 'lit-element';
5
6
  declare const Base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
6
7
  defaultNS: string;
7
8
  };
8
9
  export declare class AdminSubscriptionForm extends Base<Data> {
10
+ static get properties(): PropertyDeclarations;
11
+ /** URL of the UOE settings page in the admin. If set, displays a link to that page in the self-service links section. */
12
+ uoeSettingsPage: string | null;
9
13
  get hiddenSelector(): BooleanSelector;
10
14
  get headerSubtitleOptions(): Record<string, unknown>;
11
15
  renderBody(): TemplateResult;
@@ -6,6 +6,17 @@ import { html } from 'lit-html';
6
6
  const NS = 'admin-subscription-form';
7
7
  const Base = TranslatableMixin(InternalForm, NS);
8
8
  export class AdminSubscriptionForm extends Base {
9
+ constructor() {
10
+ super(...arguments);
11
+ /** URL of the UOE settings page in the admin. If set, displays a link to that page in the self-service links section. */
12
+ this.uoeSettingsPage = null;
13
+ }
14
+ static get properties() {
15
+ return {
16
+ ...super.properties,
17
+ uoeSettingsPage: { attribute: 'uoe-settings-page' },
18
+ };
19
+ }
9
20
  get hiddenSelector() {
10
21
  var _a, _b;
11
22
  const alwaysMatch = ['delete', super.hiddenSelector.toString()];
@@ -61,8 +72,6 @@ export class AdminSubscriptionForm extends Base {
61
72
  </foxy-internal-number-control>
62
73
  </foxy-internal-summary-control>
63
74
 
64
- ${this.renderTemplateOrSlot()}
65
-
66
75
  <foxy-internal-summary-control infer="self-service-links">
67
76
  <foxy-internal-admin-subscription-form-link-control infer="load-in-cart">
68
77
  </foxy-internal-admin-subscription-form-link-control>
@@ -87,16 +96,22 @@ export class AdminSubscriptionForm extends Base {
87
96
 
88
97
  <p class="text-s text-secondary">
89
98
  <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n>
90
- <a
91
- target="_blank"
92
- class="inline-block rounded font-medium text-body transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50"
93
- href="https://admin.foxycart.com"
94
- >
95
- <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n>
96
- </a>
99
+ ${this.uoeSettingsPage
100
+ ? html `
101
+ <a
102
+ target="_blank"
103
+ class="inline-block rounded font-medium text-body transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50"
104
+ href=${this.uoeSettingsPage}
105
+ >
106
+ <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n>
107
+ </a>
108
+ `
109
+ : ''}
97
110
  </p>
98
111
  </foxy-internal-summary-control>
99
112
 
113
+ ${this.renderTemplateOrSlot()}
114
+
100
115
  <foxy-internal-async-list-control
101
116
  infer="attributes"
102
117
  class="min-w-0"
@@ -1 +1 @@
1
- {"version":3,"file":"AdminSubscriptionForm.js","sourceRoot":"","sources":["../../../../src/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,EAAE,GAAG,yBAAyB,CAAC;AACrC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD,MAAM,OAAO,qBAAsB,SAAQ,IAAU;IACnD,IAAI,cAAc;;QAChB,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChE,IAAI,QAAC,IAAI,CAAC,IAAI,0CAAE,aAAa,CAAA;YAAE,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,QAAC,IAAI,CAAC,IAAI,0CAAE,SAAS,CAAA;YAAE,WAAW,CAAC,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QAC/E,OAAO,IAAI,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,qBAAqB;;QACvB,OAAO,EAAE,OAAO,EAAE,OAAA,IAAI,CAAC,IAAI,0CAAE,SAAS,EAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IACnE,CAAC;IAED,UAAU;;QACR,IAAI,gBAAoC,CAAC;QAEzC,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,iBAAiB,EAAE,IAAI,mCAAI,EAAE,CAAC,CAAC;YACrE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACtC,gBAAgB,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;SACnC;QAAC,WAAM;YACN,gBAAgB,GAAG,SAAS,CAAC;SAC9B;QAED,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;mBAuBR,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,SAAS,CAAC,yBAAyB,EAAE,aAAa,CAAC;;;;;;;QAOnF,IAAI,CAAC,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAuCnB,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,0CAAG,eAAe,EAAE,IAAI,CAAC;;;;;;;;;;gBAUpD,SAAS,CAAC,gBAAgB,CAAC;;;;;;;;;;QAUnC,KAAK,CAAC,UAAU,EAAE;KACrB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { TemplateResult } from 'lit-html';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\nconst NS = 'admin-subscription-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\nexport class AdminSubscriptionForm extends Base<Data> {\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['delete', super.hiddenSelector.toString()];\n if (!this.data?.error_message) alwaysMatch.unshift('error-message');\n if (!this.data?.is_active) alwaysMatch.unshift('view-action', 'cancel-action');\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get headerSubtitleOptions(): Record<string, unknown> {\n return { context: this.data?.is_active ? 'active' : 'inactive' };\n }\n\n renderBody(): TemplateResult {\n let transactionsHref: string | undefined;\n\n try {\n const url = new URL(this.data?._links['fx:transactions'].href ?? '');\n url.searchParams.set('zoom', 'items');\n transactionsHref = url.toString();\n } catch {\n transactionsHref = undefined;\n }\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-admin-subscription-form-error infer=\"error-message\">\n </foxy-internal-admin-subscription-form-error>\n\n <foxy-internal-summary-control infer=\"general\">\n <foxy-internal-date-control layout=\"summary-item\" infer=\"start-date\">\n </foxy-internal-date-control>\n <foxy-internal-frequency-control\n layout=\"summary-item\"\n infer=\"frequency\"\n allow-twice-a-month\n >\n </foxy-internal-frequency-control>\n <foxy-internal-date-control layout=\"summary-item\" infer=\"next-transaction-date\">\n </foxy-internal-date-control>\n <foxy-internal-date-control layout=\"summary-item\" infer=\"end-date\">\n </foxy-internal-date-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"overdue\">\n <foxy-internal-number-control\n layout=\"summary-item\"\n suffix=${ifDefined(this.data?._embedded['fx:transaction_template'].currency_code)}\n infer=\"past-due-amount\"\n min=\"0\"\n >\n </foxy-internal-number-control>\n </foxy-internal-summary-control>\n\n ${this.renderTemplateOrSlot()}\n\n <foxy-internal-summary-control infer=\"self-service-links\">\n <foxy-internal-admin-subscription-form-link-control infer=\"load-in-cart\">\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"cart=checkout\"\n infer=\"load-on-checkout\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"sub_cancel=next_transaction_date\"\n infer=\"cancel-at-end-of-billing-period\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"sub_cancel=true\"\n infer=\"cancel-next-day\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <p class=\"text-s text-secondary\">\n <foxy-i18n infer=\"\" key=\"uoe_hint_text\"></foxy-i18n>\n <a\n target=\"_blank\"\n class=\"inline-block rounded font-medium text-body transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=\"https://admin.foxycart.com\"\n >\n <foxy-i18n infer=\"\" key=\"uoe_link_text\"></foxy-i18n>\n </a>\n </p>\n </foxy-internal-summary-control>\n\n <foxy-internal-async-list-control\n infer=\"attributes\"\n class=\"min-w-0\"\n first=${ifDefined(this.data?._links?.['fx:attributes'].href)}\n item=\"foxy-attribute-card\"\n form=\"foxy-attribute-form\"\n alert\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n infer=\"transactions\"\n class=\"min-w-0\"\n first=${ifDefined(transactionsHref)}\n item=\"foxy-transaction-card\"\n form=\"foxy-transaction\"\n hide-create-button\n hide-delete-button\n alert\n wide\n >\n </foxy-internal-async-list-control>\n\n ${super.renderBody()}\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"AdminSubscriptionForm.js","sourceRoot":"","sources":["../../../../src/elements/public/AdminSubscriptionForm/AdminSubscriptionForm.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,MAAM,EAAE,GAAG,yBAAyB,CAAC;AACrC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD,MAAM,OAAO,qBAAsB,SAAQ,IAAU;IAArD;;QAQE,yHAAyH;QACzH,oBAAe,GAAkB,IAAI,CAAC;IAyHxC,CAAC;IAjIC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,eAAe,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE;SACpD,CAAC;IACJ,CAAC;IAKD,IAAI,cAAc;;QAChB,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChE,IAAI,QAAC,IAAI,CAAC,IAAI,0CAAE,aAAa,CAAA;YAAE,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,QAAC,IAAI,CAAC,IAAI,0CAAE,SAAS,CAAA;YAAE,WAAW,CAAC,OAAO,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QAC/E,OAAO,IAAI,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,qBAAqB;;QACvB,OAAO,EAAE,OAAO,EAAE,OAAA,IAAI,CAAC,IAAI,0CAAE,SAAS,EAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IACnE,CAAC;IAED,UAAU;;QACR,IAAI,gBAAoC,CAAC;QAEzC,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,iBAAiB,EAAE,IAAI,mCAAI,EAAE,CAAC,CAAC;YACrE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACtC,gBAAgB,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;SACnC;QAAC,WAAM;YACN,gBAAgB,GAAG,SAAS,CAAC;SAC9B;QAED,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;mBAuBR,SAAS,OAAC,IAAI,CAAC,IAAI,0CAAE,SAAS,CAAC,yBAAyB,EAAE,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA+B/E,IAAI,CAAC,eAAe;YACpB,CAAC,CAAC,IAAI,CAAA;;;;yBAIO,IAAI,CAAC,eAAe;;;;eAI9B;YACH,CAAC,CAAC,EAAE;;;;QAIR,IAAI,CAAC,oBAAoB,EAAE;;;;;gBAKnB,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,0CAAG,eAAe,EAAE,IAAI,CAAC;;;;;;;;;;gBAUpD,SAAS,CAAC,gBAAgB,CAAC;;;;;;;;;;QAUnC,KAAK,CAAC,UAAU,EAAE;KACrB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { TemplateResult } from 'lit-html';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\nimport { PropertyDeclarations } from 'lit-element';\n\nconst NS = 'admin-subscription-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\nexport class AdminSubscriptionForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n uoeSettingsPage: { attribute: 'uoe-settings-page' },\n };\n }\n\n /** URL of the UOE settings page in the admin. If set, displays a link to that page in the self-service links section. */\n uoeSettingsPage: string | null = null;\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['delete', super.hiddenSelector.toString()];\n if (!this.data?.error_message) alwaysMatch.unshift('error-message');\n if (!this.data?.is_active) alwaysMatch.unshift('view-action', 'cancel-action');\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get headerSubtitleOptions(): Record<string, unknown> {\n return { context: this.data?.is_active ? 'active' : 'inactive' };\n }\n\n renderBody(): TemplateResult {\n let transactionsHref: string | undefined;\n\n try {\n const url = new URL(this.data?._links['fx:transactions'].href ?? '');\n url.searchParams.set('zoom', 'items');\n transactionsHref = url.toString();\n } catch {\n transactionsHref = undefined;\n }\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-admin-subscription-form-error infer=\"error-message\">\n </foxy-internal-admin-subscription-form-error>\n\n <foxy-internal-summary-control infer=\"general\">\n <foxy-internal-date-control layout=\"summary-item\" infer=\"start-date\">\n </foxy-internal-date-control>\n <foxy-internal-frequency-control\n layout=\"summary-item\"\n infer=\"frequency\"\n allow-twice-a-month\n >\n </foxy-internal-frequency-control>\n <foxy-internal-date-control layout=\"summary-item\" infer=\"next-transaction-date\">\n </foxy-internal-date-control>\n <foxy-internal-date-control layout=\"summary-item\" infer=\"end-date\">\n </foxy-internal-date-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"overdue\">\n <foxy-internal-number-control\n layout=\"summary-item\"\n suffix=${ifDefined(this.data?._embedded['fx:transaction_template'].currency_code)}\n infer=\"past-due-amount\"\n min=\"0\"\n >\n </foxy-internal-number-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"self-service-links\">\n <foxy-internal-admin-subscription-form-link-control infer=\"load-in-cart\">\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"cart=checkout\"\n infer=\"load-on-checkout\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"sub_cancel=next_transaction_date\"\n infer=\"cancel-at-end-of-billing-period\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <foxy-internal-admin-subscription-form-link-control\n search=\"sub_cancel=true\"\n infer=\"cancel-next-day\"\n >\n </foxy-internal-admin-subscription-form-link-control>\n\n <p class=\"text-s text-secondary\">\n <foxy-i18n infer=\"\" key=\"uoe_hint_text\"></foxy-i18n>\n ${this.uoeSettingsPage\n ? html`\n <a\n target=\"_blank\"\n class=\"inline-block rounded font-medium text-body transition-colors cursor-pointer hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${this.uoeSettingsPage}\n >\n <foxy-i18n infer=\"\" key=\"uoe_link_text\"></foxy-i18n>\n </a>\n `\n : ''}\n </p>\n </foxy-internal-summary-control>\n\n ${this.renderTemplateOrSlot()}\n\n <foxy-internal-async-list-control\n infer=\"attributes\"\n class=\"min-w-0\"\n first=${ifDefined(this.data?._links?.['fx:attributes'].href)}\n item=\"foxy-attribute-card\"\n form=\"foxy-attribute-form\"\n alert\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n infer=\"transactions\"\n class=\"min-w-0\"\n first=${ifDefined(transactionsHref)}\n item=\"foxy-transaction-card\"\n form=\"foxy-transaction\"\n hide-create-button\n hide-delete-button\n alert\n wide\n >\n </foxy-internal-async-list-control>\n\n ${super.renderBody()}\n `;\n }\n}\n"]}
@@ -18,8 +18,11 @@ export class InternalAdminSubscriptionFormLinkControl extends ResponsiveMixin(In
18
18
  let href;
19
19
  try {
20
20
  const url = new URL((_b = (_a = form === null || form === void 0 ? void 0 : form.data) === null || _a === void 0 ? void 0 : _a._links['fx:sub_token_url'].href) !== null && _b !== void 0 ? _b : '');
21
- if (this.search)
21
+ if (this.search) {
22
+ const originalParams = new URLSearchParams(url.search);
22
23
  url.search = this.search;
24
+ originalParams.forEach((value, key) => url.searchParams.set(key, value));
25
+ }
23
26
  href = url.toString();
24
27
  }
25
28
  catch (_c) {
@@ -38,6 +41,7 @@ export class InternalAdminSubscriptionFormLinkControl extends ResponsiveMixin(In
38
41
  <a
39
42
  target="_blank"
40
43
  class="min-w-0 flex-1 truncate font-medium rounded cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50"
44
+ style="max-width: 25rem"
41
45
  href=${href}
42
46
  >
43
47
  ${href}
@@ -1 +1 @@
1
- {"version":3,"file":"InternalAdminSubscriptionFormLinkControl.js","sourceRoot":"","sources":["../../../../../../src/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,4CAAyC;AACnE,OAAO,EAAE,eAAe,EAAE,gEAA6D;AACvF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,OAAO,wCAAyC,SAAQ,eAAe,CAAC,eAAe,CAAC;IAA9F;;QAQE,WAAM,GAAkB,IAAI,CAAC;IA2D/B,CAAC;IAlEC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE;SACX,CAAC;IACJ,CAAC;IAID,aAAa;;QACX,MAAM,IAAI,GAAG,IAAI,CAAC,OAAuC,CAAC;QAC1D,IAAI,IAAwB,CAAC;QAE7B,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,aAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,mCAAI,EAAE,CAAC,CAAC;YACvE,IAAI,IAAI,CAAC,MAAM;gBAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1C,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;SACvB;QAAC,WAAM;YACN,IAAI,GAAG,SAAS,CAAC;SAClB;QAED,OAAO,IAAI,CAAA;;;;;;;;;;;;;mBAaI,IAAI;;cAET,IAAI;;;;;;mBAMC,IAAI;;;;;;;;cAQT,GAAG,CAAA,yfAAyf;;;;;;;;;;;;;;KAcrgB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { AdminSubscriptionForm } from '../../AdminSubscriptionForm';\nimport type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\n\nimport { ResponsiveMixin } from '../../../../../mixins/responsive';\nimport { InternalControl } from '../../../../internal/InternalControl/InternalControl';\nimport { html, svg } from 'lit-html';\n\nexport class InternalAdminSubscriptionFormLinkControl extends ResponsiveMixin(InternalControl) {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n search: {},\n };\n }\n\n search: string | null = null;\n\n renderControl(): TemplateResult {\n const form = this.nucleon as AdminSubscriptionForm | null;\n let href: string | undefined;\n\n try {\n const url = new URL(form?.data?._links['fx:sub_token_url'].href ?? '');\n if (this.search) url.search = this.search;\n href = url.toString();\n } catch {\n href = undefined;\n }\n\n return html`\n <div class=\"leading-s sm-flex sm-items-center sm-gap-m\">\n <foxy-i18n\n class=\"block whitespace-nowrap text-s text-secondary sm-text-m sm-text-body sm-flex-1 sm-flex-shrink-0\"\n infer=\"\"\n key=\"label\"\n >\n </foxy-i18n>\n\n <div class=\"flex items-center gap-xs min-w-0\">\n <a\n target=\"_blank\"\n class=\"min-w-0 flex-1 truncate font-medium rounded cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${href}\n >\n ${href}\n </a>\n\n <foxy-copy-to-clipboard\n infer=\"copy-to-clipboard\"\n class=\"text-s flex-shrink-0\"\n text=${href}\n >\n </foxy-copy-to-clipboard>\n\n <div\n class=\"transition-colors text-tertiary flex-shrink-0 cursor-pointer hover-text-body\"\n id=\"trigger\"\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" style=\"width: calc(1em * var(--lumo-line-height-xs)); height: calc(1em * var(--lumo-line-height-xs)); margin-right: -0.12em\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z\" /></svg>`}\n </div>\n\n <vcf-tooltip\n position=\"bottom\"\n theme=\"light\"\n style=\"--lumo-base-color: black; max-width: 30rem\"\n class=\"mt-s\"\n for=\"trigger\"\n >\n <foxy-i18n class=\"text-s\" style=\"color: white\" infer=\"\" key=\"helper_text\"></foxy-i18n>\n </vcf-tooltip>\n </div>\n </div>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalAdminSubscriptionFormLinkControl.js","sourceRoot":"","sources":["../../../../../../src/elements/public/AdminSubscriptionForm/internal/InternalAdminSubscriptionFormLinkControl/InternalAdminSubscriptionFormLinkControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,4CAAyC;AACnE,OAAO,EAAE,eAAe,EAAE,gEAA6D;AACvF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,OAAO,wCAAyC,SAAQ,eAAe,CAAC,eAAe,CAAC;IAA9F;;QAQE,WAAM,GAAkB,IAAI,CAAC;IAkE/B,CAAC;IAzEC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,MAAM,EAAE,EAAE;SACX,CAAC;IACJ,CAAC;IAID,aAAa;;QACX,MAAM,IAAI,GAAG,IAAI,CAAC,OAAuC,CAAC;QAC1D,IAAI,IAAwB,CAAC;QAE7B,IAAI;YACF,MAAM,GAAG,GAAG,IAAI,GAAG,aAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,mCAAI,EAAE,CAAC,CAAC;YAEvE,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,MAAM,cAAc,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACvD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;gBACzB,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;aAC1E;YAED,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;SACvB;QAAC,WAAM;YACN,IAAI,GAAG,SAAS,CAAC;SAClB;QAED,OAAO,IAAI,CAAA;;;;;;;;;;;;;;mBAcI,IAAI;;cAET,IAAI;;;;;;mBAMC,IAAI;;;;;;;;cAQT,GAAG,CAAA,yfAAyf;;;;;;;;;;;;;;KAcrgB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { AdminSubscriptionForm } from '../../AdminSubscriptionForm';\nimport type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\n\nimport { ResponsiveMixin } from '../../../../../mixins/responsive';\nimport { InternalControl } from '../../../../internal/InternalControl/InternalControl';\nimport { html, svg } from 'lit-html';\n\nexport class InternalAdminSubscriptionFormLinkControl extends ResponsiveMixin(InternalControl) {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n search: {},\n };\n }\n\n search: string | null = null;\n\n renderControl(): TemplateResult {\n const form = this.nucleon as AdminSubscriptionForm | null;\n let href: string | undefined;\n\n try {\n const url = new URL(form?.data?._links['fx:sub_token_url'].href ?? '');\n\n if (this.search) {\n const originalParams = new URLSearchParams(url.search);\n url.search = this.search;\n originalParams.forEach((value, key) => url.searchParams.set(key, value));\n }\n\n href = url.toString();\n } catch {\n href = undefined;\n }\n\n return html`\n <div class=\"leading-s sm-flex sm-items-center sm-gap-m\">\n <foxy-i18n\n class=\"block whitespace-nowrap text-s text-secondary sm-text-m sm-text-body sm-flex-1 sm-flex-shrink-0\"\n infer=\"\"\n key=\"label\"\n >\n </foxy-i18n>\n\n <div class=\"flex items-center gap-xs min-w-0\">\n <a\n target=\"_blank\"\n class=\"min-w-0 flex-1 truncate font-medium rounded cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50\"\n style=\"max-width: 25rem\"\n href=${href}\n >\n ${href}\n </a>\n\n <foxy-copy-to-clipboard\n infer=\"copy-to-clipboard\"\n class=\"text-s flex-shrink-0\"\n text=${href}\n >\n </foxy-copy-to-clipboard>\n\n <div\n class=\"transition-colors text-tertiary flex-shrink-0 cursor-pointer hover-text-body\"\n id=\"trigger\"\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" style=\"width: calc(1em * var(--lumo-line-height-xs)); height: calc(1em * var(--lumo-line-height-xs)); margin-right: -0.12em\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z\" /></svg>`}\n </div>\n\n <vcf-tooltip\n position=\"bottom\"\n theme=\"light\"\n style=\"--lumo-base-color: black; max-width: 30rem\"\n class=\"mt-s\"\n for=\"trigger\"\n >\n <foxy-i18n class=\"text-s\" style=\"color: white\" infer=\"\" key=\"helper_text\"></foxy-i18n>\n </vcf-tooltip>\n </div>\n </div>\n `;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/elements",
3
3
  "type": "module",
4
- "version": "1.38.0-beta.1",
4
+ "version": "1.38.0-beta.2",
5
5
  "description": "E-commerce web components by Foxy.",
6
6
  "repository": {
7
7
  "type": "git",