@foxy.io/elements 1.34.0-beta.2 → 1.34.0
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 +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-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-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-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-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-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-detail-card.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-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +6 -6
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-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-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.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-editor.js +3 -3
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card-embed.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-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +2 -2
- package/dist/cdn/foxy-reports-table.js +5 -5
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-container-card.js +1 -1
- package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-shipping-service-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-store-card.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-card.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-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-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-card.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-f4e03cdc.js → shared-0293eba8.js} +1 -1
- package/dist/cdn/shared-0d0fe9c0.js +1 -0
- package/dist/cdn/{shared-433ff5ae.js → shared-0db6454a.js} +10 -4
- package/dist/cdn/shared-0fe1dd67.js +1 -0
- package/dist/cdn/{shared-ff10b9fb.js → shared-126cb82b.js} +1 -1
- package/dist/cdn/{shared-3db18172.js → shared-16766722.js} +1 -1
- package/dist/cdn/{shared-f6f4bed5.js → shared-1838736d.js} +1 -1
- package/dist/cdn/{shared-9f4fad24.js → shared-1b5f155f.js} +1 -1
- package/dist/cdn/{shared-95a591b3.js → shared-1df36027.js} +2 -2
- package/dist/cdn/{shared-d3ffbcb0.js → shared-23aa2506.js} +1 -1
- package/dist/cdn/{shared-a9f4e92e.js → shared-2b6b735d.js} +1 -1
- package/dist/cdn/{shared-705ce87a.js → shared-2ddb119e.js} +1 -1
- package/dist/cdn/{shared-69cdc370.js → shared-2fd6e530.js} +1 -1
- package/dist/cdn/{shared-6b15ed9e.js → shared-370be17b.js} +5 -5
- package/dist/cdn/{shared-a8f38962.js → shared-3e25035f.js} +1 -1
- package/dist/cdn/{shared-62af0ef5.js → shared-3efc6649.js} +1 -1
- package/dist/cdn/shared-41072bad.js +1 -0
- package/dist/cdn/{shared-cc8ce493.js → shared-46de2ed2.js} +1 -1
- package/dist/cdn/{shared-4f33425a.js → shared-4e6c65e6.js} +1 -1
- package/dist/cdn/{shared-7edf38e9.js → shared-4f216dc1.js} +1 -1
- package/dist/cdn/{shared-83c8a2d2.js → shared-51fd3fc6.js} +1 -1
- package/dist/cdn/{shared-32566c11.js → shared-5245b330.js} +1 -1
- package/dist/cdn/{shared-8d826ccb.js → shared-527eb17e.js} +1 -1
- package/dist/cdn/{shared-a46c8030.js → shared-6a63a308.js} +1 -1
- package/dist/cdn/{shared-636cf673.js → shared-6c4a5133.js} +1 -1
- package/dist/cdn/{shared-25b83adb.js → shared-6cf0c762.js} +1 -1
- package/dist/cdn/{shared-8d5b9662.js → shared-6cf39826.js} +5 -5
- package/dist/cdn/shared-7040eef3.js +1 -0
- package/dist/cdn/{shared-47fe9f56.js → shared-74d9b3d4.js} +1 -1
- package/dist/cdn/{shared-136942c7.js → shared-7cfd461d.js} +1 -1
- package/dist/cdn/{shared-3ef5dcef.js → shared-7d234de2.js} +1 -1
- package/dist/cdn/{shared-a9b8c3ab.js → shared-7e1768cf.js} +1 -1
- package/dist/cdn/{shared-f0db16a5.js → shared-851b96ae.js} +1 -1
- package/dist/cdn/{shared-cb24170b.js → shared-85803aca.js} +1 -1
- package/dist/cdn/shared-869ed25d.js +294 -0
- package/dist/cdn/{shared-67d1de9a.js → shared-88bfb7f5.js} +1 -1
- package/dist/cdn/{shared-77135874.js → shared-8e73014c.js} +1 -1
- package/dist/cdn/{shared-3ebbd21d.js → shared-921e3f1e.js} +1 -1
- package/dist/cdn/{shared-52c9fa57.js → shared-9421c0d7.js} +1 -1
- package/dist/cdn/{shared-b8ae5af7.js → shared-9c479921.js} +1 -1
- package/dist/cdn/{shared-148214ee.js → shared-9e9bec09.js} +1 -1
- package/dist/cdn/{shared-6583e3f9.js → shared-a24264e6.js} +1 -1
- package/dist/cdn/{shared-9dd252c7.js → shared-a34983ea.js} +2 -2
- package/dist/cdn/{shared-a2616e4b.js → shared-a4953186.js} +1 -1
- package/dist/cdn/{shared-1d0d814b.js → shared-a7524277.js} +1 -1
- package/dist/cdn/shared-a83e33cd.js +1 -0
- package/dist/cdn/{shared-46189aae.js → shared-a86480c5.js} +1 -1
- package/dist/cdn/{shared-0d4cdb19.js → shared-ae68261f.js} +1 -1
- package/dist/cdn/{shared-2ca888f6.js → shared-b62fb09f.js} +1 -1
- package/dist/cdn/{shared-5cdec81e.js → shared-bbd2a4e6.js} +1 -1
- package/dist/cdn/{shared-56ee26d7.js → shared-bec65d6d.js} +1 -1
- package/dist/cdn/{shared-02c737dc.js → shared-c176c4fa.js} +1 -1
- package/dist/cdn/{shared-f79438f8.js → shared-c1f4a6ef.js} +1 -1
- package/dist/cdn/{shared-cfe76d01.js → shared-d735fc99.js} +1 -1
- package/dist/cdn/{shared-69c7aec1.js → shared-d806ec21.js} +1 -1
- package/dist/cdn/{shared-08e73812.js → shared-dbc9aff0.js} +1 -1
- package/dist/cdn/{shared-a1f697c2.js → shared-e0b00e0f.js} +1 -1
- package/dist/cdn/{shared-66e2a4ee.js → shared-e6379bd1.js} +1 -1
- package/dist/cdn/{shared-33c9ef32.js → shared-e7069b0f.js} +1 -1
- package/dist/cdn/{shared-70612035.js → shared-e766f6e0.js} +1 -1
- package/dist/cdn/{shared-57373d84.js → shared-e8df4368.js} +1 -1
- package/dist/cdn/{shared-b8c6eafc.js → shared-e9e2fd3f.js} +1 -1
- package/dist/cdn/{shared-2dd2ff95.js → shared-f378fe25.js} +1 -1
- package/dist/cdn/{shared-6b578d1a.js → shared-f57e1679.js} +1 -1
- package/dist/cdn/{shared-6b5e4fe4.js → shared-f8252d03.js} +1 -1
- package/dist/cdn/{shared-2aee2a22.js → shared-fceaef95.js} +1 -1
- package/dist/cdn/translations/template-config-form/en.json +520 -108
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.d.ts +2 -0
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +23 -2
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.d.ts +1 -0
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js +12 -2
- package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map +1 -1
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.d.ts +4 -0
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js +20 -0
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.d.ts +33 -26
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +679 -1234
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/index.d.ts +9 -5
- package/dist/elements/public/TemplateConfigForm/index.js +9 -5
- package/dist/elements/public/TemplateConfigForm/index.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.d.ts +14 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.js +138 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControl.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/{CountryCard.d.ts → internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControlItem.d.ts} +4 -4
- package/dist/elements/public/TemplateConfigForm/{CountryCard.js → internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControlItem.js} +20 -28
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/InternalTemplateConfigFormFilterValuesControlItem.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/index.d.ts +4 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/index.js +8 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormFilterValuesControl/index.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormSupportedCardsControl/InternalTemplateConfigFormSupportedCardsControl.d.ts +7 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormSupportedCardsControl/InternalTemplateConfigFormSupportedCardsControl.js +82 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormSupportedCardsControl/InternalTemplateConfigFormSupportedCardsControl.js.map +1 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormSupportedCardsControl/index.d.ts +3 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormSupportedCardsControl/index.js +5 -0
- package/dist/elements/public/TemplateConfigForm/internal/InternalTemplateConfigFormSupportedCardsControl/index.js.map +1 -0
- package/dist/mixins/themeable.js +4 -12
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-1acbd965.js +0 -1
- package/dist/cdn/shared-61ade33e.js +0 -6
- package/dist/cdn/shared-684174e7.js +0 -1
- package/dist/cdn/shared-8a65adfd.js +0 -1
- package/dist/cdn/shared-9ea762dc.js +0 -294
- package/dist/cdn/shared-b73aaedb.js +0 -1
- package/dist/cdn/shared-ccc7a886.js +0 -1
- package/dist/cdn/shared-e8744e04.js +0 -1
- package/dist/cdn/shared-eb8a9f27.js +0 -1
- package/dist/elements/public/TemplateConfigForm/CountriesList.d.ts +0 -21
- package/dist/elements/public/TemplateConfigForm/CountriesList.js +0 -137
- package/dist/elements/public/TemplateConfigForm/CountriesList.js.map +0 -1
- package/dist/elements/public/TemplateConfigForm/CountryCard.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InternalControl } from "../InternalControl/InternalControl.js";
|
|
2
2
|
import debounce from 'lodash-es/debounce';
|
|
3
|
+
import { get, set } from 'lodash-es';
|
|
3
4
|
/**
|
|
4
5
|
* An internal base class for controls that have editing functionality, e.g. a text field.
|
|
5
6
|
* Instances of this class will provide shortcuts for translatable placeholder, label, helper
|
|
@@ -13,8 +14,26 @@ export class InternalEditableControl extends InternalControl {
|
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
16
|
this.checkValidityAsync = null;
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
17
|
+
this.jsonTemplate = null;
|
|
18
|
+
this.jsonPath = null;
|
|
19
|
+
this.getValue = () => {
|
|
20
|
+
var _a;
|
|
21
|
+
const value = get((_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form, this.property);
|
|
22
|
+
if (this.jsonPath)
|
|
23
|
+
return get(JSON.parse(value !== null && value !== void 0 ? value : this.jsonTemplate), this.jsonPath);
|
|
24
|
+
return value;
|
|
25
|
+
};
|
|
26
|
+
this.setValue = (newValue) => {
|
|
27
|
+
var _a, _b, _c, _d;
|
|
28
|
+
if (this.jsonPath) {
|
|
29
|
+
const json = JSON.parse((_b = (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form[this.property]) !== null && _b !== void 0 ? _b : this.jsonTemplate);
|
|
30
|
+
set(json, this.jsonPath, newValue);
|
|
31
|
+
(_c = this.nucleon) === null || _c === void 0 ? void 0 : _c.edit({ [this.property]: JSON.stringify(json) });
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
(_d = this.nucleon) === null || _d === void 0 ? void 0 : _d.edit({ [this.property]: newValue });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
18
37
|
this.__debouncedCheckValidityAsync = debounce(async (newValue) => {
|
|
19
38
|
var _a;
|
|
20
39
|
const validOrError = await ((_a = this.checkValidityAsync) === null || _a === void 0 ? void 0 : _a.call(this, newValue));
|
|
@@ -34,9 +53,11 @@ export class InternalEditableControl extends InternalControl {
|
|
|
34
53
|
return {
|
|
35
54
|
...super.properties,
|
|
36
55
|
checkValidityAsync: { attribute: false },
|
|
56
|
+
jsonTemplate: { attribute: 'json-template' },
|
|
37
57
|
placeholder: { type: String, noAccessor: true },
|
|
38
58
|
helperText: { type: String, attribute: 'helper-text', noAccessor: true },
|
|
39
59
|
v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },
|
|
60
|
+
jsonPath: { attribute: 'json-path' },
|
|
40
61
|
getValue: { attribute: false },
|
|
41
62
|
setValue: { attribute: false },
|
|
42
63
|
property: { type: String, noAccessor: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalEditableControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalEditableControl/InternalEditableControl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,8CAA2C;AAErE,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAE1C;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAA5D;;QAgBE,uBAAkB,GAAwD,IAAI,CAAC;QAE/E,aAAQ,GAAG,GAAY,EAAE,wBAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAC,CAAC;QAE5D,aAAQ,GAAG,CAAC,QAAiB,EAAQ,EAAE,wBAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAC,CAAC;QAElF,kCAA6B,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAiB,EAAE,EAAE;;YAC3E,MAAM,YAAY,GAAG,aAAM,IAAI,CAAC,kBAAkB,+CAAvB,IAAI,EAAsB,QAAQ,EAAC,CAAC;YAC/D,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;gBAAE,OAAO;YACrC,IAAI,CAAC,YAAY,GAAG,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,IAAI,CAAC;QAC1E,CAAC,EAAE,GAAG,CAAC,CAAC;QAEA,oBAAe,GAAmB,IAAI,CAAC;QAEvC,kBAAa,GAAkB,IAAI,CAAC;QAEpC,iBAAY,GAAkB,I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AC,CAAC;IAClD,CAAC;IAED,mGAAmG;IACnG,IAAc,aAAa;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxF,CAAC;IAED,qFAAqF;IACrF,IAAc,cAAc;QAC1B,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\n\nimport { InternalControl } from '../InternalControl/InternalControl';\n\nimport debounce from 'lodash-es/debounce';\n\n/**\n * An internal base class for controls that have editing functionality, e.g. a text field.\n * Instances of this class will provide shortcuts for translatable placeholder, label, helper\n * text and more. Unlike a regular control, editable control can not only read from a NucleonElement\n * instance up the DOM tree, but also send changes to it and trigger validation process.\n *\n * @element foxy-internal-editable-control\n * @since 1.17.0\n */\nexport class InternalEditableControl extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n checkValidityAsync: { attribute: false },\n placeholder: { type: String, noAccessor: true },\n helperText: { type: String, attribute: 'helper-text', noAccessor: true },\n v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },\n getValue: { attribute: false },\n setValue: { attribute: false },\n property: { type: String, noAccessor: true },\n label: { type: String, noAccessor: true },\n __asyncError: { attribute: false },\n };\n }\n\n checkValidityAsync: ((value: unknown) => Promise<true | string>) | null = null;\n\n getValue = (): unknown => this.nucleon?.form[this.property];\n\n setValue = (newValue: unknown): void => this.nucleon?.edit({ [this.property]: newValue });\n\n private __debouncedCheckValidityAsync = debounce(async (newValue: unknown) => {\n const validOrError = await this.checkValidityAsync?.(newValue);\n if (this._value !== newValue) return;\n this.__asyncError = validOrError === true ? null : validOrError ?? null;\n }, 300);\n\n private __previousValue: unknown | null = null;\n\n private __placeholder: string | null = null;\n\n private __helperText: string | null = null;\n\n private __asyncError: string | null = null;\n\n private __v8nPrefix: string | null = null;\n\n private __property: string | null = null;\n\n private __label: string | null = null;\n\n /**\n * Translated placeholder text for this control. You can set your own placeholder text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetPlaceholder()`\n * to restore the default translation.\n */\n get placeholder(): string {\n return typeof this.__placeholder === 'string' ? this.__placeholder : this.t('placeholder');\n }\n\n set placeholder(newValue: string) {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = newValue;\n }\n\n /**\n * Translated helper text for this control. You can set your own helper text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetHelperText()`\n * to restore the default translation.\n */\n get helperText(): string {\n return typeof this.__helperText === 'string' ? this.__helperText : this.t('helper_text');\n }\n\n set helperText(newValue: string) {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = newValue;\n }\n\n /**\n * A prefix for all v8n errors related to this control. You can set your own v8n prefix\n * if the default one doesn't work for you. Use `.resetV8nPrefix()`\n * to restore the default v8n prefix.\n */\n get v8nPrefix(): string {\n if (typeof this.__v8nPrefix === 'string') return this.__v8nPrefix;\n if (typeof this.infer === 'string') return `${this.infer}:`;\n return '';\n }\n\n set v8nPrefix(newValue: string) {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = newValue;\n }\n\n /**\n * Name of the property to bind to inferred from the control name by converting it to snake_case.\n * You can set your own property name if the default inference method produces an incorrect result.\n * Use `.resetProperty()` to restore the default property name.\n */\n get property(): string {\n if (typeof this.__property === 'string') return this.__property;\n if (typeof this.infer === 'string') return this.infer.replace(/-/g, '_');\n return '';\n }\n\n set property(newValue: string) {\n this.requestUpdate('property', this.__property);\n this.__property = newValue;\n }\n\n /**\n * Translated label for this control. You can set your own label if the default key in the inferred\n * namespace doesn't work for you. Use `.resetLabel()` to restore the default translation.\n */\n get label(): string {\n return typeof this.__label === 'string' ? this.__label : this.t('label');\n }\n\n set label(newValue: string) {\n this.requestUpdate('label', this.__label);\n this.__label = newValue;\n }\n\n /** Restores the default placeholder translation. */\n resetPlaceholder(): void {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = null;\n }\n\n /** Restores the default helper text translation. */\n resetHelperText(): void {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = null;\n }\n\n /** Restores the default v8n prefix for errors. */\n resetV8nPrefix(): void {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = null;\n }\n\n /** Restores the default property name. */\n resetProperty(): void {\n this.requestUpdate('property', this.__property);\n this.__property = null;\n }\n\n /** Restores the default label translation. */\n resetLabel(): void {\n this.requestUpdate('label', this.__label);\n this.__label = null;\n }\n\n reportValidity(): void {\n const walker = this.ownerDocument.createTreeWalker(this.renderRoot, NodeFilter.SHOW_ELEMENT);\n\n do {\n type Input = Node & Record<string, () => unknown>;\n\n const node = walker.currentNode as Input;\n const methods = ['reportValidity', 'validate'];\n\n for (const method of methods) {\n if (method in node) {\n try {\n node[method]();\n break;\n } catch {\n continue;\n }\n }\n }\n } while (walker.nextNode());\n }\n\n /**\n * A shortcut to get the inferred value from the NucleonElement instance\n * up the DOM tree. If no such value or instance exists, returns `undefined`.\n * Assigning a value to this property will dispatch a cancelable `change` event\n * with the new value in the detail and write changes to the NucleonElement instance if permitted.\n */\n protected get _value(): unknown | undefined {\n return this.getValue();\n }\n\n protected set _value(newValue: unknown | undefined) {\n this.__previousValue = this._value;\n this.__asyncError = null;\n if (!this._error && this.__previousValue !== newValue) {\n this.__debouncedCheckValidityAsync(newValue);\n }\n\n const event = new CustomEvent('change', { cancelable: true, detail: newValue });\n const useDefaultAction = this.dispatchEvent(event);\n if (useDefaultAction) this.setValue(newValue);\n }\n\n /** A shortcut returning the first v8n error associated with this control. */\n protected get _error(): string | undefined {\n const syncError = this.nucleon?.errors.find(v => v.startsWith(this.v8nPrefix));\n return syncError ?? this.__asyncError ?? void 0;\n }\n\n /** A shortcut returning the localized text of the first v8n error associated with this control. */\n protected get _errorMessage(): string | undefined {\n return this._error ? this.t(this._error.substring(this.v8nPrefix.length)) : undefined;\n }\n\n /** A helper returning a `.checkValidity()` function for use with Vaadin elements. */\n protected get _checkValidity(): () => boolean {\n return () => !this._error;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InternalEditableControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalEditableControl/InternalEditableControl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,8CAA2C;AAErE,OAAO,QAAQ,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAA5D;;QAkBE,uBAAkB,GAAwD,IAAI,CAAC;QAE/E,iBAAY,GAAkB,IAAI,CAAC;QAEnC,aAAQ,GAAkB,IAAI,CAAC;QAE/B,aAAQ,GAAG,GAAY,EAAE;;YACvB,MAAM,KAAK,GAAG,GAAG,OAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrD,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACrF,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,QAAiB,EAAQ,EAAE;;YACrC,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,aAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,oCAAK,IAAI,CAAC,YAAY,CAAC,CAAC;gBAChF,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAC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ent":["import type { PropertyDeclarations } from 'lit-element';\n\nimport { InternalControl } from '../InternalControl/InternalControl';\n\nimport debounce from 'lodash-es/debounce';\nimport { get, set } from 'lodash-es';\n\n/**\n * An internal base class for controls that have editing functionality, e.g. a text field.\n * Instances of this class will provide shortcuts for translatable placeholder, label, helper\n * text and more. Unlike a regular control, editable control can not only read from a NucleonElement\n * instance up the DOM tree, but also send changes to it and trigger validation process.\n *\n * @element foxy-internal-editable-control\n * @since 1.17.0\n */\nexport class InternalEditableControl extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n checkValidityAsync: { attribute: false },\n jsonTemplate: { attribute: 'json-template' },\n placeholder: { type: String, noAccessor: true },\n helperText: { type: String, attribute: 'helper-text', noAccessor: true },\n v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },\n jsonPath: { attribute: 'json-path' },\n getValue: { attribute: false },\n setValue: { attribute: false },\n property: { type: String, noAccessor: true },\n label: { type: String, noAccessor: true },\n __asyncError: { attribute: false },\n };\n }\n\n checkValidityAsync: ((value: unknown) => Promise<true | string>) | null = null;\n\n jsonTemplate: string | null = null;\n\n jsonPath: string | null = null;\n\n getValue = (): unknown => {\n const value = get(this.nucleon?.form, this.property);\n if (this.jsonPath) return get(JSON.parse(value ?? this.jsonTemplate), this.jsonPath);\n return value;\n };\n\n setValue = (newValue: unknown): void => {\n if (this.jsonPath) {\n const json = JSON.parse(this.nucleon?.form[this.property] ?? this.jsonTemplate);\n set(json, this.jsonPath, newValue);\n this.nucleon?.edit({ [this.property]: JSON.stringify(json) });\n } else {\n this.nucleon?.edit({ [this.property]: newValue });\n }\n };\n\n private __debouncedCheckValidityAsync = debounce(async (newValue: unknown) => {\n const validOrError = await this.checkValidityAsync?.(newValue);\n if (this._value !== newValue) return;\n this.__asyncError = validOrError === true ? null : validOrError ?? null;\n }, 300);\n\n private __previousValue: unknown | null = null;\n\n private __placeholder: string | null = null;\n\n private __helperText: string | null = null;\n\n private __asyncError: string | null = null;\n\n private __v8nPrefix: string | null = null;\n\n private __property: string | null = null;\n\n private __label: string | null = null;\n\n /**\n * Translated placeholder text for this control. You can set your own placeholder text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetPlaceholder()`\n * to restore the default translation.\n */\n get placeholder(): string {\n return typeof this.__placeholder === 'string' ? this.__placeholder : this.t('placeholder');\n }\n\n set placeholder(newValue: string) {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = newValue;\n }\n\n /**\n * Translated helper text for this control. You can set your own helper text\n * if the default key in the inferred namespace doesn't work for you. Use `.resetHelperText()`\n * to restore the default translation.\n */\n get helperText(): string {\n return typeof this.__helperText === 'string' ? this.__helperText : this.t('helper_text');\n }\n\n set helperText(newValue: string) {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = newValue;\n }\n\n /**\n * A prefix for all v8n errors related to this control. You can set your own v8n prefix\n * if the default one doesn't work for you. Use `.resetV8nPrefix()`\n * to restore the default v8n prefix.\n */\n get v8nPrefix(): string {\n if (typeof this.__v8nPrefix === 'string') return this.__v8nPrefix;\n if (typeof this.infer === 'string') return `${this.infer}:`;\n return '';\n }\n\n set v8nPrefix(newValue: string) {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = newValue;\n }\n\n /**\n * Name of the property to bind to inferred from the control name by converting it to snake_case.\n * You can set your own property name if the default inference method produces an incorrect result.\n * Use `.resetProperty()` to restore the default property name.\n */\n get property(): string {\n if (typeof this.__property === 'string') return this.__property;\n if (typeof this.infer === 'string') return this.infer.replace(/-/g, '_');\n return '';\n }\n\n set property(newValue: string) {\n this.requestUpdate('property', this.__property);\n this.__property = newValue;\n }\n\n /**\n * Translated label for this control. You can set your own label if the default key in the inferred\n * namespace doesn't work for you. Use `.resetLabel()` to restore the default translation.\n */\n get label(): string {\n return typeof this.__label === 'string' ? this.__label : this.t('label');\n }\n\n set label(newValue: string) {\n this.requestUpdate('label', this.__label);\n this.__label = newValue;\n }\n\n /** Restores the default placeholder translation. */\n resetPlaceholder(): void {\n this.requestUpdate('placeholder', this.__placeholder);\n this.__placeholder = null;\n }\n\n /** Restores the default helper text translation. */\n resetHelperText(): void {\n this.requestUpdate('helperText', this.__helperText);\n this.__helperText = null;\n }\n\n /** Restores the default v8n prefix for errors. */\n resetV8nPrefix(): void {\n this.requestUpdate('v8nPrefix', this.__v8nPrefix);\n this.__v8nPrefix = null;\n }\n\n /** Restores the default property name. */\n resetProperty(): void {\n this.requestUpdate('property', this.__property);\n this.__property = null;\n }\n\n /** Restores the default label translation. */\n resetLabel(): void {\n this.requestUpdate('label', this.__label);\n this.__label = null;\n }\n\n reportValidity(): void {\n const walker = this.ownerDocument.createTreeWalker(this.renderRoot, NodeFilter.SHOW_ELEMENT);\n\n do {\n type Input = Node & Record<string, () => unknown>;\n\n const node = walker.currentNode as Input;\n const methods = ['reportValidity', 'validate'];\n\n for (const method of methods) {\n if (method in node) {\n try {\n node[method]();\n break;\n } catch {\n continue;\n }\n }\n }\n } while (walker.nextNode());\n }\n\n /**\n * A shortcut to get the inferred value from the NucleonElement instance\n * up the DOM tree. If no such value or instance exists, returns `undefined`.\n * Assigning a value to this property will dispatch a cancelable `change` event\n * with the new value in the detail and write changes to the NucleonElement instance if permitted.\n */\n protected get _value(): unknown | undefined {\n return this.getValue();\n }\n\n protected set _value(newValue: unknown | undefined) {\n this.__previousValue = this._value;\n this.__asyncError = null;\n if (!this._error && this.__previousValue !== newValue) {\n this.__debouncedCheckValidityAsync(newValue);\n }\n\n const event = new CustomEvent('change', { cancelable: true, detail: newValue });\n const useDefaultAction = this.dispatchEvent(event);\n if (useDefaultAction) this.setValue(newValue);\n }\n\n /** A shortcut returning the first v8n error associated with this control. */\n protected get _error(): string | undefined {\n const syncError = this.nucleon?.errors.find(v => v.startsWith(this.v8nPrefix));\n return syncError ?? this.__asyncError ?? void 0;\n }\n\n /** A shortcut returning the localized text of the first v8n error associated with this control. */\n protected get _errorMessage(): string | undefined {\n return this._error ? this.t(this._error.substring(this.v8nPrefix.length)) : undefined;\n }\n\n /** A helper returning a `.checkValidity()` function for use with Vaadin elements. */\n protected get _checkValidity(): () => boolean {\n return () => !this._error;\n }\n}\n"]}
|
|
@@ -5,6 +5,7 @@ export declare class InternalEditableListControl extends InternalEditableControl
|
|
|
5
5
|
static get properties(): PropertyDeclarations;
|
|
6
6
|
static get styles(): CSSResultArray;
|
|
7
7
|
inputParams: Record<string, unknown>;
|
|
8
|
+
simpleValue: boolean;
|
|
8
9
|
options: Option[];
|
|
9
10
|
layout: 'standalone' | 'summary-item' | null;
|
|
10
11
|
units: Unit[];
|
|
@@ -8,6 +8,7 @@ export class InternalEditableListControl extends InternalEditableControl {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
this.inputParams = {};
|
|
11
|
+
this.simpleValue = false;
|
|
11
12
|
this.options = [];
|
|
12
13
|
this.layout = null;
|
|
13
14
|
this.units = [];
|
|
@@ -19,6 +20,7 @@ export class InternalEditableListControl extends InternalEditableControl {
|
|
|
19
20
|
return {
|
|
20
21
|
...super.properties,
|
|
21
22
|
inputParams: { attribute: false },
|
|
23
|
+
simpleValue: { type: Boolean, attribute: 'simple-value' },
|
|
22
24
|
options: { type: Array },
|
|
23
25
|
layout: {},
|
|
24
26
|
units: { type: Array },
|
|
@@ -317,10 +319,18 @@ div:has(> select)::after{
|
|
|
317
319
|
}
|
|
318
320
|
get _value() {
|
|
319
321
|
var _a;
|
|
320
|
-
|
|
322
|
+
const value = super._value;
|
|
323
|
+
if (this.simpleValue)
|
|
324
|
+
return ((_a = value) !== null && _a !== void 0 ? _a : []).map(value => ({ value }));
|
|
325
|
+
return (value !== null && value !== void 0 ? value : []);
|
|
321
326
|
}
|
|
322
327
|
set _value(newValue) {
|
|
323
|
-
|
|
328
|
+
if (this.simpleValue) {
|
|
329
|
+
super._value = newValue.map(({ value }) => value);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
super._value = newValue;
|
|
333
|
+
}
|
|
324
334
|
}
|
|
325
335
|
}
|
|
326
336
|
//# sourceMappingURL=InternalEditableListControl.js.map
|
package/dist/elements/internal/InternalEditableListControl/InternalEditableListControl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalEditableListControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalEditableListControl/InternalEditableListControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,MAAM,OAAO,2BAA4B,SAAQ,uBAAuB;IAAxE;;QAsCE,gBAAW,GAA4B,EAAE,CAAC;QAE1C,YAAO,GAAa,EAAE,CAAC;QAEvB,WAAM,GAAyC,IAAI,CAAC;QAEpD,UAAK,GAAW,EAAE,CAAC;QAEnB,UAAK,GAAsB,IAAI,CAAC;QAExB,qBAAgB,GAAG,KAAK,CAAC;QAEzB,cAAS,GAAG,EAAE,CAAC;IA2RzB,CAAC;IA5UC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,WAAW,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;YACjC,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;YACxB,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;YACtB,KAAK,EAAE,EAAE;YACT,gBAAgB,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;YACtC,SAAS,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;SAChC,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAA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AAC;;;;;cAKF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;YACtC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;gBAAE,OAAO;YAC3D,OAAO,IAAI,CAAA,iBAAiB,KAAK,IAAI,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK,WAAW,CAAC;QACjE,CAAC,CAAC;;;+CAGiC,CAAC,IAAI,CAAC,SAAS;;2BAEnC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;sBACrB,QAAQ,CAAC;YACf,uEAAuE,EAAE,IAAI;YAC7E,8DAA8D,EAAE,IAAI;YACpE,4CAA4C,EAAE,mBAAmB;YACjE,wCAAwC,EAAE,CAAC,mBAAmB;YAC9D,8CAA8C,EAAE,CAAC,mBAAmB;YACpE,cAAc,EAAE,CAAC,mBAAmB;SACrC,CAAC;0BACU,mBAAmB;uBACtB,OAAO;;;;;;;;;gBASd,QAAQ,CAAC;YACf,4BAA4B,EAAE,IAAI;YAClC,SAAS,EAAE,aAAa;YACxB,QAAQ,EAAE,CAAC,aAAa;SACzB,CAAC;kBACQ,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;;UAEvF,IAAI,CAAC,aAAa;;KAEvB,CAAC;IACJ,CAAC;IAED,IAAc,MAAM;;QAClB,OAAO,OAAC,KAAK,CAAC,MAAM,mCAAI,EAAE,CAAW,CAAC;IACxC,CAAC;IAED,IAAc,MAAM,CAAC,QAAgB;QACnC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { Item, Option, Unit } from './types';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, css } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\nimport { repeat } from 'lit-html/directives/repeat';\nimport { spread } from '@open-wc/lit-helpers';\nimport { live } from 'lit-html/directives/live';\n\nexport class InternalEditableListControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n inputParams: { attribute: false },\n options: { type: Array },\n layout: {},\n units: { type: Array },\n range: {},\n __isErrorVisible: { attribute: false },\n __newItem: { attribute: false },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n div:has(> select) {\n position: relative;\n }\n\n div:has(> select)::after {\n content: ' ';\n position: absolute;\n top: 50%;\n margin-top: -2px;\n right: 10px;\n width: 0;\n height: 0;\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n border-top: 5px solid currentColor;\n }\n `,\n ];\n }\n\n inputParams: Record<string, unknown> = {};\n\n options: Option[] = [];\n\n layout: 'standalone' | 'summary-item' | null = null;\n\n units: Unit[] = [];\n\n range: null | 'optional' = null;\n\n private __isErrorVisible = false;\n\n private __newItem = '';\n\n render(): TemplateResult {\n const isSummaryItem = this.layout === 'summary-item';\n const isInteractive = !this.disabled && !this.readonly;\n\n const deleteButtonClass = classMap({\n 'w-xs h-xs rounded-s transition-colors flex-shrink-0': true,\n 'focus-outline-none focus-ring-2 ring-inset ring-error-50': true,\n 'text-tertiary hover-bg-error-10 hover-text-error': !this.disabled,\n 'cursor-default text-disabled': this.disabled,\n 'flex items-center justify-center': !this.readonly,\n 'hidden': this.readonly,\n 'mr-xs': !isSummaryItem,\n });\n\n const itemClass = classMap({\n 'transition-colors flex items-center': true,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n 'border border-contrast-10 rounded-s': isSummaryItem,\n 'h-m': !isSummaryItem,\n });\n\n const isAddButtonDisabled = this.disabled || !this.__newItem;\n\n const addItem = () => {\n const newValue = [...this._value];\n const unit = this.renderRoot.querySelector('select')?.value;\n\n this.__newItem\n .split('\\n')\n .map(code => code.trim())\n .filter(code => code.length > 0)\n .forEach(value => {\n if (!newValue.some(item => item.value === value)) {\n newValue.push({ value, unit });\n }\n });\n\n this._value = newValue;\n this.__newItem = '';\n };\n\n return html`\n <div class=\"mb-s\" ?hidden=${!this.label && !this.helperText}>\n <div class=${classMap({ 'font-medium text-l': !isSummaryItem })}>${this.label}</div>\n <div\n class=${classMap({\n 'text-secondary': true,\n 'text-xs': isSummaryItem,\n 'text-s': !isSummaryItem,\n })}\n ?hidden=${!this.helperText}\n >\n ${this.helperText}\n </div>\n </div>\n\n <div\n class=${classMap({\n 'bg-contrast-5 rounded': !isSummaryItem,\n 'mt-s': isSummaryItem,\n })}\n >\n <ol\n class=${classMap({\n 'transition-colors font-medium': true,\n 'divide-y divide-contrast-10': !isSummaryItem,\n 'flex flex-wrap gap-s': isSummaryItem,\n })}\n >\n ${repeat(\n this._value,\n item => item.value,\n (item, index) => {\n return html`\n <li\n class=${itemClass}\n style=\"padding-left: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <div class=\"flex-1 mr-s\">${item.label ?? item.value}</div>\n\n <button\n aria-label=${this.t('delete')}\n class=${deleteButtonClass}\n ?disabled=${this.disabled}\n @click=${() => {\n this._value = this._value.filter((_, i) => i !== index);\n }}\n >\n <iron-icon icon=\"lumo:cross\" class=\"icon-inline text-xl\"></iron-icon>\n </button>\n </li>\n `;\n }\n )}\n </ol>\n\n <div\n style=\"padding-left: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n class=${classMap({\n 'transition-colors h-m flex items-center gap-xs': true,\n 'focus-within-ring-2 focus-within-ring-primary-50': !isSummaryItem,\n 'bg-contrast-5 hover-bg-contrast-10': !isSummaryItem && isInteractive,\n 'bg-contrast-5': !isSummaryItem && this.disabled,\n 'flex': !this.readonly,\n 'hidden': this.readonly,\n 'rounded-s border border-contrast-10': isSummaryItem,\n 'mt-s': isSummaryItem && this._value.length > 0,\n 'rounded': !isSummaryItem && this._value.length === 0,\n 'rounded-b': !isSummaryItem && this._value.length > 0,\n })}\n >\n ${this.range\n ? html`\n <foxy-i18n infer=\"\" class=\"text-disabled font-medium\" key=\"range_from\"> </foxy-i18n>\n\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'bg-transparent appearance-none h-m font-medium focus-outline-none': true,\n 'text-disabled': this.disabled,\n })}\n list=\"list\"\n ...=${spread(this.inputParams)}\n .value=${live(this.__newItem.split('..')[0] ?? '')}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addItem()}\n @change=${(evt: Event) => evt.stopPropagation()}\n @input=${(evt: InputEvent) => {\n const newFrom = (evt.currentTarget as HTMLInputElement).value.trim();\n const oldTo = this.__newItem.split('..')[1] ?? '';\n this.__newItem = oldTo ? `${newFrom}..${oldTo}` : newFrom;\n }}\n @paste=${(evt: ClipboardEvent) => {\n evt.preventDefault();\n\n const newFrom = evt.clipboardData?.getData('text') ?? '';\n const oldTo = this.__newItem.split('..')[1] ?? '';\n this.__newItem = oldTo ? `${newFrom}..${oldTo}` : newFrom;\n\n addItem();\n }}\n @blur=${() => {\n this.__isErrorVisible = true;\n }}\n />\n\n <foxy-i18n infer=\"\" class=\"text-disabled font-medium\" key=\"range_to\"></foxy-i18n>\n\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'bg-transparent appearance-none h-m font-medium focus-outline-none': true,\n 'text-disabled': this.disabled,\n })}\n list=\"list\"\n ...=${spread(this.inputParams)}\n .value=${live(this.__newItem.split('..')[1] ?? '')}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addItem()}\n @change=${(evt: Event) => evt.stopPropagation()}\n @input=${(evt: InputEvent) => {\n const newTo = (evt.currentTarget as HTMLInputElement).value.trim();\n const oldFrom = this.__newItem.split('..')[0] ?? '';\n this.__newItem = oldFrom ? `${oldFrom}..${newTo}` : newTo;\n }}\n @paste=${(evt: ClipboardEvent) => {\n evt.preventDefault();\n\n const newTo = evt.clipboardData?.getData('text') ?? '';\n const oldFrom = this.__newItem.split('..')[0] ?? '';\n this.__newItem = oldFrom ? `${oldFrom}..${newTo}` : newTo;\n\n addItem();\n }}\n @blur=${() => {\n this.__isErrorVisible = true;\n }}\n />\n `\n : html`\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'w-full bg-transparent appearance-none h-m font-medium focus-outline-none':\n true,\n 'text-disabled': this.disabled,\n })}\n list=\"list\"\n ...=${spread(this.inputParams)}\n .value=${live(this.__newItem)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addItem()}\n @change=${(evt: Event) => evt.stopPropagation()}\n @input=${(evt: InputEvent) => {\n this.__newItem = (evt.currentTarget as HTMLInputElement).value.trim();\n }}\n @paste=${(evt: ClipboardEvent) => {\n evt.preventDefault();\n this.__newItem = evt.clipboardData?.getData('text') ?? '';\n addItem();\n }}\n @blur=${() => {\n this.__isErrorVisible = true;\n }}\n />\n `}\n\n <div\n class=${classMap({\n 'relative': true,\n 'hover-text-base focus-within-text-primary-contrast': !this.disabled,\n 'text-disabled': this.disabled,\n })}\n ?hidden=${this.units.length === 0}\n >\n <select\n style=\"min-width: 8rem\"\n class=${classMap({\n 'transition-colors rounded-s mx-xs px-s': true,\n 'bg-contrast-5 appearance-none h-xs font-medium focus-outline-none': true,\n 'hover-bg-contrast focus-bg-primary': !this.disabled,\n })}\n ?disabled=${this.disabled}\n >\n ${this.units.map(({ label, value }) => {\n return html`<option value=${value}>${label ?? value}</option>`;\n })}\n </select>\n </div>\n\n <datalist id=\"list\">\n ${this.options.map(({ label, value }) => {\n if (this._value.some(item => item.value === value)) return;\n return html`<option value=${value}>${label ?? value}</option>`;\n })}\n </datalist>\n\n <div class=\"mr-xs ml-auto\" ?hidden=${!this.__newItem}>\n <button\n aria-label=${this.t('submit')}\n class=${classMap({\n 'w-xs h-xs flex-shrink-0 ring-inset ring-success-50 focus-outline-none': true,\n 'flex items-center justify-center rounded-s transition-colors': true,\n 'bg-contrast-5 text-disabled cursor-default': isAddButtonDisabled,\n 'bg-contrast-5 text-body cursor-pointer': !isAddButtonDisabled,\n 'hover-bg-success hover-text-success-contrast': !isAddButtonDisabled,\n 'focus-ring-2': !isAddButtonDisabled,\n })}\n ?disabled=${isAddButtonDisabled}\n @click=${addItem}\n >\n <iron-icon icon=\"lumo:plus\" class=\"icon-inline text-l\"></iron-icon>\n </button>\n </div>\n </div>\n </div>\n\n <div\n class=${classMap({\n 'mt-s leading-xs text-error': true,\n 'text-xs': isSummaryItem,\n 'text-s': !isSummaryItem,\n })}\n ?hidden=${!this.__isErrorVisible || !this._errorMessage || this.disabled || this.readonly}\n >\n ${this._errorMessage}\n </div>\n `;\n }\n\n protected get _value(): Item[] {\n return (super._value ?? []) as Item[];\n }\n\n protected set _value(newValue: Item[]) {\n super._value = newValue;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InternalEditableListControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalEditableListControl/InternalEditableListControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEhD,MAAM,OAAO,2BAA4B,SAAQ,uBAAuB;IAAxE;;QAuCE,gBAAW,GAA4B,EAAE,CAAC;QAE1C,gBAAW,GAAG,KAAK,CAAC;QAEpB,YAAO,GAAa,EAAE,CAAC;QAEvB,WAAM,GAAyC,IAAI,CAAC;QAEpD,UAAK,GAAW,EAAE,CA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AAmB;uBACtB,OAAO;;;;;;;;;gBASd,QAAQ,CAAC;YACf,4BAA4B,EAAE,IAAI;YAClC,SAAS,EAAE,aAAa;YACxB,QAAQ,EAAE,CAAC,aAAa;SACzB,CAAC;kBACQ,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;;UAEvF,IAAI,CAAC,aAAa;;KAEvB,CAAC;IACJ,CAAC;IAED,IAAc,MAAM;;QAClB,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,OAAE,KAAkB,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACnF,OAAO,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAW,CAAC;IACjC,CAAC;IAED,IAAc,MAAM,CAAC,QAAgB;QACnC,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;SACnD;aAAM;YACL,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC;SACzB;IACH,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { Item, Option, Unit } from './types';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, css } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\nimport { repeat } from 'lit-html/directives/repeat';\nimport { spread } from '@open-wc/lit-helpers';\nimport { live } from 'lit-html/directives/live';\n\nexport class InternalEditableListControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n inputParams: { attribute: false },\n simpleValue: { type: Boolean, attribute: 'simple-value' },\n options: { type: Array },\n layout: {},\n units: { type: Array },\n range: {},\n __isErrorVisible: { attribute: false },\n __newItem: { attribute: false },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n div:has(> select) {\n position: relative;\n }\n\n div:has(> select)::after {\n content: ' ';\n position: absolute;\n top: 50%;\n margin-top: -2px;\n right: 10px;\n width: 0;\n height: 0;\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n border-top: 5px solid currentColor;\n }\n `,\n ];\n }\n\n inputParams: Record<string, unknown> = {};\n\n simpleValue = false;\n\n options: Option[] = [];\n\n layout: 'standalone' | 'summary-item' | null = null;\n\n units: Unit[] = [];\n\n range: null | 'optional' = null;\n\n private __isErrorVisible = false;\n\n private __newItem = '';\n\n render(): TemplateResult {\n const isSummaryItem = this.layout === 'summary-item';\n const isInteractive = !this.disabled && !this.readonly;\n\n const deleteButtonClass = classMap({\n 'w-xs h-xs rounded-s transition-colors flex-shrink-0': true,\n 'focus-outline-none focus-ring-2 ring-inset ring-error-50': true,\n 'text-tertiary hover-bg-error-10 hover-text-error': !this.disabled,\n 'cursor-default text-disabled': this.disabled,\n 'flex items-center justify-center': !this.readonly,\n 'hidden': this.readonly,\n 'mr-xs': !isSummaryItem,\n });\n\n const itemClass = classMap({\n 'transition-colors flex items-center': true,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n 'border border-contrast-10 rounded-s': isSummaryItem,\n 'h-m': !isSummaryItem,\n });\n\n const isAddButtonDisabled = this.disabled || !this.__newItem;\n\n const addItem = () => {\n const newValue = [...this._value];\n const unit = this.renderRoot.querySelector('select')?.value;\n\n this.__newItem\n .split('\\n')\n .map(code => code.trim())\n .filter(code => code.length > 0)\n .forEach(value => {\n if (!newValue.some(item => item.value === value)) {\n newValue.push({ value, unit });\n }\n });\n\n this._value = newValue;\n this.__newItem = '';\n };\n\n return html`\n <div class=\"mb-s\" ?hidden=${!this.label && !this.helperText}>\n <div class=${classMap({ 'font-medium text-l': !isSummaryItem })}>${this.label}</div>\n <div\n class=${classMap({\n 'text-secondary': true,\n 'text-xs': isSummaryItem,\n 'text-s': !isSummaryItem,\n })}\n ?hidden=${!this.helperText}\n >\n ${this.helperText}\n </div>\n </div>\n\n <div\n class=${classMap({\n 'bg-contrast-5 rounded': !isSummaryItem,\n 'mt-s': isSummaryItem,\n })}\n >\n <ol\n class=${classMap({\n 'transition-colors font-medium': true,\n 'divide-y divide-contrast-10': !isSummaryItem,\n 'flex flex-wrap gap-s': isSummaryItem,\n })}\n >\n ${repeat(\n this._value,\n item => item.value,\n (item, index) => {\n return html`\n <li\n class=${itemClass}\n style=\"padding-left: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <div class=\"flex-1 mr-s\">${item.label ?? item.value}</div>\n\n <button\n aria-label=${this.t('delete')}\n class=${deleteButtonClass}\n ?disabled=${this.disabled}\n @click=${() => {\n this._value = this._value.filter((_, i) => i !== index);\n }}\n >\n <iron-icon icon=\"lumo:cross\" class=\"icon-inline text-xl\"></iron-icon>\n </button>\n </li>\n `;\n }\n )}\n </ol>\n\n <div\n style=\"padding-left: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n class=${classMap({\n 'transition-colors h-m flex items-center gap-xs': true,\n 'focus-within-ring-2 focus-within-ring-primary-50': !isSummaryItem,\n 'bg-contrast-5 hover-bg-contrast-10': !isSummaryItem && isInteractive,\n 'bg-contrast-5': !isSummaryItem && this.disabled,\n 'flex': !this.readonly,\n 'hidden': this.readonly,\n 'rounded-s border border-contrast-10': isSummaryItem,\n 'mt-s': isSummaryItem && this._value.length > 0,\n 'rounded': !isSummaryItem && this._value.length === 0,\n 'rounded-b': !isSummaryItem && this._value.length > 0,\n })}\n >\n ${this.range\n ? html`\n <foxy-i18n infer=\"\" class=\"text-disabled font-medium\" key=\"range_from\"> </foxy-i18n>\n\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'bg-transparent appearance-none h-m font-medium focus-outline-none': true,\n 'text-disabled': this.disabled,\n })}\n list=\"list\"\n ...=${spread(this.inputParams)}\n .value=${live(this.__newItem.split('..')[0] ?? '')}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addItem()}\n @change=${(evt: Event) => evt.stopPropagation()}\n @input=${(evt: InputEvent) => {\n const newFrom = (evt.currentTarget as HTMLInputElement).value.trim();\n const oldTo = this.__newItem.split('..')[1] ?? '';\n this.__newItem = oldTo ? `${newFrom}..${oldTo}` : newFrom;\n }}\n @paste=${(evt: ClipboardEvent) => {\n evt.preventDefault();\n\n const newFrom = evt.clipboardData?.getData('text') ?? '';\n const oldTo = this.__newItem.split('..')[1] ?? '';\n this.__newItem = oldTo ? `${newFrom}..${oldTo}` : newFrom;\n\n addItem();\n }}\n @blur=${() => {\n this.__isErrorVisible = true;\n }}\n />\n\n <foxy-i18n infer=\"\" class=\"text-disabled font-medium\" key=\"range_to\"></foxy-i18n>\n\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'bg-transparent appearance-none h-m font-medium focus-outline-none': true,\n 'text-disabled': this.disabled,\n })}\n list=\"list\"\n ...=${spread(this.inputParams)}\n .value=${live(this.__newItem.split('..')[1] ?? '')}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addItem()}\n @change=${(evt: Event) => evt.stopPropagation()}\n @input=${(evt: InputEvent) => {\n const newTo = (evt.currentTarget as HTMLInputElement).value.trim();\n const oldFrom = this.__newItem.split('..')[0] ?? '';\n this.__newItem = oldFrom ? `${oldFrom}..${newTo}` : newTo;\n }}\n @paste=${(evt: ClipboardEvent) => {\n evt.preventDefault();\n\n const newTo = evt.clipboardData?.getData('text') ?? '';\n const oldFrom = this.__newItem.split('..')[0] ?? '';\n this.__newItem = oldFrom ? `${oldFrom}..${newTo}` : newTo;\n\n addItem();\n }}\n @blur=${() => {\n this.__isErrorVisible = true;\n }}\n />\n `\n : html`\n <input\n placeholder=${this.placeholder}\n class=${classMap({\n 'w-full bg-transparent appearance-none h-m font-medium focus-outline-none':\n true,\n 'text-disabled': this.disabled,\n })}\n list=\"list\"\n ...=${spread(this.inputParams)}\n .value=${live(this.__newItem)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && addItem()}\n @change=${(evt: Event) => evt.stopPropagation()}\n @input=${(evt: InputEvent) => {\n this.__newItem = (evt.currentTarget as HTMLInputElement).value.trim();\n }}\n @paste=${(evt: ClipboardEvent) => {\n evt.preventDefault();\n this.__newItem = evt.clipboardData?.getData('text') ?? '';\n addItem();\n }}\n @blur=${() => {\n this.__isErrorVisible = true;\n }}\n />\n `}\n\n <div\n class=${classMap({\n 'relative': true,\n 'hover-text-base focus-within-text-primary-contrast': !this.disabled,\n 'text-disabled': this.disabled,\n })}\n ?hidden=${this.units.length === 0}\n >\n <select\n style=\"min-width: 8rem\"\n class=${classMap({\n 'transition-colors rounded-s mx-xs px-s': true,\n 'bg-contrast-5 appearance-none h-xs font-medium focus-outline-none': true,\n 'hover-bg-contrast focus-bg-primary': !this.disabled,\n })}\n ?disabled=${this.disabled}\n >\n ${this.units.map(({ label, value }) => {\n return html`<option value=${value}>${label ?? value}</option>`;\n })}\n </select>\n </div>\n\n <datalist id=\"list\">\n ${this.options.map(({ label, value }) => {\n if (this._value.some(item => item.value === value)) return;\n return html`<option value=${value}>${label ?? value}</option>`;\n })}\n </datalist>\n\n <div class=\"mr-xs ml-auto\" ?hidden=${!this.__newItem}>\n <button\n aria-label=${this.t('submit')}\n class=${classMap({\n 'w-xs h-xs flex-shrink-0 ring-inset ring-success-50 focus-outline-none': true,\n 'flex items-center justify-center rounded-s transition-colors': true,\n 'bg-contrast-5 text-disabled cursor-default': isAddButtonDisabled,\n 'bg-contrast-5 text-body cursor-pointer': !isAddButtonDisabled,\n 'hover-bg-success hover-text-success-contrast': !isAddButtonDisabled,\n 'focus-ring-2': !isAddButtonDisabled,\n })}\n ?disabled=${isAddButtonDisabled}\n @click=${addItem}\n >\n <iron-icon icon=\"lumo:plus\" class=\"icon-inline text-l\"></iron-icon>\n </button>\n </div>\n </div>\n </div>\n\n <div\n class=${classMap({\n 'mt-s leading-xs text-error': true,\n 'text-xs': isSummaryItem,\n 'text-s': !isSummaryItem,\n })}\n ?hidden=${!this.__isErrorVisible || !this._errorMessage || this.disabled || this.readonly}\n >\n ${this._errorMessage}\n </div>\n `;\n }\n\n protected get _value(): Item[] {\n const value = super._value;\n if (this.simpleValue) return ((value as string[]) ?? []).map(value => ({ value }));\n return (value ?? []) as Item[];\n }\n\n protected set _value(newValue: Item[]) {\n if (this.simpleValue) {\n super._value = newValue.map(({ value }) => value);\n } else {\n super._value = newValue;\n }\n }\n}\n"]}
|
|
@@ -3,6 +3,10 @@ import { PropertyDeclarations, TemplateResult } from 'lit-element';
|
|
|
3
3
|
export declare class InternalSwitchControl extends InternalEditableControl {
|
|
4
4
|
static get properties(): PropertyDeclarations;
|
|
5
5
|
helperTextAsToolip: boolean;
|
|
6
|
+
falseAlias: string | null;
|
|
7
|
+
trueAlias: string | null;
|
|
6
8
|
invert: boolean;
|
|
7
9
|
renderControl(): TemplateResult;
|
|
10
|
+
protected get _value(): boolean;
|
|
11
|
+
protected set _value(value: boolean);
|
|
8
12
|
}
|
|
@@ -5,12 +5,16 @@ export class InternalSwitchControl extends InternalEditableControl {
|
|
|
5
5
|
constructor() {
|
|
6
6
|
super(...arguments);
|
|
7
7
|
this.helperTextAsToolip = false;
|
|
8
|
+
this.falseAlias = null;
|
|
9
|
+
this.trueAlias = null;
|
|
8
10
|
this.invert = false;
|
|
9
11
|
}
|
|
10
12
|
static get properties() {
|
|
11
13
|
return {
|
|
12
14
|
...super.properties,
|
|
13
15
|
helperTextAsToolip: { type: Boolean, attribute: 'helper-text-as-tooltip' },
|
|
16
|
+
falseAlias: { attribute: 'false-alias' },
|
|
17
|
+
trueAlias: { attribute: 'true-alias' },
|
|
14
18
|
invert: { type: Boolean },
|
|
15
19
|
};
|
|
16
20
|
}
|
|
@@ -93,5 +97,21 @@ export class InternalSwitchControl extends InternalEditableControl {
|
|
|
93
97
|
</div>
|
|
94
98
|
`;
|
|
95
99
|
}
|
|
100
|
+
get _value() {
|
|
101
|
+
const originalValue = super._value;
|
|
102
|
+
if (this.trueAlias && originalValue === this.trueAlias)
|
|
103
|
+
return true;
|
|
104
|
+
if (this.falseAlias && originalValue === this.falseAlias)
|
|
105
|
+
return false;
|
|
106
|
+
return !!originalValue;
|
|
107
|
+
}
|
|
108
|
+
set _value(value) {
|
|
109
|
+
if (this.trueAlias && value === true)
|
|
110
|
+
super._value = this.trueAlias;
|
|
111
|
+
else if (this.falseAlias && value === false)
|
|
112
|
+
super._value = this.falseAlias;
|
|
113
|
+
else
|
|
114
|
+
super._value = value;
|
|
115
|
+
}
|
|
96
116
|
}
|
|
97
117
|
//# sourceMappingURL=InternalSwitchControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalSwitchControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalSwitchControl/InternalSwitchControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAwB,GAAG,EAAkB,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,OAAO,qBAAsB,SAAQ,uBAAuB;IAAlE;;
|
|
1
|
+
{"version":3,"file":"InternalSwitchControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalSwitchControl/InternalSwitchControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,IAAI,EAAwB,GAAG,EAAkB,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,OAAO,qBAAsB,SAAQ,uBAAuB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c,MAAM,CAAC,KAAc;QACjC,IAAI,IAAI,CAAC,SAAS,IAAI,KAAK,KAAK,IAAI;YAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;aAC/D,IAAI,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,KAAK;YAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;;YACvE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { html, PropertyDeclarations, svg, TemplateResult } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\n\nexport class InternalSwitchControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n helperTextAsToolip: { type: Boolean, attribute: 'helper-text-as-tooltip' },\n falseAlias: { attribute: 'false-alias' },\n trueAlias: { attribute: 'true-alias' },\n invert: { type: Boolean },\n };\n }\n\n helperTextAsToolip = false;\n\n falseAlias: string | null = null;\n\n trueAlias: string | null = null;\n\n invert = false;\n\n renderControl(): TemplateResult {\n const checked = this.invert ? !this._value : !!this._value;\n return html`\n <div class=\"flex items-start gap-s leading-xs text-m\">\n <div class=\"flex-1\">\n <label class=\"text-m text-body\" for=\"input\">${this.label}</label>\n ${this.helperTextAsToolip\n ? ''\n : html`<p class=\"text-xs text-secondary\">${this.helperText}</p>`}\n <p class=\"text-xs text-error\" ?hidden=${this.disabled || this.readonly}>\n ${this._errorMessage}\n </p>\n </div>\n\n ${this.readonly\n ? html`<p class=\"text-secondary\">${checked ? this.t('checked') : this.t('unchecked')}</p>`\n : html`\n <div style=\"height: calc(1em * var(--lumo-line-height-xs))\" class=\"flex items-center\">\n <div\n style=\"border-radius: var(--lumo-size-xl); width: calc((1em * var(--lumo-line-height-xs)) - 3px + var(--lumo-space-m))\"\n class=${classMap({\n 'cursor-pointer group transition-colors relative': true,\n 'flex flex-shrink-0 items-center': true,\n 'bg-success': !this.disabled && checked,\n 'bg-contrast-20 hover-bg-contrast-30': !this.disabled && !checked,\n 'bg-contrast-10': this.disabled,\n 'focus-within-ring-2 focus-within-ring-primary-50': true,\n })}\n @click=${() => (this._value = !this._value)}\n >\n <div\n style=\"margin: 1.5px; width: calc((1em * var(--lumo-line-height-xs)) - 6px); height: calc((1em * var(--lumo-line-height-xs)) - 6px)\"\n class=${classMap({\n 'transition-all transform block rounded-full': true,\n 'translate-x-m': checked,\n 'translate-x-0': !checked,\n 'bg-base': this.disabled,\n 'bg-tint': !this.disabled,\n })}\n ></div>\n\n <input\n class=\"opacity-0 absolute inset-0 focus-outline-none\"\n type=\"checkbox\"\n id=\"input\"\n switch\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?checked=${checked}\n @change=${(evt: Event) => {\n const checkbox = evt.currentTarget as HTMLInputElement;\n this._value = this.invert ? !checkbox.checked : checkbox.checked;\n }}\n />\n </div>\n </div>\n `}\n ${this.helperTextAsToolip && this.helperText\n ? html`\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 <vcf-tooltip\n for=\"trigger\"\n style=\"--lumo-base-color: black; max-width: 30rem\"\n class=\"mt-s\"\n theme=\"light\"\n position=\"bottom\"\n >\n <span class=\"text-s\" style=\"color: white\">${this.helperText}</span>\n </vcf-tooltip>\n `\n : ''}\n </div>\n `;\n }\n\n protected get _value(): boolean {\n const originalValue = super._value;\n if (this.trueAlias && originalValue === this.trueAlias) return true;\n if (this.falseAlias && originalValue === this.falseAlias) return false;\n return !!originalValue;\n }\n\n protected set _value(value: boolean) {\n if (this.trueAlias && value === true) super._value = this.trueAlias;\n else if (this.falseAlias && value === false) super._value = this.falseAlias;\n else super._value = value;\n }\n}\n"]}
|
|
@@ -1,41 +1,48 @@
|
|
|
1
|
-
import { Data } from './types';
|
|
2
|
-
import {
|
|
3
|
-
import { TemplateResult } from 'lit-html';
|
|
4
|
-
import { NucleonElement } from '../NucleonElement/NucleonElement';
|
|
5
|
-
import { PropertyDeclarations } from 'lit-element';
|
|
1
|
+
import type { Data } from './types';
|
|
2
|
+
import type { PropertyDeclarations } from 'lit-element';
|
|
3
|
+
import type { TemplateResult } from 'lit-html';
|
|
6
4
|
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
7
|
-
|
|
5
|
+
import { InternalForm } from '../../internal/InternalForm/InternalForm';
|
|
6
|
+
declare const Base: typeof InternalForm & import("lit-element").Constructor<import("../../../mixins/translatable").TranslatableMixinHost> & {
|
|
8
7
|
defaultNS: string;
|
|
9
|
-
}
|
|
10
|
-
styles: import("lit-element").CSSResultArray;
|
|
11
|
-
} & import("lit-element").Constructor<import("../../../mixins/configurable").ConfigurableMixinHost> & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/src/types").ScopedElementsHost>;
|
|
8
|
+
};
|
|
12
9
|
/**
|
|
13
10
|
* Form element for creating or editing template configs (`fx:template_config`).
|
|
14
11
|
*
|
|
15
|
-
*
|
|
16
12
|
* @element foxy-template-config-form
|
|
17
13
|
* @since 1.14.0
|
|
18
14
|
*/
|
|
19
15
|
export declare class TemplateConfigForm extends Base<Data> {
|
|
20
|
-
static get scopedElements(): ScopedElementsMap;
|
|
21
16
|
static get properties(): PropertyDeclarations;
|
|
22
17
|
/** URI of the `fx:countries` hAPI resource. */
|
|
23
|
-
countries: string;
|
|
18
|
+
countries: string | null;
|
|
24
19
|
/** URI of the `fx:regions` hAPI resource. */
|
|
25
|
-
regions: string;
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
regions: string | null;
|
|
21
|
+
/** URI of the `fx:store` hAPI resource related to this template config. If this property is `null`, a link relationship will be used when available. */
|
|
22
|
+
store: string | null;
|
|
23
|
+
private readonly __customCheckoutFieldCouponEntryRequirementsOptions;
|
|
24
|
+
private readonly __customCheckoutFieldRequirementsOptions;
|
|
25
|
+
private readonly __tosCheckboxSettingsInitialStateOptions;
|
|
26
|
+
private readonly __locationFilteringFilterTypeOptions;
|
|
27
|
+
private readonly __foxycompleteShowComboboxOptions;
|
|
28
|
+
private readonly __tosCheckboxSettingsUsageOptions;
|
|
29
|
+
private readonly __locationFilteringUsageOptions;
|
|
30
|
+
private readonly __cscRequirementsValueOptions;
|
|
31
|
+
private readonly __checkoutTypeDefaultOptions;
|
|
32
|
+
private readonly __checkoutTypeAccountOptions;
|
|
33
|
+
private readonly __cartTypeOptions;
|
|
34
|
+
private readonly __locationFilteringFilterValuesSetValue;
|
|
35
|
+
private readonly __locationFilteringFilterTypeSetValue;
|
|
36
|
+
private readonly __foxycompleteShowComboboxGetValue;
|
|
37
|
+
private readonly __foxycompleteShowComboboxSetValue;
|
|
38
|
+
private readonly __checkoutTypeAccountGetValue;
|
|
39
|
+
private readonly __customConfigGetValue;
|
|
40
|
+
private readonly __customConfigSetValue;
|
|
41
|
+
private readonly __defaultJSON;
|
|
28
42
|
get hiddenSelector(): BooleanSelector;
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private __renderCards;
|
|
34
|
-
private __renderCheckoutType;
|
|
35
|
-
private __renderConsent;
|
|
36
|
-
private __renderFields;
|
|
37
|
-
private __renderGoogleAnalytics;
|
|
38
|
-
private __renderGoogleTag;
|
|
39
|
-
private __renderTroubleshooting;
|
|
43
|
+
renderBody(): TemplateResult;
|
|
44
|
+
private get __storeLoader();
|
|
45
|
+
private get __formJson();
|
|
46
|
+
private get __dataJson();
|
|
40
47
|
}
|
|
41
48
|
export {};
|