@saasquatch/mint-components 2.0.0-67 → 2.0.0-68
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-cd5c186c.js → ShadowViewAddon-1b38dcfc.js} +9 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/{sqm-base-registration-form-view-7b95ae7a.js → sqm-base-registration-form-view-69a4b615.js} +9 -4
- package/dist/cjs/sqm-big-stat_47.cjs.entry.js +10 -3
- package/dist/cjs/sqm-portal-google-registration-form.cjs.entry.js +25 -18
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +7 -4
- package/dist/collection/components/sqm-base-registration/BaseRegistrationForm.stories.js +2 -2
- package/dist/collection/components/sqm-base-registration/sqm-base-registration-form-view.js +9 -4
- package/dist/collection/components/sqm-big-stat/useBigStat.js +7 -1
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -1
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +1 -1
- package/dist/collection/components/sqm-input-field/sqm-input-field.js +1 -1
- package/dist/collection/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.js +1 -1
- package/dist/collection/components/sqm-name-fields/NameFields.stories.js +2 -0
- package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +2 -2
- package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +31 -1
- package/dist/collection/components/sqm-name-fields/useNameFields.js +1 -0
- package/dist/collection/components/sqm-password-field/sqm-password-field.js +2 -2
- package/dist/collection/components/sqm-portal-google-registration-form/PortalGoogleRegistrationForm.stories.js +1 -0
- package/dist/collection/components/sqm-portal-google-registration-form/sqm-portal-google-registration-form.js +4 -4
- package/dist/collection/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.js +22 -15
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +2 -2
- package/dist/esm/{ShadowViewAddon-11ffa85d.js → ShadowViewAddon-1adaf077.js} +9 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/{sqm-base-registration-form-view-1a6bb4b4.js → sqm-base-registration-form-view-9e97d8b4.js} +9 -4
- package/dist/esm/sqm-big-stat_47.entry.js +10 -3
- package/dist/esm/sqm-portal-google-registration-form.entry.js +25 -18
- package/dist/esm/sqm-stencilbook.entry.js +7 -4
- package/dist/esm-es5/{ShadowViewAddon-11ffa85d.js → ShadowViewAddon-1adaf077.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-base-registration-form-view-9e97d8b4.js +1 -0
- package/dist/esm-es5/sqm-big-stat_47.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-google-registration-form.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-e658929b.js → p-0e1a1b14.js} +3 -3
- package/dist/mint-components/{p-16ac4d4f.entry.js → p-31bba357.entry.js} +1 -1
- package/dist/mint-components/p-51a6a779.js +1 -0
- package/dist/mint-components/p-662ed116.system.entry.js +1 -0
- package/dist/mint-components/{p-4adf23e7.entry.js → p-720341b1.entry.js} +3 -3
- package/dist/mint-components/p-80569911.system.js +1 -0
- package/dist/mint-components/p-95b6e903.entry.js +1 -0
- package/dist/mint-components/p-967a9040.system.js +1 -1
- package/dist/mint-components/{p-b377570a.system.js → p-9f8d34d1.system.js} +1 -1
- package/dist/mint-components/p-d69c0a32.system.entry.js +1 -0
- package/dist/mint-components/p-fedb9ab8.system.entry.js +1 -0
- package/dist/types/components/sqm-base-registration/sqm-base-registration-form-view.d.ts +2 -1
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -1
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +1 -1
- package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +1 -1
- package/dist/types/components/sqm-marketing-emails-checkbox/sqm-marketing-emails-checkbox.d.ts +1 -1
- package/dist/types/components/sqm-name-fields/sqm-name-fields-view.d.ts +1 -0
- package/dist/types/components/sqm-name-fields/sqm-name-fields.d.ts +5 -0
- package/dist/types/components/sqm-name-fields/useNameFields.d.ts +1 -0
- package/dist/types/components/sqm-password-field/sqm-password-field.d.ts +1 -1
- package/dist/types/components/sqm-portal-google-registration-form/usePortalGoogleRegistrationForm.d.ts +2 -1
- package/dist/types/components.d.ts +10 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/sqm-base-registration-form-view-1a6bb4b4.js +0 -1
- package/dist/mint-components/p-1522a7d1.js +0 -1
- package/dist/mint-components/p-71a6e549.system.entry.js +0 -1
- package/dist/mint-components/p-b21c5311.system.js +0 -1
- package/dist/mint-components/p-c2ac14b7.entry.js +0 -1
- package/dist/mint-components/p-e9a596ad.system.entry.js +0 -1
- package/dist/mint-components/p-f66e02c7.system.entry.js +0 -1
- package/shoelace/assets/icons/twitter-x.svg +0 -4
|
@@ -7,7 +7,7 @@ import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
|
7
7
|
import './mixins-f750863a.js';
|
|
8
8
|
import './sqm-text-span-view-4c17b8c9.js';
|
|
9
9
|
import { a as useRegistrationForm } from './useRegistrationFormState-24d594ea.js';
|
|
10
|
-
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-
|
|
10
|
+
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-9e97d8b4.js';
|
|
11
11
|
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-8bdc3804.js';
|
|
12
12
|
import './AsYouType-46f67d0d.js';
|
|
13
13
|
import { u as usePortalRegistrationForm } from './usePortalRegistrationForm-1eb3cd72.js';
|
|
@@ -71,7 +71,6 @@ function jwtDecode(token, options) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
function usePortalGoogleRegistrationForm(props) {
|
|
74
|
-
const [emailValidationError, setEmailValidationError] = useState(null);
|
|
75
74
|
const [registrationFormState, setRegistrationFormState] = useRegistrationForm();
|
|
76
75
|
const [showRegistrationForm, setShowRegistrationForm] = useState({
|
|
77
76
|
mode: "base",
|
|
@@ -79,33 +78,40 @@ function usePortalGoogleRegistrationForm(props) {
|
|
|
79
78
|
const handleEmailSubmit = async (event) => {
|
|
80
79
|
const formControls = event.target.getFormControls();
|
|
81
80
|
let formData = {};
|
|
82
|
-
let
|
|
81
|
+
let validationErrors = {};
|
|
83
82
|
formControls.forEach((control) => {
|
|
84
83
|
if (!control.name)
|
|
85
84
|
return;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
const key = control.name;
|
|
86
|
+
const value = control.value;
|
|
87
|
+
jsonpointer.set(formData, key, value);
|
|
88
|
+
if (control.required && !value) {
|
|
89
|
+
jsonpointer.set(validationErrors, key, props.requiredFieldErrorMessage);
|
|
90
|
+
}
|
|
92
91
|
if (typeof control.validationError === "function") {
|
|
93
92
|
const validate = control.validationError;
|
|
94
93
|
const validationError = validate({
|
|
95
94
|
control,
|
|
96
|
-
key
|
|
97
|
-
value
|
|
95
|
+
key,
|
|
96
|
+
value,
|
|
98
97
|
});
|
|
99
98
|
if (validationError)
|
|
100
|
-
|
|
99
|
+
jsonpointer.set(validationErrors, key, validationError);
|
|
101
100
|
}
|
|
102
101
|
});
|
|
103
|
-
if (
|
|
104
|
-
|
|
102
|
+
if (Object.keys(validationErrors).length) {
|
|
103
|
+
// early return for validation errors
|
|
104
|
+
setRegistrationFormState({
|
|
105
|
+
...registrationFormState,
|
|
106
|
+
loading: false,
|
|
107
|
+
error: "",
|
|
108
|
+
validationErrors,
|
|
109
|
+
});
|
|
105
110
|
return;
|
|
106
111
|
}
|
|
107
112
|
setRegistrationFormState({
|
|
108
113
|
...registrationFormState,
|
|
114
|
+
validationErrors: {},
|
|
109
115
|
initialData: {
|
|
110
116
|
...registrationFormState === null || registrationFormState === void 0 ? void 0 : registrationFormState.initialData,
|
|
111
117
|
...formData,
|
|
@@ -135,8 +141,9 @@ function usePortalGoogleRegistrationForm(props) {
|
|
|
135
141
|
}
|
|
136
142
|
};
|
|
137
143
|
return {
|
|
144
|
+
registrationFormState,
|
|
138
145
|
showRegistrationForm,
|
|
139
|
-
|
|
146
|
+
validationErrors: registrationFormState.validationErrors,
|
|
140
147
|
handleGoogleInit,
|
|
141
148
|
handleEmailSubmit,
|
|
142
149
|
};
|
|
@@ -292,7 +299,7 @@ const PortalGoogleRegistrationForm = class {
|
|
|
292
299
|
};
|
|
293
300
|
const sheet = createStyleSheet(styles);
|
|
294
301
|
const styleString = sheet.toString();
|
|
295
|
-
const { handleGoogleInit, handleEmailSubmit, showRegistrationForm,
|
|
302
|
+
const { handleGoogleInit, handleEmailSubmit, showRegistrationForm, validationErrors, } = isDemo() ? useGoogleDemo(this) : usePortalGoogleRegistrationForm(this);
|
|
296
303
|
const content = {
|
|
297
304
|
formData: h$1("slot", { name: "formData" }),
|
|
298
305
|
googleButton: (h$1("sqm-google-sign-in", { text: this.googleButtonText, onInitComplete: handleGoogleInit })),
|
|
@@ -317,7 +324,7 @@ const PortalGoogleRegistrationForm = class {
|
|
|
317
324
|
};
|
|
318
325
|
if (showRegistrationForm.mode === "base") {
|
|
319
326
|
return (h$1(BaseRegistrationFormView, { states: {
|
|
320
|
-
|
|
327
|
+
validationErrors,
|
|
321
328
|
}, callbacks: { handleEmailSubmit }, content: content }));
|
|
322
329
|
}
|
|
323
330
|
return (h$1(PortalRegistrationFormView, { states: {
|
|
@@ -360,7 +367,7 @@ function useGoogleDemo(props) {
|
|
|
360
367
|
mode: "base",
|
|
361
368
|
});
|
|
362
369
|
return cjs({
|
|
363
|
-
|
|
370
|
+
validationErrors: {},
|
|
364
371
|
handleEmailSubmit: () => setShowRegistrationForm({ mode: "manual" }),
|
|
365
372
|
showRegistrationForm,
|
|
366
373
|
handleGoogleInit: () => setShowRegistrationForm({ mode: "google" }),
|
|
@@ -22,7 +22,7 @@ import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-0a2ec5
|
|
|
22
22
|
import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-5a452423.js';
|
|
23
23
|
import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-7d86299c.js';
|
|
24
24
|
import { P as PortalLoginView } from './sqm-portal-login-view-7670cd86.js';
|
|
25
|
-
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-
|
|
25
|
+
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-9e97d8b4.js';
|
|
26
26
|
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-8bdc3804.js';
|
|
27
27
|
import { P as PortalProfileView } from './sqm-portal-profile-view-3ed13e4d.js';
|
|
28
28
|
import './utilities-72c07b09.js';
|
|
@@ -30,7 +30,7 @@ import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-a
|
|
|
30
30
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-33805220.js';
|
|
31
31
|
import './ErrorView-bbf0a042.js';
|
|
32
32
|
import { Q as QrCodeView } from './sqm-qr-code-view-ea505213.js';
|
|
33
|
-
import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, c as CheckboxFieldView, d as PortalRegisterView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalForgotPasswordView, i as PortalFrameView, R as ReferralIframeView, 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 useShareButton, K as useShareLink, M as ProgressBarView, O as ProgressBar$2, Q as LeadFormView, U as LeadDropdownFieldView, V as ShadowViewAddon } from './ShadowViewAddon-
|
|
33
|
+
import { S as StatContainerView, B as BigStatView, a as ShareButtonView, P as PortalChangePasswordView, b as PoweredByImg$1, u as useDemoBigStat, T as TaskCardView, C as CardFeedView, c as CheckboxFieldView, d as PortalRegisterView, e as CouponCodeView, D as DropdownFieldView, E as EditProfileView, L as LeaderboardView, H as HeroView, I as InputFieldView, N as NameFieldsView, f as ChangeMarktingView, g as PortalFooterView, h as PortalForgotPasswordView, i as PortalFrameView, R as ReferralIframeView, 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 useShareButton, K as useShareLink, M as ProgressBarView, O as ProgressBar$2, Q as LeadFormView, U as LeadDropdownFieldView, V as ShadowViewAddon } from './ShadowViewAddon-1adaf077.js';
|
|
34
34
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-176e92e3.js';
|
|
35
35
|
import { I as InvoiceTableView, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, O as OtherRegionSlotView } from './IndirectTaxDetailsView-0a57b622.js';
|
|
36
36
|
import { t as taxTypeToName, L as LoadingView } from './utils-6122971b.js';
|
|
@@ -5040,7 +5040,7 @@ const BaseRegistrationForm_stories = {
|
|
|
5040
5040
|
};
|
|
5041
5041
|
const defaultProps = {
|
|
5042
5042
|
states: {
|
|
5043
|
-
|
|
5043
|
+
validationErrors: {},
|
|
5044
5044
|
},
|
|
5045
5045
|
callbacks: {
|
|
5046
5046
|
handleEmailSubmit: () => console.log("Submit!"),
|
|
@@ -5060,7 +5060,7 @@ const defaultProps = {
|
|
|
5060
5060
|
const errorProps = {
|
|
5061
5061
|
...defaultProps,
|
|
5062
5062
|
states: {
|
|
5063
|
-
error: "Something went wrong. Please try again.",
|
|
5063
|
+
validationErrors: { error: "Something went wrong. Please try again." },
|
|
5064
5064
|
},
|
|
5065
5065
|
};
|
|
5066
5066
|
const Default$1 = () => {
|
|
@@ -8246,6 +8246,7 @@ const NameFields_stories = {
|
|
|
8246
8246
|
};
|
|
8247
8247
|
const props = {
|
|
8248
8248
|
states: {
|
|
8249
|
+
optional: false,
|
|
8249
8250
|
registrationFormState: {
|
|
8250
8251
|
validationErrors: undefined,
|
|
8251
8252
|
},
|
|
@@ -8257,6 +8258,7 @@ const props = {
|
|
|
8257
8258
|
};
|
|
8258
8259
|
const errorProps$1 = {
|
|
8259
8260
|
states: {
|
|
8261
|
+
optional: false,
|
|
8260
8262
|
registrationFormState: {
|
|
8261
8263
|
validationErrors: {
|
|
8262
8264
|
firstName: "Cannot be empty",
|
|
@@ -9186,6 +9188,7 @@ const defaultProps$g = {
|
|
|
9186
9188
|
formData: (h("div", null,
|
|
9187
9189
|
" ",
|
|
9188
9190
|
h(NameFieldsView, { states: {
|
|
9191
|
+
optional: false,
|
|
9189
9192
|
registrationFormState: {
|
|
9190
9193
|
validationErrors: undefined,
|
|
9191
9194
|
disabled: true,
|