@saasquatch/mint-components 1.14.6-1 → 1.14.6-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/cjs/{ShadowViewAddon-c0a5fdf8.js → ShadowViewAddon-40f0bc74.js} +58 -26
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat_42.cjs.entry.js +85 -117
- package/dist/cjs/sqm-lead-dropdown-field-view-03a3e03f.js +69 -0
- package/dist/cjs/sqm-lead-dropdown-field.cjs.entry.js +75 -0
- package/dist/cjs/sqm-lead-input-field-view-6344cd93.js +51 -0
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +78 -0
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +166 -49
- package/dist/cjs/useLeadFormState-c83d2034.js +72 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/sqm-lead-form/LeadForm.stories.js +34 -46
- package/dist/collection/components/sqm-lead-form/LeadFormDropdownField.stories.js +59 -0
- package/dist/collection/components/sqm-lead-form/LeadInputField.stories.js +48 -0
- package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field-view.js +65 -0
- package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field.js +193 -0
- package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +59 -26
- package/dist/collection/components/sqm-lead-form/sqm-lead-form.js +147 -36
- package/dist/collection/components/sqm-lead-form/sqm-lead-input-field-view.js +47 -0
- package/dist/collection/components/sqm-lead-form/sqm-lead-input-field.js +222 -0
- package/dist/collection/components/sqm-lead-form/useLeadDropdownField.js +10 -0
- package/dist/collection/components/sqm-lead-form/useLeadForm.js +9 -6
- package/dist/collection/components/sqm-lead-form/useLeadInputField.js +10 -0
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +4 -0
- package/dist/esm/{ShadowViewAddon-aa7177fe.js → ShadowViewAddon-8a0d9e83.js} +58 -26
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat_42.entry.js +82 -114
- package/dist/esm/sqm-lead-dropdown-field-view-4c85fe20.js +67 -0
- package/dist/esm/sqm-lead-dropdown-field.entry.js +71 -0
- package/dist/esm/sqm-lead-input-field-view-f1dd4b77.js +49 -0
- package/dist/esm/sqm-lead-input-field.entry.js +74 -0
- package/dist/esm/sqm-stencilbook.entry.js +166 -49
- package/dist/esm/useLeadFormState-9016d812.js +68 -0
- package/dist/esm-es5/{ShadowViewAddon-aa7177fe.js → ShadowViewAddon-8a0d9e83.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_42.entry.js +1 -1
- package/dist/esm-es5/sqm-lead-dropdown-field-view-4c85fe20.js +1 -0
- package/dist/esm-es5/sqm-lead-dropdown-field.entry.js +1 -0
- package/dist/esm-es5/sqm-lead-input-field-view-f1dd4b77.js +1 -0
- package/dist/esm-es5/sqm-lead-input-field.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/useLeadFormState-9016d812.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-13c67985.system.entry.js +1 -0
- package/dist/mint-components/p-15f1ff1d.system.js +1 -0
- package/dist/mint-components/p-1d704c40.system.js +1 -0
- package/dist/mint-components/p-26da31c6.js +1 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-373a92a2.js → p-4139feb5.js} +3 -3
- package/dist/mint-components/p-4d5b02af.js +1 -0
- package/dist/mint-components/p-87384d9e.system.js +1 -0
- package/dist/mint-components/p-875861d7.system.entry.js +1 -0
- package/dist/mint-components/p-8af8ab01.system.entry.js +1 -0
- package/dist/mint-components/p-9e1570bf.system.entry.js +1 -0
- package/dist/mint-components/{p-72e5e84f.system.js → p-ad6420a2.system.js} +1 -1
- package/dist/mint-components/p-b8c15858.entry.js +1 -0
- package/dist/mint-components/{p-8dc110b0.entry.js → p-cd1c6113.entry.js} +2 -2
- package/dist/mint-components/p-e358f0c1.entry.js +265 -0
- package/dist/mint-components/p-f59d6012.entry.js +1 -0
- package/dist/mint-components/p-f98a4354.js +1 -0
- package/dist/types/components/sqm-lead-form/LeadForm.stories.d.ts +1 -0
- package/dist/types/components/sqm-lead-form/LeadFormDropdownField.stories.d.ts +9 -0
- package/dist/types/components/sqm-lead-form/LeadInputField.stories.d.ts +8 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field-view.d.ts +15 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field.d.ts +42 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-form-view.d.ts +7 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-form.d.ts +24 -7
- package/dist/types/components/sqm-lead-form/sqm-lead-input-field-view.d.ts +14 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-input-field.d.ts +49 -0
- package/dist/types/components/sqm-lead-form/useLeadDropdownField.d.ts +6 -0
- package/dist/types/components/sqm-lead-form/useLeadForm.d.ts +4 -0
- package/dist/types/components/sqm-lead-form/useLeadInputField.d.ts +6 -0
- package/dist/types/components.d.ts +194 -12
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/mint-components/p-02a6e0df.system.entry.js +0 -1
- package/dist/mint-components/p-cde11800.system.entry.js +0 -1
- package/dist/mint-components/p-ede3d2f9.entry.js +0 -265
- package/dist/types/global/android.d.ts +0 -7
- package/dist/types/global/demo.d.ts +0 -2
- package/dist/types/stories/features.d.ts +0 -4
- package/dist/types/stories/templates.d.ts +0 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { r as registerInstance, h as h$1 } from './index-91e7729f.js';
|
|
2
|
+
import { i as d, n as h } from './stencil-hooks.module-4bc38af4.js';
|
|
3
|
+
import './global-be1f9992.js';
|
|
4
|
+
import { i as isDemo } from './index.module-89a79f66.js';
|
|
5
|
+
import { c as cjs } from './cjs-bdfb4486.js';
|
|
6
|
+
import { g as getProps, a as getMissingProps } from './utils-334c1e34.js';
|
|
7
|
+
import './JSS-67b5cff8.js';
|
|
8
|
+
import './mixins-83f90fa1.js';
|
|
9
|
+
import { L as LEAD_FORM_STATE_CONTEXT, R as RequiredPropsError } from './useLeadFormState-9016d812.js';
|
|
10
|
+
import { L as LeadInputFieldView } from './sqm-lead-input-field-view-f1dd4b77.js';
|
|
11
|
+
|
|
12
|
+
function useLeadInputField() {
|
|
13
|
+
const leadFormState = d(LEAD_FORM_STATE_CONTEXT);
|
|
14
|
+
return {
|
|
15
|
+
states: {
|
|
16
|
+
leadFormState,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const LeadInputField = class {
|
|
22
|
+
constructor(hostRef) {
|
|
23
|
+
registerInstance(this, hostRef);
|
|
24
|
+
this.ignored = true;
|
|
25
|
+
/**
|
|
26
|
+
* @uiName Input type
|
|
27
|
+
* @uiType string
|
|
28
|
+
* @uiEnum ["text", "date", "tel"]
|
|
29
|
+
* @uiEnumNames ["Text", "Date", "Phone Number"]
|
|
30
|
+
*/
|
|
31
|
+
this.fieldType = "text";
|
|
32
|
+
/**
|
|
33
|
+
* The message to be displayed when a required field is not filled.
|
|
34
|
+
*
|
|
35
|
+
* @uiName Required field message
|
|
36
|
+
* @uiWidget textArea
|
|
37
|
+
*/
|
|
38
|
+
this.requiredFieldErrorMessage = "Please enter a {fieldName}";
|
|
39
|
+
/**
|
|
40
|
+
* @uiName Optional
|
|
41
|
+
* @default
|
|
42
|
+
*/
|
|
43
|
+
this.fieldOptional = false;
|
|
44
|
+
h(this);
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() { }
|
|
47
|
+
render() {
|
|
48
|
+
const content = {
|
|
49
|
+
...getProps(this),
|
|
50
|
+
};
|
|
51
|
+
const missingProps = getMissingProps([
|
|
52
|
+
{
|
|
53
|
+
attribute: "field-name",
|
|
54
|
+
value: this.fieldName,
|
|
55
|
+
},
|
|
56
|
+
]);
|
|
57
|
+
if (!isDemo() && missingProps) {
|
|
58
|
+
return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this input field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
|
|
59
|
+
}
|
|
60
|
+
const { states } = isDemo()
|
|
61
|
+
? useLeadInputFieldDemo(this)
|
|
62
|
+
: useLeadInputField();
|
|
63
|
+
return (h$1(LeadInputFieldView, { states: states, content: content }));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
function useLeadInputFieldDemo(props) {
|
|
67
|
+
return cjs({
|
|
68
|
+
states: {
|
|
69
|
+
leadForState: {},
|
|
70
|
+
},
|
|
71
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { LeadInputField as sqm_lead_input_field };
|
|
@@ -16,6 +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 LeadDropdownFieldView } from './sqm-lead-dropdown-field-view-4c85fe20.js';
|
|
19
20
|
import { L as LeaderboardRankView } from './sqm-leaderboard-rank-view-753c8d4a.js';
|
|
20
21
|
import { L as LogoutCurrentUserView } from './sqm-logout-current-user-view-8ef8180f.js';
|
|
21
22
|
import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-9d802b78.js';
|
|
@@ -31,9 +32,10 @@ import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-5
|
|
|
31
32
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-b12cb894.js';
|
|
32
33
|
import './ErrorView-48e2b969.js';
|
|
33
34
|
import { Q as QrCodeView } from './sqm-qr-code-view-f1d0763b.js';
|
|
34
|
-
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 autoColorScaleCss, U 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 autoColorScaleCss, U as ShadowViewAddon } from './ShadowViewAddon-8a0d9e83.js';
|
|
35
36
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-1683ae32.js';
|
|
36
37
|
import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-7f376a75.js';
|
|
38
|
+
import { L as LeadInputFieldView } from './sqm-lead-input-field-view-f1dd4b77.js';
|
|
37
39
|
|
|
38
40
|
/**
|
|
39
41
|
* lodash (Custom Build) <https://lodash.com/>
|
|
@@ -15832,6 +15834,7 @@ const LeadForm_stories = {
|
|
|
15832
15834
|
};
|
|
15833
15835
|
const defaultProps$t = {
|
|
15834
15836
|
states: {
|
|
15837
|
+
success: false,
|
|
15835
15838
|
leadFormState: {},
|
|
15836
15839
|
error: "",
|
|
15837
15840
|
loading: false,
|
|
@@ -15845,75 +15848,61 @@ const defaultProps$t = {
|
|
|
15845
15848
|
formRef: {},
|
|
15846
15849
|
},
|
|
15847
15850
|
content: {
|
|
15851
|
+
submitLabel: "Submit",
|
|
15848
15852
|
pageLabel: "Submit your information",
|
|
15853
|
+
resubmitFormLabel: "Refer Another Friend",
|
|
15849
15854
|
requiredFieldErrorMessage: "Cannot be empty",
|
|
15850
15855
|
invalidEmailErrorMessage: "Must be a valid email address",
|
|
15856
|
+
submitSuccessHeader: "Referral submitted",
|
|
15857
|
+
submitSuccessDescription: "Our team will contact your friend to see if they’re a good fit. In the meantime, you can track this referral on Activity page.",
|
|
15858
|
+
submitErrorHeader: "An error occurred while submitting",
|
|
15859
|
+
submitErrorDescription: "Please try again later. If the problem continues, contact Support",
|
|
15851
15860
|
},
|
|
15852
15861
|
};
|
|
15853
|
-
const
|
|
15862
|
+
const successProps$5 = {
|
|
15863
|
+
...defaultProps$t,
|
|
15854
15864
|
states: {
|
|
15855
|
-
|
|
15856
|
-
|
|
15857
|
-
|
|
15858
|
-
referralCode: "ABC123",
|
|
15859
|
-
},
|
|
15860
|
-
callbacks: {
|
|
15861
|
-
submit: () => console.log("Submit!"),
|
|
15862
|
-
inputFunction: () => { },
|
|
15863
|
-
},
|
|
15864
|
-
refs: {
|
|
15865
|
-
formRef: {},
|
|
15865
|
+
...defaultProps$t.states,
|
|
15866
|
+
success: true,
|
|
15867
|
+
error: null,
|
|
15866
15868
|
},
|
|
15867
15869
|
content: {
|
|
15868
|
-
|
|
15869
|
-
|
|
15870
|
-
|
|
15870
|
+
...defaultProps$t.content,
|
|
15871
|
+
pageLabel: "Refer your friend",
|
|
15872
|
+
},
|
|
15873
|
+
};
|
|
15874
|
+
const errorProps$c = {
|
|
15875
|
+
...defaultProps$t,
|
|
15876
|
+
states: {
|
|
15877
|
+
...defaultProps$t.states,
|
|
15878
|
+
error: "Something went wrong. Please try again.",
|
|
15879
|
+
leadFormState: {
|
|
15880
|
+
validationErrors: {
|
|
15881
|
+
firstName: "Please enter a first name",
|
|
15882
|
+
lastName: "Please enter a last name",
|
|
15883
|
+
email: "Please enter a valid email",
|
|
15884
|
+
},
|
|
15885
|
+
},
|
|
15871
15886
|
},
|
|
15872
15887
|
};
|
|
15873
15888
|
const loadingProps$9 = {
|
|
15889
|
+
...defaultProps$t,
|
|
15874
15890
|
states: {
|
|
15875
|
-
|
|
15876
|
-
error: "",
|
|
15891
|
+
...defaultProps$t.states,
|
|
15877
15892
|
loading: true,
|
|
15878
|
-
referralCode: "ABC123",
|
|
15879
|
-
},
|
|
15880
|
-
callbacks: {
|
|
15881
|
-
submit: () => console.log("Submit!"),
|
|
15882
|
-
inputFunction: () => { },
|
|
15883
|
-
},
|
|
15884
|
-
refs: {
|
|
15885
|
-
formRef: {},
|
|
15886
|
-
},
|
|
15887
|
-
content: {
|
|
15888
|
-
pageLabel: "Submit your information",
|
|
15889
|
-
requiredFieldErrorMessage: "Cannot be empty",
|
|
15890
|
-
invalidEmailErrorMessage: "Must be a valid email address",
|
|
15891
15893
|
},
|
|
15892
15894
|
};
|
|
15893
15895
|
const slottedProps$2 = {
|
|
15894
|
-
|
|
15895
|
-
leadFormState: {},
|
|
15896
|
-
error: "",
|
|
15897
|
-
loading: false,
|
|
15898
|
-
referralCode: "ABC123",
|
|
15899
|
-
},
|
|
15900
|
-
callbacks: {
|
|
15901
|
-
submit: () => console.log("Submit!"),
|
|
15902
|
-
inputFunction: () => { },
|
|
15903
|
-
},
|
|
15904
|
-
refs: {
|
|
15905
|
-
formRef: {},
|
|
15906
|
-
},
|
|
15896
|
+
...defaultProps$t,
|
|
15907
15897
|
content: {
|
|
15908
|
-
|
|
15909
|
-
requiredFieldErrorMessage: "Cannot be empty",
|
|
15910
|
-
invalidEmailErrorMessage: "Must be a valid email address",
|
|
15898
|
+
...defaultProps$t.content,
|
|
15911
15899
|
formData: (h("div", null,
|
|
15912
15900
|
h("sl-input", { style: { marginBottom: "var(--sl-spacing-x-large)" }, exportparts: "label: input-label, base: input-base", label: "Slotted Input", required: true }),
|
|
15913
15901
|
h("sl-input", { exportparts: "label: input-label, base: input-base", label: "Slotted Input 2", required: true }))),
|
|
15914
15902
|
},
|
|
15915
15903
|
};
|
|
15916
15904
|
const Default$r = () => h(LeadFormView, Object.assign({}, defaultProps$t));
|
|
15905
|
+
const LeadSubmitSuccess = () => h(LeadFormView, Object.assign({}, successProps$5));
|
|
15917
15906
|
const LeadSubmitWithError = () => h(LeadFormView, Object.assign({}, errorProps$c));
|
|
15918
15907
|
const LeadSubmitLoading = () => h(LeadFormView, Object.assign({}, loadingProps$9));
|
|
15919
15908
|
const FieldsHidden$2 = () => {
|
|
@@ -15921,6 +15910,7 @@ const FieldsHidden$2 = () => {
|
|
|
15921
15910
|
states: {
|
|
15922
15911
|
leadFormState: {},
|
|
15923
15912
|
error: "",
|
|
15913
|
+
success: false,
|
|
15924
15914
|
loading: true,
|
|
15925
15915
|
referralCode: "ABC123",
|
|
15926
15916
|
},
|
|
@@ -15932,12 +15922,137 @@ const LeadForm = /*#__PURE__*/Object.freeze({
|
|
|
15932
15922
|
__proto__: null,
|
|
15933
15923
|
'default': LeadForm_stories,
|
|
15934
15924
|
Default: Default$r,
|
|
15925
|
+
LeadSubmitSuccess: LeadSubmitSuccess,
|
|
15935
15926
|
LeadSubmitWithError: LeadSubmitWithError,
|
|
15936
15927
|
LeadSubmitLoading: LeadSubmitLoading,
|
|
15937
15928
|
FieldsHidden: FieldsHidden$2,
|
|
15938
15929
|
SlottedInputs: SlottedInputs$2
|
|
15939
15930
|
});
|
|
15940
15931
|
|
|
15932
|
+
const LeadInputField_stories = {
|
|
15933
|
+
title: "Components/Lead Form Input Field",
|
|
15934
|
+
};
|
|
15935
|
+
const defaultProps$u = {
|
|
15936
|
+
states: {
|
|
15937
|
+
leadFormState: {
|
|
15938
|
+
validationErrors: {},
|
|
15939
|
+
loading: false,
|
|
15940
|
+
disabled: false,
|
|
15941
|
+
initialData: {},
|
|
15942
|
+
},
|
|
15943
|
+
},
|
|
15944
|
+
content: {
|
|
15945
|
+
fieldName: "firstName",
|
|
15946
|
+
fieldLabel: "First Name",
|
|
15947
|
+
fieldType: "text",
|
|
15948
|
+
requiredFieldErrorMessage: "Please {fieldAction} a {fieldLabel}",
|
|
15949
|
+
fieldOptional: false,
|
|
15950
|
+
},
|
|
15951
|
+
};
|
|
15952
|
+
const Default$s = () => h(LeadInputFieldView, Object.assign({}, defaultProps$u));
|
|
15953
|
+
const WithError = () => (h(LeadInputFieldView, Object.assign({}, defaultProps$u, { states: {
|
|
15954
|
+
...defaultProps$u.states,
|
|
15955
|
+
leadFormState: {
|
|
15956
|
+
...defaultProps$u.states.leadFormState,
|
|
15957
|
+
validationErrors: {
|
|
15958
|
+
firstName: "Please enter a first name",
|
|
15959
|
+
},
|
|
15960
|
+
},
|
|
15961
|
+
} })));
|
|
15962
|
+
const Disabled$2 = () => (h(LeadInputFieldView, Object.assign({}, defaultProps$u, { states: {
|
|
15963
|
+
...defaultProps$u.states,
|
|
15964
|
+
leadFormState: {
|
|
15965
|
+
...defaultProps$u.states.leadFormState,
|
|
15966
|
+
disabled: true,
|
|
15967
|
+
},
|
|
15968
|
+
} })));
|
|
15969
|
+
const WithInitialValue = () => (h(LeadInputFieldView, Object.assign({}, defaultProps$u, { states: {
|
|
15970
|
+
...defaultProps$u.states,
|
|
15971
|
+
leadFormState: {
|
|
15972
|
+
...defaultProps$u.states.leadFormState,
|
|
15973
|
+
initialData: {
|
|
15974
|
+
firstName: "Jane",
|
|
15975
|
+
},
|
|
15976
|
+
},
|
|
15977
|
+
} })));
|
|
15978
|
+
|
|
15979
|
+
const LeadInputField = /*#__PURE__*/Object.freeze({
|
|
15980
|
+
__proto__: null,
|
|
15981
|
+
'default': LeadInputField_stories,
|
|
15982
|
+
Default: Default$s,
|
|
15983
|
+
WithError: WithError,
|
|
15984
|
+
Disabled: Disabled$2,
|
|
15985
|
+
WithInitialValue: WithInitialValue
|
|
15986
|
+
});
|
|
15987
|
+
|
|
15988
|
+
const LeadFormDropdownField_stories = {
|
|
15989
|
+
title: "Components/Lead Form Dropdown Field",
|
|
15990
|
+
};
|
|
15991
|
+
const defaultProps$v = {
|
|
15992
|
+
states: {
|
|
15993
|
+
leadFormState: {
|
|
15994
|
+
validationErrors: {},
|
|
15995
|
+
loading: false,
|
|
15996
|
+
disabled: false,
|
|
15997
|
+
initialData: {},
|
|
15998
|
+
},
|
|
15999
|
+
},
|
|
16000
|
+
content: {
|
|
16001
|
+
dropdownName: "country",
|
|
16002
|
+
dropdownLabel: "Country",
|
|
16003
|
+
requiredFieldErrorMessage: "Please select a country",
|
|
16004
|
+
dropdownOptional: false,
|
|
16005
|
+
selectOptions: [
|
|
16006
|
+
h("sl-menu-item", { value: "red" }, "Canada"),
|
|
16007
|
+
h("sl-menu-item", { value: "blue" }, "United States"),
|
|
16008
|
+
h("sl-menu-item", { value: "green" }, "Mexico"),
|
|
16009
|
+
],
|
|
16010
|
+
},
|
|
16011
|
+
};
|
|
16012
|
+
const Default$t = () => h(LeadDropdownFieldView, Object.assign({}, defaultProps$v));
|
|
16013
|
+
const WithError$1 = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
|
|
16014
|
+
...defaultProps$v.states,
|
|
16015
|
+
leadFormState: {
|
|
16016
|
+
...defaultProps$v.states.leadFormState,
|
|
16017
|
+
validationErrors: {
|
|
16018
|
+
country: "Please select a country",
|
|
16019
|
+
},
|
|
16020
|
+
},
|
|
16021
|
+
} })));
|
|
16022
|
+
const Disabled$3 = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
|
|
16023
|
+
...defaultProps$v.states,
|
|
16024
|
+
leadFormState: {
|
|
16025
|
+
...defaultProps$v.states.leadFormState,
|
|
16026
|
+
disabled: true,
|
|
16027
|
+
},
|
|
16028
|
+
} })));
|
|
16029
|
+
const Loading$d = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
|
|
16030
|
+
...defaultProps$v.states,
|
|
16031
|
+
leadFormState: {
|
|
16032
|
+
...defaultProps$v.states.leadFormState,
|
|
16033
|
+
loading: true,
|
|
16034
|
+
},
|
|
16035
|
+
} })));
|
|
16036
|
+
const WithInitialValue$1 = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
|
|
16037
|
+
...defaultProps$v.states,
|
|
16038
|
+
leadFormState: {
|
|
16039
|
+
...defaultProps$v.states.leadFormState,
|
|
16040
|
+
initialData: {
|
|
16041
|
+
country: "Canada",
|
|
16042
|
+
},
|
|
16043
|
+
},
|
|
16044
|
+
} })));
|
|
16045
|
+
|
|
16046
|
+
const LeadFormDropdownField = /*#__PURE__*/Object.freeze({
|
|
16047
|
+
__proto__: null,
|
|
16048
|
+
'default': LeadFormDropdownField_stories,
|
|
16049
|
+
Default: Default$t,
|
|
16050
|
+
WithError: WithError$1,
|
|
16051
|
+
Disabled: Disabled$3,
|
|
16052
|
+
Loading: Loading$d,
|
|
16053
|
+
WithInitialValue: WithInitialValue$1
|
|
16054
|
+
});
|
|
16055
|
+
|
|
15941
16056
|
/**
|
|
15942
16057
|
*
|
|
15943
16058
|
* Themes
|
|
@@ -15950,7 +16065,7 @@ const LeadForm = /*#__PURE__*/Object.freeze({
|
|
|
15950
16065
|
*
|
|
15951
16066
|
*/
|
|
15952
16067
|
//
|
|
15953
|
-
const Default$
|
|
16068
|
+
const Default$u = `
|
|
15954
16069
|
// No CSS
|
|
15955
16070
|
`;
|
|
15956
16071
|
const Orangey = `
|
|
@@ -15984,7 +16099,7 @@ const Klip = `
|
|
|
15984
16099
|
|
|
15985
16100
|
const Themes = /*#__PURE__*/Object.freeze({
|
|
15986
16101
|
__proto__: null,
|
|
15987
|
-
Default: Default$
|
|
16102
|
+
Default: Default$u,
|
|
15988
16103
|
Orangey: Orangey,
|
|
15989
16104
|
Netflix: Netflix,
|
|
15990
16105
|
SaaSquatchCorporate: SaaSquatchCorporate,
|
|
@@ -18676,6 +18791,8 @@ const stories = [
|
|
|
18676
18791
|
PayoutStatusAlert,
|
|
18677
18792
|
QRCode,
|
|
18678
18793
|
LeadForm,
|
|
18794
|
+
LeadInputField,
|
|
18795
|
+
LeadFormDropdownField,
|
|
18679
18796
|
];
|
|
18680
18797
|
const StencilStorybook = class {
|
|
18681
18798
|
constructor(hostRef) {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { h } from './index-91e7729f.js';
|
|
2
|
+
import { k as useState, y } from './stencil-hooks.module-4bc38af4.js';
|
|
3
|
+
import { i as intl } from './global-be1f9992.js';
|
|
4
|
+
import { _ } from './index.module-89a79f66.js';
|
|
5
|
+
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
6
|
+
|
|
7
|
+
const style = {
|
|
8
|
+
IconStyle: {
|
|
9
|
+
display: "block",
|
|
10
|
+
position: "absolute",
|
|
11
|
+
top: "23px",
|
|
12
|
+
},
|
|
13
|
+
DivStyle: {
|
|
14
|
+
marginLeft: "28px",
|
|
15
|
+
},
|
|
16
|
+
Details: {
|
|
17
|
+
marginLeft: "28px",
|
|
18
|
+
},
|
|
19
|
+
Heading: {
|
|
20
|
+
display: "inline-block",
|
|
21
|
+
},
|
|
22
|
+
Children: {
|
|
23
|
+
display: "none",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const sheet = createStyleSheet(style);
|
|
27
|
+
const styleString = sheet.toString();
|
|
28
|
+
function RequiredPropsError({ missingProps, heading = "There was a problem loading this section", subheading = "There was a technical problem that prevented this section from loading. Please contact us with the link to this page.", description = "Error occured while loading <{tagName}>. Values for the following attributes are missing:", }, children) {
|
|
29
|
+
if (!missingProps)
|
|
30
|
+
return false;
|
|
31
|
+
const host = _();
|
|
32
|
+
const [detailsOpen, setDetailsOpen] = useState(false);
|
|
33
|
+
return (h("sl-alert", { type: "danger", open: true },
|
|
34
|
+
h("style", { type: "text/css" }, styleString),
|
|
35
|
+
h("div", { slot: "icon", class: sheet.classes.IconStyle },
|
|
36
|
+
h("sl-icon", { name: "exclamation-octagon" })),
|
|
37
|
+
h("div", { class: sheet.classes.DivStyle },
|
|
38
|
+
h("h2", { class: sheet.classes.Heading }, intl.formatMessage({
|
|
39
|
+
id: `error-heading`,
|
|
40
|
+
defaultMessage: heading,
|
|
41
|
+
})),
|
|
42
|
+
h("p", null, intl.formatMessage({
|
|
43
|
+
id: `error-subheading`,
|
|
44
|
+
defaultMessage: subheading,
|
|
45
|
+
}))),
|
|
46
|
+
h("details", { class: sheet.classes.Details },
|
|
47
|
+
h("summary", { onClick: () => setDetailsOpen(!detailsOpen) },
|
|
48
|
+
detailsOpen ? "Less" : "More",
|
|
49
|
+
" details"),
|
|
50
|
+
h("p", null, intl.formatMessage({
|
|
51
|
+
id: `error-description`,
|
|
52
|
+
defaultMessage: description,
|
|
53
|
+
}, { tagName: host.tagName.toLowerCase() })),
|
|
54
|
+
h("ul", null, missingProps.map((prop) => (h("li", null,
|
|
55
|
+
h("strong", null, prop.attribute)))))),
|
|
56
|
+
h("div", { class: sheet.classes.Children }, children)));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const LEAD_FORM_STATE_CONTEXT = "sq:lead-form-state";
|
|
60
|
+
const LEAD_FORM_STATE_CONTEXT_INTERNAL = "sq:lead-form-state-internal";
|
|
61
|
+
function useLeadFormState(formState) {
|
|
62
|
+
const host = _();
|
|
63
|
+
const [leadFormState, setLeadFormState] = y(host, LEAD_FORM_STATE_CONTEXT, formState);
|
|
64
|
+
y(host, LEAD_FORM_STATE_CONTEXT_INTERNAL, [leadFormState, setLeadFormState]);
|
|
65
|
+
return { leadFormState, setLeadFormState };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { LEAD_FORM_STATE_CONTEXT as L, RequiredPropsError as R, useLeadFormState as u };
|