@saasquatch/mint-components 1.14.6-8 → 1.14.6
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-d1dda2b0.js → ShadowViewAddon-3c344355.js} +116 -49
- 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 → sqm-big-stat_43.cjs.entry.js} +119 -25
- package/dist/cjs/{sqm-lead-input-field-view-6344cd93.js → sqm-lead-input-field-view-89308aab.js} +7 -7
- package/dist/cjs/sqm-lead-input-field.cjs.entry.js +6 -2
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +17 -10
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field-view.js +1 -1
- package/dist/collection/components/sqm-lead-form/LeadForm.stories.js +5 -2
- package/dist/collection/components/sqm-lead-form/LeadFormDropdownField.stories.js +3 -0
- package/dist/collection/components/sqm-lead-form/LeadInputField.stories.js +1 -0
- package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field-view.js +10 -10
- package/dist/collection/components/sqm-lead-form/sqm-lead-dropdown-field.js +57 -5
- package/dist/collection/components/sqm-lead-form/sqm-lead-form-view.js +55 -51
- package/dist/collection/components/sqm-lead-form/sqm-lead-form.js +65 -35
- package/dist/collection/components/sqm-lead-form/sqm-lead-input-field-view.js +7 -7
- package/dist/collection/components/sqm-lead-form/sqm-lead-input-field.js +28 -5
- package/dist/collection/components/sqm-lead-form/useLeadForm.js +16 -10
- package/dist/esm/{ShadowViewAddon-81771102.js → ShadowViewAddon-64194d20.js} +117 -51
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/{sqm-big-stat_42.entry.js → sqm-big-stat_43.entry.js} +119 -26
- package/dist/esm/{sqm-lead-input-field-view-f1dd4b77.js → sqm-lead-input-field-view-4ede5d7f.js} +7 -7
- package/dist/esm/sqm-lead-input-field.entry.js +6 -2
- package/dist/esm/sqm-stencilbook.entry.js +12 -5
- package/dist/esm-es5/ShadowViewAddon-64194d20.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -0
- package/dist/esm-es5/sqm-lead-input-field-view-4ede5d7f.js +1 -0
- package/dist/esm-es5/sqm-lead-input-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-01dd541f.system.js +1 -0
- package/dist/mint-components/{p-cbfa7a11.entry.js → p-0a4f1306.entry.js} +21 -21
- package/dist/mint-components/p-0d94d81a.system.js +1 -0
- package/dist/mint-components/{p-460974bf.js → p-30a11ec0.js} +24 -24
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/p-6ba44ca9.js +1 -0
- package/dist/mint-components/p-74fdf750.system.entry.js +1 -0
- package/dist/mint-components/p-d3e72503.entry.js +1 -0
- package/dist/mint-components/p-eaf1a8a6.system.entry.js +1 -0
- package/dist/mint-components/{p-ba585a4b.entry.js → p-f60d1ae9.entry.js} +2 -2
- package/dist/mint-components/p-fbbb85f0.system.entry.js +1 -0
- package/dist/types/components/sqm-lead-form/LeadFormDropdownField.stories.d.ts +1 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field-view.d.ts +3 -1
- package/dist/types/components/sqm-lead-form/sqm-lead-dropdown-field.d.ts +11 -4
- package/dist/types/components/sqm-lead-form/sqm-lead-form-view.d.ts +2 -1
- package/dist/types/components/sqm-lead-form/sqm-lead-form.d.ts +19 -10
- package/dist/types/components/sqm-lead-form/sqm-lead-input-field-view.d.ts +1 -0
- package/dist/types/components/sqm-lead-form/sqm-lead-input-field.d.ts +4 -2
- package/dist/types/components/sqm-lead-form/useLeadForm.d.ts +1 -0
- package/dist/types/components/sqm-referral-iframe/useReferralIframe.d.ts +1 -1
- package/dist/types/components.d.ts +63 -19
- 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/cjs/sqm-lead-dropdown-field-view-03a3e03f.js +0 -69
- package/dist/cjs/sqm-lead-dropdown-field.cjs.entry.js +0 -81
- package/dist/esm/sqm-lead-dropdown-field-view-4c85fe20.js +0 -67
- package/dist/esm/sqm-lead-dropdown-field.entry.js +0 -77
- package/dist/esm-es5/ShadowViewAddon-81771102.js +0 -1
- package/dist/esm-es5/sqm-big-stat_42.entry.js +0 -1
- package/dist/esm-es5/sqm-lead-dropdown-field-view-4c85fe20.js +0 -1
- package/dist/esm-es5/sqm-lead-dropdown-field.entry.js +0 -1
- package/dist/esm-es5/sqm-lead-input-field-view-f1dd4b77.js +0 -1
- package/dist/mint-components/p-15f1ff1d.system.js +0 -1
- package/dist/mint-components/p-26da31c6.js +0 -1
- package/dist/mint-components/p-4056c0ea.system.entry.js +0 -1
- package/dist/mint-components/p-4d5b02af.js +0 -1
- package/dist/mint-components/p-59970cb1.system.entry.js +0 -1
- package/dist/mint-components/p-6b093d8c.entry.js +0 -1
- package/dist/mint-components/p-732849d6.system.entry.js +0 -1
- package/dist/mint-components/p-87384d9e.system.js +0 -1
- package/dist/mint-components/p-ad128614.system.js +0 -1
- package/dist/mint-components/p-c5a55554.entry.js +0 -1
- package/dist/mint-components/p-de5356d9.system.entry.js +0 -1
|
@@ -15,13 +15,13 @@ import './luxon-8d51c92b.js';
|
|
|
15
15
|
import './sqm-text-span-view-ca32495e.js';
|
|
16
16
|
import { p as pathToRegexp } from './index-ffa26b43.js';
|
|
17
17
|
import { R as REGISTRATION_FORM_STATE_CONTEXT, u as useRegistrationFormState } from './useRegistrationFormState-d6f33135.js';
|
|
18
|
-
import { R as RequiredPropsError, u as useLeadFormState } from './useLeadFormState-9016d812.js';
|
|
19
18
|
import { P as PortalLoginView } from './sqm-portal-login-view-7e49609a.js';
|
|
20
19
|
import { u as usePortalLogin } from './usePortalLogin-ef647a50.js';
|
|
21
20
|
import { A as AsYouType } from './AsYouType-46f67d0d.js';
|
|
22
21
|
import { i as isEmpty } from './utilities-5b0ca040.js';
|
|
23
|
-
import { b as useDemoBigStat,
|
|
22
|
+
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-64194d20.js';
|
|
24
23
|
import './sqm-portal-container-view-1683ae32.js';
|
|
24
|
+
import { R as RequiredPropsError, L as LEAD_FORM_STATE_CONTEXT, u as useLeadFormState } from './useLeadFormState-9016d812.js';
|
|
25
25
|
import { u as usePayoutStatus } from './usePayoutStatus-fed17fc9.js';
|
|
26
26
|
|
|
27
27
|
const BigStat = class {
|
|
@@ -1289,6 +1289,81 @@ function useInputFieldDemo(props) {
|
|
|
1289
1289
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
1290
1290
|
}
|
|
1291
1291
|
|
|
1292
|
+
function useLeadDropdownField() {
|
|
1293
|
+
const leadFormState = d(LEAD_FORM_STATE_CONTEXT);
|
|
1294
|
+
return {
|
|
1295
|
+
states: {
|
|
1296
|
+
leadFormState,
|
|
1297
|
+
},
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
const LeadDropdownField = class {
|
|
1302
|
+
constructor(hostRef) {
|
|
1303
|
+
registerInstance(this, hostRef);
|
|
1304
|
+
this.ignored = true;
|
|
1305
|
+
/**
|
|
1306
|
+
* @uiName Dropdown label
|
|
1307
|
+
*/
|
|
1308
|
+
this.dropdownLabel = "Select an option";
|
|
1309
|
+
/**
|
|
1310
|
+
* The message to be displayed when a required field is not filled.
|
|
1311
|
+
*
|
|
1312
|
+
* @uiName Required field message
|
|
1313
|
+
* @uiWidget textArea
|
|
1314
|
+
*/
|
|
1315
|
+
this.requiredFieldErrorMessage = "Please select a {dropdownLabel}";
|
|
1316
|
+
/**
|
|
1317
|
+
* @uiName Optional label
|
|
1318
|
+
*/
|
|
1319
|
+
this.optionalLabel = "(optional)";
|
|
1320
|
+
/**
|
|
1321
|
+
* @uiName Optional
|
|
1322
|
+
* @default
|
|
1323
|
+
*/
|
|
1324
|
+
this.dropdownOptional = false;
|
|
1325
|
+
/**
|
|
1326
|
+
* @uiName Multiple selection
|
|
1327
|
+
* @default
|
|
1328
|
+
*/
|
|
1329
|
+
this.multiple = false;
|
|
1330
|
+
h(this);
|
|
1331
|
+
}
|
|
1332
|
+
disconnectedCallback() { }
|
|
1333
|
+
render() {
|
|
1334
|
+
const missingProps = getMissingProps([
|
|
1335
|
+
{
|
|
1336
|
+
attribute: "dropdown-name",
|
|
1337
|
+
value: this.dropdownName,
|
|
1338
|
+
},
|
|
1339
|
+
]);
|
|
1340
|
+
if (!isDemo() && missingProps) {
|
|
1341
|
+
return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this drop down field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }, h$1("slot", null)));
|
|
1342
|
+
}
|
|
1343
|
+
const content = {
|
|
1344
|
+
...getProps(this),
|
|
1345
|
+
selectOptions: h$1("slot", null),
|
|
1346
|
+
};
|
|
1347
|
+
const { states } = isDemo()
|
|
1348
|
+
? useLeadDropdownFieldDemo(this)
|
|
1349
|
+
: useLeadDropdownField();
|
|
1350
|
+
return (h$1(LeadDropdownFieldView, { states: states, content: content }));
|
|
1351
|
+
}
|
|
1352
|
+
};
|
|
1353
|
+
function useLeadDropdownFieldDemo(props) {
|
|
1354
|
+
return cjs({
|
|
1355
|
+
states: {
|
|
1356
|
+
leadFormState: {},
|
|
1357
|
+
},
|
|
1358
|
+
content: {
|
|
1359
|
+
dropdownName: props.dropdownName,
|
|
1360
|
+
dropdownLabel: props.dropdownLabel,
|
|
1361
|
+
requiredFieldErrorMessage: props.requiredFieldErrorMessage,
|
|
1362
|
+
dropdownOptional: props.dropdownOptional,
|
|
1363
|
+
},
|
|
1364
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1292
1367
|
const SUBMIT_LEAD = dist.gql `
|
|
1293
1368
|
mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
|
|
1294
1369
|
submitForm(formSubmissionInput: $formSubmissionInput) {
|
|
@@ -1312,7 +1387,6 @@ function useLeadForm(props) {
|
|
|
1312
1387
|
const programId = H();
|
|
1313
1388
|
const user = J();
|
|
1314
1389
|
const { data: userDetails } = wn(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
|
|
1315
|
-
console.log({ userDetails });
|
|
1316
1390
|
const [submitLead, { loading, errors, data }] = $e(SUBMIT_LEAD);
|
|
1317
1391
|
const [success, setSuccess] = useState(false);
|
|
1318
1392
|
useEffect(() => {
|
|
@@ -1325,7 +1399,7 @@ function useLeadForm(props) {
|
|
|
1325
1399
|
};
|
|
1326
1400
|
}, [formRef.current]);
|
|
1327
1401
|
const submit = async (event) => {
|
|
1328
|
-
var _a
|
|
1402
|
+
var _a;
|
|
1329
1403
|
let formControls = event.target.getFormControls();
|
|
1330
1404
|
let formData = {};
|
|
1331
1405
|
let validationErrors = {};
|
|
@@ -1357,17 +1431,12 @@ function useLeadForm(props) {
|
|
|
1357
1431
|
error: "",
|
|
1358
1432
|
validationErrors: {},
|
|
1359
1433
|
});
|
|
1360
|
-
formData = { ...formData };
|
|
1361
1434
|
const variables = {
|
|
1362
1435
|
key: props.formKey,
|
|
1363
1436
|
formData,
|
|
1364
1437
|
};
|
|
1365
|
-
const result = await submitLead({ formSubmissionInput: variables });
|
|
1366
1438
|
try {
|
|
1367
|
-
|
|
1368
|
-
success: result.data.submitForm.success,
|
|
1369
|
-
isError: result instanceof Error,
|
|
1370
|
-
});
|
|
1439
|
+
const result = await submitLead({ formSubmissionInput: variables });
|
|
1371
1440
|
if (result instanceof Error) {
|
|
1372
1441
|
throw result;
|
|
1373
1442
|
}
|
|
@@ -1376,7 +1445,7 @@ function useLeadForm(props) {
|
|
|
1376
1445
|
error: "",
|
|
1377
1446
|
validationErrors: {},
|
|
1378
1447
|
});
|
|
1379
|
-
if ((
|
|
1448
|
+
if ((_a = result === null || result === void 0 ? void 0 : result.submitForm) === null || _a === void 0 ? void 0 : _a.success) {
|
|
1380
1449
|
setSuccess(true);
|
|
1381
1450
|
}
|
|
1382
1451
|
}
|
|
@@ -1396,6 +1465,18 @@ function useLeadForm(props) {
|
|
|
1396
1465
|
const asYouType = new AsYouType("US");
|
|
1397
1466
|
e.target.value = asYouType.input(e.target.value);
|
|
1398
1467
|
}, []);
|
|
1468
|
+
function resetForm() {
|
|
1469
|
+
var _a, _b;
|
|
1470
|
+
setLeadFormState({
|
|
1471
|
+
loading: false,
|
|
1472
|
+
error: "",
|
|
1473
|
+
validationErrors: {},
|
|
1474
|
+
});
|
|
1475
|
+
(_b = (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.getFormControls()) === null || _b === void 0 ? void 0 : _b.forEach((c) => {
|
|
1476
|
+
c.value = "";
|
|
1477
|
+
});
|
|
1478
|
+
setSuccess(false);
|
|
1479
|
+
}
|
|
1399
1480
|
let errorMessage = "";
|
|
1400
1481
|
if ((_a = errors === null || errors === void 0 ? void 0 : errors.response) === null || _a === void 0 ? void 0 : _a["error"]) {
|
|
1401
1482
|
errorMessage = props.networkErrorMessage;
|
|
@@ -1407,7 +1488,6 @@ function useLeadForm(props) {
|
|
|
1407
1488
|
errorMessage =
|
|
1408
1489
|
((_f = (_e = (_d = (_c = errors === null || errors === void 0 ? void 0 : errors.response) === null || _c === void 0 ? void 0 : _c.errors) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.extensions) === null || _f === void 0 ? void 0 : _f.message) || ((_j = (_h = (_g = errors === null || errors === void 0 ? void 0 : errors.response) === null || _g === void 0 ? void 0 : _g.errors) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.message) || (leadFormState === null || leadFormState === void 0 ? void 0 : leadFormState.error);
|
|
1409
1490
|
}
|
|
1410
|
-
console.log({ errors, errorMessage });
|
|
1411
1491
|
return {
|
|
1412
1492
|
states: {
|
|
1413
1493
|
loading,
|
|
@@ -1419,6 +1499,7 @@ function useLeadForm(props) {
|
|
|
1419
1499
|
callbacks: {
|
|
1420
1500
|
submit,
|
|
1421
1501
|
inputFunction,
|
|
1502
|
+
resetForm,
|
|
1422
1503
|
},
|
|
1423
1504
|
refs: {
|
|
1424
1505
|
formRef,
|
|
@@ -1437,11 +1518,11 @@ const LeadForm = class {
|
|
|
1437
1518
|
/**
|
|
1438
1519
|
* @uiName First Name field label
|
|
1439
1520
|
*/
|
|
1440
|
-
this.firstNameLabel = "First
|
|
1521
|
+
this.firstNameLabel = "First name";
|
|
1441
1522
|
/**
|
|
1442
1523
|
* @uiName Last Name field label
|
|
1443
1524
|
*/
|
|
1444
|
-
this.lastNameLabel = "Last
|
|
1525
|
+
this.lastNameLabel = "Last name";
|
|
1445
1526
|
/**
|
|
1446
1527
|
* @uiName Submit button text
|
|
1447
1528
|
*/
|
|
@@ -1454,43 +1535,52 @@ const LeadForm = class {
|
|
|
1454
1535
|
* @uiName Header text
|
|
1455
1536
|
*/
|
|
1456
1537
|
this.pageLabel = "Refer your friend";
|
|
1538
|
+
/**
|
|
1539
|
+
* Key of the form to connect to. Create and manage forms in the /advocate dashboard under Data > Forms.
|
|
1540
|
+
* @uiName Form key
|
|
1541
|
+
*/
|
|
1457
1542
|
this.formKey = "lead-form";
|
|
1458
1543
|
/**
|
|
1459
|
-
* Optional support link for error messages.
|
|
1544
|
+
* Optional support link text for error messages.
|
|
1545
|
+
* @uiName Support link text
|
|
1460
1546
|
*/
|
|
1461
|
-
this.
|
|
1547
|
+
this.supportLinkText = "Support";
|
|
1462
1548
|
/**
|
|
1463
|
-
* Header text shown on successful submission.
|
|
1549
|
+
* Header text shown on successful lead submission.
|
|
1550
|
+
* @uiName Submit success header
|
|
1464
1551
|
*/
|
|
1465
|
-
this.submitSuccessHeader = "
|
|
1552
|
+
this.submitSuccessHeader = "Lead submitted";
|
|
1466
1553
|
/**
|
|
1467
|
-
* Description text shown on successful submission.
|
|
1554
|
+
* Description text shown on successful lead submission.
|
|
1555
|
+
* @uiName Submit success description
|
|
1468
1556
|
*/
|
|
1469
1557
|
this.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.";
|
|
1470
1558
|
/**
|
|
1471
|
-
*
|
|
1559
|
+
* Header text shown if an error occurs.
|
|
1560
|
+
* @uiName Submit error header
|
|
1472
1561
|
*/
|
|
1473
1562
|
this.submitErrorHeader = "An error occurred while submitting";
|
|
1474
1563
|
/**
|
|
1475
|
-
* Description text shown
|
|
1564
|
+
* Description text shown if an error occurs.
|
|
1565
|
+
* @uiName Submit error description
|
|
1476
1566
|
*/
|
|
1477
1567
|
this.submitErrorDescription = "Please try again later. If the problem continues, contact {supportLink}";
|
|
1478
1568
|
/**
|
|
1479
|
-
* The message to be displayed
|
|
1569
|
+
* The message to be displayed if a required field is not filled.
|
|
1480
1570
|
*
|
|
1481
1571
|
* @uiName Required field message
|
|
1482
1572
|
* @uiWidget textArea
|
|
1483
1573
|
*/
|
|
1484
1574
|
this.requiredFieldErrorMessage = "Please enter a valid {fieldLabel}";
|
|
1485
1575
|
/**
|
|
1486
|
-
* The message to be displayed
|
|
1576
|
+
* The message to be displayed if a the form submission fails unexpectedly.
|
|
1487
1577
|
*
|
|
1488
1578
|
* @uiName Network error message
|
|
1489
1579
|
* @uiWidget textArea
|
|
1490
1580
|
*/
|
|
1491
1581
|
this.networkErrorMessage = "Network request failed.";
|
|
1492
1582
|
/**
|
|
1493
|
-
* The message to be displayed
|
|
1583
|
+
* The message to be displayed if the email used is invalid.
|
|
1494
1584
|
*
|
|
1495
1585
|
* @uiName Invalid email message
|
|
1496
1586
|
* @uiWidget textArea
|
|
@@ -1509,13 +1599,15 @@ const LeadForm = class {
|
|
|
1509
1599
|
submitLabel: this.submitLabel,
|
|
1510
1600
|
resubmitFormLabel: this.resubmitFormLabel,
|
|
1511
1601
|
pageLabel: this.pageLabel,
|
|
1512
|
-
|
|
1602
|
+
supportLinkText: this.supportLinkText,
|
|
1513
1603
|
submitSuccessHeader: this.submitSuccessHeader,
|
|
1514
1604
|
submitSuccessDescription: this.submitSuccessDescription,
|
|
1515
1605
|
submitErrorHeader: this.submitErrorHeader,
|
|
1516
1606
|
submitErrorDescription: this.submitErrorDescription,
|
|
1517
1607
|
invalidEmailErrorMessage: this.invalidEmailErrorMessage,
|
|
1518
1608
|
requiredFieldErrorMessage: this.requiredFieldErrorMessage,
|
|
1609
|
+
firstNameLabel: this.firstNameLabel,
|
|
1610
|
+
lastNameLabel: this.lastNameLabel,
|
|
1519
1611
|
};
|
|
1520
1612
|
return (h$1(LeadFormView, { states: states, callbacks: callbacks, content: content, refs: refs }));
|
|
1521
1613
|
}
|
|
@@ -1532,6 +1624,7 @@ function useRegisterDemo(props) {
|
|
|
1532
1624
|
console.log("submit");
|
|
1533
1625
|
},
|
|
1534
1626
|
inputFunction: () => { },
|
|
1627
|
+
resetForm: () => { },
|
|
1535
1628
|
},
|
|
1536
1629
|
refs: {
|
|
1537
1630
|
formRef: {},
|
|
@@ -5383,4 +5476,4 @@ function useUserNameDemo(props) {
|
|
|
5383
5476
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
5384
5477
|
}
|
|
5385
5478
|
|
|
5386
|
-
export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, LeadForm as sqm_lead_form, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, MarketingEmailsCheckbox as sqm_marketing_emails_checkbox, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangeMarketing as sqm_portal_change_marketing, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
|
|
5479
|
+
export { BigStat as sqm_big_stat, BrandComponent as sqm_brand, CardFeed as sqm_card_feed, CheckboxField as sqm_checkbox_field, CouponCode as sqm_coupon_code, DividedLayout as sqm_divided_layout, DropdownField as sqm_dropdown_field, EditProfile as sqm_edit_profile, Hero as sqm_hero, HeroImage as sqm_hero_image, SqmHookStoryContainer as sqm_hook_story_container, Image as sqm_image, InputField as sqm_input_field, LeadDropdownField as sqm_lead_dropdown_field, LeadForm as sqm_lead_form, Leaderboard as sqm_leaderboard, LinkButton as sqm_link_button, MarketingEmailsCheckbox as sqm_marketing_emails_checkbox, NameFields as sqm_name_fields, NavigationMenu as sqm_navigation_menu, PayoutButtonScroll as sqm_payout_button_scroll, PayoutStatusAlert as sqm_payout_status_alert, PortalChangeMarketing as sqm_portal_change_marketing, PortalChangePassword as sqm_portal_change_password, PortalFooter as sqm_portal_footer, PortalFrame as sqm_portal_frame, PortalLogin as sqm_portal_login, PortalRegister as sqm_portal_register, ProgramExplainer as sqm_program_explainer, ProgramExplainerStep as sqm_program_explainer_step, ProgramMenu as sqm_program_menu, ReferralCard as sqm_referral_card, SqmReferralIframe as sqm_referral_iframe, SqmRewardExchangeList as sqm_reward_exchange_list, SqmRouter as sqm_router, ShareButton as sqm_share_button, ShareCode as sqm_share_code, ShareLink as sqm_share_link, StatContainer as sqm_stat_container, TaskCard as sqm_task_card, Timeline as sqm_timeline, TimelineReward as sqm_timeline_entry, UserName as sqm_user_name };
|
package/dist/esm/{sqm-lead-input-field-view-f1dd4b77.js → sqm-lead-input-field-view-4ede5d7f.js}
RENAMED
|
@@ -6,7 +6,7 @@ import { E as ErrorStyles } from './mixins-83f90fa1.js';
|
|
|
6
6
|
const style = {
|
|
7
7
|
ErrorStyle: ErrorStyles,
|
|
8
8
|
FieldContainer: {
|
|
9
|
-
"margin-bottom": "var(--sl-spacing-
|
|
9
|
+
"margin-bottom": "var(--sl-spacing-medium)",
|
|
10
10
|
},
|
|
11
11
|
};
|
|
12
12
|
const vanillaStyle = `
|
|
@@ -23,24 +23,24 @@ function LeadInputFieldView(props) {
|
|
|
23
23
|
var _a, _b, _c, _d, _e, _f;
|
|
24
24
|
const { states, content } = props;
|
|
25
25
|
const getRequiredFieldErrorMessage = ({ fieldLabel, }) => intl.formatMessage({
|
|
26
|
-
id:
|
|
26
|
+
id: `requiredFieldErrorMessage-${fieldLabel}`,
|
|
27
27
|
defaultMessage: content.requiredFieldErrorMessage,
|
|
28
28
|
}, {
|
|
29
29
|
fieldLabel,
|
|
30
30
|
});
|
|
31
|
-
return (h("div", { part: "sqm-base" },
|
|
31
|
+
return (h("div", { class: sheet.classes.FieldContainer, part: "sqm-base" },
|
|
32
32
|
h("style", { type: "text/css" },
|
|
33
33
|
vanillaStyle,
|
|
34
34
|
styleString),
|
|
35
|
-
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.fieldName}`, type: content.fieldType, label: content.fieldLabel }, (!content.fieldOptional ? { required: true } : []), { disabled: ((_a = states.leadFormState) === null || _a === void 0 ? void 0 : _a.loading) || ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.disabled), validationError: ({ value }) => {
|
|
36
|
-
if (!value) {
|
|
35
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", name: `/${content.fieldName}`, type: content.fieldType, label: `${content.fieldLabel}${content.fieldOptional ? ` ${content.optionalLabel}` : ""}` }, (!content.fieldOptional ? { required: true } : []), { disabled: ((_a = states.leadFormState) === null || _a === void 0 ? void 0 : _a.loading) || ((_b = states.leadFormState) === null || _b === void 0 ? void 0 : _b.disabled), validationError: ({ value }) => {
|
|
36
|
+
if (!value && !content.fieldOptional) {
|
|
37
37
|
return getRequiredFieldErrorMessage({
|
|
38
38
|
fieldLabel: content.fieldLabel,
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
} }, (((_d = (_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d.
|
|
41
|
+
} }, (((_d = (_c = states.leadFormState) === null || _c === void 0 ? void 0 : _c.validationErrors) === null || _d === void 0 ? void 0 : _d[content.fieldName]) ? {
|
|
42
42
|
class: sheet.classes.ErrorStyle,
|
|
43
|
-
helpText: ((_f = (_e = states.leadFormState) === null || _e === void 0 ? void 0 : _e.validationErrors) === null || _f === void 0 ? void 0 : _f.
|
|
43
|
+
helpText: ((_f = (_e = states.leadFormState) === null || _e === void 0 ? void 0 : _e.validationErrors) === null || _f === void 0 ? void 0 : _f[content.fieldName]) ||
|
|
44
44
|
content.requiredFieldErrorMessage,
|
|
45
45
|
}
|
|
46
46
|
: [])))));
|
|
@@ -6,8 +6,8 @@ import { c as cjs } from './cjs-bdfb4486.js';
|
|
|
6
6
|
import { g as getProps, a as getMissingProps } from './utils-334c1e34.js';
|
|
7
7
|
import './JSS-67b5cff8.js';
|
|
8
8
|
import './mixins-83f90fa1.js';
|
|
9
|
+
import { L as LeadInputFieldView } from './sqm-lead-input-field-view-4ede5d7f.js';
|
|
9
10
|
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
11
|
|
|
12
12
|
function useLeadInputField() {
|
|
13
13
|
const leadFormState = d(LEAD_FORM_STATE_CONTEXT);
|
|
@@ -22,6 +22,10 @@ const LeadInputField = class {
|
|
|
22
22
|
constructor(hostRef) {
|
|
23
23
|
registerInstance(this, hostRef);
|
|
24
24
|
this.ignored = true;
|
|
25
|
+
/**
|
|
26
|
+
* @uiName Optional label
|
|
27
|
+
*/
|
|
28
|
+
this.optionalLabel = "(optional)";
|
|
25
29
|
/**
|
|
26
30
|
* @uiName Input type
|
|
27
31
|
* @uiType string
|
|
@@ -35,7 +39,7 @@ const LeadInputField = class {
|
|
|
35
39
|
* @uiName Required field message
|
|
36
40
|
* @uiWidget textArea
|
|
37
41
|
*/
|
|
38
|
-
this.requiredFieldErrorMessage = "Please enter a {
|
|
42
|
+
this.requiredFieldErrorMessage = "Please enter a {fieldLabel}";
|
|
39
43
|
/**
|
|
40
44
|
* @uiName Optional
|
|
41
45
|
* @default
|
|
@@ -16,7 +16,6 @@ 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';
|
|
20
19
|
import { L as LeaderboardRankView } from './sqm-leaderboard-rank-view-753c8d4a.js';
|
|
21
20
|
import { L as LogoutCurrentUserView } from './sqm-logout-current-user-view-8ef8180f.js';
|
|
22
21
|
import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-9d802b78.js';
|
|
@@ -32,10 +31,10 @@ import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-5
|
|
|
32
31
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-b12cb894.js';
|
|
33
32
|
import './ErrorView-48e2b969.js';
|
|
34
33
|
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
|
|
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 LeadDropdownFieldView, U as autoColorScaleCss, V as ShadowViewAddon } from './ShadowViewAddon-64194d20.js';
|
|
36
35
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-1683ae32.js';
|
|
37
36
|
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-
|
|
37
|
+
import { L as LeadInputFieldView } from './sqm-lead-input-field-view-4ede5d7f.js';
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
40
|
* lodash (Custom Build) <https://lodash.com/>
|
|
@@ -15843,6 +15842,7 @@ const defaultProps$t = {
|
|
|
15843
15842
|
callbacks: {
|
|
15844
15843
|
submit: () => console.log("Submit!"),
|
|
15845
15844
|
inputFunction: () => { },
|
|
15845
|
+
resetForm: () => { },
|
|
15846
15846
|
},
|
|
15847
15847
|
refs: {
|
|
15848
15848
|
formRef: {},
|
|
@@ -15897,8 +15897,10 @@ const slottedProps$2 = {
|
|
|
15897
15897
|
content: {
|
|
15898
15898
|
...defaultProps$t.content,
|
|
15899
15899
|
formData: (h("div", null,
|
|
15900
|
-
h("
|
|
15901
|
-
h("
|
|
15900
|
+
h("sqm-lead-input-field", { "field-name": "firstName", "field-label": "First Name", "field-type": "text", "required-field-error-message": "Please enter a first name" }),
|
|
15901
|
+
h("sqm-lead-input-field", { "field-name": "lastName", "field-label": "Last Name", "field-type": "text", "required-field-error-message": "Please enter a last name" }),
|
|
15902
|
+
h("sqm-lead-input-field", { "field-name": "email", "field-label": "Email", "field-type": "email", "required-field-error-message": "Please enter a valid email address" }),
|
|
15903
|
+
h("sqm-lead-dropdown-field", null))),
|
|
15902
15904
|
},
|
|
15903
15905
|
};
|
|
15904
15906
|
const Default$r = () => h(LeadFormView, Object.assign({}, defaultProps$t));
|
|
@@ -15945,6 +15947,7 @@ const defaultProps$u = {
|
|
|
15945
15947
|
fieldName: "firstName",
|
|
15946
15948
|
fieldLabel: "First Name",
|
|
15947
15949
|
fieldType: "text",
|
|
15950
|
+
optionalLabel: "(Optional)",
|
|
15948
15951
|
requiredFieldErrorMessage: "Please {fieldAction} a {fieldLabel}",
|
|
15949
15952
|
fieldOptional: false,
|
|
15950
15953
|
},
|
|
@@ -16001,7 +16004,9 @@ const defaultProps$v = {
|
|
|
16001
16004
|
dropdownName: "country",
|
|
16002
16005
|
dropdownLabel: "Country",
|
|
16003
16006
|
requiredFieldErrorMessage: "Please select a country",
|
|
16007
|
+
optionalLabel: "(Optional)",
|
|
16004
16008
|
dropdownOptional: false,
|
|
16009
|
+
multiple: false,
|
|
16005
16010
|
selectOptions: [
|
|
16006
16011
|
h("sl-menu-item", { value: "red" }, "Canada"),
|
|
16007
16012
|
h("sl-menu-item", { value: "blue" }, "United States"),
|
|
@@ -16010,6 +16015,7 @@ const defaultProps$v = {
|
|
|
16010
16015
|
},
|
|
16011
16016
|
};
|
|
16012
16017
|
const Default$t = () => h(LeadDropdownFieldView, Object.assign({}, defaultProps$v));
|
|
16018
|
+
const Multiple = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { content: { ...defaultProps$v.content, multiple: true } })));
|
|
16013
16019
|
const WithError$1 = () => (h(LeadDropdownFieldView, Object.assign({}, defaultProps$v, { states: {
|
|
16014
16020
|
...defaultProps$v.states,
|
|
16015
16021
|
leadFormState: {
|
|
@@ -16047,6 +16053,7 @@ const LeadFormDropdownField = /*#__PURE__*/Object.freeze({
|
|
|
16047
16053
|
__proto__: null,
|
|
16048
16054
|
'default': LeadFormDropdownField_stories,
|
|
16049
16055
|
Default: Default$t,
|
|
16056
|
+
Multiple: Multiple,
|
|
16050
16057
|
WithError: WithError$1,
|
|
16051
16058
|
Disabled: Disabled$3,
|
|
16052
16059
|
Loading: Loading$d,
|