@saasquatch/mint-components 1.13.0-12 → 1.13.0-14
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/{sqm-base-registration-form-view-d5685747.js → sqm-base-registration-form-view-8a2c8763.js} +1 -1
- package/dist/cjs/sqm-google-sign-in.cjs.entry.js +15 -9
- package/dist/cjs/sqm-portal-google-registration-form.cjs.entry.js +2 -3
- package/dist/cjs/{sqm-portal-registration-form-view-e947a5b3.js → sqm-portal-registration-form-view-bd72eeff.js} +1 -1
- package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -2
- package/dist/collection/components/sqm-base-registration/sqm-base-registration-form-view.js +1 -1
- package/dist/collection/components/sqm-google-sign-in/sqm-google-sign-in.js +1 -8
- package/dist/collection/components/sqm-google-sign-in/useGoogleSignIn.js +14 -2
- package/dist/collection/components/sqm-portal-google-registration-form/sqm-portal-google-registration-form.js +0 -1
- package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form-view.js +1 -1
- package/dist/esm/{sqm-base-registration-form-view-98c4db70.js → sqm-base-registration-form-view-593d4ac3.js} +1 -1
- package/dist/esm/sqm-google-sign-in.entry.js +15 -9
- package/dist/esm/sqm-portal-google-registration-form.entry.js +2 -3
- package/dist/esm/{sqm-portal-registration-form-view-90e2bfd5.js → sqm-portal-registration-form-view-c08eafea.js} +1 -1
- package/dist/esm/sqm-portal-registration-form.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +2 -2
- package/dist/esm-es5/sqm-base-registration-form-view-593d4ac3.js +1 -0
- package/dist/esm-es5/sqm-google-sign-in.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-google-registration-form.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-registration-form-view-c08eafea.js +1 -0
- package/dist/esm-es5/sqm-portal-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-3e1b7fb4.entry.js → p-0c5dae79.entry.js} +1 -1
- package/dist/mint-components/{p-045d1d49.entry.js → p-168a3298.entry.js} +1 -1
- package/dist/mint-components/p-36233648.js +1 -0
- package/dist/mint-components/p-4794641c.system.js +1 -0
- package/dist/mint-components/p-4b3e19ad.system.entry.js +1 -0
- package/dist/mint-components/{p-4bcb04aa.system.entry.js → p-85c49452.system.entry.js} +1 -1
- package/dist/mint-components/p-91959fbe.js +1 -0
- package/dist/mint-components/{p-8da47802.system.entry.js → p-9fc19501.system.entry.js} +1 -1
- package/dist/mint-components/{p-ea9fd654.entry.js → p-b4c8315d.entry.js} +1 -1
- package/dist/mint-components/p-b58661b3.system.js +1 -0
- package/dist/mint-components/{p-a1f40614.system.entry.js → p-d12a009a.system.entry.js} +1 -1
- package/dist/mint-components/p-d671e44e.system.js +1 -1
- package/dist/mint-components/p-dfe6b031.entry.js +1 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/sqm-base-registration-form-view-98c4db70.js +0 -1
- package/dist/esm-es5/sqm-portal-registration-form-view-90e2bfd5.js +0 -1
- package/dist/mint-components/p-2b4f38e7.system.entry.js +0 -1
- package/dist/mint-components/p-54657c30.entry.js +0 -1
- package/dist/mint-components/p-62f6627d.js +0 -1
- package/dist/mint-components/p-96b48c2b.system.js +0 -1
- package/dist/mint-components/p-c6a8c075.system.js +0 -1
- package/dist/mint-components/p-d87ce3d2.js +0 -1
|
@@ -6,7 +6,7 @@ const mixins = require('./mixins-f7e0377a.js');
|
|
|
6
6
|
const sqmTextSpanView = require('./sqm-text-span-view-0aa82125.js');
|
|
7
7
|
|
|
8
8
|
const style = {
|
|
9
|
-
Wrapper:
|
|
9
|
+
Wrapper: mixins.AuthWrapper,
|
|
10
10
|
Column: mixins.AuthColumn,
|
|
11
11
|
HostBlock: mixins.HostBlock,
|
|
12
12
|
":host": {
|
|
@@ -9,6 +9,17 @@ const index_module = require('./index.module-57703088.js');
|
|
|
9
9
|
function useGoogleSignIn(props) {
|
|
10
10
|
const [loaded, setLoaded] = stencilHooks_module.useState(false);
|
|
11
11
|
const [googleButtonDiv, setGoogleButtonDiv] = stencilHooks_module.useState(null);
|
|
12
|
+
const [buttonWidth, setButtonWidth] = stencilHooks_module.useState(getButtonWidth());
|
|
13
|
+
function getButtonWidth() {
|
|
14
|
+
return Math.max(200, Math.min(400, window.innerWidth * 0.65));
|
|
15
|
+
}
|
|
16
|
+
stencilHooks_module.useEffect(() => {
|
|
17
|
+
function handleResize() {
|
|
18
|
+
setButtonWidth(getButtonWidth());
|
|
19
|
+
}
|
|
20
|
+
window.addEventListener("resize", handleResize);
|
|
21
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
22
|
+
}, []);
|
|
12
23
|
stencilHooks_module.useEffect(() => {
|
|
13
24
|
const cb = () => {
|
|
14
25
|
// @ts-expect-error
|
|
@@ -33,6 +44,7 @@ function useGoogleSignIn(props) {
|
|
|
33
44
|
// @ts-expect-error
|
|
34
45
|
window.onGoogleLibraryLoad = cb;
|
|
35
46
|
}, []);
|
|
47
|
+
console.log(buttonWidth);
|
|
36
48
|
stencilHooks_module.useEffect(() => {
|
|
37
49
|
if (!googleButtonDiv || !loaded)
|
|
38
50
|
return;
|
|
@@ -42,9 +54,9 @@ function useGoogleSignIn(props) {
|
|
|
42
54
|
size: "large",
|
|
43
55
|
text: props.text,
|
|
44
56
|
height: 40,
|
|
45
|
-
width:
|
|
57
|
+
width: buttonWidth,
|
|
46
58
|
});
|
|
47
|
-
}, [googleButtonDiv, loaded]);
|
|
59
|
+
}, [googleButtonDiv, loaded, buttonWidth]);
|
|
48
60
|
return {
|
|
49
61
|
setGoogleButtonDiv,
|
|
50
62
|
};
|
|
@@ -70,12 +82,7 @@ const GoogleSignIn = class {
|
|
|
70
82
|
const { setGoogleButtonDiv } = index_module.isDemo()
|
|
71
83
|
? useDemoGoogleSignIn(this)
|
|
72
84
|
: useGoogleSignIn(this);
|
|
73
|
-
|
|
74
|
-
return (index.h("div", null, index.h("style", null, `
|
|
75
|
-
#googleSignIn {
|
|
76
|
-
max-width: 402px;
|
|
77
|
-
width: 100%
|
|
78
|
-
}`), index.h("div", { id: "googleSignIn", ref: setGoogleButtonDiv })));
|
|
85
|
+
return (index.h("div", null, index.h("div", { ref: setGoogleButtonDiv })));
|
|
79
86
|
}
|
|
80
87
|
};
|
|
81
88
|
function useDemoGoogleSignIn(props) {
|
|
@@ -108,7 +115,6 @@ function useDemoGoogleSignIn(props) {
|
|
|
108
115
|
google.accounts.id.renderButton(googleButtonDiv, {
|
|
109
116
|
theme: "outline",
|
|
110
117
|
size: "large",
|
|
111
|
-
width: 400,
|
|
112
118
|
text: props.text,
|
|
113
119
|
click_listener: cb,
|
|
114
120
|
});
|
|
@@ -11,8 +11,8 @@ const JSS = require('./JSS-8503a151.js');
|
|
|
11
11
|
require('./mixins-f7e0377a.js');
|
|
12
12
|
require('./sqm-text-span-view-0aa82125.js');
|
|
13
13
|
const useRegistrationFormState = require('./useRegistrationFormState-986b5ea1.js');
|
|
14
|
-
const sqmBaseRegistrationFormView = require('./sqm-base-registration-form-view-
|
|
15
|
-
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-
|
|
14
|
+
const sqmBaseRegistrationFormView = require('./sqm-base-registration-form-view-8a2c8763.js');
|
|
15
|
+
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-bd72eeff.js');
|
|
16
16
|
require('./AsYouType-6788393a.js');
|
|
17
17
|
const usePortalRegistrationForm = require('./usePortalRegistrationForm-a89d736e.js');
|
|
18
18
|
|
|
@@ -326,7 +326,6 @@ const PortalGoogleRegistrationForm = class {
|
|
|
326
326
|
hidePasswords: showRegistrationForm.mode === "google",
|
|
327
327
|
}, callbacks: callbacks, content: {
|
|
328
328
|
...content,
|
|
329
|
-
secondaryButton: index.h("div", { style: { display: "none" } }),
|
|
330
329
|
}, refs: refs }));
|
|
331
330
|
}
|
|
332
331
|
};
|
|
@@ -6,7 +6,7 @@ const mixins = require('./mixins-f7e0377a.js');
|
|
|
6
6
|
const sqmTextSpanView = require('./sqm-text-span-view-0aa82125.js');
|
|
7
7
|
|
|
8
8
|
const style = {
|
|
9
|
-
Wrapper:
|
|
9
|
+
Wrapper: mixins.AuthWrapper,
|
|
10
10
|
Column: mixins.AuthColumn,
|
|
11
11
|
HostBlock: mixins.HostBlock,
|
|
12
12
|
":host": {
|
|
@@ -11,7 +11,7 @@ require('./JSS-8503a151.js');
|
|
|
11
11
|
require('./mixins-f7e0377a.js');
|
|
12
12
|
require('./sqm-text-span-view-0aa82125.js');
|
|
13
13
|
require('./useRegistrationFormState-986b5ea1.js');
|
|
14
|
-
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-
|
|
14
|
+
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-bd72eeff.js');
|
|
15
15
|
require('./AsYouType-6788393a.js');
|
|
16
16
|
const usePortalRegistrationForm = require('./usePortalRegistrationForm-a89d736e.js');
|
|
17
17
|
|
|
@@ -25,8 +25,8 @@ const sqmNavigationSidebarView = require('./sqm-navigation-sidebar-view-17111896
|
|
|
25
25
|
const sqmNavigationSidebarItemView = require('./sqm-navigation-sidebar-item-view-9bba5f7e.js');
|
|
26
26
|
const sqmPortalEmailVerificationView = require('./sqm-portal-email-verification-view-98d84549.js');
|
|
27
27
|
const sqmPortalForgotPasswordView = require('./sqm-portal-forgot-password-view-78f19ef9.js');
|
|
28
|
-
const sqmBaseRegistrationFormView = require('./sqm-base-registration-form-view-
|
|
29
|
-
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-
|
|
28
|
+
const sqmBaseRegistrationFormView = require('./sqm-base-registration-form-view-8a2c8763.js');
|
|
29
|
+
const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-bd72eeff.js');
|
|
30
30
|
const sqmPortalProfileView = require('./sqm-portal-profile-view-bae28ea0.js');
|
|
31
31
|
require('./utilities-c135f16f.js');
|
|
32
32
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-fe602822.js');
|
|
@@ -3,7 +3,7 @@ import { AuthButtonsContainer, AuthColumn, AuthWrapper, ErrorStyles, HostBlock,
|
|
|
3
3
|
import { createStyleSheet } from "../../styling/JSS";
|
|
4
4
|
import { TextSpanView } from "../sqm-text-span/sqm-text-span-view";
|
|
5
5
|
const style = {
|
|
6
|
-
Wrapper:
|
|
6
|
+
Wrapper: AuthWrapper,
|
|
7
7
|
Column: AuthColumn,
|
|
8
8
|
HostBlock: HostBlock,
|
|
9
9
|
":host": {
|
|
@@ -25,14 +25,8 @@ export class GoogleSignIn {
|
|
|
25
25
|
const { setGoogleButtonDiv } = isDemo()
|
|
26
26
|
? useDemoGoogleSignIn(this)
|
|
27
27
|
: useGoogleSignIn(this);
|
|
28
|
-
console.log(setGoogleButtonDiv);
|
|
29
28
|
return (h("div", null,
|
|
30
|
-
h("
|
|
31
|
-
#googleSignIn {
|
|
32
|
-
max-width: 402px;
|
|
33
|
-
width: 100%
|
|
34
|
-
}`),
|
|
35
|
-
h("div", { id: "googleSignIn", ref: setGoogleButtonDiv })));
|
|
29
|
+
h("div", { ref: setGoogleButtonDiv })));
|
|
36
30
|
}
|
|
37
31
|
static get is() { return "sqm-google-sign-in"; }
|
|
38
32
|
static get encapsulation() { return "shadow"; }
|
|
@@ -105,7 +99,6 @@ function useDemoGoogleSignIn(props) {
|
|
|
105
99
|
google.accounts.id.renderButton(googleButtonDiv, {
|
|
106
100
|
theme: "outline",
|
|
107
101
|
size: "large",
|
|
108
|
-
width: 400,
|
|
109
102
|
text: props.text,
|
|
110
103
|
click_listener: cb,
|
|
111
104
|
});
|
|
@@ -3,6 +3,17 @@ import { useState, useEffect } from "@saasquatch/stencil-hooks";
|
|
|
3
3
|
export function useGoogleSignIn(props) {
|
|
4
4
|
const [loaded, setLoaded] = useState(false);
|
|
5
5
|
const [googleButtonDiv, setGoogleButtonDiv] = useState(null);
|
|
6
|
+
const [buttonWidth, setButtonWidth] = useState(getButtonWidth());
|
|
7
|
+
function getButtonWidth() {
|
|
8
|
+
return Math.max(200, Math.min(400, window.innerWidth * 0.65));
|
|
9
|
+
}
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
function handleResize() {
|
|
12
|
+
setButtonWidth(getButtonWidth());
|
|
13
|
+
}
|
|
14
|
+
window.addEventListener("resize", handleResize);
|
|
15
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
16
|
+
}, []);
|
|
6
17
|
useEffect(() => {
|
|
7
18
|
const cb = () => {
|
|
8
19
|
// @ts-expect-error
|
|
@@ -27,6 +38,7 @@ export function useGoogleSignIn(props) {
|
|
|
27
38
|
// @ts-expect-error
|
|
28
39
|
window.onGoogleLibraryLoad = cb;
|
|
29
40
|
}, []);
|
|
41
|
+
console.log(buttonWidth);
|
|
30
42
|
useEffect(() => {
|
|
31
43
|
if (!googleButtonDiv || !loaded)
|
|
32
44
|
return;
|
|
@@ -36,9 +48,9 @@ export function useGoogleSignIn(props) {
|
|
|
36
48
|
size: "large",
|
|
37
49
|
text: props.text,
|
|
38
50
|
height: 40,
|
|
39
|
-
width:
|
|
51
|
+
width: buttonWidth,
|
|
40
52
|
});
|
|
41
|
-
}, [googleButtonDiv, loaded]);
|
|
53
|
+
}, [googleButtonDiv, loaded, buttonWidth]);
|
|
42
54
|
return {
|
|
43
55
|
setGoogleButtonDiv,
|
|
44
56
|
};
|
|
@@ -195,7 +195,6 @@ export class PortalGoogleRegistrationForm {
|
|
|
195
195
|
hidePasswords: showRegistrationForm.mode === "google",
|
|
196
196
|
}, callbacks: callbacks, content: {
|
|
197
197
|
...content,
|
|
198
|
-
secondaryButton: h("div", { style: { display: "none" } }),
|
|
199
198
|
}, refs: refs }));
|
|
200
199
|
}
|
|
201
200
|
static get is() { return "sqm-portal-google-registration-form"; }
|
package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form-view.js
CHANGED
|
@@ -3,7 +3,7 @@ import { AuthButtonsContainer, AuthColumn, AuthWrapper, ErrorStyles, HostBlock,
|
|
|
3
3
|
import { createStyleSheet } from "../../styling/JSS";
|
|
4
4
|
import { TextSpanView } from "../sqm-text-span/sqm-text-span-view";
|
|
5
5
|
const style = {
|
|
6
|
-
Wrapper:
|
|
6
|
+
Wrapper: AuthWrapper,
|
|
7
7
|
Column: AuthColumn,
|
|
8
8
|
HostBlock: HostBlock,
|
|
9
9
|
":host": {
|
|
@@ -4,7 +4,7 @@ import { A as AuthWrapper, a as AuthColumn, H as HostBlock, b as AuthButtonsCont
|
|
|
4
4
|
import { T as TextSpanView } from './sqm-text-span-view-ca32495e.js';
|
|
5
5
|
|
|
6
6
|
const style = {
|
|
7
|
-
Wrapper:
|
|
7
|
+
Wrapper: AuthWrapper,
|
|
8
8
|
Column: AuthColumn,
|
|
9
9
|
HostBlock: HostBlock,
|
|
10
10
|
":host": {
|
|
@@ -5,6 +5,17 @@ import { g as getEnvironmentSDK, i as isDemo } from './index.module-a2989d3c.js'
|
|
|
5
5
|
function useGoogleSignIn(props) {
|
|
6
6
|
const [loaded, setLoaded] = useState(false);
|
|
7
7
|
const [googleButtonDiv, setGoogleButtonDiv] = useState(null);
|
|
8
|
+
const [buttonWidth, setButtonWidth] = useState(getButtonWidth());
|
|
9
|
+
function getButtonWidth() {
|
|
10
|
+
return Math.max(200, Math.min(400, window.innerWidth * 0.65));
|
|
11
|
+
}
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
function handleResize() {
|
|
14
|
+
setButtonWidth(getButtonWidth());
|
|
15
|
+
}
|
|
16
|
+
window.addEventListener("resize", handleResize);
|
|
17
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
18
|
+
}, []);
|
|
8
19
|
useEffect(() => {
|
|
9
20
|
const cb = () => {
|
|
10
21
|
// @ts-expect-error
|
|
@@ -29,6 +40,7 @@ function useGoogleSignIn(props) {
|
|
|
29
40
|
// @ts-expect-error
|
|
30
41
|
window.onGoogleLibraryLoad = cb;
|
|
31
42
|
}, []);
|
|
43
|
+
console.log(buttonWidth);
|
|
32
44
|
useEffect(() => {
|
|
33
45
|
if (!googleButtonDiv || !loaded)
|
|
34
46
|
return;
|
|
@@ -38,9 +50,9 @@ function useGoogleSignIn(props) {
|
|
|
38
50
|
size: "large",
|
|
39
51
|
text: props.text,
|
|
40
52
|
height: 40,
|
|
41
|
-
width:
|
|
53
|
+
width: buttonWidth,
|
|
42
54
|
});
|
|
43
|
-
}, [googleButtonDiv, loaded]);
|
|
55
|
+
}, [googleButtonDiv, loaded, buttonWidth]);
|
|
44
56
|
return {
|
|
45
57
|
setGoogleButtonDiv,
|
|
46
58
|
};
|
|
@@ -66,12 +78,7 @@ const GoogleSignIn = class {
|
|
|
66
78
|
const { setGoogleButtonDiv } = isDemo()
|
|
67
79
|
? useDemoGoogleSignIn(this)
|
|
68
80
|
: useGoogleSignIn(this);
|
|
69
|
-
|
|
70
|
-
return (h$1("div", null, h$1("style", null, `
|
|
71
|
-
#googleSignIn {
|
|
72
|
-
max-width: 402px;
|
|
73
|
-
width: 100%
|
|
74
|
-
}`), h$1("div", { id: "googleSignIn", ref: setGoogleButtonDiv })));
|
|
81
|
+
return (h$1("div", null, h$1("div", { ref: setGoogleButtonDiv })));
|
|
75
82
|
}
|
|
76
83
|
};
|
|
77
84
|
function useDemoGoogleSignIn(props) {
|
|
@@ -104,7 +111,6 @@ function useDemoGoogleSignIn(props) {
|
|
|
104
111
|
google.accounts.id.renderButton(googleButtonDiv, {
|
|
105
112
|
theme: "outline",
|
|
106
113
|
size: "large",
|
|
107
|
-
width: 400,
|
|
108
114
|
text: props.text,
|
|
109
115
|
click_listener: cb,
|
|
110
116
|
});
|
|
@@ -7,8 +7,8 @@ import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
|
7
7
|
import './mixins-83f90fa1.js';
|
|
8
8
|
import './sqm-text-span-view-ca32495e.js';
|
|
9
9
|
import { a as useRegistrationForm } from './useRegistrationFormState-01cdd8c7.js';
|
|
10
|
-
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-
|
|
11
|
-
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-
|
|
10
|
+
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-593d4ac3.js';
|
|
11
|
+
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-c08eafea.js';
|
|
12
12
|
import './AsYouType-46f67d0d.js';
|
|
13
13
|
import { u as usePortalRegistrationForm } from './usePortalRegistrationForm-5715c7a5.js';
|
|
14
14
|
|
|
@@ -322,7 +322,6 @@ const PortalGoogleRegistrationForm = class {
|
|
|
322
322
|
hidePasswords: showRegistrationForm.mode === "google",
|
|
323
323
|
}, callbacks: callbacks, content: {
|
|
324
324
|
...content,
|
|
325
|
-
secondaryButton: h$1("div", { style: { display: "none" } }),
|
|
326
325
|
}, refs: refs }));
|
|
327
326
|
}
|
|
328
327
|
};
|
|
@@ -4,7 +4,7 @@ import { A as AuthWrapper, a as AuthColumn, H as HostBlock, b as AuthButtonsCont
|
|
|
4
4
|
import { T as TextSpanView } from './sqm-text-span-view-ca32495e.js';
|
|
5
5
|
|
|
6
6
|
const style = {
|
|
7
|
-
Wrapper:
|
|
7
|
+
Wrapper: AuthWrapper,
|
|
8
8
|
Column: AuthColumn,
|
|
9
9
|
HostBlock: HostBlock,
|
|
10
10
|
":host": {
|
|
@@ -7,7 +7,7 @@ import './JSS-67b5cff8.js';
|
|
|
7
7
|
import './mixins-83f90fa1.js';
|
|
8
8
|
import './sqm-text-span-view-ca32495e.js';
|
|
9
9
|
import './useRegistrationFormState-01cdd8c7.js';
|
|
10
|
-
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-
|
|
10
|
+
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-c08eafea.js';
|
|
11
11
|
import './AsYouType-46f67d0d.js';
|
|
12
12
|
import { u as usePortalRegistrationForm } from './usePortalRegistrationForm-5715c7a5.js';
|
|
13
13
|
|
|
@@ -21,8 +21,8 @@ import { N as NavigationSidebarView } from './sqm-navigation-sidebar-view-9d802b
|
|
|
21
21
|
import { N as NavigationSidebarItemView } from './sqm-navigation-sidebar-item-view-56da6bca.js';
|
|
22
22
|
import { P as PortalEmailVerificationView } from './sqm-portal-email-verification-view-44c8970f.js';
|
|
23
23
|
import { P as PortalForgotPasswordView } from './sqm-portal-forgot-password-view-3d3182f1.js';
|
|
24
|
-
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-
|
|
25
|
-
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-
|
|
24
|
+
import { B as BaseRegistrationFormView } from './sqm-base-registration-form-view-593d4ac3.js';
|
|
25
|
+
import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-c08eafea.js';
|
|
26
26
|
import { P as PortalProfileView } from './sqm-portal-profile-view-39039274.js';
|
|
27
27
|
import './utilities-863d06d1.js';
|
|
28
28
|
import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-54a8651f.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,r=1,s=arguments.length;r<s;r++){e=arguments[r];for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a))t[a]=e[a]}return t};return __assign.apply(this,arguments)};import{h}from"./index-91e7729f.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{A as AuthWrapper,a as AuthColumn,H as HostBlock,b as AuthButtonsContainer,E as ErrorStyles}from"./mixins-83f90fa1.js";import{T as TextSpanView}from"./sqm-text-span-view-ca32495e.js";var style={Wrapper:AuthWrapper,Column:AuthColumn,HostBlock:HostBlock,":host":{margin:"0 auto",width:"100%"},ButtonsContainer:__assign(__assign({},AuthButtonsContainer),{gap:"var(--sl-spacing-medium)","& > *":{margin:"0 !important"}}),ErrorStyle:ErrorStyles};var vanillaStyle="\nsqm-portal-register {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\n\n:host{\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n";var sheet=createStyleSheet(style);var styleString=sheet.toString();function BaseRegistrationFormView(t){var e=t.states,r=t.content,s=t.callbacks;return h("div",{class:sheet.classes.Wrapper},h("style",{type:"text/css"},vanillaStyle,styleString),h(TextSpanView,{type:"h3"},r.pageLabel),h("sl-form",{class:sheet.classes.Column,"onSl-submit":s.handleEmailSubmit,novalidate:true},e.error&&h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},t.states.error)),h("sl-input",{exportparts:"label: input-label, base: input-base",type:"email",name:"/email",label:r.emailLabel||"Email",required:true,validationError:function(t){var e=t.value;if(!e){return r.requiredFieldErrorMessage}if(!e.includes("@")){return r.invalidEmailErrorMessage}}}),h("div",{class:sheet.classes.ButtonsContainer},h("sl-button",{submit:true,exportparts:"base: primarybutton-base",type:"primary",style:{margin:"0"}},r.submitLabel||"Register"),h("sl-menu-divider",{style:{margin:"0"}}),r.googleButton,r.secondaryButton)))}export{BaseRegistrationFormView as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,e as createEvent,h as h$1}from"./index-91e7729f.js";import{k as useState,f as useEffect,n as h}from"./stencil-hooks.module-4bc38af4.js";import{g as getEnvironmentSDK,i as isDemo}from"./index.module-a2989d3c.js";function useGoogleSignIn(e){var t=useState(false),n=t[0],o=t[1];var i=useState(null),r=i[0],
|
|
1
|
+
import{r as registerInstance,e as createEvent,h as h$1}from"./index-91e7729f.js";import{k as useState,f as useEffect,n as h}from"./stencil-hooks.module-4bc38af4.js";import{g as getEnvironmentSDK,i as isDemo}from"./index.module-a2989d3c.js";function useGoogleSignIn(e){var t=useState(false),n=t[0],o=t[1];var i=useState(null),r=i[0],u=i[1];var c=useState(l()),a=c[0],s=c[1];function l(){return Math.max(200,Math.min(400,window.innerWidth*.65))}useEffect((function(){function e(){s(l())}window.addEventListener("resize",e);return function(){return window.removeEventListener("resize",e)}}),[]);useEffect((function(){var t=function(){window.onGoogleLibraryLoad=null;var t=getEnvironmentSDK();if(t.type!=="SquatchPortal")return;var n=function(t){e.initComplete.emit(t)};google.accounts.id.initialize({client_id:t.env.googleOAuthId,callback:n});o(true)};if(window.google)t();window.onGoogleLibraryLoad=t}),[]);console.log(a);useEffect((function(){if(!r||!n)return;google.accounts.id.renderButton(r,{theme:"outline",size:"large",text:e.text,height:40,width:a})}),[r,n,a]);return{setGoogleButtonDiv:u}}var GoogleSignIn=function(){function e(e){registerInstance(this,e);this.initComplete=createEvent(this,"initComplete",7);h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.connectedCallback=function(){var e="https://accounts.google.com/gsi/client";if(!document.head.querySelector('script[src="'+e+'"]')){var t=document.createElement("script");t.src="https://accounts.google.com/gsi/client";t.async=true;document.head.appendChild(t)}};e.prototype.render=function(){var e=(isDemo()?useDemoGoogleSignIn(this):useGoogleSignIn(this)).setGoogleButtonDiv;return h$1("div",null,h$1("div",{ref:e}))};return e}();function useDemoGoogleSignIn(e){var t=useState(false),n=t[0],o=t[1];var i=useState(null),r=i[0],u=i[1];useEffect((function(){var e=function(){window.onGoogleLibraryLoad=null;o(true)};if(window.google)e();window.onGoogleLibraryLoad=e}),[]);useEffect((function(){if(!r||!n)return;var t=function(){e.initComplete.emit({credential:null})};google.accounts.id.initialize({client_id:"PLACEHOLDER",cb:function(){}});google.accounts.id.renderButton(r,{theme:"outline",size:"large",text:e.text,click_listener:t})}),[r,n]);return{setGoogleButtonDiv:u}}export{GoogleSignIn as sqm_google_sign_in};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){e(t,r);function o(){this.constructor=t}t.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++){t=arguments[r];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,o){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(n){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,a&&(i=n[0]&2?a["return"]:n[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;if(a=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;a=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(e){n=[6,e];a=0}finally{o=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-91e7729f.js";import{k as useState,n as h}from"./stencil-hooks.module-4bc38af4.js";import{i as isDemo,j as jn}from"./index.module-a2989d3c.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-83f90fa1.js";import"./sqm-text-span-view-ca32495e.js";import{a as useRegistrationForm}from"./useRegistrationFormState-01cdd8c7.js";import{B as BaseRegistrationFormView}from"./sqm-base-registration-form-view-
|
|
1
|
+
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){e(t,r);function o(){this.constructor=t}t.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++){t=arguments[r];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,o){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,a,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(n){if(o)throw new TypeError("Generator is already executing.");while(r)try{if(o=1,a&&(i=n[0]&2?a["return"]:n[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;if(a=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;a=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(e){n=[6,e];a=0}finally{o=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-91e7729f.js";import{k as useState,n as h}from"./stencil-hooks.module-4bc38af4.js";import{i as isDemo,j as jn}from"./index.module-a2989d3c.js";import{j as jsonpointer}from"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import"./mixins-83f90fa1.js";import"./sqm-text-span-view-ca32495e.js";import{a as useRegistrationForm}from"./useRegistrationFormState-01cdd8c7.js";import{B as BaseRegistrationFormView}from"./sqm-base-registration-form-view-593d4ac3.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-c08eafea.js";import"./AsYouType-46f67d0d.js";import{u as usePortalRegistrationForm}from"./usePortalRegistrationForm-5715c7a5.js";var InvalidTokenError=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Error);InvalidTokenError.prototype.name="InvalidTokenError";function b64DecodeUnicode(e){return decodeURIComponent(atob(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();if(r.length<2){r="0"+r}return"%"+r})))}function base64UrlDecode(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return b64DecodeUnicode(t)}catch(e){return atob(t)}}function jwtDecode(e,t){if(typeof e!=="string"){throw new InvalidTokenError("Invalid token specified: must be a string")}t||(t={});var r=t.header===true?0:1;var o=e.split(".")[r];if(typeof o!=="string"){throw new InvalidTokenError("Invalid token specified: missing part #"+(r+1))}var a;try{a=base64UrlDecode(o)}catch(e){throw new InvalidTokenError("Invalid token specified: invalid base64 for part #"+(r+1)+" ("+e.message+")")}try{return JSON.parse(a)}catch(e){throw new InvalidTokenError("Invalid token specified: invalid json for part #"+(r+1)+" ("+e.message+")")}}function usePortalGoogleRegistrationForm(e){var t=this;var r=useState(null),o=r[0],a=r[1];var i=useRegistrationForm(),n=i[0],s=i[1];var l=useState({mode:"base"}),u=l[0],c=l[1];var m=function(r){return __awaiter(t,void 0,void 0,(function(){var t,o,i;return __generator(this,(function(l){t=r.target.getFormControls();o={};i=null;t.forEach((function(t){if(!t.name||t.name!=="/email")return;jsonpointer.set(o,t.name,t.value);if(t.required&&!t.value)i=e.requiredFieldErrorMessage;if(typeof t.validationError==="function"){var r=t.validationError;var a=r({control:t,key:"email",value:t.value});if(a)i=a}}));if(i){a(i);return[2]}s(__assign(__assign({},n),{initialData:__assign(__assign({},n===null||n===void 0?void 0:n.initialData),o)}));c({mode:"manual"});return[2]}))}))};var d=function(e){var t;if(!((t=e.detail)===null||t===void 0?void 0:t.credential))return;try{var r=jwtDecode(e.detail.credential);s(__assign(__assign({},n),{_googleOAuthIdToken:e.detail.credential,initialData:{email:r.email,firstName:r.given_name,lastName:r.family_name}}));c({mode:"google"})}catch(e){console.error("Failed to decode Google Sign In credential JWT:",e)}};return{showRegistrationForm:u,emailValidationError:o,handleGoogleInit:d,handleEmailSubmit:m}}var PortalGoogleRegistrationForm=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.redirectPath="/verifyEmail";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Register";this.loginLabel="Sign in";this.confirmPasswordLabel="Confirm Password";this.confirmPassword=false;this.disablePasswordValidation=false;this.hideInputs=false;this.pageLabel="Register";this.loginPath="/login";this.loginCTA="Already have an account?";this.requiredFieldErrorMessage="Cannot be empty";this.networkErrorMessage="Network request failed.";this.passwordMismatchErrorMessage="Passwords do not match.";this.invalidEmailErrorMessage="Must be a valid email address";this.formDisabledErrorMessage="The registration form is currently disabled.";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";this.googleButtonText="signup_with";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo(this):usePortalRegistrationForm(this),t=e.states,r=e.callbacks,o=e.refs;var a={LoginButton:{"&::part(label)":{padding:"0"}}};var i=createStyleSheet(a);var n=i.toString();var s=isDemo()?useGoogleDemo(this):usePortalGoogleRegistrationForm(this),l=s.handleGoogleInit,u=s.handleEmailSubmit,c=s.showRegistrationForm,m=s.emailValidationError;var d={formData:h$1("slot",{name:"formData"}),googleButton:h$1("sqm-google-sign-in",{text:this.googleButtonText,onInitComplete:l}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("style",null,n),h$1("span",null,this.loginCTA," ",h$1("sl-button",{size:"large",type:"text",disabled:t.loading,onClick:function(){return jn.push(t.loginPath)},className:i.classes.LoginButton},this.loginLabel)," ")),terms:h$1("slot",{name:"terms"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,networkErrorMessage:this.networkErrorMessage,passwordMismatchErrorMessage:this.passwordMismatchErrorMessage,invalidEmailErrorMessage:this.invalidEmailErrorMessage,formDisabledErrorMessage:this.formDisabledErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};if(c.mode==="base"){return h$1(BaseRegistrationFormView,{states:{error:m},callbacks:{handleEmailSubmit:u},content:d})}return h$1(PortalRegistrationFormView,{states:__assign(__assign({},t),{hidePasswords:c.mode==="google"}),callbacks:r,content:__assign({},d),refs:o})};return e}();function useRegisterDemo(e){var t=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:"/login"},callbacks:{handleGoogleInit:function(){},setShowRegistrationForm:function(){},submit:function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},content:{pageLabel:"Register",formData:null,passwordField:null},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,t){return t}})}function useGoogleDemo(e){var t=useState({mode:"base"}),r=t[0],o=t[1];return cjs({emailValidationError:true,handleEmailSubmit:function(){return o({mode:"manual"})},showRegistrationForm:r,handleGoogleInit:function(){return o({mode:"google"})}},e.demoGoogleData||{},{arrayMerge:function(e,t){return t}})}export{PortalGoogleRegistrationForm as sqm_portal_google_registration_form};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h}from"./index-91e7729f.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";import{A as AuthWrapper,a as AuthColumn,H as HostBlock,b as AuthButtonsContainer,E as ErrorStyles}from"./mixins-83f90fa1.js";import{T as TextSpanView}from"./sqm-text-span-view-ca32495e.js";var style={Wrapper:AuthWrapper,Column:AuthColumn,HostBlock:HostBlock,":host":{margin:"0 auto",width:"100%"},ButtonsContainer:AuthButtonsContainer,ErrorStyle:ErrorStyles};var vanillaStyle="\nsqm-portal-register {\n margin: 0 auto;\n width: 100%;\n display: block;\n}\n\n:host{\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n";var sheet=createStyleSheet(style);var styleString=sheet.toString();function PortalRegistrationFormView(e){var r,t,a,i,o,s,l,n,d,u,m,v,p,c,b,g,f,S,x;var y=e.states,w=e.refs,E=e.callbacks,F=e.content;if(y.error){window.scrollTo({top:0,left:0,behavior:"smooth"})}return h("div",{class:sheet.classes.Wrapper,part:"sqm-base"},h("style",{type:"text/css"},vanillaStyle,styleString),h(TextSpanView,{type:"h3"},F.pageLabel),h("sl-form",{class:sheet.classes.Column,"onSl-submit":E.submit,ref:function(e){return w.formRef.current=e},novalidate:true},((r=y.registrationFormState)===null||r===void 0?void 0:r.disabled)?h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},y.registrationFormState.disabledMessage)):y.error&&h("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},h("div",{part:"erroralert-text"},e.states.error)),F.formData,!y.hideInputs&&h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"email",name:"/email",label:F.emailLabel||"Email",disabled:true,required:true,validationError:function(e){var r=e.value;if(!r){return F.requiredFieldErrorMessage}if(!r.includes("@")){return F.invalidEmailErrorMessage}}},((a=(t=y.registrationFormState)===null||t===void 0?void 0:t.initialData)===null||a===void 0?void 0:a.email)?{value:(o=(i=y.registrationFormState)===null||i===void 0?void 0:i.initialData)===null||o===void 0?void 0:o.email}:{},((l=(s=y.registrationFormState)===null||s===void 0?void 0:s.validationErrors)===null||l===void 0?void 0:l.email)?{class:sheet.classes.ErrorStyle,helpText:((d=(n=y.registrationFormState)===null||n===void 0?void 0:n.validationErrors)===null||d===void 0?void 0:d.email)||F.requiredFieldErrorMessage}:[])),!(y.hideInputs||y.hidePasswords)&&h("sqm-password-field",{fieldLabel:F.passwordLabel,"disable-validation":!y.enablePasswordValidation,meetsRequirementsText:F.meetsRequirementsText,doesNotMeetRequirementsText:F.doesNotMeetRequirementsText,minErrorText:F.minErrorText,uppercaseErrorText:F.uppercaseErrorText,lowercaseErrorText:F.lowercaseErrorText,hasErrorText:F.hasErrorText}),F.passwordField,!(y.hideInputs||y.hidePasswords)&&y.confirmPassword&&h("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"password",name:"/confirmPassword",label:F.confirmPasswordLabel,disabled:y.loading||((u=y.registrationFormState)===null||u===void 0?void 0:u.disabled),required:true},((v=(m=y.registrationFormState)===null||m===void 0?void 0:m.initialData)===null||v===void 0?void 0:v.confirmPassword)?{value:(c=(p=y.registrationFormState)===null||p===void 0?void 0:p.initialData)===null||c===void 0?void 0:c.confirmPassword}:{},((g=(b=y.registrationFormState)===null||b===void 0?void 0:b.validationErrors)===null||g===void 0?void 0:g.confirmPassword)?{class:sheet.classes.ErrorStyle,helpText:((S=(f=y.registrationFormState)===null||f===void 0?void 0:f.validationErrors)===null||S===void 0?void 0:S.confirmPassword)||F.requiredFieldErrorMessage}:[])),F.terms,h("div",{class:sheet.classes.ButtonsContainer},h("sl-button",{submit:true,loading:y.loading,disabled:(x=y.registrationFormState)===null||x===void 0?void 0:x.disabled,exportparts:"base: primarybutton-base",type:"primary"},F.submitLabel||"Register"),F.secondaryButton)))}export{PortalRegistrationFormView as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function i(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{l(s.next(e))}catch(e){a(e)}}function n(e){try{l(s["throw"](e))}catch(e){a(e)}}function l(e){e.done?t(e.value):i(e.value).then(o,n)}l((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,i,a,o;return o={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function n(e){return function(r){return l([e,r])}}function l(o){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;i=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];i=0}finally{s=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-91e7729f.js";import{n as h}from"./stencil-hooks.module-4bc38af4.js";import{i as isDemo,j as jn}from"./index.module-a2989d3c.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./JSS-67b5cff8.js";import"./mixins-83f90fa1.js";import"./sqm-text-span-view-ca32495e.js";import"./useRegistrationFormState-01cdd8c7.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,r,t,s){function i(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{l(s.next(e))}catch(e){a(e)}}function n(e){try{l(s["throw"](e))}catch(e){a(e)}}function l(e){e.done?t(e.value):i(e.value).then(o,n)}l((s=s.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,i,a,o;return o={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function n(e){return function(r){return l([e,r])}}function l(o){if(s)throw new TypeError("Generator is already executing.");while(t)try{if(s=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;i=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){t.label=o[1];break}if(o[0]===6&&t.label<a[1]){t.label=a[1];a=o;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(o);break}if(a[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];i=0}finally{s=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,h as h$1}from"./index-91e7729f.js";import{n as h}from"./stencil-hooks.module-4bc38af4.js";import{i as isDemo,j as jn}from"./index.module-a2989d3c.js";import"./jsonpointer-388a7082.js";import{c as cjs}from"./cjs-bdfb4486.js";import"./JSS-67b5cff8.js";import"./mixins-83f90fa1.js";import"./sqm-text-span-view-ca32495e.js";import"./useRegistrationFormState-01cdd8c7.js";import{P as PortalRegistrationFormView}from"./sqm-portal-registration-form-view-c08eafea.js";import"./AsYouType-46f67d0d.js";import{u as usePortalRegistrationForm}from"./usePortalRegistrationForm-5715c7a5.js";var PortalRegistrationForm=function(){function e(e){registerInstance(this,e);this.ignored=true;this.nextPage="/";this.redirectPath="/verifyEmail";this.emailLabel="Email";this.passwordLabel="Password";this.submitLabel="Register";this.loginLabel="Sign in";this.confirmPasswordLabel="Confirm Password";this.confirmPassword=false;this.disablePasswordValidation=false;this.hideInputs=false;this.pageLabel="Register";this.loginPath="/login";this.requiredFieldErrorMessage="Cannot be empty";this.networkErrorMessage="Network request failed.";this.passwordMismatchErrorMessage="Passwords do not match.";this.invalidEmailErrorMessage="Must be a valid email address";this.formDisabledErrorMessage="The registration form is currently disabled.";this.meetsRequirementsText="Password has met all requirements";this.doesNotMeetRequirementsText="Password must meet the following requirements:";this.minErrorText="be a minimum of 8 characters";this.uppercaseErrorText="contain at least 1 uppercase character";this.lowercaseErrorText="contain at least 1 lowercase character";this.hasErrorText="contain at least 1 number or symbol";h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=isDemo()?useRegisterDemo(this):usePortalRegistrationForm(this),r=e.states,t=e.callbacks,s=e.refs;var i={formData:h$1("slot",{name:"formData"}),secondaryButton:h$1("slot",{name:"secondaryButton"},h$1("sl-button",{type:"text",disabled:r.loading,onClick:function(){return jn.push(r.loginPath)}},this.loginLabel)),terms:h$1("slot",{name:"terms"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,networkErrorMessage:this.networkErrorMessage,passwordMismatchErrorMessage:this.passwordMismatchErrorMessage,invalidEmailErrorMessage:this.invalidEmailErrorMessage,formDisabledErrorMessage:this.formDisabledErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};return h$1(PortalRegistrationFormView,{states:r,callbacks:t,content:i,refs:s})};return e}();function useRegisterDemo(e){var r=this;return cjs({states:{error:"",loading:false,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs||false,customPasswordField:false,loginPath:"/login"},callbacks:{submit:function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){console.log("submit");return[2]}))}))},inputFunction:function(){}},refs:{formRef:{}}},e.demoData||{},{arrayMerge:function(e,r){return r}})}export{PortalRegistrationForm as sqm_portal_registration_form};
|