@qssolutions/ssas-registration-form 1.0.5 → 1.0.7
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/README.md +8 -11
- package/dist/components/LowerFormSection.d.ts.map +1 -1
- package/dist/components/common/SSASPrimaryButton.d.ts.map +1 -1
- package/dist/components/form-fields/ControlledComboBox.d.ts.map +1 -1
- package/dist/components/form-fields/ControlledDropdown.d.ts.map +1 -1
- package/dist/index.esm.js +51 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +51 -25
- package/dist/index.js.map +1 -1
- package/dist/models/config.d.ts +1 -3
- package/dist/models/config.d.ts.map +1 -1
- package/dist/services/ApiService.d.ts +1 -1
- package/dist/utils/constants.d.ts +1 -1
- package/dist/web-component.js +51 -25
- package/dist/web-component.js.map +1 -1
- package/dist/web-component.min.js +1 -1
- package/dist/web-component.min.js.map +1 -1
- package/package.json +1 -1
package/dist/models/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
export type SupportedLanguage = 'en' | 'fr' | 'de' | 'it' | 'ja' | 'ko' | 'pt' | 'es' | 'nl' | 'ar' | 'he' | 'pt-br' | 'tr' | 'id' | 'th' | 'vi' | 'pl';
|
|
3
3
|
export interface FormLibraryConfig {
|
|
4
|
-
|
|
4
|
+
partnerGuid: string;
|
|
5
5
|
apiBaseUrl?: string;
|
|
6
6
|
languageCode?: SupportedLanguage;
|
|
7
7
|
theme?: {
|
|
@@ -23,8 +23,6 @@ export interface FormLibraryConfig {
|
|
|
23
23
|
onValidateEmail?: (email: string, signal?: AbortSignal) => Promise<boolean>;
|
|
24
24
|
onSuccess?: (email: string) => void;
|
|
25
25
|
onError?: (error: string) => void;
|
|
26
|
-
termsAndConditionsUrl?: string;
|
|
27
|
-
privacyNoticeUrl?: string;
|
|
28
26
|
}
|
|
29
27
|
export declare const defaultConfig: Partial<FormLibraryConfig>;
|
|
30
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,CAcpD,CAAC"}
|
|
@@ -36,7 +36,7 @@ export declare class ApiService {
|
|
|
36
36
|
* Get partner by name
|
|
37
37
|
* Extracts name from the baseUrl automatically and cleans it
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
getPartnerByGuid(partnerGuid: string): Promise<IPartnerModel>;
|
|
40
40
|
/**
|
|
41
41
|
* Get localization data for FormScreen by language code and partner ID
|
|
42
42
|
*/
|
|
@@ -67,7 +67,7 @@ export declare const API_ENDPOINTS: {
|
|
|
67
67
|
readonly GET_ORG_SIZES: "/common/orgsizing-list";
|
|
68
68
|
readonly GET_INDUSTRIES: "/common/industry-list";
|
|
69
69
|
readonly GET_PARTNER: "/partner/get";
|
|
70
|
-
readonly
|
|
70
|
+
readonly GET_PARTNER_BY_GUID: "/partner/get-by-guid";
|
|
71
71
|
readonly GET_LOCALIZATION: "/localization/get";
|
|
72
72
|
};
|
|
73
73
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/web-component.js
CHANGED
|
@@ -24114,7 +24114,7 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
24114
24114
|
GET_ORG_SIZES: '/common/orgsizing-list',
|
|
24115
24115
|
GET_INDUSTRIES: '/common/industry-list',
|
|
24116
24116
|
GET_PARTNER: '/partner/get',
|
|
24117
|
-
|
|
24117
|
+
GET_PARTNER_BY_GUID: '/partner/get-by-guid',
|
|
24118
24118
|
GET_LOCALIZATION: '/localization/get',
|
|
24119
24119
|
};
|
|
24120
24120
|
|
|
@@ -24308,10 +24308,10 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
24308
24308
|
* Get partner by name
|
|
24309
24309
|
* Extracts name from the baseUrl automatically and cleans it
|
|
24310
24310
|
*/
|
|
24311
|
-
async
|
|
24311
|
+
async getPartnerByGuid(partnerGuid) {
|
|
24312
24312
|
try {
|
|
24313
|
-
const response = await axios$1.get(this.getUrl(API_ENDPOINTS.
|
|
24314
|
-
params: {
|
|
24313
|
+
const response = await axios$1.get(this.getUrl(API_ENDPOINTS.GET_PARTNER_BY_GUID), {
|
|
24314
|
+
params: { guid: partnerGuid },
|
|
24315
24315
|
});
|
|
24316
24316
|
if (response.data.isSuccess) {
|
|
24317
24317
|
return response.data.data;
|
|
@@ -48580,7 +48580,15 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
48580
48580
|
typeof option?.key === "string" || name == exports.FormModel.CompanySize || name == exports.FormModel.OrgIndustryId
|
|
48581
48581
|
? onChange(option?.key)
|
|
48582
48582
|
: onChange(option?.text);
|
|
48583
|
-
}, onBlur: onBlur, errorMessage: error && error.message
|
|
48583
|
+
}, onBlur: onBlur, errorMessage: error && error.message, styles: error
|
|
48584
|
+
? {
|
|
48585
|
+
...props.styles,
|
|
48586
|
+
title: {
|
|
48587
|
+
...(props.styles?.title),
|
|
48588
|
+
border: "solid 1px #a4262c",
|
|
48589
|
+
},
|
|
48590
|
+
}
|
|
48591
|
+
: props.styles })) }));
|
|
48584
48592
|
};
|
|
48585
48593
|
|
|
48586
48594
|
const ControlledCombobox = ({ name, control, rules, defaultValue, options, ...props }) => {
|
|
@@ -48589,7 +48597,21 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
48589
48597
|
typeof option?.key === "string"
|
|
48590
48598
|
? onChange(option.key)
|
|
48591
48599
|
: onChange(option?.text);
|
|
48592
|
-
}, onBlur: onBlur, errorMessage: error && error.message, defaultValue: undefined, allowFreeInput: true, autoComplete: "on"
|
|
48600
|
+
}, onBlur: onBlur, errorMessage: error && error.message, defaultValue: undefined, allowFreeInput: true, autoComplete: "on", styles: error
|
|
48601
|
+
? {
|
|
48602
|
+
...props.styles,
|
|
48603
|
+
root: {
|
|
48604
|
+
...(props.styles?.root),
|
|
48605
|
+
selectors: {
|
|
48606
|
+
...(props.styles?.root?.selectors),
|
|
48607
|
+
":after": {
|
|
48608
|
+
...(props.styles?.root?.selectors?.[":after"]),
|
|
48609
|
+
border: "solid 1px #a4262c",
|
|
48610
|
+
},
|
|
48611
|
+
},
|
|
48612
|
+
},
|
|
48613
|
+
}
|
|
48614
|
+
: props.styles }));
|
|
48593
48615
|
} }));
|
|
48594
48616
|
};
|
|
48595
48617
|
|
|
@@ -48701,13 +48723,13 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
48701
48723
|
};
|
|
48702
48724
|
});
|
|
48703
48725
|
};
|
|
48704
|
-
const renderByType = (component,
|
|
48726
|
+
const renderByType = (component, key) => {
|
|
48705
48727
|
const isValidating = validatingFields[component.name] || false;
|
|
48706
48728
|
switch (component.type) {
|
|
48707
48729
|
case exports.FormType.Text:
|
|
48708
|
-
return (React.createElement(ControlledTextField, { name: component.name, control: control, rules: component.rules, label: component.label, placeholder: component.placeholder, required: component.rules?.required, disabled: isRegistering, styles: textFieldStyles(config.theme?.fonts), key:
|
|
48730
|
+
return (React.createElement(ControlledTextField, { name: component.name, control: control, rules: component.rules, label: component.label, placeholder: component.placeholder, required: component.rules?.required, disabled: isRegistering, styles: textFieldStyles(config.theme?.fonts), key: key }));
|
|
48709
48731
|
case exports.FormType.AsyncText:
|
|
48710
|
-
return (React.createElement("div", { key:
|
|
48732
|
+
return (React.createElement("div", { key: key },
|
|
48711
48733
|
React.createElement(ControlledTextFieldAsync, { label: component.label, placeholder: component.placeholder, control: control, setValue: setValue, setError: setError, clearErrors: clearErrors, name: component.name, styles: textFieldStyles(config.theme?.fonts), trigger: trigger, setIsValidating: setFieldValidating(component.name), translation: translation, config: config, apiService: apiService, rules: {
|
|
48712
48734
|
required: translation.EmailError,
|
|
48713
48735
|
}, required: component.rules?.required, description: !(component.name in errors) && !isValidating
|
|
@@ -48724,16 +48746,16 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
48724
48746
|
},
|
|
48725
48747
|
} }))));
|
|
48726
48748
|
case exports.FormType.Dropdown:
|
|
48727
|
-
return (React.createElement(ControlledDropdown, { key:
|
|
48749
|
+
return (React.createElement(ControlledDropdown, { key: key, required: component.rules?.required !== undefined, options: getDropdownOptions(component.name), label: component.label, rules: component.rules, control: control, name: component.name, placeholder: component.placeholder, disabled: isDropdownDisabled(component.name), className: component.bigColumn ? styles.bigColumn : "", styles: dropdownStyles(config.theme?.fonts) }));
|
|
48728
48750
|
case exports.FormType.ComboBox:
|
|
48729
|
-
return (React.createElement(ControlledCombobox, { key:
|
|
48751
|
+
return (React.createElement(ControlledCombobox, { key: key, options: countryOptions || [], label: component.label, control: control, rules: component.rules, name: component.name, placeholder: component.placeholder, required: component.rules?.required !== "", disabled: isRegistering, autoComplete: "off", styles: comboboxStyles(config.theme?.fonts) }));
|
|
48730
48752
|
case exports.FormType.CheckBox:
|
|
48731
|
-
return (React.createElement(ControlledCheckbox, { key:
|
|
48753
|
+
return (React.createElement(ControlledCheckbox, { key: key, name: component.name, label: component.label, rules: component.rules, disabled: isRegistering, control: control, primaryColor: primaryColor, className: styles.checkboxIsSharedMail }));
|
|
48732
48754
|
default:
|
|
48733
48755
|
return null;
|
|
48734
48756
|
}
|
|
48735
48757
|
};
|
|
48736
|
-
return (React.createElement(React.Fragment, null, renderList.map((component
|
|
48758
|
+
return (React.createElement(React.Fragment, null, renderList.map((component) => renderByType(component, component.name))));
|
|
48737
48759
|
};
|
|
48738
48760
|
|
|
48739
48761
|
/**
|
|
@@ -49577,7 +49599,7 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
49577
49599
|
if (noIcon)
|
|
49578
49600
|
return reactExports.createElement(PrimaryButton, { ...buttonProps, styles: modifiedStyles });
|
|
49579
49601
|
return (!iconProps) ?
|
|
49580
|
-
reactExports.createElement(PrimaryButton, { ...buttonProps, styles: modifiedStyles, menuIconProps: { iconName: icon },
|
|
49602
|
+
reactExports.createElement(PrimaryButton, { ...buttonProps, styles: modifiedStyles, menuIconProps: { iconName: icon }, onRenderIcon: () => loadingIcon ? renderSpinner() : null }) :
|
|
49581
49603
|
reactExports.createElement(PrimaryButton, { ...buttonProps, styles: modifiedStyles, iconProps: { iconName: icon }, disabled: loadingIcon, onRenderIcon: () => loadingIcon ? renderSpinner() : null });
|
|
49582
49604
|
};
|
|
49583
49605
|
|
|
@@ -49587,9 +49609,13 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
49587
49609
|
const [privacyAcceptance, setPrivacyAcceptance] = reactExports.useState(false);
|
|
49588
49610
|
const primaryColor = primaryColorProp || DEFAULT_PRIMARY_COLOR;
|
|
49589
49611
|
const recaptchaSiteKey = RECAPTCHA_DEFAULT_SITE_KEY;
|
|
49590
|
-
const termsUrl =
|
|
49591
|
-
|
|
49592
|
-
|
|
49612
|
+
const termsUrl = partnerData
|
|
49613
|
+
? `https://${partnerData.domain}/terms-and-conditions`
|
|
49614
|
+
: "";
|
|
49615
|
+
const rawPrivacyUrl = translation.PrivacyStatementLink;
|
|
49616
|
+
const privacyUrl = rawPrivacyUrl && !/^https?:\/\//.test(rawPrivacyUrl) && partnerData
|
|
49617
|
+
? `https://${partnerData.domain}${rawPrivacyUrl}`
|
|
49618
|
+
: rawPrivacyUrl;
|
|
49593
49619
|
const onChangeTermCheckbox = (ev, checked) => {
|
|
49594
49620
|
if (checked) {
|
|
49595
49621
|
setTermAcceptance(true);
|
|
@@ -49645,11 +49671,11 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
49645
49671
|
React.createElement("span", null, submissionError))),
|
|
49646
49672
|
React.createElement(SSASPrimaryButton, { text: translation.SubmitRequest, primaryColor: primaryColor, styles: {
|
|
49647
49673
|
root: { display: "block", width: "100%" },
|
|
49648
|
-
}, type: "submit", disabled:
|
|
49649
|
-
|
|
49650
|
-
termAcceptance
|
|
49651
|
-
privacyAcceptance
|
|
49652
|
-
captcha
|
|
49674
|
+
}, type: "submit", disabled: Object.keys(errors).length > 0 ||
|
|
49675
|
+
isRegistering ||
|
|
49676
|
+
!termAcceptance ||
|
|
49677
|
+
!privacyAcceptance ||
|
|
49678
|
+
!captcha, onRenderMenuIcon: renderLoadingIcon })));
|
|
49653
49679
|
};
|
|
49654
49680
|
|
|
49655
49681
|
const SettingKeys = {
|
|
@@ -49668,7 +49694,7 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
49668
49694
|
const mergedConfig = useFormConfig(config);
|
|
49669
49695
|
// Stable service used only for partner lookup (works with relative URLs)
|
|
49670
49696
|
const initCheckUrl = mergedConfig.apiBaseUrl || "https://portal.selfserviceassessment.com";
|
|
49671
|
-
const partnerApiService = reactExports.useMemo(() => new ApiService(initCheckUrl), []);
|
|
49697
|
+
const partnerApiService = reactExports.useMemo(() => new ApiService(initCheckUrl), [initCheckUrl]);
|
|
49672
49698
|
// Main service uses the partner's own domain once loaded
|
|
49673
49699
|
const apiService = reactExports.useMemo(() => new ApiService(partnerData?.domain ? new URL(`https://${partnerData?.domain}`).toString() : ""), [partnerData?.domain]);
|
|
49674
49700
|
const styles = reactExports.useMemo(() => createFormStyles(mergedConfig.theme?.primaryColor || colorWidget?.column1, mergedConfig.theme?.fonts, mergedConfig.theme?.backgroundColor), [mergedConfig.theme?.primaryColor, mergedConfig.theme?.fonts, mergedConfig.theme?.backgroundColor, colorWidget?.column1]);
|
|
@@ -49727,7 +49753,7 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
49727
49753
|
reactExports.useEffect(() => {
|
|
49728
49754
|
setIsLoadingPartner(true);
|
|
49729
49755
|
partnerApiService
|
|
49730
|
-
.
|
|
49756
|
+
.getPartnerByGuid(mergedConfig.partnerGuid)
|
|
49731
49757
|
.then((partner) => {
|
|
49732
49758
|
partner ? setPartnerData(partner) : setPartnerLoadFailed(true);
|
|
49733
49759
|
})
|
|
@@ -49738,7 +49764,7 @@ var SSASFormWebComponent = (function (exports) {
|
|
|
49738
49764
|
.finally(() => {
|
|
49739
49765
|
setIsLoadingPartner(false);
|
|
49740
49766
|
});
|
|
49741
|
-
}, [mergedConfig.
|
|
49767
|
+
}, [mergedConfig.partnerGuid, partnerApiService]);
|
|
49742
49768
|
// Step 2: Load remaining data once partnerData is available
|
|
49743
49769
|
reactExports.useEffect(() => {
|
|
49744
49770
|
if (!partnerData)
|