@foxy.io/elements 1.29.0-beta.2 → 1.29.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-form.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-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.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-integration-form.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +2 -2
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/shared-18cb3cfc.js +1 -0
- package/dist/cdn/{shared-6e355777.js → shared-588c6b15.js} +1 -1
- package/dist/cdn/shared-666bdabd.js +1 -0
- package/dist/cdn/shared-b9138e9f.js +1 -0
- package/dist/cdn/shared-d393bcd8.js +1 -0
- package/dist/cdn/{shared-70a5fad6.js → shared-f8723f3f.js} +1 -1
- package/dist/cdn/translations/subscription-settings-form/en.json +85 -61
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.d.ts +1 -0
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +39 -18
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/internal/InternalEditableListControl/index.d.ts +1 -0
- package/dist/elements/internal/InternalEditableListControl/index.js +1 -0
- package/dist/elements/internal/InternalEditableListControl/index.js.map +1 -1
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js +2 -2
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js.map +1 -1
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +13 -5
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +2 -2
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -1
- package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js +2 -2
- package/dist/elements/internal/InternalSummaryControl/InternalSummaryControl.js.map +1 -1
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.d.ts +1 -0
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js +31 -9
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js.map +1 -1
- package/dist/elements/internal/InternalSwitchControl/index.d.ts +1 -0
- package/dist/elements/internal/InternalSwitchControl/index.js +1 -0
- package/dist/elements/internal/InternalSwitchControl/index.js.map +1 -1
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js +2 -2
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
- package/dist/elements/public/CartForm/internal/InternalCartFormAddressSummaryItem/InternalCartFormAddressSummaryItem.js +3 -3
- package/dist/elements/public/CartForm/internal/InternalCartFormAddressSummaryItem/InternalCartFormAddressSummaryItem.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.d.ts +4 -13
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js +105 -115
- package/dist/elements/public/SubscriptionSettingsForm/SubscriptionSettingsForm.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/index.d.ts +4 -4
- package/dist/elements/public/SubscriptionSettingsForm/index.js +4 -4
- package/dist/elements/public/SubscriptionSettingsForm/index.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.d.ts +3 -1
- package/dist/elements/public/SubscriptionSettingsForm/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-292ba15e.js +0 -1
- package/dist/cdn/shared-aefac46b.js +0 -1
- package/dist/cdn/shared-d4810405.js +0 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.d.ts +0 -12
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.js +0 -128
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.js.map +0 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.d.ts +0 -2
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js +0 -26
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js.map +0 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.d.ts +0 -7
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js +0 -13
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./shared-797ba64a.js";import{I as e}from"./shared-7b8ad9c1.js";import"./shared-f1d2b5bb.js";import{_ as t}from"./shared-0f6e4584.js";import{i as s}from"./shared-9803aa7c.js";import{h as a,s as i}from"./shared-dc73b9a5.js";import{c as l}from"./shared-4e709717.js";let r,o,d,h,n=e=>e;customElements.define("foxy-internal-select-control",class extends e{constructor(){super(...arguments),this.options=[],this.layout=null,this.theme=null}static get properties(){return t(t({},super.properties),{},{options:{type:Array},layout:{},theme:{type:String}})}renderControl(){var e;return"summary-item"===this.layout?this.__renderSummaryItemLayout():a(r||(r=n` <vaadin-combo-box item-value-path="value" item-label-path="label" error-message="${0}" item-id-path="value" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" theme="${0}" ?disabled="${0}" ?readonly="${0}" clear-button-visible .checkValidity="${0}" .items="${0}" .value="${0}" @change="${0}"> </vaadin-combo-box> `),s(this._errorMessage),this.helperText,this.placeholder,this.label,s(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled,this.readonly,this._checkValidity,this.options.map((e=>({label:"label"in e?this.t(e.label):e.rawLabel,value:e.value}))),this._value,(e=>{e.stopPropagation();const t=e.currentTarget;this._value=t.value,t.validate()}))}updated(e){super.updated(e);const t=this.renderRoot.querySelector("vaadin-combo-box");t&&t.value!==this._value&&(t.value=this._value)}__renderSummaryItemLayout(){const e=this.options.find((e=>e.value===this._value));return a(o||(o=n` <div class="flex items-start leading-xs"> <div class="flex-1"> <label class="text-m text-body" for="select">${0}</label> <p class="text-s text-secondary">${0}</p> <p class="text-s text-error" ?hidden="${0}"> ${0} </p> </div> <div class="${0}"> <div class="flex items-center gap-xs"> <div> ${0} </div> ${0} </div> <select class="${0}" id="select" ?disabled="${0}" ?hidden="${0}" @change="${0}"> <option value="" ?selected="${0}" disabled="disabled" hidden>${0}</option> ${0} </select> </div> </div> `),this.label,this.helperText,this.disabled||this.readonly,this._errorMessage,l({"relative rounded-s transition-colors transition-opacity":!0,"focus-within-ring-2 focus-within-ring-primary-50":!this.disabled&&!this.readonly,"text-body hover-opacity-80 cursor-pointer":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled,"font-medium":!this.readonly}),e?"label"in e?this.t(e.label):e.rawLabel:this.placeholder,this.readonly?"":i(d||(d=n`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25)"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),l({"absolute inset-0 opacity-0":!0,"cursor-pointer":!this.disabled&&!this.readonly}),this.disabled,this.readonly,(e=>{e.stopPropagation(),this._value=e.target.value}),!e,this.placeholder,this.options.map((t=>a(h||(h=n` <option value="${0}" ?selected="${0}"> ${0} </option> `),t.value,e&&t.value===this._value,"label"in t?this.t(t.label):t.rawLabel))))}});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SubscriptionSettingsForm } from '../../SubscriptionSettingsForm';
|
|
2
|
-
import type { TemplateResult } from 'lit-html';
|
|
3
|
-
import type { CSSResultArray } from 'lit-element';
|
|
4
|
-
import { InternalEditableControl } from '../../../../internal/InternalEditableControl/InternalEditableControl';
|
|
5
|
-
export declare class InternalSubscriptionSettingsFormReattemptBypass extends InternalEditableControl {
|
|
6
|
-
static get styles(): CSSResultArray;
|
|
7
|
-
nucleon: SubscriptionSettingsForm | null;
|
|
8
|
-
private __getReattemptBypassStringsValue;
|
|
9
|
-
private __setReattemptBypassStringsValue;
|
|
10
|
-
renderControl(): TemplateResult;
|
|
11
|
-
private __handleGroupValueChanged;
|
|
12
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { InternalEditableControl } from "../../../../internal/InternalEditableControl/InternalEditableControl.js";
|
|
2
|
-
import { html } from 'lit-html';
|
|
3
|
-
import { css } from 'lit-element';
|
|
4
|
-
export class InternalSubscriptionSettingsFormReattemptBypass extends InternalEditableControl {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.nucleon = null;
|
|
8
|
-
this.__getReattemptBypassStringsValue = () => {
|
|
9
|
-
var _a, _b, _c;
|
|
10
|
-
const strings = (_c = (_b = (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form.reattempt_bypass_strings) === null || _b === void 0 ? void 0 : _b.split(',')) !== null && _c !== void 0 ? _c : [];
|
|
11
|
-
return strings
|
|
12
|
-
.map(text => text.trim())
|
|
13
|
-
.filter((text, index, strings) => text && strings.indexOf(text) === index)
|
|
14
|
-
.map(text => ({ value: text }));
|
|
15
|
-
};
|
|
16
|
-
this.__setReattemptBypassStringsValue = (newValue) => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
const group = this.renderRoot.querySelector('vaadin-radio-group');
|
|
19
|
-
const logic = ((_a = group === null || group === void 0 ? void 0 : group.value) !== null && _a !== void 0 ? _a : 'reattempt_if_exists');
|
|
20
|
-
(_b = this.nucleon) === null || _b === void 0 ? void 0 : _b.edit({
|
|
21
|
-
reattempt_bypass_strings: newValue.map(({ value }) => value).join(),
|
|
22
|
-
reattempt_bypass_logic: logic,
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
static get styles() {
|
|
27
|
-
return [
|
|
28
|
-
super.styles,
|
|
29
|
-
css `.visible-if-checked{
|
|
30
|
-
display:none;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
[checked] .visible-if-checked{
|
|
34
|
-
display:block;
|
|
35
|
-
}
|
|
36
|
-
`,
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
renderControl() {
|
|
40
|
-
const reattemptBypassStringsTemplate = html `
|
|
41
|
-
<foxy-internal-editable-list-control
|
|
42
|
-
infer="reattempt-bypass-strings"
|
|
43
|
-
class="w-full visible-if-checked"
|
|
44
|
-
.getValue=${this.__getReattemptBypassStringsValue}
|
|
45
|
-
.setValue=${this.__setReattemptBypassStringsValue}
|
|
46
|
-
@mousedown=${(evt) => evt.stopPropagation()}
|
|
47
|
-
@mouseup=${(evt) => evt.stopPropagation()}
|
|
48
|
-
@keydown=${(evt) => evt.stopPropagation()}
|
|
49
|
-
@click=${(evt) => (evt.preventDefault(), evt.stopPropagation())}
|
|
50
|
-
>
|
|
51
|
-
</foxy-internal-editable-list-control>
|
|
52
|
-
`;
|
|
53
|
-
let groupValue = void 0;
|
|
54
|
-
const nucleon = this.nucleon;
|
|
55
|
-
const reattemptBypassLogic = nucleon === null || nucleon === void 0 ? void 0 : nucleon.form.reattempt_bypass_logic;
|
|
56
|
-
const reattemptBypassStrings = nucleon === null || nucleon === void 0 ? void 0 : nucleon.form.reattempt_bypass_strings;
|
|
57
|
-
if (reattemptBypassStrings) {
|
|
58
|
-
groupValue = reattemptBypassLogic;
|
|
59
|
-
}
|
|
60
|
-
else if (reattemptBypassLogic === 'reattempt_if_exists') {
|
|
61
|
-
groupValue = 'never_reattempt';
|
|
62
|
-
}
|
|
63
|
-
else if (reattemptBypassLogic === 'skip_if_exists') {
|
|
64
|
-
groupValue = 'always_reattempt';
|
|
65
|
-
}
|
|
66
|
-
return html `
|
|
67
|
-
<vaadin-radio-group
|
|
68
|
-
helper-text=${this.helperText}
|
|
69
|
-
label=${this.label}
|
|
70
|
-
class="foxy-internal-subscription-settings-form-reattempt-bypass w-full divide-y divide-contrast-10 group"
|
|
71
|
-
theme="vertical"
|
|
72
|
-
?disabled=${this.disabled}
|
|
73
|
-
?readonly=${this.readonly}
|
|
74
|
-
.value=${groupValue}
|
|
75
|
-
@value-changed=${this.__handleGroupValueChanged}
|
|
76
|
-
>
|
|
77
|
-
<vaadin-radio-button
|
|
78
|
-
class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20"
|
|
79
|
-
value="reattempt_if_exists"
|
|
80
|
-
>
|
|
81
|
-
<foxy-i18n infer="" key="option_reattempt_if_exists"></foxy-i18n>
|
|
82
|
-
${reattemptBypassStringsTemplate}
|
|
83
|
-
</vaadin-radio-button>
|
|
84
|
-
|
|
85
|
-
<vaadin-radio-button
|
|
86
|
-
class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20"
|
|
87
|
-
value="skip_if_exists"
|
|
88
|
-
>
|
|
89
|
-
<foxy-i18n infer="" key="option_skip_if_exists"></foxy-i18n>
|
|
90
|
-
${reattemptBypassStringsTemplate}
|
|
91
|
-
</vaadin-radio-button>
|
|
92
|
-
|
|
93
|
-
<vaadin-radio-button
|
|
94
|
-
class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20"
|
|
95
|
-
value="always_reattempt"
|
|
96
|
-
>
|
|
97
|
-
<foxy-i18n infer="" key="option_always_reattempt"></foxy-i18n>
|
|
98
|
-
</vaadin-radio-button>
|
|
99
|
-
|
|
100
|
-
<vaadin-radio-button
|
|
101
|
-
class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20"
|
|
102
|
-
value="never_reattempt"
|
|
103
|
-
>
|
|
104
|
-
<foxy-i18n infer="" key="option_never_reattempt"></foxy-i18n>
|
|
105
|
-
</vaadin-radio-button>
|
|
106
|
-
</vaadin-radio-group>
|
|
107
|
-
`;
|
|
108
|
-
}
|
|
109
|
-
__handleGroupValueChanged(evt) {
|
|
110
|
-
const value = evt.currentTarget.value;
|
|
111
|
-
const nucleon = this.nucleon;
|
|
112
|
-
if (value === 'never_reattempt' || value === 'always_reattempt') {
|
|
113
|
-
if (value === 'never_reattempt') {
|
|
114
|
-
if ((nucleon === null || nucleon === void 0 ? void 0 : nucleon.form.reattempt_bypass_logic) !== 'reattempt_if_exists') {
|
|
115
|
-
nucleon === null || nucleon === void 0 ? void 0 : nucleon.edit({ reattempt_bypass_logic: 'reattempt_if_exists' });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
if ((nucleon === null || nucleon === void 0 ? void 0 : nucleon.form.reattempt_bypass_logic) !== 'skip_if_exists') {
|
|
120
|
-
nucleon === null || nucleon === void 0 ? void 0 : nucleon.edit({ reattempt_bypass_logic: 'skip_if_exists' });
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (nucleon === null || nucleon === void 0 ? void 0 : nucleon.form.reattempt_bypass_strings)
|
|
124
|
-
nucleon === null || nucleon === void 0 ? void 0 : nucleon.edit({ reattempt_bypass_strings: '' });
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=InternalSubscriptionSettingsFormReattemptBypass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InternalSubscriptionSettingsFormReattemptBypass.js","sourceRoot":"","sources":["../../../../../../src/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/InternalSubscriptionSettingsFormReattemptBypass.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,uBAAuB,EAAE,gFAA6E;AAC/G,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO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;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,IAAI,KAAK,KAAK,iBAAiB,IAAI,KAAK,KAAK,kBAAkB,EAAE;YAC/D,IAAI,KAAK,KAAK,iBAAiB,EAAE;gBAC/B,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,sBAAsB,MAAK,qBAAqB,EAAE;oBAClE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,EAAE;iBAClE;aACF;iBAAM;gBACL,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,sBAAsB,MAAK,gBAAgB,EAAE;oBAC7D,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,EAAE;iBAC7D;aACF;YAED,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,wBAAwB;gBAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,EAAE,wBAAwB,EAAE,EAAE,EAAE,EAAE;SAC7F;IACH,CAAC;CACF","sourcesContent":["import type { SubscriptionSettingsForm } from '../../SubscriptionSettingsForm';\nimport type { RadioGroupElement } from '@vaadin/vaadin-radio-button/vaadin-radio-group';\nimport type { TemplateResult } from 'lit-html';\nimport type { CSSResultArray } from 'lit-element';\nimport type { Item } from '../../../../internal/InternalEditableListControl/types';\n\nimport { InternalEditableControl } from '../../../../internal/InternalEditableControl/InternalEditableControl';\nimport { html } from 'lit-html';\nimport { css } from 'lit-element';\n\nexport class InternalSubscriptionSettingsFormReattemptBypass extends InternalEditableControl {\n static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n .visible-if-checked {\n display: none;\n }\n\n [checked] .visible-if-checked {\n display: block;\n }\n `,\n ];\n }\n\n nucleon: SubscriptionSettingsForm | null = null;\n\n private __getReattemptBypassStringsValue = () => {\n const strings = this.nucleon?.form.reattempt_bypass_strings?.split(',') ?? [];\n\n return strings\n .map(text => text.trim())\n .filter((text, index, strings) => text && strings.indexOf(text) === index)\n .map(text => ({ value: text }));\n };\n\n private __setReattemptBypassStringsValue = (newValue: Item[]) => {\n type Logic = 'skip_if_exists' | 'reattempt_if_exists';\n\n const group = this.renderRoot.querySelector('vaadin-radio-group');\n const logic = (group?.value ?? 'reattempt_if_exists') as Logic;\n\n this.nucleon?.edit({\n reattempt_bypass_strings: newValue.map(({ value }) => value).join(),\n reattempt_bypass_logic: logic,\n });\n };\n\n renderControl(): TemplateResult {\n const reattemptBypassStringsTemplate = html`\n <foxy-internal-editable-list-control\n infer=\"reattempt-bypass-strings\"\n class=\"w-full visible-if-checked\"\n .getValue=${this.__getReattemptBypassStringsValue}\n .setValue=${this.__setReattemptBypassStringsValue}\n @mousedown=${(evt: MouseEvent) => evt.stopPropagation()}\n @mouseup=${(evt: MouseEvent) => evt.stopPropagation()}\n @keydown=${(evt: MouseEvent) => evt.stopPropagation()}\n @click=${(evt: MouseEvent) => (evt.preventDefault(), evt.stopPropagation())}\n >\n </foxy-internal-editable-list-control>\n `;\n\n let groupValue: string | undefined = void 0;\n\n const nucleon = this.nucleon;\n const reattemptBypassLogic = nucleon?.form.reattempt_bypass_logic;\n const reattemptBypassStrings = nucleon?.form.reattempt_bypass_strings;\n\n if (reattemptBypassStrings) {\n groupValue = reattemptBypassLogic;\n } else if (reattemptBypassLogic === 'reattempt_if_exists') {\n groupValue = 'never_reattempt';\n } else if (reattemptBypassLogic === 'skip_if_exists') {\n groupValue = 'always_reattempt';\n }\n\n return html`\n <vaadin-radio-group\n helper-text=${this.helperText}\n label=${this.label}\n class=\"foxy-internal-subscription-settings-form-reattempt-bypass w-full divide-y divide-contrast-10 group\"\n theme=\"vertical\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .value=${groupValue}\n @value-changed=${this.__handleGroupValueChanged}\n >\n <vaadin-radio-button\n class=\"foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20\"\n value=\"reattempt_if_exists\"\n >\n <foxy-i18n infer=\"\" key=\"option_reattempt_if_exists\"></foxy-i18n>\n ${reattemptBypassStringsTemplate}\n </vaadin-radio-button>\n\n <vaadin-radio-button\n class=\"foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20\"\n value=\"skip_if_exists\"\n >\n <foxy-i18n infer=\"\" key=\"option_skip_if_exists\"></foxy-i18n>\n ${reattemptBypassStringsTemplate}\n </vaadin-radio-button>\n\n <vaadin-radio-button\n class=\"foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20\"\n value=\"always_reattempt\"\n >\n <foxy-i18n infer=\"\" key=\"option_always_reattempt\"></foxy-i18n>\n </vaadin-radio-button>\n\n <vaadin-radio-button\n class=\"foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20\"\n value=\"never_reattempt\"\n >\n <foxy-i18n infer=\"\" key=\"option_never_reattempt\"></foxy-i18n>\n </vaadin-radio-button>\n </vaadin-radio-group>\n `;\n }\n\n private __handleGroupValueChanged(evt: CustomEvent) {\n const value = (evt.currentTarget as RadioGroupElement).value;\n const nucleon = this.nucleon;\n\n if (value === 'never_reattempt' || value === 'always_reattempt') {\n if (value === 'never_reattempt') {\n if (nucleon?.form.reattempt_bypass_logic !== 'reattempt_if_exists') {\n nucleon?.edit({ reattempt_bypass_logic: 'reattempt_if_exists' });\n }\n } else {\n if (nucleon?.form.reattempt_bypass_logic !== 'skip_if_exists') {\n nucleon?.edit({ reattempt_bypass_logic: 'skip_if_exists' });\n }\n }\n\n if (nucleon?.form.reattempt_bypass_strings) nucleon?.edit({ reattempt_bypass_strings: '' });\n }\n }\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit-element';
|
|
2
|
-
export const vaadinRadioGroupStyles = css `:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{
|
|
3
|
-
padding-bottom:var(--lumo-space-xs);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part='group-field']{
|
|
7
|
-
display:flex;
|
|
8
|
-
border:thin solid var(--lumo-contrast-10pct);
|
|
9
|
-
border-radius:var(--lumo-border-radius);
|
|
10
|
-
transition:border-color 0.15s ease;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host(.foxy-internal-subscription-settings-form-reattempt-bypass:not([disabled]):not([readonly]):hover)
|
|
14
|
-
[part='group-field']{
|
|
15
|
-
border-color:var(--lumo-contrast-20pct);
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
export const vaadinRadioButtonStyles = css `:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{
|
|
19
|
-
display:flex;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part='label']{
|
|
23
|
-
flex:1;
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
//# sourceMappingURL=globalStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"globalStyles.js","sourceRoot":"","sources":["../../../../../../src/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG;;;;;;;;;;;;;;;CAiBxC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG;;;;;;;CAQzC,CAAC","sourcesContent":["import { css } from 'lit-element';\n\nexport const vaadinRadioGroupStyles = css`\n :host(.foxy-internal-subscription-settings-form-reattempt-bypass) label {\n padding-bottom: var(--lumo-space-xs);\n }\n\n :host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part='group-field'] {\n display: flex;\n border: thin solid var(--lumo-contrast-10pct);\n border-radius: var(--lumo-border-radius);\n transition: border-color 0.15s ease;\n }\n\n /* prettier-ignore */\n :host(.foxy-internal-subscription-settings-form-reattempt-bypass:not([disabled]):not([readonly]):hover)\n [part='group-field'] {\n border-color: var(--lumo-contrast-20pct);\n }\n`;\n\nexport const vaadinRadioButtonStyles = css`\n :host(.foxy-internal-subscription-settings-form-reattempt-bypass) label {\n display: flex;\n }\n\n :host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part='label'] {\n flex: 1;\n }\n`;\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-radio-button/vaadin-radio-button';
|
|
2
|
-
import '@vaadin/vaadin-radio-button/vaadin-radio-group';
|
|
3
|
-
import '../../../../internal/InternalEditableListControl/index';
|
|
4
|
-
import '../../../../internal/InternalEditableControl/index';
|
|
5
|
-
import '../../../I18n/index';
|
|
6
|
-
import { InternalSubscriptionSettingsFormReattemptBypass as Control } from './InternalSubscriptionSettingsFormReattemptBypass';
|
|
7
|
-
export { Control as InternalSubscriptionSettingsFormReattemptBypass };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-radio-button/vaadin-radio-button';
|
|
2
|
-
import '@vaadin/vaadin-radio-button/vaadin-radio-group';
|
|
3
|
-
import "../../../../internal/InternalEditableListControl/index.js";
|
|
4
|
-
import "../../../../internal/InternalEditableControl/index.js";
|
|
5
|
-
import "../../../I18n/index.js";
|
|
6
|
-
import { InternalSubscriptionSettingsFormReattemptBypass as Control } from "./InternalSubscriptionSettingsFormReattemptBypass.js";
|
|
7
|
-
import { vaadinRadioButtonStyles, vaadinRadioGroupStyles } from "./globalStyles.js";
|
|
8
|
-
import { registerStyles } from '@vaadin/vaadin-themable-mixin/register-styles';
|
|
9
|
-
customElements.define('foxy-internal-subscription-settings-form-reattempt-bypass', Control);
|
|
10
|
-
registerStyles('vaadin-radio-group', vaadinRadioGroupStyles);
|
|
11
|
-
registerStyles('vaadin-radio-button', vaadinRadioButtonStyles);
|
|
12
|
-
export { Control as InternalSubscriptionSettingsFormReattemptBypass };
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/index.ts"],"names":[],"mappings":"AAAA,OAAO,iDAAiD,CAAC;AACzD,OAAO,gDAAgD,CAAC;AAExD,mEAAgE;AAChE,+DAA4D;AAE5D,gCAA6B;AAE7B,OAAO,EAAE,+CAA+C,IAAI,OAAO,EAAE,6DAA0D;AAC/H,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,0BAAuB;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,cAAc,CAAC,MAAM,CAAC,2DAA2D,EAAE,OAAO,CAAC,CAAC;AAE5F,cAAc,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;AAC7D,cAAc,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,+CAA+C,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-radio-button/vaadin-radio-button';\nimport '@vaadin/vaadin-radio-button/vaadin-radio-group';\n\nimport '../../../../internal/InternalEditableListControl/index';\nimport '../../../../internal/InternalEditableControl/index';\n\nimport '../../../I18n/index';\n\nimport { InternalSubscriptionSettingsFormReattemptBypass as Control } from './InternalSubscriptionSettingsFormReattemptBypass';\nimport { vaadinRadioButtonStyles, vaadinRadioGroupStyles } from './globalStyles';\nimport { registerStyles } from '@vaadin/vaadin-themable-mixin/register-styles';\n\ncustomElements.define('foxy-internal-subscription-settings-form-reattempt-bypass', Control);\n\nregisterStyles('vaadin-radio-group', vaadinRadioGroupStyles);\nregisterStyles('vaadin-radio-button', vaadinRadioButtonStyles);\n\nexport { Control as InternalSubscriptionSettingsFormReattemptBypass };\n"]}
|