@saasquatch/mint-components 1.6.2-18 → 1.6.2-19
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-portal-email-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +0 -6
- package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +3 -0
- package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +3 -0
- package/dist/collection/components/sqm-input-field/sqm-input-field.js +3 -0
- package/dist/collection/components/sqm-portal-email-verification/sqm-portal-email-verification.js +2 -2
- package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form.js +4 -8
- package/dist/esm/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm/sqm-portal-registration-form.entry.js +0 -6
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-12334c6f.system.entry.js → p-4809641a.system.entry.js} +1 -1
- package/dist/mint-components/p-4e45b1bf.entry.js +1 -0
- package/dist/mint-components/{p-f15b60ba.system.entry.js → p-7260e780.system.entry.js} +1 -1
- package/dist/mint-components/p-e6456af0.system.js +1 -1
- package/dist/mint-components/p-f9bc1861.entry.js +13 -0
- package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -0
- package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +1 -0
- package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +1 -0
- package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form.d.ts +1 -0
- package/dist/types/components.d.ts +8 -0
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/package.json +1 -1
- package/dist/mint-components/p-0b7a394e.entry.js +0 -13
- package/dist/mint-components/p-26783f8d.entry.js +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{h as o,r as i}from"./p-64c3217a.js";import{j as t,e as l,m as s}from"./p-78c7b4b7.js";import{u as e}from"./p-cdabe7a8.js";import{d as a,W as r,w as n,I as d,L as v}from"./p-a63204e2.js";import"./p-81f34787.js";import{j as u}from"./p-e7e129ac.js";import{c as m}from"./p-c1086930.js";import{A as c,a as p,H as b,b as f,E as h}from"./p-02be1a88.js";import{c as y}from"./p-d8876d3f.js";import{T as g}from"./p-210cd41b.js";import{A as w}from"./p-121cdc60.js";import{u as k,a as j}from"./p-2ce5d3da.js";const x=y({Wrapper:{...c,"max-width":"600px"},Column:p,HostBlock:b,":host":{margin:"0 auto",width:"100%"},ButtonsContainer:f,ErrorStyle:h}),P=x.toString();function E(i){var t,l,s,e,a,r,n,d,v,u,m,c,p,b,f,h,y,w,k;const{states:j,refs:E,callbacks:S,content:q}=i;return j.error&&window.scrollTo({top:0,left:0,behavior:"smooth"}),o("div",{class:x.classes.Wrapper},o("style",{type:"text/css"},"\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",P),o(g,{type:"h3"},q.pageLabel),o("sl-form",{class:x.classes.Column,"onSl-submit":S.submit,ref:o=>E.formRef.current=o,novalidate:!0},(null===(t=j.registrationFormState)||void 0===t?void 0:t.disabled)?o("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},o("div",{part:"erroralert-text"},j.registrationFormState.disabledMessage)):j.error&&o("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},o("div",{part:"erroralert-text"},i.states.error)),q.formData,!j.hideInputs&&o("sl-input",Object.assign({exportparts:"label: input-label",type:"email",name:"/email",label:q.emailLabel||"Email",disabled:j.loading||(null===(l=j.registrationFormState)||void 0===l?void 0:l.disabled),required:!0,validationError:({value:o})=>o?o.includes("@")?void 0:"Must be a valid email address":"Cannot be empty"},(null===(e=null===(s=j.registrationFormState)||void 0===s?void 0:s.initialData)||void 0===e?void 0:e.email)?{value:null===(r=null===(a=j.registrationFormState)||void 0===a?void 0:a.initialData)||void 0===r?void 0:r.email}:{},(null===(d=null===(n=j.validationState)||void 0===n?void 0:n.validationErrors)||void 0===d?void 0:d.email)?{class:x.classes.ErrorStyle,helpText:(null===(u=null===(v=j.validationState)||void 0===v?void 0:v.validationErrors)||void 0===u?void 0:u.email)||"Cannot be empty"}:[])),!j.hideInputs&&o("sqm-password-field",{fieldLabel:q.passwordLabel,"disable-validation":!j.enablePasswordValidation}),q.passwordField,!j.hideInputs&&j.confirmPassword&&o("sl-input",Object.assign({exportparts:"label: input-label",type:"password",name:"/confirmPassword",label:q.confirmPasswordLabel,disabled:j.loading,required:!0},(null===(c=null===(m=j.registrationFormState)||void 0===m?void 0:m.initialData)||void 0===c?void 0:c.confirmPassword)?{value:null===(b=null===(p=j.registrationFormState)||void 0===p?void 0:p.initialData)||void 0===b?void 0:b.confirmPassword}:{},(null===(h=null===(f=j.validationState)||void 0===f?void 0:f.validationErrors)||void 0===h?void 0:h.confirmPassword)?{class:x.classes.ErrorStyle,helpText:(null===(w=null===(y=j.validationState)||void 0===y?void 0:y.validationErrors)||void 0===w?void 0:w.confirmPassword)||"Cannot be empty"}:[])),q.terms,o("div",{class:x.classes.ButtonsContainer},o("sl-button",{submit:!0,loading:j.loading,disabled:null===(k=j.registrationFormState)||void 0===k?void 0:k.disabled,exportparts:"base: primarybutton-base",type:"primary"},q.submitLabel||"Register"),q.secondaryButton)))}const S=a.gql`
|
|
2
|
+
query RegistrationFormQuery($key: String!) {
|
|
3
|
+
form(key: $key) {
|
|
4
|
+
key
|
|
5
|
+
type
|
|
6
|
+
initialData {
|
|
7
|
+
initialData
|
|
8
|
+
isEnabled
|
|
9
|
+
isEnabledErrorMessage
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`,q=class{constructor(o){i(this,o),this.ignored=!0,this.nextPage="/",this.redirectPath="/verifyEmail",this.emailLabel="Email",this.passwordLabel="Password",this.submitLabel="Register",this.loginLabel="Sign in",this.confirmPasswordLabel="Confirm Password",this.confirmPassword=!1,this.disablePasswordValidation=!1,this.hideInputs=!1,this.pageLabel="Register",this.loginPath="/login",s(this)}disconnectedCallback(){}render(){const{states:i,callbacks:s,refs:a}=v()?m({states:{error:"",loading:!1,confirmPassword:!0,hideInputs:this.hideInputs||!1,customPasswordField:!1,loginPath:"/login"},callbacks:{submit:async()=>{console.log("submit")},inputFunction:()=>{}},refs:{formRef:{}}},this.demoData||{},{arrayMerge:(o,i)=>i}):function(o){var i,s,a,v,m,c,p,b,f,h,y,g,x,P,E,q;const C=t(null),{registrationFormState:F,setRegistrationFormState:R}=k({}),{validationState:D,setValidationState:L}=j({}),[T,{loading:B,errors:M,formError:I}]=r(),O=n(S,{key:o.formKey}),_=B||O.loading;l((()=>{var o,i,t;const l=null===(o=null==O?void 0:O.data)||void 0===o?void 0:o.form.initialData.initialData,s=!1===(null===(i=null==O?void 0:O.data)||void 0===i?void 0:i.form.initialData.isEnabled),e=(null===(t=null==O?void 0:O.data)||void 0===t?void 0:t.form.initialData.isEnabledErrorMessage)||"The registration form is currently disabled.";R({loading:_,disabled:s,disabledMessage:e,initialData:l})}),[null===(i=null==O?void 0:O.data)||void 0===i?void 0:i.form.initialData]),l((()=>{if(!C.current)return;const o=C.current;return o.addEventListener("sl-input",A),()=>{o.removeEventListener("sl-input",A)}}),[C.current]);const A=e((o=>{var i,t;if("tel"!==(null===(t=null===(i=o.target)||void 0===i?void 0:i.type)||void 0===t?void 0:t.toLowerCase()))return;const l=new w("US");o.target.value=l.input(o.target.value)}),[]);let H="";return H=!1===(null===(s=null==O?void 0:O.data)||void 0===s?void 0:s.form.initialData.isEnabled)?(null===(a=null==O?void 0:O.data)||void 0===a?void 0:a.form.initialData.isEnabledErrorMessage)||"The registration form is disabled":(null===(v=null==M?void 0:M.response)||void 0===v?void 0:v.error)||(null==M?void 0:M.message)&&!(null===(m=null==M?void 0:M.response)||void 0===m?void 0:m.errors.length)?"Network request failed":I||(null===(f=null===(b=null===(p=null===(c=null==O?void 0:O.errors)||void 0===c?void 0:c.response)||void 0===p?void 0:p.errors)||void 0===b?void 0:b[0])||void 0===f?void 0:f.message)||(null===(x=null===(g=null===(y=null===(h=null==M?void 0:M.response)||void 0===h?void 0:h.errors)||void 0===y?void 0:y[0])||void 0===g?void 0:g.extensions)||void 0===x?void 0:x.message)||(null===(q=null===(E=null===(P=null==M?void 0:M.response)||void 0===P?void 0:P.errors)||void 0===E?void 0:E[0])||void 0===q?void 0:q.message)||(null==D?void 0:D.error),{states:{loading:B||O.loading,error:H,validationState:D,registrationFormState:F,confirmPassword:o.confirmPassword,hideInputs:o.hideInputs,loginPath:o.loginPath,enablePasswordValidation:!o.disablePasswordValidation},callbacks:{submit:async i=>{var t;let l=i.target.getFormControls(),s={},e={};if(null==l||l.forEach((o=>{if(!o.name)return;const i=o.name,t=o.value;if(u.set(s,i,t),o.required&&!t&&u.set(e,i,"Cannot be empty"),"function"==typeof o.validationError){const l=(0,o.validationError)({control:o,key:i,value:t});l&&u.set(e,i,l)}})),(o.confirmPassword||s.confirmPassword)&&s.password!==s.confirmPassword&&(e={...e,confirmPassword:"Passwords do not match."}),L({error:"",validationErrors:e}),Object.keys(e).length)return;const{email:a,password:r}=s;delete s.email,delete s.password,delete s.confirmPassword;const n={key:o.formKey,formData:{email:a,password:r,redirectPath:o.redirectPath,...s}};try{const i=await T(n);if(i instanceof Error)throw i;const l=null===(t=i.submitForm)||void 0===t?void 0:t.results.find((o=>"identity"===o.formHandler.namespace));l&&l.result.results.length&&l.result.results[0].success&&l.result.results[0].data.token&&d.push(o.nextPage)}catch(o){L({error:"Network request failed."})}},inputFunction:A},refs:{formRef:C}}}(this);const c={formData:o("slot",{name:"formData"}),secondaryButton:o("slot",{name:"secondaryButton"},o("sl-button",{type:"text",disabled:i.loading,onClick:()=>d.push(i.loginPath)},this.loginLabel)),terms:o("slot",{name:"terms"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel};return o(E,{states:i,callbacks:s,content:c,refs:a})}};export{q as sqm_portal_registration_form}
|
|
@@ -136,6 +136,7 @@ export namespace Components {
|
|
|
136
136
|
"checkboxLabelLinkText": string;
|
|
137
137
|
/**
|
|
138
138
|
* @uiName Checkbox Name Attribute
|
|
139
|
+
* @required
|
|
139
140
|
*/
|
|
140
141
|
"checkboxName": string;
|
|
141
142
|
/**
|
|
@@ -178,6 +179,7 @@ export namespace Components {
|
|
|
178
179
|
"dropdownLabel": string;
|
|
179
180
|
/**
|
|
180
181
|
* @uiName Dropdown Name Attribute
|
|
182
|
+
* @required
|
|
181
183
|
*/
|
|
182
184
|
"dropdownName": string;
|
|
183
185
|
/**
|
|
@@ -454,6 +456,7 @@ export namespace Components {
|
|
|
454
456
|
/**
|
|
455
457
|
* Used as the key of the inputs value in form data.
|
|
456
458
|
* @uiName Input Name Attribute
|
|
459
|
+
* @required
|
|
457
460
|
*/
|
|
458
461
|
"fieldName": string;
|
|
459
462
|
/**
|
|
@@ -1115,6 +1118,7 @@ export namespace Components {
|
|
|
1115
1118
|
/**
|
|
1116
1119
|
* Microsite Registration Form Key
|
|
1117
1120
|
* @uiName Form Key
|
|
1121
|
+
* @required
|
|
1118
1122
|
*/
|
|
1119
1123
|
"formKey": string;
|
|
1120
1124
|
/**
|
|
@@ -3040,6 +3044,7 @@ declare namespace LocalJSX {
|
|
|
3040
3044
|
"checkboxLabelLinkText"?: string;
|
|
3041
3045
|
/**
|
|
3042
3046
|
* @uiName Checkbox Name Attribute
|
|
3047
|
+
* @required
|
|
3043
3048
|
*/
|
|
3044
3049
|
"checkboxName"?: string;
|
|
3045
3050
|
/**
|
|
@@ -3082,6 +3087,7 @@ declare namespace LocalJSX {
|
|
|
3082
3087
|
"dropdownLabel"?: string;
|
|
3083
3088
|
/**
|
|
3084
3089
|
* @uiName Dropdown Name Attribute
|
|
3090
|
+
* @required
|
|
3085
3091
|
*/
|
|
3086
3092
|
"dropdownName"?: string;
|
|
3087
3093
|
/**
|
|
@@ -3358,6 +3364,7 @@ declare namespace LocalJSX {
|
|
|
3358
3364
|
/**
|
|
3359
3365
|
* Used as the key of the inputs value in form data.
|
|
3360
3366
|
* @uiName Input Name Attribute
|
|
3367
|
+
* @required
|
|
3361
3368
|
*/
|
|
3362
3369
|
"fieldName"?: string;
|
|
3363
3370
|
/**
|
|
@@ -4019,6 +4026,7 @@ declare namespace LocalJSX {
|
|
|
4019
4026
|
/**
|
|
4020
4027
|
* Microsite Registration Form Key
|
|
4021
4028
|
* @uiName Form Key
|
|
4029
|
+
* @required
|
|
4022
4030
|
*/
|
|
4023
4031
|
"formKey"?: string;
|
|
4024
4032
|
/**
|
package/docs/docs.docx
CHANGED
|
Binary file
|