@foxy.io/elements 1.17.0 → 1.18.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-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +3 -85
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-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-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +15 -15
- package/dist/cdn/foxy-customer.js +6 -6
- 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-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-item-card.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-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +4 -4
- package/dist/cdn/foxy-reports-table.js +5 -5
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +150 -0
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +4 -4
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/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-26ce8d23.js → shared-023c287a.js} +1 -1
- package/dist/cdn/{shared-195fd5af.js → shared-084b6372.js} +1 -1
- package/dist/cdn/shared-11f0daea.js +169 -0
- package/dist/cdn/{shared-6d104622.js → shared-189dfb49.js} +1 -1
- package/dist/cdn/shared-23fd456c.js +134 -0
- package/dist/cdn/{shared-baf79b0b.js → shared-2ca6d676.js} +1 -1
- package/dist/cdn/{shared-c309e0ef.js → shared-2f0efb2c.js} +1 -1
- package/dist/cdn/{shared-dda2a74d.js → shared-37b61010.js} +1 -1
- package/dist/cdn/shared-381aa7fe.js +1 -0
- package/dist/cdn/shared-3a7cf739.js +15 -0
- package/dist/cdn/{shared-2188d5f7.js → shared-3e3c07ac.js} +1 -1
- package/dist/cdn/{shared-8e9a3bbb.js → shared-412670b8.js} +1 -1
- package/dist/cdn/{shared-31c43743.js → shared-4560425c.js} +1 -1
- package/dist/cdn/shared-4773b634.js +1 -0
- package/dist/cdn/{shared-7c8bb60c.js → shared-4c0520f6.js} +1 -1
- package/dist/cdn/{shared-5c3a88d2.js → shared-5482630e.js} +1 -1
- package/dist/cdn/{shared-322e7efb.js → shared-5e43b817.js} +1 -1
- package/dist/cdn/{shared-a0836fa5.js → shared-60c862aa.js} +1 -1
- package/dist/cdn/shared-619adfad.js +1 -0
- package/dist/cdn/{shared-b3df4f38.js → shared-68ab037d.js} +1 -1
- package/dist/cdn/{shared-7c612495.js → shared-6af95088.js} +1 -1
- package/dist/cdn/shared-6ce2acfa.js +1 -0
- package/dist/cdn/{shared-c8677ba3.js → shared-6f89d2e0.js} +1 -1
- package/dist/cdn/{shared-c5c60417.js → shared-71acf673.js} +1 -1
- package/dist/cdn/{shared-c89ba319.js → shared-74a27421.js} +1 -1
- package/dist/cdn/{shared-d699348f.js → shared-80b90eec.js} +2 -2
- package/dist/cdn/{shared-98497473.js → shared-85d45495.js} +1 -1
- package/dist/cdn/{shared-a5e52b8f.js → shared-872ceacf.js} +3 -3
- package/dist/cdn/{shared-4e201e09.js → shared-901ca702.js} +1 -1
- package/dist/cdn/{shared-ae415a98.js → shared-91b86bae.js} +1 -1
- package/dist/cdn/shared-9b392ba8.js +1 -0
- package/dist/cdn/{shared-1bbd9b73.js → shared-9be1a70f.js} +1 -1
- package/dist/cdn/{shared-8d4fef94.js → shared-9ef13805.js} +1 -1
- package/dist/cdn/{shared-bb686fc6.js → shared-9ef81b37.js} +1 -1
- package/dist/cdn/{shared-3b2dedf9.js → shared-a2a1193d.js} +1 -1
- package/dist/cdn/shared-a48a9dfc.js +82 -0
- package/dist/cdn/{shared-8d937ae4.js → shared-c0fb5a33.js} +3 -3
- package/dist/cdn/{shared-a052131e.js → shared-c63ba384.js} +1 -1
- package/dist/cdn/{shared-d28ac9dc.js → shared-c7280a24.js} +1 -1
- package/dist/cdn/{shared-e9a4a204.js → shared-c7c8d1b6.js} +1 -1
- package/dist/cdn/{shared-fadcb2e1.js → shared-ca0f14c1.js} +1 -1
- package/dist/cdn/{shared-7474af47.js → shared-d91ed0a8.js} +1 -1
- package/dist/cdn/{shared-39f2c345.js → shared-daa454bf.js} +1 -1
- package/dist/cdn/{shared-2bdd4f74.js → shared-ec7cfc23.js} +1 -1
- package/dist/cdn/{shared-bf6fb415.js → shared-f2639daf.js} +1 -1
- package/dist/cdn/{shared-62169210.js → shared-f31044b8.js} +1 -1
- package/dist/cdn/{shared-f84686a8.js → shared-fcbf9a41.js} +1 -1
- package/dist/cdn/{shared-dd6d3c18.js → shared-fd595d0a.js} +1 -1
- package/dist/cdn/{shared-dc23b751.js → shared-fe68657a.js} +1 -1
- package/dist/cdn/{shared-f1317609.js → shared-ff1d9854.js} +1 -1
- package/dist/cdn/translations/store-shipping-method-form/en.json +90 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.d.ts +3 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js +22 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js.map +1 -1
- package/dist/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.d.ts +17 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.js +51 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.js.map +1 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/index.d.ts +6 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/index.js +8 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/index.js.map +1 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/types.d.ts +6 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/types.js +2 -0
- package/dist/elements/internal/InternalCheckboxGroupControl/types.js.map +1 -0
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.d.ts +2 -0
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js +6 -4
- package/dist/elements/internal/InternalEditableControl/InternalEditableControl.js.map +1 -1
- package/dist/elements/internal/InternalTextAreaControl/InternalTextAreaControl.d.ts +13 -0
- package/dist/elements/internal/InternalTextAreaControl/InternalTextAreaControl.js +40 -0
- package/dist/elements/internal/InternalTextAreaControl/InternalTextAreaControl.js.map +1 -0
- package/dist/elements/internal/InternalTextAreaControl/index.d.ts +4 -0
- package/dist/elements/internal/InternalTextAreaControl/index.js +6 -0
- package/dist/elements/internal/InternalTextAreaControl/index.js.map +1 -0
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +10 -23
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.d.ts +2 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +12 -10
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/ShipmentCard/ShipmentCard.js +1 -1
- package/dist/elements/public/ShipmentCard/ShipmentCard.js.map +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.d.ts +25 -0
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +201 -0
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/index.d.ts +11 -0
- package/dist/elements/public/StoreShippingMethodForm/index.js +13 -0
- package/dist/elements/public/StoreShippingMethodForm/index.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/InternalStoreShippingMethodFormServicesControl.d.ts +5 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/InternalStoreShippingMethodFormServicesControl.js +33 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/InternalStoreShippingMethodFormServicesControl.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/index.d.ts +6 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/index.js +8 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesControl/index.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/InternalStoreShippingMethodFormServicesPage.d.ts +19 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/InternalStoreShippingMethodFormServicesPage.js +96 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/InternalStoreShippingMethodFormServicesPage.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/index.d.ts +5 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/index.js +7 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPage/index.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/InternalStoreShippingMethodFormServicesPageItem.d.ts +17 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/InternalStoreShippingMethodFormServicesPageItem.js +45 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/InternalStoreShippingMethodFormServicesPageItem.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/index.d.ts +3 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/index.js +5 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItem/index.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/InternalStoreShippingMethodFormServicesPageItemContent.d.ts +16 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/InternalStoreShippingMethodFormServicesPageItemContent.js +49 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/InternalStoreShippingMethodFormServicesPageItemContent.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/index.d.ts +3 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/index.js +5 -0
- package/dist/elements/public/StoreShippingMethodForm/internal/InternalStoreShippingMethodFormServicesPageItemContent/index.js.map +1 -0
- package/dist/elements/public/StoreShippingMethodForm/types.d.ts +5 -0
- package/dist/elements/public/StoreShippingMethodForm/types.js +2 -0
- package/dist/elements/public/StoreShippingMethodForm/types.js.map +1 -0
- package/dist/elements/public/index.d.ts +1 -0
- package/dist/elements/public/index.defined.d.ts +1 -0
- package/dist/elements/public/index.defined.js +1 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +1 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/configurable.js +16 -8
- package/dist/mixins/configurable.js.map +1 -1
- package/dist/mixins/inferrable.js +25 -23
- package/dist/mixins/inferrable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-45feee83.js +0 -1
- package/dist/cdn/shared-63685d2e.js +0 -302
- package/dist/cdn/shared-92327224.js +0 -15
- package/dist/cdn/shared-ac44429d.js +0 -1
- package/dist/cdn/shared-dc1c6edd.js +0 -1
- package/dist/cdn/shared-dc3ffd38.js +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shipping-method-uri": {
|
|
3
|
+
"label": "Shipping Method",
|
|
4
|
+
"placeholder": "Select service",
|
|
5
|
+
"helper_text": "",
|
|
6
|
+
"required": "Please select a shipping method."
|
|
7
|
+
},
|
|
8
|
+
"shipping-container-uri": {
|
|
9
|
+
"label": "Container",
|
|
10
|
+
"placeholder": "Select container",
|
|
11
|
+
"helper_text": "",
|
|
12
|
+
"required": "Please select a shipping method."
|
|
13
|
+
},
|
|
14
|
+
"shipping-drop-type-uri": {
|
|
15
|
+
"label": "Drop Type",
|
|
16
|
+
"placeholder": "Select pickup",
|
|
17
|
+
"helper_text": "",
|
|
18
|
+
"required": "Please select a drop type."
|
|
19
|
+
},
|
|
20
|
+
"destinations": {
|
|
21
|
+
"label": "Destinations",
|
|
22
|
+
"domestic": "Domestic",
|
|
23
|
+
"international": "International",
|
|
24
|
+
"helper_text": ""
|
|
25
|
+
},
|
|
26
|
+
"authentication-key": {
|
|
27
|
+
"label": "Authentication Key",
|
|
28
|
+
"placeholder": "N/A",
|
|
29
|
+
"helper_text": "If using account specific rates, enter your shipping account authentication key here, if applicable.",
|
|
30
|
+
"too_long": "Authentication key must be 50 characters or less."
|
|
31
|
+
},
|
|
32
|
+
"meter-number": {
|
|
33
|
+
"label": "Meter Number",
|
|
34
|
+
"placeholder": "N/A",
|
|
35
|
+
"helper_text": "If using account specific rates, enter your shipping account meter number here, if applicable.",
|
|
36
|
+
"too_long": "Meter number must be 50 characters or less."
|
|
37
|
+
},
|
|
38
|
+
"accountid": {
|
|
39
|
+
"label": "Account ID",
|
|
40
|
+
"placeholder": "N/A",
|
|
41
|
+
"helper_text": "If using account specific rates, enter your shipping account id here.",
|
|
42
|
+
"too_long": "Account ID must be 50 characters or less."
|
|
43
|
+
},
|
|
44
|
+
"endpoint": {
|
|
45
|
+
"label": "Endpoint URL",
|
|
46
|
+
"placeholder": "https://example.com/rates",
|
|
47
|
+
"helper_text": "Enter a URL that we'll poll for shipping rates.",
|
|
48
|
+
"required": "Please enter a valid endpoint URL."
|
|
49
|
+
},
|
|
50
|
+
"password": {
|
|
51
|
+
"label": "Password",
|
|
52
|
+
"placeholder": "N/A",
|
|
53
|
+
"helper_text": "If using account specific rates, enter your shipping account password here.",
|
|
54
|
+
"too_long": "Password must be 50 characters or less."
|
|
55
|
+
},
|
|
56
|
+
"custom-code": {
|
|
57
|
+
"label": "Custom Code",
|
|
58
|
+
"placeholder": "Paste your code here",
|
|
59
|
+
"helper_text": "JavaScript used to create and modify shipping rates.",
|
|
60
|
+
"too_long": "Please reduce the size of your custom code to 64KB or less."
|
|
61
|
+
},
|
|
62
|
+
"services": {
|
|
63
|
+
"header": "Additional services",
|
|
64
|
+
"first": "First",
|
|
65
|
+
"last": "Last",
|
|
66
|
+
"next": "Next",
|
|
67
|
+
"pagination": "{{from}}-{{to}} out of {{total}}",
|
|
68
|
+
"previous": "Previous",
|
|
69
|
+
"loading_busy": "Loading",
|
|
70
|
+
"loading_error": "Failed to load",
|
|
71
|
+
"international_only": "– international only"
|
|
72
|
+
},
|
|
73
|
+
"timestamps": {
|
|
74
|
+
"date_created": "Created on",
|
|
75
|
+
"date_modified": "Last updated",
|
|
76
|
+
"date": "{{value, date}}"
|
|
77
|
+
},
|
|
78
|
+
"delete": {
|
|
79
|
+
"delete": "Delete",
|
|
80
|
+
"cancel": "Cancel",
|
|
81
|
+
"delete_prompt": "Are you sure you'd like to remove this shipping method? You won't be able to undo if you click Delete."
|
|
82
|
+
},
|
|
83
|
+
"create": {
|
|
84
|
+
"create": "Create"
|
|
85
|
+
},
|
|
86
|
+
"spinner": {
|
|
87
|
+
"loading_busy": "Loading",
|
|
88
|
+
"loading_error": "Failed to load"
|
|
89
|
+
}
|
|
90
|
+
}
|
package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComboBoxItem } from '@vaadin/vaadin-combo-box';
|
|
1
2
|
import type { TemplateResult } from 'lit-html';
|
|
2
3
|
import { PropertyDeclarations } from 'lit-element';
|
|
3
4
|
import { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';
|
|
@@ -14,9 +15,11 @@ export declare class InternalAsyncComboBoxControl extends InternalEditableContro
|
|
|
14
15
|
itemLabelPath: string | null;
|
|
15
16
|
/** Same as `itemValuePath` property of Vaadin's `ComboBoxElement`. */
|
|
16
17
|
itemValuePath: string | null;
|
|
18
|
+
selectedItem: ComboBoxItem | string | undefined;
|
|
17
19
|
/** URL of the first page of the hAPI collection serving as a source for items. */
|
|
18
20
|
first: string | null;
|
|
19
21
|
renderControl(): TemplateResult;
|
|
22
|
+
updated(changes: Map<keyof this, unknown>): void;
|
|
20
23
|
protected get _value(): string;
|
|
21
24
|
protected set _value(newValue: string);
|
|
22
25
|
}
|
|
@@ -16,6 +16,7 @@ export class InternalAsyncComboBoxControl extends InternalEditableControl {
|
|
|
16
16
|
this.itemLabelPath = null;
|
|
17
17
|
/** Same as `itemValuePath` property of Vaadin's `ComboBoxElement`. */
|
|
18
18
|
this.itemValuePath = null;
|
|
19
|
+
this.selectedItem = undefined;
|
|
19
20
|
/** URL of the first page of the hAPI collection serving as a source for items. */
|
|
20
21
|
this.first = null;
|
|
21
22
|
}
|
|
@@ -24,6 +25,7 @@ export class InternalAsyncComboBoxControl extends InternalEditableControl {
|
|
|
24
25
|
...super.properties,
|
|
25
26
|
itemLabelPath: { type: String, attribute: 'item-label-path' },
|
|
26
27
|
itemValuePath: { type: String, attribute: 'item-value-path' },
|
|
28
|
+
selectedItem: { attribute: false },
|
|
27
29
|
first: { type: String },
|
|
28
30
|
};
|
|
29
31
|
}
|
|
@@ -59,15 +61,35 @@ export class InternalAsyncComboBoxControl extends InternalEditableControl {
|
|
|
59
61
|
?readonly=${this.readonly}
|
|
60
62
|
.checkValidity=${this._checkValidity}
|
|
61
63
|
.dataProvider=${dataProvider}
|
|
64
|
+
.selectedItem=${this.selectedItem}
|
|
62
65
|
.value=${this._value}
|
|
63
66
|
@change=${(evt) => {
|
|
67
|
+
evt.stopPropagation();
|
|
64
68
|
const comboBox = evt.currentTarget;
|
|
65
69
|
this._value = comboBox.value;
|
|
70
|
+
if (this._value === comboBox.value) {
|
|
71
|
+
this.selectedItem = comboBox.selectedItem;
|
|
72
|
+
this.dispatchEvent(new CustomEvent('selected-item-changed'));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
comboBox.value = this._value;
|
|
76
|
+
}
|
|
66
77
|
}}
|
|
67
78
|
>
|
|
68
79
|
</vaadin-combo-box>
|
|
69
80
|
`;
|
|
70
81
|
}
|
|
82
|
+
updated(changes) {
|
|
83
|
+
super.updated(changes);
|
|
84
|
+
if (changes.has('first')) {
|
|
85
|
+
const comboBox = this.renderRoot.querySelector('vaadin-combo-box');
|
|
86
|
+
// this forces reload
|
|
87
|
+
if (comboBox) {
|
|
88
|
+
comboBox.size = 0;
|
|
89
|
+
comboBox.size = 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
71
93
|
get _value() {
|
|
72
94
|
var _a;
|
|
73
95
|
return (_a = super._value) !== null && _a !== void 0 ? _a : '';
|
package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalAsyncComboBoxControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,GAAG,EAAE,2CAAwC;AAEtD;;;;;;GAMG;AACH,MAAM,OAAO,4BAA6B,SAAQ,uBAAuB;IAAzE;;
|
|
1
|
+
{"version":3,"file":"InternalAsyncComboBoxControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,GAAG,EAAE,2CAAwC;AAEtD;;;;;;GAMG;AACH,MAAM,OAAO,4BAA6B,SAAQ,uBAAuB;IAAzE;;QAWE,sEAAsE;QACtE,kBAAa,GAAkB,IAAI,CAAC;QAEpC,sEAAsE;QACtE,kBAAa,GAAkB,IAAI,CAAC;QAEpC,iBAAY,GAAsC,SAAS,CAAC;QAE5D,kFAAkF;QAClF,UAAK,GAAkB,IAAI,CAAC;IA8E9B,CAAC;IAjGC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE;YAC7D,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE;YAC7D,YAAY,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;YAClC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACxB,CAAC;IACJ,CAAC;IAaD,aAAa;;QACX,MAAM,YAAY,GAAyB,KAAK,EAAE,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;QACnC,KAAK,CAAC,MAAM,GAAG,QAA+B,CAAC;IACjD,CAAC;CACF","sourcesContent":["import type { ComboBoxDataProvider, ComboBoxElement, ComboBoxItem } from '@vaadin/vaadin-combo-box';\nimport type { TemplateResult } from 'lit-html';\n\nimport { PropertyDeclarations } from 'lit-element';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { API } from '../../public/NucleonElement/API';\n\n/**\n * Internal control displaying a combo box where items are loaded from\n * a hAPI collection.\n *\n * @since 1.17.0\n * @element foxy-internal-async-combo-box-control\n */\nexport class InternalAsyncComboBoxControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n itemLabelPath: { type: String, attribute: 'item-label-path' },\n itemValuePath: { type: String, attribute: 'item-value-path' },\n selectedItem: { attribute: false },\n first: { type: String },\n };\n }\n\n /** Same as `itemLabelPath` property of Vaadin's `ComboBoxElement`. */\n itemLabelPath: string | null = null;\n\n /** Same as `itemValuePath` property of Vaadin's `ComboBoxElement`. */\n itemValuePath: string | null = null;\n\n selectedItem: ComboBoxItem | string | undefined = undefined;\n\n /** URL of the first page of the hAPI collection serving as a source for items. */\n first: string | null = null;\n\n renderControl(): TemplateResult {\n const dataProvider: ComboBoxDataProvider = async (params, callback) => {\n if (!this.first) return callback([], 0);\n\n const url = new URL(this.first);\n url.searchParams.set('offset', String(params.page * params.pageSize));\n url.searchParams.set('limit', String(params.pageSize));\n\n if (params.filter && this.itemLabelPath) {\n url.searchParams.set(this.itemLabelPath, `*${params.filter}*`);\n }\n\n const response = await new API(this).fetch(url.toString());\n if (!response.ok) throw new Error(await response.text());\n\n const json = await response.json();\n const items = Array.from(Object.values(json._embedded))[0] as unknown[];\n\n callback(items, json.total_items);\n };\n\n return html`\n <vaadin-combo-box\n item-value-path=${ifDefined(this.itemValuePath ?? undefined)}\n item-label-path=${ifDefined(this.itemLabelPath ?? undefined)}\n error-message=${ifDefined(this._errorMessage)}\n item-id-path=\"_links.self.href\"\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n class=\"w-full\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .dataProvider=${dataProvider}\n .selectedItem=${this.selectedItem}\n .value=${this._value}\n @change=${(evt: CustomEvent) => {\n evt.stopPropagation();\n\n const comboBox = evt.currentTarget as ComboBoxElement;\n this._value = comboBox.value;\n\n if (this._value === comboBox.value) {\n this.selectedItem = comboBox.selectedItem;\n this.dispatchEvent(new CustomEvent('selected-item-changed'));\n } else {\n comboBox.value = this._value;\n }\n }}\n >\n </vaadin-combo-box>\n `;\n }\n\n updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n\n if (changes.has('first')) {\n const comboBox = this.renderRoot.querySelector<ComboBoxElement>('vaadin-combo-box');\n\n // this forces reload\n if (comboBox) {\n comboBox.size = 0;\n comboBox.size = 1;\n }\n }\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PropertyDeclarations, TemplateResult } from 'lit-element';
|
|
2
|
+
import type { Option } from './types';
|
|
3
|
+
import { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';
|
|
4
|
+
/**
|
|
5
|
+
* Internal control wrapper for `vaadin-checkbox-group` element.
|
|
6
|
+
*
|
|
7
|
+
* @since 1.17.0
|
|
8
|
+
* @element foxy-internal-checkbox-group-control
|
|
9
|
+
*/
|
|
10
|
+
export declare class InternalCheckboxGroupControl extends InternalEditableControl {
|
|
11
|
+
static get properties(): PropertyDeclarations;
|
|
12
|
+
/** List of checkboxes to render. */
|
|
13
|
+
options: Option[];
|
|
14
|
+
/** Same as the "theme" attribute/property of `vaadin-checkbox-group`. */
|
|
15
|
+
theme: string | null;
|
|
16
|
+
renderControl(): TemplateResult;
|
|
17
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { InternalEditableControl } from "../InternalEditableControl/InternalEditableControl.js";
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
3
|
+
import { html } from 'lit-html';
|
|
4
|
+
/**
|
|
5
|
+
* Internal control wrapper for `vaadin-checkbox-group` element.
|
|
6
|
+
*
|
|
7
|
+
* @since 1.17.0
|
|
8
|
+
* @element foxy-internal-checkbox-group-control
|
|
9
|
+
*/
|
|
10
|
+
export class InternalCheckboxGroupControl extends InternalEditableControl {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/** List of checkboxes to render. */
|
|
14
|
+
this.options = [];
|
|
15
|
+
/** Same as the "theme" attribute/property of `vaadin-checkbox-group`. */
|
|
16
|
+
this.theme = null;
|
|
17
|
+
}
|
|
18
|
+
static get properties() {
|
|
19
|
+
return {
|
|
20
|
+
...super.properties,
|
|
21
|
+
options: { type: Array },
|
|
22
|
+
theme: { type: String },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
renderControl() {
|
|
26
|
+
var _a;
|
|
27
|
+
return html `
|
|
28
|
+
<vaadin-checkbox-group
|
|
29
|
+
error-message=${ifDefined(this._errorMessage)}
|
|
30
|
+
helper-text=${this.helperText}
|
|
31
|
+
label=${this.label}
|
|
32
|
+
class="w-full"
|
|
33
|
+
theme=${ifDefined((_a = this.theme) !== null && _a !== void 0 ? _a : undefined)}
|
|
34
|
+
?disabled=${this.disabled || this.readonly}
|
|
35
|
+
.checkValidity=${this._checkValidity}
|
|
36
|
+
.value=${this._value}
|
|
37
|
+
@change=${(evt) => {
|
|
38
|
+
const field = evt.currentTarget;
|
|
39
|
+
this._value = field.value;
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
${this.options.map(option => html `
|
|
43
|
+
<vaadin-checkbox value=${option.value}>
|
|
44
|
+
<foxy-i18n infer="" key=${option.label}></foxy-i18n>
|
|
45
|
+
</vaadin-checkbox>
|
|
46
|
+
`)}
|
|
47
|
+
</vaadin-checkbox-group>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=InternalCheckboxGroupControl.js.map
|
package/dist/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalCheckboxGroupControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalCheckboxGroupControl/InternalCheckboxGroupControl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ,uBAAuB;IAAzE;;QASE,oCAAoC;QACpC,YAAO,GAAa,EAAE,CAAC;QAEvB,yEAAyE;QACzE,UAAK,GAAkB,IAAI,CAAC;IA4B9B,CAAC;IAxCC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACxB,CAAC;IACJ,CAAC;IAQD,aAAa;;QACX,OAAO,IAAI,CAAA;;wBAES,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;sBAC/B,IAAI,CAAC,UAAU;gBACrB,IAAI,CAAC,KAAK;;gBAEV,SAAS,OAAC,IAAI,CAAC,KAAK,mCAAI,SAAS,CAAC;oBAC9B,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;yBACzB,IAAI,CAAC,cAAc;iBAC3B,IAAI,CAAC,MAAkB;kBACtB,CAAC,GAAgB,EAAE,EAAE;YAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,aAAqC,CAAC;YACxD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC;QAC5B,CAAC;;UAEC,IAAI,CAAC,OAAO,CAAC,GAAG,CAChB,MAAM,CAAC,EAAE,CAAC,IAAI,CAAA;qCACa,MAAM,CAAC,KAAK;wCACT,MAAM,CAAC,KAAK;;WAEzC,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { CheckboxGroupElement } from '@vaadin/vaadin-checkbox/vaadin-checkbox-group';\nimport type { Option } from './types';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\n/**\n * Internal control wrapper for `vaadin-checkbox-group` element.\n *\n * @since 1.17.0\n * @element foxy-internal-checkbox-group-control\n */\nexport class InternalCheckboxGroupControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n options: { type: Array },\n theme: { type: String },\n };\n }\n\n /** List of checkboxes to render. */\n options: Option[] = [];\n\n /** Same as the \"theme\" attribute/property of `vaadin-checkbox-group`. */\n theme: string | null = null;\n\n renderControl(): TemplateResult {\n return html`\n <vaadin-checkbox-group\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n label=${this.label}\n class=\"w-full\"\n theme=${ifDefined(this.theme ?? undefined)}\n ?disabled=${this.disabled || this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value as string[]}\n @change=${(evt: CustomEvent) => {\n const field = evt.currentTarget as CheckboxGroupElement;\n this._value = field.value;\n }}\n >\n ${this.options.map(\n option => html`\n <vaadin-checkbox value=${option.value}>\n <foxy-i18n infer=\"\" key=${option.label}></foxy-i18n>\n </vaadin-checkbox>\n `\n )}\n </vaadin-checkbox-group>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import '@vaadin/vaadin-checkbox/vaadin-checkbox-group';
|
|
2
|
+
import '@vaadin/vaadin-checkbox/vaadin-checkbox';
|
|
3
|
+
import '../InternalEditableControl/index';
|
|
4
|
+
import '../../public/I18n/index';
|
|
5
|
+
import { InternalCheckboxGroupControl as Control } from './InternalCheckboxGroupControl';
|
|
6
|
+
export { Control as InternalCheckboxGroupControl };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '@vaadin/vaadin-checkbox/vaadin-checkbox-group';
|
|
2
|
+
import '@vaadin/vaadin-checkbox/vaadin-checkbox';
|
|
3
|
+
import "../InternalEditableControl/index.js";
|
|
4
|
+
import "../../public/I18n/index.js";
|
|
5
|
+
import { InternalCheckboxGroupControl as Control } from "./InternalCheckboxGroupControl.js";
|
|
6
|
+
customElements.define('foxy-internal-checkbox-group-control', Control);
|
|
7
|
+
export { Control as InternalCheckboxGroupControl };
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalCheckboxGroupControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,+CAA+C,CAAC;AACvD,OAAO,yCAAyC,CAAC;AAEjD,6CAA0C;AAC1C,oCAAiC;AAEjC,OAAO,EAAE,4BAA4B,IAAI,OAAO,EAAE,0CAAuC;AAEzF,cAAc,CAAC,MAAM,CAAC,sCAAsC,EAAE,OAAO,CAAC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-checkbox/vaadin-checkbox-group';\nimport '@vaadin/vaadin-checkbox/vaadin-checkbox';\n\nimport '../InternalEditableControl/index';\nimport '../../public/I18n/index';\n\nimport { InternalCheckboxGroupControl as Control } from './InternalCheckboxGroupControl';\n\ncustomElements.define('foxy-internal-checkbox-group-control', Control);\n\nexport { Control as InternalCheckboxGroupControl };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalCheckboxGroupControl/types.ts"],"names":[],"mappings":"","sourcesContent":["export type Option = {\n /** I18n label key for the checkbox. */\n label: string;\n /** Checkbox value. */\n value: string;\n};\n"]}
|
|
@@ -11,6 +11,8 @@ import { InternalControl } from '../InternalControl/InternalControl';
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class InternalEditableControl extends InternalControl {
|
|
13
13
|
static get properties(): PropertyDeclarations;
|
|
14
|
+
getValue: () => unknown;
|
|
15
|
+
setValue: (newValue: unknown) => void;
|
|
14
16
|
private __placeholder;
|
|
15
17
|
private __helperText;
|
|
16
18
|
private __v8nPrefix;
|
|
@@ -11,6 +11,8 @@ import { InternalControl } from "../InternalControl/InternalControl.js";
|
|
|
11
11
|
export class InternalEditableControl extends InternalControl {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
|
+
this.getValue = () => { var _a; return (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form[this.property]; };
|
|
15
|
+
this.setValue = (newValue) => { var _a; return (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.edit({ [this.property]: newValue }); };
|
|
14
16
|
this.__placeholder = null;
|
|
15
17
|
this.__helperText = null;
|
|
16
18
|
this.__v8nPrefix = null;
|
|
@@ -23,6 +25,8 @@ export class InternalEditableControl extends InternalControl {
|
|
|
23
25
|
placeholder: { type: String, noAccessor: true },
|
|
24
26
|
helperText: { type: String, attribute: 'helper-text', noAccessor: true },
|
|
25
27
|
v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },
|
|
28
|
+
getValue: { attribute: false },
|
|
29
|
+
setValue: { attribute: false },
|
|
26
30
|
property: { type: String, noAccessor: true },
|
|
27
31
|
label: { type: String, noAccessor: true },
|
|
28
32
|
};
|
|
@@ -126,15 +130,13 @@ export class InternalEditableControl extends InternalControl {
|
|
|
126
130
|
* with the new value in the detail and write changes to the NucleonElement instance if permitted.
|
|
127
131
|
*/
|
|
128
132
|
get _value() {
|
|
129
|
-
|
|
130
|
-
return (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.form[this.property];
|
|
133
|
+
return this.getValue();
|
|
131
134
|
}
|
|
132
135
|
set _value(newValue) {
|
|
133
|
-
var _a;
|
|
134
136
|
const event = new CustomEvent('change', { cancelable: true, detail: newValue });
|
|
135
137
|
const useDefaultAction = this.dispatchEvent(event);
|
|
136
138
|
if (useDefaultAction)
|
|
137
|
-
|
|
139
|
+
this.setValue(newValue);
|
|
138
140
|
}
|
|
139
141
|
/** A shortcut returning the first v8n error associated with this control. */
|
|
140
142
|
get _error() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalEditableControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalEditableControl/InternalEditableControl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,8CAA2C;AAErE;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAA5D;;QAYU,kBAAa,GAAkB,IAAI,CAAC;QAEpC,iBAAY,GAAkB,IAAI,CAAC;QAEnC,gBAAW,GAAkB,IAAI,CAAC;QAElC,eAAU,GAAkB,IAAI,CAAC;QAEjC,YAAO,GAAkB,IAAI,CAAC;IAwIxC,CAAC;IA3JC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;YAC/C,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE;YACxE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE;YACtE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;YAC5C,KAAK,EAAE,EAAE,IAAI,EA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IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport { InternalControl } from '../InternalControl/InternalControl';\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 placeholder: { type: String, noAccessor: true },\n helperText: { type: String, attribute: 'helper-text', noAccessor: true },\n v8nPrefix: { type: String, attribute: 'v8n-prefix', noAccessor: true },\n property: { type: String, noAccessor: true },\n label: { type: String, noAccessor: true },\n };\n }\n\n private __placeholder: string | null = null;\n\n private __helperText: 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 /**\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\n protected get _value(): unknown | undefined {\n return this.nucleon?.form[this.property];\n }\n\n protected set _value(newValue: unknown | undefined) {\n const event = new CustomEvent('change', { cancelable: true, detail: newValue });\n const useDefaultAction = this.dispatchEvent(event);\n if (useDefaultAction) this.nucleon?.edit({ [this.property]: newValue });\n }\n /** A shortcut returning the first v8n error associated with this control. */\n\n protected get _error(): string | undefined {\n return this.nucleon?.errors.find(v => v.startsWith(this.v8nPrefix));\n }\n /** A shortcut returning the localized text of the first v8n error associated with this control. */\n\n protected get _errorMessage(): string | undefined {\n return this._error ? this.t(this._error.substring(this.v8nPrefix.length)) : undefined;\n }\n /** A helper returning a `.checkValidity()` function for use with Vaadin elements. */\n\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":"AACA,OAAO,EAAE,eAAe,EAAE,8CAA2C;AAErE;;;;;;;;GAQG;AACH,MAAM,OAAO,uBAAwB,SAAQ,eAAe;IAA5D;;QAcE,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,kBAAa,GAAkB,IAAI,CAAC;QAEpC,iBAAY,GAAkB,IAAI,CAAC;QAEnC,gBAAW,GAAkB,IAAI,CAAC;QAElC,eAAU,GAAkB,IAAI,CAAC;QAEjC,YAAO,GAAkB,IAAI,CAAC;IAwIxC,CAAC;IAjKC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;YAC/C,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE;YACxE,SAAS,EAA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AC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxF,CAAC;IACD,qFAAqF;IAErF,IAAc,cAAc;QAC1B,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport { InternalControl } from '../InternalControl/InternalControl';\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 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 };\n }\n\n getValue = (): unknown => this.nucleon?.form[this.property];\n\n setValue = (newValue: unknown): void => this.nucleon?.edit({ [this.property]: newValue });\n\n private __placeholder: string | null = null;\n\n private __helperText: 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 /**\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\n protected get _value(): unknown | undefined {\n return this.getValue();\n }\n\n protected set _value(newValue: unknown | undefined) {\n const event = new CustomEvent('change', { cancelable: true, detail: newValue });\n const useDefaultAction = this.dispatchEvent(event);\n if (useDefaultAction) this.setValue(newValue);\n }\n /** A shortcut returning the first v8n error associated with this control. */\n\n protected get _error(): string | undefined {\n return this.nucleon?.errors.find(v => v.startsWith(this.v8nPrefix));\n }\n /** A shortcut returning the localized text of the first v8n error associated with this control. */\n\n protected get _errorMessage(): string | undefined {\n return this._error ? this.t(this._error.substring(this.v8nPrefix.length)) : undefined;\n }\n /** A helper returning a `.checkValidity()` function for use with Vaadin elements. */\n\n protected get _checkValidity(): () => boolean {\n return () => !this._error;\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TemplateResult } from 'lit-element';
|
|
2
|
+
import { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';
|
|
3
|
+
/**
|
|
4
|
+
* Internal control displaying a basic text area box.
|
|
5
|
+
*
|
|
6
|
+
* @since 1.17.0
|
|
7
|
+
* @element foxy-internal-text-area-control
|
|
8
|
+
*/
|
|
9
|
+
export declare class InternalTextAreaControl extends InternalEditableControl {
|
|
10
|
+
renderControl(): TemplateResult;
|
|
11
|
+
protected get _value(): string;
|
|
12
|
+
protected set _value(newValue: string);
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { InternalEditableControl } from "../InternalEditableControl/InternalEditableControl.js";
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined';
|
|
3
|
+
import { html } from 'lit-element';
|
|
4
|
+
/**
|
|
5
|
+
* Internal control displaying a basic text area box.
|
|
6
|
+
*
|
|
7
|
+
* @since 1.17.0
|
|
8
|
+
* @element foxy-internal-text-area-control
|
|
9
|
+
*/
|
|
10
|
+
export class InternalTextAreaControl extends InternalEditableControl {
|
|
11
|
+
renderControl() {
|
|
12
|
+
return html `
|
|
13
|
+
<vaadin-text-area
|
|
14
|
+
error-message=${ifDefined(this._errorMessage)}
|
|
15
|
+
helper-text=${this.helperText}
|
|
16
|
+
placeholder=${this.placeholder}
|
|
17
|
+
label=${this.label}
|
|
18
|
+
class="w-full"
|
|
19
|
+
?disabled=${this.disabled}
|
|
20
|
+
?readonly=${this.readonly}
|
|
21
|
+
.checkValidity=${this._checkValidity}
|
|
22
|
+
.value=${this._value}
|
|
23
|
+
@keydown=${(evt) => { var _a; return evt.key === 'Enter' && ((_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.submit()); }}
|
|
24
|
+
@input=${(evt) => {
|
|
25
|
+
const area = evt.currentTarget;
|
|
26
|
+
this._value = area.value;
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
</vaadin-text-area>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
get _value() {
|
|
33
|
+
var _a;
|
|
34
|
+
return (_a = super._value) !== null && _a !== void 0 ? _a : '';
|
|
35
|
+
}
|
|
36
|
+
set _value(newValue) {
|
|
37
|
+
super._value = newValue;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=InternalTextAreaControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalTextAreaControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalTextAreaControl/InternalTextAreaControl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,uBAAuB;IAClE,aAAa;QACX,OAAO,IAAI,CAAA;;wBAES,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;sBAC/B,IAAI,CAAC,UAAU;sBACf,IAAI,CAAC,WAAW;gBACtB,IAAI,CAAC,KAAK;;oBAEN,IAAI,CAAC,QAAQ;oBACb,IAAI,CAAC,QAAQ;yBACR,IAAI,CAAC,cAAc;iBAC3B,IAAI,CAAC,MAAM;mBACT,CAAC,GAAkB,EAAE,EAAE,WAAC,OAAA,GAAG,CAAC,GAAG,KAAK,OAAO,WAAI,IAAI,CAAC,OAAO,0CAAE,MAAM,GAAE,CAAA,EAAA;iBACvE,CAAC,GAAgB,EAAE,EAAE;YAC5B,MAAM,IAAI,GAAG,GAAG,CAAC,aAAgC,CAAC;YAClD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,CAAC;;;KAGJ,CAAC;IACJ,CAAC;IAED,IAAc,MAAM;;QAClB,aAAQ,KAAK,CAAC,MAA6B,mCAAI,EAAE,CAAC;IACpD,CAAC;IAED,IAAc,MAAM,CAAC,QAAgB;QACnC,KAAK,CAAC,MAAM,GAAG,QAA+B,CAAC;IACjD,CAAC;CACF","sourcesContent":["import type { TextAreaElement } from '@vaadin/vaadin-text-field/vaadin-text-area';\nimport type { TemplateResult } from 'lit-element';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-element';\n\n/**\n * Internal control displaying a basic text area box.\n *\n * @since 1.17.0\n * @element foxy-internal-text-area-control\n */\nexport class InternalTextAreaControl extends InternalEditableControl {\n renderControl(): TemplateResult {\n return html`\n <vaadin-text-area\n error-message=${ifDefined(this._errorMessage)}\n helper-text=${this.helperText}\n placeholder=${this.placeholder}\n label=${this.label}\n class=\"w-full\"\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n .checkValidity=${this._checkValidity}\n .value=${this._value}\n @keydown=${(evt: KeyboardEvent) => evt.key === 'Enter' && this.nucleon?.submit()}\n @input=${(evt: CustomEvent) => {\n const area = evt.currentTarget as TextAreaElement;\n this._value = area.value;\n }}\n >\n </vaadin-text-area>\n `;\n }\n\n protected get _value(): string {\n return (super._value as string | undefined) ?? '';\n }\n\n protected set _value(newValue: string) {\n super._value = newValue as unknown | undefined;\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import '@vaadin/vaadin-text-field/vaadin-text-area';
|
|
2
|
+
import "../InternalEditableControl/index.js";
|
|
3
|
+
import { InternalTextAreaControl as Control } from "./InternalTextAreaControl.js";
|
|
4
|
+
customElements.define('foxy-internal-text-area-control', Control);
|
|
5
|
+
export { Control as InternalTextAreaControl };
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalTextAreaControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC;AACpD,6CAA0C;AAC1C,OAAO,EAAE,uBAAuB,IAAI,OAAO,EAAE,qCAAkC;AAE/E,cAAc,CAAC,MAAM,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-text-field/vaadin-text-area';\nimport '../InternalEditableControl/index';\nimport { InternalTextAreaControl as Control } from './InternalTextAreaControl';\n\ncustomElements.define('foxy-internal-text-area-control', Control);\n\nexport { Control as InternalTextAreaControl };\n"]}
|
|
@@ -2,6 +2,7 @@ import { ConfigurableMixin } from "../../../mixins/configurable.js";
|
|
|
2
2
|
import { html } from 'lit-html';
|
|
3
3
|
import { API } from "../NucleonElement/API.js";
|
|
4
4
|
import { NucleonElement } from "../NucleonElement/NucleonElement.js";
|
|
5
|
+
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
5
6
|
import { ThemeableMixin } from "../../../mixins/themeable.js";
|
|
6
7
|
import { TranslatableMixin } from "../../../mixins/translatable.js";
|
|
7
8
|
const Base = ThemeableMixin(ConfigurableMixin(TranslatableMixin(NucleonElement)));
|
|
@@ -127,28 +128,14 @@ export class InternalCustomerPortalLoggedInView extends Base {
|
|
|
127
128
|
render() {
|
|
128
129
|
var _a, _b;
|
|
129
130
|
const hiddenSelector = this.hiddenSelector.zoom('customer');
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const customerHiddenControls = [
|
|
139
|
-
...optionallyHiddenInCustomer
|
|
140
|
-
.filter(id => hiddenSelector.matches(id))
|
|
141
|
-
.map(id => `${id}:${hiddenSelector.zoom(id)}`),
|
|
142
|
-
...alwaysHiddenInCustomer.map(id => {
|
|
143
|
-
const splitId = id.split(':');
|
|
144
|
-
for (let i = 0; i < splitId.length; ++i) {
|
|
145
|
-
const hostId = splitId.slice(0, i + 1).join(':');
|
|
146
|
-
if (hiddenSelector.matches(hostId, true))
|
|
147
|
-
return hostId;
|
|
148
|
-
}
|
|
149
|
-
return id;
|
|
150
|
-
}),
|
|
151
|
-
];
|
|
131
|
+
const customerHiddenControls = new BooleanSelector(`
|
|
132
|
+
attributes
|
|
133
|
+
transactions
|
|
134
|
+
subscriptions
|
|
135
|
+
addresses:actions:create
|
|
136
|
+
header:actions:edit:form:delete
|
|
137
|
+
${hiddenSelector.toString()}
|
|
138
|
+
`).toString();
|
|
152
139
|
const templates = this.getNestedTemplates('customer');
|
|
153
140
|
const originalHeaderActionsAfterTemplate = templates['header:actions:after'];
|
|
154
141
|
const originalTimestampsAfterTemplate = templates['header:actions:edit:form:timestamps:after'];
|
|
@@ -211,7 +198,7 @@ export class InternalCustomerPortalLoggedInView extends Base {
|
|
|
211
198
|
<foxy-customer
|
|
212
199
|
readonlycontrols=${this.readonlySelector.zoom('customer').toString()}
|
|
213
200
|
disabledcontrols=${this.disabledSelector.zoom('customer').toString()}
|
|
214
|
-
hiddencontrols=${customerHiddenControls
|
|
201
|
+
hiddencontrols=${customerHiddenControls}
|
|
215
202
|
data-testid="customer"
|
|
216
203
|
group=${this.group}
|
|
217
204
|
href=${this.customer}
|