@saasquatch/mint-components 1.14.7-10 → 1.14.7-11
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/cjs/{ShadowViewAddon-d79686c7.js → ShadowViewAddon-f86d2739.js} +3 -1
- package/dist/cjs/sqm-big-stat_43.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-lead-checkbox-field-view-34d94919.js → sqm-lead-checkbox-field-view-47675f42.js} +3 -7
- package/dist/cjs/sqm-lead-checkbox-field-view-bb9b7c6c.js +79 -0
- package/dist/cjs/sqm-lead-checkbox-field.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -2
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field-view.js +3 -1
- package/dist/collection/components/sqm-lead-form/sqm-lead-checkbox-field-view.js +3 -7
- package/dist/esm/{ShadowViewAddon-88ca6579.js → ShadowViewAddon-fea70c8c.js} +3 -1
- package/dist/esm/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm/{sqm-lead-checkbox-field-view-a8c1c78e.js → sqm-lead-checkbox-field-view-05823885.js} +3 -7
- package/dist/esm/sqm-lead-checkbox-field-view-269af7ba.js +77 -0
- package/dist/esm/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +2 -2
- package/dist/esm-es5/ShadowViewAddon-fea70c8c.js +1 -0
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm-es5/{sqm-lead-checkbox-field-view-a8c1c78e.js → sqm-lead-checkbox-field-view-05823885.js} +1 -1
- package/dist/esm-es5/sqm-lead-checkbox-field-view-269af7ba.js +1 -0
- package/dist/esm-es5/sqm-lead-checkbox-field.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-9743b3d1.entry.js → p-06180ec8.entry.js} +1 -1
- package/dist/mint-components/{p-95b88eb6.system.js → p-14f86024.system.js} +1 -1
- package/dist/mint-components/p-20fb7d34.system.js +1 -0
- package/dist/mint-components/{p-c45a40b0.entry.js → p-268363a8.entry.js} +1 -1
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-0a6dd9ce.system.entry.js → p-5640d160.system.entry.js} +1 -1
- package/dist/mint-components/p-9def94f6.js +394 -0
- package/dist/mint-components/{p-0b4cac9f.system.entry.js → p-c1a65f6e.system.entry.js} +1 -1
- package/dist/mint-components/{p-48c69c2d.entry.js → p-ccddb56d.entry.js} +1 -1
- package/dist/mint-components/{p-2ad84d3e.system.entry.js → p-d450ee65.system.entry.js} +1 -1
- package/dist/mint-components/p-dddeeff2.js +1 -0
- package/dist/mint-components/sqm-lead-checkbox-field-view-17027655.system.js +1 -0
- package/dist/mint-components/sqm-lead-checkbox-field-view-269af7ba.js +77 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/ShadowViewAddon-88ca6579.js +0 -1
- package/dist/mint-components/p-00df0cac.js +0 -1
- package/dist/mint-components/p-2011095e.js +0 -394
- package/dist/mint-components/p-8a8750b2.system.js +0 -1
|
@@ -1713,7 +1713,9 @@ function CheckboxFieldView(props) {
|
|
|
1713
1713
|
index.h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, checked: states.checked, "onSl-change": (e) => {
|
|
1714
1714
|
e.target.value = e.target.checked;
|
|
1715
1715
|
callbacks.setChecked(e.target.value);
|
|
1716
|
-
} }, (!content.checkboxOptional
|
|
1716
|
+
} }, (!content.checkboxOptional
|
|
1717
|
+
? { required: false }
|
|
1718
|
+
: { required: true }), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }), global.intl.formatMessage({
|
|
1717
1719
|
id: content.checkboxName + "-message",
|
|
1718
1720
|
defaultMessage: content.checkboxLabel,
|
|
1719
1721
|
}, {
|
|
@@ -24,7 +24,7 @@ const sqmPortalLoginView = require('./sqm-portal-login-view-761a4d8e.js');
|
|
|
24
24
|
const usePortalLogin = require('./usePortalLogin-63d896d1.js');
|
|
25
25
|
const AsYouType = require('./AsYouType-6788393a.js');
|
|
26
26
|
const utilities = require('./utilities-78f5e169.js');
|
|
27
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
27
|
+
const ShadowViewAddon = require('./ShadowViewAddon-f86d2739.js');
|
|
28
28
|
require('./sqm-portal-container-view-4f15143a.js');
|
|
29
29
|
const usePayoutStatus = require('./usePayoutStatus-feeac99b.js');
|
|
30
30
|
|
|
@@ -60,13 +60,9 @@ function LeadCheckboxFieldView(props) {
|
|
|
60
60
|
styleString),
|
|
61
61
|
index.h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, "onSl-change": (e) => {
|
|
62
62
|
e.target.value = e.target.checked;
|
|
63
|
-
} }, (!content.checkboxOptional
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
checkboxLabel: content.checkboxLabel,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
} }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
63
|
+
} }, (!content.checkboxOptional
|
|
64
|
+
? { required: false }
|
|
65
|
+
: { required: true }), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
70
66
|
class: sheet.classes.ErrorStyle,
|
|
71
67
|
}
|
|
72
68
|
: [])), global.intl.formatMessage({
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-acf63b7d.js');
|
|
4
|
+
const global = require('./global-eec134b3.js');
|
|
5
|
+
const jssPresetDefault_esm = require('./jss-preset-default.esm-b48f0c33.js');
|
|
6
|
+
|
|
7
|
+
const style = {
|
|
8
|
+
ErrorStyle: {
|
|
9
|
+
"&::part(control)": {
|
|
10
|
+
borderColor: "var(--sl-color-danger-500)",
|
|
11
|
+
outline: "var(--sl-color-danger-500)",
|
|
12
|
+
},
|
|
13
|
+
"&:host": {
|
|
14
|
+
"--focus-ring": "0 0 0 var(--sl-focus-ring-width) red !important",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
ErrorMessageStyle: {
|
|
18
|
+
margin: 0,
|
|
19
|
+
marginTop: "5px",
|
|
20
|
+
color: "var(--sl-color-danger-500)",
|
|
21
|
+
fontSize: "var(--sl-input-help-text-font-size-medium)",
|
|
22
|
+
fontFamily: "var(--sl-font-sans)",
|
|
23
|
+
fontWeight: "var(--sl-font-weight-normal)",
|
|
24
|
+
},
|
|
25
|
+
FieldContainer: {
|
|
26
|
+
"margin-bottom": "var(--sl-spacing-large)",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const vanillaStyle = `
|
|
30
|
+
:host {
|
|
31
|
+
margin: 0 auto;
|
|
32
|
+
width: 100%;
|
|
33
|
+
display: block;
|
|
34
|
+
}
|
|
35
|
+
sl-checkbox::part(label){
|
|
36
|
+
font-size: var(--sl-input-label-font-size-small);
|
|
37
|
+
font-weight: var(--sl-font-weight-normal);
|
|
38
|
+
line-height: 20px;
|
|
39
|
+
}
|
|
40
|
+
sl-checkbox::part(base){
|
|
41
|
+
align-items: start;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
jssPresetDefault_esm.jss.setup(jssPresetDefault_esm.create$1());
|
|
45
|
+
const sheet = jssPresetDefault_esm.jss.createStyleSheet(style);
|
|
46
|
+
const styleString = sheet.toString();
|
|
47
|
+
function LeadCheckboxFieldView(props) {
|
|
48
|
+
var _a, _b, _c, _d, _e;
|
|
49
|
+
const { states, content } = props;
|
|
50
|
+
const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
|
|
51
|
+
const getRequiredFieldErrorMessage = ({ checkboxLabel, }) => global.intl.formatMessage({
|
|
52
|
+
id: `requiredFieldErrorMessage-${checkboxLabel}`,
|
|
53
|
+
defaultMessage: content.errorMessage,
|
|
54
|
+
}, {
|
|
55
|
+
checkboxLabel,
|
|
56
|
+
});
|
|
57
|
+
return (index.h("div", { class: sheet.classes.FieldContainer, part: "sqm-base" },
|
|
58
|
+
index.h("style", { type: "text/css" },
|
|
59
|
+
vanillaStyle,
|
|
60
|
+
styleString),
|
|
61
|
+
index.h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, "onSl-change": (e) => {
|
|
62
|
+
e.target.value = e.target.checked;
|
|
63
|
+
} }, (!content.checkboxOptional
|
|
64
|
+
? { required: false }
|
|
65
|
+
: { required: true }), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
66
|
+
class: sheet.classes.ErrorStyle,
|
|
67
|
+
}
|
|
68
|
+
: [])), global.intl.formatMessage({
|
|
69
|
+
id: content.checkboxName + "-message",
|
|
70
|
+
defaultMessage: content.checkboxLabel,
|
|
71
|
+
}, {
|
|
72
|
+
labelLink: (index.h("a", { href: content.checkboxLabelLink, target: "_blank" }, content.checkboxLabelLinkText || content.checkboxLabelLink)),
|
|
73
|
+
})),
|
|
74
|
+
(validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.checkboxName]) && (index.h("p", { class: sheet.classes.ErrorMessageStyle }, getRequiredFieldErrorMessage({
|
|
75
|
+
checkboxLabel: content.checkboxLabel,
|
|
76
|
+
})))));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
exports.LeadCheckboxFieldView = LeadCheckboxFieldView;
|
|
@@ -10,7 +10,7 @@ const cjs = require('./cjs-1066ec21.js');
|
|
|
10
10
|
const utils = require('./utils-6847bc06.js');
|
|
11
11
|
require('./JSS-8503a151.js');
|
|
12
12
|
const useLeadFormState = require('./useLeadFormState-c83d2034.js');
|
|
13
|
-
const sqmLeadCheckboxFieldView = require('./sqm-lead-checkbox-field-view-
|
|
13
|
+
const sqmLeadCheckboxFieldView = require('./sqm-lead-checkbox-field-view-47675f42.js');
|
|
14
14
|
|
|
15
15
|
function useLeadCheckboxField() {
|
|
16
16
|
const leadFormState = stencilHooks_module.d(useLeadFormState.LEAD_FORM_STATE_CONTEXT);
|
|
@@ -20,7 +20,7 @@ const sqmAssetCardView = require('./sqm-asset-card-view-21ddf04f.js');
|
|
|
20
20
|
const sqmCloseButtonView = require('./sqm-close-button-view-ea3fa23b.js');
|
|
21
21
|
require('./index-8c6255f5.js');
|
|
22
22
|
const emailRegistrationView = require('./email-registration-view-55b378dc.js');
|
|
23
|
-
const sqmLeadCheckboxFieldView = require('./sqm-lead-checkbox-field-view-
|
|
23
|
+
const sqmLeadCheckboxFieldView = require('./sqm-lead-checkbox-field-view-47675f42.js');
|
|
24
24
|
const sqmLeaderboardRankView = require('./sqm-leaderboard-rank-view-d39a55d8.js');
|
|
25
25
|
const sqmLogoutCurrentUserView = require('./sqm-logout-current-user-view-11d57c12.js');
|
|
26
26
|
const sqmNavigationSidebarView = require('./sqm-navigation-sidebar-view-17111896.js');
|
|
@@ -36,7 +36,7 @@ const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-fe6
|
|
|
36
36
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-7b678f34.js');
|
|
37
37
|
require('./ErrorView-b2fcf954.js');
|
|
38
38
|
const sqmQrCodeView = require('./sqm-qr-code-view-15dfc0b6.js');
|
|
39
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
39
|
+
const ShadowViewAddon = require('./ShadowViewAddon-f86d2739.js');
|
|
40
40
|
const sqmPortalContainerView = require('./sqm-portal-container-view-4f15143a.js');
|
|
41
41
|
const sqmInvoiceTableView = require('./sqm-invoice-table-view-0f7fa309.js');
|
|
42
42
|
const sqmLeadInputFieldView = require('./sqm-lead-input-field-view-89308aab.js');
|
|
@@ -54,7 +54,9 @@ export function CheckboxFieldView(props) {
|
|
|
54
54
|
h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, checked: states.checked, "onSl-change": (e) => {
|
|
55
55
|
e.target.value = e.target.checked;
|
|
56
56
|
callbacks.setChecked(e.target.value);
|
|
57
|
-
} }, (!content.checkboxOptional
|
|
57
|
+
} }, (!content.checkboxOptional
|
|
58
|
+
? { required: false }
|
|
59
|
+
: { required: true }), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }), intl.formatMessage({
|
|
58
60
|
id: content.checkboxName + "-message",
|
|
59
61
|
defaultMessage: content.checkboxLabel,
|
|
60
62
|
}, {
|
|
@@ -58,13 +58,9 @@ export function LeadCheckboxFieldView(props) {
|
|
|
58
58
|
styleString),
|
|
59
59
|
h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, "onSl-change": (e) => {
|
|
60
60
|
e.target.value = e.target.checked;
|
|
61
|
-
} }, (!content.checkboxOptional
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
checkboxLabel: content.checkboxLabel,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
} }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
61
|
+
} }, (!content.checkboxOptional
|
|
62
|
+
? { required: false }
|
|
63
|
+
: { required: true }), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
68
64
|
class: sheet.classes.ErrorStyle,
|
|
69
65
|
}
|
|
70
66
|
: [])), intl.formatMessage({
|
|
@@ -1711,7 +1711,9 @@ function CheckboxFieldView(props) {
|
|
|
1711
1711
|
h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, checked: states.checked, "onSl-change": (e) => {
|
|
1712
1712
|
e.target.value = e.target.checked;
|
|
1713
1713
|
callbacks.setChecked(e.target.value);
|
|
1714
|
-
} }, (!content.checkboxOptional
|
|
1714
|
+
} }, (!content.checkboxOptional
|
|
1715
|
+
? { required: false }
|
|
1716
|
+
: { required: true }), { disabled: ((_b = states.registrationFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.registrationFormState) === null || _c === void 0 ? void 0 : _c.disabled) }), intl.formatMessage({
|
|
1715
1717
|
id: content.checkboxName + "-message",
|
|
1716
1718
|
defaultMessage: content.checkboxLabel,
|
|
1717
1719
|
}, {
|
|
@@ -20,7 +20,7 @@ import { P as PortalLoginView } from './sqm-portal-login-view-7e49609a.js';
|
|
|
20
20
|
import { u as usePortalLogin } from './usePortalLogin-ef647a50.js';
|
|
21
21
|
import { A as AsYouType } from './AsYouType-46f67d0d.js';
|
|
22
22
|
import { i as isEmpty } from './utilities-5b0ca040.js';
|
|
23
|
-
import { b as useDemoBigStat, W as useBigStat, B as BigStatView, U as autoColorScaleCss, J as CardFeedView, i as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, Q as LeadDropdownFieldView, O as LeadFormView, X as withShadowView, L as LeaderboardView, N as NameFieldsView, C as ChangeMarktingView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, Y as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-
|
|
23
|
+
import { b as useDemoBigStat, W as useBigStat, B as BigStatView, U as autoColorScaleCss, J as CardFeedView, i as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, Q as LeadDropdownFieldView, O as LeadFormView, X as withShadowView, L as LeaderboardView, N as NameFieldsView, C as ChangeMarktingView, d as PortalChangePasswordView, h as PortalFooterView, P as PortalFrameView, e as PortalRegisterView, R as ReferralIframeView, Y as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-fea70c8c.js';
|
|
24
24
|
import './sqm-portal-container-view-1683ae32.js';
|
|
25
25
|
import { u as usePayoutStatus } from './usePayoutStatus-fed17fc9.js';
|
|
26
26
|
|
|
@@ -58,13 +58,9 @@ function LeadCheckboxFieldView(props) {
|
|
|
58
58
|
styleString),
|
|
59
59
|
h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, "onSl-change": (e) => {
|
|
60
60
|
e.target.value = e.target.checked;
|
|
61
|
-
} }, (!content.checkboxOptional
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
checkboxLabel: content.checkboxLabel,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
} }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
61
|
+
} }, (!content.checkboxOptional
|
|
62
|
+
? { required: false }
|
|
63
|
+
: { required: true }), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
68
64
|
class: sheet.classes.ErrorStyle,
|
|
69
65
|
}
|
|
70
66
|
: [])), intl.formatMessage({
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { h } from './index-9c0e3f6c.js';
|
|
2
|
+
import { i as intl } from './global-74148d5d.js';
|
|
3
|
+
import { j as jss, a as create } from './jss-preset-default.esm-c36417f8.js';
|
|
4
|
+
|
|
5
|
+
const style = {
|
|
6
|
+
ErrorStyle: {
|
|
7
|
+
"&::part(control)": {
|
|
8
|
+
borderColor: "var(--sl-color-danger-500)",
|
|
9
|
+
outline: "var(--sl-color-danger-500)",
|
|
10
|
+
},
|
|
11
|
+
"&:host": {
|
|
12
|
+
"--focus-ring": "0 0 0 var(--sl-focus-ring-width) red !important",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
ErrorMessageStyle: {
|
|
16
|
+
margin: 0,
|
|
17
|
+
marginTop: "5px",
|
|
18
|
+
color: "var(--sl-color-danger-500)",
|
|
19
|
+
fontSize: "var(--sl-input-help-text-font-size-medium)",
|
|
20
|
+
fontFamily: "var(--sl-font-sans)",
|
|
21
|
+
fontWeight: "var(--sl-font-weight-normal)",
|
|
22
|
+
},
|
|
23
|
+
FieldContainer: {
|
|
24
|
+
"margin-bottom": "var(--sl-spacing-large)",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const vanillaStyle = `
|
|
28
|
+
:host {
|
|
29
|
+
margin: 0 auto;
|
|
30
|
+
width: 100%;
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
sl-checkbox::part(label){
|
|
34
|
+
font-size: var(--sl-input-label-font-size-small);
|
|
35
|
+
font-weight: var(--sl-font-weight-normal);
|
|
36
|
+
line-height: 20px;
|
|
37
|
+
}
|
|
38
|
+
sl-checkbox::part(base){
|
|
39
|
+
align-items: start;
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
jss.setup(create());
|
|
43
|
+
const sheet = jss.createStyleSheet(style);
|
|
44
|
+
const styleString = sheet.toString();
|
|
45
|
+
function LeadCheckboxFieldView(props) {
|
|
46
|
+
var _a, _b, _c, _d, _e;
|
|
47
|
+
const { states, content } = props;
|
|
48
|
+
const validationErrors = (_a = states === null || states === void 0 ? void 0 : states.leadFormState) === null || _a === void 0 ? void 0 : _a.validationErrors;
|
|
49
|
+
const getRequiredFieldErrorMessage = ({ checkboxLabel, }) => intl.formatMessage({
|
|
50
|
+
id: `requiredFieldErrorMessage-${checkboxLabel}`,
|
|
51
|
+
defaultMessage: content.errorMessage,
|
|
52
|
+
}, {
|
|
53
|
+
checkboxLabel,
|
|
54
|
+
});
|
|
55
|
+
return (h("div", { class: sheet.classes.FieldContainer, part: "sqm-base" },
|
|
56
|
+
h("style", { type: "text/css" },
|
|
57
|
+
vanillaStyle,
|
|
58
|
+
styleString),
|
|
59
|
+
h("sl-checkbox", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.checkboxName}`, "onSl-change": (e) => {
|
|
60
|
+
e.target.value = e.target.checked;
|
|
61
|
+
} }, (!content.checkboxOptional
|
|
62
|
+
? { required: false }
|
|
63
|
+
: { required: true }), { disabled: ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.loading) || ((_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.disabled) }, (((_e = (_d = states.leadFormState) === null || _d === void 0 ? void 0 : _d.validationErrors) === null || _e === void 0 ? void 0 : _e[content.checkboxName]) ? {
|
|
64
|
+
class: sheet.classes.ErrorStyle,
|
|
65
|
+
}
|
|
66
|
+
: [])), intl.formatMessage({
|
|
67
|
+
id: content.checkboxName + "-message",
|
|
68
|
+
defaultMessage: content.checkboxLabel,
|
|
69
|
+
}, {
|
|
70
|
+
labelLink: (h("a", { href: content.checkboxLabelLink, target: "_blank" }, content.checkboxLabelLinkText || content.checkboxLabelLink)),
|
|
71
|
+
})),
|
|
72
|
+
(validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors[content.checkboxName]) && (h("p", { class: sheet.classes.ErrorMessageStyle }, getRequiredFieldErrorMessage({
|
|
73
|
+
checkboxLabel: content.checkboxLabel,
|
|
74
|
+
})))));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { LeadCheckboxFieldView as L };
|
|
@@ -6,7 +6,7 @@ import { c as cjs } from './cjs-bdfb4486.js';
|
|
|
6
6
|
import { a as getMissingProps, g as getProps } from './utils-334c1e34.js';
|
|
7
7
|
import './JSS-67b5cff8.js';
|
|
8
8
|
import { L as LEAD_FORM_STATE_CONTEXT, R as RequiredPropsError } from './useLeadFormState-9016d812.js';
|
|
9
|
-
import { L as LeadCheckboxFieldView } from './sqm-lead-checkbox-field-view-
|
|
9
|
+
import { L as LeadCheckboxFieldView } from './sqm-lead-checkbox-field-view-05823885.js';
|
|
10
10
|
|
|
11
11
|
function useLeadCheckboxField() {
|
|
12
12
|
const leadFormState = d(LEAD_FORM_STATE_CONTEXT);
|
|
@@ -16,7 +16,7 @@ import { A as AssetCardView } from './sqm-asset-card-view-fe5db3c0.js';
|
|
|
16
16
|
import { C as CloseButtonView } from './sqm-close-button-view-f9819751.js';
|
|
17
17
|
import './index-ffa26b43.js';
|
|
18
18
|
import { E as EmailRegistrationView } from './email-registration-view-a7818cf2.js';
|
|
19
|
-
import { L as LeadCheckboxFieldView } from './sqm-lead-checkbox-field-view-
|
|
19
|
+
import { L as LeadCheckboxFieldView } from './sqm-lead-checkbox-field-view-05823885.js';
|
|
20
20
|
import { L as LeaderboardRankView } from './sqm-leaderboard-rank-view-753c8d4a.js';
|
|
21
21
|
import { L as LogoutCurrentUserView } from './sqm-logout-current-user-view-8ef8180f.js';
|
|
22
22
|
import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-9d802b78.js';
|
|
@@ -32,7 +32,7 @@ import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-5
|
|
|
32
32
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-b12cb894.js';
|
|
33
33
|
import './ErrorView-48e2b969.js';
|
|
34
34
|
import { Q as QrCodeView } from './sqm-qr-code-view-f1d0763b.js';
|
|
35
|
-
import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalRegisterView, C as ChangeMarktingView, T as TaskCardView, f as ProgressBarView, g as PoweredByImg$1, h as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, i as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as LeadFormView, Q as LeadDropdownFieldView, U as autoColorScaleCss, V as ShadowViewAddon } from './ShadowViewAddon-
|
|
35
|
+
import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalRegisterView, C as ChangeMarktingView, T as TaskCardView, f as ProgressBarView, g as PoweredByImg$1, h as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, i as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as LeadFormView, Q as LeadDropdownFieldView, U as autoColorScaleCss, V as ShadowViewAddon } from './ShadowViewAddon-fea70c8c.js';
|
|
36
36
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-1683ae32.js';
|
|
37
37
|
import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-7f376a75.js';
|
|
38
38
|
import { L as LeadInputFieldView } from './sqm-lead-input-field-view-4ede5d7f.js';
|